/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./node_modules/apexcharts/dist/apexcharts.common.js":
/*!***********************************************************!*\
  !*** ./node_modules/apexcharts/dist/apexcharts.common.js ***!
  \***********************************************************/
/***/ ((module, exports, __webpack_require__) => {

"use strict";
eval("var __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * ApexCharts v3.35.1\n * (c) 2018-2022 ApexCharts\n * Released under the MIT License.\n */\nfunction t(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,a)}return i}function e(e){for(var i=1;i<arguments.length;i++){var a=null!=arguments[i]?arguments[i]:{};i%2?t(Object(a),!0).forEach((function(t){o(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function i(t){return(i=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}function a(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function s(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,\"value\"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function r(t,e,i){return e&&s(t.prototype,e),i&&s(t,i),t}function o(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function n(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t,e){if(e&&(\"object\"==typeof e||\"function\"==typeof e))return e;if(void 0!==e)throw new TypeError(\"Derived constructors may only return object or undefined\");return function(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}(t)}function d(t){var e=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,a=l(t);if(e){var s=l(this).constructor;i=Reflect.construct(a,arguments,s)}else i=a.apply(this,arguments);return c(this,i)}}function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:\"undefined\"!=typeof Symbol&&t[Symbol.iterator]||t[\"@@iterator\"];if(null==i)return;var a,s,r=[],o=!0,n=!1;try{for(i=i.call(t);!(o=(a=i.next()).done)&&(r.push(a.value),!e||r.length!==e);o=!0);}catch(t){n=!0,s=t}finally{try{o||null==i.return||i.return()}finally{if(n)throw s}}return r}(t,e)||f(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function u(t){return function(t){if(Array.isArray(t))return p(t)}(t)||function(t){if(\"undefined\"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t[\"@@iterator\"])return Array.from(t)}(t)||f(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function f(t,e){if(t){if(\"string\"==typeof t)return p(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return\"Object\"===i&&t.constructor&&(i=t.constructor.name),\"Map\"===i||\"Set\"===i?Array.from(t):\"Arguments\"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?p(t,e):void 0}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i<e;i++)a[i]=t[i];return a}var x=function(){function t(){a(this,t)}return r(t,[{key:\"shadeRGBColor\",value:function(t,e){var i=e.split(\",\"),a=t<0?0:255,s=t<0?-1*t:t,r=parseInt(i[0].slice(4),10),o=parseInt(i[1],10),n=parseInt(i[2],10);return\"rgb(\"+(Math.round((a-r)*s)+r)+\",\"+(Math.round((a-o)*s)+o)+\",\"+(Math.round((a-n)*s)+n)+\")\"}},{key:\"shadeHexColor\",value:function(t,e){var i=parseInt(e.slice(1),16),a=t<0?0:255,s=t<0?-1*t:t,r=i>>16,o=i>>8&255,n=255&i;return\"#\"+(16777216+65536*(Math.round((a-r)*s)+r)+256*(Math.round((a-o)*s)+o)+(Math.round((a-n)*s)+n)).toString(16).slice(1)}},{key:\"shadeColor\",value:function(e,i){return t.isColorHex(i)?this.shadeHexColor(e,i):this.shadeRGBColor(e,i)}}],[{key:\"bind\",value:function(t,e){return function(){return t.apply(e,arguments)}}},{key:\"isObject\",value:function(t){return t&&\"object\"===i(t)&&!Array.isArray(t)&&null!=t}},{key:\"is\",value:function(t,e){return Object.prototype.toString.call(e)===\"[object \"+t+\"]\"}},{key:\"listToArray\",value:function(t){var e,i=[];for(e=0;e<t.length;e++)i[e]=t[e];return i}},{key:\"extend\",value:function(t,e){var i=this;\"function\"!=typeof Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError(\"Cannot convert undefined or null to object\");for(var e=Object(t),i=1;i<arguments.length;i++){var a=arguments[i];if(null!=a)for(var s in a)a.hasOwnProperty(s)&&(e[s]=a[s])}return e});var a=Object.assign({},t);return this.isObject(t)&&this.isObject(e)&&Object.keys(e).forEach((function(s){i.isObject(e[s])&&s in t?a[s]=i.extend(t[s],e[s]):Object.assign(a,o({},s,e[s]))})),a}},{key:\"extendArray\",value:function(e,i){var a=[];return e.map((function(e){a.push(t.extend(i,e))})),e=a}},{key:\"monthMod\",value:function(t){return t%12}},{key:\"clone\",value:function(e){if(t.is(\"Array\",e)){for(var a=[],s=0;s<e.length;s++)a[s]=this.clone(e[s]);return a}if(t.is(\"Null\",e))return null;if(t.is(\"Date\",e))return e;if(\"object\"===i(e)){var r={};for(var o in e)e.hasOwnProperty(o)&&(r[o]=this.clone(e[o]));return r}return e}},{key:\"log10\",value:function(t){return Math.log(t)/Math.LN10}},{key:\"roundToBase10\",value:function(t){return Math.pow(10,Math.floor(Math.log10(t)))}},{key:\"roundToBase\",value:function(t,e){return Math.pow(e,Math.floor(Math.log(t)/Math.log(e)))}},{key:\"parseNumber\",value:function(t){return null===t?t:parseFloat(t)}},{key:\"randomId\",value:function(){return(Math.random()+1).toString(36).substring(4)}},{key:\"noExponents\",value:function(t){var e=String(t).split(/[eE]/);if(1===e.length)return e[0];var i=\"\",a=t<0?\"-\":\"\",s=e[0].replace(\".\",\"\"),r=Number(e[1])+1;if(r<0){for(i=a+\"0.\";r++;)i+=\"0\";return i+s.replace(/^-/,\"\")}for(r-=s.length;r--;)i+=\"0\";return s+i}},{key:\"getDimensions\",value:function(t){var e=getComputedStyle(t,null),i=t.clientHeight,a=t.clientWidth;return i-=parseFloat(e.paddingTop)+parseFloat(e.paddingBottom),[a-=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight),i]}},{key:\"getBoundingClientRect\",value:function(t){var e=t.getBoundingClientRect();return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:t.clientWidth,height:t.clientHeight,x:e.left,y:e.top}}},{key:\"getLargestStringFromArr\",value:function(t){return t.reduce((function(t,e){return Array.isArray(e)&&(e=e.reduce((function(t,e){return t.length>e.length?t:e}))),t.length>e.length?t:e}),0)}},{key:\"hexToRgba\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"#999999\",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.6;\"#\"!==t.substring(0,1)&&(t=\"#999999\");var i=t.replace(\"#\",\"\");i=i.match(new RegExp(\"(.{\"+i.length/3+\"})\",\"g\"));for(var a=0;a<i.length;a++)i[a]=parseInt(1===i[a].length?i[a]+i[a]:i[a],16);return void 0!==e&&i.push(e),\"rgba(\"+i.join(\",\")+\")\"}},{key:\"getOpacityFromRGBA\",value:function(t){return parseFloat(t.replace(/^.*,(.+)\\)/,\"$1\"))}},{key:\"rgb2hex\",value:function(t){return(t=t.match(/^rgba?[\\s+]?\\([\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?/i))&&4===t.length?\"#\"+(\"0\"+parseInt(t[1],10).toString(16)).slice(-2)+(\"0\"+parseInt(t[2],10).toString(16)).slice(-2)+(\"0\"+parseInt(t[3],10).toString(16)).slice(-2):\"\"}},{key:\"isColorHex\",value:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(t)}},{key:\"getPolygonPos\",value:function(t,e){for(var i=[],a=2*Math.PI/e,s=0;s<e;s++){var r={};r.x=t*Math.sin(s*a),r.y=-t*Math.cos(s*a),i.push(r)}return i}},{key:\"polarToCartesian\",value:function(t,e,i,a){var s=(a-90)*Math.PI/180;return{x:t+i*Math.cos(s),y:e+i*Math.sin(s)}}},{key:\"escapeString\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"x\",i=t.toString().slice();return i=i.replace(/[` ~!@#$%^&*()_|+\\-=?;:'\",.<>{}[\\]\\\\/]/gi,e)}},{key:\"negToZero\",value:function(t){return t<0?0:t}},{key:\"moveIndexInArray\",value:function(t,e,i){if(i>=t.length)for(var a=i-t.length+1;a--;)t.push(void 0);return t.splice(i,0,t.splice(e,1)[0]),t}},{key:\"extractNumber\",value:function(t){return parseFloat(t.replace(/[^\\d.]*/g,\"\"))}},{key:\"findAncestor\",value:function(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}},{key:\"setELstyles\",value:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t.style.key=e[i])}},{key:\"isNumber\",value:function(t){return!isNaN(t)&&parseFloat(Number(t))===t&&!isNaN(parseInt(t,10))}},{key:\"isFloat\",value:function(t){return Number(t)===t&&t%1!=0}},{key:\"isSafari\",value:function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}},{key:\"isFirefox\",value:function(){return navigator.userAgent.toLowerCase().indexOf(\"firefox\")>-1}},{key:\"isIE11\",value:function(){if(-1!==window.navigator.userAgent.indexOf(\"MSIE\")||window.navigator.appVersion.indexOf(\"Trident/\")>-1)return!0}},{key:\"isIE\",value:function(){var t=window.navigator.userAgent,e=t.indexOf(\"MSIE \");if(e>0)return parseInt(t.substring(e+5,t.indexOf(\".\",e)),10);if(t.indexOf(\"Trident/\")>0){var i=t.indexOf(\"rv:\");return parseInt(t.substring(i+3,t.indexOf(\".\",i)),10)}var a=t.indexOf(\"Edge/\");return a>0&&parseInt(t.substring(a+5,t.indexOf(\".\",a)),10)}}]),t}(),b=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w,this.setEasingFunctions()}return r(t,[{key:\"setEasingFunctions\",value:function(){var t;if(!this.w.globals.easing){switch(this.w.config.chart.animations.easing){case\"linear\":t=\"-\";break;case\"easein\":t=\"<\";break;case\"easeout\":t=\">\";break;case\"easeinout\":t=\"<>\";break;case\"swing\":t=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1};break;case\"bounce\":t=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375};break;case\"elastic\":t=function(t){return t===!!t?t:Math.pow(2,-10*t)*Math.sin((t-.075)*(2*Math.PI)/.3)+1};break;default:t=\"<>\"}this.w.globals.easing=t}}},{key:\"animateLine\",value:function(t,e,i,a){t.attr(e).animate(a).attr(i)}},{key:\"animateMarker\",value:function(t,e,i,a,s,r){e||(e=0),t.attr({r:e,width:e,height:e}).animate(a,s).attr({r:i,width:i.width,height:i.height}).afterAll((function(){r()}))}},{key:\"animateCircle\",value:function(t,e,i,a,s){t.attr({r:e.r,cx:e.cx,cy:e.cy}).animate(a,s).attr({r:i.r,cx:i.cx,cy:i.cy})}},{key:\"animateRect\",value:function(t,e,i,a,s){t.attr(e).animate(a).attr(i).afterAll((function(){return s()}))}},{key:\"animatePathsGradually\",value:function(t){var e=t.el,i=t.realIndex,a=t.j,s=t.fill,r=t.pathFrom,o=t.pathTo,n=t.speed,l=t.delay,h=this.w,c=0;h.config.chart.animations.animateGradually.enabled&&(c=h.config.chart.animations.animateGradually.delay),h.config.chart.animations.dynamicAnimation.enabled&&h.globals.dataChanged&&\"bar\"!==h.config.chart.type&&(c=0),this.morphSVG(e,i,a,\"line\"!==h.config.chart.type||h.globals.comboCharts?s:\"stroke\",r,o,n,l*c)}},{key:\"showDelayedElements\",value:function(){this.w.globals.delayedElements.forEach((function(t){t.el.classList.remove(\"apexcharts-element-hidden\")}))}},{key:\"animationCompleted\",value:function(t){var e=this.w;e.globals.animationEnded||(e.globals.animationEnded=!0,this.showDelayedElements(),\"function\"==typeof e.config.chart.events.animationEnd&&e.config.chart.events.animationEnd(this.ctx,{el:t,w:e}))}},{key:\"morphSVG\",value:function(t,e,i,a,s,r,o,n){var l=this,h=this.w;s||(s=t.attr(\"pathFrom\")),r||(r=t.attr(\"pathTo\"));var c=function(t){return\"radar\"===h.config.chart.type&&(o=1),\"M 0 \".concat(h.globals.gridHeight)};(!s||s.indexOf(\"undefined\")>-1||s.indexOf(\"NaN\")>-1)&&(s=c()),(!r||r.indexOf(\"undefined\")>-1||r.indexOf(\"NaN\")>-1)&&(r=c()),h.globals.shouldAnimate||(o=1),t.plot(s).animate(1,h.globals.easing,n).plot(s).animate(o,h.globals.easing,n).plot(r).afterAll((function(){x.isNumber(i)?i===h.globals.series[h.globals.maxValsInArrayIndex].length-2&&h.globals.shouldAnimate&&l.animationCompleted(t):\"none\"!==a&&h.globals.shouldAnimate&&(!h.globals.comboCharts&&e===h.globals.series.length-1||h.globals.comboCharts)&&l.animationCompleted(t),l.showDelayedElements()}))}}]),t}(),v=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"getDefaultFilter\",value:function(t,e){var i=this.w;t.unfilter(!0),(new window.SVG.Filter).size(\"120%\",\"180%\",\"-5%\",\"-40%\"),\"none\"!==i.config.states.normal.filter?this.applyFilter(t,e,i.config.states.normal.filter.type,i.config.states.normal.filter.value):i.config.chart.dropShadow.enabled&&this.dropShadow(t,i.config.chart.dropShadow,e)}},{key:\"addNormalFilter\",value:function(t,e){var i=this.w;i.config.chart.dropShadow.enabled&&!t.node.classList.contains(\"apexcharts-marker\")&&this.dropShadow(t,i.config.chart.dropShadow,e)}},{key:\"addLightenFilter\",value:function(t,e,i){var a=this,s=this.w,r=i.intensity;t.unfilter(!0);new window.SVG.Filter;t.filter((function(t){var i=s.config.chart.dropShadow;(i.enabled?a.addShadow(t,e,i):t).componentTransfer({rgb:{type:\"linear\",slope:1.5,intercept:r}})})),t.filterer.node.setAttribute(\"filterUnits\",\"userSpaceOnUse\"),this._scaleFilterSize(t.filterer.node)}},{key:\"addDarkenFilter\",value:function(t,e,i){var a=this,s=this.w,r=i.intensity;t.unfilter(!0);new window.SVG.Filter;t.filter((function(t){var i=s.config.chart.dropShadow;(i.enabled?a.addShadow(t,e,i):t).componentTransfer({rgb:{type:\"linear\",slope:r}})})),t.filterer.node.setAttribute(\"filterUnits\",\"userSpaceOnUse\"),this._scaleFilterSize(t.filterer.node)}},{key:\"applyFilter\",value:function(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;switch(i){case\"none\":this.addNormalFilter(t,e);break;case\"lighten\":this.addLightenFilter(t,e,{intensity:a});break;case\"darken\":this.addDarkenFilter(t,e,{intensity:a})}}},{key:\"addShadow\",value:function(t,e,i){var a=i.blur,s=i.top,r=i.left,o=i.color,n=i.opacity,l=t.flood(Array.isArray(o)?o[e]:o,n).composite(t.sourceAlpha,\"in\").offset(r,s).gaussianBlur(a).merge(t.source);return t.blend(t.source,l)}},{key:\"dropShadow\",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=e.top,s=e.left,r=e.blur,o=e.color,n=e.opacity,l=e.noUserSpaceOnUse,h=this.w;return t.unfilter(!0),x.isIE()&&\"radialBar\"===h.config.chart.type||(o=Array.isArray(o)?o[i]:o,t.filter((function(t){var e=null;e=x.isSafari()||x.isFirefox()||x.isIE()?t.flood(o,n).composite(t.sourceAlpha,\"in\").offset(s,a).gaussianBlur(r):t.flood(o,n).composite(t.sourceAlpha,\"in\").offset(s,a).gaussianBlur(r).merge(t.source),t.blend(t.source,e)})),l||t.filterer.node.setAttribute(\"filterUnits\",\"userSpaceOnUse\"),this._scaleFilterSize(t.filterer.node)),t}},{key:\"setSelectionFilter\",value:function(t,e,i){var a=this.w;if(void 0!==a.globals.selectedDataPoints[e]&&a.globals.selectedDataPoints[e].indexOf(i)>-1){t.node.setAttribute(\"selected\",!0);var s=a.config.states.active.filter;\"none\"!==s&&this.applyFilter(t,e,s.type,s.value)}}},{key:\"_scaleFilterSize\",value:function(t){!function(e){for(var i in e)e.hasOwnProperty(i)&&t.setAttribute(i,e[i])}({width:\"200%\",height:\"200%\",x:\"-50%\",y:\"-50%\"})}}]),t}(),m=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"drawLine\",value:function(t,e,i,a){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:\"#a8a8a8\",r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,n=arguments.length>7&&void 0!==arguments[7]?arguments[7]:\"butt\",l=this.w,h=l.globals.dom.Paper.line().attr({x1:t,y1:e,x2:i,y2:a,stroke:s,\"stroke-dasharray\":r,\"stroke-width\":o,\"stroke-linecap\":n});return h}},{key:\"drawRect\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:\"#fefefe\",o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,n=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,c=this.w,d=c.globals.dom.Paper.rect();return d.attr({x:t,y:e,width:i>0?i:0,height:a>0?a:0,rx:s,ry:s,opacity:o,\"stroke-width\":null!==n?n:0,stroke:null!==l?l:\"none\",\"stroke-dasharray\":h}),d.node.setAttribute(\"fill\",r),d}},{key:\"drawPolygon\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"#e1e1e1\",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:\"none\",s=this.w,r=s.globals.dom.Paper.polygon(t).attr({fill:a,stroke:e,\"stroke-width\":i});return r}},{key:\"drawCircle\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.w;t<0&&(t=0);var a=i.globals.dom.Paper.circle(2*t);return null!==e&&a.attr(e),a}},{key:\"drawPath\",value:function(t){var e=t.d,i=void 0===e?\"\":e,a=t.stroke,s=void 0===a?\"#a8a8a8\":a,r=t.strokeWidth,o=void 0===r?1:r,n=t.fill,l=t.fillOpacity,h=void 0===l?1:l,c=t.strokeOpacity,d=void 0===c?1:c,g=t.classes,u=t.strokeLinecap,f=void 0===u?null:u,p=t.strokeDashArray,x=void 0===p?0:p,b=this.w;return null===f&&(f=b.config.stroke.lineCap),(i.indexOf(\"undefined\")>-1||i.indexOf(\"NaN\")>-1)&&(i=\"M 0 \".concat(b.globals.gridHeight)),b.globals.dom.Paper.path(i).attr({fill:n,\"fill-opacity\":h,stroke:s,\"stroke-opacity\":d,\"stroke-linecap\":f,\"stroke-width\":o,\"stroke-dasharray\":x,class:g})}},{key:\"group\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.w,i=e.globals.dom.Paper.group();return null!==t&&i.attr(t),i}},{key:\"move\",value:function(t,e){var i=[\"M\",t,e].join(\" \");return i}},{key:\"line\",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=null;return null===i?a=[\"L\",t,e].join(\" \"):\"H\"===i?a=[\"H\",t].join(\" \"):\"V\"===i&&(a=[\"V\",e].join(\" \")),a}},{key:\"curve\",value:function(t,e,i,a,s,r){var o=[\"C\",t,e,i,a,s,r].join(\" \");return o}},{key:\"quadraticCurve\",value:function(t,e,i,a){return[\"Q\",t,e,i,a].join(\" \")}},{key:\"arc\",value:function(t,e,i,a,s,r,o){var n=arguments.length>7&&void 0!==arguments[7]&&arguments[7],l=\"A\";n&&(l=\"a\");var h=[l,t,e,i,a,s,r,o].join(\" \");return h}},{key:\"renderPaths\",value:function(t){var i,a=t.j,s=t.realIndex,r=t.pathFrom,o=t.pathTo,n=t.stroke,l=t.strokeWidth,h=t.strokeLinecap,c=t.fill,d=t.animationDelay,g=t.initialSpeed,u=t.dataChangeSpeed,f=t.className,p=t.shouldClipToGrid,x=void 0===p||p,m=t.bindEventsOnPaths,y=void 0===m||m,w=t.drawShadow,k=void 0===w||w,A=this.w,S=new v(this.ctx),C=new b(this.ctx),L=this.w.config.chart.animations.enabled,P=L&&this.w.config.chart.animations.dynamicAnimation.enabled,M=!!(L&&!A.globals.resized||P&&A.globals.dataChanged&&A.globals.shouldAnimate);M?i=r:(i=o,A.globals.animationEnded=!0);var T=A.config.stroke.dashArray,I=0;I=Array.isArray(T)?T[s]:A.config.stroke.dashArray;var z=this.drawPath({d:i,stroke:n,strokeWidth:l,fill:c,fillOpacity:1,classes:f,strokeLinecap:h,strokeDashArray:I});if(z.attr(\"index\",s),x&&z.attr({\"clip-path\":\"url(#gridRectMask\".concat(A.globals.cuid,\")\")}),\"none\"!==A.config.states.normal.filter.type)S.getDefaultFilter(z,s);else if(A.config.chart.dropShadow.enabled&&k&&(!A.config.chart.dropShadow.enabledOnSeries||A.config.chart.dropShadow.enabledOnSeries&&-1!==A.config.chart.dropShadow.enabledOnSeries.indexOf(s))){var X=A.config.chart.dropShadow;S.dropShadow(z,X,s)}y&&(z.node.addEventListener(\"mouseenter\",this.pathMouseEnter.bind(this,z)),z.node.addEventListener(\"mouseleave\",this.pathMouseLeave.bind(this,z)),z.node.addEventListener(\"mousedown\",this.pathMouseDown.bind(this,z))),z.attr({pathTo:o,pathFrom:r});var E={el:z,j:a,realIndex:s,pathFrom:r,pathTo:o,fill:c,strokeWidth:l,delay:d};return!L||A.globals.resized||A.globals.dataChanged?!A.globals.resized&&A.globals.dataChanged||C.showDelayedElements():C.animatePathsGradually(e(e({},E),{},{speed:g})),A.globals.dataChanged&&P&&M&&C.animatePathsGradually(e(e({},E),{},{speed:u})),z}},{key:\"drawPattern\",value:function(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:\"#a8a8a8\",s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=this.w,o=r.globals.dom.Paper.pattern(e,i,(function(r){\"horizontalLines\"===t?r.line(0,0,i,0).stroke({color:a,width:s+1}):\"verticalLines\"===t?r.line(0,0,0,e).stroke({color:a,width:s+1}):\"slantedLines\"===t?r.line(0,0,e,i).stroke({color:a,width:s}):\"squares\"===t?r.rect(e,i).fill(\"none\").stroke({color:a,width:s}):\"circles\"===t&&r.circle(e).fill(\"none\").stroke({color:a,width:s})}));return o}},{key:\"drawGradient\",value:function(t,e,i,a,s){var r,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,n=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=this.w;e.length<9&&0===e.indexOf(\"#\")&&(e=x.hexToRgba(e,a)),i.length<9&&0===i.indexOf(\"#\")&&(i=x.hexToRgba(i,s));var d=0,g=1,u=1,f=null;null!==n&&(d=void 0!==n[0]?n[0]/100:0,g=void 0!==n[1]?n[1]/100:1,u=void 0!==n[2]?n[2]/100:1,f=void 0!==n[3]?n[3]/100:null);var p=!(\"donut\"!==c.config.chart.type&&\"pie\"!==c.config.chart.type&&\"polarArea\"!==c.config.chart.type&&\"bubble\"!==c.config.chart.type);if(r=null===l||0===l.length?c.globals.dom.Paper.gradient(p?\"radial\":\"linear\",(function(t){t.at(d,e,a),t.at(g,i,s),t.at(u,i,s),null!==f&&t.at(f,e,a)})):c.globals.dom.Paper.gradient(p?\"radial\":\"linear\",(function(t){(Array.isArray(l[h])?l[h]:l).forEach((function(e){t.at(e.offset/100,e.color,e.opacity)}))})),p){var b=c.globals.gridWidth/2,v=c.globals.gridHeight/2;\"bubble\"!==c.config.chart.type?r.attr({gradientUnits:\"userSpaceOnUse\",cx:b,cy:v,r:o}):r.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}else\"vertical\"===t?r.from(0,0).to(0,1):\"diagonal\"===t?r.from(0,0).to(1,1):\"horizontal\"===t?r.from(0,1).to(1,1):\"diagonal2\"===t&&r.from(1,0).to(0,1);return r}},{key:\"getTextBasedOnMaxWidth\",value:function(t){var e=t.text,i=t.maxWidth,a=t.fontSize,s=t.fontFamily,r=this.getTextRects(e,a,s),o=r.width/e.length,n=Math.floor(i/o);return i<r.width?e.slice(0,n-3)+\"...\":e}},{key:\"drawText\",value:function(t){var i=this,a=t.x,s=t.y,r=t.text,o=t.textAnchor,n=t.fontSize,l=t.fontFamily,h=t.fontWeight,c=t.foreColor,d=t.opacity,g=t.maxWidth,u=t.cssClass,f=void 0===u?\"\":u,p=t.isPlainText,x=void 0===p||p,b=this.w;void 0===r&&(r=\"\");var v=r;o||(o=\"start\"),c&&c.length||(c=b.config.chart.foreColor),l=l||b.config.chart.fontFamily,h=h||\"regular\";var m,y={maxWidth:g,fontSize:n=n||\"11px\",fontFamily:l};return Array.isArray(r)?m=b.globals.dom.Paper.text((function(t){for(var a=0;a<r.length;a++)g&&(v=i.getTextBasedOnMaxWidth(e({text:r[a]},y))),0===a?t.tspan(v):t.tspan(v).newLine()})):(g&&(v=this.getTextBasedOnMaxWidth(e({text:r},y))),m=x?b.globals.dom.Paper.plain(r):b.globals.dom.Paper.text((function(t){return t.tspan(v)}))),m.attr({x:a,y:s,\"text-anchor\":o,\"dominant-baseline\":\"auto\",\"font-size\":n,\"font-family\":l,\"font-weight\":h,fill:c,class:\"apexcharts-text \"+f}),m.node.style.fontFamily=l,m.node.style.opacity=d,m}},{key:\"drawMarker\",value:function(t,e,i){t=t||0;var a=i.pSize||0,s=null;if(\"square\"===i.shape||\"rect\"===i.shape){var r=void 0===i.pRadius?a/2:i.pRadius;null!==e&&a||(a=0,r=0);var o=1.2*a+r,n=this.drawRect(o,o,o,o,r);n.attr({x:t-o/2,y:e-o/2,cx:t,cy:e,class:i.class?i.class:\"\",fill:i.pointFillColor,\"fill-opacity\":i.pointFillOpacity?i.pointFillOpacity:1,stroke:i.pointStrokeColor,\"stroke-width\":i.pointStrokeWidth?i.pointStrokeWidth:0,\"stroke-opacity\":i.pointStrokeOpacity?i.pointStrokeOpacity:1}),s=n}else\"circle\"!==i.shape&&i.shape||(x.isNumber(e)||(a=0,e=0),s=this.drawCircle(a,{cx:t,cy:e,class:i.class?i.class:\"\",stroke:i.pointStrokeColor,fill:i.pointFillColor,\"fill-opacity\":i.pointFillOpacity?i.pointFillOpacity:1,\"stroke-width\":i.pointStrokeWidth?i.pointStrokeWidth:0,\"stroke-opacity\":i.pointStrokeOpacity?i.pointStrokeOpacity:1}));return s}},{key:\"pathMouseEnter\",value:function(t,e){var i=this.w,a=new v(this.ctx),s=parseInt(t.node.getAttribute(\"index\"),10),r=parseInt(t.node.getAttribute(\"j\"),10);if(\"function\"==typeof i.config.chart.events.dataPointMouseEnter&&i.config.chart.events.dataPointMouseEnter(e,this.ctx,{seriesIndex:s,dataPointIndex:r,w:i}),this.ctx.events.fireEvent(\"dataPointMouseEnter\",[e,this.ctx,{seriesIndex:s,dataPointIndex:r,w:i}]),(\"none\"===i.config.states.active.filter.type||\"true\"!==t.node.getAttribute(\"selected\"))&&\"none\"!==i.config.states.hover.filter.type&&!i.globals.isTouchDevice){var o=i.config.states.hover.filter;a.applyFilter(t,s,o.type,o.value)}}},{key:\"pathMouseLeave\",value:function(t,e){var i=this.w,a=new v(this.ctx),s=parseInt(t.node.getAttribute(\"index\"),10),r=parseInt(t.node.getAttribute(\"j\"),10);\"function\"==typeof i.config.chart.events.dataPointMouseLeave&&i.config.chart.events.dataPointMouseLeave(e,this.ctx,{seriesIndex:s,dataPointIndex:r,w:i}),this.ctx.events.fireEvent(\"dataPointMouseLeave\",[e,this.ctx,{seriesIndex:s,dataPointIndex:r,w:i}]),\"none\"!==i.config.states.active.filter.type&&\"true\"===t.node.getAttribute(\"selected\")||\"none\"!==i.config.states.hover.filter.type&&a.getDefaultFilter(t,s)}},{key:\"pathMouseDown\",value:function(t,e){var i=this.w,a=new v(this.ctx),s=parseInt(t.node.getAttribute(\"index\"),10),r=parseInt(t.node.getAttribute(\"j\"),10),o=\"false\";if(\"true\"===t.node.getAttribute(\"selected\")){if(t.node.setAttribute(\"selected\",\"false\"),i.globals.selectedDataPoints[s].indexOf(r)>-1){var n=i.globals.selectedDataPoints[s].indexOf(r);i.globals.selectedDataPoints[s].splice(n,1)}}else{if(!i.config.states.active.allowMultipleDataPointsSelection&&i.globals.selectedDataPoints.length>0){i.globals.selectedDataPoints=[];var l=i.globals.dom.Paper.select(\".apexcharts-series path\").members,h=i.globals.dom.Paper.select(\".apexcharts-series circle, .apexcharts-series rect\").members,c=function(t){Array.prototype.forEach.call(t,(function(t){t.node.setAttribute(\"selected\",\"false\"),a.getDefaultFilter(t,s)}))};c(l),c(h)}t.node.setAttribute(\"selected\",\"true\"),o=\"true\",void 0===i.globals.selectedDataPoints[s]&&(i.globals.selectedDataPoints[s]=[]),i.globals.selectedDataPoints[s].push(r)}if(\"true\"===o){var d=i.config.states.active.filter;if(\"none\"!==d)a.applyFilter(t,s,d.type,d.value);else if(\"none\"!==i.config.states.hover.filter&&!i.globals.isTouchDevice){var g=i.config.states.hover.filter;a.applyFilter(t,s,g.type,g.value)}}else if(\"none\"!==i.config.states.active.filter.type)if(\"none\"===i.config.states.hover.filter.type||i.globals.isTouchDevice)a.getDefaultFilter(t,s);else{g=i.config.states.hover.filter;a.applyFilter(t,s,g.type,g.value)}\"function\"==typeof i.config.chart.events.dataPointSelection&&i.config.chart.events.dataPointSelection(e,this.ctx,{selectedDataPoints:i.globals.selectedDataPoints,seriesIndex:s,dataPointIndex:r,w:i}),e&&this.ctx.events.fireEvent(\"dataPointSelection\",[e,this.ctx,{selectedDataPoints:i.globals.selectedDataPoints,seriesIndex:s,dataPointIndex:r,w:i}])}},{key:\"rotateAroundCenter\",value:function(t){var e={};return t&&\"function\"==typeof t.getBBox&&(e=t.getBBox()),{x:e.x+e.width/2,y:e.y+e.height/2}}},{key:\"getTextRects\",value:function(t,e,i,a){var s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=this.w,o=this.drawText({x:-200,y:-200,text:t,textAnchor:\"start\",fontSize:e,fontFamily:i,foreColor:\"#fff\",opacity:0});a&&o.attr(\"transform\",a),r.globals.dom.Paper.add(o);var n=o.bbox();return s||(n=o.node.getBoundingClientRect()),o.remove(),{width:n.width,height:n.height}}},{key:\"placeTextWithEllipsis\",value:function(t,e,i){if(\"function\"==typeof t.getComputedTextLength&&(t.textContent=e,e.length>0&&t.getComputedTextLength()>=i/1.1)){for(var a=e.length-3;a>0;a-=3)if(t.getSubStringLength(0,a)<=i/1.1)return void(t.textContent=e.substring(0,a)+\"...\");t.textContent=\".\"}}}],[{key:\"setAttrs\",value:function(t,e){for(var i in e)e.hasOwnProperty(i)&&t.setAttribute(i,e[i])}}]),t}(),y=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"getStackedSeriesTotals\",value:function(){var t=this.w,e=[];if(0===t.globals.series.length)return e;for(var i=0;i<t.globals.series[t.globals.maxValsInArrayIndex].length;i++){for(var a=0,s=0;s<t.globals.series.length;s++)void 0!==t.globals.series[s][i]&&(a+=t.globals.series[s][i]);e.push(a)}return t.globals.stackedSeriesTotals=e,e}},{key:\"getSeriesTotalByIndex\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null===t?this.w.config.series.reduce((function(t,e){return t+e}),0):this.w.globals.series[t].reduce((function(t,e){return t+e}),0)}},{key:\"isSeriesNull\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return 0===(null===t?this.w.config.series.filter((function(t){return null!==t})):this.w.config.series[t].data.filter((function(t){return null!==t}))).length}},{key:\"seriesHaveSameValues\",value:function(t){return this.w.globals.series[t].every((function(t,e,i){return t===i[0]}))}},{key:\"getCategoryLabels\",value:function(t){var e=this.w,i=t.slice();return e.config.xaxis.convertedCatToNumeric&&(i=t.map((function(t,i){return e.config.xaxis.labels.formatter(t-e.globals.minX+1)}))),i}},{key:\"getLargestSeries\",value:function(){var t=this.w;t.globals.maxValsInArrayIndex=t.globals.series.map((function(t){return t.length})).indexOf(Math.max.apply(Math,t.globals.series.map((function(t){return t.length}))))}},{key:\"getLargestMarkerSize\",value:function(){var t=this.w,e=0;return t.globals.markers.size.forEach((function(t){e=Math.max(e,t)})),t.config.markers.discrete&&t.config.markers.discrete.length&&t.config.markers.discrete.forEach((function(t){e=Math.max(e,t.size)})),e>0&&(e+=t.config.markers.hover.sizeOffset+1),t.globals.markers.largestSize=e,e}},{key:\"getSeriesTotals\",value:function(){var t=this.w;t.globals.seriesTotals=t.globals.series.map((function(t,e){var i=0;if(Array.isArray(t))for(var a=0;a<t.length;a++)i+=t[a];else i+=t;return i}))}},{key:\"getSeriesTotalsXRange\",value:function(t,e){var i=this.w;return i.globals.series.map((function(a,s){for(var r=0,o=0;o<a.length;o++)i.globals.seriesX[s][o]>t&&i.globals.seriesX[s][o]<e&&(r+=a[o]);return r}))}},{key:\"getPercentSeries\",value:function(){var t=this.w;t.globals.seriesPercent=t.globals.series.map((function(e,i){var a=[];if(Array.isArray(e))for(var s=0;s<e.length;s++){var r=t.globals.stackedSeriesTotals[s],o=0;r&&(o=100*e[s]/r),a.push(o)}else{var n=100*e/t.globals.seriesTotals.reduce((function(t,e){return t+e}),0);a.push(n)}return a}))}},{key:\"getCalculatedRatios\",value:function(){var t,e,i,a,s=this.w.globals,r=[],o=0,n=[],l=.1,h=0;if(s.yRange=[],s.isMultipleYAxis)for(var c=0;c<s.minYArr.length;c++)s.yRange.push(Math.abs(s.minYArr[c]-s.maxYArr[c])),n.push(0);else s.yRange.push(Math.abs(s.minY-s.maxY));s.xRange=Math.abs(s.maxX-s.minX),s.zRange=Math.abs(s.maxZ-s.minZ);for(var d=0;d<s.yRange.length;d++)r.push(s.yRange[d]/s.gridHeight);if(e=s.xRange/s.gridWidth,i=Math.abs(s.initialMaxX-s.initialMinX)/s.gridWidth,t=s.yRange/s.gridWidth,a=s.xRange/s.gridHeight,(o=s.zRange/s.gridHeight*16)||(o=1),s.minY!==Number.MIN_VALUE&&0!==Math.abs(s.minY)&&(s.hasNegs=!0),s.isMultipleYAxis){n=[];for(var g=0;g<r.length;g++)n.push(-s.minYArr[g]/r[g])}else n.push(-s.minY/r[0]),s.minY!==Number.MIN_VALUE&&0!==Math.abs(s.minY)&&(l=-s.minY/t,h=s.minX/e);return{yRatio:r,invertedYRatio:t,zRatio:o,xRatio:e,initialXRatio:i,invertedXRatio:a,baseLineInvertedY:l,baseLineY:n,baseLineX:h}}},{key:\"getLogSeries\",value:function(t){var e=this,i=this.w;return i.globals.seriesLog=t.map((function(t,a){return i.config.yaxis[a]&&i.config.yaxis[a].logarithmic?t.map((function(t){return null===t?null:e.getLogVal(i.config.yaxis[a].logBase,t,a)})):t})),i.globals.invalidLogScale?t:i.globals.seriesLog}},{key:\"getBaseLog\",value:function(t,e){return Math.log(e)/Math.log(t)}},{key:\"getLogVal\",value:function(t,e,i){if(0===e)return 0;var a=this.w,s=0===a.globals.minYArr[i]?-1:this.getBaseLog(t,a.globals.minYArr[i]),r=(0===a.globals.maxYArr[i]?0:this.getBaseLog(t,a.globals.maxYArr[i]))-s;return e<1?e/r:(this.getBaseLog(t,e)-s)/r}},{key:\"getLogYRatios\",value:function(t){var e=this,i=this.w,a=this.w.globals;return a.yLogRatio=t.slice(),a.logYRange=a.yRange.map((function(t,s){if(i.config.yaxis[s]&&e.w.config.yaxis[s].logarithmic){var r,o=-Number.MAX_VALUE,n=Number.MIN_VALUE;return a.seriesLog.forEach((function(t,e){t.forEach((function(t){i.config.yaxis[e]&&i.config.yaxis[e].logarithmic&&(o=Math.max(t,o),n=Math.min(t,n))}))})),r=Math.pow(a.yRange[s],Math.abs(n-o)/a.yRange[s]),a.yLogRatio[s]=r/a.gridHeight,r}})),a.invalidLogScale?t.slice():a.yLogRatio}}],[{key:\"checkComboSeries\",value:function(t){var e=!1,i=0,a=0;return t.length&&void 0!==t[0].type&&t.forEach((function(t){\"bar\"!==t.type&&\"column\"!==t.type&&\"candlestick\"!==t.type&&\"boxPlot\"!==t.type||i++,void 0!==t.type&&a++})),a>0&&(e=!0),{comboBarCount:i,comboCharts:e}}},{key:\"extendArrayProps\",value:function(t,e,i){return e.yaxis&&(e=t.extendYAxis(e,i)),e.annotations&&(e.annotations.yaxis&&(e=t.extendYAxisAnnotations(e)),e.annotations.xaxis&&(e=t.extendXAxisAnnotations(e)),e.annotations.points&&(e=t.extendPointAnnotations(e))),e}}]),t}(),w=function(){function t(e){a(this,t),this.w=e.w,this.annoCtx=e}return r(t,[{key:\"setOrientations\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.w;if(\"vertical\"===t.label.orientation){var a=null!==e?e:0,s=i.globals.dom.baseEl.querySelector(\".apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='\".concat(a,\"']\"));if(null!==s){var r=s.getBoundingClientRect();s.setAttribute(\"x\",parseFloat(s.getAttribute(\"x\"))-r.height+4),\"top\"===t.label.position?s.setAttribute(\"y\",parseFloat(s.getAttribute(\"y\"))+r.width):s.setAttribute(\"y\",parseFloat(s.getAttribute(\"y\"))-r.width);var o=this.annoCtx.graphics.rotateAroundCenter(s),n=o.x,l=o.y;s.setAttribute(\"transform\",\"rotate(-90 \".concat(n,\" \").concat(l,\")\"))}}}},{key:\"addBackgroundToAnno\",value:function(t,e){var i=this.w;if(!t||void 0===e.label.text||void 0!==e.label.text&&!String(e.label.text).trim())return null;var a=i.globals.dom.baseEl.querySelector(\".apexcharts-grid\").getBoundingClientRect(),s=t.getBoundingClientRect(),r=e.label.style.padding.left,o=e.label.style.padding.right,n=e.label.style.padding.top,l=e.label.style.padding.bottom;\"vertical\"===e.label.orientation&&(n=e.label.style.padding.left,l=e.label.style.padding.right,r=e.label.style.padding.top,o=e.label.style.padding.bottom);var h=s.left-a.left-r,c=s.top-a.top-n,d=this.annoCtx.graphics.drawRect(h-i.globals.barPadForNumericAxis,c,s.width+r+o,s.height+n+l,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&d.node.classList.add(e.id),d}},{key:\"annotationsBackground\",value:function(){var t=this,e=this.w,i=function(i,a,s){var r=e.globals.dom.baseEl.querySelector(\".apexcharts-\".concat(s,\"-annotations .apexcharts-\").concat(s,\"-annotation-label[rel='\").concat(a,\"']\"));if(r){var o=r.parentNode,n=t.addBackgroundToAnno(r,i);n&&(o.insertBefore(n.node,r),i.label.mouseEnter&&n.node.addEventListener(\"mouseenter\",i.label.mouseEnter.bind(t,i)),i.label.mouseLeave&&n.node.addEventListener(\"mouseleave\",i.label.mouseLeave.bind(t,i)))}};e.config.annotations.xaxis.map((function(t,e){i(t,e,\"xaxis\")})),e.config.annotations.yaxis.map((function(t,e){i(t,e,\"yaxis\")})),e.config.annotations.points.map((function(t,e){i(t,e,\"point\")}))}},{key:\"getY1Y2\",value:function(t,e){var i,a=\"y1\"===t?e.y:e.y2,s=this.w;if(this.annoCtx.invertAxis){var r=s.globals.labels.indexOf(a);s.config.xaxis.convertedCatToNumeric&&(r=s.globals.categoryLabels.indexOf(a));var o=s.globals.dom.baseEl.querySelector(\".apexcharts-yaxis-texts-g text:nth-child(\"+(r+1)+\")\");o&&(i=parseFloat(o.getAttribute(\"y\")))}else{var n;if(s.config.yaxis[e.yAxisIndex].logarithmic)n=(a=new y(this.annoCtx.ctx).getLogVal(a,e.yAxisIndex))/s.globals.yLogRatio[e.yAxisIndex];else n=(a-s.globals.minYArr[e.yAxisIndex])/(s.globals.yRange[e.yAxisIndex]/s.globals.gridHeight);i=s.globals.gridHeight-n,s.config.yaxis[e.yAxisIndex]&&s.config.yaxis[e.yAxisIndex].reversed&&(i=n)}return i}},{key:\"getX1X2\",value:function(t,e){var i=this.w,a=this.annoCtx.invertAxis?i.globals.minY:i.globals.minX,s=this.annoCtx.invertAxis?i.globals.maxY:i.globals.maxX,r=this.annoCtx.invertAxis?i.globals.yRange[0]:i.globals.xRange,o=(e.x-a)/(r/i.globals.gridWidth);this.annoCtx.inversedReversedAxis&&(o=(s-e.x)/(r/i.globals.gridWidth)),\"category\"!==i.config.xaxis.type&&!i.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||i.globals.dataFormatXNumeric||(o=this.getStringX(e.x));var n=(e.x2-a)/(r/i.globals.gridWidth);return this.annoCtx.inversedReversedAxis&&(n=(s-e.x2)/(r/i.globals.gridWidth)),\"category\"!==i.config.xaxis.type&&!i.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||i.globals.dataFormatXNumeric||(n=this.getStringX(e.x2)),\"x1\"===t?o:n}},{key:\"getStringX\",value:function(t){var e=this.w,i=t;e.config.xaxis.convertedCatToNumeric&&e.globals.categoryLabels.length&&(t=e.globals.categoryLabels.indexOf(t)+1);var a=e.globals.labels.indexOf(t),s=e.globals.dom.baseEl.querySelector(\".apexcharts-xaxis-texts-g text:nth-child(\"+(a+1)+\")\");return s&&(i=parseFloat(s.getAttribute(\"x\"))),i}}]),t}(),k=function(){function t(e){a(this,t),this.w=e.w,this.annoCtx=e,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new w(this.annoCtx)}return r(t,[{key:\"addXaxisAnnotation\",value:function(t,e,i){var a,s=this.w,r=this.helpers.getX1X2(\"x1\",t),o=t.label.text,n=t.strokeDashArray;if(x.isNumber(r)){if(null===t.x2||void 0===t.x2){var l=this.annoCtx.graphics.drawLine(r+t.offsetX,0+t.offsetY,r+t.offsetX,s.globals.gridHeight+t.offsetY,t.borderColor,n,t.borderWidth);e.appendChild(l.node),t.id&&l.node.classList.add(t.id)}else{if((a=this.helpers.getX1X2(\"x2\",t))<r){var h=r;r=a,a=h}var c=this.annoCtx.graphics.drawRect(r+t.offsetX,0+t.offsetY,a-r,s.globals.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,n);c.node.classList.add(\"apexcharts-annotation-rect\"),c.attr(\"clip-path\",\"url(#gridRectMask\".concat(s.globals.cuid,\")\")),e.appendChild(c.node),t.id&&c.node.classList.add(t.id)}var d=\"top\"===t.label.position?4:s.globals.gridHeight,g=this.annoCtx.graphics.getTextRects(o,parseFloat(t.label.style.fontSize)),u=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:d+t.label.offsetY-(\"vertical\"===t.label.orientation?\"top\"===t.label.position?g.width/2-12:-g.width/2:0),text:o,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:\"apexcharts-xaxis-annotation-label \".concat(t.label.style.cssClass,\" \").concat(t.id?t.id:\"\")});u.attr({rel:i}),e.appendChild(u.node),this.annoCtx.helpers.setOrientations(t,i)}}},{key:\"drawXAxisAnnotations\",value:function(){var t=this,e=this.w,i=this.annoCtx.graphics.group({class:\"apexcharts-xaxis-annotations\"});return e.config.annotations.xaxis.map((function(e,a){t.addXaxisAnnotation(e,i.node,a)})),i}}]),t}(),A=function(){function t(e){a(this,t),this.w=e.w,this.annoCtx=e,this.helpers=new w(this.annoCtx)}return r(t,[{key:\"addYaxisAnnotation\",value:function(t,e,i){var a,s=this.w,r=t.strokeDashArray,o=this.helpers.getY1Y2(\"y1\",t),n=t.label.text;if(null===t.y2||void 0===t.y2){var l=this.annoCtx.graphics.drawLine(0+t.offsetX,o+t.offsetY,this._getYAxisAnnotationWidth(t),o+t.offsetY,t.borderColor,r,t.borderWidth);e.appendChild(l.node),t.id&&l.node.classList.add(t.id)}else{if((a=this.helpers.getY1Y2(\"y2\",t))>o){var h=o;o=a,a=h}var c=this.annoCtx.graphics.drawRect(0+t.offsetX,a+t.offsetY,this._getYAxisAnnotationWidth(t),o-a,0,t.fillColor,t.opacity,1,t.borderColor,r);c.node.classList.add(\"apexcharts-annotation-rect\"),c.attr(\"clip-path\",\"url(#gridRectMask\".concat(s.globals.cuid,\")\")),e.appendChild(c.node),t.id&&c.node.classList.add(t.id)}var d=\"right\"===t.label.position?s.globals.gridWidth:0,g=this.annoCtx.graphics.drawText({x:d+t.label.offsetX,y:(null!=a?a:o)+t.label.offsetY-3,text:n,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:\"apexcharts-yaxis-annotation-label \".concat(t.label.style.cssClass,\" \").concat(t.id?t.id:\"\")});g.attr({rel:i}),e.appendChild(g.node)}},{key:\"_getYAxisAnnotationWidth\",value:function(t){var e=this.w;e.globals.gridWidth;return(t.width.indexOf(\"%\")>-1?e.globals.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10))+t.offsetX}},{key:\"drawYAxisAnnotations\",value:function(){var t=this,e=this.w,i=this.annoCtx.graphics.group({class:\"apexcharts-yaxis-annotations\"});return e.config.annotations.yaxis.map((function(e,a){t.addYaxisAnnotation(e,i.node,a)})),i}}]),t}(),S=function(){function t(e){a(this,t),this.w=e.w,this.annoCtx=e,this.helpers=new w(this.annoCtx)}return r(t,[{key:\"addPointAnnotation\",value:function(t,e,i){this.w;var a=this.helpers.getX1X2(\"x1\",t),s=this.helpers.getY1Y2(\"y1\",t);if(x.isNumber(a)){var r={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:\"apexcharts-point-annotation-marker \".concat(t.marker.cssClass,\" \").concat(t.id?t.id:\"\")},o=this.annoCtx.graphics.drawMarker(a+t.marker.offsetX,s+t.marker.offsetY,r);e.appendChild(o.node);var n=t.label.text?t.label.text:\"\",l=this.annoCtx.graphics.drawText({x:a+t.label.offsetX,y:s+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:n,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:\"apexcharts-point-annotation-label \".concat(t.label.style.cssClass,\" \").concat(t.id?t.id:\"\")});if(l.attr({rel:i}),e.appendChild(l.node),t.customSVG.SVG){var h=this.annoCtx.graphics.group({class:\"apexcharts-point-annotations-custom-svg \"+t.customSVG.cssClass});h.attr({transform:\"translate(\".concat(a+t.customSVG.offsetX,\", \").concat(s+t.customSVG.offsetY,\")\")}),h.node.innerHTML=t.customSVG.SVG,e.appendChild(h.node)}if(t.image.path){var c=t.image.width?t.image.width:20,d=t.image.height?t.image.height:20;o=this.annoCtx.addImage({x:a+t.image.offsetX-c/2,y:s+t.image.offsetY-d/2,width:c,height:d,path:t.image.path,appendTo:\".apexcharts-point-annotations\"})}t.mouseEnter&&o.node.addEventListener(\"mouseenter\",t.mouseEnter.bind(this,t)),t.mouseLeave&&o.node.addEventListener(\"mouseleave\",t.mouseLeave.bind(this,t))}}},{key:\"drawPointAnnotations\",value:function(){var t=this,e=this.w,i=this.annoCtx.graphics.group({class:\"apexcharts-point-annotations\"});return e.config.annotations.points.map((function(e,a){t.addPointAnnotation(e,i.node,a)})),i}}]),t}();var C={name:\"en\",options:{months:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],shortMonths:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],days:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],shortDays:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],toolbar:{exportToSVG:\"Download SVG\",exportToPNG:\"Download PNG\",exportToCSV:\"Download CSV\",menu:\"Menu\",selection:\"Selection\",selectionZoom:\"Selection Zoom\",zoomIn:\"Zoom In\",zoomOut:\"Zoom Out\",pan:\"Panning\",reset:\"Reset Zoom\"}}},L=function(){function t(){a(this,t),this.yAxis={show:!0,showAlways:!1,showForNullSeries:!0,seriesName:void 0,opposite:!1,reversed:!1,logarithmic:!1,logBase:10,tickAmount:void 0,forceNiceScale:!1,max:void 0,min:void 0,floating:!1,decimalsInFloat:void 0,labels:{show:!0,minWidth:0,maxWidth:160,offsetX:0,offsetY:0,align:void 0,rotate:0,padding:20,style:{colors:[],fontSize:\"11px\",fontWeight:400,fontFamily:void 0,cssClass:\"\"},formatter:void 0},axisBorder:{show:!1,color:\"#e0e0e0\",width:1,offsetX:0,offsetY:0},axisTicks:{show:!1,color:\"#e0e0e0\",width:6,offsetX:0,offsetY:0},title:{text:void 0,rotate:-90,offsetY:0,offsetX:0,style:{color:void 0,fontSize:\"11px\",fontWeight:900,fontFamily:void 0,cssClass:\"\"}},tooltip:{enabled:!1,offsetX:0},crosshairs:{show:!0,position:\"front\",stroke:{color:\"#b6b6b6\",width:1,dashArray:0}}},this.pointAnnotation={id:void 0,x:0,y:null,yAxisIndex:0,seriesIndex:0,mouseEnter:void 0,mouseLeave:void 0,marker:{size:4,fillColor:\"#fff\",strokeWidth:2,strokeColor:\"#333\",shape:\"circle\",offsetX:0,offsetY:0,radius:2,cssClass:\"\"},label:{borderColor:\"#c2c2c2\",borderWidth:1,borderRadius:2,text:void 0,textAnchor:\"middle\",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,style:{background:\"#fff\",color:void 0,fontSize:\"11px\",fontFamily:void 0,fontWeight:400,cssClass:\"\",padding:{left:5,right:5,top:2,bottom:2}}},customSVG:{SVG:void 0,cssClass:void 0,offsetX:0,offsetY:0},image:{path:void 0,width:20,height:20,offsetX:0,offsetY:0}},this.yAxisAnnotation={id:void 0,y:0,y2:null,strokeDashArray:1,fillColor:\"#c2c2c2\",borderColor:\"#c2c2c2\",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,width:\"100%\",yAxisIndex:0,label:{borderColor:\"#c2c2c2\",borderWidth:1,borderRadius:2,text:void 0,textAnchor:\"end\",position:\"right\",offsetX:0,offsetY:-3,mouseEnter:void 0,mouseLeave:void 0,style:{background:\"#fff\",color:void 0,fontSize:\"11px\",fontFamily:void 0,fontWeight:400,cssClass:\"\",padding:{left:5,right:5,top:2,bottom:2}}}},this.xAxisAnnotation={id:void 0,x:0,x2:null,strokeDashArray:1,fillColor:\"#c2c2c2\",borderColor:\"#c2c2c2\",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,label:{borderColor:\"#c2c2c2\",borderWidth:1,borderRadius:2,text:void 0,textAnchor:\"middle\",orientation:\"vertical\",position:\"top\",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,style:{background:\"#fff\",color:void 0,fontSize:\"11px\",fontFamily:void 0,fontWeight:400,cssClass:\"\",padding:{left:5,right:5,top:2,bottom:2}}}},this.text={x:0,y:0,text:\"\",textAnchor:\"start\",foreColor:void 0,fontSize:\"13px\",fontFamily:void 0,fontWeight:400,appendTo:\".apexcharts-annotations\",backgroundColor:\"transparent\",borderColor:\"#c2c2c2\",borderRadius:0,borderWidth:0,paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2}}return r(t,[{key:\"init\",value:function(){return{annotations:{position:\"front\",yaxis:[this.yAxisAnnotation],xaxis:[this.xAxisAnnotation],points:[this.pointAnnotation],texts:[],images:[],shapes:[]},chart:{animations:{enabled:!0,easing:\"easeinout\",speed:800,animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350}},background:\"transparent\",locales:[C],defaultLocale:\"en\",dropShadow:{enabled:!1,enabledOnSeries:void 0,top:2,left:2,blur:4,color:\"#000\",opacity:.35},events:{animationEnd:void 0,beforeMount:void 0,mounted:void 0,updated:void 0,click:void 0,mouseMove:void 0,mouseLeave:void 0,legendClick:void 0,markerClick:void 0,selection:void 0,dataPointSelection:void 0,dataPointMouseEnter:void 0,dataPointMouseLeave:void 0,beforeZoom:void 0,beforeResetZoom:void 0,zoomed:void 0,scrolled:void 0,brushScrolled:void 0},foreColor:\"#373d3f\",fontFamily:\"Helvetica, Arial, sans-serif\",height:\"auto\",parentHeightOffset:15,redrawOnParentResize:!0,redrawOnWindowResize:!0,id:void 0,group:void 0,offsetX:0,offsetY:0,selection:{enabled:!1,type:\"x\",fill:{color:\"#24292e\",opacity:.1},stroke:{width:1,color:\"#24292e\",opacity:.4,dashArray:3},xaxis:{min:void 0,max:void 0},yaxis:{min:void 0,max:void 0}},sparkline:{enabled:!1},brush:{enabled:!1,autoScaleYaxis:!0,target:void 0},stacked:!1,stackType:\"normal\",toolbar:{show:!0,offsetX:0,offsetY:0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0,customIcons:[]},export:{csv:{filename:void 0,columnDelimiter:\",\",headerCategory:\"category\",headerValue:\"value\",dateFormatter:function(t){return new Date(t).toDateString()}},png:{filename:void 0},svg:{filename:void 0}},autoSelected:\"zoom\"},type:\"line\",width:\"100%\",zoom:{enabled:!0,type:\"x\",autoScaleYaxis:!1,zoomedArea:{fill:{color:\"#90CAF9\",opacity:.4},stroke:{color:\"#0D47A1\",opacity:.4,width:1}}}},plotOptions:{area:{fillTo:\"origin\"},bar:{horizontal:!1,columnWidth:\"70%\",barHeight:\"70%\",distributed:!1,borderRadius:0,rangeBarOverlap:!0,rangeBarGroupRows:!1,colors:{ranges:[],backgroundBarColors:[],backgroundBarOpacity:1,backgroundBarRadius:0},dataLabels:{position:\"top\",maxItems:100,hideOverflowingLabels:!0,orientation:\"horizontal\"}},bubble:{minBubbleRadius:void 0,maxBubbleRadius:void 0},candlestick:{colors:{upward:\"#00B746\",downward:\"#EF403C\"},wick:{useFillColor:!0}},boxPlot:{colors:{upper:\"#00E396\",lower:\"#008FFB\"}},heatmap:{radius:2,enableShades:!0,shadeIntensity:.5,reverseNegativeShade:!1,distributed:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},treemap:{enableShades:!0,shadeIntensity:.5,distributed:!1,reverseNegativeShade:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},radialBar:{inverseOrder:!1,startAngle:0,endAngle:360,offsetX:0,offsetY:0,hollow:{margin:5,size:\"50%\",background:\"transparent\",image:void 0,imageWidth:150,imageHeight:150,imageOffsetX:0,imageOffsetY:0,imageClipped:!0,position:\"front\",dropShadow:{enabled:!1,top:0,left:0,blur:3,color:\"#000\",opacity:.5}},track:{show:!0,startAngle:void 0,endAngle:void 0,background:\"#f2f2f2\",strokeWidth:\"97%\",opacity:1,margin:5,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:\"#000\",opacity:.5}},dataLabels:{show:!0,name:{show:!0,fontSize:\"16px\",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:0,formatter:function(t){return t}},value:{show:!0,fontSize:\"14px\",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:16,formatter:function(t){return t+\"%\"}},total:{show:!1,label:\"Total\",fontSize:\"16px\",fontWeight:600,fontFamily:void 0,color:void 0,formatter:function(t){return t.globals.seriesTotals.reduce((function(t,e){return t+e}),0)/t.globals.series.length+\"%\"}}}},pie:{customScale:1,offsetX:0,offsetY:0,startAngle:0,endAngle:360,expandOnClick:!0,dataLabels:{offset:0,minAngleToShowLabel:10},donut:{size:\"65%\",background:\"transparent\",labels:{show:!1,name:{show:!0,fontSize:\"16px\",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:-10,formatter:function(t){return t}},value:{show:!0,fontSize:\"20px\",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:10,formatter:function(t){return t}},total:{show:!1,showAlways:!1,label:\"Total\",fontSize:\"16px\",fontWeight:400,fontFamily:void 0,color:void 0,formatter:function(t){return t.globals.seriesTotals.reduce((function(t,e){return t+e}),0)}}}}},polarArea:{rings:{strokeWidth:1,strokeColor:\"#e8e8e8\"},spokes:{strokeWidth:1,connectorColors:\"#e8e8e8\"}},radar:{size:void 0,offsetX:0,offsetY:0,polygons:{strokeWidth:1,strokeColors:\"#e8e8e8\",connectorColors:\"#e8e8e8\",fill:{colors:void 0}}}},colors:void 0,dataLabels:{enabled:!0,enabledOnSeries:void 0,formatter:function(t){return null!==t?t:\"\"},textAnchor:\"middle\",distributed:!1,offsetX:0,offsetY:0,style:{fontSize:\"12px\",fontFamily:void 0,fontWeight:600,colors:void 0},background:{enabled:!0,foreColor:\"#fff\",borderRadius:2,padding:4,opacity:.9,borderWidth:1,borderColor:\"#fff\",dropShadow:{enabled:!1,top:1,left:1,blur:1,color:\"#000\",opacity:.45}},dropShadow:{enabled:!1,top:1,left:1,blur:1,color:\"#000\",opacity:.45}},fill:{type:\"solid\",colors:void 0,opacity:.85,gradient:{shade:\"dark\",type:\"horizontal\",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]},image:{src:[],width:void 0,height:void 0},pattern:{style:\"squares\",width:6,height:6,strokeWidth:2}},forecastDataPoints:{count:0,fillOpacity:.5,strokeWidth:void 0,dashArray:4},grid:{show:!0,borderColor:\"#e0e0e0\",strokeDashArray:0,position:\"back\",xaxis:{lines:{show:!1}},yaxis:{lines:{show:!0}},row:{colors:void 0,opacity:.5},column:{colors:void 0,opacity:.5},padding:{top:0,right:10,bottom:0,left:12}},labels:[],legend:{show:!0,showForSingleSeries:!1,showForNullSeries:!0,showForZeroSeries:!0,floating:!1,position:\"bottom\",horizontalAlign:\"center\",inverseOrder:!1,fontSize:\"12px\",fontFamily:void 0,fontWeight:400,width:void 0,height:void 0,formatter:void 0,tooltipHoverFormatter:void 0,offsetX:-20,offsetY:4,customLegendItems:[],labels:{colors:void 0,useSeriesColors:!1},markers:{width:12,height:12,strokeWidth:0,fillColors:void 0,strokeColor:\"#fff\",radius:12,customHTML:void 0,offsetX:0,offsetY:0,onClick:void 0},itemMargin:{horizontal:5,vertical:2},onItemClick:{toggleDataSeries:!0},onItemHover:{highlightDataSeries:!0}},markers:{discrete:[],size:0,colors:void 0,strokeColors:\"#fff\",strokeWidth:2,strokeOpacity:.9,strokeDashArray:0,fillOpacity:1,shape:\"circle\",width:8,height:8,radius:2,offsetX:0,offsetY:0,onClick:void 0,onDblClick:void 0,showNullDataPoints:!0,hover:{size:void 0,sizeOffset:3}},noData:{text:void 0,align:\"center\",verticalAlign:\"middle\",offsetX:0,offsetY:0,style:{color:void 0,fontSize:\"14px\",fontFamily:void 0}},responsive:[],series:void 0,states:{normal:{filter:{type:\"none\",value:0}},hover:{filter:{type:\"lighten\",value:.1}},active:{allowMultipleDataPointsSelection:!1,filter:{type:\"darken\",value:.5}}},title:{text:void 0,align:\"left\",margin:5,offsetX:0,offsetY:0,floating:!1,style:{fontSize:\"14px\",fontWeight:900,fontFamily:void 0,color:void 0}},subtitle:{text:void 0,align:\"left\",margin:5,offsetX:0,offsetY:30,floating:!1,style:{fontSize:\"12px\",fontWeight:400,fontFamily:void 0,color:void 0}},stroke:{show:!0,curve:\"smooth\",lineCap:\"butt\",width:2,colors:void 0,dashArray:0,fill:{type:\"solid\",colors:void 0,opacity:.85,gradient:{shade:\"dark\",type:\"horizontal\",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]}}},tooltip:{enabled:!0,enabledOnSeries:void 0,shared:!0,followCursor:!1,intersect:!1,inverseOrder:!1,custom:void 0,fillSeriesColor:!1,theme:\"light\",cssClass:\"\",style:{fontSize:\"12px\",fontFamily:void 0},onDatasetHover:{highlightDataSeries:!1},x:{show:!0,format:\"dd MMM\",formatter:void 0},y:{formatter:void 0,title:{formatter:function(t){return t?t+\": \":\"\"}}},z:{formatter:void 0,title:\"Size: \"},marker:{show:!0,fillColors:void 0},items:{display:\"flex\"},fixed:{enabled:!1,position:\"topRight\",offsetX:0,offsetY:0}},xaxis:{type:\"category\",categories:[],convertedCatToNumeric:!1,offsetX:0,offsetY:0,overwriteCategories:void 0,labels:{show:!0,rotate:-45,rotateAlways:!1,hideOverlappingLabels:!0,trim:!1,minHeight:void 0,maxHeight:120,showDuplicates:!0,style:{colors:[],fontSize:\"12px\",fontWeight:400,fontFamily:void 0,cssClass:\"\"},offsetX:0,offsetY:0,format:void 0,formatter:void 0,datetimeUTC:!0,datetimeFormatter:{year:\"yyyy\",month:\"MMM 'yy\",day:\"dd MMM\",hour:\"HH:mm\",minute:\"HH:mm:ss\",second:\"HH:mm:ss\"}},group:{groups:[],style:{colors:[],fontSize:\"12px\",fontWeight:400,fontFamily:void 0,cssClass:\"\"}},axisBorder:{show:!0,color:\"#e0e0e0\",width:\"100%\",height:1,offsetX:0,offsetY:0},axisTicks:{show:!0,color:\"#e0e0e0\",height:6,offsetX:0,offsetY:0},tickAmount:void 0,tickPlacement:\"on\",min:void 0,max:void 0,range:void 0,floating:!1,decimalsInFloat:void 0,position:\"bottom\",title:{text:void 0,offsetX:0,offsetY:0,style:{color:void 0,fontSize:\"12px\",fontWeight:900,fontFamily:void 0,cssClass:\"\"}},crosshairs:{show:!0,width:1,position:\"back\",opacity:.9,stroke:{color:\"#b6b6b6\",width:1,dashArray:3},fill:{type:\"solid\",color:\"#B1B9C4\",gradient:{colorFrom:\"#D8E3F0\",colorTo:\"#BED1E6\",stops:[0,100],opacityFrom:.4,opacityTo:.5}},dropShadow:{enabled:!1,left:0,top:0,blur:1,opacity:.4}},tooltip:{enabled:!0,offsetY:0,formatter:void 0,style:{fontSize:\"12px\",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:\"light\",palette:\"palette1\",monochrome:{enabled:!1,color:\"#008FFB\",shadeTo:\"light\",shadeIntensity:.65}}}}}]),t}(),P=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w,this.graphics=new m(this.ctx),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new w(this),this.xAxisAnnotations=new k(this),this.yAxisAnnotations=new A(this),this.pointsAnnotations=new S(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.globals.gridWidth/this.w.globals.dataPoints}return r(t,[{key:\"drawAxesAnnotations\",value:function(){var t=this.w;if(t.globals.axisCharts){for(var e=this.yAxisAnnotations.drawYAxisAnnotations(),i=this.xAxisAnnotations.drawXAxisAnnotations(),a=this.pointsAnnotations.drawPointAnnotations(),s=t.config.chart.animations.enabled,r=[e,i,a],o=[i.node,e.node,a.node],n=0;n<3;n++)t.globals.dom.elGraphical.add(r[n]),!s||t.globals.resized||t.globals.dataChanged||\"scatter\"!==t.config.chart.type&&\"bubble\"!==t.config.chart.type&&t.globals.dataPoints>1&&o[n].classList.add(\"apexcharts-element-hidden\"),t.globals.delayedElements.push({el:o[n],index:0});this.helpers.annotationsBackground()}}},{key:\"drawImageAnnos\",value:function(){var t=this;this.w.config.annotations.images.map((function(e,i){t.addImage(e,i)}))}},{key:\"drawTextAnnos\",value:function(){var t=this;this.w.config.annotations.texts.map((function(e,i){t.addText(e,i)}))}},{key:\"addXaxisAnnotation\",value:function(t,e,i){this.xAxisAnnotations.addXaxisAnnotation(t,e,i)}},{key:\"addYaxisAnnotation\",value:function(t,e,i){this.yAxisAnnotations.addYaxisAnnotation(t,e,i)}},{key:\"addPointAnnotation\",value:function(t,e,i){this.pointsAnnotations.addPointAnnotation(t,e,i)}},{key:\"addText\",value:function(t,e){var i=t.x,a=t.y,s=t.text,r=t.textAnchor,o=t.foreColor,n=t.fontSize,l=t.fontFamily,h=t.fontWeight,c=t.cssClass,d=t.backgroundColor,g=t.borderWidth,u=t.strokeDashArray,f=t.borderRadius,p=t.borderColor,x=t.appendTo,b=void 0===x?\".apexcharts-annotations\":x,v=t.paddingLeft,m=void 0===v?4:v,y=t.paddingRight,w=void 0===y?4:y,k=t.paddingBottom,A=void 0===k?2:k,S=t.paddingTop,C=void 0===S?2:S,L=this.w,P=this.graphics.drawText({x:i,y:a,text:s,textAnchor:r||\"start\",fontSize:n||\"12px\",fontWeight:h||\"regular\",fontFamily:l||L.config.chart.fontFamily,foreColor:o||L.config.chart.foreColor,cssClass:c}),M=L.globals.dom.baseEl.querySelector(b);M&&M.appendChild(P.node);var T=P.bbox();if(s){var I=this.graphics.drawRect(T.x-m,T.y-C,T.width+m+w,T.height+A+C,f,d||\"transparent\",1,g,p,u);M.insertBefore(I.node,P.node)}}},{key:\"addImage\",value:function(t,e){var i=this.w,a=t.path,s=t.x,r=void 0===s?0:s,o=t.y,n=void 0===o?0:o,l=t.width,h=void 0===l?20:l,c=t.height,d=void 0===c?20:c,g=t.appendTo,u=void 0===g?\".apexcharts-annotations\":g,f=i.globals.dom.Paper.image(a);f.size(h,d).move(r,n);var p=i.globals.dom.baseEl.querySelector(u);return p&&p.appendChild(f.node),f}},{key:\"addXaxisAnnotationExternal\",value:function(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:\"xaxis\",contextMethod:i.addXaxisAnnotation}),i}},{key:\"addYaxisAnnotationExternal\",value:function(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:\"yaxis\",contextMethod:i.addYaxisAnnotation}),i}},{key:\"addPointAnnotationExternal\",value:function(t,e,i){return void 0===this.invertAxis&&(this.invertAxis=i.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:\"point\",contextMethod:i.addPointAnnotation}),i}},{key:\"addAnnotationExternal\",value:function(t){var e=t.params,i=t.pushToMemory,a=t.context,s=t.type,r=t.contextMethod,o=a,n=o.w,l=n.globals.dom.baseEl.querySelector(\".apexcharts-\".concat(s,\"-annotations\")),h=l.childNodes.length+1,c=new L,d=Object.assign({},\"xaxis\"===s?c.xAxisAnnotation:\"yaxis\"===s?c.yAxisAnnotation:c.pointAnnotation),g=x.extend(d,e);switch(s){case\"xaxis\":this.addXaxisAnnotation(g,l,h);break;case\"yaxis\":this.addYaxisAnnotation(g,l,h);break;case\"point\":this.addPointAnnotation(g,l,h)}var u=n.globals.dom.baseEl.querySelector(\".apexcharts-\".concat(s,\"-annotations .apexcharts-\").concat(s,\"-annotation-label[rel='\").concat(h,\"']\")),f=this.helpers.addBackgroundToAnno(u,g);return f&&l.insertBefore(f.node,u),i&&n.globals.memory.methodsToExec.push({context:o,id:g.id?g.id:x.randomId(),method:r,label:\"addAnnotation\",params:e}),a}},{key:\"clearAnnotations\",value:function(t){var e=t.w,i=e.globals.dom.baseEl.querySelectorAll(\".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations\");e.globals.memory.methodsToExec.map((function(t,i){\"addText\"!==t.label&&\"addAnnotation\"!==t.label||e.globals.memory.methodsToExec.splice(i,1)})),i=x.listToArray(i),Array.prototype.forEach.call(i,(function(t){for(;t.firstChild;)t.removeChild(t.firstChild)}))}},{key:\"removeAnnotation\",value:function(t,e){var i=t.w,a=i.globals.dom.baseEl.querySelectorAll(\".\".concat(e));a&&(i.globals.memory.methodsToExec.map((function(t,a){t.id===e&&i.globals.memory.methodsToExec.splice(a,1)})),Array.prototype.forEach.call(a,(function(t){t.parentElement.removeChild(t)})))}}]),t}(),M=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w,this.opts=null,this.seriesIndex=0}return r(t,[{key:\"clippedImgArea\",value:function(t){var e=this.w,i=e.config,a=parseInt(e.globals.gridWidth,10),s=parseInt(e.globals.gridHeight,10),r=a>s?a:s,o=t.image,n=0,l=0;void 0===t.width&&void 0===t.height?void 0!==i.fill.image.width&&void 0!==i.fill.image.height?(n=i.fill.image.width+1,l=i.fill.image.height):(n=r+1,l=r):(n=t.width,l=t.height);var h=document.createElementNS(e.globals.SVGNS,\"pattern\");m.setAttrs(h,{id:t.patternID,patternUnits:t.patternUnits?t.patternUnits:\"userSpaceOnUse\",width:n+\"px\",height:l+\"px\"});var c=document.createElementNS(e.globals.SVGNS,\"image\");h.appendChild(c),c.setAttributeNS(window.SVG.xlink,\"href\",o),m.setAttrs(c,{x:0,y:0,preserveAspectRatio:\"none\",width:n+\"px\",height:l+\"px\"}),c.style.opacity=t.opacity,e.globals.dom.elDefs.node.appendChild(h)}},{key:\"getSeriesIndex\",value:function(t){var e=this.w;return(\"bar\"===e.config.chart.type||\"rangeBar\"===e.config.chart.type)&&e.config.plotOptions.bar.distributed||\"heatmap\"===e.config.chart.type||\"treemap\"===e.config.chart.type?this.seriesIndex=t.seriesNumber:this.seriesIndex=t.seriesNumber%e.globals.series.length,this.seriesIndex}},{key:\"fillPath\",value:function(t){var e=this.w;this.opts=t;var i,a,s,r=this.w.config;this.seriesIndex=this.getSeriesIndex(t);var o=this.getFillColors()[this.seriesIndex];void 0!==e.globals.seriesColors[this.seriesIndex]&&(o=e.globals.seriesColors[this.seriesIndex]),\"function\"==typeof o&&(o=o({seriesIndex:this.seriesIndex,dataPointIndex:t.dataPointIndex,value:t.value,w:e}));var n=this.getFillType(this.seriesIndex),l=Array.isArray(r.fill.opacity)?r.fill.opacity[this.seriesIndex]:r.fill.opacity;t.color&&(o=t.color);var h=o;if(-1===o.indexOf(\"rgb\")?o.length<9&&(h=x.hexToRgba(o,l)):o.indexOf(\"rgba\")>-1&&(l=x.getOpacityFromRGBA(o)),t.opacity&&(l=t.opacity),\"pattern\"===n&&(a=this.handlePatternFill(a,o,l,h)),\"gradient\"===n&&(s=this.handleGradientFill(o,l,this.seriesIndex)),\"image\"===n){var c=r.fill.image.src,d=t.patternID?t.patternID:\"\";this.clippedImgArea({opacity:l,image:Array.isArray(c)?t.seriesNumber<c.length?c[t.seriesNumber]:c[0]:c,width:t.width?t.width:void 0,height:t.height?t.height:void 0,patternUnits:t.patternUnits,patternID:\"pattern\".concat(e.globals.cuid).concat(t.seriesNumber+1).concat(d)}),i=\"url(#pattern\".concat(e.globals.cuid).concat(t.seriesNumber+1).concat(d,\")\")}else i=\"gradient\"===n?s:\"pattern\"===n?a:h;return t.solid&&(i=h),i}},{key:\"getFillType\",value:function(t){var e=this.w;return Array.isArray(e.config.fill.type)?e.config.fill.type[t]:e.config.fill.type}},{key:\"getFillColors\",value:function(){var t=this.w,e=t.config,i=this.opts,a=[];return t.globals.comboCharts?\"line\"===t.config.series[this.seriesIndex].type?Array.isArray(t.globals.stroke.colors)?a=t.globals.stroke.colors:a.push(t.globals.stroke.colors):Array.isArray(t.globals.fill.colors)?a=t.globals.fill.colors:a.push(t.globals.fill.colors):\"line\"===e.chart.type?Array.isArray(t.globals.stroke.colors)?a=t.globals.stroke.colors:a.push(t.globals.stroke.colors):Array.isArray(t.globals.fill.colors)?a=t.globals.fill.colors:a.push(t.globals.fill.colors),void 0!==i.fillColors&&(a=[],Array.isArray(i.fillColors)?a=i.fillColors.slice():a.push(i.fillColors)),a}},{key:\"handlePatternFill\",value:function(t,e,i,a){var s=this.w.config,r=this.opts,o=new m(this.ctx),n=void 0===s.fill.pattern.strokeWidth?Array.isArray(s.stroke.width)?s.stroke.width[this.seriesIndex]:s.stroke.width:Array.isArray(s.fill.pattern.strokeWidth)?s.fill.pattern.strokeWidth[this.seriesIndex]:s.fill.pattern.strokeWidth,l=e;Array.isArray(s.fill.pattern.style)?t=void 0!==s.fill.pattern.style[r.seriesNumber]?o.drawPattern(s.fill.pattern.style[r.seriesNumber],s.fill.pattern.width,s.fill.pattern.height,l,n,i):a:t=o.drawPattern(s.fill.pattern.style,s.fill.pattern.width,s.fill.pattern.height,l,n,i);return t}},{key:\"handleGradientFill\",value:function(t,e,i){var a,s=this.w.config,r=this.opts,o=new m(this.ctx),n=new x,l=s.fill.gradient.type,h=t,c=void 0===s.fill.gradient.opacityFrom?e:Array.isArray(s.fill.gradient.opacityFrom)?s.fill.gradient.opacityFrom[i]:s.fill.gradient.opacityFrom;h.indexOf(\"rgba\")>-1&&(c=x.getOpacityFromRGBA(h));var d=void 0===s.fill.gradient.opacityTo?e:Array.isArray(s.fill.gradient.opacityTo)?s.fill.gradient.opacityTo[i]:s.fill.gradient.opacityTo;if(void 0===s.fill.gradient.gradientToColors||0===s.fill.gradient.gradientToColors.length)a=\"dark\"===s.fill.gradient.shade?n.shadeColor(-1*parseFloat(s.fill.gradient.shadeIntensity),t.indexOf(\"rgb\")>-1?x.rgb2hex(t):t):n.shadeColor(parseFloat(s.fill.gradient.shadeIntensity),t.indexOf(\"rgb\")>-1?x.rgb2hex(t):t);else if(s.fill.gradient.gradientToColors[r.seriesNumber]){var g=s.fill.gradient.gradientToColors[r.seriesNumber];a=g,g.indexOf(\"rgba\")>-1&&(d=x.getOpacityFromRGBA(g))}else a=t;if(s.fill.gradient.inverseColors){var u=h;h=a,a=u}return h.indexOf(\"rgb\")>-1&&(h=x.rgb2hex(h)),a.indexOf(\"rgb\")>-1&&(a=x.rgb2hex(a)),o.drawGradient(l,h,a,c,d,r.size,s.fill.gradient.stops,s.fill.gradient.colorStops,i)}}]),t}(),T=function(){function t(e,i){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"setGlobalMarkerSize\",value:function(){var t=this.w;if(t.globals.markers.size=Array.isArray(t.config.markers.size)?t.config.markers.size:[t.config.markers.size],t.globals.markers.size.length>0){if(t.globals.markers.size.length<t.globals.series.length+1)for(var e=0;e<=t.globals.series.length;e++)void 0===t.globals.markers.size[e]&&t.globals.markers.size.push(t.globals.markers.size[0])}else t.globals.markers.size=t.config.series.map((function(e){return t.config.markers.size}))}},{key:\"plotChartMarkers\",value:function(t,e,i,a){var s,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=this.w,n=e,l=t,h=null,c=new m(this.ctx),d=o.config.markers.discrete&&o.config.markers.discrete.length;if((o.globals.markers.size[e]>0||r||d)&&(h=c.group({class:r||d?\"\":\"apexcharts-series-markers\"})).attr(\"clip-path\",\"url(#gridRectMarkerMask\".concat(o.globals.cuid,\")\")),Array.isArray(l.x))for(var g=0;g<l.x.length;g++){var u=i;1===i&&0===g&&(u=0),1===i&&1===g&&(u=1);var f=\"apexcharts-marker\";\"line\"!==o.config.chart.type&&\"area\"!==o.config.chart.type||o.globals.comboCharts||o.config.tooltip.intersect||(f+=\" no-pointer-events\");var p=Array.isArray(o.config.markers.size)?o.globals.markers.size[e]>0:o.config.markers.size>0;if(p||r||d){x.isNumber(l.y[g])?f+=\" w\".concat(x.randomId()):f=\"apexcharts-nullpoint\";var b=this.getMarkerConfig({cssClass:f,seriesIndex:e,dataPointIndex:u});o.config.series[n].data[u]&&(o.config.series[n].data[u].fillColor&&(b.pointFillColor=o.config.series[n].data[u].fillColor),o.config.series[n].data[u].strokeColor&&(b.pointStrokeColor=o.config.series[n].data[u].strokeColor)),a&&(b.pSize=a),(s=c.drawMarker(l.x[g],l.y[g],b)).attr(\"rel\",u),s.attr(\"j\",u),s.attr(\"index\",e),s.node.setAttribute(\"default-marker-size\",b.pSize);var y=new v(this.ctx);y.setSelectionFilter(s,e,u),this.addEvents(s),h&&h.add(s)}else void 0===o.globals.pointsArray[e]&&(o.globals.pointsArray[e]=[]),o.globals.pointsArray[e].push([l.x[g],l.y[g]])}return h}},{key:\"getMarkerConfig\",value:function(t){var e=t.cssClass,i=t.seriesIndex,a=t.dataPointIndex,s=void 0===a?null:a,r=t.finishRadius,o=void 0===r?null:r,n=this.w,l=this.getMarkerStyle(i),h=n.globals.markers.size[i],c=n.config.markers;return null!==s&&c.discrete.length&&c.discrete.map((function(t){t.seriesIndex===i&&t.dataPointIndex===s&&(l.pointStrokeColor=t.strokeColor,l.pointFillColor=t.fillColor,h=t.size,l.pointShape=t.shape)})),{pSize:null===o?h:o,pRadius:c.radius,width:Array.isArray(c.width)?c.width[i]:c.width,height:Array.isArray(c.height)?c.height[i]:c.height,pointStrokeWidth:Array.isArray(c.strokeWidth)?c.strokeWidth[i]:c.strokeWidth,pointStrokeColor:l.pointStrokeColor,pointFillColor:l.pointFillColor,shape:l.pointShape||(Array.isArray(c.shape)?c.shape[i]:c.shape),class:e,pointStrokeOpacity:Array.isArray(c.strokeOpacity)?c.strokeOpacity[i]:c.strokeOpacity,pointStrokeDashArray:Array.isArray(c.strokeDashArray)?c.strokeDashArray[i]:c.strokeDashArray,pointFillOpacity:Array.isArray(c.fillOpacity)?c.fillOpacity[i]:c.fillOpacity,seriesIndex:i}}},{key:\"addEvents\",value:function(t){var e=this.w,i=new m(this.ctx);t.node.addEventListener(\"mouseenter\",i.pathMouseEnter.bind(this.ctx,t)),t.node.addEventListener(\"mouseleave\",i.pathMouseLeave.bind(this.ctx,t)),t.node.addEventListener(\"mousedown\",i.pathMouseDown.bind(this.ctx,t)),t.node.addEventListener(\"click\",e.config.markers.onClick),t.node.addEventListener(\"dblclick\",e.config.markers.onDblClick),t.node.addEventListener(\"touchstart\",i.pathMouseDown.bind(this.ctx,t),{passive:!0})}},{key:\"getMarkerStyle\",value:function(t){var e=this.w,i=e.globals.markers.colors,a=e.config.markers.strokeColor||e.config.markers.strokeColors;return{pointStrokeColor:Array.isArray(a)?a[t]:a,pointFillColor:Array.isArray(i)?i[t]:i}}}]),t}(),I=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled}return r(t,[{key:\"draw\",value:function(t,e,i){var a=this.w,s=new m(this.ctx),r=i.realIndex,o=i.pointsPos,n=i.zRatio,l=i.elParent,h=s.group({class:\"apexcharts-series-markers apexcharts-series-\".concat(a.config.chart.type)});if(h.attr(\"clip-path\",\"url(#gridRectMarkerMask\".concat(a.globals.cuid,\")\")),Array.isArray(o.x))for(var c=0;c<o.x.length;c++){var d=e+1,g=!0;0===e&&0===c&&(d=0),0===e&&1===c&&(d=1);var u=0,f=a.globals.markers.size[r];if(n!==1/0){f=a.globals.seriesZ[r][d]/n;var p=a.config.plotOptions.bubble;p.minBubbleRadius&&f<p.minBubbleRadius&&(f=p.minBubbleRadius),p.maxBubbleRadius&&f>p.maxBubbleRadius&&(f=p.maxBubbleRadius)}a.config.chart.animations.enabled||(u=f);var x=o.x[c],b=o.y[c];if(u=u||0,null!==b&&void 0!==a.globals.series[r][d]||(g=!1),g){var v=this.drawPoint(x,b,u,f,r,d,e);h.add(v)}l.add(h)}}},{key:\"drawPoint\",value:function(t,e,i,a,s,r,o){var n=this.w,l=s,h=new b(this.ctx),c=new v(this.ctx),d=new M(this.ctx),g=new T(this.ctx),u=new m(this.ctx),f=g.getMarkerConfig({cssClass:\"apexcharts-marker\",seriesIndex:l,dataPointIndex:r,finishRadius:\"bubble\"===n.config.chart.type||n.globals.comboCharts&&n.config.series[s]&&\"bubble\"===n.config.series[s].type?a:null});a=f.pSize;var p,x=d.fillPath({seriesNumber:s,dataPointIndex:r,color:f.pointFillColor,patternUnits:\"objectBoundingBox\",value:n.globals.series[s][o]});if(\"circle\"===f.shape?p=u.drawCircle(i):\"square\"!==f.shape&&\"rect\"!==f.shape||(p=u.drawRect(0,0,f.width-f.pointStrokeWidth/2,f.height-f.pointStrokeWidth/2,f.pRadius)),n.config.series[l].data[r]&&n.config.series[l].data[r].fillColor&&(x=n.config.series[l].data[r].fillColor),p.attr({x:t-f.width/2-f.pointStrokeWidth/2,y:e-f.height/2-f.pointStrokeWidth/2,cx:t,cy:e,fill:x,\"fill-opacity\":f.pointFillOpacity,stroke:f.pointStrokeColor,r:a,\"stroke-width\":f.pointStrokeWidth,\"stroke-dasharray\":f.pointStrokeDashArray,\"stroke-opacity\":f.pointStrokeOpacity}),n.config.chart.dropShadow.enabled){var y=n.config.chart.dropShadow;c.dropShadow(p,y,s)}if(!this.initialAnim||n.globals.dataChanged||n.globals.resized)n.globals.animationEnded=!0;else{var w=n.config.chart.animations.speed;h.animateMarker(p,0,\"circle\"===f.shape?a:{width:f.width,height:f.height},w,n.globals.easing,(function(){window.setTimeout((function(){h.animationCompleted(p)}),100)}))}if(n.globals.dataChanged&&\"circle\"===f.shape)if(this.dynamicAnim){var k,A,S,C,L=n.config.chart.animations.dynamicAnimation.speed;null!=(C=n.globals.previousPaths[s]&&n.globals.previousPaths[s][o])&&(k=C.x,A=C.y,S=void 0!==C.r?C.r:a);for(var P=0;P<n.globals.collapsedSeries.length;P++)n.globals.collapsedSeries[P].index===s&&(L=1,a=0);0===t&&0===e&&(a=0),h.animateCircle(p,{cx:k,cy:A,r:S},{cx:t,cy:e,r:a},L,n.globals.easing)}else p.attr({r:a});return p.attr({rel:r,j:r,index:s,\"default-marker-size\":a}),c.setSelectionFilter(p,s,r),g.addEvents(p),p.node.classList.add(\"apexcharts-marker\"),p}},{key:\"centerTextInBubble\",value:function(t){var e=this.w;return{y:t+=parseInt(e.config.dataLabels.style.fontSize,10)/4}}}]),t}(),z=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"dataLabelsCorrection\",value:function(t,e,i,a,s,r,o){var n=this.w,l=!1,h=new m(this.ctx).getTextRects(i,o),c=h.width,d=h.height;e<0&&(e=0),e>n.globals.gridHeight+d&&(e=n.globals.gridHeight+d/2),void 0===n.globals.dataLabelsRects[a]&&(n.globals.dataLabelsRects[a]=[]),n.globals.dataLabelsRects[a].push({x:t,y:e,width:c,height:d});var g=n.globals.dataLabelsRects[a].length-2,u=void 0!==n.globals.lastDrawnDataLabelsIndexes[a]?n.globals.lastDrawnDataLabelsIndexes[a][n.globals.lastDrawnDataLabelsIndexes[a].length-1]:0;if(void 0!==n.globals.dataLabelsRects[a][g]){var f=n.globals.dataLabelsRects[a][u];(t>f.x+f.width+2||e>f.y+f.height+2||t+c<f.x)&&(l=!0)}return(0===s||r)&&(l=!0),{x:t,y:e,textRects:h,drawnextLabel:l}}},{key:\"drawDataLabel\",value:function(t,e,i){var a=this,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,r=this.w,o=new m(this.ctx),n=r.config.dataLabels,l=0,h=0,c=i,d=null;if(!n.enabled||!Array.isArray(t.x))return d;d=o.group({class:\"apexcharts-data-labels\"});for(var g=0;g<t.x.length;g++)if(l=t.x[g]+n.offsetX,h=t.y[g]+n.offsetY+s,!isNaN(l)){1===i&&0===g&&(c=0),1===i&&1===g&&(c=1);var u=r.globals.series[e][c],f=\"\",p=function(t){return r.config.dataLabels.formatter(t,{ctx:a.ctx,seriesIndex:e,dataPointIndex:c,w:r})};if(\"bubble\"===r.config.chart.type){f=p(u=r.globals.seriesZ[e][c]),h=t.y[g];var x=new I(this.ctx),b=x.centerTextInBubble(h,e,c);h=b.y}else void 0!==u&&(f=p(u));this.plotDataLabelsText({x:l,y:h,text:f,i:e,j:c,parent:d,offsetCorrection:!0,dataLabelsConfig:r.config.dataLabels})}return d}},{key:\"plotDataLabelsText\",value:function(t){var e=this.w,i=new m(this.ctx),a=t.x,s=t.y,r=t.i,o=t.j,n=t.text,l=t.textAnchor,h=t.fontSize,c=t.parent,d=t.dataLabelsConfig,g=t.color,u=t.alwaysDrawDataLabel,f=t.offsetCorrection;if(!(Array.isArray(e.config.dataLabels.enabledOnSeries)&&e.config.dataLabels.enabledOnSeries.indexOf(r)<0)){var p={x:a,y:s,drawnextLabel:!0,textRects:null};f&&(p=this.dataLabelsCorrection(a,s,n,r,o,u,parseInt(d.style.fontSize,10))),e.globals.zoomed||(a=p.x,s=p.y),p.textRects&&(a<-10-p.textRects.width||a>e.globals.gridWidth+p.textRects.width+10)&&(n=\"\");var x=e.globals.dataLabels.style.colors[r];((\"bar\"===e.config.chart.type||\"rangeBar\"===e.config.chart.type)&&e.config.plotOptions.bar.distributed||e.config.dataLabels.distributed)&&(x=e.globals.dataLabels.style.colors[o]),\"function\"==typeof x&&(x=x({series:e.globals.series,seriesIndex:r,dataPointIndex:o,w:e})),g&&(x=g);var b=d.offsetX,y=d.offsetY;if(\"bar\"!==e.config.chart.type&&\"rangeBar\"!==e.config.chart.type||(b=0,y=0),p.drawnextLabel){var w=i.drawText({width:100,height:parseInt(d.style.fontSize,10),x:a+b,y:s+y,foreColor:x,textAnchor:l||d.textAnchor,text:n,fontSize:h||d.style.fontSize,fontFamily:d.style.fontFamily,fontWeight:d.style.fontWeight||\"normal\"});if(w.attr({class:\"apexcharts-datalabel\",cx:a,cy:s}),d.dropShadow.enabled){var k=d.dropShadow;new v(this.ctx).dropShadow(w,k)}c.add(w),void 0===e.globals.lastDrawnDataLabelsIndexes[r]&&(e.globals.lastDrawnDataLabelsIndexes[r]=[]),e.globals.lastDrawnDataLabelsIndexes[r].push(o)}}}},{key:\"addBackgroundToDataLabel\",value:function(t,e){var i=this.w,a=i.config.dataLabels.background,s=a.padding,r=a.padding/2,o=e.width,n=e.height,l=new m(this.ctx).drawRect(e.x-s,e.y-r/2,o+2*s,n+r,a.borderRadius,\"transparent\"===i.config.chart.background?\"#fff\":i.config.chart.background,a.opacity,a.borderWidth,a.borderColor);a.dropShadow.enabled&&new v(this.ctx).dropShadow(l,a.dropShadow);return l}},{key:\"dataLabelsBackground\",value:function(){var t=this.w;if(\"bubble\"!==t.config.chart.type)for(var e=t.globals.dom.baseEl.querySelectorAll(\".apexcharts-datalabels text\"),i=0;i<e.length;i++){var a=e[i],s=a.getBBox(),r=null;if(s.width&&s.height&&(r=this.addBackgroundToDataLabel(a,s)),r){a.parentNode.insertBefore(r.node,a);var o=a.getAttribute(\"fill\");t.config.chart.animations.enabled&&!t.globals.resized&&!t.globals.dataChanged?r.animate().attr({fill:o}):r.attr({fill:o}),a.setAttribute(\"fill\",t.config.dataLabels.background.foreColor)}}}},{key:\"bringForward\",value:function(){for(var t=this.w,e=t.globals.dom.baseEl.querySelectorAll(\".apexcharts-datalabels\"),i=t.globals.dom.baseEl.querySelector(\".apexcharts-plot-series:last-child\"),a=0;a<e.length;a++)i&&i.insertBefore(e[a],i.nextSibling)}}]),t}(),X=function(){function t(e){a(this,t),this.w=e.w,this.barCtx=e}return r(t,[{key:\"handleBarDataLabels\",value:function(t){var e=t.x,i=t.y,a=t.y1,s=t.y2,r=t.i,o=t.j,n=t.realIndex,l=t.series,h=t.barHeight,c=t.barWidth,d=t.barYPosition,g=t.visibleSeries,u=t.renderedPath,f=this.w,p=new m(this.barCtx.ctx),x=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[n]:this.barCtx.strokeWidth,b=e+parseFloat(c*g),v=i+parseFloat(h*g);f.globals.isXNumeric&&!f.globals.isBarHorizontal&&(b=e+parseFloat(c*(g+1)),v=i+parseFloat(h*(g+1))-x);var y=e,w=i,k={},A=f.config.dataLabels,S=this.barCtx.barOptions.dataLabels;void 0!==d&&this.barCtx.isRangeBar&&(v=d,w=d);var C=A.offsetX,L=A.offsetY,P={width:0,height:0};if(f.config.dataLabels.enabled){var M=this.barCtx.series[r][o];P=p.getTextRects(f.globals.yLabelFormatters[0](M),parseFloat(A.style.fontSize))}var T={x:e,y:i,i:r,j:o,renderedPath:u,bcx:b,bcy:v,barHeight:h,barWidth:c,textRects:P,strokeWidth:x,dataLabelsX:y,dataLabelsY:w,barDataLabelsConfig:S,offX:C,offY:L};return k=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(T):this.calculateColumnsDataLabelsPosition(T),u.attr({cy:k.bcy,cx:k.bcx,j:o,val:l[r][o],barHeight:h,barWidth:c}),this.drawCalculatedDataLabels({x:k.dataLabelsX,y:k.dataLabelsY,val:this.barCtx.isRangeBar?[a,s]:l[r][o],i:n,j:o,barWidth:c,barHeight:h,textRects:P,dataLabelsConfig:A})}},{key:\"calculateColumnsDataLabelsPosition\",value:function(t){var e,i=this.w,a=t.i,s=t.j,r=t.y,o=t.bcx,n=t.barWidth,l=t.barHeight,h=t.textRects,c=t.dataLabelsY,d=t.barDataLabelsConfig,g=t.strokeWidth,u=t.offX,f=t.offY;l=Math.abs(l);var p=\"vertical\"===i.config.plotOptions.bar.dataLabels.orientation;o-=g/2;var x=i.globals.gridWidth/i.globals.dataPoints;if(e=i.globals.isXNumeric?o-n/2+u:o-x+n/2+u,p){e=e+h.height/2-g/2-2}var b=this.barCtx.series[a][s]<0,v=r;switch(this.barCtx.isReversed&&(v=r-l+(b?2*l:0),r-=l),d.position){case\"center\":c=p?b?v+l/2+f:v+l/2-f:b?v-l/2+h.height/2+f:v+l/2+h.height/2-f;break;case\"bottom\":c=p?b?v+l+f:v+l-f:b?v-l+h.height+g+f:v+l-h.height/2+g-f;break;case\"top\":c=p?b?v+f:v-f:b?v-h.height/2-f:v+h.height+f}return i.config.chart.stacked||(c<0?c=0+g:c+h.height/3>i.globals.gridHeight&&(c=i.globals.gridHeight-g)),{bcx:o,bcy:r,dataLabelsX:e,dataLabelsY:c}}},{key:\"calculateBarsDataLabelsPosition\",value:function(t){var e=this.w,i=t.x,a=t.i,s=t.j,r=t.bcy,o=t.barHeight,n=t.barWidth,l=t.textRects,h=t.dataLabelsX,c=t.strokeWidth,d=t.barDataLabelsConfig,g=t.offX,u=t.offY,f=e.globals.gridHeight/e.globals.dataPoints;n=Math.abs(n);var p=r-(this.barCtx.isRangeBar?0:f)+o/2+l.height/2+u-3,x=this.barCtx.series[a][s]<0,b=i;switch(this.barCtx.isReversed&&(b=i+n-(x?2*n:0),i=e.globals.gridWidth-n),d.position){case\"center\":h=x?b+n/2-g:Math.max(l.width/2,b-n/2)+g;break;case\"bottom\":h=x?b+n-c-Math.round(l.width/2)-g:b-n+c+Math.round(l.width/2)+g;break;case\"top\":h=x?b-c+Math.round(l.width/2)-g:b-c-Math.round(l.width/2)+g}return e.config.chart.stacked||(h<0?h=h+l.width+c:h+l.width/2>e.globals.gridWidth&&(h=e.globals.gridWidth-l.width-c)),{bcx:i,bcy:r,dataLabelsX:h,dataLabelsY:p}}},{key:\"drawCalculatedDataLabels\",value:function(t){var i=t.x,a=t.y,s=t.val,r=t.i,o=t.j,n=t.textRects,l=t.barHeight,h=t.barWidth,c=t.dataLabelsConfig,d=this.w,g=\"rotate(0)\";\"vertical\"===d.config.plotOptions.bar.dataLabels.orientation&&(g=\"rotate(-90, \".concat(i,\", \").concat(a,\")\"));var u=new z(this.barCtx.ctx),f=new m(this.barCtx.ctx),p=c.formatter,x=null,b=d.globals.collapsedSeriesIndices.indexOf(r)>-1;if(c.enabled&&!b){x=f.group({class:\"apexcharts-data-labels\",transform:g});var v=\"\";void 0!==s&&(v=p(s,{seriesIndex:r,dataPointIndex:o,w:d}));var y=d.globals.series[r][o]<0,w=d.config.plotOptions.bar.dataLabels.position;if(\"vertical\"===d.config.plotOptions.bar.dataLabels.orientation&&(\"top\"===w&&(c.textAnchor=y?\"end\":\"start\"),\"center\"===w&&(c.textAnchor=\"middle\"),\"bottom\"===w&&(c.textAnchor=y?\"end\":\"start\")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels)h<f.getTextRects(v,parseFloat(c.style.fontSize)).width&&(v=\"\");d.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?n.width/1.6>Math.abs(h)&&(v=\"\"):n.height/1.6>Math.abs(l)&&(v=\"\"));var k=e({},c);this.barCtx.isHorizontal&&s<0&&(\"start\"===c.textAnchor?k.textAnchor=\"end\":\"end\"===c.textAnchor&&(k.textAnchor=\"start\")),u.plotDataLabelsText({x:i,y:a,text:v,i:r,j:o,parent:x,dataLabelsConfig:k,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return x}}]),t}(),E=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w,this.legendInactiveClass=\"legend-mouseover-inactive\"}return r(t,[{key:\"getAllSeriesEls\",value:function(){return this.w.globals.dom.baseEl.getElementsByClassName(\"apexcharts-series\")}},{key:\"getSeriesByName\",value:function(t){return this.w.globals.dom.baseEl.querySelector(\".apexcharts-inner .apexcharts-series[seriesName='\".concat(x.escapeString(t),\"']\"))}},{key:\"isSeriesHidden\",value:function(t){var e=this.getSeriesByName(t),i=parseInt(e.getAttribute(\"data:realIndex\"),10);return{isHidden:e.classList.contains(\"apexcharts-series-collapsed\"),realIndex:i}}},{key:\"addCollapsedClassToSeries\",value:function(t,e){var i=this.w;function a(i){for(var a=0;a<i.length;a++)i[a].index===e&&t.node.classList.add(\"apexcharts-series-collapsed\")}a(i.globals.collapsedSeries),a(i.globals.ancillaryCollapsedSeries)}},{key:\"toggleSeries\",value:function(t){var e=this.isSeriesHidden(t);return this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex,e.isHidden),e.isHidden}},{key:\"showSeries\",value:function(t){var e=this.isSeriesHidden(t);e.isHidden&&this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex,!0)}},{key:\"hideSeries\",value:function(t){var e=this.isSeriesHidden(t);e.isHidden||this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex,!1)}},{key:\"resetSeries\",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=this.w,s=x.clone(a.globals.initialSeries);a.globals.previousPaths=[],i?(a.globals.collapsedSeries=[],a.globals.ancillaryCollapsedSeries=[],a.globals.collapsedSeriesIndices=[],a.globals.ancillaryCollapsedSeriesIndices=[]):s=this.emptyCollapsedSeries(s),a.config.series=s,t&&(e&&(a.globals.zoomed=!1,this.ctx.updateHelpers.revertDefaultAxisMinMax()),this.ctx.updateHelpers._updateSeries(s,a.config.chart.animations.dynamicAnimation.enabled))}},{key:\"emptyCollapsedSeries\",value:function(t){for(var e=this.w,i=0;i<t.length;i++)e.globals.collapsedSeriesIndices.indexOf(i)>-1&&(t[i].data=[]);return t}},{key:\"toggleSeriesOnHover\",value:function(t,e){var i=this.w;e||(e=t.target);var a=i.globals.dom.baseEl.querySelectorAll(\".apexcharts-series, .apexcharts-datalabels\");if(\"mousemove\"===t.type){var s=parseInt(e.getAttribute(\"rel\"),10)-1,r=null,o=null;i.globals.axisCharts||\"radialBar\"===i.config.chart.type?i.globals.axisCharts?(r=i.globals.dom.baseEl.querySelector(\".apexcharts-series[data\\\\:realIndex='\".concat(s,\"']\")),o=i.globals.dom.baseEl.querySelector(\".apexcharts-datalabels[data\\\\:realIndex='\".concat(s,\"']\"))):r=i.globals.dom.baseEl.querySelector(\".apexcharts-series[rel='\".concat(s+1,\"']\")):r=i.globals.dom.baseEl.querySelector(\".apexcharts-series[rel='\".concat(s+1,\"'] path\"));for(var n=0;n<a.length;n++)a[n].classList.add(this.legendInactiveClass);null!==r&&(i.globals.axisCharts||r.parentNode.classList.remove(this.legendInactiveClass),r.classList.remove(this.legendInactiveClass),null!==o&&o.classList.remove(this.legendInactiveClass))}else if(\"mouseout\"===t.type)for(var l=0;l<a.length;l++)a[l].classList.remove(this.legendInactiveClass)}},{key:\"highlightRangeInSeries\",value:function(t,e){var i=this,a=this.w,s=a.globals.dom.baseEl.getElementsByClassName(\"apexcharts-heatmap-rect\"),r=function(t){for(var e=0;e<s.length;e++)s[e].classList[t](i.legendInactiveClass)};if(\"mousemove\"===t.type){var o=parseInt(e.getAttribute(\"rel\"),10)-1;r(\"add\"),function(t){for(var e=0;e<s.length;e++){var a=parseInt(s[e].getAttribute(\"val\"),10);a>=t.from&&a<=t.to&&s[e].classList.remove(i.legendInactiveClass)}}(a.config.plotOptions.heatmap.colorScale.ranges[o])}else\"mouseout\"===t.type&&r(\"remove\")}},{key:\"getActiveConfigSeriesIndex\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"asc\",i=this.w,a=0;if(i.config.series.length>1)for(var s=i.config.series.map((function(e,a){var s=!1;return t&&(s=\"bar\"===i.config.series[a].type||\"column\"===i.config.series[a].type),e.data&&e.data.length>0&&!s?a:-1})),r=\"asc\"===e?0:s.length-1;\"asc\"===e?r<s.length:r>=0;\"asc\"===e?r++:r--)if(-1!==s[r]){a=s[r];break}return a}},{key:\"getPreviousPaths\",value:function(){var t=this.w;function e(e,i,a){for(var s=e[i].childNodes,r={type:a,paths:[],realIndex:e[i].getAttribute(\"data:realIndex\")},o=0;o<s.length;o++)if(s[o].hasAttribute(\"pathTo\")){var n=s[o].getAttribute(\"pathTo\");r.paths.push({d:n})}t.globals.previousPaths.push(r)}t.globals.previousPaths=[];[\"line\",\"area\",\"bar\",\"rangebar\",\"candlestick\",\"radar\"].forEach((function(i){for(var a,s=(a=i,t.globals.dom.baseEl.querySelectorAll(\".apexcharts-\".concat(a,\"-series .apexcharts-series\"))),r=0;r<s.length;r++)e(s,r,i)})),this.handlePrevBubbleScatterPaths(\"bubble\"),this.handlePrevBubbleScatterPaths(\"scatter\");var i=t.globals.dom.baseEl.querySelectorAll(\".apexcharts-\".concat(t.config.chart.type,\" .apexcharts-series\"));if(i.length>0)for(var a=function(e){for(var i=t.globals.dom.baseEl.querySelectorAll(\".apexcharts-\".concat(t.config.chart.type,\" .apexcharts-series[data\\\\:realIndex='\").concat(e,\"'] rect\")),a=[],s=function(t){var e=function(e){return i[t].getAttribute(e)},s={x:parseFloat(e(\"x\")),y:parseFloat(e(\"y\")),width:parseFloat(e(\"width\")),height:parseFloat(e(\"height\"))};a.push({rect:s,color:i[t].getAttribute(\"color\")})},r=0;r<i.length;r++)s(r);t.globals.previousPaths.push(a)},s=0;s<i.length;s++)a(s);t.globals.axisCharts||(t.globals.previousPaths=t.globals.series)}},{key:\"handlePrevBubbleScatterPaths\",value:function(t){var e=this.w,i=e.globals.dom.baseEl.querySelectorAll(\".apexcharts-\".concat(t,\"-series .apexcharts-series\"));if(i.length>0)for(var a=0;a<i.length;a++){for(var s=e.globals.dom.baseEl.querySelectorAll(\".apexcharts-\".concat(t,\"-series .apexcharts-series[data\\\\:realIndex='\").concat(a,\"'] circle\")),r=[],o=0;o<s.length;o++)r.push({x:s[o].getAttribute(\"cx\"),y:s[o].getAttribute(\"cy\"),r:s[o].getAttribute(\"r\")});e.globals.previousPaths.push(r)}}},{key:\"clearPreviousPaths\",value:function(){var t=this.w;t.globals.previousPaths=[],t.globals.allSeriesCollapsed=!1}},{key:\"handleNoData\",value:function(){var t=this.w,e=t.config.noData,i=new m(this.ctx),a=t.globals.svgWidth/2,s=t.globals.svgHeight/2,r=\"middle\";if(t.globals.noData=!0,t.globals.animationEnded=!0,\"left\"===e.align?(a=10,r=\"start\"):\"right\"===e.align&&(a=t.globals.svgWidth-10,r=\"end\"),\"top\"===e.verticalAlign?s=50:\"bottom\"===e.verticalAlign&&(s=t.globals.svgHeight-50),a+=e.offsetX,s=s+parseInt(e.style.fontSize,10)+2+e.offsetY,void 0!==e.text&&\"\"!==e.text){var o=i.drawText({x:a,y:s,text:e.text,textAnchor:r,fontSize:e.style.fontSize,fontFamily:e.style.fontFamily,foreColor:e.style.color,opacity:1,class:\"apexcharts-text-nodata\"});t.globals.dom.Paper.add(o)}}},{key:\"setNullSeriesToZeroValues\",value:function(t){for(var e=this.w,i=0;i<t.length;i++)if(0===t[i].length)for(var a=0;a<t[e.globals.maxValsInArrayIndex].length;a++)t[i].push(0);return t}},{key:\"hasAllSeriesEqualX\",value:function(){for(var t=!0,e=this.w,i=this.filteredSeriesX(),a=0;a<i.length-1;a++)if(i[a][0]!==i[a+1][0]){t=!1;break}return e.globals.allSeriesHasEqualX=t,t}},{key:\"filteredSeriesX\",value:function(){var t=this.w.globals.seriesX.map((function(t){return t.length>0?t:[]}));return t}}]),t}(),Y=function(){function t(e){a(this,t),this.w=e.w,this.barCtx=e}return r(t,[{key:\"initVariables\",value:function(t){var e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(var i=0;i<t.length;i++)if(t[i].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[i].length),e.globals.isXNumeric)for(var a=0;a<t[i].length;a++)e.globals.seriesX[i][a]>e.globals.minX&&e.globals.seriesX[i][a]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1),this.barCtx.zeroSerieses=[],this.barCtx.radiusOnSeriesNumber=t.length-1,e.globals.comboCharts||this.checkZeroSeries({series:t})}},{key:\"initialPositions\",value:function(){var t,e,i,a,s,r,o,n,l=this.w,h=l.globals.dataPoints;this.barCtx.isRangeBar&&(h=l.globals.labels.length);var c=this.barCtx.seriesLen;if(l.config.plotOptions.bar.rangeBarGroupRows&&(c=1),this.barCtx.isHorizontal)s=(i=l.globals.gridHeight/h)/c,l.globals.isXNumeric&&(s=(i=l.globals.gridHeight/this.barCtx.totalItems)/this.barCtx.seriesLen),s=s*parseInt(this.barCtx.barOptions.barHeight,10)/100,n=this.barCtx.baseLineInvertedY+l.globals.padHorizontal+(this.barCtx.isReversed?l.globals.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),e=(i-s*this.barCtx.seriesLen)/2;else{if(a=l.globals.gridWidth/this.barCtx.visibleItems,l.config.xaxis.convertedCatToNumeric&&(a=l.globals.gridWidth/l.globals.dataPoints),r=a/this.barCtx.seriesLen*parseInt(this.barCtx.barOptions.columnWidth,10)/100,l.globals.isXNumeric){var d=this.barCtx.xRatio;l.config.xaxis.convertedCatToNumeric&&(d=this.barCtx.initialXRatio),l.globals.minXDiff&&.5!==l.globals.minXDiff&&l.globals.minXDiff/d>0&&(a=l.globals.minXDiff/d),(r=a/this.barCtx.seriesLen*parseInt(this.barCtx.barOptions.columnWidth,10)/100)<1&&(r=1)}o=l.globals.gridHeight-this.barCtx.baseLineY[this.barCtx.yaxisIndex]-(this.barCtx.isReversed?l.globals.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.yaxisIndex]:0),t=l.globals.padHorizontal+(a-r*this.barCtx.seriesLen)/2}return{x:t,y:e,yDivision:i,xDivision:a,barHeight:s,barWidth:r,zeroH:o,zeroW:n}}},{key:\"getPathFillColor\",value:function(t,e,i,a){var s=this.w,r=new M(this.barCtx.ctx),o=null,n=this.barCtx.barOptions.distributed?i:e;this.barCtx.barOptions.colors.ranges.length>0&&this.barCtx.barOptions.colors.ranges.map((function(a){t[e][i]>=a.from&&t[e][i]<=a.to&&(o=a.color)}));return s.config.series[e].data[i]&&s.config.series[e].data[i].fillColor&&(o=s.config.series[e].data[i].fillColor),r.fillPath({seriesNumber:this.barCtx.barOptions.distributed?n:a,dataPointIndex:i,color:o,value:t[e][i]})}},{key:\"getStrokeWidth\",value:function(t,e,i){var a=0,s=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,s.config.stroke.show&&(this.barCtx.isNullValue||(a=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[i]:this.barCtx.strokeWidth)),a}},{key:\"barBackground\",value:function(t){var e=t.j,i=t.i,a=t.x1,s=t.x2,r=t.y1,o=t.y2,n=t.elSeries,l=this.w,h=new m(this.barCtx.ctx),c=new E(this.barCtx.ctx).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&c===i){e>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(e%=this.barCtx.barOptions.colors.backgroundBarColors.length);var d=this.barCtx.barOptions.colors.backgroundBarColors[e],g=h.drawRect(void 0!==a?a:0,void 0!==r?r:0,void 0!==s?s:l.globals.gridWidth,void 0!==o?o:l.globals.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,d,this.barCtx.barOptions.colors.backgroundBarOpacity);n.add(g),g.node.classList.add(\"apexcharts-backgroundBar\")}}},{key:\"getColumnPaths\",value:function(t){var e=t.barWidth,i=t.barXPosition,a=t.yRatio,s=t.y1,r=t.y2,o=t.strokeWidth,n=t.series,l=t.realIndex,h=t.i,c=t.j,d=t.w,g=new m(this.barCtx.ctx);(o=Array.isArray(o)?o[l]:o)||(o=0);var u={barWidth:e,strokeWidth:o,yRatio:a,barXPosition:i,y1:s,y2:r},f=this.getRoundedBars(d,u,n,h,c),p=i,x=i+e,b=g.move(p,s),v=g.move(p,s),y=g.line(x-o,s);return d.globals.previousPaths.length>0&&(v=this.barCtx.getPreviousPath(l,c,!1)),b=b+g.line(p,f.y2)+f.pathWithRadius+g.line(x-o,f.y2)+y+y+\"z\",v=v+g.line(p,s)+y+y+y+y+y+g.line(p,s),d.config.chart.stacked&&(this.barCtx.yArrj.push(f.y2),this.barCtx.yArrjF.push(Math.abs(s-f.y2)),this.barCtx.yArrjVal.push(this.barCtx.series[h][c])),{pathTo:b,pathFrom:v}}},{key:\"getBarpaths\",value:function(t){var e=t.barYPosition,i=t.barHeight,a=t.x1,s=t.x2,r=t.strokeWidth,o=t.series,n=t.realIndex,l=t.i,h=t.j,c=t.w,d=new m(this.barCtx.ctx);(r=Array.isArray(r)?r[n]:r)||(r=0);var g={barHeight:i,strokeWidth:r,barYPosition:e,x2:s,x1:a},u=this.getRoundedBars(c,g,o,l,h),f=d.move(a,e),p=d.move(a,e);c.globals.previousPaths.length>0&&(p=this.barCtx.getPreviousPath(n,h,!1));var x=e,b=e+i,v=d.line(a,b-r);return f=f+d.line(u.x2,x)+u.pathWithRadius+d.line(u.x2,b-r)+v+v+\"z\",p=p+d.line(a,x)+v+v+v+v+v+d.line(a,x),c.config.chart.stacked&&(this.barCtx.xArrj.push(u.x2),this.barCtx.xArrjF.push(Math.abs(a-u.x2)),this.barCtx.xArrjVal.push(this.barCtx.series[l][h])),{pathTo:f,pathFrom:p}}},{key:\"getRoundedBars\",value:function(t,e,i,a,s){var r=new m(this.barCtx.ctx),o=0,n=t.config.plotOptions.bar.borderRadius,l=Array.isArray(n);l?o=n[a>n.length-1?n.length-1:a]:o=n;if(t.config.chart.stacked&&i.length>1&&a!==this.barCtx.radiusOnSeriesNumber&&!l&&(o=0),this.barCtx.isHorizontal){var h=\"\",c=e.x2;if(Math.abs(e.x1-e.x2)<o&&(o=Math.abs(e.x1-e.x2)),void 0!==i[a][s]||null!==i[a][s]){var d=this.barCtx.isReversed?i[a][s]>0:i[a][s]<0;d&&(o*=-1),c-=o,h=r.quadraticCurve(c+o,e.barYPosition,c+o,e.barYPosition+(d?-1*o:o))+r.line(c+o,e.barYPosition+e.barHeight-e.strokeWidth-(d?-1*o:o))+r.quadraticCurve(c+o,e.barYPosition+e.barHeight-e.strokeWidth,c,e.barYPosition+e.barHeight-e.strokeWidth)}return{pathWithRadius:h,x2:c}}var g=\"\",u=e.y2;if(Math.abs(e.y1-e.y2)<o&&(o=Math.abs(e.y1-e.y2)),void 0!==i[a][s]||null!==i[a][s]){var f=i[a][s]<0;f&&(o*=-1),u+=o,g=r.quadraticCurve(e.barXPosition,u-o,e.barXPosition+(f?-1*o:o),u-o)+r.line(e.barXPosition+e.barWidth-e.strokeWidth-(f?-1*o:o),u-o)+r.quadraticCurve(e.barXPosition+e.barWidth-e.strokeWidth,u-o,e.barXPosition+e.barWidth-e.strokeWidth,u)}return{pathWithRadius:g,y2:u}}},{key:\"checkZeroSeries\",value:function(t){for(var e=t.series,i=this.w,a=0;a<e.length;a++){for(var s=0,r=0;r<e[i.globals.maxValsInArrayIndex].length;r++)s+=e[a][r];0===s&&this.barCtx.zeroSerieses.push(a)}for(var o=e.length-1;o>=0;o--)this.barCtx.zeroSerieses.indexOf(o)>-1&&o===this.radiusOnSeriesNumber&&(this.barCtx.radiusOnSeriesNumber-=1);for(var n=e.length-1;n>=0;n--)i.globals.collapsedSeriesIndices.indexOf(this.barCtx.radiusOnSeriesNumber)>-1&&(this.barCtx.radiusOnSeriesNumber-=1)}},{key:\"getXForValue\",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=i?e:null;return null!=t&&(a=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),a}},{key:\"getYForValue\",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=i?e:null;return null!=t&&(a=e-t/this.barCtx.yRatio[this.barCtx.yaxisIndex]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[this.barCtx.yaxisIndex]:0)),a}},{key:\"getGoalValues\",value:function(t,e,i,a,s){var r=this,n=this.w,l=[];return n.globals.seriesGoals[a]&&n.globals.seriesGoals[a][s]&&Array.isArray(n.globals.seriesGoals[a][s])&&n.globals.seriesGoals[a][s].forEach((function(a){var s;l.push((o(s={},t,\"x\"===t?r.getXForValue(a.value,e,!1):r.getYForValue(a.value,i,!1)),o(s,\"attrs\",a),s))})),l}},{key:\"drawGoalLine\",value:function(t){var e=t.barXPosition,i=t.barYPosition,a=t.goalX,s=t.goalY,r=t.barWidth,o=t.barHeight,n=new m(this.barCtx.ctx),l=n.group({className:\"apexcharts-bar-goals-groups\"}),h=null;return this.barCtx.isHorizontal?Array.isArray(a)&&a.forEach((function(t){var e=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:o/2,a=i+e+o/2;h=n.drawLine(t.x,a-2*e,t.x,a,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),l.add(h)})):Array.isArray(s)&&s.forEach((function(t){var i=void 0!==t.attrs.strokeWidth?t.attrs.strokeWidth:r/2,a=e+i+r/2;h=n.drawLine(a-2*i,t.y,a,t.y,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeHeight?t.attrs.strokeHeight:2,t.attrs.strokeLineCap),l.add(h)})),l}}]),t}(),F=function(){function t(e,i){a(this,t),this.ctx=e,this.w=e.w;var s=this.w;this.barOptions=s.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=s.config.stroke.width,this.isNullValue=!1,this.isRangeBar=s.globals.seriesRangeBar.length&&this.isHorizontal,this.xyRatios=i,null!==this.xyRatios&&(this.xRatio=i.xRatio,this.initialXRatio=i.initialXRatio,this.yRatio=i.yRatio,this.invertedXRatio=i.invertedXRatio,this.invertedYRatio=i.invertedYRatio,this.baseLineY=i.baseLineY,this.baseLineInvertedY=i.baseLineInvertedY),this.yaxisIndex=0,this.seriesLen=0,this.barHelpers=new Y(this)}return r(t,[{key:\"draw\",value:function(t,i){var a=this.w,s=new m(this.ctx),r=new y(this.ctx,a);t=r.getLogSeries(t),this.series=t,this.yRatio=r.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);var o=s.group({class:\"apexcharts-bar-series apexcharts-plot-series\"});a.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn(\"WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering.\");for(var n=0,l=0;n<t.length;n++,l++){var h,c,d,g,u=void 0,f=void 0,p=[],b=[],v=a.globals.comboCharts?i[n]:n,w=s.group({class:\"apexcharts-series\",rel:n+1,seriesName:x.escapeString(a.globals.seriesNames[v]),\"data:realIndex\":v});this.ctx.series.addCollapsedClassToSeries(w,v),t[n].length>0&&(this.visibleI=this.visibleI+1);var k=0,A=0;this.yRatio.length>1&&(this.yaxisIndex=v),this.isReversed=a.config.yaxis[this.yaxisIndex]&&a.config.yaxis[this.yaxisIndex].reversed;var S=this.barHelpers.initialPositions();f=S.y,k=S.barHeight,c=S.yDivision,g=S.zeroW,u=S.x,A=S.barWidth,h=S.xDivision,d=S.zeroH,this.horizontal||b.push(u+A/2);for(var C=s.group({class:\"apexcharts-datalabels\",\"data:realIndex\":v}),L=s.group({class:\"apexcharts-bar-goals-markers\",style:\"pointer-events: none\"}),P=0;P<a.globals.dataPoints;P++){var M=this.barHelpers.getStrokeWidth(n,P,v),T=null,I={indexes:{i:n,j:P,realIndex:v,bc:l},x:u,y:f,strokeWidth:M,elSeries:w};this.isHorizontal?(T=this.drawBarPaths(e(e({},I),{},{barHeight:k,zeroW:g,yDivision:c})),A=this.series[n][P]/this.invertedYRatio):(T=this.drawColumnPaths(e(e({},I),{},{xDivision:h,barWidth:A,zeroH:d})),k=this.series[n][P]/this.yRatio[this.yaxisIndex]);var z=this.barHelpers.drawGoalLine({barXPosition:T.barXPosition,barYPosition:T.barYPosition,goalX:T.goalX,goalY:T.goalY,barHeight:k,barWidth:A});z&&L.add(z),f=T.y,u=T.x,P>0&&b.push(u+A/2),p.push(f);var X=this.barHelpers.getPathFillColor(t,n,P,v);this.renderSeries({realIndex:v,pathFill:X,j:P,i:n,pathFrom:T.pathFrom,pathTo:T.pathTo,strokeWidth:M,elSeries:w,x:u,y:f,series:t,barHeight:k,barWidth:A,elDataLabelsWrap:C,elGoalsMarkers:L,visibleSeries:this.visibleI,type:\"bar\"})}a.globals.seriesXvalues[v]=b,a.globals.seriesYvalues[v]=p,o.add(w)}return o}},{key:\"renderSeries\",value:function(t){var e=t.realIndex,i=t.pathFill,a=t.lineFill,s=t.j,r=t.i,o=t.pathFrom,n=t.pathTo,l=t.strokeWidth,h=t.elSeries,c=t.x,d=t.y,g=t.y1,u=t.y2,f=t.series,p=t.barHeight,x=t.barWidth,b=t.barYPosition,y=t.elDataLabelsWrap,w=t.elGoalsMarkers,k=t.visibleSeries,A=t.type,S=this.w,C=new m(this.ctx);a||(a=this.barOptions.distributed?S.globals.stroke.colors[s]:S.globals.stroke.colors[e]),S.config.series[r].data[s]&&S.config.series[r].data[s].strokeColor&&(a=S.config.series[r].data[s].strokeColor),this.isNullValue&&(i=\"none\");var L=s/S.config.chart.animations.animateGradually.delay*(S.config.chart.animations.speed/S.globals.dataPoints)/2.4,P=C.renderPaths({i:r,j:s,realIndex:e,pathFrom:o,pathTo:n,stroke:a,strokeWidth:l,strokeLineCap:S.config.stroke.lineCap,fill:i,animationDelay:L,initialSpeed:S.config.chart.animations.speed,dataChangeSpeed:S.config.chart.animations.dynamicAnimation.speed,className:\"apexcharts-\".concat(A,\"-area\")});P.attr(\"clip-path\",\"url(#gridRectMask\".concat(S.globals.cuid,\")\"));var M=S.config.forecastDataPoints;M.count>0&&s>=S.globals.dataPoints-M.count&&(P.node.setAttribute(\"stroke-dasharray\",M.dashArray),P.node.setAttribute(\"stroke-width\",M.strokeWidth),P.node.setAttribute(\"fill-opacity\",M.fillOpacity)),void 0!==g&&void 0!==u&&(P.attr(\"data-range-y1\",g),P.attr(\"data-range-y2\",u)),new v(this.ctx).setSelectionFilter(P,e,s),h.add(P);var T=new X(this).handleBarDataLabels({x:c,y:d,y1:g,y2:u,i:r,j:s,series:f,realIndex:e,barHeight:p,barWidth:x,barYPosition:b,renderedPath:P,visibleSeries:k});return null!==T&&y.add(T),h.add(y),w&&h.add(w),h}},{key:\"drawBarPaths\",value:function(t){var e=t.indexes,i=t.barHeight,a=t.strokeWidth,s=t.zeroW,r=t.x,o=t.y,n=t.yDivision,l=t.elSeries,h=this.w,c=e.i,d=e.j;h.globals.isXNumeric&&(o=(h.globals.seriesX[c][d]-h.globals.minX)/this.invertedXRatio-i);var g=o+i*this.visibleI;r=this.barHelpers.getXForValue(this.series[c][d],s);var u=this.barHelpers.getBarpaths({barYPosition:g,barHeight:i,x1:s,x2:r,strokeWidth:a,series:this.series,realIndex:e.realIndex,i:c,j:d,w:h});return h.globals.isXNumeric||(o+=n),this.barHelpers.barBackground({j:d,i:c,y1:g-i*this.visibleI,y2:i*this.seriesLen,elSeries:l}),{pathTo:u.pathTo,pathFrom:u.pathFrom,x:r,y:o,goalX:this.barHelpers.getGoalValues(\"x\",s,null,c,d),barYPosition:g}}},{key:\"drawColumnPaths\",value:function(t){var e=t.indexes,i=t.x,a=t.y,s=t.xDivision,r=t.barWidth,o=t.zeroH,n=t.strokeWidth,l=t.elSeries,h=this.w,c=e.realIndex,d=e.i,g=e.j,u=e.bc;if(h.globals.isXNumeric){var f=c;h.globals.seriesX[c].length||(f=h.globals.maxValsInArrayIndex),i=(h.globals.seriesX[f][g]-h.globals.minX)/this.xRatio-r*this.seriesLen/2}var p=i+r*this.visibleI;a=this.barHelpers.getYForValue(this.series[d][g],o);var x=this.barHelpers.getColumnPaths({barXPosition:p,barWidth:r,y1:o,y2:a,strokeWidth:n,series:this.series,realIndex:e.realIndex,i:d,j:g,w:h});return h.globals.isXNumeric||(i+=s),this.barHelpers.barBackground({bc:u,j:g,i:d,x1:p-n/2-r*this.visibleI,x2:r*this.seriesLen+n/2,elSeries:l}),{pathTo:x.pathTo,pathFrom:x.pathFrom,x:i,y:a,goalY:this.barHelpers.getGoalValues(\"y\",null,o,d,g),barXPosition:p}}},{key:\"getPreviousPath\",value:function(t,e){for(var i,a=this.w,s=0;s<a.globals.previousPaths.length;s++){var r=a.globals.previousPaths[s];r.paths&&r.paths.length>0&&parseInt(r.realIndex,10)===parseInt(t,10)&&void 0!==a.globals.previousPaths[s].paths[e]&&(i=a.globals.previousPaths[s].paths[e].d)}return i}}]),t}(),R=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w,this.months31=[1,3,5,7,8,10,12],this.months30=[2,4,6,9,11],this.daysCntOfYear=[0,31,59,90,120,151,181,212,243,273,304,334]}return r(t,[{key:\"isValidDate\",value:function(t){return!isNaN(this.parseDate(t))}},{key:\"getTimeStamp\",value:function(t){return Date.parse(t)?this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toISOString().substr(0,25)).getTime():new Date(t).getTime():t}},{key:\"getDate\",value:function(t){return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toUTCString()):new Date(t)}},{key:\"parseDate\",value:function(t){var e=Date.parse(t);if(!isNaN(e))return this.getTimeStamp(t);var i=Date.parse(t.replace(/-/g,\"/\").replace(/[a-z]+/gi,\" \"));return i=this.getTimeStamp(i)}},{key:\"parseDateWithTimezone\",value:function(t){return Date.parse(t.replace(/-/g,\"/\").replace(/[a-z]+/gi,\" \"))}},{key:\"formatDate\",value:function(t,e){var i=this.w.globals.locale,a=this.w.config.xaxis.labels.datetimeUTC,s=[\"\\0\"].concat(u(i.months)),r=[\"\\x01\"].concat(u(i.shortMonths)),o=[\"\\x02\"].concat(u(i.days)),n=[\"\\x03\"].concat(u(i.shortDays));function l(t,e){var i=t+\"\";for(e=e||2;i.length<e;)i=\"0\"+i;return i}var h=a?t.getUTCFullYear():t.getFullYear();e=(e=(e=e.replace(/(^|[^\\\\])yyyy+/g,\"$1\"+h)).replace(/(^|[^\\\\])yy/g,\"$1\"+h.toString().substr(2,2))).replace(/(^|[^\\\\])y/g,\"$1\"+h);var c=(a?t.getUTCMonth():t.getMonth())+1;e=(e=(e=(e=e.replace(/(^|[^\\\\])MMMM+/g,\"$1\"+s[0])).replace(/(^|[^\\\\])MMM/g,\"$1\"+r[0])).replace(/(^|[^\\\\])MM/g,\"$1\"+l(c))).replace(/(^|[^\\\\])M/g,\"$1\"+c);var d=a?t.getUTCDate():t.getDate();e=(e=(e=(e=e.replace(/(^|[^\\\\])dddd+/g,\"$1\"+o[0])).replace(/(^|[^\\\\])ddd/g,\"$1\"+n[0])).replace(/(^|[^\\\\])dd/g,\"$1\"+l(d))).replace(/(^|[^\\\\])d/g,\"$1\"+d);var g=a?t.getUTCHours():t.getHours(),f=g>12?g-12:0===g?12:g;e=(e=(e=(e=e.replace(/(^|[^\\\\])HH+/g,\"$1\"+l(g))).replace(/(^|[^\\\\])H/g,\"$1\"+g)).replace(/(^|[^\\\\])hh+/g,\"$1\"+l(f))).replace(/(^|[^\\\\])h/g,\"$1\"+f);var p=a?t.getUTCMinutes():t.getMinutes();e=(e=e.replace(/(^|[^\\\\])mm+/g,\"$1\"+l(p))).replace(/(^|[^\\\\])m/g,\"$1\"+p);var x=a?t.getUTCSeconds():t.getSeconds();e=(e=e.replace(/(^|[^\\\\])ss+/g,\"$1\"+l(x))).replace(/(^|[^\\\\])s/g,\"$1\"+x);var b=a?t.getUTCMilliseconds():t.getMilliseconds();e=e.replace(/(^|[^\\\\])fff+/g,\"$1\"+l(b,3)),b=Math.round(b/10),e=e.replace(/(^|[^\\\\])ff/g,\"$1\"+l(b)),b=Math.round(b/10);var v=g<12?\"AM\":\"PM\";e=(e=(e=e.replace(/(^|[^\\\\])f/g,\"$1\"+b)).replace(/(^|[^\\\\])TT+/g,\"$1\"+v)).replace(/(^|[^\\\\])T/g,\"$1\"+v.charAt(0));var m=v.toLowerCase();e=(e=e.replace(/(^|[^\\\\])tt+/g,\"$1\"+m)).replace(/(^|[^\\\\])t/g,\"$1\"+m.charAt(0));var y=-t.getTimezoneOffset(),w=a||!y?\"Z\":y>0?\"+\":\"-\";if(!a){var k=(y=Math.abs(y))%60;w+=l(Math.floor(y/60))+\":\"+l(k)}e=e.replace(/(^|[^\\\\])K/g,\"$1\"+w);var A=(a?t.getUTCDay():t.getDay())+1;return e=(e=(e=(e=(e=e.replace(new RegExp(o[0],\"g\"),o[A])).replace(new RegExp(n[0],\"g\"),n[A])).replace(new RegExp(s[0],\"g\"),s[c])).replace(new RegExp(r[0],\"g\"),r[c])).replace(/\\\\(.)/g,\"$1\")}},{key:\"getTimeUnitsfromTimestamp\",value:function(t,e,i){var a=this.w;void 0!==a.config.xaxis.min&&(t=a.config.xaxis.min),void 0!==a.config.xaxis.max&&(e=a.config.xaxis.max);var s=this.getDate(t),r=this.getDate(e),o=this.formatDate(s,\"yyyy MM dd HH mm ss fff\").split(\" \"),n=this.formatDate(r,\"yyyy MM dd HH mm ss fff\").split(\" \");return{minMillisecond:parseInt(o[6],10),maxMillisecond:parseInt(n[6],10),minSecond:parseInt(o[5],10),maxSecond:parseInt(n[5],10),minMinute:parseInt(o[4],10),maxMinute:parseInt(n[4],10),minHour:parseInt(o[3],10),maxHour:parseInt(n[3],10),minDate:parseInt(o[2],10),maxDate:parseInt(n[2],10),minMonth:parseInt(o[1],10)-1,maxMonth:parseInt(n[1],10)-1,minYear:parseInt(o[0],10),maxYear:parseInt(n[0],10)}}},{key:\"isLeapYear\",value:function(t){return t%4==0&&t%100!=0||t%400==0}},{key:\"calculcateLastDaysOfMonth\",value:function(t,e,i){return this.determineDaysOfMonths(t,e)-i}},{key:\"determineDaysOfYear\",value:function(t){var e=365;return this.isLeapYear(t)&&(e=366),e}},{key:\"determineRemainingDaysOfYear\",value:function(t,e,i){var a=this.daysCntOfYear[e]+i;return e>1&&this.isLeapYear()&&a++,a}},{key:\"determineDaysOfMonths\",value:function(t,e){var i=30;switch(t=x.monthMod(t),!0){case this.months30.indexOf(t)>-1:2===t&&(i=this.isLeapYear(e)?29:28);break;case this.months31.indexOf(t)>-1:default:i=31}return i}}]),t}(),H=function(t){n(s,F);var i=d(s);function s(){return a(this,s),i.apply(this,arguments)}return r(s,[{key:\"draw\",value:function(t,i){var a=this.w,s=new m(this.ctx);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=a.globals.seriesRangeStart,this.seriesRangeEnd=a.globals.seriesRangeEnd,this.barHelpers.initVariables(t);for(var r=s.group({class:\"apexcharts-rangebar-series apexcharts-plot-series\"}),o=0;o<t.length;o++){var n,l,h,c=void 0,d=void 0,g=void 0,u=a.globals.comboCharts?i[o]:o,f=s.group({class:\"apexcharts-series\",seriesName:x.escapeString(a.globals.seriesNames[u]),rel:o+1,\"data:realIndex\":u});this.ctx.series.addCollapsedClassToSeries(f,u),t[o].length>0&&(this.visibleI=this.visibleI+1);var p=0,b=0;this.yRatio.length>1&&(this.yaxisIndex=u);var v=this.barHelpers.initialPositions();d=v.y,h=v.zeroW,c=v.x,b=v.barWidth,n=v.xDivision,l=v.zeroH;for(var y=s.group({class:\"apexcharts-datalabels\",\"data:realIndex\":u}),w=s.group({class:\"apexcharts-rangebar-goals-markers\",style:\"pointer-events: none\"}),k=0;k<a.globals.dataPoints;k++){var A=this.barHelpers.getStrokeWidth(o,k,u),S=this.seriesRangeStart[o][k],C=this.seriesRangeEnd[o][k],L=null,P=null,M={x:c,y:d,strokeWidth:A,elSeries:f};if(g=v.yDivision,p=v.barHeight,this.isHorizontal){P=d+p*this.visibleI;var T=this.seriesLen;a.config.plotOptions.bar.rangeBarGroupRows&&(T=1);var I=(g-p*T)/2;if(void 0===a.config.series[o].data[k])break;if(a.config.series[o].data[k].x){var z=this.detectOverlappingBars({i:o,j:k,barYPosition:P,srty:I,barHeight:p,yDivision:g,initPositions:v});p=z.barHeight,P=z.barYPosition}b=(L=this.drawRangeBarPaths(e({indexes:{i:o,j:k,realIndex:u},barHeight:p,barYPosition:P,zeroW:h,yDivision:g,y1:S,y2:C},M))).barWidth}else p=(L=this.drawRangeColumnPaths(e({indexes:{i:o,j:k,realIndex:u},zeroH:l,barWidth:b,xDivision:n},M))).barHeight;var X=this.barHelpers.drawGoalLine({barXPosition:L.barXPosition,barYPosition:P,goalX:L.goalX,goalY:L.goalY,barHeight:p,barWidth:b});X&&w.add(X),d=L.y,c=L.x;var E=this.barHelpers.getPathFillColor(t,o,k,u),Y=a.globals.stroke.colors[u];this.renderSeries({realIndex:u,pathFill:E,lineFill:Y,j:k,i:o,x:c,y:d,y1:S,y2:C,pathFrom:L.pathFrom,pathTo:L.pathTo,strokeWidth:A,elSeries:f,series:t,barHeight:p,barYPosition:P,barWidth:b,elDataLabelsWrap:y,elGoalsMarkers:w,visibleSeries:this.visibleI,type:\"rangebar\"})}r.add(f)}return r}},{key:\"detectOverlappingBars\",value:function(t){var e=t.i,i=t.j,a=t.barYPosition,s=t.srty,r=t.barHeight,o=t.yDivision,n=t.initPositions,l=this.w,h=[],c=l.config.series[e].data[i].rangeName,d=l.config.series[e].data[i].x,g=l.globals.labels.indexOf(d),u=l.globals.seriesRangeBar[e].findIndex((function(t){return t.x===d&&t.overlaps.length>0}));return a=l.config.plotOptions.bar.rangeBarGroupRows?s+o*g:s+r*this.visibleI+o*g,u>-1&&!l.config.plotOptions.bar.rangeBarOverlap&&(h=l.globals.seriesRangeBar[e][u].overlaps).indexOf(c)>-1&&(a=(r=n.barHeight/h.length)*this.visibleI+o*(100-parseInt(this.barOptions.barHeight,10))/100/2+r*(this.visibleI+h.indexOf(c))+o*g),{barYPosition:a,barHeight:r}}},{key:\"drawRangeColumnPaths\",value:function(t){var e=t.indexes,i=t.x;t.strokeWidth;var a=t.xDivision,s=t.barWidth,r=t.zeroH,o=this.w,n=e.i,l=e.j,h=this.yRatio[this.yaxisIndex],c=e.realIndex,d=this.getRangeValue(c,l),g=Math.min(d.start,d.end),u=Math.max(d.start,d.end);o.globals.isXNumeric&&(i=(o.globals.seriesX[n][l]-o.globals.minX)/this.xRatio-s/2);var f=i+s*this.visibleI;void 0===this.series[n][l]||null===this.series[n][l]?g=r:(g=r-g/h,u=r-u/h);var p=Math.abs(u-g),x=this.barHelpers.getColumnPaths({barXPosition:f,barWidth:s,y1:g,y2:u,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:e.realIndex,i:c,j:l,w:o});return o.globals.isXNumeric||(i+=a),{pathTo:x.pathTo,pathFrom:x.pathFrom,barHeight:p,x:i,y:u,goalY:this.barHelpers.getGoalValues(\"y\",null,r,n,l),barXPosition:f}}},{key:\"drawRangeBarPaths\",value:function(t){var e=t.indexes,i=t.y,a=t.y1,s=t.y2,r=t.yDivision,o=t.barHeight,n=t.barYPosition,l=t.zeroW,h=this.w,c=l+a/this.invertedYRatio,d=l+s/this.invertedYRatio,g=Math.abs(d-c),u=this.barHelpers.getBarpaths({barYPosition:n,barHeight:o,x1:c,x2:d,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:e.realIndex,realIndex:e.realIndex,j:e.j,w:h});return h.globals.isXNumeric||(i+=r),{pathTo:u.pathTo,pathFrom:u.pathFrom,barWidth:g,x:d,goalX:this.barHelpers.getGoalValues(\"x\",l,null,e.realIndex,e.j),y:i}}},{key:\"getRangeValue\",value:function(t,e){var i=this.w;return{start:i.globals.seriesRangeStart[t][e],end:i.globals.seriesRangeEnd[t][e]}}},{key:\"getTooltipValues\",value:function(t){var e=t.ctx,i=t.seriesIndex,a=t.dataPointIndex,s=t.y1,r=t.y2,o=t.w,n=o.globals.seriesRangeStart[i][a],l=o.globals.seriesRangeEnd[i][a],h=o.globals.labels[a],c=o.config.series[i].name?o.config.series[i].name:\"\",d=o.config.tooltip.y.formatter,g=o.config.tooltip.y.title.formatter,u={w:o,seriesIndex:i,dataPointIndex:a,start:n,end:l};\"function\"==typeof g&&(c=g(c,u)),Number.isFinite(s)&&Number.isFinite(r)&&(n=s,l=r,o.config.series[i].data[a].x&&(h=o.config.series[i].data[a].x+\":\"),\"function\"==typeof d&&(h=d(h,u)));var f=\"\",p=\"\",x=o.globals.colors[i];if(void 0===o.config.tooltip.x.formatter)if(\"datetime\"===o.config.xaxis.type){var b=new R(e);f=b.formatDate(b.getDate(n),o.config.tooltip.x.format),p=b.formatDate(b.getDate(l),o.config.tooltip.x.format)}else f=n,p=l;else f=o.config.tooltip.x.formatter(n),p=o.config.tooltip.x.formatter(l);return{start:n,end:l,startVal:f,endVal:p,ylabel:h,color:x,seriesName:c}}},{key:\"buildCustomTooltipHTML\",value:function(t){var e=t.color,i=t.seriesName;return'<div class=\"apexcharts-tooltip-rangebar\"><div> <span class=\"series-name\" style=\"color: '+e+'\">'+(i||\"\")+'</span></div><div> <span class=\"category\">'+t.ylabel+' </span> <span class=\"value start-value\">'+t.start+'</span> <span class=\"separator\">-</span> <span class=\"value end-value\">'+t.end+\"</span></div></div>\"}}]),s}(),D=function(){function t(e){a(this,t),this.opts=e}return r(t,[{key:\"line\",value:function(){return{chart:{animations:{easing:\"swing\"}},dataLabels:{enabled:!1},stroke:{width:5,curve:\"straight\"},markers:{size:0,hover:{sizeOffset:6}},xaxis:{crosshairs:{width:1}}}}},{key:\"sparkline\",value:function(t){this.opts.yaxis[0].show=!1,this.opts.yaxis[0].title.text=\"\",this.opts.yaxis[0].axisBorder.show=!1,this.opts.yaxis[0].axisTicks.show=!1,this.opts.yaxis[0].floating=!0;return x.extend(t,{grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},legend:{show:!1},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}},chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1}})}},{key:\"bar\",value:function(){return{chart:{stacked:!1,animations:{easing:\"swing\"}},plotOptions:{bar:{dataLabels:{position:\"center\"}}},dataLabels:{style:{colors:[\"#fff\"]},background:{enabled:!1}},stroke:{width:0,lineCap:\"round\"},fill:{opacity:.85},legend:{markers:{shape:\"square\",radius:2,size:8}},tooltip:{shared:!1,intersect:!0},xaxis:{tooltip:{enabled:!1},tickPlacement:\"between\",crosshairs:{width:\"barWidth\",position:\"back\",fill:{type:\"gradient\"},dropShadow:{enabled:!1},stroke:{width:0}}}}}},{key:\"candlestick\",value:function(){var t=this;return{stroke:{width:1,colors:[\"#333\"]},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(e){var i=e.seriesIndex,a=e.dataPointIndex,s=e.w;return t._getBoxTooltip(s,i,a,[\"Open\",\"High\",\"\",\"Low\",\"Close\"],\"candlestick\")}},states:{active:{filter:{type:\"none\"}}},xaxis:{crosshairs:{width:1}}}}},{key:\"boxPlot\",value:function(){var t=this;return{chart:{animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:[\"#24292e\"]},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(e){var i=e.seriesIndex,a=e.dataPointIndex,s=e.w;return t._getBoxTooltip(s,i,a,[\"Minimum\",\"Q1\",\"Median\",\"Q3\",\"Maximum\"],\"boxPlot\")}},markers:{size:5,strokeWidth:1,strokeColors:\"#111\"},xaxis:{crosshairs:{width:1}}}}},{key:\"rangeBar\",value:function(){return{stroke:{width:0,lineCap:\"square\"},plotOptions:{bar:{borderRadius:0,dataLabels:{position:\"center\"}}},dataLabels:{enabled:!1,formatter:function(t,e){e.ctx;var i=e.seriesIndex,a=e.dataPointIndex,s=e.w,r=s.globals.seriesRangeStart[i][a];return s.globals.seriesRangeEnd[i][a]-r},background:{enabled:!1},style:{colors:[\"#fff\"]}},tooltip:{shared:!1,followCursor:!0,custom:function(t){return t.w.config.plotOptions&&t.w.config.plotOptions.bar&&t.w.config.plotOptions.bar.horizontal?function(t){var e=new H(t.ctx,null),i=e.getTooltipValues(t),a=i.color,s=i.seriesName,r=i.ylabel,o=i.startVal,n=i.endVal;return e.buildCustomTooltipHTML({color:a,seriesName:s,ylabel:r,start:o,end:n})}(t):function(t){var e=new H(t.ctx,null),i=e.getTooltipValues(t),a=i.color,s=i.seriesName,r=i.ylabel,o=i.start,n=i.end;return e.buildCustomTooltipHTML({color:a,seriesName:s,ylabel:r,start:o,end:n})}(t)}},xaxis:{tickPlacement:\"between\",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}},{key:\"area\",value:function(){return{stroke:{width:4,fill:{type:\"solid\",gradient:{inverseColors:!1,shade:\"light\",type:\"vertical\",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}}},fill:{type:\"gradient\",gradient:{inverseColors:!1,shade:\"light\",type:\"vertical\",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}},markers:{size:0,hover:{sizeOffset:6}},tooltip:{followCursor:!1}}}},{key:\"brush\",value:function(t){return x.extend(t,{chart:{toolbar:{autoSelected:\"selection\",show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1},stroke:{width:1},tooltip:{enabled:!1},xaxis:{tooltip:{enabled:!1}}})}},{key:\"stacked100\",value:function(t){t.dataLabels=t.dataLabels||{},t.dataLabels.formatter=t.dataLabels.formatter||void 0;var e=t.dataLabels.formatter;return t.yaxis.forEach((function(e,i){t.yaxis[i].min=0,t.yaxis[i].max=100})),\"bar\"===t.chart.type&&(t.dataLabels.formatter=e||function(t){return\"number\"==typeof t&&t?t.toFixed(0)+\"%\":t}),t}},{key:\"convertCatToNumeric\",value:function(t){return t.xaxis.convertedCatToNumeric=!0,t}},{key:\"convertCatToNumericXaxis\",value:function(t,e,i){t.xaxis.type=\"numeric\",t.xaxis.labels=t.xaxis.labels||{},t.xaxis.labels.formatter=t.xaxis.labels.formatter||function(t){return x.isNumber(t)?Math.floor(t):t};var a=t.xaxis.labels.formatter,s=t.xaxis.categories&&t.xaxis.categories.length?t.xaxis.categories:t.labels;return i&&i.length&&(s=i.map((function(t){return Array.isArray(t)?t:String(t)}))),s&&s.length&&(t.xaxis.labels.formatter=function(t){return x.isNumber(t)?a(s[Math.floor(t)-1]):a(t)}),t.xaxis.categories=[],t.labels=[],t.xaxis.tickAmount=t.xaxis.tickAmount||\"dataPoints\",t}},{key:\"bubble\",value:function(){return{dataLabels:{style:{colors:[\"#fff\"]}},tooltip:{shared:!1,intersect:!0},xaxis:{crosshairs:{width:0}},fill:{type:\"solid\",gradient:{shade:\"light\",inverse:!0,shadeIntensity:.55,opacityFrom:.4,opacityTo:.8}}}}},{key:\"scatter\",value:function(){return{dataLabels:{enabled:!1},tooltip:{shared:!1,intersect:!0},markers:{size:6,strokeWidth:1,hover:{sizeOffset:2}}}}},{key:\"heatmap\",value:function(){return{chart:{stacked:!1},fill:{opacity:1},dataLabels:{style:{colors:[\"#fff\"]}},stroke:{colors:[\"#fff\"]},tooltip:{followCursor:!0,marker:{show:!1},x:{show:!1}},legend:{position:\"top\",markers:{shape:\"square\",size:10,offsetY:2}},grid:{padding:{right:20}}}}},{key:\"treemap\",value:function(){return{chart:{zoom:{enabled:!1}},dataLabels:{style:{fontSize:14,fontWeight:600,colors:[\"#fff\"]}},stroke:{show:!0,width:2,colors:[\"#fff\"]},legend:{show:!1},fill:{gradient:{stops:[0,100]}},tooltip:{followCursor:!0,x:{show:!1}},grid:{padding:{left:0,right:0}},xaxis:{crosshairs:{show:!1},tooltip:{enabled:!1}}}}},{key:\"pie\",value:function(){return{chart:{toolbar:{show:!1}},plotOptions:{pie:{donut:{labels:{show:!1}}}},dataLabels:{formatter:function(t){return t.toFixed(1)+\"%\"},style:{colors:[\"#fff\"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:[\"#fff\"]},fill:{opacity:1,gradient:{shade:\"light\",stops:[0,100]}},tooltip:{theme:\"dark\",fillSeriesColor:!0},legend:{position:\"right\"}}}},{key:\"donut\",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(t){return t.toFixed(1)+\"%\"},style:{colors:[\"#fff\"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:[\"#fff\"]},fill:{opacity:1,gradient:{shade:\"light\",shadeIntensity:.35,stops:[80,100],opacityFrom:1,opacityTo:1}},tooltip:{theme:\"dark\",fillSeriesColor:!0},legend:{position:\"right\"}}}},{key:\"polarArea\",value:function(){return this.opts.yaxis[0].tickAmount=this.opts.yaxis[0].tickAmount?this.opts.yaxis[0].tickAmount:6,{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(t){return t.toFixed(1)+\"%\"},enabled:!1},stroke:{show:!0,width:2},fill:{opacity:.7},tooltip:{theme:\"dark\",fillSeriesColor:!0},legend:{position:\"right\"}}}},{key:\"radar\",value:function(){return this.opts.yaxis[0].labels.offsetY=this.opts.yaxis[0].labels.offsetY?this.opts.yaxis[0].labels.offsetY:6,{dataLabels:{enabled:!1,style:{fontSize:\"11px\"}},stroke:{width:2},markers:{size:3,strokeWidth:1,strokeOpacity:1},fill:{opacity:.2},tooltip:{shared:!1,intersect:!0,followCursor:!0},grid:{show:!1},xaxis:{labels:{formatter:function(t){return t},style:{colors:[\"#a8a8a8\"],fontSize:\"11px\"}},tooltip:{enabled:!1},crosshairs:{show:!1}}}}},{key:\"radialBar\",value:function(){return{chart:{animations:{dynamicAnimation:{enabled:!0,speed:800}},toolbar:{show:!1}},fill:{gradient:{shade:\"dark\",shadeIntensity:.4,inverseColors:!1,type:\"diagonal2\",opacityFrom:1,opacityTo:1,stops:[70,98,100]}},legend:{show:!1,position:\"right\"},tooltip:{enabled:!1,fillSeriesColor:!0}}}},{key:\"_getBoxTooltip\",value:function(t,e,i,a,s){var r=t.globals.seriesCandleO[e][i],o=t.globals.seriesCandleH[e][i],n=t.globals.seriesCandleM[e][i],l=t.globals.seriesCandleL[e][i],h=t.globals.seriesCandleC[e][i];return t.config.series[e].type&&t.config.series[e].type!==s?'<div class=\"apexcharts-custom-tooltip\">\\n          '.concat(t.config.series[e].name?t.config.series[e].name:\"series-\"+(e+1),\": <strong>\").concat(t.globals.series[e][i],\"</strong>\\n        </div>\"):'<div class=\"apexcharts-tooltip-box apexcharts-tooltip-'.concat(t.config.chart.type,'\">')+\"<div>\".concat(a[0],': <span class=\"value\">')+r+\"</span></div>\"+\"<div>\".concat(a[1],': <span class=\"value\">')+o+\"</span></div>\"+(n?\"<div>\".concat(a[2],': <span class=\"value\">')+n+\"</span></div>\":\"\")+\"<div>\".concat(a[3],': <span class=\"value\">')+l+\"</span></div>\"+\"<div>\".concat(a[4],': <span class=\"value\">')+h+\"</span></div></div>\"}}]),t}(),N=function(){function t(e){a(this,t),this.opts=e}return r(t,[{key:\"init\",value:function(t){var e=t.responsiveOverride,a=this.opts,s=new L,r=new D(a);this.chartType=a.chart.type,\"histogram\"===this.chartType&&(a.chart.type=\"bar\",a=x.extend({plotOptions:{bar:{columnWidth:\"99.99%\"}}},a)),a=this.extendYAxis(a),a=this.extendAnnotations(a);var o=s.init(),n={};if(a&&\"object\"===i(a)){var l={};l=-1!==[\"line\",\"area\",\"bar\",\"candlestick\",\"boxPlot\",\"rangeBar\",\"histogram\",\"bubble\",\"scatter\",\"heatmap\",\"treemap\",\"pie\",\"polarArea\",\"donut\",\"radar\",\"radialBar\"].indexOf(a.chart.type)?r[a.chart.type]():r.line(),a.chart.brush&&a.chart.brush.enabled&&(l=r.brush(l)),a.chart.stacked&&\"100%\"===a.chart.stackType&&(a=r.stacked100(a)),this.checkForDarkTheme(window.Apex),this.checkForDarkTheme(a),a.xaxis=a.xaxis||window.Apex.xaxis||{},e||(a.xaxis.convertedCatToNumeric=!1),((a=this.checkForCatToNumericXAxis(this.chartType,l,a)).chart.sparkline&&a.chart.sparkline.enabled||window.Apex.chart&&window.Apex.chart.sparkline&&window.Apex.chart.sparkline.enabled)&&(l=r.sparkline(l)),n=x.extend(o,l)}var h=x.extend(n,window.Apex);return o=x.extend(h,a),o=this.handleUserInputErrors(o)}},{key:\"checkForCatToNumericXAxis\",value:function(t,e,i){var a=new D(i),s=(\"bar\"===t||\"boxPlot\"===t)&&i.plotOptions&&i.plotOptions.bar&&i.plotOptions.bar.horizontal,r=\"pie\"===t||\"polarArea\"===t||\"donut\"===t||\"radar\"===t||\"radialBar\"===t||\"heatmap\"===t,o=\"datetime\"!==i.xaxis.type&&\"numeric\"!==i.xaxis.type,n=i.xaxis.tickPlacement?i.xaxis.tickPlacement:e.xaxis&&e.xaxis.tickPlacement;return s||r||!o||\"between\"===n||(i=a.convertCatToNumeric(i)),i}},{key:\"extendYAxis\",value:function(t,e){var i=new L;(void 0===t.yaxis||!t.yaxis||Array.isArray(t.yaxis)&&0===t.yaxis.length)&&(t.yaxis={}),t.yaxis.constructor!==Array&&window.Apex.yaxis&&window.Apex.yaxis.constructor!==Array&&(t.yaxis=x.extend(t.yaxis,window.Apex.yaxis)),t.yaxis.constructor!==Array?t.yaxis=[x.extend(i.yAxis,t.yaxis)]:t.yaxis=x.extendArray(t.yaxis,i.yAxis);var a=!1;t.yaxis.forEach((function(t){t.logarithmic&&(a=!0)}));var s=t.series;return e&&!s&&(s=e.config.series),a&&s.length!==t.yaxis.length&&s.length&&(t.yaxis=s.map((function(e,a){if(e.name||(s[a].name=\"series-\".concat(a+1)),t.yaxis[a])return t.yaxis[a].seriesName=s[a].name,t.yaxis[a];var r=x.extend(i.yAxis,t.yaxis[0]);return r.show=!1,r}))),a&&s.length>1&&s.length!==t.yaxis.length&&console.warn(\"A multi-series logarithmic chart should have equal number of series and y-axes. Please make sure to equalize both.\"),t}},{key:\"extendAnnotations\",value:function(t){return void 0===t.annotations&&(t.annotations={},t.annotations.yaxis=[],t.annotations.xaxis=[],t.annotations.points=[]),t=this.extendYAxisAnnotations(t),t=this.extendXAxisAnnotations(t),t=this.extendPointAnnotations(t)}},{key:\"extendYAxisAnnotations\",value:function(t){var e=new L;return t.annotations.yaxis=x.extendArray(void 0!==t.annotations.yaxis?t.annotations.yaxis:[],e.yAxisAnnotation),t}},{key:\"extendXAxisAnnotations\",value:function(t){var e=new L;return t.annotations.xaxis=x.extendArray(void 0!==t.annotations.xaxis?t.annotations.xaxis:[],e.xAxisAnnotation),t}},{key:\"extendPointAnnotations\",value:function(t){var e=new L;return t.annotations.points=x.extendArray(void 0!==t.annotations.points?t.annotations.points:[],e.pointAnnotation),t}},{key:\"checkForDarkTheme\",value:function(t){t.theme&&\"dark\"===t.theme.mode&&(t.tooltip||(t.tooltip={}),\"light\"!==t.tooltip.theme&&(t.tooltip.theme=\"dark\"),t.chart.foreColor||(t.chart.foreColor=\"#f6f7f8\"),t.chart.background||(t.chart.background=\"#424242\"),t.theme.palette||(t.theme.palette=\"palette4\"))}},{key:\"handleUserInputErrors\",value:function(t){var e=t;if(e.tooltip.shared&&e.tooltip.intersect)throw new Error(\"tooltip.shared cannot be enabled when tooltip.intersect is true. Turn off any other option by setting it to false.\");if(\"bar\"===e.chart.type&&e.plotOptions.bar.horizontal){if(e.yaxis.length>1)throw new Error(\"Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false\");e.yaxis[0].reversed&&(e.yaxis[0].opposite=!0),e.xaxis.tooltip.enabled=!1,e.yaxis[0].tooltip.enabled=!1,e.chart.zoom.enabled=!1}return\"bar\"!==e.chart.type&&\"rangeBar\"!==e.chart.type||e.tooltip.shared&&\"barWidth\"===e.xaxis.crosshairs.width&&e.series.length>1&&(e.xaxis.crosshairs.width=\"tickWidth\"),\"candlestick\"!==e.chart.type&&\"boxPlot\"!==e.chart.type||e.yaxis[0].reversed&&(console.warn(\"Reversed y-axis in \".concat(e.chart.type,\" chart is not supported.\")),e.yaxis[0].reversed=!1),e}}]),t}(),O=function(){function t(){a(this,t)}return r(t,[{key:\"initGlobalVars\",value:function(t){t.series=[],t.seriesCandleO=[],t.seriesCandleH=[],t.seriesCandleM=[],t.seriesCandleL=[],t.seriesCandleC=[],t.seriesRangeStart=[],t.seriesRangeEnd=[],t.seriesRangeBar=[],t.seriesPercent=[],t.seriesGoals=[],t.seriesX=[],t.seriesZ=[],t.seriesNames=[],t.seriesTotals=[],t.seriesLog=[],t.seriesColors=[],t.stackedSeriesTotals=[],t.seriesXvalues=[],t.seriesYvalues=[],t.labels=[],t.hasGroups=!1,t.groups=[],t.categoryLabels=[],t.timescaleLabels=[],t.noLabelsProvided=!1,t.resizeTimer=null,t.selectionResizeTimer=null,t.delayedElements=[],t.pointsArray=[],t.dataLabelsRects=[],t.isXNumeric=!1,t.xaxisLabelsCount=0,t.skipLastTimelinelabel=!1,t.skipFirstTimelinelabel=!1,t.isDataXYZ=!1,t.isMultiLineX=!1,t.isMultipleYAxis=!1,t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE,t.minYArr=[],t.maxYArr=[],t.maxX=-Number.MAX_VALUE,t.minX=Number.MAX_VALUE,t.initialMaxX=-Number.MAX_VALUE,t.initialMinX=Number.MAX_VALUE,t.maxDate=0,t.minDate=Number.MAX_VALUE,t.minZ=Number.MAX_VALUE,t.maxZ=-Number.MAX_VALUE,t.minXDiff=Number.MAX_VALUE,t.yAxisScale=[],t.xAxisScale=null,t.xAxisTicksPositions=[],t.yLabelsCoords=[],t.yTitleCoords=[],t.barPadForNumericAxis=0,t.padHorizontal=0,t.xRange=0,t.yRange=[],t.zRange=0,t.dataPoints=0,t.xTickAmount=0}},{key:\"globalVars\",value:function(t){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],clientX:null,clientY:null,fill:{colors:[]},stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:t.markers.size,largestSize:0},animationEnded:!1,isTouchDevice:\"ontouchstart\"in window||navigator.msMaxTouchPoints,isDirty:!1,isExecCalled:!1,initialConfig:null,initialSeries:[],lastXAxis:[],lastYAxis:[],columnSeries:null,labels:[],timescaleLabels:[],noLabelsProvided:!1,allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],risingSeries:[],dataFormatXNumeric:!1,capturedSeriesIndex:-1,capturedDataPointIndex:-1,selectedDataPoints:[],goldenPadding:35,invalidLogScale:!1,ignoreYAxisIndexes:[],yAxisSameScaleIndices:[],maxValsInArrayIndex:0,radialSize:0,selection:void 0,zoomEnabled:\"zoom\"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.zoom&&t.chart.zoom.enabled,panEnabled:\"pan\"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.pan,selectionEnabled:\"selection\"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.selection,yaxis:null,mousedown:!1,lastClientPosition:{},visibleXRange:void 0,yValueDecimal:0,total:0,SVGNS:\"http://www.w3.org/2000/svg\",svgWidth:0,svgHeight:0,noData:!1,locale:{},dom:{},memory:{methodsToExec:[]},shouldAnimate:!0,skipLastTimelinelabel:!1,skipFirstTimelinelabel:!1,delayedElements:[],axisCharts:!0,isDataXYZ:!1,resized:!1,resizeTimer:null,comboCharts:!1,dataChanged:!1,previousPaths:[],allSeriesHasEqualX:!0,pointsArray:[],dataLabelsRects:[],lastDrawnDataLabelsIndexes:[],hasNullValues:!1,easing:null,zoomed:!1,gridWidth:0,gridHeight:0,rotateXLabels:!1,defaultLabels:!1,xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,LINE_HEIGHT_RATIO:1.618,xAxisLabelsHeight:0,xAxisGroupLabelsHeight:0,xAxisLabelsWidth:0,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateX:0,translateY:0,translateYAxisX:[],yAxisWidths:[],translateXAxisY:0,translateXAxisX:0,tooltip:null}}},{key:\"init\",value:function(t){var e=this.globalVars(t);return this.initGlobalVars(e),e.initialConfig=x.extend({},t),e.initialSeries=x.clone(t.series),e.lastXAxis=x.clone(e.initialConfig.xaxis),e.lastYAxis=x.clone(e.initialConfig.yaxis),e}}]),t}(),W=function(){function t(e){a(this,t),this.opts=e}return r(t,[{key:\"init\",value:function(){var t=new N(this.opts).init({responsiveOverride:!1});return{config:t,globals:(new O).init(t)}}}]),t}(),B=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.seriesGoals=[],this.coreUtils=new y(this.ctx)}return r(t,[{key:\"isMultiFormat\",value:function(){return this.isFormatXY()||this.isFormat2DArray()}},{key:\"isFormatXY\",value:function(){var t=this.w.config.series.slice(),e=new E(this.ctx);if(this.activeSeriesIndex=e.getActiveConfigSeriesIndex(),void 0!==t[this.activeSeriesIndex].data&&t[this.activeSeriesIndex].data.length>0&&null!==t[this.activeSeriesIndex].data[0]&&void 0!==t[this.activeSeriesIndex].data[0].x&&null!==t[this.activeSeriesIndex].data[0])return!0}},{key:\"isFormat2DArray\",value:function(){var t=this.w.config.series.slice(),e=new E(this.ctx);if(this.activeSeriesIndex=e.getActiveConfigSeriesIndex(),void 0!==t[this.activeSeriesIndex].data&&t[this.activeSeriesIndex].data.length>0&&void 0!==t[this.activeSeriesIndex].data[0]&&null!==t[this.activeSeriesIndex].data[0]&&t[this.activeSeriesIndex].data[0].constructor===Array)return!0}},{key:\"handleFormat2DArray\",value:function(t,e){for(var i=this.w.config,a=this.w.globals,s=\"boxPlot\"===i.chart.type||\"boxPlot\"===i.series[e].type,r=0;r<t[e].data.length;r++)if(void 0!==t[e].data[r][1]&&(Array.isArray(t[e].data[r][1])&&4===t[e].data[r][1].length&&!s?this.twoDSeries.push(x.parseNumber(t[e].data[r][1][3])):t[e].data[r].length>=5?this.twoDSeries.push(x.parseNumber(t[e].data[r][4])):this.twoDSeries.push(x.parseNumber(t[e].data[r][1])),a.dataFormatXNumeric=!0),\"datetime\"===i.xaxis.type){var o=new Date(t[e].data[r][0]);o=new Date(o).getTime(),this.twoDSeriesX.push(o)}else this.twoDSeriesX.push(t[e].data[r][0]);for(var n=0;n<t[e].data.length;n++)void 0!==t[e].data[n][2]&&(this.threeDSeries.push(t[e].data[n][2]),a.isDataXYZ=!0)}},{key:\"handleFormatXY\",value:function(t,e){var i=this.w.config,a=this.w.globals,s=new R(this.ctx),r=e;a.collapsedSeriesIndices.indexOf(e)>-1&&(r=this.activeSeriesIndex);for(var o=0;o<t[e].data.length;o++)void 0!==t[e].data[o].y&&(Array.isArray(t[e].data[o].y)?this.twoDSeries.push(x.parseNumber(t[e].data[o].y[t[e].data[o].y.length-1])):this.twoDSeries.push(x.parseNumber(t[e].data[o].y))),void 0!==t[e].data[o].goals&&Array.isArray(t[e].data[o].goals)?(void 0===this.seriesGoals[e]&&(this.seriesGoals[e]=[]),this.seriesGoals[e].push(t[e].data[o].goals)):(void 0===this.seriesGoals[e]&&(this.seriesGoals[e]=[]),this.seriesGoals[e].push(null));for(var n=0;n<t[r].data.length;n++){var l=\"string\"==typeof t[r].data[n].x,h=Array.isArray(t[r].data[n].x),c=!h&&!!s.isValidDate(t[r].data[n].x.toString());if(l||c)if(l||i.xaxis.convertedCatToNumeric){var d=a.isBarHorizontal&&a.isRangeData;\"datetime\"!==i.xaxis.type||d?(this.fallbackToCategory=!0,this.twoDSeriesX.push(t[r].data[n].x)):this.twoDSeriesX.push(s.parseDate(t[r].data[n].x))}else\"datetime\"===i.xaxis.type?this.twoDSeriesX.push(s.parseDate(t[r].data[n].x.toString())):(a.dataFormatXNumeric=!0,a.isXNumeric=!0,this.twoDSeriesX.push(parseFloat(t[r].data[n].x)));else h?(this.fallbackToCategory=!0,this.twoDSeriesX.push(t[r].data[n].x)):(a.isXNumeric=!0,a.dataFormatXNumeric=!0,this.twoDSeriesX.push(t[r].data[n].x))}if(t[e].data[0]&&void 0!==t[e].data[0].z){for(var g=0;g<t[e].data.length;g++)this.threeDSeries.push(t[e].data[g].z);a.isDataXYZ=!0}}},{key:\"handleRangeData\",value:function(t,e){var i=this.w.globals,a={};return this.isFormat2DArray()?a=this.handleRangeDataFormat(\"array\",t,e):this.isFormatXY()&&(a=this.handleRangeDataFormat(\"xy\",t,e)),i.seriesRangeStart.push(a.start),i.seriesRangeEnd.push(a.end),i.seriesRangeBar.push(a.rangeUniques),i.seriesRangeBar.forEach((function(t,e){t&&t.forEach((function(t,e){t.y.forEach((function(e,i){for(var a=0;a<t.y.length;a++)if(i!==a){var s=e.y1,r=e.y2,o=t.y[a].y1;s<=t.y[a].y2&&o<=r&&(t.overlaps.indexOf(e.rangeName)<0&&t.overlaps.push(e.rangeName),t.overlaps.indexOf(t.y[a].rangeName)<0&&t.overlaps.push(t.y[a].rangeName))}}))}))})),a}},{key:\"handleCandleStickBoxData\",value:function(t,e){var i=this.w.globals,a={};return this.isFormat2DArray()?a=this.handleCandleStickBoxDataFormat(\"array\",t,e):this.isFormatXY()&&(a=this.handleCandleStickBoxDataFormat(\"xy\",t,e)),i.seriesCandleO[e]=a.o,i.seriesCandleH[e]=a.h,i.seriesCandleM[e]=a.m,i.seriesCandleL[e]=a.l,i.seriesCandleC[e]=a.c,a}},{key:\"handleRangeDataFormat\",value:function(t,e,i){var a=[],s=[],r=e[i].data.filter((function(t,e,i){return e===i.findIndex((function(e){return e.x===t.x}))})).map((function(t,e){return{x:t.x,overlaps:[],y:[]}})),o=\"Please provide [Start, End] values in valid format. Read more https://apexcharts.com/docs/series/#rangecharts\",n=new E(this.ctx).getActiveConfigSeriesIndex();if(\"array\"===t){if(2!==e[n].data[0][1].length)throw new Error(o);for(var l=0;l<e[i].data.length;l++)a.push(e[i].data[l][1][0]),s.push(e[i].data[l][1][1])}else if(\"xy\"===t){if(2!==e[n].data[0].y.length)throw new Error(o);for(var h=function(t){var o=x.randomId(),n=e[i].data[t].x,l={y1:e[i].data[t].y[0],y2:e[i].data[t].y[1],rangeName:o};e[i].data[t].rangeName=o;var h=r.findIndex((function(t){return t.x===n}));r[h].y.push(l),a.push(l.y1),s.push(l.y2)},c=0;c<e[i].data.length;c++)h(c)}return{start:a,end:s,rangeUniques:r}}},{key:\"handleCandleStickBoxDataFormat\",value:function(t,e,i){var a=this.w,s=\"boxPlot\"===a.config.chart.type||\"boxPlot\"===a.config.series[i].type,r=[],o=[],n=[],l=[],h=[];if(\"array\"===t)if(s&&6===e[i].data[0].length||!s&&5===e[i].data[0].length)for(var c=0;c<e[i].data.length;c++)r.push(e[i].data[c][1]),o.push(e[i].data[c][2]),s?(n.push(e[i].data[c][3]),l.push(e[i].data[c][4]),h.push(e[i].data[c][5])):(l.push(e[i].data[c][3]),h.push(e[i].data[c][4]));else for(var d=0;d<e[i].data.length;d++)Array.isArray(e[i].data[d][1])&&(r.push(e[i].data[d][1][0]),o.push(e[i].data[d][1][1]),s?(n.push(e[i].data[d][1][2]),l.push(e[i].data[d][1][3]),h.push(e[i].data[d][1][4])):(l.push(e[i].data[d][1][2]),h.push(e[i].data[d][1][3])));else if(\"xy\"===t)for(var g=0;g<e[i].data.length;g++)Array.isArray(e[i].data[g].y)&&(r.push(e[i].data[g].y[0]),o.push(e[i].data[g].y[1]),s?(n.push(e[i].data[g].y[2]),l.push(e[i].data[g].y[3]),h.push(e[i].data[g].y[4])):(l.push(e[i].data[g].y[2]),h.push(e[i].data[g].y[3])));return{o:r,h:o,m:n,l:l,c:h}}},{key:\"parseDataAxisCharts\",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.ctx,a=this.w.config,s=this.w.globals,r=new R(i),o=a.labels.length>0?a.labels.slice():a.xaxis.categories.slice();s.isRangeBar=\"rangeBar\"===a.chart.type&&s.isBarHorizontal,s.hasGroups=\"category\"===a.xaxis.type&&a.xaxis.group.groups.length>0,s.hasGroups&&(s.groups=a.xaxis.group.groups);for(var n=function(){for(var t=0;t<o.length;t++)if(\"string\"==typeof o[t]){if(!r.isValidDate(o[t]))throw new Error(\"You have provided invalid Date format. Please provide a valid JavaScript Date\");e.twoDSeriesX.push(r.parseDate(o[t]))}else e.twoDSeriesX.push(o[t])},l=0;l<t.length;l++){if(this.twoDSeries=[],this.twoDSeriesX=[],this.threeDSeries=[],void 0===t[l].data)return void console.error(\"It is a possibility that you may have not included 'data' property in series.\");if(\"rangeBar\"!==a.chart.type&&\"rangeArea\"!==a.chart.type&&\"rangeBar\"!==t[l].type&&\"rangeArea\"!==t[l].type||(s.isRangeData=!0,this.handleRangeData(t,l)),this.isMultiFormat())this.isFormat2DArray()?this.handleFormat2DArray(t,l):this.isFormatXY()&&this.handleFormatXY(t,l),\"candlestick\"!==a.chart.type&&\"candlestick\"!==t[l].type&&\"boxPlot\"!==a.chart.type&&\"boxPlot\"!==t[l].type||this.handleCandleStickBoxData(t,l),s.series.push(this.twoDSeries),s.labels.push(this.twoDSeriesX),s.seriesX.push(this.twoDSeriesX),s.seriesGoals=this.seriesGoals,l!==this.activeSeriesIndex||this.fallbackToCategory||(s.isXNumeric=!0);else{\"datetime\"===a.xaxis.type?(s.isXNumeric=!0,n(),s.seriesX.push(this.twoDSeriesX)):\"numeric\"===a.xaxis.type&&(s.isXNumeric=!0,o.length>0&&(this.twoDSeriesX=o,s.seriesX.push(this.twoDSeriesX))),s.labels.push(this.twoDSeriesX);var h=t[l].data.map((function(t){return x.parseNumber(t)}));s.series.push(h)}s.seriesZ.push(this.threeDSeries),void 0!==t[l].name?s.seriesNames.push(t[l].name):s.seriesNames.push(\"series-\"+parseInt(l+1,10)),void 0!==t[l].color?s.seriesColors.push(t[l].color):s.seriesColors.push(void 0)}return this.w}},{key:\"parseDataNonAxisCharts\",value:function(t){var e=this.w.globals,i=this.w.config;e.series=t.slice(),e.seriesNames=i.labels.slice();for(var a=0;a<e.series.length;a++)void 0===e.seriesNames[a]&&e.seriesNames.push(\"series-\"+(a+1));return this.w}},{key:\"handleExternalLabelsData\",value:function(t){var e=this.w.config,i=this.w.globals;if(e.xaxis.categories.length>0)i.labels=e.xaxis.categories;else if(e.labels.length>0)i.labels=e.labels.slice();else if(this.fallbackToCategory){if(i.labels=i.labels[0],i.seriesRangeBar.length&&(i.seriesRangeBar.map((function(t){t.forEach((function(t){i.labels.indexOf(t.x)<0&&t.x&&i.labels.push(t.x)}))})),i.labels=i.labels.filter((function(t,e,i){return i.indexOf(t)===e}))),e.xaxis.convertedCatToNumeric)new D(e).convertCatToNumericXaxis(e,this.ctx,i.seriesX[0]),this._generateExternalLabels(t)}else this._generateExternalLabels(t)}},{key:\"_generateExternalLabels\",value:function(t){var e=this.w.globals,i=this.w.config,a=[];if(e.axisCharts){if(e.series.length>0)if(this.isFormatXY())for(var s=i.series.map((function(t,e){return t.data.filter((function(t,e,i){return i.findIndex((function(e){return e.x===t.x}))===e}))})),r=s.reduce((function(t,e,i,a){return a[t].length>e.length?t:i}),0),o=0;o<s[r].length;o++)a.push(o+1);else for(var n=0;n<e.series[e.maxValsInArrayIndex].length;n++)a.push(n+1);e.seriesX=[];for(var l=0;l<t.length;l++)e.seriesX.push(a);e.isXNumeric=!0}if(0===a.length){a=e.axisCharts?[]:e.series.map((function(t,e){return e+1}));for(var h=0;h<t.length;h++)e.seriesX.push(a)}e.labels=a,i.xaxis.convertedCatToNumeric&&(e.categoryLabels=a.map((function(t){return i.xaxis.labels.formatter(t)}))),e.noLabelsProvided=!0}},{key:\"parseData\",value:function(t){var e=this.w,i=e.config,a=e.globals;if(this.excludeCollapsedSeriesInYAxis(),this.fallbackToCategory=!1,this.ctx.core.resetGlobals(),this.ctx.core.isMultipleY(),a.axisCharts?this.parseDataAxisCharts(t):this.parseDataNonAxisCharts(t),this.coreUtils.getLargestSeries(),\"bar\"===i.chart.type&&i.chart.stacked){var s=new E(this.ctx);a.series=s.setNullSeriesToZeroValues(a.series)}this.coreUtils.getSeriesTotals(),a.axisCharts&&this.coreUtils.getStackedSeriesTotals(),this.coreUtils.getPercentSeries(),a.dataFormatXNumeric||a.isXNumeric&&(\"numeric\"!==i.xaxis.type||0!==i.labels.length||0!==i.xaxis.categories.length)||this.handleExternalLabelsData(t);for(var r=this.coreUtils.getCategoryLabels(a.labels),o=0;o<r.length;o++)if(Array.isArray(r[o])){a.isMultiLineX=!0;break}}},{key:\"excludeCollapsedSeriesInYAxis\",value:function(){var t=this,e=this.w;e.globals.ignoreYAxisIndexes=e.globals.collapsedSeries.map((function(i,a){if(t.w.globals.isMultipleYAxis&&!e.config.chart.stacked)return i.index}))}}]),t}(),V=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w,this.tooltipKeyFormat=\"dd MMM\"}return r(t,[{key:\"xLabelFormat\",value:function(t,e,i,a){var s=this.w;if(\"datetime\"===s.config.xaxis.type&&void 0===s.config.xaxis.labels.formatter&&void 0===s.config.tooltip.x.formatter){var r=new R(this.ctx);return r.formatDate(r.getDate(e),s.config.tooltip.x.format)}return t(e,i,a)}},{key:\"defaultGeneralFormatter\",value:function(t){return Array.isArray(t)?t.map((function(t){return t})):t}},{key:\"defaultYFormatter\",value:function(t,e,i){var a=this.w;return x.isNumber(t)&&(t=0!==a.globals.yValueDecimal?t.toFixed(void 0!==e.decimalsInFloat?e.decimalsInFloat:a.globals.yValueDecimal):a.globals.maxYArr[i]-a.globals.minYArr[i]<5?t.toFixed(1):t.toFixed(0)),t}},{key:\"setLabelFormatters\",value:function(){var t=this,e=this.w;return e.globals.xaxisTooltipFormatter=function(e){return t.defaultGeneralFormatter(e)},e.globals.ttKeyFormatter=function(e){return t.defaultGeneralFormatter(e)},e.globals.ttZFormatter=function(t){return t},e.globals.legendFormatter=function(e){return t.defaultGeneralFormatter(e)},void 0!==e.config.xaxis.labels.formatter?e.globals.xLabelFormatter=e.config.xaxis.labels.formatter:e.globals.xLabelFormatter=function(t){if(x.isNumber(t)){if(!e.config.xaxis.convertedCatToNumeric&&\"numeric\"===e.config.xaxis.type){if(x.isNumber(e.config.xaxis.decimalsInFloat))return t.toFixed(e.config.xaxis.decimalsInFloat);var i=e.globals.maxX-e.globals.minX;return i>0&&i<100?t.toFixed(1):t.toFixed(0)}if(e.globals.isBarHorizontal)if(e.globals.maxY-e.globals.minYArr<4)return t.toFixed(1);return t.toFixed(0)}return t},\"function\"==typeof e.config.tooltip.x.formatter?e.globals.ttKeyFormatter=e.config.tooltip.x.formatter:e.globals.ttKeyFormatter=e.globals.xLabelFormatter,\"function\"==typeof e.config.xaxis.tooltip.formatter&&(e.globals.xaxisTooltipFormatter=e.config.xaxis.tooltip.formatter),(Array.isArray(e.config.tooltip.y)||void 0!==e.config.tooltip.y.formatter)&&(e.globals.ttVal=e.config.tooltip.y),void 0!==e.config.tooltip.z.formatter&&(e.globals.ttZFormatter=e.config.tooltip.z.formatter),void 0!==e.config.legend.formatter&&(e.globals.legendFormatter=e.config.legend.formatter),e.config.yaxis.forEach((function(i,a){void 0!==i.labels.formatter?e.globals.yLabelFormatters[a]=i.labels.formatter:e.globals.yLabelFormatters[a]=function(s){return e.globals.xyCharts?Array.isArray(s)?s.map((function(e){return t.defaultYFormatter(e,i,a)})):t.defaultYFormatter(s,i,a):s}})),e.globals}},{key:\"heatmapLabelFormatters\",value:function(){var t=this.w;if(\"heatmap\"===t.config.chart.type){t.globals.yAxisScale[0].result=t.globals.seriesNames.slice();var e=t.globals.seriesNames.reduce((function(t,e){return t.length>e.length?t:e}),0);t.globals.yAxisScale[0].niceMax=e,t.globals.yAxisScale[0].niceMin=e}}}]),t}(),G=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"getLabel\",value:function(t,e,i,a){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:\"12px\",o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],n=this.w,l=void 0===t[a]?\"\":t[a],h=l,c=n.globals.xLabelFormatter,d=n.config.xaxis.labels.formatter,g=!1,u=new V(this.ctx),f=l;o&&(h=u.xLabelFormat(c,l,f,{i:a,dateFormatter:new R(this.ctx).formatDate,w:n}),void 0!==d&&(h=d(l,t[a],{i:a,dateFormatter:new R(this.ctx).formatDate,w:n})));var p=function(t){var i=null;return e.forEach((function(t){\"month\"===t.unit?i=\"year\":\"day\"===t.unit?i=\"month\":\"hour\"===t.unit?i=\"day\":\"minute\"===t.unit&&(i=\"hour\")})),i===t};e.length>0?(g=p(e[a].unit),i=e[a].position,h=e[a].value):\"datetime\"===n.config.xaxis.type&&void 0===d&&(h=\"\"),void 0===h&&(h=\"\"),h=Array.isArray(h)?h:h.toString();var x=new m(this.ctx),b={};b=n.globals.rotateXLabels&&o?x.getTextRects(h,parseInt(r,10),null,\"rotate(\".concat(n.config.xaxis.labels.rotate,\" 0 0)\"),!1):x.getTextRects(h,parseInt(r,10));var v=!n.config.xaxis.labels.showDuplicates&&this.ctx.timeScale;return!Array.isArray(h)&&(0===h.indexOf(\"NaN\")||0===h.toLowerCase().indexOf(\"invalid\")||h.toLowerCase().indexOf(\"infinity\")>=0||s.indexOf(h)>=0&&v)&&(h=\"\"),{x:i,text:h,textRect:b,isBold:g}}},{key:\"checkLabelBasedOnTickamount\",value:function(t,e,i){var a=this.w,s=a.config.xaxis.tickAmount;return\"dataPoints\"===s&&(s=Math.round(a.globals.gridWidth/120)),s>i||t%Math.round(i/(s+1))==0||(e.text=\"\"),e}},{key:\"checkForOverflowingLabels\",value:function(t,e,i,a,s){var r=this.w;if(0===t&&r.globals.skipFirstTimelinelabel&&(e.text=\"\"),t===i-1&&r.globals.skipLastTimelinelabel&&(e.text=\"\"),r.config.xaxis.labels.hideOverlappingLabels&&a.length>0){var o=s[s.length-1];e.x<o.textRect.width/(r.globals.rotateXLabels?Math.abs(r.config.xaxis.labels.rotate)/12:1.01)+o.x&&(e.text=\"\")}return e}},{key:\"checkForReversedLabels\",value:function(t,e){var i=this.w;return i.config.yaxis[t]&&i.config.yaxis[t].reversed&&e.reverse(),e}},{key:\"isYAxisHidden\",value:function(t){var e=this.w,i=new y(this.ctx);return!e.config.yaxis[t].show||!e.config.yaxis[t].showForNullSeries&&i.isSeriesNull(t)&&-1===e.globals.collapsedSeriesIndices.indexOf(t)}},{key:\"getYAxisForeColor\",value:function(t,e){var i=this.w;return Array.isArray(t)&&i.globals.yAxisScale[e]&&this.ctx.theme.pushExtraColors(t,i.globals.yAxisScale[e].result.length,!1),t}},{key:\"drawYAxisTicks\",value:function(t,e,i,a,s,r,o){var n=this.w,l=new m(this.ctx),h=n.globals.translateY;if(a.show&&e>0){!0===n.config.yaxis[s].opposite&&(t+=a.width);for(var c=e;c>=0;c--){var d=h+e/10+n.config.yaxis[s].labels.offsetY-1;n.globals.isBarHorizontal&&(d=r*c),\"heatmap\"===n.config.chart.type&&(d+=r/2);var g=l.drawLine(t+i.offsetX-a.width+a.offsetX,d+a.offsetY,t+i.offsetX+a.offsetX,d+a.offsetY,a.color);o.add(g),h+=r}}}}]),t}(),j=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"scaleSvgNode\",value:function(t,e){var i=parseFloat(t.getAttributeNS(null,\"width\")),a=parseFloat(t.getAttributeNS(null,\"height\"));t.setAttributeNS(null,\"width\",i*e),t.setAttributeNS(null,\"height\",a*e),t.setAttributeNS(null,\"viewBox\",\"0 0 \"+i+\" \"+a)}},{key:\"fixSvgStringForIe11\",value:function(t){if(!x.isIE11())return t.replace(/&nbsp;/g,\"&#160;\");var e=0,i=t.replace(/xmlns=\"http:\\/\\/www.w3.org\\/2000\\/svg\"/g,(function(t){return 2===++e?'xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:svgjs=\"http://svgjs.dev\"':t}));return i=(i=i.replace(/xmlns:NS\\d+=\"\"/g,\"\")).replace(/NS\\d+:(\\w+:\\w+=\")/g,\"$1\")}},{key:\"getSvgString\",value:function(t){var e=this.w.globals.dom.Paper.svg();if(1!==t){var i=this.w.globals.dom.Paper.node.cloneNode(!0);this.scaleSvgNode(i,t),e=(new XMLSerializer).serializeToString(i)}return this.fixSvgStringForIe11(e)}},{key:\"cleanup\",value:function(){var t=this.w,e=t.globals.dom.baseEl.getElementsByClassName(\"apexcharts-xcrosshairs\"),i=t.globals.dom.baseEl.getElementsByClassName(\"apexcharts-ycrosshairs\"),a=t.globals.dom.baseEl.querySelectorAll(\".apexcharts-zoom-rect, .apexcharts-selection-rect\");Array.prototype.forEach.call(a,(function(t){t.setAttribute(\"width\",0)})),e&&e[0]&&(e[0].setAttribute(\"x\",-500),e[0].setAttribute(\"x1\",-500),e[0].setAttribute(\"x2\",-500)),i&&i[0]&&(i[0].setAttribute(\"y\",-100),i[0].setAttribute(\"y1\",-100),i[0].setAttribute(\"y2\",-100))}},{key:\"svgUrl\",value:function(){this.cleanup();var t=this.getSvgString(),e=new Blob([t],{type:\"image/svg+xml;charset=utf-8\"});return URL.createObjectURL(e)}},{key:\"dataURI\",value:function(t){var e=this;return new Promise((function(i){var a=e.w,s=t?t.scale||t.width/a.globals.svgWidth:1;e.cleanup();var r=document.createElement(\"canvas\");r.width=a.globals.svgWidth*s,r.height=parseInt(a.globals.dom.elWrap.style.height,10)*s;var o=\"transparent\"===a.config.chart.background?\"#fff\":a.config.chart.background,n=r.getContext(\"2d\");n.fillStyle=o,n.fillRect(0,0,r.width*s,r.height*s);var l=e.getSvgString(s);if(window.canvg&&x.isIE11()){var h=window.canvg.Canvg.fromString(n,l,{ignoreClear:!0,ignoreDimensions:!0});h.start();var c=r.msToBlob();h.stop(),i({blob:c})}else{var d=\"data:image/svg+xml,\"+encodeURIComponent(l),g=new Image;g.crossOrigin=\"anonymous\",g.onload=function(){if(n.drawImage(g,0,0),r.msToBlob){var t=r.msToBlob();i({blob:t})}else{var e=r.toDataURL(\"image/png\");i({imgURI:e})}},g.src=d}}))}},{key:\"exportToSVG\",value:function(){this.triggerDownload(this.svgUrl(),this.w.config.chart.toolbar.export.svg.filename,\".svg\")}},{key:\"exportToPng\",value:function(){var t=this;this.dataURI().then((function(e){var i=e.imgURI,a=e.blob;a?navigator.msSaveOrOpenBlob(a,t.w.globals.chartID+\".png\"):t.triggerDownload(i,t.w.config.chart.toolbar.export.png.filename,\".png\")}))}},{key:\"exportToCSV\",value:function(t){var e=this,i=t.series,a=t.columnDelimiter,s=t.lineDelimiter,r=void 0===s?\"\\n\":s,o=this.w,n=[],l=[],h=\"\",c=new B(this.ctx),d=new G(this.ctx),g=function(t){var i=\"\";if(o.globals.axisCharts){if(\"category\"===o.config.xaxis.type||o.config.xaxis.convertedCatToNumeric)if(o.globals.isBarHorizontal){var s=o.globals.yLabelFormatters[0],r=new E(e.ctx).getActiveConfigSeriesIndex();i=s(o.globals.labels[t],{seriesIndex:r,dataPointIndex:t,w:o})}else i=d.getLabel(o.globals.labels,o.globals.timescaleLabels,0,t).text;\"datetime\"===o.config.xaxis.type&&(o.config.xaxis.categories.length?i=o.config.xaxis.categories[t]:o.config.labels.length&&(i=o.config.labels[t]))}else i=o.config.labels[t];return Array.isArray(i)&&(i=i.join(\" \")),x.isNumber(i)?i:i.split(a).join(\"\")};n.push(o.config.chart.toolbar.export.csv.headerCategory),i.map((function(t,e){var i=t.name?t.name:\"series-\".concat(e);o.globals.axisCharts&&n.push(i.split(a).join(\"\")?i.split(a).join(\"\"):\"series-\".concat(e))})),o.globals.axisCharts||(n.push(o.config.chart.toolbar.export.csv.headerValue),l.push(n.join(a))),i.map((function(t,e){o.globals.axisCharts?function(t,e){if(n.length&&0===e&&l.push(n.join(a)),t.data&&t.data.length)for(var s=0;s<t.data.length;s++){n=[];var r=g(s);if(r||(c.isFormatXY()?r=i[e].data[s].x:c.isFormat2DArray()&&(r=i[e].data[s]?i[e].data[s][0]:\"\")),0===e){n.push((d=r,\"datetime\"===o.config.xaxis.type&&String(d).length>=10?o.config.chart.toolbar.export.csv.dateFormatter(r):x.isNumber(r)?r:r.split(a).join(\"\")));for(var h=0;h<o.globals.series.length;h++)n.push(o.globals.series[h][s])}(\"candlestick\"===o.config.chart.type||t.type&&\"candlestick\"===t.type)&&(n.pop(),n.push(o.globals.seriesCandleO[e][s]),n.push(o.globals.seriesCandleH[e][s]),n.push(o.globals.seriesCandleL[e][s]),n.push(o.globals.seriesCandleC[e][s])),(\"boxPlot\"===o.config.chart.type||t.type&&\"boxPlot\"===t.type)&&(n.pop(),n.push(o.globals.seriesCandleO[e][s]),n.push(o.globals.seriesCandleH[e][s]),n.push(o.globals.seriesCandleM[e][s]),n.push(o.globals.seriesCandleL[e][s]),n.push(o.globals.seriesCandleC[e][s])),\"rangeBar\"===o.config.chart.type&&(n.pop(),n.push(o.globals.seriesRangeStart[e][s]),n.push(o.globals.seriesRangeEnd[e][s])),n.length&&l.push(n.join(a))}var d}(t,e):((n=[]).push(o.globals.labels[e].split(a).join(\"\")),n.push(o.globals.series[e]),l.push(n.join(a)))})),h+=l.join(r),this.triggerDownload(\"data:text/csv; charset=utf-8,\"+encodeURIComponent(\"\\ufeff\"+h),o.config.chart.toolbar.export.csv.filename,\".csv\")}},{key:\"triggerDownload\",value:function(t,e,i){var a=document.createElement(\"a\");a.href=t,a.download=(e||this.w.globals.chartID)+i,document.body.appendChild(a),a.click(),document.body.removeChild(a)}}]),t}(),_=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w;var i=this.w;this.axesUtils=new G(e),this.xaxisLabels=i.globals.labels.slice(),i.globals.timescaleLabels.length>0&&!i.globals.isBarHorizontal&&(this.xaxisLabels=i.globals.timescaleLabels.slice()),i.config.xaxis.overwriteCategories&&(this.xaxisLabels=i.config.xaxis.overwriteCategories),this.drawnLabels=[],this.drawnLabelsRects=[],\"top\"===i.config.xaxis.position?this.offY=0:this.offY=i.globals.gridHeight+1,this.offY=this.offY+i.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal=\"bar\"===i.config.chart.type&&i.config.plotOptions.bar.horizontal,this.xaxisFontSize=i.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=i.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=i.config.xaxis.labels.style.colors,this.xaxisBorderWidth=i.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=i.config.yaxis[0].axisBorder.width.toString()),this.xaxisBorderWidth.indexOf(\"%\")>-1?this.xaxisBorderWidth=i.globals.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=i.config.xaxis.axisBorder.height,this.yaxis=i.config.yaxis[0]}return r(t,[{key:\"drawXaxis\",value:function(){var t=this.w,e=new m(this.ctx),i=e.group({class:\"apexcharts-xaxis\",transform:\"translate(\".concat(t.config.xaxis.offsetX,\", \").concat(t.config.xaxis.offsetY,\")\")}),a=e.group({class:\"apexcharts-xaxis-texts-g\",transform:\"translate(\".concat(t.globals.translateXAxisX,\", \").concat(t.globals.translateXAxisY,\")\")});i.add(a);for(var s=[],r=0;r<this.xaxisLabels.length;r++)s.push(this.xaxisLabels[r]);if(this.drawXAxisLabelAndGroup(!0,e,a,s,t.globals.isXNumeric,(function(t,e){return e})),t.globals.hasGroups){var o=t.globals.groups;s=[];for(var n=0;n<o.length;n++)s.push(o[n].title);var l={};t.config.xaxis.group.style&&(l.xaxisFontSize=t.config.xaxis.group.style.fontSize,l.xaxisFontFamily=t.config.xaxis.group.style.fontFamily,l.xaxisForeColors=t.config.xaxis.group.style.colors,l.fontWeight=t.config.xaxis.group.style.fontWeight,l.cssClass=t.config.xaxis.group.style.cssClass),this.drawXAxisLabelAndGroup(!1,e,a,s,!1,(function(t,e){return o[t].cols*e}),l)}if(void 0!==t.config.xaxis.title.text){var h=e.group({class:\"apexcharts-xaxis-title\"}),c=e.drawText({x:t.globals.gridWidth/2+t.config.xaxis.title.offsetX,y:this.offY+parseFloat(this.xaxisFontSize)+t.globals.xAxisLabelsHeight+t.config.xaxis.title.offsetY,text:t.config.xaxis.title.text,textAnchor:\"middle\",fontSize:t.config.xaxis.title.style.fontSize,fontFamily:t.config.xaxis.title.style.fontFamily,fontWeight:t.config.xaxis.title.style.fontWeight,foreColor:t.config.xaxis.title.style.color,cssClass:\"apexcharts-xaxis-title-text \"+t.config.xaxis.title.style.cssClass});h.add(c),i.add(h)}if(t.config.xaxis.axisBorder.show){var d=t.globals.barPadForNumericAxis,g=e.drawLine(t.globals.padHorizontal+t.config.xaxis.axisBorder.offsetX-d,this.offY,this.xaxisBorderWidth+d,this.offY,t.config.xaxis.axisBorder.color,0,this.xaxisBorderHeight);i.add(g)}return i}},{key:\"drawXAxisLabelAndGroup\",value:function(t,e,i,a,s,r){var o,n=this,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},h=[],c=[],d=this.w,g=l.xaxisFontSize||this.xaxisFontSize,u=l.xaxisFontFamily||this.xaxisFontFamily,f=l.xaxisForeColors||this.xaxisForeColors,p=l.fontWeight||d.config.xaxis.labels.style.fontWeight,x=l.cssClass||d.config.xaxis.labels.style.cssClass,b=d.globals.padHorizontal,v=a.length,m=\"category\"===d.config.xaxis.type?d.globals.dataPoints:v;if(s){var y=m>1?m-1:m;o=d.globals.gridWidth/y,b=b+r(0,o)/2+d.config.xaxis.labels.offsetX}else o=d.globals.gridWidth/m,b=b+r(0,o)+d.config.xaxis.labels.offsetX;for(var w=function(s){var l=b-r(s,o)/2+d.config.xaxis.labels.offsetX;0===s&&1===v&&o/2===b&&1===m&&(l=d.globals.gridWidth/2);var y=n.axesUtils.getLabel(a,d.globals.timescaleLabels,l,s,h,g,t),w=28;d.globals.rotateXLabels&&t&&(w=22),t||(w=w+parseFloat(g)+(d.globals.xAxisLabelsHeight-d.globals.xAxisGroupLabelsHeight)+(d.globals.rotateXLabels?10:0)),y=void 0!==d.config.xaxis.tickAmount&&\"dataPoints\"!==d.config.xaxis.tickAmount&&\"datetime\"!==d.config.xaxis.type?n.axesUtils.checkLabelBasedOnTickamount(s,y,v):n.axesUtils.checkForOverflowingLabels(s,y,v,h,c);if(t&&y.text&&d.globals.xaxisLabelsCount++,d.config.xaxis.labels.show){var k=e.drawText({x:y.x,y:n.offY+d.config.xaxis.labels.offsetY+w-(\"top\"===d.config.xaxis.position?d.globals.xAxisHeight+d.config.xaxis.axisTicks.height-2:0),text:y.text,textAnchor:\"middle\",fontWeight:y.isBold?600:p,fontSize:g,fontFamily:u,foreColor:Array.isArray(f)?t&&d.config.xaxis.convertedCatToNumeric?f[d.globals.minX+s-1]:f[s]:f,isPlainText:!1,cssClass:(t?\"apexcharts-xaxis-label \":\"apexcharts-xaxis-group-label \")+x});if(i.add(k),t){var A=document.createElementNS(d.globals.SVGNS,\"title\");A.textContent=Array.isArray(y.text)?y.text.join(\" \"):y.text,k.node.appendChild(A),\"\"!==y.text&&(h.push(y.text),c.push(y))}}s<v-1&&(b+=r(s+1,o))},k=0;k<=v-1;k++)w(k)}},{key:\"drawXaxisInversed\",value:function(t){var e,i,a=this,s=this.w,r=new m(this.ctx),o=s.config.yaxis[0].opposite?s.globals.translateYAxisX[t]:0,n=r.group({class:\"apexcharts-yaxis apexcharts-xaxis-inversed\",rel:t}),l=r.group({class:\"apexcharts-yaxis-texts-g apexcharts-xaxis-inversed-texts-g\",transform:\"translate(\"+o+\", 0)\"});n.add(l);var h=[];if(s.config.yaxis[t].show)for(var c=0;c<this.xaxisLabels.length;c++)h.push(this.xaxisLabels[c]);e=s.globals.gridHeight/h.length,i=-e/2.2;var d=s.globals.yLabelFormatters[0],g=s.config.yaxis[0].labels;if(g.show)for(var u=function(o){var n=void 0===h[o]?\"\":h[o];n=d(n,{seriesIndex:t,dataPointIndex:o,w:s});var c=a.axesUtils.getYAxisForeColor(g.style.colors,t),u=0;Array.isArray(n)&&(u=n.length/2*parseInt(g.style.fontSize,10));var f=r.drawText({x:g.offsetX-15,y:i+e+g.offsetY-u,text:n,textAnchor:a.yaxis.opposite?\"start\":\"end\",foreColor:Array.isArray(c)?c[o]:c,fontSize:g.style.fontSize,fontFamily:g.style.fontFamily,fontWeight:g.style.fontWeight,isPlainText:!1,cssClass:\"apexcharts-yaxis-label \"+g.style.cssClass});l.add(f);var p=document.createElementNS(s.globals.SVGNS,\"title\");if(p.textContent=Array.isArray(n)?n.join(\" \"):n,f.node.appendChild(p),0!==s.config.yaxis[t].labels.rotate){var x=r.rotateAroundCenter(f.node);f.node.setAttribute(\"transform\",\"rotate(\".concat(s.config.yaxis[t].labels.rotate,\" 0 \").concat(x.y,\")\"))}i+=e},f=0;f<=h.length-1;f++)u(f);if(void 0!==s.config.yaxis[0].title.text){var p=r.group({class:\"apexcharts-yaxis-title apexcharts-xaxis-title-inversed\",transform:\"translate(\"+o+\", 0)\"}),x=r.drawText({x:0,y:s.globals.gridHeight/2,text:s.config.yaxis[0].title.text,textAnchor:\"middle\",foreColor:s.config.yaxis[0].title.style.color,fontSize:s.config.yaxis[0].title.style.fontSize,fontWeight:s.config.yaxis[0].title.style.fontWeight,fontFamily:s.config.yaxis[0].title.style.fontFamily,cssClass:\"apexcharts-yaxis-title-text \"+s.config.yaxis[0].title.style.cssClass});p.add(x),n.add(p)}var b=0;this.isCategoryBarHorizontal&&s.config.yaxis[0].opposite&&(b=s.globals.gridWidth);var v=s.config.xaxis.axisBorder;if(v.show){var y=r.drawLine(s.globals.padHorizontal+v.offsetX+b,1+v.offsetY,s.globals.padHorizontal+v.offsetX+b,s.globals.gridHeight+v.offsetY,v.color,0);n.add(y)}return s.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(b,h.length,s.config.yaxis[0].axisBorder,s.config.yaxis[0].axisTicks,0,e,n),n}},{key:\"drawXaxisTicks\",value:function(t,e,i){var a=this.w,s=t;if(!(t<0||t-2>a.globals.gridWidth)){var r=this.offY+a.config.xaxis.axisTicks.offsetY;if(e=e+r+a.config.xaxis.axisTicks.height,\"top\"===a.config.xaxis.position&&(e=r-a.config.xaxis.axisTicks.height),a.config.xaxis.axisTicks.show){var o=new m(this.ctx).drawLine(t+a.config.xaxis.axisTicks.offsetX,r+a.config.xaxis.offsetY,s+a.config.xaxis.axisTicks.offsetX,e+a.config.xaxis.offsetY,a.config.xaxis.axisTicks.color);i.add(o),o.node.classList.add(\"apexcharts-xaxis-tick\")}}}},{key:\"getXAxisTicksPositions\",value:function(){var t=this.w,e=[],i=this.xaxisLabels.length,a=t.globals.padHorizontal;if(t.globals.timescaleLabels.length>0)for(var s=0;s<i;s++)a=this.xaxisLabels[s].position,e.push(a);else for(var r=i,o=0;o<r;o++){var n=r;t.globals.isXNumeric&&\"bar\"!==t.config.chart.type&&(n-=1),a+=t.globals.gridWidth/n,e.push(a)}return e}},{key:\"xAxisLabelCorrections\",value:function(){var t=this.w,e=new m(this.ctx),i=t.globals.dom.baseEl.querySelector(\".apexcharts-xaxis-texts-g\"),a=t.globals.dom.baseEl.querySelectorAll(\".apexcharts-xaxis-texts-g text:not(.apexcharts-xaxis-group-label)\"),s=t.globals.dom.baseEl.querySelectorAll(\".apexcharts-yaxis-inversed text\"),r=t.globals.dom.baseEl.querySelectorAll(\".apexcharts-xaxis-inversed-texts-g text tspan\");if(t.globals.rotateXLabels||t.config.xaxis.labels.rotateAlways)for(var o=0;o<a.length;o++){var n=e.rotateAroundCenter(a[o]);n.y=n.y-1,n.x=n.x+1,a[o].setAttribute(\"transform\",\"rotate(\".concat(t.config.xaxis.labels.rotate,\" \").concat(n.x,\" \").concat(n.y,\")\")),a[o].setAttribute(\"text-anchor\",\"end\");i.setAttribute(\"transform\",\"translate(0, \".concat(-10,\")\"));var l=a[o].childNodes;t.config.xaxis.labels.trim&&Array.prototype.forEach.call(l,(function(i){e.placeTextWithEllipsis(i,i.textContent,t.globals.xAxisLabelsHeight-(\"bottom\"===t.config.legend.position?20:10))}))}else!function(){for(var i=t.globals.gridWidth/(t.globals.labels.length+1),s=0;s<a.length;s++){var r=a[s].childNodes;t.config.xaxis.labels.trim&&\"datetime\"!==t.config.xaxis.type&&Array.prototype.forEach.call(r,(function(t){e.placeTextWithEllipsis(t,t.textContent,i)}))}}();if(s.length>0){var h=s[s.length-1].getBBox(),c=s[0].getBBox();h.x<-20&&s[s.length-1].parentNode.removeChild(s[s.length-1]),c.x+c.width>t.globals.gridWidth&&!t.globals.isBarHorizontal&&s[0].parentNode.removeChild(s[0]);for(var d=0;d<r.length;d++)e.placeTextWithEllipsis(r[d],r[d].textContent,t.config.yaxis[0].labels.maxWidth-(t.config.yaxis[0].title.text?2*parseFloat(t.config.yaxis[0].title.style.fontSize):0)-15)}}}]),t}(),U=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w;var i=this.w;this.xaxisLabels=i.globals.labels.slice(),this.axesUtils=new G(e),this.isRangeBar=i.globals.seriesRangeBar.length,i.globals.timescaleLabels.length>0&&(this.xaxisLabels=i.globals.timescaleLabels.slice())}return r(t,[{key:\"drawGridArea\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.w,i=new m(this.ctx);null===t&&(t=i.group({class:\"apexcharts-grid\"}));var a=i.drawLine(e.globals.padHorizontal,1,e.globals.padHorizontal,e.globals.gridHeight,\"transparent\"),s=i.drawLine(e.globals.padHorizontal,e.globals.gridHeight,e.globals.gridWidth,e.globals.gridHeight,\"transparent\");return t.add(s),t.add(a),t}},{key:\"drawGrid\",value:function(){var t=null;return this.w.globals.axisCharts&&(t=this.renderGrid(),this.drawGridArea(t.el)),t}},{key:\"createGridMask\",value:function(){var t=this.w,e=t.globals,i=new m(this.ctx),a=Array.isArray(t.config.stroke.width)?0:t.config.stroke.width;if(Array.isArray(t.config.stroke.width)){var s=0;t.config.stroke.width.forEach((function(t){s=Math.max(s,t)})),a=s}e.dom.elGridRectMask=document.createElementNS(e.SVGNS,\"clipPath\"),e.dom.elGridRectMask.setAttribute(\"id\",\"gridRectMask\".concat(e.cuid)),e.dom.elGridRectMarkerMask=document.createElementNS(e.SVGNS,\"clipPath\"),e.dom.elGridRectMarkerMask.setAttribute(\"id\",\"gridRectMarkerMask\".concat(e.cuid)),e.dom.elForecastMask=document.createElementNS(e.SVGNS,\"clipPath\"),e.dom.elForecastMask.setAttribute(\"id\",\"forecastMask\".concat(e.cuid)),e.dom.elNonForecastMask=document.createElementNS(e.SVGNS,\"clipPath\"),e.dom.elNonForecastMask.setAttribute(\"id\",\"nonForecastMask\".concat(e.cuid));var r=t.config.chart.type,o=0,n=0;(\"bar\"===r||\"rangeBar\"===r||\"candlestick\"===r||\"boxPlot\"===r||t.globals.comboBarCount>0)&&t.globals.isXNumeric&&!t.globals.isBarHorizontal&&(o=t.config.grid.padding.left,n=t.config.grid.padding.right,e.barPadForNumericAxis>o&&(o=e.barPadForNumericAxis,n=e.barPadForNumericAxis)),e.dom.elGridRect=i.drawRect(-a/2-o-2,-a/2,e.gridWidth+a+n+o+4,e.gridHeight+a,0,\"#fff\");var l=t.globals.markers.largestSize+1;e.dom.elGridRectMarker=i.drawRect(2*-l,2*-l,e.gridWidth+4*l,e.gridHeight+4*l,0,\"#fff\"),e.dom.elGridRectMask.appendChild(e.dom.elGridRect.node),e.dom.elGridRectMarkerMask.appendChild(e.dom.elGridRectMarker.node);var h=e.dom.baseEl.querySelector(\"defs\");h.appendChild(e.dom.elGridRectMask),h.appendChild(e.dom.elForecastMask),h.appendChild(e.dom.elNonForecastMask),h.appendChild(e.dom.elGridRectMarkerMask)}},{key:\"_drawGridLines\",value:function(t){var e=t.i,i=t.x1,a=t.y1,s=t.x2,r=t.y2,o=t.xCount,n=t.parent,l=this.w;if(!(0===e&&l.globals.skipFirstTimelinelabel||e===o-1&&l.globals.skipLastTimelinelabel&&!l.config.xaxis.labels.formatter||\"radar\"===l.config.chart.type)){l.config.grid.xaxis.lines.show&&this._drawGridLine({x1:i,y1:a,x2:s,y2:r,parent:n});var h=0;if(l.globals.hasGroups&&\"between\"===l.config.xaxis.tickPlacement){var c=l.globals.groups;if(c){for(var d=0,g=0;d<e&&g<c.length;g++)d+=c[g].cols;d===e&&(h=.6*l.globals.xAxisLabelsHeight)}}new _(this.ctx).drawXaxisTicks(i,h,this.elg)}}},{key:\"_drawGridLine\",value:function(t){var e=t.x1,i=t.y1,a=t.x2,s=t.y2,r=t.parent,o=this.w,n=r.node.classList.contains(\"apexcharts-gridlines-horizontal\"),l=o.config.grid.strokeDashArray,h=o.globals.barPadForNumericAxis,c=new m(this).drawLine(e-(n?h:0),i,a+(n?h:0),s,o.config.grid.borderColor,l);c.node.classList.add(\"apexcharts-gridline\"),r.add(c)}},{key:\"_drawGridBandRect\",value:function(t){var e=t.c,i=t.x1,a=t.y1,s=t.x2,r=t.y2,o=t.type,n=this.w,l=new m(this.ctx),h=n.globals.barPadForNumericAxis;if(\"column\"!==o||\"datetime\"!==n.config.xaxis.type){var c=n.config.grid[o].colors[e],d=l.drawRect(i-(\"row\"===o?h:0),a,s+(\"row\"===o?2*h:0),r,0,c,n.config.grid[o].opacity);this.elg.add(d),d.attr(\"clip-path\",\"url(#gridRectMask\".concat(n.globals.cuid,\")\")),d.node.classList.add(\"apexcharts-grid-\".concat(o))}}},{key:\"_drawXYLines\",value:function(t){var e=this,i=t.xCount,a=t.tickAmount,s=this.w;if(s.config.grid.xaxis.lines.show||s.config.xaxis.axisTicks.show){var r,o=s.globals.padHorizontal,n=s.globals.gridHeight;s.globals.timescaleLabels.length?function(t){for(var a=t.xC,s=t.x1,r=t.y1,o=t.x2,n=t.y2,l=0;l<a;l++)s=e.xaxisLabels[l].position,o=e.xaxisLabels[l].position,e._drawGridLines({i:l,x1:s,y1:r,x2:o,y2:n,xCount:i,parent:e.elgridLinesV})}({xC:i,x1:o,y1:0,x2:r,y2:n}):(s.globals.isXNumeric&&(i=s.globals.xAxisScale.result.length),s.config.xaxis.convertedCatToNumeric&&(i=s.globals.xaxisLabelsCount),function(t){var a=t.xC,r=t.x1,o=t.y1,n=t.x2,l=t.y2;if(void 0!==s.config.xaxis.tickAmount&&\"dataPoints\"!==s.config.xaxis.tickAmount&&\"on\"===s.config.xaxis.tickPlacement)s.globals.dom.baseEl.querySelectorAll(\".apexcharts-text.apexcharts-xaxis-label tspan:not(:empty)\").forEach((function(t,a){var s=t.getBBox();e._drawGridLines({i:a,x1:s.x+s.width/2,y1:o,x2:s.x+s.width/2,y2:l,xCount:i,parent:e.elgridLinesV})}));else for(var h=0;h<a+(s.globals.isXNumeric?0:1);h++)0===h&&1===a&&1===s.globals.dataPoints&&(n=r=s.globals.gridWidth/2),e._drawGridLines({i:h,x1:r,y1:o,x2:n,y2:l,xCount:i,parent:e.elgridLinesV}),n=r+=s.globals.gridWidth/(s.globals.isXNumeric?a-1:a)}({xC:i,x1:o,y1:0,x2:r,y2:n}))}if(s.config.grid.yaxis.lines.show){var l=0,h=0,c=s.globals.gridWidth,d=a+1;this.isRangeBar&&(d=s.globals.labels.length);for(var g=0;g<d+(this.isRangeBar?1:0);g++)this._drawGridLine({x1:0,y1:l,x2:c,y2:h,parent:this.elgridLinesH}),h=l+=s.globals.gridHeight/(this.isRangeBar?d:a)}}},{key:\"_drawInvertedXYLines\",value:function(t){var e=t.xCount,i=this.w;if(i.config.grid.xaxis.lines.show||i.config.xaxis.axisTicks.show)for(var a,s=i.globals.padHorizontal,r=i.globals.gridHeight,o=0;o<e+1;o++){i.config.grid.xaxis.lines.show&&this._drawGridLine({x1:s,y1:0,x2:a,y2:r,parent:this.elgridLinesV}),new _(this.ctx).drawXaxisTicks(s,0,this.elg),a=s=s+i.globals.gridWidth/e+.3}if(i.config.grid.yaxis.lines.show)for(var n=0,l=0,h=i.globals.gridWidth,c=0;c<i.globals.dataPoints+1;c++)this._drawGridLine({x1:0,y1:n,x2:h,y2:l,parent:this.elgridLinesH}),l=n+=i.globals.gridHeight/i.globals.dataPoints}},{key:\"renderGrid\",value:function(){var t=this.w,e=new m(this.ctx);this.elg=e.group({class:\"apexcharts-grid\"}),this.elgridLinesH=e.group({class:\"apexcharts-gridlines-horizontal\"}),this.elgridLinesV=e.group({class:\"apexcharts-gridlines-vertical\"}),this.elg.add(this.elgridLinesH),this.elg.add(this.elgridLinesV),t.config.grid.show||(this.elgridLinesV.hide(),this.elgridLinesH.hide());for(var i,a=t.globals.yAxisScale.length?t.globals.yAxisScale[0].result.length-1:5,s=0;s<t.globals.series.length&&(void 0!==t.globals.yAxisScale[s]&&(a=t.globals.yAxisScale[s].result.length-1),!(a>2));s++);return!t.globals.isBarHorizontal||this.isRangeBar?(i=this.xaxisLabels.length,this.isRangeBar&&(a=t.globals.labels.length,t.config.xaxis.tickAmount&&t.config.xaxis.labels.formatter&&(i=t.config.xaxis.tickAmount)),this._drawXYLines({xCount:i,tickAmount:a})):(i=a,a=t.globals.xTickAmount,this._drawInvertedXYLines({xCount:i,tickAmount:a})),this.drawGridBands(i,a),{el:this.elg,xAxisTickWidth:t.globals.gridWidth/i}}},{key:\"drawGridBands\",value:function(t,e){var i=this.w;if(void 0!==i.config.grid.row.colors&&i.config.grid.row.colors.length>0)for(var a=0,s=i.globals.gridHeight/e,r=i.globals.gridWidth,o=0,n=0;o<e;o++,n++)n>=i.config.grid.row.colors.length&&(n=0),this._drawGridBandRect({c:n,x1:0,y1:a,x2:r,y2:s,type:\"row\"}),a+=i.globals.gridHeight/e;if(void 0!==i.config.grid.column.colors&&i.config.grid.column.colors.length>0)for(var l=i.globals.isBarHorizontal||\"category\"!==i.config.xaxis.type&&!i.config.xaxis.convertedCatToNumeric?t:t-1,h=i.globals.padHorizontal,c=i.globals.padHorizontal+i.globals.gridWidth/l,d=i.globals.gridHeight,g=0,u=0;g<t;g++,u++)u>=i.config.grid.column.colors.length&&(u=0),this._drawGridBandRect({c:u,x1:h,y1:0,x2:c,y2:d,type:\"column\"}),h+=i.globals.gridWidth/l}}]),t}(),q=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"niceScale\",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4?arguments[4]:void 0,r=this.w,o=Math.abs(e-t);if(\"dataPoints\"===(i=this._adjustTicksForSmallRange(i,a,o))&&(i=r.globals.dataPoints-1),t===Number.MIN_VALUE&&0===e||!x.isNumber(t)&&!x.isNumber(e)||t===Number.MIN_VALUE&&e===-Number.MAX_VALUE){t=0,e=i;var n=this.linearScale(t,e,i);return n}t>e?(console.warn(\"axis.min cannot be greater than axis.max\"),e=t+.1):t===e&&(t=0===t?0:t-.5,e=0===e?2:e+.5);var l=[];o<1&&s&&(\"candlestick\"===r.config.chart.type||\"candlestick\"===r.config.series[a].type||\"boxPlot\"===r.config.chart.type||\"boxPlot\"===r.config.series[a].type||r.globals.isRangeData)&&(e*=1.01);var h=i+1;h<2?h=2:h>2&&(h-=2);var c=o/h,d=Math.floor(x.log10(c)),g=Math.pow(10,d),u=Math.round(c/g);u<1&&(u=1);var f=u*g,p=f*Math.floor(t/f),b=f*Math.ceil(e/f),v=p;if(s&&o>2){for(;l.push(v),!((v+=f)>b););return{result:l,niceMin:l[0],niceMax:l[l.length-1]}}var m=t;(l=[]).push(m);for(var y=Math.abs(e-t)/i,w=0;w<=i;w++)m+=y,l.push(m);return l[l.length-2]>=e&&l.pop(),{result:l,niceMin:l[0],niceMax:l[l.length-1]}}},{key:\"linearScale\",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,a=arguments.length>3?arguments[3]:void 0,s=Math.abs(e-t);\"dataPoints\"===(i=this._adjustTicksForSmallRange(i,a,s))&&(i=this.w.globals.dataPoints-1);var r=s/i;i===Number.MAX_VALUE&&(i=10,r=1);for(var o=[],n=t;i>=0;)o.push(n),n+=r,i-=1;return{result:o,niceMin:o[0],niceMax:o[o.length-1]}}},{key:\"logarithmicScaleNice\",value:function(t,e,i){e<=0&&(e=Math.max(t,i)),t<=0&&(t=Math.min(e,i));for(var a=[],s=Math.ceil(Math.log(e)/Math.log(i)+1),r=Math.floor(Math.log(t)/Math.log(i));r<s;r++)a.push(Math.pow(i,r));return{result:a,niceMin:a[0],niceMax:a[a.length-1]}}},{key:\"logarithmicScale\",value:function(t,e,i){e<=0&&(e=Math.max(t,i)),t<=0&&(t=Math.min(e,i));for(var a=[],s=Math.log(e)/Math.log(i),r=Math.log(t)/Math.log(i),o=s-r,n=Math.round(o),l=o/n,h=0,c=r;h<n;h++,c+=l)a.push(Math.pow(i,c));return a.push(Math.pow(i,s)),{result:a,niceMin:t,niceMax:e}}},{key:\"_adjustTicksForSmallRange\",value:function(t,e,i){var a=t;if(void 0!==e&&this.w.config.yaxis[e].labels.formatter&&void 0===this.w.config.yaxis[e].tickAmount){var s=this.w.config.yaxis[e].labels.formatter(1);x.isNumber(Number(s))&&!x.isFloat(s)&&(a=Math.ceil(i))}return a<t?a:t}},{key:\"setYScaleForIndex\",value:function(t,e,i){var a=this.w.globals,s=this.w.config,r=a.isBarHorizontal?s.xaxis:s.yaxis[t];void 0===a.yAxisScale[t]&&(a.yAxisScale[t]=[]);var o=Math.abs(i-e);if(r.logarithmic&&o<=5&&(a.invalidLogScale=!0),r.logarithmic&&o>5)a.allSeriesCollapsed=!1,a.yAxisScale[t]=this.logarithmicScale(e,i,r.logBase),a.yAxisScale[t]=r.forceNiceScale?this.logarithmicScaleNice(e,i,r.logBase):this.logarithmicScale(e,i,r.logBase);else if(i!==-Number.MAX_VALUE&&x.isNumber(i))if(a.allSeriesCollapsed=!1,void 0===r.min&&void 0===r.max||r.forceNiceScale){var n=void 0===s.yaxis[t].max&&void 0===s.yaxis[t].min||s.yaxis[t].forceNiceScale;a.yAxisScale[t]=this.niceScale(e,i,r.tickAmount?r.tickAmount:o<5&&o>1?o+1:5,t,n)}else a.yAxisScale[t]=this.linearScale(e,i,r.tickAmount,t);else a.yAxisScale[t]=this.linearScale(0,5,5)}},{key:\"setXScale\",value:function(t,e){var i=this.w,a=i.globals,s=i.config.xaxis,r=Math.abs(e-t);return e!==-Number.MAX_VALUE&&x.isNumber(e)?a.xAxisScale=this.linearScale(t,e,s.tickAmount?s.tickAmount:r<5&&r>1?r+1:5,0):a.xAxisScale=this.linearScale(0,5,5),a.xAxisScale}},{key:\"setMultipleYScales\",value:function(){var t=this,e=this.w.globals,i=this.w.config,a=e.minYArr.concat([]),s=e.maxYArr.concat([]),r=[];i.yaxis.forEach((function(e,o){var n=o;i.series.forEach((function(t,i){t.name===e.seriesName&&(n=i,o!==i?r.push({index:i,similarIndex:o,alreadyExists:!0}):r.push({index:i}))}));var l=a[n],h=s[n];t.setYScaleForIndex(o,l,h)})),this.sameScaleInMultipleAxes(a,s,r)}},{key:\"sameScaleInMultipleAxes\",value:function(t,e,i){var a=this,s=this.w.config,r=this.w.globals,o=[];i.forEach((function(t){t.alreadyExists&&(void 0===o[t.index]&&(o[t.index]=[]),o[t.index].push(t.index),o[t.index].push(t.similarIndex))})),r.yAxisSameScaleIndices=o,o.forEach((function(t,e){o.forEach((function(i,a){var s,r;e!==a&&(s=t,r=i,s.filter((function(t){return-1!==r.indexOf(t)}))).length>0&&(o[e]=o[e].concat(o[a]))}))}));var n=o.map((function(t){return t.filter((function(e,i){return t.indexOf(e)===i}))})).map((function(t){return t.sort()}));o=o.filter((function(t){return!!t}));var l=n.slice(),h=l.map((function(t){return JSON.stringify(t)}));l=l.filter((function(t,e){return h.indexOf(JSON.stringify(t))===e}));var c=[],d=[];t.forEach((function(t,i){l.forEach((function(a,s){a.indexOf(i)>-1&&(void 0===c[s]&&(c[s]=[],d[s]=[]),c[s].push({key:i,value:t}),d[s].push({key:i,value:e[i]}))}))}));var g=Array.apply(null,Array(l.length)).map(Number.prototype.valueOf,Number.MIN_VALUE),u=Array.apply(null,Array(l.length)).map(Number.prototype.valueOf,-Number.MAX_VALUE);c.forEach((function(t,e){t.forEach((function(t,i){g[e]=Math.min(t.value,g[e])}))})),d.forEach((function(t,e){t.forEach((function(t,i){u[e]=Math.max(t.value,u[e])}))})),t.forEach((function(t,e){d.forEach((function(t,i){var o=g[i],n=u[i];s.chart.stacked&&(n=0,t.forEach((function(t,e){t.value!==-Number.MAX_VALUE&&(n+=t.value),o!==Number.MIN_VALUE&&(o+=c[i][e].value)}))),t.forEach((function(i,l){t[l].key===e&&(void 0!==s.yaxis[e].min&&(o=\"function\"==typeof s.yaxis[e].min?s.yaxis[e].min(r.minY):s.yaxis[e].min),void 0!==s.yaxis[e].max&&(n=\"function\"==typeof s.yaxis[e].max?s.yaxis[e].max(r.maxY):s.yaxis[e].max),a.setYScaleForIndex(e,o,n))}))}))}))}},{key:\"autoScaleY\",value:function(t,e,i){t||(t=this);var a=t.w;if(a.globals.isMultipleYAxis||a.globals.collapsedSeries.length)return console.warn(\"autoScaleYaxis is not supported in a multi-yaxis chart.\"),e;var s=a.globals.seriesX[0],r=a.config.chart.stacked;return e.forEach((function(t,o){for(var n=0,l=0;l<s.length;l++)if(s[l]>=i.xaxis.min){n=l;break}var h,c,d=a.globals.minYArr[o],g=a.globals.maxYArr[o],u=a.globals.stackedSeriesTotals;a.globals.series.forEach((function(o,l){var f=o[n];r?(f=u[n],h=c=f,u.forEach((function(t,e){s[e]<=i.xaxis.max&&s[e]>=i.xaxis.min&&(t>c&&null!==t&&(c=t),o[e]<h&&null!==o[e]&&(h=o[e]))}))):(h=c=f,o.forEach((function(t,e){if(s[e]<=i.xaxis.max&&s[e]>=i.xaxis.min){var r=t,o=t;a.globals.series.forEach((function(i,a){null!==t&&(r=Math.min(i[e],r),o=Math.max(i[e],o))})),o>c&&null!==o&&(c=o),r<h&&null!==r&&(h=r)}}))),void 0===h&&void 0===c&&(h=d,c=g),(c*=c<0?.9:1.1)<0&&c<g&&(c=g),(h*=h<0?1.1:.9)<0&&h>d&&(h=d),e.length>1?(e[l].min=void 0===t.min?h:t.min,e[l].max=void 0===t.max?c:t.max):(e[0].min=void 0===t.min?h:t.min,e[0].max=void 0===t.max?c:t.max)}))})),e}}]),t}(),Z=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w,this.scales=new q(e)}return r(t,[{key:\"init\",value:function(){this.setYRange(),this.setXRange(),this.setZRange()}},{key:\"getMinYMaxY\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-Number.MAX_VALUE,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=this.w.config,r=this.w.globals,o=-Number.MAX_VALUE,n=Number.MIN_VALUE;null===a&&(a=t+1);var l=r.series,h=l,c=l;\"candlestick\"===s.chart.type?(h=r.seriesCandleL,c=r.seriesCandleH):\"boxPlot\"===s.chart.type?(h=r.seriesCandleO,c=r.seriesCandleC):r.isRangeData&&(h=r.seriesRangeStart,c=r.seriesRangeEnd);for(var d=t;d<a;d++){r.dataPoints=Math.max(r.dataPoints,l[d].length),r.categoryLabels.length&&(r.dataPoints=r.categoryLabels.filter((function(t){return void 0!==t})).length);for(var g=0;g<r.series[d].length;g++){var u=l[d][g];null!==u&&x.isNumber(u)?(void 0!==c[d][g]&&(o=Math.max(o,c[d][g]),e=Math.min(e,c[d][g])),void 0!==h[d][g]&&(e=Math.min(e,h[d][g]),i=Math.max(i,h[d][g])),\"candlestick\"!==this.w.config.chart.type&&\"boxPlot\"!==this.w.config.chart.type||(void 0!==r.seriesCandleC[d][g]&&(o=Math.max(o,r.seriesCandleO[d][g]),o=Math.max(o,r.seriesCandleH[d][g]),o=Math.max(o,r.seriesCandleL[d][g]),o=Math.max(o,r.seriesCandleC[d][g]),\"boxPlot\"===this.w.config.chart.type&&(o=Math.max(o,r.seriesCandleM[d][g]))),!s.series[d].type||\"candlestick\"===s.series[d].type&&\"boxPlot\"===s.series[d].type||(o=Math.max(o,r.series[d][g]),e=Math.min(e,r.series[d][g])),i=o),r.seriesGoals[d]&&r.seriesGoals[d][g]&&Array.isArray(r.seriesGoals[d][g])&&r.seriesGoals[d][g].forEach((function(t){n!==Number.MIN_VALUE&&(n=Math.min(n,t.value),e=n),o=Math.max(o,t.value),i=o})),x.isFloat(u)&&(u=x.noExponents(u),r.yValueDecimal=Math.max(r.yValueDecimal,u.toString().split(\".\")[1].length)),n>h[d][g]&&h[d][g]<0&&(n=h[d][g])):r.hasNullValues=!0}}return\"rangeBar\"===s.chart.type&&r.seriesRangeStart.length&&r.isBarHorizontal&&(n=e),\"bar\"===s.chart.type&&(n<0&&o<0&&(o=0),n===Number.MIN_VALUE&&(n=0)),{minY:n,maxY:o,lowestY:e,highestY:i}}},{key:\"setYRange\",value:function(){var t=this.w.globals,e=this.w.config;t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE;var i=Number.MAX_VALUE;if(t.isMultipleYAxis)for(var a=0;a<t.series.length;a++){var s=this.getMinYMaxY(a,i,null,a+1);t.minYArr.push(s.minY),t.maxYArr.push(s.maxY),i=s.lowestY}var r=this.getMinYMaxY(0,i,null,t.series.length);if(t.minY=r.minY,t.maxY=r.maxY,i=r.lowestY,e.chart.stacked&&this._setStackedMinMax(),(\"line\"===e.chart.type||\"area\"===e.chart.type||\"candlestick\"===e.chart.type||\"boxPlot\"===e.chart.type||\"rangeBar\"===e.chart.type&&!t.isBarHorizontal)&&t.minY===Number.MIN_VALUE&&i!==-Number.MAX_VALUE&&i!==t.maxY){var o=t.maxY-i;(i>=0&&i<=10||void 0!==e.yaxis[0].min||void 0!==e.yaxis[0].max)&&(o=0),t.minY=i-5*o/100,i>0&&t.minY<0&&(t.minY=0),t.maxY=t.maxY+5*o/100}if(e.yaxis.forEach((function(e,i){void 0!==e.max&&(\"number\"==typeof e.max?t.maxYArr[i]=e.max:\"function\"==typeof e.max&&(t.maxYArr[i]=e.max(t.isMultipleYAxis?t.maxYArr[i]:t.maxY)),t.maxY=t.maxYArr[i]),void 0!==e.min&&(\"number\"==typeof e.min?t.minYArr[i]=e.min:\"function\"==typeof e.min&&(t.minYArr[i]=e.min(t.isMultipleYAxis?t.minYArr[i]===Number.MIN_VALUE?0:t.minYArr[i]:t.minY)),t.minY=t.minYArr[i])})),t.isBarHorizontal){[\"min\",\"max\"].forEach((function(i){void 0!==e.xaxis[i]&&\"number\"==typeof e.xaxis[i]&&(\"min\"===i?t.minY=e.xaxis[i]:t.maxY=e.xaxis[i])}))}return t.isMultipleYAxis?(this.scales.setMultipleYScales(),t.minY=i,t.yAxisScale.forEach((function(e,i){t.minYArr[i]=e.niceMin,t.maxYArr[i]=e.niceMax}))):(this.scales.setYScaleForIndex(0,t.minY,t.maxY),t.minY=t.yAxisScale[0].niceMin,t.maxY=t.yAxisScale[0].niceMax,t.minYArr[0]=t.yAxisScale[0].niceMin,t.maxYArr[0]=t.yAxisScale[0].niceMax),{minY:t.minY,maxY:t.maxY,minYArr:t.minYArr,maxYArr:t.maxYArr,yAxisScale:t.yAxisScale}}},{key:\"setXRange\",value:function(){var t=this.w.globals,e=this.w.config,i=\"numeric\"===e.xaxis.type||\"datetime\"===e.xaxis.type||\"category\"===e.xaxis.type&&!t.noLabelsProvided||t.noLabelsProvided||t.isXNumeric;if(t.isXNumeric&&function(){for(var e=0;e<t.series.length;e++)if(t.labels[e])for(var i=0;i<t.labels[e].length;i++)null!==t.labels[e][i]&&x.isNumber(t.labels[e][i])&&(t.maxX=Math.max(t.maxX,t.labels[e][i]),t.initialMaxX=Math.max(t.maxX,t.labels[e][i]),t.minX=Math.min(t.minX,t.labels[e][i]),t.initialMinX=Math.min(t.minX,t.labels[e][i]))}(),t.noLabelsProvided&&0===e.xaxis.categories.length&&(t.maxX=t.labels[t.labels.length-1],t.initialMaxX=t.labels[t.labels.length-1],t.minX=1,t.initialMinX=1),t.isXNumeric||t.noLabelsProvided||t.dataFormatXNumeric){var a;if(void 0===e.xaxis.tickAmount?(a=Math.round(t.svgWidth/150),\"numeric\"===e.xaxis.type&&t.dataPoints<30&&(a=t.dataPoints-1),a>t.dataPoints&&0!==t.dataPoints&&(a=t.dataPoints-1)):\"dataPoints\"===e.xaxis.tickAmount?(t.series.length>1&&(a=t.series[t.maxValsInArrayIndex].length-1),t.isXNumeric&&(a=t.maxX-t.minX-1)):a=e.xaxis.tickAmount,t.xTickAmount=a,void 0!==e.xaxis.max&&\"number\"==typeof e.xaxis.max&&(t.maxX=e.xaxis.max),void 0!==e.xaxis.min&&\"number\"==typeof e.xaxis.min&&(t.minX=e.xaxis.min),void 0!==e.xaxis.range&&(t.minX=t.maxX-e.xaxis.range),t.minX!==Number.MAX_VALUE&&t.maxX!==-Number.MAX_VALUE)if(e.xaxis.convertedCatToNumeric&&!t.dataFormatXNumeric){for(var s=[],r=t.minX-1;r<t.maxX;r++)s.push(r+1);t.xAxisScale={result:s,niceMin:s[0],niceMax:s[s.length-1]}}else t.xAxisScale=this.scales.setXScale(t.minX,t.maxX);else t.xAxisScale=this.scales.linearScale(1,a,a),t.noLabelsProvided&&t.labels.length>0&&(t.xAxisScale=this.scales.linearScale(1,t.labels.length,a-1),t.seriesX=t.labels.slice());i&&(t.labels=t.xAxisScale.result.slice())}return t.isBarHorizontal&&t.labels.length&&(t.xTickAmount=t.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:t.minX,maxX:t.maxX}}},{key:\"setZRange\",value:function(){var t=this.w.globals;if(t.isDataXYZ)for(var e=0;e<t.series.length;e++)if(void 0!==t.seriesZ[e])for(var i=0;i<t.seriesZ[e].length;i++)null!==t.seriesZ[e][i]&&x.isNumber(t.seriesZ[e][i])&&(t.maxZ=Math.max(t.maxZ,t.seriesZ[e][i]),t.minZ=Math.min(t.minZ,t.seriesZ[e][i]))}},{key:\"_handleSingleDataPoint\",value:function(){var t=this.w.globals,e=this.w.config;if(t.minX===t.maxX){var i=new R(this.ctx);if(\"datetime\"===e.xaxis.type){var a=i.getDate(t.minX);e.xaxis.labels.datetimeUTC?a.setUTCDate(a.getUTCDate()-2):a.setDate(a.getDate()-2),t.minX=new Date(a).getTime();var s=i.getDate(t.maxX);e.xaxis.labels.datetimeUTC?s.setUTCDate(s.getUTCDate()+2):s.setDate(s.getDate()+2),t.maxX=new Date(s).getTime()}else(\"numeric\"===e.xaxis.type||\"category\"===e.xaxis.type&&!t.noLabelsProvided)&&(t.minX=t.minX-2,t.initialMinX=t.minX,t.maxX=t.maxX+2,t.initialMaxX=t.maxX)}}},{key:\"_getMinXDiff\",value:function(){var t=this.w.globals;t.isXNumeric&&t.seriesX.forEach((function(e,i){1===e.length&&e.push(t.seriesX[t.maxValsInArrayIndex][t.seriesX[t.maxValsInArrayIndex].length-1]);var a=e.slice();a.sort((function(t,e){return t-e})),a.forEach((function(e,i){if(i>0){var s=e-a[i-1];s>0&&(t.minXDiff=Math.min(s,t.minXDiff))}})),1!==t.dataPoints&&t.minXDiff!==Number.MAX_VALUE||(t.minXDiff=.5)}))}},{key:\"_setStackedMinMax\",value:function(){var t=this.w.globals,e=[],i=[];if(t.series.length)for(var a=0;a<t.series[t.maxValsInArrayIndex].length;a++)for(var s=0,r=0,o=0;o<t.series.length;o++)null!==t.series[o][a]&&x.isNumber(t.series[o][a])&&(t.series[o][a]>0?s=s+parseFloat(t.series[o][a])+1e-4:r+=parseFloat(t.series[o][a])),o===t.series.length-1&&(e.push(s),i.push(r));for(var n=0;n<e.length;n++)t.maxY=Math.max(t.maxY,e[n]),t.minY=Math.min(t.minY,i[n])}}]),t}(),$=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w;var i=this.w;this.xaxisFontSize=i.config.xaxis.labels.style.fontSize,this.axisFontFamily=i.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=i.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal=\"bar\"===i.config.chart.type&&i.config.plotOptions.bar.horizontal,this.xAxisoffX=0,\"bottom\"===i.config.xaxis.position&&(this.xAxisoffX=i.globals.gridHeight),this.drawnLabels=[],this.axesUtils=new G(e)}return r(t,[{key:\"drawYaxis\",value:function(t){var e=this,i=this.w,a=new m(this.ctx),s=i.config.yaxis[t].labels.style,r=s.fontSize,o=s.fontFamily,n=s.fontWeight,l=a.group({class:\"apexcharts-yaxis\",rel:t,transform:\"translate(\"+i.globals.translateYAxisX[t]+\", 0)\"});if(this.axesUtils.isYAxisHidden(t))return l;var h=a.group({class:\"apexcharts-yaxis-texts-g\"});l.add(h);var c=i.globals.yAxisScale[t].result.length-1,d=i.globals.gridHeight/c,g=i.globals.translateY,u=i.globals.yLabelFormatters[t],f=i.globals.yAxisScale[t].result.slice();f=this.axesUtils.checkForReversedLabels(t,f);var p=\"\";if(i.config.yaxis[t].labels.show)for(var x=function(l){var x=f[l];x=u(x,l,i);var b=i.config.yaxis[t].labels.padding;i.config.yaxis[t].opposite&&0!==i.config.yaxis.length&&(b*=-1);var v=e.axesUtils.getYAxisForeColor(s.colors,t),m=a.drawText({x:b,y:g+c/10+i.config.yaxis[t].labels.offsetY+1,text:x,textAnchor:i.config.yaxis[t].opposite?\"start\":\"end\",fontSize:r,fontFamily:o,fontWeight:n,maxWidth:i.config.yaxis[t].labels.maxWidth,foreColor:Array.isArray(v)?v[l]:v,isPlainText:!1,cssClass:\"apexcharts-yaxis-label \"+s.cssClass});l===c&&(p=m),h.add(m);var y=document.createElementNS(i.globals.SVGNS,\"title\");if(y.textContent=Array.isArray(x)?x.join(\" \"):x,m.node.appendChild(y),0!==i.config.yaxis[t].labels.rotate){var w=a.rotateAroundCenter(p.node),k=a.rotateAroundCenter(m.node);m.node.setAttribute(\"transform\",\"rotate(\".concat(i.config.yaxis[t].labels.rotate,\" \").concat(w.x,\" \").concat(k.y,\")\"))}g+=d},b=c;b>=0;b--)x(b);if(void 0!==i.config.yaxis[t].title.text){var v=a.group({class:\"apexcharts-yaxis-title\"}),y=0;i.config.yaxis[t].opposite&&(y=i.globals.translateYAxisX[t]);var w=a.drawText({x:y,y:i.globals.gridHeight/2+i.globals.translateY+i.config.yaxis[t].title.offsetY,text:i.config.yaxis[t].title.text,textAnchor:\"end\",foreColor:i.config.yaxis[t].title.style.color,fontSize:i.config.yaxis[t].title.style.fontSize,fontWeight:i.config.yaxis[t].title.style.fontWeight,fontFamily:i.config.yaxis[t].title.style.fontFamily,cssClass:\"apexcharts-yaxis-title-text \"+i.config.yaxis[t].title.style.cssClass});v.add(w),l.add(v)}var k=i.config.yaxis[t].axisBorder,A=31+k.offsetX;if(i.config.yaxis[t].opposite&&(A=-31-k.offsetX),k.show){var S=a.drawLine(A,i.globals.translateY+k.offsetY-2,A,i.globals.gridHeight+i.globals.translateY+k.offsetY+2,k.color,0,k.width);l.add(S)}return i.config.yaxis[t].axisTicks.show&&this.axesUtils.drawYAxisTicks(A,c,k,i.config.yaxis[t].axisTicks,t,d,l),l}},{key:\"drawYaxisInversed\",value:function(t){var e=this.w,i=new m(this.ctx),a=i.group({class:\"apexcharts-xaxis apexcharts-yaxis-inversed\"}),s=i.group({class:\"apexcharts-xaxis-texts-g\",transform:\"translate(\".concat(e.globals.translateXAxisX,\", \").concat(e.globals.translateXAxisY,\")\")});a.add(s);var r=e.globals.yAxisScale[t].result.length-1,o=e.globals.gridWidth/r+.1,n=o+e.config.xaxis.labels.offsetX,l=e.globals.xLabelFormatter,h=e.globals.yAxisScale[t].result.slice(),c=e.globals.timescaleLabels;c.length>0&&(this.xaxisLabels=c.slice(),r=(h=c.slice()).length),h=this.axesUtils.checkForReversedLabels(t,h);var d=c.length;if(e.config.xaxis.labels.show)for(var g=d?0:r;d?g<d:g>=0;d?g++:g--){var u=h[g];u=l(u,g,e);var f=e.globals.gridWidth+e.globals.padHorizontal-(n-o+e.config.xaxis.labels.offsetX);if(c.length){var p=this.axesUtils.getLabel(h,c,f,g,this.drawnLabels,this.xaxisFontSize);f=p.x,u=p.text,this.drawnLabels.push(p.text),0===g&&e.globals.skipFirstTimelinelabel&&(u=\"\"),g===h.length-1&&e.globals.skipLastTimelinelabel&&(u=\"\")}var x=i.drawText({x:f,y:this.xAxisoffX+e.config.xaxis.labels.offsetY+30-(\"top\"===e.config.xaxis.position?e.globals.xAxisHeight+e.config.xaxis.axisTicks.height-2:0),text:u,textAnchor:\"middle\",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[t]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.xaxisFontFamily,fontWeight:e.config.xaxis.labels.style.fontWeight,isPlainText:!1,cssClass:\"apexcharts-xaxis-label \"+e.config.xaxis.labels.style.cssClass});s.add(x),x.tspan(u);var b=document.createElementNS(e.globals.SVGNS,\"title\");b.textContent=u,x.node.appendChild(b),n+=o}return this.inversedYAxisTitleText(a),this.inversedYAxisBorder(a),a}},{key:\"inversedYAxisBorder\",value:function(t){var e=this.w,i=new m(this.ctx),a=e.config.xaxis.axisBorder;if(a.show){var s=0;\"bar\"===e.config.chart.type&&e.globals.isXNumeric&&(s-=15);var r=i.drawLine(e.globals.padHorizontal+s+a.offsetX,this.xAxisoffX,e.globals.gridWidth,this.xAxisoffX,a.color,0,a.height);t.add(r)}}},{key:\"inversedYAxisTitleText\",value:function(t){var e=this.w,i=new m(this.ctx);if(void 0!==e.config.xaxis.title.text){var a=i.group({class:\"apexcharts-xaxis-title apexcharts-yaxis-title-inversed\"}),s=i.drawText({x:e.globals.gridWidth/2+e.config.xaxis.title.offsetX,y:this.xAxisoffX+parseFloat(this.xaxisFontSize)+parseFloat(e.config.xaxis.title.style.fontSize)+e.config.xaxis.title.offsetY+20,text:e.config.xaxis.title.text,textAnchor:\"middle\",fontSize:e.config.xaxis.title.style.fontSize,fontFamily:e.config.xaxis.title.style.fontFamily,fontWeight:e.config.xaxis.title.style.fontWeight,foreColor:e.config.xaxis.title.style.color,cssClass:\"apexcharts-xaxis-title-text \"+e.config.xaxis.title.style.cssClass});a.add(s),t.add(a)}}},{key:\"yAxisTitleRotate\",value:function(t,e){var i=this.w,a=new m(this.ctx),s={width:0,height:0},r={width:0,height:0},o=i.globals.dom.baseEl.querySelector(\" .apexcharts-yaxis[rel='\".concat(t,\"'] .apexcharts-yaxis-texts-g\"));null!==o&&(s=o.getBoundingClientRect());var n=i.globals.dom.baseEl.querySelector(\".apexcharts-yaxis[rel='\".concat(t,\"'] .apexcharts-yaxis-title text\"));if(null!==n&&(r=n.getBoundingClientRect()),null!==n){var l=this.xPaddingForYAxisTitle(t,s,r,e);n.setAttribute(\"x\",l.xPos-(e?10:0))}if(null!==n){var h=a.rotateAroundCenter(n);n.setAttribute(\"transform\",\"rotate(\".concat(e?-1*i.config.yaxis[t].title.rotate:i.config.yaxis[t].title.rotate,\" \").concat(h.x,\" \").concat(h.y,\")\"))}}},{key:\"xPaddingForYAxisTitle\",value:function(t,e,i,a){var s=this.w,r=0,o=0,n=10;return void 0===s.config.yaxis[t].title.text||t<0?{xPos:o,padd:0}:(a?(o=e.width+s.config.yaxis[t].title.offsetX+i.width/2+n/2,0===(r+=1)&&(o-=n/2)):(o=-1*e.width+s.config.yaxis[t].title.offsetX+n/2+i.width/2,s.globals.isBarHorizontal&&(n=25,o=-1*e.width-s.config.yaxis[t].title.offsetX-n)),{xPos:o,padd:n})}},{key:\"setYAxisXPosition\",value:function(t,e){var i=this.w,a=0,s=0,r=18,o=1;i.config.yaxis.length>1&&(this.multipleYs=!0),i.config.yaxis.map((function(n,l){var h=i.globals.ignoreYAxisIndexes.indexOf(l)>-1||!n.show||n.floating||0===t[l].width,c=t[l].width+e[l].width;n.opposite?i.globals.isBarHorizontal?(s=i.globals.gridWidth+i.globals.translateX-1,i.globals.translateYAxisX[l]=s-n.labels.offsetX):(s=i.globals.gridWidth+i.globals.translateX+o,h||(o=o+c+20),i.globals.translateYAxisX[l]=s-n.labels.offsetX+20):(a=i.globals.translateX-r,h||(r=r+c+20),i.globals.translateYAxisX[l]=a+n.labels.offsetX)}))}},{key:\"setYAxisTextAlignments\",value:function(){var t=this.w,e=t.globals.dom.baseEl.getElementsByClassName(\"apexcharts-yaxis\");(e=x.listToArray(e)).forEach((function(e,i){var a=t.config.yaxis[i];if(a&&void 0!==a.labels.align){var s=t.globals.dom.baseEl.querySelector(\".apexcharts-yaxis[rel='\".concat(i,\"'] .apexcharts-yaxis-texts-g\")),r=t.globals.dom.baseEl.querySelectorAll(\".apexcharts-yaxis[rel='\".concat(i,\"'] .apexcharts-yaxis-label\"));r=x.listToArray(r);var o=s.getBoundingClientRect();\"left\"===a.labels.align?(r.forEach((function(t,e){t.setAttribute(\"text-anchor\",\"start\")})),a.opposite||s.setAttribute(\"transform\",\"translate(-\".concat(o.width,\", 0)\"))):\"center\"===a.labels.align?(r.forEach((function(t,e){t.setAttribute(\"text-anchor\",\"middle\")})),s.setAttribute(\"transform\",\"translate(\".concat(o.width/2*(a.opposite?1:-1),\", 0)\"))):\"right\"===a.labels.align&&(r.forEach((function(t,e){t.setAttribute(\"text-anchor\",\"end\")})),a.opposite&&s.setAttribute(\"transform\",\"translate(\".concat(o.width,\", 0)\")))}}))}}]),t}(),J=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w,this.documentEvent=x.bind(this.documentEvent,this)}return r(t,[{key:\"addEventListener\",value:function(t,e){var i=this.w;i.globals.events.hasOwnProperty(t)?i.globals.events[t].push(e):i.globals.events[t]=[e]}},{key:\"removeEventListener\",value:function(t,e){var i=this.w;if(i.globals.events.hasOwnProperty(t)){var a=i.globals.events[t].indexOf(e);-1!==a&&i.globals.events[t].splice(a,1)}}},{key:\"fireEvent\",value:function(t,e){var i=this.w;if(i.globals.events.hasOwnProperty(t)){e&&e.length||(e=[]);for(var a=i.globals.events[t],s=a.length,r=0;r<s;r++)a[r].apply(null,e)}}},{key:\"setupEventHandlers\",value:function(){var t=this,e=this.w,i=this.ctx,a=e.globals.dom.baseEl.querySelector(e.globals.chartClass);this.ctx.eventList.forEach((function(t){a.addEventListener(t,(function(t){var a=Object.assign({},e,{seriesIndex:e.globals.capturedSeriesIndex,dataPointIndex:e.globals.capturedDataPointIndex});\"mousemove\"===t.type||\"touchmove\"===t.type?\"function\"==typeof e.config.chart.events.mouseMove&&e.config.chart.events.mouseMove(t,i,a):\"mouseleave\"===t.type||\"touchleave\"===t.type?\"function\"==typeof e.config.chart.events.mouseLeave&&e.config.chart.events.mouseLeave(t,i,a):(\"mouseup\"===t.type&&1===t.which||\"touchend\"===t.type)&&(\"function\"==typeof e.config.chart.events.click&&e.config.chart.events.click(t,i,a),i.ctx.events.fireEvent(\"click\",[t,i,a]))}),{capture:!1,passive:!0})})),this.ctx.eventList.forEach((function(i){e.globals.dom.baseEl.addEventListener(i,t.documentEvent,{passive:!0})})),this.ctx.core.setupBrushHandler()}},{key:\"documentEvent\",value:function(t){var e=this.w,i=t.target.className;if(\"click\"===t.type){var a=e.globals.dom.baseEl.querySelector(\".apexcharts-menu\");a&&a.classList.contains(\"apexcharts-menu-open\")&&\"apexcharts-menu-icon\"!==i&&a.classList.remove(\"apexcharts-menu-open\")}e.globals.clientX=\"touchmove\"===t.type?t.touches[0].clientX:t.clientX,e.globals.clientY=\"touchmove\"===t.type?t.touches[0].clientY:t.clientY}}]),t}(),Q=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"setCurrentLocaleValues\",value:function(t){var e=this.w.config.chart.locales;window.Apex.chart&&window.Apex.chart.locales&&window.Apex.chart.locales.length>0&&(e=this.w.config.chart.locales.concat(window.Apex.chart.locales));var i=e.filter((function(e){return e.name===t}))[0];if(!i)throw new Error(\"Wrong locale name provided. Please make sure you set the correct locale name in options\");var a=x.extend(C,i);this.w.globals.locale=a.options}}]),t}(),K=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"drawAxis\",value:function(t,e){var i,a,s=this.w.globals,r=this.w.config,o=new _(this.ctx),n=new $(this.ctx);s.axisCharts&&\"radar\"!==t&&(s.isBarHorizontal?(a=n.drawYaxisInversed(0),i=o.drawXaxisInversed(0),s.dom.elGraphical.add(i),s.dom.elGraphical.add(a)):(i=o.drawXaxis(),s.dom.elGraphical.add(i),r.yaxis.map((function(t,e){-1===s.ignoreYAxisIndexes.indexOf(e)&&(a=n.drawYaxis(e),s.dom.Paper.add(a))}))))}}]),t}(),tt=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"drawXCrosshairs\",value:function(){var t=this.w,e=new m(this.ctx),i=new v(this.ctx),a=t.config.xaxis.crosshairs.fill.gradient,s=t.config.xaxis.crosshairs.dropShadow,r=t.config.xaxis.crosshairs.fill.type,o=a.colorFrom,n=a.colorTo,l=a.opacityFrom,h=a.opacityTo,c=a.stops,d=s.enabled,g=s.left,u=s.top,f=s.blur,p=s.color,b=s.opacity,y=t.config.xaxis.crosshairs.fill.color;if(t.config.xaxis.crosshairs.show){\"gradient\"===r&&(y=e.drawGradient(\"vertical\",o,n,l,h,null,c,null));var w=e.drawRect();1===t.config.xaxis.crosshairs.width&&(w=e.drawLine());var k=t.globals.gridHeight;(!x.isNumber(k)||k<0)&&(k=0);var A=t.config.xaxis.crosshairs.width;(!x.isNumber(A)||A<0)&&(A=0),w.attr({class:\"apexcharts-xcrosshairs\",x:0,y:0,y2:k,width:A,height:k,fill:y,filter:\"none\",\"fill-opacity\":t.config.xaxis.crosshairs.opacity,stroke:t.config.xaxis.crosshairs.stroke.color,\"stroke-width\":t.config.xaxis.crosshairs.stroke.width,\"stroke-dasharray\":t.config.xaxis.crosshairs.stroke.dashArray}),d&&(w=i.dropShadow(w,{left:g,top:u,blur:f,color:p,opacity:b})),t.globals.dom.elGraphical.add(w)}}},{key:\"drawYCrosshairs\",value:function(){var t=this.w,e=new m(this.ctx),i=t.config.yaxis[0].crosshairs,a=t.globals.barPadForNumericAxis;if(t.config.yaxis[0].crosshairs.show){var s=e.drawLine(-a,0,t.globals.gridWidth+a,0,i.stroke.color,i.stroke.dashArray,i.stroke.width);s.attr({class:\"apexcharts-ycrosshairs\"}),t.globals.dom.elGraphical.add(s)}var r=e.drawLine(-a,0,t.globals.gridWidth+a,0,i.stroke.color,0,0);r.attr({class:\"apexcharts-ycrosshairs-hidden\"}),t.globals.dom.elGraphical.add(r)}}]),t}(),et=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"checkResponsiveConfig\",value:function(t){var e=this,i=this.w,a=i.config;if(0!==a.responsive.length){var s=a.responsive.slice();s.sort((function(t,e){return t.breakpoint>e.breakpoint?1:e.breakpoint>t.breakpoint?-1:0})).reverse();var r=new N({}),o=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=s[0].breakpoint,o=window.innerWidth>0?window.innerWidth:screen.width;if(o>a){var n=y.extendArrayProps(r,i.globals.initialConfig,i);t=x.extend(n,t),t=x.extend(i.config,t),e.overrideResponsiveOptions(t)}else for(var l=0;l<s.length;l++)o<s[l].breakpoint&&(t=y.extendArrayProps(r,s[l].options,i),t=x.extend(i.config,t),e.overrideResponsiveOptions(t))};if(t){var n=y.extendArrayProps(r,t,i);n=x.extend(i.config,n),o(n=x.extend(n,t))}else o({})}}},{key:\"overrideResponsiveOptions\",value:function(t){var e=new N(t).init({responsiveOverride:!0});this.w.config=e}}]),t}(),it=function(){function t(e){a(this,t),this.ctx=e,this.colors=[],this.w=e.w;var i=this.w;this.isColorFn=!1,this.isHeatmapDistributed=\"treemap\"===i.config.chart.type&&i.config.plotOptions.treemap.distributed||\"heatmap\"===i.config.chart.type&&i.config.plotOptions.heatmap.distributed,this.isBarDistributed=i.config.plotOptions.bar.distributed&&(\"bar\"===i.config.chart.type||\"rangeBar\"===i.config.chart.type)}return r(t,[{key:\"init\",value:function(){this.setDefaultColors()}},{key:\"setDefaultColors\",value:function(){var t=this,e=this.w,i=new x;if(e.globals.dom.elWrap.classList.add(\"apexcharts-theme-\".concat(e.config.theme.mode)),void 0===e.config.colors?e.globals.colors=this.predefined():(e.globals.colors=e.config.colors,Array.isArray(e.config.colors)&&e.config.colors.length>0&&\"function\"==typeof e.config.colors[0]&&(e.globals.colors=e.config.series.map((function(i,a){var s=e.config.colors[a];return s||(s=e.config.colors[0]),\"function\"==typeof s?(t.isColorFn=!0,s({value:e.globals.axisCharts?e.globals.series[a][0]?e.globals.series[a][0]:0:e.globals.series[a],seriesIndex:a,dataPointIndex:a,w:e})):s})))),e.globals.seriesColors.map((function(t,i){t&&(e.globals.colors[i]=t)})),e.config.theme.monochrome.enabled){var a=[],s=e.globals.series.length;(this.isBarDistributed||this.isHeatmapDistributed)&&(s=e.globals.series[0].length*e.globals.series.length);for(var r=e.config.theme.monochrome.color,o=1/(s/e.config.theme.monochrome.shadeIntensity),n=e.config.theme.monochrome.shadeTo,l=0,h=0;h<s;h++){var c=void 0;\"dark\"===n?(c=i.shadeColor(-1*l,r),l+=o):(c=i.shadeColor(l,r),l+=o),a.push(c)}e.globals.colors=a.slice()}var d=e.globals.colors.slice();this.pushExtraColors(e.globals.colors);[\"fill\",\"stroke\"].forEach((function(i){void 0===e.config[i].colors?e.globals[i].colors=t.isColorFn?e.config.colors:d:e.globals[i].colors=e.config[i].colors.slice(),t.pushExtraColors(e.globals[i].colors)})),void 0===e.config.dataLabels.style.colors?e.globals.dataLabels.style.colors=d:e.globals.dataLabels.style.colors=e.config.dataLabels.style.colors.slice(),this.pushExtraColors(e.globals.dataLabels.style.colors,50),void 0===e.config.plotOptions.radar.polygons.fill.colors?e.globals.radarPolygons.fill.colors=[\"dark\"===e.config.theme.mode?\"#424242\":\"none\"]:e.globals.radarPolygons.fill.colors=e.config.plotOptions.radar.polygons.fill.colors.slice(),this.pushExtraColors(e.globals.radarPolygons.fill.colors,20),void 0===e.config.markers.colors?e.globals.markers.colors=d:e.globals.markers.colors=e.config.markers.colors.slice(),this.pushExtraColors(e.globals.markers.colors)}},{key:\"pushExtraColors\",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=this.w,s=e||a.globals.series.length;if(null===i&&(i=this.isBarDistributed||this.isHeatmapDistributed||\"heatmap\"===a.config.chart.type&&a.config.plotOptions.heatmap.colorScale.inverse),i&&a.globals.series.length&&(s=a.globals.series[a.globals.maxValsInArrayIndex].length*a.globals.series.length),t.length<s)for(var r=s-t.length,o=0;o<r;o++)t.push(t[o])}},{key:\"updateThemeOptions\",value:function(t){t.chart=t.chart||{},t.tooltip=t.tooltip||{};var e=t.theme.mode||\"light\",i=t.theme.palette?t.theme.palette:\"dark\"===e?\"palette4\":\"palette1\",a=t.chart.foreColor?t.chart.foreColor:\"dark\"===e?\"#f6f7f8\":\"#373d3f\";return t.tooltip.theme=e,t.chart.foreColor=a,t.theme.palette=i,t}},{key:\"predefined\",value:function(){switch(this.w.config.theme.palette){case\"palette1\":this.colors=[\"#008FFB\",\"#00E396\",\"#FEB019\",\"#FF4560\",\"#775DD0\"];break;case\"palette2\":this.colors=[\"#3f51b5\",\"#03a9f4\",\"#4caf50\",\"#f9ce1d\",\"#FF9800\"];break;case\"palette3\":this.colors=[\"#33b2df\",\"#546E7A\",\"#d4526e\",\"#13d8aa\",\"#A5978B\"];break;case\"palette4\":this.colors=[\"#4ecdc4\",\"#c7f464\",\"#81D4FA\",\"#fd6a6a\",\"#546E7A\"];break;case\"palette5\":this.colors=[\"#2b908f\",\"#f9a3a4\",\"#90ee7e\",\"#fa4443\",\"#69d2e7\"];break;case\"palette6\":this.colors=[\"#449DD1\",\"#F86624\",\"#EA3546\",\"#662E9B\",\"#C5D86D\"];break;case\"palette7\":this.colors=[\"#D7263D\",\"#1B998B\",\"#2E294E\",\"#F46036\",\"#E2C044\"];break;case\"palette8\":this.colors=[\"#662E9B\",\"#F86624\",\"#F9C80E\",\"#EA3546\",\"#43BCCD\"];break;case\"palette9\":this.colors=[\"#5C4742\",\"#A5978B\",\"#8D5B4C\",\"#5A2A27\",\"#C4BBAF\"];break;case\"palette10\":this.colors=[\"#A300D6\",\"#7D02EB\",\"#5653FE\",\"#2983FF\",\"#00B1F2\"];break;default:this.colors=[\"#008FFB\",\"#00E396\",\"#FEB019\",\"#FF4560\",\"#775DD0\"]}return this.colors}}]),t}(),at=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"draw\",value:function(){this.drawTitleSubtitle(\"title\"),this.drawTitleSubtitle(\"subtitle\")}},{key:\"drawTitleSubtitle\",value:function(t){var e=this.w,i=\"title\"===t?e.config.title:e.config.subtitle,a=e.globals.svgWidth/2,s=i.offsetY,r=\"middle\";if(\"left\"===i.align?(a=10,r=\"start\"):\"right\"===i.align&&(a=e.globals.svgWidth-10,r=\"end\"),a+=i.offsetX,s=s+parseInt(i.style.fontSize,10)+i.margin/2,void 0!==i.text){var o=new m(this.ctx).drawText({x:a,y:s,text:i.text,textAnchor:r,fontSize:i.style.fontSize,fontFamily:i.style.fontFamily,fontWeight:i.style.fontWeight,foreColor:i.style.color,opacity:1});o.node.setAttribute(\"class\",\"apexcharts-\".concat(t,\"-text\")),e.globals.dom.Paper.add(o)}}}]),t}(),st=function(){function t(e){a(this,t),this.w=e.w,this.dCtx=e}return r(t,[{key:\"getTitleSubtitleCoords\",value:function(t){var e=this.w,i=0,a=0,s=\"title\"===t?e.config.title.floating:e.config.subtitle.floating,r=e.globals.dom.baseEl.querySelector(\".apexcharts-\".concat(t,\"-text\"));if(null!==r&&!s){var o=r.getBoundingClientRect();i=o.width,a=e.globals.axisCharts?o.height+5:o.height}return{width:i,height:a}}},{key:\"getLegendsRect\",value:function(){var t=this.w,e=t.globals.dom.baseEl.querySelector(\".apexcharts-legend\");t.config.legend.height||\"top\"!==t.config.legend.position&&\"bottom\"!==t.config.legend.position||(e.style.maxHeight=t.globals.svgHeight/2+\"px\");var i=Object.assign({},x.getBoundingClientRect(e));return null!==e&&!t.config.legend.floating&&t.config.legend.show?this.dCtx.lgRect={x:i.x,y:i.y,height:i.height,width:0===i.height?0:i.width}:this.dCtx.lgRect={x:0,y:0,height:0,width:0},\"left\"!==t.config.legend.position&&\"right\"!==t.config.legend.position||1.5*this.dCtx.lgRect.width>t.globals.svgWidth&&(this.dCtx.lgRect.width=t.globals.svgWidth/1.5),this.dCtx.lgRect}},{key:\"getLargestStringFromMultiArr\",value:function(t,e){var i=t;if(this.w.globals.isMultiLineX){var a=e.map((function(t,e){return Array.isArray(t)?t.length:1})),s=Math.max.apply(Math,u(a));i=e[a.indexOf(s)]}return i}}]),t}(),rt=function(){function t(e){a(this,t),this.w=e.w,this.dCtx=e}return r(t,[{key:\"getxAxisLabelsCoords\",value:function(){var t,e=this.w,i=e.globals.labels.slice();if(e.config.xaxis.convertedCatToNumeric&&0===i.length&&(i=e.globals.categoryLabels),e.globals.timescaleLabels.length>0){var a=this.getxAxisTimeScaleLabelsCoords();t={width:a.width,height:a.height},e.globals.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends=\"left\"!==e.config.legend.position&&\"right\"!==e.config.legend.position||e.config.legend.floating?0:this.dCtx.lgRect.width;var s=e.globals.xLabelFormatter,r=x.getLargestStringFromArr(i),o=this.dCtx.dimHelpers.getLargestStringFromMultiArr(r,i);e.globals.isBarHorizontal&&(o=r=e.globals.yAxisScale[0].result.reduce((function(t,e){return t.length>e.length?t:e}),0));var n=new V(this.dCtx.ctx),l=r;r=n.xLabelFormat(s,r,l,{i:void 0,dateFormatter:new R(this.dCtx.ctx).formatDate,w:e}),o=n.xLabelFormat(s,o,l,{i:void 0,dateFormatter:new R(this.dCtx.ctx).formatDate,w:e}),(e.config.xaxis.convertedCatToNumeric&&void 0===r||\"\"===String(r).trim())&&(o=r=\"1\");var h=new m(this.dCtx.ctx),c=h.getTextRects(r,e.config.xaxis.labels.style.fontSize),d=c;if(r!==o&&(d=h.getTextRects(o,e.config.xaxis.labels.style.fontSize)),(t={width:c.width>=d.width?c.width:d.width,height:c.height>=d.height?c.height:d.height}).width*i.length>e.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&0!==e.config.xaxis.labels.rotate||e.config.xaxis.labels.rotateAlways){if(!e.globals.isBarHorizontal){e.globals.rotateXLabels=!0;var g=function(t){return h.getTextRects(t,e.config.xaxis.labels.style.fontSize,e.config.xaxis.labels.style.fontFamily,\"rotate(\".concat(e.config.xaxis.labels.rotate,\" 0 0)\"),!1)};c=g(r),r!==o&&(d=g(o)),t.height=(c.height>d.height?c.height:d.height)/1.5,t.width=c.width>d.width?c.width:d.width}}else e.globals.rotateXLabels=!1}return e.config.xaxis.labels.show||(t={width:0,height:0}),{width:t.width,height:t.height}}},{key:\"getxAxisGroupLabelsCoords\",value:function(){var t,e=this.w;if(!e.globals.hasGroups)return{width:0,height:0};var i,a=(null===(t=e.config.xaxis.group.style)||void 0===t?void 0:t.fontSize)||e.config.xaxis.labels.style.fontSize,s=e.globals.groups.map((function(t){return t.title})),r=x.getLargestStringFromArr(s),o=this.dCtx.dimHelpers.getLargestStringFromMultiArr(r,s),n=new m(this.dCtx.ctx),l=n.getTextRects(r,a),h=l;return r!==o&&(h=n.getTextRects(o,a)),i={width:l.width>=h.width?l.width:h.width,height:l.height>=h.height?l.height:h.height},e.config.xaxis.labels.show||(i={width:0,height:0}),{width:i.width,height:i.height}}},{key:\"getxAxisTitleCoords\",value:function(){var t=this.w,e=0,i=0;if(void 0!==t.config.xaxis.title.text){var a=new m(this.dCtx.ctx).getTextRects(t.config.xaxis.title.text,t.config.xaxis.title.style.fontSize);e=a.width,i=a.height}return{width:e,height:i}}},{key:\"getxAxisTimeScaleLabelsCoords\",value:function(){var t,e=this.w;this.dCtx.timescaleLabels=e.globals.timescaleLabels.slice();var i=this.dCtx.timescaleLabels.map((function(t){return t.value})),a=i.reduce((function(t,e){return void 0===t?(console.error(\"You have possibly supplied invalid Date format. Please supply a valid JavaScript Date\"),0):t.length>e.length?t:e}),0);return 1.05*(t=new m(this.dCtx.ctx).getTextRects(a,e.config.xaxis.labels.style.fontSize)).width*i.length>e.globals.gridWidth&&0!==e.config.xaxis.labels.rotate&&(e.globals.overlappingXLabels=!0),t}},{key:\"additionalPaddingXLabels\",value:function(t){var e=this,i=this.w,a=i.globals,s=i.config,r=s.xaxis.type,o=t.width;a.skipLastTimelinelabel=!1,a.skipFirstTimelinelabel=!1;var n=i.config.yaxis[0].opposite&&i.globals.isBarHorizontal,l=function(t,n){(function(t){return-1!==a.collapsedSeriesIndices.indexOf(t)})(n)||function(t){if(e.dCtx.timescaleLabels&&e.dCtx.timescaleLabels.length){var n=e.dCtx.timescaleLabels[0],l=e.dCtx.timescaleLabels[e.dCtx.timescaleLabels.length-1].position+o/1.75-e.dCtx.yAxisWidthRight,h=n.position-o/1.75+e.dCtx.yAxisWidthLeft,c=\"right\"===i.config.legend.position&&e.dCtx.lgRect.width>0?e.dCtx.lgRect.width:0;l>a.svgWidth-a.translateX-c&&(a.skipLastTimelinelabel=!0),h<-(t.show&&!t.floating||\"bar\"!==s.chart.type&&\"candlestick\"!==s.chart.type&&\"rangeBar\"!==s.chart.type&&\"boxPlot\"!==s.chart.type?10:o/1.75)&&(a.skipFirstTimelinelabel=!0)}else\"datetime\"===r?e.dCtx.gridPad.right<o&&!a.rotateXLabels&&(a.skipLastTimelinelabel=!0):\"datetime\"!==r&&e.dCtx.gridPad.right<o/2-e.dCtx.yAxisWidthRight&&!a.rotateXLabels&&!i.config.xaxis.labels.trim&&(\"between\"!==i.config.xaxis.tickPlacement||i.globals.isBarHorizontal)&&(e.dCtx.xPadRight=o/2+1)}(t)};s.yaxis.forEach((function(t,i){n?(e.dCtx.gridPad.left<o&&(e.dCtx.xPadLeft=o/2+1),e.dCtx.xPadRight=o/2+1):l(t,i)}))}}]),t}(),ot=function(){function t(e){a(this,t),this.w=e.w,this.dCtx=e}return r(t,[{key:\"getyAxisLabelsCoords\",value:function(){var t=this,e=this.w,i=[],a=10,s=new G(this.dCtx.ctx);return e.config.yaxis.map((function(r,o){var n=e.globals.yAxisScale[o],l=0;if(!s.isYAxisHidden(o)&&r.labels.show&&void 0!==r.labels.minWidth&&(l=r.labels.minWidth),!s.isYAxisHidden(o)&&r.labels.show&&n.result.length){var h=e.globals.yLabelFormatters[o],c=n.niceMin===Number.MIN_VALUE?0:n.niceMin,d=String(c).length>String(n.niceMax).length?c:n.niceMax,g=h(d,{seriesIndex:o,dataPointIndex:-1,w:e}),u=g;if(void 0!==g&&0!==g.length||(g=d),e.globals.isBarHorizontal){a=0;var f=e.globals.labels.slice();g=h(g=x.getLargestStringFromArr(f),{seriesIndex:o,dataPointIndex:-1,w:e}),u=t.dCtx.dimHelpers.getLargestStringFromMultiArr(g,f)}var p=new m(t.dCtx.ctx),b=\"rotate(\".concat(r.labels.rotate,\" 0 0)\"),v=p.getTextRects(g,r.labels.style.fontSize,r.labels.style.fontFamily,b,!1),y=v;g!==u&&(y=p.getTextRects(u,r.labels.style.fontSize,r.labels.style.fontFamily,b,!1)),i.push({width:(l>y.width||l>v.width?l:y.width>v.width?y.width:v.width)+a,height:y.height>v.height?y.height:v.height})}else i.push({width:0,height:0})})),i}},{key:\"getyAxisTitleCoords\",value:function(){var t=this,e=this.w,i=[];return e.config.yaxis.map((function(e,a){if(e.show&&void 0!==e.title.text){var s=new m(t.dCtx.ctx),r=\"rotate(\".concat(e.title.rotate,\" 0 0)\"),o=s.getTextRects(e.title.text,e.title.style.fontSize,e.title.style.fontFamily,r,!1);i.push({width:o.width,height:o.height})}else i.push({width:0,height:0})})),i}},{key:\"getTotalYAxisWidth\",value:function(){var t=this.w,e=0,i=0,a=0,s=t.globals.yAxisScale.length>1?10:0,r=new G(this.dCtx.ctx),o=function(o,n){var l=t.config.yaxis[n].floating,h=0;o.width>0&&!l?(h=o.width+s,function(e){return t.globals.ignoreYAxisIndexes.indexOf(e)>-1}(n)&&(h=h-o.width-s)):h=l||r.isYAxisHidden(n)?0:5,t.config.yaxis[n].opposite?a+=h:i+=h,e+=h};return t.globals.yLabelsCoords.map((function(t,e){o(t,e)})),t.globals.yTitleCoords.map((function(t,e){o(t,e)})),t.globals.isBarHorizontal&&!t.config.yaxis[0].floating&&(e=t.globals.yLabelsCoords[0].width+t.globals.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=i,this.dCtx.yAxisWidthRight=a,e}}]),t}(),nt=function(){function t(e){a(this,t),this.w=e.w,this.dCtx=e}return r(t,[{key:\"gridPadForColumnsInNumericAxis\",value:function(t){var e=this.w;if(e.globals.noData||e.globals.allSeriesCollapsed)return 0;var i=function(t){return\"bar\"===t||\"rangeBar\"===t||\"candlestick\"===t||\"boxPlot\"===t},a=e.config.chart.type,s=0,r=i(a)?e.config.series.length:1;if(e.globals.comboBarCount>0&&(r=e.globals.comboBarCount),e.globals.collapsedSeries.forEach((function(t){i(t.type)&&(r-=1)})),e.config.chart.stacked&&(r=1),(i(a)||e.globals.comboBarCount>0)&&e.globals.isXNumeric&&!e.globals.isBarHorizontal&&r>0){var o,n,l=Math.abs(e.globals.initialMaxX-e.globals.initialMinX);l<=3&&(l=e.globals.dataPoints),o=l/t,e.globals.minXDiff&&e.globals.minXDiff/o>0&&(n=e.globals.minXDiff/o),n>t/2&&(n/=2),(s=n/r*parseInt(e.config.plotOptions.bar.columnWidth,10)/100)<1&&(s=1),s=s/(r>1?1:1.5)+5,e.globals.barPadForNumericAxis=s}return s}},{key:\"gridPadFortitleSubtitle\",value:function(){var t=this,e=this.w,i=e.globals,a=this.dCtx.isSparkline||!e.globals.axisCharts?0:10;[\"title\",\"subtitle\"].forEach((function(i){void 0!==e.config[i].text?a+=e.config[i].margin:a+=t.dCtx.isSparkline||!e.globals.axisCharts?0:5})),!e.config.legend.show||\"bottom\"!==e.config.legend.position||e.config.legend.floating||e.globals.axisCharts||(a+=10);var s=this.dCtx.dimHelpers.getTitleSubtitleCoords(\"title\"),r=this.dCtx.dimHelpers.getTitleSubtitleCoords(\"subtitle\");i.gridHeight=i.gridHeight-s.height-r.height-a,i.translateY=i.translateY+s.height+r.height+a}},{key:\"setGridXPosForDualYAxis\",value:function(t,e){var i=this.w,a=new G(this.dCtx.ctx);i.config.yaxis.map((function(s,r){-1!==i.globals.ignoreYAxisIndexes.indexOf(r)||s.floating||a.isYAxisHidden(r)||(s.opposite&&(i.globals.translateX=i.globals.translateX-(e[r].width+t[r].width)-parseInt(i.config.yaxis[r].labels.style.fontSize,10)/1.2-12),i.globals.translateX<2&&(i.globals.translateX=2))}))}}]),t}(),lt=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w,this.lgRect={},this.yAxisWidth=0,this.yAxisWidthLeft=0,this.yAxisWidthRight=0,this.xAxisHeight=0,this.isSparkline=this.w.config.chart.sparkline.enabled,this.dimHelpers=new st(this),this.dimYAxis=new ot(this),this.dimXAxis=new rt(this),this.dimGrid=new nt(this),this.lgWidthForSideLegends=0,this.gridPad=this.w.config.grid.padding,this.xPadRight=0,this.xPadLeft=0}return r(t,[{key:\"plotCoords\",value:function(){var t=this,e=this.w,i=e.globals;this.lgRect=this.dimHelpers.getLegendsRect(),this.isSparkline&&(e.config.markers.discrete.length>0||e.config.markers.size>0)&&Object.entries(this.gridPad).forEach((function(e){var i=g(e,2),a=i[0],s=i[1];t.gridPad[a]=Math.max(s,t.w.globals.markers.largestSize/1.5)})),i.axisCharts?this.setDimensionsForAxisCharts():this.setDimensionsForNonAxisCharts(),this.dimGrid.gridPadFortitleSubtitle(),i.gridHeight=i.gridHeight-this.gridPad.top-this.gridPad.bottom,i.gridWidth=i.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;var a=this.dimGrid.gridPadForColumnsInNumericAxis(i.gridWidth);i.gridWidth=i.gridWidth-2*a,i.translateX=i.translateX+this.gridPad.left+this.xPadLeft+(a>0?a+4:0),i.translateY=i.translateY+this.gridPad.top}},{key:\"setDimensionsForAxisCharts\",value:function(){var t=this,e=this.w,i=e.globals,a=this.dimYAxis.getyAxisLabelsCoords(),s=this.dimYAxis.getyAxisTitleCoords();e.globals.yLabelsCoords=[],e.globals.yTitleCoords=[],e.config.yaxis.map((function(t,i){e.globals.yLabelsCoords.push({width:a[i].width,index:i}),e.globals.yTitleCoords.push({width:s[i].width,index:i})})),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();var r=this.dimXAxis.getxAxisLabelsCoords(),o=this.dimXAxis.getxAxisGroupLabelsCoords(),n=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(r,n,o),i.translateXAxisY=e.globals.rotateXLabels?this.xAxisHeight/8:-4,i.translateXAxisX=e.globals.rotateXLabels&&e.globals.isXNumeric&&e.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,e.globals.isBarHorizontal&&(i.rotateXLabels=!1,i.translateXAxisY=parseInt(e.config.xaxis.labels.style.fontSize,10)/1.5*-1),i.translateXAxisY=i.translateXAxisY+e.config.xaxis.labels.offsetY,i.translateXAxisX=i.translateXAxisX+e.config.xaxis.labels.offsetX;var l=this.yAxisWidth,h=this.xAxisHeight;i.xAxisLabelsHeight=this.xAxisHeight-n.height,i.xAxisGroupLabelsHeight=i.xAxisLabelsHeight-r.height,i.xAxisLabelsWidth=this.xAxisWidth,i.xAxisHeight=this.xAxisHeight;var c=10;(\"radar\"===e.config.chart.type||this.isSparkline)&&(l=0,h=i.goldenPadding),this.isSparkline&&(this.lgRect={height:0,width:0}),(this.isSparkline||\"treemap\"===e.config.chart.type)&&(l=0,h=0,c=0),this.isSparkline||this.dimXAxis.additionalPaddingXLabels(r);var d=function(){i.translateX=l,i.gridHeight=i.svgHeight-t.lgRect.height-h-(t.isSparkline||\"treemap\"===e.config.chart.type?0:e.globals.rotateXLabels?10:15),i.gridWidth=i.svgWidth-l};switch(\"top\"===e.config.xaxis.position&&(c=i.xAxisHeight-e.config.xaxis.axisTicks.height-5),e.config.legend.position){case\"bottom\":i.translateY=c,d();break;case\"top\":i.translateY=this.lgRect.height+c,d();break;case\"left\":i.translateY=c,i.translateX=this.lgRect.width+l,i.gridHeight=i.svgHeight-h-12,i.gridWidth=i.svgWidth-this.lgRect.width-l;break;case\"right\":i.translateY=c,i.translateX=l,i.gridHeight=i.svgHeight-h-12,i.gridWidth=i.svgWidth-this.lgRect.width-l-5;break;default:throw new Error(\"Legend position not supported\")}this.dimGrid.setGridXPosForDualYAxis(s,a),new $(this.ctx).setYAxisXPosition(a,s)}},{key:\"setDimensionsForNonAxisCharts\",value:function(){var t=this.w,e=t.globals,i=t.config,a=0;t.config.legend.show&&!t.config.legend.floating&&(a=20);var s=\"pie\"===i.chart.type||\"polarArea\"===i.chart.type||\"donut\"===i.chart.type?\"pie\":\"radialBar\",r=i.plotOptions[s].offsetY,o=i.plotOptions[s].offsetX;if(!i.legend.show||i.legend.floating)return e.gridHeight=e.svgHeight-i.grid.padding.left+i.grid.padding.right,e.gridWidth=e.gridHeight,e.translateY=r,void(e.translateX=o+(e.svgWidth-e.gridWidth)/2);switch(i.legend.position){case\"bottom\":e.gridHeight=e.svgHeight-this.lgRect.height-e.goldenPadding,e.gridWidth=e.svgWidth,e.translateY=r-10,e.translateX=o+(e.svgWidth-e.gridWidth)/2;break;case\"top\":e.gridHeight=e.svgHeight-this.lgRect.height-e.goldenPadding,e.gridWidth=e.svgWidth,e.translateY=this.lgRect.height+r+10,e.translateX=o+(e.svgWidth-e.gridWidth)/2;break;case\"left\":e.gridWidth=e.svgWidth-this.lgRect.width-a,e.gridHeight=\"auto\"!==i.chart.height?e.svgHeight:e.gridWidth,e.translateY=r,e.translateX=o+this.lgRect.width+a;break;case\"right\":e.gridWidth=e.svgWidth-this.lgRect.width-a-5,e.gridHeight=\"auto\"!==i.chart.height?e.svgHeight:e.gridWidth,e.translateY=r,e.translateX=o+10;break;default:throw new Error(\"Legend position not supported\")}}},{key:\"conditionalChecksForAxisCoords\",value:function(t,e,i){var a=this.w,s=a.globals.hasGroups?2:1,r=i.height+t.height+e.height,o=a.globals.isMultiLineX?1.2:a.globals.LINE_HEIGHT_RATIO,n=a.globals.rotateXLabels?22:10,l=a.globals.rotateXLabels&&\"bottom\"===a.config.legend.position?10:0;this.xAxisHeight=r*o+s*n+l,this.xAxisWidth=t.width,this.xAxisHeight-e.height>a.config.xaxis.labels.maxHeight&&(this.xAxisHeight=a.config.xaxis.labels.maxHeight),a.config.xaxis.labels.minHeight&&this.xAxisHeight<a.config.xaxis.labels.minHeight&&(this.xAxisHeight=a.config.xaxis.labels.minHeight),a.config.xaxis.floating&&(this.xAxisHeight=0);var h=0,c=0;a.config.yaxis.forEach((function(t){h+=t.labels.minWidth,c+=t.labels.maxWidth})),this.yAxisWidth<h&&(this.yAxisWidth=h),this.yAxisWidth>c&&(this.yAxisWidth=c)}}]),t}(),ht=function(){function t(e){a(this,t),this.w=e.w,this.lgCtx=e}return r(t,[{key:\"getLegendStyles\",value:function(){var t=document.createElement(\"style\");t.setAttribute(\"type\",\"text/css\");var e=document.createTextNode(\"\\t\\n    \\t\\n      .apexcharts-legend {\\t\\n        display: flex;\\t\\n        overflow: auto;\\t\\n        padding: 0 10px;\\t\\n      }\\t\\n      .apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {\\t\\n        flex-wrap: wrap\\t\\n      }\\t\\n      .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\\t\\n        flex-direction: column;\\t\\n        bottom: 0;\\t\\n      }\\t\\n      .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\\t\\n        justify-content: flex-start;\\t\\n      }\\t\\n      .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {\\t\\n        justify-content: center;  \\t\\n      }\\t\\n      .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {\\t\\n        justify-content: flex-end;\\t\\n      }\\t\\n      .apexcharts-legend-series {\\t\\n        cursor: pointer;\\t\\n        line-height: normal;\\t\\n      }\\t\\n      .apexcharts-legend.apx-legend-position-bottom .apexcharts-legend-series, .apexcharts-legend.apx-legend-position-top .apexcharts-legend-series{\\t\\n        display: flex;\\t\\n        align-items: center;\\t\\n      }\\t\\n      .apexcharts-legend-text {\\t\\n        position: relative;\\t\\n        font-size: 14px;\\t\\n      }\\t\\n      .apexcharts-legend-text *, .apexcharts-legend-marker * {\\t\\n        pointer-events: none;\\t\\n      }\\t\\n      .apexcharts-legend-marker {\\t\\n        position: relative;\\t\\n        display: inline-block;\\t\\n        cursor: pointer;\\t\\n        margin-right: 3px;\\t\\n        border-style: solid;\\n      }\\t\\n      \\t\\n      .apexcharts-legend.apexcharts-align-right .apexcharts-legend-series, .apexcharts-legend.apexcharts-align-left .apexcharts-legend-series{\\t\\n        display: inline-block;\\t\\n      }\\t\\n      .apexcharts-legend-series.apexcharts-no-click {\\t\\n        cursor: auto;\\t\\n      }\\t\\n      .apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\\t\\n        display: none !important;\\t\\n      }\\t\\n      .apexcharts-inactive-legend {\\t\\n        opacity: 0.45;\\t\\n      }\");return t.appendChild(e),t}},{key:\"getLegendBBox\",value:function(){var t=this.w.globals.dom.baseEl.querySelector(\".apexcharts-legend\").getBoundingClientRect(),e=t.width;return{clwh:t.height,clww:e}}},{key:\"appendToForeignObject\",value:function(){var t=this.w.globals;t.dom.elLegendForeign=document.createElementNS(t.SVGNS,\"foreignObject\");var e=t.dom.elLegendForeign;e.setAttribute(\"x\",0),e.setAttribute(\"y\",0),e.setAttribute(\"width\",t.svgWidth),e.setAttribute(\"height\",t.svgHeight),t.dom.elLegendWrap.setAttribute(\"xmlns\",\"http://www.w3.org/1999/xhtml\"),e.appendChild(t.dom.elLegendWrap),e.appendChild(this.getLegendStyles()),t.dom.Paper.node.insertBefore(e,t.dom.elGraphical.node)}},{key:\"toggleDataSeries\",value:function(t,e){var i=this,a=this.w;if(a.globals.axisCharts||\"radialBar\"===a.config.chart.type){a.globals.resized=!0;var s=null,r=null;if(a.globals.risingSeries=[],a.globals.axisCharts?(s=a.globals.dom.baseEl.querySelector(\".apexcharts-series[data\\\\:realIndex='\".concat(t,\"']\")),r=parseInt(s.getAttribute(\"data:realIndex\"),10)):(s=a.globals.dom.baseEl.querySelector(\".apexcharts-series[rel='\".concat(t+1,\"']\")),r=parseInt(s.getAttribute(\"rel\"),10)-1),e)[{cs:a.globals.collapsedSeries,csi:a.globals.collapsedSeriesIndices},{cs:a.globals.ancillaryCollapsedSeries,csi:a.globals.ancillaryCollapsedSeriesIndices}].forEach((function(t){i.riseCollapsedSeries(t.cs,t.csi,r)}));else this.hideSeries({seriesEl:s,realIndex:r})}else{var o=a.globals.dom.Paper.select(\" .apexcharts-series[rel='\".concat(t+1,\"'] path\")),n=a.config.chart.type;if(\"pie\"===n||\"polarArea\"===n||\"donut\"===n){var l=a.config.plotOptions.pie.donut.labels;new m(this.lgCtx.ctx).pathMouseDown(o.members[0],null),this.lgCtx.ctx.pie.printDataLabelsInner(o.members[0].node,l)}o.fire(\"click\")}}},{key:\"hideSeries\",value:function(t){var e=t.seriesEl,i=t.realIndex,a=this.w,s=x.clone(a.config.series);if(a.globals.axisCharts){var r=!1;if(a.config.yaxis[i]&&a.config.yaxis[i].show&&a.config.yaxis[i].showAlways&&(r=!0,a.globals.ancillaryCollapsedSeriesIndices.indexOf(i)<0&&(a.globals.ancillaryCollapsedSeries.push({index:i,data:s[i].data.slice(),type:e.parentNode.className.baseVal.split(\"-\")[1]}),a.globals.ancillaryCollapsedSeriesIndices.push(i))),!r){a.globals.collapsedSeries.push({index:i,data:s[i].data.slice(),type:e.parentNode.className.baseVal.split(\"-\")[1]}),a.globals.collapsedSeriesIndices.push(i);var o=a.globals.risingSeries.indexOf(i);a.globals.risingSeries.splice(o,1)}}else a.globals.collapsedSeries.push({index:i,data:s[i]}),a.globals.collapsedSeriesIndices.push(i);for(var n=e.childNodes,l=0;l<n.length;l++)n[l].classList.contains(\"apexcharts-series-markers-wrap\")&&(n[l].classList.contains(\"apexcharts-hide\")?n[l].classList.remove(\"apexcharts-hide\"):n[l].classList.add(\"apexcharts-hide\"));a.globals.allSeriesCollapsed=a.globals.collapsedSeries.length===a.config.series.length,s=this._getSeriesBasedOnCollapsedState(s),this.lgCtx.ctx.updateHelpers._updateSeries(s,a.config.chart.animations.dynamicAnimation.enabled)}},{key:\"riseCollapsedSeries\",value:function(t,e,i){var a=this.w,s=x.clone(a.config.series);if(t.length>0){for(var r=0;r<t.length;r++)t[r].index===i&&(a.globals.axisCharts?(s[i].data=t[r].data.slice(),t.splice(r,1),e.splice(r,1),a.globals.risingSeries.push(i)):(s[i]=t[r].data,t.splice(r,1),e.splice(r,1),a.globals.risingSeries.push(i)));s=this._getSeriesBasedOnCollapsedState(s),this.lgCtx.ctx.updateHelpers._updateSeries(s,a.config.chart.animations.dynamicAnimation.enabled)}}},{key:\"_getSeriesBasedOnCollapsedState\",value:function(t){var e=this.w;return e.globals.axisCharts?t.forEach((function(i,a){e.globals.collapsedSeriesIndices.indexOf(a)>-1&&(t[a].data=[])})):t.forEach((function(i,a){e.globals.collapsedSeriesIndices.indexOf(a)>-1&&(t[a]=0)})),t}}]),t}(),ct=function(){function t(e,i){a(this,t),this.ctx=e,this.w=e.w,this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed=\"bar\"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new ht(this)}return r(t,[{key:\"init\",value:function(){var t=this.w,e=t.globals,i=t.config;if((i.legend.showForSingleSeries&&1===e.series.length||this.isBarsDistributed||e.series.length>1||!e.axisCharts)&&i.legend.show){for(;e.dom.elLegendWrap.firstChild;)e.dom.elLegendWrap.removeChild(e.dom.elLegendWrap.firstChild);this.drawLegends(),x.isIE11()?document.getElementsByTagName(\"head\")[0].appendChild(this.legendHelpers.getLegendStyles()):this.legendHelpers.appendToForeignObject(),\"bottom\"===i.legend.position||\"top\"===i.legend.position?this.legendAlignHorizontal():\"right\"!==i.legend.position&&\"left\"!==i.legend.position||this.legendAlignVertical()}}},{key:\"drawLegends\",value:function(){var t=this,e=this.w,i=e.config.legend.fontFamily,a=e.globals.seriesNames,s=e.globals.colors.slice();if(\"heatmap\"===e.config.chart.type){var r=e.config.plotOptions.heatmap.colorScale.ranges;a=r.map((function(t){return t.name?t.name:t.from+\" - \"+t.to})),s=r.map((function(t){return t.color}))}else this.isBarsDistributed&&(a=e.globals.labels.slice());e.config.legend.customLegendItems.length&&(a=e.config.legend.customLegendItems);for(var o=e.globals.legendFormatter,n=e.config.legend.inverseOrder,l=n?a.length-1:0;n?l>=0:l<=a.length-1;n?l--:l++){var h=o(a[l],{seriesIndex:l,w:e}),c=!1,d=!1;if(e.globals.collapsedSeries.length>0)for(var g=0;g<e.globals.collapsedSeries.length;g++)e.globals.collapsedSeries[g].index===l&&(c=!0);if(e.globals.ancillaryCollapsedSeriesIndices.length>0)for(var u=0;u<e.globals.ancillaryCollapsedSeriesIndices.length;u++)e.globals.ancillaryCollapsedSeriesIndices[u]===l&&(d=!0);var f=document.createElement(\"span\");f.classList.add(\"apexcharts-legend-marker\");var p=e.config.legend.markers.offsetX,b=e.config.legend.markers.offsetY,v=e.config.legend.markers.height,w=e.config.legend.markers.width,k=e.config.legend.markers.strokeWidth,A=e.config.legend.markers.strokeColor,S=e.config.legend.markers.radius,C=f.style;C.background=s[l],C.color=s[l],C.setProperty(\"background\",s[l],\"important\"),e.config.legend.markers.fillColors&&e.config.legend.markers.fillColors[l]&&(C.background=e.config.legend.markers.fillColors[l]),void 0!==e.globals.seriesColors[l]&&(C.background=e.globals.seriesColors[l],C.color=e.globals.seriesColors[l]),C.height=Array.isArray(v)?parseFloat(v[l])+\"px\":parseFloat(v)+\"px\",C.width=Array.isArray(w)?parseFloat(w[l])+\"px\":parseFloat(w)+\"px\",C.left=(Array.isArray(p)?parseFloat(p[l]):parseFloat(p))+\"px\",C.top=(Array.isArray(b)?parseFloat(b[l]):parseFloat(b))+\"px\",C.borderWidth=Array.isArray(k)?k[l]:k,C.borderColor=Array.isArray(A)?A[l]:A,C.borderRadius=Array.isArray(S)?parseFloat(S[l])+\"px\":parseFloat(S)+\"px\",e.config.legend.markers.customHTML&&(Array.isArray(e.config.legend.markers.customHTML)?e.config.legend.markers.customHTML[l]&&(f.innerHTML=e.config.legend.markers.customHTML[l]()):f.innerHTML=e.config.legend.markers.customHTML()),m.setAttrs(f,{rel:l+1,\"data:collapsed\":c||d}),(c||d)&&f.classList.add(\"apexcharts-inactive-legend\");var L=document.createElement(\"div\"),P=document.createElement(\"span\");P.classList.add(\"apexcharts-legend-text\"),P.innerHTML=Array.isArray(h)?h.join(\" \"):h;var M=e.config.legend.labels.useSeriesColors?e.globals.colors[l]:e.config.legend.labels.colors;M||(M=e.config.chart.foreColor),P.style.color=M,P.style.fontSize=parseFloat(e.config.legend.fontSize)+\"px\",P.style.fontWeight=e.config.legend.fontWeight,P.style.fontFamily=i||e.config.chart.fontFamily,m.setAttrs(P,{rel:l+1,i:l,\"data:default-text\":encodeURIComponent(h),\"data:collapsed\":c||d}),L.appendChild(f),L.appendChild(P);var T=new y(this.ctx);if(!e.config.legend.showForZeroSeries)0===T.getSeriesTotalByIndex(l)&&T.seriesHaveSameValues(l)&&!T.isSeriesNull(l)&&-1===e.globals.collapsedSeriesIndices.indexOf(l)&&-1===e.globals.ancillaryCollapsedSeriesIndices.indexOf(l)&&L.classList.add(\"apexcharts-hidden-zero-series\");e.config.legend.showForNullSeries||T.isSeriesNull(l)&&-1===e.globals.collapsedSeriesIndices.indexOf(l)&&-1===e.globals.ancillaryCollapsedSeriesIndices.indexOf(l)&&L.classList.add(\"apexcharts-hidden-null-series\"),e.globals.dom.elLegendWrap.appendChild(L),e.globals.dom.elLegendWrap.classList.add(\"apexcharts-align-\".concat(e.config.legend.horizontalAlign)),e.globals.dom.elLegendWrap.classList.add(\"apx-legend-position-\"+e.config.legend.position),L.classList.add(\"apexcharts-legend-series\"),L.style.margin=\"\".concat(e.config.legend.itemMargin.vertical,\"px \").concat(e.config.legend.itemMargin.horizontal,\"px\"),e.globals.dom.elLegendWrap.style.width=e.config.legend.width?e.config.legend.width+\"px\":\"\",e.globals.dom.elLegendWrap.style.height=e.config.legend.height?e.config.legend.height+\"px\":\"\",m.setAttrs(L,{rel:l+1,seriesName:x.escapeString(a[l]),\"data:collapsed\":c||d}),(c||d)&&L.classList.add(\"apexcharts-inactive-legend\"),e.config.legend.onItemClick.toggleDataSeries||L.classList.add(\"apexcharts-no-click\")}e.globals.dom.elWrap.addEventListener(\"click\",t.onLegendClick,!0),e.config.legend.onItemHover.highlightDataSeries&&0===e.config.legend.customLegendItems.length&&(e.globals.dom.elWrap.addEventListener(\"mousemove\",t.onLegendHovered,!0),e.globals.dom.elWrap.addEventListener(\"mouseout\",t.onLegendHovered,!0))}},{key:\"setLegendWrapXY\",value:function(t,e){var i=this.w,a=i.globals.dom.baseEl.querySelector(\".apexcharts-legend\"),s=a.getBoundingClientRect(),r=0,o=0;if(\"bottom\"===i.config.legend.position)o+=i.globals.svgHeight-s.height/2;else if(\"top\"===i.config.legend.position){var n=new lt(this.ctx),l=n.dimHelpers.getTitleSubtitleCoords(\"title\").height,h=n.dimHelpers.getTitleSubtitleCoords(\"subtitle\").height;o=o+(l>0?l-10:0)+(h>0?h-10:0)}a.style.position=\"absolute\",r=r+t+i.config.legend.offsetX,o=o+e+i.config.legend.offsetY,a.style.left=r+\"px\",a.style.top=o+\"px\",\"bottom\"===i.config.legend.position?(a.style.top=\"auto\",a.style.bottom=5-i.config.legend.offsetY+\"px\"):\"right\"===i.config.legend.position&&(a.style.left=\"auto\",a.style.right=25+i.config.legend.offsetX+\"px\");[\"width\",\"height\"].forEach((function(t){a.style[t]&&(a.style[t]=parseInt(i.config.legend[t],10)+\"px\")}))}},{key:\"legendAlignHorizontal\",value:function(){var t=this.w;t.globals.dom.baseEl.querySelector(\".apexcharts-legend\").style.right=0;var e=this.legendHelpers.getLegendBBox(),i=new lt(this.ctx),a=i.dimHelpers.getTitleSubtitleCoords(\"title\"),s=i.dimHelpers.getTitleSubtitleCoords(\"subtitle\"),r=0;\"bottom\"===t.config.legend.position?r=-e.clwh/1.8:\"top\"===t.config.legend.position&&(r=a.height+s.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(20,r)}},{key:\"legendAlignVertical\",value:function(){var t=this.w,e=this.legendHelpers.getLegendBBox(),i=0;\"left\"===t.config.legend.position&&(i=20),\"right\"===t.config.legend.position&&(i=t.globals.svgWidth-e.clww-10),this.setLegendWrapXY(i,20)}},{key:\"onLegendHovered\",value:function(t){var e=this.w,i=t.target.classList.contains(\"apexcharts-legend-text\")||t.target.classList.contains(\"apexcharts-legend-marker\");if(\"heatmap\"===e.config.chart.type||this.isBarsDistributed){if(i){var a=parseInt(t.target.getAttribute(\"rel\"),10)-1;this.ctx.events.fireEvent(\"legendHover\",[this.ctx,a,this.w]),new E(this.ctx).highlightRangeInSeries(t,t.target)}}else!t.target.classList.contains(\"apexcharts-inactive-legend\")&&i&&new E(this.ctx).toggleSeriesOnHover(t,t.target)}},{key:\"onLegendClick\",value:function(t){var e=this.w;if(!e.config.legend.customLegendItems.length&&(t.target.classList.contains(\"apexcharts-legend-text\")||t.target.classList.contains(\"apexcharts-legend-marker\"))){var i=parseInt(t.target.getAttribute(\"rel\"),10)-1,a=\"true\"===t.target.getAttribute(\"data:collapsed\"),s=this.w.config.chart.events.legendClick;\"function\"==typeof s&&s(this.ctx,i,this.w),this.ctx.events.fireEvent(\"legendClick\",[this.ctx,i,this.w]);var r=this.w.config.legend.markers.onClick;\"function\"==typeof r&&t.target.classList.contains(\"apexcharts-legend-marker\")&&(r(this.ctx,i,this.w),this.ctx.events.fireEvent(\"legendMarkerClick\",[this.ctx,i,this.w])),\"treemap\"!==e.config.chart.type&&\"heatmap\"!==e.config.chart.type&&!this.isBarsDistributed&&e.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(i,a)}}}]),t}(),dt=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w;var i=this.w;this.ev=this.w.config.chart.events,this.selectedClass=\"apexcharts-selected\",this.localeValues=this.w.globals.locale.toolbar,this.minX=i.globals.minX,this.maxX=i.globals.maxX}return r(t,[{key:\"createToolbar\",value:function(){var t=this,e=this.w,i=function(){return document.createElement(\"div\")},a=i();if(a.setAttribute(\"class\",\"apexcharts-toolbar\"),a.style.top=e.config.chart.toolbar.offsetY+\"px\",a.style.right=3-e.config.chart.toolbar.offsetX+\"px\",e.globals.dom.elWrap.appendChild(a),this.elZoom=i(),this.elZoomIn=i(),this.elZoomOut=i(),this.elPan=i(),this.elSelection=i(),this.elZoomReset=i(),this.elMenuIcon=i(),this.elMenu=i(),this.elCustomIcons=[],this.t=e.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(var s=0;s<this.t.customIcons.length;s++)this.elCustomIcons.push(i());var r=[],o=function(i,a,s){var o=i.toLowerCase();t.t[o]&&e.config.chart.zoom.enabled&&r.push({el:a,icon:\"string\"==typeof t.t[o]?t.t[o]:s,title:t.localeValues[i],class:\"apexcharts-\".concat(o,\"-icon\")})};o(\"zoomIn\",this.elZoomIn,'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\\n    <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\\n    <path d=\"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z\"/>\\n</svg>\\n'),o(\"zoomOut\",this.elZoomOut,'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\\n    <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\\n    <path d=\"M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z\"/>\\n</svg>\\n');var n=function(i){t.t[i]&&e.config.chart[i].enabled&&r.push({el:\"zoom\"===i?t.elZoom:t.elSelection,icon:\"string\"==typeof t.t[i]?t.t[i]:\"zoom\"===i?'<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"#000000\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\">\\n    <path d=\"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\"/>\\n    <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\\n    <path d=\"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z\"/>\\n</svg>':'<svg fill=\"#6E8192\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\\n    <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\\n    <path d=\"M3 5h2V3c-1.1 0-2 .9-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2c0-1.1-.9-2-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2z\"/>\\n</svg>',title:t.localeValues[\"zoom\"===i?\"selectionZoom\":\"selection\"],class:e.globals.isTouchDevice?\"apexcharts-element-hidden\":\"apexcharts-\".concat(i,\"-icon\")})};n(\"zoom\"),n(\"selection\"),this.t.pan&&e.config.chart.zoom.enabled&&r.push({el:this.elPan,icon:\"string\"==typeof this.t.pan?this.t.pan:'<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" fill=\"#000000\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\">\\n    <defs>\\n        <path d=\"M0 0h24v24H0z\" id=\"a\"/>\\n    </defs>\\n    <clipPath id=\"b\">\\n        <use overflow=\"visible\" xlink:href=\"#a\"/>\\n    </clipPath>\\n    <path clip-path=\"url(#b)\" d=\"M23 5.5V20c0 2.2-1.8 4-4 4h-7.3c-1.08 0-2.1-.43-2.85-1.19L1 14.83s1.26-1.23 1.3-1.25c.22-.19.49-.29.79-.29.22 0 .42.06.6.16.04.01 4.31 2.46 4.31 2.46V4c0-.83.67-1.5 1.5-1.5S11 3.17 11 4v7h1V1.5c0-.83.67-1.5 1.5-1.5S15 .67 15 1.5V11h1V2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V11h1V5.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5z\"/>\\n</svg>',title:this.localeValues.pan,class:e.globals.isTouchDevice?\"apexcharts-element-hidden\":\"apexcharts-pan-icon\"}),o(\"reset\",this.elZoomReset,'<svg fill=\"#000000\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\\n    <path d=\"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z\"/>\\n    <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\\n</svg>'),this.t.download&&r.push({el:this.elMenuIcon,icon:\"string\"==typeof this.t.download?this.t.download:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path fill=\"none\" d=\"M0 0h24v24H0V0z\"/><path d=\"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z\"/></svg>',title:this.localeValues.menu,class:\"apexcharts-menu-icon\"});for(var l=0;l<this.elCustomIcons.length;l++)r.push({el:this.elCustomIcons[l],icon:this.t.customIcons[l].icon,title:this.t.customIcons[l].title,index:this.t.customIcons[l].index,class:\"apexcharts-toolbar-custom-icon \"+this.t.customIcons[l].class});r.forEach((function(t,e){t.index&&x.moveIndexInArray(r,e,t.index)}));for(var h=0;h<r.length;h++)m.setAttrs(r[h].el,{class:r[h].class,title:r[h].title}),r[h].el.innerHTML=r[h].icon,a.appendChild(r[h].el);this._createHamburgerMenu(a),e.globals.zoomEnabled?this.elZoom.classList.add(this.selectedClass):e.globals.panEnabled?this.elPan.classList.add(this.selectedClass):e.globals.selectionEnabled&&this.elSelection.classList.add(this.selectedClass),this.addToolbarEventListeners()}},{key:\"_createHamburgerMenu\",value:function(t){this.elMenuItems=[],t.appendChild(this.elMenu),m.setAttrs(this.elMenu,{class:\"apexcharts-menu\"});var e=[{name:\"exportSVG\",title:this.localeValues.exportToSVG},{name:\"exportPNG\",title:this.localeValues.exportToPNG},{name:\"exportCSV\",title:this.localeValues.exportToCSV}];this.w.globals.allSeriesHasEqualX||e.splice(2,1);for(var i=0;i<e.length;i++)this.elMenuItems.push(document.createElement(\"div\")),this.elMenuItems[i].innerHTML=e[i].title,m.setAttrs(this.elMenuItems[i],{class:\"apexcharts-menu-item \".concat(e[i].name),title:e[i].title}),this.elMenu.appendChild(this.elMenuItems[i])}},{key:\"addToolbarEventListeners\",value:function(){var t=this;this.elZoomReset.addEventListener(\"click\",this.handleZoomReset.bind(this)),this.elSelection.addEventListener(\"click\",this.toggleZoomSelection.bind(this,\"selection\")),this.elZoom.addEventListener(\"click\",this.toggleZoomSelection.bind(this,\"zoom\")),this.elZoomIn.addEventListener(\"click\",this.handleZoomIn.bind(this)),this.elZoomOut.addEventListener(\"click\",this.handleZoomOut.bind(this)),this.elPan.addEventListener(\"click\",this.togglePanning.bind(this)),this.elMenuIcon.addEventListener(\"click\",this.toggleMenu.bind(this)),this.elMenuItems.forEach((function(e){e.classList.contains(\"exportSVG\")?e.addEventListener(\"click\",t.handleDownload.bind(t,\"svg\")):e.classList.contains(\"exportPNG\")?e.addEventListener(\"click\",t.handleDownload.bind(t,\"png\")):e.classList.contains(\"exportCSV\")&&e.addEventListener(\"click\",t.handleDownload.bind(t,\"csv\"))}));for(var e=0;e<this.t.customIcons.length;e++)this.elCustomIcons[e].addEventListener(\"click\",this.t.customIcons[e].click.bind(this,this.ctx,this.ctx.w))}},{key:\"toggleZoomSelection\",value:function(t){this.ctx.getSyncedCharts().forEach((function(e){e.ctx.toolbar.toggleOtherControls();var i=\"selection\"===t?e.ctx.toolbar.elSelection:e.ctx.toolbar.elZoom,a=\"selection\"===t?\"selectionEnabled\":\"zoomEnabled\";e.w.globals[a]=!e.w.globals[a],i.classList.contains(e.ctx.toolbar.selectedClass)?i.classList.remove(e.ctx.toolbar.selectedClass):i.classList.add(e.ctx.toolbar.selectedClass)}))}},{key:\"getToolbarIconsReference\",value:function(){var t=this.w;this.elZoom||(this.elZoom=t.globals.dom.baseEl.querySelector(\".apexcharts-zoom-icon\")),this.elPan||(this.elPan=t.globals.dom.baseEl.querySelector(\".apexcharts-pan-icon\")),this.elSelection||(this.elSelection=t.globals.dom.baseEl.querySelector(\".apexcharts-selection-icon\"))}},{key:\"enableZoomPanFromToolbar\",value:function(t){this.toggleOtherControls(),\"pan\"===t?this.w.globals.panEnabled=!0:this.w.globals.zoomEnabled=!0;var e=\"pan\"===t?this.elPan:this.elZoom,i=\"pan\"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}},{key:\"togglePanning\",value:function(){this.ctx.getSyncedCharts().forEach((function(t){t.ctx.toolbar.toggleOtherControls(),t.w.globals.panEnabled=!t.w.globals.panEnabled,t.ctx.toolbar.elPan.classList.contains(t.ctx.toolbar.selectedClass)?t.ctx.toolbar.elPan.classList.remove(t.ctx.toolbar.selectedClass):t.ctx.toolbar.elPan.classList.add(t.ctx.toolbar.selectedClass)}))}},{key:\"toggleOtherControls\",value:function(){var t=this,e=this.w;e.globals.panEnabled=!1,e.globals.zoomEnabled=!1,e.globals.selectionEnabled=!1,this.getToolbarIconsReference(),[this.elPan,this.elSelection,this.elZoom].forEach((function(e){e&&e.classList.remove(t.selectedClass)}))}},{key:\"handleZoomIn\",value:function(){var t=this.w;t.globals.isRangeBar&&(this.minX=t.globals.minY,this.maxX=t.globals.maxY);var e=(this.minX+this.maxX)/2,i=(this.minX+e)/2,a=(this.maxX+e)/2,s=this._getNewMinXMaxX(i,a);t.globals.disableZoomIn||this.zoomUpdateOptions(s.minX,s.maxX)}},{key:\"handleZoomOut\",value:function(){var t=this.w;if(t.globals.isRangeBar&&(this.minX=t.globals.minY,this.maxX=t.globals.maxY),!(\"datetime\"===t.config.xaxis.type&&new Date(this.minX).getUTCFullYear()<1e3)){var e=(this.minX+this.maxX)/2,i=this.minX-(e-this.minX),a=this.maxX-(e-this.maxX),s=this._getNewMinXMaxX(i,a);t.globals.disableZoomOut||this.zoomUpdateOptions(s.minX,s.maxX)}}},{key:\"_getNewMinXMaxX\",value:function(t,e){var i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(t):t,maxX:i?Math.floor(e):e}}},{key:\"zoomUpdateOptions\",value:function(t,e){var i=this.w;if(void 0!==t||void 0!==e){if(!(i.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=i.globals.dataPoints),e-t<2))){var a={min:t,max:e},s=this.getBeforeZoomRange(a);s&&(a=s.xaxis);var r={xaxis:a},o=x.clone(i.globals.initialConfig.yaxis);if(i.config.chart.zoom.autoScaleYaxis)o=new q(this.ctx).autoScaleY(this.ctx,o,{xaxis:a});i.config.chart.group||(r.yaxis=o),this.w.globals.zoomed=!0,this.ctx.updateHelpers._updateOptions(r,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(a,o)}}else this.handleZoomReset()}},{key:\"zoomCallback\",value:function(t,e){\"function\"==typeof this.ev.zoomed&&this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e})}},{key:\"getBeforeZoomRange\",value:function(t,e){var i=null;return\"function\"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),i}},{key:\"toggleMenu\",value:function(){var t=this;window.setTimeout((function(){t.elMenu.classList.contains(\"apexcharts-menu-open\")?t.elMenu.classList.remove(\"apexcharts-menu-open\"):t.elMenu.classList.add(\"apexcharts-menu-open\")}),0)}},{key:\"handleDownload\",value:function(t){var e=this.w,i=new j(this.ctx);switch(t){case\"svg\":i.exportToSVG(this.ctx);break;case\"png\":i.exportToPng(this.ctx);break;case\"csv\":i.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}},{key:\"handleZoomReset\",value:function(t){this.ctx.getSyncedCharts().forEach((function(t){var e=t.w;if(e.globals.lastXAxis.min=void 0,e.globals.lastXAxis.max=void 0,t.updateHelpers.revertDefaultAxisMinMax(),\"function\"==typeof e.config.chart.events.beforeResetZoom){var i=e.config.chart.events.beforeResetZoom(t,e);i&&t.updateHelpers.revertDefaultAxisMinMax(i)}\"function\"==typeof e.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:e.config.xaxis.min,max:e.config.xaxis.max}),e.globals.zoomed=!1;var a=t.ctx.series.emptyCollapsedSeries(x.clone(e.globals.initialSeries));t.updateHelpers._updateSeries(a,e.config.chart.animations.dynamicAnimation.enabled)}))}},{key:\"destroy\",value:function(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elZoomReset=null,this.elMenuIcon=null}}]),t}(),gt=function(t){n(i,dt);var e=d(i);function i(t){var s;return a(this,i),(s=e.call(this,t)).ctx=t,s.w=t.w,s.dragged=!1,s.graphics=new m(s.ctx),s.eventList=[\"mousedown\",\"mouseleave\",\"mousemove\",\"touchstart\",\"touchmove\",\"mouseup\",\"touchend\"],s.clientX=0,s.clientY=0,s.startX=0,s.endX=0,s.dragX=0,s.startY=0,s.endY=0,s.dragY=0,s.moveDirection=\"none\",s}return r(i,[{key:\"init\",value:function(t){var e=this,i=t.xyRatios,a=this.w,s=this;this.xyRatios=i,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.gridRect=a.globals.dom.baseEl.querySelector(\".apexcharts-grid\"),this.zoomRect.node.classList.add(\"apexcharts-zoom-rect\"),this.selectionRect.node.classList.add(\"apexcharts-selection-rect\"),a.globals.dom.elGraphical.add(this.zoomRect),a.globals.dom.elGraphical.add(this.selectionRect),\"x\"===a.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:a.globals.gridWidth,maxY:a.globals.gridHeight}).on(\"dragmove\",this.selectionDragging.bind(this,\"dragging\")):\"y\"===a.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:a.globals.gridWidth}).on(\"dragmove\",this.selectionDragging.bind(this,\"dragging\")):this.slDraggableRect=this.selectionRect.draggable().on(\"dragmove\",this.selectionDragging.bind(this,\"dragging\")),this.preselectedSelection(),this.hoverArea=a.globals.dom.baseEl.querySelector(\"\".concat(a.globals.chartClass,\" .apexcharts-svg\")),this.hoverArea.classList.add(\"apexcharts-zoomable\"),this.eventList.forEach((function(t){e.hoverArea.addEventListener(t,s.svgMouseEvents.bind(s,i),{capture:!1,passive:!0})}))}},{key:\"destroy\",value:function(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null,this.gridRect=null}},{key:\"svgMouseEvents\",value:function(t,e){var i=this.w,a=this,s=this.ctx.toolbar,r=i.globals.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,o=i.config.chart.toolbar.autoSelected;if(e.shiftKey?(this.shiftWasPressed=!0,s.enableZoomPanFromToolbar(\"pan\"===o?\"zoom\":\"pan\")):this.shiftWasPressed&&(s.enableZoomPanFromToolbar(o),this.shiftWasPressed=!1),e.target){var n,l=e.target.classList;if(e.target.parentNode&&null!==e.target.parentNode&&(n=e.target.parentNode.classList),!(l.contains(\"apexcharts-selection-rect\")||l.contains(\"apexcharts-legend-marker\")||l.contains(\"apexcharts-legend-text\")||n&&n.contains(\"apexcharts-toolbar\"))){if(a.clientX=\"touchmove\"===e.type||\"touchstart\"===e.type?e.touches[0].clientX:\"touchend\"===e.type?e.changedTouches[0].clientX:e.clientX,a.clientY=\"touchmove\"===e.type||\"touchstart\"===e.type?e.touches[0].clientY:\"touchend\"===e.type?e.changedTouches[0].clientY:e.clientY,\"mousedown\"===e.type&&1===e.which){var h=a.gridRect.getBoundingClientRect();a.startX=a.clientX-h.left,a.startY=a.clientY-h.top,a.dragged=!1,a.w.globals.mousedown=!0}if((\"mousemove\"===e.type&&1===e.which||\"touchmove\"===e.type)&&(a.dragged=!0,i.globals.panEnabled?(i.globals.selection=null,a.w.globals.mousedown&&a.panDragging({context:a,zoomtype:r,xyRatios:t})):(a.w.globals.mousedown&&i.globals.zoomEnabled||a.w.globals.mousedown&&i.globals.selectionEnabled)&&(a.selection=a.selectionDrawing({context:a,zoomtype:r}))),\"mouseup\"===e.type||\"touchend\"===e.type||\"mouseleave\"===e.type){var c=a.gridRect.getBoundingClientRect();a.w.globals.mousedown&&(a.endX=a.clientX-c.left,a.endY=a.clientY-c.top,a.dragX=Math.abs(a.endX-a.startX),a.dragY=Math.abs(a.endY-a.startY),(i.globals.zoomEnabled||i.globals.selectionEnabled)&&a.selectionDrawn({context:a,zoomtype:r}),i.globals.panEnabled&&i.config.xaxis.convertedCatToNumeric&&a.delayedPanScrolled()),i.globals.zoomEnabled&&a.hideSelectionRect(this.selectionRect),a.dragged=!1,a.w.globals.mousedown=!1}this.makeSelectionRectDraggable()}}}},{key:\"makeSelectionRectDraggable\",value:function(){var t=this.w;if(this.selectionRect){var e=this.selectionRect.node.getBoundingClientRect();e.width>0&&e.height>0&&this.slDraggableRect.selectize({points:\"l, r\",pointSize:8,pointType:\"rect\"}).resize({constraint:{minX:0,minY:0,maxX:t.globals.gridWidth,maxY:t.globals.gridHeight}}).on(\"resizing\",this.selectionDragging.bind(this,\"resizing\"))}}},{key:\"preselectedSelection\",value:function(){var t=this.w,e=this.xyRatios;if(!t.globals.zoomEnabled)if(void 0!==t.globals.selection&&null!==t.globals.selection)this.drawSelectionRect(t.globals.selection);else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){var i=(t.config.chart.selection.xaxis.min-t.globals.minX)/e.xRatio,a={x:i,y:0,width:t.globals.gridWidth-(t.globals.maxX-t.config.chart.selection.xaxis.max)/e.xRatio-i,height:t.globals.gridHeight,translateX:0,translateY:0,selectionEnabled:!0};this.drawSelectionRect(a),this.makeSelectionRectDraggable(),\"function\"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}},{key:\"drawSelectionRect\",value:function(t){var e=t.x,i=t.y,a=t.width,s=t.height,r=t.translateX,o=void 0===r?0:r,n=t.translateY,l=void 0===n?0:n,h=this.w,c=this.zoomRect,d=this.selectionRect;if(this.dragged||null!==h.globals.selection){var g={transform:\"translate(\"+o+\", \"+l+\")\"};h.globals.zoomEnabled&&this.dragged&&(a<0&&(a=1),c.attr({x:e,y:i,width:a,height:s,fill:h.config.chart.zoom.zoomedArea.fill.color,\"fill-opacity\":h.config.chart.zoom.zoomedArea.fill.opacity,stroke:h.config.chart.zoom.zoomedArea.stroke.color,\"stroke-width\":h.config.chart.zoom.zoomedArea.stroke.width,\"stroke-opacity\":h.config.chart.zoom.zoomedArea.stroke.opacity}),m.setAttrs(c.node,g)),h.globals.selectionEnabled&&(d.attr({x:e,y:i,width:a>0?a:0,height:s>0?s:0,fill:h.config.chart.selection.fill.color,\"fill-opacity\":h.config.chart.selection.fill.opacity,stroke:h.config.chart.selection.stroke.color,\"stroke-width\":h.config.chart.selection.stroke.width,\"stroke-dasharray\":h.config.chart.selection.stroke.dashArray,\"stroke-opacity\":h.config.chart.selection.stroke.opacity}),m.setAttrs(d.node,g))}}},{key:\"hideSelectionRect\",value:function(t){t&&t.attr({x:0,y:0,width:0,height:0})}},{key:\"selectionDrawing\",value:function(t){var e=t.context,i=t.zoomtype,a=this.w,s=e,r=this.gridRect.getBoundingClientRect(),o=s.startX-1,n=s.startY,l=!1,h=!1,c=s.clientX-r.left-o,d=s.clientY-r.top-n,g={};return Math.abs(c+o)>a.globals.gridWidth?c=a.globals.gridWidth-o:s.clientX-r.left<0&&(c=o),o>s.clientX-r.left&&(l=!0,c=Math.abs(c)),n>s.clientY-r.top&&(h=!0,d=Math.abs(d)),g=\"x\"===i?{x:l?o-c:o,y:0,width:c,height:a.globals.gridHeight}:\"y\"===i?{x:0,y:h?n-d:n,width:a.globals.gridWidth,height:d}:{x:l?o-c:o,y:h?n-d:n,width:c,height:d},s.drawSelectionRect(g),s.selectionDragging(\"resizing\"),g}},{key:\"selectionDragging\",value:function(t,e){var i=this,a=this.w,s=this.xyRatios,r=this.selectionRect,o=0;\"resizing\"===t&&(o=30);var n=function(t){return parseFloat(r.node.getAttribute(t))},l={x:n(\"x\"),y:n(\"y\"),width:n(\"width\"),height:n(\"height\")};a.globals.selection=l,\"function\"==typeof a.config.chart.events.selection&&a.globals.selectionEnabled&&(clearTimeout(this.w.globals.selectionResizeTimer),this.w.globals.selectionResizeTimer=window.setTimeout((function(){var t=i.gridRect.getBoundingClientRect(),e=r.node.getBoundingClientRect(),o={xaxis:{min:a.globals.xAxisScale.niceMin+(e.left-t.left)*s.xRatio,max:a.globals.xAxisScale.niceMin+(e.right-t.left)*s.xRatio},yaxis:{min:a.globals.yAxisScale[0].niceMin+(t.bottom-e.bottom)*s.yRatio[0],max:a.globals.yAxisScale[0].niceMax-(e.top-t.top)*s.yRatio[0]}};a.config.chart.events.selection(i.ctx,o),a.config.chart.brush.enabled&&void 0!==a.config.chart.events.brushScrolled&&a.config.chart.events.brushScrolled(i.ctx,o)}),o))}},{key:\"selectionDrawn\",value:function(t){var e=t.context,i=t.zoomtype,a=this.w,s=e,r=this.xyRatios,o=this.ctx.toolbar;if(s.startX>s.endX){var n=s.startX;s.startX=s.endX,s.endX=n}if(s.startY>s.endY){var l=s.startY;s.startY=s.endY,s.endY=l}var h=void 0,c=void 0;a.globals.isRangeBar?(h=a.globals.yAxisScale[0].niceMin+s.startX*r.invertedYRatio,c=a.globals.yAxisScale[0].niceMin+s.endX*r.invertedYRatio):(h=a.globals.xAxisScale.niceMin+s.startX*r.xRatio,c=a.globals.xAxisScale.niceMin+s.endX*r.xRatio);var d=[],g=[];if(a.config.yaxis.forEach((function(t,e){d.push(a.globals.yAxisScale[e].niceMax-r.yRatio[e]*s.startY),g.push(a.globals.yAxisScale[e].niceMax-r.yRatio[e]*s.endY)})),s.dragged&&(s.dragX>10||s.dragY>10)&&h!==c)if(a.globals.zoomEnabled){var u=x.clone(a.globals.initialConfig.yaxis),f=x.clone(a.globals.initialConfig.xaxis);if(a.globals.zoomed=!0,a.config.xaxis.convertedCatToNumeric&&(h=Math.floor(h),c=Math.floor(c),h<1&&(h=1,c=a.globals.dataPoints),c-h<2&&(c=h+1)),\"xy\"!==i&&\"x\"!==i||(f={min:h,max:c}),\"xy\"!==i&&\"y\"!==i||u.forEach((function(t,e){u[e].min=g[e],u[e].max=d[e]})),a.config.chart.zoom.autoScaleYaxis){var p=new q(s.ctx);u=p.autoScaleY(s.ctx,u,{xaxis:f})}if(o){var b=o.getBeforeZoomRange(f,u);b&&(f=b.xaxis?b.xaxis:f,u=b.yaxis?b.yaxis:u)}var v={xaxis:f};a.config.chart.group||(v.yaxis=u),s.ctx.updateHelpers._updateOptions(v,!1,s.w.config.chart.animations.dynamicAnimation.enabled),\"function\"==typeof a.config.chart.events.zoomed&&o.zoomCallback(f,u)}else if(a.globals.selectionEnabled){var m,y=null;m={min:h,max:c},\"xy\"!==i&&\"y\"!==i||(y=x.clone(a.config.yaxis)).forEach((function(t,e){y[e].min=g[e],y[e].max=d[e]})),a.globals.selection=s.selection,\"function\"==typeof a.config.chart.events.selection&&a.config.chart.events.selection(s.ctx,{xaxis:m,yaxis:y})}}},{key:\"panDragging\",value:function(t){var e=t.context,i=this.w,a=e;if(void 0!==i.globals.lastClientPosition.x){var s=i.globals.lastClientPosition.x-a.clientX,r=i.globals.lastClientPosition.y-a.clientY;Math.abs(s)>Math.abs(r)&&s>0?this.moveDirection=\"left\":Math.abs(s)>Math.abs(r)&&s<0?this.moveDirection=\"right\":Math.abs(r)>Math.abs(s)&&r>0?this.moveDirection=\"up\":Math.abs(r)>Math.abs(s)&&r<0&&(this.moveDirection=\"down\")}i.globals.lastClientPosition={x:a.clientX,y:a.clientY};var o=i.globals.isRangeBar?i.globals.minY:i.globals.minX,n=i.globals.isRangeBar?i.globals.maxY:i.globals.maxX;i.config.xaxis.convertedCatToNumeric||a.panScrolled(o,n)}},{key:\"delayedPanScrolled\",value:function(){var t=this.w,e=t.globals.minX,i=t.globals.maxX,a=(t.globals.maxX-t.globals.minX)/2;\"left\"===this.moveDirection?(e=t.globals.minX+a,i=t.globals.maxX+a):\"right\"===this.moveDirection&&(e=t.globals.minX-a,i=t.globals.maxX-a),e=Math.floor(e),i=Math.floor(i),this.updateScrolledChart({xaxis:{min:e,max:i}},e,i)}},{key:\"panScrolled\",value:function(t,e){var i=this.w,a=this.xyRatios,s=x.clone(i.globals.initialConfig.yaxis),r=a.xRatio,o=i.globals.minX,n=i.globals.maxX;i.globals.isRangeBar&&(r=a.invertedYRatio,o=i.globals.minY,n=i.globals.maxY),\"left\"===this.moveDirection?(t=o+i.globals.gridWidth/15*r,e=n+i.globals.gridWidth/15*r):\"right\"===this.moveDirection&&(t=o-i.globals.gridWidth/15*r,e=n-i.globals.gridWidth/15*r),i.globals.isRangeBar||(t<i.globals.initialMinX||e>i.globals.initialMaxX)&&(t=o,e=n);var l={min:t,max:e};i.config.chart.zoom.autoScaleYaxis&&(s=new q(this.ctx).autoScaleY(this.ctx,s,{xaxis:l}));var h={xaxis:{min:t,max:e}};i.config.chart.group||(h.yaxis=s),this.updateScrolledChart(h,t,e)}},{key:\"updateScrolledChart\",value:function(t,e,i){var a=this.w;this.ctx.updateHelpers._updateOptions(t,!1,!1),\"function\"==typeof a.config.chart.events.scrolled&&a.config.chart.events.scrolled(this.ctx,{xaxis:{min:e,max:i}})}}]),i}(),ut=function(){function t(e){a(this,t),this.w=e.w,this.ttCtx=e,this.ctx=e.ctx}return r(t,[{key:\"getNearestValues\",value:function(t){var e=t.hoverArea,i=t.elGrid,a=t.clientX,s=t.clientY,r=this.w,o=i.getBoundingClientRect(),n=o.width,l=o.height,h=n/(r.globals.dataPoints-1),c=l/r.globals.dataPoints,d=this.hasBars();!r.globals.comboCharts&&!d||r.config.xaxis.convertedCatToNumeric||(h=n/r.globals.dataPoints);var g=a-o.left-r.globals.barPadForNumericAxis,u=s-o.top;g<0||u<0||g>n||u>l?(e.classList.remove(\"hovering-zoom\"),e.classList.remove(\"hovering-pan\")):r.globals.zoomEnabled?(e.classList.remove(\"hovering-pan\"),e.classList.add(\"hovering-zoom\")):r.globals.panEnabled&&(e.classList.remove(\"hovering-zoom\"),e.classList.add(\"hovering-pan\"));var f=Math.round(g/h),p=Math.floor(u/c);d&&!r.config.xaxis.convertedCatToNumeric&&(f=Math.ceil(g/h),f-=1);var b=null,v=null,m=[],y=[];if(r.globals.seriesXvalues.forEach((function(t){m.push([t[0]+1e-6].concat(t))})),r.globals.seriesYvalues.forEach((function(t){y.push([t[0]+1e-6].concat(t))})),m=m.map((function(t){return t.filter((function(t){return x.isNumber(t)}))})),y=y.map((function(t){return t.filter((function(t){return x.isNumber(t)}))})),r.globals.isXNumeric){var w=this.ttCtx.getElGrid().getBoundingClientRect(),k=g*(w.width/n),A=u*(w.height/l);b=(v=this.closestInMultiArray(k,A,m,y)).index,f=v.j,null!==b&&(m=r.globals.seriesXvalues[b],f=(v=this.closestInArray(k,m)).index)}return r.globals.capturedSeriesIndex=null===b?-1:b,(!f||f<1)&&(f=0),r.globals.isBarHorizontal?r.globals.capturedDataPointIndex=p:r.globals.capturedDataPointIndex=f,{capturedSeries:b,j:r.globals.isBarHorizontal?p:f,hoverX:g,hoverY:u}}},{key:\"closestInMultiArray\",value:function(t,e,i,a){var s=this.w,r=0,o=null,n=-1;s.globals.series.length>1?r=this.getFirstActiveXArray(i):o=0;var l=i[r][0],h=Math.abs(t-l);if(i.forEach((function(e){e.forEach((function(e,i){var a=Math.abs(t-e);a<h&&(h=a,n=i)}))})),-1!==n){var c=a[r][n],d=Math.abs(e-c);o=r,a.forEach((function(t,i){var a=Math.abs(e-t[n]);a<d&&(d=a,o=i)}))}return{index:o,j:n}}},{key:\"getFirstActiveXArray\",value:function(t){for(var e=this.w,i=0,a=t.map((function(t,e){return t.length>0?e:-1})),s=0;s<a.length;s++)if(-1!==a[s]&&-1===e.globals.collapsedSeriesIndices.indexOf(s)&&-1===e.globals.ancillaryCollapsedSeriesIndices.indexOf(s)){i=a[s];break}return i}},{key:\"closestInArray\",value:function(t,e){for(var i=e[0],a=null,s=Math.abs(t-i),r=0;r<e.length;r++){var o=Math.abs(t-e[r]);o<s&&(s=o,a=r)}return{index:a}}},{key:\"isXoverlap\",value:function(t){var e=[],i=this.w.globals.seriesX.filter((function(t){return void 0!==t[0]}));if(i.length>0)for(var a=0;a<i.length-1;a++)void 0!==i[a][t]&&void 0!==i[a+1][t]&&i[a][t]!==i[a+1][t]&&e.push(\"unEqual\");return 0===e.length}},{key:\"isInitialSeriesSameLen\",value:function(){for(var t=!0,e=this.w.globals.initialSeries,i=0;i<e.length-1;i++)if(e[i].data.length!==e[i+1].data.length){t=!1;break}return t}},{key:\"getBarsHeight\",value:function(t){return u(t).reduce((function(t,e){return t+e.getBBox().height}),0)}},{key:\"getElMarkers\",value:function(){return this.w.globals.dom.baseEl.querySelectorAll(\" .apexcharts-series-markers\")}},{key:\"getAllMarkers\",value:function(){var t=this.w.globals.dom.baseEl.querySelectorAll(\".apexcharts-series-markers-wrap\");(t=u(t)).sort((function(t,e){var i=Number(t.getAttribute(\"data:realIndex\")),a=Number(e.getAttribute(\"data:realIndex\"));return a<i?1:a>i?-1:0}));var e=[];return t.forEach((function(t){e.push(t.querySelector(\".apexcharts-marker\"))})),e}},{key:\"hasMarkers\",value:function(){return this.getElMarkers().length>0}},{key:\"getElBars\",value:function(){return this.w.globals.dom.baseEl.querySelectorAll(\".apexcharts-bar-series,  .apexcharts-candlestick-series, .apexcharts-boxPlot-series, .apexcharts-rangebar-series\")}},{key:\"hasBars\",value:function(){return this.getElBars().length>0}},{key:\"getHoverMarkerSize\",value:function(t){var e=this.w,i=e.config.markers.hover.size;return void 0===i&&(i=e.globals.markers.size[t]+e.config.markers.hover.sizeOffset),i}},{key:\"toggleAllTooltipSeriesGroups\",value:function(t){var e=this.w,i=this.ttCtx;0===i.allTooltipSeriesGroups.length&&(i.allTooltipSeriesGroups=e.globals.dom.baseEl.querySelectorAll(\".apexcharts-tooltip-series-group\"));for(var a=i.allTooltipSeriesGroups,s=0;s<a.length;s++)\"enable\"===t?(a[s].classList.add(\"apexcharts-active\"),a[s].style.display=e.config.tooltip.items.display):(a[s].classList.remove(\"apexcharts-active\"),a[s].style.display=\"none\")}}]),t}(),ft=function(){function t(e){a(this,t),this.w=e.w,this.ctx=e.ctx,this.ttCtx=e,this.tooltipUtil=new ut(e)}return r(t,[{key:\"drawSeriesTexts\",value:function(t){var e=t.shared,i=void 0===e||e,a=t.ttItems,s=t.i,r=void 0===s?0:s,o=t.j,n=void 0===o?null:o,l=t.y1,h=t.y2,c=t.e,d=this.w;void 0!==d.config.tooltip.custom?this.handleCustomTooltip({i:r,j:n,y1:l,y2:h,w:d}):this.toggleActiveInactiveSeries(i);var g=this.getValuesToPrint({i:r,j:n});this.printLabels({i:r,j:n,values:g,ttItems:a,shared:i,e:c});var u=this.ttCtx.getElTooltip();this.ttCtx.tooltipRect.ttWidth=u.getBoundingClientRect().width,this.ttCtx.tooltipRect.ttHeight=u.getBoundingClientRect().height}},{key:\"printLabels\",value:function(t){var i,a=this,s=t.i,r=t.j,o=t.values,n=t.ttItems,l=t.shared,h=t.e,c=this.w,d=[],g=function(t){return c.globals.seriesGoals[t]&&c.globals.seriesGoals[t][r]&&Array.isArray(c.globals.seriesGoals[t][r])},u=o.xVal,f=o.zVal,p=o.xAxisTTVal,x=\"\",b=c.globals.colors[s];null!==r&&c.config.plotOptions.bar.distributed&&(b=c.globals.colors[r]);for(var v=function(t,o){var v=a.getFormatters(s);x=a.getSeriesName({fn:v.yLbTitleFormatter,index:s,seriesIndex:s,j:r}),\"treemap\"===c.config.chart.type&&(x=v.yLbTitleFormatter(String(c.config.series[s].data[r].x),{series:c.globals.series,seriesIndex:s,dataPointIndex:r,w:c}));var m=c.config.tooltip.inverseOrder?o:t;if(c.globals.axisCharts){var y=function(t){return v.yLbFormatter(c.globals.series[t][r],{series:c.globals.series,seriesIndex:t,dataPointIndex:r,w:c})};if(l)v=a.getFormatters(m),x=a.getSeriesName({fn:v.yLbTitleFormatter,index:m,seriesIndex:s,j:r}),b=c.globals.colors[m],i=y(m),g(m)&&(d=c.globals.seriesGoals[m][r].map((function(t){return{attrs:t,val:v.yLbFormatter(t.value,{seriesIndex:m,dataPointIndex:r,w:c})}})));else{var w,k=null==h||null===(w=h.target)||void 0===w?void 0:w.getAttribute(\"fill\");k&&(b=-1!==k.indexOf(\"url\")?document.querySelector(k.substr(4).slice(0,-1)).childNodes[0].getAttribute(\"stroke\"):k),i=y(s),g(s)&&Array.isArray(c.globals.seriesGoals[s][r])&&(d=c.globals.seriesGoals[s][r].map((function(t){return{attrs:t,val:v.yLbFormatter(t.value,{seriesIndex:s,dataPointIndex:r,w:c})}})))}}null===r&&(i=v.yLbFormatter(c.globals.series[s],e(e({},c),{},{seriesIndex:s,dataPointIndex:s}))),a.DOMHandling({i:s,t:m,j:r,ttItems:n,values:{val:i,goalVals:d,xVal:u,xAxisTTVal:p,zVal:f},seriesName:x,shared:l,pColor:b})},m=0,y=c.globals.series.length-1;m<c.globals.series.length;m++,y--)v(m,y)}},{key:\"getFormatters\",value:function(t){var e,i=this.w,a=i.globals.yLabelFormatters[t];return void 0!==i.globals.ttVal?Array.isArray(i.globals.ttVal)?(a=i.globals.ttVal[t]&&i.globals.ttVal[t].formatter,e=i.globals.ttVal[t]&&i.globals.ttVal[t].title&&i.globals.ttVal[t].title.formatter):(a=i.globals.ttVal.formatter,\"function\"==typeof i.globals.ttVal.title.formatter&&(e=i.globals.ttVal.title.formatter)):e=i.config.tooltip.y.title.formatter,\"function\"!=typeof a&&(a=i.globals.yLabelFormatters[0]?i.globals.yLabelFormatters[0]:function(t){return t}),\"function\"!=typeof e&&(e=function(t){return t}),{yLbFormatter:a,yLbTitleFormatter:e}}},{key:\"getSeriesName\",value:function(t){var e=t.fn,i=t.index,a=t.seriesIndex,s=t.j,r=this.w;return e(String(r.globals.seriesNames[i]),{series:r.globals.series,seriesIndex:a,dataPointIndex:s,w:r})}},{key:\"DOMHandling\",value:function(t){t.i;var e=t.t,i=t.j,a=t.ttItems,s=t.values,r=t.seriesName,o=t.shared,n=t.pColor,l=this.w,h=this.ttCtx,c=s.val,d=s.goalVals,g=s.xVal,u=s.xAxisTTVal,f=s.zVal,p=null;p=a[e].children,l.config.tooltip.fillSeriesColor&&(a[e].style.backgroundColor=n,p[0].style.display=\"none\"),h.showTooltipTitle&&(null===h.tooltipTitle&&(h.tooltipTitle=l.globals.dom.baseEl.querySelector(\".apexcharts-tooltip-title\")),h.tooltipTitle.innerHTML=g),h.isXAxisTooltipEnabled&&(h.xaxisTooltipText.innerHTML=\"\"!==u?u:g);var x=a[e].querySelector(\".apexcharts-tooltip-text-y-label\");x&&(x.innerHTML=r||\"\");var b=a[e].querySelector(\".apexcharts-tooltip-text-y-value\");b&&(b.innerHTML=void 0!==c?c:\"\"),p[0]&&p[0].classList.contains(\"apexcharts-tooltip-marker\")&&(l.config.tooltip.marker.fillColors&&Array.isArray(l.config.tooltip.marker.fillColors)&&(n=l.config.tooltip.marker.fillColors[e]),p[0].style.backgroundColor=n),l.config.tooltip.marker.show||(p[0].style.display=\"none\");var v=a[e].querySelector(\".apexcharts-tooltip-text-goals-label\"),m=a[e].querySelector(\".apexcharts-tooltip-text-goals-value\");if(d.length&&l.globals.seriesGoals[e]){var y=function(){var t=\"<div >\",e=\"<div>\";d.forEach((function(i,a){t+=' <div style=\"display: flex\"><span class=\"apexcharts-tooltip-marker\" style=\"background-color: '.concat(i.attrs.strokeColor,'; height: 3px; border-radius: 0; top: 5px;\"></span> ').concat(i.attrs.name,\"</div>\"),e+=\"<div>\".concat(i.val,\"</div>\")})),v.innerHTML=t+\"</div>\",m.innerHTML=e+\"</div>\"};o?l.globals.seriesGoals[e][i]&&Array.isArray(l.globals.seriesGoals[e][i])?y():(v.innerHTML=\"\",m.innerHTML=\"\"):y()}else v.innerHTML=\"\",m.innerHTML=\"\";null!==f&&(a[e].querySelector(\".apexcharts-tooltip-text-z-label\").innerHTML=l.config.tooltip.z.title,a[e].querySelector(\".apexcharts-tooltip-text-z-value\").innerHTML=void 0!==f?f:\"\");o&&p[0]&&(null==c||l.globals.ancillaryCollapsedSeriesIndices.indexOf(e)>-1||l.globals.collapsedSeriesIndices.indexOf(e)>-1?p[0].parentNode.style.display=\"none\":p[0].parentNode.style.display=l.config.tooltip.items.display)}},{key:\"toggleActiveInactiveSeries\",value:function(t){var e=this.w;if(t)this.tooltipUtil.toggleAllTooltipSeriesGroups(\"enable\");else{this.tooltipUtil.toggleAllTooltipSeriesGroups(\"disable\");var i=e.globals.dom.baseEl.querySelector(\".apexcharts-tooltip-series-group\");i&&(i.classList.add(\"apexcharts-active\"),i.style.display=e.config.tooltip.items.display)}}},{key:\"getValuesToPrint\",value:function(t){var e=t.i,i=t.j,a=this.w,s=this.ctx.series.filteredSeriesX(),r=\"\",o=\"\",n=null,l=null,h={series:a.globals.series,seriesIndex:e,dataPointIndex:i,w:a},c=a.globals.ttZFormatter;null===i?l=a.globals.series[e]:a.globals.isXNumeric&&\"treemap\"!==a.config.chart.type?(r=s[e][i],0===s[e].length&&(r=s[this.tooltipUtil.getFirstActiveXArray(s)][i])):r=void 0!==a.globals.labels[i]?a.globals.labels[i]:\"\";var d=r;a.globals.isXNumeric&&\"datetime\"===a.config.xaxis.type?r=new V(this.ctx).xLabelFormat(a.globals.ttKeyFormatter,d,d,{i:void 0,dateFormatter:new R(this.ctx).formatDate,w:this.w}):r=a.globals.isBarHorizontal?a.globals.yLabelFormatters[0](d,h):a.globals.xLabelFormatter(d,h);return void 0!==a.config.tooltip.x.formatter&&(r=a.globals.ttKeyFormatter(d,h)),a.globals.seriesZ.length>0&&a.globals.seriesZ[e].length>0&&(n=c(a.globals.seriesZ[e][i],a)),o=\"function\"==typeof a.config.xaxis.tooltip.formatter?a.globals.xaxisTooltipFormatter(d,h):r,{val:Array.isArray(l)?l.join(\" \"):l,xVal:Array.isArray(r)?r.join(\" \"):r,xAxisTTVal:Array.isArray(o)?o.join(\" \"):o,zVal:n}}},{key:\"handleCustomTooltip\",value:function(t){var e=t.i,i=t.j,a=t.y1,s=t.y2,r=t.w,o=this.ttCtx.getElTooltip(),n=r.config.tooltip.custom;Array.isArray(n)&&n[e]&&(n=n[e]),o.innerHTML=n({ctx:this.ctx,series:r.globals.series,seriesIndex:e,dataPointIndex:i,y1:a,y2:s,w:r})}}]),t}(),pt=function(){function t(e){a(this,t),this.ttCtx=e,this.ctx=e.ctx,this.w=e.w}return r(t,[{key:\"moveXCrosshairs\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.ttCtx,a=this.w,s=i.getElXCrosshairs(),r=t-i.xcrosshairsWidth/2,o=a.globals.labels.slice().length;if(null!==e&&(r=a.globals.gridWidth/o*e),null===s||a.globals.isBarHorizontal||(s.setAttribute(\"x\",r),s.setAttribute(\"x1\",r),s.setAttribute(\"x2\",r),s.setAttribute(\"y2\",a.globals.gridHeight),s.classList.add(\"apexcharts-active\")),r<0&&(r=0),r>a.globals.gridWidth&&(r=a.globals.gridWidth),i.isXAxisTooltipEnabled){var n=r;\"tickWidth\"!==a.config.xaxis.crosshairs.width&&\"barWidth\"!==a.config.xaxis.crosshairs.width||(n=r+i.xcrosshairsWidth/2),this.moveXAxisTooltip(n)}}},{key:\"moveYCrosshairs\",value:function(t){var e=this.ttCtx;null!==e.ycrosshairs&&m.setAttrs(e.ycrosshairs,{y1:t,y2:t}),null!==e.ycrosshairsHidden&&m.setAttrs(e.ycrosshairsHidden,{y1:t,y2:t})}},{key:\"moveXAxisTooltip\",value:function(t){var e=this.w,i=this.ttCtx;if(null!==i.xaxisTooltip&&0!==i.xcrosshairsWidth){i.xaxisTooltip.classList.add(\"apexcharts-active\");var a=i.xaxisOffY+e.config.xaxis.tooltip.offsetY+e.globals.translateY+1+e.config.xaxis.offsetY;if(t-=i.xaxisTooltip.getBoundingClientRect().width/2,!isNaN(t)){t+=e.globals.translateX;var s;s=new m(this.ctx).getTextRects(i.xaxisTooltipText.innerHTML),i.xaxisTooltipText.style.minWidth=s.width+\"px\",i.xaxisTooltip.style.left=t+\"px\",i.xaxisTooltip.style.top=a+\"px\"}}}},{key:\"moveYAxisTooltip\",value:function(t){var e=this.w,i=this.ttCtx;null===i.yaxisTTEls&&(i.yaxisTTEls=e.globals.dom.baseEl.querySelectorAll(\".apexcharts-yaxistooltip\"));var a=parseInt(i.ycrosshairsHidden.getAttribute(\"y1\"),10),s=e.globals.translateY+a,r=i.yaxisTTEls[t].getBoundingClientRect().height,o=e.globals.translateYAxisX[t]-2;e.config.yaxis[t].opposite&&(o-=26),s-=r/2,-1===e.globals.ignoreYAxisIndexes.indexOf(t)?(i.yaxisTTEls[t].classList.add(\"apexcharts-active\"),i.yaxisTTEls[t].style.top=s+\"px\",i.yaxisTTEls[t].style.left=o+e.config.yaxis[t].tooltip.offsetX+\"px\"):i.yaxisTTEls[t].classList.remove(\"apexcharts-active\")}},{key:\"moveTooltip\",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=this.w,s=this.ttCtx,r=s.getElTooltip(),o=s.tooltipRect,n=null!==i?parseFloat(i):1,l=parseFloat(t)+n+5,h=parseFloat(e)+n/2;if(l>a.globals.gridWidth/2&&(l=l-o.ttWidth-n-10),l>a.globals.gridWidth-o.ttWidth-10&&(l=a.globals.gridWidth-o.ttWidth),l<-20&&(l=-20),a.config.tooltip.followCursor){var c=s.getElGrid(),d=c.getBoundingClientRect();h=s.e.clientY+a.globals.translateY-d.top-o.ttHeight/2}else a.globals.isBarHorizontal||(o.ttHeight/2+h>a.globals.gridHeight&&(h=a.globals.gridHeight-o.ttHeight+a.globals.translateY),h<0&&(h=0));isNaN(l)||(l+=a.globals.translateX,r.style.left=l+\"px\",r.style.top=h+\"px\")}},{key:\"moveMarkers\",value:function(t,e){var i=this.w,a=this.ttCtx;if(i.globals.markers.size[t]>0)for(var s=i.globals.dom.baseEl.querySelectorAll(\" .apexcharts-series[data\\\\:realIndex='\".concat(t,\"'] .apexcharts-marker\")),r=0;r<s.length;r++)parseInt(s[r].getAttribute(\"rel\"),10)===e&&(a.marker.resetPointsSize(),a.marker.enlargeCurrentPoint(e,s[r]));else a.marker.resetPointsSize(),this.moveDynamicPointOnHover(e,t)}},{key:\"moveDynamicPointOnHover\",value:function(t,e){var i,a,s=this.w,r=this.ttCtx,o=s.globals.pointsArray,n=r.tooltipUtil.getHoverMarkerSize(e),l=s.config.series[e].type;if(!l||\"column\"!==l&&\"candlestick\"!==l&&\"boxPlot\"!==l){i=o[e][t][0],a=o[e][t][1]?o[e][t][1]:0;var h=s.globals.dom.baseEl.querySelector(\".apexcharts-series[data\\\\:realIndex='\".concat(e,\"'] .apexcharts-series-markers circle\"));h&&a<s.globals.gridHeight&&a>0&&(h.setAttribute(\"r\",n),h.setAttribute(\"cx\",i),h.setAttribute(\"cy\",a)),this.moveXCrosshairs(i),r.fixedTooltip||this.moveTooltip(i,a,n)}}},{key:\"moveDynamicPointsOnHover\",value:function(t){var e,i=this.ttCtx,a=i.w,s=0,r=0,o=a.globals.pointsArray;e=new E(this.ctx).getActiveConfigSeriesIndex(!0);var n=i.tooltipUtil.getHoverMarkerSize(e);o[e]&&(s=o[e][t][0],r=o[e][t][1]);var l=i.tooltipUtil.getAllMarkers();if(null!==l)for(var h=0;h<a.globals.series.length;h++){var c=o[h];if(a.globals.comboCharts&&void 0===c&&l.splice(h,0,null),c&&c.length){var d=o[h][t][1];l[h].setAttribute(\"cx\",s),null!==d&&!isNaN(d)&&d<a.globals.gridHeight+n&&d+n>0?(l[h]&&l[h].setAttribute(\"r\",n),l[h]&&l[h].setAttribute(\"cy\",d)):l[h]&&l[h].setAttribute(\"r\",0)}}if(this.moveXCrosshairs(s),!i.fixedTooltip){var g=r||a.globals.gridHeight;this.moveTooltip(s,g,n)}}},{key:\"moveStickyTooltipOverBars\",value:function(t){var e=this.w,i=this.ttCtx,a=e.globals.columnSeries?e.globals.columnSeries.length:e.globals.series.length,s=a>=2&&a%2==0?Math.floor(a/2):Math.floor(a/2)+1;e.globals.isBarHorizontal&&(s=new E(this.ctx).getActiveConfigSeriesIndex(!1,\"desc\")+1);var r=e.globals.dom.baseEl.querySelector(\".apexcharts-bar-series .apexcharts-series[rel='\".concat(s,\"'] path[j='\").concat(t,\"'], .apexcharts-candlestick-series .apexcharts-series[rel='\").concat(s,\"'] path[j='\").concat(t,\"'], .apexcharts-boxPlot-series .apexcharts-series[rel='\").concat(s,\"'] path[j='\").concat(t,\"'], .apexcharts-rangebar-series .apexcharts-series[rel='\").concat(s,\"'] path[j='\").concat(t,\"']\")),o=r?parseFloat(r.getAttribute(\"cx\")):0,n=r?parseFloat(r.getAttribute(\"cy\")):0,l=r?parseFloat(r.getAttribute(\"barWidth\")):0,h=r?parseFloat(r.getAttribute(\"barHeight\")):0,c=i.getElGrid().getBoundingClientRect(),d=r.classList.contains(\"apexcharts-candlestick-area\")||r.classList.contains(\"apexcharts-boxPlot-area\");if(e.globals.isXNumeric?(r&&!d&&(o-=a%2!=0?l/2:0),r&&d&&e.globals.comboCharts&&(o-=l/2)):e.globals.isBarHorizontal||(o=i.xAxisTicksPositions[t-1]+i.dataPointsDividedWidth/2,isNaN(o)&&(o=i.xAxisTicksPositions[t]-i.dataPointsDividedWidth/2)),e.globals.isBarHorizontal?(n>e.globals.gridHeight/2&&(n-=i.tooltipRect.ttHeight),(n=n+e.config.grid.padding.top+h/3)+h>e.globals.gridHeight&&(n=e.globals.gridHeight-h)):e.config.tooltip.followCursor?n=i.e.clientY-c.top-i.tooltipRect.ttHeight/2:n+i.tooltipRect.ttHeight+15>e.globals.gridHeight&&(n=e.globals.gridHeight),n<-10&&(n=-10),e.globals.isBarHorizontal||this.moveXCrosshairs(o),!i.fixedTooltip){var g=n||e.globals.gridHeight;this.moveTooltip(o,g)}}}]),t}(),xt=function(){function t(e){a(this,t),this.w=e.w,this.ttCtx=e,this.ctx=e.ctx,this.tooltipPosition=new pt(e)}return r(t,[{key:\"drawDynamicPoints\",value:function(){var t=this.w,e=new m(this.ctx),i=new T(this.ctx),a=t.globals.dom.baseEl.querySelectorAll(\".apexcharts-series\");a=u(a),t.config.chart.stacked&&a.sort((function(t,e){return parseFloat(t.getAttribute(\"data:realIndex\"))-parseFloat(e.getAttribute(\"data:realIndex\"))}));for(var s=0;s<a.length;s++){var r=a[s].querySelector(\".apexcharts-series-markers-wrap\");if(null!==r){var o=void 0,n=\"apexcharts-marker w\".concat((Math.random()+1).toString(36).substring(4));\"line\"!==t.config.chart.type&&\"area\"!==t.config.chart.type||t.globals.comboCharts||t.config.tooltip.intersect||(n+=\" no-pointer-events\");var l=i.getMarkerConfig({cssClass:n,seriesIndex:Number(r.getAttribute(\"data:realIndex\"))});(o=e.drawMarker(0,0,l)).node.setAttribute(\"default-marker-size\",0);var h=document.createElementNS(t.globals.SVGNS,\"g\");h.classList.add(\"apexcharts-series-markers\"),h.appendChild(o.node),r.appendChild(h)}}}},{key:\"enlargeCurrentPoint\",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=this.w;\"bubble\"!==s.config.chart.type&&this.newPointSize(t,e);var r=e.getAttribute(\"cx\"),o=e.getAttribute(\"cy\");if(null!==i&&null!==a&&(r=i,o=a),this.tooltipPosition.moveXCrosshairs(r),!this.fixedTooltip){if(\"radar\"===s.config.chart.type){var n=this.ttCtx.getElGrid(),l=n.getBoundingClientRect();r=this.ttCtx.e.clientX-l.left}this.tooltipPosition.moveTooltip(r,o,s.config.markers.hover.size)}}},{key:\"enlargePoints\",value:function(t){for(var e=this.w,i=this,a=this.ttCtx,s=t,r=e.globals.dom.baseEl.querySelectorAll(\".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker\"),o=e.config.markers.hover.size,n=0;n<r.length;n++){var l=r[n].getAttribute(\"rel\"),h=r[n].getAttribute(\"index\");if(void 0===o&&(o=e.globals.markers.size[h]+e.config.markers.hover.sizeOffset),s===parseInt(l,10)){i.newPointSize(s,r[n]);var c=r[n].getAttribute(\"cx\"),d=r[n].getAttribute(\"cy\");i.tooltipPosition.moveXCrosshairs(c),a.fixedTooltip||i.tooltipPosition.moveTooltip(c,d,o)}else i.oldPointSize(r[n])}}},{key:\"newPointSize\",value:function(t,e){var i=this.w,a=i.config.markers.hover.size,s=0===t?e.parentNode.firstChild:e.parentNode.lastChild;if(\"0\"!==s.getAttribute(\"default-marker-size\")){var r=parseInt(s.getAttribute(\"index\"),10);void 0===a&&(a=i.globals.markers.size[r]+i.config.markers.hover.sizeOffset),a<0&&(a=0),s.setAttribute(\"r\",a)}}},{key:\"oldPointSize\",value:function(t){var e=parseFloat(t.getAttribute(\"default-marker-size\"));t.setAttribute(\"r\",e)}},{key:\"resetPointsSize\",value:function(){for(var t=this.w.globals.dom.baseEl.querySelectorAll(\".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker\"),e=0;e<t.length;e++){var i=parseFloat(t[e].getAttribute(\"default-marker-size\"));x.isNumber(i)&&i>=0?t[e].setAttribute(\"r\",i):t[e].setAttribute(\"r\",0)}}}]),t}(),bt=function(){function t(e){a(this,t),this.w=e.w,this.ttCtx=e}return r(t,[{key:\"getAttr\",value:function(t,e){return parseFloat(t.target.getAttribute(e))}},{key:\"handleHeatTreeTooltip\",value:function(t){var e=t.e,i=t.opt,a=t.x,s=t.y,r=t.type,o=this.ttCtx,n=this.w;if(e.target.classList.contains(\"apexcharts-\".concat(r,\"-rect\"))){var l=this.getAttr(e,\"i\"),h=this.getAttr(e,\"j\"),c=this.getAttr(e,\"cx\"),d=this.getAttr(e,\"cy\"),g=this.getAttr(e,\"width\"),u=this.getAttr(e,\"height\");if(o.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:l,j:h,shared:!1,e:e}),n.globals.capturedSeriesIndex=l,n.globals.capturedDataPointIndex=h,a=c+o.tooltipRect.ttWidth/2+g,s=d+o.tooltipRect.ttHeight/2-u/2,o.tooltipPosition.moveXCrosshairs(c+g/2),a>n.globals.gridWidth/2&&(a=c-o.tooltipRect.ttWidth/2+g),o.w.config.tooltip.followCursor){var f=n.globals.dom.elWrap.getBoundingClientRect();a=n.globals.clientX-f.left-(a>n.globals.gridWidth/2?o.tooltipRect.ttWidth:0),s=n.globals.clientY-f.top-(s>n.globals.gridHeight/2?o.tooltipRect.ttHeight:0)}}return{x:a,y:s}}},{key:\"handleMarkerTooltip\",value:function(t){var e,i,a=t.e,s=t.opt,r=t.x,o=t.y,n=this.w,l=this.ttCtx;if(a.target.classList.contains(\"apexcharts-marker\")){var h=parseInt(s.paths.getAttribute(\"cx\"),10),c=parseInt(s.paths.getAttribute(\"cy\"),10),d=parseFloat(s.paths.getAttribute(\"val\"));if(i=parseInt(s.paths.getAttribute(\"rel\"),10),e=parseInt(s.paths.parentNode.parentNode.parentNode.getAttribute(\"rel\"),10)-1,l.intersect){var g=x.findAncestor(s.paths,\"apexcharts-series\");g&&(e=parseInt(g.getAttribute(\"data:realIndex\"),10))}if(l.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:e,j:i,shared:!l.showOnIntersect&&n.config.tooltip.shared,e:a}),\"mouseup\"===a.type&&l.markerClick(a,e,i),n.globals.capturedSeriesIndex=e,n.globals.capturedDataPointIndex=i,r=h,o=c+n.globals.translateY-1.4*l.tooltipRect.ttHeight,l.w.config.tooltip.followCursor){var u=l.getElGrid().getBoundingClientRect();o=l.e.clientY+n.globals.translateY-u.top}d<0&&(o=c),l.marker.enlargeCurrentPoint(i,s.paths,r,o)}return{x:r,y:o}}},{key:\"handleBarTooltip\",value:function(t){var e,i,a=t.e,s=t.opt,r=this.w,o=this.ttCtx,n=o.getElTooltip(),l=0,h=0,c=0,d=this.getBarTooltipXY({e:a,opt:s});e=d.i;var g=d.barHeight,u=d.j;r.globals.capturedSeriesIndex=e,r.globals.capturedDataPointIndex=u,r.globals.isBarHorizontal&&o.tooltipUtil.hasBars()||!r.config.tooltip.shared?(h=d.x,c=d.y,i=Array.isArray(r.config.stroke.width)?r.config.stroke.width[e]:r.config.stroke.width,l=h):r.globals.comboCharts||r.config.tooltip.shared||(l/=2),isNaN(c)?c=r.globals.svgHeight-o.tooltipRect.ttHeight:c<0&&(c=0);var f=parseInt(s.paths.parentNode.getAttribute(\"data:realIndex\"),10),p=r.globals.isMultipleYAxis?r.config.yaxis[f]&&r.config.yaxis[f].reversed:r.config.yaxis[0].reversed;if(h+o.tooltipRect.ttWidth>r.globals.gridWidth&&!p?h-=o.tooltipRect.ttWidth:h<0&&(h=0),o.w.config.tooltip.followCursor){var x=o.getElGrid().getBoundingClientRect();c=o.e.clientY-x.top}null===o.tooltip&&(o.tooltip=r.globals.dom.baseEl.querySelector(\".apexcharts-tooltip\")),r.config.tooltip.shared||(r.globals.comboBarCount>0?o.tooltipPosition.moveXCrosshairs(l+i/2):o.tooltipPosition.moveXCrosshairs(l)),!o.fixedTooltip&&(!r.config.tooltip.shared||r.globals.isBarHorizontal&&o.tooltipUtil.hasBars())&&(p&&(h-=o.tooltipRect.ttWidth)<0&&(h=0),!p||r.globals.isBarHorizontal&&o.tooltipUtil.hasBars()||(c=c+g-2*(r.globals.series[e][u]<0?g:0)),o.tooltipRect.ttHeight+c>r.globals.gridHeight?c=r.globals.gridHeight-o.tooltipRect.ttHeight+r.globals.translateY:(c=c+r.globals.translateY-o.tooltipRect.ttHeight/2)<0&&(c=0),n.style.left=h+r.globals.translateX+\"px\",n.style.top=c+\"px\")}},{key:\"getBarTooltipXY\",value:function(t){var e=t.e,i=t.opt,a=this.w,s=null,r=this.ttCtx,o=0,n=0,l=0,h=0,c=0,d=e.target.classList;if(d.contains(\"apexcharts-bar-area\")||d.contains(\"apexcharts-candlestick-area\")||d.contains(\"apexcharts-boxPlot-area\")||d.contains(\"apexcharts-rangebar-area\")){var g=e.target,u=g.getBoundingClientRect(),f=i.elGrid.getBoundingClientRect(),p=u.height;c=u.height;var x=u.width,b=parseInt(g.getAttribute(\"cx\"),10),v=parseInt(g.getAttribute(\"cy\"),10);h=parseFloat(g.getAttribute(\"barWidth\"));var m=\"touchmove\"===e.type?e.touches[0].clientX:e.clientX;s=parseInt(g.getAttribute(\"j\"),10),o=parseInt(g.parentNode.getAttribute(\"rel\"),10)-1;var y=g.getAttribute(\"data-range-y1\"),w=g.getAttribute(\"data-range-y2\");a.globals.comboCharts&&(o=parseInt(g.parentNode.getAttribute(\"data:realIndex\"),10)),r.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:o,j:s,y1:y?parseInt(y,10):null,y2:w?parseInt(w,10):null,shared:!r.showOnIntersect&&a.config.tooltip.shared,e:e}),a.config.tooltip.followCursor?a.globals.isBarHorizontal?(n=m-f.left+15,l=v-r.dataPointsDividedHeight+p/2-r.tooltipRect.ttHeight/2):(n=a.globals.isXNumeric?b-x/2:b-r.dataPointsDividedWidth+x/2,l=e.clientY-f.top-r.tooltipRect.ttHeight/2-15):a.globals.isBarHorizontal?((n=b)<r.xyRatios.baseLineInvertedY&&(n=b-r.tooltipRect.ttWidth),l=v-r.dataPointsDividedHeight+p/2-r.tooltipRect.ttHeight/2):(n=a.globals.isXNumeric?b-x/2:b-r.dataPointsDividedWidth+x/2,l=v)}return{x:n,y:l,barHeight:c,barWidth:h,i:o,j:s}}}]),t}(),vt=function(){function t(e){a(this,t),this.w=e.w,this.ttCtx=e}return r(t,[{key:\"drawXaxisTooltip\",value:function(){var t=this.w,e=this.ttCtx,i=\"bottom\"===t.config.xaxis.position;e.xaxisOffY=i?t.globals.gridHeight+1:-t.globals.xAxisHeight-t.config.xaxis.axisTicks.height+3;var a=i?\"apexcharts-xaxistooltip apexcharts-xaxistooltip-bottom\":\"apexcharts-xaxistooltip apexcharts-xaxistooltip-top\",s=t.globals.dom.elWrap;e.isXAxisTooltipEnabled&&(null===t.globals.dom.baseEl.querySelector(\".apexcharts-xaxistooltip\")&&(e.xaxisTooltip=document.createElement(\"div\"),e.xaxisTooltip.setAttribute(\"class\",a+\" apexcharts-theme-\"+t.config.tooltip.theme),s.appendChild(e.xaxisTooltip),e.xaxisTooltipText=document.createElement(\"div\"),e.xaxisTooltipText.classList.add(\"apexcharts-xaxistooltip-text\"),e.xaxisTooltipText.style.fontFamily=t.config.xaxis.tooltip.style.fontFamily||t.config.chart.fontFamily,e.xaxisTooltipText.style.fontSize=t.config.xaxis.tooltip.style.fontSize,e.xaxisTooltip.appendChild(e.xaxisTooltipText)))}},{key:\"drawYaxisTooltip\",value:function(){for(var t=this.w,e=this.ttCtx,i=function(i){var a=t.config.yaxis[i].opposite||t.config.yaxis[i].crosshairs.opposite;e.yaxisOffX=a?t.globals.gridWidth+1:1;var s=\"apexcharts-yaxistooltip apexcharts-yaxistooltip-\".concat(i,a?\" apexcharts-yaxistooltip-right\":\" apexcharts-yaxistooltip-left\");t.globals.yAxisSameScaleIndices.map((function(e,a){e.map((function(e,a){a===i&&(s+=t.config.yaxis[a].show?\" \":\" apexcharts-yaxistooltip-hidden\")}))}));var r=t.globals.dom.elWrap;null===t.globals.dom.baseEl.querySelector(\".apexcharts-yaxistooltip apexcharts-yaxistooltip-\".concat(i))&&(e.yaxisTooltip=document.createElement(\"div\"),e.yaxisTooltip.setAttribute(\"class\",s+\" apexcharts-theme-\"+t.config.tooltip.theme),r.appendChild(e.yaxisTooltip),0===i&&(e.yaxisTooltipText=[]),e.yaxisTooltipText[i]=document.createElement(\"div\"),e.yaxisTooltipText[i].classList.add(\"apexcharts-yaxistooltip-text\"),e.yaxisTooltip.appendChild(e.yaxisTooltipText[i]))},a=0;a<t.config.yaxis.length;a++)i(a)}},{key:\"setXCrosshairWidth\",value:function(){var t=this.w,e=this.ttCtx,i=e.getElXCrosshairs();if(e.xcrosshairsWidth=parseInt(t.config.xaxis.crosshairs.width,10),t.globals.comboCharts){var a=t.globals.dom.baseEl.querySelector(\".apexcharts-bar-area\");if(null!==a&&\"barWidth\"===t.config.xaxis.crosshairs.width){var s=parseFloat(a.getAttribute(\"barWidth\"));e.xcrosshairsWidth=s}else if(\"tickWidth\"===t.config.xaxis.crosshairs.width){var r=t.globals.labels.length;e.xcrosshairsWidth=t.globals.gridWidth/r}}else if(\"tickWidth\"===t.config.xaxis.crosshairs.width){var o=t.globals.labels.length;e.xcrosshairsWidth=t.globals.gridWidth/o}else if(\"barWidth\"===t.config.xaxis.crosshairs.width){var n=t.globals.dom.baseEl.querySelector(\".apexcharts-bar-area\");if(null!==n){var l=parseFloat(n.getAttribute(\"barWidth\"));e.xcrosshairsWidth=l}else e.xcrosshairsWidth=1}t.globals.isBarHorizontal&&(e.xcrosshairsWidth=0),null!==i&&e.xcrosshairsWidth>0&&i.setAttribute(\"width\",e.xcrosshairsWidth)}},{key:\"handleYCrosshair\",value:function(){var t=this.w,e=this.ttCtx;e.ycrosshairs=t.globals.dom.baseEl.querySelector(\".apexcharts-ycrosshairs\"),e.ycrosshairsHidden=t.globals.dom.baseEl.querySelector(\".apexcharts-ycrosshairs-hidden\")}},{key:\"drawYaxisTooltipText\",value:function(t,e,i){var a=this.ttCtx,s=this.w,r=s.globals.yLabelFormatters[t];if(a.yaxisTooltips[t]){var o=a.getElGrid().getBoundingClientRect(),n=(e-o.top)*i.yRatio[t],l=s.globals.maxYArr[t]-s.globals.minYArr[t],h=s.globals.minYArr[t]+(l-n);a.tooltipPosition.moveYCrosshairs(e-o.top),a.yaxisTooltipText[t].innerHTML=r(h),a.tooltipPosition.moveYAxisTooltip(t)}}}]),t}(),mt=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w;var i=this.w;this.tConfig=i.config.tooltip,this.tooltipUtil=new ut(this),this.tooltipLabels=new ft(this),this.tooltipPosition=new pt(this),this.marker=new xt(this),this.intersect=new bt(this),this.axesTooltip=new vt(this),this.showOnIntersect=this.tConfig.intersect,this.showTooltipTitle=this.tConfig.x.show,this.fixedTooltip=this.tConfig.fixed.enabled,this.xaxisTooltip=null,this.yaxisTTEls=null,this.isBarShared=!i.globals.isBarHorizontal&&this.tConfig.shared,this.lastHoverTime=Date.now()}return r(t,[{key:\"getElTooltip\",value:function(t){return t||(t=this),t.w.globals.dom.baseEl?t.w.globals.dom.baseEl.querySelector(\".apexcharts-tooltip\"):null}},{key:\"getElXCrosshairs\",value:function(){return this.w.globals.dom.baseEl.querySelector(\".apexcharts-xcrosshairs\")}},{key:\"getElGrid\",value:function(){return this.w.globals.dom.baseEl.querySelector(\".apexcharts-grid\")}},{key:\"drawTooltip\",value:function(t){var e=this.w;this.xyRatios=t,this.isXAxisTooltipEnabled=e.config.xaxis.tooltip.enabled&&e.globals.axisCharts,this.yaxisTooltips=e.config.yaxis.map((function(t,i){return!!(t.show&&t.tooltip.enabled&&e.globals.axisCharts)})),this.allTooltipSeriesGroups=[],e.globals.axisCharts||(this.showTooltipTitle=!1);var i=document.createElement(\"div\");if(i.classList.add(\"apexcharts-tooltip\"),e.config.tooltip.cssClass&&i.classList.add(e.config.tooltip.cssClass),i.classList.add(\"apexcharts-theme-\".concat(this.tConfig.theme)),e.globals.dom.elWrap.appendChild(i),e.globals.axisCharts){this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair();var a=new _(this.ctx);this.xAxisTicksPositions=a.getXAxisTicksPositions()}if(!e.globals.comboCharts&&!this.tConfig.intersect&&\"rangeBar\"!==e.config.chart.type||this.tConfig.shared||(this.showOnIntersect=!0),0!==e.config.markers.size&&0!==e.globals.markers.largestSize||this.marker.drawDynamicPoints(this),e.globals.collapsedSeries.length!==e.globals.series.length){this.dataPointsDividedHeight=e.globals.gridHeight/e.globals.dataPoints,this.dataPointsDividedWidth=e.globals.gridWidth/e.globals.dataPoints,this.showTooltipTitle&&(this.tooltipTitle=document.createElement(\"div\"),this.tooltipTitle.classList.add(\"apexcharts-tooltip-title\"),this.tooltipTitle.style.fontFamily=this.tConfig.style.fontFamily||e.config.chart.fontFamily,this.tooltipTitle.style.fontSize=this.tConfig.style.fontSize,i.appendChild(this.tooltipTitle));var s=e.globals.series.length;(e.globals.xyCharts||e.globals.comboCharts)&&this.tConfig.shared&&(s=this.showOnIntersect?1:e.globals.series.length),this.legendLabels=e.globals.dom.baseEl.querySelectorAll(\".apexcharts-legend-text\"),this.ttItems=this.createTTElements(s),this.addSVGEvents()}}},{key:\"createTTElements\",value:function(t){for(var e=this,i=this.w,a=[],s=this.getElTooltip(),r=function(r){var o=document.createElement(\"div\");o.classList.add(\"apexcharts-tooltip-series-group\"),o.style.order=i.config.tooltip.inverseOrder?t-r:r+1,e.tConfig.shared&&e.tConfig.enabledOnSeries&&Array.isArray(e.tConfig.enabledOnSeries)&&e.tConfig.enabledOnSeries.indexOf(r)<0&&o.classList.add(\"apexcharts-tooltip-series-group-hidden\");var n=document.createElement(\"span\");n.classList.add(\"apexcharts-tooltip-marker\"),n.style.backgroundColor=i.globals.colors[r],o.appendChild(n);var l=document.createElement(\"div\");l.classList.add(\"apexcharts-tooltip-text\"),l.style.fontFamily=e.tConfig.style.fontFamily||i.config.chart.fontFamily,l.style.fontSize=e.tConfig.style.fontSize,[\"y\",\"goals\",\"z\"].forEach((function(t){var e=document.createElement(\"div\");e.classList.add(\"apexcharts-tooltip-\".concat(t,\"-group\"));var i=document.createElement(\"span\");i.classList.add(\"apexcharts-tooltip-text-\".concat(t,\"-label\")),e.appendChild(i);var a=document.createElement(\"span\");a.classList.add(\"apexcharts-tooltip-text-\".concat(t,\"-value\")),e.appendChild(a),l.appendChild(e)})),o.appendChild(l),s.appendChild(o),a.push(o)},o=0;o<t;o++)r(o);return a}},{key:\"addSVGEvents\",value:function(){var t=this.w,e=t.config.chart.type,i=this.getElTooltip(),a=!(\"bar\"!==e&&\"candlestick\"!==e&&\"boxPlot\"!==e&&\"rangeBar\"!==e),s=\"area\"===e||\"line\"===e||\"scatter\"===e||\"bubble\"===e||\"radar\"===e,r=t.globals.dom.Paper.node,o=this.getElGrid();o&&(this.seriesBound=o.getBoundingClientRect());var n,l=[],h=[],c={hoverArea:r,elGrid:o,tooltipEl:i,tooltipY:l,tooltipX:h,ttItems:this.ttItems};if(t.globals.axisCharts&&(s?n=t.globals.dom.baseEl.querySelectorAll(\".apexcharts-series[data\\\\:longestSeries='true'] .apexcharts-marker\"):a?n=t.globals.dom.baseEl.querySelectorAll(\".apexcharts-series .apexcharts-bar-area, .apexcharts-series .apexcharts-candlestick-area, .apexcharts-series .apexcharts-boxPlot-area, .apexcharts-series .apexcharts-rangebar-area\"):\"heatmap\"!==e&&\"treemap\"!==e||(n=t.globals.dom.baseEl.querySelectorAll(\".apexcharts-series .apexcharts-heatmap, .apexcharts-series .apexcharts-treemap\")),n&&n.length))for(var d=0;d<n.length;d++)l.push(n[d].getAttribute(\"cy\")),h.push(n[d].getAttribute(\"cx\"));if(t.globals.xyCharts&&!this.showOnIntersect||t.globals.comboCharts&&!this.showOnIntersect||a&&this.tooltipUtil.hasBars()&&this.tConfig.shared)this.addPathsEventListeners([r],c);else if(a&&!t.globals.comboCharts||s&&this.showOnIntersect)this.addDatapointEventsListeners(c);else if(!t.globals.axisCharts||\"heatmap\"===e||\"treemap\"===e){var g=t.globals.dom.baseEl.querySelectorAll(\".apexcharts-series\");this.addPathsEventListeners(g,c)}if(this.showOnIntersect){var u=t.globals.dom.baseEl.querySelectorAll(\".apexcharts-line-series .apexcharts-marker, .apexcharts-area-series .apexcharts-marker\");u.length>0&&this.addPathsEventListeners(u,c),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(c)}}},{key:\"drawFixedTooltipRect\",value:function(){var t=this.w,e=this.getElTooltip(),i=e.getBoundingClientRect(),a=i.width+10,s=i.height+10,r=this.tConfig.fixed.offsetX,o=this.tConfig.fixed.offsetY,n=this.tConfig.fixed.position.toLowerCase();return n.indexOf(\"right\")>-1&&(r=r+t.globals.svgWidth-a+10),n.indexOf(\"bottom\")>-1&&(o=o+t.globals.svgHeight-s-10),e.style.left=r+\"px\",e.style.top=o+\"px\",{x:r,y:o,ttWidth:a,ttHeight:s}}},{key:\"addDatapointEventsListeners\",value:function(t){var e=this.w.globals.dom.baseEl.querySelectorAll(\".apexcharts-series-markers .apexcharts-marker, .apexcharts-bar-area, .apexcharts-candlestick-area, .apexcharts-boxPlot-area, .apexcharts-rangebar-area\");this.addPathsEventListeners(e,t)}},{key:\"addPathsEventListeners\",value:function(t,e){for(var i=this,a=function(a){var s={paths:t[a],tooltipEl:e.tooltipEl,tooltipY:e.tooltipY,tooltipX:e.tooltipX,elGrid:e.elGrid,hoverArea:e.hoverArea,ttItems:e.ttItems};[\"mousemove\",\"mouseup\",\"touchmove\",\"mouseout\",\"touchend\"].map((function(e){return t[a].addEventListener(e,i.onSeriesHover.bind(i,s),{capture:!1,passive:!0})}))},s=0;s<t.length;s++)a(s)}},{key:\"onSeriesHover\",value:function(t,e){var i=this,a=Date.now()-this.lastHoverTime;a>=100?this.seriesHover(t,e):(clearTimeout(this.seriesHoverTimeout),this.seriesHoverTimeout=setTimeout((function(){i.seriesHover(t,e)}),100-a))}},{key:\"seriesHover\",value:function(t,e){var i=this;this.lastHoverTime=Date.now();var a=[],s=this.w;s.config.chart.group&&(a=this.ctx.getGroupedCharts()),s.globals.axisCharts&&(s.globals.minX===-1/0&&s.globals.maxX===1/0||0===s.globals.dataPoints)||(a.length?a.forEach((function(a){var s=i.getElTooltip(a),r={paths:t.paths,tooltipEl:s,tooltipY:t.tooltipY,tooltipX:t.tooltipX,elGrid:t.elGrid,hoverArea:t.hoverArea,ttItems:a.w.globals.tooltip.ttItems};a.w.globals.minX===i.w.globals.minX&&a.w.globals.maxX===i.w.globals.maxX&&a.w.globals.tooltip.seriesHoverByContext({chartCtx:a,ttCtx:a.w.globals.tooltip,opt:r,e:e})})):this.seriesHoverByContext({chartCtx:this.ctx,ttCtx:this.w.globals.tooltip,opt:t,e:e}))}},{key:\"seriesHoverByContext\",value:function(t){var e=t.chartCtx,i=t.ttCtx,a=t.opt,s=t.e,r=e.w,o=this.getElTooltip();if(o){if(i.tooltipRect={x:0,y:0,ttWidth:o.getBoundingClientRect().width,ttHeight:o.getBoundingClientRect().height},i.e=s,i.tooltipUtil.hasBars()&&!r.globals.comboCharts&&!i.isBarShared)if(this.tConfig.onDatasetHover.highlightDataSeries)new E(e).toggleSeriesOnHover(s,s.target.parentNode);i.fixedTooltip&&i.drawFixedTooltipRect(),r.globals.axisCharts?i.axisChartsTooltips({e:s,opt:a,tooltipRect:i.tooltipRect}):i.nonAxisChartsTooltips({e:s,opt:a,tooltipRect:i.tooltipRect})}}},{key:\"axisChartsTooltips\",value:function(t){var e,i,a=t.e,s=t.opt,r=this.w,o=s.elGrid.getBoundingClientRect(),n=\"touchmove\"===a.type?a.touches[0].clientX:a.clientX,l=\"touchmove\"===a.type?a.touches[0].clientY:a.clientY;if(this.clientY=l,this.clientX=n,r.globals.capturedSeriesIndex=-1,r.globals.capturedDataPointIndex=-1,l<o.top||l>o.top+o.height)this.handleMouseOut(s);else{if(Array.isArray(this.tConfig.enabledOnSeries)&&!r.config.tooltip.shared){var h=parseInt(s.paths.getAttribute(\"index\"),10);if(this.tConfig.enabledOnSeries.indexOf(h)<0)return void this.handleMouseOut(s)}var c=this.getElTooltip(),d=this.getElXCrosshairs(),g=r.globals.xyCharts||\"bar\"===r.config.chart.type&&!r.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&this.tConfig.shared||r.globals.comboCharts&&this.tooltipUtil.hasBars();if(\"mousemove\"===a.type||\"touchmove\"===a.type||\"mouseup\"===a.type){if(r.globals.collapsedSeries.length+r.globals.ancillaryCollapsedSeries.length===r.globals.series.length)return;null!==d&&d.classList.add(\"apexcharts-active\");var u=this.yaxisTooltips.filter((function(t){return!0===t}));if(null!==this.ycrosshairs&&u.length&&this.ycrosshairs.classList.add(\"apexcharts-active\"),g&&!this.showOnIntersect)this.handleStickyTooltip(a,n,l,s);else if(\"heatmap\"===r.config.chart.type||\"treemap\"===r.config.chart.type){var f=this.intersect.handleHeatTreeTooltip({e:a,opt:s,x:e,y:i,type:r.config.chart.type});e=f.x,i=f.y,c.style.left=e+\"px\",c.style.top=i+\"px\"}else this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:a,opt:s}),this.tooltipUtil.hasMarkers()&&this.intersect.handleMarkerTooltip({e:a,opt:s,x:e,y:i});if(this.yaxisTooltips.length)for(var p=0;p<r.config.yaxis.length;p++)this.axesTooltip.drawYaxisTooltipText(p,l,this.xyRatios);s.tooltipEl.classList.add(\"apexcharts-active\")}else\"mouseout\"!==a.type&&\"touchend\"!==a.type||this.handleMouseOut(s)}}},{key:\"nonAxisChartsTooltips\",value:function(t){var e=t.e,i=t.opt,a=t.tooltipRect,s=this.w,r=i.paths.getAttribute(\"rel\"),o=this.getElTooltip(),n=s.globals.dom.elWrap.getBoundingClientRect();if(\"mousemove\"===e.type||\"touchmove\"===e.type){o.classList.add(\"apexcharts-active\"),this.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:parseInt(r,10)-1,shared:!1});var l=s.globals.clientX-n.left-a.ttWidth/2,h=s.globals.clientY-n.top-a.ttHeight-10;if(o.style.left=l+\"px\",o.style.top=h+\"px\",s.config.legend.tooltipHoverFormatter){var c=r-1,d=(0,s.config.legend.tooltipHoverFormatter)(this.legendLabels[c].getAttribute(\"data:default-text\"),{seriesIndex:c,dataPointIndex:c,w:s});this.legendLabels[c].innerHTML=d}}else\"mouseout\"!==e.type&&\"touchend\"!==e.type||(o.classList.remove(\"apexcharts-active\"),s.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach((function(t){var e=t.getAttribute(\"data:default-text\");t.innerHTML=decodeURIComponent(e)})))}},{key:\"handleStickyTooltip\",value:function(t,e,i,a){var s=this.w,r=this.tooltipUtil.getNearestValues({context:this,hoverArea:a.hoverArea,elGrid:a.elGrid,clientX:e,clientY:i}),o=r.j,n=r.capturedSeries,l=a.elGrid.getBoundingClientRect();r.hoverX<0||r.hoverX>l.width?this.handleMouseOut(a):null!==n?this.handleStickyCapturedSeries(t,n,a,o):(this.tooltipUtil.isXoverlap(o)||s.globals.isBarHorizontal)&&this.create(t,this,0,o,a.ttItems)}},{key:\"handleStickyCapturedSeries\",value:function(t,e,i,a){var s=this.w;if(!this.tConfig.shared&&null===s.globals.series[e][a])return void this.handleMouseOut(i);void 0!==s.globals.series[e][a]?this.tConfig.shared&&this.tooltipUtil.isXoverlap(a)&&this.tooltipUtil.isInitialSeriesSameLen()?this.create(t,this,e,a,i.ttItems):this.create(t,this,e,a,i.ttItems,!1):this.tooltipUtil.isXoverlap(a)&&this.create(t,this,0,a,i.ttItems)}},{key:\"deactivateHoverFilter\",value:function(){for(var t=this.w,e=new m(this.ctx),i=t.globals.dom.Paper.select(\".apexcharts-bar-area\"),a=0;a<i.length;a++)e.pathMouseLeave(i[a])}},{key:\"handleMouseOut\",value:function(t){var e=this.w,i=this.getElXCrosshairs();if(t.tooltipEl.classList.remove(\"apexcharts-active\"),this.deactivateHoverFilter(),\"bubble\"!==e.config.chart.type&&this.marker.resetPointsSize(),null!==i&&i.classList.remove(\"apexcharts-active\"),null!==this.ycrosshairs&&this.ycrosshairs.classList.remove(\"apexcharts-active\"),this.isXAxisTooltipEnabled&&this.xaxisTooltip.classList.remove(\"apexcharts-active\"),this.yaxisTooltips.length){null===this.yaxisTTEls&&(this.yaxisTTEls=e.globals.dom.baseEl.querySelectorAll(\".apexcharts-yaxistooltip\"));for(var a=0;a<this.yaxisTTEls.length;a++)this.yaxisTTEls[a].classList.remove(\"apexcharts-active\")}e.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach((function(t){var e=t.getAttribute(\"data:default-text\");t.innerHTML=decodeURIComponent(e)}))}},{key:\"markerClick\",value:function(t,e,i){var a=this.w;\"function\"==typeof a.config.chart.events.markerClick&&a.config.chart.events.markerClick(t,this.ctx,{seriesIndex:e,dataPointIndex:i,w:a}),this.ctx.events.fireEvent(\"markerClick\",[t,this.ctx,{seriesIndex:e,dataPointIndex:i,w:a}])}},{key:\"create\",value:function(t,e,i,a,s){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,o=this.w,n=e;\"mouseup\"===t.type&&this.markerClick(t,i,a),null===r&&(r=this.tConfig.shared);var l=this.tooltipUtil.hasMarkers(),h=this.tooltipUtil.getElBars();if(o.config.legend.tooltipHoverFormatter){var c=o.config.legend.tooltipHoverFormatter,d=Array.from(this.legendLabels);d.forEach((function(t){var e=t.getAttribute(\"data:default-text\");t.innerHTML=decodeURIComponent(e)}));for(var g=0;g<d.length;g++){var u=d[g],f=parseInt(u.getAttribute(\"i\"),10),p=decodeURIComponent(u.getAttribute(\"data:default-text\")),x=c(p,{seriesIndex:r?f:i,dataPointIndex:a,w:o});if(r)u.innerHTML=o.globals.collapsedSeriesIndices.indexOf(f)<0?x:p;else if(u.innerHTML=f===i?x:p,i===f)break}}if(r){if(n.tooltipLabels.drawSeriesTexts({ttItems:s,i:i,j:a,shared:!this.showOnIntersect&&this.tConfig.shared}),l&&(o.globals.markers.largestSize>0?n.marker.enlargePoints(a):n.tooltipPosition.moveDynamicPointsOnHover(a)),this.tooltipUtil.hasBars()&&(this.barSeriesHeight=this.tooltipUtil.getBarsHeight(h),this.barSeriesHeight>0)){var b=new m(this.ctx),v=o.globals.dom.Paper.select(\".apexcharts-bar-area[j='\".concat(a,\"']\"));this.deactivateHoverFilter(),this.tooltipPosition.moveStickyTooltipOverBars(a);for(var y=0;y<v.length;y++)b.pathMouseEnter(v[y])}}else n.tooltipLabels.drawSeriesTexts({shared:!1,ttItems:s,i:i,j:a}),this.tooltipUtil.hasBars()&&n.tooltipPosition.moveStickyTooltipOverBars(a),l&&n.tooltipPosition.moveMarkers(i,a)}}]),t}(),yt=function(t){n(s,F);var i=d(s);function s(){return a(this,s),i.apply(this,arguments)}return r(s,[{key:\"draw\",value:function(t,i){var a=this,s=this.w;this.graphics=new m(this.ctx),this.bar=new F(this.ctx,this.xyRatios);var r=new y(this.ctx,s);t=r.getLogSeries(t),this.yRatio=r.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t),\"100%\"===s.config.chart.stackType&&(t=s.globals.seriesPercent.slice()),this.series=t,this.totalItems=0,this.prevY=[],this.prevX=[],this.prevYF=[],this.prevXF=[],this.prevYVal=[],this.prevXVal=[],this.xArrj=[],this.xArrjF=[],this.xArrjVal=[],this.yArrj=[],this.yArrjF=[],this.yArrjVal=[];for(var o=0;o<t.length;o++)t[o].length>0&&(this.totalItems+=t[o].length);for(var n=this.graphics.group({class:\"apexcharts-bar-series apexcharts-plot-series\"}),l=0,h=0,c=function(r,o){var c=void 0,d=void 0,g=void 0,u=void 0,f=[],p=[],b=s.globals.comboCharts?i[r]:r;a.yRatio.length>1&&(a.yaxisIndex=b),a.isReversed=s.config.yaxis[a.yaxisIndex]&&s.config.yaxis[a.yaxisIndex].reversed;var v=a.graphics.group({class:\"apexcharts-series\",seriesName:x.escapeString(s.globals.seriesNames[b]),rel:r+1,\"data:realIndex\":b});a.ctx.series.addCollapsedClassToSeries(v,b);var m=a.graphics.group({class:\"apexcharts-datalabels\",\"data:realIndex\":b}),y=0,w=0,k=a.initialPositions(l,h,c,d,g,u);h=k.y,y=k.barHeight,d=k.yDivision,u=k.zeroW,l=k.x,w=k.barWidth,c=k.xDivision,g=k.zeroH,a.yArrj=[],a.yArrjF=[],a.yArrjVal=[],a.xArrj=[],a.xArrjF=[],a.xArrjVal=[],1===a.prevY.length&&a.prevY[0].every((function(t){return isNaN(t)}))&&(a.prevY[0]=a.prevY[0].map((function(t){return g})),a.prevYF[0]=a.prevYF[0].map((function(t){return 0})));for(var A=0;A<s.globals.dataPoints;A++){var S=a.barHelpers.getStrokeWidth(r,A,b),C={indexes:{i:r,j:A,realIndex:b,bc:o},strokeWidth:S,x:l,y:h,elSeries:v},L=null;a.isHorizontal?(L=a.drawStackedBarPaths(e(e({},C),{},{zeroW:u,barHeight:y,yDivision:d})),w=a.series[r][A]/a.invertedYRatio):(L=a.drawStackedColumnPaths(e(e({},C),{},{xDivision:c,barWidth:w,zeroH:g})),y=a.series[r][A]/a.yRatio[a.yaxisIndex]),h=L.y,l=L.x,f.push(l),p.push(h);var P=a.barHelpers.getPathFillColor(t,r,A,b);v=a.renderSeries({realIndex:b,pathFill:P,j:A,i:r,pathFrom:L.pathFrom,pathTo:L.pathTo,strokeWidth:S,elSeries:v,x:l,y:h,series:t,barHeight:y,barWidth:w,elDataLabelsWrap:m,type:\"bar\",visibleSeries:0})}s.globals.seriesXvalues[b]=f,s.globals.seriesYvalues[b]=p,a.prevY.push(a.yArrj),a.prevYF.push(a.yArrjF),a.prevYVal.push(a.yArrjVal),a.prevX.push(a.xArrj),a.prevXF.push(a.xArrjF),a.prevXVal.push(a.xArrjVal),n.add(v)},d=0,g=0;d<t.length;d++,g++)c(d,g);return n}},{key:\"initialPositions\",value:function(t,e,i,a,s,r){var o,n,l=this.w;return this.isHorizontal?(o=(o=a=l.globals.gridHeight/l.globals.dataPoints)*parseInt(l.config.plotOptions.bar.barHeight,10)/100,r=this.baseLineInvertedY+l.globals.padHorizontal+(this.isReversed?l.globals.gridWidth:0)-(this.isReversed?2*this.baseLineInvertedY:0),e=(a-o)/2):(n=i=l.globals.gridWidth/l.globals.dataPoints,n=l.globals.isXNumeric&&l.globals.dataPoints>1?(i=l.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:n*parseInt(l.config.plotOptions.bar.columnWidth,10)/100,s=this.baseLineY[this.yaxisIndex]+(this.isReversed?l.globals.gridHeight:0)-(this.isReversed?2*this.baseLineY[this.yaxisIndex]:0),t=l.globals.padHorizontal+(i-n)/2),{x:t,y:e,yDivision:a,xDivision:i,barHeight:o,barWidth:n,zeroH:s,zeroW:r}}},{key:\"drawStackedBarPaths\",value:function(t){for(var e,i=t.indexes,a=t.barHeight,s=t.strokeWidth,r=t.zeroW,o=t.x,n=t.y,l=t.yDivision,h=t.elSeries,c=this.w,d=n,g=i.i,u=i.j,f=0,p=0;p<this.prevXF.length;p++)f+=this.prevXF[p][u];if(g>0){var x=r;this.prevXVal[g-1][u]<0?x=this.series[g][u]>=0?this.prevX[g-1][u]+f-2*(this.isReversed?f:0):this.prevX[g-1][u]:this.prevXVal[g-1][u]>=0&&(x=this.series[g][u]>=0?this.prevX[g-1][u]:this.prevX[g-1][u]-f+2*(this.isReversed?f:0)),e=x}else e=r;o=null===this.series[g][u]?e:e+this.series[g][u]/this.invertedYRatio-2*(this.isReversed?this.series[g][u]/this.invertedYRatio:0);var b=this.barHelpers.getBarpaths({barYPosition:d,barHeight:a,x1:e,x2:o,strokeWidth:s,series:this.series,realIndex:i.realIndex,i:g,j:u,w:c});return this.barHelpers.barBackground({j:u,i:g,y1:d,y2:a,elSeries:h}),n+=l,{pathTo:b.pathTo,pathFrom:b.pathFrom,x:o,y:n}}},{key:\"drawStackedColumnPaths\",value:function(t){var e=t.indexes,i=t.x,a=t.y,s=t.xDivision,r=t.barWidth,o=t.zeroH;t.strokeWidth;var n=t.elSeries,l=this.w,h=e.i,c=e.j,d=e.bc;if(l.globals.isXNumeric){var g=l.globals.seriesX[h][c];g||(g=0),i=(g-l.globals.minX)/this.xRatio-r/2}for(var u,f=i,p=0,x=0;x<this.prevYF.length;x++)p+=isNaN(this.prevYF[x][c])?0:this.prevYF[x][c];if(h>0&&!l.globals.isXNumeric||h>0&&l.globals.isXNumeric&&l.globals.seriesX[h-1][c]===l.globals.seriesX[h][c]){var b,v,m=Math.min(this.yRatio.length+1,h+1);if(void 0!==this.prevY[h-1])for(var y=1;y<m;y++)if(!isNaN(this.prevY[h-y][c])){v=this.prevY[h-y][c];break}for(var w=1;w<m;w++){if(this.prevYVal[h-w][c]<0){b=this.series[h][c]>=0?v-p+2*(this.isReversed?p:0):v;break}if(this.prevYVal[h-w][c]>=0){b=this.series[h][c]>=0?v:v+p-2*(this.isReversed?p:0);break}}void 0===b&&(b=l.globals.gridHeight),u=this.prevYF[0].every((function(t){return 0===t}))&&this.prevYF.slice(1,h).every((function(t){return t.every((function(t){return isNaN(t)}))}))?l.globals.gridHeight-o:b}else u=l.globals.gridHeight-o;a=u-this.series[h][c]/this.yRatio[this.yaxisIndex]+2*(this.isReversed?this.series[h][c]/this.yRatio[this.yaxisIndex]:0);var k=this.barHelpers.getColumnPaths({barXPosition:f,barWidth:r,y1:u,y2:a,yRatio:this.yRatio[this.yaxisIndex],strokeWidth:this.strokeWidth,series:this.series,realIndex:e.realIndex,i:h,j:c,w:l});return this.barHelpers.barBackground({bc:d,j:c,i:h,x1:f,x2:r,elSeries:n}),i+=s,{pathTo:k.pathTo,pathFrom:k.pathFrom,x:l.globals.isXNumeric?i-s:i,y:a}}}]),s}(),wt=function(t){n(s,F);var i=d(s);function s(){return a(this,s),i.apply(this,arguments)}return r(s,[{key:\"draw\",value:function(t,i){var a=this,s=this.w,r=new m(this.ctx),o=new M(this.ctx);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=s.config.plotOptions.bar.horizontal;var n=new y(this.ctx,s);t=n.getLogSeries(t),this.series=t,this.yRatio=n.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);for(var l=r.group({class:\"apexcharts-\".concat(s.config.chart.type,\"-series apexcharts-plot-series\")}),h=function(n){a.isBoxPlot=\"boxPlot\"===s.config.chart.type||\"boxPlot\"===s.config.series[n].type;var h,c,d,g,u=void 0,f=void 0,p=[],b=[],v=s.globals.comboCharts?i[n]:n,m=r.group({class:\"apexcharts-series\",seriesName:x.escapeString(s.globals.seriesNames[v]),rel:n+1,\"data:realIndex\":v});a.ctx.series.addCollapsedClassToSeries(m,v),t[n].length>0&&(a.visibleI=a.visibleI+1);var y,w;a.yRatio.length>1&&(a.yaxisIndex=v);var k=a.barHelpers.initialPositions();f=k.y,y=k.barHeight,c=k.yDivision,g=k.zeroW,u=k.x,w=k.barWidth,h=k.xDivision,d=k.zeroH,b.push(u+w/2);for(var A=r.group({class:\"apexcharts-datalabels\",\"data:realIndex\":v}),S=function(i){var r=a.barHelpers.getStrokeWidth(n,i,v),l=null,x={indexes:{i:n,j:i,realIndex:v},x:u,y:f,strokeWidth:r,elSeries:m};l=a.isHorizontal?a.drawHorizontalBoxPaths(e(e({},x),{},{yDivision:c,barHeight:y,zeroW:g})):a.drawVerticalBoxPaths(e(e({},x),{},{xDivision:h,barWidth:w,zeroH:d})),f=l.y,u=l.x,i>0&&b.push(u+w/2),p.push(f),l.pathTo.forEach((function(e,h){var c=!a.isBoxPlot&&a.candlestickOptions.wick.useFillColor?l.color[h]:s.globals.stroke.colors[n],d=o.fillPath({seriesNumber:v,dataPointIndex:i,color:l.color[h],value:t[n][i]});a.renderSeries({realIndex:v,pathFill:d,lineFill:c,j:i,i:n,pathFrom:l.pathFrom,pathTo:e,strokeWidth:r,elSeries:m,x:u,y:f,series:t,barHeight:y,barWidth:w,elDataLabelsWrap:A,visibleSeries:a.visibleI,type:s.config.chart.type})}))},C=0;C<s.globals.dataPoints;C++)S(C);s.globals.seriesXvalues[v]=b,s.globals.seriesYvalues[v]=p,l.add(m)},c=0;c<t.length;c++)h(c);return l}},{key:\"drawVerticalBoxPaths\",value:function(t){var e=t.indexes,i=t.x;t.y;var a=t.xDivision,s=t.barWidth,r=t.zeroH,o=t.strokeWidth,n=this.w,l=new m(this.ctx),h=e.i,c=e.j,d=!0,g=n.config.plotOptions.candlestick.colors.upward,u=n.config.plotOptions.candlestick.colors.downward,f=\"\";this.isBoxPlot&&(f=[this.boxOptions.colors.lower,this.boxOptions.colors.upper]);var p=this.yRatio[this.yaxisIndex],x=e.realIndex,b=this.getOHLCValue(x,c),v=r,y=r;b.o>b.c&&(d=!1);var w=Math.min(b.o,b.c),k=Math.max(b.o,b.c),A=b.m;n.globals.isXNumeric&&(i=(n.globals.seriesX[x][c]-n.globals.minX)/this.xRatio-s/2);var S=i+s*this.visibleI;void 0===this.series[h][c]||null===this.series[h][c]?(w=r,k=r):(w=r-w/p,k=r-k/p,v=r-b.h/p,y=r-b.l/p,A=r-b.m/p);var C=l.move(S,r),L=l.move(S+s/2,w);return n.globals.previousPaths.length>0&&(L=this.getPreviousPath(x,c,!0)),C=this.isBoxPlot?[l.move(S,w)+l.line(S+s/2,w)+l.line(S+s/2,v)+l.line(S+s/4,v)+l.line(S+s-s/4,v)+l.line(S+s/2,v)+l.line(S+s/2,w)+l.line(S+s,w)+l.line(S+s,A)+l.line(S,A)+l.line(S,w+o/2),l.move(S,A)+l.line(S+s,A)+l.line(S+s,k)+l.line(S+s/2,k)+l.line(S+s/2,y)+l.line(S+s-s/4,y)+l.line(S+s/4,y)+l.line(S+s/2,y)+l.line(S+s/2,k)+l.line(S,k)+l.line(S,A)+\"z\"]:[l.move(S,k)+l.line(S+s/2,k)+l.line(S+s/2,v)+l.line(S+s/2,k)+l.line(S+s,k)+l.line(S+s,w)+l.line(S+s/2,w)+l.line(S+s/2,y)+l.line(S+s/2,w)+l.line(S,w)+l.line(S,k-o/2)],L+=l.move(S,w),n.globals.isXNumeric||(i+=a),{pathTo:C,pathFrom:L,x:i,y:k,barXPosition:S,color:this.isBoxPlot?f:d?[g]:[u]}}},{key:\"drawHorizontalBoxPaths\",value:function(t){var e=t.indexes;t.x;var i=t.y,a=t.yDivision,s=t.barHeight,r=t.zeroW,o=t.strokeWidth,n=this.w,l=new m(this.ctx),h=e.i,c=e.j,d=this.boxOptions.colors.lower;this.isBoxPlot&&(d=[this.boxOptions.colors.lower,this.boxOptions.colors.upper]);var g=this.invertedYRatio,u=e.realIndex,f=this.getOHLCValue(u,c),p=r,x=r,b=Math.min(f.o,f.c),v=Math.max(f.o,f.c),y=f.m;n.globals.isXNumeric&&(i=(n.globals.seriesX[u][c]-n.globals.minX)/this.invertedXRatio-s/2);var w=i+s*this.visibleI;void 0===this.series[h][c]||null===this.series[h][c]?(b=r,v=r):(b=r+b/g,v=r+v/g,p=r+f.h/g,x=r+f.l/g,y=r+f.m/g);var k=l.move(r,w),A=l.move(b,w+s/2);return n.globals.previousPaths.length>0&&(A=this.getPreviousPath(u,c,!0)),k=[l.move(b,w)+l.line(b,w+s/2)+l.line(p,w+s/2)+l.line(p,w+s/2-s/4)+l.line(p,w+s/2+s/4)+l.line(p,w+s/2)+l.line(b,w+s/2)+l.line(b,w+s)+l.line(y,w+s)+l.line(y,w)+l.line(b+o/2,w),l.move(y,w)+l.line(y,w+s)+l.line(v,w+s)+l.line(v,w+s/2)+l.line(x,w+s/2)+l.line(x,w+s-s/4)+l.line(x,w+s/4)+l.line(x,w+s/2)+l.line(v,w+s/2)+l.line(v,w)+l.line(y,w)+\"z\"],A+=l.move(b,w),n.globals.isXNumeric||(i+=a),{pathTo:k,pathFrom:A,x:v,y:i,barYPosition:w,color:d}}},{key:\"getOHLCValue\",value:function(t,e){var i=this.w;return{o:this.isBoxPlot?i.globals.seriesCandleH[t][e]:i.globals.seriesCandleO[t][e],h:this.isBoxPlot?i.globals.seriesCandleO[t][e]:i.globals.seriesCandleH[t][e],m:i.globals.seriesCandleM[t][e],l:this.isBoxPlot?i.globals.seriesCandleC[t][e]:i.globals.seriesCandleL[t][e],c:this.isBoxPlot?i.globals.seriesCandleL[t][e]:i.globals.seriesCandleC[t][e]}}}]),s}(),kt=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"checkColorRange\",value:function(){var t=this.w,e=!1,i=t.config.plotOptions[t.config.chart.type];return i.colorScale.ranges.length>0&&i.colorScale.ranges.map((function(t,i){t.from<=0&&(e=!0)})),e}},{key:\"getShadeColor\",value:function(t,e,i,a){var s=this.w,r=1,o=s.config.plotOptions[t].shadeIntensity,n=this.determineColor(t,e,i);s.globals.hasNegs||a?r=s.config.plotOptions[t].reverseNegativeShade?n.percent<0?n.percent/100*(1.25*o):(1-n.percent/100)*(1.25*o):n.percent<=0?1-(1+n.percent/100)*o:(1-n.percent/100)*o:(r=1-n.percent/100,\"treemap\"===t&&(r=(1-n.percent/100)*(1.25*o)));var l=n.color,h=new x;return s.config.plotOptions[t].enableShades&&(l=\"dark\"===this.w.config.theme.mode?x.hexToRgba(h.shadeColor(-1*r,n.color),s.config.fill.opacity):x.hexToRgba(h.shadeColor(r,n.color),s.config.fill.opacity)),{color:l,colorProps:n}}},{key:\"determineColor\",value:function(t,e,i){var a=this.w,s=a.globals.series[e][i],r=a.config.plotOptions[t],o=r.colorScale.inverse?i:e;r.distributed&&\"treemap\"===a.config.chart.type&&(o=i);var n=a.globals.colors[o],l=null,h=Math.min.apply(Math,u(a.globals.series[e])),c=Math.max.apply(Math,u(a.globals.series[e]));r.distributed||\"heatmap\"!==t||(h=a.globals.minY,c=a.globals.maxY),void 0!==r.colorScale.min&&(h=r.colorScale.min<a.globals.minY?r.colorScale.min:a.globals.minY,c=r.colorScale.max>a.globals.maxY?r.colorScale.max:a.globals.maxY);var d=Math.abs(c)+Math.abs(h),g=100*s/(0===d?d-1e-6:d);r.colorScale.ranges.length>0&&r.colorScale.ranges.map((function(t,e){if(s>=t.from&&s<=t.to){n=t.color,l=t.foreColor?t.foreColor:null,h=t.from,c=t.to;var i=Math.abs(c)+Math.abs(h);g=100*s/(0===i?i-1e-6:i)}}));return{color:n,foreColor:l,percent:g}}},{key:\"calculateDataLabels\",value:function(t){var e=t.text,i=t.x,a=t.y,s=t.i,r=t.j,o=t.colorProps,n=t.fontSize,l=this.w.config.dataLabels,h=new m(this.ctx),c=new z(this.ctx),d=null;if(l.enabled){d=h.group({class:\"apexcharts-data-labels\"});var g=l.offsetX,u=l.offsetY,f=i+g,p=a+parseFloat(l.style.fontSize)/3+u;c.plotDataLabelsText({x:f,y:p,text:e,i:s,j:r,color:o.foreColor,parent:d,fontSize:n,dataLabelsConfig:l})}return d}},{key:\"addListeners\",value:function(t){var e=new m(this.ctx);t.node.addEventListener(\"mouseenter\",e.pathMouseEnter.bind(this,t)),t.node.addEventListener(\"mouseleave\",e.pathMouseLeave.bind(this,t)),t.node.addEventListener(\"mousedown\",e.pathMouseDown.bind(this,t))}}]),t}(),At=function(){function t(e,i){a(this,t),this.ctx=e,this.w=e.w,this.xRatio=i.xRatio,this.yRatio=i.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new kt(e),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}return r(t,[{key:\"draw\",value:function(t){var e=this.w,i=new m(this.ctx),a=i.group({class:\"apexcharts-heatmap\"});a.attr(\"clip-path\",\"url(#gridRectMask\".concat(e.globals.cuid,\")\"));var s=e.globals.gridWidth/e.globals.dataPoints,r=e.globals.gridHeight/e.globals.series.length,o=0,n=!1;this.negRange=this.helpers.checkColorRange();var l=t.slice();e.config.yaxis[0].reversed&&(n=!0,l.reverse());for(var h=n?0:l.length-1;n?h<l.length:h>=0;n?h++:h--){var c=i.group({class:\"apexcharts-series apexcharts-heatmap-series\",seriesName:x.escapeString(e.globals.seriesNames[h]),rel:h+1,\"data:realIndex\":h});if(this.ctx.series.addCollapsedClassToSeries(c,h),e.config.chart.dropShadow.enabled){var d=e.config.chart.dropShadow;new v(this.ctx).dropShadow(c,d,h)}for(var g=0,u=e.config.plotOptions.heatmap.shadeIntensity,f=0;f<l[h].length;f++){var p=this.helpers.getShadeColor(e.config.chart.type,h,f,this.negRange),b=p.color,y=p.colorProps;if(\"image\"===e.config.fill.type)b=new M(this.ctx).fillPath({seriesNumber:h,dataPointIndex:f,opacity:e.globals.hasNegs?y.percent<0?1-(1+y.percent/100):u+y.percent/100:y.percent/100,patternID:x.randomId(),width:e.config.fill.image.width?e.config.fill.image.width:s,height:e.config.fill.image.height?e.config.fill.image.height:r});var w=this.rectRadius,k=i.drawRect(g,o,s,r,w);if(k.attr({cx:g,cy:o}),k.node.classList.add(\"apexcharts-heatmap-rect\"),c.add(k),k.attr({fill:b,i:h,index:h,j:f,val:l[h][f],\"stroke-width\":this.strokeWidth,stroke:e.config.plotOptions.heatmap.useFillColorAsStroke?b:e.globals.stroke.colors[0],color:b}),this.helpers.addListeners(k),e.config.chart.animations.enabled&&!e.globals.dataChanged){var A=1;e.globals.resized||(A=e.config.chart.animations.speed),this.animateHeatMap(k,g,o,s,r,A)}if(e.globals.dataChanged){var S=1;if(this.dynamicAnim.enabled&&e.globals.shouldAnimate){S=this.dynamicAnim.speed;var C=e.globals.previousPaths[h]&&e.globals.previousPaths[h][f]&&e.globals.previousPaths[h][f].color;C||(C=\"rgba(255, 255, 255, 0)\"),this.animateHeatColor(k,x.isColorHex(C)?C:x.rgb2hex(C),x.isColorHex(b)?b:x.rgb2hex(b),S)}}var L=(0,e.config.dataLabels.formatter)(e.globals.series[h][f],{value:e.globals.series[h][f],seriesIndex:h,dataPointIndex:f,w:e}),P=this.helpers.calculateDataLabels({text:L,x:g+s/2,y:o+r/2,i:h,j:f,colorProps:y,series:l});null!==P&&c.add(P),g+=s}o+=r,a.add(c)}var T=e.globals.yAxisScale[0].result.slice();e.config.yaxis[0].reversed?T.unshift(\"\"):T.push(\"\"),e.globals.yAxisScale[0].result=T;var I=e.globals.gridHeight/e.globals.series.length;return e.config.yaxis[0].labels.offsetY=-I/2,a}},{key:\"animateHeatMap\",value:function(t,e,i,a,s,r){var o=new b(this.ctx);o.animateRect(t,{x:e+a/2,y:i+s/2,width:0,height:0},{x:e,y:i,width:a,height:s},r,(function(){o.animationCompleted(t)}))}},{key:\"animateHeatColor\",value:function(t,e,i,a){t.attr({fill:e}).animate(a).attr({fill:i})}}]),t}(),St=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"drawYAxisTexts\",value:function(t,e,i,a){var s=this.w,r=s.config.yaxis[0],o=s.globals.yLabelFormatters[0];return new m(this.ctx).drawText({x:t+r.labels.offsetX,y:e+r.labels.offsetY,text:o(a,i),textAnchor:\"middle\",fontSize:r.labels.style.fontSize,fontFamily:r.labels.style.fontFamily,foreColor:Array.isArray(r.labels.style.colors)?r.labels.style.colors[i]:r.labels.style.colors})}}]),t}(),Ct=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w;var i=this.w;this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=void 0!==i.globals.stroke.colors?i.globals.stroke.colors:i.globals.colors,this.defaultSize=Math.min(i.globals.gridWidth,i.globals.gridHeight),this.centerY=this.defaultSize/2,this.centerX=i.globals.gridWidth/2,\"radialBar\"===i.config.chart.type?this.fullAngle=360:this.fullAngle=Math.abs(i.config.plotOptions.pie.endAngle-i.config.plotOptions.pie.startAngle),this.initialAngle=i.config.plotOptions.pie.startAngle%this.fullAngle,i.globals.radialSize=this.defaultSize/2.05-i.config.stroke.width-(i.config.chart.sparkline.enabled?0:i.config.chart.dropShadow.blur),this.donutSize=i.globals.radialSize*parseInt(i.config.plotOptions.pie.donut.size,10)/100,this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSectorAngleArr=[]}return r(t,[{key:\"draw\",value:function(t){var e=this,i=this.w,a=new m(this.ctx);if(this.ret=a.group({class:\"apexcharts-pie\"}),i.globals.noData)return this.ret;for(var s=0,r=0;r<t.length;r++)s+=x.negToZero(t[r]);var o=[],n=a.group();0===s&&(s=1e-5),t.forEach((function(t){e.maxY=Math.max(e.maxY,t)})),i.config.yaxis[0].max&&(this.maxY=i.config.yaxis[0].max),\"back\"===i.config.grid.position&&\"polarArea\"===this.chartType&&this.drawPolarElements(this.ret);for(var l=0;l<t.length;l++){var h=this.fullAngle*x.negToZero(t[l])/s;o.push(h),\"polarArea\"===this.chartType?(o[l]=this.fullAngle/t.length,this.sliceSizes.push(i.globals.radialSize*t[l]/this.maxY)):this.sliceSizes.push(i.globals.radialSize)}if(i.globals.dataChanged){for(var c,d=0,g=0;g<i.globals.previousPaths.length;g++)d+=x.negToZero(i.globals.previousPaths[g]);for(var u=0;u<i.globals.previousPaths.length;u++)c=this.fullAngle*x.negToZero(i.globals.previousPaths[u])/d,this.prevSectorAngleArr.push(c)}this.donutSize<0&&(this.donutSize=0);var f=i.config.plotOptions.pie.customScale,p=i.globals.gridWidth/2,b=i.globals.gridHeight/2,v=p-i.globals.gridWidth/2*f,y=b-i.globals.gridHeight/2*f;if(\"donut\"===this.chartType){var w=a.drawCircle(this.donutSize);w.attr({cx:this.centerX,cy:this.centerY,fill:i.config.plotOptions.pie.donut.background?i.config.plotOptions.pie.donut.background:\"transparent\"}),n.add(w)}var k=this.drawArcs(o,t);if(this.sliceLabels.forEach((function(t){k.add(t)})),n.attr({transform:\"translate(\".concat(v,\", \").concat(y,\") scale(\").concat(f,\")\")}),n.add(k),this.ret.add(n),this.donutDataLabels.show){var A=this.renderInnerDataLabels(this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show,translateX:v,translateY:y});this.ret.add(A)}return\"front\"===i.config.grid.position&&\"polarArea\"===this.chartType&&this.drawPolarElements(this.ret),this.ret}},{key:\"drawArcs\",value:function(t,e){var i=this.w,a=new v(this.ctx),s=new m(this.ctx),r=new M(this.ctx),o=s.group({class:\"apexcharts-slices\"}),n=this.initialAngle,l=this.initialAngle,h=this.initialAngle,c=this.initialAngle;this.strokeWidth=i.config.stroke.show?i.config.stroke.width:0;for(var d=0;d<t.length;d++){var g=s.group({class:\"apexcharts-series apexcharts-pie-series\",seriesName:x.escapeString(i.globals.seriesNames[d]),rel:d+1,\"data:realIndex\":d});o.add(g),l=c,h=(n=h)+t[d],c=l+this.prevSectorAngleArr[d];var u=h<n?this.fullAngle+h-n:h-n,f=r.fillPath({seriesNumber:d,size:this.sliceSizes[d],value:e[d]}),p=this.getChangedPath(l,c),b=s.drawPath({d:p,stroke:Array.isArray(this.lineColorArr)?this.lineColorArr[d]:this.lineColorArr,strokeWidth:0,fill:f,fillOpacity:i.config.fill.opacity,classes:\"apexcharts-pie-area apexcharts-\".concat(this.chartType.toLowerCase(),\"-slice-\").concat(d)});if(b.attr({index:0,j:d}),a.setSelectionFilter(b,0,d),i.config.chart.dropShadow.enabled){var y=i.config.chart.dropShadow;a.dropShadow(b,y,d)}this.addListeners(b,this.donutDataLabels),m.setAttrs(b.node,{\"data:angle\":u,\"data:startAngle\":n,\"data:strokeWidth\":this.strokeWidth,\"data:value\":e[d]});var w={x:0,y:0};\"pie\"===this.chartType||\"polarArea\"===this.chartType?w=x.polarToCartesian(this.centerX,this.centerY,i.globals.radialSize/1.25+i.config.plotOptions.pie.dataLabels.offset,(n+u/2)%this.fullAngle):\"donut\"===this.chartType&&(w=x.polarToCartesian(this.centerX,this.centerY,(i.globals.radialSize+this.donutSize)/2+i.config.plotOptions.pie.dataLabels.offset,(n+u/2)%this.fullAngle)),g.add(b);var k=0;if(!this.initialAnim||i.globals.resized||i.globals.dataChanged?this.animBeginArr.push(0):(0===(k=u/this.fullAngle*i.config.chart.animations.speed)&&(k=1),this.animDur=k+this.animDur,this.animBeginArr.push(this.animDur)),this.dynamicAnim&&i.globals.dataChanged?this.animatePaths(b,{size:this.sliceSizes[d],endAngle:h,startAngle:n,prevStartAngle:l,prevEndAngle:c,animateStartingPos:!0,i:d,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:i.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(b,{size:this.sliceSizes[d],endAngle:h,startAngle:n,i:d,totalItems:t.length-1,animBeginArr:this.animBeginArr,dur:k}),i.config.plotOptions.pie.expandOnClick&&\"polarArea\"!==this.chartType&&b.click(this.pieClicked.bind(this,d)),void 0!==i.globals.selectedDataPoints[0]&&i.globals.selectedDataPoints[0].indexOf(d)>-1&&this.pieClicked(d),i.config.dataLabels.enabled){var A=w.x,S=w.y,C=100*u/this.fullAngle+\"%\";if(0!==u&&i.config.plotOptions.pie.dataLabels.minAngleToShowLabel<t[d]){var L=i.config.dataLabels.formatter;void 0!==L&&(C=L(i.globals.seriesPercent[d][0],{seriesIndex:d,w:i}));var P=i.globals.dataLabels.style.colors[d],T=s.group({class:\"apexcharts-datalabels\"}),I=s.drawText({x:A,y:S,text:C,textAnchor:\"middle\",fontSize:i.config.dataLabels.style.fontSize,fontFamily:i.config.dataLabels.style.fontFamily,fontWeight:i.config.dataLabels.style.fontWeight,foreColor:P});if(T.add(I),i.config.dataLabels.dropShadow.enabled){var z=i.config.dataLabels.dropShadow;a.dropShadow(I,z)}I.node.classList.add(\"apexcharts-pie-label\"),i.config.chart.animations.animate&&!1===i.globals.resized&&(I.node.classList.add(\"apexcharts-pie-label-delay\"),I.node.style.animationDelay=i.config.chart.animations.speed/940+\"s\"),this.sliceLabels.push(T)}}}return o}},{key:\"addListeners\",value:function(t,e){var i=new m(this.ctx);t.node.addEventListener(\"mouseenter\",i.pathMouseEnter.bind(this,t)),t.node.addEventListener(\"mouseleave\",i.pathMouseLeave.bind(this,t)),t.node.addEventListener(\"mouseleave\",this.revertDataLabelsInner.bind(this,t.node,e)),t.node.addEventListener(\"mousedown\",i.pathMouseDown.bind(this,t)),this.donutDataLabels.total.showAlways||(t.node.addEventListener(\"mouseenter\",this.printDataLabelsInner.bind(this,t.node,e)),t.node.addEventListener(\"mousedown\",this.printDataLabelsInner.bind(this,t.node,e)))}},{key:\"animatePaths\",value:function(t,e){var i=this.w,a=e.endAngle<e.startAngle?this.fullAngle+e.endAngle-e.startAngle:e.endAngle-e.startAngle,s=a,r=e.startAngle,o=e.startAngle;void 0!==e.prevStartAngle&&void 0!==e.prevEndAngle&&(r=e.prevEndAngle,s=e.prevEndAngle<e.prevStartAngle?this.fullAngle+e.prevEndAngle-e.prevStartAngle:e.prevEndAngle-e.prevStartAngle),e.i===i.config.series.length-1&&(a+o>this.fullAngle?e.endAngle=e.endAngle-(a+o):a+o<this.fullAngle&&(e.endAngle=e.endAngle+(this.fullAngle-(a+o)))),a===this.fullAngle&&(a=this.fullAngle-.01),this.animateArc(t,r,o,a,s,e)}},{key:\"animateArc\",value:function(t,e,i,a,s,r){var o,n=this,l=this.w,h=new b(this.ctx),c=r.size;(isNaN(e)||isNaN(s))&&(e=i,s=a,r.dur=0);var d=a,g=i,u=e<i?this.fullAngle+e-i:e-i;l.globals.dataChanged&&r.shouldSetPrevPaths&&r.prevEndAngle&&(o=n.getPiePath({me:n,startAngle:r.prevStartAngle,angle:r.prevEndAngle<r.prevStartAngle?this.fullAngle+r.prevEndAngle-r.prevStartAngle:r.prevEndAngle-r.prevStartAngle,size:c}),t.attr({d:o})),0!==r.dur?t.animate(r.dur,l.globals.easing,r.animBeginArr[r.i]).afterAll((function(){\"pie\"!==n.chartType&&\"donut\"!==n.chartType&&\"polarArea\"!==n.chartType||this.animate(l.config.chart.animations.dynamicAnimation.speed).attr({\"stroke-width\":n.strokeWidth}),r.i===l.config.series.length-1&&h.animationCompleted(t)})).during((function(l){d=u+(a-u)*l,r.animateStartingPos&&(d=s+(a-s)*l,g=e-s+(i-(e-s))*l),o=n.getPiePath({me:n,startAngle:g,angle:d,size:c}),t.node.setAttribute(\"data:pathOrig\",o),t.attr({d:o})})):(o=n.getPiePath({me:n,startAngle:g,angle:a,size:c}),r.isTrack||(l.globals.animationEnded=!0),t.node.setAttribute(\"data:pathOrig\",o),t.attr({d:o,\"stroke-width\":n.strokeWidth}))}},{key:\"pieClicked\",value:function(t){var e,i=this.w,a=this,s=a.sliceSizes[t]+(i.config.plotOptions.pie.expandOnClick?4:0),r=i.globals.dom.Paper.select(\".apexcharts-\".concat(a.chartType.toLowerCase(),\"-slice-\").concat(t)).members[0];if(\"true\"!==r.attr(\"data:pieClicked\")){var o=i.globals.dom.baseEl.getElementsByClassName(\"apexcharts-pie-area\");Array.prototype.forEach.call(o,(function(t){t.setAttribute(\"data:pieClicked\",\"false\");var e=t.getAttribute(\"data:pathOrig\");t.setAttribute(\"d\",e)})),r.attr(\"data:pieClicked\",\"true\");var n=parseInt(r.attr(\"data:startAngle\"),10),l=parseInt(r.attr(\"data:angle\"),10);e=a.getPiePath({me:a,startAngle:n,angle:l,size:s}),360!==l&&r.plot(e)}else{r.attr({\"data:pieClicked\":\"false\"}),this.revertDataLabelsInner(r.node,this.donutDataLabels);var h=r.attr(\"data:pathOrig\");r.attr({d:h})}}},{key:\"getChangedPath\",value:function(t,e){var i=\"\";return this.dynamicAnim&&this.w.globals.dataChanged&&(i=this.getPiePath({me:this,startAngle:t,angle:e-t,size:this.size})),i}},{key:\"getPiePath\",value:function(t){var e=t.me,i=t.startAngle,a=t.angle,s=t.size,r=i,o=Math.PI*(r-90)/180,n=a+i;Math.ceil(n)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(n=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(n)>this.fullAngle&&(n-=this.fullAngle);var l=Math.PI*(n-90)/180,h=e.centerX+s*Math.cos(o),c=e.centerY+s*Math.sin(o),d=e.centerX+s*Math.cos(l),g=e.centerY+s*Math.sin(l),u=x.polarToCartesian(e.centerX,e.centerY,e.donutSize,n),f=x.polarToCartesian(e.centerX,e.centerY,e.donutSize,r),p=a>180?1:0,b=[\"M\",h,c,\"A\",s,s,0,p,1,d,g];return\"donut\"===e.chartType?[].concat(b,[\"L\",u.x,u.y,\"A\",e.donutSize,e.donutSize,0,p,0,f.x,f.y,\"L\",h,c,\"z\"]).join(\" \"):\"pie\"===e.chartType||\"polarArea\"===e.chartType?[].concat(b,[\"L\",e.centerX,e.centerY,\"L\",h,c]).join(\" \"):[].concat(b).join(\" \")}},{key:\"drawPolarElements\",value:function(t){var e=this.w,i=new q(this.ctx),a=new m(this.ctx),s=new St(this.ctx),r=a.group(),o=a.group(),n=i.niceScale(0,Math.ceil(this.maxY),e.config.yaxis[0].tickAmount,0,!0),l=n.result.reverse(),h=n.result.length;this.maxY=n.niceMax;for(var c=e.globals.radialSize,d=c/(h-1),g=0;g<h-1;g++){var u=a.drawCircle(c);if(u.attr({cx:this.centerX,cy:this.centerY,fill:\"none\",\"stroke-width\":e.config.plotOptions.polarArea.rings.strokeWidth,stroke:e.config.plotOptions.polarArea.rings.strokeColor}),e.config.yaxis[0].show){var f=s.drawYAxisTexts(this.centerX,this.centerY-c+parseInt(e.config.yaxis[0].labels.style.fontSize,10)/2,g,l[g]);o.add(f)}r.add(u),c-=d}this.drawSpokes(t),t.add(r),t.add(o)}},{key:\"renderInnerDataLabels\",value:function(t,e){var i=this.w,a=new m(this.ctx),s=a.group({class:\"apexcharts-datalabels-group\",transform:\"translate(\".concat(e.translateX?e.translateX:0,\", \").concat(e.translateY?e.translateY:0,\") scale(\").concat(i.config.plotOptions.pie.customScale,\")\")}),r=t.total.show;s.node.style.opacity=e.opacity;var o,n,l=e.centerX,h=e.centerY;o=void 0===t.name.color?i.globals.colors[0]:t.name.color;var c=t.name.fontSize,d=t.name.fontFamily,g=t.name.fontWeight;n=void 0===t.value.color?i.config.chart.foreColor:t.value.color;var u=t.value.formatter,f=\"\",p=\"\";if(r?(o=t.total.color,c=t.total.fontSize,d=t.total.fontFamily,g=t.total.fontWeight,p=t.total.label,f=t.total.formatter(i)):1===i.globals.series.length&&(f=u(i.globals.series[0],i),p=i.globals.seriesNames[0]),p&&(p=t.name.formatter(p,t.total.show,i)),t.name.show){var x=a.drawText({x:l,y:h+parseFloat(t.name.offsetY),text:p,textAnchor:\"middle\",foreColor:o,fontSize:c,fontWeight:g,fontFamily:d});x.node.classList.add(\"apexcharts-datalabel-label\"),s.add(x)}if(t.value.show){var b=t.name.show?parseFloat(t.value.offsetY)+16:t.value.offsetY,v=a.drawText({x:l,y:h+b,text:f,textAnchor:\"middle\",foreColor:n,fontWeight:t.value.fontWeight,fontSize:t.value.fontSize,fontFamily:t.value.fontFamily});v.node.classList.add(\"apexcharts-datalabel-value\"),s.add(v)}return s}},{key:\"printInnerLabels\",value:function(t,e,i,a){var s,r=this.w;a?s=void 0===t.name.color?r.globals.colors[parseInt(a.parentNode.getAttribute(\"rel\"),10)-1]:t.name.color:r.globals.series.length>1&&t.total.show&&(s=t.total.color);var o=r.globals.dom.baseEl.querySelector(\".apexcharts-datalabel-label\"),n=r.globals.dom.baseEl.querySelector(\".apexcharts-datalabel-value\");i=(0,t.value.formatter)(i,r),a||\"function\"!=typeof t.total.formatter||(i=t.total.formatter(r));var l=e===t.total.label;e=t.name.formatter(e,l,r),null!==o&&(o.textContent=e),null!==n&&(n.textContent=i),null!==o&&(o.style.fill=s)}},{key:\"printDataLabelsInner\",value:function(t,e){var i=this.w,a=t.getAttribute(\"data:value\"),s=i.globals.seriesNames[parseInt(t.parentNode.getAttribute(\"rel\"),10)-1];i.globals.series.length>1&&this.printInnerLabels(e,s,a,t);var r=i.globals.dom.baseEl.querySelector(\".apexcharts-datalabels-group\");null!==r&&(r.style.opacity=1)}},{key:\"drawSpokes\",value:function(t){var e=this,i=this.w,a=new m(this.ctx),s=i.config.plotOptions.polarArea.spokes;if(0!==s.strokeWidth){for(var r=[],o=360/i.globals.series.length,n=0;n<i.globals.series.length;n++)r.push(x.polarToCartesian(this.centerX,this.centerY,i.globals.radialSize,i.config.plotOptions.pie.startAngle+o*n));r.forEach((function(i,r){var o=a.drawLine(i.x,i.y,e.centerX,e.centerY,Array.isArray(s.connectorColors)?s.connectorColors[r]:s.connectorColors);t.add(o)}))}}},{key:\"revertDataLabelsInner\",value:function(t,e,i){var a=this,s=this.w,r=s.globals.dom.baseEl.querySelector(\".apexcharts-datalabels-group\"),o=!1,n=s.globals.dom.baseEl.getElementsByClassName(\"apexcharts-pie-area\"),l=function(t){var i=t.makeSliceOut,s=t.printLabel;Array.prototype.forEach.call(n,(function(t){\"true\"===t.getAttribute(\"data:pieClicked\")&&(i&&(o=!0),s&&a.printDataLabelsInner(t,e))}))};if(l({makeSliceOut:!0,printLabel:!1}),e.total.show&&s.globals.series.length>1)o&&!e.total.showAlways?l({makeSliceOut:!1,printLabel:!0}):this.printInnerLabels(e,e.total.label,e.total.formatter(s));else if(l({makeSliceOut:!1,printLabel:!0}),!o)if(s.globals.selectedDataPoints.length&&s.globals.series.length>1)if(s.globals.selectedDataPoints[0].length>0){var h=s.globals.selectedDataPoints[0],c=s.globals.dom.baseEl.querySelector(\".apexcharts-\".concat(this.chartType.toLowerCase(),\"-slice-\").concat(h));this.printDataLabelsInner(c,e)}else r&&s.globals.selectedDataPoints.length&&0===s.globals.selectedDataPoints[0].length&&(r.style.opacity=0);else r&&s.globals.series.length>1&&(r.style.opacity=0)}}]),t}(),Lt=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0;var i=this.w;this.graphics=new m(this.ctx),this.lineColorArr=void 0!==i.globals.stroke.colors?i.globals.stroke.colors:i.globals.colors,this.defaultSize=i.globals.svgHeight<i.globals.svgWidth?i.globals.gridHeight+1.5*i.globals.goldenPadding:i.globals.gridWidth,this.isLog=i.config.yaxis[0].logarithmic,this.coreUtils=new y(this.ctx),this.maxValue=this.isLog?this.coreUtils.getLogVal(i.globals.maxY,0):i.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.w.globals.minY,0):i.globals.minY,this.polygons=i.config.plotOptions.radar.polygons,this.strokeWidth=i.config.stroke.show?i.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-i.config.chart.dropShadow.blur,i.config.xaxis.labels.show&&(this.size=this.size-i.globals.xAxisLabelsWidth/1.75),void 0!==i.config.plotOptions.radar.size&&(this.size=i.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.yaxisLabelsTextsPos=[]}return r(t,[{key:\"draw\",value:function(t){var i=this,a=this.w,s=new M(this.ctx),r=[],o=new z(this.ctx);t.length&&(this.dataPointsLen=t[a.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;var n=a.globals.gridWidth/2,l=a.globals.gridHeight/2,h=n+a.config.plotOptions.radar.offsetX,c=l+a.config.plotOptions.radar.offsetY,d=this.graphics.group({class:\"apexcharts-radar-series apexcharts-plot-series\",transform:\"translate(\".concat(h||0,\", \").concat(c||0,\")\")}),g=[],u=null,f=null;if(this.yaxisLabels=this.graphics.group({class:\"apexcharts-yaxis\"}),t.forEach((function(t,n){var l=t.length===a.globals.dataPoints,h=i.graphics.group().attr({class:\"apexcharts-series\",\"data:longestSeries\":l,seriesName:x.escapeString(a.globals.seriesNames[n]),rel:n+1,\"data:realIndex\":n});i.dataRadiusOfPercent[n]=[],i.dataRadius[n]=[],i.angleArr[n]=[],t.forEach((function(t,e){var a=Math.abs(i.maxValue-i.minValue);t+=Math.abs(i.minValue),i.isLog&&(t=i.coreUtils.getLogVal(t,0)),i.dataRadiusOfPercent[n][e]=t/a,i.dataRadius[n][e]=i.dataRadiusOfPercent[n][e]*i.size,i.angleArr[n][e]=e*i.disAngle})),g=i.getDataPointsPos(i.dataRadius[n],i.angleArr[n]);var c=i.createPaths(g,{x:0,y:0});u=i.graphics.group({class:\"apexcharts-series-markers-wrap apexcharts-element-hidden\"}),f=i.graphics.group({class:\"apexcharts-datalabels\",\"data:realIndex\":n}),a.globals.delayedElements.push({el:u.node,index:n});var d={i:n,realIndex:n,animationDelay:n,initialSpeed:a.config.chart.animations.speed,dataChangeSpeed:a.config.chart.animations.dynamicAnimation.speed,className:\"apexcharts-radar\",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:a.globals.stroke.colors[n],strokeLineCap:a.config.stroke.lineCap},p=null;a.globals.previousPaths.length>0&&(p=i.getPreviousPath(n));for(var b=0;b<c.linePathsTo.length;b++){var m=i.graphics.renderPaths(e(e({},d),{},{pathFrom:null===p?c.linePathsFrom[b]:p,pathTo:c.linePathsTo[b],strokeWidth:Array.isArray(i.strokeWidth)?i.strokeWidth[n]:i.strokeWidth,fill:\"none\",drawShadow:!1}));h.add(m);var y=s.fillPath({seriesNumber:n}),w=i.graphics.renderPaths(e(e({},d),{},{pathFrom:null===p?c.areaPathsFrom[b]:p,pathTo:c.areaPathsTo[b],strokeWidth:0,fill:y,drawShadow:!1}));if(a.config.chart.dropShadow.enabled){var k=new v(i.ctx),A=a.config.chart.dropShadow;k.dropShadow(w,Object.assign({},A,{noUserSpaceOnUse:!0}),n)}h.add(w)}t.forEach((function(t,s){var r=new T(i.ctx).getMarkerConfig({cssClass:\"apexcharts-marker\",seriesIndex:n,dataPointIndex:s}),l=i.graphics.drawMarker(g[s].x,g[s].y,r);l.attr(\"rel\",s),l.attr(\"j\",s),l.attr(\"index\",n),l.node.setAttribute(\"default-marker-size\",r.pSize);var c=i.graphics.group({class:\"apexcharts-series-markers\"});c&&c.add(l),u.add(c),h.add(u);var d=a.config.dataLabels;if(d.enabled){var p=d.formatter(a.globals.series[n][s],{seriesIndex:n,dataPointIndex:s,w:a});o.plotDataLabelsText({x:g[s].x,y:g[s].y,text:p,textAnchor:\"middle\",i:n,j:n,parent:f,offsetCorrection:!1,dataLabelsConfig:e({},d)})}h.add(f)})),r.push(h)})),this.drawPolygons({parent:d}),a.config.xaxis.labels.show){var p=this.drawXAxisTexts();d.add(p)}return r.forEach((function(t){d.add(t)})),d.add(this.yaxisLabels),d}},{key:\"drawPolygons\",value:function(t){for(var e=this,i=this.w,a=t.parent,s=new St(this.ctx),r=i.globals.yAxisScale[0].result.reverse(),o=r.length,n=[],l=this.size/(o-1),h=0;h<o;h++)n[h]=l*h;n.reverse();var c=[],d=[];n.forEach((function(t,i){var a=x.getPolygonPos(t,e.dataPointsLen),s=\"\";a.forEach((function(t,a){if(0===i){var r=e.graphics.drawLine(t.x,t.y,0,0,Array.isArray(e.polygons.connectorColors)?e.polygons.connectorColors[a]:e.polygons.connectorColors);d.push(r)}0===a&&e.yaxisLabelsTextsPos.push({x:t.x,y:t.y}),s+=t.x+\",\"+t.y+\" \"})),c.push(s)})),c.forEach((function(t,s){var r=e.polygons.strokeColors,o=e.polygons.strokeWidth,n=e.graphics.drawPolygon(t,Array.isArray(r)?r[s]:r,Array.isArray(o)?o[s]:o,i.globals.radarPolygons.fill.colors[s]);a.add(n)})),d.forEach((function(t){a.add(t)})),i.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach((function(t,i){var a=s.drawYAxisTexts(t.x,t.y,i,r[i]);e.yaxisLabels.add(a)}))}},{key:\"drawXAxisTexts\",value:function(){var t=this,i=this.w,a=i.config.xaxis.labels,s=this.graphics.group({class:\"apexcharts-xaxis\"}),r=x.getPolygonPos(this.size,this.dataPointsLen);return i.globals.labels.forEach((function(o,n){var l=i.config.xaxis.labels.formatter,h=new z(t.ctx);if(r[n]){var c=t.getTextPos(r[n],t.size),d=l(o,{seriesIndex:-1,dataPointIndex:n,w:i});h.plotDataLabelsText({x:c.newX,y:c.newY,text:d,textAnchor:c.textAnchor,i:n,j:n,parent:s,color:Array.isArray(a.style.colors)&&a.style.colors[n]?a.style.colors[n]:\"#a8a8a8\",dataLabelsConfig:e({textAnchor:c.textAnchor,dropShadow:{enabled:!1}},a),offsetCorrection:!1})}})),s}},{key:\"createPaths\",value:function(t,e){var i=this,a=[],s=[],r=[],o=[];if(t.length){s=[this.graphics.move(e.x,e.y)],o=[this.graphics.move(e.x,e.y)];var n=this.graphics.move(t[0].x,t[0].y),l=this.graphics.move(t[0].x,t[0].y);t.forEach((function(e,a){n+=i.graphics.line(e.x,e.y),l+=i.graphics.line(e.x,e.y),a===t.length-1&&(n+=\"Z\",l+=\"Z\")})),a.push(n),r.push(l)}return{linePathsFrom:s,linePathsTo:a,areaPathsFrom:o,areaPathsTo:r}}},{key:\"getTextPos\",value:function(t,e){var i=\"middle\",a=t.x,s=t.y;return Math.abs(t.x)>=10?t.x>0?(i=\"start\",a+=10):t.x<0&&(i=\"end\",a-=10):i=\"middle\",Math.abs(t.y)>=e-10&&(t.y<0?s-=10:t.y>0&&(s+=10)),{textAnchor:i,newX:a,newY:s}}},{key:\"getPreviousPath\",value:function(t){for(var e=this.w,i=null,a=0;a<e.globals.previousPaths.length;a++){var s=e.globals.previousPaths[a];s.paths.length>0&&parseInt(s.realIndex,10)===parseInt(t,10)&&void 0!==e.globals.previousPaths[a].paths[0]&&(i=e.globals.previousPaths[a].paths[0].d)}return i}},{key:\"getDataPointsPos\",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dataPointsLen;t=t||[],e=e||[];for(var a=[],s=0;s<i;s++){var r={};r.x=t[s]*Math.sin(e[s]),r.y=-t[s]*Math.cos(e[s]),a.push(r)}return a}}]),t}(),Pt=function(t){n(i,Ct);var e=d(i);function i(t){var s;a(this,i),(s=e.call(this,t)).ctx=t,s.w=t.w,s.animBeginArr=[0],s.animDur=0;var r=s.w;return s.startAngle=r.config.plotOptions.radialBar.startAngle,s.endAngle=r.config.plotOptions.radialBar.endAngle,s.totalAngle=Math.abs(r.config.plotOptions.radialBar.endAngle-r.config.plotOptions.radialBar.startAngle),s.trackStartAngle=r.config.plotOptions.radialBar.track.startAngle,s.trackEndAngle=r.config.plotOptions.radialBar.track.endAngle,s.donutDataLabels=s.w.config.plotOptions.radialBar.dataLabels,s.radialDataLabels=s.donutDataLabels,s.trackStartAngle||(s.trackStartAngle=s.startAngle),s.trackEndAngle||(s.trackEndAngle=s.endAngle),360===s.endAngle&&(s.endAngle=359.99),s.margin=parseInt(r.config.plotOptions.radialBar.track.margin,10),s}return r(i,[{key:\"draw\",value:function(t){var e=this.w,i=new m(this.ctx),a=i.group({class:\"apexcharts-radialbar\"});if(e.globals.noData)return a;var s=i.group(),r=this.defaultSize/2,o=e.globals.gridWidth/2,n=this.defaultSize/2.05;e.config.chart.sparkline.enabled||(n=n-e.config.stroke.width-e.config.chart.dropShadow.blur);var l=e.globals.fill.colors;if(e.config.plotOptions.radialBar.track.show){var h=this.drawTracks({size:n,centerX:o,centerY:r,colorArr:l,series:t});s.add(h)}var c=this.drawArcs({size:n,centerX:o,centerY:r,colorArr:l,series:t}),d=360;e.config.plotOptions.radialBar.startAngle<0&&(d=this.totalAngle);var g=(360-d)/360;if(e.globals.radialSize=n-n*g,this.radialDataLabels.value.show){var u=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);e.globals.radialSize+=u*g}return s.add(c.g),\"front\"===e.config.plotOptions.radialBar.hollow.position&&(c.g.add(c.elHollow),c.dataLabels&&c.g.add(c.dataLabels)),a.add(s),a}},{key:\"drawTracks\",value:function(t){var e=this.w,i=new m(this.ctx),a=i.group({class:\"apexcharts-tracks\"}),s=new v(this.ctx),r=new M(this.ctx),o=this.getStrokeWidth(t);t.size=t.size-o/2;for(var n=0;n<t.series.length;n++){var l=i.group({class:\"apexcharts-radialbar-track apexcharts-track\"});a.add(l),l.attr({rel:n+1}),t.size=t.size-o-this.margin;var h=e.config.plotOptions.radialBar.track,c=r.fillPath({seriesNumber:0,size:t.size,fillColors:Array.isArray(h.background)?h.background[n]:h.background,solid:!0}),d=this.trackStartAngle,g=this.trackEndAngle;Math.abs(g)+Math.abs(d)>=360&&(g=360-Math.abs(this.startAngle)-.1);var u=i.drawPath({d:\"\",stroke:c,strokeWidth:o*parseInt(h.strokeWidth,10)/100,fill:\"none\",strokeOpacity:h.opacity,classes:\"apexcharts-radialbar-area\"});if(h.dropShadow.enabled){var f=h.dropShadow;s.dropShadow(u,f)}l.add(u),u.attr(\"id\",\"apexcharts-radialbarTrack-\"+n),this.animatePaths(u,{centerX:t.centerX,centerY:t.centerY,endAngle:g,startAngle:d,size:t.size,i:n,totalItems:2,animBeginArr:0,dur:0,isTrack:!0,easing:e.globals.easing})}return a}},{key:\"drawArcs\",value:function(t){var e=this.w,i=new m(this.ctx),a=new M(this.ctx),s=new v(this.ctx),r=i.group(),o=this.getStrokeWidth(t);t.size=t.size-o/2;var n=e.config.plotOptions.radialBar.hollow.background,l=t.size-o*t.series.length-this.margin*t.series.length-o*parseInt(e.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,h=l-e.config.plotOptions.radialBar.hollow.margin;void 0!==e.config.plotOptions.radialBar.hollow.image&&(n=this.drawHollowImage(t,r,l,n));var c=this.drawHollow({size:h,centerX:t.centerX,centerY:t.centerY,fill:n||\"transparent\"});if(e.config.plotOptions.radialBar.hollow.dropShadow.enabled){var d=e.config.plotOptions.radialBar.hollow.dropShadow;s.dropShadow(c,d)}var g=1;!this.radialDataLabels.total.show&&e.globals.series.length>1&&(g=0);var u=null;this.radialDataLabels.show&&(u=this.renderInnerDataLabels(this.radialDataLabels,{hollowSize:l,centerX:t.centerX,centerY:t.centerY,opacity:g})),\"back\"===e.config.plotOptions.radialBar.hollow.position&&(r.add(c),u&&r.add(u));var f=!1;e.config.plotOptions.radialBar.inverseOrder&&(f=!0);for(var p=f?t.series.length-1:0;f?p>=0:p<t.series.length;f?p--:p++){var b=i.group({class:\"apexcharts-series apexcharts-radial-series\",seriesName:x.escapeString(e.globals.seriesNames[p])});r.add(b),b.attr({rel:p+1,\"data:realIndex\":p}),this.ctx.series.addCollapsedClassToSeries(b,p),t.size=t.size-o-this.margin;var y=a.fillPath({seriesNumber:p,size:t.size,value:t.series[p]}),w=this.startAngle,k=void 0,A=x.negToZero(t.series[p]>100?100:t.series[p])/100,S=Math.round(this.totalAngle*A)+this.startAngle,C=void 0;e.globals.dataChanged&&(k=this.startAngle,C=Math.round(this.totalAngle*x.negToZero(e.globals.previousPaths[p])/100)+k),Math.abs(S)+Math.abs(w)>=360&&(S-=.01),Math.abs(C)+Math.abs(k)>=360&&(C-=.01);var L=S-w,P=Array.isArray(e.config.stroke.dashArray)?e.config.stroke.dashArray[p]:e.config.stroke.dashArray,T=i.drawPath({d:\"\",stroke:y,strokeWidth:o,fill:\"none\",fillOpacity:e.config.fill.opacity,classes:\"apexcharts-radialbar-area apexcharts-radialbar-slice-\"+p,strokeDashArray:P});if(m.setAttrs(T.node,{\"data:angle\":L,\"data:value\":t.series[p]}),e.config.chart.dropShadow.enabled){var I=e.config.chart.dropShadow;s.dropShadow(T,I,p)}s.setSelectionFilter(T,0,p),this.addListeners(T,this.radialDataLabels),b.add(T),T.attr({index:0,j:p});var z=0;!this.initialAnim||e.globals.resized||e.globals.dataChanged||(z=e.config.chart.animations.speed),e.globals.dataChanged&&(z=e.config.chart.animations.dynamicAnimation.speed),this.animDur=z/(1.2*t.series.length)+this.animDur,this.animBeginArr.push(this.animDur),this.animatePaths(T,{centerX:t.centerX,centerY:t.centerY,endAngle:S,startAngle:w,prevEndAngle:C,prevStartAngle:k,size:t.size,i:p,totalItems:2,animBeginArr:this.animBeginArr,dur:z,shouldSetPrevPaths:!0,easing:e.globals.easing})}return{g:r,elHollow:c,dataLabels:u}}},{key:\"drawHollow\",value:function(t){var e=new m(this.ctx).drawCircle(2*t.size);return e.attr({class:\"apexcharts-radialbar-hollow\",cx:t.centerX,cy:t.centerY,r:t.size,fill:t.fill}),e}},{key:\"drawHollowImage\",value:function(t,e,i,a){var s=this.w,r=new M(this.ctx),o=x.randomId(),n=s.config.plotOptions.radialBar.hollow.image;if(s.config.plotOptions.radialBar.hollow.imageClipped)r.clippedImgArea({width:i,height:i,image:n,patternID:\"pattern\".concat(s.globals.cuid).concat(o)}),a=\"url(#pattern\".concat(s.globals.cuid).concat(o,\")\");else{var l=s.config.plotOptions.radialBar.hollow.imageWidth,h=s.config.plotOptions.radialBar.hollow.imageHeight;if(void 0===l&&void 0===h){var c=s.globals.dom.Paper.image(n).loaded((function(e){this.move(t.centerX-e.width/2+s.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-e.height/2+s.config.plotOptions.radialBar.hollow.imageOffsetY)}));e.add(c)}else{var d=s.globals.dom.Paper.image(n).loaded((function(e){this.move(t.centerX-l/2+s.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-h/2+s.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(l,h)}));e.add(d)}}return a}},{key:\"getStrokeWidth\",value:function(t){var e=this.w;return t.size*(100-parseInt(e.config.plotOptions.radialBar.hollow.size,10))/100/(t.series.length+1)-this.margin}}]),i}(),Mt=function(){function t(e){a(this,t),this.w=e.w,this.lineCtx=e}return r(t,[{key:\"sameValueSeriesFix\",value:function(t,e){var i=this.w;if(\"line\"===i.config.chart.type&&(\"gradient\"===i.config.fill.type||\"gradient\"===i.config.fill.type[t])&&new y(this.lineCtx.ctx,i).seriesHaveSameValues(t)){var a=e[t].slice();a[a.length-1]=a[a.length-1]+1e-6,e[t]=a}return e}},{key:\"calculatePoints\",value:function(t){var e=t.series,i=t.realIndex,a=t.x,s=t.y,r=t.i,o=t.j,n=t.prevY,l=this.w,h=[],c=[];if(0===o){var d=this.lineCtx.categoryAxisCorrection+l.config.markers.offsetX;l.globals.isXNumeric&&(d=(l.globals.seriesX[i][0]-l.globals.minX)/this.lineCtx.xRatio+l.config.markers.offsetX),h.push(d),c.push(x.isNumber(e[r][0])?n+l.config.markers.offsetY:null),h.push(a+l.config.markers.offsetX),c.push(x.isNumber(e[r][o+1])?s+l.config.markers.offsetY:null)}else h.push(a+l.config.markers.offsetX),c.push(x.isNumber(e[r][o+1])?s+l.config.markers.offsetY:null);return{x:h,y:c}}},{key:\"checkPreviousPaths\",value:function(t){for(var e=t.pathFromLine,i=t.pathFromArea,a=t.realIndex,s=this.w,r=0;r<s.globals.previousPaths.length;r++){var o=s.globals.previousPaths[r];(\"line\"===o.type||\"area\"===o.type)&&o.paths.length>0&&parseInt(o.realIndex,10)===parseInt(a,10)&&(\"line\"===o.type?(this.lineCtx.appendPathFrom=!1,e=s.globals.previousPaths[r].paths[0].d):\"area\"===o.type&&(this.lineCtx.appendPathFrom=!1,i=s.globals.previousPaths[r].paths[0].d,s.config.stroke.show&&s.globals.previousPaths[r].paths[1]&&(e=s.globals.previousPaths[r].paths[1].d)))}return{pathFromLine:e,pathFromArea:i}}},{key:\"determineFirstPrevY\",value:function(t){var e=t.i,i=t.series,a=t.prevY,s=t.lineYPosition,r=this.w;if(void 0!==i[e][0])a=(s=r.config.chart.stacked&&e>0?this.lineCtx.prevSeriesY[e-1][0]:this.lineCtx.zeroY)-i[e][0]/this.lineCtx.yRatio[this.lineCtx.yaxisIndex]+2*(this.lineCtx.isReversed?i[e][0]/this.lineCtx.yRatio[this.lineCtx.yaxisIndex]:0);else if(r.config.chart.stacked&&e>0&&void 0===i[e][0])for(var o=e-1;o>=0;o--)if(null!==i[o][0]&&void 0!==i[o][0]){a=s=this.lineCtx.prevSeriesY[o][0];break}return{prevY:a,lineYPosition:s}}}]),t}(),Tt=function(){function t(e,i,s){a(this,t),this.ctx=e,this.w=e.w,this.xyRatios=i,this.pointsChart=!(\"bubble\"!==this.w.config.chart.type&&\"scatter\"!==this.w.config.chart.type)||s,this.scatter=new I(this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new Mt(this),this.markers=new T(this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0}return r(t,[{key:\"draw\",value:function(t,e,i){var a=this.w,s=new m(this.ctx),r=a.globals.comboCharts?e:a.config.chart.type,o=s.group({class:\"apexcharts-\".concat(r,\"-series apexcharts-plot-series\")}),n=new y(this.ctx,a);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,t=n.getLogSeries(t),this.yRatio=n.getLogYRatios(this.yRatio);for(var l=[],h=0;h<t.length;h++){t=this.lineHelpers.sameValueSeriesFix(h,t);var c=a.globals.comboCharts?i[h]:h;this._initSerieVariables(t,h,c);var d=[],g=[],u=a.globals.padHorizontal+this.categoryAxisCorrection;this.ctx.series.addCollapsedClassToSeries(this.elSeries,c),a.globals.isXNumeric&&a.globals.seriesX.length>0&&(u=(a.globals.seriesX[c][0]-a.globals.minX)/this.xRatio),g.push(u);var f,p=u,x=p,b=this.zeroY;b=this.lineHelpers.determineFirstPrevY({i:h,series:t,prevY:b,lineYPosition:0}).prevY,d.push(b),f=b;var v=this._calculatePathsFrom({series:t,i:h,realIndex:c,prevX:x,prevY:b}),w=this._iterateOverDataPoints({series:t,realIndex:c,i:h,x:u,y:1,pX:p,pY:f,pathsFrom:v,linePaths:[],areaPaths:[],seriesIndex:i,lineYPosition:0,xArrj:g,yArrj:d});this._handlePaths({type:r,realIndex:c,i:h,paths:w}),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),l.push(this.elSeries)}if(a.config.chart.stacked)for(var k=l.length;k>0;k--)o.add(l[k-1]);else for(var A=0;A<l.length;A++)o.add(l[A]);return o}},{key:\"_initSerieVariables\",value:function(t,e,i){var a=this.w,s=new m(this.ctx);this.xDivision=a.globals.gridWidth/(a.globals.dataPoints-(\"on\"===a.config.xaxis.tickPlacement?1:0)),this.strokeWidth=Array.isArray(a.config.stroke.width)?a.config.stroke.width[i]:a.config.stroke.width,this.yRatio.length>1&&(this.yaxisIndex=i),this.isReversed=a.config.yaxis[this.yaxisIndex]&&a.config.yaxis[this.yaxisIndex].reversed,this.zeroY=a.globals.gridHeight-this.baseLineY[this.yaxisIndex]-(this.isReversed?a.globals.gridHeight:0)+(this.isReversed?2*this.baseLineY[this.yaxisIndex]:0),this.areaBottomY=this.zeroY,(this.zeroY>a.globals.gridHeight||\"end\"===a.config.plotOptions.area.fillTo)&&(this.areaBottomY=a.globals.gridHeight),this.categoryAxisCorrection=this.xDivision/2,this.elSeries=s.group({class:\"apexcharts-series\",seriesName:x.escapeString(a.globals.seriesNames[i])}),this.elPointsMain=s.group({class:\"apexcharts-series-markers-wrap\",\"data:realIndex\":i}),this.elDataLabelsWrap=s.group({class:\"apexcharts-datalabels\",\"data:realIndex\":i});var r=t[e].length===a.globals.dataPoints;this.elSeries.attr({\"data:longestSeries\":r,rel:e+1,\"data:realIndex\":i}),this.appendPathFrom=!0}},{key:\"_calculatePathsFrom\",value:function(t){var e,i,a,s,r=t.series,o=t.i,n=t.realIndex,l=t.prevX,h=t.prevY,c=this.w,d=new m(this.ctx);if(null===r[o][0]){for(var g=0;g<r[o].length;g++)if(null!==r[o][g]){l=this.xDivision*g,h=this.zeroY-r[o][g]/this.yRatio[this.yaxisIndex],e=d.move(l,h),i=d.move(l,this.areaBottomY);break}}else e=d.move(l,h),i=d.move(l,this.areaBottomY)+d.line(l,h);if(a=d.move(-1,this.zeroY)+d.line(-1,this.zeroY),s=d.move(-1,this.zeroY)+d.line(-1,this.zeroY),c.globals.previousPaths.length>0){var u=this.lineHelpers.checkPreviousPaths({pathFromLine:a,pathFromArea:s,realIndex:n});a=u.pathFromLine,s=u.pathFromArea}return{prevX:l,prevY:h,linePath:e,areaPath:i,pathFromLine:a,pathFromArea:s}}},{key:\"_handlePaths\",value:function(t){var i=t.type,a=t.realIndex,s=t.i,r=t.paths,o=this.w,n=new m(this.ctx),l=new M(this.ctx);this.prevSeriesY.push(r.yArrj),o.globals.seriesXvalues[a]=r.xArrj,o.globals.seriesYvalues[a]=r.yArrj;var h=o.config.forecastDataPoints;if(h.count>0){var c=o.globals.seriesXvalues[a][o.globals.seriesXvalues[a].length-h.count-1],d=n.drawRect(c,0,o.globals.gridWidth,o.globals.gridHeight,0);o.globals.dom.elForecastMask.appendChild(d.node);var g=n.drawRect(0,0,c,o.globals.gridHeight,0);o.globals.dom.elNonForecastMask.appendChild(g.node)}this.pointsChart||o.globals.delayedElements.push({el:this.elPointsMain.node,index:a});var u={i:s,realIndex:a,animationDelay:s,initialSpeed:o.config.chart.animations.speed,dataChangeSpeed:o.config.chart.animations.dynamicAnimation.speed,className:\"apexcharts-\".concat(i)};if(\"area\"===i)for(var f=l.fillPath({seriesNumber:a}),p=0;p<r.areaPaths.length;p++){var x=n.renderPaths(e(e({},u),{},{pathFrom:r.pathFromArea,pathTo:r.areaPaths[p],stroke:\"none\",strokeWidth:0,strokeLineCap:null,fill:f}));this.elSeries.add(x)}if(o.config.stroke.show&&!this.pointsChart){var b=null;if(\"line\"===i)b=l.fillPath({seriesNumber:a,i:s});else if(o.config.stroke.fill){var v=o.config.fill;o.config.fill=o.config.stroke.fill,b=l.fillPath({seriesNumber:a,i:s}),o.config.fill=v}else b=o.globals.stroke.colors[a];for(var y=0;y<r.linePaths.length;y++){var w=e(e({},u),{},{pathFrom:r.pathFromLine,pathTo:r.linePaths[y],stroke:b,strokeWidth:this.strokeWidth,strokeLineCap:o.config.stroke.lineCap,fill:\"none\"}),k=n.renderPaths(w);if(this.elSeries.add(k),h.count>0){var A=n.renderPaths(w);A.node.setAttribute(\"stroke-dasharray\",h.dashArray),h.strokeWidth&&A.node.setAttribute(\"stroke-width\",h.strokeWidth),this.elSeries.add(A),A.attr(\"clip-path\",\"url(#forecastMask\".concat(o.globals.cuid,\")\")),k.attr(\"clip-path\",\"url(#nonForecastMask\".concat(o.globals.cuid,\")\"))}}}}},{key:\"_iterateOverDataPoints\",value:function(t){for(var e=t.series,i=t.realIndex,a=t.i,s=t.x,r=t.y,o=t.pX,n=t.pY,l=t.pathsFrom,h=t.linePaths,c=t.areaPaths,d=t.seriesIndex,g=t.lineYPosition,u=t.xArrj,f=t.yArrj,p=this.w,b=new m(this.ctx),v=this.yRatio,y=l.prevY,w=l.linePath,k=l.areaPath,A=l.pathFromLine,S=l.pathFromArea,C=x.isNumber(p.globals.minYArr[i])?p.globals.minYArr[i]:p.globals.minY,L=p.globals.dataPoints>1?p.globals.dataPoints-1:p.globals.dataPoints,P=0;P<L;P++){var M=void 0===e[a][P+1]||null===e[a][P+1];if(p.globals.isXNumeric){var T=p.globals.seriesX[i][P+1];void 0===p.globals.seriesX[i][P+1]&&(T=p.globals.seriesX[i][L-1]),s=(T-p.globals.minX)/this.xRatio}else s+=this.xDivision;if(p.config.chart.stacked)if(a>0&&p.globals.collapsedSeries.length<p.config.series.length-1){g=this.prevSeriesY[function(t){for(var e=t,i=0;i<p.globals.series.length;i++)if(p.globals.collapsedSeriesIndices.indexOf(t)>-1){e--;break}return e>=0?e:0}(a-1)][P+1]}else g=this.zeroY;else g=this.zeroY;r=M?g-C/v[this.yaxisIndex]+2*(this.isReversed?C/v[this.yaxisIndex]:0):g-e[a][P+1]/v[this.yaxisIndex]+2*(this.isReversed?e[a][P+1]/v[this.yaxisIndex]:0),u.push(s),f.push(r);var I=this.lineHelpers.calculatePoints({series:e,x:s,y:r,realIndex:i,i:a,j:P,prevY:y}),z=this._createPaths({series:e,i:a,realIndex:i,j:P,x:s,y:r,pX:o,pY:n,linePath:w,areaPath:k,linePaths:h,areaPaths:c,seriesIndex:d});c=z.areaPaths,h=z.linePaths,o=z.pX,n=z.pY,k=z.areaPath,w=z.linePath,this.appendPathFrom&&(A+=b.line(s,this.zeroY),S+=b.line(s,this.zeroY)),this.handleNullDataPoints(e,I,a,P,i),this._handleMarkersAndLabels({pointsPos:I,series:e,x:s,y:r,prevY:y,i:a,j:P,realIndex:i})}return{yArrj:f,xArrj:u,pathFromArea:S,areaPaths:c,pathFromLine:A,linePaths:h}}},{key:\"_handleMarkersAndLabels\",value:function(t){var e=t.pointsPos;t.series,t.x,t.y,t.prevY;var i=t.i,a=t.j,s=t.realIndex,r=this.w,o=new z(this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,a,{realIndex:s,pointsPos:e,zRatio:this.zRatio,elParent:this.elPointsMain});else{r.globals.series[i].length>1&&this.elPointsMain.node.classList.add(\"apexcharts-element-hidden\");var n=this.markers.plotChartMarkers(e,s,a+1);null!==n&&this.elPointsMain.add(n)}var l=o.drawDataLabel(e,s,a+1,null);null!==l&&this.elDataLabelsWrap.add(l)}},{key:\"_createPaths\",value:function(t){var e=t.series,i=t.i,a=t.realIndex,s=t.j,r=t.x,o=t.y,n=t.pX,l=t.pY,h=t.linePath,c=t.areaPath,d=t.linePaths,g=t.areaPaths,u=t.seriesIndex,f=this.w,p=new m(this.ctx),x=f.config.stroke.curve,b=this.areaBottomY;if(Array.isArray(f.config.stroke.curve)&&(x=Array.isArray(u)?f.config.stroke.curve[u[i]]:f.config.stroke.curve[i]),\"smooth\"===x){var v=.35*(r-n);f.globals.hasNullValues?(null!==e[i][s]&&(null!==e[i][s+1]?(h=p.move(n,l)+p.curve(n+v,l,r-v,o,r+1,o),c=p.move(n+1,l)+p.curve(n+v,l,r-v,o,r+1,o)+p.line(r,b)+p.line(n,b)+\"z\"):(h=p.move(n,l),c=p.move(n,l)+\"z\")),d.push(h),g.push(c)):(h+=p.curve(n+v,l,r-v,o,r,o),c+=p.curve(n+v,l,r-v,o,r,o)),n=r,l=o,s===e[i].length-2&&(c=c+p.curve(n,l,r,o,r,b)+p.move(r,o)+\"z\",f.globals.hasNullValues||(d.push(h),g.push(c)))}else{if(null===e[i][s+1]){h+=p.move(r,o);var y=f.globals.isXNumeric?(f.globals.seriesX[a][s]-f.globals.minX)/this.xRatio:r-this.xDivision;c=c+p.line(y,b)+p.move(r,o)+\"z\"}null===e[i][s]&&(h+=p.move(r,o),c+=p.move(r,b)),\"stepline\"===x?(h=h+p.line(r,null,\"H\")+p.line(null,o,\"V\"),c=c+p.line(r,null,\"H\")+p.line(null,o,\"V\")):\"straight\"===x&&(h+=p.line(r,o),c+=p.line(r,o)),s===e[i].length-2&&(c=c+p.line(r,b)+p.move(r,o)+\"z\",d.push(h),g.push(c))}return{linePaths:d,areaPaths:g,pX:n,pY:l,linePath:h,areaPath:c}}},{key:\"handleNullDataPoints\",value:function(t,e,i,a,s){var r=this.w;if(null===t[i][a]&&r.config.markers.showNullDataPoints||1===t[i].length){var o=this.markers.plotChartMarkers(e,s,a+1,this.strokeWidth-r.config.markers.strokeWidth/2,!0);null!==o&&this.elPointsMain.add(o)}}}]),t}();window.TreemapSquared={},window.TreemapSquared.generate=function(){function t(e,i,a,s){this.xoffset=e,this.yoffset=i,this.height=s,this.width=a,this.shortestEdge=function(){return Math.min(this.height,this.width)},this.getCoordinates=function(t){var e,i=[],a=this.xoffset,s=this.yoffset,o=r(t)/this.height,n=r(t)/this.width;if(this.width>=this.height)for(e=0;e<t.length;e++)i.push([a,s,a+o,s+t[e]/o]),s+=t[e]/o;else for(e=0;e<t.length;e++)i.push([a,s,a+t[e]/n,s+n]),a+=t[e]/n;return i},this.cutArea=function(e){var i;if(this.width>=this.height){var a=e/this.height,s=this.width-a;i=new t(this.xoffset+a,this.yoffset,s,this.height)}else{var r=e/this.width,o=this.height-r;i=new t(this.xoffset,this.yoffset+r,this.width,o)}return i}}function e(e,a,s,o,n){return o=void 0===o?0:o,n=void 0===n?0:n,function(t){var e,i,a=[];for(e=0;e<t.length;e++)for(i=0;i<t[e].length;i++)a.push(t[e][i]);return a}(i(function(t,e){var i,a=[],s=e/r(t);for(i=0;i<t.length;i++)a[i]=t[i]*s;return a}(e,a*s),[],new t(o,n,a,s),[]))}function i(t,e,s,o){var n,l,h;if(0!==t.length)return n=s.shortestEdge(),function(t,e,i){var s;if(0===t.length)return!0;(s=t.slice()).push(e);var r=a(t,i),o=a(s,i);return r>=o}(e,l=t[0],n)?(e.push(l),i(t.slice(1),e,s,o)):(h=s.cutArea(r(e),o),o.push(s.getCoordinates(e)),i(t,[],h,o)),o;o.push(s.getCoordinates(e))}function a(t,e){var i=Math.min.apply(Math,t),a=Math.max.apply(Math,t),s=r(t);return Math.max(Math.pow(e,2)*a/Math.pow(s,2),Math.pow(s,2)/(Math.pow(e,2)*i))}function s(t){return t&&t.constructor===Array}function r(t){var e,i=0;for(e=0;e<t.length;e++)i+=t[e];return i}function o(t){var e,i=0;if(s(t[0]))for(e=0;e<t.length;e++)i+=o(t[e]);else i=r(t);return i}return function t(i,a,r,n,l){n=void 0===n?0:n,l=void 0===l?0:l;var h,c,d=[],g=[];if(s(i[0])){for(c=0;c<i.length;c++)d[c]=o(i[c]);for(h=e(d,a,r,n,l),c=0;c<i.length;c++)g.push(t(i[c],h[c][2]-h[c][0],h[c][3]-h[c][1],h[c][0],h[c][1]))}else g=e(i,a,r,n,l);return g}}();var It,zt,Xt=function(){function t(e,i){a(this,t),this.ctx=e,this.w=e.w,this.strokeWidth=this.w.config.stroke.width,this.helpers=new kt(e),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[]}return r(t,[{key:\"draw\",value:function(t){var e=this,i=this.w,a=new m(this.ctx),s=new M(this.ctx),r=a.group({class:\"apexcharts-treemap\"});if(i.globals.noData)return r;var o=[];return t.forEach((function(t){var e=t.map((function(t){return Math.abs(t)}));o.push(e)})),this.negRange=this.helpers.checkColorRange(),i.config.series.forEach((function(t,i){t.data.forEach((function(t){Array.isArray(e.labels[i])||(e.labels[i]=[]),e.labels[i].push(t.x)}))})),window.TreemapSquared.generate(o,i.globals.gridWidth,i.globals.gridHeight).forEach((function(o,n){var l=a.group({class:\"apexcharts-series apexcharts-treemap-series\",seriesName:x.escapeString(i.globals.seriesNames[n]),rel:n+1,\"data:realIndex\":n});if(i.config.chart.dropShadow.enabled){var h=i.config.chart.dropShadow;new v(e.ctx).dropShadow(r,h,n)}var c=a.group({class:\"apexcharts-data-labels\"});o.forEach((function(r,o){var h=r[0],c=r[1],d=r[2],g=r[3],u=a.drawRect(h,c,d-h,g-c,0,\"#fff\",1,e.strokeWidth,i.config.plotOptions.treemap.useFillColorAsStroke?p:i.globals.stroke.colors[n]);u.attr({cx:h,cy:c,index:n,i:n,j:o,width:d-h,height:g-c});var f=e.helpers.getShadeColor(i.config.chart.type,n,o,e.negRange),p=f.color;void 0!==i.config.series[n].data[o]&&i.config.series[n].data[o].fillColor&&(p=i.config.series[n].data[o].fillColor);var x=s.fillPath({color:p,seriesNumber:n,dataPointIndex:o});u.node.classList.add(\"apexcharts-treemap-rect\"),u.attr({fill:x}),e.helpers.addListeners(u);var b={x:h+(d-h)/2,y:c+(g-c)/2,width:0,height:0},v={x:h,y:c,width:d-h,height:g-c};if(i.config.chart.animations.enabled&&!i.globals.dataChanged){var m=1;i.globals.resized||(m=i.config.chart.animations.speed),e.animateTreemap(u,b,v,m)}if(i.globals.dataChanged){var y=1;e.dynamicAnim.enabled&&i.globals.shouldAnimate&&(y=e.dynamicAnim.speed,i.globals.previousPaths[n]&&i.globals.previousPaths[n][o]&&i.globals.previousPaths[n][o].rect&&(b=i.globals.previousPaths[n][o].rect),e.animateTreemap(u,b,v,y))}var w=e.getFontSize(r),k=i.config.dataLabels.formatter(e.labels[n][o],{value:i.globals.series[n][o],seriesIndex:n,dataPointIndex:o,w:i}),A=e.helpers.calculateDataLabels({text:k,x:(h+d)/2,y:(c+g)/2+e.strokeWidth/2+w/3,i:n,j:o,colorProps:f,fontSize:w,series:t});i.config.dataLabels.enabled&&A&&e.rotateToFitLabel(A,k,h,c,d,g),l.add(u),null!==A&&l.add(A)})),l.add(c),r.add(l)})),r}},{key:\"getFontSize\",value:function(t){var e=this.w;var i,a,s,r,o=function t(e){var i,a=0;if(Array.isArray(e[0]))for(i=0;i<e.length;i++)a+=t(e[i]);else for(i=0;i<e.length;i++)a+=e[i].length;return a}(this.labels)/function t(e){var i,a=0;if(Array.isArray(e[0]))for(i=0;i<e.length;i++)a+=t(e[i]);else for(i=0;i<e.length;i++)a+=1;return a}(this.labels);return i=t[2]-t[0],a=t[3]-t[1],s=i*a,r=Math.pow(s,.5),Math.min(r/o,parseInt(e.config.dataLabels.style.fontSize,10))}},{key:\"rotateToFitLabel\",value:function(t,e,i,a,s,r){var o=new m(this.ctx),n=o.getTextRects(e);if(n.width+5>s-i&&n.width<=r-a){var l=o.rotateAroundCenter(t.node);t.node.setAttribute(\"transform\",\"rotate(-90 \".concat(l.x,\" \").concat(l.y,\")\"))}}},{key:\"animateTreemap\",value:function(t,e,i,a){var s=new b(this.ctx);s.animateRect(t,{x:e.x,y:e.y,width:e.width,height:e.height},{x:i.x,y:i.y,width:i.width,height:i.height},a,(function(){s.animationCompleted(t)}))}}]),t}(),Et=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w,this.timeScaleArray=[],this.utc=this.w.config.xaxis.labels.datetimeUTC}return r(t,[{key:\"calculateTimeScaleTicks\",value:function(t,i){var a=this,s=this.w;if(s.globals.allSeriesCollapsed)return s.globals.labels=[],s.globals.timescaleLabels=[],[];var r=new R(this.ctx),o=(i-t)/864e5;this.determineInterval(o),s.globals.disableZoomIn=!1,s.globals.disableZoomOut=!1,o<.00011574074074074075?s.globals.disableZoomIn=!0:o>5e4&&(s.globals.disableZoomOut=!0);var n=r.getTimeUnitsfromTimestamp(t,i,this.utc),l=s.globals.gridWidth/o,h=l/24,c=h/60,d=c/60,g=Math.floor(24*o),u=Math.floor(1440*o),f=Math.floor(86400*o),p=Math.floor(o),x=Math.floor(o/30),b=Math.floor(o/365),v={minMillisecond:n.minMillisecond,minSecond:n.minSecond,minMinute:n.minMinute,minHour:n.minHour,minDate:n.minDate,minMonth:n.minMonth,minYear:n.minYear},m={firstVal:v,currentMillisecond:v.minMillisecond,currentSecond:v.minSecond,currentMinute:v.minMinute,currentHour:v.minHour,currentMonthDate:v.minDate,currentDate:v.minDate,currentMonth:v.minMonth,currentYear:v.minYear,daysWidthOnXAxis:l,hoursWidthOnXAxis:h,minutesWidthOnXAxis:c,secondsWidthOnXAxis:d,numberOfSeconds:f,numberOfMinutes:u,numberOfHours:g,numberOfDays:p,numberOfMonths:x,numberOfYears:b};switch(this.tickInterval){case\"years\":this.generateYearScale(m);break;case\"months\":case\"half_year\":this.generateMonthScale(m);break;case\"months_days\":case\"months_fortnight\":case\"days\":case\"week_days\":this.generateDayScale(m);break;case\"hours\":this.generateHourScale(m);break;case\"minutes_fives\":case\"minutes\":this.generateMinuteScale(m);break;case\"seconds_tens\":case\"seconds_fives\":case\"seconds\":this.generateSecondScale(m)}var y=this.timeScaleArray.map((function(t){var i={position:t.position,unit:t.unit,year:t.year,day:t.day?t.day:1,hour:t.hour?t.hour:0,month:t.month+1};return\"month\"===t.unit?e(e({},i),{},{day:1,value:t.value+1}):\"day\"===t.unit||\"hour\"===t.unit?e(e({},i),{},{value:t.value}):\"minute\"===t.unit?e(e({},i),{},{value:t.value,minute:t.value}):\"second\"===t.unit?e(e({},i),{},{value:t.value,minute:t.minute,second:t.second}):t}));return y.filter((function(t){var e=1,i=Math.ceil(s.globals.gridWidth/120),r=t.value;void 0!==s.config.xaxis.tickAmount&&(i=s.config.xaxis.tickAmount),y.length>i&&(e=Math.floor(y.length/i));var o=!1,n=!1;switch(a.tickInterval){case\"years\":\"year\"===t.unit&&(o=!0);break;case\"half_year\":e=7,\"year\"===t.unit&&(o=!0);break;case\"months\":e=1,\"year\"===t.unit&&(o=!0);break;case\"months_fortnight\":e=15,\"year\"!==t.unit&&\"month\"!==t.unit||(o=!0),30===r&&(n=!0);break;case\"months_days\":e=10,\"month\"===t.unit&&(o=!0),30===r&&(n=!0);break;case\"week_days\":e=8,\"month\"===t.unit&&(o=!0);break;case\"days\":e=1,\"month\"===t.unit&&(o=!0);break;case\"hours\":\"day\"===t.unit&&(o=!0);break;case\"minutes_fives\":r%5!=0&&(n=!0);break;case\"seconds_tens\":r%10!=0&&(n=!0);break;case\"seconds_fives\":r%5!=0&&(n=!0)}if(\"hours\"===a.tickInterval||\"minutes_fives\"===a.tickInterval||\"seconds_tens\"===a.tickInterval||\"seconds_fives\"===a.tickInterval){if(!n)return!0}else if((r%e==0||o)&&!n)return!0}))}},{key:\"recalcDimensionsBasedOnFormat\",value:function(t,e){var i=this.w,a=this.formatDates(t),s=this.removeOverlappingTS(a);i.globals.timescaleLabels=s.slice(),new lt(this.ctx).plotCoords()}},{key:\"determineInterval\",value:function(t){var e=24*t,i=60*e;switch(!0){case t/365>5:this.tickInterval=\"years\";break;case t>800:this.tickInterval=\"half_year\";break;case t>180:this.tickInterval=\"months\";break;case t>90:this.tickInterval=\"months_fortnight\";break;case t>60:this.tickInterval=\"months_days\";break;case t>30:this.tickInterval=\"week_days\";break;case t>2:this.tickInterval=\"days\";break;case e>2.4:this.tickInterval=\"hours\";break;case i>15:this.tickInterval=\"minutes_fives\";break;case i>5:this.tickInterval=\"minutes\";break;case i>1:this.tickInterval=\"seconds_tens\";break;case 60*i>20:this.tickInterval=\"seconds_fives\";break;default:this.tickInterval=\"seconds\"}}},{key:\"generateYearScale\",value:function(t){var e=t.firstVal,i=t.currentMonth,a=t.currentYear,s=t.daysWidthOnXAxis,r=t.numberOfYears,o=e.minYear,n=0,l=new R(this.ctx),h=\"year\";if(e.minDate>1||e.minMonth>0){var c=l.determineRemainingDaysOfYear(e.minYear,e.minMonth,e.minDate);n=(l.determineDaysOfYear(e.minYear)-c+1)*s,o=e.minYear+1,this.timeScaleArray.push({position:n,value:o,unit:h,year:o,month:x.monthMod(i+1)})}else 1===e.minDate&&0===e.minMonth&&this.timeScaleArray.push({position:n,value:o,unit:h,year:a,month:x.monthMod(i+1)});for(var d=o,g=n,u=0;u<r;u++)d++,g=l.determineDaysOfYear(d-1)*s+g,this.timeScaleArray.push({position:g,value:d,unit:h,year:d,month:1})}},{key:\"generateMonthScale\",value:function(t){var e=t.firstVal,i=t.currentMonthDate,a=t.currentMonth,s=t.currentYear,r=t.daysWidthOnXAxis,o=t.numberOfMonths,n=a,l=0,h=new R(this.ctx),c=\"month\",d=0;if(e.minDate>1){l=(h.determineDaysOfMonths(a+1,e.minYear)-i+1)*r,n=x.monthMod(a+1);var g=s+d,u=x.monthMod(n),f=n;0===n&&(c=\"year\",f=g,u=1,g+=d+=1),this.timeScaleArray.push({position:l,value:f,unit:c,year:g,month:u})}else this.timeScaleArray.push({position:l,value:n,unit:c,year:s,month:x.monthMod(a)});for(var p=n+1,b=l,v=0,m=1;v<o;v++,m++){0===(p=x.monthMod(p))?(c=\"year\",d+=1):c=\"month\";var y=this._getYear(s,p,d);b=h.determineDaysOfMonths(p,y)*r+b;var w=0===p?y:p;this.timeScaleArray.push({position:b,value:w,unit:c,year:y,month:0===p?1:p}),p++}}},{key:\"generateDayScale\",value:function(t){var e=t.firstVal,i=t.currentMonth,a=t.currentYear,s=t.hoursWidthOnXAxis,r=t.numberOfDays,o=new R(this.ctx),n=\"day\",l=e.minDate+1,h=l,c=function(t,e,i){return t>o.determineDaysOfMonths(e+1,i)?(h=1,n=\"month\",g=e+=1,e):e},d=(24-e.minHour)*s,g=l,u=c(h,i,a);0===e.minHour&&1===e.minDate?(d=0,g=x.monthMod(e.minMonth),n=\"month\",h=e.minDate,r++):1!==e.minDate&&0===e.minHour&&0===e.minMinute&&(d=0,l=e.minDate,g=l,u=c(h=l,i,a)),this.timeScaleArray.push({position:d,value:g,unit:n,year:this._getYear(a,u,0),month:x.monthMod(u),day:h});for(var f=d,p=0;p<r;p++){n=\"day\",u=c(h+=1,u,this._getYear(a,u,0));var b=this._getYear(a,u,0);f=24*s+f;var v=1===h?x.monthMod(u):h;this.timeScaleArray.push({position:f,value:v,unit:n,year:b,month:x.monthMod(u),day:v})}}},{key:\"generateHourScale\",value:function(t){var e=t.firstVal,i=t.currentDate,a=t.currentMonth,s=t.currentYear,r=t.minutesWidthOnXAxis,o=t.numberOfHours,n=new R(this.ctx),l=\"hour\",h=function(t,e){return t>n.determineDaysOfMonths(e+1,s)&&(p=1,e+=1),{month:e,date:p}},c=function(t,e){return t>n.determineDaysOfMonths(e+1,s)?e+=1:e},d=60-(e.minMinute+e.minSecond/60),g=d*r,u=e.minHour+1,f=u+1;60===d&&(g=0,f=(u=e.minHour)+1);var p=i,b=c(p,a);this.timeScaleArray.push({position:g,value:u,unit:l,day:p,hour:f,year:s,month:x.monthMod(b)});for(var v=g,m=0;m<o;m++){if(l=\"hour\",f>=24)f=0,l=\"day\",b=h(p+=1,b).month,b=c(p,b);var y=this._getYear(s,b,0);v=0===f&&0===m?d*r:60*r+v;var w=0===f?p:f;this.timeScaleArray.push({position:v,value:w,unit:l,hour:f,day:p,year:y,month:x.monthMod(b)}),f++}}},{key:\"generateMinuteScale\",value:function(t){for(var e=t.currentMillisecond,i=t.currentSecond,a=t.currentMinute,s=t.currentHour,r=t.currentDate,o=t.currentMonth,n=t.currentYear,l=t.minutesWidthOnXAxis,h=t.secondsWidthOnXAxis,c=t.numberOfMinutes,d=a+1,g=r,u=o,f=n,p=s,b=(60-i-e/1e3)*h,v=0;v<c;v++)d>=60&&(d=0,24===(p+=1)&&(p=0)),this.timeScaleArray.push({position:b,value:d,unit:\"minute\",hour:p,minute:d,day:g,year:this._getYear(f,u,0),month:x.monthMod(u)}),b+=l,d++}},{key:\"generateSecondScale\",value:function(t){for(var e=t.currentMillisecond,i=t.currentSecond,a=t.currentMinute,s=t.currentHour,r=t.currentDate,o=t.currentMonth,n=t.currentYear,l=t.secondsWidthOnXAxis,h=t.numberOfSeconds,c=i+1,d=a,g=r,u=o,f=n,p=s,b=(1e3-e)/1e3*l,v=0;v<h;v++)c>=60&&(c=0,++d>=60&&(d=0,24===++p&&(p=0))),this.timeScaleArray.push({position:b,value:c,unit:\"second\",hour:p,minute:d,second:c,day:g,year:this._getYear(f,u,0),month:x.monthMod(u)}),b+=l,c++}},{key:\"createRawDateString\",value:function(t,e){var i=t.year;return 0===t.month&&(t.month=1),i+=\"-\"+(\"0\"+t.month.toString()).slice(-2),\"day\"===t.unit?i+=\"day\"===t.unit?\"-\"+(\"0\"+e).slice(-2):\"-01\":i+=\"-\"+(\"0\"+(t.day?t.day:\"1\")).slice(-2),\"hour\"===t.unit?i+=\"hour\"===t.unit?\"T\"+(\"0\"+e).slice(-2):\"T00\":i+=\"T\"+(\"0\"+(t.hour?t.hour:\"0\")).slice(-2),\"minute\"===t.unit?i+=\":\"+(\"0\"+e).slice(-2):i+=\":\"+(t.minute?(\"0\"+t.minute).slice(-2):\"00\"),\"second\"===t.unit?i+=\":\"+(\"0\"+e).slice(-2):i+=\":00\",this.utc&&(i+=\".000Z\"),i}},{key:\"formatDates\",value:function(t){var e=this,i=this.w;return t.map((function(t){var a=t.value.toString(),s=new R(e.ctx),r=e.createRawDateString(t,a),o=s.getDate(s.parseDate(r));if(e.utc||(o=s.getDate(s.parseDateWithTimezone(r))),void 0===i.config.xaxis.labels.format){var n=\"dd MMM\",l=i.config.xaxis.labels.datetimeFormatter;\"year\"===t.unit&&(n=l.year),\"month\"===t.unit&&(n=l.month),\"day\"===t.unit&&(n=l.day),\"hour\"===t.unit&&(n=l.hour),\"minute\"===t.unit&&(n=l.minute),\"second\"===t.unit&&(n=l.second),a=s.formatDate(o,n)}else a=s.formatDate(o,i.config.xaxis.labels.format);return{dateString:r,position:t.position,value:a,unit:t.unit,year:t.year,month:t.month}}))}},{key:\"removeOverlappingTS\",value:function(t){var e,i=this,a=new m(this.ctx),s=!1;t.length>0&&t[0].value&&t.every((function(e){return e.value.length===t[0].value.length}))&&(s=!0,e=a.getTextRects(t[0].value).width);var r=0,o=t.map((function(o,n){if(n>0&&i.w.config.xaxis.labels.hideOverlappingLabels){var l=s?e:a.getTextRects(t[r].value).width,h=t[r].position;return o.position>h+l+10?(r=n,o):null}return o}));return o=o.filter((function(t){return null!==t}))}},{key:\"_getYear\",value:function(t,e,i){return t+Math.floor(e/12)+i}}]),t}(),Yt=function(){function t(e,i){a(this,t),this.ctx=i,this.w=i.w,this.el=e}return r(t,[{key:\"setupElements\",value:function(){var t=this.w.globals,e=this.w.config,i=e.chart.type;t.axisCharts=[\"line\",\"area\",\"bar\",\"rangeBar\",\"candlestick\",\"boxPlot\",\"scatter\",\"bubble\",\"radar\",\"heatmap\",\"treemap\"].indexOf(i)>-1,t.xyCharts=[\"line\",\"area\",\"bar\",\"rangeBar\",\"candlestick\",\"boxPlot\",\"scatter\",\"bubble\"].indexOf(i)>-1,t.isBarHorizontal=(\"bar\"===e.chart.type||\"rangeBar\"===e.chart.type||\"boxPlot\"===e.chart.type)&&e.plotOptions.bar.horizontal,t.chartClass=\".apexcharts\"+t.chartID,t.dom.baseEl=this.el,t.dom.elWrap=document.createElement(\"div\"),m.setAttrs(t.dom.elWrap,{id:t.chartClass.substring(1),class:\"apexcharts-canvas \"+t.chartClass.substring(1)}),this.el.appendChild(t.dom.elWrap),t.dom.Paper=new window.SVG.Doc(t.dom.elWrap),t.dom.Paper.attr({class:\"apexcharts-svg\",\"xmlns:data\":\"ApexChartsNS\",transform:\"translate(\".concat(e.chart.offsetX,\", \").concat(e.chart.offsetY,\")\")}),t.dom.Paper.node.style.background=e.chart.background,this.setSVGDimensions(),t.dom.elGraphical=t.dom.Paper.group().attr({class:\"apexcharts-inner apexcharts-graphical\"}),t.dom.elAnnotations=t.dom.Paper.group().attr({class:\"apexcharts-annotations\"}),t.dom.elDefs=t.dom.Paper.defs(),t.dom.elLegendWrap=document.createElement(\"div\"),t.dom.elLegendWrap.classList.add(\"apexcharts-legend\"),t.dom.elWrap.appendChild(t.dom.elLegendWrap),t.dom.Paper.add(t.dom.elGraphical),t.dom.elGraphical.add(t.dom.elDefs)}},{key:\"plotChartType\",value:function(t,e){var i=this.w,a=i.config,s=i.globals,r={series:[],i:[]},o={series:[],i:[]},n={series:[],i:[]},l={series:[],i:[]},h={series:[],i:[]},c={series:[],i:[]},d={series:[],i:[]};s.series.map((function(e,g){var u=0;void 0!==t[g].type?(\"column\"===t[g].type||\"bar\"===t[g].type?(s.series.length>1&&a.plotOptions.bar.horizontal&&console.warn(\"Horizontal bars are not supported in a mixed/combo chart. Please turn off `plotOptions.bar.horizontal`\"),h.series.push(e),h.i.push(g),u++,i.globals.columnSeries=h.series):\"area\"===t[g].type?(o.series.push(e),o.i.push(g),u++):\"line\"===t[g].type?(r.series.push(e),r.i.push(g),u++):\"scatter\"===t[g].type?(n.series.push(e),n.i.push(g)):\"bubble\"===t[g].type?(l.series.push(e),l.i.push(g),u++):\"candlestick\"===t[g].type?(c.series.push(e),c.i.push(g),u++):\"boxPlot\"===t[g].type?(d.series.push(e),d.i.push(g),u++):console.warn(\"You have specified an unrecognized chart type. Available types for this property are line/area/column/bar/scatter/bubble\"),u>1&&(s.comboCharts=!0)):(r.series.push(e),r.i.push(g))}));var g=new Tt(this.ctx,e),u=new wt(this.ctx,e);this.ctx.pie=new Ct(this.ctx);var f=new Pt(this.ctx);this.ctx.rangeBar=new H(this.ctx,e);var p=new Lt(this.ctx),x=[];if(s.comboCharts){if(o.series.length>0&&x.push(g.draw(o.series,\"area\",o.i)),h.series.length>0)if(i.config.chart.stacked){var b=new yt(this.ctx,e);x.push(b.draw(h.series,h.i))}else this.ctx.bar=new F(this.ctx,e),x.push(this.ctx.bar.draw(h.series,h.i));if(r.series.length>0&&x.push(g.draw(r.series,\"line\",r.i)),c.series.length>0&&x.push(u.draw(c.series,c.i)),d.series.length>0&&x.push(u.draw(d.series,d.i)),n.series.length>0){var v=new Tt(this.ctx,e,!0);x.push(v.draw(n.series,\"scatter\",n.i))}if(l.series.length>0){var m=new Tt(this.ctx,e,!0);x.push(m.draw(l.series,\"bubble\",l.i))}}else switch(a.chart.type){case\"line\":x=g.draw(s.series,\"line\");break;case\"area\":x=g.draw(s.series,\"area\");break;case\"bar\":if(a.chart.stacked)x=new yt(this.ctx,e).draw(s.series);else this.ctx.bar=new F(this.ctx,e),x=this.ctx.bar.draw(s.series);break;case\"candlestick\":x=new wt(this.ctx,e).draw(s.series);break;case\"boxPlot\":x=new wt(this.ctx,e).draw(s.series);break;case\"rangeBar\":x=this.ctx.rangeBar.draw(s.series);break;case\"heatmap\":x=new At(this.ctx,e).draw(s.series);break;case\"treemap\":x=new Xt(this.ctx,e).draw(s.series);break;case\"pie\":case\"donut\":case\"polarArea\":x=this.ctx.pie.draw(s.series);break;case\"radialBar\":x=f.draw(s.series);break;case\"radar\":x=p.draw(s.series);break;default:x=g.draw(s.series)}return x}},{key:\"setSVGDimensions\",value:function(){var t=this.w.globals,e=this.w.config;t.svgWidth=e.chart.width,t.svgHeight=e.chart.height;var i=x.getDimensions(this.el),a=e.chart.width.toString().split(/[0-9]+/g).pop();\"%\"===a?x.isNumber(i[0])&&(0===i[0].width&&(i=x.getDimensions(this.el.parentNode)),t.svgWidth=i[0]*parseInt(e.chart.width,10)/100):\"px\"!==a&&\"\"!==a||(t.svgWidth=parseInt(e.chart.width,10));var s=e.chart.height.toString().split(/[0-9]+/g).pop();if(\"auto\"!==t.svgHeight&&\"\"!==t.svgHeight)if(\"%\"===s){var r=x.getDimensions(this.el.parentNode);t.svgHeight=r[1]*parseInt(e.chart.height,10)/100}else t.svgHeight=parseInt(e.chart.height,10);else t.axisCharts?t.svgHeight=t.svgWidth/1.61:t.svgHeight=t.svgWidth/1.2;if(t.svgWidth<0&&(t.svgWidth=0),t.svgHeight<0&&(t.svgHeight=0),m.setAttrs(t.dom.Paper.node,{width:t.svgWidth,height:t.svgHeight}),\"%\"!==s){var o=e.chart.sparkline.enabled?0:t.axisCharts?e.chart.parentHeightOffset:0;t.dom.Paper.node.parentNode.parentNode.style.minHeight=t.svgHeight+o+\"px\"}t.dom.elWrap.style.width=t.svgWidth+\"px\",t.dom.elWrap.style.height=t.svgHeight+\"px\"}},{key:\"shiftGraphPosition\",value:function(){var t=this.w.globals,e=t.translateY,i={transform:\"translate(\"+t.translateX+\", \"+e+\")\"};m.setAttrs(t.dom.elGraphical.node,i)}},{key:\"resizeNonAxisCharts\",value:function(){var t=this.w,e=t.globals,i=0,a=t.config.chart.sparkline.enabled?1:15;a+=t.config.grid.padding.bottom,\"top\"!==t.config.legend.position&&\"bottom\"!==t.config.legend.position||!t.config.legend.show||t.config.legend.floating||(i=new ct(this.ctx).legendHelpers.getLegendBBox().clwh+10);var s=t.globals.dom.baseEl.querySelector(\".apexcharts-radialbar, .apexcharts-pie\"),r=2.05*t.globals.radialSize;if(s&&!t.config.chart.sparkline.enabled&&0!==t.config.plotOptions.radialBar.startAngle){var o=x.getBoundingClientRect(s);r=o.bottom;var n=o.bottom-o.top;r=Math.max(2.05*t.globals.radialSize,n)}var l=r+e.translateY+i+a;e.dom.elLegendForeign&&e.dom.elLegendForeign.setAttribute(\"height\",l),t.config.chart.height&&String(t.config.chart.height).indexOf(\"%\")>0||(e.dom.elWrap.style.height=l+\"px\",m.setAttrs(e.dom.Paper.node,{height:l}),e.dom.Paper.node.parentNode.parentNode.style.minHeight=l+\"px\")}},{key:\"coreCalculations\",value:function(){new Z(this.ctx).init()}},{key:\"resetGlobals\",value:function(){var t=this,e=function(){return t.w.config.series.map((function(t){return[]}))},i=new O,a=this.w.globals;i.initGlobalVars(a),a.seriesXvalues=e(),a.seriesYvalues=e()}},{key:\"isMultipleY\",value:function(){if(this.w.config.yaxis.constructor===Array&&this.w.config.yaxis.length>1)return this.w.globals.isMultipleYAxis=!0,!0}},{key:\"xySettings\",value:function(){var t=null,e=this.w;if(e.globals.axisCharts){if(\"back\"===e.config.xaxis.crosshairs.position)new tt(this.ctx).drawXCrosshairs();if(\"back\"===e.config.yaxis[0].crosshairs.position)new tt(this.ctx).drawYCrosshairs();if(\"datetime\"===e.config.xaxis.type&&void 0===e.config.xaxis.labels.formatter){this.ctx.timeScale=new Et(this.ctx);var i=[];isFinite(e.globals.minX)&&isFinite(e.globals.maxX)&&!e.globals.isBarHorizontal?i=this.ctx.timeScale.calculateTimeScaleTicks(e.globals.minX,e.globals.maxX):e.globals.isBarHorizontal&&(i=this.ctx.timeScale.calculateTimeScaleTicks(e.globals.minY,e.globals.maxY)),this.ctx.timeScale.recalcDimensionsBasedOnFormat(i)}t=new y(this.ctx).getCalculatedRatios()}return t}},{key:\"updateSourceChart\",value:function(t){this.ctx.w.globals.selection=void 0,this.ctx.updateHelpers._updateOptions({chart:{selection:{xaxis:{min:t.w.globals.minX,max:t.w.globals.maxX}}}},!1,!1)}},{key:\"setupBrushHandler\",value:function(){var t=this,i=this.w;if(i.config.chart.brush.enabled&&\"function\"!=typeof i.config.chart.events.selection){var a=i.config.chart.brush.targets||[i.config.chart.brush.target];a.forEach((function(e){var i=ApexCharts.getChartByID(e);i.w.globals.brushSource=t.ctx,\"function\"!=typeof i.w.config.chart.events.zoomed&&(i.w.config.chart.events.zoomed=function(){t.updateSourceChart(i)}),\"function\"!=typeof i.w.config.chart.events.scrolled&&(i.w.config.chart.events.scrolled=function(){t.updateSourceChart(i)})})),i.config.chart.events.selection=function(t,s){a.forEach((function(t){var a=ApexCharts.getChartByID(t),r=x.clone(i.config.yaxis);if(i.config.chart.brush.autoScaleYaxis&&1===a.w.globals.series.length){var o=new q(a);r=o.autoScaleY(a,r,s)}var n=a.w.config.yaxis.reduce((function(t,i,s){return[].concat(u(t),[e(e({},a.w.config.yaxis[s]),{},{min:r[0].min,max:r[0].max})])}),[]);a.ctx.updateHelpers._updateOptions({xaxis:{min:s.xaxis.min,max:s.xaxis.max},yaxis:n},!1,!1,!1,!1)}))}}}}]),t}(),Ft=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"_updateOptions\",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new Promise((function(n){var l=[e.ctx];r&&(l=e.ctx.getSyncedCharts()),e.ctx.w.globals.isExecCalled&&(l=[e.ctx],e.ctx.w.globals.isExecCalled=!1),l.forEach((function(r,h){var c=r.w;if(c.globals.shouldAnimate=s,a||(c.globals.resized=!0,c.globals.dataChanged=!0,s&&r.series.getPreviousPaths()),t&&\"object\"===i(t)&&(r.config=new N(t),t=y.extendArrayProps(r.config,t,c),r.w.globals.chartID!==e.ctx.w.globals.chartID&&delete t.series,c.config=x.extend(c.config,t),o&&(c.globals.lastXAxis=t.xaxis?x.clone(t.xaxis):[],c.globals.lastYAxis=t.yaxis?x.clone(t.yaxis):[],c.globals.initialConfig=x.extend({},c.config),c.globals.initialSeries=x.clone(c.config.series),t.series))){for(var d=0;d<c.globals.collapsedSeriesIndices.length;d++){var g=c.config.series[c.globals.collapsedSeriesIndices[d]];c.globals.collapsedSeries[d].data=c.globals.axisCharts?g.data.slice():g}for(var u=0;u<c.globals.ancillaryCollapsedSeriesIndices.length;u++){var f=c.config.series[c.globals.ancillaryCollapsedSeriesIndices[u]];c.globals.ancillaryCollapsedSeries[u].data=c.globals.axisCharts?f.data.slice():f}r.series.emptyCollapsedSeries(c.config.series)}return r.update(t).then((function(){h===l.length-1&&n(r)}))}))}))}},{key:\"_updateSeries\",value:function(t,e){var i=this,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new Promise((function(s){var r,o=i.w;return o.globals.shouldAnimate=e,o.globals.dataChanged=!0,e&&i.ctx.series.getPreviousPaths(),o.globals.axisCharts?(0===(r=t.map((function(t,e){return i._extendSeries(t,e)}))).length&&(r=[{data:[]}]),o.config.series=r):o.config.series=t.slice(),a&&(o.globals.initialSeries=x.clone(o.config.series)),i.ctx.update().then((function(){s(i.ctx)}))}))}},{key:\"_extendSeries\",value:function(t,i){var a=this.w,s=a.config.series[i];return e(e({},a.config.series[i]),{},{name:t.name?t.name:s&&s.name,color:t.color?t.color:s&&s.color,type:t.type?t.type:s&&s.type,data:t.data?t.data:s&&s.data})}},{key:\"toggleDataPointSelection\",value:function(t,e){var i=this.w,a=null,s=\".apexcharts-series[data\\\\:realIndex='\".concat(t,\"']\");return i.globals.axisCharts?a=i.globals.dom.Paper.select(\"\".concat(s,\" path[j='\").concat(e,\"'], \").concat(s,\" circle[j='\").concat(e,\"'], \").concat(s,\" rect[j='\").concat(e,\"']\")).members[0]:void 0===e&&(a=i.globals.dom.Paper.select(\"\".concat(s,\" path[j='\").concat(t,\"']\")).members[0],\"pie\"!==i.config.chart.type&&\"polarArea\"!==i.config.chart.type&&\"donut\"!==i.config.chart.type||this.ctx.pie.pieClicked(t)),a?(new m(this.ctx).pathMouseDown(a,null),a.node?a.node:null):(console.warn(\"toggleDataPointSelection: Element not found\"),null)}},{key:\"forceXAxisUpdate\",value:function(t){var e=this.w;if([\"min\",\"max\"].forEach((function(i){void 0!==t.xaxis[i]&&(e.config.xaxis[i]=t.xaxis[i],e.globals.lastXAxis[i]=t.xaxis[i])})),t.xaxis.categories&&t.xaxis.categories.length&&(e.config.xaxis.categories=t.xaxis.categories),e.config.xaxis.convertedCatToNumeric){var i=new D(t);t=i.convertCatToNumericXaxis(t,this.ctx)}return t}},{key:\"forceYAxisUpdate\",value:function(t){var e=this.w;return e.config.chart.stacked&&\"100%\"===e.config.chart.stackType&&(Array.isArray(t.yaxis)?t.yaxis.forEach((function(e,i){t.yaxis[i].min=0,t.yaxis[i].max=100})):(t.yaxis.min=0,t.yaxis.max=100)),t}},{key:\"revertDefaultAxisMinMax\",value:function(t){var e=this,i=this.w,a=i.globals.lastXAxis,s=i.globals.lastYAxis;t&&t.xaxis&&(a=t.xaxis),t&&t.yaxis&&(s=t.yaxis),i.config.xaxis.min=a.min,i.config.xaxis.max=a.max;var r=function(t){void 0!==s[t]&&(i.config.yaxis[t].min=s[t].min,i.config.yaxis[t].max=s[t].max)};i.config.yaxis.map((function(t,a){i.globals.zoomed||void 0!==s[a]?r(a):void 0!==e.ctx.opts.yaxis[a]&&(t.min=e.ctx.opts.yaxis[a].min,t.max=e.ctx.opts.yaxis[a].max)}))}}]),t}();It=\"undefined\"!=typeof window?window:void 0,zt=function(t,e){var a=(void 0!==this?this:t).SVG=function(t){if(a.supported)return t=new a.Doc(t),a.parser.draw||a.prepare(),t};if(a.ns=\"http://www.w3.org/2000/svg\",a.xmlns=\"http://www.w3.org/2000/xmlns/\",a.xlink=\"http://www.w3.org/1999/xlink\",a.svgjs=\"http://svgjs.dev\",a.supported=!0,!a.supported)return!1;a.did=1e3,a.eid=function(t){return\"Svgjs\"+d(t)+a.did++},a.create=function(t){var i=e.createElementNS(this.ns,t);return i.setAttribute(\"id\",this.eid(t)),i},a.extend=function(){var t,e;e=(t=[].slice.call(arguments)).pop();for(var i=t.length-1;i>=0;i--)if(t[i])for(var s in e)t[i].prototype[s]=e[s];a.Set&&a.Set.inherit&&a.Set.inherit()},a.invent=function(t){var e=\"function\"==typeof t.create?t.create:function(){this.constructor.call(this,a.create(t.create))};return t.inherit&&(e.prototype=new t.inherit),t.extend&&a.extend(e,t.extend),t.construct&&a.extend(t.parent||a.Container,t.construct),e},a.adopt=function(e){return e?e.instance?e.instance:((i=\"svg\"==e.nodeName?e.parentNode instanceof t.SVGElement?new a.Nested:new a.Doc:\"linearGradient\"==e.nodeName?new a.Gradient(\"linear\"):\"radialGradient\"==e.nodeName?new a.Gradient(\"radial\"):a[d(e.nodeName)]?new(a[d(e.nodeName)]):new a.Element(e)).type=e.nodeName,i.node=e,e.instance=i,i instanceof a.Doc&&i.namespace().defs(),i.setData(JSON.parse(e.getAttribute(\"svgjs:data\"))||{}),i):null;var i},a.prepare=function(){var t=e.getElementsByTagName(\"body\")[0],i=(t?new a.Doc(t):a.adopt(e.documentElement).nested()).size(2,0);a.parser={body:t||e.documentElement,draw:i.style(\"opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden\").node,poly:i.polyline().node,path:i.path().node,native:a.create(\"svg\")}},a.parser={native:a.create(\"svg\")},e.addEventListener(\"DOMContentLoaded\",(function(){a.parser.draw||a.prepare()}),!1),a.regex={numberAndUnit:/^([+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i,rgb:/rgb\\((\\d+),(\\d+),(\\d+)\\)/,reference:/#([a-z0-9\\-_]+)/i,transforms:/\\)\\s*,?\\s*/,whitespace:/\\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\\s+)?$/,isNumber:/^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,isPercent:/^-?[\\d\\.]+%$/,isImage:/\\.(jpg|jpeg|png|gif|svg)(\\?[^=]+.*)?/i,delimiter:/[\\s,]+/,hyphen:/([^e])\\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\\d?\\.\\d+(?:e[+-]?\\d+)?)((?:\\.\\d+(?:e[+-]?\\d+)?)+))+/gi,dots:/\\./g},a.utils={map:function(t,e){for(var i=t.length,a=[],s=0;s<i;s++)a.push(e(t[s]));return a},filter:function(t,e){for(var i=t.length,a=[],s=0;s<i;s++)e(t[s])&&a.push(t[s]);return a},filterSVGElements:function(e){return this.filter(e,(function(e){return e instanceof t.SVGElement}))}},a.defaults={attrs:{\"fill-opacity\":1,\"stroke-opacity\":1,\"stroke-width\":0,\"stroke-linejoin\":\"miter\",\"stroke-linecap\":\"butt\",fill:\"#000000\",stroke:\"#000000\",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,\"stop-opacity\":1,\"stop-color\":\"#000000\",\"font-size\":16,\"font-family\":\"Helvetica, Arial, sans-serif\",\"text-anchor\":\"start\"}},a.Color=function(t){var e,s;this.r=0,this.g=0,this.b=0,t&&(\"string\"==typeof t?a.regex.isRgb.test(t)?(e=a.regex.rgb.exec(t.replace(a.regex.whitespace,\"\")),this.r=parseInt(e[1]),this.g=parseInt(e[2]),this.b=parseInt(e[3])):a.regex.isHex.test(t)&&(e=a.regex.hex.exec(4==(s=t).length?[\"#\",s.substring(1,2),s.substring(1,2),s.substring(2,3),s.substring(2,3),s.substring(3,4),s.substring(3,4)].join(\"\"):s),this.r=parseInt(e[1],16),this.g=parseInt(e[2],16),this.b=parseInt(e[3],16)):\"object\"===i(t)&&(this.r=t.r,this.g=t.g,this.b=t.b))},a.extend(a.Color,{toString:function(){return this.toHex()},toHex:function(){return\"#\"+g(this.r)+g(this.g)+g(this.b)},toRgb:function(){return\"rgb(\"+[this.r,this.g,this.b].join()+\")\"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},morph:function(t){return this.destination=new a.Color(t),this},at:function(t){return this.destination?(t=t<0?0:t>1?1:t,new a.Color({r:~~(this.r+(this.destination.r-this.r)*t),g:~~(this.g+(this.destination.g-this.g)*t),b:~~(this.b+(this.destination.b-this.b)*t)})):this}}),a.Color.test=function(t){return t+=\"\",a.regex.isHex.test(t)||a.regex.isRgb.test(t)},a.Color.isRgb=function(t){return t&&\"number\"==typeof t.r&&\"number\"==typeof t.g&&\"number\"==typeof t.b},a.Color.isColor=function(t){return a.Color.isRgb(t)||a.Color.test(t)},a.Array=function(t,e){0==(t=(t||[]).valueOf()).length&&e&&(t=e.valueOf()),this.value=this.parse(t)},a.extend(a.Array,{toString:function(){return this.value.join(\" \")},valueOf:function(){return this.value},parse:function(t){return t=t.valueOf(),Array.isArray(t)?t:this.split(t)}}),a.PointArray=function(t,e){a.Array.call(this,t,e||[[0,0]])},a.PointArray.prototype=new a.Array,a.PointArray.prototype.constructor=a.PointArray;for(var s={M:function(t,e,i){return e.x=i.x=t[0],e.y=i.y=t[1],[\"M\",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],[\"L\",t[0],t[1]]},H:function(t,e){return e.x=t[0],[\"H\",t[0]]},V:function(t,e){return e.y=t[0],[\"V\",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],[\"C\",t[0],t[1],t[2],t[3],t[4],t[5]]},Q:function(t,e){return e.x=t[2],e.y=t[3],[\"Q\",t[0],t[1],t[2],t[3]]},Z:function(t,e,i){return e.x=i.x,e.y=i.y,[\"Z\"]}},r=\"mlhvqtcsaz\".split(\"\"),o=0,n=r.length;o<n;++o)s[r[o]]=function(t){return function(e,i,a){if(\"H\"==t)e[0]=e[0]+i.x;else if(\"V\"==t)e[0]=e[0]+i.y;else if(\"A\"==t)e[5]=e[5]+i.x,e[6]=e[6]+i.y;else for(var r=0,o=e.length;r<o;++r)e[r]=e[r]+(r%2?i.y:i.x);if(s&&\"function\"==typeof s[t])return s[t](e,i,a)}}(r[o].toUpperCase());a.PathArray=function(t,e){a.Array.call(this,t,e||[[\"M\",0,0]])},a.PathArray.prototype=new a.Array,a.PathArray.prototype.constructor=a.PathArray,a.extend(a.PathArray,{toString:function(){return function(t){for(var e=0,i=t.length,a=\"\";e<i;e++)a+=t[e][0],null!=t[e][1]&&(a+=t[e][1],null!=t[e][2]&&(a+=\" \",a+=t[e][2],null!=t[e][3]&&(a+=\" \",a+=t[e][3],a+=\" \",a+=t[e][4],null!=t[e][5]&&(a+=\" \",a+=t[e][5],a+=\" \",a+=t[e][6],null!=t[e][7]&&(a+=\" \",a+=t[e][7])))));return a+\" \"}(this.value)},move:function(t,e){var i=this.bbox();return i.x,i.y,this},at:function(t){if(!this.destination)return this;for(var e=this.value,i=this.destination.value,s=[],r=new a.PathArray,o=0,n=e.length;o<n;o++){s[o]=[e[o][0]];for(var l=1,h=e[o].length;l<h;l++)s[o][l]=e[o][l]+(i[o][l]-e[o][l])*t;\"A\"===s[o][0]&&(s[o][4]=+(0!=s[o][4]),s[o][5]=+(0!=s[o][5]))}return r.value=s,r},parse:function(t){if(t instanceof a.PathArray)return t.valueOf();var e,i={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};t=\"string\"==typeof t?t.replace(a.regex.numbersWithDots,h).replace(a.regex.pathLetters,\" $& \").replace(a.regex.hyphen,\"$1 -\").trim().split(a.regex.delimiter):t.reduce((function(t,e){return[].concat.call(t,e)}),[]);var r=[],o=new a.Point,n=new a.Point,l=0,c=t.length;do{a.regex.isPathLetter.test(t[l])?(e=t[l],++l):\"M\"==e?e=\"L\":\"m\"==e&&(e=\"l\"),r.push(s[e].call(null,t.slice(l,l+=i[e.toUpperCase()]).map(parseFloat),o,n))}while(c>l);return r},bbox:function(){return a.parser.draw||a.prepare(),a.parser.path.setAttribute(\"d\",this.toString()),a.parser.path.getBBox()}}),a.Number=a.invent({create:function(t,e){this.value=0,this.unit=e||\"\",\"number\"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:\"string\"==typeof t?(e=t.match(a.regex.numberAndUnit))&&(this.value=parseFloat(e[1]),\"%\"==e[5]?this.value/=100:\"s\"==e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof a.Number&&(this.value=t.valueOf(),this.unit=t.unit)},extend:{toString:function(){return(\"%\"==this.unit?~~(1e8*this.value)/1e6:\"s\"==this.unit?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(t){return t=new a.Number(t),new a.Number(this+t,this.unit||t.unit)},minus:function(t){return t=new a.Number(t),new a.Number(this-t,this.unit||t.unit)},times:function(t){return t=new a.Number(t),new a.Number(this*t,this.unit||t.unit)},divide:function(t){return t=new a.Number(t),new a.Number(this/t,this.unit||t.unit)},to:function(t){var e=new a.Number(this);return\"string\"==typeof t&&(e.unit=t),e},morph:function(t){return this.destination=new a.Number(t),t.relative&&(this.destination.value+=this.value),this},at:function(t){return this.destination?new a.Number(this.destination).minus(this).times(t).plus(this):this}}}),a.Element=a.invent({create:function(t){this._stroke=a.defaults.attrs.stroke,this._event=null,this.dom={},(this.node=t)&&(this.type=t.nodeName,this.node.instance=this,this._stroke=t.getAttribute(\"stroke\")||this._stroke)},extend:{x:function(t){return this.attr(\"x\",t)},y:function(t){return this.attr(\"y\",t)},cx:function(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)},cy:function(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)},move:function(t,e){return this.x(t).y(e)},center:function(t,e){return this.cx(t).cy(e)},width:function(t){return this.attr(\"width\",t)},height:function(t){return this.attr(\"height\",t)},size:function(t,e){var i=u(this,t,e);return this.width(new a.Number(i.width)).height(new a.Number(i.height))},clone:function(t){this.writeDataToDom();var e=x(this.node.cloneNode(!0));return t?t.add(e):this.after(e),e},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(t){return this.after(t).remove(),t},addTo:function(t){return t.put(this)},putIn:function(t){return t.add(this)},id:function(t){return this.attr(\"id\",t)},show:function(){return this.style(\"display\",\"\")},hide:function(){return this.style(\"display\",\"none\")},visible:function(){return\"none\"!=this.style(\"display\")},toString:function(){return this.attr(\"id\")},classes:function(){var t=this.attr(\"class\");return null==t?[]:t.trim().split(a.regex.delimiter)},hasClass:function(t){return-1!=this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){var e=this.classes();e.push(t),this.attr(\"class\",e.join(\" \"))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr(\"class\",this.classes().filter((function(e){return e!=t})).join(\" \")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)},reference:function(t){return a.get(this.attr(t))},parent:function(e){var i=this;if(!i.node.parentNode)return null;if(i=a.adopt(i.node.parentNode),!e)return i;for(;i&&i.node instanceof t.SVGElement;){if(\"string\"==typeof e?i.matches(e):i instanceof e)return i;if(!i.node.parentNode||\"#document\"==i.node.parentNode.nodeName)return null;i=a.adopt(i.node.parentNode)}},doc:function(){return this instanceof a.Doc?this:this.parent(a.Doc)},parents:function(t){var e=[],i=this;do{if(!(i=i.parent(t))||!i.node)break;e.push(i)}while(i.parent);return e},matches:function(t){return function(t,e){return(t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector).call(t,e)}(this.node,t)},native:function(){return this.node},svg:function(t){var i=e.createElement(\"svg\");if(!(t&&this instanceof a.Parent))return i.appendChild(t=e.createElement(\"svg\")),this.writeDataToDom(),t.appendChild(this.node.cloneNode(!0)),i.innerHTML.replace(/^<svg>/,\"\").replace(/<\\/svg>$/,\"\");i.innerHTML=\"<svg>\"+t.replace(/\\n/,\"\").replace(/<([\\w:-]+)([^<]+?)\\/>/g,\"<$1$2></$1>\")+\"</svg>\";for(var s=0,r=i.firstChild.childNodes.length;s<r;s++)this.node.appendChild(i.firstChild.firstChild);return this},writeDataToDom:function(){return(this.each||this.lines)&&(this.each?this:this.lines()).each((function(){this.writeDataToDom()})),this.node.removeAttribute(\"svgjs:data\"),Object.keys(this.dom).length&&this.node.setAttribute(\"svgjs:data\",JSON.stringify(this.dom)),this},setData:function(t){return this.dom=t,this},is:function(t){return function(t,e){return t instanceof e}(this,t)}}}),a.easing={\"-\":function(t){return t},\"<>\":function(t){return-Math.cos(t*Math.PI)/2+.5},\">\":function(t){return Math.sin(t*Math.PI/2)},\"<\":function(t){return 1-Math.cos(t*Math.PI/2)}},a.morph=function(t){return function(e,i){return new a.MorphObj(e,i).at(t)}},a.Situation=a.invent({create:function(t){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new a.Number(t.duration).valueOf(),this.delay=new a.Number(t.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=t.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),a.FX=a.invent({create:function(t){this._target=t,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(t,e,s){\"object\"===i(t)&&(e=t.ease,s=t.delay,t=t.duration);var r=new a.Situation({duration:t||1e3,delay:s||0,ease:a.easing[e||\"-\"]||e});return this.queue(r),this},target:function(t){return t&&t instanceof a.Element?(this._target=t,this):this._target},timeToAbsPos:function(t){return(t-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(t){return this.situation.duration/this._speed*t+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=t.requestAnimationFrame(function(){this.step()}.bind(this))},stopAnimFrame:function(){t.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(t){return(\"function\"==typeof t||t instanceof a.Situation)&&this.situations.push(t),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof a.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var t,e=this.situation;if(e.init)return this;for(var i in e.animations){t=this.target()[i](),Array.isArray(t)||(t=[t]),Array.isArray(e.animations[i])||(e.animations[i]=[e.animations[i]]);for(var s=t.length;s--;)e.animations[i][s]instanceof a.Number&&(t[s]=new a.Number(t[s])),e.animations[i][s]=t[s].morph(e.animations[i][s])}for(var i in e.attrs)e.attrs[i]=new a.MorphObj(this.target().attr(i),e.attrs[i]);for(var i in e.styles)e.styles[i]=new a.MorphObj(this.target().style(i),e.styles[i]);return e.initialTransformation=this.target().matrixify(),e.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(t,e){var i=this.active;return this.active=!1,e&&this.clearQueue(),t&&this.situation&&(!i&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},after:function(t){var e=this.last();return this.target().on(\"finished.fx\",(function i(a){a.detail.situation==e&&(t.call(this,e),this.off(\"finished.fx\",i))})),this._callStart()},during:function(t){var e=this.last(),i=function(i){i.detail.situation==e&&t.call(this,i.detail.pos,a.morph(i.detail.pos),i.detail.eased,e)};return this.target().off(\"during.fx\",i).on(\"during.fx\",i),this.after((function(){this.off(\"during.fx\",i)})),this._callStart()},afterAll:function(t){var e=function e(i){t.call(this),this.off(\"allfinished.fx\",e)};return this.target().off(\"allfinished.fx\",e).on(\"allfinished.fx\",e),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(t,e,i){return this.last()[i||\"animations\"][t]=e,this._callStart()},step:function(t){var e,i,a;t||(this.absPos=this.timeToAbsPos(+new Date)),!1!==this.situation.loops?(e=Math.max(this.absPos,0),i=Math.floor(e),!0===this.situation.loops||i<this.situation.loops?(this.pos=e-i,a=this.situation.loop,this.situation.loop=i):(this.absPos=this.situation.loops,this.pos=1,a=this.situation.loop-1,this.situation.loop=this.situation.loops),this.situation.reversing&&(this.situation.reversed=this.situation.reversed!=Boolean((this.situation.loop-a)%2))):(this.absPos=Math.min(this.absPos,1),this.pos=this.absPos),this.pos<0&&(this.pos=0),this.situation.reversed&&(this.pos=1-this.pos);var s=this.situation.ease(this.pos);for(var r in this.situation.once)r>this.lastPos&&r<=s&&(this.situation.once[r].call(this.target(),this.pos,s),delete this.situation.once[r]);return this.active&&this.target().fire(\"during\",{pos:this.pos,eased:s,fx:this,situation:this.situation}),this.situation?(this.eachAt(),1==this.pos&&!this.situation.reversed||this.situation.reversed&&0==this.pos?(this.stopAnimFrame(),this.target().fire(\"finished\",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire(\"allfinished\"),this.situations.length||(this.target().off(\".fx\"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=s,this):this},eachAt:function(){var t,e=this,i=this.target(),s=this.situation;for(var r in s.animations)t=[].concat(s.animations[r]).map((function(t){return\"string\"!=typeof t&&t.at?t.at(s.ease(e.pos),e.pos):t})),i[r].apply(i,t);for(var r in s.attrs)t=[r].concat(s.attrs[r]).map((function(t){return\"string\"!=typeof t&&t.at?t.at(s.ease(e.pos),e.pos):t})),i.attr.apply(i,t);for(var r in s.styles)t=[r].concat(s.styles[r]).map((function(t){return\"string\"!=typeof t&&t.at?t.at(s.ease(e.pos),e.pos):t})),i.style.apply(i,t);if(s.transforms.length){t=s.initialTransformation,r=0;for(var o=s.transforms.length;r<o;r++){var n=s.transforms[r];n instanceof a.Matrix?t=n.relative?t.multiply((new a.Matrix).morph(n).at(s.ease(this.pos))):t.morph(n).at(s.ease(this.pos)):(n.relative||n.undo(t.extract()),t=t.multiply(n.at(s.ease(this.pos))))}i.matrix(t)}return this},once:function(t,e,i){var a=this.last();return i||(t=a.ease(t)),a.once[t]=e,this},_callStart:function(){return setTimeout(function(){this.start()}.bind(this),0),this}},parent:a.Element,construct:{animate:function(t,e,i){return(this.fx||(this.fx=new a.FX(this))).animate(t,e,i)},delay:function(t){return(this.fx||(this.fx=new a.FX(this))).delay(t)},stop:function(t,e){return this.fx&&this.fx.stop(t,e),this},finish:function(){return this.fx&&this.fx.finish(),this}}}),a.MorphObj=a.invent({create:function(t,e){return a.Color.isColor(e)?new a.Color(t).morph(e):a.regex.delimiter.test(t)?a.regex.pathLetters.test(t)?new a.PathArray(t).morph(e):new a.Array(t).morph(e):a.regex.numberAndUnit.test(e)?new a.Number(t).morph(e):(this.value=t,void(this.destination=e))},extend:{at:function(t,e){return e<1?this.value:this.destination},valueOf:function(){return this.value}}}),a.extend(a.FX,{attr:function(t,e,a){if(\"object\"===i(t))for(var s in t)this.attr(s,t[s]);else this.add(t,e,\"attrs\");return this},plot:function(t,e,i,a){return 4==arguments.length?this.plot([t,e,i,a]):this.add(\"plot\",new(this.target().morphArray)(t))}}),a.Box=a.invent({create:function(t,e,s,r){if(!(\"object\"!==i(t)||t instanceof a.Element))return a.Box.call(this,null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height);4==arguments.length&&(this.x=t,this.y=e,this.width=s,this.height=r),b(this)}}),a.BBox=a.invent({create:function(t){if(a.Box.apply(this,[].slice.call(arguments)),t instanceof a.Element){var i;try{if(!e.documentElement.contains){for(var s=t.node;s.parentNode;)s=s.parentNode;if(s!=e)throw new Error(\"Element not in the dom\")}i=t.node.getBBox()}catch(e){if(t instanceof a.Shape){a.parser.draw||a.prepare();var r=t.clone(a.parser.draw.instance).show();r&&r.node&&\"function\"==typeof r.node.getBBox&&(i=r.node.getBBox()),r&&\"function\"==typeof r.remove&&r.remove()}else i={x:t.node.clientLeft,y:t.node.clientTop,width:t.node.clientWidth,height:t.node.clientHeight}}a.Box.call(this,i)}},inherit:a.Box,parent:a.Element,construct:{bbox:function(){return new a.BBox(this)}}}),a.BBox.prototype.constructor=a.BBox,a.Matrix=a.invent({create:function(t){var e=p([1,0,0,1,0,0]);t=null===t?e:t instanceof a.Element?t.matrixify():\"string\"==typeof t?p(t.split(a.regex.delimiter).map(parseFloat)):6==arguments.length?p([].slice.call(arguments)):Array.isArray(t)?p(t):t&&\"object\"===i(t)?t:e;for(var s=m.length-1;s>=0;--s)this[m[s]]=null!=t[m[s]]?t[m[s]]:e[m[s]]},extend:{extract:function(){var t=f(this,0,1);f(this,1,0);var e=180/Math.PI*Math.atan2(t.y,t.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(e*Math.PI/180)+this.f*Math.sin(e*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(e*Math.PI/180)+this.e*Math.sin(-e*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),rotation:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new a.Matrix(this)}},clone:function(){return new a.Matrix(this)},morph:function(t){return this.destination=new a.Matrix(t),this},multiply:function(t){return new a.Matrix(this.native().multiply(function(t){return t instanceof a.Matrix||(t=new a.Matrix(t)),t}(t).native()))},inverse:function(){return new a.Matrix(this.native().inverse())},translate:function(t,e){return new a.Matrix(this.native().translate(t||0,e||0))},native:function(){for(var t=a.parser.native.createSVGMatrix(),e=m.length-1;e>=0;e--)t[m[e]]=this[m[e]];return t},toString:function(){return\"matrix(\"+v(this.a)+\",\"+v(this.b)+\",\"+v(this.c)+\",\"+v(this.d)+\",\"+v(this.e)+\",\"+v(this.f)+\")\"}},parent:a.Element,construct:{ctm:function(){return new a.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof a.Nested){var t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new a.Matrix(e)}return new a.Matrix(this.node.getScreenCTM())}}}),a.Point=a.invent({create:function(t,e){var a;a=Array.isArray(t)?{x:t[0],y:t[1]}:\"object\"===i(t)?{x:t.x,y:t.y}:null!=t?{x:t,y:null!=e?e:t}:{x:0,y:0},this.x=a.x,this.y=a.y},extend:{clone:function(){return new a.Point(this)},morph:function(t,e){return this.destination=new a.Point(t,e),this}}}),a.extend(a.Element,{point:function(t,e){return new a.Point(t,e).transform(this.screenCTM().inverse())}}),a.extend(a.Element,{attr:function(t,e,s){if(null==t){for(t={},s=(e=this.node.attributes).length-1;s>=0;s--)t[e[s].nodeName]=a.regex.isNumber.test(e[s].nodeValue)?parseFloat(e[s].nodeValue):e[s].nodeValue;return t}if(\"object\"===i(t))for(var r in t)this.attr(r,t[r]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?a.defaults.attrs[t]:a.regex.isNumber.test(e)?parseFloat(e):e;\"stroke-width\"==t?this.attr(\"stroke\",parseFloat(e)>0?this._stroke:null):\"stroke\"==t&&(this._stroke=e),\"fill\"!=t&&\"stroke\"!=t||(a.regex.isImage.test(e)&&(e=this.doc().defs().image(e,0,0)),e instanceof a.Image&&(e=this.doc().defs().pattern(0,0,(function(){this.add(e)})))),\"number\"==typeof e?e=new a.Number(e):a.Color.isColor(e)?e=new a.Color(e):Array.isArray(e)&&(e=new a.Array(e)),\"leading\"==t?this.leading&&this.leading(e):\"string\"==typeof s?this.node.setAttributeNS(s,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||\"font-size\"!=t&&\"x\"!=t||this.rebuild(t,e)}return this}}),a.extend(a.Element,{transform:function(t,e){var s;return\"object\"!==i(t)?(s=new a.Matrix(this).extract(),\"string\"==typeof t?s[t]:s):(s=new a.Matrix(this),e=!!e||!!t.relative,null!=t.a&&(s=e?s.multiply(new a.Matrix(t)):new a.Matrix(t)),this.attr(\"transform\",s))}}),a.extend(a.Element,{untransform:function(){return this.attr(\"transform\",null)},matrixify:function(){return(this.attr(\"transform\")||\"\").split(a.regex.transforms).slice(0,-1).map((function(t){var e=t.trim().split(\"(\");return[e[0],e[1].split(a.regex.delimiter).map((function(t){return parseFloat(t)}))]})).reduce((function(t,e){return\"matrix\"==e[0]?t.multiply(p(e[1])):t[e[0]].apply(t,e[1])}),new a.Matrix)},toParent:function(t){if(this==t)return this;var e=this.screenCTM(),i=t.screenCTM().inverse();return this.addTo(t).untransform().transform(i.multiply(e)),this},toDoc:function(){return this.toParent(this.doc())}}),a.Transformation=a.invent({create:function(t,e){if(arguments.length>1&&\"boolean\"!=typeof e)return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(t))for(var a=0,s=this.arguments.length;a<s;++a)this[this.arguments[a]]=t[a];else if(t&&\"object\"===i(t))for(a=0,s=this.arguments.length;a<s;++a)this[this.arguments[a]]=t[this.arguments[a]];this.inversed=!1,!0===e&&(this.inversed=!0)}}),a.Translate=a.invent({parent:a.Matrix,inherit:a.Transformation,create:function(t,e){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:[\"transformedX\",\"transformedY\"],method:\"translate\"}}),a.extend(a.Element,{style:function(t,e){if(0==arguments.length)return this.node.style.cssText||\"\";if(arguments.length<2)if(\"object\"===i(t))for(var s in t)this.style(s,t[s]);else{if(!a.regex.isCss.test(t))return this.node.style[c(t)];for(t=t.split(/\\s*;\\s*/).filter((function(t){return!!t})).map((function(t){return t.split(/\\s*:\\s*/)}));e=t.pop();)this.style(e[0],e[1])}else this.node.style[c(t)]=null===e||a.regex.isBlank.test(e)?\"\":e;return this}}),a.Parent=a.invent({create:function(t){this.constructor.call(this,t)},inherit:a.Element,extend:{children:function(){return a.utils.map(a.utils.filterSVGElements(this.node.childNodes),(function(t){return a.adopt(t)}))},add:function(t,e){return null==e?this.node.appendChild(t.node):t.node!=this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this},put:function(t,e){return this.add(t,e),t},has:function(t){return this.index(t)>=0},index:function(t){return[].slice.call(this.node.childNodes).indexOf(t.node)},get:function(t){return a.adopt(this.node.childNodes[t])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(t,e){for(var i=this.children(),s=0,r=i.length;s<r;s++)i[s]instanceof a.Element&&t.apply(i[s],[s,i]),e&&i[s]instanceof a.Container&&i[s].each(t,e);return this},removeElement:function(t){return this.node.removeChild(t.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},defs:function(){return this.doc().defs()}}}),a.extend(a.Parent,{ungroup:function(t,e){return 0===e||this instanceof a.Defs||this.node==a.parser.draw||(t=t||(this instanceof a.Doc?this:this.parent(a.Parent)),e=e||1/0,this.each((function(){return this instanceof a.Defs?this:this instanceof a.Parent?this.ungroup(t,e-1):this.toParent(t)})),this.node.firstChild||this.remove()),this},flatten:function(t,e){return this.ungroup(t,e)}}),a.Container=a.invent({create:function(t){this.constructor.call(this,t)},inherit:a.Parent}),a.ViewBox=a.invent({parent:a.Container,construct:{}}),[\"click\",\"dblclick\",\"mousedown\",\"mouseup\",\"mouseover\",\"mouseout\",\"mousemove\",\"touchstart\",\"touchmove\",\"touchleave\",\"touchend\",\"touchcancel\"].forEach((function(t){a.Element.prototype[t]=function(e){return a.on(this.node,t,e),this}})),a.listeners=[],a.handlerMap=[],a.listenerId=0,a.on=function(t,e,i,s,r){var o=i.bind(s||t.instance||t),n=(a.handlerMap.indexOf(t)+1||a.handlerMap.push(t))-1,l=e.split(\".\")[0],h=e.split(\".\")[1]||\"*\";a.listeners[n]=a.listeners[n]||{},a.listeners[n][l]=a.listeners[n][l]||{},a.listeners[n][l][h]=a.listeners[n][l][h]||{},i._svgjsListenerId||(i._svgjsListenerId=++a.listenerId),a.listeners[n][l][h][i._svgjsListenerId]=o,t.addEventListener(l,o,r||{passive:!0})},a.off=function(t,e,i){var s=a.handlerMap.indexOf(t),r=e&&e.split(\".\")[0],o=e&&e.split(\".\")[1],n=\"\";if(-1!=s)if(i){if(\"function\"==typeof i&&(i=i._svgjsListenerId),!i)return;a.listeners[s][r]&&a.listeners[s][r][o||\"*\"]&&(t.removeEventListener(r,a.listeners[s][r][o||\"*\"][i],!1),delete a.listeners[s][r][o||\"*\"][i])}else if(o&&r){if(a.listeners[s][r]&&a.listeners[s][r][o]){for(var l in a.listeners[s][r][o])a.off(t,[r,o].join(\".\"),l);delete a.listeners[s][r][o]}}else if(o)for(var h in a.listeners[s])for(var n in a.listeners[s][h])o===n&&a.off(t,[h,o].join(\".\"));else if(r){if(a.listeners[s][r]){for(var n in a.listeners[s][r])a.off(t,[r,n].join(\".\"));delete a.listeners[s][r]}}else{for(var h in a.listeners[s])a.off(t,h);delete a.listeners[s],delete a.handlerMap[s]}},a.extend(a.Element,{on:function(t,e,i,s){return a.on(this.node,t,e,i,s),this},off:function(t,e){return a.off(this.node,t,e),this},fire:function(e,i){return e instanceof t.Event?this.node.dispatchEvent(e):this.node.dispatchEvent(e=new a.CustomEvent(e,{detail:i,cancelable:!0})),this._event=e,this},event:function(){return this._event}}),a.Defs=a.invent({create:\"defs\",inherit:a.Container}),a.G=a.invent({create:\"g\",inherit:a.Container,extend:{x:function(t){return null==t?this.transform(\"x\"):this.transform({x:t-this.x()},!0)}},construct:{group:function(){return this.put(new a.G)}}}),a.Doc=a.invent({create:function(t){t&&(\"svg\"==(t=\"string\"==typeof t?e.getElementById(t):t).nodeName?this.constructor.call(this,t):(this.constructor.call(this,a.create(\"svg\")),t.appendChild(this.node),this.size(\"100%\",\"100%\")),this.namespace().defs())},inherit:a.Container,extend:{namespace:function(){return this.attr({xmlns:a.ns,version:\"1.1\"}).attr(\"xmlns:xlink\",a.xlink,a.xmlns).attr(\"xmlns:svgjs\",a.svgjs,a.xmlns)},defs:function(){var t;return this._defs||((t=this.node.getElementsByTagName(\"defs\")[0])?this._defs=a.adopt(t):this._defs=new a.Defs,this.node.appendChild(this._defs.node)),this._defs},parent:function(){return this.node.parentNode&&\"#document\"!=this.node.parentNode.nodeName?this.node.parentNode:null},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,a.parser.draw&&!a.parser.draw.parentNode&&this.node.appendChild(a.parser.draw),this},clone:function(t){this.writeDataToDom();var e=this.node,i=x(e.cloneNode(!0));return t?(t.node||t).appendChild(i.node):e.parentNode.insertBefore(i.node,e.nextSibling),i}}}),a.extend(a.Element,{}),a.Gradient=a.invent({create:function(t){this.constructor.call(this,a.create(t+\"Gradient\")),this.type=t},inherit:a.Container,extend:{at:function(t,e,i){return this.put(new a.Stop).update(t,e,i)},update:function(t){return this.clear(),\"function\"==typeof t&&t.call(this,this),this},fill:function(){return\"url(#\"+this.id()+\")\"},toString:function(){return this.fill()},attr:function(t,e,i){return\"transform\"==t&&(t=\"gradientTransform\"),a.Container.prototype.attr.call(this,t,e,i)}},construct:{gradient:function(t,e){return this.defs().gradient(t,e)}}}),a.extend(a.Gradient,a.FX,{from:function(t,e){return\"radial\"==(this._target||this).type?this.attr({fx:new a.Number(t),fy:new a.Number(e)}):this.attr({x1:new a.Number(t),y1:new a.Number(e)})},to:function(t,e){return\"radial\"==(this._target||this).type?this.attr({cx:new a.Number(t),cy:new a.Number(e)}):this.attr({x2:new a.Number(t),y2:new a.Number(e)})}}),a.extend(a.Defs,{gradient:function(t,e){return this.put(new a.Gradient(t)).update(e)}}),a.Stop=a.invent({create:\"stop\",inherit:a.Element,extend:{update:function(t){return(\"number\"==typeof t||t instanceof a.Number)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr(\"stop-opacity\",t.opacity),null!=t.color&&this.attr(\"stop-color\",t.color),null!=t.offset&&this.attr(\"offset\",new a.Number(t.offset)),this}}}),a.Pattern=a.invent({create:\"pattern\",inherit:a.Container,extend:{fill:function(){return\"url(#\"+this.id()+\")\"},update:function(t){return this.clear(),\"function\"==typeof t&&t.call(this,this),this},toString:function(){return this.fill()},attr:function(t,e,i){return\"transform\"==t&&(t=\"patternTransform\"),a.Container.prototype.attr.call(this,t,e,i)}},construct:{pattern:function(t,e,i){return this.defs().pattern(t,e,i)}}}),a.extend(a.Defs,{pattern:function(t,e,i){return this.put(new a.Pattern).update(i).attr({x:0,y:0,width:t,height:e,patternUnits:\"userSpaceOnUse\"})}}),a.Shape=a.invent({create:function(t){this.constructor.call(this,t)},inherit:a.Element}),a.Symbol=a.invent({create:\"symbol\",inherit:a.Container,construct:{symbol:function(){return this.put(new a.Symbol)}}}),a.Use=a.invent({create:\"use\",inherit:a.Shape,extend:{element:function(t,e){return this.attr(\"href\",(e||\"\")+\"#\"+t,a.xlink)}},construct:{use:function(t,e){return this.put(new a.Use).element(t,e)}}}),a.Rect=a.invent({create:\"rect\",inherit:a.Shape,construct:{rect:function(t,e){return this.put(new a.Rect).size(t,e)}}}),a.Circle=a.invent({create:\"circle\",inherit:a.Shape,construct:{circle:function(t){return this.put(new a.Circle).rx(new a.Number(t).divide(2)).move(0,0)}}}),a.extend(a.Circle,a.FX,{rx:function(t){return this.attr(\"r\",t)},ry:function(t){return this.rx(t)}}),a.Ellipse=a.invent({create:\"ellipse\",inherit:a.Shape,construct:{ellipse:function(t,e){return this.put(new a.Ellipse).size(t,e).move(0,0)}}}),a.extend(a.Ellipse,a.Rect,a.FX,{rx:function(t){return this.attr(\"rx\",t)},ry:function(t){return this.attr(\"ry\",t)}}),a.extend(a.Circle,a.Ellipse,{x:function(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())},y:function(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())},cx:function(t){return null==t?this.attr(\"cx\"):this.attr(\"cx\",t)},cy:function(t){return null==t?this.attr(\"cy\"):this.attr(\"cy\",t)},width:function(t){return null==t?2*this.rx():this.rx(new a.Number(t).divide(2))},height:function(t){return null==t?2*this.ry():this.ry(new a.Number(t).divide(2))},size:function(t,e){var i=u(this,t,e);return this.rx(new a.Number(i.width).divide(2)).ry(new a.Number(i.height).divide(2))}}),a.Line=a.invent({create:\"line\",inherit:a.Shape,extend:{array:function(){return new a.PointArray([[this.attr(\"x1\"),this.attr(\"y1\")],[this.attr(\"x2\"),this.attr(\"y2\")]])},plot:function(t,e,i,s){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:i,y2:s}:new a.PointArray(t).toLine(),this.attr(t))},move:function(t,e){return this.attr(this.array().move(t,e).toLine())},size:function(t,e){var i=u(this,t,e);return this.attr(this.array().size(i.width,i.height).toLine())}},construct:{line:function(t,e,i,s){return a.Line.prototype.plot.apply(this.put(new a.Line),null!=t?[t,e,i,s]:[0,0,0,0])}}}),a.Polyline=a.invent({create:\"polyline\",inherit:a.Shape,construct:{polyline:function(t){return this.put(new a.Polyline).plot(t||new a.PointArray)}}}),a.Polygon=a.invent({create:\"polygon\",inherit:a.Shape,construct:{polygon:function(t){return this.put(new a.Polygon).plot(t||new a.PointArray)}}}),a.extend(a.Polyline,a.Polygon,{array:function(){return this._array||(this._array=new a.PointArray(this.attr(\"points\")))},plot:function(t){return null==t?this.array():this.clear().attr(\"points\",\"string\"==typeof t?t:this._array=new a.PointArray(t))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr(\"points\",this.array().move(t,e))},size:function(t,e){var i=u(this,t,e);return this.attr(\"points\",this.array().size(i.width,i.height))}}),a.extend(a.Line,a.Polyline,a.Polygon,{morphArray:a.PointArray,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){var e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){var e=this.bbox();return null==t?e.height:this.size(e.width,t)}}),a.Path=a.invent({create:\"path\",inherit:a.Shape,extend:{morphArray:a.PathArray,array:function(){return this._array||(this._array=new a.PathArray(this.attr(\"d\")))},plot:function(t){return null==t?this.array():this.clear().attr(\"d\",\"string\"==typeof t?t:this._array=new a.PathArray(t))},clear:function(){return delete this._array,this}},construct:{path:function(t){return this.put(new a.Path).plot(t||new a.PathArray)}}}),a.Image=a.invent({create:\"image\",inherit:a.Shape,extend:{load:function(e){if(!e)return this;var i=this,s=new t.Image;return a.on(s,\"load\",(function(){a.off(s);var t=i.parent(a.Pattern);null!==t&&(0==i.width()&&0==i.height()&&i.size(s.width,s.height),t&&0==t.width()&&0==t.height()&&t.size(i.width(),i.height()),\"function\"==typeof i._loaded&&i._loaded.call(i,{width:s.width,height:s.height,ratio:s.width/s.height,url:e}))})),a.on(s,\"error\",(function(t){a.off(s),\"function\"==typeof i._error&&i._error.call(i,t)})),this.attr(\"href\",s.src=this.src=e,a.xlink)},loaded:function(t){return this._loaded=t,this},error:function(t){return this._error=t,this}},construct:{image:function(t,e,i){return this.put(new a.Image).load(t).size(e||0,i||e||0)}}}),a.Text=a.invent({create:function(){this.constructor.call(this,a.create(\"text\")),this.dom.leading=new a.Number(1.3),this._rebuild=!0,this._build=!1,this.attr(\"font-family\",a.defaults.attrs[\"font-family\"])},inherit:a.Shape,extend:{x:function(t){return null==t?this.attr(\"x\"):this.attr(\"x\",t)},text:function(t){if(void 0===t){t=\"\";for(var e=this.node.childNodes,i=0,s=e.length;i<s;++i)0!=i&&3!=e[i].nodeType&&1==a.adopt(e[i]).dom.newLined&&(t+=\"\\n\"),t+=e[i].textContent;return t}if(this.clear().build(!0),\"function\"==typeof t)t.call(this,this);else{i=0;for(var r=(t=t.split(\"\\n\")).length;i<r;i++)this.tspan(t[i]).newLine()}return this.build(!1).rebuild()},size:function(t){return this.attr(\"font-size\",t).rebuild()},leading:function(t){return null==t?this.dom.leading:(this.dom.leading=new a.Number(t),this.rebuild())},lines:function(){var t=(this.textPath&&this.textPath()||this).node,e=a.utils.map(a.utils.filterSVGElements(t.childNodes),(function(t){return a.adopt(t)}));return new a.Set(e)},rebuild:function(t){if(\"boolean\"==typeof t&&(this._rebuild=t),this._rebuild){var e=this,i=0,s=this.dom.leading*new a.Number(this.attr(\"font-size\"));this.lines().each((function(){this.dom.newLined&&(e.textPath()||this.attr(\"x\",e.attr(\"x\")),\"\\n\"==this.text()?i+=s:(this.attr(\"dy\",s+i),i=0))})),this.fire(\"rebuild\")}return this},build:function(t){return this._build=!!t,this},setData:function(t){return this.dom=t,this.dom.leading=new a.Number(t.leading||1.3),this}},construct:{text:function(t){return this.put(new a.Text).text(t)},plain:function(t){return this.put(new a.Text).plain(t)}}}),a.Tspan=a.invent({create:\"tspan\",inherit:a.Shape,extend:{text:function(t){return null==t?this.node.textContent+(this.dom.newLined?\"\\n\":\"\"):(\"function\"==typeof t?t.call(this,this):this.plain(t),this)},dx:function(t){return this.attr(\"dx\",t)},dy:function(t){return this.attr(\"dy\",t)},newLine:function(){var t=this.parent(a.Text);return this.dom.newLined=!0,this.dy(t.dom.leading*t.attr(\"font-size\")).attr(\"x\",t.x())}}}),a.extend(a.Text,a.Tspan,{plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(e.createTextNode(t)),this},tspan:function(t){var e=(this.textPath&&this.textPath()||this).node,i=new a.Tspan;return!1===this._build&&this.clear(),e.appendChild(i.node),i.text(t)},clear:function(){for(var t=(this.textPath&&this.textPath()||this).node;t.hasChildNodes();)t.removeChild(t.lastChild);return this},length:function(){return this.node.getComputedTextLength()}}),a.TextPath=a.invent({create:\"textPath\",inherit:a.Parent,parent:a.Text,construct:{morphArray:a.PathArray,array:function(){var t=this.track();return t?t.array():null},plot:function(t){var e=this.track(),i=null;return e&&(i=e.plot(t)),null==t?i:this},track:function(){var t=this.textPath();if(t)return t.reference(\"href\")},textPath:function(){if(this.node.firstChild&&\"textPath\"==this.node.firstChild.nodeName)return a.adopt(this.node.firstChild)}}}),a.Nested=a.invent({create:function(){this.constructor.call(this,a.create(\"svg\")),this.style(\"overflow\",\"visible\")},inherit:a.Container,construct:{nested:function(){return this.put(new a.Nested)}}});var l={stroke:[\"color\",\"width\",\"opacity\",\"linecap\",\"linejoin\",\"miterlimit\",\"dasharray\",\"dashoffset\"],fill:[\"color\",\"opacity\",\"rule\"],prefix:function(t,e){return\"color\"==e?t:t+\"-\"+e}};function h(t,e,i,s){return i+s.replace(a.regex.dots,\" .\")}function c(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function d(t){return t.charAt(0).toUpperCase()+t.slice(1)}function g(t){var e=t.toString(16);return 1==e.length?\"0\"+e:e}function u(t,e,i){if(null==e||null==i){var a=t.bbox();null==e?e=a.width/a.height*i:null==i&&(i=a.height/a.width*e)}return{width:e,height:i}}function f(t,e,i){return{x:e*t.a+i*t.c+0,y:e*t.b+i*t.d+0}}function p(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}function x(e){for(var i=e.childNodes.length-1;i>=0;i--)e.childNodes[i]instanceof t.SVGElement&&x(e.childNodes[i]);return a.adopt(e).id(a.eid(e.nodeName))}function b(t){return null==t.x&&(t.x=0,t.y=0,t.width=0,t.height=0),t.w=t.width,t.h=t.height,t.x2=t.x+t.width,t.y2=t.y+t.height,t.cx=t.x+t.width/2,t.cy=t.y+t.height/2,t}function v(t){return Math.abs(t)>1e-37?t:0}[\"fill\",\"stroke\"].forEach((function(t){var e={};e[t]=function(e){if(void 0===e)return this;if(\"string\"==typeof e||a.Color.isRgb(e)||e&&\"function\"==typeof e.fill)this.attr(t,e);else for(var i=l[t].length-1;i>=0;i--)null!=e[l[t][i]]&&this.attr(l.prefix(t,l[t][i]),e[l[t][i]]);return this},a.extend(a.Element,a.FX,e)})),a.extend(a.Element,a.FX,{translate:function(t,e){return this.transform({x:t,y:e})},matrix:function(t){return this.attr(\"transform\",new a.Matrix(6==arguments.length?[].slice.call(arguments):t))},opacity:function(t){return this.attr(\"opacity\",t)},dx:function(t){return this.x(new a.Number(t).plus(this instanceof a.FX?0:this.x()),!0)},dy:function(t){return this.y(new a.Number(t).plus(this instanceof a.FX?0:this.y()),!0)}}),a.extend(a.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(t){return this.node.getPointAtLength(t)}}),a.Set=a.invent({create:function(t){Array.isArray(t)?this.members=t:this.clear()},extend:{add:function(){for(var t=[].slice.call(arguments),e=0,i=t.length;e<i;e++)this.members.push(t[e]);return this},remove:function(t){var e=this.index(t);return e>-1&&this.members.splice(e,1),this},each:function(t){for(var e=0,i=this.members.length;e<i;e++)t.apply(this.members[e],[e,this.members]);return this},clear:function(){return this.members=[],this},length:function(){return this.members.length},has:function(t){return this.index(t)>=0},index:function(t){return this.members.indexOf(t)},get:function(t){return this.members[t]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members}},construct:{set:function(t){return new a.Set(t)}}}),a.FX.Set=a.invent({create:function(t){this.set=t}}),a.Set.inherit=function(){var t=[];for(var e in a.Shape.prototype)\"function\"==typeof a.Shape.prototype[e]&&\"function\"!=typeof a.Set.prototype[e]&&t.push(e);for(var e in t.forEach((function(t){a.Set.prototype[t]=function(){for(var e=0,i=this.members.length;e<i;e++)this.members[e]&&\"function\"==typeof this.members[e][t]&&this.members[e][t].apply(this.members[e],arguments);return\"animate\"==t?this.fx||(this.fx=new a.FX.Set(this)):this}})),t=[],a.FX.prototype)\"function\"==typeof a.FX.prototype[e]&&\"function\"!=typeof a.FX.Set.prototype[e]&&t.push(e);t.forEach((function(t){a.FX.Set.prototype[t]=function(){for(var e=0,i=this.set.members.length;e<i;e++)this.set.members[e].fx[t].apply(this.set.members[e].fx,arguments);return this}}))},a.extend(a.Element,{}),a.extend(a.Element,{remember:function(t,e){if(\"object\"===i(arguments[0]))for(var a in t)this.remember(a,t[a]);else{if(1==arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0==arguments.length)this._memory={};else for(var t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory||(this._memory={})}}),a.get=function(t){var i=e.getElementById(function(t){var e=(t||\"\").toString().match(a.regex.reference);if(e)return e[1]}(t)||t);return a.adopt(i)},a.select=function(t,i){return new a.Set(a.utils.map((i||e).querySelectorAll(t),(function(t){return a.adopt(t)})))},a.extend(a.Parent,{select:function(t){return a.select(t,this.node)}});var m=\"abcdef\".split(\"\");if(\"function\"!=typeof t.CustomEvent){var y=function(t,i){i=i||{bubbles:!1,cancelable:!1,detail:void 0};var a=e.createEvent(\"CustomEvent\");return a.initCustomEvent(t,i.bubbles,i.cancelable,i.detail),a};y.prototype=t.Event.prototype,a.CustomEvent=y}else a.CustomEvent=t.CustomEvent;return a}, true?!(__WEBPACK_AMD_DEFINE_RESULT__ = (function(){return zt(It,It.document)}).call(exports, __webpack_require__, exports, module),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)):0,\n/*! svg.filter.js - v2.0.2 - 2016-02-24\n* https://github.com/wout/svg.filter.js\n* Copyright (c) 2016 Wout Fierens; Licensed MIT */\nfunction(){SVG.Filter=SVG.invent({create:\"filter\",inherit:SVG.Parent,extend:{source:\"SourceGraphic\",sourceAlpha:\"SourceAlpha\",background:\"BackgroundImage\",backgroundAlpha:\"BackgroundAlpha\",fill:\"FillPaint\",stroke:\"StrokePaint\",autoSetIn:!0,put:function(t,e){return this.add(t,e),!t.attr(\"in\")&&this.autoSetIn&&t.attr(\"in\",this.source),t.attr(\"result\")||t.attr(\"result\",t),t},blend:function(t,e,i){return this.put(new SVG.BlendEffect(t,e,i))},colorMatrix:function(t,e){return this.put(new SVG.ColorMatrixEffect(t,e))},convolveMatrix:function(t){return this.put(new SVG.ConvolveMatrixEffect(t))},componentTransfer:function(t){return this.put(new SVG.ComponentTransferEffect(t))},composite:function(t,e,i){return this.put(new SVG.CompositeEffect(t,e,i))},flood:function(t,e){return this.put(new SVG.FloodEffect(t,e))},offset:function(t,e){return this.put(new SVG.OffsetEffect(t,e))},image:function(t){return this.put(new SVG.ImageEffect(t))},merge:function(){var t=[void 0];for(var e in arguments)t.push(arguments[e]);return this.put(new(SVG.MergeEffect.bind.apply(SVG.MergeEffect,t)))},gaussianBlur:function(t,e){return this.put(new SVG.GaussianBlurEffect(t,e))},morphology:function(t,e){return this.put(new SVG.MorphologyEffect(t,e))},diffuseLighting:function(t,e,i){return this.put(new SVG.DiffuseLightingEffect(t,e,i))},displacementMap:function(t,e,i,a,s){return this.put(new SVG.DisplacementMapEffect(t,e,i,a,s))},specularLighting:function(t,e,i,a){return this.put(new SVG.SpecularLightingEffect(t,e,i,a))},tile:function(){return this.put(new SVG.TileEffect)},turbulence:function(t,e,i,a,s){return this.put(new SVG.TurbulenceEffect(t,e,i,a,s))},toString:function(){return\"url(#\"+this.attr(\"id\")+\")\"}}}),SVG.extend(SVG.Defs,{filter:function(t){var e=this.put(new SVG.Filter);return\"function\"==typeof t&&t.call(e,e),e}}),SVG.extend(SVG.Container,{filter:function(t){return this.defs().filter(t)}}),SVG.extend(SVG.Element,SVG.G,SVG.Nested,{filter:function(t){return this.filterer=t instanceof SVG.Element?t:this.doc().filter(t),this.doc()&&this.filterer.doc()!==this.doc()&&this.doc().defs().add(this.filterer),this.attr(\"filter\",this.filterer),this.filterer},unfilter:function(t){return this.filterer&&!0===t&&this.filterer.remove(),delete this.filterer,this.attr(\"filter\",null)}}),SVG.Effect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Element,extend:{in:function(t){return null==t?this.parent()&&this.parent().select('[result=\"'+this.attr(\"in\")+'\"]').get(0)||this.attr(\"in\"):this.attr(\"in\",t)},result:function(t){return null==t?this.attr(\"result\"):this.attr(\"result\",t)},toString:function(){return this.result()}}}),SVG.ParentEffect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Parent,extend:{in:function(t){return null==t?this.parent()&&this.parent().select('[result=\"'+this.attr(\"in\")+'\"]').get(0)||this.attr(\"in\"):this.attr(\"in\",t)},result:function(t){return null==t?this.attr(\"result\"):this.attr(\"result\",t)},toString:function(){return this.result()}}});var t={blend:function(t,e){return this.parent()&&this.parent().blend(this,t,e)},colorMatrix:function(t,e){return this.parent()&&this.parent().colorMatrix(t,e).in(this)},convolveMatrix:function(t){return this.parent()&&this.parent().convolveMatrix(t).in(this)},componentTransfer:function(t){return this.parent()&&this.parent().componentTransfer(t).in(this)},composite:function(t,e){return this.parent()&&this.parent().composite(this,t,e)},flood:function(t,e){return this.parent()&&this.parent().flood(t,e)},offset:function(t,e){return this.parent()&&this.parent().offset(t,e).in(this)},image:function(t){return this.parent()&&this.parent().image(t)},merge:function(){return this.parent()&&this.parent().merge.apply(this.parent(),[this].concat(arguments))},gaussianBlur:function(t,e){return this.parent()&&this.parent().gaussianBlur(t,e).in(this)},morphology:function(t,e){return this.parent()&&this.parent().morphology(t,e).in(this)},diffuseLighting:function(t,e,i){return this.parent()&&this.parent().diffuseLighting(t,e,i).in(this)},displacementMap:function(t,e,i,a){return this.parent()&&this.parent().displacementMap(this,t,e,i,a)},specularLighting:function(t,e,i,a){return this.parent()&&this.parent().specularLighting(t,e,i,a).in(this)},tile:function(){return this.parent()&&this.parent().tile().in(this)},turbulence:function(t,e,i,a,s){return this.parent()&&this.parent().turbulence(t,e,i,a,s).in(this)}};SVG.extend(SVG.Effect,t),SVG.extend(SVG.ParentEffect,t),SVG.ChildEffect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Element,extend:{in:function(t){this.attr(\"in\",t)}}});var e={blend:function(t,e,i){this.attr({in:t,in2:e,mode:i||\"normal\"})},colorMatrix:function(t,e){\"matrix\"==t&&(e=s(e)),this.attr({type:t,values:void 0===e?null:e})},convolveMatrix:function(t){t=s(t),this.attr({order:Math.sqrt(t.split(\" \").length),kernelMatrix:t})},composite:function(t,e,i){this.attr({in:t,in2:e,operator:i})},flood:function(t,e){this.attr(\"flood-color\",t),null!=e&&this.attr(\"flood-opacity\",e)},offset:function(t,e){this.attr({dx:t,dy:e})},image:function(t){this.attr(\"href\",t,SVG.xlink)},displacementMap:function(t,e,i,a,s){this.attr({in:t,in2:e,scale:i,xChannelSelector:a,yChannelSelector:s})},gaussianBlur:function(t,e){null!=t||null!=e?this.attr(\"stdDeviation\",r(Array.prototype.slice.call(arguments))):this.attr(\"stdDeviation\",\"0 0\")},morphology:function(t,e){this.attr({operator:t,radius:e})},tile:function(){},turbulence:function(t,e,i,a,s){this.attr({numOctaves:e,seed:i,stitchTiles:a,baseFrequency:t,type:s})}},i={merge:function(){var t;if(arguments[0]instanceof SVG.Set){var e=this;arguments[0].each((function(t){this instanceof SVG.MergeNode?e.put(this):(this instanceof SVG.Effect||this instanceof SVG.ParentEffect)&&e.put(new SVG.MergeNode(this))}))}else{t=Array.isArray(arguments[0])?arguments[0]:arguments;for(var i=0;i<t.length;i++)t[i]instanceof SVG.MergeNode?this.put(t[i]):this.put(new SVG.MergeNode(t[i]))}},componentTransfer:function(t){if(this.rgb=new SVG.Set,[\"r\",\"g\",\"b\",\"a\"].forEach(function(t){this[t]=new(SVG[\"Func\"+t.toUpperCase()])(\"identity\"),this.rgb.add(this[t]),this.node.appendChild(this[t].node)}.bind(this)),t)for(var e in t.rgb&&([\"r\",\"g\",\"b\"].forEach(function(e){this[e].attr(t.rgb)}.bind(this)),delete t.rgb),t)this[e].attr(t[e])},diffuseLighting:function(t,e,i){this.attr({surfaceScale:t,diffuseConstant:e,kernelUnitLength:i})},specularLighting:function(t,e,i,a){this.attr({surfaceScale:t,diffuseConstant:e,specularExponent:i,kernelUnitLength:a})}},a={distantLight:function(t,e){this.attr({azimuth:t,elevation:e})},pointLight:function(t,e,i){this.attr({x:t,y:e,z:i})},spotLight:function(t,e,i,a,s,r){this.attr({x:t,y:e,z:i,pointsAtX:a,pointsAtY:s,pointsAtZ:r})},mergeNode:function(t){this.attr(\"in\",t)}};function s(t){return Array.isArray(t)&&(t=new SVG.Array(t)),t.toString().replace(/^\\s+/,\"\").replace(/\\s+$/,\"\").replace(/\\s+/g,\" \")}function r(t){if(!Array.isArray(t))return t;for(var e=0,i=t.length,a=[];e<i;e++)a.push(t[e]);return a.join(\" \")}function o(){var t=function(){};for(var e in\"function\"==typeof arguments[arguments.length-1]&&(t=arguments[arguments.length-1],Array.prototype.splice.call(arguments,arguments.length-1,1)),arguments)for(var i in arguments[e])t(arguments[e][i],i,arguments[e])}[\"r\",\"g\",\"b\",\"a\"].forEach((function(t){a[\"Func\"+t.toUpperCase()]=function(t){switch(this.attr(\"type\",t),t){case\"table\":this.attr(\"tableValues\",arguments[1]);break;case\"linear\":this.attr(\"slope\",arguments[1]),this.attr(\"intercept\",arguments[2]);break;case\"gamma\":this.attr(\"amplitude\",arguments[1]),this.attr(\"exponent\",arguments[2]),this.attr(\"offset\",arguments[2])}}})),o(e,(function(t,e){var i=e.charAt(0).toUpperCase()+e.slice(1);SVG[i+\"Effect\"]=SVG.invent({create:function(){this.constructor.call(this,SVG.create(\"fe\"+i)),t.apply(this,arguments),this.result(this.attr(\"id\")+\"Out\")},inherit:SVG.Effect,extend:{}})})),o(i,(function(t,e){var i=e.charAt(0).toUpperCase()+e.slice(1);SVG[i+\"Effect\"]=SVG.invent({create:function(){this.constructor.call(this,SVG.create(\"fe\"+i)),t.apply(this,arguments),this.result(this.attr(\"id\")+\"Out\")},inherit:SVG.ParentEffect,extend:{}})})),o(a,(function(t,e){var i=e.charAt(0).toUpperCase()+e.slice(1);SVG[i]=SVG.invent({create:function(){this.constructor.call(this,SVG.create(\"fe\"+i)),t.apply(this,arguments)},inherit:SVG.ChildEffect,extend:{}})})),SVG.extend(SVG.MergeEffect,{in:function(t){return t instanceof SVG.MergeNode?this.add(t,0):this.add(new SVG.MergeNode(t),0),this}}),SVG.extend(SVG.CompositeEffect,SVG.BlendEffect,SVG.DisplacementMapEffect,{in2:function(t){return null==t?this.parent()&&this.parent().select('[result=\"'+this.attr(\"in2\")+'\"]').get(0)||this.attr(\"in2\"):this.attr(\"in2\",t)}}),SVG.filter={sepiatone:[.343,.669,.119,0,0,.249,.626,.13,0,0,.172,.334,.111,0,0,0,0,0,1,0]}}.call(void 0),function(){function t(t,s,r,o,n,l,h){for(var c=t.slice(s,r||h),d=o.slice(n,l||h),g=0,u={pos:[0,0],start:[0,0]},f={pos:[0,0],start:[0,0]};;){if(c[g]=e.call(u,c[g]),d[g]=e.call(f,d[g]),c[g][0]!=d[g][0]||\"M\"==c[g][0]||\"A\"==c[g][0]&&(c[g][4]!=d[g][4]||c[g][5]!=d[g][5])?(Array.prototype.splice.apply(c,[g,1].concat(a.call(u,c[g]))),Array.prototype.splice.apply(d,[g,1].concat(a.call(f,d[g])))):(c[g]=i.call(u,c[g]),d[g]=i.call(f,d[g])),++g==c.length&&g==d.length)break;g==c.length&&c.push([\"C\",u.pos[0],u.pos[1],u.pos[0],u.pos[1],u.pos[0],u.pos[1]]),g==d.length&&d.push([\"C\",f.pos[0],f.pos[1],f.pos[0],f.pos[1],f.pos[0],f.pos[1]])}return{start:c,dest:d}}function e(t){switch(t[0]){case\"z\":case\"Z\":t[0]=\"L\",t[1]=this.start[0],t[2]=this.start[1];break;case\"H\":t[0]=\"L\",t[2]=this.pos[1];break;case\"V\":t[0]=\"L\",t[2]=t[1],t[1]=this.pos[0];break;case\"T\":t[0]=\"Q\",t[3]=t[1],t[4]=t[2],t[1]=this.reflection[1],t[2]=this.reflection[0];break;case\"S\":t[0]=\"C\",t[6]=t[4],t[5]=t[3],t[4]=t[2],t[3]=t[1],t[2]=this.reflection[1],t[1]=this.reflection[0]}return t}function i(t){var e=t.length;return this.pos=[t[e-2],t[e-1]],-1!=\"SCQT\".indexOf(t[0])&&(this.reflection=[2*this.pos[0]-t[e-4],2*this.pos[1]-t[e-3]]),t}function a(t){var e=[t];switch(t[0]){case\"M\":return this.pos=this.start=[t[1],t[2]],e;case\"L\":t[5]=t[3]=t[1],t[6]=t[4]=t[2],t[1]=this.pos[0],t[2]=this.pos[1];break;case\"Q\":t[6]=t[4],t[5]=t[3],t[4]=1*t[4]/3+2*t[2]/3,t[3]=1*t[3]/3+2*t[1]/3,t[2]=1*this.pos[1]/3+2*t[2]/3,t[1]=1*this.pos[0]/3+2*t[1]/3;break;case\"A\":t=(e=function(t,e){var i,a,s,r,o,n,l,h,c,d,g,u,f,p,x,b,v,m,y,w,k,A,S,C,L,P,M=Math.abs(e[1]),T=Math.abs(e[2]),I=e[3]%360,z=e[4],X=e[5],E=e[6],Y=e[7],F=new SVG.Point(t),R=new SVG.Point(E,Y),H=[];if(0===M||0===T||F.x===R.x&&F.y===R.y)return[[\"C\",F.x,F.y,R.x,R.y,R.x,R.y]];i=new SVG.Point((F.x-R.x)/2,(F.y-R.y)/2).transform((new SVG.Matrix).rotate(I)),(a=i.x*i.x/(M*M)+i.y*i.y/(T*T))>1&&(M*=a=Math.sqrt(a),T*=a);s=(new SVG.Matrix).rotate(I).scale(1/M,1/T).rotate(-I),F=F.transform(s),R=R.transform(s),r=[R.x-F.x,R.y-F.y],n=r[0]*r[0]+r[1]*r[1],o=Math.sqrt(n),r[0]/=o,r[1]/=o,l=n<4?Math.sqrt(1-n/4):0,z===X&&(l*=-1);h=new SVG.Point((R.x+F.x)/2+l*-r[1],(R.y+F.y)/2+l*r[0]),c=new SVG.Point(F.x-h.x,F.y-h.y),d=new SVG.Point(R.x-h.x,R.y-h.y),g=Math.acos(c.x/Math.sqrt(c.x*c.x+c.y*c.y)),c.y<0&&(g*=-1);u=Math.acos(d.x/Math.sqrt(d.x*d.x+d.y*d.y)),d.y<0&&(u*=-1);X&&g>u&&(u+=2*Math.PI);!X&&g<u&&(u-=2*Math.PI);for(p=Math.ceil(2*Math.abs(g-u)/Math.PI),b=[],v=g,f=(u-g)/p,x=4*Math.tan(f/4)/3,k=0;k<=p;k++)y=Math.cos(v),m=Math.sin(v),w=new SVG.Point(h.x+y,h.y+m),b[k]=[new SVG.Point(w.x+x*m,w.y-x*y),w,new SVG.Point(w.x-x*m,w.y+x*y)],v+=f;for(b[0][0]=b[0][1].clone(),b[b.length-1][2]=b[b.length-1][1].clone(),s=(new SVG.Matrix).rotate(I).scale(M,T).rotate(-I),k=0,A=b.length;k<A;k++)b[k][0]=b[k][0].transform(s),b[k][1]=b[k][1].transform(s),b[k][2]=b[k][2].transform(s);for(k=1,A=b.length;k<A;k++)S=(w=b[k-1][2]).x,C=w.y,L=(w=b[k][0]).x,P=w.y,E=(w=b[k][1]).x,Y=w.y,H.push([\"C\",S,C,L,P,E,Y]);return H}(this.pos,t))[0]}return t[0]=\"C\",this.pos=[t[5],t[6]],this.reflection=[2*t[5]-t[3],2*t[6]-t[4]],e}function s(t,e){if(!1===e)return!1;for(var i=e,a=t.length;i<a;++i)if(\"M\"==t[i][0])return i;return!1}SVG.extend(SVG.PathArray,{morph:function(e){for(var i=this.value,a=this.parse(e),r=0,o=0,n=!1,l=!1;!1!==r||!1!==o;){var h;n=s(i,!1!==r&&r+1),l=s(a,!1!==o&&o+1),!1===r&&(r=0==(h=new SVG.PathArray(c.start).bbox()).height||0==h.width?i.push(i[0])-1:i.push([\"M\",h.x+h.width/2,h.y+h.height/2])-1),!1===o&&(o=0==(h=new SVG.PathArray(c.dest).bbox()).height||0==h.width?a.push(a[0])-1:a.push([\"M\",h.x+h.width/2,h.y+h.height/2])-1);var c=t(i,r,n,a,o,l);i=i.slice(0,r).concat(c.start,!1===n?[]:i.slice(n)),a=a.slice(0,o).concat(c.dest,!1===l?[]:a.slice(l)),r=!1!==n&&r+c.start.length,o=!1!==l&&o+c.dest.length}return this.value=i,this.destination=new SVG.PathArray,this.destination.value=a,this}})}(),\n/*! svg.draggable.js - v2.2.2 - 2019-01-08\n* https://github.com/svgdotjs/svg.draggable.js\n* Copyright (c) 2019 Wout Fierens; Licensed MIT */\nfunction(){function t(t){t.remember(\"_draggable\",this),this.el=t}t.prototype.init=function(t,e){var i=this;this.constraint=t,this.value=e,this.el.on(\"mousedown.drag\",(function(t){i.start(t)})),this.el.on(\"touchstart.drag\",(function(t){i.start(t)}))},t.prototype.transformPoint=function(t,e){var i=(t=t||window.event).changedTouches&&t.changedTouches[0]||t;return this.p.x=i.clientX-(e||0),this.p.y=i.clientY,this.p.matrixTransform(this.m)},t.prototype.getBBox=function(){var t=this.el.bbox();return this.el instanceof SVG.Nested&&(t=this.el.rbox()),(this.el instanceof SVG.G||this.el instanceof SVG.Use||this.el instanceof SVG.Nested)&&(t.x=this.el.x(),t.y=this.el.y()),t},t.prototype.start=function(t){if(\"click\"!=t.type&&\"mousedown\"!=t.type&&\"mousemove\"!=t.type||1==(t.which||t.buttons)){var e=this;if(this.el.fire(\"beforedrag\",{event:t,handler:this}),!this.el.event().defaultPrevented){t.preventDefault(),t.stopPropagation(),this.parent=this.parent||this.el.parent(SVG.Nested)||this.el.parent(SVG.Doc),this.p=this.parent.node.createSVGPoint(),this.m=this.el.node.getScreenCTM().inverse();var i,a=this.getBBox();if(this.el instanceof SVG.Text)switch(i=this.el.node.getComputedTextLength(),this.el.attr(\"text-anchor\")){case\"middle\":i/=2;break;case\"start\":i=0}this.startPoints={point:this.transformPoint(t,i),box:a,transform:this.el.transform()},SVG.on(window,\"mousemove.drag\",(function(t){e.drag(t)})),SVG.on(window,\"touchmove.drag\",(function(t){e.drag(t)})),SVG.on(window,\"mouseup.drag\",(function(t){e.end(t)})),SVG.on(window,\"touchend.drag\",(function(t){e.end(t)})),this.el.fire(\"dragstart\",{event:t,p:this.startPoints.point,m:this.m,handler:this})}}},t.prototype.drag=function(t){var e=this.getBBox(),i=this.transformPoint(t),a=this.startPoints.box.x+i.x-this.startPoints.point.x,s=this.startPoints.box.y+i.y-this.startPoints.point.y,r=this.constraint,o=i.x-this.startPoints.point.x,n=i.y-this.startPoints.point.y;if(this.el.fire(\"dragmove\",{event:t,p:i,m:this.m,handler:this}),this.el.event().defaultPrevented)return i;if(\"function\"==typeof r){var l=r.call(this.el,a,s,this.m);\"boolean\"==typeof l&&(l={x:l,y:l}),!0===l.x?this.el.x(a):!1!==l.x&&this.el.x(l.x),!0===l.y?this.el.y(s):!1!==l.y&&this.el.y(l.y)}else\"object\"==typeof r&&(null!=r.minX&&a<r.minX?o=(a=r.minX)-this.startPoints.box.x:null!=r.maxX&&a>r.maxX-e.width&&(o=(a=r.maxX-e.width)-this.startPoints.box.x),null!=r.minY&&s<r.minY?n=(s=r.minY)-this.startPoints.box.y:null!=r.maxY&&s>r.maxY-e.height&&(n=(s=r.maxY-e.height)-this.startPoints.box.y),null!=r.snapToGrid&&(a-=a%r.snapToGrid,s-=s%r.snapToGrid,o-=o%r.snapToGrid,n-=n%r.snapToGrid),this.el instanceof SVG.G?this.el.matrix(this.startPoints.transform).transform({x:o,y:n},!0):this.el.move(a,s));return i},t.prototype.end=function(t){var e=this.drag(t);this.el.fire(\"dragend\",{event:t,p:e,m:this.m,handler:this}),SVG.off(window,\"mousemove.drag\"),SVG.off(window,\"touchmove.drag\"),SVG.off(window,\"mouseup.drag\"),SVG.off(window,\"touchend.drag\")},SVG.extend(SVG.Element,{draggable:function(e,i){\"function\"!=typeof e&&\"object\"!=typeof e||(i=e,e=!0);var a=this.remember(\"_draggable\")||new t(this);return(e=void 0===e||e)?a.init(i||{},e):(this.off(\"mousedown.drag\"),this.off(\"touchstart.drag\")),this}})}.call(void 0),function(){function t(t){this.el=t,t.remember(\"_selectHandler\",this),this.pointSelection={isSelected:!1},this.rectSelection={isSelected:!1},this.pointsList={lt:[0,0],rt:[\"width\",0],rb:[\"width\",\"height\"],lb:[0,\"height\"],t:[\"width\",0],r:[\"width\",\"height\"],b:[\"width\",\"height\"],l:[0,\"height\"]},this.pointCoord=function(t,e,i){var a=\"string\"!=typeof t?t:e[t];return i?a/2:a},this.pointCoords=function(t,e){var i=this.pointsList[t];return{x:this.pointCoord(i[0],e,\"t\"===t||\"b\"===t),y:this.pointCoord(i[1],e,\"r\"===t||\"l\"===t)}}}t.prototype.init=function(t,e){var i=this.el.bbox();this.options={};var a=this.el.selectize.defaults.points;for(var s in this.el.selectize.defaults)this.options[s]=this.el.selectize.defaults[s],void 0!==e[s]&&(this.options[s]=e[s]);var r=[\"points\",\"pointsExclude\"];for(var s in r){var o=this.options[r[s]];\"string\"==typeof o?o=o.length>0?o.split(/\\s*,\\s*/i):[]:\"boolean\"==typeof o&&\"points\"===r[s]&&(o=o?a:[]),this.options[r[s]]=o}this.options.points=[a,this.options.points].reduce((function(t,e){return t.filter((function(t){return e.indexOf(t)>-1}))})),this.options.points=[this.options.points,this.options.pointsExclude].reduce((function(t,e){return t.filter((function(t){return e.indexOf(t)<0}))})),this.parent=this.el.parent(),this.nested=this.nested||this.parent.group(),this.nested.matrix(new SVG.Matrix(this.el).translate(i.x,i.y)),this.options.deepSelect&&-1!==[\"line\",\"polyline\",\"polygon\"].indexOf(this.el.type)?this.selectPoints(t):this.selectRect(t),this.observe(),this.cleanup()},t.prototype.selectPoints=function(t){return this.pointSelection.isSelected=t,this.pointSelection.set||(this.pointSelection.set=this.parent.set(),this.drawPoints()),this},t.prototype.getPointArray=function(){var t=this.el.bbox();return this.el.array().valueOf().map((function(e){return[e[0]-t.x,e[1]-t.y]}))},t.prototype.drawPoints=function(){for(var t=this,e=this.getPointArray(),i=0,a=e.length;i<a;++i){var s=function(e){return function(i){(i=i||window.event).preventDefault?i.preventDefault():i.returnValue=!1,i.stopPropagation();var a=i.pageX||i.touches[0].pageX,s=i.pageY||i.touches[0].pageY;t.el.fire(\"point\",{x:a,y:s,i:e,event:i})}}(i),r=this.drawPoint(e[i][0],e[i][1]).addClass(this.options.classPoints).addClass(this.options.classPoints+\"_point\").on(\"touchstart\",s).on(\"mousedown\",s);this.pointSelection.set.add(r)}},t.prototype.drawPoint=function(t,e){var i=this.options.pointType;switch(i){case\"circle\":return this.drawCircle(t,e);case\"rect\":return this.drawRect(t,e);default:if(\"function\"==typeof i)return i.call(this,t,e);throw new Error(\"Unknown \"+i+\" point type!\")}},t.prototype.drawCircle=function(t,e){return this.nested.circle(this.options.pointSize).center(t,e)},t.prototype.drawRect=function(t,e){return this.nested.rect(this.options.pointSize,this.options.pointSize).center(t,e)},t.prototype.updatePointSelection=function(){var t=this.getPointArray();this.pointSelection.set.each((function(e){this.cx()===t[e][0]&&this.cy()===t[e][1]||this.center(t[e][0],t[e][1])}))},t.prototype.updateRectSelection=function(){var t=this,e=this.el.bbox();if(this.rectSelection.set.get(0).attr({width:e.width,height:e.height}),this.options.points.length&&this.options.points.map((function(i,a){var s=t.pointCoords(i,e);t.rectSelection.set.get(a+1).center(s.x,s.y)})),this.options.rotationPoint){var i=this.rectSelection.set.length();this.rectSelection.set.get(i-1).center(e.width/2,20)}},t.prototype.selectRect=function(t){var e=this,i=this.el.bbox();function a(t){return function(i){(i=i||window.event).preventDefault?i.preventDefault():i.returnValue=!1,i.stopPropagation();var a=i.pageX||i.touches[0].pageX,s=i.pageY||i.touches[0].pageY;e.el.fire(t,{x:a,y:s,event:i})}}if(this.rectSelection.isSelected=t,this.rectSelection.set=this.rectSelection.set||this.parent.set(),this.rectSelection.set.get(0)||this.rectSelection.set.add(this.nested.rect(i.width,i.height).addClass(this.options.classRect)),this.options.points.length&&this.rectSelection.set.length()<2){this.options.points.map((function(t,s){var r=e.pointCoords(t,i),o=e.drawPoint(r.x,r.y).attr(\"class\",e.options.classPoints+\"_\"+t).on(\"mousedown\",a(t)).on(\"touchstart\",a(t));e.rectSelection.set.add(o)})),this.rectSelection.set.each((function(){this.addClass(e.options.classPoints)}))}if(this.options.rotationPoint&&(this.options.points&&!this.rectSelection.set.get(9)||!this.options.points&&!this.rectSelection.set.get(1))){var s=function(t){(t=t||window.event).preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation();var i=t.pageX||t.touches[0].pageX,a=t.pageY||t.touches[0].pageY;e.el.fire(\"rot\",{x:i,y:a,event:t})},r=this.drawPoint(i.width/2,20).attr(\"class\",this.options.classPoints+\"_rot\").on(\"touchstart\",s).on(\"mousedown\",s);this.rectSelection.set.add(r)}},t.prototype.handler=function(){var t=this.el.bbox();this.nested.matrix(new SVG.Matrix(this.el).translate(t.x,t.y)),this.rectSelection.isSelected&&this.updateRectSelection(),this.pointSelection.isSelected&&this.updatePointSelection()},t.prototype.observe=function(){var t=this;if(MutationObserver)if(this.rectSelection.isSelected||this.pointSelection.isSelected)this.observerInst=this.observerInst||new MutationObserver((function(){t.handler()})),this.observerInst.observe(this.el.node,{attributes:!0});else try{this.observerInst.disconnect(),delete this.observerInst}catch(t){}else this.el.off(\"DOMAttrModified.select\"),(this.rectSelection.isSelected||this.pointSelection.isSelected)&&this.el.on(\"DOMAttrModified.select\",(function(){t.handler()}))},t.prototype.cleanup=function(){!this.rectSelection.isSelected&&this.rectSelection.set&&(this.rectSelection.set.each((function(){this.remove()})),this.rectSelection.set.clear(),delete this.rectSelection.set),!this.pointSelection.isSelected&&this.pointSelection.set&&(this.pointSelection.set.each((function(){this.remove()})),this.pointSelection.set.clear(),delete this.pointSelection.set),this.pointSelection.isSelected||this.rectSelection.isSelected||(this.nested.remove(),delete this.nested)},SVG.extend(SVG.Element,{selectize:function(e,i){return\"object\"==typeof e&&(i=e,e=!0),(this.remember(\"_selectHandler\")||new t(this)).init(void 0===e||e,i||{}),this}}),SVG.Element.prototype.selectize.defaults={points:[\"lt\",\"rt\",\"rb\",\"lb\",\"t\",\"r\",\"b\",\"l\"],pointsExclude:[],classRect:\"svg_select_boundingRect\",classPoints:\"svg_select_points\",pointSize:7,rotationPoint:!0,deepSelect:!1,pointType:\"circle\"}}(),function(){(function(){function t(t){t.remember(\"_resizeHandler\",this),this.el=t,this.parameters={},this.lastUpdateCall=null,this.p=t.doc().node.createSVGPoint()}t.prototype.transformPoint=function(t,e,i){return this.p.x=t-(this.offset.x-window.pageXOffset),this.p.y=e-(this.offset.y-window.pageYOffset),this.p.matrixTransform(i||this.m)},t.prototype._extractPosition=function(t){return{x:null!=t.clientX?t.clientX:t.touches[0].clientX,y:null!=t.clientY?t.clientY:t.touches[0].clientY}},t.prototype.init=function(t){var e=this;if(this.stop(),\"stop\"!==t){for(var i in this.options={},this.el.resize.defaults)this.options[i]=this.el.resize.defaults[i],void 0!==t[i]&&(this.options[i]=t[i]);this.el.on(\"lt.resize\",(function(t){e.resize(t||window.event)})),this.el.on(\"rt.resize\",(function(t){e.resize(t||window.event)})),this.el.on(\"rb.resize\",(function(t){e.resize(t||window.event)})),this.el.on(\"lb.resize\",(function(t){e.resize(t||window.event)})),this.el.on(\"t.resize\",(function(t){e.resize(t||window.event)})),this.el.on(\"r.resize\",(function(t){e.resize(t||window.event)})),this.el.on(\"b.resize\",(function(t){e.resize(t||window.event)})),this.el.on(\"l.resize\",(function(t){e.resize(t||window.event)})),this.el.on(\"rot.resize\",(function(t){e.resize(t||window.event)})),this.el.on(\"point.resize\",(function(t){e.resize(t||window.event)})),this.update()}},t.prototype.stop=function(){return this.el.off(\"lt.resize\"),this.el.off(\"rt.resize\"),this.el.off(\"rb.resize\"),this.el.off(\"lb.resize\"),this.el.off(\"t.resize\"),this.el.off(\"r.resize\"),this.el.off(\"b.resize\"),this.el.off(\"l.resize\"),this.el.off(\"rot.resize\"),this.el.off(\"point.resize\"),this},t.prototype.resize=function(t){var e=this;this.m=this.el.node.getScreenCTM().inverse(),this.offset={x:window.pageXOffset,y:window.pageYOffset};var i=this._extractPosition(t.detail.event);if(this.parameters={type:this.el.type,p:this.transformPoint(i.x,i.y),x:t.detail.x,y:t.detail.y,box:this.el.bbox(),rotation:this.el.transform().rotation},\"text\"===this.el.type&&(this.parameters.fontSize=this.el.attr()[\"font-size\"]),void 0!==t.detail.i){var a=this.el.array().valueOf();this.parameters.i=t.detail.i,this.parameters.pointCoords=[a[t.detail.i][0],a[t.detail.i][1]]}switch(t.type){case\"lt\":this.calc=function(t,e){var i=this.snapToGrid(t,e);if(this.parameters.box.width-i[0]>0&&this.parameters.box.height-i[1]>0){if(\"text\"===this.parameters.type)return this.el.move(this.parameters.box.x+i[0],this.parameters.box.y),void this.el.attr(\"font-size\",this.parameters.fontSize-i[0]);i=this.checkAspectRatio(i),this.el.move(this.parameters.box.x+i[0],this.parameters.box.y+i[1]).size(this.parameters.box.width-i[0],this.parameters.box.height-i[1])}};break;case\"rt\":this.calc=function(t,e){var i=this.snapToGrid(t,e,2);if(this.parameters.box.width+i[0]>0&&this.parameters.box.height-i[1]>0){if(\"text\"===this.parameters.type)return this.el.move(this.parameters.box.x-i[0],this.parameters.box.y),void this.el.attr(\"font-size\",this.parameters.fontSize+i[0]);i=this.checkAspectRatio(i,!0),this.el.move(this.parameters.box.x,this.parameters.box.y+i[1]).size(this.parameters.box.width+i[0],this.parameters.box.height-i[1])}};break;case\"rb\":this.calc=function(t,e){var i=this.snapToGrid(t,e,0);if(this.parameters.box.width+i[0]>0&&this.parameters.box.height+i[1]>0){if(\"text\"===this.parameters.type)return this.el.move(this.parameters.box.x-i[0],this.parameters.box.y),void this.el.attr(\"font-size\",this.parameters.fontSize+i[0]);i=this.checkAspectRatio(i),this.el.move(this.parameters.box.x,this.parameters.box.y).size(this.parameters.box.width+i[0],this.parameters.box.height+i[1])}};break;case\"lb\":this.calc=function(t,e){var i=this.snapToGrid(t,e,1);if(this.parameters.box.width-i[0]>0&&this.parameters.box.height+i[1]>0){if(\"text\"===this.parameters.type)return this.el.move(this.parameters.box.x+i[0],this.parameters.box.y),void this.el.attr(\"font-size\",this.parameters.fontSize-i[0]);i=this.checkAspectRatio(i,!0),this.el.move(this.parameters.box.x+i[0],this.parameters.box.y).size(this.parameters.box.width-i[0],this.parameters.box.height+i[1])}};break;case\"t\":this.calc=function(t,e){var i=this.snapToGrid(t,e,2);if(this.parameters.box.height-i[1]>0){if(\"text\"===this.parameters.type)return;this.el.move(this.parameters.box.x,this.parameters.box.y+i[1]).height(this.parameters.box.height-i[1])}};break;case\"r\":this.calc=function(t,e){var i=this.snapToGrid(t,e,0);if(this.parameters.box.width+i[0]>0){if(\"text\"===this.parameters.type)return;this.el.move(this.parameters.box.x,this.parameters.box.y).width(this.parameters.box.width+i[0])}};break;case\"b\":this.calc=function(t,e){var i=this.snapToGrid(t,e,0);if(this.parameters.box.height+i[1]>0){if(\"text\"===this.parameters.type)return;this.el.move(this.parameters.box.x,this.parameters.box.y).height(this.parameters.box.height+i[1])}};break;case\"l\":this.calc=function(t,e){var i=this.snapToGrid(t,e,1);if(this.parameters.box.width-i[0]>0){if(\"text\"===this.parameters.type)return;this.el.move(this.parameters.box.x+i[0],this.parameters.box.y).width(this.parameters.box.width-i[0])}};break;case\"rot\":this.calc=function(t,e){var i=t+this.parameters.p.x,a=e+this.parameters.p.y,s=Math.atan2(this.parameters.p.y-this.parameters.box.y-this.parameters.box.height/2,this.parameters.p.x-this.parameters.box.x-this.parameters.box.width/2),r=Math.atan2(a-this.parameters.box.y-this.parameters.box.height/2,i-this.parameters.box.x-this.parameters.box.width/2),o=this.parameters.rotation+180*(r-s)/Math.PI+this.options.snapToAngle/2;this.el.center(this.parameters.box.cx,this.parameters.box.cy).rotate(o-o%this.options.snapToAngle,this.parameters.box.cx,this.parameters.box.cy)};break;case\"point\":this.calc=function(t,e){var i=this.snapToGrid(t,e,this.parameters.pointCoords[0],this.parameters.pointCoords[1]),a=this.el.array().valueOf();a[this.parameters.i][0]=this.parameters.pointCoords[0]+i[0],a[this.parameters.i][1]=this.parameters.pointCoords[1]+i[1],this.el.plot(a)}}this.el.fire(\"resizestart\",{dx:this.parameters.x,dy:this.parameters.y,event:t}),SVG.on(window,\"touchmove.resize\",(function(t){e.update(t||window.event)})),SVG.on(window,\"touchend.resize\",(function(){e.done()})),SVG.on(window,\"mousemove.resize\",(function(t){e.update(t||window.event)})),SVG.on(window,\"mouseup.resize\",(function(){e.done()}))},t.prototype.update=function(t){if(t){var e=this._extractPosition(t),i=this.transformPoint(e.x,e.y),a=i.x-this.parameters.p.x,s=i.y-this.parameters.p.y;this.lastUpdateCall=[a,s],this.calc(a,s),this.el.fire(\"resizing\",{dx:a,dy:s,event:t})}else this.lastUpdateCall&&this.calc(this.lastUpdateCall[0],this.lastUpdateCall[1])},t.prototype.done=function(){this.lastUpdateCall=null,SVG.off(window,\"mousemove.resize\"),SVG.off(window,\"mouseup.resize\"),SVG.off(window,\"touchmove.resize\"),SVG.off(window,\"touchend.resize\"),this.el.fire(\"resizedone\")},t.prototype.snapToGrid=function(t,e,i,a){var s;return void 0!==a?s=[(i+t)%this.options.snapToGrid,(a+e)%this.options.snapToGrid]:(i=null==i?3:i,s=[(this.parameters.box.x+t+(1&i?0:this.parameters.box.width))%this.options.snapToGrid,(this.parameters.box.y+e+(2&i?0:this.parameters.box.height))%this.options.snapToGrid]),t<0&&(s[0]-=this.options.snapToGrid),e<0&&(s[1]-=this.options.snapToGrid),t-=Math.abs(s[0])<this.options.snapToGrid/2?s[0]:s[0]-(t<0?-this.options.snapToGrid:this.options.snapToGrid),e-=Math.abs(s[1])<this.options.snapToGrid/2?s[1]:s[1]-(e<0?-this.options.snapToGrid:this.options.snapToGrid),this.constraintToBox(t,e,i,a)},t.prototype.constraintToBox=function(t,e,i,a){var s,r,o=this.options.constraint||{};return void 0!==a?(s=i,r=a):(s=this.parameters.box.x+(1&i?0:this.parameters.box.width),r=this.parameters.box.y+(2&i?0:this.parameters.box.height)),void 0!==o.minX&&s+t<o.minX&&(t=o.minX-s),void 0!==o.maxX&&s+t>o.maxX&&(t=o.maxX-s),void 0!==o.minY&&r+e<o.minY&&(e=o.minY-r),void 0!==o.maxY&&r+e>o.maxY&&(e=o.maxY-r),[t,e]},t.prototype.checkAspectRatio=function(t,e){if(!this.options.saveAspectRatio)return t;var i=t.slice(),a=this.parameters.box.width/this.parameters.box.height,s=this.parameters.box.width+t[0],r=this.parameters.box.height-t[1],o=s/r;return o<a?(i[1]=s/a-this.parameters.box.height,e&&(i[1]=-i[1])):o>a&&(i[0]=this.parameters.box.width-r*a,e&&(i[0]=-i[0])),i},SVG.extend(SVG.Element,{resize:function(e){return(this.remember(\"_resizeHandler\")||new t(this)).init(e||{}),this}}),SVG.Element.prototype.resize.defaults={snapToAngle:.1,snapToGrid:1,constraint:{},saveAspectRatio:!1}}).call(this)}(),void 0===window.Apex&&(window.Apex={});var Rt=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"initModules\",value:function(){this.ctx.publicMethods=[\"updateOptions\",\"updateSeries\",\"appendData\",\"appendSeries\",\"toggleSeries\",\"showSeries\",\"hideSeries\",\"setLocale\",\"resetSeries\",\"zoomX\",\"toggleDataPointSelection\",\"dataURI\",\"addXaxisAnnotation\",\"addYaxisAnnotation\",\"addPointAnnotation\",\"clearAnnotations\",\"removeAnnotation\",\"paper\",\"destroy\"],this.ctx.eventList=[\"click\",\"mousedown\",\"mousemove\",\"mouseleave\",\"touchstart\",\"touchmove\",\"touchleave\",\"mouseup\",\"touchend\"],this.ctx.animations=new b(this.ctx),this.ctx.axes=new K(this.ctx),this.ctx.core=new Yt(this.ctx.el,this.ctx),this.ctx.config=new N({}),this.ctx.data=new B(this.ctx),this.ctx.grid=new U(this.ctx),this.ctx.graphics=new m(this.ctx),this.ctx.coreUtils=new y(this.ctx),this.ctx.crosshairs=new tt(this.ctx),this.ctx.events=new J(this.ctx),this.ctx.exports=new j(this.ctx),this.ctx.localization=new Q(this.ctx),this.ctx.options=new L,this.ctx.responsive=new et(this.ctx),this.ctx.series=new E(this.ctx),this.ctx.theme=new it(this.ctx),this.ctx.formatters=new V(this.ctx),this.ctx.titleSubtitle=new at(this.ctx),this.ctx.legend=new ct(this.ctx),this.ctx.toolbar=new dt(this.ctx),this.ctx.dimensions=new lt(this.ctx),this.ctx.updateHelpers=new Ft(this.ctx),this.ctx.zoomPanSelection=new gt(this.ctx),this.ctx.w.globals.tooltip=new mt(this.ctx)}}]),t}(),Ht=function(){function t(e){a(this,t),this.ctx=e,this.w=e.w}return r(t,[{key:\"clear\",value:function(t){var e=t.isUpdating;this.ctx.zoomPanSelection&&this.ctx.zoomPanSelection.destroy(),this.ctx.toolbar&&this.ctx.toolbar.destroy(),this.ctx.animations=null,this.ctx.axes=null,this.ctx.annotations=null,this.ctx.core=null,this.ctx.data=null,this.ctx.grid=null,this.ctx.series=null,this.ctx.responsive=null,this.ctx.theme=null,this.ctx.formatters=null,this.ctx.titleSubtitle=null,this.ctx.legend=null,this.ctx.dimensions=null,this.ctx.options=null,this.ctx.crosshairs=null,this.ctx.zoomPanSelection=null,this.ctx.updateHelpers=null,this.ctx.toolbar=null,this.ctx.localization=null,this.ctx.w.globals.tooltip=null,this.clearDomElements({isUpdating:e})}},{key:\"killSVG\",value:function(t){t.each((function(t,e){this.removeClass(\"*\"),this.off(),this.stop()}),!0),t.ungroup(),t.clear()}},{key:\"clearDomElements\",value:function(t){var e=this,i=t.isUpdating,a=this.w.globals.dom.Paper.node;a.parentNode&&a.parentNode.parentNode&&!i&&(a.parentNode.parentNode.style.minHeight=\"unset\");var s=this.w.globals.dom.baseEl;s&&this.ctx.eventList.forEach((function(t){s.removeEventListener(t,e.ctx.events.documentEvent)}));var r=this.w.globals.dom;if(null!==this.ctx.el)for(;this.ctx.el.firstChild;)this.ctx.el.removeChild(this.ctx.el.firstChild);this.killSVG(r.Paper),r.Paper.remove(),r.elWrap=null,r.elGraphical=null,r.elAnnotations=null,r.elLegendWrap=null,r.baseEl=null,r.elGridRect=null,r.elGridRectMask=null,r.elGridRectMarkerMask=null,r.elForecastMask=null,r.elNonForecastMask=null,r.elDefs=null}}]),t}(),Dt=new WeakMap;var Nt=function(){function t(e,i){a(this,t),this.opts=i,this.ctx=this,this.w=new W(i).init(),this.el=e,this.w.globals.cuid=x.randomId(),this.w.globals.chartID=this.w.config.chart.id?x.escapeString(this.w.config.chart.id):this.w.globals.cuid,new Rt(this).initModules(),this.create=x.bind(this.create,this),this.windowResizeHandler=this._windowResizeHandler.bind(this),this.parentResizeHandler=this._parentResizeCallback.bind(this)}return r(t,[{key:\"render\",value:function(){var t=this;return new Promise((function(e,i){if(null!==t.el){void 0===Apex._chartInstances&&(Apex._chartInstances=[]),t.w.config.chart.id&&Apex._chartInstances.push({id:t.w.globals.chartID,group:t.w.config.chart.group,chart:t}),t.setLocale(t.w.config.chart.defaultLocale);var a=t.w.config.chart.events.beforeMount;if(\"function\"==typeof a&&a(t,t.w),t.events.fireEvent(\"beforeMount\",[t,t.w]),window.addEventListener(\"resize\",t.windowResizeHandler),function(t,e){var i=!1,a=t.getBoundingClientRect();\"none\"!==t.style.display&&0!==a.width||(i=!0);var s=new ResizeObserver((function(a){i&&e.call(t,a),i=!0}));t.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(t.children).forEach((function(t){return s.observe(t)})):s.observe(t),Dt.set(e,s)}(t.el.parentNode,t.parentResizeHandler),!t.css){var s=t.el.getRootNode&&t.el.getRootNode(),r=x.is(\"ShadowRoot\",s),o=t.el.ownerDocument,n=o.getElementById(\"apexcharts-css\");!r&&n||(t.css=document.createElement(\"style\"),t.css.id=\"apexcharts-css\",t.css.textContent='.apexcharts-canvas {\\n  position: relative;\\n  user-select: none;\\n  /* cannot give overflow: hidden as it will crop tooltips which overflow outside chart area */\\n}\\n\\n\\n/* scrollbar is not visible by default for legend, hence forcing the visibility */\\n.apexcharts-canvas ::-webkit-scrollbar {\\n  -webkit-appearance: none;\\n  width: 6px;\\n}\\n\\n.apexcharts-canvas ::-webkit-scrollbar-thumb {\\n  border-radius: 4px;\\n  background-color: rgba(0, 0, 0, .5);\\n  box-shadow: 0 0 1px rgba(255, 255, 255, .5);\\n  -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5);\\n}\\n\\n\\n.apexcharts-inner {\\n  position: relative;\\n}\\n\\n.apexcharts-text tspan {\\n  font-family: inherit;\\n}\\n\\n.legend-mouseover-inactive {\\n  transition: 0.15s ease all;\\n  opacity: 0.20;\\n}\\n\\n.apexcharts-series-collapsed {\\n  opacity: 0;\\n}\\n\\n.apexcharts-tooltip {\\n  border-radius: 5px;\\n  box-shadow: 2px 2px 6px -4px #999;\\n  cursor: default;\\n  font-size: 14px;\\n  left: 62px;\\n  opacity: 0;\\n  pointer-events: none;\\n  position: absolute;\\n  top: 20px;\\n  display: flex;\\n  flex-direction: column;\\n  overflow: hidden;\\n  white-space: nowrap;\\n  z-index: 12;\\n  transition: 0.15s ease all;\\n}\\n\\n.apexcharts-tooltip.apexcharts-active {\\n  opacity: 1;\\n  transition: 0.15s ease all;\\n}\\n\\n.apexcharts-tooltip.apexcharts-theme-light {\\n  border: 1px solid #e3e3e3;\\n  background: rgba(255, 255, 255, 0.96);\\n}\\n\\n.apexcharts-tooltip.apexcharts-theme-dark {\\n  color: #fff;\\n  background: rgba(30, 30, 30, 0.8);\\n}\\n\\n.apexcharts-tooltip * {\\n  font-family: inherit;\\n}\\n\\n\\n.apexcharts-tooltip-title {\\n  padding: 6px;\\n  font-size: 15px;\\n  margin-bottom: 4px;\\n}\\n\\n.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title {\\n  background: #ECEFF1;\\n  border-bottom: 1px solid #ddd;\\n}\\n\\n.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title {\\n  background: rgba(0, 0, 0, 0.7);\\n  border-bottom: 1px solid #333;\\n}\\n\\n.apexcharts-tooltip-text-y-value,\\n.apexcharts-tooltip-text-goals-value,\\n.apexcharts-tooltip-text-z-value {\\n  display: inline-block;\\n  font-weight: 600;\\n  margin-left: 5px;\\n}\\n\\n.apexcharts-tooltip-title:empty,\\n.apexcharts-tooltip-text-y-label:empty,\\n.apexcharts-tooltip-text-y-value:empty,\\n.apexcharts-tooltip-text-goals-label:empty,\\n.apexcharts-tooltip-text-goals-value:empty,\\n.apexcharts-tooltip-text-z-value:empty {\\n  display: none;\\n}\\n\\n.apexcharts-tooltip-text-y-value,\\n.apexcharts-tooltip-text-goals-value,\\n.apexcharts-tooltip-text-z-value {\\n  font-weight: 600;\\n}\\n\\n.apexcharts-tooltip-text-goals-label, \\n.apexcharts-tooltip-text-goals-value {\\n  padding: 6px 0 5px;\\n}\\n\\n.apexcharts-tooltip-goals-group, \\n.apexcharts-tooltip-text-goals-label, \\n.apexcharts-tooltip-text-goals-value {\\n  display: flex;\\n}\\n.apexcharts-tooltip-text-goals-label:not(:empty),\\n.apexcharts-tooltip-text-goals-value:not(:empty) {\\n  margin-top: -6px;\\n}\\n\\n.apexcharts-tooltip-marker {\\n  width: 12px;\\n  height: 12px;\\n  position: relative;\\n  top: 0px;\\n  margin-right: 10px;\\n  border-radius: 50%;\\n}\\n\\n.apexcharts-tooltip-series-group {\\n  padding: 0 10px;\\n  display: none;\\n  text-align: left;\\n  justify-content: left;\\n  align-items: center;\\n}\\n\\n.apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-marker {\\n  opacity: 1;\\n}\\n\\n.apexcharts-tooltip-series-group.apexcharts-active,\\n.apexcharts-tooltip-series-group:last-child {\\n  padding-bottom: 4px;\\n}\\n\\n.apexcharts-tooltip-series-group-hidden {\\n  opacity: 0;\\n  height: 0;\\n  line-height: 0;\\n  padding: 0 !important;\\n}\\n\\n.apexcharts-tooltip-y-group {\\n  padding: 6px 0 5px;\\n}\\n\\n.apexcharts-tooltip-box, .apexcharts-custom-tooltip {\\n  padding: 4px 8px;\\n}\\n\\n.apexcharts-tooltip-boxPlot {\\n  display: flex;\\n  flex-direction: column-reverse;\\n}\\n\\n.apexcharts-tooltip-box>div {\\n  margin: 4px 0;\\n}\\n\\n.apexcharts-tooltip-box span.value {\\n  font-weight: bold;\\n}\\n\\n.apexcharts-tooltip-rangebar {\\n  padding: 5px 8px;\\n}\\n\\n.apexcharts-tooltip-rangebar .category {\\n  font-weight: 600;\\n  color: #777;\\n}\\n\\n.apexcharts-tooltip-rangebar .series-name {\\n  font-weight: bold;\\n  display: block;\\n  margin-bottom: 5px;\\n}\\n\\n.apexcharts-xaxistooltip {\\n  opacity: 0;\\n  padding: 9px 10px;\\n  pointer-events: none;\\n  color: #373d3f;\\n  font-size: 13px;\\n  text-align: center;\\n  border-radius: 2px;\\n  position: absolute;\\n  z-index: 10;\\n  background: #ECEFF1;\\n  border: 1px solid #90A4AE;\\n  transition: 0.15s ease all;\\n}\\n\\n.apexcharts-xaxistooltip.apexcharts-theme-dark {\\n  background: rgba(0, 0, 0, 0.7);\\n  border: 1px solid rgba(0, 0, 0, 0.5);\\n  color: #fff;\\n}\\n\\n.apexcharts-xaxistooltip:after,\\n.apexcharts-xaxistooltip:before {\\n  left: 50%;\\n  border: solid transparent;\\n  content: \" \";\\n  height: 0;\\n  width: 0;\\n  position: absolute;\\n  pointer-events: none;\\n}\\n\\n.apexcharts-xaxistooltip:after {\\n  border-color: rgba(236, 239, 241, 0);\\n  border-width: 6px;\\n  margin-left: -6px;\\n}\\n\\n.apexcharts-xaxistooltip:before {\\n  border-color: rgba(144, 164, 174, 0);\\n  border-width: 7px;\\n  margin-left: -7px;\\n}\\n\\n.apexcharts-xaxistooltip-bottom:after,\\n.apexcharts-xaxistooltip-bottom:before {\\n  bottom: 100%;\\n}\\n\\n.apexcharts-xaxistooltip-top:after,\\n.apexcharts-xaxistooltip-top:before {\\n  top: 100%;\\n}\\n\\n.apexcharts-xaxistooltip-bottom:after {\\n  border-bottom-color: #ECEFF1;\\n}\\n\\n.apexcharts-xaxistooltip-bottom:before {\\n  border-bottom-color: #90A4AE;\\n}\\n\\n.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:after {\\n  border-bottom-color: rgba(0, 0, 0, 0.5);\\n}\\n\\n.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:before {\\n  border-bottom-color: rgba(0, 0, 0, 0.5);\\n}\\n\\n.apexcharts-xaxistooltip-top:after {\\n  border-top-color: #ECEFF1\\n}\\n\\n.apexcharts-xaxistooltip-top:before {\\n  border-top-color: #90A4AE;\\n}\\n\\n.apexcharts-xaxistooltip-top.apexcharts-theme-dark:after {\\n  border-top-color: rgba(0, 0, 0, 0.5);\\n}\\n\\n.apexcharts-xaxistooltip-top.apexcharts-theme-dark:before {\\n  border-top-color: rgba(0, 0, 0, 0.5);\\n}\\n\\n.apexcharts-xaxistooltip.apexcharts-active {\\n  opacity: 1;\\n  transition: 0.15s ease all;\\n}\\n\\n.apexcharts-yaxistooltip {\\n  opacity: 0;\\n  padding: 4px 10px;\\n  pointer-events: none;\\n  color: #373d3f;\\n  font-size: 13px;\\n  text-align: center;\\n  border-radius: 2px;\\n  position: absolute;\\n  z-index: 10;\\n  background: #ECEFF1;\\n  border: 1px solid #90A4AE;\\n}\\n\\n.apexcharts-yaxistooltip.apexcharts-theme-dark {\\n  background: rgba(0, 0, 0, 0.7);\\n  border: 1px solid rgba(0, 0, 0, 0.5);\\n  color: #fff;\\n}\\n\\n.apexcharts-yaxistooltip:after,\\n.apexcharts-yaxistooltip:before {\\n  top: 50%;\\n  border: solid transparent;\\n  content: \" \";\\n  height: 0;\\n  width: 0;\\n  position: absolute;\\n  pointer-events: none;\\n}\\n\\n.apexcharts-yaxistooltip:after {\\n  border-color: rgba(236, 239, 241, 0);\\n  border-width: 6px;\\n  margin-top: -6px;\\n}\\n\\n.apexcharts-yaxistooltip:before {\\n  border-color: rgba(144, 164, 174, 0);\\n  border-width: 7px;\\n  margin-top: -7px;\\n}\\n\\n.apexcharts-yaxistooltip-left:after,\\n.apexcharts-yaxistooltip-left:before {\\n  left: 100%;\\n}\\n\\n.apexcharts-yaxistooltip-right:after,\\n.apexcharts-yaxistooltip-right:before {\\n  right: 100%;\\n}\\n\\n.apexcharts-yaxistooltip-left:after {\\n  border-left-color: #ECEFF1;\\n}\\n\\n.apexcharts-yaxistooltip-left:before {\\n  border-left-color: #90A4AE;\\n}\\n\\n.apexcharts-yaxistooltip-left.apexcharts-theme-dark:after {\\n  border-left-color: rgba(0, 0, 0, 0.5);\\n}\\n\\n.apexcharts-yaxistooltip-left.apexcharts-theme-dark:before {\\n  border-left-color: rgba(0, 0, 0, 0.5);\\n}\\n\\n.apexcharts-yaxistooltip-right:after {\\n  border-right-color: #ECEFF1;\\n}\\n\\n.apexcharts-yaxistooltip-right:before {\\n  border-right-color: #90A4AE;\\n}\\n\\n.apexcharts-yaxistooltip-right.apexcharts-theme-dark:after {\\n  border-right-color: rgba(0, 0, 0, 0.5);\\n}\\n\\n.apexcharts-yaxistooltip-right.apexcharts-theme-dark:before {\\n  border-right-color: rgba(0, 0, 0, 0.5);\\n}\\n\\n.apexcharts-yaxistooltip.apexcharts-active {\\n  opacity: 1;\\n}\\n\\n.apexcharts-yaxistooltip-hidden {\\n  display: none;\\n}\\n\\n.apexcharts-xcrosshairs,\\n.apexcharts-ycrosshairs {\\n  pointer-events: none;\\n  opacity: 0;\\n  transition: 0.15s ease all;\\n}\\n\\n.apexcharts-xcrosshairs.apexcharts-active,\\n.apexcharts-ycrosshairs.apexcharts-active {\\n  opacity: 1;\\n  transition: 0.15s ease all;\\n}\\n\\n.apexcharts-ycrosshairs-hidden {\\n  opacity: 0;\\n}\\n\\n.apexcharts-selection-rect {\\n  cursor: move;\\n}\\n\\n.svg_select_boundingRect, .svg_select_points_rot {\\n  pointer-events: none;\\n  opacity: 0;\\n  visibility: hidden;\\n}\\n.apexcharts-selection-rect + g .svg_select_boundingRect,\\n.apexcharts-selection-rect + g .svg_select_points_rot {\\n  opacity: 0;\\n  visibility: hidden;\\n}\\n\\n.apexcharts-selection-rect + g .svg_select_points_l,\\n.apexcharts-selection-rect + g .svg_select_points_r {\\n  cursor: ew-resize;\\n  opacity: 1;\\n  visibility: visible;\\n}\\n\\n.svg_select_points {\\n  fill: #efefef;\\n  stroke: #333;\\n  rx: 2;\\n}\\n\\n.apexcharts-svg.apexcharts-zoomable.hovering-zoom {\\n  cursor: crosshair\\n}\\n\\n.apexcharts-svg.apexcharts-zoomable.hovering-pan {\\n  cursor: move\\n}\\n\\n.apexcharts-zoom-icon,\\n.apexcharts-zoomin-icon,\\n.apexcharts-zoomout-icon,\\n.apexcharts-reset-icon,\\n.apexcharts-pan-icon,\\n.apexcharts-selection-icon,\\n.apexcharts-menu-icon,\\n.apexcharts-toolbar-custom-icon {\\n  cursor: pointer;\\n  width: 20px;\\n  height: 20px;\\n  line-height: 24px;\\n  color: #6E8192;\\n  text-align: center;\\n}\\n\\n.apexcharts-zoom-icon svg,\\n.apexcharts-zoomin-icon svg,\\n.apexcharts-zoomout-icon svg,\\n.apexcharts-reset-icon svg,\\n.apexcharts-menu-icon svg {\\n  fill: #6E8192;\\n}\\n\\n.apexcharts-selection-icon svg {\\n  fill: #444;\\n  transform: scale(0.76)\\n}\\n\\n.apexcharts-theme-dark .apexcharts-zoom-icon svg,\\n.apexcharts-theme-dark .apexcharts-zoomin-icon svg,\\n.apexcharts-theme-dark .apexcharts-zoomout-icon svg,\\n.apexcharts-theme-dark .apexcharts-reset-icon svg,\\n.apexcharts-theme-dark .apexcharts-pan-icon svg,\\n.apexcharts-theme-dark .apexcharts-selection-icon svg,\\n.apexcharts-theme-dark .apexcharts-menu-icon svg,\\n.apexcharts-theme-dark .apexcharts-toolbar-custom-icon svg {\\n  fill: #f3f4f5;\\n}\\n\\n.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected svg,\\n.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected svg,\\n.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected svg {\\n  fill: #008FFB;\\n}\\n\\n.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover svg,\\n.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover svg,\\n.apexcharts-theme-light .apexcharts-zoomin-icon:hover svg,\\n.apexcharts-theme-light .apexcharts-zoomout-icon:hover svg,\\n.apexcharts-theme-light .apexcharts-reset-icon:hover svg,\\n.apexcharts-theme-light .apexcharts-menu-icon:hover svg {\\n  fill: #333;\\n}\\n\\n.apexcharts-selection-icon,\\n.apexcharts-menu-icon {\\n  position: relative;\\n}\\n\\n.apexcharts-reset-icon {\\n  margin-left: 5px;\\n}\\n\\n.apexcharts-zoom-icon,\\n.apexcharts-reset-icon,\\n.apexcharts-menu-icon {\\n  transform: scale(0.85);\\n}\\n\\n.apexcharts-zoomin-icon,\\n.apexcharts-zoomout-icon {\\n  transform: scale(0.7)\\n}\\n\\n.apexcharts-zoomout-icon {\\n  margin-right: 3px;\\n}\\n\\n.apexcharts-pan-icon {\\n  transform: scale(0.62);\\n  position: relative;\\n  left: 1px;\\n  top: 0px;\\n}\\n\\n.apexcharts-pan-icon svg {\\n  fill: #fff;\\n  stroke: #6E8192;\\n  stroke-width: 2;\\n}\\n\\n.apexcharts-pan-icon.apexcharts-selected svg {\\n  stroke: #008FFB;\\n}\\n\\n.apexcharts-pan-icon:not(.apexcharts-selected):hover svg {\\n  stroke: #333;\\n}\\n\\n.apexcharts-toolbar {\\n  position: absolute;\\n  z-index: 11;\\n  max-width: 176px;\\n  text-align: right;\\n  border-radius: 3px;\\n  padding: 0px 6px 2px 6px;\\n  display: flex;\\n  justify-content: space-between;\\n  align-items: center;\\n}\\n\\n.apexcharts-menu {\\n  background: #fff;\\n  position: absolute;\\n  top: 100%;\\n  border: 1px solid #ddd;\\n  border-radius: 3px;\\n  padding: 3px;\\n  right: 10px;\\n  opacity: 0;\\n  min-width: 110px;\\n  transition: 0.15s ease all;\\n  pointer-events: none;\\n}\\n\\n.apexcharts-menu.apexcharts-menu-open {\\n  opacity: 1;\\n  pointer-events: all;\\n  transition: 0.15s ease all;\\n}\\n\\n.apexcharts-menu-item {\\n  padding: 6px 7px;\\n  font-size: 12px;\\n  cursor: pointer;\\n}\\n\\n.apexcharts-theme-light .apexcharts-menu-item:hover {\\n  background: #eee;\\n}\\n\\n.apexcharts-theme-dark .apexcharts-menu {\\n  background: rgba(0, 0, 0, 0.7);\\n  color: #fff;\\n}\\n\\n@media screen and (min-width: 768px) {\\n  .apexcharts-canvas:hover .apexcharts-toolbar {\\n    opacity: 1;\\n  }\\n}\\n\\n.apexcharts-datalabel.apexcharts-element-hidden {\\n  opacity: 0;\\n}\\n\\n.apexcharts-pie-label,\\n.apexcharts-datalabels,\\n.apexcharts-datalabel,\\n.apexcharts-datalabel-label,\\n.apexcharts-datalabel-value {\\n  cursor: default;\\n  pointer-events: none;\\n}\\n\\n.apexcharts-pie-label-delay {\\n  opacity: 0;\\n  animation-name: opaque;\\n  animation-duration: 0.3s;\\n  animation-fill-mode: forwards;\\n  animation-timing-function: ease;\\n}\\n\\n.apexcharts-canvas .apexcharts-element-hidden {\\n  opacity: 0;\\n}\\n\\n.apexcharts-hide .apexcharts-series-points {\\n  opacity: 0;\\n}\\n\\n.apexcharts-gridline,\\n.apexcharts-annotation-rect,\\n.apexcharts-tooltip .apexcharts-marker,\\n.apexcharts-area-series .apexcharts-area,\\n.apexcharts-line,\\n.apexcharts-zoom-rect,\\n.apexcharts-toolbar svg,\\n.apexcharts-area-series .apexcharts-series-markers .apexcharts-marker.no-pointer-events,\\n.apexcharts-line-series .apexcharts-series-markers .apexcharts-marker.no-pointer-events,\\n.apexcharts-radar-series path,\\n.apexcharts-radar-series polygon {\\n  pointer-events: none;\\n}\\n\\n\\n/* markers */\\n\\n.apexcharts-marker {\\n  transition: 0.15s ease all;\\n}\\n\\n@keyframes opaque {\\n  0% {\\n    opacity: 0;\\n  }\\n  100% {\\n    opacity: 1;\\n  }\\n}\\n\\n\\n/* Resize generated styles */\\n\\n@keyframes resizeanim {\\n  from {\\n    opacity: 0;\\n  }\\n  to {\\n    opacity: 0;\\n  }\\n}\\n\\n.resize-triggers {\\n  animation: 1ms resizeanim;\\n  visibility: hidden;\\n  opacity: 0;\\n}\\n\\n.resize-triggers,\\n.resize-triggers>div,\\n.contract-trigger:before {\\n  content: \" \";\\n  display: block;\\n  position: absolute;\\n  top: 0;\\n  left: 0;\\n  height: 100%;\\n  width: 100%;\\n  overflow: hidden;\\n}\\n\\n.resize-triggers>div {\\n  background: #eee;\\n  overflow: auto;\\n}\\n\\n.contract-trigger:before {\\n  width: 200%;\\n  height: 200%;\\n}',r?s.prepend(t.css):o.head.appendChild(t.css))}var l=t.create(t.w.config.series,{});if(!l)return e(t);t.mount(l).then((function(){\"function\"==typeof t.w.config.chart.events.mounted&&t.w.config.chart.events.mounted(t,t.w),t.events.fireEvent(\"mounted\",[t,t.w]),e(l)})).catch((function(t){i(t)}))}else i(new Error(\"Element not found\"))}))}},{key:\"create\",value:function(t,e){var i=this.w;new Rt(this).initModules();var a=this.w.globals;(a.noData=!1,a.animationEnded=!1,this.responsive.checkResponsiveConfig(e),i.config.xaxis.convertedCatToNumeric)&&new D(i.config).convertCatToNumericXaxis(i.config,this.ctx);if(null===this.el)return a.animationEnded=!0,null;if(this.core.setupElements(),\"treemap\"===i.config.chart.type&&(i.config.grid.show=!1,i.config.yaxis[0].show=!1),0===a.svgWidth)return a.animationEnded=!0,null;var s=y.checkComboSeries(t);a.comboCharts=s.comboCharts,a.comboBarCount=s.comboBarCount;var r=t.every((function(t){return t.data&&0===t.data.length}));(0===t.length||r)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(t),this.theme.init(),new T(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),a.noData&&a.collapsedSeries.length!==a.series.length&&!i.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),a.axisCharts&&(this.core.coreCalculations(),\"category\"!==i.config.xaxis.type&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=i.globals.minX,this.ctx.toolbar.maxX=i.globals.maxX),this.formatters.heatmapLabelFormatters(),new y(this).getLargestMarkerSize(),this.dimensions.plotCoords();var o=this.core.xySettings();this.grid.createGridMask();var n=this.core.plotChartType(t,o),l=new z(this);l.bringForward(),i.config.dataLabels.background.enabled&&l.dataLabelsBackground(),this.core.shiftGraphPosition();var h={plot:{left:i.globals.translateX,top:i.globals.translateY,width:i.globals.gridWidth,height:i.globals.gridHeight}};return{elGraph:n,xyRatios:o,elInner:i.globals.dom.elGraphical,dimensions:h}}},{key:\"mount\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=this,a=i.w;return new Promise((function(s,r){if(null===i.el)return r(new Error(\"Not enough data to display or target element not found\"));(null===e||a.globals.allSeriesCollapsed)&&i.series.handleNoData(),\"treemap\"!==a.config.chart.type&&i.axes.drawAxis(a.config.chart.type,e.xyRatios),i.grid=new U(i);var o=i.grid.drawGrid();i.annotations=new P(i),i.annotations.drawImageAnnos(),i.annotations.drawTextAnnos(),\"back\"===a.config.grid.position&&o&&a.globals.dom.elGraphical.add(o.el);var n=new _(t.ctx),l=new $(t.ctx);if(null!==o&&(n.xAxisLabelCorrections(o.xAxisTickWidth),l.setYAxisTextAlignments(),a.config.yaxis.map((function(t,e){-1===a.globals.ignoreYAxisIndexes.indexOf(e)&&l.yAxisTitleRotate(e,t.opposite)}))),\"back\"===a.config.annotations.position&&(a.globals.dom.Paper.add(a.globals.dom.elAnnotations),i.annotations.drawAxesAnnotations()),Array.isArray(e.elGraph))for(var h=0;h<e.elGraph.length;h++)a.globals.dom.elGraphical.add(e.elGraph[h]);else a.globals.dom.elGraphical.add(e.elGraph);if(\"front\"===a.config.grid.position&&o&&a.globals.dom.elGraphical.add(o.el),\"front\"===a.config.xaxis.crosshairs.position&&i.crosshairs.drawXCrosshairs(),\"front\"===a.config.yaxis[0].crosshairs.position&&i.crosshairs.drawYCrosshairs(),\"front\"===a.config.annotations.position&&(a.globals.dom.Paper.add(a.globals.dom.elAnnotations),i.annotations.drawAxesAnnotations()),!a.globals.noData){if(a.config.tooltip.enabled&&!a.globals.noData&&i.w.globals.tooltip.drawTooltip(e.xyRatios),a.globals.axisCharts&&(a.globals.isXNumeric||a.config.xaxis.convertedCatToNumeric||a.globals.isRangeBar))(a.config.chart.zoom.enabled||a.config.chart.selection&&a.config.chart.selection.enabled||a.config.chart.pan&&a.config.chart.pan.enabled)&&i.zoomPanSelection.init({xyRatios:e.xyRatios});else{var c=a.config.chart.toolbar.tools;[\"zoom\",\"zoomin\",\"zoomout\",\"selection\",\"pan\",\"reset\"].forEach((function(t){c[t]=!1}))}a.config.chart.toolbar.show&&!a.globals.allSeriesCollapsed&&i.toolbar.createToolbar()}a.globals.memory.methodsToExec.length>0&&a.globals.memory.methodsToExec.forEach((function(t){t.method(t.params,!1,t.context)})),a.globals.axisCharts||a.globals.noData||i.core.resizeNonAxisCharts(),s(i)}))}},{key:\"destroy\",value:function(){var t,e;window.removeEventListener(\"resize\",this.windowResizeHandler),this.el.parentNode,t=this.parentResizeHandler,(e=Dt.get(t))&&(e.disconnect(),Dt.delete(t));var i=this.w.config.chart.id;i&&Apex._chartInstances.forEach((function(t,e){t.id===x.escapeString(i)&&Apex._chartInstances.splice(e,1)})),new Ht(this.ctx).clear({isUpdating:!1})}},{key:\"updateOptions\",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=this.w;return o.globals.selection=void 0,t.series&&(this.series.resetSeries(!1,!0,!1),t.series.length&&t.series[0].data&&(t.series=t.series.map((function(t,i){return e.updateHelpers._extendSeries(t,i)}))),this.updateHelpers.revertDefaultAxisMinMax()),t.xaxis&&(t=this.updateHelpers.forceXAxisUpdate(t)),t.yaxis&&(t=this.updateHelpers.forceYAxisUpdate(t)),o.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),t.theme&&(t=this.theme.updateThemeOptions(t)),this.updateHelpers._updateOptions(t,i,a,s,r)}},{key:\"updateSeries\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(t,e,i)}},{key:\"appendSeries\",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=this.w.config.series.slice();return a.push(t),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(a,e,i)}},{key:\"appendData\",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this;i.w.globals.dataChanged=!0,i.series.getPreviousPaths();for(var a=i.w.config.series.slice(),s=0;s<a.length;s++)if(null!==t[s]&&void 0!==t[s])for(var r=0;r<t[s].data.length;r++)a[s].data.push(t[s].data[r]);return i.w.config.series=a,e&&(i.w.globals.initialSeries=x.clone(i.w.config.series)),this.update()}},{key:\"update\",value:function(t){var e=this;return new Promise((function(i,a){new Ht(e.ctx).clear({isUpdating:!0});var s=e.create(e.w.config.series,t);if(!s)return i(e);e.mount(s).then((function(){\"function\"==typeof e.w.config.chart.events.updated&&e.w.config.chart.events.updated(e,e.w),e.events.fireEvent(\"updated\",[e,e.w]),e.w.globals.isDirty=!0,i(e)})).catch((function(t){a(t)}))}))}},{key:\"getSyncedCharts\",value:function(){var t=this.getGroupedCharts(),e=[this];return t.length&&(e=[],t.forEach((function(t){e.push(t)}))),e}},{key:\"getGroupedCharts\",value:function(){var t=this;return Apex._chartInstances.filter((function(t){if(t.group)return!0})).map((function(e){return t.w.config.chart.group===e.group?e.chart:t}))}},{key:\"toggleSeries\",value:function(t){return this.series.toggleSeries(t)}},{key:\"highlightSeriesOnLegendHover\",value:function(t,e){return this.series.toggleSeriesOnHover(t,e)}},{key:\"showSeries\",value:function(t){this.series.showSeries(t)}},{key:\"hideSeries\",value:function(t){this.series.hideSeries(t)}},{key:\"resetSeries\",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.series.resetSeries(t,e)}},{key:\"addEventListener\",value:function(t,e){this.events.addEventListener(t,e)}},{key:\"removeEventListener\",value:function(t,e){this.events.removeEventListener(t,e)}},{key:\"addXaxisAnnotation\",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,a=this;i&&(a=i),a.annotations.addXaxisAnnotationExternal(t,e,a)}},{key:\"addYaxisAnnotation\",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,a=this;i&&(a=i),a.annotations.addYaxisAnnotationExternal(t,e,a)}},{key:\"addPointAnnotation\",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,a=this;i&&(a=i),a.annotations.addPointAnnotationExternal(t,e,a)}},{key:\"clearAnnotations\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=this;t&&(e=t),e.annotations.clearAnnotations(e)}},{key:\"removeAnnotation\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=this;e&&(i=e),i.annotations.removeAnnotation(i,t)}},{key:\"getChartArea\",value:function(){return this.w.globals.dom.baseEl.querySelector(\".apexcharts-inner\")}},{key:\"getSeriesTotalXRange\",value:function(t,e){return this.coreUtils.getSeriesTotalsXRange(t,e)}},{key:\"getHighestValueInSeries\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=new Z(this.ctx);return e.getMinYMaxY(t).highestY}},{key:\"getLowestValueInSeries\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=new Z(this.ctx);return e.getMinYMaxY(t).lowestY}},{key:\"getSeriesTotal\",value:function(){return this.w.globals.seriesTotals}},{key:\"toggleDataPointSelection\",value:function(t,e){return this.updateHelpers.toggleDataPointSelection(t,e)}},{key:\"zoomX\",value:function(t,e){this.ctx.toolbar.zoomUpdateOptions(t,e)}},{key:\"setLocale\",value:function(t){this.localization.setCurrentLocaleValues(t)}},{key:\"dataURI\",value:function(t){return new j(this.ctx).dataURI(t)}},{key:\"paper\",value:function(){return this.w.globals.dom.Paper}},{key:\"_parentResizeCallback\",value:function(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:\"_windowResize\",value:function(){var t=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout((function(){t.w.globals.resized=!0,t.w.globals.dataChanged=!1,t.ctx.update()}),150)}},{key:\"_windowResizeHandler\",value:function(){var t=this.w.config.chart.redrawOnWindowResize;\"function\"==typeof t&&(t=t()),t&&this._windowResize()}}],[{key:\"getChartByID\",value:function(t){var e=x.escapeString(t),i=Apex._chartInstances.filter((function(t){return t.id===e}))[0];return i&&i.chart}},{key:\"initOnLoad\",value:function(){for(var e=document.querySelectorAll(\"[data-apexcharts]\"),i=0;i<e.length;i++){new t(e[i],JSON.parse(e[i].getAttribute(\"data-options\"))).render()}}},{key:\"exec\",value:function(t,e){var i=this.getChartByID(t);if(i){i.w.globals.isExecCalled=!0;var a=null;if(-1!==i.publicMethods.indexOf(e)){for(var s=arguments.length,r=new Array(s>2?s-2:0),o=2;o<s;o++)r[o-2]=arguments[o];a=i[e].apply(i,r)}return a}}},{key:\"merge\",value:function(t,e){return x.extend(t,e)}}]),t}();module.exports=Nt;\n\n\n//# sourceURL=webpack://domino/./node_modules/apexcharts/dist/apexcharts.common.js?");

/***/ }),

/***/ "./src/scripts/appConfig.js":
/*!**********************************!*\
  !*** ./src/scripts/appConfig.js ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _util_clientStorage_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/clientStorage.js */ \"./src/scripts/util/clientStorage.js\");\n/* harmony import */ var _pages_master_viewModel_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pages/master/viewModel.js */ \"./src/scripts/pages/master/viewModel.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var dateHelper = __webpack_require__(/*! ./src/scripts/util/dateHelper.js */ \"./src/scripts/util/dateHelper.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n__webpack_require__(/*! ../styleImport.js */ \"./src/styleImport.js\");\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\n__webpack_require__(/*! ./vendors/bootstrap.js */ \"./src/scripts/vendors/bootstrap.js\");\n\n__webpack_require__(/*! ./vendors/knockout.validation.fa-IR.js */ \"./src/scripts/vendors/knockout.validation.fa-IR.js\");\n\n__webpack_require__(/*! ./util/validationRules.js */ \"./src/scripts/util/validationRules.js\");\n\n__webpack_require__(/*! ./util/bindingHandlers.js */ \"./src/scripts/util/bindingHandlers.js\");\n\n__webpack_require__(/*! ./util/commonResources.js */ \"./src/scripts/util/commonResources.js\");\n\n__webpack_require__(/*! ./util/dateHelper.js */ \"./src/scripts/util/dateHelper.js\");\n\n__webpack_require__(/*! ./components/jqfontselector.js */ \"./src/scripts/components/jqfontselector.js\");\n\n__webpack_require__(/*! ./components/jqrg.js */ \"./src/scripts/components/jqrg.js\");\n\n__webpack_require__(/*! ./components/jqtabletreeview.js */ \"./src/scripts/components/jqtabletreeview.js\");\n\n__webpack_require__(/*! ./components/jqtreeview.js */ \"./src/scripts/components/jqtreeview.js\");\n\n__webpack_require__(/*! ./components/jsRuler.js */ \"./src/scripts/components/jsRuler.js\");\n\n__webpack_require__(/*! ./components/ko-autocomplete.js */ \"./src/scripts/components/ko-autocomplete.js\");\n\n__webpack_require__(/*! ./components/ko-consolidate-select.js */ \"./src/scripts/components/ko-consolidate-select.js\");\n\n__webpack_require__(/*! ./components/ko-datepicker.js */ \"./src/scripts/components/ko-datepicker.js\");\n\n__webpack_require__(/*! ./components/ko-formulamaker.js */ \"./src/scripts/components/ko-formulamaker.js\");\n\n__webpack_require__(/*! ./components/ko-inputautocomplete.js */ \"./src/scripts/components/ko-inputautocomplete.js\");\n\n__webpack_require__(/*! ./components/ko-nodeselect.js */ \"./src/scripts/components/ko-nodeselect.js\");\n\n__webpack_require__(/*! ./components/ko-radio.js */ \"./src/scripts/components/ko-radio.js\");\n\n__webpack_require__(/*! ./components/ko-rg.js */ \"./src/scripts/components/ko-rg.js\");\n\n__webpack_require__(/*! ./components/ko-rgborder.js */ \"./src/scripts/components/ko-rgborder.js\");\n\n__webpack_require__(/*! ./components/ko-select.js */ \"./src/scripts/components/ko-select.js\");\n\n__webpack_require__(/*! ./components/ko-filtercolumn.js */ \"./src/scripts/components/ko-filtercolumn.js\");\n\nwindow._h = _h;\nwindow.dateHelper = dateHelper;\n\n\n\nvar appConfig = function () {\n  var defineParams = function defineParams() {\n    window.clientStorage = new _util_clientStorage_js__WEBPACK_IMPORTED_MODULE_0__.ClientStorage();\n    window.locale = 'fa';\n    window.anyOpenModal = false;\n    window.focusSearchInput = false;\n    window.activeSection = '';\n    window.resDomain = '';\n    window.resSecondDomain = '';\n    window.firstload = true;\n    window.inCTvm = false;\n  };\n\n  var initKnockoutValidation = function initKnockoutValidation(options) {\n    ko.validation.locale('fa-IR');\n    ko.validation.init({\n      grouping: {\n        deep: true,\n        live: true,\n        observable: true\n      }\n    });\n  };\n\n  var initKnockout = function initKnockout() {\n    var item;\n\n    for (var i = 0; i < menus.length; i++) {\n      var page = window.location.pathname.toLowerCase().replace(\"/\", \"\");\n\n      if (page.indexOf(menus[i].enText.toLowerCase()) !== -1) {\n        item = menus[i];\n      }\n    }\n\n    window.resDomain = item[\"default\"];\n    var model = new _pages_master_viewModel_js__WEBPACK_IMPORTED_MODULE_1__.MasterViewModel();\n    model.pageName(item.enText);\n    document.title = \"دومینو | \" + item.text;\n    $(\"#master-page\").attr(\"data-name\", item.enText.toLowerCase());\n    ko.applyBindings(model, document.getElementById(\"ko_wrapper\"));\n    model.init();\n  };\n\n  var initNecessaryModules = function initNecessaryModules() {\n    (function ($) {\n      $.fn.dragPageScroll = function (options) {\n        options || (options = {});\n        var defaults = {\n          topId: 'top_scroll_page',\n          bottomId: 'bottom_scroll_page',\n          delay: 50,\n          height: 80\n        };\n        options = $.extend(defaults, options);\n        var topEl = $('#' + options.topId);\n        if (!topEl.length) topEl = $('<div id=\"top_scroll_page\">&nbsp;</div>').appendTo('body');\n        var bottomEl = $('#' + options.bottomId);\n        if (!bottomEl.length) bottomEl = $('<div id=\"bottom_scroll_page\">&nbsp;</div>').appendTo('body');\n        var bothEl = $('#top_scroll_page, #bottom_scroll_page');\n        bothEl.hide();\n        bothEl.css({\n          position: 'fixed',\n          left: 0,\n          right: 0,\n          height: options.height,\n          zIndex: 999999\n        });\n        topEl.css({\n          top: \"-80px\"\n        });\n        bottomEl.css({\n          bottom: \"-80px\"\n        });\n        var activeDragMode = false;\n        var lastTop;\n        var lastBottom;\n        bothEl.on('dragenter', function (e) {\n          //var direction = ($(this).attr('id') == options.topId) ? 'up' : 'down';\n          activeDragMode = true;\n          return true;\n        });\n        bothEl.on('dragover', function (e) {\n          //if ($('html,body').is(':animated')) return true;\n          var body = document.body,\n              html = document.documentElement;\n          activeDragMode = true;\n          var scrollTop = html.scrollTop || body.scrollTop;\n          var direction = this.id === options.topId ? -1 : 1;\n          var last = direction === -1 ? lastTop : lastBottom;\n          var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n          var current = direction === -1 ? scrollTop : height - (scrollTop + window.innerHeight);\n\n          if (last !== undefined && last === current && current > 0) {\n            var newScrollTop = scrollTop + direction * 40;\n            $('html,body').scrollTop(newScrollTop);\n          }\n\n          if (direction === -1) lastTop = current;else lastBottom = current;\n          return true;\n        });\n\n        var hide = function hide(e) {\n          topEl.css({\n            top: \"-80px\"\n          });\n          bottomEl.css({\n            bottom: \"-80px\"\n          });\n          bothEl.hide(); // timestamp = undefined;\n          // scrolltop = 0;\n          // scrollbottom = 0;\n\n          return true;\n        };\n\n        $(document).on('dragstart', function (e) {\n          bothEl.show();\n          topEl.css({\n            top: 0\n          });\n          bottomEl.css({\n            bottom: 0\n          });\n          activeDragMode = true;\n          return true;\n        });\n        $(document).on('dragend', hide);\n        bothEl.on('mouseover', hide);\n      };\n    })(jQuery);\n\n    $(document).ready(function () {\n      $().dragPageScroll();\n      $(document).on('click', '.searchbox, .searchbox input, .searchbox .selectable, .searchbox label, .searchbox .selectize-control, ' + '.searchbox li, .searchbox button, .col-select input, .col-select label, .col-select .selectize-control, .autocom-input, ' + '.col-select li, .col-select button,.tbl-menu-row-title , .col-select div, .col-select span, .operator-select li,' + '.autocom-li, .autocom-remove, .ncls, .searchbox .selectize-control a, .searchbox .selectize-control .remove, .operator-select div, .operator-select h6', function (event) {\n        event.stopPropagation();\n        var visList = $(\".drp-menu:visible\");\n        var parent = $(event.target).closest(\".drp-menu\");\n\n        if (visList && visList.length > 0 && parent.length === 0 && !$(event.target).is('.ncls, .cal-input, .cal-box, .select-textbox, #tree_view ul, #tree_view li,.dmn-ey,.dmn-dirc,.dmn-ttl,.dmn-p,.dmn-dot,.dmn-fld , .autocom-input ,.autocom-ul, .autocom-li, .autocom-span, .autocom-btn')) {\n          var target = ko.contextFor(visList[0]);\n\n          if (target && target.$data && target.$data[\"showMenu\"]) {\n            target.$data.showMenu(false);\n          }\n\n          if (target && target.$data && target.$data[\"showSelectedItems\"] && !$(event.target).is(\"span.mu-spn, .autocom-remove\")) {\n            target.$data.showSelectedItems(false);\n          }\n        }\n      });\n      $(document).on(\"click\", function (e) {\n        var parent = $(e.target).closest(\".drp-menu\");\n        var visList = $(\".drp-menu:visible\");\n\n        if (visList && visList.length > 0 && !$(e.target).is('.ncls, .cal-input, .cal-box, .select-textbox, #tree_view ul, #tree_view li,.dmn-ey,.dmn-dirc,.dmn-ttl,.dmn-p,.dmn-dot,.dmn-fld , .autocom-input ,.autocom-ul, .autocom-li, .autocom-span, .autocom-btn') && parent.length === 0 && !$(e.target).is(\".tv-multi\")) {\n          var target = ko.contextFor(visList[0]);\n          if (target && target.$data && target.$data[\"showMenu\"]) target.$data.showMenu(false);\n        }\n      });\n      $(document).on('click', '.remove', function (event) {\n        event.stopPropagation();\n      });\n      $(document).on('focusout', '.search-input', function () {\n        window.focusSearchInput = false;\n      });\n      $(document).on('focusin', '.search-input', function () {\n        window.focusSearchInput = true;\n      });\n    });\n    $(window).bind(\"load\", function () {\n      $('.splash').css('display', 'none');\n    });\n    $(window).bind('storage', function (e) {\n      if (e.originalEvent.key === \"token\" && e.originalEvent.newValue === null) _h.backToLogin();\n      if (e.originalEvent.key === \"ProcessToken\" && e.originalEvent.newValue === \"\") _h.kocnx().checkProcessQueue();\n\n      if (e.originalEvent.key === \"ud\") {\n        window.location.reload(false);\n      }\n    });\n    $(window).on(\"beforeunload\", function (e) {\n      var tab = $(\".onClose.active\");\n\n      if (tab.length) {\n        var changed;\n        var tabName = $(tab).attr(\"id\");\n\n        switch (tabName) {\n          case \"tree-t\":\n            changed = $(\".save-tree-act:visible\").length;\n            break;\n\n          case \"tablestructure-t\":\n            changed = true;\n            break;\n\n          case \"magazine-t\":\n            changed = $(\".rich-texteditor:visible\").length;\n            break;\n        }\n\n        if (changed) return 'Are you sure?';\n      }\n    });\n\n    $.fn.hasAnyClass = function () {\n      for (var i = 0; i < arguments.length; i++) {\n        if (this.hasClass(arguments[i])) {\n          return true;\n        }\n      }\n\n      return false;\n    };\n  };\n\n  var menuUrlHandler = function menuUrlHandler() {\n    var path = window.location.pathname.toLowerCase().split(\"?\");\n\n    if (path[0] !== \"\") {\n      var array = path[0].split(\"/\");\n      array = $.grep(array, function (n) {\n        return n !== \"\";\n      });\n\n      if (array.length > 0) {\n        var lis = $(\".menu-bar li\");\n        $.each(lis, function (i, p) {\n          var className = $(p).attr(\"class\").replace(\"menu-item\", \"\").replace(\"-menu\", \"\");\n\n          if (className.indexOf(array[0]) !== -1) {\n            $(p).attr(\"id\", className.trim() + \"-menu\");\n          }\n        });\n      }\n    }\n  };\n\n  var showMvcError = function showMvcError() {\n    switch (window.errorNumber) {\n      case 403:\n        var text = _h.getApiMessage(\"Forbidden\");\n\n        _h.failToast(text);\n\n        window.errorNumber = 403;\n        break;\n\n      case 404:\n        var text = _h.getApiMessage(\"NotFound\");\n\n        _h.failToast(text);\n\n        window.errorNumber = 404;\n        break;\n    }\n  };\n\n  return {\n    init: function init(options) {\n      defineParams();\n      initKnockoutValidation(options);\n      initKnockout(options);\n      initNecessaryModules(options);\n      menuUrlHandler();\n      showMvcError();\n    }\n  };\n}();\n\nappConfig.init();\n\n//# sourceURL=webpack://domino/./src/scripts/appConfig.js?");

/***/ }),

/***/ "./src/scripts/components/jqfontselector.js":
/*!**************************************************!*\
  !*** ./src/scripts/components/jqfontselector.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var _hh = __webpack_require__(/*! ./src/scripts/util/htmlHelper.js */ \"./src/scripts/util/htmlHelper.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n(function ($) {\n  var fsUtil = function () {\n    var build = function build(div, options) {\n      $(div).empty();\n      div = div.get(0);\n\n      var resBox = _hh.createTag({\n        name: \"div\",\n        parent: div,\n        className: \"fnt-select\"\n      });\n\n      var familySpan = _hh.createTag({\n        name: \"span\",\n        className: \"fnt-family\",\n        parent: resBox,\n        onclick: function onclick() {\n          var ul = $(this).parent().parent().find(\".fnt-selectbox\");\n          var val = ul.css(\"display\");\n          if (val === \"none\") ul.css(\"display\", \"block\");else ul.css(\"display\", \"\");\n        }\n      });\n\n      $(familySpan.ownerDocument).on('click', function (event) {\n        if (!$(event.target).hasAnyClass('fnt-select', 'fnt-family', 'fnt-size', 'fnt-ulsize', 'fnt-ulfamily', 'fnt-selectbox', 'fnt-item')) {\n          var magazine = $(\".rich-texteditor\").length > 0;\n\n          if (magazine) {\n            $(\".fnt-selectbox\").css(\"display\", \"\");\n          } else {\n            $(div).trigger('outOfTable', [event.target]);\n          }\n        }\n      });\n\n      _hh.createTag({\n        name: \"span\",\n        className: \"fnt-size\",\n        parent: resBox,\n        onclick: function onclick() {\n          var ul = $(this).parent().parent().find(\".fnt-selectbox\");\n          var val = ul.css(\"display\");\n          if (val === \"none\") ul.css(\"display\", \"block\");else ul.css(\"display\", \"\");\n        }\n      });\n\n      var selectListBox = _hh.createTag({\n        name: \"div\",\n        className: \"fnt-selectbox\",\n        parent: div\n      });\n\n      var ulFamily = _hh.createTag({\n        name: \"ul\",\n        className: \"fnt-ulfamily\",\n        parent: selectListBox\n      });\n\n      var ulSize = _hh.createTag({\n        name: \"ul\",\n        className: \"fnt-ulsize\",\n        parent: selectListBox\n      });\n\n      for (var i = 0; i < fontFamilies.length; i++) {\n        _hh.createTag({\n          name: \"li\",\n          text: fontFamilies[i].text,\n          className: \"fnt-item\" + fontFamilies[i].value === options.textFontFamily ? \" fnt-selected\" : \"\",\n          attributes: {\n            \"data-value\": fontFamilies[i].value\n          },\n          parent: ulFamily,\n          onclick: function onclick() {\n            var parent = $(this).closest(\".fnt-selector\");\n            var data = {\n              textFontFamily: this.getAttribute(\"data-value\"),\n              textFontSize: parent.find(\".fnt-ulsize .fnt-selected\").attr(\"data-value\")\n            };\n            setValue(parent.get(0), data);\n\n            if (!options.magazine) {\n              if ($(this).hasClass(\"fnt-selected\")) parent.trigger('selectionchange', [{\n                type: \"textFontFamily\",\n                value: $(this).attr(\"data-value\")\n              }]);else parent.trigger('selectionchange', [{\n                type: \"textFontFamily\",\n                value: undefined\n              }]);\n            } else {\n              _h.kocnx().mgvm().designSelectedModel().toggleCommand(null, \"fontName\", $(this).attr(\"data-value\"));\n            }\n          }\n        });\n      }\n\n      for (var i = 0; i < fontSizes.length; i++) {\n        _hh.createTag({\n          name: \"li\",\n          text: fontSizes[i].text,\n          className: \"fnt-item\" + fontSizes[i].value === options.textFontSize ? \" fnt-selected\" : \"\",\n          attributes: {\n            \"data-value\": fontSizes[i].value\n          },\n          parent: ulSize,\n          onclick: function onclick() {\n            var parent = $(this).closest(\".fnt-selector\");\n            var data = {\n              textFontFamily: parent.find(\".fnt-ulfamily .fnt-selected\").attr(\"data-value\"),\n              textFontSize: $(this).attr(\"data-value\")\n            };\n            setValue(parent.get(0), data);\n\n            if (!options.magazine) {\n              if ($(this).hasClass(\"fnt-selected\")) parent.trigger('selectionchange', [{\n                type: \"textFontSize\",\n                value: $(this).attr(\"data-value\")\n              }]);else parent.trigger('selectionchange', [{\n                type: \"textFontSize\",\n                value: undefined\n              }]);\n            } else {\n              _h.kocnx().mgvm().designSelectedModel().toggleCommand(null, \"fontSize\", $(this).attr(\"data-value\"));\n            }\n          }\n        });\n      }\n\n      setValue(div, options);\n    };\n\n    var setValue = function setValue(target, values) {\n      var familyText = fontFamilies[0].text;\n      var fontText = fontSizes[6].text;\n      $(target).find(\"li\").removeClass(\"fnt-selected\");\n\n      if (values.textFontFamily) {\n        var familyText = fontFamilies.filter(function (a) {\n          return a.value === values.textFontFamily;\n        })[0].text;\n        $(target).find(\".fnt-family\").text(familyText);\n        $(target).find(\".fnt-ulfamily\").find('[data-value=\"' + values.textFontFamily + '\"]').addClass(\"fnt-selected\");\n      }\n\n      if (values.textFontSize) {\n        var fontText = fontSizes.filter(function (a) {\n          return a.value === values.textFontSize;\n        })[0].text;\n        $(target).find(\".fnt-size\").text(fontText);\n        $(target).find(\".fnt-ulsize\").find('[data-value=\"' + values.textFontSize + '\"]').addClass(\"fnt-selected\");\n      }\n    };\n\n    var getValues = function getValues(target) {\n      var familyText = $(target).find(\".fnt-family\")[0];\n      var family, size;\n\n      if (familyText) {\n        family = fontFamilies.filter(function (a) {\n          return a.text === familyText.innerText;\n        })[0].value;\n      }\n\n      var fontSize = $(target).find(\".fnt-size\")[0];\n\n      if (fontSize) {\n        size = fontSizes.filter(function (a) {\n          return a.text === fontSize.innerText;\n        })[0].value;\n      }\n\n      return [family, size];\n    };\n\n    return {\n      build: build,\n      setValue: setValue,\n      getValues: getValues\n    };\n  }();\n\n  var fsMethods = {\n    init: function init(options) {\n      fsUtil.build(this, options);\n    },\n    setValue: function setValue(values) {\n      fsUtil.setValue(this, values);\n    },\n    getValues: function getValues() {\n      var values = fsUtil.getValues(this);\n      return values;\n    }\n  };\n\n  $.fn.fontSelector = function (methodOrOptions) {\n    if (fsMethods[methodOrOptions]) {\n      return fsMethods[methodOrOptions].apply(this, Array.prototype.slice.call(arguments, 1));\n    } else if (_typeof(methodOrOptions) === 'object' || !methodOrOptions) {\n      return fsMethods.init.apply(this, arguments);\n    } else {\n      $.error('Method ' + methodOrOptions + ' does not exist on jQuery.fontSelector');\n    }\n  };\n})(jQuery);\n\n//# sourceURL=webpack://domino/./src/scripts/components/jqfontselector.js?");

/***/ }),

/***/ "./src/scripts/components/jqrg.js":
/*!****************************************!*\
  !*** ./src/scripts/components/jqrg.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _util_expparser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/expparser.js */ \"./src/scripts/util/expparser.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var _hh = __webpack_require__(/*! ./src/scripts/util/htmlHelper.js */ \"./src/scripts/util/htmlHelper.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var comparator = __webpack_require__(/*! ./src/scripts/util/comparator.js */ \"./src/scripts/util/comparator.js\");\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar pasteDataFormater = __webpack_require__(/*! ../util/pasteDataFormatter.js */ \"./src/scripts/util/pasteDataFormatter.js\");\n\nvar jsep = __webpack_require__(/*! ../vendors/jsep.js */ \"./src/scripts/vendors/jsep.js\");\n\n(function ($) {\n  var dataKey = 'cellsSelector';\n  var selectableTableClass = 'tcs';\n  var selectedCellClass = 'tcs-selected';\n  var selectionEnabled = 'tcs-selection-enabled';\n  var isMouseDown = false;\n  var rgTextBuffer = null;\n  var widthStart = 0;\n  var heightStart = 0;\n  var oppositeActions = {\n    \"mergeCells\": \"unMergeCells\",\n    \"unMergeCells\": \"mergeCells\",\n    \"hideCol\": \"showCol\",\n    \"showCol\": \"hideCol\",\n    \"hideRow\": \"showRow\",\n    \"showRow\": \"hideRow\",\n    \"deleteCol\": \"colRight\",\n    \"deleteRow\": \"rowTop\",\n    \"rowTop\": \"deleteRow\",\n    \"colRight\": \"deleteCol\",\n    \"CutCell\": \"PasteCell\",\n    \"erase\": \"PasteCell\",\n    \"eraseStyle\": \"PasteCellStyle\",\n    \"LinkedCell\": \"PasteCell\",\n    \"NodeInCell\": \"PasteCell\",\n    \"NodeNameInCell\": \"PasteCell\",\n    \"NodeValueNameInCell\": \"PasteCell\",\n    \"Consolidate\": \"PasteCell\",\n    \"TotalSum\": \"PasteCell\",\n    \"PartialSum\": \"PasteCell\",\n    \"GroupSum\": \"PasteCell\",\n    \"ColumnSum\": \"PasteCell\",\n    \"Average\": \"PasteCell\",\n    \"Max\": \"PasteCell\",\n    \"Min\": \"PasteCell\",\n    \"info:'4'\": \"PasteCell\",\n    \"info:'7'\": \"PasteCell\",\n    \"info:'8'\": \"PasteCell\",\n    \"info:'9'\": \"PasteCell\",\n    \"info:'10'\": \"PasteCell\",\n    \"periodname:'_'\": \"PasteCell\",\n    \"perioddate:'_'\": \"PasteCell\",\n    \"periodyear:'_'\": \"PasteCell\"\n  };\n  var rgCommandList = {\n    \"textBold\": \"style\",\n    \"textItalic\": \"style\",\n    \"textUnderline\": \"style\",\n    \"textFontFamily\": \"style\",\n    \"textFontSize\": \"style\",\n    \"align\": \"style\",\n    \"textColor\": \"style\",\n    \"backColor\": \"style\",\n    \"cellStyle\": \"style\",\n    \"eraseStyle\": \"style\",\n    \"textWrap\": \"style\",\n    \"erase\": \"style\",\n    \"border\": \"style\",\n    \"financialPeriod\": \"extraParam\",\n    \"minusRedText\": \"extraParam\",\n    \"minusParenthese\": \"extraParam\",\n    \"dataType\": \"extraParam\",\n    \"decimals\": \"extraParam\",\n    \"accountType\": \"extraParam\",\n    \"percent\": \"extraParam\",\n    \"valueSource\": \"extraParam\",\n    \"valueAccountType\": \"extraParam\",\n    \"valueDisplay\": \"extraParam\",\n    \"zeroDisplay\": \"extraParam\",\n    \"roundingApproach\": \"extraParam\",\n    \"groupType\": \"totalCost\",\n    \"sortDirection\": \"totalCost\",\n    \"mergeCells\": \"tableAction\",\n    \"unMergeCells\": \"tableAction\",\n    \"hideCol\": \"tableAction\",\n    \"showCol\": \"tableAction\",\n    \"hideRow\": \"tableAction\",\n    \"showRow\": \"tableAction\",\n    \"deleteCol\": \"tableAction\",\n    \"deleteRow\": \"tableAction\",\n    \"rowTop\": \"tableAction\",\n    \"colRight\": \"tableAction\",\n    \"width\": \"tableAction\",\n    \"height\": \"tableAction\",\n    \"LinkedCell\": \"setValue\",\n    \"ClearNode\": \"setValue\",\n    \"Consolidate\": \"setValue\",\n    \"Column\": \"setValue\",\n    \"TotalSum\": \"setValue\",\n    \"GroupSum\": \"setValue\",\n    \"ColumnSum\": \"setValue\",\n    \"Average\": \"setValue\",\n    \"PartialSum\": \"setSpecialValue\",\n    \"Max\": \"setValue\",\n    \"Min\": \"setValue\",\n    \"info:'4'\": \"setValue\",\n    \"info:'7'\": \"setValue\",\n    \"info:'8'\": \"setValue\",\n    \"info:'9'\": \"setValue\",\n    \"info:'10'\": \"setValue\",\n    \"periodname:'_'\": \"setValue\",\n    \"perioddate:'_'\": \"setValue\",\n    \"periodyear:'_'\": \"setValue\",\n    \"info:'25'\": \"setValue\",\n    \"xbrlConcept\": \"xbrlConcept\",\n    \"colSortDirection\": \"financialProperties\",\n    \"region\": \"financialProperties\",\n    \"NodeInCell\": \"treeActions\",\n    \"NodeNameInCell\": \"treeActions\",\n    \"NodeValueNameInCell\": \"treeActions\",\n    \"Formula\": \"formulaActions\",\n    \"CellTyping\": \"setText\",\n    \"PasteCell\": \"eventActions\",\n    \"PasteCellStyle\": \"eventActions\",\n    \"ChangeDesc\": \"setText\"\n  };\n\n  var tagRender = function () {\n    var getPeriodId = function getPeriodId(str) {\n      var numb = str.match(/\\d/g);\n      numb = numb.join(\"\");\n      return Number(numb);\n    };\n\n    var cellInfo = function cellInfo(ul, cell) {\n      $(ul).empty();\n      if (cell.cellInfos.length === 0) return;\n      var cellInfo = cell.cellInfos[0];\n\n      var item = _h.getEnumItem(cellInfoTypes, cellInfo.type);\n\n      if (item) {\n        $(ul).css(\"display\", \"block\");\n      }\n\n      var li = _hh.createTag({\n        name: \"li\",\n        parent: ul\n      });\n\n      var a = _hh.createTag({\n        name: \"a\",\n        parent: li,\n        attributes: {\n          \"title\": cellInfo.title ? cellInfo.title : item.text,\n          \"data-container\": \"body\"\n        }\n      });\n\n      var baseAddr = \"/App/src/images/Icons/\";\n      var val = item.value;\n\n      if (cellInfo.type === 33 || cellInfo.type === 34 || cellInfo.type === 35) {\n        baseAddr += cellInfo.type + \"/\";\n        val = getPeriodId(cell.value);\n      }\n\n      _hh.createTag({\n        name: \"img\",\n        parent: a,\n        className: \"icon-image-xxsmall clickable\",\n        attributes: {\n          \"src\": baseAddr + val + '.png'\n        },\n        onclick: function onclick(event) {\n          if (event.target.src.indexOf(\"18.png\") === -1 || !event.shiftKey) return false;\n          var td = $(event.target).closest(\"td\");\n          var table = $(event.target).closest(\"table\");\n          table = rgUtil.getTable(table);\n          var model = rgUtil.getModel(table);\n          var address = $(td).attr(\"data-address\");\n          var cell = model.cells.filter(function (a) {\n            return a.address === address;\n          })[0];\n\n          if (cell.value && cell.value.indexOf(\"link\") !== -1) {\n            _h.kocnx().ttvm().designBtn([{\n              id: cell.linkedTemplate.id,\n              templateTableType: cell.linkedTemplate.templateTableType,\n              title: cell.linkedTemplate.title\n            }]);\n          }\n        },\n        ondblclick: function ondblclick(event) {\n          var td = $(event.target).closest(\"td\");\n          var table = $(event.target).closest(\"table\")[0];\n          if ($(table).hasClass(\"tsc-cs\") || !$(table).hasClass(\"editable-table\")) return;\n          table = rgUtil.getTable(table);\n          var model = rgUtil.getModel(table);\n          var address = $(td).attr(\"data-address\");\n          var cell = model.cells.filter(function (a) {\n            return a.address === address;\n          })[0];\n          rgUtil.executeCommand($(table), model, {\n            id: \"ClearNode\",\n            value: undefined,\n            cells: [cell]\n          });\n        }\n      });\n    };\n\n    var buildCell = function buildCell(cell, frag, type, model) {\n      var styles = \"\";\n      var attributes = {\n        'data-address': cell.address,\n        'data-row': cell.row,\n        'data-col': cell.col,\n        'rowspan': cell.rowSpan,\n        'colspan': cell.colSpan\n      };\n\n      switch (type) {\n        case \"cellSelect\":\n          if (cell.value === null) cell.value = \"\";\n          styles = cell.value.indexOf(\"node\") !== -1 || cell.value.startsWith(\"=\") ? \"\" : \"background-color:#e4e5e7;\";\n\n          if (!styles) {\n            attributes[\"data-tag\"] = cell.tag;\n            attributes[\"data-id\"] = model.id;\n            attributes[\"data-ttType\"] = model.tableTemplateType;\n            attributes[\"data-title\"] = model.title;\n          }\n\n          break;\n\n        default:\n          styles = cell.hidden ? \"background-color:#e1e1e1;\" : \"\";\n          break;\n      }\n\n      var td = _hh.cloneTag({\n        name: \"td\",\n        className: \"rp-gen-cell\",\n        parent: frag,\n        styles: styles,\n        attributes: attributes\n      });\n\n      var iFrag = document.createDocumentFragment();\n\n      _hh.createTag({\n        name: \"input\",\n        parent: iFrag,\n        styles: cellFunc.translateCellStyle(cell),\n        className: \"cell-input\",\n        attributes: {\n          \"autocomplete\": \"off123\"\n        },\n        value: cell.text\n      });\n\n      cellFunc.addCellEvents(td, type, styles);\n\n      var ul = _hh.createTag({\n        name: \"ul\",\n        className: \"cell-infos\",\n        parent: iFrag\n      });\n\n      if (cell.cellInfos.length) tagRender.cellInfo(ul, cell);\n\n      var warningA = _hh.createTag({\n        name: \"a\",\n        className: \"warning-sign\",\n        styles: \"display:none;\",\n        attributes: {\n          \"data-container\": \"body\"\n        },\n        parent: iFrag\n      });\n\n      _hh.createTag(_defineProperty({\n        name: \"img\",\n        className: \"icon-image-xxsmall\",\n        parent: iFrag,\n        attributes: {\n          \"src\": \"/App/src/images/ico/warning.png\"\n        }\n      }, \"parent\", warningA));\n\n      _hh.createTag({\n        name: \"div\",\n        className: \"triangle-datatype\",\n        styles: !(cell.extraParams.dataType === 1) ? \"display:none;\" : \"\",\n        parent: iFrag\n      });\n\n      _hh.createTag({\n        name: \"div\",\n        className: \"triangle-format\",\n        styles: !cell.extraParams.minusRedText && !cell.extraParams.minusParenthese ? \"display:none;\" : \"\",\n        parent: iFrag\n      });\n\n      _hh.createTag({\n        name: \"div\",\n        className: \"triangle-xbrl\",\n        styles: !cell.xbrlConcept ? \"display:none;\" : \"\",\n        \"title\": cell.xbrlConcept ? cell.xbrlConcept.title : '',\n        parent: iFrag\n      });\n\n      _hh.createTag({\n        name: \"div\",\n        className: \"triangle-desc\",\n        attributes: {\n          \"data-container\": \"body\",\n          \"title\": cell.desc\n        },\n        styles: !cell.desc ? \"display:none;\" : \"\",\n        parent: iFrag\n      });\n\n      td.appendChild(iFrag);\n    };\n\n    var buildRow = function buildRow(tbody, model, rowHeight, type, append) {\n      var cells = model.cells.filter(function (a) {\n        return a.row === rowHeight.id;\n      });\n      var trRow;\n\n      if (!append) {\n        trRow = _hh.createTag({\n          name: \"tr\",\n          parent: tbody\n        });\n      } else {\n        trRow = _hh.createTag({\n          name: \"tr\",\n          attach: false\n        });\n\n        if (rowHeight.id > 1) {\n          var prevSib = $(tbody).find(\".first-cell[data-row='\" + (rowHeight.id - 1) + \"']\").parent();\n          $(trRow).insertAfter(prevSib);\n        } else {\n          var currentEl = $(tbody).find(\".first-cell\")[0];\n          $(trRow).insertBefore($(currentEl).parent());\n        }\n      }\n\n      var thRow = _hh.createTag({\n        name: \"th\",\n        parent: trRow,\n        className: \"first-cell\",\n        styles: \"height:\" + rowHeight.size,\n        attributes: {\n          \"data-row\": rowHeight.id\n        }\n      });\n\n      _hh.createTag({\n        name: \"span\",\n        className: \"th-label\",\n        parent: thRow,\n        text: rowHeight.id,\n        styles: \"position: absolute;top: 23%;left: 41%;\"\n      });\n\n      var frag = document.createDocumentFragment();\n\n      for (var j = 0; j < cells.length; j++) {\n        var cell = cells[j];\n        buildCell(cell, frag, type, model);\n      }\n\n      trRow.appendChild(frag);\n\n      if (type === \"cellSelect\") {\n        _hh.createTag({\n          name: \"th\",\n          parent: trRow,\n          text: rowHeight.id,\n          className: \"last-cell\",\n          styles: \"height:\" + rowHeight.size,\n          attributes: {\n            \"data-row\": rowHeight.id\n          }\n        });\n      }\n    };\n\n    var buildThCol = function buildThCol(colWidth, i, trCol, model) {\n      if (i === 0) {\n        _hh.createTag({\n          name: \"th\",\n          parent: trCol,\n          className: \"cross-cell\",\n          attributes: {\n            \"data-col\": 0\n          }\n        });\n      }\n\n      var parent = _hh.createTag({\n        name: \"th\",\n        parent: trCol,\n        styles: \"width:\" + colWidth.size,\n        className: \"rp-gen-col\",\n        text: _h.numberToAlphabet(colWidth.id),\n        attributes: {\n          \"data-col\": colWidth.id\n        }\n      });\n\n      var className = \"fa\";\n\n      if (colWidth.id === model.financialProperties.sortColumn.id) {\n        className = model.financialProperties.sortColumn.sortDirection === 0 ? \"fa fa-sort-amount-asc\" : \"fa fa-sort-amount-desc\";\n      }\n\n      _hh.createTag({\n        name: \"span\",\n        parent: parent,\n        className: className,\n        attributes: {\n          \"data-col\": colWidth.id\n        }\n      });\n    };\n\n    var buildTable = function buildTable(hostEl, model, type) {\n      var table = _hh.createTag({\n        name: \"table\",\n        parent: hostEl,\n        className: type === \"cellSelect\" ? \"tsc-cs\" : \"tsc-ed\"\n      });\n\n      var thead = _hh.createTag({\n        name: \"thead\",\n        parent: table\n      });\n\n      var trCol = _hh.createTag({\n        name: \"tr\",\n        styles: \"height: 28px;\",\n        parent: thead\n      });\n\n      for (var i = 0; i < model.colsWidth.length; i++) {\n        var colWidth = model.colsWidth[i];\n        buildThCol(colWidth, i, trCol, model);\n      }\n\n      var tbody = _hh.createTag({\n        name: \"tbody\",\n        parent: table\n      });\n\n      for (var _i = 0; _i < model.rowsHeight.length; _i++) {\n        var rowHeight = model.rowsHeight[_i];\n        buildRow(tbody, model, rowHeight, type, false);\n      }\n\n      if (type === \"cellSelect\") {\n        _hh.createTag({\n          name: \"th\",\n          parent: trCol,\n          className: \"cross-cell\",\n          attributes: {\n            \"data-col\": 0\n          }\n        });\n\n        var tfoot = _hh.createTag({\n          name: \"tfoot\",\n          parent: table\n        });\n\n        trCol = _hh.createTag({\n          name: \"tr\",\n          styles: \"height: 28px;\",\n          parent: tfoot\n        });\n\n        for (var _i2 = 0; _i2 < model.colsWidth.length; _i2++) {\n          var colWidth = model.colsWidth[_i2];\n          buildThCol(colWidth, _i2, trCol, model);\n        }\n\n        _hh.createTag({\n          name: \"th\",\n          parent: trCol,\n          className: \"cross-cell\",\n          attributes: {\n            \"data-col\": 0\n          }\n        });\n      }\n\n      return table;\n    };\n\n    var sortRowTdList = function sortRowTdList(tr) {\n      var cols = $(tr).find(\"td\").get();\n      cols.sort(function (a, b) {\n        var colA = Number($(a).attr('data-col'));\n        var colB = Number($(b).attr('data-col'));\n        if (colA < colB) return -1;\n        if (colA > colB) return 1;\n        return 0;\n      });\n      $.each(cols, function (index, col) {\n        $(tr).append(col);\n      });\n    };\n\n    var applyToTable = function applyToTable(type, table, model, val) {\n      var cells, cell, target, rowId, colId, rowHeight, colNumber, trList, col;\n\n      switch (type) {\n        case \"unMergeCells\":\n          trList = $(table).find(\"tr\");\n\n          for (var i = 0; i < val.length; i++) {\n            var item = val[i];\n            cell = model.cells.filter(function (a) {\n              return a.row === item.row && a.col === item.col;\n            })[0];\n            buildCell(cell, trList[item.row]);\n            sortRowTdList(trList[item.row]);\n          }\n\n          break;\n\n        case \"hiddenCells\":\n          var arrayRows = model.hiddenRows;\n          var arrayCols = model.hiddenCols;\n\n          for (var _i3 = 0; _i3 < model.rowsHeight.length; _i3++) {\n            rowHeight = model.rowsHeight[_i3];\n            cells = model.cells.filter(function (a) {\n              return a.row === rowHeight.id;\n            });\n\n            for (var j = 0; j < cells.length; j++) {\n              target = cells[j];\n\n              if (arrayRows && arrayRows.indexOf(target.row) !== -1 || arrayCols && arrayCols.indexOf(target.col) !== -1) {\n                $(table).find('[data-address=\"' + target.address + '\"]').css(\"background-color\", \"#e1e1e1\");\n              } else {\n                $(table).find('[data-address=\"' + target.address + '\"]').css(\"background-color\", \"\");\n              }\n            }\n          }\n\n          break;\n\n        case \"DynamicValueHiddenCells\":\n          var arrayRows = val[0];\n          var arrayCols = val[1];\n\n          for (var _i4 = 0; _i4 < model.rowsHeight.length; _i4++) {\n            rowHeight = model.rowsHeight[_i4];\n            cells = model.cells.filter(function (a) {\n              return a.row === rowHeight.id;\n            });\n\n            for (var j = 0; j < cells.length; j++) {\n              target = cells[j];\n\n              if (arrayRows && arrayRows.indexOf(target.row) !== -1 || arrayCols && arrayCols.indexOf(target.col) !== -1) {\n                $(table).find('[data-address=\"' + target.address + '\"]').css(\"background-color\", \"#e1e1e1\");\n              } else {\n                $(table).find('[data-address=\"' + target.address + '\"]').css(\"background-color\", \"\");\n              }\n            }\n          }\n\n          break;\n\n        case \"removeCol\":\n          if (val.reduceCells.length > 0) for (var n = 0; n < val.reduceCells.length; n++) {\n            target = $(table).find(\"td[data-address='\" + val.reduceCells[n] + \"']\");\n            target.attr(\"colSpan\", Number(target.attr(\"colSpan\")) - 1);\n          }\n          var colElement = $(table).find(\"th[data-col='\" + val.targetCol + \"']\");\n          $(colElement).remove();\n          var removeList = $(table).find(\"td[data-col='\" + val.targetCol + \"']\");\n\n          for (var q = 0; q < removeList.length; q++) {\n            target = removeList[q];\n            var dAddr = $(target).attr(\"data-address\");\n            if (!val.reduceCells || val.reduceCells.indexOf(dAddr) === -1) $(target).remove();\n          }\n\n          var colList = $(table).find(\"th.rp-gen-col\");\n\n          for (var k = 0; k < colList.length; k++) {\n            col = colList[k];\n            colNumber = Number($(col).attr(\"data-col\"));\n\n            if (colNumber > val.targetCol) {\n              $(col).attr(\"data-col\", colNumber - 1);\n              $(col).text(_h.numberToAlphabet(colNumber - 1));\n            }\n          }\n\n          var cellList = $(table).find(\"td\");\n\n          for (var l = 0; l < cellList.length; l++) {\n            colNumber = Number($(cellList[l]).attr(\"data-col\"));\n\n            if (colNumber > val.targetCol) {\n              $(cellList[l]).attr(\"data-col\", colNumber - 1);\n              $(cellList[l]).attr(\"data-address\", _h.numberToAlphabet(colNumber - 1) + $(cellList[l]).attr(\"data-row\"));\n            }\n          }\n\n          break;\n\n        case \"colRight\":\n          if (val.increaseCells.length > 0) for (var n = 0; n < val.increaseCells.length; n++) {\n            target = $(table).find(\"td[data-address='\" + val.increaseCells[n] + \"']\");\n            target.attr(\"colSpan\", Number(target.attr(\"colSpan\")) + 1);\n          }\n          cells = $(table).find(\"td.rp-gen-cell\");\n\n          for (var m = 0; m < cells.length; m++) {\n            cell = cells[m];\n            colId = Number($(cell).attr(\"data-col\"));\n\n            if (colId >= val.targetCol) {\n              $(cell).attr(\"data-col\", colId + 1);\n\n              if (cell.nodeName === \"TD\") {\n                rowId = $(cell).attr(\"data-row\");\n                $(cell).attr(\"data-address\", _h.numberToAlphabet(colId + 1) + rowId);\n              }\n            }\n          }\n\n          trList = $(table).find(\"tr\");\n          if (val.addCells.length) for (var r = 0; r < val.addCells.length; r++) {\n            cell = val.addCells[r];\n            buildCell(cell, trList[cell.row]);\n            sortRowTdList(trList[cell.row]);\n          }\n          $(trList[0]).empty();\n\n          for (var _i5 = 0; _i5 < model.colsWidth.length; _i5++) {\n            var colWidth = model.colsWidth[_i5];\n            buildThCol(colWidth, _i5, trList[0], model);\n          }\n\n          break;\n\n        case \"removeRow\":\n          if (val.reduceCells.length > 0) for (var n = 0; n < val.reduceCells.length; n++) {\n            target = $(table).find(\"td[data-address='\" + val.reduceCells[n] + \"']\");\n            target.attr(\"rowSpan\", Number(target.attr(\"rowSpan\")) - 1);\n          }\n          var targetTr = $(table).find(\"th[data-row='\" + val.targetRow + \"']\").parent();\n          var sortList = [];\n          if (val.reduceAndReplaceCells.length > 0) for (var p = 0; p < val.reduceAndReplaceCells.length; p++) {\n            target = $(table).find(\"td[data-address='\" + val.reduceAndReplaceCells[p] + \"']\");\n            var rNum = Number(target.attr(\"rowSpan\"));\n            target.attr(\"rowSpan\", rNum - 1);\n            var newTargetTr = $(table).find(\"th[data-row='\" + (val.targetRow + 1) + \"']\").parent();\n            sortList.push(newTargetTr);\n            $(target).appendTo(newTargetTr);\n          }\n          targetTr.remove();\n          cells = $(table).find(\"th.first-cell, td.rp-gen-cell\");\n\n          for (var m = 0; m < cells.length; m++) {\n            cell = cells[m];\n            rowId = Number($(cell).attr(\"data-row\"));\n\n            if (rowId > val.targetRow) {\n              $(cell).attr(\"data-row\", rowId - 1);\n\n              if (cell.nodeName === \"TH\") {\n                var targetSpan = $(cell).find(\".th-label\");\n                $(targetSpan).text(rowId - 1);\n              }\n\n              if (cell.nodeName === \"TD\") {\n                colId = $(cell).attr(\"data-col\");\n                $(cell).attr(\"data-address\", _h.numberToAlphabet(colId) + (rowId - 1));\n              }\n            }\n          }\n\n          if (sortList.length) for (var o = 0; o < sortList.length; o++) {\n            sortRowTdList(sortList[o]);\n          }\n          break;\n\n        case \"rowTop\":\n          if (val.increaseCells.length > 0) for (var n = 0; n < val.increaseCells.length; n++) {\n            target = $(table).find(\"td[data-address='\" + val.increaseCells[n] + \"']\");\n            target.attr(\"rowSpan\", Number(target.attr(\"rowSpan\")) + 1);\n          }\n          var tbody = $(table).find(\"tbody\");\n          cells = $(table).find(\"th.first-cell, td.rp-gen-cell\");\n\n          for (var m = 0; m < cells.length; m++) {\n            cell = cells[m];\n            rowId = Number($(cell).attr(\"data-row\"));\n\n            if (rowId >= val.targetRow) {\n              $(cell).attr(\"data-row\", rowId + 1);\n\n              if (cell.nodeName === \"TH\") {\n                var targetSpan = $(cell).find(\".th-label\");\n                $(targetSpan).text(rowId + 1);\n              }\n\n              if (cell.nodeName === \"TD\") {\n                colId = $(cell).attr(\"data-col\");\n                $(cell).attr(\"data-address\", _h.numberToAlphabet(colId) + (rowId + 1));\n              }\n            }\n          }\n\n          rowHeight = model.rowsHeight.filter(function (a) {\n            return a.id === val.targetRow;\n          })[0];\n          buildRow(tbody.get(0), model, rowHeight, \"edit\", true);\n          break;\n\n        case \"setDynamicValue\":\n          $(table).addClass('preview-mode');\n          break;\n\n        case \"resetDynamicValue\":\n          $(table).removeClass('preview-mode');\n          break;\n\n        case \"colSortDirection\":\n          var iList = $(table).find(\".fa\");\n\n          for (var i = 0; i < iList.length; i++) {\n            var target = iList[i];\n            var colId = $(target).attr(\"data-col\");\n            $(target).attr(\"class\", \"fa\");\n\n            if (Number(colId) === model.financialProperties.sortColumn.id) {\n              var className;\n\n              switch (model.financialProperties.sortColumn.sortDirection) {\n                case 0:\n                  className = \"fa fa-sort-amount-asc\";\n                  $(target).attr(\"class\", className);\n                  break;\n\n                case 1:\n                  className = \"fa fa-sort-amount-desc\";\n                  $(target).attr(\"class\", className);\n                  break;\n              }\n            }\n          }\n\n          break;\n\n        case \"colSortDirectionReset\":\n          var iList = $(table).find(\".fa\");\n\n          for (var i = 0; i < iList.length; i++) {\n            $(iList[i]).attr(\"class\", \"fa\");\n          }\n\n          break;\n      }\n    };\n\n    var applyToElement = function applyToElement(table, cell, type, value) {\n      var cellElement = $(table).find('[data-col=\"' + cell.col + '\"][data-row=\"' + cell.row + '\"]');\n      var target, styles;\n\n      switch (type) {\n        case \"NodeInCell\":\n        case \"Consolidate\":\n        case \"Column\":\n        case \"LinkedCell\":\n        case \"NodeNameInCell\":\n          $(cellElement).find(\"input\").val(undefined);\n          target = $(cellElement).find(\".cell-infos\");\n          tagRender.cellInfo(target[0], cell);\n\n          if (type === \"NodeInCell\") {\n            $(\".txtFormula:visible\").val(cell.value);\n          }\n\n          break;\n\n        case \"info\":\n          $(cellElement).find(\"input\").val(undefined);\n          target = $(cellElement).find(\".cell-infos\");\n          tagRender.cellInfo(target[0], cell);\n          break;\n\n        case \"style\":\n          target = $(cellElement).find(\"input\");\n          styles = cellFunc.translateCellStyle(cell);\n          $(target).attr(\"style\", styles);\n          break;\n\n        case \"erase\":\n          $(cellElement).find(\"input\").val(undefined);\n          $(cellElement).find(\".triangle-format\").css(\"display\", \"none\");\n          $(cellElement).find(\".triangle-datatype\").css(\"display\", \"block\");\n          $(cellElement).find(\".triangle-xbrl\").css(\"display\", \"none\");\n          $(cellElement).find(\".triangle-desc\").css(\"display\", \"none\");\n          target = $(cellElement).find(\".cell-infos\");\n          tagRender.cellInfo(target[0], cell);\n          break;\n\n        case \"paste\":\n          var bSelector = $(table).data(\"baseSelector\");\n          target = $(cellElement).find(\"input\");\n          target.val(cell.text);\n          styles = cellFunc.translateCellStyle(cell);\n          $(target).attr(\"style\", styles);\n          target = $(cellElement).find(\".cell-infos\");\n          tagRender.cellInfo(target[0], cell);\n          target = $(cellElement).find(\".triangle-format\");\n          cell.extraParams.minusRedText || cell.extraParams.minusParenthese ? target.css(\"display\", \"block\") : target.css(\"display\", \"none\");\n          target = $(cellElement).find(\".triangle-datatype\");\n          cell.extraParams.dataType === 1 ? target.css(\"display\", \"block\") : target.css(\"display\", \"none\");\n\n          if (cell.value && cell.value.startsWith(\"=\")) {\n            $(bSelector + ' .txtFormula').val(cell.value);\n          }\n\n          break;\n\n        case \"cut\":\n          $(cellElement).find(\"input\").val(undefined);\n          $(cellElement).find(\".triangle-format\").css(\"display\", \"none\");\n          $(cellElement).find(\".triangle-datatype\").css(\"display\", \"block\");\n          $(cellElement).find(\".triangle-xbrl\").css(\"display\", \"none\");\n          $(cellElement).find(\".cell-infos\").empty();\n          break;\n\n        case \"span\":\n          $(cellElement).attr(\"colspan\", cell.colSpan);\n          $(cellElement).attr(\"rowspan\", cell.rowSpan);\n          break;\n\n        case \"removeCell\":\n          $(cellElement).remove();\n          break;\n\n        case \"Formula\":\n          var bSelector = $(table).data(\"baseSelector\");\n          $(cellElement).find(\"input\").val(undefined);\n          target = $(cellElement).find(\".cell-infos\");\n          tagRender.cellInfo(target[0], cell);\n\n          if (cell.value && cell.value.startsWith(\"=\")) {\n            $(bSelector + ' .txtFormula').val(cell.value);\n          }\n\n          break;\n\n        case \"setDynamicValue\":\n          $(cellElement).find(\".cell-infos\").css(\"display\", \"none\");\n          $(cellElement).find(\"input\").val(cell.text);\n\n          if (cell.redText) {\n            $(cellElement).find(\"input\").css(\"color\", \"red\");\n          }\n\n          var triangle = $(cellElement).find(\".triangle-desc\");\n\n          if (cell.desc) {\n            triangle.css(\"display\", \"block\");\n            triangle.attr(\"title\", \"\");\n            triangle.attr(\"data-original-title\", cell.desc);\n\n            _h.activeTooltip(true);\n          } else {\n            triangle.css(\"display\", \"none\");\n            triangle.attr(\"title\", \"\");\n            triangle.attr(\"data-original-title\", \"\");\n          }\n\n          break;\n\n        case \"resetDynamicValue\":\n          $(cellElement).find(\".cell-infos\").css(\"display\", \"\");\n\n          if (!cell.style.textColor) {\n            $(cellElement).find(\"input\").css(\"color\", \"\");\n          } else {\n            $(cellElement).find(\"input\").css(\"color\", cell.style.textColor);\n          }\n\n          var triangle = $(cellElement).find(\".triangle-desc\");\n\n          if (cell.desc) {\n            triangle.css(\"display\", \"block\");\n            triangle.attr(\"title\", \"\");\n            triangle.attr(\"data-original-title\", cell.desc);\n\n            _h.activeTooltip(true);\n          } else {\n            triangle.css(\"display\", \"none\");\n            triangle.attr(\"title\", \"\");\n            triangle.attr(\"data-original-title\", \"\");\n          }\n\n          break;\n\n        case \"minusRedText\":\n          target = $(cellElement).find(\".triangle-format\");\n          var status = value || cell.extraParams.minusParenthese;\n          status ? target.css(\"display\", \"block\") : target.css(\"display\", \"none\");\n          break;\n\n        case \"minusParenthese\":\n          target = $(cellElement).find(\".triangle-format\");\n          var status = value || cell.extraParams.minusRedText;\n          status ? target.css(\"display\", \"block\") : target.css(\"display\", \"none\");\n          break;\n\n        case \"dataType\":\n          target = $(cellElement).find(\".triangle-datatype\");\n          value ? target.css(\"display\", \"block\") : target.css(\"display\", \"none\");\n          break;\n\n        case \"resetFormula\":\n          target = $(cellElement).find(\".cell-infos\");\n          $(cellElement).find(\".cell-infos\").empty();\n          break;\n\n        case \"xbrlConcept\":\n          target = $(cellElement).find(\".triangle-xbrl\");\n\n          if (cell.xbrlConcept) {\n            target.css(\"display\", \"block\");\n            target.attr(\"title\", cell.xbrlConcept.title);\n            target.attr(\"data-container\", \"body\");\n          } else {\n            target.css(\"display\", \"none\");\n            target.attr(\"data-container\", \"\");\n            target.attr(\"title\", undefined);\n          }\n\n          break;\n\n        case \"ClearNode\":\n          $(cellElement).find(\".cell-infos\").empty();\n          $('.txtFormula:visible').val(\"\");\n          $(\".tooltip\").remove();\n          break;\n\n        case \"CellTyping\":\n          $(cellElement).find(\".cell-infos\").empty();\n          $('.txtFormula:visible').val(\"\");\n          $(cellElement).find(\"input\").val(value);\n          break;\n\n        case \"ChangeDesc\":\n          var triangle = $(cellElement).find(\".triangle-desc\");\n\n          if (cell.desc) {\n            triangle.css(\"display\", \"block\");\n            triangle.attr(\"title\", \"\");\n            triangle.attr(\"data-original-title\", cell.desc);\n\n            _h.activeTooltip(true);\n          } else {\n            triangle.attr(\"title\", \"\");\n            triangle.attr(\"data-original-title\", \"\");\n            triangle.css(\"display\", \"none\");\n          }\n\n          break;\n      }\n    };\n\n    return {\n      cellInfo: cellInfo,\n      buildTable: buildTable,\n      buildRow: buildRow,\n      buildCell: buildCell,\n      applyToTable: applyToTable,\n      applyToElement: applyToElement\n    };\n  }();\n\n  var cellFunc = function () {\n    var hasItem = function hasItem(cell, type) {\n      switch (type) {\n        case \"node\":\n          return !_h.isNullOrEmpty(cell.value) && cell.value.startsWith(\"node:\");\n\n        case \"info\":\n          return !_h.isNullOrEmpty(cell.value) && (cell.value.indexOf(\"info\") || cell.value.indexOf(\"period\"));\n\n        case \"formatData\":\n          return cell.extraParams.minusParenthese || cell.extraParams.minusRedText;\n\n        case \"attachCell\":\n          return !_h.isNullOrEmpty(cell.value) && cell.value.startsWith(\"#\");\n\n        case \"formula\":\n          return !_h.isNullOrEmpty(cell.value) && cell.value.startsWith(\"=\");\n\n        case \"column\":\n          return !_h.isNullOrEmpty(cell.value) && cell.value.indexOf(\"table\") !== -1;\n      }\n    };\n\n    var eraseCell = function eraseCell(cell, accountType, defaultVal) {\n      cell.text = \"\";\n      cell.value = \"\";\n      cell.desc = \"\";\n      cell.cellInfos = [];\n      cell.xbrlConcept = undefined;\n      cell.columnId = undefined;\n      cell.tableId = undefined;\n      cell.extraParams = createEmptyModel(\"extraParams\", null, null, accountType, defaultVal);\n    };\n\n    var addStyles = function addStyles(table, cell, type, value, defaultVal) {\n      var resModel = {};\n\n      switch (type) {\n        case \"textBold\":\n        case \"textItalic\":\n        case \"textUnderline\":\n          resModel.old = cell.style[type];\n          cell.style[type] = !cell.style[type];\n          resModel[\"new\"] = cell.style[type];\n          break;\n\n        case \"align\":\n          resModel.old = cell.style.textAlign;\n          cell.style.textAlign = value;\n          resModel[\"new\"] = cell.style.textAlign;\n          break;\n\n        case \"cellStyle\":\n          resModel.old = ko.toJS(cell.style);\n          cellFunc.fillCellStyle(cell, value);\n          resModel[\"new\"] = ko.toJS(cell.style);\n          break;\n\n        case \"textFontFamily\":\n        case \"textFontSize\":\n        case \"textColor\":\n        case \"backColor\":\n          resModel.old = cell.style[type];\n          cell.style[type] = value;\n          resModel[\"new\"] = cell.style[type];\n          break;\n\n        case \"eraseStyle\":\n          resModel.old = ko.toJS(cell.style);\n          cell.style = createEmptyModel(\"style\", null, null, null, defaultVal);\n          resModel[\"new\"] = ko.toJS(cell.style);\n          break;\n\n        case \"erase\":\n          resModel.old = ko.toJS(cell);\n          eraseCell(cell, value, defaultVal);\n          tagRender.applyToElement(table, cell, type);\n          resModel[\"new\"] = ko.toJS(cell);\n          break;\n\n        case \"textWrap\":\n          resModel.old = cell.style[type];\n          cell.style[type] = value;\n          resModel[\"new\"] = cell.style[type];\n          break;\n\n        case \"border\":\n          resModel.old = ko.toJS(cell.style);\n          var side = value.side,\n              width = value.width,\n              style = value.style,\n              color = value.color;\n          var data = getAllSideBorders(cell);\n          var borderStyles = data[0];\n          var borderWidths = data[1];\n          var borderColors = data[2];\n\n          switch (side) {\n            case \"left\":\n              if (!_h.isNullOrEmpty(style)) borderStyles[3] = style;\n              if (!_h.isNullOrEmpty(width)) borderWidths[3] = width;\n              if (!_h.isNullOrEmpty(color)) borderColors[3] = color;\n              break;\n\n            case \"right\":\n              if (!_h.isNullOrEmpty(style)) borderStyles[1] = style;\n              if (!_h.isNullOrEmpty(width)) borderWidths[1] = width;\n              if (!_h.isNullOrEmpty(color)) borderColors[1] = color;\n              break;\n\n            case \"top\":\n              if (!_h.isNullOrEmpty(style)) borderStyles[0] = style;\n              if (!_h.isNullOrEmpty(width)) borderWidths[0] = width;\n              if (!_h.isNullOrEmpty(color)) borderColors[0] = color;\n              break;\n\n            case \"bottom\":\n              if (!_h.isNullOrEmpty(style)) borderStyles[2] = style;\n              if (!_h.isNullOrEmpty(width)) borderWidths[2] = width;\n              if (!_h.isNullOrEmpty(color)) borderColors[2] = color;\n              break;\n\n            case \"full\":\n              if (!_h.isNullOrEmpty(style)) {\n                borderStyles[0] = style;\n                borderStyles[1] = style;\n                borderStyles[2] = style;\n                borderStyles[3] = style;\n              }\n\n              if (!_h.isNullOrEmpty(width)) {\n                borderWidths[0] = width;\n                borderWidths[1] = width;\n                borderWidths[2] = width;\n                borderWidths[3] = width;\n              }\n\n              if (!_h.isNullOrEmpty(color)) {\n                borderColors[0] = color;\n                borderColors[1] = color;\n                borderColors[2] = color;\n                borderColors[3] = color;\n              }\n\n              break;\n\n            case \"none\":\n              if (!_h.isNullOrEmpty(style)) {\n                borderStyles[0] = \"none\";\n                borderStyles[1] = \"none\";\n                borderStyles[2] = \"none\";\n                borderStyles[3] = \"none\";\n              }\n\n              if (!_h.isNullOrEmpty(width)) {\n                borderWidths[0] = \"0\";\n                borderWidths[1] = \"0\";\n                borderWidths[2] = \"0\";\n                borderWidths[3] = \"0\";\n              }\n\n              if (!_h.isNullOrEmpty(color)) {\n                borderColors[0] = \"#000000\";\n                borderColors[1] = \"#000000\";\n                borderColors[2] = \"#000000\";\n                borderColors[3] = \"#000000\";\n              }\n\n              break;\n          }\n\n          cell.style.borderStyle = borderStyles[0] + \" \" + borderStyles[1] + \" \" + borderStyles[2] + \" \" + borderStyles[3];\n          cell.style.borderWidth = borderWidths[0] + \" \" + borderWidths[1] + \" \" + borderWidths[2] + \" \" + borderWidths[3];\n          cell.style.borderColor = borderColors[0] + \" \" + borderColors[1] + \" \" + borderColors[2] + \" \" + borderColors[3];\n          resModel[\"new\"] = ko.toJS(cell.style);\n          break;\n      }\n\n      tagRender.applyToElement(table, cell, \"style\");\n      return resModel;\n    };\n\n    var addValues = function addValues(table, cell, type, values, reset) {\n      var _oldValues;\n\n      var item = _h.getEnumItemByText(cellInfoTypes, type);\n\n      var resModel = {};\n      var numb = \"\";\n\n      if (!item) {\n        if (type.indexOf(\"period\") !== -1) {\n          numb = type.match(/\\d/g);\n\n          if (numb.length > 1) {\n            numb = numb[0] + numb[1];\n          } else {\n            numb = numb[0];\n          }\n\n          type = type.replace(numb, \"_\");\n        }\n\n        item = _h.getEnumItemByText(cellInfoTypes, type);\n      }\n\n      resModel.old = ko.toJS(cell);\n\n      switch (type) {\n        default:\n          cell.extraParams.percent = false;\n          cell.extraParams.minusParenthese = false;\n          cell.extraParams.minusRedText = false;\n          cell.text = \"\";\n          cell.value = \"[\" + item.enText + \"]\";\n\n          if (item.enText.indexOf(\"_\") !== -1) {\n            cell.value = cell.value.replace(\"_\", numb);\n            numb = Number(numb);\n          }\n\n          cell.hasError = false;\n          cell.cellInfos = [];\n\n          if (type === \"info:'4'\" || type === \"info:'9'\" || type === \"info:'10'\" || type.indexOf(\"period\") !== -1) {\n            values = \"\";\n          }\n\n          cell.cellInfos.push({\n            title: item.text + \" \" + numb,\n            type: item.value,\n            value: values ? values : Number(numb)\n          });\n          tagRender.applyToElement(table, cell, \"info\");\n          break;\n\n        case \"ClearNode\":\n          cell.value = \"\";\n          cell.text = \"\";\n          cell.hasError = false;\n          cell.linkedTemplate = undefined;\n          cell.cellInfos = [];\n          cell.columnId = undefined;\n          cell.extraParams.financialPeriod = undefined;\n          tagRender.applyToElement(table, cell, type);\n          break;\n\n        case \"NodeInCell\":\n          var oldValues = [];\n          if (!reset) oldValues = getCellValues(cell, \"node\");\n\n          (_oldValues = oldValues).push.apply(_oldValues, _toConsumableArray(values));\n\n          cell.text = \"\";\n          cell.hasError = false;\n          cell.value = mergeValues(oldValues, \"node\");\n          var title = mergeValues(oldValues, \"nodeTitle\");\n          cell.cellInfos = [];\n          if (oldValues.length > 0) cell.cellInfos.push({\n            title: title,\n            type: item.value\n          });\n          if (_h.any(values)) cell.extraParams.financialPeriod = values[0].periodId;\n          tagRender.applyToElement(table, cell, type);\n          break;\n\n        case \"NodeNameInCell\":\n          cell.text = \"\";\n          cell.hasError = false;\n          cell.value = \"[nodename:'\" + values.code + \"']\";\n          cell.cellInfos = [];\n          cell.cellInfos.push({\n            title: values.name,\n            type: item.value\n          });\n          cell.extraParams.financialPeriod = values.periodId;\n          tagRender.applyToElement(table, cell, type);\n          break;\n\n        case \"Consolidate\":\n          cell.text = \"\";\n          cell.hasError = false;\n          cell.cellInfos = [];\n          cell.cellInfos.push({\n            title: values[1],\n            type: item.value\n          });\n          cell.value = \"[\" + type.toLowerCase() + \":'\" + values[0] + \"']\";\n          tagRender.applyToElement(table, cell, type);\n          break;\n\n        case \"Column\":\n          cell.columnId = Number(values.id);\n          cell.value = \"[table:'\" + values.id + \"']\";\n          cell.cellInfos.push({\n            title: values.title,\n            type: item.value\n          });\n          tagRender.applyToElement(table, cell, type);\n          break;\n\n        case \"Formula\":\n          var parseTree;\n\n          try {\n            cell.hasError = false;\n\n            if (!values) {\n              cell.value = undefined;\n              cell.columnId = undefined;\n              cell.tableId = undefined;\n              cell.cellInfos = [];\n              tagRender.applyToElement(table, cell, type);\n              return;\n            }\n\n            parseTree = jsep(values.trim().substring(1));\n          } catch (ex) {\n            cell.hasError = true;\n          }\n\n          if (!cell.hasError) {\n            cell.text = \"\";\n            cell.cellInfos = [];\n            var temp = values.trim().toUpperCase();\n            temp = _h.replaceAll(temp, \" \", \"\");\n            cell.value = temp;\n            cell.columnId = undefined;\n            cell.tableId = undefined;\n            cell.cellInfos.push({\n              title: item.text,\n              type: item.value\n            });\n            tagRender.applyToElement(table, cell, type);\n          }\n\n          break;\n\n        case \"PartialSum\":\n          cell.text = \"\";\n          var vertexes = calculateVertexes(values);\n          cell.value = \"=Sum(\" + _h.numberToAlphabet(cell.col) + \":\" + vertexes.sRow + \":\" + vertexes.bRow + \")\";\n          cell.cellInfos = [];\n          cell.cellInfos.push({\n            title: \"\",\n            type: item.value\n          });\n          tagRender.applyToElement(table, cell, \"info\");\n          break;\n\n        case \"TotalSum\":\n        case \"GroupSum\":\n        case \"ColumnSum\":\n        case \"Average\":\n        case \"Max\":\n        case \"Min\":\n          cell.text = \"\";\n          cell.cellInfos = [];\n          cell.cellInfos.push({\n            title: \"\",\n            type: item.value\n          });\n          cell.value = \"=\" + item.ph + \"(\" + _h.numberToAlphabet(cell.col) + \")\";\n          tagRender.applyToElement(table, cell, \"info\");\n          break;\n\n        case \"LinkedCell\":\n          cell.extraParams.percent = false;\n          cell.extraParams.minusParenthese = false;\n          cell.extraParams.minusRedText = false;\n          cell.text = \"\";\n          cell.cellInfos = [];\n          cell.linkedTemplate = {\n            id: Number(values.tId),\n            templateTableType: Number(values.templateTableType),\n            title: values.tTitle\n          };\n          cell.cellInfos.push({\n            title: values.title,\n            type: item.value\n          });\n          cell.value = \"[link:'\" + values.tag + \"']\";\n          tagRender.applyToElement(table, cell, type);\n          break;\n\n        case \"xbrlConcept\":\n          if (values) {\n            cell.xbrlConcept = {\n              id: values.id,\n              title: values.title\n            };\n          } else {\n            cell.xbrlConcept = undefined;\n          }\n\n          tagRender.applyToElement(table, cell, \"xbrlConcept\");\n          break;\n      }\n\n      resModel[\"new\"] = ko.toJS(cell);\n      return resModel;\n    };\n\n    var setText = function setText(table, cell, type, value) {\n      var resModel = {};\n\n      switch (type) {\n        case \"CellTyping\":\n          resModel.old = cell.text;\n          resModel[\"new\"] = value;\n          cell.text = value;\n          break;\n\n        case \"ChangeDesc\":\n          resModel.old = cell.desc;\n          resModel[\"new\"] = value;\n          cell.desc = value;\n          break;\n      }\n\n      tagRender.applyToElement(table, cell, type);\n      return resModel;\n    };\n\n    var addExtraParams = function addExtraParams(table, cell, type, values) {\n      var resModel = {};\n      resModel.old = cell.extraParams[type];\n      cell.extraParams[type] = values;\n      tagRender.applyToElement(table, cell, type, cell.extraParams[type]);\n      resModel[\"new\"] = cell.extraParams[type];\n      return resModel;\n    };\n\n    var getAllSideBorders = function getAllSideBorders(cell) {\n      var borderStyles = cell.style.borderStyle.split(\" \");\n      borderStyles = _h.cleanArray(borderStyles);\n      var borderWidths = cell.style.borderWidth.split(\" \");\n      borderWidths = _h.cleanArray(borderWidths);\n      var borderColors = cell.style.borderColor.split(\" \");\n      borderColors = _h.cleanArray(borderColors);\n      if (_h.any(borderColors)) for (var i = 0; i < borderColors.length; i++) {\n        if (borderColors[i].indexOf(\"undefined\") !== -1) {\n          borderColors[i] = \"#000000\";\n        }\n      }\n      return [borderStyles, borderWidths, borderColors];\n    };\n\n    var calculateVertexes = function calculateVertexes(cells) {\n      var sCol = 0;\n      var bCol = 0;\n      var sRow = 0;\n      var bRow = 0;\n\n      for (var i = 0; i < cells.length; i++) {\n        var cell = cells[i];\n\n        if (i === 0) {\n          sCol = cell.col;\n          sRow = cell.row;\n        }\n\n        if (cell.col < sCol) sCol = cell.col;\n        if (cell.col > bCol) bCol = cell.col;\n        if (cell.row < sRow) sRow = cell.row;\n        if (cell.row > bRow) bRow = cell.row;\n      }\n\n      return {\n        sCol: sCol,\n        bCol: bCol,\n        sRow: sRow,\n        bRow: bRow\n      };\n    };\n\n    var splitNodeValuePhrase = function splitNodeValuePhrase(valueTemp) {\n      if (_h.isEmpty(valueTemp)) return [];\n      var splits = valueTemp.split(/[+-/*]+/);\n      var array = [];\n\n      for (var j = 0; j < valueTemp.length; j++) {\n        if (valueTemp[j] === '+' || valueTemp[j] === '-' || valueTemp[j] === '/' || valueTemp[j] === '*') {\n          array.push(valueTemp[j]);\n        }\n      }\n\n      var array2 = [];\n\n      for (var i = 0; i < splits.length; i++) {\n        var p = splits[i];\n        if (p.startsWith(\"[node:'\")) array2.push({\n          operator: array[i],\n          code: p.replace(\"[node:'\", \"\").replace(\"']\", \"\"),\n          type: \"node\"\n        });else {\n          array2.push({\n            operator: array[i],\n            code: p,\n            type: \"\"\n          });\n        }\n      }\n\n      return array2;\n    };\n\n    var getCellValues = function getCellValues(cell, type) {\n      var values = [];\n\n      switch (type) {\n        case \"node\":\n          if (!_h.isNullOrEmpty(cell.value) && cell.value.startsWith(\"[node:\")) {\n            var cellInfo = cell.cellInfos[0];\n            var titles = cellInfo.title.split(\"|\");\n            titles = _h.cleanArray(titles);\n            var valueTemp = cell.value.trim();\n            var splits = splitNodeValuePhrase(valueTemp);\n\n            for (var i = 0; i < splits.length; i++) {\n              var target = splits[i];\n              var title = \"\";\n              if (target.type === 'node') title = titles[i];\n              target.title = title;\n              values.push(target);\n            }\n          }\n\n          return values;\n      }\n    };\n\n    var mergeValues = function mergeValues(values, type) {\n      var str = \"\";\n      var item;\n\n      switch (type) {\n        case \"node\":\n          if (values.length === 1 && values[0].type === 'node') str += \"[node:'\" + values[0].code + \"']\";else if (values.length === 1 && values[0].type !== 'node') str += values[0].code;else for (var k = 0; k < values.length; k++) {\n            item = values[k];\n            if (!item.operator) item.operator = \"+\";\n\n            if (item.type === \"node\") {\n              if (values.length !== k + 1) str += \"[node:'\" + item.code + \"']\" + item.operator;else str += \"[node:'\" + item.code + \"']\";\n            } else {\n              if (values.length !== k + 1) str += item.code + item.operator;else str += item.code;\n            }\n          }\n          break;\n\n        case \"nodeTitle\":\n          for (var j = 0; j < values.length; j++) {\n            if (j === 0) {\n              str = values[j].title;\n            } else {\n              str += \"|\" + values[j].title;\n            }\n          }\n\n          break;\n      }\n\n      return str;\n    };\n\n    var isUniqueNode = function isUniqueNode(cell, newCode) {\n      var isUnique = true;\n      var values = getCellValues(cell, \"node\");\n      if (values.length === 0) return true;\n\n      for (var m = 0; m < values.length; m++) {\n        var nodeTarget = values[m];\n\n        if (nodeTarget.code === newCode) {\n          isUnique = false;\n        }\n      }\n\n      return isUnique;\n    };\n\n    var fillCellStyle = function fillCellStyle(cell, model) {\n      if (model.backColor) cell.style.backColor = model.backColor;\n      if (model.textColor) cell.style.textColor = model.textColor;\n      if (model.textAlign) cell.style.textAlign = model.textAlign;\n      if (model.textBold) cell.style.textBold = model.textBold;\n      if (model.textItalic) cell.style.textItalic = model.textItalic;\n      if (model.textUnderline) cell.style.textUnderline = model.textUnderline;\n      if (model.borderStyle) cell.style.borderStyle = model.borderStyle;\n      if (model.borderWidth) cell.style.borderWidth = model.borderWidth;\n      if (model.borderColor) cell.style.borderColor = model.borderColor;\n      if (model.textWrap) cell.style.textWrap = model.textWrap;\n      if (model.textFontFamily) cell.style.textFontFamily = model.textFontFamily;\n      if (model.textFontSize) cell.style.textFontSize = model.textFontSize;\n    };\n\n    var translateBorder = function translateBorder(cell) {\n      if (cell.borderStyle !== undefined && cell.borderStyle !== \"\") {\n        var splits = cell.borderStyle.trim().split(\" \");\n        splits = _h.cleanArray(splits);\n\n        switch (splits.length) {\n          case 1:\n            cell.borderStyle = splits[0] + \" \" + splits[0] + \" \" + splits[0] + \" \" + splits[0];\n            break;\n\n          case 2:\n            cell.borderStyle = splits[0] + \" \" + splits[1] + \" \" + splits[0] + \" \" + splits[1];\n            break;\n\n          case 3:\n            cell.borderStyle = splits[0] + \" \" + splits[1] + \" \" + splits[2] + \" \" + splits[1];\n            break;\n        }\n      } else {\n        cell.borderStyle = \"none none none none\";\n      }\n\n      if (cell.borderWidth !== undefined && cell.borderWidth !== \"\") {\n        var borderWidths = cell.borderWidth.trim().split(\" \");\n        borderWidths = _h.cleanArray(borderWidths);\n\n        switch (borderWidths.length) {\n          case 1:\n            cell.borderWidth = borderWidths[0] + \" \" + borderWidths[0] + \" \" + borderWidths[0] + \" \" + borderWidths[0];\n            break;\n\n          case 2:\n            cell.borderWidth = borderWidths[0] + \" \" + borderWidths[1] + \" \" + borderWidths[0] + \" \" + borderWidths[1];\n            break;\n\n          case 3:\n            cell.borderWidth = borderWidths[0] + \" \" + borderWidths[1] + \" \" + borderWidths[2] + \" \" + borderWidths[1];\n            break;\n        }\n      } else cell.borderWidth = \"0 0 0 0\";\n\n      if (cell.borderColor !== undefined && cell.borderColor !== \"0 0 0 0\" && cell.borderColor !== \"\") {\n        var borderColors = cell.borderColor.trim().split(\" \");\n        borderColors = _h.cleanArray(borderColors);\n\n        switch (borderColors.length) {\n          case 1:\n            cell.borderColor = borderColors[0] + \" \" + borderColors[0] + \" \" + borderColors[0] + \" \" + borderColors[0];\n            break;\n\n          case 2:\n            cell.borderColor = borderColors[0] + \" \" + borderColors[1] + \" \" + borderColors[0] + \" \" + borderColors[1];\n            break;\n\n          case 3:\n            cell.borderColor = borderColors[0] + \" \" + borderColors[1] + \" \" + borderColors[2] + \" \" + borderColors[1];\n            break;\n        }\n      } else cell.borderColor = \"#000000 #000000 #000000 #000000\";\n    };\n\n    var translateCellStyle = function translateCellStyle(cell) {\n      if (!cell.style) return \"\";\n      var st = \"\";\n      if (cell.style.textItalic) st += \"font-style: italic;\";\n      if (cell.style.textBold) st += \"font-weight: bold;\";\n      if (cell.style.textWrap) st += \"white-space: nowrap;\";\n      if (cell.style.textUnderline) st += \"text-decoration: underline;\";\n      if (cell.style.backColor) st += \"background-color:\" + cell.style.backColor + \";\";\n      if (cell.style.textColor) st += \"color:\" + cell.style.textColor + \";\";\n      if (cell.style.textFontFamily) st += \"font-family:\" + cell.style.textFontFamily + \";\";\n      if (cell.style.textFontSize) st += \"font-size:\" + cell.style.textFontSize + \";\";\n      if (cell.style.textAlign) st += \"text-align:\" + cell.style.textAlign + \";\";\n      if (cell.style.borderStyle && cell.style.borderStyle !== \"none none none none\") st += \"border-style:\" + cell.style.borderStyle + \";\";\n      if (cell.style.borderWidth && cell.style.borderWidth !== \"0 0 0 0\") st += \"border-width:\" + cell.style.borderWidth + \";\";\n      if (cell.style.borderColor) st += \"border-color:\" + cell.style.borderColor + \";\";\n      translateBorder(cell);\n      return st;\n    };\n\n    var addCellEvents = function addCellEvents(el, type, ne) {\n      if (type === \"cellSelect\" && !ne) {\n        el.addEventListener(\"click\", function (event) {\n          var table = $(event.target).closest(\"table\");\n          table.find(\".rp-gen-cell\").removeClass(\"tcs-selected\");\n          var td = $(event.target).closest(\".rp-gen-cell\");\n          td.addClass(selectedCellClass);\n          var address = td.attr(\"data-address\");\n          var tag = td.attr(\"data-tag\");\n          var id = td.attr(\"data-id\");\n          var templateTableType = td.attr(\"data-ttType\");\n          var title = td.attr(\"data-title\");\n          table.trigger('selectionchange', {\n            address: address,\n            tag: tag,\n            id: id,\n            templateTableType: templateTableType,\n            title: title\n          });\n          event.preventDefault();\n        });\n        return;\n      }\n\n      el.addEventListener(\"focusin\", function (event) {\n        if (!event.target) return;\n\n        if (event.target.nodeName === \"INPUT\") {\n          var td = $(event.target).closest(\"td\");\n          var address = $(td).attr(\"data-address\");\n\n          if (rgTextBuffer && rgTextBuffer.address != address) {\n            var table = $(\"table:visible\");\n            var model = rgUtil.getModel(table);\n\n            if (model) {\n              var cell = model.cells.filter(function (a) {\n                return a.address === rgTextBuffer.address;\n              });\n\n              if (cell.length && cell[0].text !== rgTextBuffer.text) {\n                rgUtil.addToHistory(table, cell, {\n                  type: \"CellTyping\"\n                }, [{\n                  old: rgTextBuffer.text,\n                  \"new\": cell[0].text\n                }]);\n              }\n            }\n          }\n\n          rgTextBuffer = {\n            address: $(td).attr(\"data-address\"),\n            text: event.target.value\n          };\n        }\n      });\n      el.addEventListener(\"focusout\", function (event) {\n        if (!event.currentTarget) return;\n\n        if (event.currentTarget.nodeName === \"INPUT\") {\n          $(event.currentTarget).css(\"caret-color\", \"\");\n          $(event.currentTarget).find(\"td\").removeClass(selectionEnabled);\n        } else {\n          var target = $(event.currentTarget).find(\"input\");\n          target.css(\"caret-color\", \"\");\n          $(event.currentTarget).removeClass(selectionEnabled);\n        }\n      });\n      el.addEventListener(\"drop\", function (event) {\n        try {\n          event.preventDefault();\n          var dragInfo = event.dataTransfer.getData(\"application/json\");\n          dragInfo = JSON.parse(dragInfo);\n          var el = event.currentTarget;\n          if (event.currentTarget.nodeName !== \"TD\") el = $(event.currentTarget).parent();\n\n          switch (dragInfo.action) {\n            case \"nodeDrag\":\n              handleNodeDrop(el, dragInfo.list, dragInfo.nodeDisplayType);\n              break;\n\n            case \"consolidate\":\n              handleConsolidateDrop(el, dragInfo.model);\n              break;\n\n            case \"tableCol\":\n              handleTableColDrop(el, dragInfo.model);\n              break;\n\n            case \"xbrlConcept\":\n              handleXbrlConceptDrop(el, dragInfo.model);\n              break;\n\n            default:\n              handleSignDrop(el, dragInfo.actionType, dragInfo.dataType);\n              break;\n          }\n\n          _h.activeTooltip(true);\n        } catch (e) {//\n        }\n      });\n      el.addEventListener(\"dragenter\", function (event) {\n        event.preventDefault();\n      });\n      el.addEventListener(\"dragover\", function (event) {\n        event.preventDefault();\n      });\n      el.addEventListener(\"dragover\", function (event) {\n        event.preventDefault();\n      });\n      el.addEventListener(\"click\", function (event) {\n        if (event.shiftKey && event.target.nodeName !== \"IMG\") {\n          if ($(\"#tree_view\").length > 0) {\n            var list = $(\"#tree_view\").treeView(\"getDragList\");\n            var ele = document.getElementsByName('nodeDisplayType');\n            var nodeDisplayType = null;\n\n            for (var i = 0; i < ele.length; i++) {\n              if (ele[i].checked) nodeDisplayType = ele[i].value;\n            }\n\n            if (list.length) {\n              handleNodeDrop(event.target, list, nodeDisplayType);\n\n              _h.activeTooltip(true);\n            }\n          }\n        }\n\n        event.preventDefault();\n      });\n    };\n\n    var handleNodeDrop = function handleNodeDrop(el, dragList, nodeDisplayType) {\n      if (el.nodeName === \"INPUT\") el = el.parentNode;\n      var table = $(el).closest(\"table\");\n      var row = Number($(el).attr(\"data-row\"));\n      var col = Number($(el).attr(\"data-col\"));\n      var isSelectedCell = $(el).hasClass(\"tcs-selected\");\n      var model = rgUtil.getModel(table);\n      var cell = model.cells.filter(function (a) {\n        return a.row === row && a.col === col;\n      })[0];\n\n      switch (nodeDisplayType) {\n        case \"NodeInCell\":\n        case 1:\n          var nodeList = [];\n\n          for (var l = 0; l < dragList.length; l++) {\n            var node = dragList[l];\n\n            if (cellFunc.isUniqueNode(cell, node.code)) {\n              nodeList.push({\n                treeId: node.treeId,\n                code: node.code,\n                operator: \"+\",\n                title: node.path.replace(\" :: \", \"\") + \" (\" + node.code + \")\",\n                type: 'node',\n                periodId: node.periodId\n              });\n            }\n          }\n\n          if (nodeList.length) {\n            rgUtil.selectRangeCells(table, [cell.address], function (res) {\n              var result = rgUtil.executeCommand(table, model, {\n                id: \"NodeInCell\",\n                value: nodeList,\n                cells: [cell]\n              });\n              $(\".txtFormula:visible\").val(cell.value);\n              table.data(\"model\", model);\n              $(\"#tree_view\").treeView(\"clearSelectItems\");\n\n              _h.kocnx().ttvm().focusDesignItem().refreshToolBar(true);\n            });\n          }\n\n          break;\n\n        case \"NodeNameInCell\":\n        case 2:\n          var cells = rgUtil.getSelectedCellModels(table);\n          $(\"#tree_view\").treeView(\"clearSelectItems\");\n          var shapeData = findShapeSelection(cells);\n\n          if (shapeData[0] === \"Ver\") {\n            if (!isSelectedCell) {\n              rgUtil.selectRangeCells(table, [cell.address], function (res) {\n                cells = rgUtil.getSelectedCellModels(table);\n                rgUtil.executeCommand(table, model, {\n                  id: \"NodeNameInCell\",\n                  value: dragList,\n                  cells: cells\n                });\n\n                _h.kocnx().ttvm().focusDesignItem().refreshToolBar(true);\n              });\n            } else {\n              rgUtil.executeCommand(table, model, {\n                id: \"NodeNameInCell\",\n                value: dragList,\n                cells: cells\n              });\n\n              _h.kocnx().ttvm().focusDesignItem().refreshToolBar(true);\n            }\n          }\n\n          break;\n\n        case \"NodeValueNameInCell\":\n        case 3:\n          var cells = rgUtil.getSelectedCellModels(table);\n          $(\"#tree_view\").treeView(\"clearSelectItems\");\n          var shapeData = findShapeSelection(cells);\n\n          if (shapeData[0] === \"Ver\" || shapeData[0] === \"Hor\" && cells.length === 2) {\n            var hasEnoughCol = cells.filter(function (a) {\n              return a.col === cells[0].col + 1;\n            }).length > 0;\n\n            if (!hasEnoughCol) {\n              var text = _h.getApiMessage(\"NotEnoughCol\");\n\n              _h.failToast(text);\n\n              return;\n            }\n\n            var firstColCells = cells.filter(function (a) {\n              return a.col === shapeData[1];\n            });\n            var result = rgUtil.executeCommand(table, model, {\n              id: \"NodeValueNameInCell\",\n              value: dragList,\n              cells: firstColCells\n            });\n\n            _h.kocnx().ttvm().focusDesignItem().refreshToolBar(true);\n          }\n\n          break;\n      }\n    };\n\n    var handleConsolidateDrop = function handleConsolidateDrop(el, data) {\n      var table = $(el).closest(\"table\");\n      var row = $(el).attr(\"data-row\");\n      var col = $(el).attr(\"data-col\");\n      var model = rgUtil.getModel(table);\n      var cell = model.cells.filter(function (a) {\n        return a.row === Number(row) && a.col === Number(col);\n      })[0];\n      var tCell;\n      var isValidCommand = false;\n      var name = data.name;\n      var id = Number(data.id);\n      var isRoot = data.isRoot === \"true\";\n      var cols = $(\".rp-gen-cell[data-col=\" + col + \"]\");\n\n      if (name && id) {\n        switch (model.tableTemplateType) {\n          case 3:\n            if (cell.col === 1 && cell.row > 1 || cell.row === 1 && cell.col > 1) {\n              isValidCommand = true;\n            }\n\n            break;\n\n          case 5:\n            if (cell.col === 1 && cell.row === 1) return;\n\n            if (cell.col === 1 && cell.row > 1 || cell.row === 1 && cell.col > 1 && isRoot) {\n              isValidCommand = true;\n            }\n\n            break;\n\n          case 4:\n            for (var k = 0; k < cols.length; k++) {\n              tCell = model.cells.filter(function (a) {\n                return a.row === k + 1 && a.col === Number(col);\n              })[0];\n\n              if (!_h.isNullOrEmpty(tCell) && !_h.isNullOrEmpty(tCell.value) && tCell.value.indexOf(\"Consolidate\") !== -1) {\n                var cellElement = $(table).find('[data-col=\"' + cell.col + '\"][data-row=\"' + cell.row + '\"]');\n                var target = $(cellElement).find(\".cell-infos\");\n                $(target).empty();\n              }\n            }\n\n            isValidCommand = true;\n            break;\n\n          default:\n            isValidCommand = true;\n            break;\n        }\n\n        if (isValidCommand) {\n          rgUtil.selectRangeCells(table, [cell.address], function (res) {\n            rgUtil.executeCommand(table, model, {\n              id: \"Consolidate\",\n              value: [id, name],\n              cells: [cell]\n            });\n\n            _h.kocnx().ttvm().focusDesignItem().refreshToolBar(true);\n          });\n        }\n\n        for (var l = 0; l < cols.length; l++) {\n          tCell = model.cells.filter(function (a) {\n            return a.row === l + 1 && a.col === Number(col);\n          })[0];\n          if (isRoot) tCell.extraParams.valueSource = 1;else tCell.extraParams.valueSource = 2;\n        }\n\n        table.data(\"model\", model);\n      }\n    };\n\n    var handleTableColDrop = function handleTableColDrop(el, data) {\n      var table = $(el).closest(\"table\");\n      var model = rgUtil.getModel(table);\n      var address = $(el).attr(\"data-address\");\n      var row = Number($(el).attr(\"data-row\"));\n      var col = Number($(el).attr(\"data-col\"));\n      var cell = model.cells.filter(function (a) {\n        return a.address === address;\n      })[0];\n\n      var _getColumnActiveRow = getColumnActiveRow(model, true),\n          _getColumnActiveRow2 = _slicedToArray(_getColumnActiveRow, 2),\n          rowNumber = _getColumnActiveRow2[0],\n          rowNumberSign = _getColumnActiveRow2[1];\n\n      if (rowNumber && rowNumber !== Number(row) || rowNumberSign && rowNumberSign !== Number(row)) {\n        _h.removeDragLabel();\n\n        toast.custom(\"error\", _h.getApiMessage('RpError1'));\n        return;\n      }\n\n      if (model.tableId && model.tableId !== data.tableId) {\n        _h.removeDragLabel();\n\n        toast.custom(\"error\", _h.getApiMessage('RpError2'));\n        return;\n      }\n\n      var hasRowNumberCellInfo = model.cells.filter(function (a) {\n        return a.col === col && !_h.isNullOrEmpty(a.value) && a.value.indexOf(\"info:'25'\") !== -1;\n      }).length > 0;\n\n      if (hasRowNumberCellInfo) {\n        _h.removeDragLabel();\n\n        toast.custom(\"error\", _h.getApiMessage('RpError3'));\n        return;\n      }\n\n      var mTableId = model.tableId;\n      model.tableId = data.tableId;\n      rgUtil.executeCommand(table, model, {\n        id: \"Column\",\n        value: data,\n        cells: [cell],\n        extraObj: {\n          tableId: mTableId\n        }\n      }); //todo extraobj??\n\n      _h.removeDragLabel();\n    };\n\n    var handleSignDrop = function handleSignDrop(el, action, dt) {\n      var table = $(el).closest(\"table\");\n      var row = Number($(el).attr(\"data-row\"));\n      var col = Number($(el).attr(\"data-col\"));\n      var model = rgUtil.getModel(table);\n\n      if (model.tableTemplateType !== 4 && (action === \"GroupSum\" || action === \"ColumnSum\")) {\n        return;\n      }\n\n      if (model.tableTemplateType === 4 && action !== \"GroupSum\" && action !== \"ColumnSum\") {\n        return;\n      }\n\n      var cell = model.cells.filter(function (a) {\n        return a.row === row && a.col === col;\n      })[0];\n      var isPartialSum = action === \"PartialSum\";\n      var selectedCells = rgUtil.getSelectedCellModels(table);\n\n      if (selectedCells.length > 1) {\n        if (action === \"info:'25'\") return;\n        var inSelectedZone = false;\n        var inSameCol = true;\n\n        for (var j = 0; j < selectedCells.length; j++) {\n          var selectedCell = selectedCells[j];\n          if (selectedCell.address === cell.address) inSelectedZone = true;\n          if (cell.col !== selectedCell.col) inSameCol = false;\n        }\n\n        if (!isPartialSum) {\n          if (!inSelectedZone) addValues(table, cell, action);\n          if (inSelectedZone) for (var i = 0; i < selectedCells.length; i++) {\n            var targetCell = selectedCells[i];\n            rgUtil.executeCommand(table, model, {\n              id: action,\n              value: action,\n              cells: [targetCell]\n            });\n          }\n          return;\n        }\n\n        if (inSelectedZone) {\n          toast.custom(\"error\", _h.getApiMessage('RpError4'));\n          return;\n        }\n\n        if (!inSameCol) {\n          toast.custom(\"error\", _h.getApiMessage('RpError5'));\n          return;\n        }\n\n        rgUtil.executeCommand(table, model, {\n          id: action,\n          value: selectedCells,\n          cells: [cell],\n          cellsEffected: selectedCells\n        });\n      } else {\n        if (isPartialSum) {\n          toast.custom(\"error\", _h.getApiMessage('RpError6'));\n          return;\n        }\n\n        if (action === \"info:'25'\") {\n          var res = hasColTableColumn(model, Number(col));\n\n          if (res) {\n            toast.custom(\"error\", _h.getApiMessage('RpError7'));\n            return;\n          } else {\n            var info = getColumnActiveRow(model);\n\n            if (info[0] && info[0] !== row) {\n              toast.custom(\"error\", _h.getApiMessage('RpError8'));\n              return;\n            }\n\n            rgUtil.executeCommand(table, model, {\n              id: action,\n              value: action,\n              cells: [cell]\n            });\n          }\n        } else {\n          rgUtil.selectRangeCells(table, [cell.address], function () {\n            rgUtil.executeCommand(table, model, {\n              id: action,\n              value: action,\n              cells: [cell]\n            });\n          });\n        }\n      }\n\n      table.data(\"model\", model);\n      setTimeout(function () {\n        _h.kocnx().ttvm().focusDesignItem().refreshToolBar(true);\n      }, 50);\n    };\n\n    var handleXbrlConceptDrop = function handleXbrlConceptDrop(el, data) {\n      var table = $(el).closest(\"table\");\n      var row = Number($(el).attr(\"data-row\"));\n      var col = Number($(el).attr(\"data-col\"));\n      var model = rgUtil.getModel(table);\n      var cell = model.cells.filter(function (a) {\n        return a.row === row && a.col === col;\n      })[0];\n\n      if (cell) {\n        rgUtil.executeCommand(table, model, {\n          id: \"xbrlConcept\",\n          value: {\n            id: data.id,\n            title: data.title\n          },\n          cells: [cell]\n        });\n      }\n    };\n\n    var findShapeSelection = function findShapeSelection(cells) {\n      if (cells.length === 1) {\n        return ['Ver', cells[0].col, cells[0].row];\n      } else {\n        var points = rgUtil.getRectanglePoints(cells);\n\n        if (points.sCol !== points.bCol && points.sRow !== points.bRow) {\n          return ['Ver', cells[0].col, cells[0].row];\n        }\n\n        if (points.sCol === points.bCol && points.sRow !== points.bRow) {\n          return ['Ver', points.sCol, cells[0].sRow];\n        }\n\n        if (points.sCol !== points.bCol && points.sRow === points.bRow) {\n          return ['Hor', points.sCol, cells[0].sRow];\n        }\n      }\n    };\n\n    var getColumnActiveRow = function getColumnActiveRow(model, chkRowNumberSign) {\n      var rowNumber, rowNumberSign;\n\n      for (var i = 0; i < model.cells.length; i++) {\n        var cell = model.cells[i];\n\n        if (cell.columnId) {\n          rowNumber = cell.row;\n        }\n\n        if (chkRowNumberSign && !_h.isNullOrEmpty(cell.value) && cell.value.indexOf(\"info:'25'\") !== -1) {\n          rowNumberSign = cell.row;\n        }\n      }\n\n      return [rowNumber, rowNumberSign];\n    };\n\n    var hasColTableColumn = function hasColTableColumn(model, col) {\n      var has = false;\n\n      for (var i = 0; i < model.cells.length; i++) {\n        var cell = model.cells[i];\n\n        if (cell.col === col && cell.columnId && model.tableId) {\n          has = true;\n        }\n      }\n\n      return has;\n    };\n\n    var pasteCell = function pasteCell(table, cell, oldCell, colsCount, rowsCount) {\n      if (oldCell[\"backColor\"]) {\n        var dataCopy = _objectSpread({}, oldCell);\n\n        cell.style = dataCopy;\n      } else if (!_h.isNullOrEmpty(oldCell[\"text\"])) {\n        cell.text = oldCell.text;\n        cell.cellInfos = [];\n        var copyValue = true;\n        if (_h.any(oldCell.cellInfos)) for (var j = 0; j < oldCell.cellInfos.length; j++) {\n          var cellInfo = oldCell.cellInfos[j];\n\n          if (cellInfo.type !== 24) {\n            cell.cellInfos.push({\n              title: cellInfo.title,\n              type: cellInfo.type\n            });\n          } else {\n            copyValue = false;\n          }\n        }\n        if (copyValue) cell.value = oldCell.value;\n\n        if (cell.value && cell.value.startsWith(\"=\")) {\n          refreshFormulaCell(table, cell, oldCell.address, colsCount, rowsCount);\n        }\n\n        if (!_h.isNullOrEmpty(oldCell.style)) {\n          var dataCopy = _objectSpread({}, oldCell.style);\n\n          cell.style = dataCopy;\n        }\n\n        if (!_h.isNullOrEmpty(oldCell.extraParams)) {\n          var dataCopy = _objectSpread({}, oldCell.extraParams);\n\n          cell.extraParams = dataCopy;\n        }\n\n        if (oldCell.linkedTemplate) {\n          var dataCopy = _objectSpread({}, oldCell.linkedTemplate);\n\n          cell.linkedTemplate = dataCopy;\n        }\n      } else {\n        cell.text = oldCell;\n      }\n\n      tagRender.applyToElement(table, cell, \"paste\");\n    };\n\n    var copyCell = function copyCell(cell) {\n      return {\n        text: cell.text,\n        value: cell.value,\n        address: cell.address,\n        cellInfos: cell.cellInfos,\n        style: cell.style,\n        linkedTemplate: cell.linkedTemplate,\n        extraParams: cell.extraParams,\n        columnId: cell.columnId,\n        xbrlConcept: cell.xbrlConcept,\n        tableId: cell.tableId\n      };\n    };\n\n    var cutCell = function cutCell(table, model, cell, defaultVal) {\n      var json = copyCell(cell);\n      cell.text = \"\";\n      cell.value = \"\";\n      cell.linkedTemplate = undefined;\n      cell.extraParams = createEmptyModel(\"extraParams\", null, null, model.accountType, null);\n      cell.style = createEmptyModel(\"style\", null, null, null, defaultVal);\n      cell.cellinfos = [];\n      tagRender.applyToElement(table, cell, \"cut\");\n      return json;\n    };\n\n    var createEmptyModel = function createEmptyModel(part, col, row, accountType, defaultVal) {\n      var extraParams = {\n        financialPeriod: 0,\n        minusRedText: false,\n        minusParenthese: false,\n        dataType: 1,\n        decimals: 0,\n        negate: null,\n        accountType: accountType,\n        percent: false,\n        valueSource: 1,\n        valueAccountType: 0,\n        valueDisplay: 1,\n        zeroDisplay: 1,\n        roundingApproach: 1\n      };\n      var style = {\n        backColor: \"\",\n        textColor: \"\",\n        textAlign: \"\",\n        textBold: false,\n        textItalic: false,\n        textUnderline: false,\n        textWrap: false,\n        textFontFamily: \"\",\n        textFontSize: \"\",\n        borderStyle: \"none none none none\",\n        borderWidth: \"0 0 0 0\",\n        borderColor: \"#000000 #000000 #000000 #000000\"\n      };\n\n      if (defaultVal) {\n        if (defaultVal.textColor) style.textColor = defaultVal.textColor;\n        if (defaultVal.backColor) style.backColor = defaultVal.backColor;\n        if (defaultVal.textFontFamily) style.textFontFamily = defaultVal.textFontFamily;\n        if (defaultVal.textFontSize) style.textFontSize = defaultVal.textFontSize;\n        if (defaultVal.align) style.textAlign = defaultVal.align;\n      }\n\n      switch (part) {\n        case \"extraParams\":\n          return extraParams;\n\n        case \"style\":\n          return style;\n\n        case \"cell\":\n          return {\n            row: row,\n            col: col,\n            address: _h.numberToAlphabet(col) + row,\n            hidden: false,\n            warning: false,\n            warningMessage: \"\",\n            xbrlConcept: undefined,\n            colSpan: 1,\n            rowSpan: 1,\n            text: \"\",\n            oldAddress: \"\",\n            hasError: false,\n            value: \"\",\n            tag: \"\",\n            dynamicValue: \"\",\n            redText: false,\n            cellInfos: [],\n            columnId: undefined,\n            tableId: undefined,\n            extraParams: extraParams,\n            style: style\n          };\n      }\n    };\n\n    var refreshFormulaCell = function refreshFormulaCell(table, cell, lastAddress, colsCount, rowsCount) {\n      var str = cell.value;\n      var temp, letter, number, last, lastNumber, lastLetter, isRowCopy, isColCopy;\n\n      if ((str.indexOf(\"+\") !== -1 || str.indexOf(\"-\") !== -1 || str.indexOf(\"*\") !== -1 || str.indexOf(\"/\") !== -1) && str.indexOf(\":\") === -1) {\n        lastNumber = Number(lastAddress.replace(/^\\D+/g, ''));\n        lastLetter = lastAddress.replace(lastNumber, \"\");\n        var parser = new _util_expparser_js__WEBPACK_IMPORTED_MODULE_0__.ExpParser();\n        isRowCopy = lastNumber === cell.row;\n        isColCopy = lastLetter === _h.numberToAlphabet(cell.col);\n\n        if (isColCopy) {\n          if (cell.row < lastNumber) {\n            cell.value = \"\";\n            cell.cellInfos = [];\n            return;\n          }\n\n          str = parser.afterColCopy(str, colsCount, rowsCount, cell.row, lastNumber);\n\n          if (!_h.isNullOrEmpty(str) && str !== \"\") {\n            cell.value = str;\n          } else {\n            cell.value = \"\";\n            cell.cellInfos = [];\n          }\n        }\n\n        if (isRowCopy) {\n          temp = str.replace(/[\\])}[{(=]/g, '');\n          temp = _h.replaceAll(temp, ' ', '');\n\n          var splits = _h.splitMulti(temp, ['+', '-', '*', '/']);\n\n          splits = _h.cleanArray(splits);\n          var sameCol = true;\n          var rArray = [],\n              rArray2 = [];\n          if (_h.any(splits)) for (var i = 0; i < splits.length; i++) {\n            number = splits[i].replace(/^\\D+/g, '');\n            letter = splits[i].replace(number, '');\n            if (i === 0) last = letter;\n            if (letter !== \"\" && letter !== last) sameCol = false;\n          }\n\n          if (sameCol && lastNumber === cell.row) {\n            for (var k = 0; k < splits.length; k++) {\n              number = splits[k].replace(/^\\D+/g, '');\n              letter = splits[k].replace(number, \"\");\n\n              if (letter !== \"\" && rArray.indexOf(letter) === -1) {\n                rArray.push(letter);\n              }\n            }\n\n            if (_h.any(rArray)) {\n              for (var j = 0; j < rArray.length; j++) {\n                str = _h.replaceAll(str, rArray[j], _h.numberToAlphabet(cell.col));\n              }\n            }\n\n            str = parser.minMaxControl(str, colsCount, rowsCount);\n\n            if (!_h.isNullOrEmpty(str) && str !== \"\") {\n              cell.value = str;\n            } else {\n              cell.value = \"\";\n              cell.cellInfos = [];\n            }\n          }\n        }\n      } else if (str.indexOf(\"Sum\") !== -1 && str.indexOf(\":\") !== -1) {\n        temp = str.replace(\"=Sum(\", \"\").replace(\")\", \"\").split(\":\");\n\n        if (temp.length > 1) {\n          letter = temp[0];\n          lastNumber = lastAddress.replace(/^\\D+/g, '');\n          lastLetter = lastAddress.replace(lastNumber, \"\");\n          isRowCopy = Number(lastNumber) === cell.row;\n          isColCopy = lastLetter === _h.numberToAlphabet(cell.col);\n\n          if (isColCopy && Number(lastNumber) < cell.row) {\n            var sNumber = cell.row - Number(lastNumber) + Number(temp[1]);\n            var eNumber = cell.row - Number(lastNumber) + Number(temp[2]);\n            cell.value = \"=Sum(\" + _h.numberToAlphabet(cell.col) + \":\" + sNumber + \":\" + eNumber + \")\";\n          }\n\n          if (isRowCopy) {\n            if (Number(lastNumber) === cell.row) cell.value = \"=Sum(\" + _h.numberToAlphabet(cell.col) + \":\" + temp[1] + \":\" + temp[2] + \")\";else {\n              cell.value = \"\";\n              cell.cellInfos = [];\n            }\n          }\n        }\n      } else if ((str.indexOf(\"Sum\") !== -1 || str.indexOf(\"GSum\") !== -1 || str.indexOf(\"CSum\") !== -1) && str.indexOf(\":\") === -1) {\n        lastNumber = lastAddress.replace(/^\\D+/g, '');\n        lastLetter = lastAddress.replace(lastNumber, \"\");\n\n        if (cell.row === 1) {\n          cell.value = \"\";\n          cell.cellInfos = [];\n        }\n\n        if (Number(lastNumber) === cell.row && str.indexOf(\"Sum\") !== -1) {\n          cell.value = \"=Sum(\" + _h.numberToAlphabet(cell.col) + \")\";\n        }\n\n        if (Number(lastNumber) === cell.row && str.indexOf(\"GSum\") !== -1) {\n          cell.value = \"=GSum(\" + _h.numberToAlphabet(cell.col) + \")\";\n        }\n\n        if (Number(lastNumber) === cell.row && str.indexOf(\"CSum\") !== -1) {\n          cell.value = \"=CSum(\" + _h.numberToAlphabet(cell.col) + \")\";\n        }\n      } else if (str.indexOf(\"Avg\") !== -1 || str.indexOf(\"Max\") !== -1 || str.indexOf(\"Min\") !== -1) {\n        var st = rgUtil.getFormulaType(str);\n        lastNumber = lastAddress.replace(/^\\D+/g, '');\n        lastLetter = lastAddress.replace(lastNumber, \"\");\n\n        if (cell.row === 1) {\n          cell.value = \"\";\n          cell.cellInfos = [];\n        } else {\n          cell.value = \"=\" + st + \"(\" + _h.numberToAlphabet(cell.col) + \")\";\n        }\n      }\n    };\n\n    return {\n      addExtraParams: addExtraParams,\n      eraseCell: eraseCell,\n      isUniqueNode: isUniqueNode,\n      hasItem: hasItem,\n      addValues: addValues,\n      addCellEvents: addCellEvents,\n      translateCellStyle: translateCellStyle,\n      translateBorder: translateBorder,\n      pasteCell: pasteCell,\n      copyCell: copyCell,\n      cutCell: cutCell,\n      fillCellStyle: fillCellStyle,\n      createEmptyModel: createEmptyModel,\n      getCellValues: getCellValues,\n      addStyles: addStyles,\n      calculateVertexes: calculateVertexes,\n      setText: setText\n    };\n  }();\n\n  var rgUtil = function () {\n    var getDefault = function getDefault() {\n      var model = {};\n      var data = clientStorage.getSetting(\"DefaultTemplateStyle\");\n\n      if (!_h.isEmpty(data)) {\n        model = JSON.parse(data);\n        if (!model.textFontSize) model.textFontSize = \"12px\";\n        if (!model.textFontFamily) model.textFontFamily = \"Nazanin\";\n      } else {\n        return {\n          textColor: \"\",\n          backColor: \"\",\n          textFontSize: \"12px\",\n          textFontFamily: \"Nazanin\",\n          align: undefined\n        };\n      }\n\n      return model;\n    };\n\n    var addTableEvents = function addTableEvents($table) {\n      $table.on('mouseover', onMouseOver).on('mousedown', onMouseDown).on('mouseup', onMouseUp).on(\"keydown\", onKeyDown).on(\"dblclick\", onDoubleClick).on('contextmenu', onContextMenu);\n      var table = $table[0];\n      $(document).on(\"keydown\", \"#\" + table.id, onKeyDown);\n      $(table.ownerDocument).on('click', function (event) {\n        isMouseDown = false;\n        $table.trigger('outOfTable', [event.target]);\n      });\n      $(document).on(\"copy\", \"#\" + table.id, function (event) {\n        if ($(event.target).hasClass(\"cell-input\")) {\n          var tTable = $(event.originalEvent.target).closest(\"table\");\n          copyCellsData(event.originalEvent, tTable);\n        }\n\n        if (!$(event.target).hasClass(\"cell-input\")) {\n          var $ta = $(\".tcs:visible\");\n\n          if ($ta.length) {\n            copyCellsData(event.originalEvent, $ta);\n          }\n        }\n      });\n      $(document).on(\"paste\", \"#\" + table.id, function (event) {\n        if ($(event.target).hasClass(\"cell-input\")) {\n          var tTable = $(event.originalEvent.target).closest(\"table\");\n          pasteCellsData(event.originalEvent, tTable);\n\n          _h.activeTooltip(true);\n        }\n\n        if (!$(event.target).hasClass(\"cell-input\")) {\n          var $ta = $(\".tcs:visible\");\n          pasteCellsData(event.originalEvent, $ta);\n\n          _h.activeTooltip(true);\n        }\n      });\n      $(document).on(\"cut\", \"#\" + table.id, function (event) {\n        if ($(event.target).hasClass(\"cell-input\")) {\n          var tTable = $(event.originalEvent.target).closest(\"table\");\n          cutCellsData(event.originalEvent, tTable);\n\n          _h.activeTooltip(true);\n        }\n\n        if (!$(event.target).hasClass(\"cell-input\")) {\n          var $ta = $(\".tcs:visible\");\n          cutCellsData(event.originalEvent, $ta);\n\n          _h.activeTooltip(true);\n        }\n      });\n    };\n\n    var onContextMenu = function onContextMenu(event) {\n      if (event.target.nodeName === \"TH\") {\n        $(event.currentTarget).trigger('contextMenu', event.target);\n        return false;\n      }\n\n      if ((event.target.nodeName === \"TD\" || event.target.nodeName === \"INPUT\") && event.shiftKey) {\n        $(event.currentTarget).trigger('contextMenu', event.target);\n        return false;\n      }\n    };\n\n    var onDoubleClick = function onDoubleClick(evt) {\n      if (evt.target.className.indexOf(\"rp-gen-col\") !== -1) {\n        var col = Number($(evt.target).attr(\"data-col\"));\n        var bWidth = 0;\n        var colWidth = Number($(evt.target).css(\"width\").replace(\"px\", \"\"));\n        var cells = $(\".rp-gen-cell[data-col='\" + col + \"']\");\n\n        for (var i = 0; i < cells.length; i++) {\n          var cell = cells[i];\n          var scrollWidth = cell.scrollWidth;\n\n          if (scrollWidth > colWidth) {\n            if (i === 0) {\n              bWidth = scrollWidth;\n            } else {\n              if (scrollWidth > bWidth) {\n                bWidth = scrollWidth;\n              }\n            }\n          }\n        }\n\n        if (bWidth > 0) $(evt.target).css(\"width\", bWidth + \"px\");\n      }\n\n      if (evt.target.className.indexOf(\"cell-input\") !== -1) {\n        $(evt.target).css(\"caret-color\", \"black\");\n        $(evt.target).closest(\"td\").addClass(selectionEnabled);\n      }\n\n      if (evt.target.className.indexOf(\"rp-gen-cell\") !== -1) {\n        $(evt.target).find(\"input\").css(\"caret-color\", \"black\");\n        $(evt.target).addClass(selectionEnabled);\n      }\n    };\n\n    var isArrowKey = function isArrowKey(evt) {\n      return evt.keyCode === 38 || evt.keyCode === 39 || evt.keyCode === 40 || evt.keyCode === 37;\n    };\n\n    var onKeyDown = function onKeyDown(evt) {\n      evt.stopPropagation();\n\n      if (isArrowKey(evt)) {\n        var _document$activeEleme;\n\n        (_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.blur();\n      }\n\n      var $table = $(evt.currentTarget);\n      var cells = getSelectedCells($table);\n      if (cells.length === 0) return;\n      var bCol = 0;\n      var sRow = 0;\n      var sCol = 0;\n      var $cell;\n      var endCol = $table.find(\".rp-gen-col\").length;\n      var endRow = $table.find(\".first-cell\").length;\n      cells.each(function (key, cell) {\n        var row = Number($(cell).attr(\"data-row\"));\n        var col = Number($(cell).attr(\"data-col\"));\n\n        if (key === 0) {\n          sCol = col;\n          bCol = col;\n          sRow = row;\n        } else {\n          if (sCol > col) sCol = col;\n          if (bCol < col) bCol = col;\n          if (sRow > row) sRow = row;\n        }\n      });\n      $cell = $table.find('td[data-col=\"' + bCol + '\"][data-row=\"' + sRow + '\"]');\n\n      switch (evt.keyCode) {\n        case 37:\n          $cell = $table.find('td[data-col=\"' + sCol + '\"][data-row=\"' + sRow + '\"]');\n\n          if ($cell) {\n            var nextCell = $cell.next();\n            if (nextCell.length) selectNextCell(nextCell.attr(\"data-col\"), nextCell.attr(\"data-row\"), $table, $cell, true);else {\n              if (sCol + 1 > endCol && sRow + 1 <= endRow) selectNextCell(1, sRow + 1, $table, $cell, true);\n              if (sCol + 1 > endCol && sRow + 1 > endRow) selectNextCell(1, 1, $table, $cell, true);\n            }\n            $table[0].parentNode.scrollLeft -= 40;\n          }\n\n          break;\n\n        case 38:\n          selectNextCell(bCol, sRow - 1, $table, $cell, true);\n          window.scrollBy(0, -10);\n          break;\n\n        case 39:\n          if ($cell.length) {\n            var prevCell = $cell.prev();\n\n            if (prevCell.length && !prevCell.hasClass(\"first-cell\")) {\n              selectNextCell(prevCell.attr(\"data-col\"), prevCell.attr(\"data-row\"), $table, $cell, true);\n              $table[0].parentNode.scrollLeft += 40;\n            }\n          }\n\n          break;\n\n        case 40:\n          if ($cell) {\n            selectNextCell(bCol, sRow + 1, $table, $cell, true);\n            window.scrollBy(0, 10);\n          }\n\n          break;\n\n        case 13:\n          var input = $cell.find(\"input\");\n          var val = $(input).val();\n\n          if (val && val.startsWith(\"=\")) {\n            $(input).val(\"\");\n            var formulaInput = $table.parent().parent().parent().find(\".txtFormula\");\n            $(formulaInput).val(val);\n            var e = jQuery.Event(\"keydown\");\n            e.which = 13;\n            $(formulaInput).trigger(e, val);\n          }\n\n          break;\n\n        case 16:\n          break;\n\n        default:\n          if (!evt.ctrlKey) {\n            $(evt.target).css(\"caret-color\", \"black\");\n            var model = rgUtil.getModel($table);\n            var celldata = model.cells.filter(function (a) {\n              return a.address === cells[0].getAttribute(\"data-address\");\n            })[0];\n\n            if (celldata.cellInfos && celldata.cellInfos.length > 0) {\n              return false;\n            }\n\n            setTimeout(function () {\n              var txt = $(evt.target).val();\n              celldata.text = txt;\n            }, 10);\n          }\n\n          break;\n      }\n    };\n\n    var selectGroupCells = function selectGroupCells($table, cells) {\n      deselectAll($table);\n\n      for (var i = 0; i < cells.length; i++) {\n        var cellTag = $table.find('td[data-address=\"' + cells[i] + '\"]');\n\n        if (cellTag.length) {\n          cellTag.addClass(selectedCellClass);\n        }\n      }\n\n      $table.trigger('selectionchange');\n    };\n\n    var selectNextCell = function selectNextCell(col, row, $table, $cell, focus) {\n      if (!$cell) return;\n      var nextCell = $table.find('td[data-col=\"' + col + '\"][data-row=\"' + row + '\"]');\n\n      if (nextCell.length) {\n        var data = $table.data(dataKey);\n        data.selFrom = getCoordinates(nextCell);\n        data.selFrom.$el = nextCell;\n        $cell.removeClass(selectedCellClass);\n        $cell.find(\"input\").css(\"caret-color\", \"\");\n        deselectAll($table);\n        nextCell.addClass(selectedCellClass);\n\n        if (focus) {\n          nextCell.find(\"input\").focus();\n        }\n\n        data.$pointX1 = nextCell.offset().left;\n        data.$pointX1width = nextCell.offset().left + nextCell.width();\n        data.$pointY1 = nextCell.offset().top;\n        data.$pointY1height = nextCell.offset().top + nextCell.height();\n        data.isHighlighted = nextCell.hasClass(selectedCellClass);\n        $table.data(dataKey, data);\n        $table.trigger('selectionchange');\n      }\n    };\n\n    var onMouseOver = function onMouseOver(event) {\n      if (event.ctrlKey) return;\n      var pluginData = getPluginDataByEvent(event);\n      var $table = pluginData.$table;\n      var $cell = pluginData.$cell;\n      if ($cell.length === 0) return;\n      var data = pluginData.data;\n      data.$currCell = $cell;\n      if (!isMouseDown) return false;\n      $table.find('.' + selectionEnabled).removeClass(selectionEnabled);\n      data.selTo = getCoordinates($cell);\n      setPointCoordinates(data, $cell);\n      coordinateManipulateMagic($table, data);\n      selectCells($table, data);\n      $table.data(data);\n      return true;\n    };\n\n    var findRectangle = function findRectangle(pointA, pointB) {\n      var first, second;\n\n      if (pointA.address < pointB.address) {\n        first = pointA;\n        second = pointB;\n      } else {\n        first = pointB;\n        second = pointA;\n      }\n\n      var array = [];\n\n      for (var i = first.col; i < second.col + 1; i++) {\n        for (var j = first.row; j < second.row + 1; j++) {\n          var col = _h.numberToAlphabet(i);\n\n          array.push(col + j);\n        }\n      }\n\n      return array;\n    };\n\n    var onMouseDown = function onMouseDown(event) {\n      var pluginData = getPluginDataByEvent(event);\n      var $table = pluginData.$table;\n      var $cell = pluginData.$cell;\n      var isRightClick = isRightMouseButton(event);\n      if (isRightClick && event.shiftKey) return;\n      if ($cell.length === 0) return;\n\n      if (event.shiftKey) {\n        var cells = getSelectedCells($table);\n\n        if (cells.length === 1) {\n          var addressList = findRectangle({\n            address: $(cells[0]).attr(\"data-address\"),\n            col: Number($(cells[0]).attr(\"data-col\")),\n            row: Number($(cells[0]).attr(\"data-row\"))\n          }, {\n            address: $cell.attr(\"data-address\"),\n            col: Number($cell.attr(\"data-col\")),\n            row: Number($cell.attr(\"data-row\"))\n          });\n\n          for (var i = 0; i < addressList.length; i++) {\n            var $tCell = $table.find('td[data-address=\"' + addressList[i] + '\"]');\n            $tCell.addClass(selectedCellClass);\n          }\n\n          $table.trigger('selectionchange');\n          return true;\n        }\n      }\n\n      if ($cell[0].nodeName === \"TD\" && isRightClick) {\n        deselectAll($table);\n        $cell.addClass(selectedCellClass);\n        $table.trigger('selectionchange');\n        return true;\n      }\n\n      if (event.ctrlKey) {\n        $cell.addClass(selectedCellClass);\n        $table.trigger('selectionchange');\n        return true;\n      }\n\n      if ($cell[0].nodeName === \"TH\" && !isRightClick) {\n        deselectAll($table);\n\n        if ($cell.hasClass(\"rp-gen-col\")) {\n          var colId = Number($cell.attr(\"data-col\"));\n          $table.find('td[data-col=\"' + colId + '\"]').addClass(selectedCellClass);\n          $table.trigger('selectionchange');\n        }\n\n        if ($cell.hasClass('first-cell')) {\n          var rowId = Number($cell.attr(\"data-row\"));\n          $table.find('td[data-row=\"' + rowId + '\"]').addClass(selectedCellClass);\n          $table.trigger('selectionchange');\n        }\n\n        return;\n      }\n\n      if ($cell[0].nodeName === \"TH\" && isRightClick) return;\n      var data = pluginData.data;\n      isMouseDown = true;\n      data.selFrom = getCoordinates($cell);\n      data.selFrom.$el = $cell;\n      deselectAll($table);\n      $cell.addClass(selectedCellClass);\n      var offSet = $cell.offset();\n      data.$pointX1 = offSet.left;\n      data.$pointX1width = offSet.left + $cell.width();\n      data.$pointY1 = offSet.top;\n      data.$pointY1height = offSet.top + $cell.height();\n      data.isHighlighted = $cell.hasClass(selectedCellClass);\n      $table.data(data);\n      return true;\n    };\n\n    var onMouseUp = function onMouseUp(event) {\n      var pluginData = getPluginDataByEvent(event);\n      var data = pluginData.data;\n      isMouseDown = false;\n      data.selFrom = false;\n      data.selTo = false;\n      pluginData.$table.data(data); // if (event.target.nodeName != \"IMG\")  //why this line add before??\n\n      pluginData.$table.trigger('selectionchange');\n      return true;\n    };\n\n    var selectCells = function selectCells($table, data) {\n      deselectAll($table);\n      var cells = $table[0].getElementsByTagName(\"td\");\n\n      for (var i = 0; i < cells.length; i++) {\n        var cell = $(cells[i]);\n        var offset = cell.offset();\n        data.$elemX = offset.left;\n        data.$elemXwidth = offset.left + cell.width();\n        data.$elemY = offset.top;\n        data.$elemXheight = offset.top + cell.height();\n\n        if (data.$elemX >= data.$pointXmin && data.$elemXwidth <= data.$pointXwidth && data.$elemXwidth <= data.$pointXwidth && data.$elemY >= data.$pointYmin && data.$elemY <= data.$pointYheight && data.$elemYheight >= data.$pointYheight && cells[i].nodeName === \"TD\") {\n          cells[i].classList.toggle(selectedCellClass);\n        }\n      }\n    };\n\n    var getTable = function getTable(el) {\n      var table;\n\n      if ($(el).hasClass(\"rp-gen\")) {\n        table = el.find(\"table\");\n      }\n\n      if ($(el).hasClass(\"tsc-cs\") || $(el).hasClass(\"tsc-ed\")) {\n        table = el;\n      }\n\n      if (!table) {\n        var table = $(el).closest(\"table\");\n      }\n\n      var model = rgUtil.getModel(table);\n\n      if (!model) {\n        var parent = $(el).closest(\".rg-c\");\n        var id = $(parent).attr(\"id\");\n        table = $(\"#\" + id).find(\"table.tcs\");\n      }\n\n      return table;\n    };\n\n    var getModel = function getModel(el) {\n      if (el.nodeName === \"Table\") {\n        return $(table).data('model');\n      }\n\n      var table = $(el).closest(\"table\");\n      return $(table).data('model');\n    };\n\n    var getSelectedCells = function getSelectedCells($table) {\n      return $table.find('.' + selectedCellClass);\n    };\n\n    var getSelectedCellModels = function getSelectedCellModels(table) {\n      var elements = getSelectedCells(table);\n      var model = rgUtil.getModel(table);\n      var cells = [];\n\n      for (var i = 0; i < elements.length; i++) {\n        var row = $(elements[i]).attr(\"data-row\");\n        var col = $(elements[i]).attr(\"data-col\");\n        var cell = model.cells.filter(function (a) {\n          return a.row === Number(row) && a.col === Number(col);\n        })[0];\n        cells.push(cell);\n      }\n\n      return cells;\n    };\n\n    var getCoordinates = function getCoordinates($cell) {\n      var cell = $cell[0];\n      var colspan = cell.getAttribute('colspan');\n      var rowspan = cell.getAttribute('rowspan');\n      return {\n        x: parseInt(cell.getAttribute('data_x')),\n        y: parseInt(cell.parentNode.getAttribute('data_y')),\n        colspan: colspan ? parseInt(colspan) : 0,\n        rowspan: rowspan ? parseInt(rowspan) : 0\n      };\n    };\n\n    var deselectAll = function deselectAll($table) {\n      var selectedCells = getSelectedCells($table);\n      selectedCells.removeClass(selectedCellClass);\n      return 0;\n    };\n\n    var isRightMouseButton = function isRightMouseButton(event) {\n      var isRightMb;\n      event = event || window.event;\n      if (\"which\" in event) isRightMb = event.which === 3;else if (\"button\" in event) isRightMb = event.button === 2;\n      return isRightMb;\n    };\n\n    var getPluginDataByEvent = function getPluginDataByEvent(event) {\n      var $target = $(event.target);\n      var $table = $target.closest('table');\n      return {\n        $target: $target,\n        $table: $table,\n        $cell: $target.closest('td,th'),\n        data: $table.data(dataKey)\n      };\n    };\n\n    var coordinateManipulateMagic = function coordinateManipulateMagic($table, data) {\n      var i = 1;\n\n      while (i > 0) {\n        i = 0;\n        var cells = $table[0].getElementsByTagName(\"td\");\n\n        for (var j = 0; j < cells.length; j++) {\n          var cell = $(cells[j]);\n          var offSet = cell.offset();\n          data.$elemX = offSet.left;\n          data.$elemXwidth = offSet.left + cell.width();\n          data.$elemY = offSet.top;\n          data.$elemYheight = offSet.top + cell.height();\n\n          if (data.$elemX < data.$pointXmin && data.$elemXwidth >= data.$pointXmin && data.$elemXwidth <= data.$pointXwidth && data.$elemYheight <= data.$pointYheight && data.$elemYheight > data.$pointYmin) {\n            data.$temp = data.$elemX;\n\n            if (data.$temp != data.$pointXmin) {\n              data.$pointXmin = data.$temp;\n              i = 1;\n            }\n          }\n\n          if (data.$elemX >= data.$pointXmin && data.$elemX < data.$pointXwidth && data.$elemXwidth >= data.$pointXwidth && data.$elemYheight <= data.$pointYheight && data.$elemYheight > data.$pointYmin) {\n            data.$temp = data.$elemXwidth;\n\n            if (data.$temp != data.$pointXwidth) {\n              data.$pointXwidth = data.$temp;\n              i = 1;\n            }\n          }\n\n          if (data.$elemY < data.$pointYmin && data.$elemYheight >= data.$pointYmin && data.$elemYheight <= data.$pointYheight && data.$elemXwidth <= data.$pointXwidth && data.$elemXwidth > data.$pointXmin) {\n            data.$temp = data.$elemY;\n\n            if (data.$temp != data.$pointYmin) {\n              data.$pointYmin = data.$temp;\n              i = 1;\n            }\n          }\n\n          if (data.$elemY >= data.$pointYmin && data.$elemY < data.$pointYheight && data.$elemYheight >= data.$pointYheight && data.$elemXwidth <= data.$pointXwidth && data.$elemXwidth > data.$pointXmin) {\n            data.$temp = data.$elemYheight;\n\n            if (data.$temp != data.$pointYheight) {\n              data.$pointYheight = data.$temp;\n              i = 1;\n            }\n          }\n\n          if (data.$elemX < data.$pointXmin && data.$elemXwidth >= data.$pointXwidth && data.$elemYheight <= data.$pointYheight && data.$elemYheight > data.$pointYmin) {\n            data.$temp = data.$elemX;\n\n            if (data.$temp < data.$pointXmin) {\n              data.$pointXmin = data.$temp;\n              i = 1;\n            }\n          }\n\n          if (data.$elemX > data.$pointXmin && data.$elemX < data.$pointXwidth && data.$elemY < data.$pointYheight && data.$elemY > data.$pointYmin) {\n            data.$temp = data.$elemXwidth;\n\n            if (data.$temp > data.$pointXwidth) {\n              data.$pointXwidth = data.$temp;\n              i = 1;\n            }\n          }\n\n          if (data.$elemY < data.$pointYmin && data.$elemYheight >= data.$pointYmin && data.$elemYheight <= data.$pointYheight && data.$elemXwidth <= data.$pointXwidth && data.$elemXwidth > data.$pointXmin) {\n            data.$temp = data.$elemY;\n\n            if (data.$temp < data.$pointYmin) {\n              data.$pointYmin = data.$temp;\n              i = 1;\n            }\n          }\n\n          if (data.$elemY > data.$pointYmin && data.$elemYheight <= data.$pointYheight && data.$elemX <= data.$pointXwidth) {\n            data.$temp = data.$elemYheight;\n\n            if (data.$temp > data.$pointYheight) {\n              data.$pointYheight = data.$temp;\n              i = 1;\n            }\n          }\n        }\n      }\n    };\n\n    var setPointCoordinates = function setPointCoordinates(data, $cell) {\n      var offset = $cell.offset();\n      data.$pointX2 = offset.left;\n      data.$pointX2width = offset.left + $cell.width();\n      data.$pointY2 = offset.top;\n      data.$pointY2height = offset.top + $cell.height();\n\n      if (data.$pointX1 < data.$pointX2) {\n        data.$pointXmin = data.$pointX1;\n        data.$pointXmax = data.$pointX2;\n      } else {\n        data.$pointXmin = data.$pointX2;\n        data.$pointXmax = data.$pointX1;\n      }\n\n      if (data.$pointX1width > data.$pointX2width) {\n        data.$pointXwidth = data.$pointX1width;\n      } else {\n        data.$pointXwidth = data.$pointX2width;\n      }\n\n      if (data.$pointY1 < data.$pointY2) {\n        data.$pointYmin = data.$pointY1;\n        data.$pointYmax = data.$pointY2;\n      } else {\n        data.$pointYmin = data.$pointY2;\n        data.$pointYmax = data.$pointY1;\n      }\n\n      if (data.$pointY1height > data.$pointY2height) {\n        data.$pointYheight = data.$pointY1height;\n      } else {\n        data.$pointYheight = data.$pointY2height;\n      }\n    };\n\n    var resizeFunc = function resizeFunc(table) {\n      $(table).find('.rp-gen-col').resizable({\n        handles: 'w',\n        minWidth: 5,\n        _h: \"resizable-_h\",\n        resize: function resize(event, ui) {\n          $(event.target).css(\"left\", 0);\n        },\n        stop: function stop(event, ui) {\n          var width = event.target.offsetWidth;\n          var colNum = event.target.getAttribute(\"data-col\");\n          var model = rgUtil.getModel($(table));\n          rgUtil.executeCommand($(table), model, {\n            id: \"width\",\n            type: \"width\",\n            viewType: \"col\",\n            value: width,\n            colNumber: Number(colNum)\n          });\n          setTimeout(function () {\n            _h.kocnx().ttvm().focusDesignItem().refreshToolBar(true);\n          }, 50);\n        }\n      });\n      $(table).find('.first-cell').resizable({\n        handles: 's',\n        minHeight: 5,\n        _h: \"resizable-_h\",\n        stop: function stop(event, ui) {\n          $(event.target).css(\"top\", 0);\n          var height = event.target.offsetHeight;\n          var rowNum = event.target.getAttribute(\"data-row\");\n          var model = rgUtil.getModel($(table));\n          rgUtil.executeCommand($(table), model, {\n            id: \"height\",\n            type: \"height\",\n            viewType: \"row\",\n            value: height,\n            rowNumber: Number(rowNum)\n          });\n          setTimeout(function () {\n            _h.kocnx().ttvm().focusDesignItem().refreshToolBar(true);\n          }, 50);\n        }\n      });\n    };\n\n    var copyCellsData = function copyCellsData(e, table) {\n      var cells = getSelectedCellModels($(table));\n\n      if (cells.length > 0) {\n        var array = [];\n\n        for (var i = 0; i < cells.length; i++) {\n          var cell = cellFunc.copyCell(cells[i]);\n          array.push(cell);\n        }\n\n        if (array.length > 0) {\n          e.clipboardData.clearData('application/json');\n\n          if (array.length === 1) {\n            e.clipboardData.setData('text/plain', array[0].text);\n          }\n\n          e.clipboardData.setData('application/json', JSON.stringify(array));\n          e.preventDefault();\n        }\n      }\n    };\n\n    var pasteCellsData = function pasteCellsData(e, table) {\n      var model = rgUtil.getModel(table);\n      var cells = getSelectedCellModels($(table));\n      var cell;\n\n      if (cells.length > 0) {\n        var data = e.clipboardData.getData('application/json');\n\n        if (!_h.isEmpty(data)) {\n          var json = JSON.parse(data);\n          if (json.length === 1) for (var i = 0; i < cells.length; i++) {\n            cell = cells[i];\n            cellFunc.pasteCell(table, cell, json[0], model.cols, model.rows);\n          } else {\n            if (cells.length === json.length) {\n              for (var j = 0; j < cells.length; j++) {\n                cell = cells[j];\n                cellFunc.pasteCell(table, cell, json[j], model.cols, model.rows);\n              }\n            }\n          }\n        }\n\n        var html = e.clipboardData.getData('text/html');\n        data = e.clipboardData.getData('text/plain');\n        var dataJson = e.clipboardData.getData('application/json');\n\n        if (!_h.isEmpty(data) && !html && _h.isEmpty(dataJson)) {\n          for (var k = 0; k < cells.length; k++) {\n            cell = cells[k];\n            cellFunc.pasteCell(table, cell, data, model.cols, model.rows);\n          }\n        }\n\n        if (!_h.isEmpty(data) && !_h.isEmpty(html) && _h.isEmpty(dataJson)) {\n          var list = pasteDataFormater.textToJson(data);\n\n          if (_h.any(list)) {\n            for (var i = 0; i < cells.length; i++) {\n              var cell = cells[i];\n              cellFunc.pasteCell(table, cell, list[i], model.cols, model.rows);\n            }\n          }\n        }\n\n        if (!_h.isEmpty(data) && _h.isEmpty(html) && _h.isEmpty(dataJson)) {\n          for (var k = 0; k < cells.length; k++) {\n            cell = cells[k];\n            cellFunc.pasteCell(table, cell, data, model.cols, model.rows);\n          }\n        }\n\n        e.preventDefault();\n        $(table).data(\"model\", model);\n      }\n    };\n\n    var cutCellsData = function cutCellsData(e, table) {\n      var model = rgUtil.getModel(table);\n      var cells = getSelectedCellModels($(table));\n      var defaultVal = getDefault();\n\n      if (cells.length > 0) {\n        var array = [];\n\n        for (var i = 0; i < cells.length; i++) {\n          var cell = cells[i];\n          var cellData = cellFunc.cutCell(table, model, cell, defaultVal);\n          array.push(cellData);\n        }\n\n        if (array.length > 0) {\n          rgUtil.addToHistory(table, array, {\n            type: \"CutCell\"\n          }, [{\n            old: array,\n            \"new\": []\n          }]);\n          var clipboardData = e.originalEvent ? e.originalEvent.clipboardData : e.clipboardData;\n          clipboardData.clearData('application/json');\n\n          if (array.length === 1) {\n            clipboardData.setData('text/plain', array[0].text);\n          }\n\n          clipboardData.setData('application/json', JSON.stringify(array));\n          e.preventDefault();\n        }\n\n        $(table).data(\"model\", model);\n      }\n    };\n\n    var replaceHiddenRows = function replaceHiddenRows(table, model, row, action) {\n      if (model.hiddenRows.length === 0) {\n        tagRender.applyToTable(\"hiddenCells\", table, model);\n        return;\n      }\n\n      var delList = [];\n\n      for (var i = 0; i < model.hiddenRows.length; i++) {\n        var target = model.hiddenRows[i];\n\n        if (action === \"add\") {\n          if (row <= target) model.hiddenRows[i] = target + 1;\n        } else {\n          if (row < target) model.hiddenRows[i] = target - 1;\n          if (row === target) delList.push(i);\n        }\n      }\n\n      for (var j = 0; j < delList.length; j++) {\n        model.hiddenRows.splice(delList[j], 1);\n      }\n\n      tagRender.applyToTable(\"hiddenCells\", table, model);\n    };\n\n    var replaceHiddenCols = function replaceHiddenCols(table, model, col, action) {\n      if (model.hiddenCols.length === 0) {\n        tagRender.applyToTable(\"hiddenCells\", table, model);\n        return;\n      }\n\n      var delList = [];\n\n      for (var i = 0; i < model.hiddenCols.length; i++) {\n        var target = model.hiddenCols[i];\n\n        if (action === \"add\") {\n          if (col <= target) model.hiddenCols[i] = target + 1;\n        } else {\n          if (col < target) model.hiddenCols[i] = target - 1;\n          if (col === target) delList.push(i);\n        }\n      }\n\n      for (var j = 0; j < delList.length; j++) {\n        model.hiddenCols.splice(delList[j], 1);\n      }\n\n      tagRender.applyToTable(\"hiddenCells\", table, model);\n    };\n\n    var refreshFormulaCells = function refreshFormulaCells(table, model, rowNumber, colNumber, type) {\n      for (var i = 0; i < model.rowsHeight.length; i++) {\n        var rowHeight = model.rowsHeight[i];\n        var cells = model.cells.filter(function (a) {\n          return a.row === rowHeight.id;\n        });\n\n        for (var j = 0; j < cells.length; j++) {\n          var cell = cells[j];\n          var temp, letter, numLetter, parser;\n          var str = cell.value;\n\n          if (str && str.startsWith(\"=\") && rowNumber && cell.row >= rowNumber) {\n            if ((str.indexOf(\"+\") !== -1 || str.indexOf(\"-\") !== -1 || str.indexOf(\"*\") !== -1 || str.indexOf(\"/\") !== -1) && str.indexOf(\":\") === -1) {\n              parser = new _util_expparser_js__WEBPACK_IMPORTED_MODULE_0__.ExpParser();\n              temp = type === \"remove\" ? parser.removeRow(str, rowNumber) : parser.addRow(str, rowNumber);\n              cell.value = temp;\n            } else if (str.indexOf(\"Sum\") !== -1 && str.indexOf(\":\") !== -1) {\n              fixPartialSumRowValue(table, str, type, rowNumber, cell);\n            }\n          } else if (str && str.startsWith(\"=\") && colNumber && cell.col >= colNumber) {\n            if ((str.indexOf(\"+\") !== -1 || str.indexOf(\"-\") !== -1 || str.indexOf(\"*\") !== -1 || str.indexOf(\"/\") !== -1) && str.indexOf(\":\") === -1) {\n              parser = new _util_expparser_js__WEBPACK_IMPORTED_MODULE_0__.ExpParser();\n              temp = type === \"remove\" ? parser.removeCol(str, colNumber) : parser.addCol(str, colNumber);\n              cell.value = temp;\n            } else if (str.indexOf(\"Sum\") !== -1 && str.indexOf(\":\") !== -1) {\n              fixPartialSumColValue(str, type, cell);\n            } else if ((str.indexOf(\"Sum\") !== -1 || str.indexOf(\"GSum\") !== -1 || str.indexOf(\"CSum\") !== -1) && str.indexOf(\":\") === -1) {\n              var st = getFormulaType(str);\n              letter = str.toLowerCase().replace(\")\", '').replace(\"=\", '').replace(\"\" + st.toLowerCase() + \"(\", '');\n\n              if (type === \"remove\") {\n                numLetter = _h.alphabetToNumber(letter.toUpperCase()) - 1;\n                cell.value = \"=\" + st + \"(\" + _h.numberToAlphabet(numLetter) + \")\";\n              }\n\n              if (type === \"add\") {\n                numLetter = _h.alphabetToNumber(letter.toUpperCase()) + 1;\n                cell.value = \"=\" + st + \"(\" + _h.numberToAlphabet(numLetter) + \")\";\n              }\n            } else if (str.indexOf(\"Avg\") !== -1 || str.indexOf(\"Max\") !== -1 || str.indexOf(\"Min\") !== -1) {\n              var st = getFormulaType(str);\n              letter = str.toLowerCase().replace(\")\", '').replace(\"=\", '').replace(\"\" + st.toLowerCase() + \"(\", '');\n\n              if (type === \"remove\") {\n                numLetter = _h.alphabetToNumber(letter.toUpperCase()) - 1;\n                cell.value = \"=\" + st + \"(\" + _h.numberToAlphabet(numLetter) + \")\";\n              }\n\n              if (type === \"add\") {\n                numLetter = _h.alphabetToNumber(letter.toUpperCase()) + 1;\n                cell.value = \"=\" + st + \"(\" + _h.numberToAlphabet(numLetter) + \")\";\n              }\n            }\n          } else if (str && str.startsWith(\"{\") && rgUtil.stringIsEnglish(str) && rowNumber && cell.row >= rowNumber) {\n            parser = new _util_expparser_js__WEBPACK_IMPORTED_MODULE_0__.ExpParser();\n            temp = type === \"remove\" ? parser.removeNodeRow(str, rowNumber) : parser.addNodeRow(str, rowNumber);\n            cell.value = temp;\n          } else if (str && str.startsWith(\"{\") && rgUtil.stringIsEnglish(str) && colNumber && cell.col >= colNumber) {\n            parser = new _util_expparser_js__WEBPACK_IMPORTED_MODULE_0__.ExpParser();\n            temp = type === \"remove\" ? parser.removeNodeCol(str, colNumber) : parser.addNodeCol(str, colNumber);\n            cell.value = temp;\n          }\n        }\n      }\n    };\n\n    var stringIsEnglish = function stringIsEnglish() {\n      var index;\n      var english = \" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~!@#$%^&*(){}:_+-.<>?|\\\\/\";\n\n      for (index = str.length - 1; index >= 0; --index) {\n        if (english.indexOf(str.substring(index, index + 1)) < 0) {\n          return false;\n        }\n      }\n\n      return true;\n    };\n\n    var refreshCompareCells = function refreshCompareCells(table, model, rowNumber, colNumber, type) {\n      var cellBinds = model.cellBinds;\n\n      for (var i = 0; i < cellBinds.length; i++) {\n        var item = cellBinds[i];\n        var firstLetter = item.firstCell.replace(/\\d+/g, '');\n\n        var firstLetterNumber = _h.alphabetToNumber(firstLetter);\n\n        var secondLetter = item.secondCell.replace(/\\d+/g, '');\n\n        var secondLetterNumber = _h.alphabetToNumber(secondLetter);\n\n        var firstNumber = Number(item.firstCell.replace(/^\\D+/g, ''));\n        var secondNumber = Number(item.secondCell.replace(/^\\D+/g, ''));\n\n        if (type === \"remove\") {\n          if (colNumber === firstLetterNumber || colNumber === secondLetterNumber || rowNumber === firstNumber || rowNumber === secondNumber) {\n            item.deleted = true;\n            continue;\n          }\n\n          if (colNumber && firstLetterNumber > colNumber) {\n            item.firstCell = _h.numberToAlphabet(firstLetterNumber - 1) + firstNumber;\n          }\n\n          if (colNumber && secondLetterNumber > colNumber) {\n            item.secondCell = _h.numberToAlphabet(secondLetterNumber - 1) + secondNumber;\n          }\n\n          if (rowNumber && firstNumber > rowNumber) {\n            item.firstCell = _h.numberToAlphabet(firstLetterNumber) + (firstNumber - 1);\n          }\n\n          if (rowNumber && secondNumber > rowNumber) {\n            item.secondCell = _h.numberToAlphabet(secondLetterNumber) + (secondNumber - 1);\n          } else if (rowNumber && firstNumber > rowNumber && secondNumber < rowNumber) {\n            item.secondCell = secondLetterNumber + (secondNumber - 1);\n          }\n        } else {\n          if (colNumber && firstLetterNumber >= colNumber) {\n            item.firstCell = _h.numberToAlphabet(firstLetterNumber + 1) + firstNumber;\n          }\n\n          if (colNumber && secondLetterNumber > colNumber) {\n            item.secondCell = _h.numberToAlphabet(secondLetterNumber + 1) + secondNumber;\n          }\n\n          if (colNumber && firstLetterNumber < colNumber && secondLetterNumber >= colNumber) {\n            item.secondCell = _h.numberToAlphabet(secondLetterNumber + 1) + secondNumber;\n          }\n\n          if (rowNumber && firstNumber >= rowNumber) {\n            item.firstCell = _h.numberToAlphabet(firstLetterNumber) + (firstNumber + 1);\n          }\n\n          if (rowNumber && secondNumber >= rowNumber) {\n            item.secondCell = _h.numberToAlphabet(secondLetterNumber) + (secondNumber + 1);\n          }\n\n          if (rowNumber && firstNumber < rowNumber && secondNumber >= rowNumber) {\n            item.secondCell = _h.numberToAlphabet(secondLetterNumber) + (secondNumber + 1);\n          }\n        }\n      }\n\n      model.cellBinds = model.cellBinds.filter(function (a) {\n        return !a.deleted;\n      });\n    };\n\n    var getFormulaType = function getFormulaType(val) {\n      if (val && val.indexOf(\"GSum\") !== -1) return \"GSum\";\n      if (val && val.indexOf(\"CSum\") !== -1) return \"CSum\";\n      if (val && val.indexOf(\"Sum\") !== -1) return \"Sum\";\n      if (val && val.indexOf(\"Avg\") !== -1) return \"Avg\";\n      if (val && val.indexOf(\"Max\") !== -1) return \"Max\";\n      if (val && val.indexOf(\"Min\") !== -1) return \"Min\";\n      return \"\";\n    };\n\n    var fixPartialSumRowValue = function fixPartialSumRowValue(table, str, type, rowNumber, cell) {\n      var letter,\n          resetFormula = false;\n      var temp = str.replace(\"=Sum(\", \"\").replace(\")\", \"\").split(\":\");\n\n      if (temp.length > 1) {\n        letter = temp[0];\n        var start = Number(temp[1]);\n        var end = Number(temp[2]);\n\n        if (type === \"remove\") {\n          var newStart, newEnd;\n\n          if (rowNumber < start) {\n            newStart = start - 1;\n            if (newStart === 0) newStart = 1;\n            newEnd = end - 1;\n            cell.value = \"=Sum(\" + letter + \":\" + newStart + \":\" + newEnd + \")\";\n          }\n\n          if (rowNumber >= start && rowNumber <= end) {\n            if (start < end - 1) {\n              cell.value = \"=Sum(\" + letter + \":\" + start + \":\" + (end - 1) + \")\";\n            } else {\n              resetFormula = true;\n            }\n          }\n\n          if (resetFormula) {\n            cell.value = \"\";\n            tagRender.applyToElement(table, cell, \"resetFormula\");\n          }\n        }\n\n        if (type === \"add\") {\n          if (rowNumber < start) {\n            cell.value = \"=Sum(\" + letter + \":\" + (start + 1) + \":\" + (end + 1) + \")\";\n          }\n\n          if (rowNumber >= start && rowNumber <= end) {\n            if (rowNumber === start) {\n              cell.value = \"=Sum(\" + letter + \":\" + (start + 1) + \":\" + (end + 1) + \")\";\n            } else {\n              cell.value = \"=Sum(\" + letter + \":\" + start + \":\" + (end + 1) + \")\";\n            }\n          }\n        }\n      }\n    };\n\n    var fixPartialSumColValue = function fixPartialSumColValue(str, type, cell) {\n      var numLetter;\n      var temp = str.replace(\"=Sum(\", \"\").replace(\")\", \"\").split(\":\");\n\n      if (temp.length > 1) {\n        if (type === \"remove\") {\n          numLetter = _h.alphabetToNumber(temp[0]) - 1;\n          cell.value = \"=Sum(\" + _h.numberToAlphabet(numLetter) + \":\" + temp[1] + \":\" + temp[2] + \")\";\n        }\n\n        if (type === \"add\") {\n          numLetter = _h.alphabetToNumber(temp[0]) + 1;\n          cell.value = \"=Sum(\" + _h.numberToAlphabet(numLetter) + \":\" + temp[1] + \":\" + temp[2] + \")\";\n        }\n      }\n    };\n\n    var getRectanglePoints = function getRectanglePoints(cells) {\n      var sCol = 0;\n      var bCol = 0;\n      var sRow = 0;\n      var bRow = 0;\n\n      for (var i = 0; i < cells.length; i++) {\n        var cell = cells[i];\n\n        if (i === 0) {\n          sCol = cell.col;\n          sRow = cell.row;\n        }\n\n        if (cell.colSpan > 1) {\n          for (var j = 1; j < cell.colSpan; j++) {\n            var innerCol = cell.col + j;\n            if (innerCol < sCol) sCol = innerCol;\n            if (innerCol > bCol) bCol = innerCol;\n          }\n        }\n\n        if (cell.rowSpan > 1) {\n          for (var k = 1; k < cell.rowSpan; k++) {\n            var innerRow = cell.row + k;\n            if (innerRow < sRow) sRow = innerRow;\n            if (innerRow > bRow) bRow = innerRow;\n          }\n        }\n\n        if (cell.col < sCol) sCol = cell.col;\n        if (cell.col > bCol) bCol = cell.col;\n        if (cell.row < sRow) sRow = cell.row;\n        if (cell.row > bRow) bRow = cell.row;\n      }\n\n      return {\n        sCol: sCol,\n        bCol: bCol,\n        sRow: sRow,\n        bRow: bRow\n      };\n    };\n\n    var getSelectedCellsShape = function getSelectedCellsShape(cells) {\n      var v = cellFunc.calculateVertexes(cells);\n      var left = true,\n          right = true,\n          top = true,\n          bottom = true;\n      var address;\n\n      for (var i = v.sRow; i < v.bRow + 1; i++) {\n        address = _h.numberToAlphabet(v.bCol) + i;\n        if (cells.filter(function (a) {\n          return a.address === address;\n        }).length === 0) left = false;\n        address = _h.numberToAlphabet(v.sCol) + i;\n        if (cells.filter(function (a) {\n          return a.address === address;\n        }).length === 0) right = false;\n      }\n\n      for (var i = v.sCol; i < v.bCol + 1; i++) {\n        address = _h.numberToAlphabet(i) + v.sRow;\n        if (cells.filter(function (a) {\n          return a.address === address;\n        }).length === 0) top = false;\n        address = _h.numberToAlphabet(i) + v.bRow;\n        if (cells.filter(function (a) {\n          return a.address === address;\n        }).length === 0) bottom = false;\n      }\n\n      return [left, right, top, bottom, left && right && top && bottom];\n    };\n\n    var mergeCells = function mergeCells(model, table, selectedCells) {\n      var points = getRectanglePoints(selectedCells);\n      var deleteArray = [];\n      var cell;\n      var outCellAddress = null;\n\n      for (var i = 0; i < selectedCells.length; i++) {\n        cell = selectedCells[i];\n\n        if (cell.col === points.sCol && cell.row === points.sRow) {\n          cell.rowSpan = points.bRow - points.sRow + 1;\n          cell.colSpan = points.bCol - points.sCol + 1;\n          tagRender.applyToElement(table, cell, \"span\");\n          outCellAddress = cell.address;\n        } else {\n          deleteArray.push(cell.address);\n          tagRender.applyToElement(table, cell, \"removeCell\");\n        }\n      }\n\n      var newCells = model.cells.filter(function (a) {\n        return deleteArray.indexOf(a.address) === -1;\n      });\n      model.cells = newCells;\n      return outCellAddress;\n    };\n\n    var unMergeCells = function unMergeCells(model, table, cell, defaultVal) {\n      var rowSpan = cell.rowSpan;\n      var colSpan = cell.colSpan;\n      var array = [];\n      var outArray = [];\n      var newCell;\n\n      for (var j = 0; j < colSpan; j++) {\n        var col = cell.col + j;\n\n        for (var i = 0; i < rowSpan - 1; i++) {\n          array.push({\n            col: col,\n            row: cell.row + (i + 1),\n            address: _h.numberToAlphabet(col) + (cell.row + (i + 1))\n          });\n          newCell = cellFunc.createEmptyModel(\"cell\", col, cell.row + (i + 1), model.accountType, defaultVal);\n          model.cells.push(newCell);\n        }\n      }\n\n      if (colSpan > 1) {\n        for (var l = 0; l < colSpan - 1; l++) {\n          array.push({\n            col: cell.col + (l + 1),\n            row: cell.row,\n            address: _h.numberToAlphabet(cell.col + (l + 1)) + cell.row\n          });\n          newCell = cellFunc.createEmptyModel(\"cell\", cell.col + (l + 1), cell.row, model.accountType, defaultVal);\n          model.cells.push(newCell);\n        }\n      }\n\n      cell.colSpan = 1;\n      cell.rowSpan = 1;\n      tagRender.applyToElement(table, cell, \"span\");\n      tagRender.applyToTable(\"unMergeCells\", table, model, array);\n      array.filter(function (a) {\n        return outArray.push(a.address);\n      });\n      outArray.push(cell.address);\n      return outArray;\n    };\n\n    var getColsWidth = function getColsWidth(table) {\n      var colsWidth = [];\n      var cols = $(table).find(\"thead th\");\n\n      for (var i = 0; i < cols.length; i++) {\n        var col = cols[i];\n\n        if ($(col).hasClass(\"rp-gen-col\")) {\n          //var width = col.offsetWidth;\n          //var w2 = col.getBoundingClientRect();\n          colsWidth.push({\n            id: Number($(col).attr(\"data-col\")),\n            size: $(col).css(\"width\")\n          });\n        }\n      }\n\n      return colsWidth;\n    };\n\n    var getRowsHeight = function getRowsHeight(table) {\n      var rowsHeight = [];\n      var rows = $(table).find(\"tbody th\");\n\n      for (var i = 0; i < rows.length; i++) {\n        var row = rows[i];\n\n        if ($(row).attr(\"data-row\")) {\n          rowsHeight.push({\n            id: Number($(row).attr(\"data-row\")),\n            size: $(row).css(\"height\")\n          });\n        }\n      }\n\n      return rowsHeight;\n    };\n\n    var findHigherCell = function findHigherCell(model, col, row) {\n      var reducer = row - 1;\n\n      while (reducer > 0) {\n        var target = model.cells.filter(function (a) {\n          return a.col === col && a.row === reducer;\n        })[0];\n        if (target) return target;\n        reducer = reducer - 1;\n      }\n    };\n\n    var removeRow = function removeRow(table, model, cell) {\n      var targetRow = cell.row;\n      var resModel = [];\n      var reduceRsAndReplaceCells = [];\n      var reduceRsCells = [];\n      var ignoreCells = [];\n\n      for (var b = 0; b < model.cols; b++) {\n        var addr = _h.numberToAlphabet(b + 1) + cell.row;\n        var rCell = model.cells.filter(function (a) {\n          return a.address === addr;\n        })[0];\n\n        if (!rCell) {\n          if (ignoreCells.indexOf(addr) === -1) {\n            var target = findHigherCell(model, b + 1, targetRow);\n\n            if (target) {\n              target.rowSpan = target.rowSpan - 1;\n              reduceRsCells.push(target.address);\n\n              if (target.colSpan > 1) {\n                for (var i = 0; i < target.colSpan; i++) {\n                  if (i !== 0) {\n                    var addr3 = _h.numberToAlphabet(target.col + i) + cell.row;\n                    ignoreCells.push(addr3);\n                  }\n                }\n              }\n            }\n          }\n        } else {\n          if (rCell.colSpan >= 1 && rCell.rowSpan === 1) {\n            rCell.remove = true;\n            resModel.push(rCell);\n          }\n\n          if (rCell.rowSpan > 1) {\n            rCell.rowSpan = rCell.rowSpan - 1;\n            reduceRsAndReplaceCells.push(rCell.address);\n          }\n\n          if (rCell.colSpan > 1) {\n            for (var i = 0; i < rCell.colSpan; i++) {\n              if (i !== 0) {\n                var addr2 = _h.numberToAlphabet(rCell.col + i) + cell.row;\n                ignoreCells.push(addr2);\n              }\n            }\n          }\n        }\n      }\n\n      model.cells = model.cells.filter(function (a) {\n        return !a[\"remove\"];\n      });\n\n      for (var j = 0; j < model.cells.length; j++) {\n        var targetCell = model.cells[j];\n\n        if (targetCell.row > targetRow) {\n          targetCell.row = targetCell.row - 1;\n          targetCell.address = _h.numberToAlphabet(targetCell.col) + targetCell.row;\n        }\n      }\n\n      var newRowsHeight = getRowsHeight(table);\n      newRowsHeight = newRowsHeight.filter(function (a) {\n        return a.id !== targetRow;\n      });\n\n      for (var k = 0; k < newRowsHeight.length; k++) {\n        var rowHeight = newRowsHeight[k];\n        if (rowHeight.id > targetRow) rowHeight.id = rowHeight.id - 1;\n      }\n\n      model.rowsHeight = newRowsHeight;\n      model.rows = model.rows - 1;\n      tagRender.applyToTable(\"removeRow\", table, model, {\n        targetRow: targetRow,\n        reduceAndReplaceCells: reduceRsAndReplaceCells,\n        reduceCells: reduceRsCells\n      });\n      replaceHiddenRows(table, model, cell.row, \"remove\");\n      refreshFormulaCells(table, model, cell.row, undefined, \"remove\");\n      refreshCompareCells(table, model, cell.row, undefined, \"remove\");\n      resizeFunc(table);\n      return resModel;\n    };\n\n    var findRighterCell = function findRighterCell(model, col, row) {\n      var reducer = col - 1;\n\n      while (reducer > 0) {\n        var target = model.cells.filter(function (a) {\n          return a.col === reducer && a.row === row;\n        })[0];\n        if (target) return target;\n        reducer = reducer - 1;\n      }\n    };\n\n    var removeCol = function removeCol(table, model, cell) {\n      var resModel = [];\n      var targetCol = cell.col;\n      var reduceCsCells = [];\n      var ignoreCells = [];\n      var newColsWidth = getColsWidth(table);\n      newColsWidth = newColsWidth.filter(function (a) {\n        return a.id !== targetCol;\n      });\n\n      for (var k = 0; k < newColsWidth.length; k++) {\n        var colWidth = newColsWidth[k];\n        if (colWidth.id > targetCol) colWidth.id = colWidth.id - 1;\n      }\n\n      model.colsWidth = newColsWidth;\n\n      for (var i = 0; i < model.rows; i++) {\n        var addr = _h.numberToAlphabet(cell.col) + (i + 1);\n        var rCell = model.cells.filter(function (a) {\n          return a.address === addr;\n        })[0];\n\n        if (!rCell) {\n          if (ignoreCells.indexOf(addr) === -1) {\n            var target = findRighterCell(model, targetCol, i + 1);\n\n            if (target) {\n              target.colSpan = target.colSpan - 1;\n              reduceCsCells.push(target.address);\n\n              if (target.rowSpan > 1) {\n                for (var b = 0; b < target.rowSpan; b++) {\n                  if (b !== 0) {\n                    var addr3 = _h.numberToAlphabet(targetCol) + (target.row + b);\n                    ignoreCells.push(addr3);\n                  }\n                }\n              }\n            }\n          }\n        } else {\n          if (rCell.colSpan === 1 && rCell.rowSpan >= 1 || rCell.rowSpan >= 1 && rCell.colSpan === 1) {\n            rCell.remove = true;\n            resModel.push(rCell);\n          }\n\n          if (rCell.colSpan > 1) {\n            rCell.colSpan = rCell.colSpan - 1;\n            reduceCsCells.push(rCell.address);\n          }\n\n          if (rCell.rowSpan > 1) {\n            for (var c = 0; c < rCell.rowSpan; c++) {\n              if (c !== 0) {\n                var addr2 = _h.numberToAlphabet(targetCol) + (rCell.row + c);\n                ignoreCells.push(addr2);\n              }\n            }\n          }\n        }\n      }\n\n      model.cells = model.cells.filter(function (a) {\n        return !a[\"remove\"];\n      });\n      model.cols = model.cols - 1;\n\n      for (var j = 0; j < model.cells.length; j++) {\n        var targetCell = model.cells[j];\n\n        if (targetCell.col > targetCol) {\n          targetCell.col = targetCell.col - 1;\n          targetCell.address = _h.numberToAlphabet(targetCell.col) + targetCell.row;\n        }\n      }\n\n      tagRender.applyToTable(\"removeCol\", table, model, {\n        targetCol: targetCol,\n        reduceCells: reduceCsCells\n      });\n      replaceHiddenCols(table, model, cell.col, \"remove\");\n      refreshFormulaCells(table, model, undefined, targetCol, \"remove\");\n      refreshCompareCells(table, model, undefined, targetCol, \"remove\");\n      return resModel;\n    };\n\n    var getRecursiveCell = function getRecursiveCell(table, model, type, col, row) {\n      var current;\n      var cell = undefined;\n      var dataModel;\n\n      if (type === \"row\") {\n        current = row;\n\n        while (current !== 0) {\n          cell = $(table).find(\"[data-address='\" + (_h.numberToAlphabet(col) + current) + \"']\");\n\n          if (cell.length) {\n            dataModel = model.cells.filter(function (a) {\n              return a.col === col && a.row === current;\n            })[0];\n            return dataModel;\n          }\n\n          current = current - 1;\n        }\n\n        return undefined;\n      } else {\n        current = col;\n\n        while (current !== 0) {\n          cell = $(table).find(\"[data-address='\" + (_h.numberToAlphabet(current) + row) + \"']\");\n\n          if (cell.length) {\n            dataModel = model.cells.filter(function (a) {\n              return a.col === current && a.row === row;\n            })[0];\n            return dataModel;\n          }\n\n          current = current - 1;\n        }\n\n        return undefined;\n      }\n    };\n\n    var getRecursiveClosestCell = function getRecursiveClosestCell(table, model, col, row) {\n      var cell = $(table).find(\"[data-address='\" + (_h.numberToAlphabet(col) + row) + \"']\");\n\n      if (cell.length) {\n        return model.cells.filter(function (a) {\n          return a.col === col && a.row === row;\n        })[0];\n      }\n\n      var cellRow = getRecursiveCell(table, model, \"row\", col, row);\n      var cellCol = getRecursiveCell(table, model, \"col\", col, row);\n      var array = [];\n      var array2 = [];\n      if (cellRow && cellCol && cellRow.address === cellCol.address) return cellRow;\n      if (cellRow) for (var i = 0; i < cellRow.colSpan; i++) {\n        for (var k = 0; k < cellRow.rowSpan; k++) {\n          array.push(_h.numberToAlphabet(cellRow.col + i) + (cellRow.row + k));\n        }\n      }\n      if (array.indexOf(_h.numberToAlphabet(col) + row) !== -1) return cellRow;\n      if (cellCol) for (var m = 0; m < cellCol.colSpan; m++) {\n        for (var n = 0; n < cellCol.rowSpan; n++) {\n          array2.push(_h.numberToAlphabet(cellCol.col + m) + (cellCol.row + n));\n        }\n      }\n      if (array2.indexOf(_h.numberToAlphabet(col) + row) !== -1) return cellCol;\n    };\n\n    var hasRowBackCell = function hasRowBackCell(table, model, item) {\n      if (item.col === 1) return true;\n\n      for (var i = item.col - 1; i > 0; i--) {\n        for (var j = item.row; j > 0; j--) {\n          var adr = _h.numberToAlphabet(i) + j;\n          var cell = table.find(\"[data-address='\" + adr + \"']\");\n\n          if (cell.length) {\n            return true;\n          }\n        }\n      }\n    };\n\n    var hasColBackCell = function hasColBackCell(table, item) {\n      return $(table).find(\"[data-address='\" + (_h.numberToAlphabet(item.col) + (item.row - 1)) + \"']\").length;\n    };\n\n    var addToNewCellArray = function addToNewCellArray(array, newCell) {\n      var hasRecord = array.filter(function (a) {\n        return a.address === newCell.address;\n      }).length > 0;\n      if (hasRecord) return array;\n      array.push(newCell);\n      return array;\n    };\n\n    var addRow = function addRow(table, model, cell, defaultVal) {\n      if (model.rows >= 100) {\n        var text = _h.getApiMessage(\"ErrorMaxRowReportGenerator\");\n\n        _h.failToast(text);\n\n        return;\n      }\n\n      var increaseRsCells = [];\n      var addCells = [];\n      var targetRow = cell.row;\n      var newCell;\n      var newRowsHeight = getRowsHeight(table);\n\n      for (var i = 0; i < newRowsHeight.length; i++) {\n        if (newRowsHeight[i].id >= targetRow) {\n          newRowsHeight[i].id++;\n        }\n      }\n\n      newRowsHeight.push({\n        id: targetRow,\n        size: \"30px\"\n      });\n      newRowsHeight.sort(function (a, b) {\n        return a.id - b.id;\n      });\n      model.rowsHeight = newRowsHeight;\n\n      for (var j = 0; j < model.cols; j++) {\n        var rightCell = getRecursiveClosestCell(table, model, j + 1, cell.row);\n\n        if (!_h.isNullOrEmpty(rightCell)) {\n          if (rightCell.col === j + 1 && rightCell.rowSpan > 1 && rightCell.row < cell.row) {\n            increaseRsCells.push(rightCell.address);\n            rightCell.rowSpan = rightCell.rowSpan + 1;\n          }\n\n          if (rightCell.col === j + 1 && rightCell.colSpan > 1) {\n            for (var i = 0; i < rightCell.colSpan; i++) {\n              newCell = cellFunc.createEmptyModel(\"cell\", rightCell.col + i, rightCell.row, model.accountType, defaultVal);\n              if (newCell.row === cell.row) addToNewCellArray(addCells, newCell);\n            }\n          }\n\n          if (rightCell.row === cell.row && rightCell.rowSpan === 1) {\n            newCell = cellFunc.createEmptyModel(\"cell\", rightCell.col, rightCell.row, model.accountType, defaultVal);\n            if (newCell.row === cell.row) addToNewCellArray(addCells, newCell);\n          }\n\n          if (rightCell.row === cell.row && rightCell.rowSpan > 1) {\n            newCell = cellFunc.createEmptyModel(\"cell\", j + 1, rightCell.row, model.accountType, defaultVal);\n            addToNewCellArray(addCells, newCell);\n          }\n\n          if (rightCell.row === cell.row && rightCell.rowSpan > 1 && hasColBackCell(table, rightCell)) {\n            newCell = cellFunc.createEmptyModel(\"cell\", j + 1, rightCell.row, model.accountType, defaultVal);\n            if (newCell.row === cell.row) addToNewCellArray(addCells, newCell);\n          }\n        }\n      }\n\n      for (var k = 0; k < model.cells.length; k++) {\n        var targetCell = model.cells[k];\n\n        if (targetCell.row >= targetRow) {\n          targetCell.row = targetCell.row + 1;\n          targetCell.address = _h.numberToAlphabet(targetCell.col) + targetCell.row;\n        }\n      }\n\n      for (var l = 0; l < addCells.length; l++) {\n        addCells[l].added = true;\n        model.cells.push(addCells[l]);\n      }\n\n      model.cells.sort(function (a, b) {\n        return a.row - b.row;\n      });\n      model.rows = model.rows + 1;\n      tagRender.applyToTable(\"rowTop\", table, model, {\n        targetRow: targetRow,\n        addCells: addCells,\n        increaseCells: increaseRsCells\n      });\n      replaceHiddenRows(table, model, targetRow, \"add\");\n      refreshFormulaCells(table, model, targetRow, undefined, \"add\");\n      refreshCompareCells(table, model, targetRow, undefined, \"add\");\n      resizeFunc(table);\n    };\n\n    var addCol = function addCol(table, model, cell, defaultVal) {\n      if (model.cols >= 100) {\n        var text = _h.getApiMessage(\"ErrorMaxColReportGenerator\");\n\n        _h.failToast(text);\n\n        return;\n      }\n\n      var addCells = [];\n      var increaseCsCells = [];\n      var targetCol = cell.col;\n      var newCell;\n      var newColsWidth = getColsWidth(table);\n\n      for (var k = 0; k < newColsWidth.length; k++) {\n        var colWidth = newColsWidth[k];\n        if (colWidth.id >= targetCol) colWidth.id = colWidth.id + 1;\n      }\n\n      newColsWidth.push({\n        id: targetCol,\n        size: \"150px\"\n      });\n      newColsWidth.sort(function (a, b) {\n        return a.id - b.id;\n      });\n      model.colsWidth = newColsWidth;\n\n      for (var j = 0; j < model.rows; j++) {\n        var rightCell = getRecursiveClosestCell(table, model, cell.col, j + 1);\n\n        if (!_h.isNullOrEmpty(rightCell)) {\n          if (rightCell.row === j + 1 && rightCell.colSpan > 1 && rightCell.col < cell.col) {\n            rightCell.colSpan = rightCell.colSpan + 1;\n            increaseCsCells.push(rightCell.address);\n          }\n\n          if (rightCell.row === j + 1 && rightCell.rowSpan > 1) {\n            for (var i = 0; i < rightCell.rowSpan; i++) {\n              newCell = cellFunc.createEmptyModel(\"cell\", rightCell.col, rightCell.row + i, model.accountType, defaultVal);\n              if (newCell.col === cell.col) addToNewCellArray(addCells, newCell);\n            }\n          }\n\n          if (rightCell.col === cell.col && rightCell.rowSpan > 1) {\n            newCell = cellFunc.createEmptyModel(\"cell\", rightCell.col, j + 1, model.accountType, defaultVal);\n            if (newCell.col === cell.col) addToNewCellArray(addCells, newCell);\n          }\n\n          if (rightCell.col === cell.col && rightCell.colSpan === 1) {\n            newCell = cellFunc.createEmptyModel(\"cell\", rightCell.col, rightCell.row, model.accountType, defaultVal);\n            if (newCell.col === cell.col) addToNewCellArray(addCells, newCell);\n          }\n\n          if (rightCell.col === cell.col && rightCell.colSpan > 1 && hasRowBackCell(table, model, rightCell)) {\n            newCell = cellFunc.createEmptyModel(\"cell\", rightCell.col, j + 1, model.accountType, defaultVal);\n            if (newCell.col === cell.col) addToNewCellArray(addCells, newCell);\n          }\n        }\n      }\n\n      for (var k = 0; k < model.cells.length; k++) {\n        var targetCell = model.cells[k];\n\n        if (targetCell.col >= targetCol) {\n          targetCell.col = targetCell.col + 1;\n          targetCell.address = _h.numberToAlphabet(targetCell.col) + targetCell.row;\n        }\n      }\n\n      for (var l = 0; l < addCells.length; l++) {\n        addCells[l].added = true;\n        model.cells.push(addCells[l]);\n      }\n\n      model.cells.sort(function (a, b) {\n        return a.row - b.row;\n      });\n      model.cols = model.cols + 1;\n      tagRender.applyToTable(\"colRight\", table, model, {\n        targetCol: targetCol,\n        addCells: addCells,\n        increaseCells: increaseCsCells\n      });\n      replaceHiddenCols(table, model, targetCol, \"add\");\n      refreshFormulaCells(table, model, undefined, targetCol, \"add\");\n      refreshCompareCells(table, model, undefined, targetCol, \"add\");\n      resizeFunc(table);\n    };\n\n    var tableActions = function tableActions(table, model, cells, obj) {\n      var cell = cells[0];\n      var resModel = {};\n      if (!cell && obj.type !== \"width\" && obj.type !== \"height\") return;\n\n      switch (obj.id) {\n        case \"colRight\":\n          resModel.old = cell.address;\n          addCol(table, model, cell, obj[\"default\"]);\n          setFinancialProperties(table, model, {\n            type: \"reset\"\n          });\n          resModel[\"new\"] = cell.address;\n          break;\n\n        case \"rowTop\":\n          resModel.old = cell.address;\n          addRow(table, model, cell, obj[\"default\"]);\n          setFinancialProperties(table, model, {\n            type: \"reset\"\n          });\n          resModel[\"new\"] = cell.address;\n          break;\n\n        case \"deleteCol\":\n          resModel.old = {\n            address: cell.address\n          };\n          var res = removeCol(table, model, cell);\n          setFinancialProperties(table, model, {\n            type: \"reset\"\n          });\n          resModel[\"new\"] = {\n            address: cell.address,\n            removeCells: res\n          };\n          break;\n\n        case \"deleteRow\":\n          resModel.old = {\n            address: cell.address\n          };\n          var res = removeRow(table, model, cell);\n          setFinancialProperties(table, model, {\n            type: \"reset\"\n          });\n          resModel[\"new\"] = {\n            address: cell.address,\n            removeCells: res\n          };\n          break;\n\n        case \"mergeCells\":\n          if (cells.length > 1) {\n            var cList = [];\n            cells.filter(function (a) {\n              return cList.push(a.address);\n            });\n            resModel.old = cList;\n            resModel[\"new\"] = mergeCells(model, table, cells);\n          }\n\n          break;\n\n        case \"unMergeCells\":\n          if (cells.length === 1) {\n            resModel.old = cell.address;\n            resModel[\"new\"] = unMergeCells(model, table, cell, obj[\"default\"]);\n          }\n\n          break;\n\n        case \"hideCol\":\n          if (model.hiddenCols.indexOf(cell.col) === -1) {\n            resModel.old = cell.col;\n            resModel[\"new\"] = cell.col;\n            model.hiddenCols.push(cell.col);\n            tagRender.applyToTable(\"hiddenCells\", table, model);\n          }\n\n          break;\n\n        case \"showCol\":\n          if (model.hiddenCols.indexOf(cell.col) !== -1) {\n            resModel.old = cell.col;\n            resModel[\"new\"] = cell.col;\n            model.hiddenCols.remove(cell.col);\n            tagRender.applyToTable(\"hiddenCells\", table, model);\n          }\n\n          break;\n\n        case \"hideRow\":\n          if (model.hiddenRows.indexOf(cell.row) === -1) {\n            resModel.old = cell.row;\n            model.hiddenRows.push(cell.row);\n            tagRender.applyToTable(\"hiddenCells\", table, model);\n            resModel[\"new\"] = cell.row;\n          }\n\n          break;\n\n        case \"showRow\":\n          if (model.hiddenRows.indexOf(cell.row) !== -1) {\n            resModel.old = cell.row;\n            model.hiddenRows.remove(cell.row);\n            tagRender.applyToTable(\"hiddenCells\", table, model);\n            resModel[\"new\"] = cell.row;\n          }\n\n          break;\n\n        case \"width\":\n          var colsWidth;\n          resModel.old = {\n            address: obj.colNumber,\n            viewType: obj.viewType\n          };\n          resModel[\"new\"] = {\n            address: obj.colNumber,\n            viewType: obj.viewType\n          };\n\n          if (obj.viewType !== \"cross\") {\n            colsWidth = model.colsWidth.filter(function (a) {\n              return a.id === obj.colNumber;\n            });\n            resModel.old.value = Number(colsWidth[0].size.replace(\"px\", \"\"));\n            resModel[\"new\"].value = Number(obj.value);\n          } else {\n            resModel.old.address = \"\";\n            resModel[\"new\"].address = \"\";\n            colsWidth = model.colsWidth;\n            resModel.old.value = Number(colsWidth[0].size.replace(\"px\", \"\"));\n            resModel[\"new\"].value = Number(obj.value);\n          }\n\n          for (var i = 0; i < colsWidth.length; i++) {\n            colsWidth[i].size = obj.value + \"px\";\n            $(table).find(\"th[data-col='\" + colsWidth[i].id + \"']\").css(\"width\", obj.value + \"px\");\n          }\n\n          break;\n\n        case \"height\":\n          var rowsHeight;\n          resModel.old = {\n            address: obj.rowNumber,\n            viewType: obj.viewType\n          };\n          resModel[\"new\"] = {\n            address: obj.rowNumber,\n            viewType: obj.viewType\n          };\n\n          if (obj.viewType !== \"cross\") {\n            rowsHeight = model.rowsHeight.filter(function (a) {\n              return a.id === obj.rowNumber;\n            });\n            resModel.old.value = Number(rowsHeight[0].size.replace(\"px\", \"\"));\n            resModel[\"new\"].value = Number(obj.value);\n          } else {\n            resModel.old.address = \"\";\n            resModel[\"new\"].address = \"\";\n            rowsHeight = model.rowsHeight;\n            resModel.old.value = Number(rowsHeight[0].size.replace(\"px\", \"\"));\n            resModel[\"new\"].value = Number(obj.value);\n          }\n\n          for (var i = 0; i < rowsHeight.length; i++) {\n            rowsHeight[i].size = obj.value + \"px\";\n            $(table).find(\"th[data-row='\" + rowsHeight[i].id + \"']\").css(\"height\", obj.value + \"px\");\n          }\n\n          break;\n      }\n\n      return resModel;\n    };\n\n    var addWarnings = function addWarnings(table, list) {\n      if (list && list.length > 0) for (var i = 0; i < list.length; i++) {\n        var target = $(table).find('[data-address=\"' + list[i].key + '\"]');\n        var a = target.find(\".warning-sign\");\n        $(a).css(\"display\", \"block\");\n        $(a).attr(\"title\", list[i].value);\n      }\n    };\n\n    var removeAllWarning = function removeAllWarning(table) {\n      var allSign = $(table).find(\".warning-sign\");\n      if (allSign && allSign.length) for (var i = 0; i < allSign.length; i++) {\n        $(allSign[i]).css(\"display\", \"none\");\n      }\n    };\n\n    var setDynamicValues = function setDynamicValues(table, model, list) {\n      resetDynamicValue(table, model);\n\n      if (_h.any(list)) {\n        for (var i = 0; i < list.length; i++) {\n          var target = list[i];\n          var cell = model.cells.filter(function (a) {\n            return a.address === target.value;\n          })[0];\n\n          if (cell) {\n            cell.hasDynamicValue = true;\n            cell.oldText = cell.text;\n            cell.text = target.text;\n            cell.redText = target.redText;\n            cell.oldDesc = cell.desc;\n            cell.desc = target.desc;\n            tagRender.applyToElement(table, cell, \"setDynamicValue\");\n          }\n        }\n\n        model.previewMode = true;\n        tagRender.applyToTable(\"setDynamicValue\", table, model);\n      } else {\n        model.previewMode = false;\n        tagRender.applyToTable(\"resetDynamicValue\", table, model);\n      }\n    };\n\n    var resetDynamicValue = function resetDynamicValue(table, model) {\n      var cells = model.cells.filter(function (a) {\n        return a.hasDynamicValue;\n      });\n      model.previewMode = false;\n      tagRender.applyToTable(\"resetDynamicValue\");\n\n      for (var i = 0; i < cells.length; i++) {\n        var cell = cells[i];\n        var needrefresh = false;\n\n        if ('oldText' in cell) {\n          cell.text = cell.oldText;\n          delete cell[\"oldText\"];\n          delete cell[\"hasDynamicValue\"];\n          needrefresh = true;\n        }\n\n        if ('oldDesc' in cell) {\n          cell.desc = cell.oldDesc;\n          delete cell[\"oldDesc\"];\n          delete cell[\"hasDynamicValue\"];\n          needrefresh = true;\n        }\n\n        if (cell.cellInfos.length > 0 && cell.cellInfos[0].type > 3) {\n          cell.text = \"\";\n          needrefresh = true;\n        }\n\n        if (needrefresh) {\n          tagRender.applyToElement(table, cell, \"setDynamicValue\");\n          tagRender.applyToElement(table, cell, \"resetDynamicValue\");\n        }\n\n        cell.redText = false;\n        delete cell[\"hasDynamicValue\"];\n      }\n    };\n\n    var addExtraParams = function addExtraParams(table, cells, obj) {\n      var array = [];\n\n      for (var i = 0; i < cells.length; i++) {\n        var res = cellFunc.addExtraParams(table, cells[i], obj.type, obj.value);\n        array.push(res);\n      }\n\n      return array;\n    };\n\n    var addStyles = function addStyles(table, cells, obj) {\n      var array = [];\n\n      for (var i = 0; i < cells.length; i++) {\n        var res = cellFunc.addStyles(table, cells[i], obj.type, obj.value, obj.defaultVal);\n        array.push(res);\n      }\n\n      return array;\n    };\n\n    var setValues = function setValues(table, cells, obj) {\n      var array = [];\n\n      for (var i = 0; i < cells.length; i++) {\n        var res = cellFunc.addValues(table, cells[i], obj.type, obj.value, obj.title);\n        array.push(res);\n      }\n\n      return array;\n    };\n\n    var setNodeValueName = function setNodeValueName(table, model, obj) {\n      var array = [];\n      var cells = obj.cells;\n\n      switch (obj.type) {\n        case \"NodeInCell\":\n          array = cellFunc.addValues(table, cells[0], obj.type, obj.value, obj.reset);\n          break;\n\n        case \"NodeNameInCell\":\n          for (var i = 0; i < cells.length; i++) {\n            nameCell = cells[i];\n\n            if (nameCell) {\n              var res = cellFunc.addValues(table, nameCell, \"NodeNameInCell\", obj.value[i]);\n              array.push(res);\n            }\n          }\n\n          break;\n\n        case \"NodeValueNameInCell\":\n          for (var i = 0; i < cells.length; i++) {\n            var nameCell = cells[i];\n            var valCell = model.cells.filter(function (a) {\n              return a.row === nameCell.row && a.col === nameCell.col + 1;\n            });\n\n            if (valCell.length && nameCell) {\n              var res = cellFunc.addValues(table, valCell[0], \"NodeInCell\", [{\n                treeId: obj.value[i].treeId,\n                code: obj.value[i].code,\n                operator: \"+\",\n                title: obj.value[i].path.replace(\" :: \", \"\") + \" (\" + obj.value[i].code + \")\",\n                type: 'node',\n                periodId: obj.value[i].periodId\n              }], true);\n              var res2 = cellFunc.addValues(table, nameCell, \"NodeNameInCell\", obj.value[i]);\n              array.push({\n                old: {\n                  NodeInCell: res.old,\n                  NodeNameInCell: res2.old\n                },\n                \"new\": {\n                  NodeInCell: res[\"new\"],\n                  NodeNameInCell: res2[\"new\"]\n                }\n              });\n            }\n          }\n\n          break;\n      }\n\n      return array;\n    };\n\n    var setTotalCost = function setTotalCost(table, model, cells, obj) {\n      var cell = cells[0];\n      var res = false;\n      var resModel = {\n        old: ko.toJS(model.totalCostProperties)\n      };\n\n      switch (obj.type) {\n        case \"groupType\":\n          res = changeGroupType(model, obj.value, cell.value);\n          break;\n\n        case \"sortDirection\":\n          res = changeSortDirection(model, obj.value, cell.value);\n          break;\n      }\n\n      resModel[\"new\"] = ko.toJS(model.totalCostProperties);\n      if (res) return resModel;else return res;\n    };\n\n    var setFinancialProperties = function setFinancialProperties(table, model, obj) {\n      if (model.financialProperties.sortColumn.id !== obj.colNumber) {\n        model.financialProperties.sortColumn.regions = undefined;\n        model.financialProperties.sortColumn.sortDirection = undefined;\n      }\n\n      switch (obj.type) {\n        case \"colSortDirection\":\n          model.financialProperties.sortColumn.sortDirection = obj.value;\n          model.financialProperties.sortColumn.id = obj.colNumber;\n          tagRender.applyToTable(obj.type, table, model);\n          break;\n\n        case \"region\":\n          model.financialProperties.sortColumn.id = obj.colNumber;\n          model.financialProperties.sortColumn.regions = obj.value;\n\n          if (_h.isNullOrEmpty(model.financialProperties.sortColumn.sortDirection)) {\n            model.financialProperties.sortColumn.sortDirection = 0;\n            tagRender.applyToTable(\"colSortDirection\", table, model);\n          }\n\n          break;\n\n        case \"reset\":\n          model.financialProperties.sortColumn.id = undefined;\n          model.financialProperties.sortColumn.regions = [];\n          model.financialProperties.sortColumn.sortDirection = undefined;\n          tagRender.applyToTable(\"colSortDirectionReset\", table, model);\n          break;\n      }\n\n      return true;\n    };\n\n    var init = function init(target, options) {\n      if (!target.length) return false;\n      target = target.get(0);\n      options.el = target;\n      target.innerHTML = \"\";\n      var model = options.model;\n      var table = tagRender.buildTable(target, model, options.type);\n\n      if (options.type === \"cellSelect\") {\n        return;\n      }\n\n      var $table = $(table);\n      $table.data(\"model\", options.model);\n      var oldModel = JSON.parse(JSON.stringify(options.model));\n      $table.data(\"oldModel\", oldModel);\n      $table.data(\"baseSelector\", options.baseSelector);\n      $table.data(\"historyModel\", {\n        position: 0,\n        history: []\n      });\n      $table.attr(\"id\", options.baseSelector.replace(\"#rg\", \"rgt\"));\n      tagRender.applyToTable(\"hiddenCells\", table, model);\n      resizeFunc(table);\n      $table.addClass(selectableTableClass);\n      addTableEvents($table);\n      $table.data(dataKey, {\n        selFrom: false,\n        selTo: false,\n        isHighlighted: undefined,\n        $currTR: $(),\n        $currTH: $(),\n        $currCell: $()\n      });\n\n      if (options.bindErrors && options.bindErrors.length) {\n        addWarnings(table, options.bindErrors);\n      }\n\n      _h.activeTooltip(true);\n    };\n\n    var changeGroupType = function changeGroupType(model, val, cellVal) {\n      if (_h.isNullOrEmpty(cellVal) || cellVal === \"\" || cellVal.indexOf(\"table\") === -1) return false;\n      var array = cellVal.split(\":\");\n      array = _h.cleanArray(array);\n      var temp = array[2].replace(\"]\", \"\");\n      var id = Number(temp);\n\n      if (_h.isNullOrEmpty(val) && model.totalCostProperties.groupColumn.id === id) {\n        model.totalCostProperties.groupColumn = {\n          id: undefined,\n          groupType: undefined\n        };\n        return true;\n      }\n\n      if (!_h.isNullOrEmpty(id) && !_h.isNullOrEmpty(val)) {\n        model.totalCostProperties.groupColumn = {\n          id: id,\n          groupType: val\n        };\n        return true;\n      }\n    };\n\n    var changeSortDirection = function changeSortDirection(model, val, cellVal) {\n      if (_h.isNullOrEmpty(cellVal) || cellVal === \"\" || cellVal.indexOf(\"table\") === -1) return false;\n      var array = cellVal.split(\":\");\n      array = _h.cleanArray(array);\n      var temp = array[2].replace(\"]\", \"\");\n      var id = Number(temp);\n      var isEdit = false;\n\n      if (_h.any(model.totalCostProperties.sortColumns)) {\n        var deleteItem;\n\n        for (var i = 0; i < model.totalCostProperties.sortColumns.length; i++) {\n          var item = model.totalCostProperties.sortColumns[i];\n\n          if (item.id === id) {\n            if (val && val !== item.sortDirection) {\n              item.sortDirection = val;\n              isEdit = true;\n            }\n\n            if (!val) deleteItem = item;\n          }\n        }\n\n        if (deleteItem) model.totalCostProperties.sortColumns.remove(deleteItem);\n        return true;\n      }\n\n      if (!isEdit && !_h.isNullOrEmpty(val)) {\n        model.totalCostProperties.sortColumns.push({\n          id: id,\n          sortDirection: val\n        });\n        return true;\n      }\n\n      return false;\n    };\n\n    var compareModels = function compareModels(table) {\n      var oldModel = $(table).data('oldModel');\n      var model = $(table).data('model'); //var start = performance.now();\n\n      var res = comparator.isEqual(model, oldModel); //var duration = performance.now() - start;\n      //console.log(\"duration : \" + duration);\n\n      return !res;\n    };\n\n    var fixFindingTable = function fixFindingTable($this) {\n      var table = $($this).find(\"table.tcs\");\n      var id = $(table).attr(\"id\");\n      table = $(\"#\" + id);\n      return table;\n    };\n\n    var addToHistory = function addToHistory(table, cells, obj, result) {//var dataModel = $(table).data(\"historyModel\");\n      //if (dataModel.position < dataModel.history.length - 1) {\n      //    dataModel.history = dataModel.history.slice(0, dataModel.position + 1);\n      //}\n      //dataModel.position += 1;\n      //var idList = [];\n      //if (cells && cells.length) {\n      //    cells.filter(a => idList.push(a.address));\n      //}\n      //var cellsEffected = [];\n      //if (obj[\"cellsEffected\"])\n      //    obj.cellsEffected.filter(a => cellsEffected.push(a.address));\n      //var command = new RgCommand({ old: result[0].old, new: result[0].new, type: obj.type, cellsSelected: idList, cellsEffected: cellsEffected });\n      //console.log(command);\n      //dataModel.history.push(command);\n      //$(table).data(\"historyModel\", dataModel);\n    };\n\n    var selectRangeCells = function selectRangeCells(table, list, callback) {\n      $(table).find(\"td\").removeClass(selectedCellClass);\n\n      for (var i = 0; i < list.length; i++) {\n        var target = $(table).find('td[data-address=\"' + list[i] + '\"]');\n        if (!$(target).hasClass(selectedCellClass)) $(target).addClass(selectedCellClass);\n      }\n\n      setTimeout(function () {\n        callback(true);\n      }, 50);\n    };\n\n    var fixHistoryArray = function fixHistoryArray(array) {\n      if (Array.isArray(array)) {\n        return array;\n      } else {\n        return [array];\n      }\n    };\n\n    var setEventActions = function setEventActions(table, model, type, cells, oldCells) {\n      for (var j = 0; j < cells.length; j++) {\n        var cell = cells[j];\n\n        switch (type) {\n          case \"PasteCell\":\n            if (_typeof(oldCells) === 'object' && !Array.isArray(oldCells)) {\n              cellFunc.pasteCell(table, cell, oldCells, model.cols, model.rows);\n            }\n\n            if (Array.isArray(oldCells)) {\n              var oldCell = oldCells.filter(function (a) {\n                return a.address === cell.address;\n              });\n\n              if (oldCell.length) {\n                cellFunc.pasteCell(table, cell, oldCell[0], model.cols, model.rows);\n              }\n            }\n\n            break;\n\n          case \"PasteCellStyle\":\n            cellFunc.pasteCell(table, cell, oldCells, model.cols, model.rows);\n            break;\n        }\n      }\n    };\n\n    var findCommandGroup = function findCommandGroup(obj) {\n      var type = obj.id;\n      obj.type = obj.id;\n      var group = rgCommandList[obj.id];\n\n      if (!group) {\n        type = findPeriodAction(obj.type);\n        group = rgCommandList[type];\n      }\n\n      return group;\n    };\n\n    var findPeriodAction = function findPeriodAction(type) {\n      if (type.indexOf(\"period\") !== -1) {\n        var numb = type.match(/\\d/g);\n\n        if (numb.length > 1) {\n          numb = numb[0] + numb[1];\n        } else {\n          numb = numb[0];\n        }\n\n        type = type.replace(numb, \"_\");\n      }\n\n      return type;\n    };\n\n    var executeCommand = function executeCommand(table, model, obj) {\n      var group = findCommandGroup(obj);\n      var cells = rgUtil.getSelectedCellModels(table);\n      var result,\n          resModel = undefined;\n\n      switch (group) {\n        case \"tableAction\":\n          resModel = rgUtil.tableActions(table, model, cells, obj);\n\n          if (obj.type === \"width\" || obj.type === \"height\") {\n            if (!obj[\"undoAction\"]) rgUtil.addToHistory(table, cells, {\n              type: obj.type,\n              value: value\n            }, fixHistoryArray(resModel));\n            return true;\n          }\n\n          break;\n\n        case \"style\":\n          var value = obj.value;\n          if (obj.type === \"erase\") value = model.accountType;\n          if (obj.cell) resModel = rgUtil.addStyles(table, [obj.cell], obj);else resModel = rgUtil.addStyles(table, cells, {\n            type: obj.type,\n            value: value,\n            defaultVal: obj[\"default\"]\n          });\n          break;\n\n        case \"extraParam\":\n          resModel = rgUtil.addExtraParams(table, cells, obj);\n          break;\n\n        case \"setValue\":\n          if (obj.cells) resModel = rgUtil.setValues(table, obj.cells, obj);else resModel = rgUtil.setValues(table, cells, obj);\n          break;\n\n        case \"totalCost\":\n          resModel = rgUtil.setTotalCost(table, model, cells);\n          break;\n\n        case \"xbrlConcept\":\n          resModel = rgUtil.setValues(table, cells, {\n            type: \"xbrlConcept\",\n            value: false\n          });\n          break;\n\n        case \"financialProperties\":\n          resModel = rgUtil.setFinancialProperties(table, model, obj);\n          break;\n\n        case \"treeActions\":\n          resModel = rgUtil.setNodeValueName(table, model, obj);\n          break;\n\n        case \"formulaActions\":\n          if (!obj.cell) obj.cell = cells[0];\n          resModel = cellFunc.addValues(table, obj.cell, obj.type, obj.value, obj.reset);\n          break;\n\n        case \"setText\":\n          resModel = cellFunc.setText(table, obj.cell, obj.type, obj.value);\n          break;\n\n        case \"eventActions\":\n          resModel = rgUtil.setEventActions(table, model, obj.type, cells, obj.value);\n          break;\n\n        case \"setSpecialValue\":\n          resModel = rgUtil.setValues(table, obj.cells, obj);\n          if (!obj[\"undoAction\"]) rgUtil.addToHistory(table, obj.cells, {\n            type: obj.type,\n            value: value,\n            cellsEffected: obj[\"cellsEffected\"]\n          }, fixHistoryArray(resModel));\n          return true;\n      }\n\n      if (resModel) {\n        result = true;\n        if (!obj[\"undoAction\"]) rgUtil.addToHistory(table, cells, {\n          type: obj.type,\n          value: value\n        }, fixHistoryArray(resModel));\n      }\n\n      return result;\n    };\n\n    return {\n      init: init,\n      getTable: getTable,\n      findPeriodAction: findPeriodAction,\n      getModel: getModel,\n      fixFindingTable: fixFindingTable,\n      tableActions: tableActions,\n      addExtraParams: addExtraParams,\n      setValues: setValues,\n      getSelectedCells: getSelectedCells,\n      getSelectedCellModels: getSelectedCellModels,\n      setDynamicValues: setDynamicValues,\n      resetDynamicValue: resetDynamicValue,\n      addWarnings: addWarnings,\n      removeAllWarning: removeAllWarning,\n      addStyles: addStyles,\n      getRectanglePoints: getRectanglePoints,\n      getColsWidth: getColsWidth,\n      getRowsHeight: getRowsHeight,\n      getSelectedCellsShape: getSelectedCellsShape,\n      selectGroupCells: selectGroupCells,\n      setTotalCost: setTotalCost,\n      compareModels: compareModels,\n      setFinancialProperties: setFinancialProperties,\n      addToHistory: addToHistory,\n      executeCommand: executeCommand,\n      selectRangeCells: selectRangeCells,\n      setNodeValueName: setNodeValueName,\n      setEventActions: setEventActions,\n      stringIsEnglish: stringIsEnglish,\n      getFormulaType: getFormulaType,\n      fixHistoryArray: fixHistoryArray\n    };\n  }();\n\n  var rgMethods = {\n    init: function init(options) {\n      rgUtil.init(this, options);\n    },\n    command: function command(obj) {\n      obj.type = obj.id;\n      var table = rgUtil.fixFindingTable(this);\n      var model = rgUtil.getModel(table);\n      var result = rgUtil.executeCommand(table, model, obj);\n      return result;\n    },\n    getCellValues: function getCellValues() {\n      var array = [];\n      var table = rgUtil.fixFindingTable(this);\n      var cells = rgUtil.getSelectedCellModels(table);\n\n      if (cells.length === 1) {\n        array = cellFunc.getCellValues(cells[0], \"node\");\n      }\n\n      return array;\n    },\n    getTotalCostModel: function getTotalCostModel(value) {\n      var table = rgUtil.fixFindingTable(this);\n      var model = rgUtil.getModel(table);\n      var dataModel = {\n        groupType: undefined,\n        sortDirection: undefined\n      };\n      if (_h.isNullOrEmpty(value) || value === \"\" || value.indexOf(\"table\") === -1) return dataModel;\n      var array = value.split(\":\");\n      array = _h.cleanArray(array);\n      var temp = array[2].replace(\"]\", \"\");\n      var id = Number(temp);\n      if (isNaN(id) || _h.isNullOrEmpty(id)) return dataModel;\n\n      if (!_h.isNullOrEmpty(model.totalCostProperties.groupColumn) && model.totalCostProperties.groupColumn.id === id) {\n        model.groupType = model.totalCostProperties.groupColumn.groupType;\n      }\n\n      if (_h.any(model.totalCostProperties.sortColumns)) for (var i = 0; i < model.totalCostProperties.sortColumns.length; i++) {\n        var item = model.totalCostProperties.sortColumns[i];\n\n        if (item.id === id) {\n          model.sortDirection = item.sortDirection;\n        }\n      }\n      return dataModel;\n    },\n    setFormula: function setFormula(obj) {\n      var table = rgUtil.fixFindingTable(this);\n      var cells = rgUtil.getSelectedCellModels(table);\n      var model = rgUtil.getModel(table);\n      obj.reset = true;\n      obj.cells = cells;\n      var result = rgUtil.executeCommand(table, model, obj);\n      return cells[0];\n    },\n    getModel: function getModel() {\n      var table = rgUtil.fixFindingTable(this);\n      return table.data(\"model\");\n    },\n    getSelectedCells: function getSelectedCells() {\n      var table = rgUtil.fixFindingTable(this);\n      var cells = rgUtil.getSelectedCellModels(table);\n      return cells;\n    },\n    getSelectedCellsData: function getSelectedCellsData() {\n      var table = rgUtil.fixFindingTable(this);\n      var cells = rgUtil.getSelectedCellModels(table);\n      var shapeData = rgUtil.getSelectedCellsShape(cells);\n      return {\n        cells: cells,\n        shapeData: shapeData\n      };\n    },\n    previewMode: function previewMode(type, list, bindErrors, hiddenRows, hiddenCols) {\n      var table = rgUtil.fixFindingTable(this);\n      var model = rgUtil.getModel(table);\n\n      if (type === \"reset\") {\n        rgUtil.resetDynamicValue(table, model);\n        rgUtil.removeAllWarning(table);\n        tagRender.applyToTable(\"hiddenCells\", table, model);\n      }\n\n      if (type === \"set\") {\n        rgUtil.removeAllWarning(table);\n        rgUtil.setDynamicValues(table, model, list);\n        rgUtil.addWarnings(table, bindErrors);\n        tagRender.applyToTable(\"DynamicValueHiddenCells\", table, model, [hiddenRows, hiddenCols]);\n      }\n    },\n    setWarning: function setWarning(list) {\n      var table = rgUtil.fixFindingTable(this);\n      rgUtil.removeAllWarning(table);\n      if (_h.any(list)) rgUtil.addWarnings(table, list);\n    },\n    removeWarnings: function removeWarnings() {\n      var table = rgUtil.fixFindingTable(this);\n      rgUtil.removeAllWarning(table);\n    },\n    setCellBinds: function setCellBinds(list) {\n      var table = rgUtil.fixFindingTable(this);\n      var model = rgUtil.getModel(table);\n      model.cellBinds = list;\n      table.data(\"model\", model);\n    },\n    getCellBinds: function getCellBinds() {\n      var table = rgUtil.fixFindingTable(this);\n      var model = rgUtil.getModel(table);\n      return model.cellBinds;\n    },\n    getBorder: function getBorder() {\n      var table = rgUtil.fixFindingTable(this);\n      var cells = rgUtil.getSelectedCellModels(table);\n      return rgUtil.getRectanglePoints(cells);\n    },\n    toServer: function toServer(sign) {\n      var table = $(this).find(\"table.tcs\"); //var inPreviewMode = $(table).hasClass(\"preview-mode\");\n\n      var model = rgUtil.getModel(table);\n      if (!model) return undefined; //var colsWidth = rgUtil.getColsWidth(table);\n      //var rowsHeight = rgUtil.getRowsHeight(table);\n      // inPreviewMode || sign\n\n      if (sign) {\n        var outModel = ko.toJS(model);\n\n        for (var i = 0; i < outModel.cells.length; i++) {\n          var cell = outModel.cells[i];\n\n          if ('oldText' in cell) {\n            cell.text = cell.oldText;\n          }\n\n          if (cell.cellInfos.length > 0 && cell.cellInfos[0].type > 3) {\n            cell.text = \"\";\n          }\n        } //outModel.colsWidth = colsWidth;\n        //outModel.rowsHeight = rowsHeight;\n\n\n        return [outModel, true];\n      } else {\n        //model.colsWidth = colsWidth;\n        //model.rowsHeight = rowsHeight;\n        var isChanged = rgUtil.compareModels(table);\n        return [model, isChanged];\n      }\n    },\n    selectGroupCells: function selectGroupCells(list) {\n      var table = $(this).find(\"table.tcs\");\n      rgUtil.selectGroupCells(table, list);\n      var cells = rgUtil.getSelectedCellModels(table);\n      return cells;\n    },\n    getCellElement: function getCellElement() {\n      var table = $(this).find(\"table.tcs\")[0];\n      var cells = rgUtil.getSelectedCells($(table));\n\n      if (cells.length === 1) {\n        return cells[0];\n      }\n    },\n    refreshCellsTag: function refreshCellsTag(list) {\n      var table = rgUtil.getTable(this);\n      var model = rgUtil.getModel(table);\n      if (list && list.length) for (var i = 0; i < list.length; i++) {\n        var cell = model.cells.filter(function (a) {\n          return a.address === list[i].key;\n        })[0];\n\n        if (cell) {\n          cell.tag = list[i].value;\n        }\n      }\n    },\n    undo: function undo(defaultVal) {\n      var table = rgUtil.fixFindingTable(this);\n      var model = rgUtil.getModel(table);\n      var historyModel = table.data(\"historyModel\");\n\n      if (historyModel.position > 0) {\n        var lastAction = historyModel.history[historyModel.position - 1];\n        var tType = lastAction.type;\n\n        if (lastAction.type.indexOf(\"period\") !== -1) {\n          tType = rgUtil.findPeriodAction(lastAction.type);\n        }\n\n        var oppositeAction = oppositeActions[tType];\n\n        if (oppositeAction) {\n          switch (oppositeAction) {\n            case \"mergeCells\":\n              rgUtil.selectRangeCells(table, lastAction[\"new\"], function () {\n                var cells = rgUtil.getSelectedCellModels(table);\n                rgUtil.executeCommand(table, model, {\n                  type: lastAction.type,\n                  id: oppositeAction,\n                  value: lastAction.old,\n                  cells: cells,\n                  cell: cells[0],\n                  undoAction: true,\n                  \"default\": defaultVal\n                });\n              });\n              break;\n\n            case \"deleteRow\":\n            case \"deleteCol\":\n              rgUtil.selectRangeCells(table, [lastAction.old], function () {\n                var cells = rgUtil.getSelectedCellModels(table);\n                rgUtil.executeCommand(table, model, {\n                  type: lastAction.type,\n                  id: oppositeAction,\n                  value: lastAction.old,\n                  cells: cells,\n                  cell: cells[0],\n                  undoAction: true,\n                  \"default\": defaultVal\n                });\n              });\n              break;\n\n            case \"colRight\":\n            case \"rowTop\":\n              rgUtil.selectRangeCells(table, [lastAction.old.address], function () {\n                var cells = rgUtil.getSelectedCellModels(table);\n                rgUtil.executeCommand(table, model, {\n                  type: lastAction.type,\n                  id: oppositeAction,\n                  value: lastAction.old,\n                  cells: cells,\n                  cell: cells[0],\n                  undoAction: true,\n                  \"default\": defaultVal\n                });\n                var nCells = [];\n                lastAction[\"new\"].removeCells.filter(function (a) {\n                  return nCells.push(a.address);\n                });\n                rgUtil.selectRangeCells(table, nCells, function () {\n                  cells = rgUtil.getSelectedCellModels(table);\n                  rgUtil.executeCommand(table, model, {\n                    type: \"PasteCell\",\n                    id: \"PasteCell\",\n                    value: lastAction[\"new\"].removeCells,\n                    cells: cells,\n                    cell: cells[0],\n                    undoAction: true,\n                    \"default\": defaultVal\n                  });\n                });\n              });\n              break;\n\n            default:\n              if (lastAction.type === \"PartialSum\") {\n                rgUtil.selectRangeCells(table, lastAction.cellsSelected, function () {\n                  var cells = rgUtil.getSelectedCellModels(table);\n                  rgUtil.executeCommand(table, model, {\n                    type: lastAction.type,\n                    id: oppositeAction,\n                    value: lastAction.old,\n                    cells: cells,\n                    cell: cells[0],\n                    undoAction: true,\n                    \"default\": defaultVal\n                  });\n                  rgUtil.selectRangeCells(table, lastAction.cellsEffected, function () {});\n                });\n              } else {\n                rgUtil.selectRangeCells(table, lastAction.cellsSelected, function () {\n                  var cells = rgUtil.getSelectedCellModels(table);\n                  rgUtil.executeCommand(table, model, {\n                    type: lastAction.type,\n                    id: oppositeAction,\n                    value: lastAction.old,\n                    cells: cells,\n                    cell: cells[0],\n                    undoAction: true,\n                    \"default\": defaultVal\n                  });\n                });\n              }\n\n              break;\n          }\n        } else {\n          switch (lastAction.type) {\n            case \"height\":\n            case \"width\":\n              rgUtil.executeCommand(table, model, {\n                type: lastAction.type,\n                id: lastAction.type,\n                viewType: lastAction.old.viewType,\n                rowNumber: lastAction.old[\"address\"],\n                colNumber: lastAction.old[\"address\"],\n                value: lastAction.old.value,\n                cells: [],\n                cell: null,\n                undoAction: true,\n                \"default\": defaultVal\n              });\n              break;\n\n            default:\n              rgUtil.selectRangeCells(table, lastAction.cellsSelected, function () {\n                var cells = rgUtil.getSelectedCellModels(table);\n                rgUtil.executeCommand(table, model, {\n                  type: lastAction.type,\n                  id: lastAction.type,\n                  value: lastAction.old,\n                  cells: cells,\n                  cell: cells[0],\n                  undoAction: true,\n                  \"default\": defaultVal\n                });\n              });\n              break;\n          }\n        }\n\n        historyModel.position -= 1;\n      }\n    },\n    redo: function redo(defaultVal) {\n      var table = rgUtil.fixFindingTable(this);\n      var historyModel = table.data(\"historyModel\");\n\n      if (historyModel.position <= historyModel.history.length - 1) {\n        var nextAction = historyModel.history[historyModel.position];\n        var oppositeAction = oppositeActions[nextAction.type];\n\n        if (oppositeAction) {\n          switch (oppositeAction) {\n            case \"mergeCells\":\n              rgUtil.selectRangeCells(table, nextAction[\"new\"], function () {\n                rgUtil.executeCommand(table, model, {\n                  type: nextAction.type,\n                  id: oppositeAction,\n                  value: nextAction[\"new\"],\n                  cellsSelected: nextAction.cellsSelected,\n                  undoAction: true,\n                  defaultVal: defaultVal\n                });\n              });\n              break;\n\n            case \"deleteRow\":\n            case \"deleteCol\":\n              rgUtil.selectRangeCells(table, [nextAction[\"new\"]], function () {\n                var cells = rgUtil.getSelectedCellModels(table);\n                rgUtil.executeCommand(table, model, {\n                  type: nextAction.type,\n                  id: oppositeAction,\n                  value: nextAction[\"new\"],\n                  cells: cells,\n                  cell: cells[0],\n                  undoAction: true,\n                  \"default\": defaultVal\n                });\n              });\n              break;\n\n            case \"colRight\":\n            case \"rowTop\":\n              rgUtil.selectRangeCells(table, [nextAction.old.address], function () {\n                var cells = rgUtil.getSelectedCellModels(table);\n                rgUtil.executeCommand(table, model, {\n                  type: nextAction.type,\n                  id: oppositeAction,\n                  value: nextAction.old,\n                  cells: cells,\n                  cell: cells[0],\n                  undoAction: true,\n                  \"default\": defaultVal\n                });\n                var nCells = [];\n                rgUtil.selectRangeCells(table, nCells, function () {\n                  cells = rgUtil.getSelectedCellModels(table);\n                  rgUtil.executeCommand(table, model, {\n                    type: \"PasteCell\",\n                    id: \"PasteCell\",\n                    value: lastAction[\"new\"].removeCells,\n                    cells: cells,\n                    cell: cells[0],\n                    undoAction: true,\n                    \"default\": defaultVal\n                  });\n                });\n              });\n              break;\n\n            default:\n              if (nextAction.type === \"PartialSum\") {\n                rgUtil.selectRangeCells(table, nextAction.cellsSelected, function () {\n                  var cells = rgUtil.getSelectedCellModels(table);\n                  rgUtil.executeCommand(table, model, {\n                    type: nextAction.type,\n                    id: oppositeAction,\n                    value: nextAction[\"new\"],\n                    cells: cells,\n                    cell: cells[0],\n                    undoAction: true,\n                    \"default\": defaultVal\n                  });\n                  rgUtil.selectRangeCells(table, nextAction.cellsEffected, function () {});\n                });\n              } else {\n                rgUtil.selectRangeCells(table, nextAction.cellsSelected, function () {\n                  var cells = rgUtil.getSelectedCellModels(table);\n                  rgUtil.executeCommand(table, model, {\n                    type: nextAction.type,\n                    id: oppositeAction,\n                    value: nextAction[\"new\"],\n                    cells: cells,\n                    cell: cells[0],\n                    undoAction: true,\n                    \"default\": defaultVal\n                  });\n                });\n              }\n\n              break;\n          }\n        } else {\n          switch (lastAction.type) {\n            case \"height\":\n            case \"width\":\n              rgUtil.selectRangeCells(table, nextAction.cellsSelected, function () {\n                rgUtil.executeCommand(table, model, {\n                  type: nextAction.type,\n                  id: nextAction.type,\n                  value: nextAction[\"new\"].value,\n                  cellsSelected: nextAction.cellsSelected,\n                  viewType: nextAction.old.viewType,\n                  rowNumber: nextAction.old[\"address\"],\n                  colNumber: nextAction.old[\"address\"],\n                  undoAction: true,\n                  defaultVal: defaultVal\n                });\n              });\n              break;\n\n            default:\n              rgUtil.selectRangeCells(table, nextAction.cellsSelected, function () {\n                rgUtil.executeCommand(table, model, {\n                  type: nextAction.type,\n                  id: nextAction.type,\n                  value: nextAction[\"new\"],\n                  cellsSelected: nextAction.cellsSelected,\n                  undoAction: true,\n                  defaultVal: defaultVal\n                });\n              });\n              break;\n          }\n        }\n\n        historyModel.position += 1;\n      }\n    },\n    getToolbarStateData: function getToolbarStateData() {\n      try {\n        var table = rgUtil.fixFindingTable(this);\n        var model = table.data(\"model\");\n        var historyModel = table.data(\"historyModel\");\n        var cells = rgUtil.getSelectedCellModels(table);\n        var shapeData = rgUtil.getSelectedCellsShape(cells);\n        var showUndo = false,\n            showRedo = false;\n        if (!historyModel) return [cells, shapeData, model, false, false]; //if (historyModel.position > 0) {\n        //    showUndo = true\n        //}\n        //if (historyModel.position < historyModel.history.length) {\n        //    showRedo = true\n        //}\n\n        return [cells, shapeData, model, showUndo, showRedo];\n      } catch (e) {\n        var table = rgUtil.fixFindingTable(this);\n        var model = table.data(\"model\");\n        var shapeData = rgUtil.getSelectedCellsShape(cells);\n        return [[], [0, 0, 0, 0, 0], model, false, false];\n      }\n    },\n    toggleEditable: function toggleEditable(res) {\n      var table = rgUtil.fixFindingTable(this);\n\n      if (res) {\n        $(table).addClass(\"editable-table\");\n      } else {\n        $(table).removeClass(\"editable-table\");\n      }\n    }\n  };\n\n  $.fn.rg = function (methodOrOptions) {\n    if (rgMethods[methodOrOptions]) {\n      return rgMethods[methodOrOptions].apply(this, Array.prototype.slice.call(arguments, 1));\n    } else if (_typeof(methodOrOptions) === 'object' || !methodOrOptions) {\n      return rgMethods.init.apply(this, arguments);\n    } else {\n      $.error('Method ' + methodOrOptions + ' does not exist on jQuery.reportGenerator');\n    }\n  };\n})(jQuery);\n\nvar RgCommand = /*#__PURE__*/_createClass(function RgCommand(model) {\n  _classCallCheck(this, RgCommand);\n\n  this.type = model.type;\n  this.old = model.old;\n  this[\"new\"] = model[\"new\"];\n  this.cellsSelected = model.cellsSelected;\n  this.cellsEffected = model.cellsEffected;\n});\n\n//# sourceURL=webpack://domino/./src/scripts/components/jqrg.js?");

/***/ }),

/***/ "./src/scripts/components/jqtabletreeview.js":
/*!***************************************************!*\
  !*** ./src/scripts/components/jqtabletreeview.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var _hh = __webpack_require__(/*! ./src/scripts/util/htmlHelper.js */ \"./src/scripts/util/htmlHelper.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n(function ($) {\n  var headerUtil = function () {\n    var createFirstRow = function createFirstRow() {\n      var cols = [\"شرح\", \"تراز آزمایشی\", \"تعدیلات و طبقه بندی\", \"مانده نهایی\"];\n\n      var frHeader = _hh.createTag({\n        name: \"div\",\n        className: \"balancereport-set\",\n        parent: $(\"#br_Table\")[0]\n      });\n\n      for (var i = 0; i < cols.length; i++) {\n        _hh.createTag({\n          name: \"div\",\n          text: cols[i],\n          parent: frHeader,\n          className: \"col-title text-center\",\n          styles: i !== 0 ? \"width:21.6%;display:inline-block;padding:24px;font-weight:bold;color: white;\" : \"width:35.2%;display:inline-block;padding:24px;font-weight:bold;color: white;\"\n        });\n      }\n    };\n\n    var setSortIcon = function setSortIcon(tag, direction) {\n      switch (direction) {\n        case \"Ascending\":\n          _hh.setClassName(tag, 'fa fa-sort-amount-asc');\n\n          break;\n\n        case \"Descending\":\n          _hh.setClassName(tag, 'fa fa-sort-amount-desc');\n\n          break;\n\n        case \"None\":\n          _hh.setClassName(tag, 'fa fa-sort');\n\n          break;\n      }\n    };\n\n    var createSecondRow = function createSecondRow(cols) {\n      var table = document.getElementById(\"br_Table\");\n\n      var srHeader = _hh.createTag({\n        name: \"div\",\n        className: \"balancereport-second-set\",\n        parent: table,\n        styles: \"direction: ltr;\"\n      });\n\n      var groupCol, groupDiv;\n\n      for (var i = 0; i < cols.length; i++) {\n        var col = cols[i];\n        if (!col.tablecol) continue;\n\n        if (col.groupBy !== groupCol) {\n          groupCol = col.groupBy;\n          groupDiv = _hh.createTag({\n            name: \"div\",\n            parent: srHeader,\n            addBefore: true,\n            styles: groupCol === \"desc\" ? \"width:35.2%;display:inline-block;\" : \"width:21.6%;display:inline-block;\"\n          });\n        }\n\n        var tag = _hh.createTag({\n          name: \"div\",\n          className: \"tbl-col-second ver-mid column-cell\",\n          parent: groupDiv,\n          addBefore: true,\n          attributes: {\n            \"col-name\": col.name\n          },\n          styles: col.name !== \"name\" ? \"width:\" + col.size + \"%;padding:13px 0px 13px 13px;\" : \"width:\" + col.size + \"%;padding:13px;\",\n          onclick: function onclick() {\n            var colName = this.getAttribute(\"col-name\");\n            var opts = ttvUtil.getOptions();\n            var col;\n\n            for (var j = 0; j < _h.kocnx().brvm().tableProperties().length; j++) {\n              var sortItem = _h.kocnx().brvm().tableProperties()[j];\n\n              if (colName === sortItem.name) {\n                col = sortItem;\n\n                if (sortItem.sortDir() === \"Ascending\") {\n                  sortItem.sortDir(\"Descending\");\n                  setSortIcon(this.childNodes[1], sortItem.sortDir());\n                } else {\n                  sortItem.sortDir(\"Ascending\");\n                  setSortIcon(this.childNodes[1], sortItem.sortDir());\n                }\n              } else {\n                sortItem.sortDir(\"None\");\n                setSortIcon(this.childNodes[1], \"None\");\n              }\n            }\n\n            if (col[\"alias\"] !== null && col[\"alias\"] !== undefined && col[\"alias\"] !== \"\") _h.kocnx().brvm().sortProperty(col.alias);else _h.kocnx().brvm().sortProperty(col.name);\n\n            _h.kocnx().brvm().sortDirection(col.sortDir());\n\n            _h.kocnx().brvm().getRecords();\n\n            if (col) opts.cols = ko.toJS(_h.kocnx().brvm().tableProperties());\n          }\n        });\n\n        var span = _hh.createTag({\n          name: \"div\",\n          parent: tag,\n          addBefore: true\n        });\n\n        setSortIcon(span, col.sortDir);\n\n        _hh.createTag({\n          name: \"div\",\n          html: col.fa,\n          parent: tag,\n          addBefore: true,\n          styles: \"margin-right:5px;display: inline-block;\"\n        });\n      }\n    };\n\n    var create = function create(cols) {\n      createFirstRow();\n      createSecondRow(cols);\n    };\n\n    return {\n      create: create,\n      setSortIcon: setSortIcon\n    };\n  }();\n\n  var bodyUtil = function () {\n    var createDriveButtons = function createDriveButtons(row, data, options) {\n      if (options.worksheetView === 1) return;\n\n      var btnBox = _hh.createTag({\n        name: \"div\",\n        className: \"lvl-btn-box\",\n        parent: row\n      });\n\n      var btnDown = _hh.createTag({\n        name: \"a\",\n        className: \"pull-left\",\n        parent: btnBox,\n        attributes: {\n          \"title\": \"پیمایش به سطح پایین\",\n          \"data-id\": data.id,\n          \"data-lv\": data.lv,\n          \"data-ppa\": data.ppa,\n          \"data-pa\": data.pa\n        },\n        children: [{\n          name: \"img\",\n          className: \"icon-image-xxsmall\",\n          attributes: {\n            \"src\": \"/App/src/images/ico/down.png\"\n          }\n        }],\n        attach: false\n      });\n\n      var btnUp = _hh.createTag({\n        name: \"a\",\n        className: \"pull-right\",\n        parent: btnBox,\n        attributes: {\n          \"title\": \"پیمایش به سطح بالا\",\n          \"data-id\": data.id,\n          \"data-pa\": data.pa,\n          \"data-lv\": data.lv,\n          \"data-ppa\": data.ppa\n        },\n        children: [{\n          name: \"img\",\n          className: \"icon-image-xxsmall\",\n          attributes: {\n            \"src\": \"/App/src/images/ico/up.png\"\n          }\n        }],\n        attach: false\n      });\n\n      btnDown.onclick = function (e) {\n        var opts = ttvUtil.getOptions();\n\n        _h.kocnx().brvm().downTableNode({\n          level: Number(this.getAttribute(\"data-lv\")),\n          id: Number(this.getAttribute(\"data-id\")),\n          path: this.getAttribute(\"data-pa\"),\n          pathParent: this.getAttribute(\"data-ppa\")\n        }, e);\n      };\n\n      btnUp.onclick = function (e) {\n        var opts = ttvUtil.getOptions();\n\n        _h.kocnx().brvm().upTableNode({\n          level: Number(this.getAttribute(\"data-lv\")),\n          id: Number(this.getAttribute(\"data-id\")),\n          pathParent: this.getAttribute(\"data-ppa\"),\n          path: this.getAttribute(\"data-pa\")\n        }, e);\n      };\n\n      if (!data.il) {\n        btnBox.prepend(btnDown);\n        if (data.lv > 1) btnBox.prepend(btnUp);\n      } else {\n        if (data.lv > 1) btnBox.prepend(btnUp);\n      }\n    };\n\n    var addDepth = function addDepth(row, data) {\n      var parent = row.parentNode;\n      var depth = 0;\n\n      if (parent !== null) {\n        depth = parent.getAttribute(\"dep\");\n        if (!depth) depth = 0;\n\n        _hh.setAttributes(row, {\n          \"dep\": Number(depth) + 1,\n          \"did\": data.id,\n          \"dco\": data.co\n        });\n      }\n\n      return depth;\n    };\n\n    var addEvent = function addEvent(type) {\n      switch (type) {\n        case \"Tree\":\n        case \"Total\":\n          return function (e) {\n            _h.kocnx().brvm().balanceReportDetailsBtn({\n              code: this.getAttribute(\"data-co\"),\n              id: Number(this.getAttribute(\"data-id\"))\n            }, e);\n          };\n\n        case \"creditorFlow\":\n        case \"debtorFlow\":\n          return function (e) {\n            _h.kocnx().brvm().amendmentsDetailsBtn(type, {\n              id: Number(this.getAttribute(\"data-id\"))\n            }, e);\n          };\n\n        case \"Balance\":\n          return function (e) {\n            _h.kocnx().brvm().totalDetailsBtn({\n              id: Number(this.getAttribute(\"data-id\"))\n            }, e);\n          };\n      }\n    };\n\n    var createPlusMinusButtons = function createPlusMinusButtons(row, data, options) {\n      if (options.worksheetView === 0) return;\n\n      switch (data.nt) {\n        case 2:\n        case 0:\n          _hh.createTag({\n            name: \"i\",\n            className: \"dmn-att fa fa-file-o node-va\",\n            parent: row\n          });\n\n          break;\n\n        case 1:\n          _hh.createTag({\n            name: \"i\",\n            className: \"dmn-p fa fa-plus node-va\",\n            parent: row,\n            onclick: function onclick() {\n              ttvUtil.toggleOpenButtons(this);\n            }\n          });\n\n          _hh.createTag({\n            name: \"i\",\n            className: \"dmn-fld fa fa-folder node-va\",\n            parent: row\n          });\n\n          break;\n      }\n    };\n\n    var createTreeColGroup = function createTreeColGroup(groupColDiv, data, options) {\n      var row = _hh.createTag({\n        name: \"div\",\n        className: \"table-node\",\n        parent: groupColDiv,\n        styles: options.worksheetView === 0 ? \"border-bottom: 1px solid #dee6ea;\" : \"\"\n      });\n\n      var depth = addDepth(row, data);\n      createDriveButtons(row, data, options);\n      createPlusMinusButtons(row, data, options);\n\n      _hh.createTag({\n        name: \"div\",\n        className: \"table-node-title\",\n        parent: row,\n        text: _h.shortName(data.na)[0],\n        attributes: {\n          \"title\": data.pa\n        },\n        styles: options.worksheetView === 0 ? \"margin-right:38px;\" : \"\"\n      });\n\n      var codeConfig = {\n        name: \"span\",\n        parent: row,\n        text: \"( \" + data.co + \" )\",\n        className: \"table-node-code\",\n        attributes: {\n          \"data-id\": data.id,\n          \"data-co\": data.co\n        }\n      };\n\n      if (data.il && options.companyType === 1 && (data.tc !== 0 || data.td !== 0)) {\n        codeConfig.className = \"table-node-code link-underline clickable\";\n        codeConfig.onclick = addEvent(\"Tree\");\n      }\n\n      _hh.createTag(codeConfig);\n\n      if (data.nt === 1 || data.nt === 2) {\n        var ul = _hh.createTag({\n          name: \"div\",\n          className: \"node-ch dmn-c\",\n          parent: row,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        if (data.children && data.children.length) for (var i = 0; i < data.children.length; i++) {\n          bodyUtil.createTreeColGroup(ul, data.children[i], options);\n        }\n      }\n    };\n\n    var createTotalColGroup = function createTotalColGroup(groupColDiv, data, options) {\n      var groupDiv = document.createElement(\"div\");\n      groupColDiv.appendChild(groupDiv);\n      var depth = addDepth(groupDiv, data);\n\n      var tdDiv = _hh.createTag({\n        name: \"div\",\n        className: \"table-cell\",\n        parent: groupDiv,\n        styles: \"width:50%;\"\n      });\n\n      var tcDiv = _hh.createTag({\n        name: \"div\",\n        className: \"table-cell\",\n        parent: groupDiv,\n        styles: \"width:50%;\"\n      });\n\n      var tdSpan = _hh.createTag({\n        name: \"span\",\n        parent: tdDiv,\n        text: _h.shortValue(data.td),\n        attributes: {\n          \"title\": _h.shortValue(data.td),\n          \"data-id\": data.id,\n          \"data-co\": data.co\n        }\n      });\n\n      var tcSpan = _hh.createTag({\n        name: \"span\",\n        parent: tcDiv,\n        text: _h.shortValue(data.tc),\n        attributes: {\n          \"title\": _h.shortValue(data.tc),\n          \"data-id\": data.id,\n          \"data-co\": data.co\n        }\n      });\n\n      if ((data.tc !== 0 || data.td !== 0) && data.il && options.companyType === 0) {\n        tdSpan.className = \"link-underline clickable\";\n        tcSpan.className = \"link-underline clickable\";\n        tdSpan.onclick = addEvent(\"Total\");\n        tcSpan.onclick = addEvent(\"Total\");\n      }\n\n      if (_h.isNumberNegative(data.td)) tdSpan.style.color = \"red\";\n      if (_h.isNumberNegative(data.tc)) tcSpan.style.color = \"red\";\n\n      if (data.nt === 1 || data.nt === 2) {\n        var ul = _hh.createTag({\n          name: \"div\",\n          className: \"dmn-c\",\n          parent: groupDiv,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        if (data.children && data.children.length) for (var i = 0; i < data.children.length; i++) {\n          bodyUtil.createTotalColGroup(ul, data.children[i], options);\n        }\n      }\n    };\n\n    var createFlowColGroup = function createFlowColGroup(groupColDiv, data, options) {\n      var groupDiv = document.createElement(\"div\");\n      groupColDiv.appendChild(groupDiv);\n      var depth = addDepth(groupDiv, data);\n\n      var fldDiv = _hh.createTag({\n        name: \"div\",\n        className: \"table-cell\",\n        parent: groupDiv\n      });\n\n      _hh.setAttributes(fldDiv, {\n        \"style\": \"width:50%;display:inline-block;\"\n      });\n\n      var flcDiv = _hh.createTag({\n        name: \"div\",\n        className: \"table-cell\",\n        parent: groupDiv\n      });\n\n      _hh.setAttributes(flcDiv, {\n        \"style\": \"width:50%;display:inline-block;\"\n      });\n\n      var flcA = _hh.createTag({\n        name: \"a\",\n        className: \"link-underline\",\n        parent: flcDiv,\n        text: _h.shortValue(data.flc),\n        attributes: {\n          \"title\": _h.shortValue(data.flc),\n          \"data-id\": data.id\n        }\n      });\n\n      var fldA = _hh.createTag({\n        name: \"a\",\n        className: \"link-underline\",\n        parent: fldDiv,\n        text: _h.shortValue(data.fld),\n        attributes: {\n          \"title\": _h.shortValue(data.fld),\n          \"data-id\": data.id\n        }\n      });\n\n      flcA.onclick = addEvent(\"creditorFlow\");\n      fldA.onclick = addEvent(\"debtorFlow\");\n\n      if (data.nt === 1 || data.nt === 2) {\n        var ul = _hh.createTag({\n          name: \"div\",\n          className: \"dmn-c\",\n          parent: groupDiv,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        if (data.children && data.children.length) for (var i = 0; i < data.children.length; i++) {\n          bodyUtil.createFlowColGroup(ul, data.children[i], options);\n        }\n      }\n    };\n\n    var createBalanceColGroup = function createBalanceColGroup(groupColDiv, data, options) {\n      var groupDiv = document.createElement(\"div\");\n      groupColDiv.appendChild(groupDiv);\n      var depth = addDepth(groupDiv, data);\n\n      var bdDiv = _hh.createTag({\n        name: \"div\",\n        className: \"table-cell\",\n        parent: groupDiv,\n        styles: \"width:50%;display:inline-block;\"\n      });\n\n      var bcDiv = _hh.createTag({\n        name: \"div\",\n        className: \"table-cell\",\n        parent: groupDiv,\n        styles: \"width:50%;display:inline-block;\"\n      });\n\n      var bdSpan = _hh.createTag({\n        name: \"span\",\n        parent: bdDiv,\n        text: _h.shortValue(data.bd),\n        attributes: {\n          \"title\": _h.shortValue(data.bd),\n          \"data-id\": data.id\n        }\n      });\n\n      var bcSpan = _hh.createTag({\n        name: \"span\",\n        parent: bcDiv,\n        text: _h.shortValue(data.bc),\n        attributes: {\n          \"title\": _h.shortValue(data.bc),\n          \"data-id\": data.id\n        }\n      });\n\n      if (_h.isNumberNegative(data.bc)) bcSpan.style.color = \"red\";\n      if (_h.isNumberNegative(data.bd)) bdSpan.style.color = \"red\";\n\n      if (options.companyType === 0) {\n        bcSpan.className = \"link-underline clickable\";\n        bdSpan.className = \"link-underline clickable\";\n        bcSpan.onclick = addEvent(\"Balance\");\n        bdSpan.onclick = addEvent(\"Balance\");\n      }\n\n      if (data.nt === 1 || data.nt === 2) {\n        var ul = _hh.createTag({\n          name: \"div\",\n          className: \"dmn-c\",\n          parent: groupDiv,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        if (data.children && data.children.length) for (var i = 0; i < data.children.length; i++) {\n          bodyUtil.createBalanceColGroup(ul, data.children[i], options);\n        }\n      }\n    };\n\n    var create = function create(options) {\n      var table = document.getElementById(\"br_Table\");\n\n      var body = _hh.createTag({\n        name: \"div\",\n        className: \"body-table\",\n        parent: table\n      });\n\n      for (var j = 0; j < 4; j++) {\n        var groupColDiv = _hh.createTag({\n          name: \"div\",\n          className: \"body-table\",\n          parent: table,\n          styles: j === 0 ? \"width:35.2%;height:100%;display:inline-block;font-size:12px;\" : \"width:21.6%;height:100%;display:inline-block;font-size:12px;\",\n          attributes: {\n            \"col\": j + 1\n          }\n        });\n\n        body.appendChild(groupColDiv);\n      }\n\n      for (var i = 0; i < options.nodes.length; i++) {\n        var data = options.nodes[i];\n        createTreeColGroup(body.childNodes[0], data, options);\n        createTotalColGroup(body.childNodes[1], data, options);\n        createFlowColGroup(body.childNodes[2], data, options);\n        createBalanceColGroup(body.childNodes[3], data, options);\n      }\n\n      if (options.nodeCodeSelected) $(table).find(\"[dco='\" + options.nodeCodeSelected + \"']\").addClass(\"table-row-selected\");\n    };\n\n    return {\n      create: create,\n      createTreeColGroup: createTreeColGroup,\n      createTotalColGroup: createTotalColGroup,\n      createFlowColGroup: createFlowColGroup,\n      createBalanceColGroup: createBalanceColGroup\n    };\n  }();\n\n  var footerUtil = function () {\n    var createCell = function createCell(data, parent) {\n      var cell = document.createElement(\"div\");\n      cell.innerHTML = data;\n      if (data != \"0\") _hh.setAttributes(cell, {\n        \"title\": data\n      });\n      $(cell).css({\n        \"width\": \"50%\",\n        \"font-size\": \"12px\",\n        \"cursor\": \"pointer\",\n        \"text-align\": \"right\",\n        \"padding\": \"13px 1px 13px 1px\",\n        \"font-weight\": \"bold\",\n        \"display\": \"inline-block\"\n      });\n      parent.appendChild(cell);\n    };\n\n    var create = function create(options) {\n      var table = document.getElementById(\"br_Table\");\n      var footer = document.createElement(\"div\");\n\n      _hh.setClassName(footer, \"font-bold footer-table\");\n\n      table.appendChild(footer);\n      var data = options.footerData;\n      var groupDiv = document.createElement(\"div\");\n\n      _hh.setAttributes(groupDiv, {\n        \"style\": \"width:35.2%;display:inline-block;text-align: center;\"\n      });\n\n      createCell(\"جمع کل\", groupDiv);\n      footer.appendChild(groupDiv);\n      groupDiv = document.createElement(\"div\");\n\n      _hh.setAttributes(groupDiv, {\n        \"style\": \"width:21.6%;display:inline-block;\"\n      });\n\n      createCell(data.totalDebtor, groupDiv);\n      createCell(data.totalCreditor, groupDiv);\n      footer.appendChild(groupDiv);\n      groupDiv = document.createElement(\"div\");\n\n      _hh.setAttributes(groupDiv, {\n        \"style\": \"width:21.6%;display:inline-block;\"\n      });\n\n      createCell(data.totalDebtorFlow, groupDiv);\n      createCell(data.totalCreditorFlow, groupDiv);\n      footer.appendChild(groupDiv);\n      groupDiv = document.createElement(\"div\");\n\n      _hh.setAttributes(groupDiv, {\n        \"style\": \"width:21.6%;display:inline-block;\"\n      });\n\n      createCell(data.totalDebtorBalance, groupDiv);\n      createCell(data.totalCreditorBalance, groupDiv);\n      footer.appendChild(groupDiv);\n    };\n\n    return {\n      create: create\n    };\n  }();\n\n  var ttvUtil = function () {\n    var toggleOpenButtons = function toggleOpenButtons(sign) {\n      var parent = sign.parentNode;\n      var ulParent = parent.parentNode;\n      var id = parent.getAttribute(\"did\");\n      var parts = document.querySelectorAll('[did=\"' + id + '\"]');\n      var fld = parent.getElementsByClassName(\"dmn-fld\")[0];\n      var ul = parent.childNodes[4];\n      var dep = Number(ul.getAttribute(\"dep\"));\n\n      if ($(ul).hasClass('dmn-c')) {\n        for (var i = 0; i < parts.length; i++) {\n          if (parts[i].childNodes.length === 5) parts[i].childNodes[4].className = \"node-ch\";else parts[i].childNodes[2].className = \"\";\n        }\n\n        _hh.setClassName(sign, \"dmn-p fa fa-minus text-danger node-va\");\n\n        if (fld) {\n          _hh.setAttributes(fld, {\n            \"class\": \"dmn-fld fa fa-folder-open\"\n          });\n        }\n\n        $(parent).next().addClass(\"fix-margin\");\n\n        if (dep > 1) {\n          if (ulParent.childNodes[ulParent.childNodes.length - 1].getAttribute(\"did\") !== id) $(ul).addClass(\"fix-border\");\n        }\n      } else {\n        _hh.setClassName(sign, \"dmn-p fa fa-plus node-va\");\n\n        if (fld) {\n          _hh.setAttributes(fld, {\n            \"class\": \"dmn-fld fa fa-folder\"\n          });\n        }\n\n        setTimeout(function () {\n          for (var j = 0; j < parts.length; j++) {\n            if (parts[j].childNodes.length === 5) parts[j].childNodes[4].className = \"node-ch dmn-c\";else parts[j].childNodes[2].className = \"dmn-c\";\n          }\n        }, 150);\n        $(parent).next().removeClass(\"fix-margin\");\n\n        if (dep > 1) {\n          $(ul).removeClass(\"fix-border\");\n        }\n      }\n\n      _h.activeTooltip(true);\n    };\n\n    var getOptions = function getOptions() {\n      return $.fn.tableTreeView.options.instances[0].opts;\n    };\n\n    var build = function build(target, options) {\n      if (!target.length) return false;\n      target = target.get(0);\n      options.treeEl = target;\n      target.innerHTML = \"\";\n      var randomId = Number((Math.random() * (10000000 - 100) + 100).toString().replace(\".\", \"\"));\n      $.fn.tableTreeView.options.instances.push({\n        id: randomId,\n        opts: options\n      });\n\n      _hh.setAttributes(target, {\n        \"ttv-rootId\": options.rootId,\n        \"ttv-id\": randomId\n      });\n\n      headerUtil.create(options.cols);\n      bodyUtil.create(options);\n      footerUtil.create(options);\n      setTimeout(function () {\n        _h.activeTooltip(true);\n      }, 300);\n    };\n\n    return {\n      build: build,\n      getOptions: getOptions,\n      toggleOpenButtons: toggleOpenButtons\n    };\n  }();\n\n  var ttvMethods = {\n    init: function init(options) {\n      ttvUtil.build(this, options);\n    },\n    expand: function expand(list) {\n      if (_h.any(list)) {\n        for (var i = 0; i < list.length; i++) {\n          var li = $(\".table-node[did=\" + list[i] + \" ]\");\n          var sign = li.find(\".dmn-p\")[0];\n          ttvUtil.toggleOpenButtons(sign);\n        }\n      }\n    }\n  };\n\n  $.fn.tableTreeView = function (methodOrOptions) {\n    if (ttvMethods[methodOrOptions]) {\n      return ttvMethods[methodOrOptions].apply(this, Array.prototype.slice.call(arguments, 1));\n    } else if (_typeof(methodOrOptions) === 'object' || !methodOrOptions) {\n      return ttvMethods.init.apply(this, arguments);\n    } else {\n      $.error('Method ' + methodOrOptions + ' does not exist on jQuery.tableTreeView');\n    }\n  };\n\n  $.fn.tableTreeView.options = {\n    instances: []\n  };\n})(jQuery);\n\n//# sourceURL=webpack://domino/./src/scripts/components/jqtabletreeview.js?");

/***/ }),

/***/ "./src/scripts/components/jqtreeview.js":
/*!**********************************************!*\
  !*** ./src/scripts/components/jqtreeview.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var _hh = __webpack_require__(/*! ./src/scripts/util/htmlHelper.js */ \"./src/scripts/util/htmlHelper.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\n(function ($) {\n  var tUtil = function () {\n    var collectOpenBranches = function collectOpenBranches(tree) {\n      var options = tUtil.getTreeOptions(tree);\n      var ulList = $(tree).find(\"ul:not(.dmn-c)\");\n      var array = [];\n      if (ulList.length) for (var i = 0; i < ulList.length; i++) {\n        var item = ulList[i];\n        var parent = $(item).parent();\n        if (parent) array.push(parent.attr(\"did\"));\n      }\n      options.expandList = array;\n    };\n\n    var openBranches = function openBranches(tree) {\n      var options = tUtil.getTreeOptions(tree);\n      var list = options.expandList;\n      if (_h.any(list)) for (var i = 0; i < list.length; i++) {\n        var li = $(tree).find(\"[did='\" + list[i] + \"']\");\n\n        if (li.length) {\n          $(li).find(\"ul\").first().removeClass(\"dmn-c\");\n          $(li).find(\".dmn-p\").first().addClass(\"fa-minus text-danger\");\n          $(li).find(\".dmn-p\").first().removeClass(\"fa-plus\");\n          $(li).find(\".dmn-fld\").first().addClass(\"fa-folder\");\n          $(li).find(\".dmn-fld\").first().removeClass(\"fa-folder-open\");\n        }\n      }\n      options.expandList = [];\n    };\n\n    var toggleSelectedTag = function toggleSelectedTag(li, withChild) {\n      var firstSpan = $(li).find(\".dmn-ttl\")[0];\n\n      if (withChild) {\n        if (_hh.hasClass(li, \"dmn-selected\")) {\n          $(li).removeClass(\"dmn-selected\");\n          $(li).attr(\"draggable\", \"false\");\n          $(li).find(\"li\").removeClass(\"dmn-selected\");\n          $(li).find(\".dmn-ttl\").css(\"color\", \"#6a6c6f\");\n          $(li).find(\"li\").attr(\"draggable\", \"false\");\n        } else {\n          $(li).find(\"li\").addClass(\"dmn-selected\");\n          $(li).find(\".dmn-ttl\").css(\"color\", \"red\");\n          $(li).find(\"li\").attr(\"draggable\", \"true\");\n          $(li).addClass(\"dmn-selected\");\n          $(li).attr(\"draggable\", \"true\");\n        }\n      } else {\n        if (_hh.hasClass(li, \"dmn-selected\")) {\n          $(li).removeClass(\"dmn-selected\");\n          $(li).attr(\"draggable\", \"false\");\n          $(li).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(li).find(\"li[draggable='true']\").attr(\"draggable\", \"false\");\n          $(li).find(\".dmn-ttl\").css(\"color\", \"#6a6c6f\");\n        } else {\n          $(li).find(\"li\").removeClass(\"dmn-selected\");\n          $(li).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(li).find(\"li[draggable='true']\").attr(\"draggable\", \"false\");\n          $(li).find(\".dmn-ttl\").css(\"color\", \"#6a6c6f\");\n          $(li).addClass(\"dmn-selected\");\n          $(li).attr(\"draggable\", \"true\");\n          $(firstSpan).css(\"color\", \"red\");\n        }\n      }\n    };\n\n    var getValidUnselectedItems = function getValidUnselectedItems(li) {\n      var list = [];\n      var unselectedItems = $(li).find(\"li:not(.dmn-selected)\");\n      $.each(unselectedItems, function (index, item) {\n        if ($(item).attr(\"dim\") === \"false\" && $(item).attr(\"dis\") === \"false\") {\n          list.push(item);\n        }\n      });\n      return list;\n    };\n\n    var toggleSelectedMappingSrcTag = function toggleSelectedMappingSrcTag(li) {\n      var firstSpan;\n\n      if (_hh.hasClass(li, \"dmn-selected\")) {\n        $(li).removeClass(\"dmn-selected\");\n        $(li).attr(\"draggable\", \"false\");\n        $(li).css(\"color\", \"\");\n        $(li).find(\"li\").removeClass(\"dmn-selected\");\n        $(li).find(\"li\").attr(\"draggable\", \"false\");\n        $(li).find(\".dmn-ttl\").css(\"color\", \"\");\n        var parents = tUtil.getParents(li);\n        if (parents && parents.length) for (var j = 0; j < parents.length; j++) {\n          var parent = parents[j];\n          $(parent).removeClass(\"dmn-selected\");\n          $(parent).attr(\"draggable\", \"false\");\n          var sPa = $(parent).find(\".dmn-ttl\")[0];\n          $(sPa).css(\"color\", \"\");\n        }\n      } else {\n        var item;\n\n        if ($(li).attr(\"dim\") === \"false\" && $(li).attr(\"dis\") === \"false\") {\n          $(li).addClass(\"dmn-selected\");\n          $(li).attr(\"draggable\", \"true\");\n          firstSpan = $(li).find(\".dmn-ttl\")[0];\n          $(firstSpan).css(\"color\", \"red\");\n        }\n\n        var unselectList = getValidUnselectedItems(li);\n        var selectList = $(li).find(\"li.dmn-selected\");\n\n        if (unselectList.length) {\n          for (var i = 0; i < unselectList.length; i++) {\n            item = unselectList[i];\n            firstSpan = $(item).find(\".dmn-ttl\")[0];\n            $(item).addClass(\"dmn-selected\");\n            $(item).attr(\"draggable\", \"true\");\n            $(firstSpan).css(\"color\", \"red\");\n          }\n        } else {\n          if (selectList.length) for (var k = 0; k < selectList.length; k++) {\n            item = selectList[k];\n            $(item).removeClass(\"dmn-selected\");\n            $(item).attr(\"draggable\", \"false\");\n            var sPau = $(item).find(\".dmn-ttl\")[0];\n            $(sPau).css(\"color\", \"\");\n          }\n        }\n      }\n    };\n\n    var toggleNodeSelectedTag = function toggleNodeSelectedTag(li, withChild, options) {\n      var firstSpan = $(li).find(\".dmn-ttl\")[0];\n\n      if (withChild) {\n        if (_hh.hasClass(li, \"dmn-selected\")) {\n          $(li).removeClass(\"dmn-selected\");\n          $(li).find(\"li\").removeClass(\"dmn-selected\");\n          $(li).find(\".dmn-ttl\").css(\"color\", \"#6a6c6f\");\n        } else {\n          $(li).find(\"li\").addClass(\"dmn-selected\");\n          $(li).find(\".dmn-ttl\").css(\"color\", \"red\");\n          $(li).addClass(\"dmn-selected\");\n        }\n      } else {\n        if (_hh.hasClass(li, \"dmn-selected\")) {\n          $(li).removeClass(\"dmn-selected\");\n          $(li).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(li).find(\".dmn-ttl\").css(\"color\", \"#6a6c6f\");\n        } else {\n          $(li).find(\"li\").removeClass(\"dmn-selected\");\n          $(li).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(li).find(\".dmn-ttl\").css(\"color\", \"#6a6c6f\");\n          $(li).addClass(\"dmn-selected\");\n          $(firstSpan).css(\"color\", \"red\");\n        }\n      }\n    };\n\n    var getNode = function getNode(tree, id) {\n      return tree.querySelectorAll('[did=\"' + id + '\"]');\n    };\n\n    var droppableMappingNode = function droppableMappingNode(li, obj, options) {\n      if (options.permitPeriodEdit && obj.nt === 2 && obj.mp) {\n        li.ondragover = function (ev) {\n          ev.preventDefault();\n          var span = $(ev.currentTarget).find(\".dmn-ttl\")[0];\n          $(span).css(\"color\", \"red\");\n        };\n\n        li.ondragleave = function (ev) {\n          ev.preventDefault();\n          var span = $(ev.currentTarget).find(\".dmn-ttl\")[0];\n          $(span).css(\"color\", \"#6a6c6f\");\n          var div = document.getElementById('drag-label');\n          div.style.display = \"block\";\n        };\n\n        li.ondragend = function (ev) {\n          ev.preventDefault();\n          var span = $(ev.currentTarget).find(\".dmn-ttl\")[0];\n          $(span).css(\"color\", \"#6a6c6f\");\n          var div = document.getElementById('drag-label');\n          div.style.display = \"block\";\n        };\n\n        li.ondrop = function (ev) {\n          ev.preventDefault();\n          var id = this.getAttribute(\"did\");\n          var tree = tUtil.getTree(this);\n          tUtil.collectOpenBranches(tree);\n          options.onDropCallback(id, options, function (targetId, list, opts) {\n            if (!targetId) return false;\n            if (!list || list.length === 0) return false;\n            var tree = opts.treeEl;\n            var liTarget = getNode(tree, targetId)[0];\n            var ulTraget = $(liTarget).find(\"ul\")[0];\n            $(ulTraget).empty();\n            var span = $(liTarget).find(\".dmn-ttl\")[0];\n            $(span).css(\"color\", \"#6a6c6f\");\n            var div = document.getElementById('drag-label');\n            div.style.display = \"block\";\n            var ulTarget = liTarget.getElementsByTagName(\"ul\")[0];\n\n            for (var i = 0; i < list.length; i++) {\n              tUtil.buildMappingRow(ulTarget, list[i], opts);\n            }\n\n            tUtil.openBranches(tree);\n          });\n        };\n      }\n    };\n\n    var droppableMappingDestNode = function droppableMappingDestNode(li, obj, options) {\n      if (!options.permitPeriodEdit || obj.mp === false) return;\n\n      li.ondragover = function (ev) {\n        ev.preventDefault();\n        var span = ev.currentTarget.getElementsByClassName(\"dmn-ttl\")[0];\n\n        if (span.className.indexOf(\"dmn-nodrp\") === -1 && span.style.color !== \"red\") {\n          span.style.color = \"red\";\n        }\n      };\n\n      li.ondragleave = function (ev) {\n        ev.preventDefault();\n        var span = ev.currentTarget.getElementsByClassName(\"dmn-ttl\")[0];\n\n        if (span.className.indexOf(\"dmn-nodrp\") === -1 && span.style.color === \"red\") {\n          $(span).css(\"color\", \"#6a6c6f\");\n        }\n      };\n\n      li.ondragend = function (ev) {\n        ev.preventDefault();\n        var div = document.getElementById('drag-label');\n        div.style.display = \"none\";\n      };\n\n      li.ondrop = function (ev) {\n        ev.preventDefault();\n        var id = this.getAttribute(\"did\");\n        options.onDropCallback(Number(id), options, function (targetId, list, opts) {\n          if (!targetId) return false;\n          if (!list || list.length === 0) return false;\n          var tree = opts.treeEl;\n          var liTarget = getNode(tree, targetId)[0];\n          tUtil.setITag(liTarget, true, true);\n          var ulTraget = $(liTarget).find(\"ul\")[0];\n          $(ulTraget).empty();\n          var span = $(liTarget).find(\".dmn-ttl\")[0];\n          $(span).css(\"color\", \"#6a6c6f\");\n          var div = document.getElementById('drag-label');\n          div.style.display = \"block\";\n          var ulTarget = liTarget.getElementsByTagName(\"ul\")[0];\n\n          for (var i = 0; i < list.length; i++) {\n            tUtil.buildMappingDestRow(ulTarget, list[i], opts);\n          }\n        });\n      };\n    };\n\n    var setNodeTitle = function setNodeTitle(li, obj, tType) {\n      var nameSpan = _hh.createElement(\"span\", li);\n\n      var sName = _h.shortName(obj.na);\n\n      switch (obj.nt) {\n        case 0:\n          _hh.setInnerHtml(nameSpan, obj.co + \"-\" + sName[0]);\n\n          _hh.setClassName(nameSpan, \"dmn-ttl dmn-mgl\");\n\n          break;\n\n        case 1:\n          _hh.setInnerHtml(nameSpan, sName[0] + \" (\" + obj.co + \")\");\n\n          _hh.setClassName(nameSpan, \"dmn-ttl dmn-ntmg\");\n\n          break;\n\n        case 2:\n          _hh.setInnerHtml(nameSpan, sName[0] + \" (\" + obj.co + \")\");\n\n          if (tType === \"Mapping\") {\n            if (obj.mp) {\n              _hh.setClassName(nameSpan, \"dmn-ttl dmn-mg dmn-drp\");\n            } else {\n              _hh.setClassName(nameSpan, \"dmn-ttl dmn-mg dmn-nodrp\");\n            }\n          } else {\n            _hh.setClassName(nameSpan, \"dmn-ttl\");\n          }\n\n          break;\n      }\n\n      if (sName[1]) {\n        _hh.setAttributes(nameSpan, {\n          \"title\": obj.na\n        });\n      }\n\n      nameSpan.onclick = function () {\n        var li = this.parentNode;\n        var dmp = li.getAttribute(\"dmp\");\n        if (dmp === \"false\" || dmp === false) return;\n        var id = li.getAttribute(\"did\");\n        var nt = li.getAttribute(\"dnt\");\n        var instId = tUtil.getInstanceId(li);\n        var opts = tUtil.getOptions(instId);\n        var tree = tUtil.getTree(li);\n        tUtil.collectOpenBranches(tree);\n        opts.onClickItem(id, opts, Number(nt), function (targetId, list, options) {\n          if (!targetId) return false;\n          if (!list || list.length === 0) return false;\n          var tr = opts.treeEl;\n          var liTarget = getNode(tr, targetId)[0];\n          var ulTraget = $(liTarget).find(\"ul\")[0];\n          $(ulTraget).empty();\n          var ulTarget = liTarget.getElementsByTagName(\"ul\")[0];\n\n          for (var i = 0; i < list.length; i++) {\n            tUtil.buildMappingRow(ulTarget, list[i], options);\n          }\n\n          var tree = tUtil.getTree(liTarget);\n          tUtil.openBranches(tree);\n        });\n      };\n    };\n\n    var getInstanceId = function getInstanceId(el) {\n      var parent = tUtil.getTree(el);\n      return $(parent).attr(\"tv-id\");\n    };\n\n    var getTree = function getTree(el) {\n      if ($(el).hasClass(\"dmn-tree\")) return el;\n      return $(el).closest(\".dmn-tree\");\n    };\n\n    var getParents = function getParents(li) {\n      var parent = li.parentNode;\n      var array = [];\n\n      while (parent.className !== \"dmn-tree\") {\n        var liParent = $(parent).closest(\"li\").get(0);\n        array.push(liParent);\n        parent = parent.parentNode;\n\n        if (parent.className !== \"dmn-tree\") {\n          if (parent.nodeName !== \"LI\") parent = parent.parentNode;\n        }\n      }\n\n      return array;\n    };\n\n    var resetGuidSigns = function resetGuidSigns(li) {\n      var tree = tUtil.getTree(li);\n      $(tree).find(\".dmn-dot\").css(\"display\", \"none\");\n    };\n\n    var setGuidSigns = function setGuidSigns(tree, selectList, options) {\n      $(tree).find(\".dmn-dot\").css(\"display\", \"none\");\n      if (selectList.length) for (var j = 0; j < selectList.length; j++) {\n        var elm = tree.find(\"[did='\" + selectList[j].value + \"']\");\n        if (elm.length) tUtil.toggleGuideSign(elm.get(0), true);\n      }\n    };\n\n    var changeOtherSideSelectedItem = function changeOtherSideSelectedItem(tree, items) {\n      if (items && items.length) for (var i = 0; i < items.length; i++) {\n        var li = $(tree).find(\"[did='\" + items[i].value + \"']\");\n        if (li.length === 0) continue;\n        tUtil.toggleGuideSign(li.get(0), true);\n        $(li).addClass(\"dmn-selected\"); //li.get(0).scrollIntoView();\n\n        var firstSpan = $(li).find(\".dmn-ttl\")[0];\n        $(firstSpan).css(\"color\", \"red\");\n        var parents = tUtil.getParents(li[0]);\n        if (parents && parents.length) for (var j = 0; j < parents.length; j++) {\n          var parent = parents[j];\n          var ul = $(parent).find(\"ul\")[0];\n          var fld = $(parent).find(\".dmn-fld\")[0];\n          var sign = $(parent).find(\".dmn-p\")[0];\n          if (fld) _hh.setAttributes($(fld).get(0), {\n            \"class\": \"dmn-fld fa fa-folder-open\"\n          });\n\n          _hh.setAttributes(sign, {\n            \"class\": \"dmn-p fa fa-minus text-danger\"\n          });\n\n          $(ul).removeClass(\"dmn-c\");\n        }\n      }\n    };\n\n    var refreshSelectItems = function refreshSelectItems(tree, items) {\n      if (items && items.length) for (var i = 0; i < items.length; i++) {\n        var li = $(tree).find(\"[did='\" + items[i].value + \"']\");\n        tUtil.toggleGuideSign(li.get(0), true);\n        $(li).addClass(\"dmn-selected\");\n        var firstSpan = $(li).find(\".dmn-ttl\")[0];\n        $(firstSpan).css(\"color\", \"red\");\n      }\n    };\n\n    var toggleGuideSign = function toggleGuideSign(li, action) {\n      if (!li) return;\n      var parent = li.parentNode;\n\n      while (!_hh.hasClass(parent, \"dmn-tree\")) {\n        if (parent.nodeName === \"UL\" && !_hh.hasClass(parent, \"dmn-tree\")) {\n          parent = parent.parentNode;\n        }\n\n        if (parent.nodeName === \"LI\") {\n          var tg = $(parent).find(\".dmn-dot\")[0];\n          if (action) $(tg).css(\"display\", \"block\");else $(tg).css(\"display\", \"none\");\n        }\n\n        parent = parent.parentNode;\n\n        if (!_hh.hasClass(parent, \"dmn-tree\")) {\n          if (parent.nodeName !== \"LI\") parent = parent.parentNode;\n        }\n      }\n    };\n\n    var extractOldClass = function extractOldClass(tag) {\n      if ($(tag).hasClass(\"dmn-add\")) return \"dmn-add\";\n      if ($(tag).hasClass(\"dmn-dele\")) return \"dmn-dele\";\n      if ($(tag).hasClass(\"dmn-edt\")) return \"dmn-edt\";\n    };\n\n    var toggleShowChildren = function toggleShowChildren(tag) {\n      var parent = $(tag).parent().find(\"ul\")[0];\n      var fld = $(tag).parent().find(\".dmn-fld\")[0];\n\n      if (parent) {\n        var exClass;\n\n        if ($(parent).hasClass('dmn-c')) {\n          if (fld) {\n            exClass = extractOldClass(fld);\n\n            _hh.setAttributes($(fld).get(0), {\n              \"class\": \"dmn-fld fa fa-folder-open\" + \" \" + exClass\n            });\n          }\n\n          _hh.setAttributes(tag, {\n            \"class\": \"dmn-p fa fa-minus text-danger\"\n          });\n\n          setTimeout(function () {\n            $(parent).removeClass(\"dmn-c\");\n          }, 150);\n        } else {\n          if (fld) {\n            exClass = extractOldClass(fld);\n\n            _hh.setAttributes($(fld).get(0), {\n              \"class\": \"dmn-fld fa fa-folder\" + \" \" + exClass\n            });\n          }\n\n          _hh.setAttributes(tag, {\n            \"class\": \"dmn-p fa fa-plus\"\n          });\n\n          setTimeout(function () {\n            $(parent).addClass(\"dmn-c\");\n          }, 150);\n        }\n      }\n    };\n\n    var openGuideSign = function openGuideSign(li) {\n      var list = $(li).find(\"li.dmn-selected\");\n      if (list.length) for (var i = 0; i < list.length; i++) {\n        var parent = li;\n\n        while (parent.className !== \"dmn-tree\") {\n          var span = parent.getElementsByClassName(\"dmn-ttl\");\n          parent = parent.parentNode;\n\n          if (parent.className !== \"dmn-tree\") {\n            if (parent.nodeName !== \"LI\") parent = parent.parentNode;\n          }\n        }\n      }\n    };\n\n    var getOptions = function getOptions(instanceId) {\n      var item = $.fn.treeView.options.instances.filter(function (el) {\n        return el.id === Number(instanceId);\n      });\n      return item[0].opts;\n    };\n\n    var getTreeOptions = function getTreeOptions(li) {\n      var instanceId = getInstanceId(li);\n      var item = $.fn.treeView.options.instances.filter(function (el) {\n        return el.id === Number(instanceId);\n      });\n      return item[0].opts;\n    };\n\n    var setSelectedItems = function setSelectedItems(tree, options) {\n      for (var i = 0; i < options.selectedItems().length; i++) {\n        var li = $(tree).find(\"[did='\" + options.selectedItems()[i].value + \"']\");\n        if (options.tType !== \"CompanySetting\") tUtil.toggleGuideSign(li.get(0), true);\n        $(li).addClass(\"dmn-selected\");\n        var firstSpan = $(li).find(\".dmn-ttl\")[0];\n        $(firstSpan).css(\"color\", \"red\");\n      }\n    };\n\n    var setSelectedItem = function setSelectedItem(tree, options) {\n      var li = $(tree).find(\"[did='\" + options.selectedItem.value + \"']\");\n      tUtil.toggleGuideSign(li.get(0), true);\n      $(li).addClass(\"dmn-selected\");\n      var firstSpan = $(li).find(\".dmn-ttl\")[0];\n      $(firstSpan).css(\"color\", \"red\");\n    };\n\n    var getSelectedItemsData = function getSelectedItemsData(li, onlyThisNode) {\n      var tree = tUtil.getTree(li);\n\n      if (tree) {\n        var array = [];\n        tree.find(\"li.dmn-selected\").each(function (index, li) {\n          var span = $(li).find(\".dmn-ttl\")[0];\n          array.push({\n            value: Number($(li).attr(\"did\")),\n            code: $(li).attr(\"dco\"),\n            text: $(span).text()\n          });\n        });\n      }\n\n      return array;\n    };\n\n    var getConsolidationBranchData = function getConsolidationBranchData(id, options, callback) {\n      var model = {\n        id: id,\n        controllerName: options.controllerName,\n        depth: 1,\n        showMapped: options.showMapped,\n        mappingSide: options.mappingSide\n      };\n\n      if (options.sheetId) {\n        model.sheetId = options.sheetId;\n      }\n\n      if (options.periodId) {\n        model.period = options.periodId;\n      }\n\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/common/getconsolidationbranch\",\n        data: model,\n        success: function success(data) {\n          if (data !== null && data !== undefined) {\n            callback(data);\n          }\n        },\n        error: function error(data) {\n          callback(null);\n        }\n      });\n    };\n\n    var getNodeParentId = function getNodeParentId(li) {\n      var parentUl = li.parentNode;\n      var parentLi = parentUl.parentNode;\n      return Number(parentLi.getAttribute(\"did\"));\n    };\n\n    var createNodePath = function createNodePath(li, treeName) {\n      var path;\n      if (treeName) path = treeName + \" => \";else path = \" :: \";\n      var array = [];\n      var parent = li;\n\n      while (parent.className !== \"dmn-tree\") {\n        var span = parent.getElementsByClassName(\"dmn-ttl\");\n\n        if (treeName) {\n          var titleTemp = span[0].innerText.substring(0, span[0].innerText.indexOf(\" (\"));\n          if (array.indexOf(span[0].innerText) === -1) array.push(titleTemp);\n        } else {\n          if (array.indexOf(span[0].innerText) === -1) array.push(span[0].innerText);\n        }\n\n        parent = parent.parentNode;\n\n        if (parent.className !== \"dmn-tree\") {\n          if (parent.nodeName !== \"LI\") parent = parent.parentNode;\n        }\n      }\n\n      array.reverse();\n      var parents = array;\n\n      for (var j = 0; j < parents.length; j++) {\n        var target = parents[j];\n        path += target;\n\n        if (parents.length - 1 !== j) {\n          path += \" => \";\n        }\n      }\n\n      return path;\n    };\n\n    var setPlusMinusAll = function setPlusMinusAll(li) {\n      var minusI = _hh.createElement(\"i\", li);\n\n      _hh.setClassName(minusI, \"dmn-dirc fa fa-minus-square-o\");\n\n      var plusI = _hh.createElement(\"i\", li);\n\n      _hh.setClassName(plusI, \"dmn-dirc fa fa-plus-square-o\");\n\n      plusI.onclick = function (ev) {\n        var li = $(this).parent();\n        li.find(\"ul\").removeClass(\"dmn-c\");\n        li.find(\".dmn-p\").addClass(\"fa-minus text-danger\");\n        li.find(\".dmn-p\").removeClass(\"fa-plus\");\n        li.find(\".dmn-fld\").addClass(\"fa-folder-open\");\n        li.find(\".dmn-fld\").removeClass(\"fa-folder\");\n      };\n\n      minusI.onclick = function (ev) {\n        var li = $(this).parent();\n        li.find(\"ul\").addClass(\"dmn-c\");\n        li.find(\".dmn-p\").removeClass(\"fa-minus text-danger\");\n        li.find(\".dmn-p\").addClass(\"fa-plus\");\n        li.find(\".dmn-fld\").removeClass(\"fa-folder-open\");\n        li.find(\".dmn-fld\").addClass(\"fa-folder\");\n      };\n    };\n\n    var setITag = function setITag(li, insertAfter, type) {\n      var iTag = li.getElementsByClassName(\"dmn-p\");\n\n      if (iTag.length) {\n        return;\n      }\n\n      if (insertAfter) {\n        iTag = document.createElement(\"i\");\n        li.prepend(iTag);\n      } else iTag = _hh.createElement(\"i\", li);\n\n      if (!type) _hh.setClassName(iTag, \"dmn-p fa fa-plus\");else _hh.setClassName(iTag, \"dmn-p fa fa-minus text-danger\");\n\n      iTag.onclick = function () {\n        tUtil.toggleShowChildren(this);\n      };\n    };\n\n    var refreshMappingDestSubset = function refreshMappingDestSubset(targetId, list, options, type) {\n      if (!targetId) return false;\n      var tree = options.treeEl;\n      var liTarget = tUtil.getNode(tree, targetId);\n\n      if (liTarget.length > 1) {\n        for (var j = 0; j < liTarget.length; j++) {\n          if (liTarget[j].getAttribute(\"dda\") == \"false\") {\n            liTarget = liTarget[j];\n            break;\n          }\n        }\n      } else {\n        liTarget = liTarget[0];\n      }\n\n      tUtil.setITag(liTarget, true);\n      var ulTraget = $(liTarget).find(\"ul\")[0];\n      $(ulTraget).empty();\n\n      if (list && list.length) {\n        var span = $(liTarget).find(\".dmn-ttl\")[0];\n        $(span).css(\"color\", \"#6a6c6f\");\n        var div = document.getElementById('drag-label');\n        div.style.display = \"block\";\n        var ulTarget = liTarget.getElementsByTagName(\"ul\")[0];\n\n        for (var i = 0; i < list.length; i++) {\n          tUtil.buildMappingDestRow(ulTarget, list[i], options);\n        }\n      } else {\n        var sign = $(liTarget).find(\"dmn-p\")[0];\n        $(sign).remove();\n      }\n    };\n\n    var buildChildren = function buildChildren(target, obj, options) {\n      if (obj.children && obj.children.length) for (var i = 0; i < obj.children.length; i++) {\n        if (tUtil[\"build\" + options.tType + \"Row\"]) tUtil[\"build\" + options.tType + \"Row\"](target, obj.children[i], options);else treeEditor.buildEditorRow(target, obj.children[i], options);\n      }\n    };\n\n    var setUnlinkTag = function setUnlinkTag(li, obj) {\n      var unlinkTag = _hh.createElement(\"i\", li);\n\n      _hh.setClassName(unlinkTag, \"dmn-del fa fa-unlink\");\n\n      if (obj.da && obj.children && obj.children.length || obj.mp) {\n        _hh.setAttributes(unlinkTag, {\n          \"title\": \"حذف گروهی گره های نگاشت\"\n        });\n\n        unlinkTag.onclick = function () {\n          var code = null,\n              nodeId = 0;\n          var li = this.parentNode;\n          var da = li.getAttribute(\"dda\") === \"true\";\n\n          if (da) {\n            code = li.getAttribute(\"did\");\n            var parents = tUtil.getParents(li);\n\n            for (var i = 0; i < parents.length; i++) {\n              var parent = parents[i];\n\n              if (parent.getAttribute(\"dda\") === \"false\") {\n                nodeId = Number(parent.getAttribute(\"did\"));\n                break;\n              }\n            }\n          } else nodeId = Number(li.getAttribute(\"did\"));\n\n          var tree = tUtil.getTree(li);\n          var options = tUtil.getTreeOptions(li);\n          var ul = $(li).find(\"ul\");\n          var depth = Number($(ul).attr(\"dep\"));\n          var count = $(ul).find(\"li[dep='\" + (depth + 1) + \"']\").length;\n          if (!count) return false;\n          tUtil.collectOpenBranches(tree);\n          options.removeItemsFunc(nodeId, count, \"multi\", code, function (targetId, list) {\n            refreshMappingDestSubset(targetId, list, options);\n            tUtil.openBranches(tree);\n            tUtil.removeUselessSigns(tree);\n          });\n        };\n      }\n\n      if (obj.da && (!obj.children || obj.children.length === 0)) {\n        _hh.setAttributes(unlinkTag, {\n          \"title\": \"حذف  گره نگاشت\"\n        });\n\n        unlinkTag.onclick = function () {\n          var code = null,\n              nodeId = 0;\n          var li = this.parentNode;\n          var da = li.getAttribute(\"dda\") === \"true\";\n\n          if (da) {\n            code = li.getAttribute(\"did\");\n            var parents = tUtil.getParents(li);\n\n            for (var i = 0; i < parents.length; i++) {\n              var parent = parents[i];\n\n              if (parent.getAttribute(\"dda\") === \"false\") {\n                nodeId = Number(parent.getAttribute(\"did\"));\n                break;\n              }\n            }\n          } else nodeId = Number(li.getAttribute(\"did\"));\n\n          var tree = tUtil.getTree(li);\n          var options = tUtil.getTreeOptions(li);\n          tUtil.collectOpenBranches(tree);\n          options.removeItemsFunc(nodeId, null, \"single\", code, function (targetId, list) {\n            refreshMappingDestSubset(targetId, list, options);\n            tUtil.openBranches(tree);\n            tUtil.removeUselessSigns(tree);\n          });\n        };\n      }\n    };\n\n    var createConsolidateTag = function createConsolidateTag(li, obj) {\n      if (obj.nt === 1 && obj.nte === 1 && !obj.cc) {\n        var ccTag = _hh.createElement(\"i\", li);\n\n        _hh.setClassName(ccTag, \"dmn-ey fa fa-eye\");\n\n        ccTag.onclick = function (ev) {\n          var li = this.parentElement;\n          var id = li.getAttribute(\"did\");\n          var eyIcon = li.getElementsByClassName(\"dmn-ey\")[0];\n          var ulTarget = li.getElementsByTagName(\"ul\")[0];\n          var instId = tUtil.getInstanceId(li);\n          var opts = tUtil.getOptions(instId);\n          getConsolidationBranchData(id, opts, function (list) {\n            if (list && list.length) {\n              var oldNodes = $(ulTarget).find(\"li.dmn-selected\");\n              $(ulTarget).empty();\n\n              for (var i = 0; i < list.length; i++) {\n                if (tUtil[\"build\" + opts.tType + \"Row\"]) tUtil[\"build\" + opts.tType + \"Row\"](ulTarget, list[i], opts);else treeEditor.buildEditorRow(ulTarget, list[i], opts);\n              }\n\n              if (oldNodes.length) {\n                var parent = tUtil.getTree(ulTarget);\n                setSelectedItems(parent, opts);\n              }\n            }\n\n            _hh.removeElement(eyIcon);\n          });\n        };\n      }\n    };\n\n    var createLiTag = function createLiTag(target, obj, options, targetLi, extraAtt) {\n      var li;\n\n      if (targetLi) {\n        li = document.createElement(\"li\");\n        targetLi.replaceWith(li);\n      } else li = _hh.createElement(\"li\", target);\n\n      var depth = target.getAttribute(\"dep\");\n      if (!depth) depth = 0;\n      var attributes = {\n        \"dep\": Number(depth) + 1,\n        \"did\": obj.id,\n        \"dnt\": obj.nt\n      };\n      if (obj.nte) attributes.dnte = obj.nte;\n      if (obj.cc) attributes.dcc = obj.cc;\n      if (obj.co) attributes.dco = obj.co;\n\n      for (var t in extraAtt) {\n        if (extraAtt.hasOwnProperty(t)) {\n          var param = extraAtt[t];\n          attributes[t] = param;\n        }\n      }\n\n      _hh.setAttributes(li, attributes);\n\n      return [li, depth];\n    };\n\n    var createSwitchPart = function createSwitchPart(li, obj, options) {\n      var att, iTag, folderI, iDot, nt;\n\n      switch (options.tType) {\n        case \"CompanyAccessUser\":\n        case \"CompanySetting\":\n          nt = obj.nt + 1;\n          break;\n\n        default:\n          nt = obj.nt;\n          break;\n      }\n\n      switch (nt) {\n        case 1:\n          switch (options.tType) {\n            case \"NodeSelect\":\n              iDot = _hh.createTag({\n                name: \"i\",\n                className: \"dmn-dot fa fa-caret-left\",\n                parent: li,\n                onclick: function onclick() {\n                  var li = this.parentElement;\n                  var instId = tUtil.getInstanceId(li);\n                  var opts = tUtil.getOptions(instId);\n\n                  for (var i = 0; i < opts.selectedItems().length; i++) {\n                    var target = $(li).find(\"li[did='\" + opts.selectedItems()[i].value + \"']\")[0];\n                    tUtil.openGuideSign(target);\n                  }\n                }\n              });\n              break;\n          }\n\n          iTag = _hh.createTag({\n            name: \"i\",\n            className: \"dmn-p fa fa-plus\",\n            parent: li,\n            onclick: function onclick() {\n              tUtil.toggleShowChildren(this);\n            }\n          });\n          folderI = _hh.createTag({\n            name: \"i\",\n            className: \"dmn-fld fa fa-folder\",\n            parent: li\n          });\n          break;\n\n        case 2:\n          switch (options.tType) {\n            case \"Reference\":\n            case \"Current\":\n            case \"TreeInfo\":\n            case \"XbrlConcept\":\n            case \"NodeSelect\":\n            case \"MappingSrc\":\n              if (_h.any(obj.children)) iTag = _hh.createTag({\n                name: \"i\",\n                className: \"dmn-p fa fa-plus\",\n                parent: li,\n                onclick: function onclick() {\n                  tUtil.toggleShowChildren(this);\n                }\n              });\n              break;\n          }\n\n          att = _hh.createTag({\n            name: \"i\",\n            className: \"dmn-att fa fa-file-text-o\",\n            parent: li\n          });\n          break;\n      }\n\n      ;\n      return [att, iTag, folderI, iDot];\n    };\n\n    var changeCheckboxes = function changeCheckboxes(tree) {\n      var list = $(tree).find(\"[dnt='1']\");\n\n      for (var i = 0; i < list.length; i++) {\n        var parent = list[i];\n        var ul = $(parent).find(\"ul\");\n        var checked = $(ul).find(\"input:checkbox:checked\");\n        var unChecked = $(ul).find(\"input:checkbox:not(:checked)\");\n        var input = $(parent).find(\"input:checkbox\")[0];\n\n        if (checked.length && unChecked.length) {\n          $(input).attr(\"checked\", \"checked\");\n          $(input).attr(\"itype\", \"indeterminate\");\n        }\n\n        if (checked.length && !unChecked.length) {\n          $(input).attr(\"checked\", \"checked\");\n          input.removeAttribute(\"itype\");\n        }\n\n        if (!checked.length && unChecked.length) {\n          input.checked = false;\n          input.removeAttribute(\"checked\");\n          input.removeAttribute(\"itype\");\n        }\n\n        if (!checked.length && !unChecked.length) {\n          input.checked = false;\n          input.removeAttribute(\"checked\");\n          input.removeAttribute(\"itype\");\n        }\n      }\n    };\n\n    var createDragListData = function createDragListData(tags, options) {\n      var list = [];\n\n      for (var j = 0; j < tags.length; j++) {\n        var path = tUtil.createNodePath(tags[j], options.rootName);\n        list.push({\n          id: Number(tags[j].getAttribute(\"did\")),\n          code: tags[j].getAttribute(\"dco\"),\n          name: $(tags[j]).find(\".dmn-ttl\")[0].innerText.trim(),\n          path: path,\n          periodId: options.periodId,\n          treeId: options.treeId\n        });\n      }\n\n      return list;\n    };\n\n    var buildMappingRow = function buildMappingRow(target, obj, options, targetLi) {\n      var unlinkTag, att, iTag, folderI;\n\n      var _tUtil$createLiTag = tUtil.createLiTag(target, obj, options, targetLi, {\n        \"dmp\": obj.mp\n      }),\n          _tUtil$createLiTag2 = _slicedToArray(_tUtil$createLiTag, 2),\n          li = _tUtil$createLiTag2[0],\n          depth = _tUtil$createLiTag2[1];\n\n      switch (obj.nt) {\n        case 0:\n          att = _hh.createTag({\n            name: \"i\",\n            className: \"dmn-att fa fa-file-o\",\n            parent: li\n          });\n\n          if (options.permitPeriodEdit && !options.isEffected) {\n            if (obj.da) {\n              unlinkTag = _hh.createElement(\"i\", li);\n\n              _hh.setClassName(unlinkTag, \"dmn-del fa fa-unlink\");\n\n              _hh.setAttributes(unlinkTag, {\n                \"title\": \"حذف گره نگاشت\"\n              });\n\n              unlinkTag.onclick = function () {\n                var parent = $(this).parent()[0];\n                var liParent = $(parent).parent().parent();\n                var tree = tUtil.getTree(liParent);\n                var id = $(liParent).attr(\"did\");\n                var code = parent.getAttribute(\"dco\");\n                tUtil.collectOpenBranches(tree);\n                options.removeItemsFunc(Number(id), null, \"single\", code, function (res) {\n                  if (res) {\n                    _hh.removeElement(parent);\n\n                    tUtil.resetITagSigns(tree);\n                    tUtil.openBranches(tree);\n                  }\n                });\n              };\n            }\n          }\n\n          break;\n\n        case 1:\n          iTag = _hh.createTag({\n            name: \"i\",\n            className: \"dmn-p fa fa-plus\",\n            parent: li\n          });\n          folderI = _hh.createTag({\n            name: \"i\",\n            className: \"dmn-fld fa fa-folder\",\n            parent: li\n          });\n          ;\n\n          iTag.onclick = function () {\n            tUtil.toggleShowChildren(this);\n          };\n\n          break;\n\n        case 2:\n          iTag = _hh.createTag({\n            name: \"i\",\n            className: \"dmn-p fa fa-plus\",\n            parent: li\n          });\n          att = _hh.createElement(\"i\", li);\n\n          _hh.setClassName(att, \"dmn-att fa fa-file-text-o\");\n\n          if (options.permitPeriodEdit && !options.isEffected && obj.mp) {\n            unlinkTag = _hh.createElement(\"i\", li);\n\n            _hh.setClassName(unlinkTag, \"dmn-del fa fa-unlink\");\n\n            _hh.setAttributes(unlinkTag, {\n              \"title\": \"حذف گروهی گره های نگاشت\"\n            });\n\n            unlinkTag.onclick = function () {\n              var parent = $(this).parent()[0];\n              var ul = $(parent).find(\"ul\");\n              var depth = Number($(ul).attr(\"dep\"));\n              var count = $(ul).find(\"li[dep='\" + (depth + 1) + \"']\").length;\n              if (!count) return false;\n              var tree = tUtil.getTree(parent);\n              var id = parent.getAttribute(\"did\");\n              tUtil.collectOpenBranches(tree);\n              options.removeItemsFunc(Number(id), count, \"multi\", null, function (res) {\n                if (res) {\n                  var parentul = parent.getElementsByTagName(\"ul\")[0];\n                  parentul.innerHTML = \"\";\n                  tUtil.resetITagSigns(tree);\n                  tUtil.openBranches(tree);\n                }\n              });\n            };\n          }\n\n          iTag.onclick = function () {\n            tUtil.toggleShowChildren(this);\n          };\n\n          break;\n      }\n\n      droppableMappingNode(li, obj, options);\n      setNodeTitle(li, obj, options.tType);\n      tUtil.createConsolidateTag(li, obj);\n\n      if (obj.nt === 1 || obj.nt === 2) {\n        var ul = _hh.createTag({\n          name: \"ul\",\n          className: \"dmn-c\",\n          parent: li,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        tUtil.buildChildren(ul, obj, options);\n      }\n    };\n\n    var buildMappingDestRow = function buildMappingDestRow(target, obj, options) {\n      var unlinkTag, att, iTag, folderI;\n\n      var _tUtil$createLiTag3 = tUtil.createLiTag(target, obj, options, null, {\n        \"dmp\": obj.mp,\n        \"dda\": obj.da\n      }),\n          _tUtil$createLiTag4 = _slicedToArray(_tUtil$createLiTag3, 2),\n          li = _tUtil$createLiTag4[0],\n          depth = _tUtil$createLiTag4[1];\n\n      switch (obj.nt) {\n        case 1:\n          tUtil.setITag(li);\n          folderI = _hh.createElement(\"i\", li);\n\n          _hh.setClassName(folderI, \"dmn-fld fa fa-folder\");\n\n          break;\n\n        case 2:\n          if (obj.children && obj.children.length) {\n            tUtil.setITag(li);\n          }\n\n          att = _hh.createElement(\"i\", li);\n\n          _hh.setClassName(att, \"dmn-att fa fa-file-text-o\");\n\n          break;\n      }\n\n      if (options.permitPeriodEdit && (obj.mp || obj.da)) {\n        tUtil.setUnlinkTag(li, obj);\n      }\n\n      var nameSpan = _hh.createElement(\"span\", li);\n\n      var sName = _h.shortName(obj.na);\n\n      if (depth === 0 && obj.nt === 1) tUtil.setPlusMinusAll(li);\n\n      _hh.setInnerHtml(nameSpan, sName[0] + \" (\" + obj.co + \")\");\n\n      if (sName[1]) {\n        _hh.setAttributes(nameSpan, {\n          \"title\": obj.na\n        });\n      }\n\n      switch (obj.nt) {\n        case 1:\n          if (obj.da) {\n            _hh.setClassName(nameSpan, \"dmn-ttl dmn-ntmg dmn-mgl\");\n          } else {\n            _hh.setClassName(nameSpan, \"dmn-ttl\");\n          }\n\n          break;\n\n        case 2:\n          if (obj.mp) {\n            _hh.setClassName(nameSpan, \"dmn-ttl dmn-mg dmn-drp\");\n          } else {\n            _hh.setClassName(nameSpan, \"dmn-ttl dmn-mg dmn-mgl\");\n          }\n\n          break;\n      }\n\n      nameSpan.onclick = function () {\n        var li = this.parentNode;\n        var dmp = li.getAttribute(\"dmp\");\n        if (dmp === \"false\" || dmp === false) return;\n        var id = li.getAttribute(\"did\");\n        var nt = li.getAttribute(\"dnt\");\n        var instId = tUtil.getInstanceId(li);\n        var opts = tUtil.getOptions(instId);\n        var tree = tUtil.getTree(li);\n        tUtil.collectOpenBranches(tree);\n        opts.onClickItem(id, opts, Number(nt), function (targetId, list, options) {\n          if (!targetId) return false;\n          if (!list || list.length === 0) return false;\n          var tr = options.treeEl;\n          var liTarget = tUtil.getNode(tr, targetId)[0];\n          var instId = tUtil.getInstanceId(li);\n          var tree = tUtil.getTree(li);\n          var opts = tUtil.getOptions(instId);\n          tUtil.setITag(liTarget, true);\n          var ulTarget = $(liTarget).find(\"ul\");\n          $(ulTarget).empty();\n\n          for (var i = 0; i < list.length; i++) {\n            tUtil.buildMappingDestRow(ulTarget[0], list[i], options);\n          }\n\n          tUtil.openBranches(tree);\n        });\n      };\n\n      droppableMappingDestNode(li, obj, options);\n      tUtil.createConsolidateTag(li, obj);\n\n      var ul = _hh.createTag({\n        name: \"ul\",\n        className: \"dmn-c\",\n        parent: li,\n        attributes: {\n          \"dep\": Number(depth) + 1\n        }\n      });\n\n      tUtil.buildChildren(ul, obj, options);\n      return li;\n    };\n\n    var buildBalanceReportRow = function buildBalanceReportRow(target, obj, options) {\n      var _tUtil$createLiTag5 = tUtil.createLiTag(target, obj, options, null, {}),\n          _tUtil$createLiTag6 = _slicedToArray(_tUtil$createLiTag5, 2),\n          li = _tUtil$createLiTag6[0],\n          depth = _tUtil$createLiTag6[1];\n\n      var _createSwitchPart = createSwitchPart(li, obj, options),\n          _createSwitchPart2 = _slicedToArray(_createSwitchPart, 3),\n          att = _createSwitchPart2[0],\n          iTag = _createSwitchPart2[1],\n          folderI = _createSwitchPart2[2];\n\n      var nameSpan = _hh.createElement(\"span\", li);\n\n      var sName = _h.shortName(obj.na);\n\n      nameSpan.onclick = function () {\n        var li = this.parentNode;\n        var parentId = tUtil.getNodeParentId(li);\n        var path = tUtil.createNodePath(li);\n\n        var isSelected = _hh.hasClass(li, \"dmn-selected\");\n\n        var depth = Number(li.getAttribute(\"dep\")) - 1;\n        var model = {\n          depth: depth,\n          id: Number(li.getAttribute(\"did\")),\n          nodeType: Number(li.getAttribute(\"dnt\")),\n          code: li.getAttribute(\"dco\"),\n          parentId: parentId,\n          path: path,\n          selected: isSelected\n        };\n        var instId = tUtil.getInstanceId(li);\n        var opts = tUtil.getOptions(instId);\n        opts.onClickItem(model, function (res) {\n          if (!isSelected) {\n            li.classList.add(\"dmn-selected\");\n            li.getElementsByClassName(\"dmn-rp\")[0].style.color = \"red\";\n          } else {\n            li.classList.remove(\"dmn-selected\");\n            li.getElementsByClassName(\"dmn-rp\")[0].style.color = \"#6a6c6f\";\n          }\n        });\n      };\n\n      _hh.setInnerHtml(nameSpan, sName[0] + \" (\" + obj.co + \")\");\n\n      _hh.setClassName(nameSpan, \"dmn-ttl dmn-rp\");\n\n      if (sName[1]) {\n        _hh.setAttributes(nameSpan, {\n          \"title\": obj.na\n        });\n      }\n\n      tUtil.createConsolidateTag(li, obj);\n\n      if (obj.nt === 1 || obj.nt === 2) {\n        var ul = _hh.createTag({\n          name: \"ul\",\n          className: \"dmn-c\",\n          parent: li,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        tUtil.buildChildren(ul, obj, options);\n      }\n    };\n\n    var buildTreeInfoRow = function buildTreeInfoRow(target, obj, options) {\n      var _tUtil$createLiTag7 = tUtil.createLiTag(target, obj, options, null, {}),\n          _tUtil$createLiTag8 = _slicedToArray(_tUtil$createLiTag7, 2),\n          li = _tUtil$createLiTag8[0],\n          depth = _tUtil$createLiTag8[1];\n\n      var _createSwitchPart3 = createSwitchPart(li, obj, options),\n          _createSwitchPart4 = _slicedToArray(_createSwitchPart3, 3),\n          att = _createSwitchPart4[0],\n          iTag = _createSwitchPart4[1],\n          folderI = _createSwitchPart4[2];\n\n      var nameSpan = _hh.createElement(\"span\", li);\n\n      var sName = _h.shortName(obj.na);\n\n      _hh.setClassName(nameSpan, \"dmn-ttl dmn-rp\");\n\n      var title = sName[0];\n\n      var accountType = _h.getEnumText(accountTypes, obj.at);\n\n      title += \" ( \" + obj.co + \" ) \";\n\n      if (!_h.isNullOrEmpty(accountType)) {\n        title += \"-\" + accountType.substring(0, 2);\n      }\n\n      if (sName[1]) {\n        _hh.setAttributes(nameSpan, {\n          \"title\": obj.na\n        });\n      }\n\n      if (depth === 0 && obj.nt === 1) tUtil.setPlusMinusAll(li);\n\n      _hh.setInnerHtml(nameSpan, title);\n\n      nameSpan.onclick = function (ev) {\n        var li = this.parentNode;\n        if (ev.ctrlKey) tUtil.toggleSelectedTag(li, true);else tUtil.toggleSelectedTag(li, false);\n\n        if (!li.ondragstart && li.getAttribute(\"draggable\") === \"true\") {\n          li.addEventListener('dragstart', function (event) {\n            var treeOpts = tUtil.getTreeOptions(this);\n            var tags = $(this).closest(\"#tree_view\").find(\"li.dmn-selected\");\n            var length = tags.length;\n            var list = createDragListData(tags, treeOpts);\n            var div = document.getElementById('drag-label');\n            div.style.display = \"block\";\n            var span = div.getElementsByTagName(\"span\")[0];\n            span.innerText = length;\n\n            var item = _h.getEnumItem(nodeDisplayTypes, treeOpts.nodeDisplayType());\n\n            event.dataTransfer.setData('application/json', JSON.stringify({\n              action: \"nodeDrag\",\n              nodeDisplayType: item.enText,\n              list: list\n            }));\n            event.dataTransfer.setDragImage(div, 60, 0);\n          });\n          li.addEventListener('dragover', function (e) {\n            e.preventDefault();\n          });\n          li.addEventListener('dragleave', function (e) {\n            var div = document.getElementById('drag-label');\n            div.style.display = \"none\";\n            e.preventDefault();\n          });\n          li.addEventListener('dragend', function (e) {\n            var div = document.getElementById('drag-label');\n            div.style.display = \"none\";\n            e.preventDefault();\n          });\n        }\n\n        if (li.ondragstart && li.getAttribute(\"draggable\") === \"false\") {\n          li.ondragstart = null;\n          li.ondragover = null;\n          li.ondragleave = null;\n          li.ondragend = null;\n        }\n      };\n\n      tUtil.createConsolidateTag(li, obj);\n\n      if (obj.nt === 1 || obj.nt === 2) {\n        var ul = _hh.createTag({\n          name: \"ul\",\n          className: \"dmn-c\",\n          parent: li,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        tUtil.buildChildren(ul, obj, options);\n      }\n    };\n\n    var buildXbrlConceptRow = function buildXbrlConceptRow(target, obj, options) {\n      var _tUtil$createLiTag9 = tUtil.createLiTag(target, obj, options, null, {}),\n          _tUtil$createLiTag10 = _slicedToArray(_tUtil$createLiTag9, 2),\n          li = _tUtil$createLiTag10[0],\n          depth = _tUtil$createLiTag10[1];\n\n      createSwitchPart(li, obj, options);\n\n      var nameSpan = _hh.createElement(\"span\", li);\n\n      var sName = _h.shortName(obj.na);\n\n      _hh.setClassName(nameSpan, \"dmn-ttl dmn-rp\");\n\n      var title = sName[0];\n\n      if (sName[1]) {\n        _hh.setAttributes(nameSpan, {\n          \"title\": obj.na\n        });\n      }\n\n      if (depth === 0 && obj.nt === 1) tUtil.setPlusMinusAll(li);\n\n      _hh.setInnerHtml(nameSpan, title);\n\n      nameSpan.onclick = function (ev) {\n        var li = this.parentNode;\n        var tree = tUtil.getTree(li)[0];\n        var options = tUtil.getTreeOptions(li);\n\n        if (_hh.hasClass(li, \"dmn-selected\")) {\n          $(tree).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(li).attr(\"draggable\", \"false\");\n          $(li).find(\"li\").attr(\"draggable\", \"false\");\n          $(tree).find(\".dmn-ttl\").css(\"color\", \"\");\n          $(li).find(\".dmn-ttl\").css(\"color\", \"\");\n        } else {\n          $(tree).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(tree).find(\".dmn-ttl\").css(\"color\", \"\");\n          $(li).addClass(\"dmn-selected\");\n          $(li).find(\"li\").attr(\"draggable\", \"false\");\n          $(li).attr(\"draggable\", \"true\");\n          var tar = $(li).find(\".dmn-ttl\")[0];\n          $(tar).css(\"color\", \"red\");\n        }\n\n        if (!li.ondragstart && li.getAttribute(\"draggable\") === \"true\") {\n          li.addEventListener('dragstart', function (event) {\n            var tag = $(this).closest(\"#xbrl_tree_view\").find(\"li.dmn-selected\")[0];\n            var spanTitle = $(tag).find(\".dmn-ttl\");\n            var data = {\n              id: tag.getAttribute(\"did\"),\n              title: $(spanTitle).attr(\"data-original-title\") || $(spanTitle).text()\n            };\n            var div = document.getElementById('drag-label');\n            div.style.display = \"block\";\n            var span = div.getElementsByTagName(\"span\")[0];\n            span.innerText = 1;\n            event.dataTransfer.setData('application/json', JSON.stringify({\n              action: \"xbrlConcept\",\n              model: data\n            }));\n            event.dataTransfer.setDragImage(div, 60, 0);\n          });\n          li.addEventListener('dragover', function (e) {\n            e.preventDefault();\n          });\n          li.addEventListener('dragleave', function (e) {\n            var div = document.getElementById('drag-label');\n            div.style.display = \"none\";\n            e.preventDefault();\n          });\n          li.addEventListener('dragend', function (e) {\n            var div = document.getElementById('drag-label');\n            div.style.display = \"none\";\n            e.preventDefault();\n          });\n        }\n\n        if (li.ondragstart && li.getAttribute(\"draggable\") === \"false\") {\n          li.ondragstart = null;\n          li.ondragover = null;\n          li.ondragleave = null;\n          li.ondragend = null;\n        }\n      };\n\n      if (obj.nt === 1 || obj.nt === 2) {\n        var ul = _hh.createTag({\n          name: \"ul\",\n          className: \"dmn-c\",\n          parent: li,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        tUtil.buildChildren(ul, obj, options);\n      }\n    };\n\n    var buildNodeSelectRow = function buildNodeSelectRow(target, obj, options) {\n      var _tUtil$createLiTag11 = tUtil.createLiTag(target, obj, options, null, {}),\n          _tUtil$createLiTag12 = _slicedToArray(_tUtil$createLiTag11, 2),\n          li = _tUtil$createLiTag12[0],\n          depth = _tUtil$createLiTag12[1];\n\n      var _createSwitchPart5 = createSwitchPart(li, obj, options),\n          _createSwitchPart6 = _slicedToArray(_createSwitchPart5, 4),\n          att = _createSwitchPart6[0],\n          iTag = _createSwitchPart6[1],\n          folderI = _createSwitchPart6[2],\n          iDot = _createSwitchPart6[3];\n\n      var nameSpan = _hh.createElement(\"span\", li);\n\n      var sName = _h.shortName(obj.na);\n\n      _hh.setClassName(nameSpan, \"dmn-ttl\");\n\n      var title = sName[0];\n\n      var accountType = _h.getEnumText(accountTypes, obj.at);\n\n      title += \" ( \" + obj.co + \" ) \";\n\n      if (!_h.isNullOrEmpty(accountType)) {\n        title += \"-\" + accountType.substring(0, 2);\n      }\n\n      if (depth === 0 && obj.nt === 1) tUtil.setPlusMinusAll(li);\n\n      _hh.setInnerHtml(nameSpan, title);\n\n      if (options.substituteNode === true && obj.nt === 2 || obj.nt === 1 && options.branchSelectable || obj.nt === 2 && options.branchSelectable || obj.nt === 2 && !options.branchSelectable && obj.children.length === 0) {\n        _hh.setClassName(nameSpan, \"dmn-ttl dmn-ntmg\");\n\n        nameSpan.onclick = function (ev) {\n          var li = this.parentNode;\n          var ids;\n          var instId = tUtil.getInstanceId(li);\n          var opts = tUtil.getOptions(instId);\n          var tree = tUtil.getTree(li);\n\n          _hh.hasClass(li, \"dmn-selected\");\n\n          if (opts.multi) {\n            if (ev.ctrlKey) tUtil.toggleNodeSelectedTag(li, true);else tUtil.toggleNodeSelectedTag(li, false);\n            ids = tUtil.getSelectedItemsData(li, true);\n            opts.onClickItems(ids);\n          } else {\n            if (_hh.hasClass(li, \"dmn-selected\")) {\n              $(tree).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n              $(tree).find(\".dmn-ttl\").css(\"color\", \"\");\n              $(li).find(\".dmn-ttl\").css(\"color\", \"\");\n              opts.onClickItem(undefined);\n            } else {\n              $(tree).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n              $(tree).find(\".dmn-ttl\").css(\"color\", \"\");\n              $(li).addClass(\"dmn-selected\");\n              var tar = $(li).find(\".dmn-ttl\")[0];\n              $(tar).css(\"color\", \"red\");\n              ids = tUtil.getSelectedItemsData(li, true);\n              opts.onClickItem(ids[0]);\n            }\n          }\n\n          ids = tUtil.getSelectedItemsData(li, true);\n          tUtil.setGuidSigns(tree, ids, opts);\n        };\n      }\n\n      tUtil.createConsolidateTag(li, obj);\n\n      if (obj.nt === 1 || obj.nt === 2) {\n        var ul = _hh.createTag({\n          name: \"ul\",\n          className: \"dmn-c\",\n          parent: li,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        tUtil.buildChildren(ul, obj, options);\n      }\n\n      if (sName[1]) {\n        _hh.setAttributes(nameSpan, {\n          \"title\": obj.na\n        });\n      }\n    };\n\n    var buildReferenceRow = function buildReferenceRow(target, obj, options) {\n      var acceptI, rejectI;\n\n      var _tUtil$createLiTag13 = tUtil.createLiTag(target, obj, options, null, {\n        \"dci\": obj.ci,\n        \"dcht\": obj.cht\n      }),\n          _tUtil$createLiTag14 = _slicedToArray(_tUtil$createLiTag13, 2),\n          li = _tUtil$createLiTag14[0],\n          depth = _tUtil$createLiTag14[1];\n\n      var _createSwitchPart7 = createSwitchPart(li, obj, options),\n          _createSwitchPart8 = _slicedToArray(_createSwitchPart7, 3),\n          att = _createSwitchPart8[0],\n          iTag = _createSwitchPart8[1],\n          folderI = _createSwitchPart8[2];\n\n      var nameSpan = _hh.createElement(\"span\", li);\n\n      _hh.setClassName(nameSpan, \"dmn-ttl dmn-ref\");\n\n      var sName = _h.shortName(obj.na);\n\n      var title = sName[0] + \" ( \" + obj.co + \" )\";\n      if (obj.at && obj.at > 0) title += \" - \" + _h.getEnumText(accountTypes, obj.at).substring(0, 2);\n\n      _hh.setInnerHtml(nameSpan, title);\n\n      if (sName[1]) {\n        _hh.setAttributes(nameSpan, {\n          \"title\": obj.na\n        });\n      }\n\n      if (obj.nt === 1 && obj.nte === 1 && !obj.cc) nameSpan.style.textDecoration = \"underline\";\n\n      nameSpan.onclick = function (ev) {\n        var li = this.parentNode;\n        var tree = tUtil.getTree(li)[0];\n        var options = tUtil.getTreeOptions(li);\n\n        if (_hh.hasClass(li, \"dmn-selected\")) {\n          $(tree).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(tree).find(\".dmn-ttl\").css(\"color\", \"\");\n          $(li).find(\".dmn-ttl\").css(\"color\", \"\");\n        } else {\n          $(tree).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(tree).find(\".dmn-ttl\").css(\"color\", \"\");\n          $(li).addClass(\"dmn-selected\");\n          var tar = $(li).find(\".dmn-ttl\")[0];\n          $(tar).css(\"color\", \"red\");\n        }\n\n        var selectedItems = tree.getElementsByClassName(\"dmn-selected\");\n        var array = [];\n        if (selectedItems && selectedItems.length) for (var j = 0; j < selectedItems.length; j++) {\n          array.push({\n            value: selectedItems[j].getAttribute(\"did\")\n          });\n        }\n        options.onDeffTreeSelect(\"ref\", array);\n      };\n\n      if (obj.cht !== 0) {\n        acceptI = _hh.createElement(\"i\", li);\n        rejectI = _hh.createElement(\"i\", li);\n\n        _hh.setClassName(acceptI, \"dmn-acc fa fa-check\");\n\n        _hh.setClassName(rejectI, \"dmn-rem fa fa-remove\");\n\n        _hh.setAttributes(acceptI, {\n          \"title\": \"اعمال تغییر\"\n        });\n\n        _hh.setAttributes(rejectI, {\n          \"title\": \"رد تغییر\"\n        });\n\n        acceptI.onclick = function () {\n          var list = [];\n\n          var li = _hh.getClosest(this, \"li\");\n\n          list.push(Number(li.getAttribute(\"did\")));\n          var liList = li.getElementsByTagName(\"li\");\n          if (liList && liList.length) for (var j = 0; j < liList.length; j++) {\n            list.push(Number(liList[j].getAttribute(\"did\")));\n          }\n          options.onApplyItem(list, function (res) {\n            if (res) {\n              _hh.removeElement(this);\n            }\n          });\n        };\n\n        rejectI.onclick = function () {\n          var list = [];\n\n          var li = _hh.getClosest(this, \"li\");\n\n          list.push(Number(li.getAttribute(\"did\")));\n          var liList = li.getElementsByTagName(\"li\");\n          if (liList && liList.length) for (var j = 0; j < liList.length; j++) {\n            list.push(Number(liList[j].getAttribute(\"did\")));\n          }\n          options.onRejectItem(list, function (res) {\n            if (res) {\n              _hh.removeElement(this);\n            }\n          });\n        };\n\n        switch (obj.cht) {\n          case 1:\n            if (folderI) {\n              folderI.classList.add(\"dmn-add\");\n\n              _hh.setAttributes(folderI, {\n                \"title\": \"ایجاد\"\n              });\n            }\n\n            if (att) {\n              att.classList.add(\"dmn-add\");\n\n              _hh.setAttributes(att, {\n                \"title\": \"ایجاد\"\n              });\n            }\n\n            break;\n\n          case 2:\n            if (folderI) {\n              folderI.classList.add(\"dmn-edt\");\n\n              _hh.setAttributes(folderI, {\n                \"title\": \"ویرایش\"\n              });\n            }\n\n            if (att) {\n              att.classList.add(\"dmn-edt\");\n\n              _hh.setAttributes(att, {\n                \"title\": \"ویرایش\"\n              });\n            }\n\n            break;\n\n          case 3:\n            if (folderI) {\n              folderI.classList.add(\"dmn-dele\");\n\n              _hh.setAttributes(folderI, {\n                \"title\": \"حذف\"\n              });\n            }\n\n            if (att) {\n              att.classList.add(\"dmn-dele\");\n\n              _hh.setAttributes(att, {\n                \"title\": \"حذف\"\n              });\n            }\n\n            break;\n        }\n      }\n\n      if (depth === 0 && obj.nt === 1) tUtil.setPlusMinusAll(li);\n\n      if (obj.nt === 1 || obj.nt === 2) {\n        var ul = _hh.createTag({\n          name: \"ul\",\n          className: \"dmn-c\",\n          parent: li,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        tUtil.buildChildren(ul, obj, options);\n      }\n    };\n\n    var buildCurrentRow = function buildCurrentRow(target, obj, options) {\n      var _tUtil$createLiTag15 = tUtil.createLiTag(target, obj, options, null, {\n        \"dci\": obj.ci,\n        \"dcht\": obj.cht\n      }),\n          _tUtil$createLiTag16 = _slicedToArray(_tUtil$createLiTag15, 2),\n          li = _tUtil$createLiTag16[0],\n          depth = _tUtil$createLiTag16[1];\n\n      var _createSwitchPart9 = createSwitchPart(li, obj, options),\n          _createSwitchPart10 = _slicedToArray(_createSwitchPart9, 3),\n          att = _createSwitchPart10[0],\n          iTag = _createSwitchPart10[1],\n          folderI = _createSwitchPart10[2];\n\n      var nameSpan = _hh.createElement(\"span\", li);\n\n      _hh.setClassName(nameSpan, \"dmn-ttl dmn-ref\");\n\n      var sName = _h.shortName(obj.na);\n\n      var title = sName[0] + \" ( \" + obj.co + \" )\";\n      if (obj.at && obj.at > 0) title += \" - \" + _h.getEnumText(accountTypes, obj.at).substring(0, 2);\n\n      _hh.setInnerHtml(nameSpan, title);\n\n      if (obj.nt === 1 && obj.nte === 1 && !obj.cc) nameSpan.style.textDecoration = \"underline\";\n\n      if (sName[1]) {\n        _hh.setAttributes(nameSpan, {\n          \"title\": obj.na\n        });\n      }\n\n      nameSpan.onclick = function (ev) {\n        var li = this.parentNode;\n        var tree = tUtil.getTree(li)[0];\n        var options = tUtil.getTreeOptions(li);\n\n        if (_hh.hasClass(li, \"dmn-selected\")) {\n          $(tree).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(tree).find(\".dmn-ttl\").css(\"color\", \"\");\n          $(li).find(\".dmn-ttl\").css(\"color\", \"\");\n        } else {\n          $(tree).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(tree).find(\".dmn-ttl\").css(\"color\", \"\");\n          $(li).addClass(\"dmn-selected\");\n          var tar = $(li).find(\".dmn-ttl\")[0];\n          $(tar).css(\"color\", \"red\");\n        }\n\n        var selectedItems = tree.getElementsByClassName(\"dmn-selected\");\n        var array = [];\n        if (selectedItems && selectedItems.length) for (var j = 0; j < selectedItems.length; j++) {\n          array.push({\n            value: selectedItems[j].getAttribute(\"did\")\n          });\n        }\n        options.onDeffTreeSelect(\"cr\", array);\n      };\n\n      if (depth === 0 && obj.nt === 1) tUtil.setPlusMinusAll(li);\n\n      if (obj.nt === 1 || obj.nt === 2) {\n        var ul = _hh.createTag({\n          name: \"ul\",\n          className: \"dmn-c\",\n          parent: li,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        tUtil.buildChildren(ul, obj, options);\n      }\n    };\n\n    var buildMappingSrcRow = function buildMappingSrcRow(target, obj, options, targetLi) {\n      var _tUtil$createLiTag17 = tUtil.createLiTag(target, obj, options, targetLi, {\n        \"dim\": obj.im,\n        \"dis\": obj.dis\n      }),\n          _tUtil$createLiTag18 = _slicedToArray(_tUtil$createLiTag17, 2),\n          li = _tUtil$createLiTag18[0],\n          depth = _tUtil$createLiTag18[1];\n\n      var _createSwitchPart11 = createSwitchPart(li, obj, options),\n          _createSwitchPart12 = _slicedToArray(_createSwitchPart11, 3),\n          att = _createSwitchPart12[0],\n          iTag = _createSwitchPart12[1],\n          folderI = _createSwitchPart12[2];\n\n      var nameSpan = _hh.createElement(\"span\", li);\n\n      var sName = _h.shortName(obj.na);\n\n      if (obj.im) _hh.setClassName(nameSpan, \"dmn-ttl dmn-im\");else _hh.setClassName(nameSpan, \"dmn-ttl dmn-rp\");\n      var title = sName[0];\n\n      var accountType = _h.getEnumText(accountTypes, obj.at);\n\n      title += \" ( \" + obj.co + \" ) \";\n\n      if (!_h.isNullOrEmpty(accountType)) {\n        title += \"-\" + accountType.substring(0, 2);\n      }\n\n      if (sName[1]) {\n        _hh.setAttributes(nameSpan, {\n          \"title\": obj.na\n        });\n      }\n\n      if (depth === 0 && obj.nt === 1) tUtil.setPlusMinusAll(li);\n\n      _hh.setInnerHtml(nameSpan, title);\n\n      nameSpan.onclick = function (ev) {\n        var li = this.parentNode;\n        var dis = li.getAttribute(\"dis\");\n        var dim = li.getAttribute(\"dim\");\n        var tree = tUtil.getTree(li);\n        tUtil.toggleSelectedMappingSrcTag(li, true);\n\n        if (li.ondragstart && dis !== \"false\" && dim !== \"false\") {\n          li.ondragstart = null;\n        }\n\n        if (!li.ondragstart && dis === \"false\" && dim === \"false\") {\n          li.addEventListener('dragstart', function (event) {\n            var tags = $(this).closest(\".dmn-tree\").find(\"li.dmn-selected\");\n            var length = tags.length;\n            var div = document.getElementById('drag-label');\n            div.style.display = \"block\";\n            var span = div.getElementsByTagName(\"span\")[0];\n            span.innerText = length;\n            event.dataTransfer.setDragImage(div, 60, 0);\n          });\n        }\n      };\n\n      tUtil.createConsolidateTag(li, obj);\n\n      if (obj.nt === 1 || obj.nt === 2) {\n        var ul = _hh.createTag({\n          name: \"ul\",\n          className: \"dmn-c\",\n          parent: li,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        tUtil.buildChildren(ul, obj, options);\n      }\n    };\n\n    var buildCompanySettingRow = function buildCompanySettingRow(target, obj, options) {\n      var _tUtil$createLiTag19 = tUtil.createLiTag(target, obj, options, null, {\n        \"dna\": obj.na\n      }),\n          _tUtil$createLiTag20 = _slicedToArray(_tUtil$createLiTag19, 2),\n          li = _tUtil$createLiTag20[0],\n          depth = _tUtil$createLiTag20[1];\n\n      var chkDiv = _hh.createElement(\"div\", li);\n\n      _hh.setClassName(chkDiv, \"awcheckbox awcheckbox-success awcheckbox-inline treeitem-chkbox\");\n\n      var chkInput = _hh.createElement(\"input\", chkDiv);\n\n      if (!obj.selected) {\n        _hh.setAttributes(chkInput, {\n          \"type\": \"checkbox\",\n          \"id\": \"Com-Sel_\" + obj.id,\n          \"did\": obj.id\n        });\n      } else {\n        _hh.setAttributes(chkInput, {\n          \"type\": \"checkbox\",\n          \"id\": \"Com-Sel_\" + obj.id,\n          \"did\": obj.id,\n          \"checked\": obj.selected\n        });\n      }\n\n      var chkLabel = _hh.createTag({\n        name: \"label\",\n        parent: chkDiv,\n        attributes: {\n          \"for\": \"Com-Sel_\" + obj.id\n        },\n        onclick: function onclick() {\n          var parent = $(this).parent().parent();\n          var input = parent.find(\"input\")[0];\n          var inputs = parent.find(\"input\");\n          var parents = tUtil.getParents(parent[0]);\n\n          if (!$(input).is(':checked')) {\n            if (inputs && inputs.length) for (var j = 0; j < inputs.length; j++) {\n              if (inputs[j].id !== input.id) inputs[j].checked = true;\n            }\n            if (parents && parents.length) for (var l = 0; l < parents.length; l++) {\n              var parentInput = $(parents[l]).find(\"input\")[0];\n              parentInput.checked = true;\n            }\n          } else {\n            if (inputs && inputs.length) for (var k = 0; k < inputs.length; k++) {\n              if (inputs[k].id !== input.id) inputs[k].checked = false;\n            }\n          }\n\n          return true;\n        }\n      });\n\n      var _createSwitchPart13 = createSwitchPart(li, obj, options),\n          _createSwitchPart14 = _slicedToArray(_createSwitchPart13, 3),\n          att = _createSwitchPart14[0],\n          iTag = _createSwitchPart14[1],\n          folderI = _createSwitchPart14[2];\n\n      var sName = _h.shortName(obj.na);\n\n      var nameSpan = _hh.createTag({\n        name: \"span\",\n        className: \"dmn-ttl dmn-ref\",\n        text: sName[0],\n        parent: li,\n        attributes: {\n          \"dep\": Number(depth) + 1\n        }\n      });\n\n      if (sName[1]) {\n        _hh.setAttributes(nameSpan, {\n          \"title\": sName[1]\n        });\n      }\n\n      nameSpan.onclick = function (ev) {\n        var li = this.parentNode;\n        tUtil.toggleSelectedTag(li, true);\n      };\n\n      if (depth === 0 && obj.nt === 0) tUtil.setPlusMinusAll(li);\n\n      if (obj.nt === 0) {\n        var ul = _hh.createTag({\n          name: \"ul\",\n          className: \"dmn-c\",\n          parent: li,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        tUtil.buildChildren(ul, obj, options);\n      }\n    };\n\n    var buildPermissionRow = function buildPermissionRow(target, obj, options) {\n      var _tUtil$createLiTag21 = tUtil.createLiTag(target, obj, options, null, {\n        \"dna\": obj.na\n      }),\n          _tUtil$createLiTag22 = _slicedToArray(_tUtil$createLiTag21, 2),\n          li = _tUtil$createLiTag22[0],\n          depth = _tUtil$createLiTag22[1];\n\n      var chkDiv = _hh.createElement(\"div\", li);\n\n      _hh.setClassName(chkDiv, \"awcheckbox awcheckbox-success awcheckbox-inline treeitem-chkbox\");\n\n      var chkInput = _hh.createElement(\"input\", chkDiv);\n\n      if (!obj.selected) {\n        _hh.setAttributes(chkInput, {\n          \"type\": \"checkbox\",\n          \"id\": \"Com-Sel_\" + obj.id,\n          \"did\": obj.id\n        });\n      } else {\n        _hh.setAttributes(chkInput, {\n          \"type\": \"checkbox\",\n          \"id\": \"Com-Sel_\" + obj.id,\n          \"did\": obj.id,\n          \"checked\": obj.selected\n        });\n      }\n\n      _hh.createTag({\n        name: \"label\",\n        parent: chkDiv,\n        attributes: {\n          \"for\": \"Com-Sel_\" + obj.id\n        },\n        onclick: function onclick() {\n          var parent = $(this).parent().parent();\n          var tree = tUtil.getTree(parent);\n          var input = parent.find(\"input\")[0];\n          var inputs = parent.find(\"input\");\n          var parents = tUtil.getParents(parent[0]);\n          var options = getTreeOptions(parent);\n\n          if (!$(input).is(':checked')) {\n            if (inputs && inputs.length) for (var j = 0; j < inputs.length; j++) {\n              if (inputs[j].id !== input.id) inputs[j].checked = true;\n            }\n            if (parents && parents.length) for (var l = 0; l < parents.length; l++) {\n              var parentInput = $(parents[l]).find(\"input\")[0];\n              parentInput.checked = true;\n            }\n          } else {\n            if (inputs && inputs.length) for (var k = 0; k < inputs.length; k++) {\n              if (inputs[k].id !== input.id) inputs[k].checked = false;\n            }\n          }\n\n          setTimeout(function () {\n            options.context.onClickItem();\n            tUtil.changeCheckboxes(tree);\n          }, 200);\n          return true;\n        }\n      });\n\n      var _createSwitchPart15 = createSwitchPart(li, obj, options),\n          _createSwitchPart16 = _slicedToArray(_createSwitchPart15, 3),\n          att = _createSwitchPart16[0],\n          iTag = _createSwitchPart16[1],\n          folderI = _createSwitchPart16[2];\n\n      var sName = _h.shortName(obj.na);\n\n      var nameSpan = _hh.createTag({\n        name: \"span\",\n        className: \"dmn-ttl dmn-ref\",\n        text: sName[0],\n        parent: li,\n        attributes: {\n          \"dep\": Number(depth) + 1\n        }\n      });\n\n      if (sName[1]) {\n        _hh.setAttributes(nameSpan, {\n          \"title\": obj.na\n        });\n      }\n\n      if (obj.nt === 1) {\n        var ul = _hh.createTag({\n          name: \"ul\",\n          className: \"dmn-c\",\n          parent: li,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        tUtil.buildChildren(ul, obj, options);\n      }\n    };\n\n    var buildCompanyAccessUserRow = function buildCompanyAccessUserRow(target, obj, options) {\n      var _tUtil$createLiTag23 = tUtil.createLiTag(target, obj, options, null, {\n        \"dal\": JSON.stringify(obj.userAccesses)\n      }),\n          _tUtil$createLiTag24 = _slicedToArray(_tUtil$createLiTag23, 2),\n          li = _tUtil$createLiTag24[0],\n          depth = _tUtil$createLiTag24[1];\n\n      var _createSwitchPart17 = createSwitchPart(li, obj, options),\n          _createSwitchPart18 = _slicedToArray(_createSwitchPart17, 3),\n          att = _createSwitchPart18[0],\n          iTag = _createSwitchPart18[1],\n          folderI = _createSwitchPart18[2];\n\n      var nameSpan = _hh.createElement(\"span\", li);\n\n      _hh.setClassName(nameSpan, \"dmn-ttl dmn-ref\");\n\n      _hh.setInnerHtml(nameSpan, obj.na);\n\n      if (obj.nt === 0) {\n        var ul = _hh.createTag({\n          name: \"ul\",\n          className: \"dmn-c\",\n          parent: li,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        tUtil.buildChildren(ul, obj, options);\n      }\n\n      nameSpan.onclick = function (ev) {\n        var li = this.parentNode;\n        var tree = tUtil.getTree(li)[0];\n        var options = tUtil.getTreeOptions(li);\n        var res = false;\n\n        if (_hh.hasClass(li, \"dmn-selected\")) {\n          $(tree).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(tree).find(\".dmn-ttl\").css(\"color\", \"\");\n          $(li).find(\".dmn-ttl\").css(\"color\", \"\");\n        } else {\n          $(tree).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(tree).find(\".dmn-ttl\").css(\"color\", \"\");\n          $(li).addClass(\"dmn-selected\");\n          var tar = $(li).find(\".dmn-ttl\")[0];\n          $(tar).css(\"color\", \"red\");\n          res = true;\n        }\n\n        if (res) {\n          var accessBox = document.getElementsByClassName(\"user-access-list\")[0];\n          accessBox.innerHTML = \"\";\n          var list = JSON.parse(li.getAttribute(\"dal\"));\n\n          for (var i = 0; i < list.length; i++) {\n            var liTag = _hh.createTag({\n              name: \"li\",\n              parent: accessBox\n            });\n\n            var chkDiv = _hh.createTag({\n              name: \"div\",\n              parent: liTag,\n              className: \"awcheckbox awcheckbox-success awcheckbox-inline\",\n              styles: \"margin-bottom: 10px;font-size: 10px;\"\n            });\n\n            var attributes = {};\n            if (list[i].selected) attributes = {\n              \"type\": \"checkbox\",\n              \"checked\": list[i].selected,\n              \"id\": 'AccessU-' + list[i].value,\n              'data-id': list[i].value,\n              'data-txt': list[i].text\n            };else attributes = {\n              \"type\": \"checkbox\",\n              \"id\": 'AccessU-' + list[i].value,\n              'data-id': list[i].value,\n              'data-txt': list[i].text\n            };\n\n            _hh.createTag({\n              name: \"input\",\n              parent: chkDiv,\n              attributes: attributes,\n              onclick: function onclick(ev) {\n                var accessBox = document.getElementsByClassName(\"user-access-list\")[0];\n                var tree = document.getElementById(\"tree_view_au\");\n                var liSelected = $(tree).find(\"li.dmn-selected\");\n                var checkBoxes = $(accessBox).find(\"input\");\n                var array = [];\n\n                for (var j = 0; j < checkBoxes.length; j++) {\n                  array.push({\n                    \"value\": Number(checkBoxes[j].getAttribute(\"data-id\")),\n                    \"selected\": checkBoxes[j].checked,\n                    \"text\": checkBoxes[j].getAttribute(\"data-txt\")\n                  });\n                }\n\n                _hh.setAttributes(liSelected[0], {\n                  \"dal\": JSON.stringify(array)\n                });\n              }\n            });\n\n            _hh.createTag({\n              name: \"label\",\n              parent: chkDiv,\n              attributes: {\n                'for': 'AccessU-' + list[i].value\n              },\n              text: list[i].text\n            });\n          }\n        }\n      };\n    };\n\n    var buildCompanyRow = function buildCompanyRow(target, obj, options) {\n      var li = _hh.createElement(\"li\", target);\n\n      var orgObj = obj;\n      $(li).data(orgObj);\n      obj = ko.toJS(obj);\n      obj.nt = obj.nt + 1;\n      var depth = target.getAttribute(\"dep\");\n      if (!depth) depth = 0;\n\n      _hh.setAttributes(li, {\n        \"dep\": Number(depth) + 1,\n        \"did\": obj.id,\n        \"dct\": obj.nt,\n        \"dst\": obj.stateType\n      });\n\n      var _createSwitchPart19 = createSwitchPart(li, obj, options),\n          _createSwitchPart20 = _slicedToArray(_createSwitchPart19, 3),\n          att = _createSwitchPart20[0],\n          iTag = _createSwitchPart20[1],\n          folderI = _createSwitchPart20[2];\n\n      var nameSpan = _hh.createElement(\"span\", li);\n\n      var nameClass = \"dmn-ttl dmn-ref\";\n\n      if (obj.stateType === 0) {\n        nameClass = \"dmn-ttl dmn-ref node-codis\";\n      }\n\n      if (obj.mainCompany) {\n        nameSpan.style.fontWeight = \"bold\";\n      }\n\n      _hh.setClassName(nameSpan, nameClass);\n\n      _hh.setInnerHtml(nameSpan, obj.na);\n\n      if (obj.de) {\n        var descTag = _hh.createElement(\"i\", li);\n\n        _hh.setClassName(descTag, \"dmn-info fa fa-info-circle\");\n\n        _hh.setAttributes(descTag, {\n          \"title\": obj.de\n        });\n      }\n\n      nameSpan.onclick = function (ev) {\n        var li = this.parentNode;\n        var tree = tUtil.getTree(li)[0];\n        var options = tUtil.getTreeOptions(li);\n\n        if (_hh.hasClass(li, \"dmn-selected\")) {\n          $(tree).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(tree).find(\".dmn-ttl\").css(\"color\", \"\");\n          $(li).find(\".dmn-ttl\").css(\"color\", \"\");\n        } else {\n          $(tree).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(tree).find(\".dmn-ttl\").css(\"color\", \"\");\n          $(li).addClass(\"dmn-selected\");\n          var tar = $(li).find(\".dmn-ttl\")[0];\n          $(tar).css(\"color\", \"red\");\n        }\n\n        options.context.onTreeNodeSelect($(li).data());\n      };\n\n      nameSpan.ondblclick = function (ev) {\n        var li = ev.target.parentNode.parentNode;\n        var tree = tUtil.getTree(li);\n        var options = tUtil.getTreeOptions(li);\n        options.actions.onEdit(li.getAttribute(\"did\"), null, li);\n      };\n\n      li.oncontextmenu = function (ev) {\n        var li = null;\n        if (this.nodeName === \"LI\") li = this;\n        if (this.nodeName === \"SPAN\") li = this.parentNode;\n\n        var pos = _h.getPosition(ev.currentTarget);\n\n        var tree = tUtil.getTree(li);\n        var options = tUtil.getTreeOptions(li);\n\n        if (!_h.kocnx().permitPeriodEdit()) {\n          return false;\n        }\n\n        if (!_hh.hasClass(li, \"dmn-selected\")) {\n          $(tree).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(tree).find(\".dmn-ttl\").css(\"color\", \"\");\n          $(li).addClass(\"dmn-selected\");\n          var tar = $(li).find(\".dmn-ttl\")[0];\n          $(tar).css(\"color\", \"red\");\n          options.context.onTreeNodeSelect($(li).data());\n        }\n\n        var menu = document.getElementsByClassName(\"context-menu\")[0];\n        if (menu) menu.parentNode.removeChild(menu);\n        var nav = document.createElement('nav');\n        document.body.appendChild(nav);\n\n        _hh.setAttributes(nav, {\n          \"target\": tree[0].getAttribute(\"tv-id\")\n        });\n\n        nav.className = \"context-menu\";\n\n        _hh.setClassName(nav, \"context-menu\");\n\n        var ul = _hh.createElement(\"ul\", nav);\n\n        _hh.setClassName(ul, \"mt-contextmenu\");\n\n        for (var _i2 = 0; _i2 < options.context.menuItems().length; _i2++) {\n          var button = options.context.menuItems()[_i2];\n\n          if (!options.context[button.visName]()) continue;\n\n          var lim = _hh.createElement(\"li\", ul);\n\n          var a = _hh.createElement(\"a\", lim);\n\n          lim.setAttribute(\"data-action\", button.visName.replace(\"vis\", \"\"));\n\n          var caption = _hh.createElement(\"span\", a);\n\n          caption.innerText = button.text;\n\n          _hh.setClassName(caption, \"mt-contextmenu-text\");\n\n          var iconSpan = _hh.createElement(\"span\", a);\n\n          _hh.setClassName(iconSpan, \"mt-contextmenu-icon\");\n\n          var image = _hh.createElement(\"img\", iconSpan);\n\n          image.src = \"/App/src/images/ico/\" + _h.getIcon(button.icon);\n\n          lim.onclick = function (event) {\n            var dataAction = this.getAttribute(\"data-action\");\n            var actionName = dataAction + \"Btn\";\n            options.context[actionName]();\n          };\n        }\n\n        ev.cancelBubble = true;\n        nav.style.top = pos.top + 30 + \"px\";\n        nav.style.left = pos.right + \"px\";\n\n        document.onclick = function () {\n          var menu = document.getElementsByClassName(\"context-menu\")[0];\n\n          if (menu) {\n            menu.parentNode.removeChild(menu);\n          }\n        };\n\n        return false;\n      };\n\n      if (obj.nt === 1) {\n        var ul = _hh.createTag({\n          name: \"ul\",\n          className: \"dmn-c\",\n          parent: li,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        var children = ko.isObservable(orgObj.children) ? orgObj.children() : orgObj.children;\n\n        for (var i = 0; i < children.length; i++) {\n          tUtil.buildCompanyRow(ul, children[i], options);\n        }\n\n        if (obj.isRoot) {\n          var firstSign = $(li).find(\".dmn-p\")[0];\n          $(firstSign).trigger(\"click\");\n          $(li).addClass(\"dmn-selected\");\n          var tar = $(li).find(\".dmn-ttl\")[0];\n          $(tar).css(\"color\", \"red\");\n          options.context.onTreeNodeSelect($(li).data());\n        }\n      }\n    };\n\n    var buildHelpRow = function buildHelpRow(target, obj, options) {\n      var li = _hh.createElement(\"li\", target);\n\n      $(li).data(obj);\n      var depth = target.getAttribute(\"dep\");\n      if (!depth) depth = 0;\n\n      _hh.setAttributes(li, {\n        \"dep\": Number(depth) + 1,\n        \"did\": obj.id,\n        \"dct\": obj.nt\n      });\n\n      var _createSwitchPart21 = createSwitchPart(li, obj, options),\n          _createSwitchPart22 = _slicedToArray(_createSwitchPart21, 3),\n          att = _createSwitchPart22[0],\n          iTag = _createSwitchPart22[1],\n          folderI = _createSwitchPart22[2];\n\n      var nameSpan = _hh.createElement(\"span\", li);\n\n      _hh.setClassName(nameSpan, \"dmn-ttl dmn-ref\");\n\n      _hh.setInnerHtml(nameSpan, obj.na);\n\n      nameSpan.onclick = function (ev) {\n        var li = this.parentNode;\n        var tree = tUtil.getTree(li)[0];\n        var options = tUtil.getTreeOptions(li);\n\n        if (_hh.hasClass(li, \"dmn-selected\")) {\n          $(tree).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(tree).find(\".dmn-ttl\").css(\"color\", \"\");\n          $(li).find(\".dmn-ttl\").css(\"color\", \"\");\n        } else {\n          $(tree).find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(tree).find(\".dmn-ttl\").css(\"color\", \"\");\n          $(li).addClass(\"dmn-selected\");\n          var tar = $(li).find(\".dmn-ttl\")[0];\n          $(tar).css(\"color\", \"red\");\n        }\n\n        options.onSelectRow($(li).data());\n      };\n\n      if (obj.nt === 1) {\n        var ul = _hh.createTag({\n          name: \"ul\",\n          className: \"dmn-c\",\n          parent: li,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        for (var i = 0; i < orgObj.children().length; i++) {\n          tUtil.buildHelpRow(ul, orgObj.children()[i], options);\n        }\n      }\n    };\n\n    var buildRow = function buildRow(target, obj, options) {\n      if (tUtil[\"build\" + options.tType + \"Row\"]) tUtil[\"build\" + options.tType + \"Row\"](target, obj, options);else treeEditor.buildEditorRow(target, obj, options);\n    };\n\n    var handleOldVersion = function handleOldVersion(options) {\n      var item = $.fn.treeView.options.instances.filter(function (el) {\n        return el.type === options.tType && el.location === options.location;\n      });\n\n      if (item.length) {\n        item = item[0];\n        options.expandList = item.opts.expandList;\n        var index = $.fn.treeView.options.instances.indexOf(item);\n        delete $.fn.treeView.options.instances[index];\n      }\n    };\n\n    var build = function build(target, options) {\n      if (!target.length) return false;\n\n      if (options.multi) {\n        $(target).addClass(\"dmn-tree tv-multi\");\n      } else {\n        $(target).addClass(\"dmn-tree\");\n      }\n\n      target = target.get(0);\n      options.treeEl = target;\n      target.innerHTML = \"\";\n      var randomId = Number((Math.random() * (10000000 - 100) + 100).toString().replace(\".\", \"\"));\n      handleOldVersion(options);\n      $.fn.treeView.options.instances.push({\n        id: randomId,\n        opts: options,\n        type: options.tType\n      });\n\n      _hh.setAttributes(target, {\n        \"tv-rootId\": options.rootId,\n        \"tv-id\": randomId,\n        \"t-type\": options.tType\n      });\n\n      if (!ko.isObservable(options.nodes)) {\n        if (options.nodes && options.nodes.length) for (var i = 0; i < options.nodes.length; i++) {\n          buildRow(target, options.nodes[i], options);\n        }\n      } else {\n        if (options.nodes() && options.nodes().length) for (var _i3 = 0; _i3 < options.nodes().length; _i3++) {\n          buildRow(target, options.nodes()[_i3], options);\n        }\n      }\n\n      if (options.selectedItems && options.selectedItems().length) {\n        setTimeout(function () {\n          setSelectedItems(target, options);\n        }, 150);\n      }\n\n      if (options.selectedItem) {\n        setTimeout(function () {\n          setSelectedItem(target, options);\n        }, 150);\n      }\n\n      switch (options.tType) {\n        case \"Permission\":\n          tUtil.changeCheckboxes($(target));\n          break;\n      }\n\n      _h.activeTooltip();\n    };\n\n    var typeOfRefreshInput = function typeOfRefreshInput(input) {\n      if (input === \"0\" || input === 0) return \"new\";\n      if (typeof input == 'string' && input.startsWith(\"U\")) return \"uid\";\n      if (typeof input == 'string' && $.isNumeric(input)) return \"numberString\";\n      if (typeof input == 'number') return \"number\";\n    };\n\n    var removeUselessSigns = function removeUselessSigns(tree) {\n      var liList = $(tree).find(\"li:not(:has('li'))\");\n      if (liList.length) for (var i = 0; i < liList.length; i++) {\n        var item = liList[i];\n        var sign = $(item).find(\".dmn-p\");\n\n        if (sign.length > 0) {\n          $(item).find(\".dmn-p\").remove();\n        }\n      }\n    };\n\n    var resetITagSigns = function resetITagSigns(tree) {\n      var liList = $(tree).find(\"li:not(:has('li'))\");\n      if (liList.length) for (var i = 0; i < liList.length; i++) {\n        var item = liList[i];\n        var sign = $(item).find(\".dmn-p\");\n\n        if (sign.length > 0) {\n          $(sign).addClass(\"fa-plus\");\n          $(sign).removeClass(\"fa-minus text-danger\");\n          $(item).find(\"ul\").addClass(\"dmn-c\");\n        }\n      }\n    };\n\n    return {\n      build: build,\n      buildChildren: buildChildren,\n      buildHelpRow: buildHelpRow,\n      buildMappingRow: buildMappingRow,\n      buildMappingDestRow: buildMappingDestRow,\n      buildBalanceReportRow: buildBalanceReportRow,\n      buildTreeInfoRow: buildTreeInfoRow,\n      buildXbrlConceptRow: buildXbrlConceptRow,\n      buildNodeSelectRow: buildNodeSelectRow,\n      buildReferenceRow: buildReferenceRow,\n      buildCurrentRow: buildCurrentRow,\n      buildCompanySettingRow: buildCompanySettingRow,\n      buildCompanyAccessUserRow: buildCompanyAccessUserRow,\n      buildCompanyRow: buildCompanyRow,\n      buildMappingSrcRow: buildMappingSrcRow,\n      buildPermissionRow: buildPermissionRow,\n      changeCheckboxes: changeCheckboxes,\n      createLiTag: createLiTag,\n      createConsolidateTag: createConsolidateTag,\n      getInstanceId: getInstanceId,\n      getOptions: getOptions,\n      getTreeOptions: getTreeOptions,\n      createNodePath: createNodePath,\n      getNodeParentId: getNodeParentId,\n      toggleSelectedTag: toggleSelectedTag,\n      toggleNodeSelectedTag: toggleNodeSelectedTag,\n      openGuideSign: openGuideSign,\n      getParents: getParents,\n      changeOtherSideSelectedItem: changeOtherSideSelectedItem,\n      getSelectedItemsData: getSelectedItemsData,\n      setGuidSigns: setGuidSigns,\n      toggleGuideSign: toggleGuideSign,\n      resetGuidSigns: resetGuidSigns,\n      getTree: getTree,\n      getNode: getNode,\n      refreshSelectItems: refreshSelectItems,\n      droppableMappingDestNode: droppableMappingDestNode,\n      setITag: setITag,\n      toggleSelectedMappingSrcTag: toggleSelectedMappingSrcTag,\n      setUnlinkTag: setUnlinkTag,\n      setPlusMinusAll: setPlusMinusAll,\n      toggleShowChildren: toggleShowChildren,\n      getConsolidationBranchData: getConsolidationBranchData,\n      typeOfRefreshInput: typeOfRefreshInput,\n      removeUselessSigns: removeUselessSigns,\n      resetITagSigns: resetITagSigns,\n      collectOpenBranches: collectOpenBranches,\n      openBranches: openBranches,\n      createDragListData: createDragListData\n    };\n  }();\n\n  var tVMethods = {\n    init: function init(options) {\n      tUtil.build(this, options);\n    },\n    expandAll: function expandAll() {\n      this.find(\"ul\").removeClass(\"dmn-c\");\n      this.find(\".dmn-p\").addClass(\"fa-minus text-danger\");\n      this.find(\".dmn-p\").removeClass(\"fa-plus\");\n      this.find(\".dmn-fld\").addClass(\"fa-folder\");\n      this.find(\".dmn-fld\").removeClass(\"fa-folder-open\");\n      tUtil.collectOpenBranches(this);\n    },\n    expand: function expand(list) {\n      if (_h.any(list)) for (var i = 0; i < list.length; i++) {\n        var li = $(this).find(\"[did='\" + list[i] + \"']\");\n\n        if (li.length) {\n          $(li).find(\"ul\").first().removeClass(\"dmn-c\");\n          $(li).find(\".dmn-p\").first().addClass(\"fa-minus text-danger\");\n          $(li).find(\".dmn-p\").first().removeClass(\"fa-plus\");\n          $(li).find(\".dmn-fld\").first().addClass(\"fa-folder\");\n          $(li).find(\".dmn-fld\").first().removeClass(\"fa-folder-open\");\n        }\n      }\n    },\n    collapseAll: function collapseAll() {\n      this.find(\"ul\").addClass(\"dmn-c\");\n      this.find(\".dmn-p\").removeClass(\"fa-minus text-danger\");\n      this.find(\".dmn-p\").addClass(\"fa-plus\");\n      this.find(\".dmn-fld\").addClass(\"fa-folder-open\");\n      this.find(\".dmn-fld\").removeClass(\"fa-folder\");\n      var options = tUtil.getTreeOptions(this);\n      options.expandList = [];\n    },\n    collectOpenBranches: function collectOpenBranches() {\n      var tree = tUtil.getTree(this);\n      tUtil.collectOpenBranches(tree);\n    },\n    openBranches: function openBranches() {\n      var tree = tUtil.getTree(this);\n      tUtil.openBranches(tree);\n    },\n    clearSelect: function clearSelect() {\n      this.find(\"li\").removeClass(\"dmn-selected\");\n      this.find(\".dmn-ttl\").css(\"color\", \"#6a6c6f\");\n      tUtil.resetGuidSigns(this);\n    },\n    refreshSelectItems: function refreshSelectItems(list) {\n      this.find(\"li\").removeClass(\"dmn-selected\");\n      this.find(\".dmn-ttl\").css(\"color\", \"\");\n      tUtil.refreshSelectItems(this, list);\n    },\n    removeTree: function removeTree() {\n      $(this).empty();\n    },\n    selectedItems: function selectedItems() {\n      var treeOpts = tUtil.getTreeOptions(this);\n      var tags = $(this).find(\"li.dmn-selected\");\n      var list = [];\n\n      for (var j = 0; j < tags.length; j++) {\n        var path = tUtil.createNodePath(tags[j], treeOpts.rootName);\n        list.push({\n          id: Number(tags[j].getAttribute(\"did\")),\n          code: tags[j].getAttribute(\"dco\"),\n          nodeType: Number(tags[j].getAttribute(\"dnt\")),\n          periodType: treeOpts.periodType,\n          path: path\n        });\n      }\n\n      return list;\n    },\n    selectedCheckedItems: function selectedCheckedItems() {\n      var inputs = $(this).find(\"input:checked\");\n      var list = [];\n\n      for (var j = 0; j < inputs.length; j++) {\n        var item = Number(inputs[j].getAttribute(\"did\"));\n        list.push(item);\n      }\n\n      return list;\n    },\n    refreshTree: function refreshTree(list, edit) {\n      var tree = tUtil.getTree(this);\n      var options = tUtil.getTreeOptions(tree);\n      if (list && list.length) for (var i = 0; i < list.length; i++) {\n        var obj = list[i];\n        var li = 0;\n        var typeOfId = tUtil.typeOfRefreshInput(obj.id);\n        if (obj.uid) typeOfId = tUtil.typeOfRefreshInput(obj.uid);\n\n        switch (typeOfId) {\n          case \"number\":\n            li = tUtil.getNode(tree[0], obj.id)[0];\n            break;\n\n          case \"numberString\":\n            li = tUtil.getNode(tree[0], Number(obj.id))[0];\n            break;\n\n          case \"uid\":\n            if (obj.uid) li = tree[0].querySelectorAll('[duid=\"' + obj.uid + '\"]')[0];else li = tree[0].querySelectorAll('[duid=\"' + obj.id + '\"]')[0];\n            break;\n\n          case \"new\":\n            li = tree[0].querySelectorAll('[duid=\"' + obj.uid + '\"]')[0];\n            break;\n        }\n\n        if (obj.del) {\n          _hh.removeElement(li);\n\n          continue;\n        }\n\n        if (!li) {\n          switch (options.tType) {\n            case \"MappingSrc\":\n              tUtil.buildMappingSrcRow(tree[0], obj, options);\n              break;\n\n            case \"Editor\":\n              treeEditor.buildEditorRow(tree[0], obj, options);\n              break;\n\n            case \"Mapping\":\n              tUtil.buildMappingRow(tree[0], obj, options);\n              break;\n          }\n        } else {\n          var ulTarget = li.parentNode;\n\n          switch (options.tType) {\n            case \"MappingSrc\":\n              tUtil.buildMappingSrcRow(ulTarget, obj, options, li);\n              break;\n\n            case \"Editor\":\n              treeEditor.buildEditorRow(ulTarget, obj, options, li, edit);\n              break;\n\n            case \"Mapping\":\n              tUtil.buildMappingRow(ulTarget, obj, options, li);\n              break;\n          }\n        }\n      }\n\n      _h.activeTooltip();\n\n      if (options.actions) options.actions.onCallbackAction();\n    },\n    changeShowMapped: function changeShowMapped(val) {\n      var tree = tUtil.getTree(this);\n      var options = tUtil.getTreeOptions(tree);\n      options.showMapped = val;\n    },\n    clearSelectItems: function clearSelectItems() {\n      var liList = this.find(\"li\");\n      if (liList && liList.length) for (var i = 0; i < liList.length; i++) {\n        var li = liList[i];\n        $(li).removeClass(\"dmn-selected\");\n        li.ondragstart = null;\n        li.ondragover = null;\n        li.ondragleave = null;\n        li.ondragend = null;\n      }\n      this.find(\".dmn-ttl\").css(\"color\", \"\");\n    },\n    removeItems: function removeItems() {\n      this.find(\"li.dmn-selected\").remove();\n\n      _h.kocnx().treevm().onCallbackAction();\n    },\n    selectSubSet: function selectSubSet() {\n      var list = this.find(\"li.dmn-selected\");\n      if (list && list.length) for (var i = 0; i < list.length; i++) {\n        var item = list[i];\n        $(item).find(\"li\").addClass(\"dmn-selected\");\n        $(item).find(\".dmn-ttl\").css(\"color\", \"red\");\n      }\n    },\n    getPasteModel: function getPasteModel(inRoot) {\n      var inComplex = treeEditor.inComplexStatus();\n      var tree = treeEditor.getTree();\n      var treeId = tree.getAttribute(\"tv-rootid\");\n      var selectedItem = treeEditor.getSelectedElements()[0];\n      var model = {\n        treeId: Number(treeId),\n        idList: [],\n        newParentId: 0,\n        nodeId: 0,\n        type: \"\"\n      };\n\n      if (inComplex.copy) {\n        var liList = tree.getElementsByClassName(\"copy-el\");\n\n        if (inRoot) {\n          model.newParentId = Number(treeId);\n        } else {\n          model.newParentId = Number(selectedItem.getAttribute(\"did\"));\n        }\n\n        model.type = 1;\n        if (liList && liList.length) for (var j = 0; j < liList.length; j++) {\n          var id = Number(liList[j].getAttribute(\"did\"));\n          model.idList.push(id);\n        }\n      }\n\n      if (inComplex.cut) {\n        var li = tree.getElementsByClassName(\"cut-el\")[0];\n        model.type = 2;\n        model.nodeId = Number(li.getAttribute(\"did\"));\n\n        if (inRoot) {\n          model.newParentId = Number(treeId);\n        } else {\n          model.newParentId = Number(selectedItem.getAttribute(\"did\"));\n        }\n      }\n\n      return model;\n    },\n    refreshAfterPaste: function refreshAfterPaste(type) {\n      var tree = treeEditor.getTree();\n\n      if (type === 1) {\n        $(tree).find(\"li\").removeClass(\"paste-target dmn-temp-selected\");\n      } else {\n        this.find(\"li\").removeClass(\"dmn-selected\");\n        this.find(\".dmn-ttl\").css(\"color\", \"\");\n        $(tree).find(\"li\").removeClass(\"copy-el paste-target dmn-temp-selected\");\n        $(tree).find(\"li.cut-el\").remove();\n      }\n\n      _h.activeTooltip();\n    },\n    nodeCreate: function nodeCreate(treeType, assignmentType, accountType, companyId) {\n      treeEditor.onCreateNode(treeType, assignmentType, accountType, companyId);\n    },\n    inComplexMode: function inComplexMode() {\n      return treeEditor.inComplexStatus();\n    },\n    getChangedItems: function getChangedItems() {\n      var tree = treeEditor.getTree();\n      var options = treeEditor.getOptions();\n      var orderChangeList = $(tree).find(\"li[dpr]\");\n      var newList = $(tree).find(\"li[did='0']\");\n      var changeList = $(tree).find(\"li[dcng='true'][did!='0']\");\n      var li, obj, parent;\n      var array = [];\n\n      if (newList && newList.length) {\n        for (var k = 0; k < newList.length; k++) {\n          li = newList[k];\n          obj = treeEditor.collectObj(li);\n          obj.id = li.getAttribute(\"duid\");\n\n          if (li.getAttribute(\"dep\") === \"1\") {\n            obj.pi = options.rootId + \"\";\n          } else {\n            parent = li.parentNode.parentNode;\n            var pid = parent.getAttribute(\"did\");\n            if (pid === \"0\") obj.pi = parent.getAttribute(\"duid\");else if (pid === undefined) obj.pi = options.rootId + \"\";else obj.pi = parent.getAttribute(\"did\");\n          }\n\n          obj.children = [];\n          var hasObj = array.filter(function (item) {\n            return item.id === obj.id;\n          }).length !== 0;\n\n          if (!hasObj) {\n            var dpr = li.getAttribute(\"dpr\");\n            if (dpr) obj.pr = dpr;\n            array.push(obj);\n          }\n        }\n      }\n\n      if (changeList && changeList.length) {\n        for (var i = 0; i < changeList.length; i++) {\n          li = changeList[i];\n          obj = treeEditor.collectObj(li);\n          obj.id = obj.id + \"\";\n          parent = li.parentNode.parentNode;\n          var pid = parent.getAttribute(\"did\");\n          if (pid === \"0\") obj.pi = parent.getAttribute(\"duid\");else if (pid === undefined) obj.pi = options.rootId + \"\";else obj.pi = parent.getAttribute(\"did\");\n          obj.children = [];\n          if (li.getAttribute(\"dep\") === \"1\") obj.pi = options.rootId + \"\";\n\n          var _hasObj = array.filter(function (item) {\n            return item.id === obj.id;\n          }).length !== 0;\n\n          if (!_hasObj) array.push(obj);\n        }\n      }\n\n      if (orderChangeList && orderChangeList.length) {\n        for (var d = 0; d < orderChangeList.length; d++) {\n          li = orderChangeList[d];\n          var elDid = li.getAttribute(\"did\");\n          if (!elDid || elDid === \"0\") continue;\n          obj = treeEditor.collectObj(li);\n          obj.id = obj.id + \"\";\n          parent = li.parentNode.parentNode;\n          var pid = parent.getAttribute(\"did\");\n          if (pid === \"0\") obj.pi = parent.getAttribute(\"duid\");else if (pid === undefined) obj.pi = options.rootId + \"\";else obj.pi = parent.getAttribute(\"did\");\n          obj.pr = li.getAttribute(\"dpr\");\n          obj.children = [];\n          if (li.getAttribute(\"dep\") === \"1\") obj.pi = options.rootId + \"\";\n\n          var _hasObj2 = array.filter(function (item) {\n            return item.id === obj.id;\n          }).length !== 0;\n\n          if (!_hasObj2) array.push(obj);else {\n            array.filter(function (item) {\n              return item.id === obj.id;\n            }).pr = li.getAttribute(\"dpr\");\n          }\n        }\n      }\n\n      var treefy = _h.buildTree(array);\n\n      return treefy;\n    },\n    setErrors: function setErrors(list) {\n      treeEditor.setErrors(list);\n    },\n    resetErrors: function resetErrors() {\n      var tree = treeEditor.getTree();\n      $(tree).find(\".dropdown\").remove();\n    },\n    nodeEditTrigger: function nodeEditTrigger() {\n      var li = this.find(\"li.dmn-selected\");\n      if (li.length > 1) return;\n      var tree = treeEditor.getTree();\n      var options = treeEditor.getOptions(tree);\n      var object = treeEditor.collectObj(li);\n\n      var parent = _hh.getClosest(li, \"li\");\n\n      object.parentNodeTemplate = parent.getAttribute(\"dnte\") === \"null\" ? null : Number(parent.getAttribute(\"dnte\"));\n      object.pId = Number(parent.getAttribute(\"did\"));\n      options.actions.onEditNode(li, object);\n    },\n    getDataNode: function getDataNode(id) {\n      var tree = tUtil.getTree(this);\n      var treeId = tree.getAttribute(\"tv-rootid\");\n      var li = tUtil.getNode(tree[0], id)[0];\n      var object = treeEditor.collectObj(li);\n\n      if (li.getAttribute(\"dep\") === \"1\") {\n        object.pId = Number(treeId);\n        object.parentNodeTemplate = false;\n      } else {\n        var parent = _hh.getClosest(li, \"li\");\n\n        object.parentNodeTemplate = parent.getAttribute(\"dnte\") === \"null\" ? null : Number(parent.getAttribute(\"dnte\"));\n        object.pId = Number(parent.getAttribute(\"did\"));\n      }\n\n      return object;\n    },\n    getToolbarData: function getToolbarData() {\n      if (this.find(\"li\").length === 0) return [];\n      var tree = treeEditor.getTree();\n      var options = treeEditor.getOptions();\n      var period = options.permitPeriodEdit;\n      var inComplex = treeEditor.inComplexStatus();\n      var newList = $(tree).find(\"li[did='0']\");\n      var changedList = $(tree).find(\"li[dcng='true']\");\n      var sortedItems = $(tree).find(\"li[dpr]\");\n      var liList = treeEditor.getSelectedElements();\n      var allowedActions = treeEditor.getAllowedActions(liList);\n      if (!allowedActions) allowedActions = [];\n      var action;\n\n      if (changedList.length + newList.length + sortedItems.length > 0 && period) {\n        action = allowedActions.filter(function (a) {\n          return a.name === \"SaveChange\";\n        });\n        if (!action.length) allowedActions.push({\n          name: \"SaveChange\",\n          visible: true\n        });else action.visible = true;\n      }\n\n      if (liList.length === 0 && period) {\n        action = allowedActions.filter(function (a) {\n          return a.name === \"CreateNode\";\n        });\n        if (!action.length) allowedActions.push({\n          name: \"CreateNode\",\n          visible: true\n        });else action.visible = true;\n      }\n\n      if (liList.length === 0 && period && inComplex.sort === false) {\n        allowedActions.push({\n          name: \"Sort\",\n          visible: true\n        });\n      }\n\n      if (liList.length === 0 && period && inComplex.sort === true) {\n        allowedActions.push({\n          name: \"SaveSort\",\n          visible: true\n        });\n        allowedActions.push({\n          name: \"Cancel\",\n          visible: true\n        });\n        action = allowedActions.filter(function (a) {\n          return a.name === \"CreateNode\";\n        });\n        if (action.length) action[0].visible = false;\n      }\n\n      if (liList.length === 0 && inComplex.cut) {\n        action = allowedActions.filter(function (a) {\n          return a.name === \"Paste\";\n        }); // if (!action.length)\n        //     allowedActions.push({name: \"Paste\", visible: true});\n        // else\n        //     action.visible = true;\n\n        allowedActions = [{\n          name: \"Paste\",\n          visible: true\n        }, {\n          name: \"Cancel\",\n          visible: true\n        }];\n      }\n\n      if (liList.length === 0 && inComplex.copy) {\n        // action = allowedActions.filter(a => a.name === \"Paste\");\n        // if (!action.length)\n        //     allowedActions.push();\n        // else\n        //     action.visible = true;\n        allowedActions = [{\n          name: \"Paste\",\n          visible: true\n        }, {\n          name: \"Cancel\",\n          visible: true\n        }];\n      }\n\n      return allowedActions;\n    },\n    nodeSort: function nodeSort() {\n      treeEditor.onSort(this);\n    },\n    removeNewNodes: function removeNewNodes() {\n      var newList = $(tree).find(\"li[did='0']\");\n      if (newList && newList.length) for (var i = 0; i < newList.length; i++) {\n        $(newList[i]).remove();\n      }\n    },\n    changeSelectedItem: function changeSelectedItem(list) {\n      this.find(\"li\").removeClass(\"dmn-selected\");\n      this.find(\".dmn-ttl\").css(\"color\", \"\");\n      tUtil.changeOtherSideSelectedItem(this, list);\n    },\n    exeAction: function exeAction(action) {\n      var inComplex = treeEditor.inComplexStatus();\n      var li = treeEditor.getSelectedElements();\n      var tree = treeEditor.getTree();\n      var options = treeEditor.getOptions();\n      if (li.length === 0 && inComplex.sort) li = [tree];\n      var inRoot;\n\n      if (action === \"Paste\") {\n        li = tree.getElementsByClassName(\"dmn-temp-selected\");\n        $(li).addClass(\"paste-target\");\n        $(li).removeClass(\"dmn-temp-selected\");\n        inRoot = true;\n      }\n\n      if (action === \"Sort\" && li.length === 0) {\n        li = [tree];\n      }\n\n      if (treeEditor[\"on\" + action]) treeEditor[\"on\" + action](li);else if (options.actions[\"on\" + action]) options.actions[\"on\" + action](inRoot);\n    },\n    setAccessList: function setAccessList(model) {\n      var tag = $(this).find(\"li.dmn-selected\")[0];\n      var array = [];\n      if (model.list && model.list.length > 0) for (var i = 0; i < model.list.length; i++) {\n        if (model.list[i].assign === true) array.push({\n          companyId: tag.id,\n          accessId: model.list[i].accessId\n        });\n      }\n      tag.setAttribute(\"dal\", JSON.stringify(array));\n    },\n    getCompanyAccess: function getCompanyAccess() {\n      var tags = $(this).find(\"li\");\n      var array = [];\n\n      for (var i = 0; i < tags.length; i++) {\n        var tag = tags[i];\n        array.push({\n          id: Number(tag.getAttribute(\"did\")),\n          userAccesses: JSON.parse(tag.getAttribute(\"dal\"))\n        });\n      }\n\n      return array;\n    },\n    checkedBoxes: function checkedBoxes() {\n      var inputs = $(this).find(\"input\");\n\n      for (var i = 0; i < inputs.length; i++) {\n        inputs[i].checked = true;\n      }\n    },\n    uncheckedBoxes: function uncheckedBoxes() {\n      var inputs = $(this).find(\"input\");\n\n      for (var i = 0; i < inputs.length; i++) {\n        inputs[i].checked = false;\n      }\n    },\n    getDragList: function getDragList() {\n      var treeOpts = tUtil.getTreeOptions(this);\n      var tags = $(this).find(\"li.dmn-selected\");\n      var length = tags.length;\n      var list = tUtil.createDragListData(tags, treeOpts);\n      return list;\n    }\n  };\n\n  var treeEditor = function () {\n    var setErrors = function setErrors(list) {\n      if (!list && !list.length) return;\n      var tree = treeEditor.getTree();\n      $(tree).find(\".dropdown\").remove();\n      var t = '<div class=\"dropdown col-select\" style=\"float: left;position: absolute;\">' + '<a data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"true\">' + '<img class=\"icon-image-xxsmall\" style=\"margin-right: -34px;\" src=\"/App/src/images/ico/form-error.png\" />' + '</a><ul class=\"dropdown-menu pull-left\" style=\"width: 450px;padding: 0;margin: 0;\">' + '<li class=\"tbl-menu-row tbl-menu-header\" style=\"margin: 0;\"><span style=\"font-weight: bold;color: #999;\">فهرست خطاها</span></li>' + '<li class=\"tbl-menu-row\"><div class=\"row m-b-lg\" style=\"margin-top: 6px;\"><div class=\"col-lg-12\">' + '<ul class=\"error-list\"></ul></div></div></li></ul></div>';\n      var div = $(t);\n      var ul = div.find(\"ul.error-list\");\n\n      for (var i = 0; i < list.length; i++) {\n        var li = $(tree).find(\"li[did='\" + list[i].nodeId + \"']\");\n        if (!li || li.length === 0) li = $(tree).find(\"li[duid='\" + list[i].nodeId + \"']\");\n        if (!li || li.length === 0) continue;\n        var itemErrors = list[i].errors;\n\n        if (itemErrors.length) {\n          for (var j = 0; j < itemErrors.length; j++) {\n            var target = itemErrors[j];\n\n            var text = _h.getApiMessage(target.code);\n\n            var faName;\n\n            try {\n              faName = _h.getLocalizedText(target.propertyName);\n              text = _h.completeError(text, target);\n            } catch (e) {\n              faName = undefined;\n            }\n\n            var liError = $('<li class=\"error-item\"><span class=\"error-title\"></span>' + '<span class=\"error-desc\"></span></li>');\n            liError.find(\".error-item\").text(faName);\n            liError.find(\".error-desc\").text(text);\n            ul.append(liError);\n          }\n\n          li.prepend(div);\n        }\n      }\n    };\n\n    var setNodeTitle = function setNodeTitle(li, obj, options) {\n      var divTitle = _hh.createElement(\"div\", li);\n\n      _hh.setClassName(divTitle, \"dmn-tl\");\n\n      var nameSpan = _hh.createElement(\"span\", divTitle);\n\n      var sName = _h.shortName(obj.na);\n\n      var title = sName[0];\n\n      _hh.setInnerHtml(nameSpan, title);\n\n      switch (obj.nt) {\n        case 1:\n          _hh.setClassName(nameSpan, \"dmn-ttl dmn-mg\");\n\n          break;\n\n        case 2:\n          _hh.setClassName(nameSpan, \"dmn-ttl dmn-mg\");\n\n          break;\n      }\n\n      var codeSpan = _hh.createElement(\"span\", divTitle);\n\n      _hh.setInnerHtml(codeSpan, \" ( \" + obj.co + \" )\");\n\n      _hh.setClassName(codeSpan, \"dmn-code\");\n\n      var divDesc = _hh.createElement(\"div\", li);\n\n      _hh.setClassName(divDesc, \"dmn-sline\");\n\n      if (_h.contains([0, 1, 4], obj.tt)) {\n        var atSpan = _hh.createElement(\"span\", divDesc);\n\n        _hh.setInnerHtml(atSpan, _h.getEnumText(accountTypes, obj.at));\n\n        _hh.setClassName(atSpan, \"dmn-at\");\n\n        if (obj.nt === 2) {\n          _hh.setClassName(divDesc, \"dmn-sline-at\");\n        }\n      } else {\n        if (obj.nt === 1) {\n          _hh.setClassName(divDesc, \"dmn-sline-vltb\");\n        } else {\n          _hh.setClassName(divDesc, \"dmn-sline-vlt\");\n        }\n      }\n\n      var vlSpan = _hh.createElement(\"span\", divDesc);\n\n      var hasVlEvent = false;\n\n      _hh.setInnerHtml(vlSpan, _h.formatTextIfNull(obj.dv));\n\n      if (options.companyType === 0 && (obj.tt === 2 || obj.tt === 3)) {\n        _hh.setClassName(vlSpan, \"dmn-vlg link-underline clickable\");\n\n        hasVlEvent = true;\n      } else {\n        _hh.setClassName(vlSpan, \"dmn-vl\");\n      }\n\n      var ccTag;\n\n      if (obj.nt === 1 && obj.nte === 1 && !obj.cc) {\n        ccTag = _hh.createElement(\"i\", divDesc);\n\n        _hh.setClassName(ccTag, \"dmn-ey fa fa-eye\");\n      }\n\n      if (obj.de) {\n        var descTag = _hh.createElement(\"i\", divDesc);\n\n        _hh.setClassName(descTag, \"dmn-info fa fa-info-circle \");\n\n        _hh.setAttributes(descTag, {\n          \"title\": obj.de\n        });\n      }\n\n      treeEditor.eventHandlers(li, nameSpan, ccTag, vlSpan, hasVlEvent);\n\n      if (sName[1]) {\n        _hh.setAttributes(nameSpan, {\n          \"title\": obj.na\n        });\n      }\n\n      return nameSpan;\n    };\n\n    var eventHandlers = function eventHandlers(li, nameSpan, ccTag, vlSpan, vlEvent) {\n      li.oncontextmenu = function (ev) {\n        var li = null;\n        if (this.nodeName === \"LI\") li = this;\n        if (this.nodeName === \"SPAN\") li = this.parentNode;\n        treeEditor.toggleSelectedTag(li, ev.ctrlKey, true);\n        treeEditor.getMenu({\n          el: ev.currentTarget\n        });\n        ev.cancelBubble = true;\n        return false;\n      };\n\n      if (vlSpan && vlEvent) vlSpan.onclick = function (ev) {\n        var li = _hh.getClosest(ev.target, \"li\");\n\n        var tree = treeEditor.getTree();\n        var options = treeEditor.getOptions(tree);\n        options.actions.onNodeValuePart(Number(li.getAttribute(\"did\")));\n      };\n      if (ccTag) ccTag.onclick = function (ev) {\n        var li = this.parentNode.parentNode;\n        var id = li.getAttribute(\"did\");\n        if (id === \"0\") return;\n        var eyIcon = li.getElementsByClassName(\"dmn-ey\")[0];\n        var ulTarget = li.getElementsByTagName(\"ul\")[0];\n        var instId = tUtil.getInstanceId(li);\n        var opts = tUtil.getOptions(instId);\n        tUtil.getConsolidationBranchData(id, opts, function (list) {\n          if (list && list.length) {\n            var oldNodes = $(ulTarget).find(\"li.dmn-selected\");\n            var oldIds = [];\n            if (oldNodes.length) for (var j = 0; j < oldNodes.length; j++) {\n              oldIds.push(Number($(oldNodes[j]).attr(\"did\")));\n            }\n            $(ulTarget).empty();\n\n            for (var i = 0; i < list.length; i++) {\n              treeEditor.buildEditorRow(ulTarget, list[i], opts);\n            }\n          }\n\n          _hh.removeElement(eyIcon);\n        });\n      };\n\n      nameSpan.onclick = function (ev) {\n        var li = this.parentNode.parentNode;\n        treeEditor.toggleSelectedTag(li, ev.ctrlKey);\n      };\n\n      nameSpan.ondblclick = function (ev) {\n        var li = ev.target.parentNode.parentNode;\n        var tree = treeEditor.getTree();\n        var treeId = tree.getAttribute(\"tv-rootid\");\n        var options = treeEditor.getOptions(tree);\n        if (!options.permitPeriodEdit) return;\n        var object = treeEditor.collectObj(li);\n\n        if (li.getAttribute(\"dep\") === \"1\") {\n          object.pId = Number(treeId);\n          object.parentNodeTemplate = false;\n        } else {\n          var parent = $(li).parent().parent()[0];\n          object.parentNodeTemplate = parent.getAttribute(\"dnte\") === \"null\" ? null : Number(parent.getAttribute(\"dnte\"));\n          object.pId = Number(parent.getAttribute(\"did\"));\n        }\n\n        options.actions.onEditNode(li, object);\n      };\n\n      var iTag = li.getElementsByClassName(\"dmn-p\")[0];\n      if (iTag) iTag.onclick = function () {\n        tUtil.toggleShowChildren(this);\n      };\n    };\n\n    var resetEventHandlers = function resetEventHandlers(li) {\n      var liList = li.getElementsByTagName(\"li\");\n      var vlSpan, nameSpan, ccTag;\n      vlSpan = li.getElementsByClassName(\"dmn-vlg\")[0];\n      nameSpan = li.getElementsByClassName(\"dmn-ttl\")[0];\n      ccTag = li.getElementsByClassName(\"dmn-ey\")[0];\n      treeEditor.eventHandlers(li, nameSpan, ccTag, vlSpan, false);\n\n      if (liList.length > 1) {\n        for (var i = 0; i < liList.length; i++) {\n          var liChild = liList[i];\n          vlSpan = liChild.getElementsByClassName(\"dmn-vlg\")[0];\n          nameSpan = liChild.getElementsByClassName(\"dmn-ttl\")[0];\n          ccTag = liChild.getElementsByClassName(\"dmn-ey\")[0];\n          treeEditor.eventHandlers(liChild, nameSpan, ccTag, vlSpan, false);\n        }\n      }\n    };\n\n    var collectObj = function collectObj(li) {\n      var dnte = li.getAttribute(\"dnte\") === \"null\" ? null : Number(li.getAttribute(\"dnte\"));\n      var obj = {\n        id: Number(li.getAttribute(\"did\")),\n        uid: li.getAttribute(\"duid\"),\n        nt: Number(li.getAttribute(\"dnt\")),\n        nte: dnte,\n        co: li.getAttribute(\"dco\"),\n        tt: Number(li.getAttribute(\"dtt\")),\n        dep: Number(li.getAttribute(\"dep\")),\n        at: Number(li.getAttribute(\"dat\")),\n        cfc: Number(li.getAttribute(\"dcfc\")),\n        v: li.getAttribute(\"dv\"),\n        f: li.getAttribute(\"df\"),\n        na: li.getAttribute(\"dna\"),\n        ci: Number(li.getAttribute(\"dci\")),\n        as: Number(li.getAttribute(\"das\")),\n        dv: li.getAttribute(\"ddv\"),\n        liTarget: li,\n        de: li.getAttribute(\"dde\"),\n        gid: li.getAttribute(\"dgid\")\n      };\n\n      for (var k in obj) {\n        if (obj.hasOwnProperty(k)) {\n          var param = obj[k];\n          if (param === \"undefied\") param = \"\";\n          if (param === NaN) param = \"\";\n        }\n      }\n\n      return obj;\n    };\n\n    var getTree = function getTree() {\n      return document.getElementById(\"tree_view_ed\");\n    };\n\n    var getOptions = function getOptions() {\n      var tree = treeEditor.getTree();\n      var instanceId = tree.getAttribute(\"tv-id\");\n      var item = $.fn.treeView.options.instances.filter(function (el) {\n        return el.id === Number(instanceId);\n      });\n      return item[0].opts;\n    };\n\n    var getSelectedElements = function getSelectedElements() {\n      var tree = document.getElementById(\"tree_view_ed\");\n      var copy = tree.getElementsByClassName(\"copy-el\").length > 0;\n      var cut = tree.getElementsByClassName(\"cut-el\").length > 0;\n      if (!cut && !copy) return tree.getElementsByClassName(\"dmn-selected\");else {\n        return tree.getElementsByClassName(\"paste-target\");\n      }\n    };\n\n    var getMenu = function getMenu(data) {\n      treeEditor.disposeMenu();\n\n      var pos = _h.getPosition(data.el);\n\n      var tree = tUtil.getTree(data.el);\n      var selectedItems = treeEditor.getSelectedElements();\n      if (selectedItems.length === 0) selectedItems = [data.el];\n      var buttons = treeEditor.getAllowedActions(selectedItems);\n      if (!buttons && buttons.length === 0) return;\n      var nav = document.createElement('nav');\n      document.body.appendChild(nav);\n\n      _hh.setAttributes(nav, {\n        \"target\": tree[0].getAttribute(\"tv-id\")\n      });\n\n      nav.className = \"context-menu\";\n\n      _hh.setClassName(nav, \"context-menu\");\n\n      var ul = _hh.createElement(\"ul\", nav);\n\n      _hh.setClassName(ul, \"mt-contextmenu\");\n\n      for (var i = 0; i < buttons.length; i++) {\n        var button = buttons[i];\n        if (!button.visible) continue;\n\n        var li = _hh.createElement(\"li\", ul);\n\n        var a = _hh.createElement(\"a\", li);\n\n        li.setAttribute(\"data-action\", button.name);\n\n        var caption = _hh.createElement(\"span\", a);\n\n        caption.innerText = button.caption;\n\n        _hh.setClassName(caption, \"mt-contextmenu-text\");\n\n        var iconSpan = _hh.createElement(\"span\", a);\n\n        _hh.setClassName(iconSpan, \"mt-contextmenu-icon\");\n\n        var image = _hh.createElement(\"img\", iconSpan);\n\n        image.src = button.icon;\n\n        li.onclick = function (event) {\n          var inComplex = treeEditor.inComplexStatus();\n          var li = treeEditor.getSelectedElements();\n          var tree = treeEditor.getTree();\n          var options = treeEditor.getOptions();\n          if (li.length === 0 && inComplex.sort) li = [tree];\n          var dataAction = this.getAttribute(\"data-action\");\n\n          if (dataAction === \"Paste\") {\n            li = tree.getElementsByClassName(\"dmn-temp-selected\");\n            $(li).addClass(\"paste-target\");\n            $(li).removeClass(\"dmn-temp-selected\");\n          }\n\n          if (treeEditor[\"on\" + dataAction]) treeEditor[\"on\" + dataAction](li);else if (options.actions[\"on\" + dataAction]) options.actions[\"on\" + dataAction]();\n        };\n      }\n\n      nav.style.top = pos.top + 30 + \"px\";\n      nav.style.left = pos.right + \"px\";\n\n      document.onclick = function () {\n        var menu = document.getElementsByClassName(\"context-menu\")[0];\n        if (menu) disposeMenu();\n      };\n    };\n\n    var disposeMenu = function disposeMenu() {\n      var menu = document.getElementsByClassName(\"context-menu\")[0];\n      if (menu) menu.parentNode.removeChild(menu);\n    };\n\n    var toggleSelectedTag = function toggleSelectedTag(li, ctrl, rightClick) {\n      var complex = treeEditor.inComplexStatus();\n      if (complex.sort) return false;\n\n      if (complex.cut || complex.copy) {\n        if (!_hh.hasClass(li, \"dmn-selected\")) {\n          $(\"li.dmn-temp-selected\").removeClass(\"dmn-temp-selected\");\n          $(li).addClass(\"dmn-temp-selected\");\n        }\n\n        return false;\n      }\n\n      var firstSpan = $(li).find(\".dmn-ttl\")[0];\n\n      if (ctrl) {\n        if (_hh.hasClass(li, \"dmn-selected\")) {\n          if (rightClick) {\n            $(li).find(\"li\").addClass(\"dmn-selected\");\n            $(li).find(\".dmn-ttl\").css(\"color\", \"red\");\n            $(li).addClass(\"dmn-selected\");\n          } else {\n            $(li).removeClass(\"dmn-selected\");\n            $(li).find(\"li\").removeClass(\"dmn-selected\");\n            $(li).find(\".dmn-ttl\").css(\"color\", \"\");\n          }\n        } else {\n          $(li).find(\"li\").addClass(\"dmn-selected\");\n          $(li).find(\".dmn-ttl\").css(\"color\", \"red\");\n          $(li).addClass(\"dmn-selected\");\n        }\n      } else {\n        if (_hh.hasClass(li, \"dmn-selected\")) {\n          if (rightClick) {\n            $(li).addClass(\"dmn-selected\");\n            $(firstSpan).css(\"color\", \"red\");\n          } else {\n            $(li).closest(\".dmn-tree\").find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n            $(li).closest(\".dmn-tree\").find(\".dmn-ttl\").css(\"color\", \"\");\n          }\n        } else {\n          $(li).closest(\".dmn-tree\").find(\"li.dmn-selected\").removeClass(\"dmn-selected\");\n          $(li).closest(\".dmn-tree\").find(\".dmn-ttl\").css(\"color\", \"\");\n          $(li).addClass(\"dmn-selected\");\n          $(firstSpan).css(\"color\", \"red\");\n        }\n      }\n\n      _h.kocnx().treevm().onCallbackAction();\n    };\n\n    var buildEditorRow = function buildEditorRow(target, obj, options, targetLi, editTag) {\n      var li, childNodes;\n\n      if (targetLi) {\n        li = document.createElement(\"li\");\n        var oldUl = targetLi.getElementsByTagName(\"ul\")[0];\n        if (editTag) childNodes = oldUl.childNodes;\n        targetLi.replaceWith(li);\n      } else li = _hh.createElement(\"li\", target);\n\n      if (editTag) _hh.setAttributes(li, {\n        \"dcng\": true\n      });\n      var att, iTag, iDot, folderI;\n      var depth = target.getAttribute(\"dep\");\n      if (!depth) depth = 0;\n\n      _hh.setAttributes(li, {\n        \"dep\": Number(depth) + 1,\n        \"did\": obj.id,\n        \"duid\": obj.uid,\n        \"dnt\": obj.nt,\n        \"dnte\": obj.nte,\n        \"dcc\": obj.cc,\n        \"dco\": obj.co,\n        \"dtt\": obj.tt,\n        \"dat\": obj.at,\n        \"dcfc\": obj.cfc,\n        \"dv\": _h.emptyTextIfNull(obj.v),\n        \"df\": _h.emptyTextIfNull(obj.f),\n        \"dna\": obj.na,\n        \"dci\": obj.ci,\n        \"das\": obj.as,\n        \"ddv\": obj.dv,\n        \"dde\": _h.emptyTextIfNull(obj.de)\n      });\n\n      if (obj.gid) li.setAttribute(\"dgid\", obj.gid);\n\n      switch (obj.nt) {\n        case 1:\n          iTag = _hh.createElement(\"i\", li);\n\n          _hh.setClassName(iTag, \"dmn-p fa fa-plus\");\n\n          folderI = _hh.createElement(\"i\", li);\n\n          _hh.setClassName(folderI, \"dmn-fld fa fa-folder\");\n\n          iTag.onclick = function () {\n            tUtil.toggleShowChildren(this);\n          };\n\n          break;\n\n        case 2:\n          if (obj.children.length > 0) {\n            iTag = _hh.createElement(\"i\", li);\n\n            _hh.setClassName(iTag, \"dmn-p fa fa-plus\");\n          }\n\n          att = _hh.createElement(\"i\", li);\n\n          _hh.setClassName(att, \"dmn-att fa fa-file-text-o\");\n\n          if (obj.children.length > 0) {\n            iTag.onclick = function () {\n              tUtil.toggleShowChildren(this);\n            };\n          }\n\n          break;\n      }\n\n      if (depth === 0 && obj.nt === 1) tUtil.setPlusMinusAll(li);\n      setNodeTitle(li, obj, options);\n\n      if (obj.nt === 1 || obj.nt === 2) {\n        var ul = _hh.createTag({\n          name: \"ul\",\n          className: \"dmn-c\",\n          parent: li,\n          attributes: {\n            \"dep\": Number(depth) + 1\n          }\n        });\n\n        tUtil.buildChildren(ul, obj, options);\n      }\n\n      if (childNodes && childNodes.length && obj.nt === 1) {\n        var liUl = li.getElementsByTagName(\"ul\")[0];\n\n        for (var j = 0; j < childNodes.length; j++) {\n          var newClone = childNodes[j].cloneNode(true);\n          liUl.appendChild(newClone);\n        }\n\n        treeEditor.resetEventHandlers(li);\n      }\n    };\n\n    var getAllowedActions = function getAllowedActions(liList, actionTarget) {\n      var baseUrl = \"/App/src/images/ico/\";\n      if (!liList || liList.length === 0) return null;\n      var inComplexStatus = treeEditor.inComplexStatus();\n      var actions, action, target;\n      var options = tUtil.getTreeOptions(liList[0]);\n      var period = options.permitPeriodEdit;\n      var isRoot = options.companyIsRoot;\n      var selectedCount = liList.length;\n      var consolidate = null,\n          consolidateBranch = false;\n\n      if (selectedCount === 1) {\n        consolidate = liList[0].getAttribute(\"dcc\") !== \"null\" && Number(liList[0].getAttribute(\"dcc\")) > 0;\n      }\n\n      if (selectedCount === 1) {\n        consolidateBranch = liList[0].getAttribute(\"dnte\") === \"1\" && liList[0].getAttribute(\"dcc\") === \"null\";\n      }\n\n      if (inComplexStatus.all) {\n        actions = [{\n          name: \"Paste\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"Paste\"),\n          caption: _h.getLocalizedText(\"paste\")\n        }, {\n          name: \"Cancel\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"Cancel\"),\n          caption: _h.getLocalizedText(\"cancel\")\n        }, {\n          name: \"SaveSort\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"Save\"),\n          caption: _h.getLocalizedText(\"update\")\n        }];\n\n        for (var j = 0; j < actions.length; j++) {\n          action = actions[j];\n\n          switch (action.name) {\n            case \"Paste\":\n              var res = false;\n              if (inComplexStatus.copy) res = !_hh.hasClass(liList[0], \"copy-el\") && liList[0].getAttribute(\"dnt\") == 1;\n              if (inComplexStatus.cut) res = !_hh.hasClass(liList[0], \"cut-el\") && liList[0].getAttribute(\"dnt\") == 1;\n              action.visible = res && !inComplexStatus.sort && selectedCount === 1;\n              break;\n\n            case \"Cancel\":\n              action.visible = inComplexStatus.all;\n              break;\n\n            case \"SaveSort\":\n              action.visible = inComplexStatus.sort;\n              break;\n          }\n\n          if (action.name === actionTarget) target = action;\n        }\n\n        if (actionTarget) return target;\n        return actions;\n      } else {\n        actions = [{\n          name: \"CreateNode\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"TreeCreate\"),\n          caption: _h.getLocalizedText(\"createNodeCaption\")\n        }, {\n          name: \"DeleteNode\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"Delete\"),\n          caption: _h.getLocalizedText(\"deleteNodeCaption\")\n        }, {\n          name: \"DeleteNodes\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"Delete\"),\n          caption: _h.getLocalizedText(\"deleteNodesCaption\")\n        }, {\n          name: \"Sort\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"Sort\"),\n          caption: _h.getLocalizedText(\"activeOrderSubCaption\")\n        }, {\n          name: \"NodeReport\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"NodeReport\"),\n          caption: _h.getLocalizedText(\"nodeReportCaption\")\n        }, {\n          name: \"NodeReports\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"NodeReport\"),\n          caption: _h.getLocalizedText(\"nodeReportsCaption\")\n        }, {\n          name: \"Copy\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"Copy\"),\n          caption: _h.getLocalizedText(\"copy\")\n        }, {\n          name: \"Cut\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"Cut\"),\n          caption: _h.getLocalizedText(\"cut\")\n        }, {\n          name: \"ToBranch\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"Up\"),\n          caption: _h.getLocalizedText(\"changeToBranchCaption\")\n        }, {\n          name: \"ToLeaf\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"Down\"),\n          caption: _h.getLocalizedText(\"changeToLeafCaption\")\n        }, {\n          name: \"EditNode\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"Edit\"),\n          caption: _h.getLocalizedText(\"EditCaption\")\n        }, {\n          name: \"ImportExcel\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"ImportExcel\"),\n          caption: _h.getLocalizedText(\"importExcelCaption\")\n        }, {\n          name: \"ExportExcel\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"ExportExcel\"),\n          caption: _h.getLocalizedText(\"exportExcel\")\n        }, {\n          name: \"ExportAllExcel\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"ExportExcel\"),\n          caption: _h.getLocalizedText(\"exportExcelAll\")\n        }, {\n          name: \"ResetConsolidate\",\n          visible: false,\n          icon: baseUrl + _h.getIcon(\"ResetConsolidate\"),\n          caption: _h.getLocalizedText(\"ResetBranchConsolidateCaption\")\n        }];\n\n        for (var i = 0; i < actions.length; i++) {\n          action = actions[i];\n\n          if (!actionTarget || action.name === actionTarget) {\n            switch (action.name) {\n              case \"Copy\":\n                var temp = period && !inComplexStatus.all;\n\n                if (selectedCount === 1) {\n                  action.visible = temp && !consolidate;\n                } else {\n                  var gConsolidate = $(\"li.dmn-selected[dnte='1'][dcc='null']\");\n                  var diveInConsolidate = $(\"li.dmn-selected[dnte='1'][dcc!='null']\");\n                  if (gConsolidate.length === 0 && diveInConsolidate.length > 0) action.visible = false;else if (gConsolidate.length === 0) action.visible = temp;else if (gConsolidate.length > 0) {\n                    var res = true;\n\n                    for (var k = 0; k < gConsolidate.length; k++) {\n                      res = $(gConsolidate[k]).find(\"li:not(.dmn-selected)\").length === 0;\n                      if (!res) break;\n                    }\n\n                    action.visible = temp && res;\n                  }\n                }\n\n                break;\n\n              case \"Cut\":\n                action.visible = period && !inComplexStatus.all && !consolidate && selectedCount === 1;\n                break;\n\n              case \"DeleteNode\":\n                var creator = liList[0].getAttribute(\"dci\"); //var owner = Number(creator) === options.companyId;\n\n                action.visible = period && selectedCount === 1 && (consolidate && !isRoot || !consolidate);\n                break;\n\n              case \"DeleteNodes\":\n                action.visible = period && selectedCount > 1;\n                break;\n\n              case \"CreateNode\":\n                var nodeTemplate = liList[0].getAttribute(\"dnte\");\n                var att = selectedCount === 1 && liList[0].getAttribute(\"dnt\") == 1 && (nodeTemplate == null || nodeTemplate == 0 || nodeTemplate == \"null\");\n                action.visible = period && att;\n                break;\n\n              case \"Sort\":\n                var dep = liList[0].getAttribute(\"dep\");\n                var hasChild = $(liList[0]).find(\"li[dep='\" + (Number(dep) + 1) + \"']\").length > 1;\n                action.visible = period && selectedCount === 1 && hasChild;\n                break;\n\n              case \"NodeReport\":\n                action.visible = selectedCount === 1 && liList[0].getAttribute(\"did\") !== \"0\";\n                break;\n\n              case \"NodeReports\":\n                action.visible = selectedCount > 1;\n                break;\n\n              case \"ToBranch\":\n                var value = liList[0].getAttribute(\"dv\");\n                var formula = liList[0].getAttribute(\"df\");\n                var hasValue = !_h.isNullOrEmpty(value) && value !== \"\" && value !== \"null\" || !_h.isNullOrEmpty(formula) && formula !== \"\" && formula !== \"null\";\n                action.visible = period && !hasValue && !consolidate && selectedCount === 1 && liList[0].getAttribute(\"dnt\") == 2;\n                break;\n\n              case \"ToLeaf\":\n                action.visible = period && selectedCount === 1 && liList[0].getElementsByTagName(\"li\").length === 0 && liList[0].getAttribute(\"dnt\") == 1 && !consolidate && !(liList[0].getAttribute(\"dnt\") == 1 && liList[0].getAttribute(\"dnte\") == 1);\n                break;\n\n              case \"ExportExcel\":\n              case \"ImportExcel\":\n              case \"ExportAllExcel\":\n                action.visible = period && liList[0].getAttribute(\"dnt\") == 1 && (options.companyType === 0 && _h.contains([6, 7, 8], Number(liList[0].getAttribute(\"dtt\"))) || options.companyType === 1 && _h.contains([2, 3, 6, 7, 8], Number(liList[0].getAttribute(\"dtt\"))));\n                break;\n\n              case \"EditNode\":\n                action.visible = period;\n                break;\n\n              case \"ResetConsolidate\":\n                action.visible = period && consolidateBranch;\n                break;\n            }\n          }\n\n          if (action.name === actionTarget) target = action;\n        }\n\n        if (actionTarget) return target;\n        return actions;\n      }\n    };\n\n    var fixHelper = function fixHelper(e, ui) {\n      ui.children().each(function () {\n        $(this).width($(this).width());\n      });\n      return ui;\n    };\n\n    var onCreateNode = function onCreateNode(treeType, assignmentType, accountType, companyId) {\n      var el = treeEditor.getSelectedElements();\n      var tree = treeEditor.getTree();\n      var options = treeEditor.getOptions();\n      if (!options.permitPeriodEdit) return;\n\n      var uid = \"U-\" + _h.createRandomNumber();\n\n      var ul, dep, liCount, obj;\n\n      if (el && el.length === 1) {\n        el = el[0];\n        if (el.getAttribute(\"dnt\") === \"2\") return;\n        ul = el.getElementsByTagName(\"ul\")[0];\n        dep = ul.getAttribute(\"dep\");\n        liCount = $(ul).find(\"li[dep='\" + (Number(dep) + 1) + \"']\").length;\n        obj = {\n          id: 0,\n          uid: uid,\n          ri: tree.getAttribute(\"tv-rootid\"),\n          pi: el.getAttribute(\"did\"),\n          co: \"\",\n          nt: 2,\n          as: el.getAttribute(\"das\"),\n          tt: el.getAttribute(\"dtt\"),\n          at: el.getAttribute(\"dat\"),\n          cfc: el.getAttribute(\"dcfc\"),\n          f: \"\",\n          v: \"\",\n          na: \"گره جدید\",\n          ci: el.getAttribute(\"dci\"),\n          nte: null,\n          cc: el.getAttribute(\"dcc\"),\n          pr: liCount + 1,\n          children: []\n        };\n      } else {\n        ul = tree;\n        liCount = $(ul).find(\"li[dep='\" + 1 + \"']\").length;\n        obj = {\n          id: 0,\n          uid: uid,\n          ri: tree.getAttribute(\"tv-rootid\"),\n          pi: tree.getAttribute(\"tv-rootid\"),\n          co: \"\",\n          nt: 2,\n          as: assignmentType,\n          tt: treeType,\n          at: accountType,\n          cfc: treeType === 1 ? 1 : 0,\n          f: \"\",\n          v: \"\",\n          na: \"گره جدید\",\n          ci: companyId,\n          nte: null,\n          cc: null,\n          pr: liCount + 1,\n          children: []\n        };\n      }\n\n      buildEditorRow(ul, obj, options);\n      options.actions.onCallbackAction();\n    };\n\n    var onEditNode = function onEditNode(li) {\n      if (li.length > 1) return;\n      if (HTMLCollection.prototype.isPrototypeOf(li)) li = li[0];\n      var tree = treeEditor.getTree();\n      var options = treeEditor.getOptions(tree);\n      var object = treeEditor.collectObj(li);\n\n      var parent = _hh.getClosest(li, \"li\");\n\n      object.parentNodeTemplate = parent.getAttribute(\"dnte\") === \"null\" ? null : Number(parent.getAttribute(\"dnte\"));\n      object.pId = Number(parent.getAttribute(\"did\"));\n      options.actions.onEditNode(li, object);\n    };\n\n    var onSort = function onSort(li, save) {\n      var options = treeEditor.getOptions();\n      if (!options.permitPeriodEdit) return;\n      var ul;\n\n      if (li.length > 0 && li[0].nodeName === \"UL\") {\n        ul = li[0];\n      } else if (save !== undefined) ul = treeEditor.getTree(li).getElementsByClassName(\"ui-sortable\")[0];else ul = $(li).find(\"ul\")[0];\n\n      if (!$(ul).hasClass(\"ui-sortable\")) {\n        $(ul).sortable({\n          _h: fixHelper\n        }).disableSelection();\n        setTimeout(function () {\n          options.actions.onCallbackAction();\n        }, 100);\n      } else {\n        if (save) {\n          var dep = $(ul).attr(\"dep\");\n          if (!dep) dep = 0;\n          var liList = $(ul).find(\"li[dep='\" + (Number(dep) + 1) + \"']\");\n\n          for (var i = 0; i < liList.length; i++) {\n            liList[i].setAttribute(\"dpr\", i + 1);\n          }\n        } else {\n          var newLiList = $(ul.innerHTML);\n          ul.innerHTML = \"\";\n\n          for (var j = 0; j < newLiList.length; j++) {\n            ul.innerHTML += newLiList[j].outerHTML;\n          }\n        }\n\n        var tagList = $(\".ui-sortable-handle\");\n        if (tagList && tagList.length) for (var k = 0; k < tagList.length; k++) {\n          treeEditor.resetEventHandlers(tagList[k]);\n        }\n        $(ul).sortable(\"destroy\");\n        $(\".ui-sortable-handle\").removeClass(\"ui-sortable-handle\");\n        options.actions.onCallbackAction();\n      }\n    };\n\n    var onCancel = function onCancel(li) {\n      var options = treeEditor.getOptions();\n      var inComplex = treeEditor.inComplexStatus();\n      if (inComplex.sort) treeEditor.onSort(li, false);\n\n      if (inComplex.copy || inComplex.cut) {\n        var tree = treeEditor.getTree();\n        $(tree).find(\"li\").removeClass(\"copy-el cut-el paste-target\");\n      }\n\n      options.actions.onCallbackAction();\n    };\n\n    var onSaveSort = function onSaveSort(li) {\n      treeEditor.onSort(li, true);\n    };\n\n    var onCopy = function onCopy() {\n      if (!treeEditor.canCutCopy()) return;\n      var list = treeEditor.getSelectedElements();\n\n      for (var i = 0; i < list.length; i++) {\n        list[i].classList.add(\"copy-el\");\n      }\n\n      treeEditor.getOptions().actions.onCallbackAction();\n    };\n\n    var onCut = function onCut() {\n      if (!treeEditor.canCutCopy()) return;\n      var list = treeEditor.getSelectedElements();\n\n      for (var i = 0; i < list.length; i++) {\n        list[i].classList.add(\"cut-el\");\n      }\n\n      treeEditor.getOptions().actions.onCallbackAction();\n    };\n\n    var canCutCopy = function canCutCopy() {\n      var tree = treeEditor.getTree();\n      var newList = $(tree).find(\"li[did='0']\");\n      var changedList = $(tree).find(\"li[dcng='true']\");\n\n      if (newList.length || changedList.length) {\n        var text = _h.getApiMessage(\"NodeEditorUnableToCopy\");\n\n        _h.failToast(text);\n\n        return false;\n      }\n\n      return true;\n    };\n\n    var onToBranch = function onToBranch() {\n      var options = treeEditor.getOptions();\n      var li = treeEditor.getSelectedElements();\n\n      if (li.length === 1 && li[0].getAttribute(\"did\") !== \"0\") {\n        options.actions.onToBranch();\n      } else {\n        li = li[0];\n        li.setAttribute(\"dnt\", \"1\");\n        var span = li.getElementsByClassName(\"dmn-att\")[0];\n        span.className = \"dmn-p fa fa-plus\";\n        li.getElementsByTagName(\"ul\")[0].className = \"dmn-c\";\n        var folderI = document.createElement(\"i\");\n\n        _hh.setClassName(folderI, \"dmn-fld fa fa-folder\");\n\n        $(folderI).insertAfter(span);\n\n        span.onclick = function () {\n          tUtil.toggleShowChildren(this);\n        };\n      }\n    };\n\n    var onToLeaf = function onToLeaf() {\n      var options = treeEditor.getOptions();\n      var li = treeEditor.getSelectedElements();\n\n      if (li.length === 1 && li[0].getAttribute(\"did\") !== \"0\") {\n        options.actions.onToBranch();\n      } else {\n        li = li[0];\n        li.setAttribute(\"dnt\", \"2\");\n        var span = li.getElementsByClassName(\"dmn-p\")[0];\n        span.className = \"dmn-att fa fa-file-text-o\";\n        var ul = li.getElementsByTagName(\"ul\")[0];\n        ul.className = \"dmn-c\";\n        ul.innerHTML = \"\";\n        var folderI = li.getElementsByClassName(\"dmn-fld\")[0];\n\n        _hh.removeElement(folderI);\n      }\n    };\n\n    var onDeleteNode = function onDeleteNode() {\n      treeEditor.onDeleteNodes();\n    };\n\n    var onDeleteNodes = function onDeleteNodes() {\n      var tree = treeEditor.getTree();\n      var options = treeEditor.getOptions();\n      var list = $(tree).find(\"li.dmn-selected[did='0']\");\n      var serverlist = $(tree).find(\"li.dmn-selected[did!='0']\");\n\n      if (list.length) {\n        for (var i = 0; i < list.length; i++) {\n          _hh.removeElement(list[i]);\n        }\n\n        _h.kocnx().treevm().onCallbackAction();\n      }\n\n      if (serverlist.length) options.actions.onDeleteNode();\n    };\n\n    var onResetConsolidate = function onResetConsolidate() {\n      var options = treeEditor.getOptions();\n      var li = treeEditor.getSelectedElements();\n      if (li.length === 1 && li[0].getAttribute(\"did\") !== \"0\") options.actions.onResetConsolidate(li[0].getAttribute(\"did\"));\n    };\n\n    var inComplexStatus = function inComplexStatus() {\n      var tree = treeEditor.getTree();\n      var sort = tree.getElementsByClassName(\"ui-sortable\").length > 0;\n      if (_hh.hasClass(tree, \"ui-sortable\")) sort = true;\n      var copy = tree.getElementsByClassName(\"copy-el\").length > 0;\n      var cut = tree.getElementsByClassName(\"cut-el\").length > 0;\n      return {\n        all: sort || cut || copy,\n        sort: sort,\n        cut: cut,\n        copy: copy\n      };\n    };\n\n    return {\n      onDeleteNode: onDeleteNode,\n      onDeleteNodes: onDeleteNodes,\n      canCutCopy: canCutCopy,\n      buildEditorRow: buildEditorRow,\n      getAllowedActions: getAllowedActions,\n      getMenu: getMenu,\n      onCreateNode: onCreateNode,\n      disposeMenu: disposeMenu,\n      toggleSelectedTag: toggleSelectedTag,\n      getTree: getTree,\n      getOptions: getOptions,\n      onSort: onSort,\n      onCancel: onCancel,\n      onSaveSort: onSaveSort,\n      onToBranch: onToBranch,\n      onToLeaf: onToLeaf,\n      inComplexStatus: inComplexStatus,\n      getSelectedElements: getSelectedElements,\n      onCopy: onCopy,\n      onEditNode: onEditNode,\n      collectObj: collectObj,\n      onCut: onCut,\n      setErrors: setErrors,\n      eventHandlers: eventHandlers,\n      resetEventHandlers: resetEventHandlers,\n      onResetConsolidate: onResetConsolidate\n    };\n  }();\n\n  $.fn.treeView = function (methodOrOptions) {\n    if (tVMethods[methodOrOptions]) {\n      return tVMethods[methodOrOptions].apply(this, Array.prototype.slice.call(arguments, 1));\n    } else if (_typeof(methodOrOptions) === 'object' || !methodOrOptions) {\n      return tVMethods.init.apply(this, arguments);\n    } else {\n      $.error('Method ' + methodOrOptions + ' does not exist on jQuery.treeView');\n    }\n  };\n\n  $.fn.treeView.options = {\n    instances: []\n  };\n})(jQuery);\n\n//# sourceURL=webpack://domino/./src/scripts/components/jqtreeview.js?");

/***/ }),

/***/ "./src/scripts/components/jsRuler.js":
/*!*******************************************!*\
  !*** ./src/scripts/components/jsRuler.js ***!
  \*******************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";
eval("/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n\n\nvar ruler = function ruler(options) {\n  this.api = this.builder();\n  this.api.constructRulers.call(this, options);\n};\n\nruler.prototype.builder = function () {\n  var VERTICAL = 1,\n      HORIZONTAL = 2,\n      CUR_DELTA_X = 0,\n      CUR_DELTA_Y = 0,\n      CUR_SCALE = 1;\n  var options,\n      rulerz = {},\n      guides = [],\n      theRulerDOM = document.createElement('div'),\n      corners = [],\n      defaultOptions = {\n    rulerHeight: 15,\n    fontFamily: 'arial',\n    fontSize: '8px',\n    strokeStyle: 'gray',\n    sides: ['top', 'right'],\n    cornerSides: ['TR'],\n    lineWidth: 1,\n    enableMouseTracking: true,\n    enableToolTip: true\n  };\n\n  var positionRuler = function positionRuler(orientation, alignment) {\n    var rulWrapper = document.getElementsByClassName('active-page')[0].parentNode.getElementsByClassName(\"rul_wrapper\")[0];\n    var main = document.getElementsByClassName('active-page')[0].getElementsByClassName(\" main\")[0];\n\n    var pos = _h.getPosition(rulWrapper);\n\n    var pos2 = _h.getPosition(main);\n\n    var res2 = (pos.width - pos2.width) / 2 - 36;\n\n    switch (alignment) {\n      case 'top':\n        var horRuler = document.getElementsByClassName(\"ruler-hor\")[0];\n\n        if (orientation === \"Landscape\") {\n          horRuler.style.top = 0 + \"px\";\n          horRuler.style.left = res2 + \"px\";\n        } else {\n          horRuler.style.top = 0 + \"px\";\n          horRuler.style.left = res2 + \"px\";\n        }\n\n        break;\n\n      case 'right':\n        var verRuler = document.getElementsByClassName(\"ruler-ver\")[0];\n\n        if (orientation === \"Landscape\") {\n          verRuler.style.top = 553 + \"px\";\n          verRuler.style.right = -541 + \"px\";\n        } else {\n          verRuler.style.top = 553 + \"px\";\n          verRuler.style.right = -541 + \"px\";\n        }\n\n        break;\n    }\n  };\n\n  var getDimension = function getDimension(target) {\n    if (!target.classList.contains(\"ruler\")) {\n      var parent = target.parentNode;\n\n      if (!parent.classList.contains(\"ruler\")) {\n        var parent2 = parent.parentNode;\n\n        if (parent2.classList.contains(\"ruler\")) {\n          if (parent2.classList.contains(\"ruler-ver\")) return 1;else return 2;\n        }\n      } else {\n        if (parent.classList.contains(\"ruler-ver\")) return 1;else return 2;\n      }\n    } else {\n      if (target.classList.contains(\"ruler-ver\")) return 1;else return 2;\n    }\n  };\n\n  var attachListeners = function attachListeners(container, curRul) {\n    var mousedown = function mousedown(e) {\n      var dimension = getDimension(e.target);\n      constructGuide(dimension, e.clientX, e.clientY, e);\n    };\n\n    curRul.target.addEventListener('mousedown', mousedown);\n\n    curRul.clearListeners = function () {\n      container.removeEventListener('mousedown', mousedown);\n    };\n  };\n\n  var constructGuide = function constructGuide(dimension, x, y, e, isSet) {\n    var guideIndex;\n\n    var moveCB = function moveCB(line, x, y) {\n      var coor;\n\n      if (line.dimension === VERTICAL) {\n        coor = theRulerDOM.offsetWidth - x;\n      } else {\n        coor = y;\n      }\n\n      if (!line.assigned()) {\n        if (coor > options.rulerHeight) {\n          line.assigned(true);\n        }\n\n        return;\n      }\n\n      if (coor < options.rulerHeight) {\n        guides.some(function (guideLine, index) {\n          if (guideLine.line === line) {\n            guideIndex = index;\n            return true;\n          }\n        });\n        line.destroy();\n        guides.splice(guideIndex, 1);\n      }\n    };\n\n    var guide = document.createElement('div'),\n        guideStyle = dimension === VERTICAL ? 'rul_lineVer' : 'rul_lineHor',\n        curDelta = dimension === VERTICAL ? CUR_DELTA_X : CUR_DELTA_Y;\n    guide.title = 'Double click to delete';\n    ruler.prototype.utils.addClasss(guide, ['rul_line', guideStyle]);\n    guide = theRulerDOM.appendChild(guide);\n\n    if (dimension === VERTICAL) {\n      guide.style.left = ruler.prototype.utils.pixelize(x - options.container.getBoundingClientRect().left);\n      if (isSet) guide.style.left = ruler.prototype.utils.pixelize(Math.round(x / CUR_SCALE) + options.rulerHeight);\n    } else {\n      guide.style.top = ruler.prototype.utils.pixelize(y - options.container.getBoundingClientRect().top);\n      if (isSet) guide.style.top = ruler.prototype.utils.pixelize(Math.round(y / CUR_SCALE) + options.rulerHeight);\n    }\n\n    guides.push({\n      dimension: dimension,\n      line: ruler.prototype.guideLine(guide, options.container.querySelector('.rul_wrapper'), dimension, options, curDelta, moveCB, e)\n    });\n  };\n\n  var constructRuler = function constructRuler(container, alignment) {\n    var dimension = alignment === 'left' || alignment === 'right' ? VERTICAL : HORIZONTAL,\n        rulerStyle = dimension === VERTICAL ? 'rul_ruler_Vertical' : 'rul_ruler_Horizontal';\n    var div = ruler.prototype.utils.createEl(\"div\", container);\n    rulerz[alignment] = ruler.prototype.rulerConstructor(div, options, dimension);\n    rulerz[alignment].drawRuler(dimension, options.size); //positionRuler(rulerz[alignment], alignment);\n\n    attachListeners(container, rulerz[alignment]);\n  };\n\n  var constructCorner = function () {\n    function cornerDraw(container, side) {\n      var corner = document.createElement('div'),\n          cornerStyle = 'rul_corner' + side.toUpperCase();\n      corner.title = 'حذف تمام خطوط';\n      ruler.prototype.utils.addClasss(corner, ['rul_corner', cornerStyle]);\n      corner.style.width = ruler.prototype.utils.pixelize(options.rulerHeight + 1);\n      corner.style.height = ruler.prototype.utils.pixelize(options.rulerHeight);\n      return container.appendChild(corner);\n    }\n\n    function mousedown(e) {\n      e.stopPropagation();\n      clearGuides();\n    }\n\n    return function (container, cornerSides) {\n      cornerSides.forEach(function (side) {\n        var corner = cornerDraw(container, side);\n        corner.addEventListener('mousedown', mousedown);\n\n        corner.destroy = function () {\n          corner.removeEventListener('mousedown', mousedown);\n          if (corner.parentNode) corner.parentNode.removeChild(corner);\n        };\n\n        corners.push(corner);\n      });\n    };\n  }();\n\n  var mouseup = function mouseup(e) {\n    guides.forEach(function (guide) {\n      guide.line.stopDrag();\n    });\n  };\n\n  var changeOrientation = function changeOrientation(orientation) {\n    options.sides.forEach(function (side) {\n      positionRuler(orientation, side);\n    });\n  };\n\n  var constructRulers = function constructRulers(curOptions) {\n    theRulerDOM = ruler.prototype.utils.addClasss(theRulerDOM, 'rul_wrapper');\n    options = ruler.prototype.utils.extend(defaultOptions, curOptions);\n    theRulerDOM = options.container.appendChild(theRulerDOM);\n    options.sides.forEach(function (side) {\n      constructRuler(theRulerDOM, side);\n      positionRuler(options.orientation, side);\n    });\n    constructCorner(theRulerDOM, options.cornerSides);\n    options.container.addEventListener('mouseup', mouseup);\n  };\n\n  var forEachRuler = function forEachRuler(cb) {\n    var index = 0;\n\n    for (var rul in rulerz) {\n      if (rulerz.hasOwnProperty(rul)) {\n        cb(rulerz[rul], index++);\n      }\n    }\n  };\n\n  var clearGuides = function clearGuides() {\n    guides.forEach(function (guide) {\n      guide.line.destroy();\n    });\n    guides = [];\n  };\n\n  var toggleGuideVisibility = function toggleGuideVisibility(val) {\n    var func = val ? 'show' : 'hide';\n    guides.forEach(function (guide) {\n      guide.line[func]();\n    });\n  };\n\n  var toggleRulerVisibility = function toggleRulerVisibility(val) {\n    var state = val ? 'block' : 'none';\n    theRulerDOM.style.display = state;\n    var trackers = options.container.querySelectorAll('.rul_tracker');\n\n    if (trackers.length > 0) {\n      trackers[0].style.display = state;\n      trackers[1].style.display = state;\n    }\n  };\n\n  var getGuides = function getGuides() {\n    return guides.map(function (guide) {\n      return {\n        posX: Math.round((parseInt(guide.line.guideLine.style.left) - CUR_DELTA_X - options.rulerHeight) * CUR_SCALE),\n        posY: Math.round((parseInt(guide.line.guideLine.style.top) - CUR_DELTA_Y - options.rulerHeight) * CUR_SCALE),\n        dimension: guide.dimension\n      };\n    });\n  };\n\n  var setGuides = function setGuides(_guides) {\n    if (!_guides) {\n      return;\n    }\n\n    _guides.forEach(function (guide) {\n      constructGuide(guide.dimension, guide.posX, guide.posY, null, true);\n    });\n  };\n\n  var destroy = function destroy() {\n    clearGuides();\n    forEachRuler(function (ruler) {\n      ruler.destroy();\n    });\n    var rullers = document.getElementsByClassName(\"ruler\");\n    if (rullers.length) rullers[0].remove();\n    if (rullers.length) rullers[0].remove();\n    corners.forEach(function (corner) {\n      corner.destroy();\n    });\n    options.container.removeEventListener('mouseup', mouseup);\n    if (theRulerDOM.parentNode) theRulerDOM.parentNode.removeChild(theRulerDOM);\n  };\n\n  return {\n    VERTICAL: VERTICAL,\n    HORIZONTAL: HORIZONTAL,\n    clearGuides: clearGuides,\n    getGuides: getGuides,\n    setGuides: setGuides,\n    constructRulers: constructRulers,\n    toggleRulerVisibility: toggleRulerVisibility,\n    toggleGuideVisibility: toggleGuideVisibility,\n    changeOrientation: changeOrientation,\n    destroy: destroy\n  };\n};\n\nruler.prototype.rulerConstructor = function (_target, options, rulDimension) {\n  var target = _target,\n      rulThickness = 0,\n      orientation = options.orientation,\n      size = options.size,\n      rulLength = 0,\n      rulScale = 1,\n      dimension = rulDimension || 2,\n      orgPos = 0,\n      tracker = document.createElement('div');\n\n  var getLength = function getLength() {\n    return rulLength;\n  };\n\n  var getThickness = function getThickness() {\n    return rulThickness;\n  };\n\n  var getScale = function getScale() {\n    return rulScale;\n  };\n\n  var setScale = function setScale(newScale) {\n    rulScale = parseFloat(newScale);\n    drawPoints();\n    return rulScale;\n  };\n\n  var drawRuler = function drawRuler(dimension, size) {\n    rulLength = target.offsetWidth;\n    var topLength = 0,\n        rightLength = 0,\n        cmDiv,\n        mmDiv;\n\n    switch (size) {\n      case \"A4\":\n        if (orientation === \"Landscape\") {\n          topLength = 30;\n          rightLength = 21;\n        } else {\n          topLength = 21;\n          rightLength = 30;\n        }\n\n        break;\n\n      case \"A3\":\n        break;\n    }\n\n    if (dimension === 1) {\n      ruler.prototype.utils.addClasss(target, [\"ruler\", \"ruler-ver\"]);\n\n      for (var k = 0; k < rightLength; k++) {\n        cmDiv = ruler.prototype.utils.createEl(\"div\", target);\n        ruler.prototype.utils.addClasss(cmDiv, \"cm\");\n\n        for (var b = 0; b < 9; b++) {\n          mmDiv = ruler.prototype.utils.createEl(\"div\", cmDiv);\n          ruler.prototype.utils.addClasss(mmDiv, [\"mm\"]);\n        }\n      }\n    } else {\n      ruler.prototype.utils.addClasss(target, [\"ruler\", \"ruler-hor\"]);\n\n      for (var i = 0; i < topLength; i++) {\n        cmDiv = ruler.prototype.utils.createEl(\"div\", target);\n        ruler.prototype.utils.addClasss(cmDiv, \"cm\");\n\n        for (var j = 0; j < 9; j++) {\n          mmDiv = ruler.prototype.utils.createEl(\"div\", cmDiv);\n          ruler.prototype.utils.addClasss(mmDiv, \"mm\");\n        }\n      }\n    }\n  };\n\n  var mousemove = function mousemove(e) {\n    var posX = e.clientX;\n    var posY = e.clientY;\n\n    if (dimension === 2) {\n      tracker.style.left = ruler.prototype.utils.pixelize(posX - parseInt(options.container.getBoundingClientRect().left));\n    } else {\n      tracker.style.top = ruler.prototype.utils.pixelize(posY - parseInt(options.container.getBoundingClientRect().top));\n    }\n  };\n\n  var destroy = function destroy() {\n    options.container.removeEventListener('mousemove', mousemove);\n    if (tracker.parentNode) tracker.parentNode.removeChild(tracker);\n    this.clearListeners && this.clearListeners();\n  };\n\n  var initTracker = function initTracker() {\n    tracker = options.container.appendChild(tracker);\n    ruler.prototype.utils.addClasss(tracker, 'rul_tracker');\n    var height = ruler.prototype.utils.pixelize(options.rulerHeight);\n\n    if (dimension === 2) {\n      tracker.style.height = height;\n    } else {\n      tracker.style.width = height;\n    }\n\n    options.container.addEventListener('mousemove', mousemove);\n  };\n\n  if (options.enableMouseTracking) {\n    initTracker();\n  }\n\n  return {\n    target: target,\n    getLength: getLength,\n    getThickness: getThickness,\n    getScale: getScale,\n    setScale: setScale,\n    dimension: dimension,\n    orgPos: orgPos,\n    drawRuler: drawRuler,\n    destroy: destroy\n  };\n};\n\nruler.prototype.guideLine = function (line, _dragContainer, lineDimension, options, curDelta, moveCB, event) {\n  var self,\n      guideLine = line,\n      _curScale = 1,\n      _assigned = false,\n      orientation = options.orientation,\n      size = options.size,\n      _curPosDelta = curDelta || 0,\n      dragContainer = _dragContainer,\n      dimension = lineDimension || 2,\n      moveCB = moveCB || function () {};\n\n  var curPosDelta = function curPosDelta(val) {\n    if (typeof val === 'undefined') {\n      return _curPosDelta;\n    }\n\n    return _curPosDelta = val;\n  };\n\n  var assigned = function assigned(val) {\n    if (typeof val === 'undefined') {\n      return _assigned;\n    }\n\n    return _assigned = val;\n  };\n\n  var curScale = function curScale(val) {\n    if (typeof val === 'undefined') {\n      return _curScale;\n    }\n\n    return _curScale = val;\n  };\n\n  var draggable = function () {\n    return {\n      move: function move(xpos, ypos) {\n        guideLine.style.left = ruler.prototype.utils.pixelize(xpos);\n        guideLine.style.top = ruler.prototype.utils.pixelize(ypos); //updateToolTip(xpos, ypos);\n\n        moveCB(self, xpos, ypos);\n      },\n      startMoving: function startMoving(evt) {\n        ruler.prototype.utils.addClasss(guideLine, ['rul_line_dragged']);\n        evt = evt || window.event;\n        var offsetHeight;\n\n        switch (size) {\n          case \"A4\":\n            if (orientation === \"Landscape\") {\n              offsetHeight = 794;\n            } else {\n              offsetHeight = 1123;\n            }\n\n            break;\n\n          case \"A3\":\n            break;\n        }\n\n        var posX = evt ? evt.clientX : 0,\n            posY = evt ? evt.clientY : 0,\n            divTop = parseInt(guideLine.style.top || 0),\n            divLeft = parseInt(guideLine.style.left || 0),\n            eWi = parseInt(guideLine.offsetWidth),\n            eHe = parseInt(guideLine.offsetHeight),\n            cWi = parseInt(dragContainer.offsetWidth),\n            cHe = parseInt(offsetHeight),\n            cursor = dimension === 2 ? 'ns-resize' : 'ew-resize';\n        options.container.style.cursor = cursor;\n        guideLine.style.cursor = cursor;\n        var diffX = posX - divLeft,\n            diffY = posY - divTop;\n\n        document.onmousemove = function moving(evt) {\n          evt = evt || window.event;\n          var posX = evt.clientX,\n              posY = evt.clientY,\n              aX = posX - diffX,\n              aY = posY - diffY;\n\n          if (aX < 0) {\n            aX = 0;\n          }\n\n          if (aY < 0) {\n            aY = 0;\n          }\n\n          if (aX + eWi > cWi) {\n            aX = cWi - eWi;\n          }\n\n          if (aY + eHe > cHe) {\n            aY = cHe - eHe;\n          }\n\n          draggable.move(aX, aY);\n        };\n\n        showToolTip();\n      },\n      stopMoving: function stopMoving() {\n        options.container.style.cursor = null;\n        guideLine.style.cursor = null;\n        $(guideLine).trigger('guideLineMove');\n\n        document.onmousemove = function () {};\n\n        hideToolTip();\n        ruler.prototype.utils.removeClasss(guideLine, ['rul_line_dragged']);\n      }\n    };\n  }();\n\n  var showToolTip = function showToolTip(e) {\n    if (!options.enableToolTip) {\n      return;\n    }\n\n    ruler.prototype.utils.addClasss(guideLine, 'rul_tooltip');\n  };\n\n  var updateToolTip = function updateToolTip(x, y) {\n    if (y) {\n      guideLine.dataset.tip = 'Y: ' + Math.round((y - options.rulerHeight - 1 - _curPosDelta) * _curScale) + ' px';\n    } else {\n      guideLine.dataset.tip = 'X: ' + Math.round((x - options.rulerHeight - 1 - _curPosDelta) * _curScale) + ' px';\n    }\n  };\n\n  var hideToolTip = function hideToolTip(e) {\n    ruler.prototype.utils.removeClasss(guideLine, 'rul_tooltip');\n  };\n\n  var destroy = function destroy() {\n    draggable.stopMoving();\n    moveCB = null;\n    guideLine.removeEventListener('mousedown', mousedown);\n    guideLine.removeEventListener('mouseup', mouseup);\n    guideLine.removeEventListener('dblclick', dblclick);\n    guideLine.parentNode && guideLine.parentNode.removeChild(guideLine);\n  };\n\n  var hide = function hide() {\n    guideLine.style.display = 'none';\n  };\n\n  var show = function show() {\n    guideLine.style.display = 'block';\n  };\n\n  var mousedown = function mousedown(e) {\n    e.stopPropagation();\n    draggable.startMoving();\n  };\n\n  var mouseup = function mouseup(e) {\n    draggable.stopMoving();\n  };\n\n  var dblclick = function dblclick(e) {\n    e.stopPropagation();\n    destroy();\n  };\n\n  guideLine.addEventListener('mousedown', mousedown);\n  guideLine.addEventListener('mouseup', mouseup);\n  guideLine.addEventListener('dblclick', dblclick);\n  if (event) draggable.startMoving(event);\n  self = {\n    setAsDraggable: draggable,\n    startDrag: draggable.startMoving,\n    stopDrag: draggable.stopMoving,\n    destroy: destroy,\n    curScale: curScale,\n    assigned: assigned,\n    curPosDelta: curPosDelta,\n    guideLine: guideLine,\n    dimension: dimension,\n    hide: hide,\n    show: show\n  };\n  return self;\n};\n\nruler.prototype.utils = {\n  extend: function extend() {\n    for (var i = 1; i < arguments.length; i++) {\n      for (var key in arguments[i]) {\n        if (arguments[i].hasOwnProperty(key)) arguments[0][key] = arguments[i][key];\n      }\n    }\n\n    return arguments[0];\n  },\n  prependChild: function prependChild(container, element) {\n    return container.insertBefore(element, container.firstChild);\n  },\n  addClasss: function addClasss(element, classNames) {\n    if (!(classNames instanceof Array)) {\n      classNames = [classNames];\n    }\n\n    classNames.forEach(function (name) {\n      element.className += ' ' + name;\n    });\n    return element;\n  },\n  removeClasss: function removeClasss(element, classNames) {\n    var curCalsss = element.className;\n\n    if (!(classNames instanceof Array)) {\n      classNames = [classNames];\n    }\n\n    classNames.forEach(function (name) {\n      curCalsss = curCalsss.replace(name, '');\n    });\n    element.className = curCalsss;\n    return element;\n  },\n  createEl: function createEl(tag, parent) {\n    var element = document.createElement(tag);\n    if (parent) parent.appendChild(element);\n    return element;\n  },\n  pixelize: function pixelize(val) {\n    return val + 'px';\n  },\n  setAttributes: function setAttributes(el, args) {\n    for (var k in args) {\n      if (args.hasOwnProperty(k)) {\n        var val = args[k];\n        el.setAttribute(k, val);\n      }\n    }\n  }\n};\nmodule.exports = ruler;\n\n//# sourceURL=webpack://domino/./src/scripts/components/jsRuler.js?");

/***/ }),

/***/ "./src/scripts/components/ko-autocomplete.js":
/*!***************************************************!*\
  !*** ./src/scripts/components/ko-autocomplete.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n\nko.components.register('ko-autocomplete', {\n  viewModel: function viewModel(params) {\n    var self = this;\n    self.type = params.type;\n    self.template = \"none\";\n    self.controlName = ko.observable(params.name);\n    self.parentForm = params.parent;\n    self.params = params;\n\n    self.getData = function (term) {\n      var model = {\n        searchKey: term\n      };\n\n      if (_h.isNullOrEmpty(term) || term === \"\") {\n        self.list.removeAll();\n        return;\n      }\n\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/dynamicdocument/getaccountcodeautocomplete\",\n        data: model,\n        success: function success(data) {\n          self.list.removeAll();\n\n          if (_h.any(data)) {\n            for (var i = 0; i < data.length; i++) {\n              if (self.selectedItems().length > 0) {\n                var val = data[i].value;\n                var result = self.selectedItems().filter(function (obj) {\n                  return obj.value === val;\n                })[0];\n                if (_h.isNullOrEmpty(result)) self.list.push(data[i]);\n              } else {\n                self.list.push(data[i]);\n              }\n            }\n\n            self.showMenu(true);\n          } else {\n            self.showMenu(false);\n          }\n        },\n        error: function error(data) {}\n      });\n    };\n\n    self.showMenu = ko.observable(false);\n\n    if (ko.isObservable(params.value)) {\n      self.value = params.value;\n    } else {\n      self.value = ko.observable(params.value);\n    }\n\n    self.selectedItems = ko.observableArray();\n\n    if (params[\"values\"] && params.values().length > 0) {\n      for (var j = 0; j < params.values().length; j++) {\n        self.selectedItems.push(params.values()[j]);\n      }\n    }\n\n    self.list = ko.observableArray();\n    self.placeHolder = _h.getLocalizedText(\"codePlaceholder\");\n\n    self.toggleFocus = function (model, e) {\n      if (self.parentForm[\"setActiveFocus\"]) {\n        var name = $(e.currentTarget).attr(\"name\");\n        self.parentForm.setActiveFocus(name);\n      }\n    };\n\n    self.removeSelectedItem = function (item) {\n      self.selectedItems.remove(item);\n      self.list.unshift(item);\n      self.value(undefined);\n      self.parentForm.onSelectAutocomplete(self.controlName(), self.selectedItems());\n    };\n\n    self.onDblClick = function () {\n      if (self.list().length > 0) {\n        self.showMenu(!self.showMenu());\n      }\n\n      if (self.list().length === 0) {\n        self.showMenu(false);\n      }\n    };\n\n    self.onKeypress = function (model, evt) {\n      var charCode = evt.which ? evt.which : evt.keyCode;\n\n      if (charCode === 13) {\n        setTimeout(function () {\n          self.getData(self.value());\n        }, 100);\n      } else {\n        if (self.type !== \"multi\") {\n          if (!$(evt.target).val()) {\n            self.parentForm.onSelectAutocomplete(self.controlName(), undefined);\n          }\n        } else {\n          if ($(evt.target).val() && $(evt.target).val().length > 1) {\n            $(evt.target).css(\"width\", $(evt.target).val().length * 7 + 4 + \"px\");\n          } else if ($(evt.target).val() && $(evt.target).val().length === 1) {\n            $(evt.target).css(\"width\", \"20px\");\n          } else if (!$(evt.target).val() && !self.value()) {\n            $(evt.target).css(\"width\", \"\");\n          }\n        }\n      }\n    };\n\n    self.onSelectItem = function (item) {\n      switch (self.type) {\n        case \"multi\":\n          self.selectedItems.push(item);\n          self.value(undefined);\n          self.parentForm.onSelectAutocomplete(self.controlName(), self.selectedItems());\n          break;\n\n        default:\n          self.value(item.text);\n          self.parentForm.onSelectAutocomplete(self.controlName(), item.value, item);\n          self.showMenu(false);\n          if (self.parentForm.resetAfterSelect) self.value(undefined);\n          break;\n      }\n\n      self.list.remove(item);\n    };\n\n    self.onInputFocus = function (x, e) {\n      var input = $(e.target).find(\".autocom-textbox\");\n      if (input) $(input).focus();\n    };\n  },\n  template: \"<!-- ko template: { name: 'autocomplete-component-t' } --><!-- /ko -->\"\n});\n\n//# sourceURL=webpack://domino/./src/scripts/components/ko-autocomplete.js?");

/***/ }),

/***/ "./src/scripts/components/ko-consolidate-select.js":
/*!*********************************************************!*\
  !*** ./src/scripts/components/ko-consolidate-select.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var _hh = __webpack_require__(/*! ./src/scripts/util/htmlHelper.js */ \"./src/scripts/util/htmlHelper.js\");\n\nko.components.register('ko-consolidate-select', {\n  viewModel: function viewModel(params) {\n    var self = this;\n    self.randomId = _h.createRandomNumber();\n    self.companyId = params.companyId;\n    self.id = \"consolidate-select-ul\" + self.randomId;\n    self.parentForm = params.parent;\n\n    if (params.disable === true) {\n      self.disable = ko.observable(true);\n    } else if (!_h.isNullOrEmpty(params.disable)) {\n      self.disable = params.disable;\n    } else {\n      self.disable = ko.observable(false);\n    }\n\n    self.list = ko.observableArray();\n\n    self.getConsolidateCompanies = function () {\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"getCompanyOwnership\",\n        data: {\n          id: self.companyId()\n        },\n        success: function success(data) {\n          self.list.removeAll();\n          if (data) self.list.push(data);\n        },\n        error: function error(data) {\n          toast.error(\"Company\", 'getSelectList');\n        }\n      });\n    };\n\n    self.params = params;\n    self.value = params.value;\n    self.input = ko.observable();\n    self.refreshSign = ko.observable(false);\n    self.showMenu = ko.observable(false);\n    self.placeHolder = _h.getLocalizedText(\"selectConsolidatePlaceholder\");\n    self.input.subscribe(function (newValue) {\n      self.buildList();\n    });\n\n    self.onSelectItem = function (item) {\n      self.input(undefined);\n      self.showMenu(false);\n      self.parentForm.onConsolidateSelect(item);\n    };\n\n    self.onInputFocus = function (x, e) {\n      if (self.disable()) {\n        self.showMenu(false);\n        return;\n      }\n\n      var visList = $(\".drp-menu:visible\");\n\n      if (visList && visList.length > 0) {\n        for (var i = 0; i < visList.length; i++) {\n          if ($(visList[i]).attr(\"id\") !== self.id) {\n            var target = ko.contextFor(visList[i]);\n            if (target && target.$data && target.$data[\"showMenu\"]) target.$data.showMenu(false);\n          }\n        }\n      }\n\n      self.showMenu(true);\n      self.buildList();\n    };\n\n    self.buildList = function () {\n      var ul = document.getElementById(self.id);\n      var table = ul.getElementsByTagName(\"table\")[0];\n      if (!table) return;\n      table.innerHTML = \"\";\n      self.buildTableHeader(table);\n      var item, tr, name;\n      var list = ko.isObservable(self.list) ? self.list() : self.list;\n\n      if (list.length === 0) {\n        self.showMenu(false);\n        return;\n      }\n\n      var tbody = _hh.createElement(\"tbody\", table);\n\n      for (var i = 0; i < list.length; i++) {\n        item = ko.toJS(list[i]);\n        self.buildRow(tbody, item, true, item.children.length);\n        if (item.children.length) for (var j = 0; j < item.children.length; j++) {\n          self.buildRow(tbody, item.children[j], false);\n        }\n      }\n    };\n\n    self.buildTableHeader = function (table) {\n      var thead = _hh.createElement(\"thead\", table);\n\n      var trHead = _hh.createElement(\"tr\", thead);\n\n      var thName = _hh.createElement(\"th\", trHead);\n\n      _hh.setClassName(thName, \"consolidate-col\");\n\n      _hh.setInnerHtml(thName, \"شرکت\");\n\n      var thdirectOwnership = _hh.createElement(\"th\", trHead);\n\n      _hh.setClassName(thdirectOwnership, \"consolidate-col\");\n\n      _hh.setInnerHtml(thdirectOwnership, \"مستقیم\");\n\n      var thindirectOwnership = _hh.createElement(\"th\", trHead);\n\n      _hh.setClassName(thindirectOwnership, \"consolidate-col\");\n\n      _hh.setInnerHtml(thindirectOwnership, \"غیر مستقیم\");\n\n      var thminorityOwnership = _hh.createElement(\"th\", trHead);\n\n      _hh.setClassName(thminorityOwnership, \"consolidate-col\");\n\n      _hh.setInnerHtml(thminorityOwnership, \"اقلیت\");\n\n      var thtotalOwnership = _hh.createElement(\"th\", trHead);\n\n      _hh.setClassName(thtotalOwnership, \"consolidate-col\");\n\n      _hh.setInnerHtml(thtotalOwnership, \"کل\");\n    };\n\n    self.shortName = function (name) {\n      if (name !== null && name !== undefined) {\n        if (name.length < 40) return name;\n        return name.substr(0, 37) + \"...\";\n      }\n\n      return \"\";\n    };\n\n    self.buildRow = function (table, item, isRoot, childCount) {\n      var tr = _hh.createElement(\"tr\", table);\n\n      var nameTd = _hh.createElement(\"td\", tr);\n\n      _hh.setClassName(nameTd, \"consolidate-col \");\n\n      var spanNameTag;\n\n      if (isRoot && childCount > 0) {\n        var aTag = _hh.createElement(\"a\", nameTd);\n\n        var iTag = _hh.createElement(\"i\", aTag);\n\n        _hh.setClassName(iTag, \"fa fa-minus text-danger\");\n\n        spanNameTag = _hh.createElement(\"span\", nameTd);\n\n        _hh.setInnerHtml(spanNameTag, item.name);\n\n        spanNameTag.setAttribute(\"style\", \"margin-right: 2px;\");\n      } else if (isRoot && childCount === 0) {\n        spanNameTag = _hh.createElement(\"span\", nameTd);\n\n        _hh.setInnerHtml(spanNameTag, item.name);\n      } else if (!isRoot) {\n        _hh.setClassName(nameTd, \"pos-rel with-overflow\");\n\n        nameTd.setAttribute(\"style\", \"margin-right: 6px;\");\n\n        var divVTag = _hh.createElement(\"a\", nameTd);\n\n        _hh.setClassName(divVTag, \"consolidate-vert-line\");\n\n        divVTag.setAttribute(\"style\", \"margin-right: 6px;\");\n\n        var spanHTag = _hh.createElement(\"span\", nameTd);\n\n        _hh.setClassName(spanHTag, \"cat-horz-lg-line\");\n\n        spanHTag.setAttribute(\"style\", \"top: 15px;margin-right: 7px;\");\n        spanNameTag = _hh.createElement(\"span\", nameTd);\n        spanNameTag.setAttribute(\"style\", \"margin-right: 32px; vertical-align: middle;\");\n\n        _hh.setInnerHtml(spanNameTag, item.name);\n      }\n\n      var directOwnership = _hh.createElement(\"td\", tr);\n\n      _hh.setInnerHtml(directOwnership, item.directOwnership.text);\n\n      _hh.setClassName(directOwnership, \"consolidate-col link-underline\");\n\n      directOwnership.setAttribute(\"data-value\", item.directOwnership.value);\n\n      directOwnership.onclick = function () {\n        var val = this.getAttribute(\"data-value\");\n        self.onSelectItem({\n          text: this.innerText,\n          value: val\n        });\n      };\n\n      var indirectOwnership = _hh.createElement(\"td\", tr);\n\n      _hh.setClassName(indirectOwnership, \"consolidate-col link-underline\");\n\n      _hh.setInnerHtml(indirectOwnership, item.indirectOwnership.text);\n\n      indirectOwnership.setAttribute(\"data-value\", item.indirectOwnership.value);\n\n      indirectOwnership.onclick = function () {\n        var val = this.getAttribute(\"data-value\");\n        self.onSelectItem({\n          text: this.innerText,\n          value: val\n        });\n      };\n\n      var minorityOwnership = _hh.createElement(\"td\", tr);\n\n      _hh.setClassName(minorityOwnership, \"consolidate-col link-underline\");\n\n      _hh.setInnerHtml(minorityOwnership, item.minorityOwnership.text);\n\n      minorityOwnership.setAttribute(\"data-value\", item.minorityOwnership.value);\n\n      minorityOwnership.onclick = function () {\n        var val = this.getAttribute(\"data-value\");\n        self.onSelectItem({\n          text: this.innerText,\n          value: val\n        });\n      };\n\n      var totalOwnership = _hh.createElement(\"td\", tr);\n\n      _hh.setClassName(totalOwnership, \"consolidate-col link-underline\");\n\n      _hh.setInnerHtml(totalOwnership, item.totalOwnership.text);\n\n      totalOwnership.setAttribute(\"data-value\", item.totalOwnership.value);\n\n      totalOwnership.onclick = function () {\n        var val = this.getAttribute(\"data-value\");\n        self.onSelectItem({\n          text: this.innerText,\n          value: val\n        });\n      };\n    };\n\n    if (ko.isObservable(self.list)) {\n      self.list.subscribe(function (newValue, oldValue) {\n        self.buildList();\n      });\n    }\n\n    self.isEmpty = function (val) {\n      return val === null || val === undefined || val === \"\";\n    };\n\n    self.getConsolidateCompanies();\n  },\n  template: '<div class=\"autocom-control select-control\">' + '<div class=\"autocom-input select-input\" data-bind=\"click: onInputFocus, attr:{dataid: id}\">' + '<input type=\"text\" class=\"select-textbox key-on\" autocomplete=\"off\" tabindex=\"\"  data-bind=\"textInput: input,' + 'visible: isEmpty(value()), attr: {placeholder: placeHolder}\"><!-- /ko --></div></div>' + '<ul class=\"autocom-ul select-ul drp-menu\" style=\"width: fit-content;min-width: 100%;\" data-bind=\"visible: showMenu, attr:{id : id}\">' + '<li><div class=\"row\"><div class=\"col-lg-12\">' + '<table class=\"table table-bordered table-striped ko-consolidate\" style=\"font-size: 9px;\"></table>' + '</div></div></li>' + '</ul>'\n});\n\n//# sourceURL=webpack://domino/./src/scripts/components/ko-consolidate-select.js?");

/***/ }),

/***/ "./src/scripts/components/ko-datepicker.js":
/*!*************************************************!*\
  !*** ./src/scripts/components/ko-datepicker.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var dateHelper = __webpack_require__(/*! ./src/scripts/util/dateHelper.js */ \"./src/scripts/util/dateHelper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nko.components.register('ko-datepicker', {\n  viewModel: function viewModel(params) {\n    var self = this;\n    self.params = params;\n    self.dateType = params.dateType;\n    self.selectScope = params.selectScope;\n    self.randomId = Math.random() * (10000000 - 100) + 100;\n    self.id = \"input-datepicker-\" + self.randomId;\n    self.weekDays = [{\n      fa: \"شنبه\",\n      en: \"Saturday\"\n    }, {\n      fa: \"یکشنبه\",\n      en: \"Sunday\"\n    }, {\n      fa: \"دوشنبه\",\n      en: \"Monday\"\n    }, {\n      fa: \"سه شنبه\",\n      en: \"Tuesday\"\n    }, {\n      fa: \"چهارشنبه\",\n      en: \"Wednesday\"\n    }, {\n      fa: \"پنج شنبه\",\n      en: \"Thursday\"\n    }, {\n      fa: \"جمعه\",\n      en: \"Friday\"\n    }];\n    self.months = [{\n      faName: \"فروردین\",\n      name: \"Jan\",\n      id: 1\n    }, {\n      faName: \"اردیبهشت\",\n      name: \"Feb\",\n      id: 2\n    }, {\n      faName: \"خرداد\",\n      name: \"Mar\",\n      id: 3\n    }, {\n      faName: \"تیر\",\n      name: \"Apr\",\n      id: 4\n    }, {\n      faName: \"مرداد\",\n      name: \"May\",\n      id: 5\n    }, {\n      faName: \"شهریور\",\n      name: \"Jun\",\n      id: 6\n    }, {\n      faName: \"مهر\",\n      name: \"Jul\",\n      id: 7\n    }, {\n      faName: \"آبان\",\n      name: \"Aug\",\n      id: 8\n    }, {\n      faName: \"آذر\",\n      name: \"Sep\",\n      id: 9\n    }, {\n      faName: \"دی\",\n      name: \"Oct\",\n      id: 10\n    }, {\n      faName: \"بهمن\",\n      name: \"Nov\",\n      id: 11\n    }, {\n      faName: \"اسفند\",\n      name: \"Dec\",\n      id: 12\n    }];\n    self.years = [{\n      fa: 1380,\n      en: 2001\n    }, {\n      fa: 1381,\n      en: 2002\n    }, {\n      fa: 1382,\n      en: 2003\n    }, {\n      fa: 1383,\n      en: 2004\n    }, {\n      fa: 1384,\n      en: 2005\n    }, {\n      fa: 1385,\n      en: 2006\n    }, {\n      fa: 1386,\n      en: 2007\n    }, {\n      fa: 1387,\n      en: 2008\n    }, {\n      fa: 1388,\n      en: 2009\n    }, {\n      fa: 1389,\n      en: 2010\n    }, {\n      fa: 1390,\n      en: 2011\n    }, {\n      fa: 1391,\n      en: 2012\n    }, {\n      fa: 1392,\n      en: 2013\n    }, {\n      fa: 1393,\n      en: 2014\n    }, {\n      fa: 1394,\n      en: 2015\n    }, {\n      fa: 1395,\n      en: 2016\n    }, {\n      fa: 1396,\n      en: 2017\n    }, {\n      fa: 1397,\n      en: 2018\n    }, {\n      fa: 1398,\n      en: 2019\n    }, {\n      fa: 1399,\n      en: 2020\n    }, {\n      fa: 1400,\n      en: 2021\n    }, {\n      fa: 1401,\n      en: 2022\n    }, {\n      fa: 1402,\n      en: 2023\n    }, {\n      fa: 1403,\n      en: 2024\n    }, {\n      fa: 1404,\n      en: 2025\n    }, {\n      fa: 1405,\n      en: 2026\n    }, {\n      fa: 1406,\n      en: 2027\n    }, {\n      fa: 1407,\n      en: 2028\n    }, {\n      fa: 1408,\n      en: 2029\n    }, {\n      fa: 1409,\n      en: 2030\n    }, {\n      fa: 1410,\n      en: 2031\n    }, {\n      fa: 1411,\n      en: 2032\n    }, {\n      fa: 1412,\n      en: 2033\n    }, {\n      fa: 1413,\n      en: 2034\n    }, {\n      fa: 1414,\n      en: 2035\n    }, {\n      fa: 1415,\n      en: 2036\n    }, {\n      fa: 1416,\n      en: 2037\n    }, {\n      fa: 1417,\n      en: 2038\n    }, {\n      fa: 1418,\n      en: 2039\n    }, {\n      fa: 1419,\n      en: 2040\n    }, {\n      fa: 1420,\n      en: 2041\n    }];\n\n    if (params.disable) {\n      self.disable = params.disable;\n    } else {\n      self.disable = ko.observable(false);\n    }\n\n    self.showMenu = ko.observable(false);\n    self.showYearList = ko.observable(false);\n    self.bubblePrevent = false;\n    self.input = ko.observable();\n    self.month = ko.observable();\n    self.year = ko.observable();\n    self.day = ko.observable();\n    self.patterns = {\n      fa: {\n        mask: \"9999/99/99\",\n        placeholder: \"----/--/--\"\n      },\n      en: {\n        mask: \"99/99/9999\",\n        placeholder: \"--/--/----\"\n      }\n    };\n    self.mask = ko.observable(self.patterns[self.dateType].mask);\n    self.placeholder = ko.observable(self.patterns[self.dateType].placeholder);\n\n    self.latestDate = function () {\n      switch (self.dateType) {\n        case \"en\":\n          break;\n\n        case \"fa\":\n          return self.year() + \"/\" + self.month() + \"/\" + self.day();\n      }\n    };\n\n    self.onClick = function (model, e) {\n      if (self.disable()) {\n        return;\n      }\n\n      self.showMenu(true);\n      self.refreshValues();\n      self.buildTableMonth();\n    };\n\n    self.input.subscribe(function (newValue) {\n      if (!_h.isNullOrEmpty(newValue) && newValue !== \"\" && newValue.indexOf(\"-\") === -1) {\n        var formatDate = dateHelper.fromDatePicker(newValue, self.dateType);\n\n        if (formatDate) {\n          self.bubblePrevent = true;\n          self.params.value(formatDate);\n          self.bubblePrevent = false;\n        }\n      } else {\n        self.bubblePrevent = true;\n        self.params.value(undefined);\n        self.bubblePrevent = false;\n      }\n    });\n\n    self.init = function () {\n      self.refreshValues();\n\n      if (self.selectScope === \"wide\") {\n        var currentYear = dateHelper.getCurrentJalaaliYear().jy;\n        var date = new Date();\n        var currentgYear = date.getFullYear();\n        var years = [];\n\n        for (var i = 0; i < 100; i++) {\n          years.push({\n            fa: currentYear - i,\n            en: currentgYear - i\n          });\n          if (i > 80) years.push({\n            fa: currentYear + (i - 80),\n            en: currentgYear + (i - 80)\n          });\n        }\n\n        years.sort(function (a, b) {\n          return a.fa - b.fa;\n        });\n        self.years = years;\n        self.params.value.subscribe(function (newValue) {\n          if (self.bubblePrevent) {\n            return;\n          }\n\n          if (!_h.isNullOrEmpty(newValue) && newValue !== \"\" && newValue.indexOf(\"-\") === -1) {\n            date = dateHelper.toDatePicker(newValue);\n            self.month(date[0].jm);\n            self.year(date[0].jy);\n            self.day(date[0].jd);\n            var nDate = self.year() + \"/\" + self.fixMonthDayNumber(self.month()) + \"/\" + self.fixMonthDayNumber(self.day());\n            self.bubblePrevent = true;\n            self.input(nDate);\n            self.bubblePrevent = false;\n          } else {\n            self.input(undefined);\n          }\n        });\n      } else {\n        self.params.value.subscribe(function (newValue) {\n          if (self.bubblePrevent) {\n            return;\n          }\n\n          if (!_h.isEmpty(newValue)) {\n            var date = dateHelper.toDatePicker(newValue);\n            self.month(date[0].jm);\n            self.year(date[0].jy);\n            self.day(date[0].jd);\n            var nDate = self.year() + \"/\" + self.fixMonthDayNumber(self.month()) + \"/\" + self.fixMonthDayNumber(self.day());\n            self.bubblePrevent = true;\n            self.input(nDate);\n            self.bubblePrevent = false;\n          }\n        });\n      }\n    };\n\n    self.fixMonthDayNumber = function (num) {\n      var x = num.toString();\n      if (x.length === 1) return \"0\" + num;\n      return num;\n    };\n\n    self.refreshValues = function () {\n      var date, nDate;\n\n      if (!_h.isNullOrEmpty(self.params.value()) && self.params.value() !== \"\") {\n        date = dateHelper.toDatePicker(self.params.value());\n        self.month(date[0].jm);\n        self.year(date[0].jy);\n        self.day(date[0].jd);\n        nDate = self.year() + \"/\" + self.fixMonthDayNumber(self.month()) + \"/\" + self.fixMonthDayNumber(self.day());\n        self.input(nDate);\n      } else {\n        var today = dateHelper.dateNow(\"fa\");\n        date = dateHelper.toDatePicker(today);\n        self.month(date[0].m);\n        self.year(date[0].y);\n        self.day(date[0].d);\n      }\n    };\n\n    self.init();\n\n    self.formatMonth = function (number) {\n      if (_h.isNullOrEmpty(number)) return \"\";\n      var month = self.months[number - 1];\n      return month.faName;\n    };\n\n    self.onShowMonthList = function () {\n      self.showYearList(false);\n    };\n\n    self.onShowYearList = function () {\n      self.showYearList(true);\n    };\n\n    self.onSelectYear = function (item) {\n      self.year(item.fa);\n      if (!dateHelper.isValidJalaaliDate(self.year(), self.month(), self.day())) self.day(1);\n      self.buildTableMonth();\n    };\n\n    self.onSelectMonth = function (item) {\n      self.month(item.id);\n      if (!dateHelper.isValidJalaaliDate(self.year(), self.month(), self.day())) self.day(1);\n      self.buildTableMonth();\n    };\n\n    self.onUpdate = function () {\n      if (self.showYearList()) {\n        if (self.dateType === \"fa\" && self.year() >= 1420 || self.dateType === \"en\" && self.year() >= 2041) return;\n        self.year(self.year() + 1);\n        if (!dateHelper.isValidJalaaliDate(self.year(), self.month(), self.day())) self.day(1);\n      } else {\n        if (self.month() < 12) {\n          self.month(self.month() + 1);\n        } else {\n          if (self.dateType === \"fa\" && self.year() >= 1420 || self.dateType === \"en\" && self.year() >= 2041) return;\n          self.year(self.year() + 1);\n          self.month(1);\n          if (!dateHelper.isValidJalaaliDate(self.year(), self.month(), self.day())) self.day(1);\n        }\n      }\n\n      self.buildTableMonth();\n    };\n\n    self.onDowndate = function () {\n      if (self.showYearList()) {\n        if (self.dateType === \"fa\" && self.year() <= 1380 || self.dateType === \"en\" && self.year() <= 2001) return;\n        self.year(self.year() - 1);\n        if (!dateHelper.isValidJalaaliDate(self.year(), self.month(), self.day())) self.day(1);\n      } else {\n        if (self.month() > 1) {\n          self.month(self.month() - 1);\n        } else {\n          if (self.dateType === \"fa\" && self.year() <= 1380 || self.dateType === \"en\" && self.year() <= 2001) return;\n          self.year(self.year() - 1);\n          self.month(1);\n          if (!dateHelper.isValidJalaaliDate(self.year(), self.month(), self.day())) self.day(1);\n        }\n      }\n\n      self.buildTableMonth();\n    };\n\n    self.setClassName = function (element, className) {\n      element.className = className;\n    };\n\n    self.setInnerHTML = function (element, html) {\n      element.innerHTML = html;\n    };\n\n    self.createElement = function (tag, parent) {\n      var element = document.createElement(tag);\n      if (parent) parent.appendChild(element);\n      return element;\n    };\n\n    self.changeDay = function (date, day) {\n      if (_h.isNullOrEmpty(date) || date === \"\") return undefined;\n      var splits = date.split(\"/\");\n      return splits[0] + \"/\" + splits[1] + \"/\" + day;\n    };\n\n    self.buildTableMonth = function () {\n      var today = dateHelper.dateNow(\"fa\");\n      var datePicker = $(\".dp-body\").get(0);\n      var tr, td;\n      var date = self.latestDate();\n      datePicker.innerHTML = \"\";\n      var table = self.createElement(\"table\", datePicker);\n      table.cellSpacing = 0;\n      var weekDay = dateHelper.getWeekDay(self.changeDay(date, \"01\"));\n\n      for (var row = 0; row < 7; row++) {\n        tr = table.insertRow(row);\n        if (row === 6) self.setClassName(tr, \"dp-row-friday ncls\");else if (dateHelper.mod(row, 2) !== 1) self.setClassName(tr, \"dp-row-even ncls\");else self.setClassName(tr, \"dp-row-odd ncls\");\n        td = self.createElement(\"td\", tr);\n        self.setInnerHTML(td, self.weekDays[row].fa);\n        self.setClassName(td, \"dp-week-day ncls\");\n\n        for (var col = 0; col < 6; col++) {\n          var cellValue = col * 7 + row - weekDay + 1;\n          td = self.createElement(\"td\", tr);\n          self.setClassName(td, \"ncls\");\n\n          if (cellValue > 0 && cellValue <= dateHelper.getMonthDays(date)) {\n            self.setInnerHTML(td, cellValue);\n            var cellDate = self.changeDay(date, cellValue);\n            var cellClassName = \"dp-day ncls\";\n            if (cellDate === date) cellClassName = \"dp-day dp-selected-day ncls\";else if (cellDate === today) cellClassName = \"dp-day dp-today ncls\";\n            self.setClassName(td, cellClassName);\n\n            td.onclick = function () {\n              var nDate = self.year() + \"/\" + self.fixMonthDayNumber(self.month()) + \"/\" + self.fixMonthDayNumber(this.innerHTML);\n              self.input(nDate);\n              self.showMenu(false);\n              self.day(Number(this.innerHTML));\n            };\n          }\n        }\n      }\n    };\n\n    self.formatValue = ko.computed(function () {\n      if (self.dateType === \"fa\" && !_h.isNullOrEmpty(self.year())) {\n        return self.year() + \"/\" + self.month() + \"/\" + self.day();\n      }\n\n      return \"\";\n    });\n  },\n  template: '<!-- ko if: !disable() --><div class=\"input-group\"><input type=\"text\" class=\"form-control text-center key-on\" style=\"direction: ltr;\" data-bind=\"masked: input, ' + 'placeholder: placeholder, mask: mask\" />' + '<!-- ko if: showMenu --><div class=\"datepicker-box drp-menu ncls\">' + '<div class=\"dp-left ncls\">' + '<ul class=\"dp-month-list ncls\" data-bind=\"visible: !showYearList(), foreach: months\">' + '<!-- ko if:  $parent.month() === id -->' + '<li class=\"month-select ncls\" data-bind=\"click: $parent.onSelectMonth, text: faName\"></li><!-- /ko -->' + '<!-- ko ifnot:  $parent.month() === id -->' + '<li class=\"ncls\" data-bind=\"click: $parent.onSelectMonth, text: faName\"></li><!-- /ko -->' + '</ul>' + '<ul class=\"dp-year-list ncls\" data-bind=\"visible: showYearList, foreach: years\">' + '<!-- ko if: $parent.year() === fa -->' + '<li class=\"year-select ncls\" data-bind=\"click: $parent.onSelectYear, text: fa\"></li><!-- /ko -->' + '<!-- ko ifnot: $parent.year() === fa -->' + '<li class=\"ncls\" data-bind=\"click: $parent.onSelectYear, text: fa\"></li><!-- /ko -->' + '</ul></div>' + '<div class=\"dp-right ncls\">' + '<div class=\"dp-head ncls\">' + '<div class=\"dp-title-box ncls\">' + '<span class=\"dp-title ncls\" data-bind=\"click: onShowMonthList, text: formatMonth(month())\"></span>' + '<span class=\"dp-title ncls\" data-bind=\"click: onShowYearList, text: year\"></span></div>' + '<div class=\"dp-icon-box ncls\"><a class=\"dp-icon ncls\" data-bind=\"click: onUpdate\">' + '<i class=\"fa fa-angle-up ncls\"></i>' + '</a>' + '<a class=\"dp-icon ncls\" data-bind=\"click: onDowndate\">' + '<i class=\"fa fa-angle-down ncls\"></i>' + '</a></div></div><div class=\"dp-body ncls\"></div></div></div><!-- /ko --> ' + '<span class=\"input-group-btn ncls\">' + '<img style=\"margin-top: -11px;margin-left: 10px;\" class= \"icon-image-small selectable ncls\"' + 'src=\"/App/src/images/ico/datepicker.png\" data-bind=\"click: onClick\" /></span></div><!-- /ko -->' + '<!-- ko if: disable --><input type=\"text\" disabled=\"disabled\" class=\"form-control text-center\" data-bind=\"value: formatValue\" />' + '<!-- /ko -->'\n});\n\n//# sourceURL=webpack://domino/./src/scripts/components/ko-datepicker.js?");

/***/ }),

/***/ "./src/scripts/components/ko-filtercolumn.js":
/*!***************************************************!*\
  !*** ./src/scripts/components/ko-filtercolumn.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\nko.components.register('ko-filtercolumn', {\n  viewModel: function viewModel(params) {\n    var self = this;\n    self.filterType = params.value;\n    self.cols = params.cols;\n    self.filterColTypes = ko.observableArray();\n\n    self.getFilterTypes = function () {\n      self.filterColTypes.removeAll();\n      self.filterColTypes.push({\n        value: \"_\",\n        text: \"همه\"\n      });\n\n      for (var m in self.cols) {\n        if (self.cols.hasOwnProperty(m)) {\n          var param = self.cols[m];\n\n          if (param.filterType) {\n            self.filterColTypes.push({\n              value: param.colName,\n              text: param.fa\n            });\n          }\n        }\n      }\n    };\n\n    self.getFilterTypes();\n  },\n  template: \"<!-- ko template: { name: 'filtercolumn-component-t' } --><!-- /ko -->\"\n});\n\n//# sourceURL=webpack://domino/./src/scripts/components/ko-filtercolumn.js?");

/***/ }),

/***/ "./src/scripts/components/ko-formulamaker.js":
/*!***************************************************!*\
  !*** ./src/scripts/components/ko-formulamaker.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _pages_master_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../pages/master/model */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n\n\nko.components.register('ko-formulamaker', {\n  viewModel: function viewModel(params) {\n    var self = this;\n    self.parentForm = params.parent;\n    self.name = params.name;\n    self.loc = params.loc;\n    self.branchSelectable = params.branchSelectable || true;\n\n    var context = _h.kocnx();\n\n    self.isGroup = context.currentCompany().ct === 0;\n    self.loginCompanyId = context.loginCompanyId();\n    self.inputId = \"formula-\" + _h.createRandomNumber();\n    self.element = null;\n    self.controllerName = params.controllerName;\n    self.companies = ko.observableArray();\n    self.trees = ko.observableArray();\n    self.columns = ko.observableArray();\n    self.nodes = [];\n    self.consolidateCompany = ko.observable();\n    self.tips = ko.observableArray();\n    self.input = ko.observable();\n\n    self.closeMenu = function () {\n      self.showMenu(false);\n    };\n\n    self.input.subscribe(function (newValue, oldValue) {\n      if (_h.isNullOrEmpty(newValue)) return;\n      self.setCaretPosition(self.inputId, newValue.length);\n      if (params.value() !== newValue) self.parentForm.onChangeFormula(newValue, self.name);\n    });\n    self.companyId = ko.observable();\n    self.companyId.subscribe(function (newValue, oldValue) {\n      if (_h.isNullOrEmpty(newValue)) return;\n\n      if (newValue === self.loginCompanyId) {\n        for (var j = 0; j < self.trees().length; j++) {\n          self.trees()[j].disabled(false);\n        }\n      } else {\n        for (var i = 0; i < self.trees().length; i++) {\n          var target = self.trees()[i];\n          if (_h.contains([0, 2, 3], target.treeType)) target.disabled(false);else target.disabled(true);\n        }\n      }\n\n      self.treeId(undefined);\n      self.getConsolidateCompanies();\n      self.toggleTabs();\n    });\n    self.treeId = ko.observable();\n    self.showFormulaValueType = ko.observable(false);\n    self.treeId.subscribe(function (newValue, oldValue) {\n      if (_h.isNullOrEmpty(newValue)) return;\n      self.formulaValueType(\"F\");\n      self.showFormulaValueType(false);\n      if (self.trees() && self.trees().length) for (var i = 0; i < self.trees().length; i++) {\n        var target = self.trees()[i];\n\n        if (target.value === newValue && target.treeType === 0 && _h.kocnx().loginCompanyType() === 0) {\n          self.showFormulaValueType(true);\n          break;\n        }\n      }\n      self.toggleTabs();\n      setTimeout(function () {\n        $('a[href=\"#nodes-t\"]').trigger('click');\n      }, 200);\n      self.getNodes();\n    });\n    self.companySearch = ko.observable();\n    self.treeSearch = ko.observable();\n    self.columnSearch = ko.observable();\n    self.companySearch.subscribe(function (newValue) {\n      if (self.companies().length) for (var i = 0; i < self.companies().length; i++) {\n        if (_h.isEmpty(newValue) || self.companies()[i].text() && self.companies()[i].text().indexOf(newValue) !== -1) self.companies()[i].hide(false);else self.companies()[i].hide(true);\n      }\n      self.companyId(undefined);\n      self.treeId(undefined);\n    });\n    self.treeSearch.subscribe(function (newValue) {\n      if (self.trees().length) for (var i = 0; i < self.trees().length; i++) {\n        if (_h.isEmpty(newValue)) self.trees()[i].hide(false);else if (self.trees()[i].text.indexOf(newValue) !== -1 || self.trees()[i].type.indexOf(newValue) !== -1 || self.trees()[i].valueTypeText.indexOf(newValue) !== -1) self.trees()[i].hide(false);else self.trees()[i].hide(true);\n      }\n    });\n    self.columnSearch.subscribe(function (newValue) {\n      if (self.columns().length) for (var i = 0; i < self.columns().length; i++) {\n        if (_h.isEmpty(newValue)) self.trees()[i].hide(false);\n        if (self.columns()[i].text().indexOf(newValue) !== -1) self.columns()[i].hide(false);else self.companies()[i].hide(true);\n      }\n    });\n    self.nodeSearchKey = ko.observable();\n\n    self.onEnterNodeSearchKey = function (d, e) {\n      if (e.keyCode === 13) {\n        self.getNodes(self.nodeSearchKey());\n      }\n\n      return true;\n    };\n\n    self.showMenu = ko.observable(false);\n    self.showColumn = false;\n    self.showPercentage = true;\n    self.lastPhrase = ko.observable();\n    self.lastOperator = ko.observable();\n    self.formulaValueType = ko.observable(\"F\");\n    self.operators = {\n      undefined: {\n        name: \"\",\n        type: -3,\n        after: [-1, 0, 4, 6],\n        enabled: ko.observable(false)\n      },\n      \"\": {\n        name: \"\",\n        type: -3,\n        after: [-1, 0, 4, 6],\n        enabled: ko.observable(false)\n      },\n      \"000\": {\n        type: -2,\n        after: [-2, -1, 0, 1, 2, 3, 5],\n        enabled: ko.observable(false)\n      },\n      \"0\": {\n        type: -1,\n        after: [-2, -1, 0, 1, 2, 3, 5],\n        enabled: ko.observable(false)\n      },\n      \"1\": {\n        type: 0,\n        after: [-3, -1, -2, 0, 1, 2, 3, 5],\n        enabled: ko.observable(false)\n      },\n      \"2\": {\n        type: 0,\n        after: [-3, -1, -2, 0, 1, 2, 3, 5],\n        enabled: ko.observable(false)\n      },\n      \"3\": {\n        type: 0,\n        after: [-3, -1, -2, 0, 1, 2, 3, 5],\n        enabled: ko.observable(false)\n      },\n      \"4\": {\n        type: 0,\n        after: [-3, -1, -2, 0, 1, 2, 3, 5],\n        enabled: ko.observable(false)\n      },\n      \"5\": {\n        type: 0,\n        after: [-3, -1, -2, 0, 1, 2, 3, 5],\n        enabled: ko.observable(false)\n      },\n      \"6\": {\n        type: 0,\n        after: [-3, -1, -2, 0, 1, 2, 3, 5],\n        enabled: ko.observable(false)\n      },\n      \"7\": {\n        type: 0,\n        after: [-3, -1, -2, 0, 1, 2, 3, 5],\n        enabled: ko.observable(false)\n      },\n      \"8\": {\n        type: 0,\n        after: [-3, -1, -2, 0, 1, 2, 3, 5],\n        enabled: ko.observable(false)\n      },\n      \"9\": {\n        type: 0,\n        after: [-3, -1, -2, 0, 1, 2, 3, 5],\n        enabled: ko.observable(false)\n      },\n      \".\": {\n        type: 1,\n        after: [-1, 0],\n        enabled: ko.observable(false)\n      },\n      \"+\": {\n        type: 2,\n        after: [-1, 0, 4, 6],\n        enabled: ko.observable(false)\n      },\n      \"-\": {\n        type: 2,\n        after: [-1, 0, 4, 6],\n        enabled: ko.observable(false)\n      },\n      \"*\": {\n        type: 2,\n        after: [-1, 0, 4, 6],\n        enabled: ko.observable(false)\n      },\n      \"/\": {\n        type: 2,\n        after: [-1, 0, 4, 6],\n        enabled: ko.observable(false)\n      },\n      \"%\": {\n        type: 3,\n        after: [2],\n        enabled: ko.observable(false)\n      },\n      \"(\": {\n        type: 4,\n        after: [-1, 0, 4, 6],\n        enabled: ko.observable(false)\n      },\n      \")\": {\n        type: 5,\n        after: [2],\n        enabled: ko.observable(false)\n      },\n      // if has open p\n      \"[\": {\n        type: 6,\n        after: [],\n        enabled: ko.observable(false)\n      },\n      \"]\": {\n        type: 7,\n        after: [2, 5],\n        enabled: ko.observable(false)\n      },\n      // if has open bracket\n      \"C\": {\n        type: 10,\n        after: [],\n        enabled: ko.observable(false)\n      },\n      \"CE\": {\n        type: 11,\n        after: [],\n        enabled: ko.observable(false)\n      }\n    };\n    self.tabs = {\n      Info: ko.observable(true),\n      Oprators: ko.observable(true),\n      Nodes: ko.observable(false),\n      Consolidates: ko.observable(false),\n      Companies: ko.observable(false),\n      Trees: ko.observable(false),\n      Columns: ko.observable(false)\n    };\n    self.inBracket = ko.observable(false);\n\n    self.getLastOperator = function () {\n      var lastOperator = self.lastOperator();\n      if (!lastOperator) lastOperator = \"\";\n      return lastOperator;\n    };\n\n    self.toggleTabs = function () {\n      var lastOperator = self.operators[self.lastOperator()];\n      var inBracket = self.inBracket();\n\n      if (self.isGroup) {\n        switch (lastOperator.type) {\n          case 6:\n            if (self.companyId() === self.loginCompanyId) self.tabs.Consolidates(false);else {\n              self.tabs.Consolidates(inBracket);\n            }\n\n            if (self.loc) {\n              self.tabs.Companies(inBracket);\n              self.tabs.Trees(inBracket);\n              self.tabs.Nodes(inBracket && self.treeId() > 0);\n              self.tabs.Columns(inBracket && self.showColumn);\n            } else {\n              self.tabs.Companies(inBracket);\n              self.tabs.Trees(inBracket && self.companyId() > 0);\n              self.tabs.Nodes(inBracket && self.companyId() > 0 && self.treeId() > 0);\n              self.tabs.Columns(inBracket && self.showColumn);\n            }\n\n            break;\n\n          case 7:\n            self.tabs.Nodes(inBracket);\n            self.tabs.Companies(inBracket);\n            self.tabs.Trees(inBracket);\n            self.tabs.Consolidates(inBracket);\n            self.tabs.Columns(inBracket && self.showColumn);\n            break;\n\n          case -3:\n            self.tabs.Nodes(inBracket);\n            self.tabs.Companies(inBracket);\n            self.tabs.Trees(inBracket);\n            self.tabs.Consolidates(inBracket);\n            self.tabs.Columns(inBracket && self.showColumn);\n            break;\n        }\n\n        if (!self.tabs.Nodes()) $('a[href=\"#oprators-t\"]').trigger('click');\n        if (!self.tabs.Consolidates()) $('a[href=\"#oprators-t\"]').trigger('click');\n        if (!self.tabs.Trees()) $('a[href=\"#info-t\"]').trigger('click');\n        if (!self.tabs.Companies()) $('a[href=\"#info-t\"]').trigger('click');\n      } else {\n        self.tabs.Nodes(inBracket);\n        self.tabs.Trees(inBracket);\n        self.tabs.Columns(inBracket && self.showColumn);\n        if (!self.tabs.Nodes()) $('a[href=\"#oprators-t\"]').trigger('click');\n        if (!self.tabs.Trees()) $('a[href=\"#info-t\"]').trigger('click');\n      }\n    };\n\n    self.toggleOperators = function () {\n      var lastOperator = self.getLastOperator();\n      var last = self.operators[lastOperator];\n\n      for (var operatorName in self.operators) {\n        if (self.operators.hasOwnProperty(operatorName)) {\n          var operator = self.operators[operatorName];\n          if (operator.type === 5) operator.enabled(self.ifHasOpenParentheses() && last.type !== 4);else if (operator.type === 10 || operator.type === 11) operator.enabled(true);else if (last.after.length === 0) operator.enabled(false);else if (last.after.indexOf(operator.type) === -1) operator.enabled(false);else operator.enabled(true);\n        }\n      }\n    };\n\n    self.eraseText = function (type) {\n      switch (type) {\n        case 10:\n          self.input(\"\");\n          self.lastOperator(undefined);\n          break;\n\n        case 11:\n          var text = self.input();\n\n          if (text && text.length === 1) {\n            self.input(\"\");\n            self.lastOperator(undefined);\n          } else if (text && text.length > 1) {\n            var sub = text.substring(text.length - 1);\n            var operator = self.operators[sub];\n            if (_h.isNullOrEmpty(operator)) return;\n\n            if (operator.type === 7) {\n              var index = 0;\n              var length = self.input().length;\n              var array = self.input().split('').reverse();\n\n              for (var i = 0; i < array.length; i++) {\n                var current = array[length - i];\n                if (current === \"[\") index = length - i;\n              }\n\n              var res = self.input().substring(0, length - index);\n              self.input(res);\n              self.lastOperator(\"[\");\n            } else {\n              var rest = text.substring(0, text.length - 1);\n              self.input(rest);\n              sub = self.input().substring(self.input().length - 1);\n              self.lastOperator(sub);\n            }\n          }\n\n          break;\n      }\n\n      self.ifInBracket();\n      self.toggleOperators();\n      self.toggleTabs();\n    };\n\n    self.onTreeItemsClick = function (item) {\n      if (self.treeId() === item.value) {\n        self.treeId(undefined);\n      } else {\n        self.treeId(item.value);\n      }\n    };\n\n    self.onCompanyItemsClick = function (item) {\n      if (self.companyId() === item.value()) {\n        self.companyId(undefined);\n      } else {\n        self.companyId(item.value());\n      }\n    };\n\n    self.onColumnItemsClick = function (item) {\n      if (_h.isNullOrEmpty(item)) return;\n      var p = \"\";\n      if (self.input() !== null && self.input() !== undefined) p = self.input();\n      self.input(p + \"col:\" + item.value() + \"]\");\n      self.lastOperator(\"]\");\n      self.inBracket(false);\n      self.toggleOperators();\n      self.toggleTabs();\n    };\n\n    self.setCaretPosition = function (elemId, caretPos) {\n      var elem = document.getElementById(elemId);\n\n      if (elem !== null) {\n        if (elem.createTextRange) {\n          var range = elem.createTextRange();\n          range.move('character', caretPos);\n          range.select();\n        } else {\n          if (elem.selectionStart) {\n            elem.focus();\n            elem.setSelectionRange(caretPos, caretPos);\n          } else elem.focus();\n        }\n      }\n    };\n\n    self.getCaretPosition = function () {\n      var el = document.getElementById(self.inputId);\n      var iCaretPos = el.selectionStart;\n      return iCaretPos;\n    };\n\n    self.onClick = function (model, e) {\n      var visList = $(\".drp-menu:visible\");\n\n      if (visList && visList.length > 0) {\n        for (var i = 0; i < visList.length; i++) {\n          var target = ko.contextFor(visList[i]);\n          if (target && target.$data && target.$data[\"showMenu\"]) target.$data.showMenu(false);\n        }\n      }\n\n      self.showMenu(true);\n\n      if (self.input()) {\n        self.setCaretPosition(self.inputId, self.input().length);\n\n        var _char = self.input().charAt(self.input().length - 1);\n\n        if (_char !== self.lastOperator()) {\n          self.lastOperator(_char);\n        }\n      } else {\n        self.setCaretPosition(self.inputId, 0);\n        self.lastOperator(undefined);\n      }\n\n      self.ifInBracket();\n      self.toggleOperators();\n      self.toggleTabs();\n      self.calculateOpenListLoc();\n    };\n\n    self.onKeydown = function (model, event) {\n      if (!self.showMenu()) return true;\n\n      if (!_h.isEnglishKeyboard(event.key)) {\n        var text = _h.getApiMessage(\"FormulaMakerEnglishOnly\");\n\n        _h.failToast(text);\n\n        return false;\n      }\n\n      switch (event.keyCode) {\n        case 8:\n          self.eraseText(11);\n          break;\n\n        case 46:\n          self.eraseText(10);\n          break;\n\n        default:\n          var key = event.key;\n          var operator = self.operators[key];\n          if (!operator || !operator.enabled()) return false;\n\n          if (self.canWrite(operator)) {\n            self.write(key, operator);\n            self.lastOperator(key);\n            self.ifInBracket();\n            self.toggleOperators();\n            self.toggleTabs();\n          }\n\n          break;\n      }\n    };\n\n    self.onKeyClick = function (model, e) {\n      var lastOperator = self.operators[self.getLastOperator()];\n      var newOperator = self.operators[e.currentTarget.innerText];\n      if (!newOperator.enabled()) return;\n\n      switch (newOperator.type) {\n        case 10:\n          self.eraseText(10);\n          break;\n\n        case 11:\n          self.eraseText(11);\n          break;\n\n        default:\n          if (lastOperator.after.indexOf(newOperator.type) !== -1) {\n            var el = document.getElementById(self.inputId);\n            el.focus();\n            self.lastOperator(e.currentTarget.innerText);\n            self.write(e.currentTarget.innerText, newOperator);\n          }\n\n          break;\n      }\n\n      self.ifInBracket();\n      self.toggleTabs();\n      self.toggleOperators();\n    };\n\n    self.ifInBracket = function () {\n      if (!self.input()) {\n        self.inBracket(false);\n        return;\n      }\n\n      var array = self.input().split('').reverse();\n\n      for (var i = 0; i < array.length; i++) {\n        if (array[i] === \"[\") {\n          self.inBracket(true);\n          break;\n        }\n\n        if (array[i] === \"]\") {\n          self.inBracket(false);\n          break;\n        }\n      }\n    };\n\n    self.ifHasOpenParentheses = function () {\n      if (!self.input()) return false;\n      var lPCount = self.input().replace(/[^(]/g, \"\").length;\n      var rPCount = self.input().replace(/[^)]/g, \"\").length;\n      if (lPCount === 0) return false;\n      if (lPCount === rPCount) return false;\n      if (lPCount > rPCount) return true;\n      return false;\n    };\n\n    self.write = function (key, operator) {\n      var text = self.input();\n      var pos = self.getCaretPosition();\n\n      if (!text) {\n        self.input(key);\n      } else if (text.length === pos) {\n        self.input(self.input() + key);\n      } else {\n        var part1 = self.input().substring(0, pos);\n        var part2 = self.input().substring(pos);\n        self.input(part1 + key + part2);\n      }\n    };\n\n    self.canWrite = function (operator) {\n      if (!self.lastOperator() || operator.after.indexOf(-3) !== -1) return true;\n      var last = self.operators[self.lastOperator()];\n      if (last.after.indexOf(operator.type) !== -1) return true;\n      return false;\n    };\n\n    self.getTreeSelectList = function () {\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__.ApiService.request({\n        url: \"/api/common/getgeneraltreelist\",\n        data: {\n          controllerName: 4\n        },\n        success: function success(data) {\n          self.trees.removeAll();\n\n          if (!_h.isNullOrEmpty(data)) {\n            for (var j = 0; j < data.length; j++) {\n              var item = new _pages_master_model__WEBPACK_IMPORTED_MODULE_0__.TreeFormulaMakerSelectItem(data[j]);\n              self.trees.push(item);\n            }\n          }\n\n          self.treeId(undefined);\n        },\n        error: function error(data) {\n          var text = _h.getApiMessage(\"ErrorLoadTree\");\n\n          _h.failToast(text);\n        }\n      });\n    };\n\n    self.getCompanyList = function () {\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__.ApiService.request({\n        url: \"/api/common/getcompanylist\",\n        data: {\n          controllerName: self.controllerName\n        },\n        success: function success(data) {\n          self.companies.removeAll();\n          if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n            var target = data[j];\n            self.companies.push(new _pages_master_model__WEBPACK_IMPORTED_MODULE_0__.CompanySelectItem(target));\n          }\n          self.companyId(undefined);\n        },\n        error: function error(data) {\n          toast.error(\"Company\", 'getSelectList');\n        }\n      });\n    };\n\n    self.getConsolidateCompanies = function () {\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__.ApiService.request({\n        url: \"getCompanyOwnership\",\n        data: {\n          id: self.companyId()\n        },\n        success: function success(data) {\n          self.consolidateCompany(data);\n        },\n        error: function error(data) {\n          toast.error(\"Company\", 'getSelectList');\n        }\n      });\n    };\n\n    self.getFormulaTips = function () {\n      if (_h.isEmpty(self.input())) {\n        if (self.tips().length) self.tips.removeAll();\n        return;\n      }\n\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__.ApiService.request({\n        url: \"getFormulaTooltip\",\n        data: {\n          controllerName: 4,\n          formula: self.input()\n        },\n        success: function success(data) {\n          self.tips.removeAll();\n          if (_h.any(data)) for (var i = 0; i < data.length; i++) {\n            self.tips.push(new _pages_master_model__WEBPACK_IMPORTED_MODULE_0__.TipItem(data[i]));\n          }\n          var infoBox = document.getElementById(\"info-t\");\n\n          if (infoBox) {\n            var row = infoBox.getElementsByClassName(\"row\")[0];\n            var leftSide = document.getElementById(\"formula_left\");\n            var rightSide = document.getElementById(\"formula_right\");\n            rightSide.style.borderLeft = \" 1px solid #ccc\";\n            row.style.width = \"\";\n            leftSide.style.opacity = \"1\";\n            self.showWideInfo(false);\n          }\n        },\n        error: function error(data) {}\n      });\n    };\n\n    self.getNodes = function (term) {\n      if (!self.treeId()) return;\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__.ApiService.request({\n        url: \"getNodeSelection\",\n        data: {\n          searchKey: term,\n          id: self.treeId(),\n          controllerName: self.controllerName,\n          branchSelectable: true\n        },\n        success: function success(data) {\n          self.nodes = data;\n          self.configNodeSelect();\n        },\n        error: function error(data) {\n          var text = _h.getApiMessage(\"LoadTreeBranchesError\");\n\n          _h.failToast(text);\n        }\n      });\n    };\n\n    self.init = function (model) {\n      if (model.value()) self.input(model.value());\n      self.controllerName = model.controllerName;\n\n      if (self.controllerName === 50) {\n        var colList = model.parent.parentForm.formulaColSelectList;\n        self.showColumn = true;\n        self.showPercentage = false;\n        if (colList && colList.length) for (var i = 0; i < colList.length; i++) {\n          self.columns.push(colList[i]);\n        }\n      }\n\n      self.getCompanyList();\n      self.getTreeSelectList();\n      self.getFormulaTips();\n      self.element = document.getElementById(self.inputId);\n      self.toggleOperators();\n      self.toggleTabs();\n      if (!_h.isNullOrEmpty(params)) params.value.subscribe(function (newValue, oldValue) {\n        setTimeout(function () {\n          if (params.value() !== self.input() && params.value.isValid()) self.input(newValue);\n        }, 350);\n      });\n    };\n\n    self.showWideInfo = ko.observable(false);\n\n    self.toggleWidthInfoBox = function () {\n      var leftSide = document.getElementById(\"formula_left\");\n      var rightSide = document.getElementById(\"formula_right\");\n\n      if (!self.showWideInfo()) {\n        $(\"#formula_left\").css({\n          \"display\": \"none\"\n        });\n        rightSide.style.border = \"none\";\n        rightSide.style.width = \"max-content\";\n        self.showWideInfo(true);\n      } else {\n        $(\"#formula_left\").css({\n          \"display\": \"\",\n          \"width\": \"\"\n        });\n        rightSide.style.width = \"\";\n        rightSide.style.borderLeft = \" 1px solid #ccc\";\n        self.showWideInfo(false);\n      }\n    };\n\n    self.onNodeItemClick = function (itemValue) {\n      if (!_h.isNullOrEmpty(itemValue)) {\n        if (self.lastOperator() === \"]\") {\n          self.eraseText(11);\n        }\n\n        var p = self.input(),\n            nodePhrase = \"\";\n        if (self.lastOperator() !== \"[\") return;\n\n        if (self.isGroup && (self.controllerName === 4 || self.controllerName === 32)) {\n          if (_h.isNullOrEmpty(self.formulaValueType())) self.formulaValueType(\"F\");\n          nodePhrase = \"node:\" + itemValue.code + \"-\" + self.companyId() + \"-\" + self.formulaValueType() + \"]\";\n          self.input(p + nodePhrase);\n          self.lastOperator(\"]\");\n        } else {\n          nodePhrase = itemValue.code + \"]\";\n          self.input(p + \"node:\" + nodePhrase);\n          self.lastOperator(\"]\");\n        }\n\n        self.inBracket(false);\n        self.toggleOperators();\n        self.toggleTabs();\n      }\n    };\n\n    self.configNodeSelect = function () {\n      var options = {\n        tType: \"NodeSelect\",\n        location: \"Formula\",\n        multi: false,\n        nodes: self.nodes,\n        substituteNode: true,\n        rootId: self.treeId(),\n        controllerName: self.controllerName,\n        onClickItem: self.onNodeItemClick,\n        selectedItems: null,\n        branchSelectable: self.branchSelectable\n      };\n      $(\"#tree_view_fl\").treeView(options);\n    };\n\n    self.onConsolidateCompanyClick = function (model, e) {\n      var value = $(e.target).attr(\"data-value\");\n\n      if (!_h.isNullOrEmpty(value)) {\n        if (self.lastOperator() === \"]\") {\n          self.eraseText(11);\n        }\n\n        var p = self.input();\n        if (self.lastOperator() !== \"[\") return;\n        self.input(p + \"percent:\" + value + \"]\");\n        self.lastOperator(\"]\");\n        self.inBracket(false);\n        self.toggleOperators();\n        self.toggleTabs();\n      }\n    };\n\n    self.init(params);\n\n    self.calculateOpenListLoc = function () {\n      var box = $(\".cal-box\");\n\n      if (box.length > 0) {\n        box.css('top', \"\");\n        var ulHeight = box.height();\n        var pageHeight = $(\"body\").height();\n        var viewportOffset = box.get(0).getBoundingClientRect();\n        var rest = pageHeight - viewportOffset.top;\n\n        if (rest < ulHeight) {\n          var ulTop = Number(box.css('top').replace(\"px\", \"\"));\n          var newTop = ulTop - ulHeight - 8;\n          box.css('top', newTop + \"px\");\n        }\n      }\n    };\n  },\n  template: \"<!-- ko template: { name: 'formula-maker-t' } --><!-- /ko -->\"\n});\n\n//# sourceURL=webpack://domino/./src/scripts/components/ko-formulamaker.js?");

/***/ }),

/***/ "./src/scripts/components/ko-inputautocomplete.js":
/*!********************************************************!*\
  !*** ./src/scripts/components/ko-inputautocomplete.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var _hh = __webpack_require__(/*! ./src/scripts/util/htmlHelper.js */ \"./src/scripts/util/htmlHelper.js\");\n\nko.components.register('ko-inputautocomplete', {\n  viewModel: function viewModel(params) {\n    var self = this;\n    self.randomId = _h.createRandomNumber();\n    self.id = \"select-ul\" + self.randomId;\n    self.value = params.value;\n    self.input = params.value;\n    self.apiData = params.apiData;\n    self.modelType = params.apiData.modelType;\n    self.list = ko.observableArray();\n    self.showMenu = ko.observable(false);\n    self.controlName = ko.observable(params.name);\n    self.parentForm = params.parent;\n\n    self.getData = function () {\n      var model = ko.toJS(self.apiData.model);\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: self.apiData.address,\n        data: model,\n        success: function success(data) {\n          self.list(data);\n          self.buildList();\n          self.showMenu(true);\n        },\n        error: function error(data) {}\n      });\n    };\n\n    self.onKeypress = function (model, evt) {\n      var charCode = evt.which ? evt.which : evt.keyCode;\n\n      if (charCode === 13) {\n        setTimeout(function () {\n          self.apiData.model.inputData.searchKey = self.input();\n          self.getData();\n        }, 100);\n      }\n\n      return true;\n    };\n\n    self.onInputFocus = function (x, e) {\n      var visList = $(\".drp-menu:visible\");\n\n      if (visList && visList.length > 0) {\n        for (var i = 0; i < visList.length; i++) {\n          if ($(visList[i]).attr(\"id\") !== self.id) {\n            var target = ko.contextFor(visList[i]);\n            if (target && target.$data && target.$data[\"showMenu\"]) target.$data.showMenu(false);\n          }\n        }\n      }\n\n      if (self.list().length) {\n        self.showMenu(true);\n        self.buildList();\n      }\n    };\n\n    self.onSelectItem = function (item) {\n      var target = null;\n\n      for (var i = 0; i < self.list().length; i++) {\n        if (self.list()[i].id === item.id) {\n          target = self.list()[i];\n        }\n      }\n\n      if (target) {\n        self.input(target.na);\n        self.showMenu(false);\n\n        switch (self.modelType) {\n          case \"node\":\n            self.parentForm.onNodeAutoSelect(self.controlName(), target);\n            break;\n\n          case \"company\":\n            self.parentForm.onCompanyAutoSelect(self.controlName(), target);\n            break;\n        }\n      }\n    };\n\n    self.buildList = function () {\n      var ul = document.getElementById(self.id);\n      if (!ul) return;\n      ul.innerHTML = \"\";\n      var item, li, html, span, info;\n      var list = ko.isObservable(self.list) ? self.list() : self.list;\n\n      if (list.length === 0) {\n        self.showMenu(false);\n        return;\n      }\n\n      for (var i = 0; i < list.length; i++) {\n        item = ko.toJS(list[i]);\n\n        switch (self.modelType) {\n          default:\n          case \"node\":\n            li = _hh.createElement(\"li\", ul);\n            li.setAttribute(\"data-id\", item.id);\n\n            _hh.setClassName(li, \"autocom-li\");\n\n            span = _hh.createElement(\"span\", li);\n\n            _hh.setClassName(span, \"autocom-span\");\n\n            _hh.setInnerHtml(span, item.na + \" ( \" + item.co + \" )\");\n\n            info = _hh.createElement(\"span\", li);\n\n            _hh.setClassName(info, \"autocom-path\");\n\n            _hh.setInnerHtml(info, item.path);\n\n            break;\n\n          case \"company\":\n            li = _hh.createElement(\"li\", ul);\n            li.setAttribute(\"data-id\", item.id);\n\n            _hh.setClassName(li, \"autocom-li\");\n\n            span = _hh.createElement(\"span\", li);\n\n            _hh.setClassName(span, \"autocom-span\");\n\n            _hh.setInnerHtml(span, item.na);\n\n            info = _hh.createElement(\"span\", li);\n\n            _hh.setClassName(info, \"autocom-path\");\n\n            _hh.setInnerHtml(info, item.de);\n\n            break;\n        }\n\n        li.onclick = function () {\n          self.onSelectItem({\n            name: this.innerText,\n            id: Number(this.getAttribute(\"data-id\"))\n          });\n        };\n      }\n\n      setTimeout(function () {\n        _h.fixItemHeight(self.id);\n\n        var elements = $('[title]');\n        $(elements).tooltip({\n          placement: 'top'\n        });\n      }, 100);\n    };\n  },\n  template: '<input type=\"text\" class=\"form-control key-on\" autocomplete=\"off\" data-bind=\"value: input,' + ' event:{keyup: onKeypress, focus: onInputFocus}, attr:{name: controlName}\">' + '<ul class=\"autocom-ul select-ul drp-menu\" data-bind=\"visible: showMenu, attr:{id : id}\"></ul>'\n});\n\n//# sourceURL=webpack://domino/./src/scripts/components/ko-inputautocomplete.js?");

/***/ }),

/***/ "./src/scripts/components/ko-nodeselect.js":
/*!*************************************************!*\
  !*** ./src/scripts/components/ko-nodeselect.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n\nko.components.register('ko-nodeselect', {\n  viewModel: function viewModel(params) {\n    var self = this;\n    self.type = params.type;\n    self.controlName = ko.observable(params.name);\n    self.location = params.location;\n    self.parentForm = params.parent;\n    self.nodeMultiSelect = params.type && params.type === \"multi\";\n    self.substituteNode = params.type && params.type === \"single\";\n    self.randomId = _h.createRandomNumber();\n    self.ulClass = params.name + \"-sl-tv-\" + self.randomId;\n    self.ulClasses = self.ulClass + \" autocom-ul select-ul sl-tv drp-menu\";\n    self.params = params;\n    self.showMenu = ko.observable(false);\n    self.showSelectedItems = ko.observable(false);\n    self.selectedItems = ko.observableArray();\n\n    if (params[\"values\"] && params.values().length > 0) {\n      for (var j = 0; j < params.values().length; j++) {\n        self.selectedItems.push(params.values()[j]);\n      }\n    }\n\n    self.list = ko.observableArray();\n    self.placeHolder = _h.getLocalizedText(\"codePlaceholder\");\n\n    self.getData = function (term) {\n      if (!self.params.treeId()) return;\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"getNodeSelection\",\n        data: {\n          searchKey: term,\n          id: self.params.treeId(),\n          controllerName: self.params.controllerName,\n          branchSelectable: self.params.branchSelectable\n        },\n        success: function success(data) {\n          self.list.removeAll();\n\n          for (var j = 0; j < data.length; j++) {\n            var target = data[j];\n            self.list.push(target);\n          }\n\n          self.buildTree();\n        },\n        error: function error(data) {\n          var text = _h.getApiMessage(\"LoadTreeBranchesError\");\n\n          _h.failToast(text);\n        }\n      });\n    };\n\n    self.buildTree = function () {\n      var options = {\n        tType: \"NodeSelect\",\n        multi: self.nodeMultiSelect,\n        nodes: self.list(),\n        substituteNode: self.substituteNode,\n        rootId: self.params.treeId(),\n        controllerName: self.params.controllerName,\n        onClickItem: self.onSelectItemCallBack,\n        onClickItems: self.onSelectItemsCallBack,\n        selectedItems: self.selectedItems,\n        branchSelectable: self.params.branchSelectable,\n        location: self.location\n      };\n\n      if (self.params[\"value\"]) {\n        var value = ko.isObservable(self.params[\"value\"]) ? self.params[\"value\"]() : self.params[\"value\"];\n        options.selectedItem = {\n          value: value\n        };\n      }\n\n      $(\".\" + self.ulClass).treeView(options);\n    };\n\n    if (ko.isObservable(params.value)) {\n      self.value = params.value;\n      if (!_h.isNullOrEmpty(self.value()) && !_h.isNullOrEmpty(params.valName)) self.selectedItems.push({\n        value: self.value(),\n        text: params.valName\n      });\n    } else {\n      self.value = ko.observable(params.value);\n      if (!_h.isNullOrEmpty(self.value()) && !_h.isNullOrEmpty(params.valName)) self.selectedItems.push({\n        value: self.value,\n        text: params.valName\n      });\n    }\n\n    self.toggleFocus = function (model, e) {\n      if (self.parentForm[\"setActiveFocus\"]) {\n        var name = $(e.currentTarget).attr(\"name\");\n        self.parentForm.setActiveFocus(name);\n      }\n    };\n\n    self.onRemoveSelectedItem = function (rItem) {\n      if (self.nodeMultiSelect) {\n        if (self.selectedItems().length === 1) rItem = self.selectedItems()[0];\n        self.selectedItems.remove(rItem);\n        self.value(undefined);\n        self.parentForm.onNodeSelect(self.controlName(), self.selectedItems());\n        $(\".\" + self.ulClass).treeView(\"refreshSelectItems\", self.selectedItems());\n      } else {\n        $(\".\" + self.ulClass).treeView(\"clearSelect\");\n        var item = self.selectedItems()[0];\n        self.selectedItems.remove(item);\n        self.value(undefined);\n        self.parentForm.onNodeSelect(self.controlName(), undefined);\n      }\n    };\n\n    self.onRemoveSelectedItems = function () {\n      $(\".\" + self.ulClass).treeView(\"clearSelect\");\n      self.selectedItems.removeAll();\n      self.value(undefined);\n      self.parentForm.onNodeSelect(self.controlName(), []);\n    };\n\n    self.onSelectItemCallBack = function (item) {\n      if (item) {\n        if (item.text.indexOf(\"-بد\") !== -1) {\n          item.text = item.text.replace(\"-بد\", \"\");\n        }\n\n        if (item.text.indexOf(\"-بس\") !== -1) {\n          item.text = item.text.replace(\"-بس\", \"\");\n        }\n\n        self.value(undefined);\n        self.selectedItems.removeAll();\n        self.selectedItems.push(item);\n        self.parentForm.onNodeSelect(self.controlName(), item.value, item);\n        self.showMenu(false);\n\n        if (self.parentForm.resetAfterSelect) {\n          self.value(undefined);\n          self.selectedItems.removeAll();\n        }\n      } else {\n        self.value(undefined);\n        self.selectedItems.removeAll();\n        self.parentForm.onNodeSelect(self.controlName(), undefined, undefined);\n      }\n    };\n\n    self.onSelectItemsCallBack = function (items) {\n      self.selectedItems(items);\n      self.value(undefined);\n      self.parentForm.onNodeSelect(self.controlName(), self.selectedItems());\n    };\n\n    self.onClickInput = function (model, e) {\n      if (e.target && $(e.target).hasClass(\"mu-spn\")) {\n        if (self.type === \"multi\") {\n          var input = $(e.target).find(\".autocom-textbox\");\n          if (input) $(input).focus();\n          self.showSelectedItems(true);\n        }\n      } else if (e.target && $(e.target).hasClass(\"autocom-remove\")) {//\n      } else {\n        if (e.target) $(e.target).focus();\n\n        if (self.list().length) {\n          self.showMenu(true);\n          self.calculateOpenListLoc();\n          if (self.type === \"multi\") self.showSelectedItems(false);\n        }\n      }\n    };\n\n    self.onKeypress = function (model, evt) {\n      var charCode = evt.which ? evt.which : evt.keyCode;\n\n      if (charCode === 13) {\n        setTimeout(function () {\n          self.getData(self.value());\n        }, 100);\n      } else {\n        if (self.type !== \"multi\") {\n          if (!$(evt.target).val()) {\n            self.parentForm.onNodeSelect(self.controlName(), undefined);\n          }\n        }\n      }\n    };\n\n    self.onInputFocus = function (x, e) {\n      var input = $(e.target).find(\".autocom-textbox\");\n      if (input) $(input).focus();\n    };\n\n    self.ph = \" مورد انتخاب شده\";\n    self.multi = \"multi\";\n    if (self.parentForm[\"treeId\"]) self.parentForm.treeId.subscribe(function (newValue) {\n      if (newValue !== undefined && newValue !== null) {\n        if (self.parentForm[\"entityName\"] || self.parentForm.parentForm && // for sourcesection dynamicdoc\n        self.parentForm.parentForm[\"section\"] && self.parentForm.parentForm.section() === \"source\") {\n          self.selectedItems.removeAll();\n          self.list.removeAll();\n          self.parentForm.onNodeSelect(self.controlName(), []);\n          self.getData();\n        }\n\n        if (self.parentForm[\"entityName\"] === \"AdjustmentDocumentItemForm\") {\n          self.selectedItems.removeAll();\n          self.list.removeAll();\n          self.getData();\n        }\n      } else {\n        self.selectedItems.removeAll();\n        self.list.removeAll();\n        self.parentForm.onNodeSelect(self.controlName(), []);\n        $(\".\" + self.ulClass).treeView(\"removeTree\");\n        self.showMenu(false);\n      }\n    });\n    self.getData();\n\n    self.calculateOpenListLoc = function () {\n      var box = $(\".node-box:visible\").find(\"#tree_view\");\n\n      if (box.length > 0) {\n        box.css('top', \"\");\n        var ulHeight = box.height();\n        var pageHeight = $(\"body\").height();\n        var viewportOffset = box.get(0).getBoundingClientRect();\n        var rest = pageHeight - viewportOffset.top;\n\n        if (rest < ulHeight) {\n          var ulTop = Number(box.css('top').replace(\"px\", \"\"));\n          var newTop = ulTop - ulHeight - 8;\n          box.css('top', newTop + \"px\");\n        }\n      }\n    };\n  },\n  template: '<!-- ko if:  showMenu() === true || selectedItems().length === 0 -->' + '<input type=\"text\" autocomplete=\"off\" style=\"unicode-bidi: plaintext;\" class=\"form-control autocomplate-input key-on ncls\"' + ' data-bind=\"value: value, click: onClickInput , event:{keyup: onKeypress, focus: toggleFocus},' + 'attr:{ placeholder: placeHolder, name: controlName }\" /><!-- /ko -->' + '<!-- ko if: !showMenu() && selectedItems().length > 0 -->' + '<div class=\"autocom-control\" style=\"display: block;\"><div class=\"autocom-input\" data-bind=\"click: onClickInput\"><div class= \"autocom-item\">' + ' <!-- ko if: selectedItems().length === 1 -->' + ' <span data-bind=\"text: selectedItems()[0].text\"></span> <a class=\"autocom-remove\" data-bind=\"click: onRemoveSelectedItem.bind(selectedItems()[0])\" tabindex=\"-1\" title=\"حذف\">×</a>' + ' <!-- /ko --><!-- ko if: selectedItems().length > 1 && !showMenu() --> <span class=\"mu-spn\" data-bind=\"text: selectedItems().length + ph\"></span>' + ' <a class=\"autocom-remove\" data-bind=\"click: onRemoveSelectedItems\" tabindex=\"-1\" title=\"حذف همه\">×</a>' + '<!-- /ko --></div></div></div><!-- /ko -->' + '<div class=\"dr-hl node-box\" data-bind=\"visible: showMenu() === true && showSelectedItems() === false\">' + '<ul id=\"tree_view\" style=\"width: fit-content;min-width: 100%;\" data-bind=\"attr:{class : ulClasses}\"></ul></div>' + '<div class=\"dr-hl\" data-bind=\"visible: showMenu() === false && showSelectedItems() === true\">' + '<ul id=\"showSelectedList_view\" class=\"autocom-ul select-ul drp-menu\" style=\"width: fit-content;min-width: 100%;\" data-bind=\"foreach: selectedItems\">' + '<li class=\"autocom-item\" style=\"display: table;\"><span data-bind=\"text: text\"></span>' + '<a class=\"autocom-remove\" data-bind=\"click: $parent.onRemoveSelectedItem\" tabindex=\"-1\" title=\"حذف\">×</a></li>' + '</ul></div>'\n});\n\n//# sourceURL=webpack://domino/./src/scripts/components/ko-nodeselect.js?");

/***/ }),

/***/ "./src/scripts/components/ko-radio.js":
/*!********************************************!*\
  !*** ./src/scripts/components/ko-radio.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\nko.components.register('ko-radio', {\n  viewModel: function viewModel(params) {\n    var self = this;\n    self.list = params.list;\n    self.className = params.className;\n    self.name = params.name;\n    self.inputValue = params.val;\n    self.value = ko.observable();\n    self.value.subscribe(function (newValue) {\n      if (!_h.isNullOrEmpty(newValue)) {\n        var item = _h.getEnumItemByText(params.list, newValue);\n\n        if (item.value !== self.inputValue()) self.inputValue(item.value);\n      }\n    });\n\n    self.init = function (model) {\n      var item = _h.getEnumItem(model.list, model.val());\n\n      if (item) self.value(item.enText);\n    };\n\n    self.onClick = function (item) {\n      self.value(item.enText);\n    };\n\n    self.init(params);\n  },\n  template: ' <!-- ko foreach: list -->  \\n' + '            <div data-bind=\"attr: {\\'class\\': $parent.className }\">\\n' + '                <input type=\"radio\" data-bind=\"checked: $parent.value, attr:{value: enText, name: $parent.name}\">\\n' + '                <label data-bind=\"click: $parent.onClick, text: text\"></label>\\n' + '            </div>\\n' + '            <!-- /ko -->'\n});\n\n//# sourceURL=webpack://domino/./src/scripts/components/ko-radio.js?");

/***/ }),

/***/ "./src/scripts/components/ko-rg.js":
/*!*****************************************!*\
  !*** ./src/scripts/components/ko-rg.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* harmony import */ var _pages_tabletemplate_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../pages/tabletemplate/model */ \"./src/scripts/pages/tabletemplate/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n\n\nko.components.register('ko-rg', {\n  viewModel: function viewModel(params) {\n    var self = this;\n    self.parent = params.parent;\n    self.entityName = \"ReportGenerator\";\n    self.type = !params.type ? \"edit\" : \"cellSelect\";\n    self.firstLoad = ko.observable(false);\n    self.active = params.active || ko.observable(true);\n    self.tableTemplateId = params.tableTemplateId;\n    self.templateType = ko.observable();\n    self.showDesc = ko.observable(false);\n    self.triggerEditable = params.triggerEditable || ko.observable(false);\n    self.refreshToolBar = params.refreshToolBar || ko.observable(false);\n    self.infoDropDownModel = ko.observable(new _pages_tabletemplate_model__WEBPACK_IMPORTED_MODULE_1__.InfoDropDown(self));\n    self.descCellModel = ko.observable();\n    self.contextMenuModel = new _pages_tabletemplate_model__WEBPACK_IMPORTED_MODULE_1__.ContextMenu();\n    self.id = \"rg-\" + (self.type === \"edit\" ? self.tableTemplateId() : \"-sc-\" + self.tableTemplateId());\n    self.selectedToolsClass = \"selected-tools\";\n    self.scope = null;\n    self.data = params.data;\n    self.previewMode = params.previewMode || ko.observable(false);\n    self.editable = ko.observable(false);\n    self.lockedBy = ko.observable();\n    self.lockedByUserId = ko.observable();\n    self.lockedForThisUser = ko.observable(false);\n    self.paperSizeAreaTypes = [{\n      text: \"هیچکدام\",\n      enText: \"\",\n      enable: ko.observable(true)\n    }, {\n      text: \"سایز A4 عمودی\",\n      enText: \"ruler-a4-port\",\n      enable: ko.observable(false)\n    }, {\n      text: \"سایز A4 افقی\",\n      enText: \"ruler-a4-land\",\n      enable: ko.observable(false)\n    }];\n\n    self.findScope = function () {\n      self.scope = $('#' + self.id);\n    };\n\n    self.changePaperSizeArea = function (item) {\n      for (var i = 0; i < self.paperSizeAreaTypes.length; i++) {\n        if (self.paperSizeAreaTypes[i].enText !== item.enText) {\n          self.paperSizeAreaTypes[i].enable(false);\n        }\n      }\n\n      item.enable(true);\n      var tag = self.scope.find(\".rg-paperSize\");\n\n      if (!tag || tag.length === 0) {\n        var box = self.scope.find(\".rp-gen\").parent();\n        box.append('<div class=\"rg-paperSize ' + item.enText + '\"></div>');\n      }\n\n      tag.attr('class', '');\n      tag.addClass(\"rg-paperSize \" + item.enText);\n    };\n\n    self.refresh = function (preview) {\n      if (!_h.isEmpty(preview) && _typeof(preview) !== Boolean) preview = false;\n\n      var context = _h.kocnx().ttvm();\n\n      var record = context.getFocusDesignRecord();\n      var arrayData = $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"toServer\");\n\n      if (arrayData && arrayData[1]) {\n        var confirmText = _h.getApiMessage(\"ConfirmNotSaveChange\");\n\n        _h.confirmDeleteAlert(confirmText, function (res) {\n          if (res) {\n            self.dispose();\n            self.getData();\n          }\n        });\n      } else {\n        self.dispose();\n        self.getData();\n      }\n    };\n\n    self.getData = function (woConfig) {\n      if (!self.active()) return;\n      var model = {\n        id: self.tableTemplateId()\n      };\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/tablestructure/getexceldata\",\n        data: model,\n        success: function success(data) {\n          if (!_h.isNullOrEmpty(data)) {\n            if (self.type === \"edit\") {\n              if (!woConfig) self.config(data.model, data.bindErrors);\n              self.resetToolBar();\n              var item = {\n                id: self.tableTemplateId(),\n                editable: data.model.editable,\n                lockedBy: data.model.lockedBy,\n                lockedByUserId: data.model.lockedByUserId\n              };\n              self.lockedBy(item.lockedBy);\n              self.lockedByUserId(item.lockedByUserId);\n\n              if (item.editable && item.lockedByUserId === _h.kocnx().currentUser().ui) {\n                self.editable(true);\n                self.lockedForThisUser(true);\n                $(\"#rg-\" + self.tableTemplateId()).find(\".rp-gen\").rg(\"toggleEditable\", true);\n              } else if (item.editable && item.lockedByUserId !== _h.kocnx().currentUser().ui) {\n                self.editable(true);\n                self.lockedForThisUser(false);\n                $(\"#rg-\" + self.tableTemplateId()).find(\".rp-gen\").rg(\"toggleEditable\", false);\n              } else {\n                self.editable(false);\n                self.lockedForThisUser(false);\n                $(\"#rg-\" + self.tableTemplateId()).find(\".rp-gen\").rg(\"toggleEditable\", false);\n              }\n\n              _h.kocnx().ttvm().setLockedItem(item);\n\n              setTimeout(function () {\n                self.charts.removeAll();\n                if (_h.any(data.model.charts)) for (var k = 0; k < data.model.charts.length; k++) {\n                  var chart = new _pages_tabletemplate_model__WEBPACK_IMPORTED_MODULE_1__.DomChart(self);\n                  self.charts.push(chart);\n                  chart.fillModel(data.model.charts[k]);\n                }\n              }, 1000);\n            } else {\n              self.configCellSelect(data.model);\n            }\n          }\n\n          if (!self.firstLoad()) self.firstLoad(true);\n          if (self.type == \"edit\") self.toolbarState();\n        },\n        error: function error(data) {\n          var text = _h.getApiMessage(\"ErrorLoadExcel\");\n\n          _h.failToast(text);\n        }\n      });\n    };\n\n    self.toggleEditable = function () {\n      if (!self.editable()) {\n        _h.kocnx().ttvm().postTemplateEditable(self.tableTemplateId(), true, function (data) {\n          if (data.model.lockedByUserId === _h.kocnx().currentUser().ui) {\n            self.editable(data.model.editable);\n            self.lockedBy(data.model.lockedBy);\n            self.lockedByUserId(data.model.lockedByUserId);\n            self.lockedForThisUser(true);\n            self.getData(true);\n          }\n        });\n      } else {\n        _h.kocnx().ttvm().postTemplateEditable(self.tableTemplateId(), false, function (data) {\n          $(\"#rg-\" + self.tableTemplateId()).find(\".rp-gen\").rg(\"toggleEditable\", false);\n          self.editable(false);\n          self.lockedBy(undefined);\n          self.lockedByUserId(undefined);\n          self.lockedForThisUser(false);\n          var item = {\n            id: self.tableTemplateId(),\n            editable: false,\n            lockedBy: undefined,\n            lockedByUserId: undefined\n          };\n\n          _h.kocnx().ttvm().setLockedItem(item);\n        });\n      }\n    };\n\n    self.saveChanges = function (preview) {\n      if (!_h.isEmpty(preview) && _typeof(preview) !== Boolean) preview = false;\n\n      var context = _h.kocnx().ttvm();\n\n      var record = context.getFocusDesignRecord();\n      var arrayData = $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"toServer\");\n      var model = arrayData[0];\n\n      if (context.focusDesignItem().previewMode()) {\n        var text = _h.getApiMessage(\"RgNotAllwedSaveChange\");\n\n        _h.failToast(text);\n\n        return;\n      }\n\n      if (_h.any(self.charts())) ko.utils.arrayForEach(self.charts(), function (item, index) {\n        if (item.showChart()) item.changePosition();\n        item.oldShowChart = item.showChart();\n        item.showChart(false);\n\n        try {\n          if (item.chartObject) {\n            item.chartObject.destroy();\n            item.chartObject = null;\n          }\n        } catch (e) {\n          item.chartObject = null;\n        }\n\n        item.showChart(item.oldShowChart);\n      });\n      model.charts = [];\n\n      for (var i = 0; i < self.charts().length; i++) {\n        var chart = self.charts()[i];\n        var objChart = chart.toServer(chart.oldShowChart);\n        model.charts.push(ko.toJS(objChart));\n      }\n\n      if (_h.any(self.charts())) ko.utils.arrayForEach(self.charts(), function (item, index) {\n        item.showChart(item.oldShowChart);\n\n        if (!item.chartObject && !preview) {\n          item.configChart();\n        }\n      });\n\n      _h.kocnx().ttvm().saveChanges(model, function (dataRes) {\n        if (dataRes !== false) {\n          if (_h.any(dataRes.bindErrors)) $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"setWarning\", dataRes.bindErrors);\n          if (_h.any(dataRes.cellsTag)) $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"refreshCellsTag\", dataRes.cellsTag);\n        }\n      });\n    };\n\n    self.nodeOperatorEditBtn = function () {\n      if (self.selectedCells.length > 0) {\n        var model = new NodesCellEdit(self, self.selectedCells);\n        if (model.canShow()) _h.kocnx().openForm(model);\n      }\n    };\n\n    self.nodeOperatorEdit = function () {\n      _h.kocnx().formModel().change(function (res) {\n        if (res) {\n          _h.kocnx().closeForm();\n        }\n      });\n    };\n\n    self.checkNodePhrase = function (formula, financialPeriod, callback) {\n      var model = {\n        formula: formula,\n        financialPeriod: financialPeriod\n      };\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/tablestructure/postchecknodesincell\",\n        data: model,\n        success: function success(list) {\n          if (!_h.isNullOrEmpty(list)) {\n            for (var i = 0; i < list.nodes.length; i++) {\n              if (list.nodes[i][\"value\"]) list.nodes[i].code = list.nodes[i][\"value\"];\n            }\n\n            callback(list);\n          }\n        },\n        error: function error(data) {}\n      });\n    };\n\n    self.resetToolBar = function () {\n      var scope = document.getElementById(self.id);\n      if (!scope) return;\n      var defaultVal = self.getDefault();\n      scope.querySelector(\"#textBold\").classList.remove(self.selectedToolsClass);\n      scope.querySelector(\"#textItalic\").classList.remove(self.selectedToolsClass);\n      scope.querySelector(\"#textUnderline\").classList.remove(self.selectedToolsClass);\n      scope.querySelector(\".txtFormula\").classList.remove(self.selectedToolsClass);\n      scope.querySelector(\".txtFormula\").style.color = \"black\";\n      scope.querySelector(\"#cellAddress\").innerText = \"\";\n      scope.querySelector(\"#textColor\").style.backgroundColor = defaultVal.textColor;\n      scope.querySelector(\"#backColor\").style.backgroundColor = defaultVal.backColor;\n      scope.querySelectorAll(\".align-btn\")[0].classList.remove(self.selectedToolsClass);\n      scope.querySelectorAll(\".align-btn\")[1].classList.remove(self.selectedToolsClass);\n      scope.querySelectorAll(\".align-btn\")[2].classList.remove(self.selectedToolsClass);\n\n      switch (defaultVal.align) {\n        case \"right\":\n          scope.querySelectorAll(\".align-btn\")[0].classList.add(self.selectedToolsClass);\n          break;\n\n        case \"center\":\n          scope.querySelectorAll(\".align-btn\")[1].classList.add(self.selectedToolsClass);\n          break;\n\n        case \"left\":\n          scope.querySelectorAll(\".align-btn\")[2].classList.add(self.selectedToolsClass);\n          break;\n      }\n\n      scope.querySelector(\"#colRight\").hidden = true;\n      scope.querySelector(\"#rowTop\").hidden = true;\n      scope.querySelector(\"#deleteCol\").hidden = true;\n      scope.querySelector(\"#deleteRow\").hidden = true;\n      scope.querySelector(\"#hideCol\").hidden = true;\n      scope.querySelector(\"#showCol\").hidden = true;\n      scope.querySelector(\"#hideRow\").hidden = true;\n      scope.querySelector(\"#showRow\").hidden = true;\n      scope.querySelector(\"#mergeCells\").hidden = !self.hasTrueShape;\n      scope.querySelector(\"#unMergeCells\").hidden = true;\n      self.scope.find(\".fnt-selector\").fontSelector(\"setValue\", {\n        textFontSize: defaultVal.textFontSize,\n        textFontFamily: defaultVal.textFontFamily\n      });\n    };\n\n    self.selectedCells = [];\n    self.hasTrueShape = false;\n\n    self.toolbarState = function () {\n      var _self$scope$find$rg = self.scope.find(\".rp-gen\").rg(\"getToolbarStateData\"),\n          _self$scope$find$rg2 = _slicedToArray(_self$scope$find$rg, 5),\n          cells = _self$scope$find$rg2[0],\n          shapeData = _self$scope$find$rg2[1],\n          model = _self$scope$find$rg2[2],\n          showUndo = _self$scope$find$rg2[3],\n          showRedo = _self$scope$find$rg2[4];\n\n      self.selectedCells = cells;\n      self.hasTrueShape = shapeData[4];\n      var scope = document.getElementById(self.id); //scope.querySelector(\"#undoAction\").hidden = !showUndo;\n      //scope.querySelector(\"#redoAction\").hidden = !showRedo;\n\n      if (self.selectedCells.length > 1 || self.selectedCells.length === 0) {\n        self.resetToolBar();\n        return;\n      } else {\n        var cell = self.selectedCells[0];\n        scope.querySelector(\"#colRight\").hidden = false;\n        scope.querySelector(\"#rowTop\").hidden = false;\n        scope.querySelector(\"#deleteCol\").hidden = false;\n        scope.querySelector(\"#deleteRow\").hidden = false;\n        scope.querySelector(\"#mergeCells\").hidden = true; //scope.querySelector(\"#undoAction\").hidden = !showUndo;\n        //scope.querySelector(\"#redoAction\").hidden = !showRedo;\n\n        scope.querySelector(\"#unMergeCells\").hidden = cell.colSpan === 1 && cell.rowSpan === 1;\n        scope.querySelector(\"#textColor\").style.backgroundColor = cell.style.textColor;\n        scope.querySelector(\"#backColor\").style.backgroundColor = cell.style.backColor;\n        scope.querySelector(\"#hideCol\").hidden = model.hiddenCols.indexOf(cell.col) !== -1;\n        scope.querySelector(\"#showCol\").hidden = model.hiddenCols.length === 0 || model.hiddenCols.indexOf(cell.col) === -1;\n        scope.querySelector(\"#hideRow\").hidden = model.hiddenRows.indexOf(cell.row) !== -1;\n        scope.querySelector(\"#showRow\").hidden = model.hiddenRows.length === 0 || model.hiddenRows.indexOf(cell.row) === -1;\n        if (cell.style.textBold) scope.querySelector(\"#textBold\").classList.add(self.selectedToolsClass);else scope.querySelector(\"#textBold\").classList.remove(self.selectedToolsClass);\n        if (cell.style.textItalic) scope.querySelector(\"#textItalic\").classList.add(self.selectedToolsClass);else scope.querySelector(\"#textItalic\").classList.remove(self.selectedToolsClass);\n        if (cell.style.textUnderline) scope.querySelector(\"#textUnderline\").classList.add(self.selectedToolsClass);else scope.querySelector(\"#textUnderline\").classList.remove(self.selectedToolsClass);\n        scope.querySelectorAll(\".align-btn\")[0].classList.remove(self.selectedToolsClass);\n        scope.querySelectorAll(\".align-btn\")[1].classList.remove(self.selectedToolsClass);\n        scope.querySelectorAll(\".align-btn\")[2].classList.remove(self.selectedToolsClass);\n\n        switch (cell.style.textAlign) {\n          case \"right\":\n            scope.querySelectorAll(\".align-btn\")[0].classList.add(self.selectedToolsClass);\n            break;\n\n          case \"center\":\n            scope.querySelectorAll(\".align-btn\")[1].classList.add(self.selectedToolsClass);\n            break;\n\n          case \"left\":\n            scope.querySelectorAll(\".align-btn\")[2].classList.add(self.selectedToolsClass);\n            break;\n        }\n\n        self.scope.find(\".fnt-selector\").fontSelector(\"setValue\", {\n          textFontSize: cell.style.textFontSize,\n          textFontFamily: cell.style.textFontFamily\n        });\n        scope.querySelector(\"#cellAddress\").innerText = cell.address;\n        scope.querySelector(\".txtFormula\").style.color = cell.hasError === true ? \"red\" : \"black\";\n        if (!_h.isNullOrEmpty(cell.value) && (cell.value.startsWith(\"=\") || cell.value.indexOf(\"node\") !== -1)) scope.querySelector(\".txtFormula\").value = cell.value;else scope.querySelector(\".txtFormula\").value = \"\";\n      }\n    };\n\n    self.getScope = function () {\n      return $(\"#\" + self.id);\n    };\n\n    self.handleFormula = function (param) {\n      var input = self.getScope().find(\".txtFormula\");\n      var val = $(input).val().trim();\n      if (param) val = param.trim();\n\n      if (self.selectedCells.length === 1) {\n        if (!_h.isNullOrEmpty(val) && val !== '' && val.startsWith('=')) {\n          var res = self.scope.find(\".rp-gen\").rg(\"setFormula\", {\n            id: \"Formula\",\n            value: val\n          });\n          $(input).val(res.hasError === true ? \"\" : res.value);\n          $(input).css(\"color\", res.hasError === true ? \"red\" : \"black\");\n        }\n\n        if (!_h.isNullOrEmpty(val) && val !== '' && !val.startsWith('=')) {\n          var financialPeriod = self.selectedCells[0].extraParams.financialPeriod;\n          self.checkNodePhrase(val.trim(), financialPeriod, function (data) {\n            if (data && data.isValid) {\n              $(input).css(\"color\", \"black\");\n              data.nodes.filter(function (a) {\n                return a.periodId = financialPeriod;\n              });\n              self.scope.find(\".rp-gen\").rg(\"setFormula\", {\n                id: \"NodeInCell\",\n                value: data.nodes\n              });\n              self.infoDropDownModel().refresh();\n            } else {\n              $(input).css(\"color\", \"red\");\n            }\n          });\n        }\n\n        if (_h.isEmpty(val)) {\n          self.scope.find(\".rp-gen\").rg(\"setFormula\", {\n            id: \"Formula\",\n            value: undefined\n          });\n          $(input).css(\"color\", \"black\");\n        }\n      }\n    };\n\n    self.config = function (data, bindErrors) {\n      var baseSelector = \"#\" + self.id;\n      var defaultVal = self.getDefault();\n      $(baseSelector + \" .toolbar-btn\").on(\"click\", function (event) {\n        event.stopPropagation();\n        defaultVal = self.getDefault();\n        var btn = $(event.currentTarget);\n        var id = btn.attr(\"id\");\n        var dvalue = btn.attr(\"data-value\");\n        if (btn.hasClass(\"align-btn\")) $(baseSelector + \" .align-btn\").removeClass(\"selected-tools\");\n        var obj = {\n          id: id,\n          \"default\": defaultVal\n        };\n        if (dvalue) obj.value = dvalue;\n        var res = self.scope.find(\".rp-gen\").rg(\"command\", obj);\n        if ($(btn).hasClass(\"show-select\")) res ? $(btn).addClass(\"selected-tools\") : $(btn).removeClass(\"selected-tools\");\n        self.toolbarState();\n\n        _h.activeTooltip(true);\n\n        self.refreshCompare();\n        return false;\n      });\n      self.scope.find(\".fnt-selector\").fontSelector({\n        textFontSize: defaultVal.textFontSize,\n        textFontFamily: defaultVal.textFontFamily\n      });\n      self.scope.find(\".fnt-selector\").on(\"selectionchange\", function (evt, data) {\n        defaultVal = self.getDefault();\n        self.scope.find(\".rp-gen\").rg(\"command\", {\n          id: data.type,\n          value: data.value,\n          \"default\": defaultVal\n        });\n        self.toolbarState();\n      }).on(\"outOfTable\", function (x, tag, z) {\n        var ul = self.scope.find(\".fnt-selectbox\");\n        if (ul.css(\"display\") !== \"none\") $(ul).css(\"display\", \"\");\n      });\n      $(document).on(\"click\", baseSelector + \" .evo-palette td\", function (e) {\n        e.stopPropagation();\n        var target = e.target;\n\n        if (target) {\n          defaultVal = self.getDefault();\n          var color = $(target).css(\"background-color\");\n\n          var trColor = _h.toHex3(color);\n\n          var parent = $(target).closest(\".dropdown-menu\");\n\n          if (parent) {\n            var prop = parent.attr(\"data-prop\");\n\n            if (prop) {\n              self.scope.find(\".rp-gen\").rg(\"command\", {\n                id: prop,\n                value: trColor,\n                \"default\": defaultVal\n              });\n              self.scope.find(\"#\" + prop).css(\"backgroundColor\", trColor);\n              self.toolbarState();\n            }\n          }\n        }\n      });\n      $(document).on(\"click\", baseSelector + \" .eraseColor\", function (e) {\n        e.stopPropagation();\n        var target = e.target;\n\n        if (target) {\n          defaultVal = self.getDefault();\n          var parent = $(target).closest(\".dropdown-menu\");\n\n          if (parent) {\n            var prop = parent.attr(\"data-prop\");\n\n            if (prop) {\n              self.scope.find(\".rp-gen\").rg(\"command\", {\n                id: prop,\n                value: \"\",\n                \"default\": defaultVal\n              });\n              self.scope.find(\"#\" + prop).css(\"backgroundColor\", \"\");\n            }\n          }\n        }\n\n        return false;\n      });\n      $(document).on('keydown', baseSelector + \" .txtFormula\", function (evt, param) {\n        evt = evt || window.event;\n        var charCode = evt.which ? evt.which : evt.keyCode;\n\n        if (charCode === 13) {\n          self.handleFormula(param);\n          evt.preventDefault();\n\n          _h.activeTooltip(true);\n\n          return false;\n        }\n      });\n      $(document).on('focus', baseSelector + ' .txtFormula', function (evt) {\n        var val = $(baseSelector + ' .txtFormula').val();\n\n        if (!self.infoDropDownModel().show() && val.startsWith(\"[node:\")) {\n          self.infoDropDownModel().init();\n        }\n      });\n      self.scope.find(\".rp-gen\").rg({\n        model: data,\n        type: \"edit\",\n        bindErrors: bindErrors,\n        handleFormula: self.handleFormula,\n        baseSelector: baseSelector\n      });\n      self.scope.find(\"table\").on(\"selectionchange\", function () {\n        self.toolbarState();\n\n        if (_h.kocnx().ttvm().cellSpecMenuModel.show()) {\n          _h.kocnx().ttvm().refreshCellSpecMenu();\n        }\n\n        if (self.infoDropDownModel().show() && !$(baseSelector + ' .txtFormula').is(\":focus\")) {\n          self.infoDropDownModel().terminate();\n        }\n      }).on(\"outOfTable\", function (x, tag, z) {\n        if (self.contextMenuModel.show() && !$(tag).hasClass(\"selectable\")) self.contextMenuModel.show(false);\n\n        if (self.infoDropDownModel().show() && !$(tag).hasClass(\"remove-node-btn\") && !$(tag).closest(\".f-info-drop\").length && !$(tag).closest(\".txtFormula\").length && !$(tag).closest(\".page-number-item\").length && !$(tag).closest(\".btn-sm\").length && !$(tag).closest(\".btn-pag\").length && !$(baseSelector + ' .txtFormula').is(\":focus\")) {\n          self.infoDropDownModel().terminate();\n        }\n      }).on(\"contextMenu\", function (evt, target, z) {\n        if (target.nodeName === \"INPUT\") {\n          _h.kocnx().ttvm().toggleCellSpecMenu();\n\n          return false;\n        }\n\n        var loc = target.classList.contains(\"rp-gen-col\") ? \"col\" : target.classList.contains(\"first-cell\") ? \"row\" : \"cross\";\n        var colNumber = Number($(target).attr(\"data-col\"));\n        var model = $(evt.target).data(\"model\");\n        var zeroCol = model.cells.filter(function (a) {\n          return a.col === colNumber;\n        })[0];\n        if (!model.financialProperties.sortColumn) model.financialProperties.sortColumn = {};\n        var height, width;\n\n        if (loc === \"cross\") {\n          height = 30;\n          width = 150;\n        } else {\n          height = Number(target.style.height.replace(\"px\", \"\"));\n          width = Number(target.style.width.replace(\"px\", \"\"));\n        }\n\n        self.contextMenuModel.init({\n          element: target,\n          viewType: loc,\n          colNumber: colNumber,\n          rowNumber: Number($(target).attr(\"data-row\")),\n          parent: self,\n          textWrap: zeroCol ? zeroCol.style.textWrap : undefined,\n          sortDirection: loc === \"col\" && colNumber === model.financialProperties.sortColumn.id ? model.financialProperties.sortColumn.sortDirection : undefined,\n          regions: loc === \"col\" && colNumber === model.financialProperties.sortColumn.id ? model.financialProperties.sortColumn.regions : undefined,\n          width: width,\n          height: height\n        });\n        return false;\n      }).on(\"floatingMenu\", function (evt, target, z) {\n        if (self.floatingMenuModel.show()) {\n          self.selectedCells = self.scope.find(\".rp-gen\").rg(\"getSelectedCells\");\n\n          if (self.selectedCells.length > 0) {\n            var cell = self.selectedCells[0];\n            var nodes = self.scope.find(\".rp-gen\").rg(\"getCellValues\");\n            self.floatingMenuModel.init({\n              element: target,\n              viewType: \"cell\",\n              parent: self,\n              cell: cell,\n              sortDirection: columnModel.sortDirection,\n              groupType: columnModel.groupType\n            });\n          }\n        }\n\n        return false;\n      });\n      self.adjustSecondScrollBar(baseSelector);\n    };\n\n    self.refreshCompare = function () {\n      if (_h.kocnx().ttvm().rgMenu().showCompare()) _h.kocnx().ttvm().rgMenu().compareCellModel().refresh();\n    };\n\n    self.configCellSelect = function (data) {\n      self.scope.find(\".rp-gen\").rg({\n        model: data,\n        type: \"cellSelect\"\n      });\n      self.scope.find(\"table\").on(\"selectionchange\", function (event, cell) {\n        if (!cell) return;\n\n        var designItem = _h.kocnx().ttvm().findFocusDesignItem();\n\n        var name = self.parent.templateName();\n        if (!name) name = self.parent.getTemplateName(self.parent.tableTemplateId());\n        $(\"#rg-\" + designItem.value()).find(\".rp-gen\").rg(\"command\", {\n          id: \"LinkedCell\",\n          value: {\n            tId: cell.id,\n            templateTableType: cell.templateTableType,\n            tTitle: cell.title,\n            tag: cell.tag,\n            title: name + \"(\" + cell.address + \")\"\n          }\n        });\n\n        _h.kocnx().ttvm().focusDesignItem().refreshToolBar(true);\n\n        _h.activeTooltip(true);\n      });\n      var width = self.scope.find(\".rp-gen table\").width();\n      if (width > 650) $(\".select-cell-box\").css(\"width\", \"70%\");else $(\".select-cell-box\").css(\"width\", \"\");\n      self.adjustSecondScrollBar(\"#selectcell-box\");\n    };\n\n    self.init = function () {\n      self.getData();\n      self.findScope();\n\n      if (self.type === \"edit\") {\n        self.previewMode.subscribe(function (newVal) {\n          if (newVal) {\n            var record = _h.kocnx().ttvm().findFocusDesignItem();\n\n            self.scope.find(\".rp-gen\").rg(\"previewMode\", \"set\", record.previewResult, record.bindErrors, record.hiddenRows, record.hiddenCols);\n            self.refreshCharts();\n          } else {\n            self.scope.find(\".rp-gen\").rg(\"previewMode\", \"reset\");\n            self.refreshCharts();\n          }\n        });\n        self.active.subscribe(function (newVal) {\n          if (newVal && !self.firstLoad()) {\n            self.getData();\n          }\n        });\n      }\n\n      self.tableTemplateId.subscribe(function (newValue) {\n        if (newValue) self.getData();\n      });\n      self.triggerEditable.subscribe(function (newValue) {\n        if (newValue) self.toggleEditable();\n      });\n      self.refreshToolBar.subscribe(function (newValue) {\n        if (newValue) self.toolbarState();\n      });\n    };\n\n    self.adjustSecondScrollBar = function (selector) {\n      var parent = $(selector);\n      var table = parent.find(\".rp-gen table\");\n\n      if (table.length) {\n        var scrollBar = parent.find(\"#second-scrollbar\");\n        var scrollBar2 = parent.find(\"#third-scrollbar\");\n        scrollBar.find(\"div\").width(table.width());\n        scrollBar2.find(\"div\").width(table.width());\n        $(selector + \" #second-scrollbar\").on(\"scroll\", function () {\n          $(selector).find(\".rp-gen\").scrollLeft($(this).scrollLeft());\n        });\n        $(selector + \" .rp-gen\").on(\"scroll\", function () {\n          $(selector + \" #second-scrollbar\").scrollLeft($(this).scrollLeft());\n          $(selector + \" #third-scrollbar\").scrollLeft($(this).scrollLeft());\n        });\n        $(selector + \" #third-scrollbar\").on(\"scroll\", function () {\n          $(selector).find(\".rp-gen\").scrollLeft($(this).scrollLeft());\n        });\n      }\n    };\n\n    setTimeout(function () {\n      self.init();\n    }, 100);\n    self.chartMenuModel = ko.observable(new _pages_tabletemplate_model__WEBPACK_IMPORTED_MODULE_1__.ChartMenu());\n    self.charts = ko.observableArray([]);\n\n    self.addChart = function (item) {\n      var list = self.selectedCells;\n\n      if (list.length > 1) {\n        if (self.charts().length >= 5) {\n          toast.custom(\"error\", ' تعداد نمودار های مجاز یک قالب جدول 5 عدد میباشد ');\n          return;\n        }\n\n        var chart = new _pages_tabletemplate_model__WEBPACK_IMPORTED_MODULE_1__.DomChart(self, true);\n        self.charts.push(chart);\n        chart.fillEmpty(item, self.charts().length, list);\n      } else {\n        toast.custom(\"error\", 'ابتدا باید یک محدوده از سلولها را انتخاب کنید');\n      }\n    };\n\n    self.toggleChartShow = function (item) {\n      if (!item.showChart()) {\n        item.showChart(true);\n        self.refreshChartData(item);\n      } else {\n        item.showChart(false);\n        self.chartMenuModel().close(item);\n      }\n    };\n\n    self.removeChart = function (item, e) {\n      self.chartMenuModel().close(item);\n      self.charts.remove(item);\n      e.stopPropagation();\n    };\n\n    self.showChartMenu = function (item, e) {\n      if (!self.chartMenuModel().show()) {\n        self.chartMenuModel().open(e, item);\n      } else self.chartMenuModel().close(e, item);\n    };\n\n    self.refreshChartData = function (item) {\n      var cells = self.selectedCells;\n      if (!cells.length) return;\n      item.configChart();\n    };\n\n    self.onChartMouseOver = function (item) {\n      $(\"#box\" + item.id()).find(\".toolbar-chart\").css(\"display\", \"block\");\n    };\n\n    self.onChartMouseOut = function (item) {\n      $(\"#box\" + item.id()).find(\".toolbar-chart\").css(\"display\", \"\");\n    };\n\n    self.refreshCharts = function () {\n      if (_h.any(self.charts())) for (var j = 0; j < self.charts().length; j++) {\n        if (self.charts()[j].showChart()) self.charts()[j].configChart();\n      }\n    };\n\n    self.toggleDescCell = function () {\n      if (self.showDesc()) {\n        self.showDesc(false);\n        self.descCellModel(null);\n      } else {\n        var cells = self.selectedCells;\n        if (cells.length !== 1) return;\n        var record = new _pages_tabletemplate_model__WEBPACK_IMPORTED_MODULE_1__.DescCell(cells[0]);\n        self.descCellModel(record);\n        self.showDesc(true);\n        var target = self.scope.find(\".rp-gen\").rg(\"getCellElement\");\n        $(\".desc-box\").position({\n          my: 'top top',\n          at: 'top top',\n          of: $(target)\n        });\n      }\n    };\n\n    self.saveAsDefault = function () {\n      if (!self.editable()) return;\n      var textColor = self.scope.find(\"#textColor\")[0].style.backgroundColor;\n      var backColor = self.scope.find(\"#backColor\")[0].style.backgroundColor;\n      var align = self.scope.find(\".align-btn.selected-tools\");\n\n      if (align.length) {\n        align = $(align).attr(\"data-value\");\n      } else {\n        align = undefined;\n      }\n\n      var fontData = self.scope.find(\".fnt-selector\").fontSelector(\"getValues\");\n      clientStorage.setSetting([{\n        key: \"DefaultTemplateStyle\",\n        value: JSON.stringify({\n          textColor: textColor,\n          backColor: backColor,\n          textFontFamily: fontData[0],\n          textFontSize: fontData[1],\n          align: align\n        })\n      }]);\n\n      var text = _h.getApiMessage(\"SaveSetting\");\n\n      _h.successToast(text);\n    };\n\n    self.getDefault = function () {\n      var model = {};\n      var data = clientStorage.getSetting(\"DefaultTemplateStyle\");\n\n      if (!_h.isEmpty(data)) {\n        model = JSON.parse(data);\n        if (!model.textFontSize) model.textFontSize = \"12px\";\n        if (!model.textFontFamily) model.textFontFamily = \"Nazanin\";\n      } else {\n        return {\n          textColor: \"\",\n          backColor: \"\",\n          textFontSize: \"12px\",\n          textFontFamily: \"Nazanin\",\n          align: undefined\n        };\n      }\n\n      return model;\n    };\n\n    self.undo = function () {\n      var defaultVal = self.getDefault();\n      self.scope.find(\".rp-gen\").rg(\"undo\", defaultVal);\n      setTimeout(function () {\n        self.toolbarState();\n\n        _h.kocnx().ttvm().refreshCellSpecMenu();\n      }, 50);\n      self.refreshCompare();\n    };\n\n    self.redo = function () {\n      var defaultVal = self.getDefault();\n      self.scope.find(\".rp-gen\").rg(\"redo\", defaultVal);\n      setTimeout(function () {\n        self.toolbarState();\n      }, 50);\n      self.refreshCompare();\n    };\n\n    self.dispose = function () {\n      var baseSelector = \"#\" + self.id;\n      $(baseSelector + \" .toolbar-btn\").off('click');\n    };\n  },\n  template: '<!-- ko template: { name: \"rg-component-t\" } --><!-- /ko -->'\n});\n$(document).on(\"shown.bs.tab\", '.rg-tab a[data-toggle=\"tab\"]', function () {\n  var all = ko.contextFor(this);\n\n  _h.kocnx().ttvm().changeDesignItem(all.$data);\n\n  return false;\n});\n\n//# sourceURL=webpack://domino/./src/scripts/components/ko-rg.js?");

/***/ }),

/***/ "./src/scripts/components/ko-rgborder.js":
/*!***********************************************!*\
  !*** ./src/scripts/components/ko-rgborder.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nko.components.register('ko-rgborder', {\n  viewModel: function viewModel(params) {\n    var self = this;\n    self.tableTemplateId = params.tableTemplateId;\n    self.id = \"rg-\" + self.tableTemplateId();\n    self.scope = null;\n    self.hasTrueShape = false;\n    self.borderWidths = ko.observableArray([{\n      id: 1,\n      value: \"1px\"\n    }, {\n      id: 2,\n      value: \"3px\"\n    }, {\n      id: 3,\n      value: \"5px\"\n    }]);\n    self.borders = {\n      right: {\n        enable: ko.observable(false),\n        value: ko.observable(\"\")\n      },\n      top: {\n        enable: ko.observable(false),\n        value: ko.observable(\"\")\n      },\n      bottom: {\n        enable: ko.observable(false),\n        value: ko.observable(\"\")\n      },\n      left: {\n        enable: ko.observable(false),\n        value: ko.observable(\"\")\n      },\n      insideVert: {\n        enable: ko.observable(false),\n        value: ko.observable(\"\")\n      },\n      insideHorz: {\n        enable: ko.observable(false),\n        value: ko.observable(\"\")\n      }\n    };\n    self.borderColorList = ko.observableArray([\"c00000\", \"ff0000\", \"ff842d\", \"ffc000\", \"ffff00\", \"92d050\", \"00b050\", \"00b0f0\", \"0070c0\", \"002060\", \"7030a0\", \"000000\", \"808080\"]);\n    self.borderStyles = ko.observableArray([{\n      id: 1,\n      style: \"2px solid black\",\n      value: \"solid\"\n    }, {\n      id: 2,\n      style: \"2px dashed black\",\n      value: \"dashed\"\n    }, {\n      id: 3,\n      style: \"3px double black\",\n      value: \"double\"\n    }]);\n    self.borderStyleVal = ko.observable(\"\").extend({\n      deferred: true\n    });\n    self.borderWidthVal = ko.observable(\"\").extend({\n      deferred: true\n    });\n    self.borderColorVal = ko.observable(\"\").extend({\n      deferred: true\n    });\n\n    self.hasBorder = function (cell, side) {\n      var borderStyles = cell.style.borderStyle.split(\" \");\n      borderStyles = _h.cleanArray(borderStyles);\n      var borderWidths = cell.style.borderWidth.split(\" \");\n      borderWidths = _h.cleanArray(borderWidths);\n\n      switch (side) {\n        case \"top\":\n          return !borderWidths[0].startsWith(\"0\") && !borderStyles[0].startsWith(\"none\");\n\n        case \"bottom\":\n          return !borderWidths[2].startsWith(\"0\") && !borderStyles[2].startsWith(\"none\");\n\n        case \"left\":\n          return !borderWidths[3].startsWith(\"0\") && !borderStyles[3].startsWith(\"none\");\n\n        case \"right\":\n          return !borderWidths[1].startsWith(\"0\") && !borderStyles[1].startsWith(\"none\");\n\n        case \"any\":\n          if (borderWidths.length === 0 || borderStyles.length === 0) return false;\n          return borderWidths[0] && !borderWidths[0].startsWith(\"0\") && !borderStyles[0].startsWith(\"none\") || borderWidths[2] && !borderWidths[2].startsWith(\"0\") && !borderStyles[2].startsWith(\"none\") || borderWidths[3] && !borderWidths[3].startsWith(\"0\") && !borderStyles[3].startsWith(\"none\") || borderWidths[1] && !borderWidths[1].startsWith(\"0\") && !borderStyles[1].startsWith(\"none\");\n      }\n    };\n\n    self.getAllSideBorders = function (cell) {\n      var borderStyles = cell.style.borderStyle.split(\" \");\n      borderStyles = _h.cleanArray(borderStyles);\n      var borderWidths = cell.style.borderWidth.split(\" \");\n      borderWidths = _h.cleanArray(borderWidths);\n      var borderColors = cell.style.borderColor.split(\" \");\n      borderColors = _h.cleanArray(borderColors);\n      if (_h.any(borderColors)) for (var i = 0; i < borderColors.length; i++) {\n        if (borderColors[i].indexOf(\"undefined\") !== -1) {\n          borderColors[i] = \"#000000\";\n        }\n      }\n      return [borderStyles, borderWidths, borderColors];\n    };\n\n    self.bordersBind = function () {\n      var data = self.scope.find(\".rp-gen\").rg(\"getSelectedCellsData\");\n      self.selectedCells = data.cells;\n      self.hasTrueShape = data.shapeData[4];\n\n      if (self.selectedCells.length === 0 || self.selectedCells.length > 1 && !self.hasTrueShape) {\n        self.borders.top.value(\"\");\n        self.borders.right.value(\"\");\n        self.borders.bottom.value(\"\");\n        self.borders.left.value(\"\");\n        self.borders.insideVert.value(\"\");\n        self.borders.insideHorz.value(\"\");\n        self.borders.top.enable(false);\n        self.borders.right.enable(false);\n        self.borders.bottom.enable(false);\n        self.borders.left.enable(false);\n        self.borders.insideVert.enable(false);\n        self.borders.insideHorz.enable(false);\n        self.borderStyleVal(\"solid\");\n        self.borderWidthVal(\"1px\");\n        if (_h.isNullOrEmpty(self.borderColorVal()) || self.borderColorVal() === \"\") self.borderColorVal(\"#000000\");\n      }\n\n      if (self.selectedCells.length === 1) {\n        self.oneSideBind(self.selectedCells[0]);\n      }\n\n      if (self.selectedCells.length > 1 && self.hasTrueShape) {\n        var vertexes = self.scope.find(\".rp-gen\").rg(\"getBorder\");\n        var rightSide = true;\n        var leftSide = true;\n        var topSide = true;\n        var bottomSide = true;\n        var insideVertSide = true;\n        var insideHorzSide = true;\n        var rightSideItem = null;\n        var leftSideItem = null;\n        var topSideItem = null;\n        var bottomSideItem = null;\n        var insideVertSideItem = null;\n        var insideHorzSideItem = null;\n        var borderStyle = \"\";\n        var borderWidth = \"\";\n        var borderColor = \"\";\n\n        for (var i = 0; i < self.selectedCells.length; i++) {\n          var target = self.selectedCells[i];\n\n          if (target.col === vertexes.sCol) {\n            if (!self.hasBorder(target, \"right\")) rightSide = false;\n            if (rightSide && rightSideItem === null) rightSideItem = target;\n          }\n\n          if (target.col === vertexes.bCol) {\n            if (!self.hasBorder(target, \"left\")) leftSide = false;\n            if (leftSide && leftSideItem === null) leftSideItem = target;\n          }\n\n          if (target.row === vertexes.sRow) {\n            if (!self.hasBorder(target, \"top\")) topSide = false;\n            if (topSide && topSideItem === null) topSideItem = target;\n          }\n\n          if (target.row === vertexes.bRow) {\n            if (!self.hasBorder(target, \"bottom\")) bottomSide = false;\n            if (bottomSide && bottomSideItem === null) bottomSideItem = target;\n          }\n\n          if (target.col < vertexes.bCol) {\n            if (!self.hasBorder(target, \"left\")) insideVertSide = false;\n            if (insideVertSide && insideVertSideItem === null) insideVertSideItem = target;\n          }\n\n          if (target.row < vertexes.bRow) {\n            if (!self.hasBorder(target, \"bottom\")) insideHorzSide = false;\n            if (insideHorzSide && insideHorzSideItem === null) insideHorzSideItem = target;\n          }\n\n          if (target.col === vertexes.bCol && vertexes.bCol === vertexes.sCol) {\n            insideVertSide = false;\n            if (insideVertSide && insideVertSideItem === null) insideVertSideItem = target;\n          }\n\n          if (target.row === vertexes.bRow && vertexes.bRow === vertexes.sRow) {\n            insideHorzSide = false;\n            if (insideHorzSide && insideHorzSideItem === null) insideHorzSideItem = target;\n          }\n        }\n\n        self.borders.top.value(\"\");\n        self.borders.right.value(\"\");\n        self.borders.bottom.value(\"\");\n        self.borders.left.value(\"\");\n        self.borders.insideVert.value(\"\");\n        self.borders.insideHorz.value(\"\");\n\n        if (rightSide) {\n          var rightbordersData = self.getAllSideBorders(rightSideItem);\n          self.borders.right.value(\"border-width: \" + rightbordersData[1][1] + \";border-style: \" + rightbordersData[0][1] + \";border-color: \" + rightbordersData[2][1] + \";\");\n          borderStyle = rightbordersData[0][1];\n          borderWidth = rightbordersData[1][1];\n          borderColor = rightbordersData[2][1];\n        }\n\n        if (leftSide) {\n          var leftbordersData = self.getAllSideBorders(leftSideItem);\n          self.borders.left.value(\"border-width: \" + leftbordersData[1][3] + \";border-style: \" + leftbordersData[0][3] + \";border-color: \" + leftbordersData[2][3] + \";\");\n          borderStyle = leftbordersData[0][3];\n          borderWidth = leftbordersData[1][3];\n          borderColor = leftbordersData[2][3];\n        }\n\n        if (topSide) {\n          var topbordersData = self.getAllSideBorders(topSideItem);\n          self.borders.top.value(\"border-width: \" + topbordersData[1][0] + \";border-style: \" + topbordersData[0][0] + \";border-color: \" + topbordersData[2][0] + \";\");\n          borderStyle = topbordersData[0][0];\n          borderWidth = topbordersData[1][0];\n          borderColor = topbordersData[2][0];\n        }\n\n        if (bottomSide) {\n          var bottombordersData = self.getAllSideBorders(bottomSideItem);\n          self.borders.bottom.value(\"border-width: \" + bottombordersData[1][2] + \";border-style: \" + bottombordersData[0][2] + \";border-color: \" + bottombordersData[2][2] + \";\");\n          borderStyle = bottombordersData[0][2];\n          borderWidth = bottombordersData[1][2];\n          borderColor = bottombordersData[2][2];\n        }\n\n        if (insideVertSide) {\n          var insideVertbordersData = self.getAllSideBorders(insideVertSideItem);\n          self.borders.insideVert.value(\"border-width: \" + insideVertbordersData[1][3] + \";border-style: \" + insideVertbordersData[0][3] + \";border-color: \" + insideVertbordersData[2][3] + \";\");\n          borderStyle = insideVertbordersData[0][3];\n          borderWidth = insideVertbordersData[1][3];\n          borderColor = insideVertbordersData[2][3];\n        }\n\n        if (insideHorzSide) {\n          var insideHorzbordersData = self.getAllSideBorders(insideHorzSideItem);\n          self.borders.insideHorz.value(\"border-width: \" + insideHorzbordersData[1][2] + \";border-style: \" + insideHorzbordersData[0][2] + \";border-color: \" + insideHorzbordersData[2][2] + \";\");\n          borderStyle = insideHorzbordersData[0][2];\n          borderWidth = insideHorzbordersData[1][2];\n          borderColor = insideHorzbordersData[2][2];\n        }\n\n        self.borders.top.enable(topSide);\n        self.borders.right.enable(rightSide);\n        self.borders.bottom.enable(bottomSide);\n        self.borders.left.enable(leftSide);\n        self.borders.insideVert.enable(insideVertSide);\n        self.borders.insideHorz.enable(insideHorzSide);\n        self.borderStyleVal(borderStyle);\n        self.borderWidthVal(borderWidth);\n        self.borderColorVal(borderColor);\n\n        if (!topSide && !rightSide && !bottomSide && !leftSide && !insideVertSide && !insideHorzSide) {\n          self.borderStyleVal(\"solid\");\n          self.borderWidthVal(\"1px\");\n          if (_h.isNullOrEmpty(self.borderColorVal()) || self.borderColorVal() === \"\") self.borderColorVal(\"#000000\");\n        }\n      }\n    };\n\n    self.oneSideBind = function (cell) {\n      var bordersData = self.getAllSideBorders(cell);\n      var borderStyles = bordersData[0];\n      var borderWidths = bordersData[1];\n      var borderColors = bordersData[2];\n      self.borders.top.enable(!borderWidths[0].startsWith(\"0\") && !borderStyles[0].startsWith(\"none\"));\n      self.borders.right.enable(!borderWidths[1].startsWith(\"0\") && !borderStyles[1].startsWith(\"none\"));\n      self.borders.bottom.enable(!borderWidths[2].startsWith(\"0\") && !borderStyles[2].startsWith(\"none\"));\n      self.borders.left.enable(!borderWidths[3].startsWith(\"0\") && !borderStyles[3].startsWith(\"none\"));\n      self.borders.insideVert.enable(false);\n      self.borders.insideHorz.enable(false);\n      var top = self.borders.top.enable();\n      var right = self.borders.right.enable();\n      var bottom = self.borders.bottom.enable();\n      var left = self.borders.left.enable();\n      self.borders.top.value(\"\");\n      self.borders.right.value(\"\");\n      self.borders.bottom.value(\"\");\n      self.borders.left.value(\"\");\n      self.borders.insideVert.value(\"\");\n      self.borders.insideHorz.value(\"\");\n\n      if (top) {\n        self.borders.top.value(\"border-width: \" + borderWidths[0] + \";border-style: \" + borderStyles[0] + \";border-color: \" + borderColors[0] + \";\");\n        self.borderWidthVal(borderWidths[0]);\n        self.borderStyleVal(borderStyles[0]);\n        self.borderColorVal(borderColors[0]);\n      }\n\n      if (right) {\n        self.borders.right.value(\"border-width: \" + borderWidths[1] + \";border-style: \" + borderStyles[1] + \";border-color: \" + borderColors[1] + \";\");\n        self.borderWidthVal(borderWidths[1]);\n        self.borderStyleVal(borderStyles[1]);\n        self.borderColorVal(borderColors[1]);\n      }\n\n      if (bottom) {\n        self.borders.bottom.value(\"border-width: \" + borderWidths[2] + \";border-style: \" + borderStyles[2] + \";border-color: \" + borderColors[2] + \";\");\n        self.borderWidthVal(borderWidths[2]);\n        self.borderStyleVal(borderStyles[2]);\n        self.borderColorVal(borderColors[2]);\n      }\n\n      if (left) {\n        self.borders.left.value(\"border-width: \" + borderWidths[3] + \";border-style: \" + borderStyles[3] + \";border-color: \" + borderColors[3] + \";\");\n        self.borderWidthVal(borderWidths[3]);\n        self.borderStyleVal(borderStyles[3]);\n        self.borderColorVal(borderColors[3]);\n      }\n\n      if (!top && !right && !bottom && !left) {\n        self.borderStyleVal(\"solid\");\n        self.borderWidthVal(\"1px\");\n        if (_h.isNullOrEmpty(self.borderColorVal()) || self.borderColorVal() === \"\") self.borderColorVal(\"#000000\");\n      }\n    };\n\n    self.changeBorderColor = function (color) {\n      self.borderColorVal(color);\n    };\n\n    self.changeBorderStyle = function (m, v) {\n      self.borderStyleVal(v.value);\n    };\n\n    self.changeBorderWidth = function (m, v) {\n      self.borderWidthVal(v.value);\n    };\n\n    self.toggleBorderCells = function (model, command, val) {\n      if (self.selectedCells.length > 1 && self.hasTrueShape) {\n        var list = [];\n\n        switch (command) {\n          case \"bottom\":\n          case \"top\":\n          case \"right\":\n          case \"left\":\n            list = self.getSurroundingsBorder(command);\n            self.setOneSideBorders(command, list);\n            break;\n\n          case \"outside\":\n            if (!_h.isEmpty(self.borderStyleVal()) && !_h.isEmpty(self.borderWidthVal())) {\n              var listRight = self.getSurroundingsBorder(\"right\");\n              self.setOneSideBorders(\"right\", listRight);\n              var listTop = self.getSurroundingsBorder(\"top\");\n              self.setOneSideBorders(\"top\", listTop);\n              var listLeft = self.getSurroundingsBorder(\"left\");\n              self.setOneSideBorders(\"left\", listLeft);\n              var listBottom = self.getSurroundingsBorder(\"bottom\");\n              self.setOneSideBorders(\"bottom\", listBottom);\n            }\n\n            break;\n\n          case \"none\":\n            for (var i = 0; i < self.selectedCells.length; i++) {\n              self.sendJqrgCommand({\n                id: \"border\",\n                color: \"#000000\",\n                cell: self.selectedCells[i],\n                style: \"none\",\n                width: \"0\",\n                side: command\n              });\n            }\n\n            self.borders.left.value(\"\");\n            self.borders.right.value(\"\");\n            self.borders.top.value(\"\");\n            self.borders.bottom.value(\"\");\n            break;\n\n          case \"inside\":\n            self.toggleInsideBorder(\"both\");\n            break;\n\n          case \"inside-vert\":\n            self.toggleInsideBorder(\"vert\");\n            break;\n\n          case \"inside-horz\":\n            self.toggleInsideBorder(\"horz\");\n            break;\n        }\n      }\n\n      if (self.selectedCells.length === 1 || self.selectedCells.length > 1 && !self.hasTrueShape) {\n        for (var j = 0; j < self.selectedCells.length; j++) {\n          switch (command) {\n            case \"bottom\":\n            case \"top\":\n            case \"right\":\n            case \"left\":\n              self.setOneSideBorder(command, self.selectedCells[j]);\n              break;\n\n            case \"outside\":\n              if (!_h.isEmpty(self.borderStyleVal()) && !_h.isEmpty(self.borderWidthVal())) {\n                self.setOneSideBorder(\"bottom\", self.selectedCells[j]);\n                self.setOneSideBorder(\"top\", self.selectedCells[j]);\n                self.setOneSideBorder(\"right\", self.selectedCells[j]);\n                self.setOneSideBorder(\"left\", self.selectedCells[j]);\n              }\n\n              break;\n\n            case \"none\":\n              self.sendJqrgCommand({\n                id: \"border\",\n                color: \"#000000\",\n                cell: self.selectedCells[i],\n                style: \"none\",\n                width: \"0\",\n                side: command\n              });\n              self.borders.left.value(\"\");\n              self.borders.right.value(\"\");\n              self.borders.top.value(\"\");\n              self.borders.bottom.value(\"\");\n              break;\n          }\n        }\n      }\n\n      self.bordersBind();\n    };\n\n    self.setOneSideBorders = function (command, list) {\n      var zero = list[0];\n      var bordersData = self.getAllSideBorders(zero);\n      var borderStyles = bordersData[0];\n      var borderWidths = bordersData[1];\n      var borderColors = bordersData[2];\n      var bStyle = \"\";\n      var bWidth = \"\";\n      var action = \"add\";\n\n      switch (command) {\n        case \"left\":\n          bStyle = borderStyles[3];\n          bWidth = borderWidths[3];\n          break;\n\n        case \"top\":\n          bStyle = borderStyles[0];\n          bWidth = borderWidths[0];\n          break;\n\n        case \"right\":\n          bStyle = borderStyles[1];\n          bWidth = borderWidths[1];\n          break;\n\n        case \"bottom\":\n          bStyle = borderStyles[2];\n          bWidth = borderWidths[2];\n          break;\n      }\n\n      if (bStyle !== \"none\" && bWidth !== \"0\") action = \"remove\";\n\n      for (var i = 0; i < list.length; i++) {\n        var cell = list[i];\n\n        if (action === \"remove\") {\n          self.sendJqrgCommand({\n            id: \"border\",\n            color: \"#000000\",\n            cell: cell,\n            style: \"none\",\n            width: \"0\",\n            side: command\n          });\n        } else {\n          if (self.borderStyleVal() || self.borderWidthVal()) self.sendJqrgCommand({\n            id: \"border\",\n            color: self.borderColorVal(),\n            cell: cell,\n            style: self.borderStyleVal(),\n            width: self.borderWidthVal(),\n            side: command\n          });\n        }\n      }\n\n      if (action === \"remove\") {\n        self.borders[command].value(\"\");\n      } else {\n        var line = \"\";\n        line = \"border-width: \" + self.borderWidthVal() + \";\";\n        line += \"border-style: \" + self.borderStyleVal() + \";\";\n        line += \"border-color: \" + self.borderColorVal() + \";\";\n        self.borders[command].value(line);\n      }\n    };\n\n    self.setOneSideBorder = function (command, item) {\n      var cell = self.selectedCells[0];\n      if (item) cell = item;\n      var bordersData = self.getAllSideBorders(cell);\n      var borderStyles = bordersData[0];\n      var borderWidths = bordersData[1];\n\n      if (self.hasBorder(cell, command)) {\n        self.sendJqrgCommand({\n          id: \"border\",\n          color: \"#000000\",\n          cell: cell,\n          style: \"none\",\n          width: \"0\",\n          side: command\n        });\n        self.borders[command].value(\"\");\n      } else {\n        switch (command) {\n          case \"left\":\n            borderStyles = borderStyles[3];\n            borderWidths = borderWidths[3];\n            break;\n\n          case \"top\":\n            borderStyles = borderStyles[0];\n            borderWidths = borderWidths[0];\n            break;\n\n          case \"right\":\n            borderStyles = borderStyles[1];\n            borderWidths = borderWidths[1];\n            break;\n\n          case \"bottom\":\n            borderStyles = borderStyles[2];\n            borderWidths = borderWidths[2];\n            break;\n        }\n\n        var line = \"\";\n        var isChanged = false;\n\n        if (self.borderWidthVal()) {\n          line = \"border-width: \" + self.borderWidthVal() + \";\";\n          isChanged = true;\n        } else {\n          line = \"border-width: \" + borderWidths + \";\";\n        }\n\n        if (self.borderStyleVal()) {\n          line += \"border-style: \" + self.borderStyleVal() + \";border-color: \" + self.borderColorVal() + \";\";\n          isChanged = true;\n        } else {\n          line += \"border-style: \" + borderStyles + \";border-color: \" + self.borderColorVal() + \";\";\n        }\n\n        if (isChanged) self.sendJqrgCommand({\n          id: \"border\",\n          color: self.borderColorVal(),\n          cell: cell,\n          style: self.borderStyleVal(),\n          width: self.borderWidthVal(),\n          side: command\n        });\n        self.borders[command].value(line);\n      }\n    };\n\n    self.getSurroundingsBorder = function (command) {\n      var vertexes = self.scope.find(\".rp-gen\").rg(\"getBorder\");\n      var array = [];\n\n      switch (command) {\n        case \"bottom\":\n          for (var b = vertexes.sCol; b < vertexes.bCol + 1; b++) {\n            array.push(_h.numberToAlphabet(b) + vertexes.bRow);\n          }\n\n          break;\n\n        case \"top\":\n          for (var t = vertexes.sCol; t < vertexes.bCol + 1; t++) {\n            array.push(_h.numberToAlphabet(t) + vertexes.sRow);\n          }\n\n          break;\n\n        case \"right\":\n          for (var r = vertexes.sRow; r < vertexes.bRow + 1; r++) {\n            array.push(_h.numberToAlphabet(vertexes.sCol) + r);\n          }\n\n          break;\n\n        case \"left\":\n          for (var l = vertexes.sRow; l < vertexes.bRow + 1; l++) {\n            array.push(_h.numberToAlphabet(vertexes.bCol) + l);\n          }\n\n          break;\n      }\n\n      var cellArray = [];\n\n      for (var i = 0; i < self.selectedCells.length; i++) {\n        var cell = self.selectedCells[i];\n        if (array.indexOf(cell.address) !== -1) cellArray.push(cell);\n      }\n\n      return cellArray;\n    };\n\n    self.toggleInsideBorder = function (side) {\n      var vertexes = self.scope.find(\".rp-gen\").rg(\"getBorder\");\n      var model = self.scope.find(\".rp-gen\").rg(\"getModel\");\n      var zero = model.cells.filter(function (a) {\n        return a.col === vertexes.sCol && a.row === vertexes.sRow;\n      })[0];\n      var bordersData = self.getAllSideBorders(zero);\n      var borderStyles = bordersData[0];\n      var borderWidths = bordersData[1];\n      var leftHasBorder = borderStyles[3] !== \"none\" && borderWidths[3] !== \"0\";\n      var bottomHasBorder = borderStyles[2] !== \"none\" && borderWidths[2] !== \"0\";\n      var targetCol = \"\";\n      var targetRow = \"\";\n      var cell = \"\";\n      var line = \"\";\n\n      if (side === \"horz\" || side === \"both\") {\n        for (var i = 0; i < vertexes.bRow - vertexes.sRow; i++) {\n          targetRow = vertexes.sRow + i;\n\n          for (var j = 0; j < vertexes.bCol - vertexes.sCol + 1; j++) {\n            targetCol = vertexes.sCol + j;\n            cell = model.cells.filter(function (a) {\n              return a.col === targetCol && a.row === targetRow;\n            })[0];\n\n            if (bottomHasBorder) {\n              self.sendJqrgCommand({\n                id: \"border\",\n                color: \"#000000\",\n                cell: cell,\n                style: \"none\",\n                width: \"0\",\n                side: \"bottom\"\n              });\n            } else {\n              if (self.borderWidthVal() || self.borderStyleVal()) self.sendJqrgCommand({\n                id: \"border\",\n                color: self.borderColorVal(),\n                cell: cell,\n                style: self.borderStyleVal(),\n                width: self.borderWidthVal(),\n                side: \"bottom\"\n              });\n            }\n          }\n        }\n\n        if (bottomHasBorder) {\n          self.borders.insideHorz.value(\"\");\n        } else {\n          line = \"border-width: \" + self.borderWidthVal() + \";\";\n          line += \"border-style: \" + self.borderStyleVal() + \";\";\n          line += \"border-color: \" + self.borderColorVal() + \";\";\n          self.borders.insideHorz.value(line);\n        }\n      }\n\n      if (side === \"vert\" || side === \"both\") {\n        for (var k = 0; k < vertexes.bCol - vertexes.sCol; k++) {\n          targetCol = vertexes.sCol + k;\n\n          for (var l = 0; l < vertexes.bRow - vertexes.sRow + 1; l++) {\n            targetRow = vertexes.sRow + l;\n            cell = model.cells.filter(function (a) {\n              return a.col === targetCol && a.row === targetRow;\n            })[0];\n\n            if (leftHasBorder) {\n              self.sendJqrgCommand({\n                id: \"border\",\n                color: \"#000000\",\n                cell: cell,\n                style: \"none\",\n                width: \"0\",\n                side: \"left\"\n              });\n            } else {\n              if (self.borderWidthVal() || self.borderStyleVal()) self.sendJqrgCommand({\n                id: \"border\",\n                color: self.borderColorVal(),\n                cell: cell,\n                style: self.borderStyleVal(),\n                width: self.borderWidthVal(),\n                side: \"left\"\n              });\n            }\n          }\n        }\n\n        if (leftHasBorder) {\n          self.borders.insideVert.value(\"\");\n        } else {\n          line = \"\";\n          line = \"border-width: \" + self.borderWidthVal() + \";\";\n          line += \"border-style: \" + self.borderStyleVal() + \";\";\n          line += \"border-color: \" + self.borderColorVal() + \";\";\n          self.borders.insideVert.value(line);\n        }\n      }\n    };\n\n    self.sendJqrgCommand = function (obj) {\n      var defaultVal = self.getDefault();\n      obj.defaultVal = defaultVal;\n      obj.type = obj.id;\n      obj.value = obj;\n      var res = self.scope.find(\".rp-gen\").rg(\"command\", obj);\n      return res;\n    };\n\n    self.config = function (data) {\n      var baseSelector = \"#\" + self.id;\n      $(document).on(\"click\", baseSelector + \" .border-box\", function (e) {\n        e.stopPropagation();\n        self.bordersBind(true);\n      });\n    };\n\n    self.init = function () {\n      self.scope = $('#' + self.id);\n      self.config();\n    };\n\n    self.getDefault = function () {\n      var model = {};\n      var data = clientStorage.getSetting(\"DefaultTemplateStyle\");\n\n      if (!_h.isEmpty(data)) {\n        model = JSON.parse(data);\n        if (!model.textFontSize) model.textFontSize = \"12px\";\n        if (!model.textFontFamily) model.textFontFamily = \"Nazanin\";\n      } else {\n        return {\n          textColor: \"\",\n          backColor: \"\",\n          textFontSize: \"12px\",\n          textFontFamily: \"Nazanin\",\n          align: undefined\n        };\n      }\n\n      return model;\n    };\n\n    self.init();\n  },\n  template: '<!-- ko template: { name: \"rgborder-component-t\" } --><!-- /ko -->'\n});\n\n//# sourceURL=webpack://domino/./src/scripts/components/ko-rgborder.js?");

/***/ }),

/***/ "./src/scripts/components/ko-select.js":
/*!*********************************************!*\
  !*** ./src/scripts/components/ko-select.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var _hh = __webpack_require__(/*! ./src/scripts/util/htmlHelper.js */ \"./src/scripts/util/htmlHelper.js\");\n\nko.components.register('ko-select', {\n  viewModel: function viewModel(params) {\n    var self = this;\n    self.randomId = _h.createRandomNumber();\n    self.id = \"select-ul\" + self.randomId;\n    self.type = params.type;\n    self.tagManager = params.tagManager || false;\n    self.refreshFunc = params.refreshFunc;\n    self.groupBy = params.groupBy;\n    self.controlName = ko.observable(params.name);\n    self.parentForm = params.parent;\n    self.itemType = params.itemType;\n    self.apiAddress = params.apiAddress;\n\n    if (params.disable === true || params.disable === false) {\n      self.disable = ko.observable(params.disable);\n    } else if (!_h.isNullOrEmpty(params.disable)) {\n      self.disable = params.disable;\n    } else {\n      self.disable = ko.observable(false);\n    }\n\n    if (params.bindTo) {\n      params.bindTo.subscribe(function (newValue) {\n        switch (self.type) {\n          case \"multi\":\n            self.values.removeAll();\n            break;\n\n          default:\n            self.value(undefined);\n            break;\n        }\n\n        if (self.parentForm[\"onSelect\"]) self.parentForm.onSelect(self.controlName());\n        self.buildList();\n      });\n    }\n\n    self.params = params;\n    self.filter = params.filter;\n    self.value = params.value;\n    self.values = params.values;\n    self.input = ko.observable();\n    self.list = params.options;\n    if (params.optionsListVar) self.list = self.parentForm[params.optionsListVar];\n    self.renderFunc = params.renderFunc;\n    self.isComparativePeriodSelect = false;\n\n    self.fillComparativePeriodSelect = function () {\n      var name = ko.isObservable(params.name) ? params.name() : params.name;\n      name = name + \"\";\n      self.isComparativePeriodSelect = periodCustomItem.indexOf(name) !== -1 || name.indexOf(\"ComparativePeriod\") !== -1;\n    };\n\n    self.fillComparativePeriodSelect();\n    self.customShowSelect = ko.observable(self.isComparativePeriodSelect);\n\n    if (ko.isObservable(self.list)) {\n      self.list.subscribe(function (newValue, oldValue) {\n        self.buildList();\n      });\n    }\n\n    self.showMenu = ko.observable(false);\n\n    if (ko.isObservable(params.placeholder)) {\n      self.placeHolder = params.placeholder();\n    } else {\n      self.placeHolder = _h.getLocalizedText(params.placeholder !== undefined ? params.placeholder : \"selectPlaceholder\");\n    }\n\n    self.removeSelectedItem = function (item) {\n      if (self.disable()) {\n        self.showMenu(false);\n        return;\n      }\n\n      if (self.itemType) {\n        var list = ko.isObservable(self.list) ? self.list() : self.list;\n        item = list[item];\n      }\n\n      item = ko.toJS(item);\n\n      switch (self.type) {\n        case \"multi\":\n          if (_h.any(self.values()) && self.values().indexOf(item.value) !== -1) self.values.remove(item.value);\n          break;\n\n        default:\n          self.value(undefined);\n          break;\n      }\n\n      if (self.parentForm[\"onSelect\"]) self.parentForm.onSelect(self.controlName());\n      self.buildList();\n    };\n\n    self.onSelectedItem = function (item) {\n      if (self.disable()) {\n        self.showMenu(false);\n        return;\n      }\n\n      if (self.itemType) {\n        var list = ko.isObservable(self.list) ? self.list() : self.list;\n        item = list[item];\n      }\n\n      item = ko.toJS(item);\n\n      switch (self.type) {\n        case \"multi\":\n          if (_h.any(self.values()) && self.values().indexOf(item.value) !== -1) self.values.remove(item.value);\n          break;\n\n        default:\n          self.value(undefined);\n          break;\n      }\n\n      self.showMenu(true);\n      if (self.parentForm[\"onSelect\"]) self.parentForm.onSelect(self.controlName());\n      self.buildList();\n    };\n\n    if (!self.tagManager) self.input.subscribe(function (newValue) {\n      self.buildList();\n    });\n\n    self.onKeypress = function (model, evt) {\n      var charCode = evt.which ? evt.which : evt.keyCode;\n\n      if (charCode === 13) {\n        if (self.type === \"multi\" && self.tagManager) {\n          var val = $(evt.target).val();\n\n          if (val) {\n            if (_h.isEmpty(self.values()) || self.values().indexOf(val) === -1) {\n              self.values.push(val);\n              self.addTagToList(val);\n            }\n          }\n\n          self.adjustInputSize();\n          self.input('');\n        }\n\n        if (self.type === \"multi\" && !self.tagManager) {\n          self.adjustInputSize();\n        }\n      } else {\n        self.buildList();\n      }\n    };\n\n    self.onFocusOut = function (evt) {\n      $(evt.target).css(\"display\", \"none\");\n    };\n\n    self.onFocusIn = function (evt) {\n      $(evt.target).css(\"display\", \"inline-block\");\n    };\n\n    self.removeTag = function (item) {\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/common/deletetags\",\n        data: {\n          id: item.value,\n          controllerName: self.params.controllerName\n        },\n        success: function success(data) {\n          self.removeTagFromList(item);\n        },\n        error: function error(data) {}\n      });\n    };\n\n    self.removeTagFromList = function (item) {\n      var isExist;\n\n      for (var i = 0; i < self.list().length; i++) {\n        if (self.list()[i].value === item.value) isExist = self.list()[i];\n      }\n\n      if (isExist) self.list.remove(isExist);\n    };\n\n    self.addTagToList = function (val) {\n      var isExist = false;\n\n      for (var i = 0; i < self.list().length; i++) {\n        if (self.list()[i].value === val) isExist = true;\n      }\n\n      if (!isExist) self.list.push({\n        text: val,\n        value: val\n      });\n    };\n\n    self.adjustInputSize = function () {\n      var inputTag = $(\"input[dataid='\" + self.id + \"']\");\n      var val = $(inputTag).val();\n\n      if (self.type === \"multi\") {\n        if (self.values().length > 0) {\n          inputTag.css(\"margin-right\", \"5px\");\n          inputTag.css(\"width\", \"50px\");\n        } else {\n          inputTag.css(\"margin-right\", \"\");\n          $(inputTag).css(\"width\", \"\");\n        }\n      }\n    };\n\n    self.onSelectItem = function (item) {\n      switch (self.type) {\n        case \"multi\":\n          if (!_h.any(self.values()) || _h.any(self.values()) && self.values().indexOf(item.value) === -1) self.values.push(item.value);\n          self.input(undefined);\n          self.buildList();\n          self.adjustInputSize();\n          break;\n\n        default:\n          self.value(item.value);\n          self.input(undefined);\n          self.showMenu(false);\n          break;\n      }\n\n      if (self.parentForm[\"onSelect\"]) self.parentForm.onSelect(self.controlName(), item);\n    };\n\n    self.onInputFocus = function (x, e) {\n      if (self.disable()) {\n        self.showMenu(false);\n        return;\n      }\n\n      switch (self.type) {\n        case \"multi\":\n          var input = $(e.target).find(\".autocomplate-input\");\n\n          if (input) {\n            $(input).focus();\n          }\n\n          break;\n      }\n\n      var visList = $(\".drp-menu:visible\");\n\n      if (visList && visList.length > 0) {\n        for (var i = 0; i < visList.length; i++) {\n          if ($(visList[i]).attr(\"id\") !== self.id) {\n            var target = ko.contextFor(visList[i]);\n            if (target && target.$data && target.$data[\"showMenu\"]) target.$data.showMenu(false);\n          }\n        }\n      }\n\n      self.showMenu(true);\n      self.buildList();\n    };\n\n    self.isShowItem = function (item) {\n      if (self[\"filter\"] && !self.filter(item)) return false;\n\n      switch (self.type) {\n        case \"multi\":\n          if (!_h.any(self.values()) && _h.isEmpty(self.input())) return true;\n          if (_h.any(self.values()) && self.values().indexOf(item.value) !== -1) return false;\n          break;\n\n        default:\n          if (_h.isEmpty(self.value()) && _h.isEmpty(self.input())) return true;\n          if (!_h.isEmpty(self.value()) && self.value() == item.value) return false;\n          break;\n      }\n\n      if (_h.isEmpty(self.input()) || !_h.isEmpty(self.input()) && item.text && item.text.indexOf(self.input()) !== -1) return true;\n      return false;\n    };\n\n    self.isValueItem = function (item) {\n      //if (self.itemType !== \"key-obj\")\n      //    return true;\n      var itemJs = ko.toJS(item);\n\n      if (self.type === \"multi\") {\n        if (!_h.any(self.values())) return false;\n        if (self.values().indexOf(itemJs.value) !== -1) return true;\n      } else {\n        if (_h.isNullOrEmpty(self.value())) return false;\n        if (itemJs.value == self.value()) return true;\n      }\n\n      return false;\n    };\n\n    self.isNumber = function (val) {\n      try {\n        var test = val.toString();\n        var a = parseInt(test);\n        var afterParse = a.toString();\n        if (afterParse.length <= 0) return false;\n        if (afterParse.length === test.length) return true;else {\n          var backZero = _h.countBackNumberZero(test);\n\n          if (test.length - (afterParse.length + backZero) === 0) {\n            return true;\n          } else {\n            return false;\n          }\n        }\n      } catch (e) {\n        return false;\n      }\n    };\n\n    self.isEmpty = function (val) {\n      if (val === null || val === undefined || val === \"\" || val.length === 0) {\n        return true;\n      } else {\n        if (self.type === \"multi\") return false;\n        var list = ko.isObservable(self.list) ? self.list() : self.list;\n        var item,\n            res = true;\n\n        if (!self.itemType) {\n          if (list.length === 0) {\n            self.showMenu(false);\n            return true;\n          }\n\n          for (var i = 0; i < list.length; i++) {\n            item = ko.toJS(list[i]);\n            if (String(item.value) === String(val)) res = false;\n          }\n        } else {\n          var keys = Object.keys(list);\n\n          if (keys.length === 0) {\n            self.showMenu(false);\n            return true;\n          }\n\n          for (var k = 0; k < keys.length; k++) {\n            item = list[keys[k]];\n            item = ko.toJS(item);\n            if (String(item.value) === String(val)) res = false;\n          }\n        }\n\n        return res;\n      }\n    };\n\n    self.reset = function () {// todo\n    };\n\n    self.shortName = function (name) {\n      var div = $(\"#\" + self.id).prev();\n      var width = div.width() - 20;\n\n      if (width < 0) {\n        self.reset();\n        name = ko.isObservable(name) ? name() : name;\n        return name;\n      }\n\n      name = ko.isObservable(name) ? name() : name;\n\n      if (name !== null && name !== undefined) {\n        var res = name.length * 6.88 > width;\n        if (!res) return name;\n        return name.substr(0, 22) + \"...\";\n      }\n\n      return \"\";\n    };\n\n    self.getTitle = function (name) {\n      var div = $(\"#\" + self.id).prev();\n      var width = div.width() - 20;\n\n      if (width < 0) {\n        self.reset();\n        name = ko.isObservable(name) ? name() : name;\n        return name;\n      }\n\n      name = ko.isObservable(name) ? name() : name;\n\n      if (name !== null && name !== undefined) {\n        var res = name.length * 6.88 > width;\n        if (!res) return \"\";\n        return name;\n      }\n\n      return \"\";\n    };\n\n    self.buildList = function () {\n      var ul = document.getElementById(self.id);\n      if (!ul) return;\n      ul.innerHTML = \"\";\n\n      if (self.params.optionsListVar) {\n        self.list = self.parentForm[self.params.optionsListVar];\n      }\n\n      var item, li, html, span;\n      var list = ko.isObservable(self.list) ? self.list() : self.list;\n\n      if (!self.itemType) {\n        if (list.length === 0) {\n          self.showMenu(false);\n          return;\n        }\n\n        var groupVal = undefined;\n\n        for (var i = 0; i < list.length; i++) {\n          item = ko.toJS(list[i]);\n\n          if (self.groupBy) {\n            if (groupVal === undefined || item[self.groupBy] !== groupVal) {\n              groupVal = item[self.groupBy];\n\n              var groupElement = _hh.createElement(\"li\", ul);\n\n              _hh.setClassName(groupElement, \"autocom-group\");\n\n              var values = window[self.groupBy + \"s\"];\n\n              if (values && values.length) {\n                groupElement.innerText = _h.getEnumText(values, item[self.groupBy]);\n              } else {\n                groupElement.innerText = item[self.groupBy];\n              }\n            }\n          }\n\n          if (self.isShowItem(item)) {\n            li = _hh.createElement(\"li\", ul);\n            li.setAttribute(\"data-value\", item.value);\n\n            _hh.setClassName(li, \"autocom-li\");\n\n            if (self.renderFunc) {\n              html = self.renderFunc(item);\n            }\n\n            if (!_h.isNullOrEmpty(html) && html !== \"\") _hh.setInnerHtml(li, html);else {\n              span = _hh.createElement(\"span\", li);\n\n              _hh.setClassName(span, \"autocom-span\");\n\n              _hh.setInnerHtml(span, item.text);\n            }\n\n            li.onclick = function (ev) {\n              var val = this.getAttribute(\"data-value\");\n              var isRemoveLabel = ev.target.classList.contains(\"remove-tag\");\n\n              if (isRemoveLabel) {\n                self.removeTag({\n                  text: val,\n                  value: val\n                });\n              } else {\n                var text = this.innerText;\n\n                if (self.tagManager) {\n                  text = text.replace('\\n', '').replace('حذف', '');\n                } else {\n                  if (self.isNumber(val)) val = Number(val);\n                }\n\n                self.onSelectItem({\n                  text: text,\n                  value: val\n                });\n              }\n            };\n          }\n        }\n      } else {\n        var keys = Object.keys(list);\n\n        for (var k = 0; k < keys.length; k++) {\n          item = list[keys[k]];\n          item = ko.toJS(item);\n\n          if (self.isShowItem(item)) {\n            li = _hh.createElement(\"li\", ul);\n            li.setAttribute(\"data-value\", item.value);\n\n            _hh.setClassName(li, \"autocom-li\");\n\n            if (self.renderFunc) {\n              html = self.renderFunc(item);\n            }\n\n            if (!_h.isNullOrEmpty(html) && html !== \"\") _hh.setInnerHtml(li, html);else {\n              span = _hh.createElement(\"span\", li);\n\n              _hh.setClassName(span, \"autocom-span\");\n\n              _hh.setInnerHtml(span, item.text);\n            }\n\n            li.onclick = function () {\n              var val = this.getAttribute(\"data-value\");\n\n              if (!self.tagManager) {\n                if (self.isNumber(val)) val = Number(val);\n              }\n\n              self.onSelectItem({\n                text: this.innerText,\n                value: val\n              });\n            };\n          }\n        }\n      }\n\n      _h.fixItemHeight(self.id);\n\n      if (ul.childNodes.length === 0) {\n        self.showMenu(false);\n      }\n\n      self.calculateOpenListLoc();\n    };\n\n    self.calculateOpenListLoc = function () {\n      var ul = $(\"#\" + self.id);\n\n      if (ul.length > 0) {\n        ul.css('top', \"\");\n        ul.css('bottom', \"\");\n        var ulHeight = ul.height();\n        var pageHeight = $(\"body\").height();\n        var viewportOffset = ul.get(0).getBoundingClientRect();\n        var rest = pageHeight - viewportOffset.top;\n\n        if (rest < ulHeight) {\n          var ulTop = Number(ul.css('top').replace(\"px\", \"\"));\n          var newTop = ulTop - ulHeight - 8;\n          ul.css('top', newTop + \"px\");\n        } else {\n          ul.css('top', \"unset\");\n          ul.css('bottom', \"-\" + ulHeight + \"px\");\n        }\n      }\n    };\n\n    self.refreshData = function () {\n      self.refreshFunc();\n    };\n\n    setTimeout(function () {\n      self.adjustInputSize();\n    }, 300);\n  },\n  template: \"<!-- ko template: { name: 'select-component-t' } --><!-- /ko -->\"\n});\nvar periodCustomItem = [\"groupPeriod\", \"sourcePeriodId\", \"calculationPeriodId\"];\n\n//# sourceURL=webpack://domino/./src/scripts/components/ko-select.js?");

/***/ }),

/***/ "./src/scripts/pages/access/model.js":
/*!*******************************************!*\
  !*** ./src/scripts/pages/access/model.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"Access\": () => (/* binding */ Access),\n/* harmony export */   \"AccessForm\": () => (/* binding */ AccessForm)\n/* harmony export */ });\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar _require = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\"),\n    BaseModel = _require.BaseModel,\n    BaseFormModel = _require.BaseFormModel;\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\nvar Access = /*#__PURE__*/function (_BaseModel) {\n  _inherits(Access, _BaseModel);\n\n  var _super = _createSuper(Access);\n\n  function Access(model) {\n    _classCallCheck(this, Access);\n\n    return _super.call(this, model);\n  }\n\n  return _createClass(Access);\n}(BaseModel);\nvar AccessForm = /*#__PURE__*/function (_BaseFormModel) {\n  _inherits(AccessForm, _BaseFormModel);\n\n  var _super2 = _createSuper(AccessForm);\n\n  function AccessForm(viewModel, editMode, permissionList) {\n    var _this;\n\n    _classCallCheck(this, AccessForm);\n\n    _this = _super2.call(this, viewModel, editMode);\n    _this.permissions = ko.observableArray();\n\n    _this.setValidationObject();\n\n    _this.createForm();\n\n    _this.selector = \"#tree_view_pr\";\n\n    _this.configTools(permissionList);\n\n    return _this;\n  }\n\n  _createClass(AccessForm, [{\n    key: \"configTools\",\n    value: function configTools(list) {\n      var self = this;\n      setTimeout(function () {\n        $(this.selector).treeView({\n          tType: \"Permission\",\n          location: \"Access\",\n          nodes: list,\n          rootId: \"1\",\n          context: self\n        });\n      }.bind(this), 1);\n      setTimeout(function () {\n        var items = $(this.selector).treeView(\"selectedCheckedItems\");\n        this.refreshPermissions(items);\n      }.bind(this), 300);\n    }\n  }, {\n    key: \"onClickItem\",\n    value: function onClickItem() {\n      var items = $(this.selector).treeView(\"selectedCheckedItems\");\n      this.refreshPermissions(items);\n    }\n  }, {\n    key: \"checkedBoxes\",\n    value: function checkedBoxes() {\n      $(this.selector).treeView(\"checkedBoxes\");\n      var items = $(this.selector).treeView(\"selectedCheckedItems\");\n      this.refreshPermissions(items);\n    }\n  }, {\n    key: \"uncheckedBoxes\",\n    value: function uncheckedBoxes() {\n      $(this.selector).treeView(\"uncheckedBoxes\");\n      var items = $(this.selector).treeView(\"selectedCheckedItems\");\n      this.refreshPermissions([]);\n    }\n  }, {\n    key: \"refreshPermissions\",\n    value: function refreshPermissions(items) {\n      this.permissions.removeAll();\n      if (_h.any(items)) for (var i = 0; i < items.length; i++) {\n        this.permissions.push({\n          accessId: this.id(),\n          permissionType: items[i]\n        });\n      }\n    }\n  }, {\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      this.validationObject = ko.validatedObservable({\n        name: this.name.extend({\n          required: true,\n          validCharacterName: true,\n          minLength: 3,\n          maxLength: 100,\n          remoteIsUniqueRule: {\n            params: [this.id, \"Access\", \"name\"]\n          }\n        }),\n        accessType: this.accessType.extend({\n          required: true\n        }),\n        description: this.description.extend({\n          maxLength: 1000\n        }),\n        permissions: this.permissions.extend({\n          atLeastOne: true\n        })\n      });\n    }\n  }, {\n    key: \"expandAll\",\n    value: function expandAll() {\n      $(this.selector).treeView(\"expandAll\");\n    }\n  }, {\n    key: \"collapseAll\",\n    value: function collapseAll() {\n      $(this.selector).treeView(\"collapseAll\");\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'txb',\n        val: this.name\n      }, {\n        t: 'slc',\n        val: this.accessType,\n        options: accessTypes\n      }), this.createLine({\n        t: 'txa',\n        val: this.description\n      }, undefined, true, 30), this.createLine({\n        t: 'tm',\n        templateName: 'access-permissions-form-t'\n      }, undefined, true, 30, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'create',\n            vis: !this.editMode(),\n            click: this.parentVM.create\n          }, {\n            name: 'edit',\n            vis: this.editMode,\n            click: this.parentVM.edit\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return AccessForm;\n}(BaseFormModel);\n\n//# sourceURL=webpack://domino/./src/scripts/pages/access/model.js?");

/***/ }),

/***/ "./src/scripts/pages/access/resource.js":
/*!**********************************************!*\
  !*** ./src/scripts/pages/access/resource.js ***!
  \**********************************************/
/***/ (() => {

eval("window.accessTypes = [{\n  text: \"دسترسی عمومی\",\n  enText: \"System\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"مشترک برای شرکت و گروه\",\n  enText: \"Company\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"ویژه گروه\",\n  enText: \"Group\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"ویژه شرکت\",\n  enText: \"Subsidiary\",\n  value: 4,\n  color: \"\"\n}];\nwindow.accessModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null,\n    size: 0,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  name: {\n    fa: 'عنوان',\n    colName: 'name',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 30,\n    type: \"string\"\n  },\n  accessType: {\n    fa: 'حوزه دسترسی',\n    colName: 'accessType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 25,\n    type: \"enum\"\n  },\n  description: {\n    fa: 'توضیحات',\n    colName: 'description',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    size: 40,\n    type: \"string\"\n  }\n};\nwindow.accessPageRes = {\n  editCaption: {\n    fa: 'ویرایش سمت'\n  },\n  deleteCaption: {\n    fa: 'حذف سمت'\n  },\n  createCaption: {\n    fa: 'تعریف سمت جدید'\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/pages/access/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/access/viewModel.js":
/*!***********************************************!*\
  !*** ./src/scripts/pages/access/viewModel.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"AccessViewModel\": () => (/* binding */ AccessViewModel)\n/* harmony export */ });\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./model */ \"./src/scripts/pages/access/model.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\nvar _require = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\"),\n    BaseViewModel = _require.BaseViewModel;\n\n\n\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/access/resource.js\");\n\nfunction AccessViewModel() {\n  var self = this;\n  self.permissionList = [];\n\n  self.getPermissionList = function (editMode, callback) {\n    var record = self.getSelectedRecord();\n    var model = {\n      id: 0\n    };\n    if (editMode) model.id = record.id();\n    self.apiService.request({\n      name: \"getSelectList\",\n      data: model,\n      success: function success(data) {\n        callback(data);\n      },\n      messageType: 'getSelectList',\n      messageKey: \"PermissionList\"\n    });\n  };\n\n  self.createBtn = function () {\n    self.getPermissionList(false, function (res) {\n      _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_0__.AccessForm(self, false, res));\n    });\n  };\n\n  self.editBtn = function () {\n    self.getPermissionList(true, function (res) {\n      _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_0__.AccessForm(self, true, res));\n    });\n  };\n\n  self.init = function () {\n    self.getRecords();\n    self.fillTableProperties();\n  };\n\n  ko.utils.extend(self, new BaseViewModel({\n    entityName: \"Access\",\n    getList: true,\n    apiService: {\n      actionList: [\"filterby\", \"post\", \"put\", \"getselectlist\", \"delete\"]\n    },\n    filters: [{\n      name: 'accessType',\n      type: \"select\",\n      source: accessTypes\n    }],\n    buttons: [{\n      name: 'edit',\n      access: true,\n      icon: 'Edit',\n      cMenu: true\n    }, {\n      name: 'delete',\n      access: true,\n      icon: 'Delete',\n      cMenu: true\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'create',\n      access: false,\n      cMenu: false\n    }],\n    sortDirection: \"Ascending\",\n    sortProperty: \"id\",\n    context: self,\n    cols: accessModelRes,\n    saveState: true,\n    searchKeyType: \"enter\",\n    selectRow: true,\n    contextMenu: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    var isSelected = self.isSelectedRecord();\n    self.viscreate(true);\n    self.visedit(isSelected);\n    self.visdelete(isSelected);\n    self.vishelp(true);\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/access/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/actionlog/model.js":
/*!**********************************************!*\
  !*** ./src/scripts/pages/actionlog/model.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"ActionLog\": () => (/* binding */ ActionLog),\n/* harmony export */   \"ExtraInformationSection\": () => (/* binding */ ExtraInformationSection)\n/* harmony export */ });\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar _require = __webpack_require__(/*! ../master/baseModels */ \"./src/scripts/pages/master/baseModels.js\"),\n    BaseModel = _require.BaseModel;\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\nvar ActionLog = /*#__PURE__*/function (_BaseModel) {\n  _inherits(ActionLog, _BaseModel);\n\n  var _super = _createSuper(ActionLog);\n\n  function ActionLog(model) {\n    _classCallCheck(this, ActionLog);\n\n    return _super.call(this, model);\n  }\n\n  return _createClass(ActionLog);\n}(BaseModel);\nvar ExtraInformationSection = /*#__PURE__*/_createClass(function ExtraInformationSection(list) {\n  _classCallCheck(this, ExtraInformationSection);\n\n  this.list = ko.observableArray(list);\n});\n\n//# sourceURL=webpack://domino/./src/scripts/pages/actionlog/model.js?");

/***/ }),

/***/ "./src/scripts/pages/actionlog/resource.js":
/*!*************************************************!*\
  !*** ./src/scripts/pages/actionlog/resource.js ***!
  \*************************************************/
/***/ (() => {

eval("window.resultStates = [{\n  text: \"نامشخص\",\n  enText: \"Unknown\",\n  value: 0,\n  color: \"navy\"\n}, {\n  text: \"موفق\",\n  enText: \"Successful\",\n  value: 1,\n  color: \"green\"\n}, {\n  text: \"ناموفق\",\n  enText: \"Failed\",\n  value: 2,\n  color: \"red\"\n}];\nwindow.actionNames = [{\n  text: 'نامشخص',\n  enText: 'NoName',\n  value: 0,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'مشاهده رکوردها',\n  enText: 'FilterBy',\n  value: 1,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'ثبت رکورد جدید',\n  enText: 'Post',\n  value: 2,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: true,\n  color: 'none'\n}, {\n  text: 'ویرایش',\n  enText: 'Put',\n  value: 3,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: true,\n  color: 'none'\n}, {\n  text: 'حذف',\n  enText: 'Delete',\n  value: 4,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'فعال/غیرفعال کردن',\n  enText: 'PutStateType',\n  value: 8,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: true,\n  color: 'none'\n}, {\n  text: 'تغییر اولویت رکوردها',\n  enText: 'PutPriority',\n  value: 10,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'کپی رکورد',\n  enText: 'Copy',\n  value: 64,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'مشاهده رکوردهای داخلی',\n  enText: 'DataFilterBy',\n  value: 15,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'آپلود فایل',\n  enText: 'ImportFile',\n  value: 125,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'حذف فایل',\n  enText: 'DeleteFile',\n  value: 126,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'بایگانی/لغو بایگانی',\n  enText: 'Archive',\n  value: 66,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'دریافت خروجی اکسل',\n  enText: 'GetExcel',\n  value: 127,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'دریافت خروجی پی دی اف',\n  enText: 'Pdf',\n  value: 101,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'مشاهده پیش نمایش گزارش خروجی',\n  enText: 'GetReportPreview',\n  value: 128,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'دریافت گزارش خروجی',\n  enText: 'GetReport',\n  value: 129,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'قفل/باز کردن رکورد برای ویرایش',\n  enText: 'PutLock',\n  value: 135,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'باز کردن رکورد قفل شده',\n  enText: 'AdminUnlock',\n  value: 136,\n  group: 'عمومی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'تغییر رمز توسط مدیر',\n  enText: 'AdminResetPassword',\n  value: 59,\n  group: 'کاربران',\n  hidden: false,\n  accountFilter: true,\n  color: 'none'\n}, {\n  text: 'تغییر رمز توسط کاربر',\n  enText: 'UserResetPassword',\n  value: 60,\n  group: 'کاربران',\n  hidden: false,\n  accountFilter: true,\n  color: 'none'\n}, {\n  text: 'ویرایش پروفایل',\n  enText: 'PutProfile',\n  value: 61,\n  group: 'کاربران',\n  hidden: false,\n  accountFilter: true,\n  color: 'none'\n}, {\n  text: 'مشاهده دسترسی های کاربر',\n  enText: 'GetAccess',\n  value: 97,\n  group: 'کاربران',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'ویرایش دسترسی های کاربر',\n  enText: 'PostAccess',\n  value: 98,\n  group: 'کاربران',\n  hidden: false,\n  accountFilter: true,\n  color: 'none'\n}, {\n  text: 'فعالسازی حساب کاربری',\n  enText: 'Unlock',\n  value: 114,\n  group: 'کاربران',\n  hidden: false,\n  accountFilter: true,\n  color: 'none'\n}, {\n  text: 'تغییر وضعیت تایید',\n  enText: 'PutSubmit',\n  value: 29,\n  group: 'دوره مالی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'ویرایش دوره های مقایسه ای',\n  enText: 'PutComparatives',\n  value: 31,\n  group: 'دوره مالی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'باز کردن /بستن دوره مالی',\n  enText: 'PutClosed',\n  value: 32,\n  group: 'دوره مالی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'مقداردهی فرم',\n  enText: 'DataPost',\n  value: 124,\n  group: 'اطلاعات شرکت ها',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'ویرایش مقادیر فرم',\n  enText: 'DataPut',\n  value: 132,\n  group: 'اطلاعات شرکت ها',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'حذف مقادیر فرم',\n  enText: 'DataDelete',\n  value: 133,\n  group: 'اطلاعات شرکت ها',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'تبدیل برگ/شاخه',\n  enText: 'PutNodeType',\n  value: 41,\n  group: 'درختواره ها',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'مشاهده درخت مرجع',\n  enText: 'DiffTrees',\n  value: 112,\n  group: 'درختواره ها',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'همگام سازی تغییرات درختواره',\n  enText: 'SyncTrees',\n  value: 113,\n  group: 'درختواره ها',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'ویرایش تنظیمات درختواره',\n  enText: 'PutTreeSetting',\n  value: 120,\n  group: 'درختواره ها',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'بازگردانی شاخه های مشمول تلفیق به تنظیمات اولیه',\n  enText: 'ResetConsolidationBranch',\n  value: 121,\n  group: 'درختواره ها',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'کپی یا کات گره های درختواره',\n  enText: 'Paste',\n  value: 122,\n  group: 'درختواره ها',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'اعمال /لغو اثر',\n  enText: 'ChangeMappingResult',\n  value: 40,\n  group: 'نگاشت',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'نگاشت',\n  enText: 'PostMapping',\n  value: 87,\n  group: 'نگاشت',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'لغو نگاشت',\n  enText: 'DeleteMapping',\n  value: 88,\n  group: 'نگاشت',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'نگاشت خودکار',\n  enText: 'AutoPostMapping',\n  value: 116,\n  group: 'نگاشت',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'ایجاد حساب مقابل',\n  enText: 'PostSubstituteNode',\n  value: 117,\n  group: 'نگاشت',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'ویرایش حساب مقابل',\n  enText: 'PutSubstituteNode',\n  value: 118,\n  group: 'نگاشت',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'حذف حساب مقابل',\n  enText: 'DeleteSubstituteNode',\n  value: 119,\n  group: 'نگاشت',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'اجرای الگوهای نگاشت',\n  enText: 'Apply',\n  value: 110,\n  group: 'الگوی نگاشت',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'بازگردانی الگوهای نگاشت',\n  enText: 'Rollback',\n  value: 111,\n  group: 'الگوی نگاشت',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'تایید/عدم تایید',\n  enText: 'PutConfirmationType',\n  value: 9,\n  group: 'اسناد اصلاحی و طبقه بندی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'تعیین درصد مالکیت',\n  enText: 'PutOwnership',\n  value: 54,\n  group: 'شرکت های مشمول تلفیق',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'حذف محتوای جدول',\n  enText: 'RemoveData',\n  value: 104,\n  group: 'محاسبات',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'حذف اثر اجرای روال های محاسبه',\n  enText: 'RemoveCalculation',\n  value: 107,\n  group: 'محاسبات',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'اجرای روال های محاسبه',\n  enText: 'ApplyCalculation',\n  value: 108,\n  group: 'محاسبات',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'مشاهده محتوای قالب جدول',\n  enText: 'GetExcelData',\n  value: 56,\n  group: 'قالب جدول',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'ذخیره تغییرات در گزارش ساز',\n  enText: 'SaveExcelData',\n  value: 57,\n  group: 'قالب جدول',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'مشاهده پیش نمایش قالب جدول',\n  enText: 'Preview',\n  value: 58,\n  group: 'قالب جدول',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'دریافت فایل پشتیبان از قالب های جدول',\n  enText: 'Export',\n  value: 93,\n  group: 'قالب جدول',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'مشاهده مقادیر سفارشی اطلاعات در گزارش ساز',\n  enText: 'GetCustomReportInfo',\n  value: 130,\n  group: 'قالب جدول',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'ویرایش مقادیر سفارشی اطلاعات در گزارش ساز',\n  enText: 'SetCustomReportInfo',\n  value: 131,\n  group: 'قالب جدول',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'حذف پی دی اف ذخیره شده مجله',\n  enText: 'DeleteSavedMagazine',\n  value: 70,\n  group: 'مجله',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'مشاهده محتوای مجله',\n  enText: 'GetPages',\n  value: 84,\n  group: 'مجله',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'ذخیره محتوای مجله',\n  enText: 'SavePages',\n  value: 85,\n  group: 'مجله',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'ذخیره یا دریافت پی دی اف مجله',\n  enText: 'MagazinePdf',\n  value: 123,\n  group: 'مجله',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'اجرای ارتباط',\n  enText: 'Run',\n  value: 1001,\n  group: 'مدیریت ارتباط',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'ورود',\n  enText: 'GetToken',\n  value: 51,\n  group: 'کاربران',\n  hidden: true,\n  accountFilter: true,\n  color: 'none'\n}, {\n  text: 'ورود',\n  enText: 'GetNewToken',\n  value: 134,\n  group: '',\n  hidden: true,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'ورود پس از تغییر رمز',\n  enText: 'ForceChangePassword',\n  value: 52,\n  group: 'کاربران',\n  hidden: true,\n  accountFilter: true,\n  color: 'none'\n}, {\n  text: 'خروج',\n  enText: 'LogOff',\n  value: 53,\n  group: 'کاربران',\n  hidden: true,\n  accountFilter: true,\n  color: 'none'\n}, {\n  text: 'منقضی شدن توکن',\n  enText: 'TokenIsExpired',\n  value: 55,\n  group: 'کاربران',\n  hidden: true,\n  accountFilter: true,\n  color: 'none'\n}, {\n  text: 'ارسال رمز یکبار مصرف',\n  enText: 'SendOTP',\n  value: 62,\n  group: '',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'ارسال هشدار ذخیره سازی لاگ',\n  enText: 'SendLogCapacityWarning',\n  value: 137,\n  group: 'پیام های مدیریتی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'ارسال خطای ذخیره سازی لاگ',\n  enText: 'SendLogExceptionWarning',\n  value: 138,\n  group: 'پیام های مدیریتی',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'مشاهده تنظیمات سامانه',\n  enText: 'GetSystemSettings',\n  value: 139,\n  group: 'تنظیمات سامانه',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}, {\n  text: 'ویرایش تنظیمات سامانه',\n  enText: 'SetSystemSettings',\n  value: 140,\n  group: 'تنظیمات سامانه',\n  hidden: false,\n  accountFilter: false,\n  color: 'none'\n}];\nwindow.methodTypes = [{\n  text: \"نامشخص\",\n  enText: \"NoName\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"بروزرسانی\",\n  enText: \"Put\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"ارسال اطلاعات\",\n  enText: \"Post\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"حذف\",\n  enText: \"Delete\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"دریافت\",\n  enText: \"Get\",\n  value: 4,\n  color: \"\"\n}];\nwindow.actionlogModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  userName: {\n    fa: 'کاربر',\n    colName: 'userName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: \"userId\",\n    type: \"string\"\n  },\n  date: {\n    fa: 'تاریخ ایجاد',\n    colName: 'date',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"Descending\",\n    alias: null,\n    type: \"pdatetime\"\n  },\n  resultState: {\n    fa: 'وضعیت',\n    colName: 'resultState',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"label\"\n  },\n  controllerName: {\n    fa: 'بخش',\n    colName: 'controllerName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  actionName: {\n    fa: 'عملیات',\n    colName: 'actionName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  networkIp: {\n    fa: 'آی پی کاربر',\n    colName: 'networkIp',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  routeValues: {\n    fa: 'مسیر',\n    colName: 'routeValues',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  formData: {\n    fa: 'اطلاعات فرم ارسالی',\n    colName: 'formData',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  queryString: {\n    fa: 'کوئری استرینگ',\n    colName: 'queryString',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  url: {\n    fa: 'آدرس',\n    colName: 'url',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  userId: {\n    fa: 'کاربر',\n    colName: 'userId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  }\n};\nwindow.actionlogPageRes = {\n  pageTitle: {\n    fa: 'فهرست'\n  },\n  detailsBtn: {\n    fa: 'جزییات'\n  },\n  moreInfo: {\n    fa: 'اطلاعات تکمیلی'\n  },\n  changeMarkCaption: {\n    fa: 'نشان دارد کردن رکورد'\n  },\n  startDate: {\n    fa: 'از تاریخ'\n  },\n  endDate: {\n    fa: 'تا تاریخ'\n  },\n  extraInformationTitle: {\n    fa: 'اطلاعات'\n  },\n  exportExcelCaption: {\n    fa: \"دریافت فایل اکسل جدول\"\n  },\n  recent: {\n    fa: 'فعالیت های اخیر'\n  },\n  controllerNames: {\n    fa: 'بخش'\n  },\n  actionNames: {\n    fa: 'عملیات'\n  },\n  users: {\n    fa: 'کاربر'\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/pages/actionlog/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/actionlog/viewModel.js":
/*!**************************************************!*\
  !*** ./src/scripts/pages/actionlog/viewModel.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"ActionLogViewModel\": () => (/* binding */ ActionLogViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/model */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./model */ \"./src/scripts/pages/actionlog/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var dateHelper = __webpack_require__(/*! ./src/scripts/util/dateHelper.js */ \"./src/scripts/util/dateHelper.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n__webpack_require__(/*! ./model */ \"./src/scripts/pages/actionlog/model.js\");\n\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/actionlog/resource.js\");\n\nvar _require = __webpack_require__(/*! ../master/baseViewModel */ \"./src/scripts/pages/master/baseViewModel.js\"),\n    BaseViewModel = _require.BaseViewModel;\n\n\n\nfunction ActionLogViewModel() {\n  var self = this;\n  self.userSelectList = ko.observableArray();\n  self.checkAll = ko.observable();\n\n  self.getUserSelectList = function () {\n    self.apiService.request({\n      name: \"/api/common/getuserslist\",\n      data: {\n        controllerName: self.controllerName\n      },\n      success: function success(data) {\n        self.userSelectList.removeAll();\n        self.users.removeAll();\n\n        if (_h.any(data)) {\n          for (var j = 0; j < data.length; j++) {\n            var target = new _master_model__WEBPACK_IMPORTED_MODULE_0__.SelectItem(data[j]);\n            self.userSelectList.push(target);\n          }\n        }\n      },\n      messageType: 'getSelectList',\n      messageKey: \"User\"\n    });\n  };\n\n  self.toggleRight = function () {\n    if (self.wideRight()) {\n      if (self.isSelectedRecord()) {\n        var selectedRecord = self.getSelectedRecord();\n        self.wideRight(false);\n        var model = new _model__WEBPACK_IMPORTED_MODULE_1__.ExtraInformationSection(selectedRecord.extraInformation());\n        self.childModel(model);\n        self.iconSize(\"icon-image-small\");\n      }\n    } else {\n      self.wideRight(true);\n      self.childModel(null);\n      self.iconSize(\"icon-image\");\n    }\n  };\n\n  self.checkAll.subscribe(function (newValue) {\n    if (newValue !== undefined && newValue !== null) {\n      ko.utils.arrayFilter(self.records(), function (record) {\n        record.selected(newValue);\n      });\n    }\n  });\n  self.hasSelectedRecord = ko.pureComputed(function () {\n    var count = 0;\n    ko.utils.arrayFilter(self.records(), function (record) {\n      if (record.selected()) count++;\n    });\n    if (count > 0) return true;\n    return false;\n  });\n  self.countSelectedRecord = ko.pureComputed(function () {\n    var count = 0;\n    ko.utils.arrayFilter(self.records(), function (record) {\n      if (record.selected()) count++;\n    });\n    return count;\n  });\n\n  self.toggleDetails = function (item, e, y) {\n    item.detailsShow(!item.detailsShow());\n  };\n\n  self.changeChildModel = function (target, force) {\n    var selectedRecord = self.getSelectedRecord();\n    var model = new _model__WEBPACK_IMPORTED_MODULE_1__.ExtraInformationSection(selectedRecord.extraInformation());\n    self.childModel(model);\n    self.iconSize(\"icon-image-small\");\n  };\n\n  self.exportExcelBtn = function () {\n    var filterModel = self.createFilterByModel();\n    var model = {\n      controllerName: 9,\n      inputData: filterModel\n    };\n\n    _h.kocnx().createExcel(model);\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n\n    var _dateHelper$getAction = dateHelper.getActionLogDate(),\n        _dateHelper$getAction2 = _slicedToArray(_dateHelper$getAction, 2),\n        start = _dateHelper$getAction2[0],\n        end = _dateHelper$getAction2[1];\n\n    self.startDate(start);\n    self.endDate(end);\n    self.getRecords();\n    self.getUserSelectList();\n  };\n\n  ko.utils.extend(self, new BaseViewModel({\n    entityName: \"ActionLog\",\n    getList: true,\n    apiService: {\n      actionList: [\"filterby\", \"delete\"]\n    },\n    buttons: [{\n      name: 'exportExcel',\n      access: true,\n      icon: 'ExportExcel',\n      cMenu: false\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }],\n    filters: [{\n      name: 'startDate',\n      type: \"datepiker\"\n    }, {\n      name: 'endDate',\n      type: \"datepiker\"\n    }, {\n      name: 'controllerNames',\n      type: \"multiselect\",\n      source: controllerNames.filter(function (a) {\n        return !a.hidden;\n      }),\n      groupBy: \"group\"\n    }, {\n      name: 'actionNames',\n      type: \"multiselect\",\n      source: actionNames.filter(function (a) {\n        return !a.hidden;\n      }),\n      groupBy: \"group\"\n    }, {\n      name: 'users',\n      type: \"multiselect\",\n      source: self.userSelectList\n    }, {\n      name: 'recent',\n      type: \"bool\"\n    }, {\n      name: 'isMarked'\n    }, {\n      name: 'timeCreated'\n    }],\n    sortDirection: \"Descending\",\n    sortProperty: \"date\",\n    context: self,\n    cols: actionlogModelRes,\n    selectRow: true,\n    saveState: true,\n    contextMenu: true,\n    isMultiSelectRows: true,\n    searchKeyType: \"enter\",\n    resizable: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    self.visexportExcel(true);\n    self.vishelp(true);\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n\n  self.refreshTable = function () {\n    self.childModel(null);\n    config.context.getRecords();\n  };\n\n  self.filterBy = function () {\n    self.pageNumber(1);\n\n    var _dateHelper$getAction3 = dateHelper.getActionLogDate(self.startDate(), self.endDate()),\n        _dateHelper$getAction4 = _slicedToArray(_dateHelper$getAction3, 2),\n        start = _dateHelper$getAction4[0],\n        end = _dateHelper$getAction4[1];\n\n    if (self.startDate() !== start) self.startDate(start);\n    if (self.endDate() !== end) self.endDate(end);\n    self.getRecords();\n  };\n\n  self.clearSearchBoxes = function () {\n    var _dateHelper$getAction5 = dateHelper.getActionLogDate(),\n        _dateHelper$getAction6 = _slicedToArray(_dateHelper$getAction5, 2),\n        start = _dateHelper$getAction6[0],\n        end = _dateHelper$getAction6[1];\n\n    self.startDate(start);\n    self.endDate(end);\n    self.controllerNames.removeAll();\n    self.actionNames.removeAll();\n    self.users.removeAll();\n    self.recent(undefined);\n    self.isMarked(undefined);\n    self.timeCreated(undefined);\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/actionlog/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/adjustmentdocument/model.js":
/*!*******************************************************!*\
  !*** ./src/scripts/pages/adjustmentdocument/model.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"AdjustmentDocument\": () => (/* binding */ AdjustmentDocument),\n/* harmony export */   \"AdjustmentDocumentForm\": () => (/* binding */ AdjustmentDocumentForm),\n/* harmony export */   \"AdjustmentDocumentItem\": () => (/* binding */ AdjustmentDocumentItem),\n/* harmony export */   \"AdjustmentDocumentItemForm\": () => (/* binding */ AdjustmentDocumentItemForm),\n/* harmony export */   \"AdjustmentDocumentItemViewModel\": () => (/* binding */ AdjustmentDocumentItemViewModel)\n/* harmony export */ });\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* harmony import */ var _master_baseModels_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\");\n/* harmony import */ var _master_model_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../master/model.js */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var _autoMapper = __webpack_require__(/*! ./src/scripts/util/autoMapper.js */ \"./src/scripts/util/autoMapper.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\n\n\n\n\nvar Big = __webpack_require__(/*! ../../vendors/big.js */ \"./src/scripts/vendors/big.js\");\n\nvar AdjustmentDocument = /*#__PURE__*/function (_BaseModel) {\n  _inherits(AdjustmentDocument, _BaseModel);\n\n  var _super = _createSuper(AdjustmentDocument);\n\n  function AdjustmentDocument(model) {\n    var _this;\n\n    _classCallCheck(this, AdjustmentDocument);\n\n    _this = _super.call(this, model);\n\n    _defineProperty(_assertThisInitialized(_this), \"messageType\", ko.observable(0));\n\n    _this.styleRowValue = ko.pureComputed(function () {\n      if (this.ineffective() === true && !_h.isNullOrEmpty(_h.kocnx().advm()) && _h.kocnx().advm().viewMode() === \"Edit\") return 'color: #ccc;';\n      if (this.messageType() === 1 && !_h.isNullOrEmpty(_h.kocnx().advm()) && _h.kocnx().advm().viewMode() === \"Edit\") return 'color: red;';\n      if (this.messageType() === 2 && !_h.isNullOrEmpty(_h.kocnx().advm()) && _h.kocnx().advm().viewMode() === \"Edit\") return 'color: green;';\n      return 'color: black;';\n    }, _assertThisInitialized(_this));\n    _this.isEditable = ko.pureComputed(function () {\n      if (this.ineffective() === true || this.confirmationState() === 2 || this.stateType() === 0) return false;\n      return true;\n    }, _assertThisInitialized(_this));\n    _this.tagsString = ko.computed(function () {\n      var res = \"\";\n      if (_h.any(this.tags())) for (var i = 0; i < this.tags().length; i++) {\n        var tag = this.tags()[i];\n        res += this.shortName(tag);\n        if (i + 1 !== this.tags().length) res += \"، \";\n      }\n      return res;\n    }.bind(_assertThisInitialized(_this)));\n    return _this;\n  }\n\n  _createClass(AdjustmentDocument, [{\n    key: \"shortName\",\n    value: function shortName(name) {\n      if (!name) return \"\";\n      if (name.length < 20) return name;\n      return name.substr(0, 17) + \"...\";\n    }\n  }]);\n\n  return AdjustmentDocument;\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_1__.BaseModel);\nvar AdjustmentDocumentForm = /*#__PURE__*/function (_BaseFormModel) {\n  _inherits(AdjustmentDocumentForm, _BaseFormModel);\n\n  var _super2 = _createSuper(AdjustmentDocumentForm);\n\n  function AdjustmentDocumentForm(viewModel, editMode, res) {\n    var _this2;\n\n    _classCallCheck(this, AdjustmentDocumentForm);\n\n    _this2 = _super2.call(this, viewModel, editMode, [\"tags\"]);\n    _this2.lastPriority = ko.observable();\n    _this2.selectTree = ko.observable();\n\n    var context = _h.kocnx();\n\n    _this2.tags = ko.observableArray();\n    _this2.loginCompanyType = context.loginCompanyType();\n\n    if (editMode) {\n      _this2.lastPriority(res);\n\n      var model = viewModel.multiCommandExecute(\"selectedRowRecord\");\n      if (context.loginCompanyType() === 0) _this2.defaultCompanyId(model.defaultCompanyId());\n      if (model[\"balanceSheetId\"]()) _this2.balanceSheetId(model[\"balanceSheetId\"]());\n      var tags = ko.toJS(model.tags());\n\n      _this2.tags(tags);\n\n      for (var i = 0; i < _this2.parentVM.trees().length; i++) {\n        if (_this2.treeId() === _this2.parentVM.trees()[i].value()) {\n          _this2.selectTree(_this2.parentVM.trees()[i]);\n        }\n      }\n    } else {\n      _this2.timeCreated(context.periodItem().te);\n\n      _this2.lastPriority(res + 1);\n\n      _this2.priority(res + 1);\n\n      _this2.stateType(1);\n\n      _this2.itemsCount = ko.observable(0);\n    }\n\n    _this2.disabledByItemsCount = ko.pureComputed(function () {\n      return this.itemsCount() > 0;\n    }.bind(_assertThisInitialized(_this2)));\n\n    _this2.setValidationObject();\n\n    _this2.createForm();\n\n    return _this2;\n  }\n\n  _createClass(AdjustmentDocumentForm, [{\n    key: \"onSelectTree\",\n    value: function onSelectTree(tree) {\n      if (this.disabledByItemsCount()) return;\n\n      if (this.treeId() === tree.value()) {\n        this.treeId(null);\n        this.selectTree(null);\n      } else {\n        this.treeId(tree.value());\n\n        for (var i = 0; i < this.parentVM.trees().length; i++) {\n          if (tree.value() === this.parentVM.trees()[i].value()) {\n            this.selectTree(this.parentVM.trees()[i]);\n          }\n        }\n      }\n\n      if (this.loginCompanyType === 0) {\n        this.defaultCompanyId(null);\n      } else {\n        for (var _i = 0; _i < this.selectTree().items().length; _i++) {\n          if (\"تراز تجمیعی\" === this.selectTree().items()[_i].text()) {\n            this.selectTree().items()[_i].selected(true);\n\n            this.balanceSheetId(this.selectTree().items()[_i].value());\n          }\n        }\n      }\n    }\n  }, {\n    key: \"onSelectItem\",\n    value: function onSelectItem(item) {\n      if (this.disabledByItemsCount()) return;\n      var reset = false;\n      if (this.loginCompanyType === 0) reset = this.defaultCompanyId() === item.value();\n      if (this.loginCompanyType === 1) reset = this.balanceSheetId() === item.value();\n\n      if (!reset) {\n        item.selected(true);\n\n        if (this.loginCompanyType === 0) {\n          this.defaultCompanyId(item.value());\n        } else {\n          this.balanceSheetId(item.value());\n        }\n      } else {\n        item.selected(false);\n        this.defaultCompanyId(null);\n        this.balanceSheetId(null);\n      }\n\n      for (var i = 0; i < this.selectTree().items().length; i++) {\n        if (this.treeId() !== this.selectTree().items()[i].value()) {\n          this.selectTree().items()[i].selected(false);\n        }\n      }\n\n      return true;\n    }\n  }, {\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      self.validationObject = ko.validatedObservable({\n        title: self.title.extend({\n          required: true,\n          minLength: 3,\n          maxLength: 100,\n          validCharacterName: true,\n          remoteIsUniqueRule: {\n            params: [self.id, \"AdjustmentDocument\", \"title\"]\n          }\n        }),\n        code: self.code.extend({\n          minLength: {\n            params: 1,\n            message: \"لطفاً حداقل 1 رقم وارد نمایید\"\n          },\n          maxLength: {\n            params: 9,\n            message: \"لطفاً حداکثر 9 رقم وارد نمایید\"\n          },\n          numberOnly: null,\n          remoteIsUniqueRule: {\n            params: [self.id, \"AdjustmentDocument\", \"code\"]\n          }\n        }),\n        timeCreated: self.timeCreated.extend({\n          required: true,\n          validation: [{\n            validator: function validator(val, someOtherVal) {\n              var activePeriod = _h.kocnx().periodItem();\n\n              var start = new Date(activePeriod.ts);\n              var timeEnd = new Date(activePeriod.te);\n              var date = new Date(val);\n              return date >= start && date <= timeEnd;\n            },\n            message: 'تاریخ ثبت سند باید در بازه تاریخ شروع و پایان دوره مالی جاری باشد'\n          }]\n        }),\n        priority: self.priority.extend({\n          required: true\n        }),\n        balanceSheetId: self.balanceSheetId.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return _h.kocnx().loginCompanyType() === 1 && !_h.isEmpty(self.selectTree()) && self.selectTree().treeType() !== 1;\n            }\n          }\n        }),\n        treeId: self.treeId.extend({\n          required: true\n        })\n      });\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tsp',\n        val: this.priority,\n        min: 1,\n        max: this.editMode() === true ? this.lastPriority() : this.priority()\n      }, {\n        t: 'txb',\n        val: this.code\n      }), this.createLine({\n        t: 'txb',\n        val: this.title\n      }, null, true, 30), this.createLine({\n        t: 'tm',\n        templateName: 'adjustmentdocument-treesection-form-t'\n      }, undefined, true, 0, 0), this.createLine({\n        t: 'dpk',\n        val: this.timeCreated,\n        dateType: 'fa'\n      }, {\n        t: 'slc',\n        val: this.folderId,\n        options: this.parentVM.folderList\n      }, true, 30), this.createLine({\n        t: 'slc',\n        val: this.tags,\n        options: this.parentVM.tagList,\n        slcType: \"multi\",\n        tagManager: true,\n        renderFunc: _h.tagSelectRowTemplate\n      }, null, true, 30), this.createLine({\n        t: 'txa',\n        val: this.description\n      }, undefined, true, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'create',\n            vis: !this.editMode(),\n            click: this.parentVM.create\n          }, {\n            name: 'edit',\n            vis: this.editMode,\n            click: this.parentVM.edit\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return AdjustmentDocumentForm;\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_1__.BaseFormModel);\nvar AdjustmentDocumentItem = /*#__PURE__*/function (_BaseModel2) {\n  _inherits(AdjustmentDocumentItem, _BaseModel2);\n\n  var _super3 = _createSuper(AdjustmentDocumentItem);\n\n  function AdjustmentDocumentItem(model) {\n    var _this3;\n\n    _classCallCheck(this, AdjustmentDocumentItem);\n\n    _this3 = _super3.call(this, model);\n\n    _defineProperty(_assertThisInitialized(_this3), \"messageType\", ko.observable(0));\n\n    _this3.styleRowValue = ko.computed(function () {\n      if (this.ineffective() === true && !_h.isNullOrEmpty(_h.kocnx().advm()) && _h.kocnx().advm().viewMode() === \"Edit\") return 'color: #ccc;';\n      if (this.isForNode() === true && !_h.isNullOrEmpty(_h.kocnx().brvm())) return 'color: green;';\n      return 'color: #334455;';\n    }, _assertThisInitialized(_this3));\n    return _this3;\n  }\n\n  return _createClass(AdjustmentDocumentItem);\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_1__.BaseModel);\nfunction AdjustmentDocumentItemViewModel(mode) {\n  var self = this;\n  self.parentModel = \"\";\n  self.caption = ko.observable();\n  self.viewMode = ko.observable(mode);\n  self.treeSelectList = ko.observableArray();\n\n  self.afterFilterBy = function (data) {\n    var context = _h.kocnx();\n\n    if (self.amountType()) {\n      clientStorage.setSetting([{\n        key: \"AdjustmentDocumentItem_amountType_\" + context.loginCompanyType(),\n        value: self.amountType()\n      }]);\n    } else {\n      clientStorage.removeSetting(\"AdjustmentDocumentItem_amountType_\" + context.loginCompanyType());\n    }\n  };\n\n  self.getTree = function (text) {\n    var name = \"-\";\n    ko.utils.arrayFilter(self.treeSelectList(), function (item) {\n      if (text === item.value) name = item;\n    });\n    return name;\n  };\n\n  self.treeSelectConfig = function (item) {\n    var model = self.getTree(item.text);\n    return '<div>' + '<span class=\"item-title\">' + '<span class=\"item-name\">' + item.text + '</span>' + '<span class=\"item-valueType\">' + _h.getEnumText(valueTypes, model.valueType) + '</span>' + '</span>' + '<ul class=\"item-meta\">' + '<li class=\"item-type\">' + model.type + '</li></ul></div>';\n  };\n\n  self.getFormInfo = function (adjustmentId, itemId, callback) {\n    var model = {\n      adjustmentId: adjustmentId || self.adjustmentId(),\n      itemId: itemId\n    };\n    self.apiService.request({\n      name: \"getItemInfo\",\n      data: model,\n      success: function success(data) {\n        callback(data);\n      },\n      error: function error(message, level) {\n        callback(false);\n      }\n    });\n  };\n\n  self.createBtn = function () {\n    self.getFormInfo(undefined, undefined, function (data) {\n      if (data) {\n        _h.kocnx().openForm(new AdjustmentDocumentItemForm(self, false, data));\n      }\n    });\n  };\n\n  self.editBtn = function () {\n    var model = self.multiCommandExecute(\"selectedRowRecord\");\n    self.getFormInfo(undefined, model.id(), function (data) {\n      if (data) {\n        _h.kocnx().openForm(new AdjustmentDocumentItemForm(self, true, data));\n      }\n    });\n  };\n\n  self.onAdjustmentIdClick = function () {\n    self.adjustmentName(\"\");\n    self.adjustmentId(null);\n    self.treeId(null);\n    self.parentModel.changeShowBlock(\"fullDetails\");\n  };\n\n  self.createFiltersList = function () {\n    var array;\n\n    if (self.viewMode() === \"Edit\") {\n      array = [{\n        name: 'adjustmentName',\n        clear: false,\n        toServer: false\n      }, {\n        name: 'adjustmentId',\n        clear: false\n      }, {\n        name: 'adjustmentStateType'\n      }, {\n        name: 'amount',\n        type: \"text\"\n      }, {\n        name: 'displayType'\n      }, {\n        name: 'amountType'\n      }, {\n        name: 'treeId',\n        clear: false\n      }, {\n        name: 'nodes',\n        type: 'list'\n      }, {\n        name: 'nodeIdList',\n        type: 'list'\n      }, {\n        name: 'codeRange'\n      }, {\n        name: 'userId'\n      }, {\n        name: 'repeated'\n      }, {\n        name: 'justIneffective'\n      }, {\n        name: 'accountType'\n      }, {\n        name: 'stateType'\n      }, {\n        name: 'folders',\n        type: \"list\"\n      }, {\n        name: 'tags',\n        type: \"list\",\n        def: []\n      }];\n\n      if (_h.kocnx().loginCompanyType() === 0) {\n        array.push({\n          name: 'companies',\n          type: 'list'\n        });\n        array.push({\n          name: 'companyId'\n        });\n        array.push({\n          name: 'consolidationCompany'\n        });\n      }\n    } else {\n      array = [{\n        name: 'adjustmentName',\n        clear: false,\n        toServer: false\n      }, {\n        name: 'adjustmentId',\n        clear: false\n      }, {\n        name: 'amountType',\n        clear: false\n      }, {\n        name: 'amount'\n      }, {\n        name: 'displayType'\n      }, {\n        name: 'treeId',\n        clear: false\n      }, {\n        name: 'nodeId',\n        clear: false\n      }, {\n        name: 'userId'\n      }, {\n        name: 'repeated'\n      }, {\n        name: 'codeRange'\n      }, {\n        name: 'showAll',\n        def: false\n      }, {\n        name: 'folders',\n        type: \"list\"\n      }, {\n        name: 'tags',\n        type: \"list\",\n        def: []\n      }];\n      if (_h.kocnx().loginCompanyType() === 0) array.push({\n        name: 'companyId'\n      });\n    }\n\n    return array;\n  };\n\n  self.createColList = function () {\n    var array = [];\n\n    for (var p in adjustmentdocumentitemModelRes) {\n      if (adjustmentdocumentitemModelRes.hasOwnProperty(p)) {\n        var target = adjustmentdocumentitemModelRes[p];\n\n        if (_h.kocnx().loginCompanyType() === 0) {\n          array.push(target);\n        } else {\n          if (target.colName !== \"companyName\") array.push(target);\n        }\n      }\n    }\n\n    return array;\n  };\n\n  self.toggleShowAll = function () {\n    self.showAll(!self.showAll());\n    self.getRecords();\n  };\n\n  self.downloadReportBtn = function () {\n    var filters = self.createFilterByModel();\n    var model = {\n      inputData: filters,\n      controllerName: 32\n    };\n    self.apiService.request({\n      name: \"/api/filegenerator/postreportpreview\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.kocnx().openForm(new _master_model_js__WEBPACK_IMPORTED_MODULE_2__.ReportPreview(self, {\n            columns: data.columns,\n            rows: data.rows,\n            controllerName: 32\n          }));\n        }\n      },\n      error: function error(message, level) {}\n    });\n  };\n\n  self.downloadReport = function (parents, btnModel, e) {\n    var item = parents[1];\n    var model = item.toServer();\n    model.inputData = self.createFilterByModel();\n    self.apiService.request({\n      splashId: e,\n      name: \"/api/filegenerator/postreport\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.kocnx().closeForm();\n\n          _h.downloadFile(data.model);\n        }\n      },\n      error: function error(message, level) {\n        var text = _h.getApiMessage(\"GetFileError\");\n\n        _h.failToast(text);\n      }\n    });\n  };\n\n  self.createButtonList = function () {\n    var array;\n\n    if (self.viewMode() === \"Edit\") {\n      array = [{\n        name: 'edit',\n        access: true,\n        icon: 'Edit',\n        cMenu: true\n      }, {\n        name: 'delete',\n        access: true,\n        icon: 'Delete',\n        cMenu: true\n      }, {\n        name: 'disable',\n        access: true,\n        icon: 'DocDisable',\n        cMenu: true\n      }, {\n        name: 'enable',\n        access: true,\n        icon: 'DocEnable',\n        cMenu: true\n      }, {\n        name: 'disables',\n        access: true,\n        icon: 'DocsDisable',\n        cMenu: true\n      }, {\n        name: 'enables',\n        access: true,\n        icon: 'DocsEnable',\n        cMenu: true\n      }, {\n        name: 'downloadReport',\n        access: true,\n        icon: 'ReportDownload',\n        cMenu: true\n      }, {\n        name: 'up',\n        access: true,\n        icon: 'Up',\n        cMenu: true\n      }, {\n        name: 'down',\n        access: true,\n        icon: 'Down',\n        cMenu: true\n      }, {\n        name: 'help',\n        access: false,\n        cMenu: false\n      }, {\n        name: 'refresh',\n        access: false,\n        cMenu: false\n      }, {\n        name: 'tools',\n        access: false,\n        cMenu: false\n      }, {\n        name: 'create',\n        access: true,\n        cMenu: false\n      }];\n    } else {\n      array = [{\n        name: 'showAllSw',\n        access: false,\n        cMenu: false,\n        templateName: \"showAll-item-button-template\"\n      }, {\n        name: 'help',\n        access: false,\n        cMenu: false\n      }, {\n        name: 'refresh',\n        access: false,\n        cMenu: false\n      }, {\n        name: 'tools',\n        access: false,\n        cMenu: false\n      }];\n    }\n\n    return array;\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_3__.BaseViewModel({\n    entityName: \"AdjustmentDocumentItem\",\n    filters: self.createFiltersList(),\n    buttons: self.createButtonList(),\n    apiService: {\n      actionList: [\"filterby\", \"post\", \"put\", \"delete\", \"getiteminfo\"]\n    },\n    extraParams: [\"lastPriority\", \"itemsCount\", \"totalDebtor\", \"totalCreditor\", \"variance\", \"searchProfiles\"],\n    parentParams: [\"treeId\", \"balanceSheetId\", \"defaultCompanyId\", \"ineffective\", \"isRightEdit\", \"parentConfirmationState\"],\n    sortDirection: \"Ascending\",\n    filterBoxTemplate: \"adjustmentitem-filter-box-template\",\n    sortProperty: \"priority\",\n    context: self,\n    saveState: true,\n    cols: self.createColList(),\n    isMultiSelectRows: self.viewMode() === \"Edit\",\n    selectRow: true,\n    contextMenu: true,\n    getList: true,\n    searchKeyType: \"enter\",\n    styleRow: \"styleRowValue\",\n    tableClass: \"table ko-tbl ko-tbl-child\",\n    tableStyle: \"margin-top:10px;font-size:11px;\",\n    footerTemplate: \"adjustmentdocumentitem-footertable-template\",\n    filterProfile: true,\n    resizable: true\n  }));\n\n  if (self.viewMode() === \"Edit\") {\n    self.btnVisibility = ko.computed(function () {\n      var context = _h.kocnx();\n\n      var adjustmentId = self.adjustmentId();\n      var permitPeriodEdit = context.permitPeriodEdit();\n      var inListView = self.showType() === \"List\";\n      var isRightEdit = self.isRightEdit();\n      var notIneffective = !self.ineffective();\n      var data = self.multiCommandExecute(\"btnVisibilityData3\");\n      if (_h.isNullOrEmpty(data)) return;\n      var temp = data[0];\n      var enableCount = data[1];\n      var disableCount = data[2];\n      var selectedList = data[3];\n\n      if (selectedList === 0) {\n        self.visedit(false);\n        self.visdelete(false);\n        self.visup(false);\n        self.visdown(false);\n        self.visdisable(false);\n        self.visenable(false);\n        self.visdisables(false);\n        self.visenables(false);\n      }\n\n      if (selectedList === 1) {\n        var item = self.getSelectedRecord();\n        if (item === null || item === undefined) item = temp;\n        var notItemIneffective = !item.ineffective();\n        self.visedit(permitPeriodEdit && isRightEdit && notIneffective && notItemIneffective && item.stateType() === 1);\n        self.visdelete(permitPeriodEdit && self.parentConfirmationState() !== 2);\n        self.visdisable(permitPeriodEdit && disableCount >= 0 && enableCount > 0 && !inListView);\n        self.visenable(permitPeriodEdit && disableCount >= 0 && enableCount === 0 && !inListView);\n\n        if (!adjustmentId) {\n          self.visedit(self.visedit() && item.editable());\n          self.visdelete(self.visdelete() && item.removable());\n          self.visdisable(self.visdisable() && item.stateTypeEditable());\n          self.visenable(self.visenable() && item.stateTypeEditable());\n        }\n\n        self.visup(permitPeriodEdit && isRightEdit && notIneffective && item.priority() > 1 && notItemIneffective && !_h.isNullOrEmpty(adjustmentId));\n        self.visdown(permitPeriodEdit && isRightEdit && notIneffective && self.lastPriority() !== item.priority() && notItemIneffective && !_h.isNullOrEmpty(adjustmentId));\n        self.visdisables(false);\n        self.visenables(false);\n      }\n\n      if (selectedList > 1) {\n        self.visedit(false);\n        self.visdelete(false);\n        self.visup(false);\n        self.visdown(false);\n        self.visdisable(false);\n        self.visenable(false);\n        self.visdisables(permitPeriodEdit && disableCount >= 0 && enableCount > 0 && !inListView);\n        self.visenables(permitPeriodEdit && disableCount >= 0 && enableCount === 0 && !inListView);\n      }\n\n      self.vishelp(true);\n      self.visrefresh(true);\n      self.vistools(true);\n      self.visdownloadReport(true);\n      self.viscreate(permitPeriodEdit && notIneffective && isRightEdit);\n    });\n\n    self.loadClientSideFilterData = function () {\n      var context = _h.kocnx();\n\n      var amountType = clientStorage.getSetting(\"AdjustmentDocumentItem_amountType_\" + context.loginCompanyType());\n\n      if (amountType) {\n        self.amountType(Number(amountType));\n      }\n    };\n  } else {\n    self.btnVisibility = ko.computed(function () {\n      self.vishelp(true);\n      self.visrefresh(true);\n      self.vistools(true);\n    });\n  }\n\n  self.init = function () {\n    self.fillTableProperties();\n\n    if (self.viewMode() === \"Edit\") {\n      self.loadClientSideFilterData();\n    }\n\n    self.getRecords();\n  };\n\n  self.onNodeSelect = function (name, list) {\n    self.nodes.removeAll();\n    self.nodeIdList.removeAll();\n\n    if (_h.any(list)) {\n      for (var i = 0; i < list.length; i++) {\n        var target = list[i];\n        self.nodes.push(target);\n        self.nodeIdList.push(target.value);\n      }\n    }\n  };\n\n  self.onSelectNodeSelector = function (name, list) {\n    if (_h.any(list)) {\n      for (var i = 0; i < list.length; i++) {\n        var isExist = false;\n        var target = list[i];\n        if (_h.any(self.nodes())) for (var j = 0; j < self.nodes().length; j++) {\n          if (self.nodes()[j].value === target.value) isExist = self.nodes()[j];\n        }\n\n        if (!isExist) {\n          self.nodes.push(list[i]);\n          self.nodeIdList.push(list[i].value);\n        }\n      }\n    } else {\n      self.nodes.removeAll();\n      self.nodeIdList.removeAll();\n    }\n\n    setTimeout(function () {\n      $(\".adjastment-item-filter\").parent(\".dropdown\").addClass(\"open\");\n    }, 100);\n  };\n\n  self.updateFilterProfileBtn = function (m, event) {\n    event.stopPropagation();\n    self.updateFilterProfile(32);\n  };\n\n  self.refreshNodes = ko.observable(false);\n\n  self.clearSearchBoxes = function () {\n    self.activeFilterProfile(null);\n\n    for (var p in self.filters) {\n      if (self.filters.hasOwnProperty(p)) {\n        var target = self.filters[p];\n\n        if (_h.isNullOrEmpty(target[\"clear\"]) && (!target.type || target.type !== \"list\")) {\n          if (target.name !== \"adjustmentId\" && target.name !== \"adjustmentName\") self[target.name](target.def);\n        }\n\n        if (_h.isNullOrEmpty(target[\"clear\"]) && target.type && target.type === \"list\") self[target.name].removeAll();\n      }\n    }\n\n    self.refreshNodes(true);\n    self.refreshNodes(false);\n    if (self.viewMode() === \"Edit\") self.loadClientSideFilterData();\n    self.inputFilterProfile(\"\");\n    self.searchKey(\"\");\n    self.pageNumber(1);\n    self.getRecords();\n  };\n\n  self.activeFilterProfile.subscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      var item = self.getFilterProfile(newValue);\n\n      if (item) {\n        for (var p in item.filters) {\n          if (item.filters.hasOwnProperty(p)) {\n            var val = item.filters[p];\n            var filter = self[p];\n\n            if (filter) {\n              if (p === \"nodes\") {\n                var dupArray = JSON.parse(JSON.stringify(val));\n                filter(dupArray);\n                self.refreshNodes(true);\n                self.refreshNodes(false);\n              } else if (p === \"nodeIdList\") {\n                var nodeIdList = JSON.parse(JSON.stringify(val));\n                filter(nodeIdList);\n              } else if (p === \"companies\") {\n                var companies = JSON.parse(JSON.stringify(val));\n                filter(companies);\n              } else {\n                filter(val);\n              }\n            }\n          }\n        }\n      }\n    }\n  });\n}\nvar AdjustmentDocumentItemForm = /*#__PURE__*/function (_FormBuilder) {\n  _inherits(AdjustmentDocumentItemForm, _FormBuilder);\n\n  var _super4 = _createSuper(AdjustmentDocumentItemForm);\n\n  function AdjustmentDocumentItemForm(viewModel, editMode, data) {\n    var _this4;\n\n    _classCallCheck(this, AdjustmentDocumentItemForm);\n\n    _this4 = _super4.call(this);\n    _this4.entityName = \"AdjustmentDocumentItemForm\";\n    _this4.width = \"45%\";\n    _this4.defaultCompanyId = ko.observable(viewModel.defaultCompanyId());\n    _this4.startDance = ko.observable(false);\n    _this4.editMode = ko.observable(editMode);\n    _this4.caption = ko.observable(!_this4.editMode() ? _h.getLocalizedText('createItemCaption') : _h.getLocalizedText('editItemCaption'));\n    _this4.parentVM = viewModel;\n\n    _this4.createProperties();\n\n    _this4.allowInputDecimal = ko.pureComputed(function () {\n      return this.currencyType() === 2 && this.adjustmentItemType() === 1;\n    }.bind(_assertThisInitialized(_this4)));\n    _this4.creditor = ko.observable(data.creditor).extend({\n      inputNumberFormatter: {\n        negative: false,\n        decimalNumber: _this4.allowInputDecimal,\n        callback: _this4.creditorChanged.bind(_assertThisInitialized(_this4))\n      }\n    });\n    _this4.debtor = ko.observable(data.debtor).extend({\n      inputNumberFormatter: {\n        negative: false,\n        decimalNumber: _this4.allowInputDecimal,\n        callback: _this4.debtorChanged.bind(_assertThisInitialized(_this4))\n      }\n    });\n\n    _this4.fillModel(data);\n\n    _this4.visAdjustmentId = ko.pureComputed(function () {\n      return _h.isNullOrEmpty(this.adjustmentId()) || this.adjustmentId() === 0;\n    }.bind(_assertThisInitialized(_this4)));\n    _this4.disableRefreshInfo = false;\n    _this4.oldAdjustmentId = _this4.adjustmentId();\n\n    _this4.adjustmentId.subscribe(function (newValue) {\n      if (!_h.isNullOrEmpty(newValue) && newValue !== this.oldAdjustmentId) {\n        this.parentVM.getFormInfo(newValue, undefined, function (dataInfo) {\n          this.disableRefreshInfo = true;\n          this.fillModel(dataInfo);\n          this.startDance(!this.startDance());\n          this.disableRefreshInfo = false;\n        }.bind(this));\n      }\n    }.bind(_assertThisInitialized(_this4)));\n\n    _this4.visAdjustmentItemType = ko.pureComputed(function () {\n      return !this.editMode() && !_h.isNullOrEmpty(this.treeType());\n    }.bind(_assertThisInitialized(_this4)));\n    _this4.visCompanyId = ko.observable(false);\n    _this4.disabledCompanyId = ko.computed(function () {\n      var x = this.startDance();\n\n      if (_h.kocnx().loginCompanyType() === 0) {\n        this.visCompanyId(true);\n        var id;\n\n        if (this.treeType() === 0) {\n          id = this.defaultCompanyId();\n\n          if (!_h.isNullOrEmpty(id)) {\n            this.companyId(id);\n            return true;\n          } else {\n            return false;\n          }\n        }\n\n        if (this.treeType() === 1) {\n          id = _h.kocnx().loginCompanyId();\n          this.companyId(id);\n          return true;\n        }\n      } else {\n        this.visCompanyId(false);\n        return true;\n      }\n    }.bind(_assertThisInitialized(_this4)));\n    _this4.disableNodeId = ko.pureComputed(function () {\n      return _h.isNullOrEmpty(this.treeId()) || this.treeId() === 0;\n    }.bind(_assertThisInitialized(_this4)));\n    _this4.visNodeId = ko.computed(function () {\n      switch (this.adjustmentItemType()) {\n        case 2:\n          return _h.kocnx().loginCompanyType() !== 0 || !_h.isNullOrEmpty(this.defaultCompanyId()) || !_h.isNullOrEmpty(this.companyId());\n\n        default:\n          return true;\n      }\n    }.bind(_assertThisInitialized(_this4)));\n    _this4.visIsConditional = ko.pureComputed(function () {\n      return this.adjustmentItemType() === 2;\n    }.bind(_assertThisInitialized(_this4)));\n    _this4.visBaseFormula = ko.computed(function () {\n      return this.adjustmentItemType() === 2 && this.visNodeId() && this.isConditional() === false;\n    }.bind(_assertThisInitialized(_this4)));\n    _this4.visOtherFormula = ko.computed(function () {\n      return this.adjustmentItemType() === 2 && this.visNodeId() && this.isConditional();\n    }.bind(_assertThisInitialized(_this4)));\n    _this4.isManualDocument = ko.computed(function () {\n      return this.adjustmentItemType() === 1 || this.adjustmentItemType() === 3;\n    }.bind(_assertThisInitialized(_this4)));\n    _this4.oldRemainedFormated = ko.pureComputed(function () {\n      return _h.formatNumber(this.oldRemained());\n    }.bind(_assertThisInitialized(_this4)));\n    _this4.newRemainedFormated = ko.pureComputed(function () {\n      return _h.formatNumber(this.newRemained());\n    }.bind(_assertThisInitialized(_this4)));\n\n    _this4.conditionalOperator.subscribe(function (newValue) {\n      if (newValue !== undefined && newValue !== null && newValue > 0) {\n        if (newValue === 7 || newValue === 8) {\n          this.isDisableRightSide(true);\n        } else {\n          this.isDisableRightSide(false);\n        }\n      }\n    }.bind(_assertThisInitialized(_this4)));\n\n    _this4.companyId.subscribe(function (newValue) {\n      if (newValue !== undefined && newValue !== null) {\n        this.getNodeAmount();\n      }\n    }.bind(_assertThisInitialized(_this4)));\n\n    _this4.treeType.subscribe(function (newValue) {\n      switch (newValue) {\n        case 0:\n          this.adjustmentItemTypeList(adjustmentItemTypes);\n          break;\n\n        case 1:\n          this.adjustmentItemTypeList(adjustmentItemTypes2);\n          break;\n\n        case \"\":\n        case undefined:\n        case null:\n          this.adjustmentItemTypeList([]);\n          break;\n      }\n    }.bind(_assertThisInitialized(_this4)));\n\n    _this4.treeType.valueHasMutated();\n\n    _this4.createForm();\n\n    return _this4;\n  }\n\n  _createClass(AdjustmentDocumentItemForm, [{\n    key: \"createProperties\",\n    value: function createProperties() {\n      var paramList = [{\n        name: \"adjustmentList\",\n        type: \"obar\"\n      }, {\n        name: \"adjustmentItemTypeList\",\n        type: \"obar\"\n      }, {\n        name: \"adjustmentId\",\n        type: \"ob\"\n      }, {\n        name: \"adjustmentItemType\",\n        type: \"ob\"\n      }, {\n        name: \"id\",\n        type: \"ob\"\n      }, {\n        name: \"treeId\",\n        type: \"ob\"\n      }, {\n        name: \"treeType\",\n        type: \"ob\"\n      }, {\n        name: \"nodeId\",\n        type: \"ob\"\n      }, {\n        name: \"lastPriority\",\n        type: \"ob\"\n      }, {\n        name: \"priority\",\n        type: \"ob\"\n      }, {\n        name: \"code\",\n        type: \"ob\"\n      }, {\n        name: \"description\",\n        type: \"ob\"\n      }, {\n        name: \"nodeName\",\n        type: \"\"\n      }, {\n        name: \"nodeAccountType\",\n        type: \"ob\"\n      }, {\n        name: \"companyType\",\n        type: \"ob\",\n        val: _h.kocnx().loginCompanyType()\n      }, {\n        name: \"balanceSheetId\",\n        type: \"ob\"\n      }, {\n        name: \"companyId\",\n        type: \"ob\"\n      }, {\n        name: \"accountType\",\n        type: \"ob\"\n      }, {\n        name: \"timeCreated\",\n        type: \"ob\"\n      }, {\n        name: \"firstInputValue\",\n        type: \"ob\"\n      }, {\n        name: \"currencyType\",\n        type: \"ob\"\n      }, {\n        name: \"nodeAmount\",\n        type: \"ob\"\n      }, {\n        name: \"oldRemained\",\n        type: \"ob\"\n      }, {\n        name: \"newRemained\",\n        type: \"ob\"\n      }, {\n        name: \"isDisableCreditor\",\n        type: \"ob\",\n        val: false\n      }, {\n        name: \"isDisableDebtor\",\n        type: \"ob\",\n        val: false\n      }, {\n        name: \"isConditional\",\n        type: \"ob\"\n      }, {\n        name: \"conditionalOperator\",\n        type: \"ob\"\n      }, {\n        name: \"leftSidePhrase\",\n        type: \"ob\"\n      }, {\n        name: \"rightSidePhrase\",\n        type: \"ob\"\n      }, {\n        name: \"baseFormula\",\n        type: \"ob\"\n      }, {\n        name: \"ifTrueFormula\",\n        type: \"ob\"\n      }, {\n        name: \"ifFalseFormula\",\n        type: \"ob\"\n      }, {\n        name: \"isDisableRightSide\",\n        type: \"ob\"\n      }];\n\n      _autoMapper.createPropsFromList(this, paramList);\n    }\n  }, {\n    key: \"fillModel\",\n    value: function fillModel(data) {\n      var creditor = _h.clearNumber(data.creditor);\n\n      var debtor = _h.clearNumber(data.debtor);\n\n      for (var property in data) {\n        if (this[property]) {\n          switch (property) {\n            case \"creditor\":\n              this[property](creditor);\n              break;\n\n            case \"debtor\":\n              this[property](debtor);\n              break;\n\n            case \"lastPriority\":\n              this[property](data.lastPriority);\n              break;\n\n            case \"priority\":\n              this[property](this.editMode() ? data.priority : data.lastPriority + 1);\n              break;\n\n            default:\n              this[property](data[property]);\n              break;\n          }\n        }\n      }\n\n      this.nodeName = data.nodeName;\n\n      if (Big(debtor).eq(0)) {\n        this.isDisableCreditor(false);\n        this.isDisableDebtor(true);\n        if (this.nodeAccountType() === 1) this.firstInputValue(creditor);\n        if (this.nodeAccountType() === 2) this.firstInputValue(\"-\" + creditor);\n      }\n\n      if (Big(creditor).eq(0)) {\n        this.isDisableCreditor(true);\n        this.isDisableDebtor(false);\n        if (this.nodeAccountType() === 1) this.firstInputValue(\"-\" + debtor);\n        if (this.nodeAccountType() === 2) this.firstInputValue(debtor);\n      }\n\n      if (Big(creditor).eq(0) && Big(debtor).eq(0)) {\n        this.isDisableCreditor(false);\n        this.isDisableDebtor(false);\n      }\n\n      if (data.adjustmentItemType) {\n        this.getNodeAmount();\n      }\n\n      if (!this.adjustmentId()) {\n        this.getAdjustmentList();\n      }\n\n      this.setValidationObject();\n    }\n  }, {\n    key: \"creditorChanged\",\n    value: function creditorChanged(number) {\n      if (!_h.isNullOrEmpty(number) && number !== \"\" && number !== \"0\") {\n        this.isDisableDebtor(true);\n        this.isDisableCreditor(false);\n      }\n\n      if (!_h.isNullOrEmpty(number) && (number === \"\" || number === \"0\")) {\n        this.isDisableDebtor(false);\n        this.isDisableCreditor(false);\n      }\n\n      this.calculateNewRemained(number, 1);\n    }\n  }, {\n    key: \"debtorChanged\",\n    value: function debtorChanged(number) {\n      if (!_h.isNullOrEmpty(number) && number !== \"\" && number !== \"0\") {\n        this.isDisableDebtor(false);\n        this.isDisableCreditor(true);\n      }\n\n      if (!_h.isNullOrEmpty(number) && (number === \"\" || number === \"0\")) {\n        this.isDisableDebtor(false);\n        this.isDisableCreditor(false);\n      }\n\n      this.calculateNewRemained(number, 2);\n    }\n  }, {\n    key: \"onNodeSelect\",\n    value: function onNodeSelect(name, value, itemValue) {\n      this.nodeId(value);\n\n      switch (this.adjustmentItemType()) {\n        case 3:\n        case 1:\n          if (!_h.isNullOrEmpty(value)) {\n            this.getNodeAmount();\n          } else {\n            this.oldRemained(undefined);\n            this.newRemained(undefined);\n            this.creditor(0);\n            this.debtor(0);\n          }\n\n          break;\n\n        case 2:\n          if (!_h.isNullOrEmpty(value)) {\n            var context = _h.kocnx();\n\n            var val = null;\n\n            if (this.companyType() === 0) {\n              val = \"[node:\" + itemValue.code + \"-\" + this.companyId() + \"-B]\";\n            } else val = \"[node:\" + itemValue.code + \"]\";\n\n            this.ifTrueFormula(val);\n            this.ifFalseFormula(val);\n            this.leftSidePhrase(val);\n            this.baseFormula(val);\n            this.rightSidePhrase(val);\n          }\n\n          break;\n      }\n    }\n  }, {\n    key: \"getNodeAmount\",\n    value: function getNodeAmount() {\n      if (_h.isNullOrEmpty(this.nodeId()) || this.nodeId() === \"\") return;\n      var model = {\n        treeId: this.treeId(),\n        nodeId: this.nodeId(),\n        companyId: this.companyId(),\n        adjustmentId: this.adjustmentId(),\n        balanceSheetId: this.balanceSheetId()\n      };\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/adjustmentdocumentitem/getnodeamount\",\n        data: model,\n        success: function (data) {\n          var number1, number2, resP;\n\n          var ba = _h.clearNumber(data.balance);\n\n          if (this.editMode() === false) {\n            this.nodeAmount(data);\n            this.newRemained(ba);\n            this.oldRemained(ba);\n            this.nodeAccountType(data.accountType);\n\n            if (Big(this.creditor()).gt(0)) {\n              this.calculateNewRemained(this.creditor(), 1);\n            }\n\n            if (Big(this.debtor()).gt(0)) {\n              this.calculateNewRemained(this.debtor(), 2);\n            }\n\n            if (Big(this.creditor()).eq(0) && Big(this.debtor()).eq(0)) {\n              this.newRemained(this.oldRemained());\n            }\n          } else {\n            this.nodeAccountType(data.accountType);\n            this.nodeAmount(data);\n            this.newRemained(ba);\n\n            if (this.firstInputValue() !== 0) {\n              number1 = new Big(ba);\n              number2 = new Big(this.firstInputValue());\n              resP = number1.minus(number2).toString();\n              this.oldRemained(resP);\n              this.firstInputValue(0);\n            } else {\n              this.oldRemained(ba);\n            }\n\n            if (Big(this.creditor()).gt(0)) {\n              this.calculateNewRemained(this.creditor(), 1);\n            }\n\n            if (Big(this.debtor()).gt(0)) {\n              this.calculateNewRemained(this.debtor(), 2);\n            }\n\n            if (Big(this.creditor()).eq(0) && Big(this.debtor()).eq(0)) {\n              this.newRemained(this.oldRemained());\n              this.isDisableCreditor(false);\n              this.isDisableDebtor(false);\n            }\n          }\n        }.bind(this),\n        error: function error(data) {\n          var text = _h.getApiMessage(\"LoadTreeNodeAmountError\");\n\n          _h.failToast(text);\n        }\n      });\n    }\n  }, {\n    key: \"calculateNewRemained\",\n    value: function calculateNewRemained(value, inputAccountType) {\n      if (value === null || value === \"\" || value === \"-\" || value === \"0\" || value === undefined) value = 0;\n      if (this.oldRemained() === null || this.oldRemained() === undefined) this.oldRemained(0);\n      var numberInput = new Big(value);\n      var old = new Big(this.oldRemained());\n      var res;\n      if (inputAccountType === this.nodeAccountType()) res = old.plus(numberInput).toString();else res = old.minus(numberInput).toString();\n      this.newRemained(res);\n    }\n  }, {\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      self.validationObject = ko.validatedObservable({\n        adjustmentItemType: self.adjustmentItemType.extend({\n          required: true\n        }),\n        treeId: self.treeId.extend({\n          required: true\n        }),\n        nodeId: self.nodeId.extend({\n          required: true\n        }),\n        companyId: self.companyId.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.companyType() === 0;\n            }\n          }\n        }),\n        balanceSheetId: self.balanceSheetId.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.companyType() === 1 && self.treeType() === 0;\n            }\n          }\n        }),\n        creditor: self.creditor.extend({\n          number: true,\n          onlyTenDigitDecimal: true,\n          max29Digit: true,\n          required: {\n            onlyIf: function onlyIf() {\n              return (self.adjustmentItemType() === 1 || self.adjustmentItemType() === 3) && (self.debtor() === null || self.debtor() === undefined || self.debtor() < 1);\n            }\n          }\n        }),\n        debtor: self.debtor.extend({\n          number: true,\n          onlyTenDigitDecimal: true,\n          max29Digit: true,\n          required: {\n            onlyIf: function onlyIf() {\n              return (self.adjustmentItemType() === 1 || self.adjustmentItemType() === 3) && (self.creditor() === null || self.creditor() === undefined || self.creditor() < 1);\n            }\n          }\n        }),\n        code: self.code.extend({\n          minLength: {\n            params: 1,\n            message: \"لطفاً حداقل 1 رقم وارد نمایید\"\n          },\n          maxLength: {\n            params: 9,\n            message: \"لطفاً حداکثر 9 رقم وارد نمایید\"\n          },\n          numberOnly: null,\n          remoteIsUniqueRule: {\n            params: [self.id, \"AdjustmentDocumentItem\", \"code\", self.adjustmentId]\n          }\n        }),\n        priority: self.priority.extend({\n          required: true\n        }),\n        baseFormula: self.baseFormula.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.adjustmentItemType() === 2 && self.isConditional() === false;\n            }\n          },\n          remoteIsValidateFormula: {\n            onlyIf: function onlyIf() {\n              return self.adjustmentItemType() === 2 && self.isConditional() === false;\n            },\n            params: 32\n          }\n        }),\n        rightSidePhrase: self.rightSidePhrase.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              if (self.adjustmentItemType() !== 2 || self.isConditional() !== true) return false;\n              return self.conditionalOperator() !== 7 && self.conditionalOperator() !== 8 && self.conditionalOperator() !== 0;\n            }\n          },\n          remoteIsValidateFormula: {\n            onlyIf: function onlyIf() {\n              return self.adjustmentItemType() === 2 && self.isConditional() === true;\n            },\n            params: 32\n          }\n        }),\n        leftSidePhrase: self.leftSidePhrase.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.adjustmentItemType() === 2 && self.isConditional() === true;\n            }\n          },\n          remoteIsValidateFormula: {\n            onlyIf: function onlyIf() {\n              return self.adjustmentItemType() === 2 && self.isConditional() === true;\n            },\n            params: 32\n          }\n        }),\n        conditionalOperator: self.conditionalOperator.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.adjustmentItemType() === 2 && self.isConditional() === true;\n            }\n          }\n        }),\n        ifTrueFormula: self.ifTrueFormula.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.adjustmentItemType() === 2 && self.isConditional() === true;\n            }\n          },\n          remoteIsValidateFormula: {\n            onlyIf: function onlyIf() {\n              return self.adjustmentItemType() === 2 && self.isConditional() === true;\n            },\n            params: 32\n          }\n        }),\n        ifFalseFormula: self.ifFalseFormula.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.adjustmentItemType() === 2 && self.isConditional() === true;\n            }\n          },\n          remoteIsValidateFormula: {\n            onlyIf: function onlyIf() {\n              return self.adjustmentItemType() === 2 && self.isConditional() === true;\n            },\n            params: 32\n          }\n        }),\n        accountType: self.accountType.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.adjustmentItemType() === 2;\n            }\n          }\n        })\n      });\n    }\n  }, {\n    key: \"toggleIsConditional\",\n    value: function toggleIsConditional() {\n      this.isConditional(!this.isConditional());\n    }\n  }, {\n    key: \"getAdjustmentList\",\n    value: function getAdjustmentList() {\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/adjustmentdocument/getadjustmentselectlist\",\n        success: function (list) {\n          if (_h.any(list)) {\n            for (var i = 0; i < list.length; i++) {\n              this.adjustmentList.push(new SelectItem(list[i]));\n            }\n          }\n        }.bind(this),\n        error: function error(data) {}\n      });\n    }\n  }, {\n    key: \"onChangeFormula\",\n    value: function onChangeFormula(value, name) {\n      this[name](value);\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'slc',\n        val: this.adjustmentId,\n        options: this.adjustmentList\n      }, null, this.visAdjustmentId, 30), this.createLine({\n        t: 'slc',\n        val: this.adjustmentItemType,\n        options: this.adjustmentItemTypeList\n      }, null, this.visAdjustmentItemType, 30), this.createLine({\n        t: 'slc',\n        val: this.companyId,\n        options: _h.kocnx().advm().companies,\n        dis: this.disabledCompanyId\n      }, null, this.visCompanyId, 30), this.createLine({\n        t: 'tsp',\n        val: this.priority,\n        min: 1,\n        max: this.editMode() === true ? this.lastPriority() : this.priority()\n      }, {\n        t: 'txb',\n        val: this.code\n      }, true, 30), this.createLine({\n        t: 'slcn',\n        treeId: this.treeId,\n        slcType: \"single\",\n        branchSelectable: false,\n        val: this.nodeId,\n        valName: this.nodeName,\n        dis: this.disableNodeId,\n        location: \"AutomaticAdjustmentDocumentItem\"\n      }, undefined, this.visNodeId, 30), this.createLine({\n        t: 'chk',\n        val: this.isConditional,\n        click: this.toggleIsConditional\n      }, undefined, this.visIsConditional, 30), this.createLine({\n        t: 'slcfm',\n        val: this.baseFormula\n      }, null, this.visBaseFormula, 30), this.createLine({\n        t: 'slcfm',\n        val: this.rightSidePhrase\n      }, null, this.visOtherFormula, 30), this.createLine({\n        t: 'slc',\n        val: this.conditionalOperator,\n        options: conditionalOperators\n      }, null, this.visOtherFormula, 30), this.createLine({\n        t: 'slcfm',\n        val: this.leftSidePhrase\n      }, null, this.visOtherFormula, 30), this.createLine({\n        t: 'slcfm',\n        val: this.ifTrueFormula\n      }, null, this.visOtherFormula, 30), this.createLine({\n        t: 'slcfm',\n        val: this.ifFalseFormula\n      }, null, this.visOtherFormula, 30), this.createLine({\n        t: 'slc',\n        val: this.accountType,\n        options: accountTypes\n      }, null, this.visIsConditional, 30), this.createLine({\n        t: 'txf',\n        val: this.debtor,\n        dis: this.isDisableDebtor\n      }, {\n        t: 'txf',\n        val: this.creditor,\n        dis: this.isDisableCreditor\n      }, this.isManualDocument, 30), this.createLine({\n        t: 'tm',\n        templateName: 'adjustmentdocumentitem-remainedformated-form-t'\n      }, undefined, true, 0, 0), this.createLine({\n        t: 'txa',\n        val: this.description\n      }, undefined, true, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'create',\n            vis: !this.editMode(),\n            click: this.parentVM.create\n          }, {\n            name: 'edit',\n            vis: this.editMode,\n            click: this.parentVM.edit\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      var amendmentItem = ko.toJS(this);\n      amendmentItem.nodeSelectModeForm = null;\n      amendmentItem.nodeAmount = null;\n      amendmentItem.amountType = this.parentVM.amountType();\n      delete amendmentItem[\"validationObject\"];\n      delete amendmentItem[\"formButtons\"];\n      delete amendmentItem[\"formControls\"];\n      delete amendmentItem[\"parentVM\"];\n      delete amendmentItem[\"editMode\"];\n      delete amendmentItem[\"ad\"];\n      delete amendmentItem[\"selected\"];\n      delete amendmentItem[\"ruleModel\"];\n      return amendmentItem;\n    }\n  }]);\n\n  return AdjustmentDocumentItemForm;\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_1__.FormBuilder);\n\n//# sourceURL=webpack://domino/./src/scripts/pages/adjustmentdocument/model.js?");

/***/ }),

/***/ "./src/scripts/pages/adjustmentdocument/resource.js":
/*!**********************************************************!*\
  !*** ./src/scripts/pages/adjustmentdocument/resource.js ***!
  \**********************************************************/
/***/ (() => {

eval("window.adjustmentItemTypes = [{\n  text: \"دستی\",\n  enText: \"Manual\",\n  value: 1\n}, {\n  text: \"اتوماتیک\",\n  enText: \"Automatic\",\n  value: 2\n}, {\n  text: \"بستن حساب\",\n  enText: \"Balance\",\n  value: 4\n}, {\n  text: \"بالانس\",\n  enText: \"Variance\",\n  value: 5\n}];\nwindow.adjustmentItemTypes2 = [{\n  text: \"جریان وجوه نقد\",\n  enText: \"CashFlow\",\n  value: 3\n}, {\n  text: \"بستن حساب\",\n  enText: \"Balance\",\n  value: 4\n}, {\n  text: \"بالانس\",\n  enText: \"Variance\",\n  value: 5\n}];\nwindow.adjustmentItemTypes3 = [{\n  text: \"دستی\",\n  enText: \"Manual\",\n  value: 1\n}, {\n  text: \"اتوماتیک\",\n  enText: \"Automatic\",\n  value: 2\n}, {\n  text: \"جریان وجوه نقد\",\n  enText: \"CashFlow\",\n  value: 3\n}, {\n  text: \"بستن حساب\",\n  enText: \"Balance\",\n  value: 4\n}, {\n  text: \"بالانس\",\n  enText: \"Variance\",\n  value: 5\n}];\nwindow.conditionalOperators = [{\n  text: \"بدون انتخاب\",\n  enText: \"None\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"<\",\n  enText: \"LessThan\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \">\",\n  enText: \"GreaterThan\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"=\",\n  enText: \"Equal\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"<>\",\n  enText: \"Unequal\",\n  value: 4,\n  color: \"\"\n}, {\n  text: \"<=\",\n  enText: \"LessThanOrEqual\",\n  value: 5,\n  color: \"\"\n}, {\n  text: \">=\",\n  enText: \"GreaterThanOrEqual\",\n  value: 6,\n  color: \"\"\n}, {\n  text: \"بدهکار\",\n  enText: \"IsDebtor\",\n  value: 7,\n  color: \"\"\n}, {\n  text: \"بستانکار\",\n  enText: \"IsCreditor\",\n  value: 8,\n  color: \"\"\n}];\nwindow.adjustmentdocumentModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  priority: {\n    fa: 'اولویت',\n    colName: 'priority',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"Ascending\",\n    alias: null,\n    size: 6,\n    type: \"string\"\n  },\n  code: {\n    fa: 'شماره',\n    colName: 'code',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 6,\n    type: \"string\",\n    popup: true\n  },\n  title: {\n    fa: 'عنوان',\n    colName: 'title',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\",\n    visibleItem: true,\n    popup: true\n  },\n  description: {\n    fa: 'توضیحات',\n    colName: 'description',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"lstring\"\n  },\n  stateType: {\n    fa: 'وضعیت',\n    colName: 'stateType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"stateSwitch\"\n  },\n  confirmationState: {\n    fa: 'وضعیت تایید',\n    colName: 'confirmationState',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"enum\"\n  },\n  timeCreated: {\n    fa: 'زمان ایجاد',\n    colName: 'timeCreated',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"pdate\"\n  },\n  createByUser: {\n    fa: 'کاربر ایجاد کننده',\n    colName: 'createByUser',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  confirmByUser: {\n    fa: 'کاربر تایید کننده',\n    colName: 'confirmByUser',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\",\n    popup: true\n  },\n  lastEditorName: {\n    fa: 'ویرایش کننده',\n    colName: 'lastEditorName',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  lastEditTime: {\n    fa: 'تاریخ آخرین ویرایش',\n    colName: 'lastEditTime',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"pdatetime\"\n  },\n  balanceSheetName: {\n    fa: 'فایل تراز',\n    colName: 'balanceSheetName',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: \"balanceSheetId\",\n    type: \"string\"\n  },\n  folderName: {\n    fa: 'پوشه',\n    colName: 'folderName',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: \"folderId\",\n    groupBy: true,\n    groupDir: \"Ascending\",\n    type: \"string\"\n  },\n  treeName: {\n    fa: 'درختواره',\n    colName: 'treeName',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: \"treeId\",\n    type: \"string\"\n  },\n  defaultCompanyName: {\n    fa: 'گروه/شرکت پیش فرض',\n    colName: 'defaultCompanyName',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: \"defaultCompanyId\",\n    type: \"string\"\n  },\n  tagsString: {\n    fa: 'برچسب ها',\n    colName: 'tagsString',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: \"tags\",\n    type: \"string\"\n  },\n  folderId: {\n    fa: 'پوشه',\n    colName: 'folderId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  treeId: {\n    fa: 'درختواره',\n    colName: 'treeId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\"\n  },\n  defaultCompanyId: {\n    fa: 'گروه/شرکت',\n    colName: 'defaultCompanyId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\"\n  },\n  balanceSheetId: {\n    fa: 'فایل تراز',\n    colName: 'balanceSheetId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\"\n  },\n  tags: {\n    fa: 'برچسب ها',\n    colName: 'tags',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\"\n  }\n};\nwindow.adjustmentdocumentPageRes = {\n  pageCaption: {\n    fa: 'اسناد اصلاحی و طبقه بندی'\n  },\n  createCaption: {\n    fa: 'تعریف سند اصلاحی و طبقه بندی'\n  },\n  editCaption: {\n    fa: 'ویرایش سند اصلاحی و طبقه بندی'\n  },\n  deleteCaption: {\n    fa: 'حذف سند اصلاحی و طبقه بندی'\n  },\n  upCaption: {\n    fa: 'افزایش الویت سند اصلاحی و طبقه بندی'\n  },\n  downCaption: {\n    fa: 'کاهش الویت سند اصلاحی و طبقه بندی'\n  },\n  copyCaption: {\n    fa: 'کپی سند اصلاحی و طبقه بندی'\n  },\n  copiesCaption: {\n    fa: 'کپی اسناد اصلاحی و طبقه بندی'\n  },\n  createPdfCaption: {\n    fa: 'دانلود pdf سند اصلاحی و طبقه بندی'\n  },\n  companyId: {\n    fa: 'گروه/شرکت'\n  },\n  justIneffective: {\n    fa: 'فقط نمایش اسناد بلااثر'\n  },\n  displayType: {\n    fa: 'وضعیت نمایش'\n  },\n  codeRange: {\n    fa: 'شماره سند'\n  },\n  empty: {\n    fa: 'فقط اسناد بدون بند'\n  },\n  withVariance: {\n    fa: 'فقط اسناد دارای مغایرت'\n  },\n  amountType: {\n    fa: 'نمایش ارقام'\n  },\n  stateType: {\n    fa: 'وضعیت'\n  },\n  adjustmentCode: {\n    fa: 'شماره سند'\n  },\n  debtor: {\n    fa: 'بدهکار'\n  },\n  creditor: {\n    fa: 'بستانکار'\n  }\n};\nwindow.adjustmentdocumentitemModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  priority: {\n    fa: 'ردیف',\n    colName: 'priority',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"Ascending\",\n    alias: null,\n    size: 6,\n    type: \"string\"\n  },\n  code: {\n    fa: 'شماره',\n    colName: 'code',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 6,\n    type: \"string\",\n    popup: true\n  },\n  nodeCode: {\n    fa: 'کد حساب',\n    colName: 'nodeCode',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 9,\n    type: \"string\",\n    popup: true\n  },\n  adjustmentItemType: {\n    fa: 'نوع بند سند',\n    colName: 'adjustmentItemType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"enum\",\n    enumSourceName: \"adjustmentItemTypes3\"\n  },\n  nodeName: {\n    fa: 'عنوان حساب',\n    colName: 'nodeName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"adjustmentdocument-nodeName-template\"\n  },\n  debtor: {\n    fa: 'بدهکار',\n    colName: 'debtor',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"money\",\n    popup: true\n  },\n  creditor: {\n    fa: 'بستانکار',\n    colName: 'creditor',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"money\",\n    popup: true\n  },\n  stateType: {\n    fa: 'وضعیت',\n    colName: 'stateType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"stateSwitch\"\n  },\n  description: {\n    fa: 'شرح بند سند',\n    colName: 'description',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\",\n    popup: true\n  },\n  companyName: {\n    fa: 'گروه/شرکت',\n    colName: 'companyName',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: \"companyId\",\n    type: \"string\",\n    popup: true\n  },\n  createdByUser: {\n    fa: 'کاربر ایجاد کننده',\n    colName: 'createdByUser',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\",\n    popup: true\n  },\n  lastEditorName: {\n    fa: 'ویرایش کننده',\n    colName: 'lastEditorName',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  lastEditTime: {\n    fa: 'تاریخ آخرین ویرایش',\n    colName: 'lastEditTime',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"pdatetime\"\n  },\n  adjustmentName: {\n    fa: 'نام سند',\n    colName: 'adjustmentName',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\",\n    popup: true\n  }\n};\nwindow.adjustmentdocumentitemPageRes = {\n  ItemPageCaption: {\n    fa: 'بند سند اصلاحی و طبقه بندی '\n  },\n  createItemCaption: {\n    fa: 'تعریف بند سنداصلاحی و طبقه بندی'\n  },\n  editItemCaption: {\n    fa: 'ویرایش بند سند اصلاحی و طبقه بندی'\n  },\n  deleteItemCaption: {\n    fa: 'حذف بند سند اصلاحی و طبقه بندی'\n  },\n  upItemCaption: {\n    fa: 'افزایش الویت بند سند اصلاحی و طبقه بندی'\n  },\n  downItemCaption: {\n    fa: 'کاهش الویت بند سند اصلاحی و طبقه بندی'\n  },\n  newRemained: {\n    fa: 'مانده نهایی'\n  },\n  oldRemained: {\n    fa: 'مانده قبلی'\n  },\n  nodeId: {\n    fa: 'کد گره'\n  },\n  isConditional: {\n    fa: 'تعریف شرط'\n  },\n  conditionalOperator: {\n    fa: 'عملگر'\n  },\n  baseFormula: {\n    fa: 'فرمول'\n  },\n  ifTrueFormula: {\n    fa: 'برقراری شرط'\n  },\n  ifFalseFormula: {\n    fa: 'عدم برقراری شرط'\n  },\n  rightSidePhrase: {\n    fa: 'سمت راست شرط'\n  },\n  leftSidePhrase: {\n    fa: 'سمت چپ شرط'\n  },\n  accountType: {\n    fa: 'ماهیت بند سند'\n  },\n  amount: {\n    fa: 'مقدار بند '\n  },\n  companies: {\n    fa: 'فهرست گروه و شرکت'\n  },\n  nodes: {\n    fa: 'فهرست گره'\n  },\n  userId: {\n    fa: 'کاربر'\n  },\n  repeated: {\n    fa: 'بند با مقدار تکراری'\n  },\n  justIneffectiveItem: {\n    fa: 'فقط بند های بلا اثر'\n  },\n  adjustmentId: {\n    fa: 'سند'\n  },\n  codeRangeItem: {\n    fa: 'شماره بند'\n  },\n  downloadReportItemCaption: {\n    fa: 'دریافت خروجی فایل'\n  },\n  downloadReportCaption: {\n    fa: 'دریافت خروجی فایل'\n  },\n  consolidationCompany: {\n    fa: 'حساب متقابل'\n  },\n  debtor: {\n    fa: ''\n  },\n  creditor: {\n    fa: ''\n  },\n  adjustmentStateType: {\n    fa: 'وضعیت سند'\n  },\n  adjustmentItemstateType: {\n    fa: 'وضعیت بند'\n  },\n  folders: {\n    fa: 'پوشه'\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/pages/adjustmentdocument/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/adjustmentdocument/viewModel.js":
/*!***********************************************************!*\
  !*** ./src/scripts/pages/adjustmentdocument/viewModel.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"AdjustmentDocumentViewModel\": () => (/* binding */ AdjustmentDocumentViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/model */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./model */ \"./src/scripts/pages/adjustmentdocument/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n__webpack_require__(/*! ./model */ \"./src/scripts/pages/adjustmentdocument/model.js\");\n\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/adjustmentdocument/resource.js\");\n\nvar _require = __webpack_require__(/*! ../master/baseViewModel */ \"./src/scripts/pages/master/baseViewModel.js\"),\n    BaseViewModel = _require.BaseViewModel;\n\n\n\nfunction AdjustmentDocumentViewModel(mode) {\n  var self = this;\n  self.caption = ko.observable();\n  self.viewMode = ko.observable(mode !== undefined ? mode : \"Edit\");\n  self.trees = ko.observableArray();\n  self.users = ko.observableArray();\n  self.balancesheets = ko.observableArray();\n  self.companies = ko.observableArray();\n  self.consolidatedCompanies = ko.observableArray();\n\n  self.getAdjustmentOptions = function () {\n    self.apiService.request({\n      name: \"getAdjustmentOptions\",\n      success: function success(data) {\n        self.balancesheets.removeAll();\n        self.companies.removeAll();\n        self.trees.removeAll();\n        self.consolidatedCompanies.removeAll();\n        if (_h.any(data.balanceSheets)) for (var j = 0; j < data.balanceSheets.length; j++) {\n          var target = data.balanceSheets[j];\n          self.balancesheets.push(new _master_model__WEBPACK_IMPORTED_MODULE_0__.TreeMapSelect(target));\n        }\n        if (!_h.isNullOrEmpty(self[\"balanceSheetId\"]) && self.viewMode() === \"Edit\") self.balanceSheetId(null);\n        if (_h.any(data.companies)) for (var m = 0; m < data.companies.length; m++) {\n          var company = data.companies[m];\n          self.companies.push(new _master_model__WEBPACK_IMPORTED_MODULE_0__.SelectItem(company));\n        }\n        if (!_h.isNullOrEmpty(self[\"companyId\"]) && self.viewMode() === \"Edit\") self.companyId(null);\n        if (_h.any(data.trees)) for (var k = 0; k < data.trees.length; k++) {\n          var tree = data.trees[k];\n          self.trees.push(new _master_model__WEBPACK_IMPORTED_MODULE_0__.TreeAdjustmentSelectItem(tree));\n        }\n        if (_h.any(data.users)) for (var a = 0; a < data.users.length; a++) {\n          var user = data.users[a];\n          self.users.push(new _master_model__WEBPACK_IMPORTED_MODULE_0__.SelectItem(user));\n        }\n        if (_h.any(data.consolidatedCompanies)) for (var b = 0; b < data.consolidatedCompanies.length; b++) {\n          var consolidatedCompany = data.consolidatedCompanies[b];\n          self.consolidatedCompanies.push(new _master_model__WEBPACK_IMPORTED_MODULE_0__.SelectItem(consolidatedCompany));\n        }\n        if (!_h.isNullOrEmpty(self[\"treeId\"]) && self.viewMode() === \"Edit\") self.treeId(null);\n      },\n      error: function error(message, level) {}\n    });\n  };\n\n  self.copyBtn = function () {\n    var item = self.multiCommandExecute(\"selectedRowRecord\");\n    var idList = [];\n    idList.push(item.id());\n    self.copyItems(idList);\n  };\n\n  self.copiesBtn = function () {\n    var idList = self.multiCommandExecute(\"selectedItemIds\");\n\n    if (idList.length === 0) {\n      var text = _h.getApiMessage(\"ActionSelectListEmptyError\");\n\n      _h.warningToast(text);\n    } else {\n      self.copyItems(idList);\n    }\n  };\n\n  self.copyItems = function (idList) {\n    var model = {\n      idList: idList\n    };\n    self.apiService.request({\n      name: \"postCopy\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          if (idList.length === 1) toast.success(self.entityName, 'custom', 'Copy');\n          if (idList.length > 1) toast.success(self.entityName, 'custom', 'Copies');\n          self.afterCreate(data.models);\n        }\n      },\n      error: function error(message, status, xhr) {\n        if (idList.length === 1) toast.error(self.entityName, 'custom', 'Copy');\n        if (idList.length > 1) toast.error(self.entityName, 'custom', 'Copies');\n      }\n    });\n  };\n\n  self.createBtn = function () {\n    self.getLastPriority(function (res) {\n      _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_1__.AdjustmentDocumentForm(self, false, res));\n    });\n  };\n\n  self.editBtn = function () {\n    self.getLastPriority(function (res) {\n      _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_1__.AdjustmentDocumentForm(self, true, res));\n    });\n  };\n\n  self.temporaryBtn = function () {\n    var item = self.multiCommandExecute(\"selectedRowRecord\");\n    var idList = [];\n    idList.push(item.id());\n    self.confirmList(idList, 1);\n  };\n\n  self.confirmedBtn = function () {\n    var item = self.multiCommandExecute(\"selectedRowRecord\");\n    var idList = [];\n    idList.push(item.id());\n    self.confirmList(idList, 2);\n  };\n\n  self.temporarysBtn = function () {\n    var idList = self.multiCommandExecute(\"selectedItemIds\");\n\n    if (idList.length === 0) {\n      var text = _h.getApiMessage(\"ActionSelectListEmptyError\");\n\n      _h.warningToast(text);\n    } else {\n      self.confirmList(idList, 1);\n    }\n  };\n\n  self.confirmedsBtn = function () {\n    var idList = self.multiCommandExecute(\"selectedItemIds\");\n\n    if (idList.length === 0) {\n      var text = _h.getApiMessage(\"ActionSelectListEmptyError\");\n\n      _h.warningToast(text);\n    } else {\n      self.confirmList(idList, 2);\n    }\n  };\n\n  self.confirmList = function (ids, action) {\n    var model = {\n      idList: ids,\n      confirmationState: action\n    };\n    self.apiService.request({\n      name: \"putConfirmationType\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          self.multiCommandExecute(\"changesLocalConfirmState\", action, ids, data);\n        }\n      },\n      error: function error(message, status, xhr) {}\n    });\n  };\n\n  self.createPdfBtn = function () {\n    var item = self.multiCommandExecute(\"selectedRowRecord\");\n\n    if (item.itemsCount() <= 0) {\n      toast.custom(\"error\", _h.getApiMessage(\"RequiredItemCount\" + self.entityName));\n      return;\n    }\n\n    var model = {\n      controllerName: 10,\n      inputData: {\n        id: item.id()\n      }\n    };\n\n    _h.kocnx().createPdf(model);\n  };\n\n  self.toggleShowAll = function () {\n    self.showAll(!self.showAll());\n    self.getRecords();\n  };\n\n  self.callBackItemCountData = function (itemsCount) {\n    self.selectedRowRecord().itemsCount(itemsCount);\n  };\n\n  self.createFiltersList = function () {\n    var array;\n\n    if (self.viewMode() === \"Edit\") {\n      array = [{\n        name: 'treeId'\n      }, {\n        name: 'codeRange'\n      }, {\n        name: 'userId'\n      }, {\n        name: 'displayType'\n      }, {\n        name: 'stateType'\n      }, {\n        name: 'companyId'\n      }, {\n        name: 'balanceSheetId'\n      }, {\n        name: 'justIneffective',\n        type: \"bool\"\n      }, {\n        name: 'empty',\n        type: \"bool\"\n      }, {\n        name: 'withVariance',\n        type: \"bool\"\n      }, {\n        name: 'tags',\n        type: \"list\",\n        def: []\n      }];\n    } else {\n      array = [{\n        name: 'treeId',\n        clear: true\n      }, {\n        name: 'nodeId',\n        clear: true\n      }, {\n        name: 'userId'\n      }, {\n        name: 'amountType',\n        clear: true\n      }, {\n        name: 'codeRange'\n      }, {\n        name: 'isCreditor',\n        clear: true\n      }, {\n        name: 'displayType'\n      }, {\n        name: 'showAll',\n        def: false\n      }, {\n        name: 'withVariance',\n        type: \"bool\"\n      }, {\n        name: 'justIneffective',\n        type: \"bool\"\n      }, {\n        name: 'empty',\n        type: \"bool\"\n      }, {\n        name: 'tags',\n        type: \"list\",\n        def: []\n      }];\n      if (_h.kocnx().loginCompanyType() === 0) array.push({\n        name: 'companyId',\n        clear: true\n      });else array.push({\n        name: 'balanceSheetId',\n        clear: true\n      });\n    }\n\n    return array;\n  };\n\n  self.createColList = function () {\n    var array = [];\n\n    for (var p in adjustmentdocumentModelRes) {\n      if (adjustmentdocumentModelRes.hasOwnProperty(p)) {\n        var target = adjustmentdocumentModelRes[p];\n\n        if (_h.kocnx().loginCompanyType() === 0) {\n          if (target.colName !== \"balanceSheetName\") array.push(target);\n        } else {\n          if (target.colName !== \"defaultCompanyName\" && target.colName !== \"amendmentType\") array.push(target);\n        }\n      }\n    }\n\n    return array;\n  };\n\n  self.createButtonList = function () {\n    var array;\n\n    if (self.viewMode() === \"Edit\") {\n      array = [{\n        name: 'edit',\n        access: true,\n        icon: 'Edit',\n        cMenu: true\n      }, {\n        name: 'delete',\n        access: true,\n        icon: 'Delete',\n        cMenu: true\n      }, {\n        name: 'disable',\n        access: true,\n        icon: 'DocDisable',\n        cMenu: true\n      }, {\n        name: 'enable',\n        access: true,\n        icon: 'DocEnable',\n        cMenu: true\n      }, {\n        name: 'disables',\n        access: true,\n        icon: 'DocsDisable',\n        cMenu: true\n      }, {\n        name: 'enables',\n        access: true,\n        icon: 'DocsEnable',\n        cMenu: true\n      }, {\n        name: 'copy',\n        access: true,\n        icon: 'Copy',\n        cMenu: true\n      }, {\n        name: 'copies',\n        access: true,\n        icon: 'Copy',\n        cMenu: true\n      }, {\n        name: 'temporary',\n        access: true,\n        icon: 'DocTemporary',\n        cMenu: true\n      }, {\n        name: 'confirmed',\n        access: true,\n        icon: 'DocConfirm',\n        cMenu: true\n      }, {\n        name: 'temporarys',\n        access: true,\n        icon: 'DocsTemporary',\n        cMenu: true\n      }, {\n        name: 'confirmeds',\n        access: true,\n        icon: 'DocsConfirm',\n        cMenu: true\n      }, {\n        name: 'up',\n        access: true,\n        icon: 'Up',\n        cMenu: true\n      }, {\n        name: 'down',\n        access: true,\n        icon: 'Down',\n        cMenu: true\n      }, {\n        name: 'createPdf',\n        access: true,\n        icon: 'ExportPdf',\n        cMenu: true\n      }, {\n        name: 'help',\n        access: false,\n        cMenu: false\n      }, {\n        name: 'refresh',\n        access: false,\n        cMenu: false\n      }, {\n        name: 'tools',\n        access: false,\n        cMenu: false\n      }, {\n        name: 'create',\n        access: true,\n        cMenu: false\n      }];\n    } else {\n      array = [{\n        name: 'showAllSw',\n        access: false,\n        cMenu: false,\n        templateName: \"showAll-button-template\"\n      }, {\n        name: 'help',\n        access: false,\n        cMenu: false\n      }, {\n        name: 'refresh',\n        access: false,\n        cMenu: false\n      }, {\n        name: 'tools',\n        access: false,\n        cMenu: false\n      }];\n    }\n\n    return array;\n  };\n\n  self.changeChildModel = function (target, force) {\n    if (self.childModel() && self.childModel().adjustmentId() === target.id() && !force) return;\n    var adjustmentModel = new _model__WEBPACK_IMPORTED_MODULE_1__.AdjustmentDocumentItemViewModel(self.viewMode());\n    adjustmentModel.treeId(target.treeId());\n    adjustmentModel.adjustmentId(target.id());\n    adjustmentModel.adjustmentName(target.title());\n    adjustmentModel.ineffective(target.ineffective());\n    if (self[\"amountType\"]) adjustmentModel.amountType(self.amountType());\n    adjustmentModel.displayType(self.displayType());\n    adjustmentModel.parentModel = self;\n\n    if (_h.kocnx().loginCompanyType() === 0) {\n      adjustmentModel.companyId(self.companyId());\n      if (!_h.isNullOrEmpty(target.defaultCompanyId()) && target.defaultCompanyId() > 0) adjustmentModel.defaultCompanyId(target.defaultCompanyId());\n    }\n\n    if (_h.kocnx().loginCompanyType() === 1) {\n      adjustmentModel.balanceSheetId(target.balanceSheetId());\n    }\n\n    adjustmentModel.parentConfirmationState(target.confirmationState());\n    if (target.stateType() === 0 || target.confirmationState() === 2) adjustmentModel.isRightEdit(false);else adjustmentModel.isRightEdit(true);\n\n    if (self.viewMode() !== \"Edit\") {\n      adjustmentModel.nodeId(self.nodeId());\n    }\n\n    self.childModel(adjustmentModel);\n    self.childModel().init();\n    if (self.viewMode() !== \"Edit\") self.caption(_h.getLocalizedText(\"reportBalanceAmendmentItemCaption\") + target.title());\n    self.childModel().iconSize(\"icon-image-small\");\n\n    if (!_h.isNullOrEmpty(self.groupProperty())) {\n      ko.utils.arrayFilter(self.tableProperties(), function (item) {\n        if (item.name === self.groupProperty()) {\n          item.visibleItem(true);\n        }\n      });\n    }\n  };\n\n  ko.utils.extend(self, new BaseViewModel({\n    entityName: \"AdjustmentDocument\",\n    getList: true,\n    apiService: {\n      actionList: [\"filterby\", \"post\", \"put\", \"getadjustmentoptions\", \"postcopy\", \"putconfirmationtype\", \"delete\"]\n    },\n    filters: self.createFiltersList(),\n    buttons: self.createButtonList(),\n    extraParams: [\"lastPriority\", \"searchProfiles\"],\n    sortDirection: \"Ascending\",\n    sortProperty: \"priority\",\n    context: self,\n    saveState: true,\n    filterBoxTemplate: \"adjustment-filter-box-template\",\n    isMultiSelectRows: self.viewMode() === \"Edit\",\n    cols: self.createColList(),\n    selectRow: true,\n    contextMenu: true,\n    searchKeyType: \"enter\",\n    tableClass: \"table ko-tbl ko-tbl-master\",\n    styleRow: \"styleRowValue\",\n    folderManagement: true,\n    tableStyle: \"margin-top:10px;font-size: 11px;\",\n    resizable: true\n  }));\n\n  if (self.viewMode() === \"Edit\") {\n    self.btnVisibility = ko.computed(function () {\n      var context = _h.kocnx();\n\n      var permitPeriodEdit = context.permitPeriodEdit();\n      var inListView = self.showType() === \"List\";\n      var data = self.multiCommandExecute(\"btnVisibilityData2\");\n      if (_h.isNullOrEmpty(data)) return;\n      var temp = data[0];\n      var enableCount = data[1];\n      var disableCount = data[2];\n      var selectedList = data[3];\n      var temporaryCount = data[4];\n      var confirmCount = data[5];\n\n      if (selectedList === 0) {\n        self.viscreate(permitPeriodEdit && !inListView);\n        self.vistools(!inListView);\n        self.visedit(false);\n        self.visdelete(false);\n        self.visup(false);\n        self.visdown(false);\n        self.viscreatePdf(false);\n        self.vistemporarys(false);\n        self.visconfirmeds(false);\n        self.visdisables(false);\n        self.visenables(false);\n        self.vistemporary(false);\n        self.visconfirmed(false);\n        self.visdisable(false);\n        self.visenable(false);\n        self.viscopy(false);\n        self.viscopies(false);\n      }\n\n      if (selectedList === 1) {\n        var item = self.getSelectedRecord();\n        if (item === null || item === undefined) item = temp;\n        var isEditable = item.isEditable();\n        self.viscreate(permitPeriodEdit && !inListView);\n        self.vistools(!inListView);\n        self.visedit(permitPeriodEdit && isEditable && !inListView);\n        self.visdelete(permitPeriodEdit && item.confirmationState() !== 2 && !inListView);\n        self.visup(permitPeriodEdit && isEditable && item.priority() > 1 && !inListView);\n        self.visdown(permitPeriodEdit && isEditable && self.lastPriority() !== item.priority() && !inListView);\n        self.viscreatePdf(!inListView);\n        self.vistemporarys(false);\n        self.visconfirmeds(false);\n        self.visdisables(false);\n        self.visenables(false);\n        self.vistemporary(permitPeriodEdit && temporaryCount >= 0 && confirmCount > 0 && !inListView);\n        self.visconfirmed(permitPeriodEdit && temporaryCount >= 0 && confirmCount === 0 && !inListView);\n        self.visdisable(permitPeriodEdit && disableCount >= 0 && enableCount > 0 && !inListView && item.confirmationState() !== 2);\n        self.visenable(permitPeriodEdit && disableCount >= 0 && enableCount === 0 && !inListView && item.confirmationState() !== 2);\n        self.viscopy(permitPeriodEdit && !inListView);\n        self.viscopies(false);\n      }\n\n      if (selectedList > 1) {\n        self.viscreate(false);\n        self.vistools(!inListView);\n        self.visedit(false);\n        self.visdelete(false);\n        self.visup(false);\n        self.visdown(false);\n        self.viscreatePdf(false);\n        self.vistemporary(false);\n        self.visconfirmed(false);\n        self.visdisable(false);\n        self.visenable(false);\n        self.vistemporarys(permitPeriodEdit && temporaryCount >= 0 && confirmCount > 0 && !inListView);\n        self.visconfirmeds(permitPeriodEdit && temporaryCount >= 0 && confirmCount === 0 && !inListView);\n        self.visdisables(permitPeriodEdit && disableCount >= 0 && enableCount > 0 && !inListView);\n        self.visenables(permitPeriodEdit && disableCount >= 0 && enableCount === 0 && !inListView);\n        self.viscopy(false);\n        self.viscopies(permitPeriodEdit && !inListView);\n      }\n\n      self.vishelp(!inListView);\n      self.visrefresh(!inListView);\n      self.vistools(true);\n    });\n  } else {\n    self.getRecords = function () {\n      var model = self.createFilterByModel();\n      self.apiService.request({\n        name: \"filterBy\",\n        data: model,\n        success: function success(data) {\n          if (!_h.isNullOrEmpty(data)) {\n            self.records.removeAll();\n            var hasRec = false;\n\n            if (_h.any(data.list)) {\n              for (var j = 0; j < data.list.length; j++) {\n                var target = data.list[j];\n                var record = self.getInstance(target);\n                self.records.push(record);\n              }\n\n              hasRec = true;\n\n              _h.kocnx().showBalanceAdjustmentDocumentForm(true);\n            }\n\n            if (_h.any(data.groupList)) {\n              for (var k = 0; k < data.groupList.length; k++) {\n                var target2 = data.groupList[k];\n                var object = {\n                  title: target2.title,\n                  vis: ko.observable(false),\n                  list: ko.observableArray()\n                };\n                if (_h.any(target2.list)) for (var i = 0; i < target2.list.length; i++) {\n                  var record2 = self.getInstance(target2.list[i]);\n                  object.list.push(record2);\n                }\n                self.records.push(object);\n              }\n\n              hasRec = true;\n\n              _h.kocnx().showBalanceAdjustmentDocumentForm(true);\n\n              setTimeout(function () {\n                self.renderedHandler();\n              }, 300);\n            }\n\n            if (!hasRec) {\n              if (self.firstView === true) {\n                var text = _h.getApiMessage(\"GetAdjustmentDocumentDataFail\");\n\n                _h.warningToast(text);\n\n                self.firstView = false;\n              }\n            } else {\n              self.firstView = false;\n            }\n\n            if (self.selectedRowRecord() !== null && self.selectedRowRecord() !== undefined) self.selectedRowRecord().selected(false);\n            self.selectedRowRecord(null);\n            self.childModel(null);\n            self.total(data.total);\n          }\n\n          _h.initResizeTable();\n\n          _h.fixLabelsSize();\n        },\n        error: function error(message, status, xhr) {\n          toast.error(self.entityName, 'getList');\n        }\n      });\n    };\n\n    self.btnVisibility = ko.computed(function () {\n      self.vishelp(true);\n      self.visrefresh(true);\n      self.vistools(true);\n    });\n  }\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.childModel(null);\n\n    if (self.viewMode() === \"Edit\") {\n      self.getAdjustmentOptions();\n      self.getFolderList();\n    } else {\n      self.getAdjustmentOptions();\n    }\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/adjustmentdocument/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/balancereport/model.js":
/*!**************************************************!*\
  !*** ./src/scripts/pages/balancereport/model.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"BalanceReportCompanyData\": () => (/* binding */ BalanceReportCompanyData),\n/* harmony export */   \"BalanceReportCompanyDataViewModel\": () => (/* binding */ BalanceReportCompanyDataViewModel),\n/* harmony export */   \"BalanceReportData\": () => (/* binding */ BalanceReportData),\n/* harmony export */   \"BalanceReportDataViewModel\": () => (/* binding */ BalanceReportDataViewModel),\n/* harmony export */   \"TotalBalanceReportData\": () => (/* binding */ TotalBalanceReportData),\n/* harmony export */   \"TotalBalanceReportDataViewModel\": () => (/* binding */ TotalBalanceReportDataViewModel)\n/* harmony export */ });\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar _require = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\"),\n    BaseModel = _require.BaseModel,\n    BaseFormModel = _require.BaseFormModel,\n    FormBuilder = _require.FormBuilder;\n\n\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\n\nvar BalanceReportData = /*#__PURE__*/function (_BaseModel) {\n  _inherits(BalanceReportData, _BaseModel);\n\n  var _super = _createSuper(BalanceReportData);\n\n  function BalanceReportData(model) {\n    _classCallCheck(this, BalanceReportData);\n\n    return _super.call(this, model);\n  }\n\n  return _createClass(BalanceReportData);\n}(BaseModel);\nvar BalanceReportDataViewModel = /*#__PURE__*/function (_FormBuilder) {\n  _inherits(BalanceReportDataViewModel, _FormBuilder);\n\n  var _super2 = _createSuper(BalanceReportDataViewModel);\n\n  function BalanceReportDataViewModel(model, item) {\n    var _this;\n\n    _classCallCheck(this, BalanceReportDataViewModel);\n\n    _this = _super2.call(this);\n\n    var context = _h.kocnx();\n\n    _this.width = context.loginCompanyType() === 0 ? '96%' : '70%';\n    var caption;\n\n    if (context.loginCompanyType() === 0) {\n      caption = _h.getLocalizedText(\"reportGroupBalanceDataCaption\");\n    }\n\n    if (context.loginCompanyType() === 1) {\n      caption = _h.getLocalizedText(\"reportBalanceDataCaption\");\n      caption = caption.replace(\"__\", item.code);\n    }\n\n    _this.caption = ko.observable(caption);\n    ko.utils.extend(_assertThisInitialized(_this), new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__.BaseViewModel({\n      entityName: \"BalanceReportData\",\n      apiService: {\n        actionList: [\"filterby\"]\n      },\n      filters: [{\n        name: 'balanceSheetId'\n      }, {\n        name: 'companyId'\n      }, {\n        name: 'nodeCode'\n      }, {\n        name: 'nodeId'\n      }, {\n        name: 'treeId'\n      }, {\n        name: 'amountType'\n      }, {\n        name: 'sheetSearchKey'\n      }],\n      extraParams: [\"totalCreditor\", \"totalDebtor\"],\n      sortDirection: \"Ascending\",\n      buttons: [{\n        name: 'exportExcelFile',\n        access: false,\n        icon: 'ExportExcel',\n        cMenu: false\n      }, {\n        name: 'refresh',\n        access: false,\n        cMenu: false\n      }, {\n        name: 'tools',\n        access: false,\n        cMenu: false\n      }],\n      sortProperty: \"code\",\n      context: _assertThisInitialized(_this),\n      cols: _this.createColList(),\n      getList: true,\n      saveState: true,\n      searchKeyType: \"enter\",\n      selectRow: true,\n      footerTemplate: \"reportbalancedata-footertable-template\",\n      tableClass: \"table ko-tbl ko-tbl-master\",\n      tableStyle: \"table-layout: fixed;margin-top:10px;font-size: 11px;\",\n      contextMenu: false\n    }));\n\n    _this.treeId(model.treeId());\n\n    _this.amountType(model.amountType());\n\n    _this.sheetSearchKey(model.sheetSearchKey());\n\n    _this.caption(caption);\n\n    _this.nodeId(item.id);\n\n    _this.nodeCode(item.code);\n\n    _this.balanceSheetId(model.balanceSheetId());\n\n    _this.companyId(model.companyId());\n\n    _this.btnVisibility = ko.computed(function () {\n      var inListView = this.showType() === \"List\";\n      this.visexportExcelFile(!inListView);\n      this.visrefresh(!inListView);\n      this.vistools(true);\n    }.bind(_assertThisInitialized(_this)));\n\n    _this.fillTableProperties();\n\n    _this.getRecords();\n\n    _this.createForm();\n\n    return _this;\n  }\n\n  _createClass(BalanceReportDataViewModel, [{\n    key: \"exportExcelFileBtn\",\n    value: function exportExcelFileBtn() {\n      var context = _h.kocnx();\n\n      var model = {\n        controllerName: 12,\n        inputData: {\n          pageNumber: this.pageNumber(),\n          pageSize: this.pageSize(),\n          sortProperty: this.sortProperty(),\n          sortDirection: this.sortDirection(),\n          searchKey: this.searchKey(),\n          balanceSheetId: this.balanceSheetId(),\n          sheetSearchKey: this.sheetSearchKey(),\n          treeId: this.treeId(),\n          nodeId: this.nodeId(),\n          companyId: this.companyId(),\n          companyType: context.loginCompanyType(),\n          type: 2,\n          amountType: this.amountType()\n        }\n      };\n\n      if (context.loginCompanyType() === 0) {\n        model.inputData.groupId = context.currentCompany().ci;\n        model.inputData.periodId = context.periodItem().pi;\n      }\n\n      if (context.loginCompanyType() === 1) {\n        model.inputData.companyId = context.currentCompany().ci;\n      }\n\n      _h.kocnx().createExcel(model);\n    }\n  }, {\n    key: \"createColList\",\n    value: function createColList() {\n      var array = [];\n\n      for (var p in reportbalancedataModelRes) {\n        if (reportbalancedataModelRes.hasOwnProperty(p)) {\n          var target = reportbalancedataModelRes[p];\n\n          if (_h.kocnx().loginCompanyType() === 0 && p !== \"code\") {\n            array.push(target);\n          }\n\n          if (_h.kocnx().loginCompanyType() === 1) {\n            array.push(target);\n          }\n        }\n      }\n\n      return array;\n    }\n  }, {\n    key: \"changeChildModel\",\n    value: function changeChildModel(target, force) {\n      var detailModel = new BalanceReportCompanyDataViewModel();\n      detailModel.treeId(this.treeId());\n      detailModel.companyId(target.id());\n      detailModel.nodeId(this.nodeId());\n      detailModel.amountType(this.amountType());\n      detailModel.sheetSearchKey(this.sheetSearchKey());\n      this.childModel(detailModel);\n\n      var text = _h.getLocalizedText(\"reportBalanceDataDetailsCaption\");\n\n      text += \" \" + this.nodeCode() + \" توسط \" + target.title();\n      this.childModel().caption(text);\n      this.childModel().init();\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'balancesheet-data-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return BalanceReportDataViewModel;\n}(FormBuilder);\nvar BalanceReportCompanyData = /*#__PURE__*/function (_BaseModel2) {\n  _inherits(BalanceReportCompanyData, _BaseModel2);\n\n  var _super3 = _createSuper(BalanceReportCompanyData);\n\n  function BalanceReportCompanyData(model) {\n    _classCallCheck(this, BalanceReportCompanyData);\n\n    return _super3.call(this, model);\n  }\n\n  return _createClass(BalanceReportCompanyData);\n}(BaseModel);\nfunction BalanceReportCompanyDataViewModel() {\n  var self = this;\n  self.caption = ko.observable();\n\n  self.exportExcelFileBtn = function (m, e) {\n    var context = _h.kocnx();\n\n    var model = {\n      controllerName: 12,\n      inputData: {}\n    };\n    var type = Number($(e.currentTarget).attr(\"data-item\"));\n\n    switch (type) {\n      case 4:\n        model.inputData = {\n          pageNumber: self.pageNumber(),\n          pageSize: self.pageSize(),\n          sortProperty: self.sortProperty(),\n          sortDirection: self.sortDirection(),\n          searchKey: self.searchKey(),\n          treeId: self.treeId(),\n          nodeId: self.nodeId(),\n          sheetSearchKey: context.brvm().sheetSearchKey(),\n          companyType: context.loginCompanyType(),\n          type: type,\n          amountType: self.amountType(),\n          companyId: self.companyId()\n        };\n        break;\n\n      case 5:\n        model.inputData = {\n          treeId: self.treeId(),\n          nodeId: self.nodeId(),\n          type: type,\n          sheetSearchKey: context.brvm().sheetSearchKey(),\n          amountType: self.amountType(),\n          companyId: self.companyId(),\n          mappedNodeId: self.selectedRowRecord().id()\n        };\n        break;\n    }\n\n    _h.kocnx().createExcel(model);\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n  };\n\n  self.createExcelBtnTitle = function () {\n    return _h.shortString(self.selectedRowRecord().title(), 15);\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__.BaseViewModel({\n    entityName: \"BalanceReportCompanyData\",\n    apiService: {\n      actionList: [\"filterby\"]\n    },\n    getList: true,\n    filters: [{\n      name: 'companyId'\n    }, {\n      name: 'nodeId'\n    }, {\n      name: 'treeId'\n    }, {\n      name: 'amountType'\n    }, {\n      name: 'sheetSearchKey'\n    }],\n    buttons: [{\n      name: 'exportExcelMenu',\n      access: false,\n      cMenu: false,\n      templateName: \"exportexcel-menu-template\"\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }],\n    extraParams: [\"totalCreditor\", \"totalDebtor\"],\n    sortDirection: \"Ascending\",\n    sortProperty: \"code\",\n    context: self,\n    saveState: true,\n    footerTemplate: \"reportbalancedata-detail-footer-template\",\n    cols: reportbalancedatadetailsModelRes,\n    selectRow: true,\n    contextMenu: false,\n    searchKeyType: \"enter\",\n    tableClass: \"table ko-tbl ko-tbl-child\",\n    tableStyle: \"table-layout: fixed;margin-top:10px;\"\n  }));\n  self.btnVisibility = ko.computed(function () {\n    var selectedRecord = self.selectedRowRecord();\n\n    if (!_h.isNullOrEmpty(selectedRecord)) {\n      self.visexportExcelMenu(true);\n    } else {\n      self.visexportExcelMenu(false);\n    }\n\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n}\nvar TotalBalanceReportData = /*#__PURE__*/function (_BaseModel3) {\n  _inherits(TotalBalanceReportData, _BaseModel3);\n\n  var _super4 = _createSuper(TotalBalanceReportData);\n\n  function TotalBalanceReportData(model) {\n    _classCallCheck(this, TotalBalanceReportData);\n\n    return _super4.call(this, model);\n  }\n\n  return _createClass(TotalBalanceReportData);\n}(BaseModel);\nvar TotalBalanceReportDataViewModel = /*#__PURE__*/function (_FormBuilder2) {\n  _inherits(TotalBalanceReportDataViewModel, _FormBuilder2);\n\n  var _super5 = _createSuper(TotalBalanceReportDataViewModel);\n\n  function TotalBalanceReportDataViewModel(model, item) {\n    var _this2;\n\n    _classCallCheck(this, TotalBalanceReportDataViewModel);\n\n    _this2 = _super5.call(this);\n    _this2.width = \"70%\";\n    _this2.caption = ko.observable();\n    ko.utils.extend(_assertThisInitialized(_this2), new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__.BaseViewModel({\n      entityName: \"TotalBalanceReportData\",\n      apiService: {\n        actionList: [\"filterby\"]\n      },\n      filters: [{\n        name: 'companyId'\n      }, {\n        name: 'treeId'\n      }, {\n        name: 'nodeId'\n      }, {\n        name: 'justConfirmed'\n      }, {\n        name: 'amountType'\n      }],\n      extraParams: [\"totalCreditor\", \"totalDebtor\", \"nodeName\", \"companyName\"],\n      sortDirection: \"Ascending\",\n      buttons: [{\n        name: 'exportExcelFile',\n        access: false,\n        icon: 'ExportExcel',\n        cMenu: false\n      }, {\n        name: 'refresh',\n        access: false,\n        cMenu: false\n      }, {\n        name: 'tools',\n        access: false,\n        cMenu: false\n      }],\n      sortProperty: \"companyTitle\",\n      context: _assertThisInitialized(_this2),\n      cols: totalbalancereportModelRes,\n      getList: true,\n      saveState: true,\n      searchKeyType: \"enter\",\n      selectRow: false,\n      contextMenu: false,\n      tableStyle: \"table-layout: fixed;font-size: 11px;\",\n      footerTemplate: \"totalbalancereport-footertable-template\"\n    }));\n    _this2.changeCaption = ko.computed(function () {\n      this.caption(this.nodeName() + \"-\" + \"مانده نهایی به تفکیک شرکت ها\");\n    }.bind(_assertThisInitialized(_this2)));\n    _this2.btnVisibility = ko.computed(function () {\n      this.visexportExcelFile(true);\n      this.visrefresh(true);\n      this.vistools(true);\n    }.bind(_assertThisInitialized(_this2)));\n\n    if (_h.kocnx().loginCompanyType() === 0) {\n      _this2.companyId(model.companyId());\n\n      _this2.justConfirmed(model.justConfirmed());\n    }\n\n    _this2.amountType(model.amountType());\n\n    _this2.nodeId(item.id);\n\n    _this2.treeId(model.treeId());\n\n    _this2.fillTableProperties();\n\n    _this2.getRecords();\n\n    _this2.createForm();\n\n    return _this2;\n  }\n\n  _createClass(TotalBalanceReportDataViewModel, [{\n    key: \"exportExcelFileBtn\",\n    value: function exportExcelFileBtn() {\n      var model = {\n        controllerName: 12,\n        inputData: {\n          pageNumber: this.pageNumber(),\n          pageSize: this.pageSize(),\n          sortProperty: this.sortProperty(),\n          sortDirection: this.sortDirection(),\n          searchKey: this.searchKey(),\n          companyId: this.companyId(),\n          treeId: this.treeId(),\n          nodeId: this.nodeId(),\n          justConfirmed: this.justConfirmed(),\n          type: 3,\n          amountType: this.amountType()\n        }\n      };\n\n      _h.kocnx().createExcel(model);\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'totalbalance-data-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return TotalBalanceReportDataViewModel;\n}(FormBuilder);\n\n//# sourceURL=webpack://domino/./src/scripts/pages/balancereport/model.js?");

/***/ }),

/***/ "./src/scripts/pages/balancereport/resource.js":
/*!*****************************************************!*\
  !*** ./src/scripts/pages/balancereport/resource.js ***!
  \*****************************************************/
/***/ (() => {

eval("window.balancereportPageRes = {\n  caption: {\n    fa: 'گزارش تراز حساب ها/کاربرگ 6020'\n  },\n  balancetreecaption: {\n    fa: 'نمایش درختواره'\n  },\n  treeCaption: {\n    fa: 'درخت حساب'\n  },\n  filterCaption: {\n    fa: 'فیلتر'\n  },\n  filterbyBtn: {\n    fa: 'اعمال'\n  },\n  codePlaceholder: {\n    fa: 'جستجوی کد'\n  },\n  namePlaceholder: {\n    fa: 'جستجوی عنوان'\n  },\n  amountPlaceholder: {\n    fa: 'جستجوی مبلغ'\n  },\n  name: {\n    fa: 'عنوان'\n  },\n  amount: {\n    fa: 'مبلغ'\n  },\n  justIneffective: {\n    fa: 'فقط نمایش اسناد بلااثر'\n  },\n  displayType: {\n    fa: 'وضعیت نمایش'\n  },\n  onShowAll: {\n    fa: 'نمایش همه سندها'\n  },\n  offShowAll: {\n    fa: 'نمایش سندهای موثر'\n  },\n  onItemShowAll: {\n    fa: 'نمایش همه بندهای سند'\n  },\n  offItemShowAll: {\n    fa: 'نمایش سندهای موثر بندهای سند'\n  },\n  codeRangeItem: {\n    fa: 'شماره بند'\n  },\n  userId: {\n    fa: 'کاربر'\n  },\n  repeated: {\n    fa: 'بند با مقدار تکراری'\n  },\n  nodeIdListCaption: {\n    fa: 'فهرست گره'\n  },\n  sheetSearchKey: {\n    fa: 'جستجوی کد تراز'\n  },\n  worksheetViewTable: {\n    fa: 'نمایش لیستی'\n  },\n  worksheetViewTree: {\n    fa: 'نمایش درختی'\n  },\n  tags: {\n    fa: 'برچسب ها'\n  }\n};\nwindow.balancereportFilterRes = {\n  treeId: {\n    fa: 'درختواره'\n  },\n  balanceSheetId: {\n    fa: 'فایل های تراز'\n  },\n  nodeId: {\n    fa: 'کد حساب'\n  },\n  level: {\n    fa: 'نمایش تا سطح'\n  },\n  amountType: {\n    fa: 'نمایش ارقام'\n  },\n  displayType: {\n    fa: 'وضعیت نمایش'\n  },\n  companyId: {\n    fa: 'شرکت'\n  },\n  justConfirmed: {\n    fa: 'اسناد تایید شده'\n  },\n  downLevelTreeSurf: {\n    fa: 'پیمایش به سطح پایین'\n  },\n  upLevelTreeSurf: {\n    fa: 'پیمایش به سطح بالا'\n  },\n  excelBtn: {\n    fa: 'فایل خروجی اکسل'\n  }\n};\nwindow.balancereportModelRes = {\n  balanceSheetId: {\n    fa: 'فایل های تراز',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null\n  },\n  name: {\n    fa: 'عنوان حساب',\n    colName: 'name',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    size: 100,\n    alias: null,\n    groupBy: \"desc\"\n  },\n  totalDebtor: {\n    fa: 'مانده بدهکار',\n    colName: 'totalDebtor',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 50,\n    groupBy: \"total\"\n  },\n  totalCreditor: {\n    fa: 'مانده بستانکار',\n    colName: 'totalCreditor',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 50,\n    groupBy: \"total\"\n  },\n  debtorFlow: {\n    fa: 'گردش بدهکار',\n    colName: 'debtorFlow',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 50,\n    groupBy: \"flow\"\n  },\n  creditorFlow: {\n    fa: 'گردش بستانکار',\n    colName: 'creditorFlow',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 50,\n    groupBy: \"flow\"\n  },\n  debtorBalance: {\n    fa: 'مانده بدهکار',\n    colName: 'debtorBalance',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 50,\n    groupBy: \"balance\"\n  },\n  creditorBalance: {\n    fa: 'مانده بستانکار',\n    colName: 'creditorBalance',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 50,\n    groupBy: \"balance\"\n  }\n};\nwindow.reportBalanceDataPageRes = {\n  reportBalanceDataCaption: {\n    fa: 'لیست کدهای نگاشت شده به کد حساب __'\n  },\n  reportGroupBalanceDataCaption: {\n    fa: 'کاربرگ تعدیلات گروه'\n  },\n  reportBalanceAdjustmentDocumentCaption: {\n    fa: 'اسناد اصلاحی و طبقه بندی'\n  },\n  reportBalanceAmendmentItemCaption: {\n    fa: 'بند سند اصلاحی و طبقه بندی '\n  },\n  exportExcelFileCaption: {\n    fa: 'خروجی فایل اکسل'\n  },\n  nodeCode: {\n    fa: 'کد گره'\n  },\n  codeRange: {\n    fa: 'شماره سند'\n  },\n  empty: {\n    fa: 'فقط اسناد بدون بند'\n  },\n  withVariance: {\n    fa: 'فقط اسناد دارای مغایرت'\n  },\n  justIneffective: {\n    fa: 'فقط نمایش اسناد بلااثر'\n  },\n  reportBalanceDataMasterCaption: {\n    fa: 'تجمیع مقادیر شرکت های مشمول تلفیق'\n  },\n  reportBalanceDataDetailsCaption: {\n    fa: 'لیست کدهای حساب نگاشت شده به گره'\n  },\n  reportBalanceDataDetailsClosedCaption: {\n    fa: 'کدهای نگاشت شده'\n  }\n};\nwindow.reportbalancedataModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  code: {\n    fa: 'کد حساب',\n    colName: 'code',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"Ascending\",\n    alias: null,\n    visibleItem: true,\n    type: \"string\",\n    size: 9,\n    popup: true\n  },\n  title: {\n    fa: 'عنوان',\n    colName: 'title',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    visibleItem: true,\n    alias: null,\n    type: \"string\",\n    size: 40,\n    popup: true\n  },\n  debtor: {\n    fa: 'بدهکار',\n    colName: 'debtor',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"money-abs\",\n    size: 20,\n    popup: true\n  },\n  creditor: {\n    fa: 'بستانکار',\n    colName: 'creditor',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"money-abs\",\n    size: 20,\n    popup: true\n  }\n};\nwindow.reportbalancedatadetailsModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  code: {\n    fa: 'کد حساب',\n    colName: 'code',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"Ascending\",\n    alias: null,\n    type: \"string\"\n  },\n  title: {\n    fa: 'عنوان',\n    colName: 'title',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  debtor: {\n    fa: 'بدهکار',\n    colName: 'debtor',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"money-abs\"\n  },\n  creditor: {\n    fa: 'بستانکار',\n    colName: 'creditor',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"money-abs\"\n  }\n};\nwindow.totalBalanceReportPageRes = {};\nwindow.totalbalancereportModelRes = {\n  companyId: {\n    fa: 'گروه/شرکت',\n    colName: 'companyId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null\n  },\n  companyTitle: {\n    fa: 'نام گروه/شرکت',\n    colName: 'companyTitle',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"Ascending\",\n    alias: null,\n    type: \"string\"\n  },\n  creditorAmount: {\n    fa: 'مانده نهایی بدهکار',\n    colName: 'debtorAmount',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"money-abs\"\n  },\n  debtorAmount: {\n    fa: 'مانده نهایی بستانکار',\n    colName: 'creditorAmount',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"money-abs\"\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/pages/balancereport/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/balancereport/viewModel.js":
/*!******************************************************!*\
  !*** ./src/scripts/pages/balancereport/viewModel.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"BalanceReportViewModel\": () => (/* binding */ BalanceReportViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _master_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/model */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _adjustmentdocument_viewModel_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../adjustmentdocument/viewModel.js */ \"./src/scripts/pages/adjustmentdocument/viewModel.js\");\n/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./model.js */ \"./src/scripts/pages/balancereport/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n__webpack_require__(/*! ./model */ \"./src/scripts/pages/balancereport/model.js\");\n\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/balancereport/resource.js\");\n\n\n\n\n\nfunction BalanceReportViewModel() {\n  var self = this;\n  self.firstLoad = ko.observable(true);\n  self.showBalanceTree = ko.observable(false);\n  self.nodePath = ko.observable();\n  self.companySelectedName = ko.observable();\n  self.balanceSheetId = ko.observable();\n  self.sheetSearchKey = ko.observable();\n  self.treeId = ko.observable();\n  self.nodeId = ko.observable();\n  self.level = ko.observable();\n  self.amountType = ko.observable(2);\n  self.displayType = ko.observable(1);\n  self.companyId = ko.observable();\n  self.worksheetView = ko.observable(0);\n  self.justConfirmed = ko.observable(false);\n  self.navigationDirection = ko.observable();\n  self.nodeIdList = ko.observableArray();\n  self.treeSearchKey = ko.observable();\n  self.lastLevel = ko.observable();\n  self.showUpLevel = ko.observable(false);\n  self.showDownLevel = ko.observable(false);\n  self.nodeCodeSelected = ko.observable();\n  self.levelSelectList = ko.observableArray();\n  self.treeGroupSelectList = ko.observableArray();\n  self.treeSelectList = ko.observableArray();\n  self.fileSelectList = ko.observableArray();\n  self.companySelectList = ko.observableArray();\n  self.treeNodeRecords = [];\n\n  self.toggleWorksheetView = function () {\n    if (self.worksheetView() === 0) {\n      self.worksheetView(1);\n      self.nodeCodeSelected(null);\n    } else {\n      self.worksheetView(0);\n    }\n\n    clientStorage.setSetting([{\n      key: \"BalanceReport_worksheetView_\" + _h.kocnx().loginCompanyType(),\n      value: self.worksheetView()\n    }]);\n    self.getRecords();\n  };\n\n  self.toggleBalanceTree = function () {\n    if (_h.isEmpty(self.treeId())) return;\n\n    if (!self.showBalanceTree()) {\n      self.showBalanceTree(true);\n      $(\".balancetree-box\").draggable({\n        scroll: true,\n        handle: \".balancetree-drag-handle\"\n      });\n      self.getTreeNodeRecords();\n    } else {\n      self.showBalanceTree(false);\n    }\n  };\n\n  self.onTreeEnterSearchKey = function (d, e) {\n    if (e.keyCode === 13) {\n      self.getTreeNodeRecords();\n    }\n\n    return true;\n  };\n\n  self.showAmountType = ko.observable(true);\n  self.treeId.subscribe(function (newValue) {\n    if (newValue === null || newValue === undefined || newValue === \"\") return;\n    if (!self.firstLoad()) self.changeCascadeItems(newValue);\n    self.nodeId(undefined);\n    self.nodeCodeSelected(null);\n    self.clearSelectedItem();\n  });\n  self.companyId.subscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue) && newValue > 1) {\n      var name = self.getCompany(newValue);\n      self.companySelectedName(\" :: \" + name);\n    }\n\n    if (_h.isNullOrEmpty(newValue) || newValue === -1) {\n      self.companySelectedName(\"\");\n    }\n  });\n\n  self.getCompany = function (id) {\n    var name = null;\n\n    for (var i = 0; i < self.companySelectList().length; i++) {\n      if (self.companySelectList()[i].value() === id) name = self.companySelectList()[i].text();\n    }\n\n    return name;\n  };\n\n  self.changeNodePath = function (item) {\n    var path = \" :: \";\n    var parents = self.getParents(item);\n\n    for (var j = 0; j < parents.length; j++) {\n      var target = parents[j];\n      path += target.name();\n\n      if (parents.length - 1 !== j) {\n        path += \" => \";\n      }\n    }\n\n    self.nodePath(path);\n  };\n\n  self.getParents = function (item) {\n    var def = item.depth;\n    var array = [];\n    if (def <= 0) return array;\n    var result = item;\n    var bigger;\n\n    for (var i = 0; i < def; i++) {\n      if (result !== null && result !== undefined) {\n        bigger = result.parent();\n        result = bigger;\n        array.push(result);\n      }\n    }\n\n    return array.reverse();\n  };\n\n  self.clearSelectedItem = function () {\n    ko.utils.arrayFilter(self.treeNodeRecords(), function (cat) {\n      cat.selected(false);\n      self.clearChildrenSelectedItem(cat);\n    });\n  };\n\n  self.clearChildrenSelectedItem = function (item) {\n    item.selected(false);\n    ko.utils.arrayFilter(item.children(), function (cat) {\n      cat.selected(false);\n      if (cat.children().length > 0) self.clearChildrenSelectedItem(cat);\n    });\n  };\n\n  self.changeCascadeItems = function (treeId) {\n    var item = null;\n\n    if (_h.kocnx().loginCompanyType() === 0) {\n      ko.utils.arrayFilter(self.treeGroupSelectList(), function (tree) {\n        if (tree.value() === treeId) {\n          item = tree;\n        }\n      });\n    }\n\n    if (_h.kocnx().loginCompanyType() === 1) {\n      ko.utils.arrayFilter(self.treeSelectList(), function (tree) {\n        if (tree.value() === treeId) {\n          item = tree;\n        }\n      });\n      self.fileSelectList.removeAll();\n      self.fileSelectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.SelectItem({\n        text: \"همه فایل ها\",\n        value: -1\n      }));\n\n      if (_h.any(item.effectedFiles())) {\n        for (var j = 0; j < item.effectedFiles().length; j++) {\n          var targetf = item.effectedFiles()[j];\n          self.fileSelectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.SelectItem(targetf));\n        }\n      }\n\n      var firstc = self.fileSelectList()[0];\n      self.balanceSheetId(firstc.value());\n      self.filterBox().balanceSheetId(firstc.value());\n    }\n\n    self.levelSelectList.removeAll();\n\n    if (item.levels() !== null && item.levels() !== undefined && item.levels().length > 0) {\n      for (var i = 0; i < item.levels().length; i++) {\n        var targetl = item.levels()[i];\n        self.levelSelectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.SelectItem(targetl));\n      }\n\n      if (self.levelSelectList().length > 0) {\n        var firstl = self.levelSelectList()[0];\n        self.level(firstl.value());\n        self.filterBox().level(firstl.value());\n      }\n    }\n\n    self.findLastLevel();\n  };\n\n  self.downTableNode = function (item) {\n    self.level(item.level + 1);\n    self.filterBox().level(self.level());\n    self.nodeId(item.id);\n    self.navigationDirection(2);\n    self.filterBy();\n    if (!_h.isEmpty(item.path)) self.nodePath(\" :: \" + item.path);else {\n      self.nodePath(\"\");\n    }\n  };\n\n  self.upTableNode = function (item) {\n    self.level(item.level - 1);\n    self.filterBox().level(self.level());\n    self.nodeId(item.id);\n    self.navigationDirection(1);\n    self.filterBy();\n    if (!_h.isEmpty(item.pathParent)) self.nodePath(\"::\" + item.pathParent);else {\n      self.nodePath(\"\");\n    }\n  };\n\n  self.upLevelTreeSurf = function () {\n    self.level(self.level() - 1);\n    self.filterBox().level(self.level());\n    self.nodeId(undefined);\n    self.clearSelectedItem();\n    self.pageNumber(1);\n    self.getRecords();\n    self.toggleShowSurfBtn();\n    self.nodePath(\"\");\n  };\n\n  self.downLevelTreeSurf = function () {\n    self.level(self.level() + 1);\n    self.filterBox().level(self.level());\n    self.nodeId(undefined);\n    self.clearSelectedItem();\n    self.pageNumber(1);\n    self.getRecords();\n    self.toggleShowSurfBtn();\n    self.nodePath(\"\");\n  };\n\n  self.toggleShowSurfBtn = function () {\n    if (self.level() > 1 && self.level() !== 0) {\n      self.showUpLevel(true);\n    }\n\n    if (self.level() === 1 || self.level() === 0) {\n      self.showUpLevel(false);\n    }\n\n    var highLevel = 1;\n    ko.utils.arrayFilter(self.levelSelectList(), function (level) {\n      if (level.value() > highLevel) {\n        highLevel = level.value();\n      }\n    });\n\n    if (self.level() >= highLevel || self.level() === 0) {\n      self.showDownLevel(false);\n    } else {\n      self.showDownLevel(true);\n    }\n  };\n\n  self.toggleChildren = function (item) {\n    if (item.childrenShow() === false) {\n      item.childrenShow(true);\n    } else {\n      item.childrenShow(false);\n    }\n  };\n\n  self.getTreeSelectList = function (callback) {\n    self.apiService.request({\n      name: \"getTreeList\",\n      success: function success(data) {\n        var isTreeExist = false;\n        var treeId = clientStorage.getSetting(\"BalanceReport_treeId_\" + _h.kocnx().loginCompanyType(), 1);\n        self.treeSelectList.removeAll();\n        if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n          var target = data[j];\n          self.treeSelectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.TreeBalanceReportSelectItem({\n            text: target.name,\n            value: target.id,\n            levels: target.levels,\n            effectedFiles: target.effectedFiles,\n            currencyType: target.currencyType\n          }));\n          if (treeId && Number(treeId) === target.id) isTreeExist = true;\n        }\n\n        if (self.treeSelectList().length > 0) {\n          var first = self.treeSelectList()[0];\n          self.treeId(isTreeExist ? Number(treeId) : first.value());\n          self.filterBox().treeId(isTreeExist ? Number(treeId) : first.value());\n          self.changeCascadeItems(self.treeId());\n        }\n\n        callback(true);\n      },\n      error: function error() {\n        var text = _h.getApiMessage(\"ErrorLoadTree\");\n\n        _h.failToast(text);\n\n        callback(false);\n      }\n    });\n  };\n\n  self.getGroupTreeSelectList = function (callback) {\n    self.apiService.request({\n      name: \"getTreeList\",\n      success: function success(data) {\n        var isTreeExist = false;\n        var treeId = clientStorage.getSetting(\"BalanceReport_treeId_\" + _h.kocnx().loginCompanyType());\n        self.treeGroupSelectList.removeAll();\n        if (_h.any(data.trees)) for (var j = 0; j < data.trees.length; j++) {\n          var target = data.trees[j];\n          self.treeGroupSelectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.TreeBalanceReportSelectItem({\n            text: target.name,\n            value: target.id,\n            levels: target.levels,\n            currencyType: target.currencyType\n          }));\n          if (treeId && Number(treeId) === target.id) isTreeExist = true;\n        }\n        self.companySelectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.SelectItem({\n          text: \"کلیه شرکت های مشمول تلفیق\",\n          value: -1\n        }));\n        if (_h.any(data.companies)) for (var i = 0; i < data.companies.length; i++) {\n          var targetC = data.companies[i];\n          self.companySelectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.SelectItem(targetC));\n        }\n        var firstC = self.companySelectList()[0];\n        self.filterBox().companyId(firstC.value());\n        self.companyId(firstC.value());\n\n        if (self.treeGroupSelectList().length > 0) {\n          var first = self.treeGroupSelectList()[0];\n          self.treeId(isTreeExist ? Number(treeId) : first.value());\n          self.filterBox().treeId(isTreeExist ? Number(treeId) : first.value());\n          self.changeCascadeItems(self.treeId());\n        }\n\n        self.findLastLevel();\n        callback(true);\n      },\n      error: function error() {\n        var text = _h.getApiMessage(\"ErrorLoadTree\");\n\n        _h.failToast(text);\n\n        callback(false);\n      }\n    });\n  };\n\n  self.getTreeNodeRecords = function () {\n    var model = {\n      id: self.treeId(),\n      searchKey: self.treeSearchKey(),\n      controllerName: 12\n    };\n    self.apiService.request({\n      name: \"getNodeSelection\",\n      data: model,\n      success: function success(data) {\n        if (_h.any(data)) {\n          self.treeNodeRecords = data;\n          self.configTools();\n        }\n      },\n      error: function error(message, level) {\n        var text = _h.getApiMessage(\"ErrorLoadMapTree\");\n\n        _h.failToast(text);\n      }\n    });\n  };\n\n  self.initDefault = function () {\n    if (_h.kocnx().loginCompanyType() === 0) {\n      self.getGroupTreeSelectList(function (res) {\n        if (res) {\n          self.loadClientSideFilterData();\n          self.getRecords();\n          self.firstLoad(false);\n        }\n      });\n    }\n\n    if (_h.kocnx().loginCompanyType() === 1) {\n      self.getTreeSelectList(function (res) {\n        if (res) {\n          self.loadClientSideFilterData();\n          self.getRecords();\n          self.firstLoad(false);\n        }\n      });\n    }\n  };\n\n  self.loadClientSideFilterData = function () {\n    var context = _h.kocnx();\n\n    var amountType = clientStorage.getSetting(\"BalanceReport_amountType_\" + context.loginCompanyType());\n    var displayType = clientStorage.getSetting(\"BalanceReport_displayType_\" + context.loginCompanyType());\n    var worksheetView = clientStorage.getSetting(\"BalanceReport_worksheetView_\" + context.loginCompanyType());\n\n    if (amountType) {\n      self.amountType(Number(amountType));\n      self.filterBox().amountType(Number(amountType));\n    }\n\n    if (displayType) {\n      self.displayType(Number(displayType));\n      self.filterBox().displayType(Number(displayType));\n    }\n\n    if (!_h.isNullOrEmpty(worksheetView)) self.worksheetView(Number(worksheetView));\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.initDefault();\n  };\n\n  self.createExcel = function () {\n    var context = _h.kocnx();\n\n    var model = {\n      controllerName: 12,\n      inputData: {\n        pageNumber: self.pageNumber(),\n        pageSize: self.pageSize(),\n        sortProperty: self.sortProperty(),\n        sortDirection: self.sortDirection(),\n        balanceSheetId: self.balanceSheetId(),\n        sheetSearchKey: self.sheetSearchKey(),\n        treeId: self.treeId(),\n        nodeId: self.nodeId(),\n        level: self.level(),\n        amountType: self.amountType(),\n        displayType: self.displayType(),\n        navigationDirection: self.navigationDirection(),\n        justConfirmed: self.justConfirmed(),\n        type: 0,\n        worksheetView: self.worksheetView(),\n        nodeIdList: self.nodeIdList()\n      }\n    };\n\n    if (_h.kocnx().loginCompanyType() === 0) {\n      model.inputData.companyId = self.companyId();\n    }\n\n    _h.kocnx().createExcel(model);\n  };\n\n  self.createSeparationExcel = function () {\n    var model = {\n      controllerName: 12,\n      inputData: {\n        pageNumber: self.pageNumber(),\n        pageSize: self.pageSize(),\n        sortProperty: self.sortProperty(),\n        sortDirection: self.sortDirection(),\n        balanceSheetId: self.balanceSheetId(),\n        sheetSearchKey: self.sheetSearchKey(),\n        treeId: self.treeId(),\n        nodeId: self.nodeId(),\n        level: self.level(),\n        amountType: self.amountType(),\n        displayType: self.displayType(),\n        companyId: self.companyId(),\n        navigationDirection: self.navigationDirection(),\n        justConfirmed: self.justConfirmed(),\n        type: 1,\n        worksheetView: self.worksheetView(),\n        nodeIdList: self.nodeIdList()\n      }\n    };\n\n    _h.kocnx().createExcel(model);\n  };\n\n  self.balanceReportDetailsBtn = function (item, e) {\n    if (e.ctrlKey || e.shiftKey) return;\n\n    _h.kocnx().openForm(new _model_js__WEBPACK_IMPORTED_MODULE_3__.BalanceReportDataViewModel(self, item));\n  };\n\n  self.amendmentsDetailsBtn = function (type, item, e) {\n    if (e.ctrlKey || e.shiftKey) return;\n\n    var context = _h.kocnx();\n\n    context.balanceAdjustmentDocumentForm(null);\n    var record = new _adjustmentdocument_viewModel_js__WEBPACK_IMPORTED_MODULE_2__.AdjustmentDocumentViewModel(\"View\");\n    if (context.loginCompanyType() === 0) record.companyId(self.companyId());\n\n    if (context.loginCompanyType() === 1) {\n      if (!self.balanceSheetId()) {\n        self.balanceSheetId(-1);\n        record.balanceSheetId(-1);\n      } else record.balanceSheetId(self.balanceSheetId());\n    }\n\n    record.amountType(self.amountType());\n    record.isCreditor(type === \"creditorFlow\");\n    record.nodeId(item.id);\n    record.treeId(self.treeId());\n    context.balanceAdjustmentDocumentForm(record);\n    context.balanceAdjustmentDocumentForm().init();\n  };\n\n  self.totalDetailsBtn = function (item, e) {\n    if (e.ctrlKey || e.shiftKey) return;\n\n    _h.kocnx().openForm(new _model_js__WEBPACK_IMPORTED_MODULE_3__.TotalBalanceReportDataViewModel(self, item));\n  };\n\n  self.findLastLevel = function () {\n    if (self.levelSelectList().length > 0) {\n      var first = 0;\n      ko.utils.arrayFilter(self.levelSelectList(), function (level) {\n        if (level.value() > first) {\n          first = level.value();\n        }\n      });\n      self.lastLevel(first);\n    }\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"BalanceReport\",\n    apiService: {\n      actionList: [\"filterby\", \"gettreelist\"]\n    },\n    sortDirection: \"Ascending\",\n    extraParams: [\"totalDebtor\", \"totalCreditor\", \"totalCreditorFlow\", \"totalDebtorFlow\", \"totalCreditorBalance\", \"totalDebtorBalance\"],\n    sortProperty: \"id\",\n    context: self,\n    cols: balancereportModelRes,\n    searchKeyType: \"enter\",\n    getList: false,\n    saveState: false,\n    selectRow: false,\n    contextMenu: false\n  }));\n  self.records = [];\n\n  self.getRecords = function () {\n    self.collectOpenBranches();\n    var filterModel = {\n      pageNumber: self.pageNumber(),\n      pageSize: self.pageSize(),\n      sortProperty: self.sortProperty(),\n      sortDirection: self.sortDirection(),\n      balanceSheetId: self.balanceSheetId(),\n      sheetSearchKey: self.sheetSearchKey(),\n      treeId: self.treeId(),\n      nodeId: self.nodeId(),\n      level: self.level(),\n      amountType: self.amountType(),\n      displayType: self.displayType(),\n      companyId: self.companyId(),\n      justConfirmed: self.justConfirmed(),\n      navigationDirection: self.navigationDirection(),\n      nodeIdList: self.nodeIdList(),\n      worksheetView: self.worksheetView(),\n      searchKey: self.searchKey()\n    };\n    self.apiService.request({\n      name: \"filterby\",\n      data: filterModel,\n      success: function success(data) {\n        self.records = [];\n\n        if (!_h.isNullOrEmpty(data)) {\n          if (_h.any(data.list)) {\n            self.records = data.list;\n          }\n\n          self.total(data.total);\n          self.totalDebtor(data.totalDebtor);\n          self.totalCreditor(data.totalCreditor);\n          self.totalCreditorFlow(data.totalCreditorFlow);\n          self.totalDebtorFlow(data.totalDebtorFlow);\n          self.totalCreditorBalance(data.totalCreditorBalance);\n          self.totalDebtorBalance(data.totalDebtorBalance);\n        }\n\n        self.configTableView();\n        self.toggleShowSurfBtn();\n\n        _h.fixLabelsSize();\n      },\n      error: function error(message, level) {\n        toast.error(self.entityName, 'getList');\n      }\n    });\n  };\n\n  self.filterBox = ko.observable(new BalanceReportFilter(self));\n\n  self.connectManBtn = function () {\n    _h.kocnx().openConnectMan(12, \"connectManCaption2\");\n  };\n\n  self.formatLevel = ko.computed(function () {\n    if (self.level() !== 0) return '-' + ' سطح ' + self.level();\n    if (self.level() === 0) return '-' + ' همه سطوح ';\n  });\n\n  self.expandAll = function () {\n    $(\"#tree_view_w\").treeView(\"expandAll\");\n  };\n\n  self.collapseAll = function () {\n    $(\"#tree_view_w\").treeView(\"collapseAll\");\n  };\n\n  self.clearSelectedItem = function () {\n    $(\"#tree_view_w\").treeView(\"clearSelect\");\n  };\n\n  self.changeNodeSelected = function (item, callback) {\n    if (!item.selected) {\n      if (item.depth === undefined || item.depth === 0) {\n        self.nodeId(undefined);\n      } else {\n        self.nodeId(item.parentId);\n      }\n\n      self.nodeCodeSelected(item.code);\n      self.level(item.depth + 1);\n      self.filterBox().level(item.depth + 1);\n      self.clearSelectedItem();\n      self.pageNumber(1);\n      self.getRecords();\n      self.nodePath(item.path);\n      callback(true);\n    } else {\n      self.nodeId(undefined);\n      self.nodeCodeSelected(null);\n      self.nodePath(\"\");\n      self.clearSelectedItem();\n      self.pageNumber(1);\n      self.getRecords();\n      callback(false);\n    }\n  };\n\n  self.configTools = function () {\n    $(\"#tree_view_w\").treeView({\n      tType: \"BalanceReport\",\n      nodes: self.treeNodeRecords,\n      rootId: self.treeId(),\n      controllerName: 12,\n      location: \"BalanceReport\",\n      onClickItem: self.changeNodeSelected\n    });\n  };\n\n  self.brSelector = \"#br_Table\";\n\n  self.configTableView = function () {\n    $(self.brSelector).tableTreeView({\n      nodes: self.records,\n      type: \"BalanceReport\",\n      companyType: _h.kocnx().loginCompanyType(),\n      rootId: self.treeId(),\n      cols: ko.toJS(self.tableProperties()),\n      controllerName: 12,\n      sortProperty: self.sortProperty(),\n      context: self,\n      worksheetView: self.worksheetView(),\n      nodeCodeSelected: self.nodeCodeSelected(),\n      footerData: {\n        totalDebtor: self.totalDebtor(),\n        totalCreditor: self.totalCreditor(),\n        totalCreditorFlow: self.totalCreditorFlow(),\n        totalDebtorFlow: self.totalDebtorFlow(),\n        totalCreditorBalance: self.totalCreditorBalance(),\n        totalDebtorBalance: self.totalDebtorBalance()\n      }\n    });\n    setTimeout(function () {\n      if (self.treeOpenBranches && self.treeOpenBranches.length) $(self.brSelector).tableTreeView(\"expand\", self.treeOpenBranches);\n    }, 150);\n  };\n\n  self.treeOpenBranches = [];\n\n  self.collectOpenBranches = function () {\n    self.treeOpenBranches = [];\n    var tree = $(self.brSelector);\n    var ulList = tree.find(\".node-ch:not(.dmn-c)\");\n    var array = [];\n    if (ulList.length) for (var i = 0; i < ulList.length; i++) {\n      var item = ulList[i];\n      var parent = $(item).parent();\n      if (parent) array.push(parent.attr(\"did\"));\n    }\n    self.treeOpenBranches = array;\n  };\n}\n\nfunction BalanceReportFilter(parent) {\n  var self = this;\n  self.parent = parent;\n  self.treeId = ko.observable();\n  self.companyId = ko.observable();\n  self.level = ko.observable();\n  self.nodeIdList = ko.observableArray();\n  self.justConfirmed = ko.observable(false);\n  self.amountType = ko.observable(2);\n  self.displayType = ko.observable(1);\n  self.balanceSheetId = ko.observable();\n  self.sheetSearchKey = ko.observable();\n  self.refreshSign = ko.observable(false);\n  self.validationObject = ko.validatedObservable({\n    treeId: self.treeId.extend({\n      required: {\n        params: true,\n        message: \"لطفا درخت نگاشت را انتخاب کنید\"\n      }\n    }),\n    balanceSheetId: self.balanceSheetId.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          return _h.kocnx().loginCompanyType() === 1;\n        },\n        params: true,\n        message: \"لطفا فایل تراز را انتخاب کنید\"\n      }\n    }),\n    companyId: self.companyId.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          return _h.kocnx().loginCompanyType() === 0;\n        },\n        params: true,\n        message: \"لطفا گروه/شرکت را انتخاب کنید\"\n      }\n    }),\n    level: self.level.extend({\n      required: {\n        params: true,\n        message: \"لطفا سطح نمایش را انتخاب کنید\"\n      }\n    }),\n    displayType: self.displayType.extend({\n      required: {\n        params: true,\n        message: \"لطفا وضعیت  نمایش را انتخاب کنید\"\n      }\n    }),\n    amountType: self.amountType.extend({\n      required: {\n        params: true,\n        message: \"لطفا نمایش ارقام را انتخاب کنید\"\n      }\n    })\n  });\n  self.level.subscribe(function (newValue) {\n    if (newValue === null || newValue === undefined || newValue === \"\") return;\n    self.parent.searchKey(\"\");\n    self.nodeIdList.removeAll();\n    self.refreshSign(true);\n    self.refreshSign(false);\n  });\n  self.treeId.subscribe(function (newValue) {\n    if (_h.isEmpty(newValue)) return;\n    self.toggleShowAmountType(newValue);\n    if (!self.parent.firstLoad()) self.parent.changeCascadeItems(newValue);\n  });\n\n  self.toggleShowAmountType = function (value) {\n    var list, target;\n    if (_h.kocnx().loginCompanyType() === 0) list = self.parent.treeGroupSelectList;else list = self.parent.treeSelectList;\n\n    for (var i = 0; i < list().length; i++) {\n      if (list()[i].value() === value) target = list()[i];\n    }\n\n    if (target) {\n      if (target.currencyType() === 2) self.parent.showAmountType(false);else self.parent.showAmountType(true);\n    } else {\n      self.parent.showAmountType(true);\n    }\n  };\n\n  self.onNodeSelect = function (name, list) {\n    self.nodeIdList.removeAll();\n\n    if (_h.any(list)) {\n      for (var i = 0; i < list.length; i++) {\n        if (self.nodeIdList().indexOf(list[i].value) === -1) self.nodeIdList.push(list[i].value);\n      }\n    }\n  };\n\n  self.clearSearchBoxes = function () {\n    self.justConfirmed(false);\n    self.parent.justConfirmed(self.justConfirmed());\n    self.amountType(2);\n    self.parent.amountType(self.amountType());\n    self.displayType(1);\n    self.parent.displayType(self.displayType());\n\n    if (self.nodeIdList().length > 0) {\n      self.nodeIdList.removeAll();\n      self.refreshSign(true);\n      self.refreshSign(false);\n      self.parent.nodeIdList(self.nodeIdList());\n    }\n\n    var firstItem;\n\n    if (self.parent.fileSelectList().length > 0) {\n      firstItem = self.parent.fileSelectList()[0];\n      self.balanceSheetId(firstItem.value());\n      self.parent.balanceSheetId(firstItem.value());\n    }\n\n    if (self.parent.companySelectList().length > 0) {\n      firstItem = self.parent.companySelectList()[0];\n      self.parent.companyId(firstItem.value());\n      self.companyId(firstItem.value());\n    }\n\n    self.sheetSearchKey(undefined);\n    self.parent.sheetSearchKey(self.sheetSearchKey());\n    self.parent.searchKey(\"\");\n\n    if (self.parent.levelSelectList().length > 0) {\n      firstItem = self.parent.levelSelectList()[0];\n      self.level(firstItem.value());\n      self.parent.level(self.level());\n    }\n\n    self.parent.pageNumber(1);\n    self.setLocalData();\n    self.parent.filterBy();\n  };\n\n  self.filterBy = function () {\n    if (!self.validationObject.isValid()) {\n      self.validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    self.parent.treeId(self.treeId());\n    self.parent.companyId(self.companyId());\n    self.parent.level(self.level());\n    self.parent.justConfirmed(self.justConfirmed());\n    self.parent.amountType(self.amountType());\n    self.parent.displayType(self.displayType());\n    self.parent.balanceSheetId(self.balanceSheetId());\n    self.parent.sheetSearchKey(self.sheetSearchKey());\n    self.parent.nodeIdList(self.nodeIdList());\n    self.setLocalData();\n    self.parent.filterBy();\n  };\n\n  self.setLocalData = function () {\n    var context = _h.kocnx();\n\n    clientStorage.setSetting([{\n      key: \"BalanceReport_treeId_\" + context.loginCompanyType(),\n      value: self.treeId()\n    }, {\n      key: \"BalanceReport_amountType_\" + context.loginCompanyType(),\n      value: self.amountType()\n    }, {\n      key: \"BalanceReport_displayType_\" + context.loginCompanyType(),\n      value: self.displayType()\n    }]);\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/balancereport/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/balancesheet/model.js":
/*!*************************************************!*\
  !*** ./src/scripts/pages/balancesheet/model.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"Balancesheet\": () => (/* binding */ Balancesheet),\n/* harmony export */   \"BalancesheetContent\": () => (/* binding */ BalancesheetContent),\n/* harmony export */   \"BalancesheetContentViewModel\": () => (/* binding */ BalancesheetContentViewModel),\n/* harmony export */   \"BalancesheetForm\": () => (/* binding */ BalancesheetForm)\n/* harmony export */ });\n/* harmony import */ var _master_baseModels_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\");\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _master_model_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../master/model.js */ \"./src/scripts/pages/master/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\n\n\nvar Balancesheet = /*#__PURE__*/function (_BaseModel) {\n  _inherits(Balancesheet, _BaseModel);\n\n  var _super = _createSuper(Balancesheet);\n\n  function Balancesheet(model) {\n    _classCallCheck(this, Balancesheet);\n\n    return _super.call(this, model);\n  }\n\n  return _createClass(Balancesheet);\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_0__.BaseModel);\nvar BalancesheetContent = /*#__PURE__*/function (_BaseInfoModel) {\n  _inherits(BalancesheetContent, _BaseInfoModel);\n\n  var _super2 = _createSuper(BalancesheetContent);\n\n  function BalancesheetContent(model) {\n    _classCallCheck(this, BalancesheetContent);\n\n    return _super2.call(this, model);\n  }\n\n  return _createClass(BalancesheetContent);\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_0__.BaseInfoModel);\nvar BalancesheetForm = /*#__PURE__*/function (_BaseFormModel) {\n  _inherits(BalancesheetForm, _BaseFormModel);\n\n  var _super3 = _createSuper(BalancesheetForm);\n\n  function BalancesheetForm(viewModel, editMode) {\n    var _this;\n\n    _classCallCheck(this, BalancesheetForm);\n\n    _this = _super3.call(this, viewModel, editMode);\n    _this.fileName = ko.observable();\n    _this.file = ko.observable();\n    _this.fileType = ko.observable();\n\n    if (!editMode) {\n      _this.balancesheetType(2);\n\n      _this.currencyType(1);\n    }\n\n    _this.setValidationObject();\n\n    _this.createForm();\n\n    return _this;\n  }\n\n  _createClass(BalancesheetForm, [{\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      this.validationObject = ko.validatedObservable({\n        name: self.name.extend({\n          required: true,\n          validCharacterName: true,\n          minLength: 3,\n          maxLength: 40,\n          remoteIsUniqueRule: {\n            params: [self.id, \"Balancesheet\", \"name\", \"remotePlaceHolder\"]\n          }\n        }),\n        balancesheetType: self.balancesheetType.extend({\n          required: true\n        }),\n        currencyType: self.currencyType.extend({\n          required: true\n        }),\n        file: self.file.extend({\n          checkExcel: {\n            params: [self.fileName]\n          }\n        })\n      });\n    }\n  }, {\n    key: \"handleFileChoose\",\n    value: function handleFileChoose(files) {\n      var file = files;\n\n      var ext = _h.getExtension(file.name);\n\n      _h.toBase64(file, function (res) {\n        this.file(res);\n      }.bind(this));\n\n      switch (ext) {\n        case \"xls\":\n          this.fileType(8);\n          break;\n\n        case \"xlsx\":\n          this.fileType(9);\n          break;\n\n        case \"csv\":\n          this.fileType(0);\n          break;\n\n        default:\n      }\n\n      this.fileName(file.name);\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'txb',\n        val: this.name\n      }, null), this.createLine({\n        t: 'slc',\n        val: this.balancesheetType,\n        options: balancesheetTypes\n      }, {\n        t: 'slc',\n        val: this.currencyType,\n        options: currencyTypes,\n        dis: this.editMode\n      }, true, 30), this.createLine({\n        t: 'tm',\n        templateName: 'balancesheet-upload-form-t'\n      }, undefined, true, 30), this.createLine({\n        t: 'txa',\n        val: this.description\n      }, undefined, true, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'create',\n            vis: !this.editMode(),\n            click: this.parentVM.create\n          }, {\n            name: 'edit',\n            vis: this.editMode() === true,\n            click: this.parentVM.edit\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return BalancesheetForm;\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_0__.BaseFormModel);\nfunction BalancesheetContentViewModel() {\n  var self = this;\n  self.treeSelectList = ko.observableArray();\n\n  self.getTreeSelectList = function () {\n    var model = {\n      controllerName: 13,\n      mappingType: 0\n    };\n    self.apiService.request({\n      name: \"getMappingTreeList\",\n      data: model,\n      success: function success(data) {\n        self.treeSelectList.removeAll();\n        if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n          self.treeSelectList.push(new _master_model_js__WEBPACK_IMPORTED_MODULE_2__.TreeMapSelect(data[j]));\n        }\n        self.treeId(null);\n      },\n      error: function error() {\n        toast.error(\"Tree\", 'getSelectList');\n      }\n    });\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.getTreeSelectList();\n  };\n\n  self.exportExcelBtn = function () {\n    var filterModel = self.createFilterByModel();\n    var model = {\n      controllerName: 13,\n      inputData: filterModel\n    };\n\n    _h.kocnx().createExcel(model);\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__.BaseViewModel({\n    entityName: \"BalancesheetContent\",\n    apiService: {\n      actionList: [\"filterby\"]\n    },\n    buttons: [{\n      name: 'exportExcel',\n      access: true,\n      icon: 'ExportExcel',\n      cMenu: false\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }],\n    filters: [{\n      name: 'treeId',\n      type: \"select\",\n      source: self.treeSelectList\n    }, {\n      name: 'sheetId',\n      clear: false\n    }],\n    extraParams: [\"totalCreditor\", \"totalDebtor\"],\n    sortDirection: \"Ascending\",\n    sortProperty: \"code\",\n    context: self,\n    cols: balancesheetcontentModelRes,\n    saveState: true,\n    getList: true,\n    contextMenu: false,\n    selectRow: false,\n    searchKeyType: \"enter\",\n    tableClass: \"table ko-tbl ko-tbl-child\",\n    tableStyle: \"font-size: 11px;\",\n    resizable: true,\n    footerTemplate: \"balancesheetcontent-footertable-template\",\n    filterbyColumn: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    self.visexportExcel(true);\n    self.vishelp(true);\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/balancesheet/model.js?");

/***/ }),

/***/ "./src/scripts/pages/balancesheet/resource.js":
/*!****************************************************!*\
  !*** ./src/scripts/pages/balancesheet/resource.js ***!
  \****************************************************/
/***/ (() => {

eval("window.balancesheetTypes = [{\n  text: \"دستی\",\n  enText: \"Manual\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"اتوماتیک\",\n  enText: \"Automatic\",\n  value: 2,\n  color: \"\"\n}];\nwindow.balancesheetPageRes = {\n  pageCaption: {\n    fa: 'فایل های تراز'\n  },\n  editCaption: {\n    fa: 'ویرایش فایل تراز'\n  },\n  createCaption: {\n    fa: 'تعریف فایل تراز جدید'\n  },\n  deleteCaption: {\n    fa: 'حذف فایل تراز'\n  },\n  wideRightSide: {\n    fa: 'بزرگ کردن بخش محتوای فایل تراز'\n  },\n  unwideRightSide: {\n    fa: 'کوچک کردن بخش محتوای فایل تراز'\n  }\n};\nwindow.balancesheetModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  name: {\n    fa: 'عنوان',\n    colName: 'name',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\",\n    visibleItem: true,\n    popup: true\n  },\n  timeCreated: {\n    fa: 'تاریخ ایجاد',\n    colName: 'timeCreated',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"pdate\",\n    visibleItem: true\n  },\n  currencyType: {\n    fa: 'نوع ارز',\n    colName: 'currencyType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"enum\"\n  },\n  description: {\n    fa: 'شرح',\n    colName: 'description',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"lstring\"\n  },\n  balancesheetType: {\n    fa: 'نوع بارگذاری',\n    colName: 'balancesheetType',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"enum\"\n  },\n  totalDebtor: {\n    fa: 'جمع کل بدهکار',\n    colName: 'totalDebtor',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"money\"\n  },\n  totalCreditor: {\n    fa: 'جمع کل بستانکار',\n    colName: 'totalCreditor',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"money\"\n  }\n};\nwindow.balancesheetContentPageRes = {\n  contentPageCaption: {\n    fa: 'محتوای فایل تراز'\n  },\n  treeId: {\n    fa: 'درخت نگاشت'\n  },\n  exportExcelCaption: {\n    fa: 'فایل خروجی اکسل'\n  }\n};\nwindow.balancesheetcontentModelRes = {\n  balanceSheetId: {\n    fa: '#',\n    colName: 'balanceSheetId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"\"\n  },\n  code: {\n    fa: 'کد',\n    colName: 'code',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"Ascending\",\n    alias: null,\n    size: 8,\n    type: \"string\",\n    popup: true,\n    filterType: true\n  },\n  title: {\n    fa: 'عنوان',\n    colName: 'title',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 20,\n    type: \"string\",\n    popup: true,\n    filterType: true\n  },\n  debtor: {\n    fa: 'مانده بدهکار',\n    colName: 'debtor',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 20,\n    type: \"money\",\n    popup: true,\n    filterType: true\n  },\n  creditor: {\n    fa: 'مانده بستانکار',\n    colName: 'creditor',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 20,\n    type: \"money\",\n    popup: true,\n    filterType: true\n  },\n  nodeCode: {\n    fa: 'کد درخت',\n    colName: 'nodeCode',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 8,\n    type: \"string\",\n    filterType: true\n  },\n  nodeName: {\n    fa: 'عنوان درخت',\n    colName: 'nodeName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 20,\n    type: \"string\",\n    popup: true,\n    filterType: true\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/pages/balancesheet/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/balancesheet/viewModel.js":
/*!*****************************************************!*\
  !*** ./src/scripts/pages/balancesheet/viewModel.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"BalancesheetViewModel\": () => (/* binding */ BalancesheetViewModel)\n/* harmony export */ });\n/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./model.js */ \"./src/scripts/pages/balancesheet/model.js\");\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n__webpack_require__(/*! ./model */ \"./src/scripts/pages/balancesheet/model.js\");\n\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/balancesheet/resource.js\");\n\n\n\nfunction BalancesheetViewModel() {\n  var self = this;\n\n  self.createBtn = function () {\n    _h.kocnx().openForm(new _model_js__WEBPACK_IMPORTED_MODULE_0__.BalancesheetForm(self, false));\n  };\n\n  self.editBtn = function () {\n    _h.kocnx().openForm(new _model_js__WEBPACK_IMPORTED_MODULE_0__.BalancesheetForm(self, true));\n  };\n\n  self.changeChildModel = function (target) {\n    self.childModel(new _model_js__WEBPACK_IMPORTED_MODULE_0__.BalancesheetContentViewModel());\n    self.childModel().sheetId(target.id());\n    self.childModel().init();\n  };\n\n  self.connectManBtn = function () {\n    _h.kocnx().openConnectMan(13, \"connectManCaption\");\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__.BaseViewModel({\n    entityName: \"Balancesheet\",\n    apiService: {\n      actionList: [\"filterby\", \"post\", \"put\", \"delete\"]\n    },\n    buttons: [{\n      name: 'edit',\n      access: true,\n      icon: 'Edit',\n      cMenu: true\n    }, {\n      name: 'delete',\n      access: true,\n      icon: 'Delete',\n      cMenu: true\n    }, {\n      name: 'connectMan',\n      access: true,\n      icon: 'DatabaseLink',\n      cMenu: true\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'create',\n      access: false,\n      cMenu: false\n    }],\n    filters: [{\n      name: 'balancesheetType',\n      type: \"select\",\n      source: balancesheetTypes\n    }, {\n      name: 'currencyType',\n      type: \"select\",\n      source: currencyTypes\n    }],\n    sortDirection: \"Ascending\",\n    sortProperty: \"id\",\n    context: self,\n    cols: balancesheetModelRes,\n    saveState: true,\n    getList: true,\n    contextMenu: true,\n    selectRow: true,\n    searchKeyType: \"enter\",\n    tableClass: \"table ko-tbl ko-tbl-master\",\n    tableStyle: \"table-layout: fixed;\",\n    resizable: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    var isSelected = self.isSelectedRecord();\n    var inListView = self.showType() === \"List\";\n\n    var permitPeriodEdit = _h.kocnx().permitPeriodEdit();\n\n    if (isSelected) {\n      self.visedit(permitPeriodEdit && !inListView);\n      self.visdelete(permitPeriodEdit && !inListView);\n    } else {\n      self.visedit(false);\n      self.visdelete(false);\n    }\n\n    self.vishelp(!inListView);\n    self.visrefresh(!inListView);\n    self.vistools(true);\n    self.visconnectMan(!inListView);\n    self.viscreate(permitPeriodEdit && !inListView);\n  });\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/balancesheet/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/company/model.js":
/*!********************************************!*\
  !*** ./src/scripts/pages/company/model.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"Company\": () => (/* binding */ Company),\n/* harmony export */   \"CompanyDynamicField\": () => (/* binding */ CompanyDynamicField),\n/* harmony export */   \"CompanyDynamicForm\": () => (/* binding */ CompanyDynamicForm),\n/* harmony export */   \"CompanyDynamicItem\": () => (/* binding */ CompanyDynamicItem),\n/* harmony export */   \"CompanyForm\": () => (/* binding */ CompanyForm),\n/* harmony export */   \"CompanyInfoData\": () => (/* binding */ CompanyInfoData),\n/* harmony export */   \"CompanyInfoDataViewModel\": () => (/* binding */ CompanyInfoDataViewModel)\n/* harmony export */ });\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* harmony import */ var _companyinfo_model_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../companyinfo/model.js */ \"./src/scripts/pages/companyinfo/model.js\");\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var _autoMapper = __webpack_require__(/*! ./src/scripts/util/autoMapper.js */ \"./src/scripts/util/autoMapper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar _require = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\"),\n    BaseModel = _require.BaseModel,\n    BaseFormModel = _require.BaseFormModel,\n    BaseSecondaryForm = _require.BaseSecondaryForm;\n\n\n\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\n\nvar Company = /*#__PURE__*/function (_BaseModel) {\n  _inherits(Company, _BaseModel);\n\n  var _super = _createSuper(Company);\n\n  function Company(model, parent) {\n    var _this;\n\n    _classCallCheck(this, Company);\n\n    _this = _super.call(this, model);\n    _this.parent = ko.observable(parent);\n    _this.children = ko.observableArray();\n    if (_h.any(model.children)) for (var j = 0; j < model.children.length; j++) {\n      var record = new Company(model.children[j], _assertThisInitialized(_this));\n\n      _this.children.push(record);\n    }\n    return _this;\n  }\n\n  _createClass(Company, [{\n    key: \"refreshModel\",\n    value: function refreshModel(model) {\n      _autoMapper.fillModel(this, model);\n\n      this.children = ko.observableArray();\n      if (_h.any(model.children)) for (var j = 0; j < model.children.length; j++) {\n        var record = new Company(model.children[j], this);\n        this.children.push(record);\n      }\n    }\n  }]);\n\n  return Company;\n}(BaseModel);\nvar CompanyForm = /*#__PURE__*/function (_BaseFormModel) {\n  _inherits(CompanyForm, _BaseFormModel);\n\n  var _super2 = _createSuper(CompanyForm);\n\n  function CompanyForm(viewModel, editMode, parentName, pi) {\n    var _this2;\n\n    _classCallCheck(this, CompanyForm);\n\n    _this2 = _super2.call(this, viewModel, editMode);\n    _this2.backgroundModal = false;\n    _this2.subsetMode = ko.observable(parentName !== undefined);\n    _this2.fileName = ko.observable();\n    _this2.file = ko.observable();\n    _this2.addByAutoComplete = ko.observable();\n    _this2.picMode = ko.observable(false);\n    if (_this2.subsetMode()) _this2.caption = _h.getLocalizedText('addSubsetCaption') + ' برای ' + parentName;\n    _this2.showPreview = ko.observable(false);\n    _this2.name = ko.observable();\n    _this2.companyType = ko.observable();\n    _this2.description = ko.observable();\n    _this2.pi = ko.observable(pi);\n\n    if (editMode) {\n      var model = viewModel.getSelectedRecord();\n\n      _this2.name(model.na());\n\n      _this2.companyType(model.nt());\n\n      _this2.description(model.de());\n\n      _this2.pi(model.pi());\n\n      if (!_h.isEmpty(model.logoUrl())) {\n        var fileName = model.logoUrl().substring(model.logoUrl().lastIndexOf(\"/\") + 1);\n\n        _this2.fileName(fileName);\n      }\n    } else _this2.mainCompany = ko.observable(false);\n\n    _this2.isCompany = ko.computed(function () {\n      return this.companyType() === 1;\n    }, _assertThisInitialized(_this2));\n\n    _this2.setValidationObject();\n\n    _this2.handlePicMode();\n\n    _this2.createForm();\n\n    return _this2;\n  }\n\n  _createClass(CompanyForm, [{\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      this.validationObject = ko.validatedObservable({\n        companyType: self.companyType.extend({\n          required: true\n        }),\n        currencyName: self.currencyName.extend({\n          required: true\n        }),\n        name: self.name.extend({\n          required: true,\n          notOnlyNumberAndSpChr: true,\n          notBeginNumberAndSpChr: true,\n          minLength: 3,\n          maxLength: 100,\n          remoteIsUniqueRule: {\n            params: [self.id, \"Company\", \"name\"]\n          }\n        }),\n        pi: self.pi.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.subsetMode();\n            }\n          }\n        }),\n        dateOfAcquisition: self.dateOfAcquisition.extend({\n          required: true\n        }),\n        nationalIdentity: self.nationalIdentity.extend({\n          required: true,\n          minLength: 10,\n          maxLength: 11,\n          numberOnly: null,\n          remoteIsUniqueRule: {\n            params: [self.id, \"Company\", \"nationalIdentity\"]\n          }\n        }),\n        file: self.file.extend({\n          checkImage: {\n            params: [self.fileName]\n          }\n        })\n      });\n    }\n  }, {\n    key: \"handleFileChoose\",\n    value: function handleFileChoose(files) {\n      var file = files;\n\n      var ext = _h.getExtension(file.name);\n\n      _h.toBase64(file, function (res) {\n        this.file(res);\n      }.bind(this));\n\n      this.fileName(file.name);\n\n      if (ext.toLowerCase() === \"jpg\" || ext.toLowerCase() === \"jpeg\" || ext.toLowerCase() === \"png\") {\n        this.handleShowPreview(file);\n      } else {\n        this.showPreview(false);\n        this.handlePicMode();\n      }\n    }\n  }, {\n    key: \"handleShowPreview\",\n    value: function handleShowPreview(file) {\n      var reader = new FileReader();\n\n      reader.onload = function (e) {\n        $('#preview-pic').attr('src', e.target.result);\n      };\n\n      reader.readAsDataURL(file);\n      this.showPreview(true);\n      this.handlePicMode();\n    }\n  }, {\n    key: \"handlePicMode\",\n    value: function handlePicMode() {\n      if (_h.isEmpty(this.logoUrl()) && !this.showPreview()) this.picMode(0);\n      if (!_h.isEmpty(this.logoUrl()) && !this.showPreview()) this.picMode(1);\n      if (this.showPreview()) this.picMode(2);\n      return true;\n    }\n  }, {\n    key: \"removeLogo\",\n    value: function removeLogo() {\n      if (_h.isEmpty(this.logoUrl())) {\n        this.file(undefined);\n        this.fileName(\"\");\n        this.showPreview(false);\n        this.picMode(0);\n      } else {\n        this.file(undefined);\n        this.picMode(0);\n        this.fileName(\"\");\n        this.logoUrl(null);\n        this.showPreview(false);\n      }\n    }\n  }, {\n    key: \"onCompanyAutoSelect\",\n    value: function onCompanyAutoSelect(controlName, item) {\n      this.companyType(item.nt);\n      this.description(item.de);\n      this.name(undefined);\n      this.name(item.na);\n      this.id(item.id);\n      this.nationalIdentity(item.nationalIdentity);\n      this.stateType(item.stateType);\n      this.currencyName(item.currencyName);\n      this.dateOfAcquisition(item.dateOfAcquisition);\n      this.addByAutoComplete(item.id);\n      if (_h.any(this.parentVM.selectList())) for (var i = 0; i < this.parentVM.selectList().length; i++) {\n        if (this.parentVM.selectList()[i].value() === item.pi) this.pi(item.pi);\n      }\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'firstrow-company-form-t'\n      }, undefined, true, 0, 0), this.createLine({\n        t: 'slc',\n        val: this.currencyName,\n        options: currencyNames\n      }, {\n        t: 'slc',\n        val: this.companyType,\n        options: companyTypes,\n        dis: this.editMode\n      }, true, 30), this.createLine({\n        t: 'dpk',\n        val: this.dateOfAcquisition,\n        dateType: 'fa'\n      }, {\n        t: 'slc',\n        val: this.pi,\n        options: this.parentVM.selectList\n      }, true, 30), this.createLine({\n        t: 'tm',\n        templateName: 'upload-company-form-t'\n      }, undefined, true, 30, 30), this.createLine({\n        t: 'chk',\n        val: this.mainCompany,\n        click: this.toggleMainCompany\n      }, undefined, this.isCompany, 30), this.createLine({\n        t: 'txa',\n        val: this.description\n      }, undefined, true, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'create',\n            vis: !this.editMode(),\n            click: this.parentVM.create\n          }, {\n            name: 'edit',\n            vis: this.editMode() === true,\n            click: this.parentVM.edit\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }, {\n    key: \"toggleMainCompany\",\n    value: function toggleMainCompany() {\n      this.mainCompany(!this.mainCompany());\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      var data = ko.toJS(this);\n      delete data[\"validationObject\"];\n      delete data[\"formButtons\"];\n      delete data[\"formControls\"];\n      delete data[\"parentVM\"];\n      delete data[\"editMode\"];\n      delete data[\"ad\"];\n      delete data[\"selected\"];\n      delete data[\"ruleModel\"];\n      delete data[\"parent\"];\n      delete data[\"children\"];\n      return data;\n    }\n  }]);\n\n  return CompanyForm;\n}(BaseFormModel);\nvar CompanyDynamicForm = /*#__PURE__*/function (_BaseSecondaryForm) {\n  _inherits(CompanyDynamicForm, _BaseSecondaryForm);\n\n  var _super3 = _createSuper(CompanyDynamicForm);\n\n  function CompanyDynamicForm(viewModel) {\n    var _this3;\n\n    _classCallCheck(this, CompanyDynamicForm);\n\n    _this3 = _super3.call(this, viewModel, [{\n      name: \"entityName\",\n      type: \"\",\n      val: \"CompanyDyanamic\"\n    }, {\n      name: \"dynamicForms\",\n      type: \"obar\"\n    }, {\n      name: \"lastPriority\",\n      type: \"ob\"\n    }, {\n      name: \"selectedRow\",\n      type: \"ob\"\n    }, {\n      name: \"resultModel\",\n      type: \"ob\"\n    }, {\n      name: \"showArchived\",\n      type: \"ob\",\n      value: false\n    }], \"CompanyDyanamicCaption\");\n    _this3.width = \"80%\";\n    _this3.visCreateBtn = ko.pureComputed(function () {\n      var cond = !_h.isNullOrEmpty(this.selectedRow()) && this.selectedRow().editMode() === false;\n      return cond;\n    }.bind(_assertThisInitialized(_this3)));\n    _this3.visEditBtn = ko.pureComputed(function () {\n      var cond = !_h.isNullOrEmpty(this.selectedRow()) && this.selectedRow().editMode();\n      return cond;\n    }.bind(_assertThisInitialized(_this3)));\n\n    _this3.createForm();\n\n    _this3.getRecords();\n\n    return _this3;\n  }\n\n  _createClass(CompanyDynamicForm, [{\n    key: \"createBtn\",\n    value: function createBtn() {\n      this.getLastPriority(function (res) {\n        if (res !== null) {\n          var item = new CompanyDynamicItem({\n            id: undefined,\n            title: \"\",\n            value: undefined,\n            priority: res + 1,\n            archived: false\n          }, res + 1);\n          this.selectedRow(item);\n        }\n      }.bind(this));\n    }\n  }, {\n    key: \"create\",\n    value: function create() {\n      var model = this.selectedRow().toServer();\n      if (model === false) return model;\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/companyinfo/post\",\n        data: model,\n        success: function (data) {\n          if (!_h.isNullOrEmpty(data)) {\n            this.getRecords(model.id);\n            this.lastPriority(data.lastPriority);\n            toast.success(this.entityName, 'post');\n          }\n        }.bind(this),\n        error: function (data) {\n          toast.error(this.entityName, 'post');\n        }.bind(this)\n      });\n    }\n  }, {\n    key: \"edit\",\n    value: function edit() {\n      var model = this.selectedRow().toServer();\n      if (model === false) return model;\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/companyinfo/put\",\n        data: model,\n        success: function (data) {\n          if (!_h.isNullOrEmpty(data)) {\n            this.getRecords(model.id);\n            this.lastPriority(data.lastPriority);\n            toast.success(this.entityName, 'put');\n          }\n        }.bind(this),\n        error: function (data) {\n          toast.error(this.entityName, 'put');\n        }.bind(this)\n      });\n    }\n  }, {\n    key: \"deleteBtn\",\n    value: function deleteBtn(m, item) {\n      if (_h.isNullOrEmpty(this.selectedRow().id())) {\n        this.selectedRow(null);\n        return;\n      }\n\n      var id = this.selectedRow().id();\n      var confirmText = toast.createMessage(this.entityName, 'del', null, 'confirm');\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/companyinfo/delete\",\n        data: {\n          id: id\n        },\n        success: function (data) {\n          if (!_h.isNullOrEmpty(data)) {\n            this.getRecords();\n            this.lastPriority(data.lastPriority);\n            this.selectedRow().selected(false);\n            this.selectedRow().editMode(false);\n            this.selectedRow(undefined);\n            toast.success(this.entityName, 'del');\n          }\n        }.bind(this),\n        error: function (data) {\n          toast.error(this.entityName, 'del');\n        }.bind(this)\n      });\n    }\n  }, {\n    key: \"getRecords\",\n    value: function getRecords(id) {\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/companyinfo/filterby\",\n        data: {\n          showArchived: this.showArchived()\n        },\n        success: function (data) {\n          this.dynamicForms.removeAll();\n\n          if (!_h.isNullOrEmpty(data)) {\n            if (_h.any(data.list)) {\n              var oldRecord;\n\n              for (var m = 0; m < data.list.length; m++) {\n                var target = data.list[m];\n                var record = new CompanyDynamicItem(target, data.lastPriority);\n                this.dynamicForms.push(record);\n\n                if (id && id === target.id) {\n                  oldRecord = record;\n                }\n              }\n\n              if (oldRecord) {\n                this.selectedRow(oldRecord);\n                oldRecord.selected(true);\n                oldRecord.editMode(true);\n              } else {\n                var first = this.dynamicForms()[0];\n\n                if (_h.isNullOrEmpty(this.selectedRow())) {\n                  this.selectedRow(first);\n                  first.selected(true);\n                  first.editMode(true);\n                }\n              }\n            }\n\n            this.lastPriority(data.lastPriority);\n          }\n        }.bind(this),\n        error: function (data) {\n          toast.error(this.entityName, 'getList');\n        }.bind(this)\n      });\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'companydynamicforms-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'createFormBtn',\n            vis: this.visCreateBtn,\n            click: this.create.bind(this)\n          }, {\n            name: \"custom\",\n            resText: 'editFormBtn',\n            vis: this.visEditBtn,\n            click: this.edit.bind(this)\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }, {\n    key: \"toggleShowArchive\",\n    value: function toggleShowArchive() {\n      this.showArchived(!this.showArchived());\n      this.getRecords();\n    }\n  }, {\n    key: \"archive\",\n    value: function archive() {\n      var model = this.selectedRow().toServer();\n      if (model === false) return model;\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/companyinfo/putarchive\",\n        data: model,\n        success: function (data) {\n          if (!_h.isNullOrEmpty(data)) {\n            this.getRecords(model.id);\n            this.lastPriority(data.lastPriority);\n            toast.success(this.entityName, 'put');\n          }\n        }.bind(this),\n        error: function (data) {\n          toast.error(this.entityName, 'put');\n        }.bind(this)\n      });\n    }\n  }, {\n    key: \"onRowClick\",\n    value: function onRowClick(item) {\n      if (this.selectedRow() !== null && this.selectedRow() !== undefined) {\n        this.selectedRow().selected(false);\n        this.selectedRow().editMode(false);\n      }\n\n      item.lastPriority(this.lastPriority() + 1);\n      this.selectedRow(item);\n      item.selected(true);\n      item.editMode(true);\n\n      if ($(\"#result-dyn-t\").hasClass(\"active\")) {\n        this.showInfo();\n      }\n    }\n  }, {\n    key: \"showInfo\",\n    value: function showInfo() {\n      var item = this.selectedRow();\n      var cols = [];\n      var idObj = {\n        fa: '#',\n        colName: 'id',\n        tablecol: false,\n        visibleCol: false,\n        sortDir: \"None\",\n        alias: null,\n        type: \"template\",\n        templateName: \"checkbox-table-template\"\n      };\n      cols.push(idObj);\n\n      for (var i = 0; i < companydyanamicModelRes.length; i++) {\n        var coi = companydyanamicModelRes[i];\n        var obj = {\n          fa: coi.fa,\n          colName: coi.colName,\n          tablecol: true,\n          visibleCol: true,\n          sortDir: \"None\",\n          alias: null,\n          type: coi.type,\n          popup: true\n        };\n        if (coi.colName === \"companyName\") obj.sortDir = \"Ascending\";\n        cols.push(obj);\n      }\n\n      if (!_h.isNullOrEmpty(item.fields())) for (var i = 0; i < item.fields().length; i++) {\n        var field = item.fields()[i];\n        var order = i.toString();\n        if (field.order()) order = field.order().toString();\n        var obj = {\n          fa: field.name(),\n          colName: order,\n          tablecol: true,\n          visibleCol: true,\n          sortDir: \"None\",\n          alias: null,\n          type: \"string\",\n          popup: true\n        };\n\n        switch (field.dataType()) {\n          case 4:\n            obj.type = \"file\";\n            break;\n        }\n        /*                if (field.name() === \"CompanyName\")\r\n                            obj.sortDir = \"Ascending\";*/\n\n\n        cols.push(obj);\n      }\n      var model = new CompanyInfoDataViewModel(cols);\n      model.formId(item.id());\n      this.resultModel(model);\n      this.resultModel().init();\n    }\n  }, {\n    key: \"getLastPriority\",\n    value: function getLastPriority(callback, id) {\n      var model = {\n        controllerName: 1,\n        id: id\n      };\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/common/getlastpriority\",\n        data: model,\n        success: function success(data) {\n          callback(data);\n        },\n        error: function error(data) {\n          toast.error(self.entityName, 'get', 'LastPriority');\n          callback(null);\n        },\n        messageType: 'get',\n        messageKey: \"LastPriority\"\n      });\n    }\n  }]);\n\n  return CompanyDynamicForm;\n}(BaseSecondaryForm);\nvar CompanyDynamicItem = /*#__PURE__*/function () {\n  function CompanyDynamicItem(model, lastPriority) {\n    _classCallCheck(this, CompanyDynamicItem);\n\n    this.editMode = ko.observable(false);\n    this.selected = ko.observable(false);\n    this.id = ko.observable(model.id);\n    this.title = ko.observable(model.title);\n    this.priority = ko.observable(model.priority);\n    this.archived = ko.observable(model.archived);\n    this.lastPriority = ko.observable(lastPriority);\n    this.fields = ko.observableArray();\n    if (_h.any(model.fields)) for (var j = 0; j < model.fields.length; j++) {\n      var record = new CompanyDynamicField(model.fields[j]);\n      this.fields.push(record);\n    }\n    this.validationObject = ko.validatedObservable({\n      title: this.title.extend({\n        required: true\n      }),\n      priority: this.priority.extend({\n        required: true\n      }),\n      fields: this.fields\n    });\n  }\n\n  _createClass(CompanyDynamicItem, [{\n    key: \"addField\",\n    value: function addField() {\n      var item = new CompanyDynamicField({\n        order: undefined,\n        name: \"\",\n        required: false\n      });\n      this.fields.push(item);\n    }\n  }, {\n    key: \"removeField\",\n    value: function removeField(parents, item) {\n      parents[0].fields.remove(item);\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      if (!this.validationObject.isValid()) {\n        this.validationObject.errors.showAllMessages();\n        return false;\n      }\n\n      var model = {\n        id: this.id(),\n        priority: this.priority(),\n        title: this.title(),\n        fields: ko.toJS(this.fields())\n      };\n      return model;\n    }\n  }]);\n\n  return CompanyDynamicItem;\n}();\nvar CompanyDynamicField = /*#__PURE__*/function () {\n  function CompanyDynamicField(model) {\n    _classCallCheck(this, CompanyDynamicField);\n\n    this.order = ko.observable(model.order);\n    this.name = ko.observable(model.name);\n    this.dataType = ko.observable(model.dataType);\n    this.value = ko.observable(model.value);\n    this.required = ko.observable(model.required);\n    this.validationObject = ko.validatedObservable({\n      name: this.name.extend({\n        required: true\n      }),\n      dataType: this.dataType.extend({\n        required: true\n      })\n    });\n  }\n\n  _createClass(CompanyDynamicField, [{\n    key: \"createTagId\",\n    value: function createTagId() {\n      return this.constructor.name + \"-\" + this.order();\n    }\n  }]);\n\n  return CompanyDynamicField;\n}();\nvar CompanyInfoData = /*#__PURE__*/function (_BaseModel2) {\n  _inherits(CompanyInfoData, _BaseModel2);\n\n  var _super4 = _createSuper(CompanyInfoData);\n\n  function CompanyInfoData(model) {\n    var _this4;\n\n    _classCallCheck(this, CompanyInfoData);\n\n    _this4 = _super4.call(this, model);\n    if (_h.any(model.cells)) for (var j = 0; j < model.cells.length; j++) {\n      var field = model.cells[j];\n      _this4[field.order] = ko.observable(field.value);\n    }\n    return _this4;\n  }\n\n  return _createClass(CompanyInfoData);\n}(BaseModel);\nfunction CompanyInfoDataViewModel(cols, editMode) {\n  var self = this;\n  self.editMode = editMode;\n  self.formName = ko.observable();\n  self.cols = cols;\n\n  self.downloadFile = function (order) {\n    var selectedRecord = self.getSelectedRecord();\n    var model = {\n      controllerName: 61,\n      inputData: {\n        formId: self.formId(),\n        id: selectedRecord.id(),\n        companyId: selectedRecord.companyId(),\n        fieldOrder: Number(order)\n      }\n    };\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n      url: \"/api/filegenerator/postdownloadfile\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.downloadFile(data.model);\n        }\n      },\n      error: function error(data) {}\n    });\n  };\n\n  self.exportExcelFileBtn = function () {\n    var filterModel = self.createFilterByModel();\n    var model = {\n      controllerName: 61,\n      inputData: filterModel\n    };\n\n    _h.kocnx().createExcel(model);\n  };\n\n  self.createEditModel = function (target, editMode) {\n    var model = {\n      editMode: editMode,\n      formId: self.formId(),\n      id: editMode ? target.id() : _h.createRandomNumber(),\n      fields: []\n    };\n\n    for (var i = 1; i < self.cols.length; i++) {\n      var col = self.cols[i];\n      var object = {\n        formId: self.formId(),\n        order: Number(col.colName),\n        name: col.fa,\n        dataType: col.dataType,\n        value: editMode ? target[i] : undefined,\n        required: col.required\n      };\n      model.fields.push(object);\n    }\n\n    return model;\n  };\n\n  self.createBtn = function () {\n    var model = self.createEditModel(null, false);\n\n    _h.kocnx().openForm(new _companyinfo_model_js__WEBPACK_IMPORTED_MODULE_1__.CompanyInfoDataForm(self, model));\n  };\n\n  self.editBtn = function (target) {\n    if (!target || !target[\"id\"]) target = self.getSelectedRecord();\n    var model = self.createEditModel(target, true);\n\n    _h.kocnx().openForm(new _companyinfo_model_js__WEBPACK_IMPORTED_MODULE_1__.CompanyInfoDataForm(self, model));\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.iconSize(\"icon-image-small\");\n  };\n\n  ko.utils.extend(this, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_2__.BaseViewModel({\n    entityName: \"CompanyInfoData\",\n    apiService: {\n      actionList: [\"filterby\", \"delete\", \"post\", \"put\"]\n    },\n    buttons: [{\n      name: 'exportExcelFile',\n      access: true,\n      icon: 'ExportExcel',\n      cMenu: false\n    }, {\n      name: 'delete',\n      access: true,\n      icon: 'Delete',\n      cMenu: true\n    }, {\n      name: 'edit',\n      access: true,\n      icon: 'Edit',\n      cMenu: true\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'create',\n      access: true,\n      cMenu: false\n    }],\n    filters: [{\n      name: 'formId'\n    }],\n    sortDirection: \"Ascending\",\n    sortProperty: \"\",\n    context: self,\n    dynamicCols: true,\n    extraParams: [],\n    saveState: true,\n    cols: cols,\n    getList: true,\n    selectRow: true,\n    contextMenu: true,\n    tableClass: \"table ko-tbl ko-tbl-child ko-tbl-dyninfo\",\n    searchKeyType: \"enter\",\n    tableStyle: \"width: 200%;margin-top: 10px;font-size: 11px;max-width: initial;\",\n    isMultiSelectRows: true,\n    resizable: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    if (!self.editMode) {\n      self.visexportExcelFile(true);\n      self.visrefresh(true);\n      self.vistools(true);\n      self.viscreate(false);\n      self.visedit(false);\n      self.visdelete(false);\n    } else {\n      self.visexportExcelFile(false);\n      self.visrefresh(true);\n      self.vistools(true);\n      self.viscreate(true);\n      var selectedRecord = self.getSelectedRecord();\n\n      if (!_h.isNullOrEmpty(selectedRecord)) {\n        self.visedit(true);\n        self.visdelete(true);\n      } else {\n        self.visedit(false);\n        self.visdelete(false);\n      }\n    }\n  });\n  self.countSelectedRecord = ko.pureComputed(function () {\n    var count = 0;\n\n    for (var i = 0; i < self.records().length; i++) {\n      var record = self.records()[i];\n      if (record.selected()) count++;\n    }\n\n    return count;\n  });\n}\n$(document).on(\"shown.bs.tab\", '.mapping-tab a[data-toggle=\"tab\"]', function () {\n  var href = $(this).attr(\"href\");\n\n  if (href === \"#result-dyn-t\") {\n    _h.kocnx().formModel().showInfo();\n  }\n\n  return false;\n});\n$(document).on(\"click\", '.file-download-item', function () {\n  var order = $(this).attr(\"data-order\");\n  if (_h.kocnx().formModel()) _h.kocnx().formModel().resultModel().downloadFile(order);else _h.kocnx().civm().childModel().downloadFile(order);\n  return false;\n});\n\n//# sourceURL=webpack://domino/./src/scripts/pages/company/model.js?");

/***/ }),

/***/ "./src/scripts/pages/company/resource.js":
/*!***********************************************!*\
  !*** ./src/scripts/pages/company/resource.js ***!
  \***********************************************/
/***/ (() => {

eval("window.companyTypes = [{\n  text: \"گروه\",\n  enText: \"\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"شرکت\",\n  enText: \"\",\n  value: 1,\n  color: \"\"\n}];\nwindow.currencyNames = [{\n  text: \"ریال\",\n  enText: \"\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"دلار\",\n  enText: \"\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"یورو\",\n  enText: \"\",\n  value: 2,\n  color: \"\"\n}];\nwindow.companyModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  name: {\n    fa: 'نام گروه/شرکت',\n    colName: 'name',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 35\n  },\n  companyType: {\n    fa: 'نوع',\n    colName: 'companyType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 6\n  },\n  currencyName: {\n    fa: 'واحد پولی',\n    colName: 'currencyName',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    size: 6\n  },\n  stateType: {\n    fa: 'وضعیت',\n    colName: 'stateType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 6\n  },\n  nationalIdentity: {\n    fa: 'شناسه ملی',\n    colName: 'nationalIdentity',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null\n  },\n  dateOfAcquisition: {\n    fa: 'تاریخ تحصیل',\n    colName: 'dateOfAcquisition',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null\n  },\n  description: {\n    fa: 'توضیحات',\n    colName: 'description',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null\n  },\n  pi: {\n    fa: 'گروه والد',\n    colName: 'pi',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null\n  },\n  mainCompany: {\n    fa: 'شرکت اصلی',\n    colName: 'mainCompany',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null\n  },\n  logoUrl: {\n    fa: '',\n    colName: 'logoUrl',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"string\"\n  }\n};\nwindow.companyPageRes = {\n  editCaption: {\n    fa: 'ویرایش اطلاعات گروه/شرکت'\n  },\n  createCaption: {\n    fa: 'تعریف گروه/شرکت جدید'\n  },\n  deleteCaption: {\n    fa: 'حذف گروه/شرکت'\n  },\n  addSubsetCaption: {\n    fa: 'تعریف زیرمجموعه'\n  },\n  removeLogoBtn: {\n    fa: 'حذف لوگو'\n  },\n  CompanyUsers: {\n    fa: 'کاربران'\n  },\n  CompanyCount: {\n    fa: 'تعداد گروه/شرکت ثبت شده'\n  },\n  chooseLogoFileHelp: {\n    fa: 'تصویر لوگو باید حداکثر 120 پیکسل و با یکی از فرمت های \"png\", \"jpg\" باشد'\n  },\n  trueStateMessage: {\n    fa: 'آیا از فعال کردن کاربر اطمینان دارید؟'\n  },\n  falseStateMessage: {\n    fa: 'آیا از غیرفعال کردن کاربر اطمینان دارید؟'\n  },\n  companyEditor: {\n    fa: 'فهرست'\n  },\n  CompanyDyanamicCaption: {\n    fa: 'فرم گزارشات'\n  },\n  CompanyDyanamicListCaption: {\n    fa: 'فهرست'\n  },\n  addCompanyDyanamic: {\n    fa: 'تعریف فرم جدید'\n  },\n  removeCompanyDyanamic: {\n    fa: 'حذف فرم'\n  },\n  formMakerCaption: {\n    fa: 'مدیریت فرم گزارش گیری'\n  },\n  formType: {\n    fa: 'نوع'\n  },\n  addForm: {\n    fa: 'فرم جدید'\n  },\n  showArchive: {\n    fa: 'نمایش فرم های بایگانی شده'\n  },\n  hideArchive: {\n    fa: 'عدم نمایش فرم های بایگانی شده'\n  },\n  unArchiveForm: {\n    fa: 'عدم بایگانی فرم'\n  },\n  archiveForm: {\n    fa: 'بایگانی فرم'\n  },\n  removeForm: {\n    fa: 'حذف فرم'\n  },\n  exportExcelFileCaption: {\n    fa: 'خروجی اکسل'\n  }\n};\nwindow.companydyanamicModelRes = [{\n  fa: 'نام گروه/شرکت',\n  colName: 'companyName',\n  type: \"string\"\n}, {\n  fa: 'شناسه ملی',\n  colName: 'nationalIdentity',\n  type: \"string\"\n}, {\n  fa: 'کاربر',\n  colName: 'createByUser',\n  type: \"string\"\n}, {\n  fa: 'بروزرسانی',\n  colName: 'lastUpdate',\n  type: \"pdate\"\n}];\n\n//# sourceURL=webpack://domino/./src/scripts/pages/company/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/company/viewModel.js":
/*!************************************************!*\
  !*** ./src/scripts/pages/company/viewModel.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"CompanyViewModel\": () => (/* binding */ CompanyViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _master_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/model */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model */ \"./src/scripts/pages/company/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/company/resource.js\");\n\n__webpack_require__(/*! ./model */ \"./src/scripts/pages/company/model.js\");\n\n\n\n\nfunction CompanyViewModel() {\n  var self = this;\n  self.selectList = ko.observableArray();\n  self.users = ko.observableArray();\n  self.usersFiltered = ko.observableArray();\n  self.userSearchKey = ko.observable();\n  self.userSearchKey.subscribe(function (value) {\n    if (_h.isEmpty(value)) {\n      var allUsers = ko.toJS(self.users());\n      self.usersFiltered(allUsers);\n    } else {\n      self.usersFiltered.removeAll();\n\n      for (var i = 0; i < self.users().length; i++) {\n        var isValueMultiPart = value.indexOf(\" \") !== -1;\n\n        if (!isValueMultiPart) {\n          if (self.checkWordInUsers(self.users()[i], value)) self.usersFiltered.push(self.users()[i]);\n        } else {\n          var splits = value.split(\" \");\n          var result = false;\n\n          for (var j = 0; j < splits.length; j++) {\n            if (!_h.isEmpty(splits[j]) && self.checkWordInUsers(self.users()[i], splits[j])) {\n              result = result || true;\n            }\n          }\n\n          if (result) self.usersFiltered.push(self.users()[i]);\n        }\n      }\n    }\n  });\n\n  self.checkWordInUsers = function (user, value) {\n    var inUserName = user.userName.indexOf(value) !== -1;\n    var inFirstName = user.firstName.indexOf(value) !== -1;\n    var inLastName = user.lastName.indexOf(value) !== -1;\n    if (inFirstName || inLastName || inUserName) return true;\n    return false;\n  };\n\n  self.onTreeNodeSelect = function (item) {\n    self.userSearchKey(undefined);\n    self.onlySelectedRow(item);\n    self.getCompanyUsers(item);\n  };\n\n  self.getSelectList = function () {\n    self.apiService.request({\n      name: \"/api/common/getcompanylist\",\n      data: {\n        controllerName: 1\n      },\n      success: function success(data) {\n        self.selectList.removeAll();\n        if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n          var target = data[j];\n          self.selectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.SelectItem(target));\n        }\n      },\n      messageType: 'getSelectList',\n      messageKey: self.entityName\n    });\n  };\n\n  self.toggleUserState = function (item) {\n    var model = {\n      controllerName: 2,\n      inputData: {\n        idList: [item.id],\n        stateType: item.stateType() === 0 ? 1 : 0\n      }\n    };\n    self.apiService.request({\n      name: \"putStateType\",\n      data: model,\n      success: function success(data) {\n        item.stateType(item.stateType() === 0 ? 1 : 0);\n        toast.success(self.entityName, 'putUpdate', 'UserState');\n      },\n      error: function error() {\n        toast.success(self.entityName, 'putUpdate', 'UserState');\n      }\n    });\n  };\n\n  self.createBtn = function () {\n    _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.CompanyForm(self, false));\n  };\n\n  self.editBtn = function (id, e, target) {\n    if (!target || target[\"currentTarget\"]) target = undefined;\n\n    _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.CompanyForm(self, true), target);\n  };\n\n  self.addSubsetBtn = function () {\n    var selectedRecord = self.getSelectedRecord();\n\n    _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.CompanyForm(self, false, selectedRecord.na(), selectedRecord.id()));\n  };\n\n  self.formMakerBtn = function () {\n    _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.CompanyDynamicForm(self));\n  };\n\n  self.getCompanyUsers = function (item) {\n    self.apiService.request({\n      name: \"/api/common/getuserslist\",\n      data: {\n        companyId: Number(item.id()),\n        controllerName: self.controllerName\n      },\n      success: function success(data) {\n        self.users.removeAll();\n        self.usersFiltered.removeAll();\n        if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n          data[j].stateType = ko.observable(data[j].stateType);\n          self.users.push(data[j]);\n          self.usersFiltered.push(data[j]);\n        }\n      },\n      messageType: 'getList',\n      messageKey: \"User\"\n    });\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.getSelectList();\n    self.iconSize(\"icon-image-small\");\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"Company\",\n    getList: true,\n    apiService: {\n      actionList: [\"filterby\", \"post\", \"put\", \"delete\", \"getselectlist\"]\n    },\n    buttons: [{\n      name: 'disable',\n      access: true,\n      icon: 'DocDisable',\n      cMenu: true\n    }, {\n      name: 'enable',\n      access: true,\n      icon: 'DocEnable',\n      cMenu: true\n    }, {\n      name: 'addSubset',\n      access: true,\n      icon: 'TreeCreate',\n      cMenu: true\n    }, {\n      name: 'formMaker',\n      access: true,\n      icon: 'FormMaker',\n      cMenu: true\n    }, {\n      name: 'delete',\n      access: true,\n      icon: 'Delete',\n      cMenu: true\n    }, {\n      name: 'edit',\n      access: true,\n      icon: 'Edit',\n      cMenu: true\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'create',\n      access: false,\n      cMenu: false\n    }],\n    filters: [{\n      name: 'companyType',\n      type: \"select\",\n      source: companyTypes\n    }, {\n      name: 'stateType',\n      type: \"select\",\n      source: stateTypes\n    }, {\n      name: 'currencyName',\n      type: \"select\",\n      source: currencyNames\n    }],\n    sortDirection: \"Ascending\",\n    sortProperty: \"id\",\n    context: self,\n    saveState: true,\n    cols: companyModelRes,\n    selectRow: true,\n    contextMenu: true,\n    rowStyle: \"rowStyleValue\",\n    searchKeyType: \"enter\",\n    resizable: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    var context = _h.kocnx();\n\n    var isSelected = self.isSelectedRecord();\n    var item = self.getSelectedRecord();\n    var permitPeriodEdit = context.permitPeriodEdit();\n\n    if (isSelected) {\n      var companyType = item.nt();\n      self.visedit(permitPeriodEdit);\n      self.visdelete(permitPeriodEdit && item.id() !== context.loginCompanyId());\n      self.visaddSubset(permitPeriodEdit && companyType === 0);\n      self.visdisable(permitPeriodEdit && item.stateType() === 1);\n      self.visenable(permitPeriodEdit && item.stateType() === 0);\n    } else {\n      self.visedit(false);\n      self.visdelete(false);\n      self.visaddSubset(false);\n      self.visdisable(false);\n      self.visenable(false);\n    }\n\n    self.visformMaker(context.loginCompanyType() === 0);\n    self.vishelp(true);\n    self.visrefresh(true);\n    self.viscreate(permitPeriodEdit);\n  });\n\n  self.afterFilterBy = function () {\n    self.configTools();\n  };\n\n  self.configTools = function () {\n    $(\"#tree_view\").treeView({\n      nodes: self.records,\n      tType: \"Company\",\n      location: \"Company\",\n      rootId: \"_\",\n      context: self,\n      actions: {\n        onEdit: self.editBtn\n      }\n    });\n  };\n\n  self.treeOpenBranches = [];\n\n  self.collectOpenBranches = function () {\n    var tree = $(\"#tree_view\");\n    var ulList = tree.find(\"ul:not(.dmn-c)\");\n    var array = [];\n    if (ulList.length) for (var i = 0; i < ulList.length; i++) {\n      var item = ulList[i];\n      var parent = $(item).parent();\n      if (parent) array.push(parent.attr(\"did\"));\n    }\n    self.treeOpenBranches = array;\n  };\n\n  self.afterUpdate = function (models, searchDeep) {\n    for (var i = 0; i < models.length; i++) {\n      var oldRecord = self.findRecord(models[i].id, searchDeep);\n\n      if (!_h.isNullOrEmpty(oldRecord)) {\n        if (oldRecord.pi() === models[i].pi) {\n          oldRecord.refreshModel(models[i]);\n        } else {\n          var parent = self.findRecord(oldRecord.pi(), searchDeep);\n          parent.children.remove(oldRecord);\n          var newParent = self.findRecord(models[i].pi, searchDeep);\n          var record = new _model__WEBPACK_IMPORTED_MODULE_2__.Company(models[i], newParent);\n          newParent.children.push(record);\n        }\n      }\n    }\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/company/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/companyinfo/model.js":
/*!************************************************!*\
  !*** ./src/scripts/pages/companyinfo/model.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"CompanyFormField\": () => (/* binding */ CompanyFormField),\n/* harmony export */   \"CompanyInfo\": () => (/* binding */ CompanyInfo),\n/* harmony export */   \"CompanyInfoDataForm\": () => (/* binding */ CompanyInfoDataForm)\n/* harmony export */ });\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar _require = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\"),\n    BaseModel = _require.BaseModel,\n    BaseSecondaryForm = _require.BaseSecondaryForm;\n\n\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\nvar CompanyInfo = /*#__PURE__*/function (_BaseModel) {\n  _inherits(CompanyInfo, _BaseModel);\n\n  var _super = _createSuper(CompanyInfo);\n\n  function CompanyInfo(model, parent) {\n    var _this;\n\n    _classCallCheck(this, CompanyInfo);\n\n    _this = _super.call(this, model);\n    _this.fields = ko.observableArray();\n    if (_h.any(model.fields)) for (var j = 0; j < model.fields.length; j++) {\n      model.fields[j].formId = model.id;\n\n      _this.fields.push(model.fields[j]);\n    }\n    return _this;\n  }\n\n  return _createClass(CompanyInfo);\n}(BaseModel);\nvar CompanyInfoDataForm = /*#__PURE__*/function (_BaseSecondaryForm) {\n  _inherits(CompanyInfoDataForm, _BaseSecondaryForm);\n\n  var _super2 = _createSuper(CompanyInfoDataForm);\n\n  function CompanyInfoDataForm(viewModel, model, lastPriority) {\n    var _this2;\n\n    _classCallCheck(this, CompanyInfoDataForm);\n\n    _this2 = _super2.call(this, viewModel, [{\n      name: \"formId\",\n      type: \"ob\",\n      val: model.formId\n    }, {\n      name: \"id\",\n      type: \"ob\",\n      val: model.id\n    }, {\n      name: \"priority\",\n      type: \"ob\",\n      val: undefined\n    }, {\n      name: \"lastPriority\",\n      type: \"ob\",\n      val: undefined\n    }, {\n      name: \"editMode\",\n      type: \"ob\",\n      val: model.editMode\n    }, {\n      name: \"fields\",\n      type: \"obar\",\n      val: undefined\n    }], model.editMode ? \"EditModalCaption\" : \"CreateModalCaption\");\n    _this2.width = \"500px\";\n\n    if (model.editMode) {\n      _this2.priority(lastPriority + 1);\n\n      _this2.lastPriority(lastPriority + 1);\n    } else {\n      _this2.priority(model.priority);\n\n      _this2.lastPriority(lastPriority);\n    }\n\n    if (_h.any(model.fields)) for (var j = 0; j < model.fields.length; j++) {\n      model.fields[j].formId = model.formId;\n      model.fields[j].id = model.id;\n      var record = new CompanyFormField(model.fields[j]);\n\n      _this2.fields.push(record);\n    }\n\n    _this2.setValidationObject();\n\n    _this2.createForm();\n\n    return _this2;\n  }\n\n  _createClass(CompanyInfoDataForm, [{\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'companyinfo-fields-form-t'\n      }, undefined, true, 30, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'create',\n            vis: !this.editMode(),\n            click: this.parentVM.create\n          }, {\n            name: 'edit',\n            vis: this.editMode,\n            click: this.parentVM.edit\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      for (var j = 0; j < this.fields().length; j++) {\n        var f = this.fields()[j];\n\n        if (!this.fields()[j].validationObject.isValid()) {\n          this.fields()[j].validationObject.errors.showAllMessages();\n          return false;\n        }\n      }\n\n      var model = {\n        id: this.id(),\n        formId: this.formId(),\n        values: []\n      };\n\n      for (var j = 0; j < this.fields().length; j++) {\n        model.values.push({\n          key: this.fields()[j].order(),\n          value: this.fields()[j].value()\n        });\n      }\n\n      return model;\n    }\n  }, {\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      self.validationObject = ko.validatedObservable({\n        fields: self.fields\n      });\n    }\n  }]);\n\n  return CompanyInfoDataForm;\n}(BaseSecondaryForm);\nvar CompanyFormField = /*#__PURE__*/function () {\n  function CompanyFormField(model) {\n    _classCallCheck(this, CompanyFormField);\n\n    this.id = model.id;\n    this.formId = ko.observable(model.formId);\n    this.order = ko.observable(model.order);\n    this.name = ko.observable(model.name);\n    this.fileName = ko.observable(model.fileName);\n    this.dataType = ko.observable(model.dataType);\n    if (model[\"value\"]) this.value = ko.observable(model.value());else this.value = ko.observable(undefined);\n    var self = this;\n    var obj = {};\n\n    if (model.required || model.dataType === 1) {\n      var sub = {};\n\n      if (model.required) {\n        sub.required = true;\n      }\n\n      if (model.dataType === 1) {\n        sub.numberOnly = true;\n      }\n\n      obj = {\n        value: self.value.extend(sub)\n      };\n    }\n\n    this.validationObject = ko.validatedObservable(obj);\n  }\n\n  _createClass(CompanyFormField, [{\n    key: \"handleFileChoose\",\n    value: function handleFileChoose(files) {\n      var file = files;\n\n      var ext = _h.getExtension(file.name);\n\n      _h.toBase64(file, function (res) {\n        var model = {\n          controllerName: 61,\n          inputData: {\n            id: this.id,\n            formId: this.formId(),\n            fieldOrder: this.order(),\n            file: res,\n            fileName: file.name,\n            fileType: ext\n          }\n        };\n        _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n          url: \"/api/common/postimportfile\",\n          data: model,\n          success: function (data) {\n            this.value(file.name);\n          }.bind(this),\n          error: function (data) {}.bind(this)\n        });\n      }.bind(this));\n    }\n  }, {\n    key: \"removeFile\",\n    value: function removeFile() {\n      var model = {\n        controllerName: 61,\n        inputData: {\n          formId: this.formId(),\n          id: this.id,\n          fieldOrder: this.order(),\n          fileName: this.value()\n        }\n      };\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/common/deletefile\",\n        data: model,\n        success: function (data) {\n          this.value(undefined);\n        }.bind(this),\n        error: function (data) {}.bind(this)\n      });\n    }\n  }]);\n\n  return CompanyFormField;\n}();\n\n//# sourceURL=webpack://domino/./src/scripts/pages/companyinfo/model.js?");

/***/ }),

/***/ "./src/scripts/pages/companyinfo/resource.js":
/*!***************************************************!*\
  !*** ./src/scripts/pages/companyinfo/resource.js ***!
  \***************************************************/
/***/ (() => {

eval("window.companyinfoModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  title: {\n    fa: 'عنوان',\n    colName: 'title',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 35,\n    type: \"string\"\n  }\n};\nwindow.companyinfoPageRes = {\n  CompanyDyanamicListCaption: {\n    fa: 'فهرست'\n  },\n  companyInfoForm: {\n    fa: 'فرم'\n  }\n};\nwindow.companyInfoDataPageRes = {\n  deleteCaption: {\n    fa: 'حذف'\n  },\n  editCaption: {\n    fa: 'ویرایش اطلاعات'\n  },\n  exportExcelFileCaption: {\n    fa: 'خروجی اکسل'\n  },\n  createCaption: {\n    fa: 'ورود اطلاعات جدید'\n  },\n  EditModalCaption: {\n    fa: 'فرم ویرایش اطلاعات'\n  },\n  CreateModalCaption: {\n    fa: 'فرم ورود اطلاعات'\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/pages/companyinfo/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/companyinfo/viewModel.js":
/*!****************************************************!*\
  !*** ./src/scripts/pages/companyinfo/viewModel.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"CompanyInfoViewModel\": () => (/* binding */ CompanyInfoViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _company_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../company/model */ \"./src/scripts/pages/company/model.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/companyinfo/resource.js\");\n\n__webpack_require__(/*! ./model */ \"./src/scripts/pages/companyinfo/model.js\");\n\n\n\nfunction CompanyInfoViewModel() {\n  var self = this;\n\n  self.putFormData = function () {\n    var selectedRecord = self.getSelectedRecord();\n    var selectedId = selectedRecord.id();\n    var model = selectedRecord.toServer();\n    if (!model) return;\n    ApiService.request({\n      url: \"/api/companyinfo/putvalue\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          self.getRecords(selectedId);\n          toast.success(self.entityName, 'put');\n        }\n      },\n      error: function error(data) {\n        toast.error(self.entityName, 'put');\n      }\n    });\n  };\n\n  self.afterFilterBy = function (x, selectedId) {\n    var rec;\n\n    if (selectedId) {\n      if (_h.any(self.records())) for (var i = 0; i < self.records().length; i++) {\n        rec = self.records()[i];\n\n        if (rec.id() === selectedId) {\n          self.changeSelectedRecord(rec, false, false, false);\n        }\n      }\n    } else {\n      if (_h.any(self.records())) {\n        rec = self.records()[0];\n        self.changeSelectedRecord(rec, false, false, false);\n      }\n    }\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"CompanyInfo\",\n    getList: true,\n    apiService: {\n      actionList: [\"filterby\"]\n    },\n    buttons: [{\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }],\n    filters: [],\n    sortDirection: \"Ascending\",\n    sortProperty: \"id\",\n    context: self,\n    saveState: true,\n    cols: companyinfoModelRes,\n    selectRow: true,\n    contextMenu: true,\n    searchKeyType: \"enter\"\n  }));\n  self.btnVisibility = ko.computed(function () {\n    self.vishelp(true);\n    self.visrefresh(true);\n  });\n\n  self.changeChildModel = function (item) {\n    var cols = [];\n    var idObj = {\n      fa: '#',\n      colName: 'id',\n      tablecol: false,\n      visibleCol: false,\n      sortDir: \"None\",\n      alias: null,\n      type: \"template\",\n      templateName: \"checkbox-table-template\",\n      dataType: -1\n    };\n    cols.push(idObj);\n    if (!_h.isNullOrEmpty(item.fields())) for (var i = 0; i < item.fields().length; i++) {\n      var field = item.fields()[i];\n      var order = field.order.toString();\n      var obj = {\n        fa: field.name,\n        colName: order,\n        tablecol: true,\n        visibleCol: true,\n        sortDir: \"None\",\n        alias: null,\n        dataType: field.dataType,\n        required: field.required\n      };\n\n      switch (field.dataType) {\n        case 1:\n          obj.type = \"string\";\n          break;\n\n        case 2:\n          obj.type = \"string\";\n          break;\n\n        case 3:\n          obj.type = \"pdate\";\n          break;\n\n        case 4:\n          obj.type = \"file\";\n          break;\n      }\n\n      if (i === 0) obj.sortDir = \"Ascending\";\n      cols.push(obj);\n    }\n    var model = new _company_model__WEBPACK_IMPORTED_MODULE_1__.CompanyInfoDataViewModel(cols, true);\n    model.formId(item.id());\n    model.formName(item.title());\n    self.childModel(model);\n    self.childModel().init();\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/companyinfo/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/consolidate/model.js":
/*!************************************************!*\
  !*** ./src/scripts/pages/consolidate/model.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"CompanySelectivePeriods\": () => (/* binding */ CompanySelectivePeriods),\n/* harmony export */   \"ConfirmedPeriod\": () => (/* binding */ ConfirmedPeriod),\n/* harmony export */   \"Consolidate\": () => (/* binding */ Consolidate),\n/* harmony export */   \"ConsolidatePeriodsForm\": () => (/* binding */ ConsolidatePeriodsForm),\n/* harmony export */   \"ConsolidationProcessStep\": () => (/* binding */ ConsolidationProcessStep),\n/* harmony export */   \"OwnershipCompany\": () => (/* binding */ OwnershipCompany),\n/* harmony export */   \"OwnershipModel\": () => (/* binding */ OwnershipModel)\n/* harmony export */ });\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var _autoMapper = __webpack_require__(/*! ./src/scripts/util/autoMapper.js */ \"./src/scripts/util/autoMapper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar _require = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\"),\n    BaseModel = _require.BaseModel,\n    BaseInfoModel = _require.BaseInfoModel,\n    BaseInnerModel = _require.BaseInnerModel,\n    BaseSecondaryForm = _require.BaseSecondaryForm;\n\n\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\nvar Consolidate = /*#__PURE__*/function (_BaseModel) {\n  _inherits(Consolidate, _BaseModel);\n\n  var _super = _createSuper(Consolidate);\n\n  function Consolidate(model) {\n    var _this;\n\n    _classCallCheck(this, Consolidate);\n\n    _this = _super.call(this, model);\n    _this.companies = ko.observableArray();\n    if (_h.any(model.companies)) for (var j = 0; j < model.companies.length; j++) {\n      var record = new Consolidate(model.companies[j]);\n\n      _this.companies.push(record);\n    }\n    _this.childrenShow = ko.observable(false);\n    return _this;\n  }\n\n  _createClass(Consolidate, [{\n    key: \"refreshModel\",\n    value: function refreshModel(model) {\n      this.companies.removeAll();\n      var companies = ko.toJS(model.companies);\n      delete model[\"companies\"];\n\n      _autoMapper.fillModel(this, model);\n\n      if (_h.any(companies)) for (var j = 0; j < companies.length; j++) {\n        var record = new Consolidate(companies[j]);\n        this.companies.push(record);\n      }\n    }\n  }]);\n\n  return Consolidate;\n}(BaseModel);\nvar OwnershipModel = /*#__PURE__*/function (_BaseSecondaryForm) {\n  _inherits(OwnershipModel, _BaseSecondaryForm);\n\n  var _super2 = _createSuper(OwnershipModel);\n\n  function OwnershipModel(viewModel, model) {\n    var _this2;\n\n    _classCallCheck(this, OwnershipModel);\n\n    _this2 = _super2.call(this, viewModel, [{\n      name: \"ownerId\",\n      type: \"ob\",\n      val: model.ownerId\n    }, {\n      name: \"ownerName\",\n      type: \"ob\",\n      val: model.ownerName\n    }, {\n      name: \"companies\",\n      type: \"obar\"\n    }], \"setPercentOwnershipCaption\");\n    _this2.width = \"600px\";\n\n    if (_h.any(model.companies)) {\n      for (var j = 0; j < model.companies.length; j++) {\n        var target = model.companies[j];\n        var record = new OwnershipCompany(target);\n\n        _this2.companies.push(record);\n      }\n    }\n\n    _this2.createForm();\n\n    return _this2;\n  }\n\n  _createClass(OwnershipModel, [{\n    key: \"checkValidCompanies\",\n    value: function checkValidCompanies() {\n      var res = true;\n      ko.utils.arrayFilter(this.companies(), function (company) {\n        if (!company.validationObject.isValid()) {\n          company.validationObject.errors.showAllMessages();\n          res = false;\n        }\n      });\n      return res;\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      var model = {\n        ownerId: this.ownerId(),\n        ownerName: this.ownerName(),\n        companies: []\n      };\n      ko.utils.arrayFilter(this.companies(), function (company) {\n        model.companies.push({\n          affiliateId: company.affiliateId(),\n          affiliateName: company.affiliateName(),\n          directOwnership: company.directOwnership()\n        });\n      });\n      return model;\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'ownership-content-form-t'\n      }, undefined, true, 30, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'custom',\n            resText: \"editFormBtn\",\n            vis: true,\n            click: this.parentVM.setPercentOwnership\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return OwnershipModel;\n}(BaseSecondaryForm);\nvar OwnershipCompany = /*#__PURE__*/function (_BaseInnerModel) {\n  _inherits(OwnershipCompany, _BaseInnerModel);\n\n  var _super3 = _createSuper(OwnershipCompany);\n\n  function OwnershipCompany(model) {\n    var _this3;\n\n    _classCallCheck(this, OwnershipCompany);\n\n    _this3 = _super3.call(this, model);\n    _this3.acceptableValue = model.acceptableValue;\n\n    _this3.setValidationObject();\n\n    return _this3;\n  }\n\n  _createClass(OwnershipCompany, [{\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      this.validationObject = ko.validatedObservable({\n        directOwnership: self.directOwnership.extend({\n          onlyDecimal: true,\n          max: 100\n        })\n      });\n    }\n  }]);\n\n  return OwnershipCompany;\n}(BaseInnerModel);\nvar ConsolidatePeriodsForm = /*#__PURE__*/function (_BaseSecondaryForm2) {\n  _inherits(ConsolidatePeriodsForm, _BaseSecondaryForm2);\n\n  var _super4 = _createSuper(ConsolidatePeriodsForm);\n\n  function ConsolidatePeriodsForm(viewModel, _list) {\n    var _this4;\n\n    _classCallCheck(this, ConsolidatePeriodsForm);\n\n    _this4 = _super4.call(this, viewModel, [{\n      name: \"inProgress\",\n      type: \"ob\",\n      val: false\n    }, {\n      name: \"percent\",\n      type: \"ob\",\n      val: 0\n    }, {\n      name: \"processStatus\",\n      type: \"ob\"\n    }, {\n      name: \"processItem\",\n      type: \"\",\n      val: null\n    }, {\n      name: \"searchKey\",\n      type: \"ob\"\n    }, {\n      name: \"resultList\",\n      type: \"obar\"\n    }, {\n      name: \"companies\",\n      type: \"obar\"\n    }], \"updateConsolidateCaption\");\n\n    _defineProperty(_assertThisInitialized(_this4), \"toServer\", function () {\n      var array = [];\n      ko.utils.arrayFilter(this.companies(), function (company) {\n        var list = company.collectData();\n        $.each(list, function (i, p) {\n          array.push(p);\n        });\n      });\n      return array;\n    });\n\n    _this4.width = \"800px\";\n\n    if (_h.any(_list)) {\n      for (var j = 0; j < _list.length; j++) {\n        var target = _list[j];\n        var record = new CompanySelectivePeriods(target);\n\n        _this4.companies.push(record);\n      }\n\n      if (_this4.companies().length) {\n        var first = _this4.companies()[0];\n\n        first.visible(true);\n      }\n    }\n\n    _this4.searchKey.subscribe(function (newVal) {\n      ko.utils.arrayFilter(this.companies(), function (company) {\n        if (company.companyName().indexOf(newVal) !== -1 || _h.isNullOrEmpty(newVal)) company.searchRes(true);else company.searchRes(false);\n      });\n    }.bind(_assertThisInitialized(_this4)));\n\n    _this4.isNotProgressMode = ko.pureComputed(function () {\n      return this.inProgress() === false;\n    }.bind(_assertThisInitialized(_this4)));\n    _this4.inProgressMode = ko.pureComputed(function () {\n      return this.inProgress() === true;\n    }.bind(_assertThisInitialized(_this4)));\n\n    _this4.createForm();\n\n    return _this4;\n  }\n\n  _createClass(ConsolidatePeriodsForm, [{\n    key: \"expandAll\",\n    value: function expandAll() {\n      ko.utils.arrayFilter(this.companies(), function (company) {\n        company.visible(true);\n      });\n    }\n  }, {\n    key: \"collapseAll\",\n    value: function collapseAll() {\n      ko.utils.arrayFilter(this.companies(), function (company) {\n        company.visible(false);\n      });\n    }\n  }, {\n    key: \"fillInProgress\",\n    value: function fillInProgress(model) {\n      this.processItem = model.item;\n      this.percent(model.percent);\n      this.processStatus(model.processStatus);\n      this.resultList.removeAll();\n      if (model.output && model.output.length > 0) for (var i = 0; i < model.output.length; i++) {\n        var item = new ConsolidationProcessStep(model.output[i]);\n        this.resultList.push(item);\n      }\n      this.inProgress(true);\n    }\n  }, {\n    key: \"onClickNodes\",\n    value: function onClickNodes(val) {\n      var ul = $(\"#group_step\").find(\"ul\");\n\n      if (ul) {\n        ul.find(\"li\").removeClass(\"dsb-active\");\n        var liList = ul.find(\"li\");\n\n        for (var i = 0; i < liList.length; i++) {\n          if ($(liList[i]).attr(\"data-id\") === \"\" + val) $(liList[i]).addClass(\"dsb-active\");\n        }\n      }\n\n      if (this.companies().length) for (var j = 0; j < this.companies().length; j++) {\n        var target = this.companies()[j];\n\n        if (target.periods().length === 1) {\n          target.periods()[0].step(Number(val));\n          target.periods()[0].changeStep(Number(val));\n          target.visible(true);\n        }\n\n        if (target.periods().length > 1) {\n          for (var k = 0; k < target.periods().length; k++) {\n            if (target.periods()[k].step() > 0) {\n              target.periods()[k].step(Number(val));\n              target.periods()[k].changeStep(Number(val));\n              target.visible(true);\n            }\n          }\n        }\n      }\n    }\n  }, {\n    key: \"onCancel\",\n    value: function onCancel() {\n      _h.kocnx().processManagement().cancelBtn(this.processItem);\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'consolidateperiods-form-t'\n      }, undefined, true, 30, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'custom',\n            resText: \"editFormBtn\",\n            vis: this.isNotProgressMode,\n            click: this.parentVM.updateConsolidate\n          }, {\n            name: 'custom',\n            resText: \"cancelProgressBtn\",\n            vis: this.inProgressMode,\n            click: this.onCancel.bind(this)\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return ConsolidatePeriodsForm;\n}(BaseSecondaryForm);\nfunction CompanySelectivePeriods(model) {\n  var self = this;\n  self.searchRes = ko.observable(true);\n  self.visible = ko.observable(false);\n  self.selectedPeriod = ko.observable();\n  self.count = ko.observable(model.count);\n  self.companyId = ko.observable(model.companyId);\n  self.companyName = ko.observable(model.companyName);\n  self.periods = ko.observableArray();\n  self.periodSelectedText = ko.computed(function () {\n    if (_h.isNullOrEmpty(self.selectedPeriod())) return \"\";\n    return self.selectedPeriod().title().replace(\"سال مالی منتهی به\", \"\") + \" - \" + _h.getEnumText(consolidationSteps, self.selectedPeriod().step());\n  });\n\n  if (_h.any(model.periods)) {\n    for (var j = 0; j < model.periods.length; j++) {\n      var record = new ConfirmedPeriod(model.periods[j], self);\n      self.periods.push(record);\n      if (record.step() > 0) self.selectedPeriod(record);\n    }\n  }\n\n  self.collectData = function () {\n    var array = [];\n    ko.utils.arrayFilter(self.periods(), function (period) {\n      array.push({\n        id: period.id(),\n        step: period.step()\n      });\n    });\n    return array;\n  };\n\n  self.changePeriodItemSelect = function (id) {\n    if (_h.any(self.periods())) for (var i = 0; i < self.periods().length; i++) {\n      if (self.periods()[i].id() !== id) {\n        self.periods()[i].step(0);\n      } else {\n        if (self.periods()[i].step() > 0) self.selectedPeriod(self.periods()[i]);\n      }\n    }\n  };\n\n  self.toggleVisible = function () {\n    self.visible(!self.visible());\n  };\n}\nvar ConfirmedPeriod = /*#__PURE__*/function (_BaseInnerModel2) {\n  _inherits(ConfirmedPeriod, _BaseInnerModel2);\n\n  var _super5 = _createSuper(ConfirmedPeriod);\n\n  function ConfirmedPeriod(model, parent) {\n    var _this5;\n\n    _classCallCheck(this, ConfirmedPeriod);\n\n    _this5 = _super5.call(this, model);\n    _this5.eId = \"step_\" + _h.createRandomNumber();\n    _this5.parent = parent;\n    _this5.description = model.description;\n    _this5.stepsub = _this5.step.supsendableSubscribe(function (newValue) {\n      this.parent.changePeriodItemSelect(this.id());\n    }.bind(_assertThisInitialized(_this5)));\n    setTimeout(function () {\n      this.changeStep(this.step());\n    }.bind(_assertThisInitialized(_this5)), 300);\n    return _this5;\n  }\n\n  _createClass(ConfirmedPeriod, [{\n    key: \"onClickNode\",\n    value: function onClickNode(val) {\n      this.step(Number(val));\n      this.changeStep(this.step());\n    }\n  }, {\n    key: \"changeStep\",\n    value: function changeStep(val) {\n      if (!val) val = 0;\n      var ul = $(\"#\" + this.eId).find(\"ul\");\n\n      if (ul) {\n        ul.find(\"li\").removeClass(\"dsb-active\");\n        var liList = ul.find(\"li\");\n\n        for (var i = 0; i < liList.length; i++) {\n          if ($(liList[i]).attr(\"data-id\") === \"\" + val) $(liList[i]).addClass(\"dsb-active\");\n        }\n      }\n    }\n  }]);\n\n  return ConfirmedPeriod;\n}(BaseInnerModel);\nvar ConsolidationProcessStep = /*#__PURE__*/function (_BaseInfoModel) {\n  _inherits(ConsolidationProcessStep, _BaseInfoModel);\n\n  var _super6 = _createSuper(ConsolidationProcessStep);\n\n  function ConsolidationProcessStep(model) {\n    _classCallCheck(this, ConsolidationProcessStep);\n\n    return _super6.call(this, model);\n  }\n\n  return _createClass(ConsolidationProcessStep);\n}(BaseInfoModel);\n\n//# sourceURL=webpack://domino/./src/scripts/pages/consolidate/model.js?");

/***/ }),

/***/ "./src/scripts/pages/consolidate/resource.js":
/*!***************************************************!*\
  !*** ./src/scripts/pages/consolidate/resource.js ***!
  \***************************************************/
/***/ (() => {

eval("window.consolidationSteps = [{\n  text: \"عدم تلفیق\",\n  enText: \"NotConsolidated\",\n  value: 0\n}, {\n  text: \"تجمیع در درختواره ها\",\n  enText: \"AggregateTrees\",\n  value: 1\n}, {\n  text: \"محاسبه درصد مالکیت\",\n  enText: \"CalculateOwnerships\",\n  value: 2\n}, {\n  text: \"تلفیق\",\n  enText: \"Consolidate \",\n  value: 3\n}];\nwindow.consolidateModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  companyId: {\n    fa: 'شرکت مشمول تلفیق',\n    colName: 'companyId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null\n  },\n  affiliateName: {\n    fa: 'شرکت تابعه',\n    colName: 'affiliateName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 20\n  },\n  periodName: {\n    fa: 'عنوان دوره',\n    colName: 'periodName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null\n  },\n  periodType: {\n    fa: 'نوع دوره',\n    colName: 'periodType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null\n  },\n  directOwnership: {\n    fa: 'درصد مالکیت مستقیم',\n    colName: 'directOwnership',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null\n  },\n  indirectOwnership: {\n    fa: 'درصد مالکیت غیر مستقیم',\n    colName: 'indirectOwnership',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null\n  },\n  minorityOwnership: {\n    fa: 'درصد مالکیت اقلیت',\n    colName: 'minorityOwnership',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null\n  },\n  totalOwnership: {\n    fa: 'درصد مالکیت کل',\n    colName: 'totalOwnership',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null\n  }\n};\nwindow.consolidatePageRes = {\n  Consolidate: {\n    fa: 'تلفیق'\n  },\n  pageCaption: {\n    fa: 'فهرست شرکت های مشمول تلفیق'\n  },\n  updateConsolidateCaption: {\n    fa: 'افزودن به فهرست شرکت های مشمول تلفیق'\n  },\n  deleteCaption: {\n    fa: 'حذف شرکت مشمول تلفیق'\n  },\n  setPercentOwnershipCaption: {\n    fa: 'تعیین درصد مالکیت'\n  },\n  ownershipTitle: {\n    fa: 'سهام های  '\n  },\n  cancelProgressBtn: {\n    fa: 'توقف عملیات'\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/pages/consolidate/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/consolidate/viewModel.js":
/*!****************************************************!*\
  !*** ./src/scripts/pages/consolidate/viewModel.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"ConsolidateViewModel\": () => (/* binding */ ConsolidateViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _master_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/model */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model */ \"./src/scripts/pages/consolidate/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n\n\n\n\n__webpack_require__(/*! ./model */ \"./src/scripts/pages/consolidate/model.js\");\n\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/consolidate/resource.js\");\n\nfunction ConsolidateViewModel() {\n  var self = this;\n  self.companySelectList = ko.observableArray();\n\n  self.getCompanySelectList = function () {\n    self.apiService.request({\n      name: \"/api/common/getcompanylist\",\n      data: {\n        controllerName: 39\n      },\n      success: function success(data) {\n        self.companySelectList.removeAll();\n        if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n          var target = data[j];\n          self.companySelectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.SelectItem(target));\n        }\n        self.companyId(null);\n      },\n      error: function error(message, level) {\n        toast.error(\"Company\", 'getSelectList', \"GroupCompanies\");\n      }\n    });\n  };\n\n  self.updateConsolidateBtn = function () {\n    self.getFormData(function (list) {\n      if (Array.isArray(list)) {\n        _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.ConsolidatePeriodsForm(self, list));\n      } else {\n        var message = _h.getApiMessage(list);\n\n        _h.warningToast(message);\n      }\n    });\n  };\n\n  self.getFormData = function (callback) {\n    self.apiService.request({\n      name: \"getSelectivePeriods\",\n      success: function success(data) {\n        callback(data);\n      },\n      error: function error(message, level) {\n        toast.error(self.entityName, 'get', \"SelectivePeriods\");\n        callback(null);\n      }\n    });\n  };\n\n  self.updateConsolidate = function (parents, btnModel, e) {\n    var formModel = parents[1];\n    var list = formModel.toServer();\n    if (list.length === 0) return;\n    var model = {\n      periodList: list\n    };\n    self.apiService.request({\n      splashId: e,\n      name: \"post\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.kocnx().checkProcessQueue(true);\n\n          localStorage.setItem(\"ProcessToken\", \"\");\n        }\n      },\n      error: function error(message, level) {\n        toast.error(self.entityName, 'putUpdate', \"PostConsolidate\");\n      }\n    });\n  };\n\n  self.toggleChildren = function (item) {\n    if (item.childrenShow() === false) {\n      item.childrenShow(true);\n    } else {\n      item.childrenShow(false);\n    }\n  };\n\n  self.getOwnershipModel = function (item, callback) {\n    self.apiService.request({\n      name: \"getOwnerShips\",\n      data: {\n        companyId: item.companyId()\n      },\n      success: function success(data) {\n        callback(data);\n      },\n      error: function error(message, level) {\n        toast.error(self.entityName, 'get', \"Ownership\");\n        callback(null);\n      }\n    });\n  };\n\n  self.setPercentOwnershipBtn = function () {\n    var item = self.getSelectedRecord();\n    self.getOwnershipModel(item, function (data) {\n      if (data) {\n        _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.OwnershipModel(self, data));\n      }\n    });\n  };\n\n  self.setPercentOwnership = function (parents, btnModel, e) {\n    var item = parents[1];\n    if (!item.checkValidCompanies()) return;\n    var model = item.toServer();\n    self.apiService.request({\n      splashId: e,\n      name: \"putOwnership\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.kocnx().closeForm();\n\n          self.afterUpdate(data.models);\n          toast.success(self.entityName, 'putUpdate', \"Ownership\");\n        }\n      },\n      error: function error(message, level) {\n        toast.error(self.entityName, 'putUpdate', \"Ownership\");\n      }\n    });\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.getCompanySelectList();\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"Consolidate\",\n    getList: true,\n    apiService: {\n      actionList: [\"filterby\", \"post\", \"getselectiveperiods\", \"getownerships\", \"putownership\"]\n    },\n    extraParams: [],\n    buttons: [{\n      name: 'setPercentOwnership',\n      access: true,\n      icon: 'PercentOwnership',\n      cMenu: true\n    }, {\n      name: 'updateConsolidate',\n      access: false,\n      icon: 'Consolidate',\n      cMenu: false\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }],\n    filters: [{\n      name: 'companyId',\n      type: \"select\",\n      source: self.companySelectList\n    }, {\n      name: 'submitState'\n    }],\n    sortDirection: \"Ascending\",\n    sortProperty: \"companyId\",\n    context: self,\n    saveState: true,\n    searchKeyType: \"enter\",\n    cols: consolidateModelRes,\n    selectRow: true,\n    contextMenu: true,\n    resizable: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    var isSelected = self.isSelectedRecord();\n\n    var permit = _h.kocnx().permitPeriodEdit();\n\n    if (isSelected) {\n      self.vissetPercentOwnership(permit);\n    } else {\n      self.vissetPercentOwnership(false);\n    }\n\n    self.vishelp(true);\n    self.visrefresh(true);\n    self.vistools(true);\n    self.visupdateConsolidate(permit);\n  });\n\n  self.right = function () {\n    var item = self.getSelectedRecord();\n\n    if (!_h.isNullOrEmpty(item)) {\n      if (item.childrenShow()) item.childrenShow(false);\n    }\n  };\n\n  self.left = function () {\n    var item = self.getSelectedRecord();\n\n    if (!_h.isNullOrEmpty(item)) {\n      if (!item.childrenShow()) item.childrenShow(true);\n    }\n  };\n\n  self.consolidationProcessHandler = function (id, input, output, percent, title, processStatus, item) {\n    var context = _h.kocnx();\n\n    if (!context.showForm()) {\n      _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.ConsolidatePeriodsForm(self, null));\n\n      context.formModel().fillInProgress({\n        id: id,\n        input: input,\n        output: output,\n        percent: percent,\n        title: title,\n        processStatus: processStatus,\n        item: item\n      });\n    } else {\n      context.formModel().fillInProgress({\n        id: id,\n        input: input,\n        output: output,\n        percent: percent,\n        title: title,\n        processStatus: processStatus,\n        item: item\n      });\n    }\n\n    if (percent === 100 || percent === \"100\") self.getRecords();\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/consolidate/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/dynamicdocument/model.js":
/*!****************************************************!*\
  !*** ./src/scripts/pages/dynamicdocument/model.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"AggregationDocumentProperties\": () => (/* binding */ AggregationDocumentProperties),\n/* harmony export */   \"AggregationTableCondition\": () => (/* binding */ AggregationTableCondition),\n/* harmony export */   \"ApportionmentDocumentProperties\": () => (/* binding */ ApportionmentDocumentProperties),\n/* harmony export */   \"ColumnDestinationValueProperty\": () => (/* binding */ ColumnDestinationValueProperty),\n/* harmony export */   \"ColumnDocumentProperties\": () => (/* binding */ ColumnDocumentProperties),\n/* harmony export */   \"ComputationalDocumentProperties\": () => (/* binding */ ComputationalDocumentProperties),\n/* harmony export */   \"ComputationalTableCondition\": () => (/* binding */ ComputationalTableCondition),\n/* harmony export */   \"DeleteCostDestinationValueProperty\": () => (/* binding */ DeleteCostDestinationValueProperty),\n/* harmony export */   \"DeleteCostDocumentProperties\": () => (/* binding */ DeleteCostDocumentProperties),\n/* harmony export */   \"DestinationAccountCode\": () => (/* binding */ DestinationAccountCode),\n/* harmony export */   \"DestinationFieldProperties\": () => (/* binding */ DestinationFieldProperties),\n/* harmony export */   \"DestinationValueProperty\": () => (/* binding */ DestinationValueProperty),\n/* harmony export */   \"DynamicDocument\": () => (/* binding */ DynamicDocument),\n/* harmony export */   \"DynamicDocumentForm\": () => (/* binding */ DynamicDocumentForm),\n/* harmony export */   \"ExpenseCenterTableData\": () => (/* binding */ ExpenseCenterTableData),\n/* harmony export */   \"ExpenseCenterTableDataViewModel\": () => (/* binding */ ExpenseCenterTableDataViewModel),\n/* harmony export */   \"SourceFieldFormula\": () => (/* binding */ SourceFieldFormula),\n/* harmony export */   \"SourceTableData\": () => (/* binding */ SourceTableData),\n/* harmony export */   \"SourceTableDataViewModel\": () => (/* binding */ SourceTableDataViewModel),\n/* harmony export */   \"TableCondition\": () => (/* binding */ TableCondition),\n/* harmony export */   \"TableConditionOperator\": () => (/* binding */ TableConditionOperator),\n/* harmony export */   \"TableConditionSet\": () => (/* binding */ TableConditionSet)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _master_model_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/model.js */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _master_phraseTranslator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../master/phraseTranslator.js */ \"./src/scripts/pages/master/phraseTranslator.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar _require = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\"),\n    BaseModel = _require.BaseModel,\n    BaseFormModel = _require.BaseFormModel,\n    FormBuilder = _require.FormBuilder;\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\n\n\n\nvar DynamicDocument = /*#__PURE__*/function (_BaseModel) {\n  _inherits(DynamicDocument, _BaseModel);\n\n  var _super = _createSuper(DynamicDocument);\n\n  function DynamicDocument(model) {\n    var _this;\n\n    _classCallCheck(this, DynamicDocument);\n\n    _this = _super.call(this, model);\n    _this.messageType = ko.observable(0);\n    _this.isEditable = ko.computed(function () {\n      return this.stateType() !== 0;\n    }.bind(_assertThisInitialized(_this)));\n    return _this;\n  }\n\n  return _createClass(DynamicDocument);\n}(BaseModel);\nvar DynamicDocumentForm = /*#__PURE__*/function (_BaseFormModel) {\n  _inherits(DynamicDocumentForm, _BaseFormModel);\n\n  var _super2 = _createSuper(DynamicDocumentForm);\n\n  function DynamicDocumentForm(viewModel, editMode, res) {\n    var _this2;\n\n    _classCallCheck(this, DynamicDocumentForm);\n\n    _this2 = _super2.call(this, viewModel, editMode);\n    _this2.lastPriority = ko.observable();\n    _this2.itemsCount = ko.observable();\n    _this2.errorTree = ko.observableArray();\n    _this2.section = ko.observable(\"general\");\n    _this2.documentProperties = ko.observable();\n\n    _this2.dynamicDocumentType.subscribe(function (newValue) {\n      var record = null;\n\n      switch (newValue) {\n        case 1:\n          record = new ComputationalDocumentProperties(this);\n          record.fillEmpty();\n          this.documentProperties(record);\n          break;\n\n        case 2:\n        case 3:\n          record = new ApportionmentDocumentProperties(this);\n          record.fillEmpty();\n          this.documentProperties(record);\n          break;\n\n        case 4:\n          record = new AggregationDocumentProperties(this);\n          record.fillEmpty();\n          this.documentProperties(record);\n          break;\n\n        case 5:\n          record = new ColumnDocumentProperties(this);\n          record.fillEmpty();\n          this.documentProperties(record);\n          break;\n\n        case 6:\n          record = new DeleteCostDocumentProperties(this);\n          record.fillEmpty();\n          this.documentProperties(record);\n          break;\n      }\n    }.bind(_assertThisInitialized(_this2)));\n\n    if (editMode) {\n      var model = viewModel.multiCommandExecute(\"selectedRowRecord\");\n\n      _this2.dynamicDocumentType(model.dynamicDocumentType());\n\n      _this2.dynamicDocumentType.valueHasMutated();\n\n      _this2.documentProperties().fillModel(model.documentProperties(), true);\n\n      _this2.lastPriority(res);\n    } else {\n      _this2.itemsCount(0);\n\n      _this2.stateType(1);\n\n      _this2.priority(res + 1);\n\n      _this2.lastPriority(res + 1);\n    }\n\n    _this2.setValidationObject();\n\n    _this2.createForm();\n\n    return _this2;\n  }\n\n  _createClass(DynamicDocumentForm, [{\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      self.validationObject = ko.validatedObservable({\n        title: self.title.extend({\n          required: true,\n          minLength: 3,\n          maxLength: 100,\n          validCharacterName: true,\n          remoteIsUniqueRule: {\n            params: [self.id, \"DynamicDocument\", \"title\", \"remotePlaceHolder\"]\n          }\n        }),\n        dynamicDocumentType: self.dynamicDocumentType.extend({\n          required: true\n        }),\n        code: self.code.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.editMode() === true;\n            }\n          },\n          remoteIsUniqueRule: {\n            params: [self.id, \"DynamicDocument\", \"code\", \"remotePlaceHolder\"]\n          },\n          numberOnly: null,\n          maxLength: {\n            params: 5,\n            message: \"کد سند باید حداکثر 5 کاراکتر عددی باشد\"\n          }\n        }),\n        priority: self.priority.extend({\n          required: true,\n          number: true\n        }),\n        documentProperties: self.documentProperties\n      });\n    }\n  }, {\n    key: \"validateForm\",\n    value: function validateForm() {\n      var array = [];\n\n      for (var p2 in this.validationObject()) {\n        if (this.validationObject().hasOwnProperty(p2)) {\n          var target2 = this.validationObject()[p2];\n          var text;\n\n          try {\n            text = _h.getLocalizedText(p2);\n          } catch (e) {\n            text = undefined;\n          }\n\n          if (!_h.isNullOrEmpty(text) && !_h.isNullOrEmpty(target2.error())) array.push({\n            propName: p2,\n            propFaName: text,\n            error: target2.error()\n          });\n\n          if (p2 === \"documentProperties\" && !_h.isNullOrEmpty(target2())) {\n            var list = target2().validateForm();\n\n            for (var i = 0; i < list.length; i++) {\n              array.push(list[i]);\n            }\n          }\n\n          this.errorTree(array);\n        }\n      }\n\n      if (!this.validationObject.isValid()) {\n        this.validationObject.errors.showAllMessages();\n        return false;\n      }\n\n      return true;\n    }\n  }, {\n    key: \"clickSection\",\n    value: function clickSection(model, event) {\n      if (!event) return;\n      var loc = $(event.target).attr(\"data-loc\");\n      this.section(loc);\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      return {\n        id: this.id(),\n        code: this.code(),\n        dynamicDocumentType: this.dynamicDocumentType(),\n        stateType: this.stateType(),\n        title: this.title(),\n        priority: this.priority(),\n        description: this.description(),\n        folderId: this.folderId(),\n        documentProperties: this.documentProperties().toServer()\n      };\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'dynamicdocument-form-t'\n      }, undefined, true, 30, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'create',\n            vis: !this.editMode(),\n            click: this.parentVM.create\n          }, {\n            name: 'edit',\n            vis: this.editMode() === true,\n            click: this.parentVM.edit\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return DynamicDocumentForm;\n}(BaseFormModel);\nfunction ComputationalDocumentProperties(parent) {\n  var self = this;\n  self.parentForm = parent;\n  self.sourceTableId = ko.observable();\n  self.sourceTableCondition = ko.observable();\n  self.sourceTableConditionModel = ko.observable();\n  self.sourceFieldFormulas = ko.observableArray();\n  self.sourceTableSelectList = {};\n  self.sourceTableColSelectList = {};\n  self.formulaColSelectList = [];\n  self.formulaTarget = ko.observable();\n\n  self.onSelect = function (controlName) {\n    var item, target;\n\n    switch (controlName) {\n      case \"sourceTableId\":\n        if (self.sourceTableId()) {\n          item = self.sourceTableSelectList[self.sourceTableId()];\n          self.sourceTableColSelectList = {};\n          self.formulaColSelectList = [];\n\n          if (_h.any(item.fields())) {\n            for (var i = 0; i < item.fields().length; i++) {\n              target = item.fields()[i];\n              self.sourceTableColSelectList[target.value()] = target;\n\n              if (target.dataType() === 0 || target.dataType() === 2 || target.dataType() === 3) {\n                self.formulaColSelectList.push(target);\n              }\n            }\n          }\n        }\n\n        self.sourceTableConditionModel().reset();\n        self.sourceFieldFormulas.removeAll();\n        break;\n    }\n  };\n\n  self.fillModel = function (model) {\n    self.fillLists();\n    self.sourceTableId(model.sourceTableId);\n    self.onSelect(\"sourceTableId\");\n    self.sourceTableCondition(model.sourceTableCondition);\n    var translator = new _master_phraseTranslator_js__WEBPACK_IMPORTED_MODULE_2__.PhraseTranslator();\n    var sourceModel = translator.getModel(model.sourceTableCondition);\n    var record = new TableConditionSet(self, \"source\");\n    record.fillModel(sourceModel, model.sourceTableConditionAggregation);\n    self.sourceTableConditionModel(record);\n    if (_h.any(model.sourceFieldFormulas)) for (var i = 0; i < model.sourceFieldFormulas.length; i++) {\n      var rec = new SourceFieldFormula(self);\n      rec.fillModel(model.sourceFieldFormulas[i]);\n      self.sourceFieldFormulas.push(rec);\n    }\n  };\n\n  self.fillEmpty = function (model) {\n    var record = new TableConditionSet(self, \"source\");\n    record.fillEmpty(undefined);\n    self.sourceTableConditionModel(record);\n    self.fillLists();\n  };\n\n  self.fillLists = function () {\n    self.sourceTableSelectList = {};\n\n    for (var i = 0; i < _h.kocnx().ddvm().allTableSelectList().length; i++) {\n      var p = _h.kocnx().ddvm().allTableSelectList()[i];\n\n      self.sourceTableSelectList[p.value()] = p;\n    }\n  };\n\n  self.validationObject = ko.validatedObservable({\n    sourceTableId: self.sourceTableId.extend({\n      required: true\n    }),\n    sourceFieldFormulas: self.sourceFieldFormulas.extend({\n      atleastOnesourceFieldFormulas: true\n    })\n  });\n\n  self.toServer = function () {\n    var array = [];\n    if (_h.any(self.sourceFieldFormulas())) for (var i = 0; i < self.sourceFieldFormulas().length; i++) {\n      var target = self.sourceFieldFormulas()[i];\n      array.push({\n        fieldOrder: target.fieldOrder(),\n        computeType: target.computeType(),\n        value: target.value()\n      });\n    }\n    return {\n      sourceTableId: self.sourceTableId(),\n      sourceFieldFormulas: array,\n      sourceTableCondition: self.sourceTableCondition()\n    };\n  };\n\n  self.addSourceFieldFormula = function () {\n    var rec = new SourceFieldFormula(self);\n    self.sourceFieldFormulas.push(rec);\n  };\n\n  self.showResultBtn = ko.computed(function () {\n    return !_h.isNullOrEmpty(self.sourceTableId());\n  });\n\n  self.validateForm = function () {\n    var array = [];\n\n    for (var p2 in self.validationObject()) {\n      if (self.validationObject().hasOwnProperty(p2)) {\n        var target2 = self.validationObject()[p2];\n        var text;\n\n        try {\n          text = _h.getLocalizedText(p2);\n        } catch (e) {\n          text = undefined;\n        }\n\n        if (!_h.isNullOrEmpty(text) && !_h.isNullOrEmpty(target2.error())) array.push({\n          propName: p2,\n          propFaName: text,\n          error: target2.error()\n        });\n\n        if (_h.isNullOrEmpty(text) && !_h.isNullOrEmpty(target2()) && !_h.isNullOrEmpty(target2()[\"validateForm\"])) {\n          array.push({\n            propName: p2,\n            propFaName: text,\n            children: target2().validateForm()\n          });\n        }\n      }\n    }\n\n    if (self.sourceTableConditionModel().conditions().length > 1) {\n      array.push({\n        propName: \"sourceTableConditionModel\",\n        propFaName: \"شروط مبدا\",\n        children: self.sourceTableConditionModel().validateForm()\n      });\n    }\n\n    return array;\n  };\n}\nfunction DestinationAccountCode(parent) {\n  var self = this;\n  self.parentForm = parent;\n  self.value = ko.observable();\n  self.accountCode = ko.observable();\n  self.accountName = ko.observable();\n  self.withFlow = ko.observable();\n  self.defaultItem = ko.observable();\n\n  self.onSelectAutocomplete = function (name, value) {\n    self.accountCode(value);\n  };\n\n  self.toggleWithFlow = function () {\n    self.withFlow(!self.withFlow());\n  };\n\n  self.fillModel = function (model) {\n    self.value(model.value);\n    self.accountCode(model.accountCode);\n    self.accountName(model.accountName);\n    self.withFlow(model.withFlow);\n    self.defaultItem(model[\"default\"]);\n  };\n}\nfunction ComputationalTableCondition(parent, parentSet, target) {\n  var self = this;\n  self.parentForm = parent;\n  self.parentSet = parentSet;\n  self.target = target;\n  self.leftListName = \"sourceTableColSelectList\";\n  self.leftSideDataType = ko.observable();\n  self.rightSideDataTypes = ko.observableArray([]);\n  self.rightSideDataType = ko.observable();\n  self.rightSide = ko.observable();\n  self.leftSide = ko.observable();\n  self.operator = ko.observable();\n  self.enumItems = {};\n  self.rightSideItems = ko.observableArray();\n\n  self.onSelect = function (controlName) {\n    switch (controlName) {\n      case \"leftSide\":\n        if (!_h.isEmpty(self.leftSide())) {\n          var item = self.parentForm.sourceTableColSelectList[self.leftSide()];\n          self.leftSideDataType(item.dataType());\n        } else {\n          self.leftSideDataType(undefined);\n        }\n\n        self.rightSideDataType(undefined);\n        self.rightSide(undefined);\n        self.operator(undefined);\n        self.parentSet.translatePhrase();\n        break;\n\n      case \"operator\":\n        self.rightSideDataTypes.removeAll();\n        self.rightSideDataType(undefined);\n        self.rightSide(undefined);\n\n        if (!_h.isNullOrEmpty(self.operator())) {\n          switch (self.operator()) {\n            case 1:\n            case 2:\n            case 3:\n            case 4:\n            case 5:\n            case 6:\n              var selected = null;\n\n              for (var i = 0; i < tableconditiondataTypes.length; i++) {\n                if (tableconditiondataTypes[i].value === self.leftSideDataType()) {\n                  selected = tableconditiondataTypes[i];\n                }\n              }\n\n              if (selected && selected.value === 7) self.refreshEnumItems();\n\n              if (self.leftSideDataType() === 0 || self.leftSideDataType() === 2 || self.leftSideDataType() === 3) {\n                self.rightSideDataTypes.push(selected);\n                self.rightSideDataTypes.push(tableconditiondataTypes[15]);\n              } else {\n                self.rightSideDataType(selected.value);\n              }\n\n              break;\n\n            case 7:\n            case 8:\n            case 9:\n            case 10:\n              self.rightSideDataType(13);\n              break;\n\n            case 11:\n              self.rightSideDataType(1);\n              break;\n\n            case 12:\n            case 13:\n              if (!_h.isNullOrEmpty(self.leftSideDataType())) {\n                var dataTypeItem = _h.getEnumItem(dataTypes, self.leftSideDataType());\n\n                switch (dataTypeItem.value) {\n                  case 0:\n                    self.rightSideDataTypes.push(tableconditiondataTypes[0]);\n                    self.rightSideDataTypes.push(tableconditiondataTypes[12]);\n                    break;\n\n                  case 1:\n                    self.rightSideDataType(9);\n                    break;\n\n                  case 4:\n                    self.rightSideDataType(10);\n                    break;\n\n                  case 7:\n                    self.rightSideDataType(12);\n                    self.refreshEnumItems();\n                    break;\n                }\n              }\n\n              break;\n\n            case 14:\n              self.rightSideDataType(15);\n              break;\n\n            case 15:\n            case 16:\n              self.rightSideDataType(20);\n              break;\n          }\n        }\n\n        self.parentSet.translatePhrase();\n        break;\n    }\n  };\n\n  self.filterOperator = function (item) {\n    return item.dataTypes.indexOf(self.leftSideDataType()) !== -1;\n  };\n\n  self.createCondtionPhrase = function () {\n    var ph = \"[table:'\" + self.leftSide() + \"']\";\n    ph += _h.getEnumEnText(dynamicConditionalOperators2, self.operator());\n    var val = self.rightSideDataType();\n    var right = \"\";\n\n    switch (val) {\n      case 0:\n        right = \"int:'\";\n        break;\n\n      case 1:\n        right = \"text:'\";\n        break;\n\n      case 2:\n        right = \"decimal:'\";\n        break;\n\n      case 3:\n        right = \"money:'\";\n        break;\n\n      case 4:\n        right = \"date:'\";\n        break;\n\n      case 7:\n        right = \"enum:'\";\n        break;\n\n      case 8:\n        right = \"table:'\";\n        break;\n\n      case 9:\n        right = \"listtext:'\";\n        break;\n\n      case 10:\n        right = \"listdate:'\";\n        break;\n\n      case 12:\n        right = \"listenum:'\";\n        break;\n\n      case 14:\n        right = \"listint:'\";\n        break;\n\n      case 15:\n        right = \"pattern:'\";\n        break;\n\n      case 20:\n        right = \"likepattern:'\";\n        break;\n\n      case 21:\n        right = \"formula:'\";\n        break;\n\n      case null:\n      case undefined:\n      case \"\":\n      case \"-\":\n      case 13:\n        return ph;\n    }\n\n    if (self.rightSide() !== undefined) ph += \"[\" + right + self.rightSide() + \"']\";else ph += \"[\" + right + \"']\";\n    return ph;\n  };\n\n  self.fillModel = function (model) {\n    if (model) {\n      self.leftSide(Number(model.leftSide));\n\n      if (!_h.isEmpty(self.leftSide())) {\n        var item = self.parentForm.sourceTableColSelectList[self.leftSide()];\n        self.leftSideDataType(item.dataType());\n      }\n\n      self.operator(model.operator.value);\n      self.rightSideDataType(model.rightSide.type);\n      self.rightSide(model.rightSide.value);\n\n      if (model.rightSide.type === 12) {\n        var values = _h.splitStringList(model.rightSide.value);\n\n        self.rightSideItems(values);\n      }\n    }\n  };\n\n  self.rightSide.subscribe(function () {\n    self.parentSet.translatePhrase();\n  });\n\n  self.refreshEnumItems = function () {\n    self.enumItems = {};\n    var keys = Object.keys(self.parentForm.sourceTableColSelectList);\n    if (keys && keys.length) for (var j = 0; j < keys.length; j++) {\n      var k = self.parentForm.sourceTableColSelectList[keys[j]];\n\n      if (k.value() === self.leftSide() && k.enumValues().length) {\n        for (var l = 0; l < k.enumValues().length; l++) {\n          var target = k.enumValues()[l];\n          self.enumItems[target.value()] = target;\n        }\n      }\n    }\n    self.rightSide(undefined);\n  };\n\n  self.rightSideDataType.subscribe(function () {\n    self.parentSet.translatePhrase();\n  });\n  self.rightSideItems.subscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      var value = _h.concatStringList(newValue);\n\n      self.rightSide(value);\n    }\n  });\n  self.validationObject = ko.validatedObservable({\n    rightSide: self.rightSide.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          var hasLeftSideValue = !_h.isNullOrEmpty(self.leftSide()) && self.leftSide() !== \"\";\n          var hasOperatorValue = !_h.isNullOrEmpty(self.operator()) && self.operator() !== \"\";\n          var reqiureVal = !_h.isNullOrEmpty(self.rightSideDataType()) && self.rightSideDataType() !== \"\" && self.rightSideDataType() !== 13;\n          return (hasLeftSideValue || hasOperatorValue) && reqiureVal;\n        }\n      }\n    }),\n    operator: self.operator.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          return !_h.isNullOrEmpty(self.leftSide()) && self.leftSide() !== \"\";\n        }\n      }\n    })\n  });\n\n  self.reset = function () {\n    self.leftSide(undefined);\n    self.leftSideDataType(undefined);\n    self.operator(undefined);\n    self.rightSideDataType(undefined);\n    self.rightSide(undefined);\n  };\n\n  self.onChangeFormula = function (value, name) {\n    self.rightSide(value);\n  };\n}\nfunction SourceFieldFormula(parent) {\n  var self = this;\n  self.parentForm = parent;\n  self.fieldOrder = ko.observable();\n  self.value = ko.observable();\n  self.values = ko.observableArray();\n  self.computeType = ko.observable();\n  self.leftFilterTypes = [];\n\n  self.onSelect = function (controlName) {\n    var item, target;\n\n    switch (controlName) {\n      case \"fieldOrder\":\n        self.computeType(undefined);\n        self.value(undefined);\n        break;\n\n      case \"computeType\":\n        item = self.parentForm.sourceTableColSelectList[self.fieldOrder()];\n\n        if (self.computeType() === 1) {\n          switch (item.dataType()) {\n            case 0:\n              self.leftFilterTypes = [0];\n              break;\n\n            case 2:\n              self.leftFilterTypes = [2];\n              break;\n\n            case 3:\n              self.leftFilterTypes = [3];\n              break;\n\n            case 1:\n              self.leftFilterTypes = [0, 1, 2, 3];\n              break;\n          }\n        }\n\n        self.value(undefined);\n        break;\n    }\n  };\n\n  self.fillModel = function (model) {\n    self.fieldOrder(model.fieldOrder);\n    self.computeType(model.computeType);\n    self.onSelect(\"computeType\");\n\n    switch (model.computeType) {\n      case 0:\n        self.value(model.value);\n        break;\n\n      case 1:\n        if (_h.any(model.value) && model.computeType === 1) for (var i = 0; i < model.value.length; i++) {\n          self.values.push(model.value[i]);\n        }\n        break;\n    }\n  };\n\n  self.values.subscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      self.value(newValue);\n    } else {\n      self.value(undefined);\n    }\n  });\n\n  self.onChangeFormula = function (value, name) {\n    self.value(value);\n  };\n\n  self.filterLeft = function (item) {\n    return self.leftFilterTypes.indexOf(item.dataType) !== -1;\n  };\n}\nfunction TableConditionOperator(model) {\n  var self = this;\n  self.id = model.id;\n  self.text = model.text;\n  self.data = model.data;\n  self.after = model.after;\n  self.enabled = ko.observable(false);\n}\nfunction SourceTableData(model) {\n  var self = this;\n  self.selected = ko.observable(false);\n  self.id = ko.observable(model.id);\n  self.stateType = ko.observable(model.stateType);\n\n  for (var j = 0; j < model.cells.length; j++) {\n    var field = model.cells[j];\n    self[field.order] = field.value;\n  }\n\n  self.createTagId = ko.pureComputed(function () {\n    return \"SourceTableTD-\" + self.id();\n  });\n  self.styleRowValue = ko.pureComputed(function () {\n    if (self.stateType() === 0) return 'color: #ccc;';\n    return '';\n  });\n}\nfunction SourceTableDataViewModel(dataModel) {\n  var self = this;\n  self.caption = ko.observable();\n  self.clickCounter = ko.observable(0);\n  self.hasDetailPart = ko.observable(true);\n  self.dataModel = dataModel;\n\n  self.init = function () {\n    self.tableName(self.dataModel.sourceTable.text());\n    self.tableCode(self.dataModel.sourceTable.code());\n    self.sourceTableId(self.dataModel.sourceTable.value());\n    self.sourceTableCondition(self.dataModel.sourceTableCondition);\n    self.dynamicDocumentType(self.dataModel.type);\n\n    switch (self.dataModel.type) {\n      case 1:\n        self.caption(_h.getLocalizedText(\"sourceTable\"));\n        self.hasDetailPart(false);\n        break;\n\n      case 4:\n        self.caption(_h.getLocalizedText(\"calculationTable\"));\n        self.sourcePeriodId(self.dataModel.sourcePeriodId);\n        self.calculationPeriodId(self.dataModel.calculationPeriodId);\n        break;\n\n      default:\n        self.caption(_h.getLocalizedText(\"expenseCenterTable\"));\n        self.treeId(self.dataModel.treeId);\n        self.nodeIdList(self.dataModel.nodeIdList);\n        self.documentCode(self.dataModel.documentCode);\n        break;\n    }\n\n    self.fillTableProperties();\n    self.getRecords();\n  };\n\n  self.createExcelFileBtn = function () {\n    var filterModel = self.createFilterByModel();\n    var cols = [];\n    ko.utils.arrayFilter(self.tableProperties(), function (item) {\n      if (item.visibleCol()) cols.push(item.name);\n    });\n    var model = {\n      controllerName: 50,\n      inputData: filterModel\n    };\n    model.inputData.columns = cols;\n\n    _h.kocnx().createExcel(model);\n  };\n\n  self.createFiltersList = function () {\n    var array;\n\n    switch (self.dataModel.type) {\n      case 1:\n        array = [{\n          name: \"sourceTableId\"\n        }, {\n          name: \"sourceTableCondition\"\n        }, {\n          name: \"dynamicDocumentType\"\n        }];\n        break;\n\n      case 4:\n        array = [{\n          name: \"sourceTableId\"\n        }, {\n          name: \"sourceTableCondition\"\n        }, {\n          name: \"sourcePeriodId\"\n        }, {\n          name: \"calculationPeriodId\"\n        }, {\n          name: \"dynamicDocumentType\"\n        }];\n        break;\n\n      default:\n        array = [{\n          name: \"sourceTableId\"\n        }, {\n          name: \"documentCode\"\n        }, {\n          name: \"sourceTableCondition\"\n        }, {\n          name: \"treeId\"\n        }, {\n          name: \"nodeIdList\",\n          type: \"list\"\n        }, {\n          name: \"dynamicDocumentType\"\n        }];\n        break;\n    }\n\n    return array;\n  };\n\n  self.createColList = function () {\n    var table = self.dataModel.sourceTable;\n    var array = [];\n\n    if (!_h.isNullOrEmpty(table.fields())) {\n      var objId = {\n        fa: '#',\n        colName: 'id',\n        tablecol: false,\n        visibleCol: false,\n        sortDir: \"None\",\n        alias: null,\n        type: \"template\",\n        templateName: \"checkbox-table-template\"\n      };\n      array.push(objId);\n\n      for (var i = 0; i < table.fields().length; i++) {\n        var field = table.fields()[i];\n        var obj = {\n          fa: field.text(),\n          colName: field.value().toString(),\n          tablecol: true,\n          visibleCol: true,\n          sortDir: \"None\",\n          alias: null,\n          type: \"string\"\n        };\n        if (i === 0) obj.sortDir = \"Ascending\";\n        if (i === 0 || i === 1 || i === 2) obj.visibleItem = true;\n        array.push(obj);\n      }\n    }\n\n    return array;\n  };\n\n  self.changeChildModel = function (target) {\n    if (!self.dataModel.expenseCenterTable || _h.isNullOrEmpty(self.dataModel.expenseCenterTable.value())) {\n      self.hasDetailPart(false);\n      self.showType(\"Table\");\n      self.showBlockType(\"fullMaster\");\n      self.iconSize(\"icon-image\");\n      return;\n    }\n\n    if (self.dataModel.type === 1) return;\n    var model = new ExpenseCenterTableDataViewModel(self.dataModel);\n    model.tableName(self.dataModel.expenseCenterTable.text());\n    model.tableCode(self.dataModel.expenseCenterTable.code());\n    model.sourceTableId(self.dataModel.sourceTable.value());\n    model.sourceTableCondition(self.dataModel.sourceTableCondition);\n    model.sourceRowId(target.id());\n    var warning = false;\n\n    switch (self.dataModel.type) {\n      case 4:\n        model.calculationTableId(self.dataModel.expenseCenterTable.value());\n        model.calculationTableCondition(self.dataModel.expenseCenterTableCondition);\n        model.sourcePeriodId(self.dataModel.sourcePeriodId);\n        model.calculationPeriodId(self.dataModel.calculationPeriodId);\n\n        if (!_h.isNullOrEmpty(model.calculationTableId())) {\n          self.childModel(model);\n          self.childModel().init();\n        } else {\n          warning = true;\n        }\n\n        break;\n\n      default:\n        model.documentCode(self.dataModel.documentCode);\n        model.treeId(self.dataModel.treeId);\n        model.nodeIdList(self.dataModel.nodeIdList);\n        if (_h.any(self.dataModel.destinationAccountCodes)) for (var i = 0; i < self.dataModel.destinationAccountCodes.length; i++) {\n          var targetp = self.dataModel.destinationAccountCodes[i];\n          model.destinationAccountCodes.push({\n            value: targetp.value(),\n            accountCode: targetp.accountCode(),\n            withFlow: targetp.withFlow(),\n            \"default\": targetp.defaultItem()\n          });\n        }\n        model.expenseCenterTableId(self.dataModel.expenseCenterTable.value());\n        model.expenseCenterTableCondition(self.dataModel.expenseCenterTableCondition);\n\n        if (!_h.isNullOrEmpty(self.dataModel.expenseCenterTable.value())) {\n          self.childModel(model);\n          self.childModel().init();\n        } else {\n          warning = true;\n        }\n\n        break;\n    }\n\n    if (warning && self.clickCounter() < 2) {\n      self.clickCounter(self.clickCounter() + 1);\n\n      var text = _h.getApiMessage(\"ShowExpenseCenterTableCondition\");\n\n      _h.failToast(text);\n    }\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"SourceTableData\",\n    apiService: {\n      actionList: []\n    },\n    buttons: [{\n      name: 'createExcelFile',\n      access: false,\n      icon: 'ExportExcel',\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }],\n    filters: self.createFiltersList(),\n    sortDirection: \"Ascending\",\n    sortProperty: \"\",\n    context: self,\n    dynamicCols: true,\n    cols: self.createColList(),\n    extraParams: [],\n    getList: true,\n    searchKeyType: \"enter\",\n    styleRow: \"styleRowValue\",\n    tableClass: \"table ko-tbl ko-tbl-master\",\n    tableStyle: \"width: 200%; margin-top: 10px; table-layout: initial;font-size:11px;white-space: nowrap;\",\n    saveState: false,\n    selectRow: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    self.visrefresh(true);\n    self.vistools(true);\n    self.viscreateExcelFile(true);\n  });\n}\nfunction ExpenseCenterTableData(model) {\n  var self = this;\n  self.selected = ko.observable(false);\n  self.id = ko.observable(model.id);\n  self.stateType = ko.observable(model.stateType);\n\n  for (var j = 0; j < model.cells.length; j++) {\n    var field = model.cells[j];\n    self[field.order] = field.value;\n  }\n\n  self.createTagId = ko.pureComputed(function () {\n    return \"ExpenseCenterTD-\" + self.id();\n  });\n  self.styleRowValue = ko.pureComputed(function () {\n    if (self.stateType() === 0) return 'color: #ccc;';\n    return '';\n  });\n}\nfunction ExpenseCenterTableDataViewModel(dataModel) {\n  var self = this;\n  self.dataModel = dataModel;\n\n  self.createExcelFileBtn = function () {\n    var filterModel = self.createFilterByModel();\n    var cols = [];\n    ko.utils.arrayFilter(self.tableProperties(), function (item) {\n      if (item.visibleCol()) cols.push(item.name);\n    });\n    var model = {\n      controllerName: 50,\n      inputData: filterModel\n    };\n    model.inputData.columns = cols;\n\n    _h.kocnx().createExcel(model);\n  };\n\n  self.createFiltersList = function () {\n    var array;\n\n    if (self.dataModel.type !== 4) {\n      array = [{\n        name: \"sourceTableId\"\n      }, {\n        name: \"documentCode\"\n      }, {\n        name: \"sourceTableCondition\"\n      }, {\n        name: \"treeId\"\n      }, {\n        name: \"nodeIdList\",\n        type: \"list\"\n      }, {\n        name: \"expenseCenterTableId\"\n      }, {\n        name: \"expenseCenterTableCondition\"\n      }, {\n        name: \"sourceRowId\"\n      }, {\n        name: \"destinationAccountCodes\",\n        type: \"list\"\n      }];\n    } else {\n      array = [{\n        name: \"sourceTableId\"\n      }, {\n        name: \"sourceTableCondition\"\n      }, {\n        name: \"calculationTableId\"\n      }, {\n        name: \"calculationTableCondition\"\n      }, {\n        name: \"sourceRowId\"\n      }, {\n        name: \"sourcePeriodId\"\n      }, {\n        name: \"calculationPeriodId\"\n      }];\n    }\n\n    return array;\n  };\n\n  self.createColList = function () {\n    var table = self.dataModel.expenseCenterTable;\n    var array = [];\n\n    if (!_h.isNullOrEmpty(table.fields())) {\n      var objId = {\n        fa: '#',\n        colName: 'id',\n        tablecol: false,\n        visibleCol: false,\n        sortDir: \"None\",\n        alias: null,\n        type: \"template\",\n        templateName: \"checkbox-table-template\"\n      };\n      array.push(objId);\n\n      for (var i = 0; i < table.fields().length; i++) {\n        var field = table.fields()[i];\n        var obj = {\n          fa: field.text(),\n          colName: field.value().toString(),\n          tablecol: true,\n          visibleCol: true,\n          sortDir: \"None\",\n          alias: null,\n          type: \"string\"\n        };\n        if (i === 0) obj.sortDir = \"Ascending\";\n        array.push(obj);\n      }\n    }\n\n    return array;\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"ExpenseCenterTableData\",\n    apiService: {\n      actionList: []\n    },\n    buttons: [{\n      name: 'createExcelFile',\n      access: false,\n      icon: 'ExportExcel',\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }],\n    filters: self.createFiltersList(),\n    sortDirection: \"\",\n    sortProperty: \"\",\n    context: self,\n    dynamicCols: true,\n    cols: self.createColList(),\n    extraParams: [],\n    saveState: true,\n    searchKeyType: \"enter\",\n    tableClass: \"table ko-tbl ko-tbl-child\",\n    styleRow: \"styleRowValue\",\n    tableStyle: \"width: 200%; margin-top: 10px; table-layout: initial;font-size:11px;white-space: nowrap;\",\n    getList: true,\n    selectRow: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    self.vistools(true);\n    self.visrefresh(true);\n    self.viscreateExcelFile(true);\n  });\n}\n$(document).on(\"shown.bs.tab\", '.dynamic-document-tab a[data-toggle=\"tab\"]', function () {\n  return false;\n});\nfunction AggregationDocumentProperties(parent) {\n  var self = this;\n  self.parentForm = parent;\n  self.sourceTableId = ko.observable();\n  self.destinationCalculationType = ko.observable();\n  self.sourceTableCondition = ko.observable();\n  self.sourceTableConditionModel = ko.observable();\n  self.calculationTableId = ko.observable();\n  self.calculationTableCondition = ko.observable();\n  self.calculationTableConditionModel = ko.observable();\n  self.destinationTableId = ko.observable();\n  self.destinationTableCondition = ko.observable();\n  self.destinationTableConditionModel = ko.observable();\n  self.sourcePeriodId = ko.observable();\n  self.calculationPeriodId = ko.observable();\n  self.destinationValues = ko.observableArray();\n  self.destinationKeys = ko.observableArray();\n  self.sourceTableSelectList = {};\n  self.calculationTableSelectList = {};\n  self.destinationTableSelectList = {};\n  self.sourceTableColSelectList = {};\n  self.calculationTableColSelectList = {};\n  self.destinationTableColSelectList = {};\n\n  self.onSelect = function (controlName) {\n    var item, target;\n\n    switch (controlName) {\n      case \"sourceTableId\":\n        self.sourceTableColSelectList = {};\n\n        if (self.sourceTableId()) {\n          item = self.sourceTableSelectList[self.sourceTableId()];\n\n          if (_h.any(item.fields())) {\n            for (var i = 0; i < item.fields().length; i++) {\n              target = item.fields()[i];\n              self.sourceTableColSelectList[target.value()] = target;\n            }\n          }\n        }\n\n        self.sourceTableConditionModel().reset();\n        self.calculationTableConditionModel().reset();\n        self.refreshDestinationValues(\"source\");\n        self.destinationTableConditionModel().reset(\"source\");\n        break;\n\n      case \"calculationTableId\":\n        self.calculationTableColSelectList = {};\n\n        if (self.calculationTableId()) {\n          item = self.calculationTableSelectList[self.calculationTableId()];\n\n          if (_h.any(item.fields())) {\n            for (var k = 0; k < item.fields().length; k++) {\n              target = item.fields()[k];\n              self.calculationTableColSelectList[target.value()] = target;\n            }\n          }\n        }\n\n        self.calculationTableConditionModel().reset();\n        self.destinationTableConditionModel().reset(\"calculation\");\n        self.refreshDestinationValues(\"calculation\");\n        break;\n\n      case \"destinationTableId\":\n        self.destinationTableColSelectList = {};\n\n        if (self.destinationTableId()) {\n          item = self.destinationTableSelectList[self.destinationTableId()];\n\n          if (_h.any(item.fields())) {\n            for (var l = 0; l < item.fields().length; l++) {\n              target = item.fields()[l];\n              self.destinationTableColSelectList[target.value()] = target;\n            }\n          }\n        }\n\n        self.destinationTableConditionModel().reset();\n        self.destinationValues.removeAll();\n        self.destinationKeys.removeAll();\n        break;\n    }\n  };\n\n  self.destinationKeyFilter = function (item) {\n    return self.destinationCalculationType() === 1;\n  };\n\n  self.fillEmpty = function () {\n    self.fillLists();\n    self.destinationCalculationType(1);\n    var record = new TableConditionSet(self, \"source\");\n    record.fillEmpty(undefined);\n    self.sourceTableConditionModel(record);\n    record = new TableConditionSet(self, \"calculation\");\n    record.fillEmpty(undefined);\n    self.calculationTableConditionModel(record);\n    record = new TableConditionSet(self, \"destination\");\n    record.fillEmpty(undefined);\n    self.destinationTableConditionModel(record);\n  };\n\n  self.fillModel = function (model) {\n    self.fillLists();\n    self.sourceTableId(model.sourceTableId);\n    self.onSelect(\"sourceTableId\");\n    self.calculationTableId(model.calculationTableId);\n    self.onSelect(\"calculationTableId\");\n    self.destinationTableId(model.destinationTableId);\n    self.onSelect(\"destinationTableId\");\n    self.destinationCalculationType(model.destinationCalculationType);\n    self.onSelect(\"destinationCalculationType\");\n    self.sourceTableCondition(model.sourceTableCondition);\n    self.calculationTableCondition(model.calculationTableCondition);\n    self.destinationTableCondition(model.destinationTableCondition);\n    var translator = new _master_phraseTranslator_js__WEBPACK_IMPORTED_MODULE_2__.PhraseTranslator();\n    var sourceModel = translator.getModel(model.sourceTableCondition);\n    var calculationModel = translator.getModel(model.calculationTableCondition);\n    var destinationModel = translator.getModel(model.destinationTableCondition);\n    var record = new TableConditionSet(self, \"source\");\n    record.fillModel(sourceModel, model.sourceTableConditionAggregation);\n    self.sourceTableConditionModel(record);\n    record = new TableConditionSet(self, \"calculation\");\n    record.fillModel(calculationModel, model.calculationConditionAggregation);\n    self.calculationTableConditionModel(record);\n    record = new TableConditionSet(self, \"destination\");\n    record.fillModel(destinationModel, model.destinationConditionAggregation);\n    self.destinationTableConditionModel(record);\n    if (_h.any(model.destinationValues)) for (var i = 0; i < model.destinationValues.length; i++) {\n      var rec = new DestinationValueProperty(self);\n      rec.fillModel(model.destinationValues[i]);\n      self.destinationValues.push(rec);\n    }\n    self.destinationKeys(model.destinationKeys);\n    self.sourcePeriodId(model.sourcePeriodId);\n    self.calculationPeriodId(model.calculationPeriodId);\n  };\n\n  self.fillLists = function () {\n    self.sourceTableSelectList = {};\n    self.destinationTableSelectList = {};\n    self.calculationTableSelectList = {};\n\n    for (var i = 0; i < _h.kocnx().ddvm().allTableSelectList().length; i++) {\n      var p = _h.kocnx().ddvm().allTableSelectList()[i];\n\n      self.sourceTableSelectList[p.value()] = p;\n      self.destinationTableSelectList[p.value()] = p;\n      self.calculationTableSelectList[p.value()] = p;\n    }\n  };\n\n  self.validationObject = ko.validatedObservable({\n    sourceTableId: self.sourceTableId.extend({\n      required: true\n    }),\n    destinationTableId: self.destinationTableId.extend({\n      required: true\n    }),\n    destinationCalculationType: self.destinationCalculationType.extend({\n      required: true\n    }),\n    destinationValues: self.destinationValues.extend({\n      atleastOneDestinationValues: true\n    })\n  });\n\n  self.refreshDestinationValues = function (loc) {\n    if (_h.any(self.destinationValues())) for (var i = 0; i < self.destinationValues().length; i++) {\n      var target = self.destinationValues()[i];\n      if (loc === \"source\" && target.calculationValueType() === 3) target.resetValue(\"source\");\n      if (loc === \"calculation\" && target.calculationValueType() === 4) target.resetValue(\"calculation\");\n    }\n  };\n\n  self.addDestinationValue = function () {\n    var rec = new DestinationValueProperty(self);\n    self.destinationValues.push(rec);\n  };\n\n  self.showResultBtn = ko.computed(function () {\n    return !_h.isNullOrEmpty(self.sourceTableId());\n  });\n\n  self.toServer = function () {\n    var dValues = [];\n\n    for (var i = 0; i < self.destinationValues().length; i++) {\n      var target = self.destinationValues()[i];\n      dValues.push({\n        destinationField: target.destinationField(),\n        calculationValueType: target.calculationValueType(),\n        value: target.value(),\n        valueFrom: target.valueFrom(),\n        valueTo: target.valueTo()\n      });\n    }\n\n    return {\n      sourceTableId: self.sourceTableId(),\n      sourceTableCondition: self.sourceTableCondition(),\n      calculationTableId: self.calculationTableId(),\n      calculationTableCondition: self.calculationTableCondition(),\n      destinationTableId: self.destinationTableId(),\n      destinationTableCondition: self.destinationTableCondition(),\n      destinationValues: dValues,\n      destinationCalculationType: self.destinationCalculationType(),\n      destinationKeys: self.destinationKeys(),\n      sourcePeriodId: self.sourcePeriodId(),\n      calculationPeriodId: self.calculationPeriodId()\n    };\n  };\n\n  self.validateForm = function () {\n    var array = [];\n\n    for (var p2 in self.validationObject()) {\n      if (self.validationObject().hasOwnProperty(p2)) {\n        var target2 = self.validationObject()[p2];\n        var text;\n\n        try {\n          text = _h.getLocalizedText(p2);\n\n          if (p2 === \"destinationValues\") {\n            text = \"مقادیر مقصد\";\n          }\n        } catch (e) {\n          text = undefined;\n        }\n\n        if (!_h.isNullOrEmpty(text) && !_h.isNullOrEmpty(target2.error())) array.push({\n          propName: p2,\n          propFaName: text,\n          error: target2.error()\n        });\n\n        if (_h.isNullOrEmpty(text) && !_h.isNullOrEmpty(target2()) && !_h.isNullOrEmpty(target2()[\"validateForm\"])) {\n          array.push({\n            propName: p2,\n            propFaName: text,\n            children: target2().validateForm()\n          });\n        }\n      }\n    }\n\n    var errors;\n\n    if (self.sourceTableConditionModel().conditions().length > 1) {\n      errors = self.sourceTableConditionModel().validateForm();\n      if (errors.length) array.push({\n        propName: \"sourceTableConditionModel\",\n        propFaName: \"شروط مبدا\",\n        children: errors\n      });\n    }\n\n    if (self.calculationTableConditionModel().conditions().length > 1) {\n      errors = self.calculationTableConditionModel().validateForm();\n      if (errors.length) array.push({\n        propName: \"calculationTableConditionModel\",\n        propFaName: \"شروط محاسبات\",\n        children: errors\n      });\n    }\n\n    if (self.destinationTableConditionModel().conditions().length > 1) {\n      errors = self.destinationTableConditionModel().validateForm();\n      if (errors.length) array.push({\n        propName: \"destinationTableConditionModel\",\n        propFaName: \"شروط مقصد\",\n        children: errors\n      });\n    }\n\n    return array;\n  };\n}\nfunction DestinationValueProperty(parent) {\n  var self = this;\n  self.parentForm = parent;\n  self.destinationField = ko.observable();\n  self.destinationFieldDataType = ko.observable();\n  self.calculationValueType = ko.observable();\n  self.value = ko.observable();\n  self.leftCaption = ko.observable();\n  self.leftState = ko.observable(false);\n  self.leftControl = ko.observable();\n  self.valueFrom = ko.observable();\n  self.valueTo = ko.observable();\n\n  self.onSelect = function (controlName) {\n    switch (controlName) {\n      case \"destinationField\":\n        var item = self.parentForm.destinationTableColSelectList[self.destinationField()];\n        if (item) self.destinationFieldDataType(item.dataType());\n        self.leftState(false);\n        self.leftControl(0);\n        self.calculationValueType(undefined);\n        self.value(\"\");\n        break;\n\n      case \"calculationValueType\":\n        switch (self.calculationValueType()) {\n          case 1:\n          case 2:\n            self.leftState(false);\n            self.leftControl(0);\n            break;\n\n          case 3:\n            self.leftCaption(\"جدول مبدا\");\n            self.leftState(true);\n            self.leftControl(1);\n            if (_h.isNullOrEmpty(self.value())) self.value(null);\n            break;\n\n          case 4:\n          case 5:\n          case 6:\n          case 8:\n          case 9:\n            self.leftCaption(\"جدول محاسبات\");\n            self.leftControl(3);\n            self.leftState(true);\n            if (_h.isNullOrEmpty(self.value())) self.value(null);\n            break;\n\n          case 7:\n            self.leftControl(2);\n            self.leftState(true);\n            self.leftCaption(\"مقدار\");\n            break;\n        }\n\n        break;\n    }\n  };\n\n  self.filterCalculationValueType = function (item) {\n    if (item.dataTypes.indexOf(self.destinationFieldDataType()) !== -1) return true;\n    if (item.value === 1 && self.parentForm.destinationCalculationType() === 1) return true;\n    return false;\n  };\n\n  self.filterValue = function (item) {\n    if (self.destinationFieldDataType() === item.dataType) {\n      return true;\n    }\n\n    return false;\n  };\n\n  self.fillModel = function (model) {\n    self.destinationField(model.destinationField);\n    self.onSelect(\"destinationField\");\n    var item = self.parentForm.destinationTableColSelectList[self.destinationField()];\n    if (item) self.destinationFieldDataType(item.dataType());\n    self.calculationValueType(model.calculationValueType);\n    self.onSelect(\"calculationValueType\");\n    self.value(model.value);\n    self.valueFrom(model.valueFrom);\n    self.valueTo(model.valueTo);\n  };\n\n  self.showFunctionsBtn = ko.computed(function () {\n    if (!_h.isNullOrEmpty(self.destinationField()) && (self.calculationValueType() === 3 || self.calculationValueType() === 4)) {\n      var item = self.parentForm.destinationTableColSelectList[self.destinationField()];\n      return item.dataType() === 1;\n    }\n\n    return false;\n  });\n\n  self.resetValue = function () {\n    self.value(undefined);\n  };\n}\nfunction ApportionmentDocumentProperties(parent) {\n  var self = this;\n  self.parentForm = parent;\n  self.effectiveDate = ko.observable();\n  self.sourceTableId = ko.observable();\n  self.sourceTableCondition = ko.observable();\n  self.sourceTableConditionModel = ko.observable();\n  self.treeId = ko.observable();\n  self.nodeIdList = ko.observableArray();\n  self.nodes = ko.observableArray();\n  self.expenseCenterTableId = ko.observable();\n  self.expenseCenterTableCondition = ko.observable();\n  self.expenseCenterTableConditionModel = ko.observable();\n  self.apportionBase = ko.observable();\n  self.destinationTableId = ko.observable();\n  self.otherFields = ko.observableArray();\n  self.destinationAccountCodes = ko.observableArray();\n  self.referenceColumn = ko.observable();\n  self.apportionAccountType = ko.observable();\n\n  self.onSelect = function (controlName) {\n    var item, target;\n\n    switch (controlName) {\n      case \"sourceTableId\":\n        if (self.sourceTableId()) {\n          item = self.sourceTableSelectList[self.sourceTableId()];\n          self.sourceTableColSelectList = {};\n\n          if (item && _h.any(item.fields())) {\n            for (var i = 0; i < item.fields().length; i++) {\n              target = item.fields()[i];\n              self.sourceTableColSelectList[target.value()] = target;\n            }\n          }\n        }\n\n        self.sourceTableConditionModel().reset();\n        self.expenseCenterTableConditionModel().reset();\n        self.checkotherFieldsSource();\n        break;\n\n      case \"expenseCenterTableId\":\n        item = self.expenseCenterTableSelectList[self.expenseCenterTableId()];\n\n        if (!_h.isNullOrEmpty(item)) {\n          self.expenseCenterTableColSelectList = {};\n          self.apportionBaseTableSelectList = {};\n          self.apportionBaseTableSelectList[0] = new _master_model_js__WEBPACK_IMPORTED_MODULE_1__.ColumnSelectItem({\n            text: \"تساوی\",\n            value: 0,\n            primary: false,\n            dataType: 10\n          });\n\n          if (item && _h.any(item.fields())) {\n            for (var k = 0; k < item.fields().length; k++) {\n              target = item.fields()[k];\n              self.expenseCenterTableColSelectList[target.value()] = target;\n              if (target.dataType() === 0 || target.dataType() === 2 || target.dataType() === 3) self.apportionBaseTableSelectList[target.value()] = target;\n            }\n          }\n        }\n\n        if (self.destinationAccountCodes().length > 1) {\n          var defItem1 = self.destinationAccountCodes()[0];\n          self.destinationAccountCodes.removeAll();\n          self.destinationAccountCodes.push(defItem1);\n        }\n\n        self.expenseCenterTableConditionModel().reset();\n        self.checkotherFieldsSource();\n        break;\n\n      case \"destinationTableId\":\n        if (self.destinationTableId()) {\n          item = self.destinationTableSelectList[self.destinationTableId()];\n          self.destinationTableColSelectList = {};\n\n          if (_h.any(item.fields())) {\n            for (var j = 0; j < item.fields().length; j++) {\n              target = item.fields()[j];\n              self.destinationTableColSelectList[target.value()] = target;\n            }\n          }\n        }\n\n        self.otherFields.removeAll();\n        self.checkotherFieldsSource();\n        break;\n    }\n  };\n\n  self.fillModel = function (model) {\n    self.fillLists();\n    self.effectiveDate(model.effectiveDate);\n    self.sourceTableId(model.sourceTableId);\n    self.onSelect(\"sourceTableId\");\n    self.expenseCenterTableId(model.expenseCenterTableId);\n    self.onSelect(\"expenseCenterTableId\");\n    self.sourceTableCondition(model.sourceTableCondition);\n    self.expenseCenterTableCondition(model.expenseCenterTableCondition);\n    self.destinationTableId(model.destinationTableId);\n    self.onSelect(\"destinationTableId\");\n    if (_h.isNullOrEmpty(model.referenceColumn) || model.referenceColumn === 0) self.referenceColumn(null);else {\n      self.referenceColumnsub.suspend();\n      self.referenceColumn(model.referenceColumn);\n      self.referenceColumnsub.unsuspend();\n    }\n    self.treeId(model.treeId);\n    self.nodeIdList(model.nodeIdList);\n    self.nodes(model.nodes);\n    self.apportionBase(model.apportionBase);\n    var translator = new _master_phraseTranslator_js__WEBPACK_IMPORTED_MODULE_2__.PhraseTranslator();\n    var sourceModel = translator.getModel(model.sourceTableCondition);\n    var expenseModel = translator.getModel(model.expenseCenterTableCondition);\n    var record = new TableConditionSet(self, \"source\");\n    record.fillModel(sourceModel, model.sourceTableConditionAggregation);\n    self.sourceTableConditionModel(record);\n    record = new TableConditionSet(self, \"expenseCenter\");\n    record.fillModel(expenseModel, model.expenseTableConditionAggregation);\n    self.expenseCenterTableConditionModel(record);\n    self.destinationAccountCodes.removeAll();\n    if (_h.any(model.destinationAccountCodes)) for (var i = 0; i < model.destinationAccountCodes.length; i++) {\n      var desacc = new DestinationAccountCode(self);\n      desacc.fillModel(model.destinationAccountCodes[i]);\n      self.destinationAccountCodes.push(desacc);\n    } else {\n      var defRec = new DestinationAccountCode(self);\n      defRec.defaultItem(true);\n      defRec.value(\"پیش فرض\");\n      self.destinationAccountCodes.push(defRec);\n    }\n\n    if (_h.any(model.otherFields)) {\n      for (var j = 0; j < model.otherFields.length; j++) {\n        var tag = new DestinationFieldProperties(self);\n        tag.fillModel(model.otherFields[j]);\n        self.otherFields.push(tag);\n      }\n\n      self.checkotherFieldsSource();\n    }\n\n    self.apportionAccountType(model.apportionAccountType);\n  };\n\n  self.addDestinationAccountCode = function () {\n    var record = new DestinationAccountCode(self);\n    record.defaultItem(false);\n    self.destinationAccountCodes.push(record);\n  };\n\n  self.removeDestinationAccountCode = function (item) {\n    if (!item.defaultItem()) self.destinationAccountCodes.remove(item);\n  };\n\n  self.fillEmpty = function () {\n    var activePeriod = _h.kocnx().periodItem();\n\n    self.effectiveDate(activePeriod.te);\n    self.fillLists();\n    var record = new TableConditionSet(self, \"source\");\n    record.fillEmpty(undefined);\n    self.sourceTableConditionModel(record);\n    record = new TableConditionSet(self, \"expenseCenter\");\n    record.fillEmpty(undefined);\n    self.expenseCenterTableConditionModel(record);\n    self.apportionAccountType(0);\n    var defRec = new DestinationAccountCode(self);\n    defRec.defaultItem(true);\n    defRec.value(\"پیش فرض\");\n    self.destinationAccountCodes.push(defRec);\n  };\n\n  self.onNodeSelect = function (name, list) {\n    self.nodeIdList.removeAll();\n    self.nodes.removeAll();\n    if (_h.any(list)) for (var i = 0; i < list.length; i++) {\n      self.nodeIdList.push(list[i].value);\n      self.nodes.push(list[i]);\n    }\n  };\n\n  self.sourceTableSelectList = {};\n  self.destinationTableSelectList = {};\n  self.apportionBaseTableSelectList = {};\n  self.expenseCenterTableSelectList = {};\n  self.sourceTableColSelectList = {};\n  self.expenseCenterTableColSelectList = {};\n  self.destinationTableColSelectList = {};\n\n  self.fillLists = function () {\n    self.sourceTableSelectList = {};\n    self.destinationTableSelectList = {};\n    self.expenseCenterTableSelectList = {};\n    if (self.parentForm.dynamicDocumentType() === 3) self.destinationTableSelectList[\"\"] = {\n      text: \"هیچکدام\",\n      value: \"\",\n      tableRole: 0\n    };\n\n    for (var i = 0; i < _h.kocnx().ddvm().allTableSelectList().length; i++) {\n      var p = _h.kocnx().ddvm().allTableSelectList()[i];\n\n      if (p.tableRole() === 1 || p.tableRole() === 2) self.sourceTableSelectList[p.value()] = p;\n      if (p.tableRole() === 2) self.destinationTableSelectList[p.value()] = p;\n      if (p.tableRole() === 3) self.expenseCenterTableSelectList[p.value()] = p;\n    }\n  };\n\n  self.referenceColumnsub = self.referenceColumn.supsendableSubscribe(function (newValue) {\n    if (newValue !== undefined && newValue !== null) {\n      if (self.destinationAccountCodes().length > 1) {\n        var defItem = self.destinationAccountCodes()[0];\n        self.destinationAccountCodes.removeAll();\n        self.destinationAccountCodes.push(defItem);\n      }\n    }\n\n    if (newValue === undefined || newValue === null) {\n      if (self.destinationAccountCodes().length > 1) {\n        var defItem1 = self.destinationAccountCodes()[0];\n        self.destinationAccountCodes.removeAll();\n        self.destinationAccountCodes.push(defItem1);\n      }\n    }\n  });\n\n  self.addOtherField = function () {\n    var model = new DestinationFieldProperties(self);\n    model.fillEmpty(self.sourceTableId(), self.expenseCenterTableId());\n    self.otherFields.push(model);\n  };\n\n  self.removeOtherField = function (item) {\n    self.otherFields.remove(item);\n  };\n\n  self.otherFieldsSourceSelectList = ko.observableArray();\n\n  self.checkotherFieldsSource = function () {\n    if (self.otherFieldsSourceSelectList().length > 0) self.otherFieldsSourceSelectList.removeAll();\n    var hasSourceValue = !_h.isNullOrEmpty(self.sourceTableId()) && self.sourceTableId() !== \"\";\n    var hasexpenseCenterValue = !_h.isNullOrEmpty(self.expenseCenterTableId()) && self.expenseCenterTableId() !== \"\";\n    if (hasSourceValue) self.otherFieldsSourceSelectList.push(new SelectItem({\n      text: \"جدول مبدا\",\n      value: self.sourceTableId()\n    }));\n    if (hasexpenseCenterValue) self.otherFieldsSourceSelectList.push(new SelectItem({\n      text: \"جدول هزینه\",\n      value: self.expenseCenterTableId()\n    }));\n  };\n\n  self.validationObject = ko.validatedObservable({\n    effectiveDate: self.effectiveDate.extend({\n      required: true,\n      validation: [{\n        validator: function validator(val, someOtherVal) {\n          var activePeriod = _h.kocnx().periodItem();\n\n          var start = new Date(activePeriod.ts);\n          var timeEnd = new Date(activePeriod.te);\n          var date = new Date(val);\n          return date >= start && date <= timeEnd;\n        },\n        message: 'تاریخ موثر سند باید در بازه تاریخ شروع و پایان دوره مالی جاری باشد'\n      }]\n    }),\n    sourceTableId: self.sourceTableId.extend({\n      required: true\n    }),\n    expenseCenterTableId: self.expenseCenterTableId.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          return self.parentForm.dynamicDocumentType() === 2;\n        }\n      }\n    }),\n    destinationTableId: self.destinationTableId.extend({\n      required: true\n    }),\n    apportionBase: self.apportionBase.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          return self.parentForm.dynamicDocumentType() === 2;\n        }\n      }\n    })\n  });\n  self.showResultBtn = ko.computed(function () {\n    return !_h.isNullOrEmpty(self.sourceTableId());\n  });\n\n  self.toServer = function () {\n    var destinationACodes = [];\n    if (_h.any(self.destinationAccountCodes())) for (var i = 0; i < self.destinationAccountCodes().length; i++) {\n      var target = self.destinationAccountCodes()[i];\n      destinationACodes.push({\n        value: target.value(),\n        accountCode: target.accountCode(),\n        withFlow: target.withFlow(),\n        \"default\": target.defaultItem()\n      });\n    }\n    var otherFields = [];\n    if (_h.any(self.otherFields())) for (var j = 0; j < self.otherFields().length; j++) {\n      var otherField = self.otherFields()[j];\n      var json = ko.toJS(otherField);\n      json.parentForm = null;\n      otherFields.push(json);\n    }\n    return {\n      destinationAccountCodes: destinationACodes,\n      effectiveDate: self.effectiveDate(),\n      sourceTableId: self.sourceTableId(),\n      sourceTableCondition: self.sourceTableCondition(),\n      treeId: self.treeId(),\n      nodeIdList: self.nodeIdList(),\n      referenceColumn: self.referenceColumn(),\n      expenseCenterTableId: self.expenseCenterTableId(),\n      expenseCenterTableCondition: self.expenseCenterTableCondition(),\n      apportionBase: self.apportionBase(),\n      destinationTableId: self.destinationTableId(),\n      otherFields: otherFields,\n      apportionAccountType: self.apportionAccountType()\n    };\n  };\n\n  self.validateForm = function () {\n    var array = [];\n\n    for (var p2 in self.validationObject()) {\n      if (self.validationObject().hasOwnProperty(p2)) {\n        var target2 = self.validationObject()[p2];\n        var text;\n\n        try {\n          text = _h.getLocalizedText(p2);\n        } catch (e) {\n          text = undefined;\n        }\n\n        if (!_h.isNullOrEmpty(text) && !_h.isNullOrEmpty(target2.error())) array.push({\n          propName: p2,\n          propFaName: text,\n          error: target2.error()\n        });\n\n        if (_h.isNullOrEmpty(text) && !_h.isNullOrEmpty(target2()) && !_h.isNullOrEmpty(target2()[\"validateForm\"])) {\n          array.push({\n            propName: p2,\n            propFaName: text,\n            children: target2().validateForm()\n          });\n        }\n      }\n    }\n\n    if (self.sourceTableConditionModel().conditions().length > 1) {\n      array.push({\n        propName: \"sourceTableConditionModel\",\n        propFaName: \"شروط مبدا\",\n        children: self.sourceTableConditionModel().validateForm()\n      });\n    }\n\n    if (self.expenseCenterTableConditionModel().conditions().length > 1) {\n      array.push({\n        propName: \"expenseCenterTableConditionModel\",\n        propFaName: \"شروط هزینه\",\n        children: self.expenseCenterTableConditionModel().validateForm()\n      });\n    }\n\n    return array;\n  };\n\n  self.showApportionAccountType = ko.computed(function () {\n    var item = self.sourceTableSelectList[self.sourceTableId()];\n    return item && item.tableRole() === 2;\n  });\n}\nfunction DeleteCostDocumentProperties(parent) {\n  var self = this;\n  self.parentForm = parent;\n  self.sourceTableId = ko.observable();\n  self.sourceTableCondition = ko.observable();\n  self.sourceTableConditionModel = ko.observable();\n  self.destinationValues = ko.observableArray();\n  self.sourceTableSelectList = {};\n  self.sourceTableColSelectList = {};\n\n  self.onSelect = function (controlName) {\n    switch (controlName) {\n      case \"sourceTableId\":\n        if (self.sourceTableId()) {\n          var item = self.sourceTableSelectList[self.sourceTableId()];\n          self.sourceTableColSelectList = {};\n\n          if (_h.any(item.fields())) {\n            for (var i = 0; i < item.fields().length; i++) {\n              var target = item.fields()[i];\n              self.sourceTableColSelectList[target.value()] = target;\n            }\n          }\n        }\n\n        self.sourceTableConditionModel().reset();\n        self.destinationValues.removeAll();\n        break;\n    }\n  };\n\n  self.fillModel = function (model, editForm) {\n    self.fillLists();\n    self.sourceTableId(model.sourceTableId);\n    self.onSelect(\"sourceTableId\");\n    self.sourceTableCondition(model.sourceTableCondition);\n    var translator = new _master_phraseTranslator_js__WEBPACK_IMPORTED_MODULE_2__.PhraseTranslator();\n    var sourceModel = translator.getModel(model.sourceTableCondition);\n    var record = new TableConditionSet(self, \"source\");\n    record.fillModel(sourceModel, model.sourceTableConditionAggregation);\n    self.sourceTableConditionModel(record);\n    if (_h.any(model.destinationValues)) for (var i = 0; i < model.destinationValues.length; i++) {\n      var rec = new DeleteCostDestinationValueProperty(self);\n      rec.fillModel(model.destinationValues[i]);\n      self.destinationValues.push(rec);\n    }\n  };\n\n  self.fillEmpty = function () {\n    self.fillLists();\n    var record = new TableConditionSet(self, \"source\");\n    record.fillEmpty(undefined);\n    self.sourceTableConditionModel(record);\n  };\n\n  self.fillLists = function () {\n    self.sourceTableSelectList = {};\n\n    for (var i = 0; i < _h.kocnx().ddvm().allTableSelectList().length; i++) {\n      var p = _h.kocnx().ddvm().allTableSelectList()[i];\n\n      if (p.tableRole() === 2) {\n        self.sourceTableSelectList[p.value()] = p;\n      }\n    }\n  };\n\n  self.addDeleteCostDestinationValue = function () {\n    self.destinationValues.push(new DeleteCostDestinationValueProperty(self));\n  };\n\n  self.removeDeleteCostDestinationValue = function (item) {\n    self.destinationValues.remove(item);\n  };\n\n  self.toServer = function () {\n    var array = [];\n\n    for (var i = 0; i < self.destinationValues().length; i++) {\n      var target = self.destinationValues()[i];\n      array.push({\n        sourceFieldOrder: target.sourceFieldOrder(),\n        destinationFieldOrder: target.destinationFieldOrder()\n      });\n    }\n\n    return {\n      sourceTableId: self.sourceTableId(),\n      destinationValues: array,\n      sourceTableCondition: self.sourceTableCondition()\n    };\n  };\n\n  self.validationObject = ko.validatedObservable({\n    sourceTableId: self.sourceTableId.extend({\n      required: true\n    }),\n    destinationValues: self.destinationValues.extend({\n      atleastOneDeleteCostDestinationValues: true\n    })\n  });\n\n  self.validateForm = function () {\n    var array = [];\n\n    for (var p2 in self.validationObject()) {\n      if (self.validationObject().hasOwnProperty(p2)) {\n        var target2 = self.validationObject()[p2];\n        var text;\n\n        try {\n          text = _h.getLocalizedText(p2);\n        } catch (e) {\n          text = undefined;\n        }\n\n        if (!_h.isNullOrEmpty(text) && !_h.isNullOrEmpty(target2.error())) array.push({\n          propName: p2,\n          propFaName: text,\n          error: target2.error()\n        });\n      }\n    }\n\n    if (self.sourceTableConditionModel().conditions().length > 1) {\n      array.push({\n        propName: \"sourceTableConditionModel\",\n        propFaName: \"شروط مبدا\",\n        children: self.sourceTableConditionModel().validateForm()\n      });\n    }\n\n    return array;\n  };\n}\nfunction ColumnDocumentProperties(parent) {\n  var self = this;\n  self.parentForm = parent;\n  self.sourceTableId = ko.observable();\n  self.sourceTableCondition = ko.observable();\n  self.sourceTableConditionModel = ko.observable();\n  self.destinationValues = ko.observableArray();\n  self.treeId = ko.observable();\n  self.sourceTableSelectList = {};\n  self.sourceTableColSelectList = {};\n  self.destinationValuesTableColSelectList = {};\n\n  self.onSelect = function (controlName) {\n    switch (controlName) {\n      case \"sourceTableId\":\n        if (self.sourceTableId()) {\n          var item = self.sourceTableSelectList[self.sourceTableId()];\n          self.sourceTableColSelectList = {};\n\n          if (item && _h.any(item.fields())) {\n            for (var i = 0; i < item.fields().length; i++) {\n              var target = item.fields()[i];\n              self.sourceTableColSelectList[target.value()] = target;\n\n              if (target.dataType() === 0 || target.dataType() === 2 || target.dataType() === 3) {\n                self.destinationValuesTableColSelectList[target.value()] = target;\n              }\n            }\n          }\n        }\n\n        self.destinationValues.removeAll();\n        self.sourceTableConditionModel().reset();\n        break;\n    }\n  };\n\n  self.fillLists = function () {\n    self.sourceTableSelectList = {};\n\n    for (var i = 0; i < _h.kocnx().ddvm().allTableSelectList().length; i++) {\n      var p = _h.kocnx().ddvm().allTableSelectList()[i];\n\n      self.sourceTableSelectList[p.value()] = p;\n    }\n  };\n\n  self.toServer = function () {\n    var dValues = [];\n\n    for (var i = 0; i < self.destinationValues().length; i++) {\n      var target = self.destinationValues()[i];\n      dValues.push({\n        nodeId: target.nodeId(),\n        columnFunction: target.columnFunction(),\n        fieldOrder: target.fieldOrder()\n      });\n    }\n\n    return {\n      sourceTableId: self.sourceTableId(),\n      sourceTableCondition: self.sourceTableCondition(),\n      destinationValues: dValues,\n      treeId: self.treeId()\n    };\n  };\n\n  self.fillModel = function (model, editForm) {\n    self.fillLists();\n    self.treeId(model.treeId);\n    self.sourceTableId(model.sourceTableId);\n    self.onSelect(\"sourceTableId\");\n    self.sourceTableCondition(model.sourceTableCondition);\n    var translator = new _master_phraseTranslator_js__WEBPACK_IMPORTED_MODULE_2__.PhraseTranslator();\n    var sourceModel = translator.getModel(model.sourceTableCondition);\n    var record = new TableConditionSet(self, \"source\");\n    record.fillModel(sourceModel, model.sourceTableConditionAggregation);\n    self.sourceTableConditionModel(record);\n    if (_h.any(model.destinationValues)) for (var i = 0; i < model.destinationValues.length; i++) {\n      var rec = new ColumnDestinationValueProperty(self);\n      rec.fillModel(model.destinationValues[i]);\n      self.destinationValues.push(rec);\n    }\n  };\n\n  self.fillEmpty = function () {\n    self.fillLists();\n    var record = new TableConditionSet(self, \"source\");\n    record.fillEmpty(undefined);\n    self.sourceTableConditionModel(record);\n  };\n\n  self.addColumnDestinationValue = function () {\n    var rec = new ColumnDestinationValueProperty(self);\n    self.destinationValues.push(rec);\n  };\n\n  self.validationObject = ko.validatedObservable({\n    sourceTableId: self.sourceTableId.extend({\n      required: true\n    }),\n    treeId: self.treeId.extend({\n      required: true\n    }),\n    destinationValues: self.destinationValues.extend({\n      atleastOneColumnDestinationValues: true\n    })\n  });\n\n  self.validateForm = function () {\n    var array = [];\n\n    for (var p2 in self.validationObject()) {\n      if (self.validationObject().hasOwnProperty(p2)) {\n        var target2 = self.validationObject()[p2];\n        var text;\n\n        try {\n          text = _h.getLocalizedText(p2);\n        } catch (e) {\n          text = undefined;\n        }\n\n        if (!_h.isNullOrEmpty(text) && !_h.isNullOrEmpty(target2.error())) array.push({\n          propName: p2,\n          propFaName: text,\n          error: target2.error()\n        });\n\n        if (_h.isNullOrEmpty(text) && !_h.isNullOrEmpty(target2()) && !_h.isNullOrEmpty(target2()[\"validateForm\"])) {\n          array.push({\n            propName: p2,\n            propFaName: text,\n            children: target2().validateForm()\n          });\n        }\n      }\n    }\n\n    if (self.sourceTableConditionModel().conditions().length > 1) {\n      array.push({\n        propName: \"sourceTableConditionModel\",\n        propFaName: \"شروط مبدا\",\n        children: self.sourceTableConditionModel().validateForm()\n      });\n    }\n\n    return array;\n  };\n\n  self.showResultBtn = ko.computed(function () {\n    return !_h.isNullOrEmpty(self.sourceTableId());\n  });\n}\nfunction DestinationFieldProperties(parent) {\n  var self = this;\n  self.parentForm = parent;\n  self.destinationField = ko.observable();\n  self.destinationFieldDataType = ko.observable();\n  self.selectedTable = ko.observable();\n  self.selectedField = ko.observable();\n\n  self.onSelect = function (controlName) {\n    switch (controlName) {\n      case \"destinationField\":\n        var item = self.parentForm.destinationTableColSelectList[self.destinationField()];\n        if (self.destinationField()) self.destinationFieldDataType(item.dataType());\n        self.selectedField(undefined);\n        break;\n    }\n  };\n\n  self.fillModel = function (model) {\n    self.destinationField(model.destinationField);\n    self.destinationFieldDataType(model.dataType);\n    self.onSelect(\"destinationField\");\n    self.selectedTable(model.selectedTable);\n    self.selectedField(model.selectedField);\n  };\n\n  self.fillEmpty = function (sourceTableId, expenseCenterTableId) {\n    if (sourceTableId && expenseCenterTableId) {\n      self.selectedTable(sourceTableId);\n    }\n\n    if (sourceTableId && !expenseCenterTableId) {\n      self.selectedTable(sourceTableId);\n    }\n\n    if (!sourceTableId && expenseCenterTableId) {\n      self.selectedTable(expenseCenterTableId);\n    }\n  };\n\n  self.filterSelectedField = function (item) {\n    if (self.destinationFieldDataType() === item.dataType) {\n      return true;\n    }\n\n    return false;\n  };\n}\nfunction DeleteCostDestinationValueProperty(parent) {\n  var self = this;\n  self.parentForm = parent;\n  self.sourceFieldOrder = ko.observable();\n  self.sourceFieldType = ko.observable();\n  self.destinationFieldOrder = ko.observable();\n\n  self.fillModel = function (model) {\n    self.sourceFieldOrder(model.sourceFieldOrder);\n    self.onSelect(\"sourceFieldOrder\");\n    var item = self.parentForm.sourceTableColSelectList[self.sourceFieldOrder()];\n    self.sourceFieldType(item.dataType());\n    self.destinationFieldOrder(model.destinationFieldOrder);\n  };\n\n  self.onSelect = function (controlName) {\n    switch (controlName) {\n      case \"sourceFieldOrder\":\n        if (self.sourceFieldOrder()) {\n          var item = self.parentForm.sourceTableColSelectList[self.sourceFieldOrder()];\n          self.sourceFieldType(item.dataType());\n        }\n\n        self.destinationFieldOrder(undefined);\n        break;\n    }\n  };\n\n  self.filterDataType = function (item) {\n    if (item.dataType === self.sourceFieldType()) {\n      return true;\n    }\n\n    return false;\n  };\n}\nfunction ColumnDestinationValueProperty(parent) {\n  var self = this;\n  self.parentForm = parent;\n  self.nodeId = ko.observable();\n  self.columnFunction = ko.observable();\n  self.fieldOrder = ko.observable();\n  self.nodeName = \"\";\n\n  self.fillModel = function (model) {\n    self.nodeId(model.nodeId);\n    self.nodeName = model.nodeName + \" ( \" + model.nodeCode + \" )\";\n    self.columnFunction(model.columnFunction);\n    self.fieldOrder(model.fieldOrder);\n  };\n\n  self.onNodeSelect = function (name, value) {\n    switch (name) {\n      case \"nodeId\":\n        self.nodeId(value);\n        break;\n    }\n  };\n}\nfunction TableConditionSet(parentForm, target) {\n  var self = this;\n  self.parentForm = parentForm;\n  self.target = target;\n  self.operatorsList = [];\n  self.showDropDown = ko.observable(false);\n  self.conditions = ko.observableArray();\n  self.shortcuts = ko.observableArray();\n  self.result = ko.observable(\"\");\n  self.text = ko.observable(\"\");\n\n  self.translatePhrase = function () {\n    if (self.conditions().length === 1) {\n      self.parentForm[self.target + \"TableCondition\"](\"\");\n\n      if (self.conditions()[0].leftSide() && self.conditions()[0].leftSide() !== \"\" && self.conditions()[0].operator() && self.conditions()[0].operator() !== \"\") {\n        var phrase = self.conditions()[0].createCondtionPhrase();\n        self.result(\"[cs1:\" + phrase + \"]\");\n        self.parentForm[self.target + \"TableCondition\"](self.result());\n      }\n    }\n\n    if (!_h.isNullOrEmpty(self.text()) && self.text() !== \"\") {\n      if (self.conditions().length > 1) {\n        var text = self.text();\n        self.parentForm[self.target + \"TableCondition\"](\"\");\n\n        for (var i = 0; i < self.conditions().length; i++) {\n          var target = self.conditions()[i];\n          var ph = target.createCondtionPhrase();\n          var cName = \"Cs\" + (i + 1);\n\n          if (self.text().indexOf(cName) !== -1) {\n            var condStr = \"[cs\" + (i + 1) + \":\" + ph + \"]\";\n            text = text.replace(cName, condStr);\n            self.result(text);\n          }\n        }\n\n        self.parentForm[self.target + \"TableCondition\"](self.result());\n      }\n    }\n\n    if (self.target === \"destination\" && self.conditions().length > 1) {\n      var condStrD = \"\";\n\n      for (var b = 0; b < self.conditions().length; b++) {\n        var targetD = self.conditions()[b];\n        var phD = targetD.createCondtionPhrase();\n        condStrD += \"[cs\" + (b + 1) + \":\" + phD + \"]\";\n        if (self.conditions().length !== b + 1) condStrD += \"&&\";\n      }\n\n      self.parentForm[self.target + \"TableCondition\"](condStrD);\n    }\n  };\n\n  self.fillModel = function (conditions, agr) {\n    self.init(conditions, agr);\n  };\n\n  self.fillEmpty = function () {\n    self.init(undefined);\n  };\n\n  self.addCondition = function () {\n    var record = self.getConditionModel();\n    record.fillModel(undefined);\n    self.conditions.push(record);\n  };\n\n  self.removeCondition = function (item) {\n    if (self.conditions().length > 1) {\n      self.conditions.remove(item);\n      $('a[href=\"#cond-0\"]').trigger('click');\n      self.translatePhrase();\n    }\n  };\n\n  self.init = function (conditions, agr) {\n    var record = null;\n    if (_h.any(conditions)) for (var i = 0; i < conditions.length; i++) {\n      var condition = conditions[i];\n      record = self.getConditionModel();\n      record.fillModel(condition);\n      self.conditions.push(record);\n    } else {\n      record = self.getConditionModel();\n      record.fillModel(undefined);\n      self.conditions.push(record);\n    }\n\n    if (!_h.isNullOrEmpty(agr)) {\n      agr = agr.replace(/[c]/g, \"C\");\n      self.text(agr);\n    }\n\n    self.operatorsList = {\n      1000: {\n        text: \"Cs\",\n        data: \"Cs\",\n        keyCode: 1000,\n        enabled: ko.observable(false),\n        after: [38, 124, 41]\n      },\n      40: {\n        text: \"(\",\n        data: \"(\",\n        keyCode: 40,\n        enabled: ko.observable(false),\n        after: [40, 1000]\n      },\n      41: {\n        text: \")\",\n        data: \")\",\n        keyCode: 41,\n        enabled: ko.observable(false),\n        after: [38, 124, 41]\n      },\n      38: {\n        text: \"و (AND)\",\n        data: \"&&\",\n        keyCode: 38,\n        enabled: ko.observable(false),\n        after: [1000, 40]\n      },\n      124: {\n        text: \"یا (OR)\",\n        data: \"||\",\n        keyCode: 124,\n        enabled: ko.observable(false),\n        after: [1000, 40]\n      }\n    };\n    self.updateOperatorState();\n    self.translatePhrase();\n  };\n\n  self.getConditionModel = function () {\n    if (self.target === \"destination\") return new AggregationTableCondition(self.parentForm, self, self.target);else if (self.parentForm.parentForm.dynamicDocumentType() === 1) {\n      return new ComputationalTableCondition(self.parentForm, self, self.target);\n    } else return new TableCondition(self.parentForm, self, self.target);\n  };\n\n  self.lastOperator = ko.observable();\n  self.middleTyping = ko.observable();\n\n  self.updateOperatorState = function () {\n    if (_h.isNullOrEmpty(self.lastOperator()) || self.lastOperator() === \"\") {\n      self.operatorsList[40].enabled(true);\n      self.operatorsList[1000].enabled(true);\n    } else {\n      var last = self.operatorsList[self.lastOperator()];\n\n      for (var prop in self.operatorsList) {\n        if (self.operatorsList.hasOwnProperty(prop)) {\n          var target = self.operatorsList[prop];\n\n          if (last.after.indexOf(target.keyCode) !== -1) {\n            if (target.keyCode !== 41) target.enabled(true);else {\n              var rs = self.isAllowAddRightParentheses();\n              target.enabled(rs);\n            }\n          } else {\n            target.enabled(false);\n          }\n        }\n      }\n    }\n  };\n\n  self.clickOperator = function (item) {\n    self.text(self.text() + item.value.data);\n    self.lastOperator(item.value.keyCode);\n    self.updateOperatorState();\n    self.translatePhrase();\n  };\n\n  self.clickCondition = function (model, index, cond) {\n    self.text(self.text() + \"Cs\" + index);\n    self.lastOperator(self.operatorsList[1000].keyCode);\n    self.updateOperatorState();\n    self.translatePhrase();\n  };\n\n  self.isAllowAddRightParentheses = function () {\n    var lPCount = self.text().replace(/[^(]/g, \"\").length;\n    var rPCount = self.text().replace(/[^)]/g, \"\").length;\n    if (lPCount === 0) return false;\n    if (lPCount === rPCount) return false;\n\n    if (lPCount > rPCount) {\n      return true;\n    }\n\n    return false;\n  };\n\n  self.proxyKeyDown = function (data, event) {\n    var itemOperator = self.operatorsList[event.keyCode];\n\n    if (itemOperator && itemOperator.enabled()) {\n      self.text(self.text() + self.operatorsList[event.keyCode].data);\n      self.lastOperator(self.operatorsList[event.keyCode].keyCode);\n      self.updateOperatorState();\n    } else {\n      if (event.keyCode === 67 && !self.middleTyping()) {\n        self.middleTyping(true);\n\n        if (self.operatorsList[1000].enabled()) {\n          self.text(\"Cs\");\n        }\n      }\n\n      if (event.keyCode >= 49 && event.keyCode <= 57 && self.middleTyping()) {\n        var condition = self.conditions()[event.keyCode - 48];\n\n        if (condition && condition.validationObject.isValid()) {\n          self.text(self.text() + \"Cs\" + (event.keyCode - 48));\n          self.middleTyping(false);\n          self.lastOperator(1000);\n        }\n      }\n\n      if (event.keyCode === 46) {\n        event.preventDefault();\n        self.text(\"\");\n        self.lastOperator(undefined);\n        self.updateOperatorState();\n      }\n\n      if (event.keyCode === 8) {\n        event.preventDefault();\n        if (!self.middleTyping()) self.clearOnStep();else {\n          var rest = self.text().substring(0, self.text().length - 2);\n          self.text(rest);\n          self.middleTyping(false);\n        }\n      }\n    }\n\n    self.translatePhrase();\n  };\n\n  self.refreshShortcuts = ko.computed(function () {\n    if (self.conditions().length > 1) {\n      self.shortcuts.removeAll();\n      var and = \"\";\n      var or = \"\";\n      ko.utils.arrayForEach(self.conditions(), function (f, index) {\n        if (f.validationObject.isValid()) {\n          if (index + 1 !== self.conditions().length) {\n            and += \"Cs\" + (index + 1) + \"&&\";\n            or += \"Cs\" + (index + 1) + \"||\";\n          } else {\n            and += \"Cs\" + (index + 1);\n            or += \"Cs\" + (index + 1);\n          }\n        }\n      });\n      self.shortcuts.push(and);\n      self.shortcuts.push(or);\n    } else {\n      self.shortcuts.removeAll();\n    }\n  });\n\n  self.clickShortcut = function (item) {\n    self.text(\"\");\n    self.text(item);\n    self.lastOperator(1000);\n    self.updateOperatorState();\n    self.translatePhrase();\n  };\n\n  self.clearOnStep = function () {\n    var last = self.lastOperator();\n\n    if (last !== undefined && last !== \"\") {\n      var itemOperator = self.operatorsList[last];\n      var lastChar = \"\";\n      var rest = self.text().substring(0, self.text().lastIndexOf(itemOperator.data));\n      self.text(rest);\n      lastChar = self.text().substring(self.text().length - 1);\n      self.guessLastOperator(lastChar);\n    }\n  };\n\n  self.guessLastOperator = function (lastChar) {\n    if (lastChar === undefined || lastChar === \"\") self.lastOperator(undefined);else if ($.isNumeric(lastChar)) self.lastOperator(1000);else if (lastChar === \"(\") self.lastOperator(40);else if (lastChar === \")\") self.lastOperator(41);else if (lastChar === \"&\") self.lastOperator(38);else if (lastChar === \" |\") self.lastOperator(124);\n  };\n\n  if (self.target !== \"destination\") self.validationObject = ko.validatedObservable({\n    conditions: self.conditions,\n    text: self.text.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          return self.conditions().length > 1;\n        }\n      },\n      isAllConditionsUse: {\n        params: self.conditions\n      },\n      isConditionsUseValid: {\n        params: self.conditions\n      },\n      remoteIsValidExpression: {\n        onlyIf: function onlyIf() {\n          return self.conditions().length > 1 && self.text() !== undefined && self.text() !== \"\";\n        },\n        params: [true, false, 50]\n      }\n    })\n  });\n  if (self.target === \"destination\") self.validationObject = ko.validatedObservable({\n    conditions: self.conditions\n  });\n\n  self.reset = function (loc) {\n    var zero = self.conditions()[0];\n    zero.reset(loc);\n    self.conditions.removeAll();\n    self.conditions.push(zero);\n  };\n\n  self.formulaTarget = ko.observable();\n\n  self.openformula = function (model, e) {\n    self.formulaTarget(model.rightSide);\n    var config = {\n      parentForm: self,\n      percentage: false,\n      column: true,\n      columnList: self.parentForm.furmolaColSelectList,\n      node: true,\n      branchSelectable: true,\n      controllerName: 50,\n      value: model.rightSide(),\n      trees: _h.kocnx().ddvm().treeFormulaList()\n    };\n\n    _h.kocnx().calculator().init(config);\n  };\n\n  self.returnFormulaValue = function (value) {\n    var control = self.formulaTarget();\n    control(value);\n    self.formulaTarget(null);\n  };\n\n  self.validateForm = function () {\n    var array = [];\n\n    for (var i = 0; i < self.conditions().length; i++) {\n      var target = self.conditions()[i];\n      var condArray = {\n        propFaName: \"شرط \" + (i + 1),\n        propName: \"Condition \" + (i + 1),\n        children: []\n      };\n\n      for (var p in target.validationObject()) {\n        if (target.validationObject().hasOwnProperty(p)) {\n          var valObj = target.validationObject()[p];\n          var text;\n\n          try {\n            text = _h.getLocalizedText(p);\n          } catch (e) {\n            text = \"\";\n          }\n\n          if (!_h.isNullOrEmpty(text) && !_h.isNullOrEmpty(valObj.error())) condArray.children.push({\n            propName: p,\n            propFaName: text,\n            error: valObj.error()\n          });\n        }\n      }\n\n      if (condArray.children.length > 0) array.push(condArray);\n    }\n\n    var sourceLoc = \"\";\n\n    switch (self.target) {\n      case \"source\":\n        sourceLoc = \"مبدا\";\n        break;\n\n      case \"destination\":\n        sourceLoc = \"مقصد\";\n        break;\n\n      case \"calculation\":\n        sourceLoc = \"محاسبات\";\n        break;\n\n      case \"expenseCenter\":\n        sourceLoc = \"هزینه\";\n        break;\n    }\n\n    if (!_h.isNullOrEmpty(self.text.error())) array.push({\n      propName: self.target + \"ConditionAggregation\",\n      propFaName: \"تجمیع شروط \" + sourceLoc,\n      error: self.text.error()\n    });\n    return array;\n  };\n}\nfunction TableCondition(parent, parentSet, target) {\n  var self = this;\n  self.parentForm = parent;\n  self.parentSet = parentSet;\n  self.target = target;\n  self.leftListName = self.target + \"TableColSelectList\";\n  self.leftSourceListName = \"sourceTableColSelectList\";\n  self.rightSideDataTypes = ko.observableArray([]);\n  self.rightSideDataType = ko.observable();\n  self.rightSide = ko.observable();\n  self.leftSide = ko.observable();\n  self.leftSideDataType = ko.observable();\n  self.operator = ko.observable();\n  self.operators = ko.observableArray();\n  self.dynamicTableConditionalOperators = ko.observableArray();\n  self.enumItems = {};\n  self.rightSideItems = ko.observableArray();\n\n  self.onSelect = function (controlName) {\n    switch (controlName) {\n      case \"leftSide\":\n        if (!_h.isEmpty(self.leftSide())) {\n          var item = self.parentForm[self.leftListName][self.leftSide()];\n          self.leftSideDataType(item.dataType());\n        } else {\n          self.leftSideDataType(undefined);\n        }\n\n        self.rightSideDataType(undefined);\n        self.rightSide(undefined);\n        self.operator(undefined);\n        self.parentSet.translatePhrase();\n        break;\n\n      case \"operator\":\n        self.rightSideDataTypes.removeAll();\n        self.rightSideDataType(undefined);\n        self.rightSide(undefined);\n\n        if (!_h.isNullOrEmpty(self.operator())) {\n          switch (self.operator()) {\n            case 1:\n            case 2:\n            case 3:\n            case 4:\n            case 5:\n            case 6:\n              var selected = null;\n\n              for (var i = 0; i < tableconditiondataTypes.length; i++) {\n                if (tableconditiondataTypes[i].value === self.leftSideDataType()) {\n                  selected = tableconditiondataTypes[i];\n                }\n              }\n\n              self.rightSideDataTypes.push(selected);\n              if (!_h.isNullOrEmpty(selected) && selected.value === 7) self.refreshEnumList(self.target);\n              self.rightSideDataType(self.leftSideDataType());\n              if (self.target !== \"source\") self.rightSideDataTypes.push(tableconditiondataTypes[7]);\n              break;\n\n            case 7:\n            case 8:\n            case 9:\n            case 10:\n              self.rightSideDataType(13);\n              break;\n\n            case 11:\n              self.rightSideDataType(1);\n              break;\n\n            case 12:\n            case 13:\n              if (!_h.isNullOrEmpty(self.leftSideDataType())) {\n                var item2 = _h.getEnumItem(dataTypes, self.leftSideDataType());\n\n                switch (item2.value) {\n                  case 0:\n                    self.rightSideDataTypes.push(tableconditiondataTypes[0]);\n                    self.rightSideDataTypes.push(tableconditiondataTypes[12]);\n                    if (self.target !== \"source\") self.rightSideDataTypes.push(tableconditiondataTypes[7]);\n                    break;\n\n                  case 1:\n                    self.rightSideDataType(9);\n                    break;\n\n                  case 4:\n                    self.rightSideDataType(10);\n                    break;\n\n                  case 7:\n                    self.rightSideDataType(12);\n                    self.refreshEnumList(\"source\");\n                    break;\n                }\n              }\n\n              break;\n\n            case 14:\n              self.rightSideDataType(15);\n              break;\n\n            case 15:\n            case 16:\n              self.rightSideDataType(20);\n              break;\n          }\n        }\n\n        self.parentSet.translatePhrase();\n        break;\n    }\n  };\n\n  self.filterOperator = function (item) {\n    return item.dataTypes.indexOf(self.leftSideDataType()) !== -1;\n  };\n\n  self.filterRightSide = function (item) {\n    return item.dataType === self.leftSideDataType();\n  };\n\n  self.rightSideDataType.subscribe(function (newValue) {\n    self.parentSet.translatePhrase();\n  });\n  self.rightSide.subscribe(function (newValue) {\n    self.parentSet.translatePhrase();\n  });\n\n  self.refreshEnumList = function (loc) {\n    self.enumItems = {};\n    var keys = Object.keys(self.parentForm[loc + \"TableColSelectList\"]);\n    if (keys && keys.length) for (var j = 0; j < keys.length; j++) {\n      var k = self.parentForm[loc + \"TableColSelectList\"][keys[j]];\n\n      if (k.value() === self.leftSide() && k.enumValues().length) {\n        for (var l = 0; l < k.enumValues().length; l++) {\n          var target = k.enumValues()[l];\n          self.enumItems[target.value()] = target;\n        }\n      }\n    }\n    self.rightSide(undefined);\n  };\n\n  self.validationObject = ko.validatedObservable({\n    rightSide: self.rightSide.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          var conditionCount = self.parentSet !== \"\" && self.parentSet.conditions().length > 1;\n          var hasLeftSideValue = self.leftSide && self.leftSide() !== \"\";\n          var hasOperatorValue = self.operator && self.operator() !== \"\";\n          var reqiureVal = self.rightSideDataType && self.rightSideDataType() !== \"\" && self.rightSideDataType() !== 13;\n          return conditionCount && (hasLeftSideValue || hasOperatorValue) && reqiureVal;\n        }\n      }\n    }),\n    leftSide: self.leftSide.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          return self.parentSet !== \"\" && self.parentSet.conditions().length > 1;\n        }\n      }\n    }),\n    operator: self.operator.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          var conditionCount = self.parentSet !== \"\" && self.parentSet.conditions().length > 1;\n          var hasLeftSideValue = self.leftSide && self.leftSide() !== \"\";\n          return conditionCount && hasLeftSideValue;\n        }\n      }\n    })\n  });\n  self.rightSideItems.subscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      var value = _h.concatStringList(newValue);\n\n      self.rightSide(value);\n    }\n  });\n\n  self.fillModel = function (model) {\n    if (model) {\n      self.leftSide(Number(model.leftSide));\n\n      if (!_h.isEmpty(self.leftSide())) {\n        var item = self.parentForm[self.leftListName][self.leftSide()];\n        self.leftSideDataType(item.dataType());\n      }\n\n      self.operator(model.operator.value);\n      self.rightSideDataType(model.rightSide.type);\n      self.rightSide(model.rightSide.value);\n\n      if (model.rightSide.type === 12) {\n        var values = _h.splitStringList(model.rightSide.value);\n\n        self.rightSideItems(values);\n      }\n\n      if (model.rightSide.type === 7) {\n        self.refreshEnumList(self.target);\n        self.rightSide(model.rightSide.value);\n      }\n    }\n  };\n\n  self.createCondtionPhrase = function () {\n    var ph = \"[table:'\" + self.leftSide() + \"']\";\n    ph += _h.getEnumEnText(dynamicConditionalOperators2, self.operator());\n    var val = self.rightSideDataType();\n    var right = \"\";\n\n    switch (val) {\n      case 0:\n        right = \"int:'\";\n        break;\n\n      case 1:\n        right = \"text:'\";\n        break;\n\n      case 2:\n        right = \"decimal:'\";\n        break;\n\n      case 3:\n        right = \"money:'\";\n        break;\n\n      case 4:\n        right = \"date:'\";\n        break;\n\n      case 7:\n        right = \"enum:'\";\n        break;\n\n      case 8:\n        right = \"table:'\";\n        break;\n\n      case 9:\n        right = \"listtext:'\";\n        break;\n\n      case 10:\n        right = \"listdate:'\";\n        break;\n\n      case 12:\n        right = \"listenum:'\";\n        break;\n\n      case 14:\n        right = \"listint:'\";\n        break;\n\n      case 15:\n        right = \"pattern:'\";\n        break;\n\n      case 20:\n        right = \"likepattern:'\";\n        break;\n\n      case null:\n      case undefined:\n      case \"\":\n      case \"-\":\n      case 13:\n        return ph;\n    }\n\n    if (self.rightSide() !== undefined) ph += \"[\" + right + self.rightSide() + \"']\";else ph += \"[\" + right + \"']\";\n    return ph;\n  };\n\n  self.reset = function () {\n    self.leftSide(undefined);\n    self.leftSideDataType(undefined);\n    self.operator(undefined);\n    self.rightSideDataType(undefined);\n    self.rightSide(undefined);\n  };\n}\nfunction AggregationTableCondition(parent, parentSet, target) {\n  var self = this;\n  self.parentForm = parent;\n  self.parentSet = parentSet;\n  self.target = target;\n  self.leftListName = \"destinationTableColSelectList\";\n  self.rightSideDataTypes = [{\n    text: \"مقدار ثابت\",\n    value: 16\n  }, {\n    text: \"ستون جدول مبدا\",\n    value: 17\n  }, {\n    text: \"ستون جدول محاسبات\",\n    value: 18\n  }];\n  self.operators = [{\n    text: \"=\",\n    enText: \"=\",\n    value: 3\n  }, {\n    text: \"بدون مقدار\",\n    enText: \"IsNull\",\n    value: 7\n  }];\n  self.rightSideDataType = ko.observable(null);\n  self.leftSideDataType = ko.observable();\n  self.rightSide = ko.observable();\n  self.leftSide = ko.observable();\n  self.operator = ko.observable();\n\n  self.onSelect = function (controlName) {\n    switch (controlName) {\n      case \"leftSide\":\n        if (!_h.isEmpty(self.leftSide())) {\n          var item = self.parentForm[self.leftListName][self.leftSide()];\n          self.leftSideDataType(item.dataType());\n        } else {\n          self.leftSideDataType(undefined);\n        }\n\n        self.operator(undefined);\n        self.rightSideDataType(undefined);\n        self.showRightSide(true);\n        self.rightSide(undefined);\n        break;\n\n      case \"operator\":\n        if (!_h.isNullOrEmpty(self.operator())) {\n          switch (self.operator()) {\n            case 7:\n              self.rightSideDataType(null);\n              self.showRightSide(false);\n              self.rightSide(null);\n              self.parentSet.translatePhrase();\n              break;\n\n            default:\n              self.showRightSide(true);\n              break;\n          }\n        }\n\n        break;\n\n      case \"rightSideDataType\":\n        break;\n    }\n  };\n\n  self.showRightSide = ko.observable(true);\n\n  self.filterRightSide = function (item) {\n    return item.dataType === self.leftSideDataType();\n  };\n\n  self.rightSide.subscribe(function () {\n    self.parentSet.translatePhrase();\n  });\n\n  self.fillModel = function (model) {\n    if (model) {\n      self.leftSide(Number(model.leftSide));\n\n      if (!_h.isEmpty(self.leftSide())) {\n        var item = self.parentForm[self.leftListName][self.leftSide()];\n        self.leftSideDataType(item.dataType());\n      }\n\n      self.operator(model.operator.value);\n      self.onSelect(\"operator\");\n      self.rightSideDataType(model.rightSide.type);\n      self.rightSide(model.rightSide.value);\n    }\n  };\n\n  self.createCondtionPhrase = function () {\n    var ph = \"[table:'\" + self.leftSide() + \"']\";\n    ph += _h.getEnumEnText(dynamicConditionalOperators2, self.operator());\n    var val = self.rightSideDataType();\n    var right = \"\";\n\n    switch (val) {\n      case 16:\n        right = \"value:'\";\n        break;\n\n      case 17:\n        right = \"sourcetable:'\";\n        break;\n\n      case 18:\n        right = \"calculationtable:'\";\n        break;\n\n      case 13:\n      case \"\":\n      case undefined:\n      case null:\n        return ph;\n    }\n\n    if (self.rightSide() !== undefined) ph += \"[\" + right + self.rightSide() + \"']\";else ph += \"[\" + right + \"']\";\n    return ph;\n  };\n\n  self.validationObject = ko.validatedObservable({\n    rightSide: self.rightSide.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          return self.parentForm.destinationCalculationType() === 2 && self.operator && self.operator() !== \"\" && self.operator() !== 7;\n        }\n      }\n    }),\n    leftSide: self.leftSide.extend({\n      onlyIf: function onlyIf() {\n        return self.parentForm.destinationCalculationType() === 2;\n      }\n    }),\n    operator: self.operator.extend({\n      onlyIf: function onlyIf() {\n        return self.parentForm.destinationCalculationType() === 2;\n      }\n    }),\n    rightSideDataType: self.rightSideDataType.extend({\n      onlyIf: function onlyIf() {\n        return self.parentForm.destinationCalculationType() === 2 && self.operator && self.operator() !== \"\" && self.operator() !== 7;\n      }\n    })\n  });\n\n  self.reset = function () {\n    self.leftSide(undefined);\n    self.leftSideDataType(undefined);\n    self.rightSideDataType(null);\n    self.showRightSide(false);\n    self.rightSide(null);\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/dynamicdocument/model.js?");

/***/ }),

/***/ "./src/scripts/pages/dynamicdocument/resource.js":
/*!*******************************************************!*\
  !*** ./src/scripts/pages/dynamicdocument/resource.js ***!
  \*******************************************************/
/***/ (() => {

eval("window.dynamicConditionalOperators = [{\n  text: \">\",\n  enText: \"GreaterThan\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"<\",\n  enText: \"LessThan\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"=\",\n  enText: \"Equal\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"<>\",\n  enText: \"Unequal\",\n  value: 4,\n  color: \"\"\n}, {\n  text: \">=\",\n  enText: \"GreaterThanOrEqual\",\n  value: 5,\n  color: \"\"\n}, {\n  text: \"<=\",\n  enText: \"LessThanOrEqual\",\n  value: 6,\n  color: \"\"\n}, {\n  text: \"بدون مقدار\",\n  enText: \"IsNull\",\n  value: 7,\n  color: \"\"\n}, {\n  text: \"دارای مقدار\",\n  enText: \"IsNotNull\",\n  value: 8,\n  color: \"\"\n}, {\n  text: \"درست\",\n  enText: \"IsTrue\",\n  value: 9,\n  color: \"\"\n}, {\n  text: \"نادرست\",\n  enText: \"IsFalse\",\n  value: 10,\n  color: \"\"\n}];\nwindow.columnFunctions = [{\n  text: \"تعداد\",\n  enText: \"Count\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"مجموع\",\n  enText: \"Sum\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"میانگین\",\n  enText: \"Average\",\n  value: 3,\n  color: \"\"\n}];\nwindow.conditionalPhraseTypes = [{\n  text: \"فرمول\",\n  enText: \"Formula\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"ستون جدول\",\n  enText: \"TableColumn\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"تاریخ\",\n  enText: \"Date\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"عبارت متنی\",\n  enText: \"Text\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"عدد ثابت\",\n  enText: \"Number\",\n  value: 4,\n  color: \"\"\n}];\nwindow.destinationCalculationTypes = [{\n  text: \"ایجاد\",\n  enText: \"Create\",\n  value: 1\n}, {\n  text: \"مقداردهی\",\n  enText: \"SetValue\",\n  value: 2\n}];\nwindow.computeTypes = [{\n  text: \"فرمول\",\n  enText: \"Formula\",\n  value: 0\n}, {\n  text: \"انتخاب ستون ها\",\n  enText: \"Column\",\n  value: 1\n}];\nwindow.calculationValueTypes = [{\n  text: \"شماره ردیف\",\n  enText: \"RowNumber\",\n  value: 1,\n  dataTypes: [0]\n}, {\n  text: \"تعداد ردیف\",\n  enText: \"RowsCount\",\n  value: 2,\n  dataTypes: [0]\n}, {\n  text: \"ستون جدول مبدا\",\n  enText: \"SourceTableColumn\",\n  value: 3,\n  dataTypes: [0, 1, 2, 3, 4, 5, 7]\n}, {\n  text: \"ستون جدول محاسبات\",\n  enText: \"CalculationtableColumn\",\n  value: 4,\n  dataTypes: [0, 1, 2, 3, 4, 5, 7]\n}, {\n  text: \"جمع\",\n  enText: \"Sum\",\n  value: 5,\n  dataTypes: [0, 2, 3]\n}, {\n  text: \"میانگین\",\n  enText: \"Average\",\n  value: 6,\n  dataTypes: [0, 2, 3]\n}, {\n  text: \"مقدار ثابت\",\n  enText: \"Value\",\n  value: 7,\n  dataTypes: [0, 1, 2, 3, 4, 5, 7]\n}, {\n  text: \"کمترین\",\n  enText: \"Min\",\n  value: 8,\n  dataTypes: [0, 2, 3]\n}, {\n  text: \"بیشترین\",\n  enText: \"Max\",\n  value: 9,\n  dataTypes: [0, 2, 3]\n}];\nwindow.documentCalculationStates = [{\n  text: \"محاسبه نشده\",\n  enText: \"NoCalculation\",\n  value: 0,\n  color: \"blue\"\n}, {\n  text: \"محاسبه موفق\",\n  enText: \"Successful\",\n  value: 1,\n  color: \"green\"\n}, {\n  text: \"محاسبه ناموفق\",\n  enText: \"Failed\",\n  value: 2,\n  color: \"red\"\n}];\nwindow.apportionAccountTypes = [{\n  text: \"معین مقصد\",\n  enText: \"DestinationAccount\",\n  value: 0\n}, {\n  text: \"معین مبدا\",\n  enText: \"SourceAccount\",\n  value: 1\n}];\nwindow.dynamicdocumentModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  priority: {\n    fa: 'اولویت',\n    colName: 'priority',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"Ascending\",\n    alias: null,\n    size: 6,\n    type: \"string\"\n  },\n  code: {\n    fa: 'شماره',\n    colName: 'code',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 6,\n    type: \"string\"\n  },\n  title: {\n    fa: 'عنوان',\n    colName: 'title',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\",\n    popup: true\n  },\n  documentCalculationState: {\n    fa: 'وضعیت اجرا',\n    colName: 'documentCalculationState',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"label\"\n  },\n  description: {\n    fa: 'شرح',\n    colName: 'description',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  dynamicDocumentType: {\n    fa: 'نوع',\n    colName: 'dynamicDocumentType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    groupBy: true,\n    groupDir: \"Ascending\",\n    type: \"enum\"\n  },\n  stateType: {\n    fa: 'وضعیت',\n    colName: 'stateType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"stateSwitch\"\n  },\n  timeCreated: {\n    fa: 'زمان ایجاد',\n    colName: 'timeCreated',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"pdate\"\n  },\n  createByUser: {\n    fa: 'کاربر ایجاد کننده',\n    colName: 'createByUser',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  folderName: {\n    fa: 'پوشه',\n    colName: 'folderName',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: \"folderId\",\n    groupBy: true,\n    groupDir: \"Ascending\",\n    type: \"string\"\n  },\n  tableId: {\n    fa: 'نام جدول',\n    colName: 'tableId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    forGroup: false\n  },\n  sourceTableId: {\n    fa: 'جدول مبدا',\n    colName: 'sourceTableId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    forGroup: false\n  },\n  expenseCenterTableId: {\n    fa: 'مرکز هزینه',\n    colName: 'expenseCenterTableId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    forGroup: false\n  },\n  destinationTableId: {\n    fa: 'جدول مقصد',\n    colName: 'destinationTableId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    forGroup: false\n  },\n  effectiveDate: {\n    fa: 'تاریخ موثر',\n    colName: 'effectiveDate',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    forGroup: false\n  },\n  nodeIdList: {\n    fa: 'گره های درختواره',\n    colName: 'nodeIdList',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    forGroup: false\n  },\n  folderId: {\n    fa: 'پوشه',\n    colName: 'folderId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/pages/dynamicdocument/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/dynamicdocument/resource.main.js":
/*!************************************************************!*\
  !*** ./src/scripts/pages/dynamicdocument/resource.main.js ***!
  \************************************************************/
/***/ (() => {

eval("window.dynamicdocumentPageRes = {\n  pageCaption: {\n    fa: 'اسناد تسهیم هزینه'\n  },\n  createCaption: {\n    fa: 'تعریف سند روال محاسبه جدید'\n  },\n  editCaption: {\n    fa: 'ویرایش سند روال محاسبه'\n  },\n  deleteCaption: {\n    fa: 'حذف سند روال محاسبه'\n  },\n  calculateDocumentsCaption: {\n    fa: 'اجرای اسناد  تسهیم هزینه'\n  },\n  calculateDocumentCaption: {\n    fa: 'اجرای سند  تسهیم هزینه'\n  },\n  deleteCalculateDocumentsCaption: {\n    fa: 'حذف اثر اجرای اسناد'\n  },\n  deleteCalculateDocumentCaption: {\n    fa: 'حذف اثر اجرای سند'\n  },\n  createExcelFileCaption: {\n    fa: 'خروجی فایل اکسل'\n  },\n  addCondition: {\n    fa: 'اضافه کردن شرط'\n  },\n  removeCondition: {\n    fa: 'حذف شرط'\n  },\n  sourceTableCondition: {\n    fa: 'تجمیع شروط مبدا'\n  },\n  expenseCenterTableCondition: {\n    fa: 'تجمیع شروط هزینه'\n  },\n  destinationTableId: {\n    fa: 'جدول مقصد'\n  },\n  calculationTableId: {\n    fa: 'جدول محاسبات'\n  },\n  destinationAccountCode: {\n    fa: 'کد حساب مقصد'\n  },\n  apportionBase: {\n    fa: 'مبنای تسهیم'\n  },\n  invalidCondition: {\n    fa: 'شرط نامعتبر'\n  },\n  showResult: {\n    fa: 'مشاهده نتایج'\n  },\n  destinationAccountCodeWithFlow: {\n    fa: 'فقط در صورت وجود سابقه گردش بر روی حساب'\n  },\n  sourceTable: {\n    fa: 'جدول مبدا'\n  },\n  expenseCenterTable: {\n    fa: 'جدول هزینه'\n  },\n  calculationTable: {\n    fa: 'جدول محاسبات'\n  },\n  sourceColTable: {\n    fa: 'ستون مبدا'\n  },\n  destinationColTable: {\n    fa: 'ستون هزینه'\n  },\n  excelBtn: {\n    fa: 'فایل خروجی اکسل'\n  },\n  copyCaption: {\n    fa: 'کپی سند تسهیم هزینه'\n  },\n  copiesCaption: {\n    fa: 'کپی اسناد تسهیم هزینه'\n  },\n  addDestinationValue: {\n    fa: 'افزودن ستون'\n  },\n  addColumnDestinationValue: {\n    fa: 'افزودن برگ'\n  },\n  destinationCalculationType: {\n    fa: 'نوع عملیات'\n  },\n  formula: {\n    fa: 'فرمول'\n  },\n  addSourceFieldFormula: {\n    fa: 'اضافه کردن ستون'\n  },\n  treeId: {\n    fa: 'درختواره'\n  },\n  destinationKeys: {\n    fa: 'کلیدهای مقصد'\n  },\n  nodeId: {\n    fa: 'برگ درختواره '\n  },\n  destinationValues: {\n    fa: 'مقادیر ستون ها'\n  },\n  sourceFieldFormulas: {\n    fa: 'مقداردهی ستون ها'\n  },\n  rightSide: {\n    fa: 'طرف راست شرط'\n  },\n  leftSide: {\n    fa: 'طرف چپ شرط'\n  },\n  operator: {\n    fa: 'عملگر شرط'\n  },\n  sourcePeriodId: {\n    fa: 'دوره مالی مبدا'\n  },\n  calculationPeriodId: {\n    fa: 'دوره مالی محاسبات'\n  },\n  apportionAccountType: {\n    fa: 'کد حساب معین'\n  },\n  functions: {\n    fa: 'توابع'\n  },\n  formErrors: {\n    fa: 'فهرست خطاهای فرم'\n  },\n  referenceColumn: {\n    fa: 'ستون شرط حساب مقصد'\n  },\n  addDestinationAccountCode: {\n    fa: 'اضافه کردن کد حساب'\n  },\n  removeDestinationAccountCode: {\n    fa: 'حذف کد حساب'\n  },\n  withFlow: {\n    fa: 'دارای گردش حساب'\n  },\n  accountCode: {\n    fa: 'کد حساب'\n  },\n  operatorPl: {\n    fa: 'عملگر'\n  },\n  columnFunctionPl: {\n    fa: 'نحوه مقداردهی'\n  },\n  addOtherField: {\n    fa: 'اضافه'\n  },\n  colPl: {\n    fa: 'ستون'\n  },\n  documentProperties: {\n    fa: ''\n  }\n};\nwindow.dynamicDocumentTypes = [{\n  text: \"محاسباتی سطری\",\n  enText: \"Computational\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"تسهیم\",\n  enText: \"Apportionment\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"انتقال\",\n  enText: \"Transferor\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"تجمیع\",\n  enText: \"Aggregation\",\n  value: 4,\n  color: \"\"\n}, {\n  text: \"ستونی\",\n  enText: \"Column\",\n  value: 5,\n  color: \"\"\n}, {\n  text: \"حذف هزینه\",\n  enText: \"DeleteCost\",\n  value: 6,\n  color: \"\"\n}];\n\n//# sourceURL=webpack://domino/./src/scripts/pages/dynamicdocument/resource.main.js?");

/***/ }),

/***/ "./src/scripts/pages/dynamicdocument/viewModel.js":
/*!********************************************************!*\
  !*** ./src/scripts/pages/dynamicdocument/viewModel.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"DynamicDocumentViewModel\": () => (/* binding */ DynamicDocumentViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _master_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/model */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model */ \"./src/scripts/pages/dynamicdocument/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/dynamicdocument/resource.js\");\n\n__webpack_require__(/*! ./resource.main.js */ \"./src/scripts/pages/dynamicdocument/resource.main.js\");\n\n\n\n\nfunction DynamicDocumentViewModel() {\n  var self = this;\n  self.showResultsModal = ko.observable(false);\n  self.resultsModel = ko.observable();\n\n  self.showResults = function () {\n    var item = _h.kocnx().formModel();\n\n    var sTable = self.getTable(item.documentProperties().sourceTableId());\n    var dataModel;\n\n    switch (item.dynamicDocumentType()) {\n      case 1:\n      case 5:\n        dataModel = {\n          sourceTable: sTable,\n          sourceTableCondition: _h.normalizeAmpersand(item.documentProperties().sourceTableCondition()),\n          type: item.dynamicDocumentType()\n        };\n        break;\n\n      case 4:\n        var cTable = self.getTable(item.documentProperties().calculationTableId());\n        dataModel = {\n          sourceTable: sTable,\n          sourceTableCondition: _h.normalizeAmpersand(item.documentProperties().sourceTableCondition()),\n          expenseCenterTable: cTable,\n          expenseCenterTableCondition: _h.normalizeAmpersand(item.documentProperties().calculationTableCondition()),\n          type: item.dynamicDocumentType(),\n          sourcePeriodId: item.documentProperties().sourcePeriodId(),\n          calculationPeriodId: item.documentProperties().calculationPeriodId()\n        };\n        break;\n\n      default:\n        var eTable = self.getTable(item.documentProperties().expenseCenterTableId());\n        dataModel = {\n          sourceTable: sTable,\n          documentCode: item.code(),\n          sourceTableCondition: _h.normalizeAmpersand(item.documentProperties().sourceTableCondition()),\n          treeId: item.documentProperties().treeId(),\n          nodeIdList: item.documentProperties().nodeIdList(),\n          expenseCenterTable: eTable,\n          expenseCenterTableCondition: _h.normalizeAmpersand(item.documentProperties().expenseCenterTableCondition()),\n          destinationAccountCodes: item.documentProperties().destinationAccountCodes(),\n          type: item.dynamicDocumentType()\n        };\n        break;\n    }\n\n    var model = new _model__WEBPACK_IMPORTED_MODULE_2__.SourceTableDataViewModel(dataModel);\n    self.resultsModel(model);\n    self.resultsModel().init();\n    self.showResultsModal(true);\n    $(\".preview-box\").draggable({\n      scroll: true,\n      handle: \".panel-heading\"\n    });\n  };\n\n  self.hideRrsults = function () {\n    self.showResultsModal(false);\n    self.resultsModel(null);\n  };\n\n  self.getTable = function (id) {\n    var table = null;\n\n    for (var i = 0; i < self.allTableSelectList().length; i++) {\n      var target = self.allTableSelectList()[i];\n      if (target.value() === id) table = target;\n    }\n\n    return table;\n  };\n\n  self.allTableSelectList = ko.observableArray();\n  self.treeList = ko.observableArray();\n  self.treeColumnsList = ko.observableArray();\n  self.periodSelectList = [];\n\n  self.getTreeList = function () {\n    self.apiService.request({\n      name: \"/api/common/getmappingtreelist\",\n      data: {\n        controllerName: this.controllerName\n      },\n      success: function success(data) {\n        self.treeList.removeAll();\n        self.treeColumnsList.removeAll();\n        if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n          var target = data[j];\n          if (target.assignmentType === 2 && target.valueType === 0) self.treeList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.SelectItem({\n            text: target.name,\n            value: target.id\n          }));\n          if (_h.kocnx().loginCompanyType() === 1 && (target.treeType === 7 || target.treeType === 8 || target.treeType === 2 || target.treeType === 3)) self.treeColumnsList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.TreeSelectItem(target));\n          if (_h.kocnx().loginCompanyType() === 0 && (target.treeType === 7 || target.treeType === 8)) self.treeColumnsList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.TreeSelectItem(target));\n        }\n      }\n    });\n  };\n\n  self.treeFormulaList = ko.observableArray();\n\n  self.getTreeFormulaSelectList = function () {\n    self.apiService.request({\n      name: \"getGeneralTreeList\",\n      data: {\n        controllerName: this.controllerName\n      },\n      success: function success(data) {\n        self.treeFormulaList.removeAll();\n\n        if (!_h.isNullOrEmpty(data)) {\n          for (var j = 0; j < data.length; j++) {\n            var item = new _master_model__WEBPACK_IMPORTED_MODULE_1__.TreeFormulaSelectItem(data[j]);\n            self.treeFormulaList.push(item);\n          }\n        }\n      },\n      error: function error() {\n        var text = _h.getApiMessage(\"ErrorLoadTree\");\n\n        _h.failToast(text);\n      }\n    });\n  };\n\n  self.getPeriodList = function () {\n    self.periodSelectList = [];\n    self.apiService.request({\n      name: \"/api/common/getperiodlist\",\n      data: {\n        controllerName: this.controllerName\n      },\n      success: function success(data) {\n        if (_h.any(data)) for (var i = 0; i < data.length; i++) {\n          self.periodSelectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.PeriodSelectItem(data[i]));\n        }\n      },\n      error: function error() {\n        self.periodSelectList = [];\n      }\n    });\n  };\n\n  self.getDynamicTable = function () {\n    self.apiService.request({\n      name: \"getTableList\",\n      data: {\n        controllerName: self.controllerName\n      },\n      success: function success(data) {\n        self.allTableSelectList.removeAll();\n        if (data !== null && data !== undefined && data.length > 0) for (var j = 0; j < data.length; j++) {\n          var target = data[j];\n          self.allTableSelectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.TableSelectItem(target));\n        }\n      },\n      error: function error() {\n        toast.error(self.entityName, \"getSelectList\", \"TableList\");\n      }\n    });\n  };\n\n  self.createBtn = function () {\n    self.getLastPriority(function (res) {\n      _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.DynamicDocumentForm(self, false, res));\n    });\n  };\n\n  self.editBtn = function () {\n    var item = self.multiCommandExecute(\"selectedRowRecord\");\n    self.getLastPriority(function (res) {\n      self.onlySelectedRow(item);\n\n      _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.DynamicDocumentForm(self, true, res));\n    });\n  };\n\n  self.copyBtn = function () {\n    var item = self.multiCommandExecute(\"selectedRowRecord\");\n    var idList = [];\n    idList.push(item.id());\n    self.copy(idList, 1);\n  };\n\n  self.copiesBtn = function () {\n    var idList = self.multiCommandExecute(\"selectedItemIds\");\n\n    if (idList.length === 0) {\n      var text = _h.getApiMessage(\"ActionSelectListEmptyError\");\n\n      _h.warningToast(text);\n    } else {\n      self.copy(idList, 0);\n    }\n  };\n\n  self.copy = function (idList) {\n    var model = {\n      idList: idList\n    };\n    self.apiService.request({\n      name: \"postCopy\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          self.afterCreate(data.models);\n          self.updateExtraParams(data);\n          if (idList.length > 1) toast.success(self.entityName, 'custom', \"Copies\");\n          if (idList.length === 1) toast.success(self.entityName, 'custom', \"Copy\");\n        }\n      },\n      error: function error() {\n        if (idList.length > 1) toast.error(self.entityName, 'custom', \"Copies\");\n        if (idList.length === 1) toast.error(self.entityName, 'custom', \"Copy\");\n      }\n    });\n  };\n\n  self.calculateDocumentBtn = function () {\n    var item = self.multiCommandExecute(\"selectedRowRecord\");\n    var idList = [];\n    idList.push(item.id());\n    var model = {\n      idList: idList\n    };\n    self.startCalculateDocument(model);\n  };\n\n  self.calculateDocumentsBtn = function () {\n    var idList = self.multiCommandExecute(\"selectedItemIds\");\n\n    if (idList.length === 0) {\n      var text = _h.getApiMessage(\"ActionSelectListEmptyError\");\n\n      _h.warningToast(text);\n    } else {\n      var model = {\n        idList: idList\n      };\n      self.startCalculateDocument(model);\n    }\n  };\n\n  self.startCalculateDocument = function (model) {\n    self.apiService.request({\n      name: \"postDocumentsCalculation\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.kocnx().checkProcessQueue();\n\n          localStorage.setItem(\"ProcessToken\", \"\");\n        }\n      },\n      error: function error() {}\n    });\n  };\n\n  self.deleteCalculateDocumentBtn = function () {\n    var idList = self.multiCommandExecute(\"selectedItemIds\");\n    model = {\n      idList: idList\n    };\n    self.deleteCalculateDocuments(model);\n  };\n\n  self.deleteCalculateDocumentsBtn = function () {\n    var idList = self.multiCommandExecute(\"selectedItemIds\");\n\n    if (idList.length === 0) {\n      var text = _h.getApiMessage(\"ActionSelectListEmptyError\");\n\n      _h.warningToast(text);\n    } else {\n      model = {\n        idList: idList\n      };\n      self.deleteCalculateDocuments(model);\n    }\n  };\n\n  self.deleteCalculateDocuments = function (model) {\n    self.apiService.request({\n      name: \"postRemoveCalculation\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          self.afterUpdate(data.models);\n          if (model.idList.length > 1) toast.success(self.entityName, 'custom', \"DeleteCalculateDocuments\");\n          if (model.idList.length === 1) toast.success(self.entityName, 'custom', \"DeleteCalculateDocument\");\n        }\n      },\n      error: function error() {\n        if (model.idList.length > 1) toast.error(self.entityName, 'custom', \"DeleteCalculateDocuments\");\n        if (model.idList.length === 1) toast.error(self.entityName, 'custom', \"DeleteCalculateDocument\");\n      }\n    });\n  };\n\n  self.changesLocalState = function (ids, action) {\n    ko.utils.arrayFilter(self.records(), function (record) {\n      if (ids.indexOf(record.id()) !== -1) {\n        record.stateType(action);\n        record.selected(false);\n      }\n    });\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"DynamicDocument\",\n    apiService: {\n      actionList: [\"filterby\", \"post\", \"put\", \"delete\", \"gettreelist\", \"postdocumentscalculation\", \"getaccountcodeautocomplete\", \"postcopy\", \"postremovecalculation\", \"getfolderautocomplete\", \"getperiodlist\"]\n    },\n    getList: true,\n    buttons: [{\n      name: 'edit',\n      access: true,\n      icon: 'Edit',\n      cMenu: true\n    }, {\n      name: 'delete',\n      access: true,\n      icon: 'Delete',\n      cMenu: true\n    }, {\n      name: 'disable',\n      access: true,\n      icon: 'DocDisable',\n      cMenu: true\n    }, {\n      name: 'enable',\n      access: true,\n      icon: 'DocEnable',\n      cMenu: true\n    }, {\n      name: 'disables',\n      access: true,\n      icon: 'DocsDisable',\n      cMenu: true\n    }, {\n      name: 'enables',\n      access: true,\n      icon: 'DocsEnable',\n      cMenu: true\n    }, {\n      name: 'copy',\n      access: true,\n      icon: 'Copy',\n      cMenu: true\n    }, {\n      name: 'copies',\n      access: true,\n      icon: 'Copy',\n      cMenu: true\n    }, {\n      name: 'calculateDocument',\n      access: true,\n      icon: 'CalculateDocument',\n      cMenu: true\n    }, {\n      name: 'calculateDocuments',\n      access: true,\n      icon: 'CalculateDocument',\n      cMenu: true\n    }, {\n      name: 'deleteCalculateDocument',\n      access: true,\n      icon: 'CalculateDocumentDelete',\n      cMenu: true\n    }, {\n      name: 'deleteCalculateDocuments',\n      access: true,\n      icon: 'CalculateDocumentDelete',\n      cMenu: true\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'create',\n      access: false,\n      cMenu: false\n    }],\n    extraParams: [\"lastPriority\"],\n    filters: [],\n    sortDirection: \"Ascending\",\n    sortProperty: \"id\",\n    context: self,\n    saveState: true,\n    isMultiSelectRows: true,\n    cols: dynamicdocumentModelRes,\n    searchKeyType: \"enter\",\n    tableStyle: \"table-layout: fixed;\",\n    selectRow: true,\n    folderManagement: true,\n    contextMenu: true,\n    resizable: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    var context = _h.kocnx();\n\n    var permitPeriodEdit = context.permitPeriodEdit();\n    var data = self.multiCommandExecute(\"btnVisibilityData\");\n    if (_h.isNullOrEmpty(data)) return;\n    var temp = data[0];\n    var enableCount = data[1];\n    var disableCount = data[2];\n    var selectedList = data[3];\n    var rightDocumentsCount = data[4];\n\n    if (selectedList === 0) {\n      self.viscreate(permitPeriodEdit);\n      self.vistools(true);\n      self.visedit(false);\n      self.visdelete(false);\n      self.visdisables(false);\n      self.visenables(false);\n      self.visdisable(false);\n      self.visenable(false);\n      self.viscalculateDocument(false);\n      self.viscalculateDocuments(false);\n      self.visdeleteCalculateDocument(false);\n      self.visdeleteCalculateDocuments(false);\n      self.viscopy(false);\n      self.viscopies(false);\n    }\n\n    if (selectedList === 1) {\n      var item = self.getSelectedRecord();\n      if (item === undefined || item === null) item = temp;\n      var isEditable = item.isEditable();\n      self.viscreate(permitPeriodEdit);\n      self.vistools(true);\n      self.visedit(permitPeriodEdit && isEditable);\n      self.visdelete(permitPeriodEdit && isEditable);\n      self.visdisables(false);\n      self.visenables(false);\n      self.visdisable(permitPeriodEdit && disableCount >= 0 && enableCount > 0);\n      self.visenable(permitPeriodEdit && disableCount >= 0 && enableCount === 0);\n      self.viscalculateDocument(permitPeriodEdit && isEditable);\n      self.viscalculateDocuments(false);\n      self.visdeleteCalculateDocument(permitPeriodEdit && isEditable && rightDocumentsCount > 0);\n      self.visdeleteCalculateDocuments(false);\n      self.viscopy(true);\n      self.viscopies(false);\n    }\n\n    if (selectedList > 1) {\n      self.viscreate(false);\n      self.vistools(true);\n      self.visedit(false);\n      self.visdelete(false);\n      self.visdisable(false);\n      self.visenable(false);\n      self.viscalculateDocument(false);\n      self.visdisables(permitPeriodEdit && disableCount >= 0 && enableCount > 0 && rightDocumentsCount > 0);\n      self.visenables(permitPeriodEdit && disableCount >= 0 && enableCount === 0 && rightDocumentsCount > 0);\n      self.viscalculateDocuments(permitPeriodEdit);\n      self.visdeleteCalculateDocument(false);\n      self.visdeleteCalculateDocuments(permitPeriodEdit && rightDocumentsCount > 0);\n      self.viscopy(false);\n      self.viscopies(true);\n    }\n\n    self.vishelp(true);\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.getDynamicTable();\n    self.getTreeList();\n    self.getPeriodList();\n    self.getFolderList();\n    setTimeout(function () {\n      self.getTreeFormulaSelectList();\n    }, 350);\n  };\n\n  self.changeCalculateDocumentsStatus = function (dataList) {\n    var itemList = self.multiCommandExecute(\"selectedItems\");\n\n    if (itemList && itemList.length) {\n      for (var j = 0; j < itemList.length; j++) {\n        if (dataList && dataList.length) for (var i = 0; i < dataList.length; i++) {\n          if (itemList[j].id() === dataList[i].id) itemList[j].documentCalculationState(dataList[i].documentCalculationState);\n        }\n      }\n    }\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/dynamicdocument/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/dynamictable/model.js":
/*!*************************************************!*\
  !*** ./src/scripts/pages/dynamictable/model.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"DynamicTable\": () => (/* binding */ DynamicTable),\n/* harmony export */   \"DynamicTableData\": () => (/* binding */ DynamicTableData),\n/* harmony export */   \"DynamicTableDataViewModel\": () => (/* binding */ DynamicTableDataViewModel),\n/* harmony export */   \"DynamicTableForm\": () => (/* binding */ DynamicTableForm),\n/* harmony export */   \"Field\": () => (/* binding */ Field),\n/* harmony export */   \"FieldForm\": () => (/* binding */ FieldForm)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var _autoMapper = __webpack_require__(/*! ./src/scripts/util/autoMapper.js */ \"./src/scripts/util/autoMapper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\nvar _require = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\"),\n    BaseModel = _require.BaseModel,\n    BaseFormModel = _require.BaseFormModel,\n    BaseInnerModel = _require.BaseInnerModel;\n\n\nvar DynamicTable = /*#__PURE__*/function (_BaseModel) {\n  _inherits(DynamicTable, _BaseModel);\n\n  var _super = _createSuper(DynamicTable);\n\n  function DynamicTable(model) {\n    var _this;\n\n    _classCallCheck(this, DynamicTable);\n\n    _this = _super.call(this, model);\n    _this.fieldsShow = ko.observable(false);\n    _this.fields = ko.observableArray();\n    if (_h.any(model.fields)) for (var j = 0; j < model.fields.length; j++) {\n      var record = new Field(model.fields[j]);\n\n      _this.fields.push(record);\n    }\n    return _this;\n  }\n\n  _createClass(DynamicTable, [{\n    key: \"refreshModel\",\n    value: function refreshModel(model) {\n      var fields = ko.toJS(model.fields);\n\n      _autoMapper.fillModel(this, model);\n\n      this.fields.removeAll();\n      if (_h.any(fields)) for (var j = 0; j < fields.length; j++) {\n        var record = new Field(fields[j]);\n        this.fields.push(record);\n      }\n    }\n  }]);\n\n  return DynamicTable;\n}(BaseModel);\nvar Field = /*#__PURE__*/function (_BaseInnerModel) {\n  _inherits(Field, _BaseInnerModel);\n\n  var _super2 = _createSuper(Field);\n\n  function Field(model) {\n    var _this2;\n\n    _classCallCheck(this, Field);\n\n    _this2 = _super2.call(this, model);\n    _this2.hasFormat = ko.observable(false);\n    _this2.index = ko.observable(model.index || false);\n    return _this2;\n  }\n\n  return _createClass(Field);\n}(BaseInnerModel);\nfunction FieldForm() {\n  var self = this;\n  self.fieldName = ko.observable();\n  self.order = ko.observable();\n  self.dataType = ko.observable();\n  self.dataFormat = ko.observable();\n  self.index = ko.observable(false);\n  self.hasFormat = ko.observable(false);\n  self.dataFormats = ko.observableArray();\n  self.dataType.subscribe(function (newValue) {\n    self.refreshDataType(newValue);\n  });\n\n  self.refreshDataType = function (newValue) {\n    self.hasFormat(false);\n    if (newValue !== 7) self.dataFormats.removeAll();\n\n    if (!_h.isNullOrEmpty(newValue)) {\n      switch (newValue) {\n        case 3:\n          self.hasFormat(true);\n          self.dataFormats([{\n            text: \"1\",\n            value: \"1\"\n          }, {\n            text: \"1.1\",\n            value: \"1.1\"\n          }]);\n          break;\n\n        case 4:\n          self.hasFormat(true);\n          self.dataFormats([{\n            text: \"yyyymmdd\",\n            value: \"yyyymmdd\"\n          }, {\n            text: \"jyyyyjmmjdd\",\n            value: \"jyyyyjmmjdd\"\n          }, {\n            text: \"yyyy/mm/dd\",\n            value: \"yyyy/mm/dd\"\n          }, {\n            text: \"jyyyy/jmm/jdd\",\n            value: \"jyyyy/jmm/jdd\"\n          }, {\n            text: \"yyyy-mm-dd\",\n            value: \"yyyy-mm-dd\"\n          }, {\n            text: \"jyyyy-jmm-jdd\",\n            value: \"jyyyy-jmm-jdd\"\n          }]);\n          break;\n\n        case 5:\n          self.hasFormat(true);\n          self.dataFormats([{\n            text: \"false|true\",\n            value: \"false|true\"\n          }, {\n            text: \"no|yes\",\n            value: \"no|yes\"\n          }, {\n            text: \"0|1\",\n            value: \"0|1\"\n          }]);\n          break;\n\n        case 7:\n          self.hasFormat(true);\n          if (self.dataFormats().length === 0) self.dataFormats.push({\n            text: \"\",\n            value: \"\"\n          });\n          break;\n      }\n    }\n  };\n\n  self.addEnumItem = function () {\n    self.dataFormats.push({\n      text: \"\",\n      value: \"\"\n    });\n  };\n\n  self.validationObject = ko.validatedObservable({\n    fieldName: self.fieldName.extend({\n      required: true,\n      minLength: 1,\n      maxLength: 50\n    }),\n    dataType: self.dataType.extend({\n      required: true\n    })\n  });\n\n  self.createTagId = function () {\n    return \"Field-\" + self.order();\n  };\n\n  self.toggleIndex = function () {\n    self.index(!self.index());\n  };\n\n  self.fillModel = function (model) {\n    self.fieldName(model.fieldName());\n    self.order(model.order());\n    self.dataType(model.dataType());\n    self.index(model.index());\n    self.dataFormat(model.dataFormat());\n    self.dataFormats(model.dataFormats());\n    self.refreshDataType(model.dataType());\n  };\n}\nvar DynamicTableForm = /*#__PURE__*/function (_BaseFormModel) {\n  _inherits(DynamicTableForm, _BaseFormModel);\n\n  var _super3 = _createSuper(DynamicTableForm);\n\n  function DynamicTableForm(viewModel, editMode, res) {\n    var _this3;\n\n    _classCallCheck(this, DynamicTableForm);\n\n    _this3 = _super3.call(this, viewModel, editMode);\n    _this3.lastPriority = ko.observable();\n    _this3.fields = ko.observableArray();\n\n    if (editMode) {\n      _this3.lastPriority(res);\n\n      var model = viewModel.multiCommandExecute(\"selectedRowRecord\");\n      if (_h.any(model.fields())) for (var i = 0; i < model.fields().length; i++) {\n        var record = new FieldForm();\n        record.fillModel(model.fields()[i]);\n\n        _this3.fields.push(record);\n      }\n    } else {\n      _this3.lastPriority(res + 1);\n\n      _this3.priority(res + 1);\n\n      _this3.addField();\n    }\n\n    _this3.setValidationObject();\n\n    _this3.createForm();\n\n    return _this3;\n  }\n\n  _createClass(DynamicTableForm, [{\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      this.validationObject = ko.validatedObservable({\n        fields: self.fields,\n        name: self.name.extend({\n          required: true,\n          remoteIsUniqueRule: {\n            params: [self.id, \"DynamicTable\", \"name\"]\n          },\n          minLength: 3,\n          maxLength: 100\n        }),\n        priority: self.priority.extend({\n          required: true,\n          number: true\n        })\n      });\n    }\n  }, {\n    key: \"addField\",\n    value: function addField() {\n      var record = new FieldForm({\n        fieldId: 0,\n        fieldCode: 0,\n        fieldName: \"\",\n        dataType: 0\n      });\n      this.fields.push(record);\n    }\n  }, {\n    key: \"removeField\",\n    value: function removeField(parent) {\n      if (parent.fields().length > 1) parent.fields.remove(this);\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tsp',\n        val: this.priority,\n        min: 1,\n        max: this.editMode() === true ? this.lastPriority() : this.priority()\n      }, {\n        t: 'txb',\n        val: this.name\n      }), this.createLine({\n        t: 'slc',\n        val: this.folderId,\n        options: this.parentVM.folderList\n      }, null, true, 30), this.createLine({\n        t: 'tm',\n        templateName: 'dynamictable-fields-form-t'\n      }, undefined, true, 30, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'create',\n            vis: !this.editMode(),\n            click: this.parentVM.create\n          }, {\n            name: 'edit',\n            vis: this.editMode,\n            click: this.parentVM.edit\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return DynamicTableForm;\n}(BaseFormModel);\nvar DynamicTableData = /*#__PURE__*/function (_BaseModel2) {\n  _inherits(DynamicTableData, _BaseModel2);\n\n  var _super4 = _createSuper(DynamicTableData);\n\n  function DynamicTableData(model) {\n    var _this4;\n\n    _classCallCheck(this, DynamicTableData);\n\n    _this4 = _super4.call(this, model);\n    if (_h.any(model.cells)) for (var j = 0; j < model.cells.length; j++) {\n      var field = model.cells[j];\n      _this4[field.order] = field.value;\n    }\n    _this4.styleRowValue = ko.pureComputed(function () {\n      if (this.stateType() === 0) return 'color: #ccc;';\n      return '';\n    }.bind(_assertThisInitialized(_this4)));\n    return _this4;\n  }\n\n  return _createClass(DynamicTableData);\n}(BaseModel);\nvar DynamicTableDataViewModel = /*#__PURE__*/function () {\n  function DynamicTableDataViewModel(cols) {\n    _classCallCheck(this, DynamicTableDataViewModel);\n\n    ko.utils.extend(this, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n      entityName: \"DynamicTableData\",\n      apiService: {\n        actionList: [\"filterby\", \"delete\"]\n      },\n      buttons: [{\n        name: 'disables',\n        access: true,\n        icon: 'DocsDisable',\n        cMenu: true\n      }, {\n        name: 'enables',\n        access: true,\n        icon: 'DocsEnable',\n        cMenu: true\n      }, {\n        name: 'disable',\n        access: true,\n        icon: 'DocDisable',\n        cMenu: true\n      }, {\n        name: 'enable',\n        access: true,\n        icon: 'DocEnable',\n        cMenu: true\n      }, {\n        name: 'deleteAll',\n        access: false,\n        icon: 'Delete',\n        cMenu: false\n      }, {\n        name: 'importExcel',\n        access: false,\n        icon: 'ImportExcel',\n        cMenu: false,\n        action: _h.kocnx().tavm().importExcelBtn\n      }, {\n        name: 'exportExcelFile',\n        access: false,\n        icon: 'ExportExcel',\n        cMenu: false\n      }, {\n        name: 'help',\n        access: false,\n        cMenu: false\n      }, {\n        name: 'refresh',\n        access: false,\n        cMenu: false\n      }, {\n        name: 'tools',\n        access: false,\n        cMenu: false\n      }],\n      filters: [{\n        name: \"tableId\"\n      }],\n      sortDirection: \"\",\n      sortProperty: \"\",\n      context: this,\n      dynamicCols: true,\n      extraParams: [],\n      saveState: true,\n      cols: cols,\n      getList: true,\n      selectRow: true,\n      contextMenu: true,\n      searchKeyType: \"enter\",\n      styleRow: \"styleRowValue\",\n      tableStyle: \"margin-top: 120px;width: 200%;margin-top: 10px;table-layout:initial;\",\n      isMultiSelectRows: true\n    }));\n    this.btnVisibility = ko.computed(function () {\n      var context = _h.kocnx();\n\n      var permitPeriodEdit = context.permitPeriodEdit();\n      this.visexportExcelFile(true);\n      this.visimportExcel(permitPeriodEdit && !context.periodItem().cl);\n      this.visdeleteAll(permitPeriodEdit && !context.periodItem().cl);\n      var enableCount = 0;\n      var disableCount = 0;\n      var selectedList = 0;\n      var selectedRow = null;\n\n      for (var i = 0; i < this.records().length; i++) {\n        var record = this.records()[i];\n\n        if (record.selected()) {\n          selectedRow = record;\n          if (record.stateType() === 0) disableCount++;\n          if (record.stateType() === 1) enableCount++;\n          selectedList++;\n        }\n      }\n\n      if (selectedList === 0) {\n        this.visdisable(false);\n        this.visenable(false);\n        this.visdisables(false);\n        this.visenables(false);\n      }\n\n      if (selectedList === 1) {\n        this.visdisable(permitPeriodEdit && !context.periodItem().cl && selectedRow.stateType() === 1);\n        this.visenable(permitPeriodEdit && !context.periodItem().cl && selectedRow.stateType() === 0);\n        this.visdisables(false);\n        this.visenables(false);\n      }\n\n      if (selectedList > 1) {\n        this.visdisable(false);\n        this.visenable(false);\n        this.visdisables(permitPeriodEdit && !context.periodItem().cl && disableCount >= 0 && enableCount > 0);\n        this.visenables(permitPeriodEdit && !context.periodItem().cl && disableCount >= 0 && enableCount === 0);\n      }\n\n      this.vishelp(true);\n      this.visrefresh(true);\n      this.vistools(true);\n    }.bind(this));\n    this.countSelectedRecord = ko.pureComputed(function () {\n      var count = 0;\n\n      for (var i = 0; i < this.records().length; i++) {\n        var record = this.records()[i];\n        if (record.selected()) count++;\n      }\n\n      return count;\n    }.bind(this));\n  }\n\n  _createClass(DynamicTableDataViewModel, [{\n    key: \"exportExcelFileBtn\",\n    value: function exportExcelFileBtn() {\n      var filterModel = this.createFilterByModel();\n      var model = {\n        controllerName: 49,\n        inputData: filterModel\n      };\n      var cols = [];\n\n      for (var i = 0; i < this.tableProperties().length; i++) {\n        var record = this.tableProperties()[i];\n        if (record.visibleCol()) cols.push(record.name);\n      }\n\n      model.inputData.columns = cols;\n\n      _h.kocnx().createExcel(model);\n    }\n  }, {\n    key: \"deleteAllBtn\",\n    value: function deleteAllBtn() {\n      var confirmText = toast.createMessage(this.entityName, 'delrange', null, 'confirm');\n\n      _h.confirmDeleteAlert(confirmText, function (res) {\n        if (res) {\n          this.apiService.request({\n            name: \"delete\",\n            data: {\n              id: this.tableId()\n            },\n            success: function (data) {\n              this.records.removeAll();\n              toast.success(this.entityName, 'delrange');\n            }.bind(this),\n            error: function () {\n              toast.error(this.entityName, 'delrange');\n            }.bind(this)\n          });\n        }\n      }.bind(this));\n    }\n  }, {\n    key: \"init\",\n    value: function init() {\n      this.fillTableProperties();\n      this.getRecords();\n    }\n  }]);\n\n  return DynamicTableDataViewModel;\n}();\n\n//# sourceURL=webpack://domino/./src/scripts/pages/dynamictable/model.js?");

/***/ }),

/***/ "./src/scripts/pages/dynamictable/resource.js":
/*!****************************************************!*\
  !*** ./src/scripts/pages/dynamictable/resource.js ***!
  \****************************************************/
/***/ (() => {

eval("window.dynamictableModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  fieldsShow: {\n    fa: 'فیلدهای جدول داده',\n    colName: 'fieldsShow',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    disableSort: true,\n    type: \"template\",\n    templateName: \"details-table-template\",\n    size: 12\n  },\n  priority: {\n    fa: 'اولویت',\n    colName: 'priority',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"Ascending\",\n    alias: null,\n    size: 10,\n    type: \"string\"\n  },\n  code: {\n    fa: 'کد',\n    colName: 'code',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 10,\n    type: \"string\"\n  },\n  name: {\n    fa: 'نام',\n    colName: 'name',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"dynamictable-name-template\"\n  },\n  folderName: {\n    fa: 'پوشه',\n    colName: 'folderName',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: \"folderId\",\n    groupBy: true,\n    groupDir: \"Ascending\",\n    type: \"string\"\n  },\n  fieldName: {\n    fa: 'نام فیلد',\n    colName: 'fieldName',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  dataType: {\n    fa: 'نوع داده',\n    colName: 'dataType',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null\n  },\n  folderId: {\n    fa: 'پوشه',\n    colName: 'folderId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  }\n};\nwindow.dynamictablePageRes = {\n  createCaption: {\n    fa: 'تعریف جدول داده'\n  },\n  editCaption: {\n    fa: 'ویرایش جدول داده'\n  },\n  addFieldBtn: {\n    fa: 'اضافه'\n  },\n  viewFieldCaption: {\n    fa: 'تعریف مشخصات جدول داده'\n  },\n  fieldListCaption: {\n    fa: 'ستون های جدول داده'\n  },\n  deleteCaption: {\n    fa: 'حذف جدول داده'\n  },\n  upCaption: {\n    fa: 'افزایش اولویت جدول داده'\n  },\n  downCaption: {\n    fa: \"کاهش اولویت جدول داده\"\n  },\n  getExcelFileBtn: {\n    fa: \"دریافت فایل اکسل جدول\"\n  },\n  dataFormat: {\n    fa: \"فرمت اطلاعات\"\n  },\n  dataFormatHelp: {\n    fa: \"مقادیر را با علامت | از هم جدا کنید\"\n  },\n  archiveCaption: {\n    fa: \"بایگانی جدول داده\"\n  },\n  unArchiveCaption: {\n    fa: \"لغو بایگانی جدول داده\"\n  },\n  archivesCaption: {\n    fa: \"بایگانی جدول های داده\"\n  },\n  unArchivesCaption: {\n    fa: \"لغو بایگانی جدول های داده\"\n  },\n  showArchived: {\n    fa: 'نمایش جدول های بایگانی شده'\n  },\n  index: {\n    fa: 'ایندکس'\n  },\n  deleteDataCaption: {\n    fa: \"حذف داده های جدول\"\n  },\n  copyCaption: {\n    fa: 'کپی'\n  }\n};\nwindow.dynamictabledataPageRes = {\n  deleteAllCaption: {\n    fa: 'حذف داده های جدول'\n  },\n  returnToPage: {\n    fa: ' برگشت به فهرست جدول های داده'\n  },\n  importExcelCaption: {\n    fa: \"بارگذاری اطلاعات از فایل اکسل\"\n  },\n  exportExcelFileCaption: {\n    fa: \"دریافت فایل اکسل جدول\"\n  },\n  enableCaption: {\n    fa: 'فعال کردن رکورد'\n  },\n  disableCaption: {\n    fa: 'غیر فعال کردن رکورد'\n  },\n  enablesCaption: {\n    fa: 'فعال کردن رکوردها'\n  },\n  disablesCaption: {\n    fa: 'غیر فعال کردن رکوردها'\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/pages/dynamictable/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/dynamictable/viewModel.js":
/*!*****************************************************!*\
  !*** ./src/scripts/pages/dynamictable/viewModel.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"DynamicTableViewModel\": () => (/* binding */ DynamicTableViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./model */ \"./src/scripts/pages/dynamictable/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n__webpack_require__(/*! ./model */ \"./src/scripts/pages/dynamictable/model.js\");\n\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/dynamictable/resource.js\");\n\n\n\nfunction DynamicTableViewModel() {\n  var self = this;\n  self.showTableData = ko.observable(false);\n\n  self.createBtn = function () {\n    self.getLastPriority(function (res) {\n      if (res !== null) {\n        _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_1__.DynamicTableForm(self, false, res));\n      }\n    });\n  };\n\n  self.editBtn = function () {\n    self.getLastPriority(function (res) {\n      if (res !== null) {\n        _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_1__.DynamicTableForm(self, true, res));\n      }\n    });\n  };\n\n  self.archiveBtn = function () {\n    self.changeArchiveState(true);\n  };\n\n  self.unArchiveBtn = function () {\n    self.changeArchiveState(false);\n  };\n\n  self.archivesBtn = function () {\n    self.changeArchiveState(true);\n  };\n\n  self.unArchivesBtn = function () {\n    self.changeArchiveState(false);\n  };\n\n  self.deleteDataBtn = function () {\n    var selectedRecord = self.multiCommandExecute(\"selectedRowRecord\");\n    var confirmText = toast.createMessage(\"DynamicTableData\", 'delrange', null, 'confirm');\n\n    _h.confirmDeleteAlert(confirmText, function (res) {\n      if (res) {\n        self.apiService.request({\n          name: \"/api/dynamictabledata/delete\",\n          data: {\n            id: selectedRecord.id()\n          },\n          success: function success(data) {\n            toast.success(\"DynamicTableData\", 'delrange');\n          },\n          error: function error() {\n            toast.error(\"DynamicTableData\", 'delrange');\n          }\n        });\n      }\n    });\n  };\n\n  self.changeArchiveState = function (action) {\n    var idList = self.multiCommandExecute(\"selectedItemIds\");\n\n    if (idList.length === 0) {\n      var text = _h.getApiMessage(\"ActionSelectListEmptyError\");\n\n      _h.warningToast(text);\n    } else {\n      model = {\n        archive: action,\n        idList: idList\n      };\n    }\n\n    var items = self.multiCommandExecute(\"selectedItems\");\n    self.apiService.request({\n      name: \"putArchiveState\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          if (model.idList.length > 1) {\n            if (action) toast.success(self.entityName, 'custom', \"Archives\");else toast.success(self.entityName, 'custom', \"UnArchives\");\n          }\n\n          if (model.idList.length === 1) {\n            if (action) toast.success(self.entityName, 'custom', \"Archive\");else toast.success(self.entityName, 'custom', \"UnArchive\");\n          }\n\n          if (action === false) {\n            self.afterCreate(data.models);\n          } else {\n            if (_h.isNullOrEmpty(self.groupProperty())) {\n              for (var i = 0; i < items.length; i++) {\n                var item = items[i];\n                self.records.remove(item);\n                self.total(self.total() - model.idList.length);\n              }\n            } else {\n              for (var d = 0; d < items.length; d++) {\n                var gItem = items[d];\n                var gParent = gItem.gParent;\n                gParent.list.remove(gItem);\n              }\n            }\n          }\n        }\n      },\n      error: function error() {\n        if (model.idList.length > 1) {\n          if (action) toast.error(self.entityName, 'custom', \"Archives\");else toast.error(self.entityName, 'custom', \"UnArchives\");\n        }\n\n        if (model.idList.length === 1) {\n          if (action) toast.error(self.entityName, 'custom', \"Archive\");else toast.error(self.entityName, 'custom', \"UnArchive\");\n        }\n      }\n    });\n  };\n\n  self.importExcelBtn = function () {\n    if (self.showTableData()) _h.kocnx().importFileBtn(self.childModel().tableId(), self, \"Excel\", false);else _h.kocnx().importFileBtn(undefined, self, \"Excel\", true);\n  };\n\n  self.viewTableData = function (item) {\n    item = item[0];\n    var cols = [];\n    var idObj = {\n      fa: '#',\n      colName: 'id',\n      tablecol: false,\n      visibleCol: false,\n      sortDir: \"None\",\n      alias: null,\n      type: \"template\",\n      templateName: \"checkbox-table-template\"\n    };\n    cols.push(idObj);\n    if (!_h.isNullOrEmpty(item.fields())) for (var i = 0; i < item.fields().length; i++) {\n      var field = item.fields()[i];\n      var order = field.order().toString();\n      var obj = {\n        fa: field.fieldName(),\n        colName: order,\n        tablecol: true,\n        visibleCol: true,\n        sortDir: \"None\",\n        alias: null,\n        type: \"string\"\n      };\n      if (i === 0) obj.sortDir = \"Ascending\";\n      cols.push(obj);\n    }\n    var model = new _model__WEBPACK_IMPORTED_MODULE_1__.DynamicTableDataViewModel(cols);\n    model.tableId(item.id());\n    model.tableName(item.name());\n    model.tableCode(item.code());\n    self.childModel(model);\n    self.childModel().init();\n    self.showTableData(true);\n  };\n\n  self.returnBack = function () {\n    self.showTableData(false);\n    self.childModel(null);\n  };\n\n  self.copyBtn = function (type, parent) {\n    var item = self.getSelectedRecord();\n    var model = {\n      id: item.id(),\n      copyType: Number(type)\n    };\n    self.apiService.request({\n      name: \"postCopy\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          toast.success(self.entityName, 'custom', \"Copy\");\n          self.afterCreate(data.models);\n        }\n      },\n      error: function error() {\n        toast.error(self.entityName, 'custom', \"Copy\");\n      }\n    });\n  };\n\n  self.connectManBtn = function () {\n    _h.kocnx().openConnectMan(49, \"connectManCaption\");\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"DynamicTable\",\n    apiService: {\n      actionList: [\"filterby\", \"post\", \"put\", \"delete\", \"putarchivestate\", \"postcopy\"]\n    },\n    buttons: [{\n      name: 'edit',\n      access: true,\n      icon: 'Edit',\n      cMenu: true\n    }, {\n      name: 'delete',\n      access: true,\n      icon: 'Delete',\n      cMenu: true\n    }, {\n      name: 'connectMan',\n      access: true,\n      icon: 'DatabaseLink',\n      cMenu: true\n    }, {\n      name: 'archive',\n      access: true,\n      icon: 'Archive',\n      cMenu: true\n    }, {\n      name: 'unArchive',\n      access: true,\n      icon: 'UnArchive',\n      cMenu: true\n    }, {\n      name: 'archives',\n      access: true,\n      icon: 'Archive',\n      cMenu: true\n    }, {\n      name: 'unArchives',\n      access: true,\n      icon: 'UnArchive',\n      cMenu: true\n    }, {\n      name: 'copy',\n      access: true,\n      cMenu: true,\n      templateName: \"copydynatable-button-template\",\n      icon: 'Copy'\n    }, {\n      name: 'deleteData',\n      access: true,\n      icon: 'ListDelete',\n      cMenu: true\n    }, {\n      name: 'up',\n      access: true,\n      icon: 'Up',\n      cMenu: true\n    }, {\n      name: 'down',\n      access: true,\n      icon: 'Down',\n      cMenu: true\n    }, {\n      name: 'importExcel',\n      access: true,\n      icon: 'ImportExcel',\n      cMenu: true\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'create',\n      access: true,\n      cMenu: false\n    }],\n    filters: [{\n      name: 'showArchived',\n      type: \"bool\",\n      source: \"null\"\n    }],\n    sortDirection: \"Ascending\",\n    sortProperty: \"priority\",\n    context: self,\n    cols: dynamictableModelRes,\n    extraParams: [\"lastPriority\"],\n    saveState: true,\n    getList: true,\n    selectRow: true,\n    contextMenu: true,\n    isMultiSelectRows: true,\n    searchKeyType: \"enter\",\n    folderManagement: true,\n    showDetails: {\n      headerIcon: \"fa fa-2x fa-columns\",\n      headerRes: \"fieldListCaption\",\n      template: \"fields-details-template\",\n      toggleParam: \"fieldsShow\",\n      toggleFunc: \"toggleFields\"\n    },\n    resizable: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    var context = _h.kocnx();\n\n    var permitPeriodEdit = context.permitPeriodEdit();\n    var data = self.multiCommandExecute(\"btnVisibilityData4\");\n    if (_h.isNullOrEmpty(data)) return;\n    var temp = data[0];\n    var archiveCount = data[1];\n    var unArchiveCount = data[2];\n    var selectedList = data[3];\n\n    if (selectedList === 0) {\n      self.visdelete(false);\n      self.visedit(false);\n      self.visup(false);\n      self.visdown(false);\n      self.visarchive(false);\n      self.visunArchive(false);\n      self.visarchives(false);\n      self.visunArchives(false);\n      self.visdeleteData(false);\n      self.visdelete(false);\n      self.viscopy(false);\n    }\n\n    if (selectedList === 1) {\n      self.visdelete(true);\n      self.visedit(true);\n      self.visup(temp.priority() > 1);\n      self.visdown(self.lastPriority() !== temp.priority());\n      self.visunArchive(permitPeriodEdit && unArchiveCount >= 0 && archiveCount > 0);\n      self.visarchive(permitPeriodEdit && unArchiveCount >= 0 && archiveCount === 0);\n      self.visarchives(false);\n      self.visunArchives(false);\n      self.visdeleteData(permitPeriodEdit && !context.periodItem().cl);\n      self.viscopy(true);\n    }\n\n    if (selectedList > 1) {\n      self.visdelete(false);\n      self.visedit(false);\n      self.visup(false);\n      self.visdown(false);\n      self.visarchive(false);\n      self.visunArchive(false);\n      self.visarchives(permitPeriodEdit && unArchiveCount >= 0 && archiveCount === 0);\n      self.visunArchives(permitPeriodEdit && unArchiveCount >= 0 && archiveCount > 0);\n      self.visdeleteData(false);\n      self.viscopy(false);\n    }\n\n    self.visconnectMan(true);\n    self.viscreate(true);\n    self.vishelp(true);\n    self.visrefresh(true);\n    self.vistools(true);\n    self.visimportExcel(true);\n  });\n\n  self.toggleFields = function (item) {\n    item.fieldsShow(!item.fieldsShow());\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.getFolderList();\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/dynamictable/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/groupperiod/model.js":
/*!************************************************!*\
  !*** ./src/scripts/pages/groupperiod/model.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"GroupPeriod\": () => (/* binding */ GroupPeriod),\n/* harmony export */   \"GroupPeriodForm\": () => (/* binding */ GroupPeriodForm)\n/* harmony export */ });\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* harmony import */ var _master_model_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/model.js */ \"./src/scripts/pages/master/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar _require = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\"),\n    BaseModel = _require.BaseModel,\n    BaseFormModel = _require.BaseFormModel,\n    FormBuilder = _require.FormBuilder;\n\n\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\n\nvar GroupPeriod = /*#__PURE__*/function (_BaseModel) {\n  _inherits(GroupPeriod, _BaseModel);\n\n  var _super = _createSuper(GroupPeriod);\n\n  function GroupPeriod(model) {\n    _classCallCheck(this, GroupPeriod);\n\n    return _super.call(this, model);\n  }\n\n  return _createClass(GroupPeriod);\n}(BaseModel);\nvar GroupPeriodForm = /*#__PURE__*/function (_BaseFormModel) {\n  _inherits(GroupPeriodForm, _BaseFormModel);\n\n  var _super2 = _createSuper(GroupPeriodForm);\n\n  function GroupPeriodForm(viewModel, editMode, data) {\n    var _this;\n\n    _classCallCheck(this, GroupPeriodForm);\n\n    _this = _super2.call(this, viewModel, editMode, [], [\"\", \"reviewFinancialCaption\"]);\n    _this.width = data.tableTemplates.length > 6 ? '80%' : '50%';\n    _this.periodTemplates = ko.observableArray();\n    _this.magazineFileCode = ko.observable();\n    _this.magazineTitle = ko.observable();\n    _this.description = ko.observable();\n    _this.showDescription = ko.observable(false);\n\n    if (editMode) {\n      _this.magazineFileCode = ko.observable(data.magazineFileCode);\n      _this.magazineTitle = ko.observable(data.magazineTitle);\n\n      for (var p in data.tableTemplates) {\n        if (data.tableTemplates.hasOwnProperty(p)) {\n          _this.periodTemplates.push(new _master_model_js__WEBPACK_IMPORTED_MODULE_1__.TableTemplateInfo(data.tableTemplates[p]));\n        }\n      }\n    }\n\n    _this.condFirst = ko.pureComputed(function () {\n      return !this.showDescription() && this.submitState() !== 2 && this.submitState() !== 3;\n    }, _assertThisInitialized(_this));\n    _this.condSecond = ko.pureComputed(function () {\n      return !this.showDescription() && this.submitState() !== 3;\n    }, _assertThisInitialized(_this));\n    _this.condThird = ko.pureComputed(function () {\n      return this.showDescription();\n    }, _assertThisInitialized(_this));\n\n    _this.setValidationObject();\n\n    _this.createForm();\n\n    return _this;\n  }\n\n  _createClass(GroupPeriodForm, [{\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      self.validationObject = ko.validatedObservable({\n        description: self.description.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.showDescription();\n            }\n          }\n        })\n      });\n    }\n  }, {\n    key: \"toggleShowContent\",\n    value: function toggleShowContent(item) {\n      item.showContent(!item.showContent());\n      this.getTemplateContent(item);\n    }\n  }, {\n    key: \"getTemplateContent\",\n    value: function getTemplateContent(item) {\n      if (_h.isEmpty(item.content())) {\n        var model = {\n          templateId: item.id(),\n          periodId: this.id()\n        };\n        _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n          url: \"/api/groupperiod/gettabletemplatecontent\",\n          data: model,\n          success: function success(data) {\n            item.content(data.data);\n          },\n          error: function error(data) {\n            var text = _h.getApiMessage(\"LoadGroupPeriodDetailError\");\n\n            _h.failToast(text);\n          }\n        });\n      }\n    }\n  }, {\n    key: \"downloadTemplateExcel\",\n    value: function downloadTemplateExcel(item) {\n      var model = {\n        controllerName: 37,\n        inputData: {\n          periodId: this.id(),\n          id: item.id()\n        }\n      };\n\n      _h.kocnx().createExcel(model);\n    }\n  }, {\n    key: \"downloadTemplatePdf\",\n    value: function downloadTemplatePdf(item) {\n      var model = {\n        controllerName: 37,\n        inputData: {\n          periodId: this.id(),\n          id: item.id()\n        }\n      };\n\n      _h.kocnx().createPdf(model);\n    }\n  }, {\n    key: \"downloadPdf\",\n    value: function downloadPdf() {\n      _h.downloadFile(this.magazineFileCode());\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      this.bodyClass = \"panel-body inside-tab\";\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'groupperiod-form-t'\n      }, undefined, true, 30, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'confirmedBtn',\n            vis: this.condFirst,\n            click: this.parentVM.confirmedBtn\n          }, {\n            name: \"custom\",\n            resText: 'rejectedBtn',\n            vis: this.condSecond,\n            click: this.parentVM.rejectedBtn\n          }, {\n            name: \"custom\",\n            resText: 'afterDescSubmittedBtn',\n            vis: this.condThird,\n            click: this.parentVM.afterDescSubmittedBtn\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return GroupPeriodForm;\n}(BaseFormModel);\n\n//# sourceURL=webpack://domino/./src/scripts/pages/groupperiod/model.js?");

/***/ }),

/***/ "./src/scripts/pages/groupperiod/resource.js":
/*!***************************************************!*\
  !*** ./src/scripts/pages/groupperiod/resource.js ***!
  \***************************************************/
/***/ (() => {

eval("window.groupperiodModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  companyName: {\n    fa: 'شرکت تابعه',\n    colName: 'companyName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: \"companyId\",\n    type: \"string\"\n  },\n  title: {\n    fa: 'عنوان دوره',\n    colName: 'title',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  periodState: {\n    fa: 'وضعیت دوره',\n    colName: 'periodState',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"enum\"\n  },\n  periodType: {\n    fa: 'نوع دوره',\n    colName: 'periodType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"enum\"\n  },\n  submitState: {\n    fa: 'ارتباط با گروه',\n    colName: 'submitState',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"label\"\n  },\n  auditState: {\n    fa: 'وضعیت حسابرسی',\n    colName: 'auditState',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"enum\"\n  },\n  endDate: {\n    fa: 'دوره مالی تا تاریخ',\n    colName: 'endDate',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"date\"\n  },\n  description: {\n    fa: 'دلیل عدم تایید',\n    colName: 'endDate',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null\n  }\n};\nwindow.groupperiodPageRes = {\n  pageCaption: {\n    fa: 'فهرست دوره های مالی ارسال شده توسط شرکت های تابعه'\n  },\n  reviewFinancialCaption: {\n    fa: 'بررسی صورتهای مالی شرکت های تابعه'\n  },\n  submittedBtn: {\n    fa: 'بازگشت به وضعیت انتظار'\n  },\n  afterDescSubmittedBtn: {\n    fa: 'ارسال'\n  },\n  confirmedBtn: {\n    fa: 'تایید'\n  },\n  rejectedBtn: {\n    fa: 'عدم تایید'\n  },\n  downloadPdfBtn: {\n    fa: 'دانلود فایل Pdf'\n  },\n  companyId: {\n    fa: 'شرکت تابعه'\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/pages/groupperiod/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/groupperiod/viewModel.js":
/*!****************************************************!*\
  !*** ./src/scripts/pages/groupperiod/viewModel.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"GroupPeriodViewModel\": () => (/* binding */ GroupPeriodViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _master_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/model */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model */ \"./src/scripts/pages/groupperiod/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n\n\n\n\n__webpack_require__(/*! ./model */ \"./src/scripts/pages/groupperiod/model.js\");\n\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/groupperiod/resource.js\");\n\nfunction GroupPeriodViewModel() {\n  var self = this;\n  self.companySelectList = ko.observableArray();\n\n  self.getCompanySelectList = function () {\n    self.apiService.request({\n      name: \"/api/common/getcompanylist\",\n      data: {\n        controllerName: 37\n      },\n      success: function success(data) {\n        self.companySelectList.removeAll();\n\n        if (_h.any(data)) {\n          for (var j = 0; j < data.length; j++) {\n            var target = data[j];\n            self.companySelectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.SelectItem(target));\n          }\n\n          self.companyId(null);\n        }\n      },\n      error: function error(message, level) {\n        toast.error(\"Company\", 'getSelectList', \"GroupCompanies\");\n      }\n    });\n  };\n\n  self.getPeriodDetail = function (callback) {\n    self.apiService.request({\n      name: \"getPeriodDetail\",\n      data: {\n        id: self.getSelectedRecord().id()\n      },\n      success: function success(data) {\n        callback(data);\n      },\n      error: function error(message, level) {\n        toast.error(self.entityName, 'get', \"PeriodDetail\");\n        callback(null);\n      }\n    });\n  };\n\n  self.reviewFinancialBtn = function () {\n    self.getPeriodDetail(function (data) {\n      if (data !== null) {\n        _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.GroupPeriodForm(self, true, data));\n      }\n    });\n  };\n\n  self.submittedBtn = function (parents, btnModel, e) {\n    self.changeSubmitState(parents[1], 1, e);\n  };\n\n  self.afterDescSubmittedBtn = function (parents, btnModel, e) {\n    self.changeSubmitState(parents[1], 3, e);\n  };\n\n  self.confirmedBtn = function (parents, btnModel, e) {\n    self.changeSubmitState(parents[1], 2, e);\n  };\n\n  self.rejectedBtn = function () {\n    _h.kocnx().formModel().showDescription(true);\n  };\n\n  self.changeSubmitState = function (item, action, e) {\n    if (!item.validationObject.isValid()) {\n      item.validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    var model = {\n      id: item.id(),\n      submitState: action,\n      description: item.description()\n    };\n    self.apiService.request({\n      splashIid: e,\n      name: \"putSubmit\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.kocnx().closeForm();\n\n          self.afterUpdate(data.models);\n          toast.success(self.entityName, 'putUpdate', \"SubmitState\");\n        }\n      },\n      error: function error(message, level) {\n        toast.error(self.entityName, 'putUpdate', \"SubmitState\");\n      }\n    });\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.getCompanySelectList();\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"GroupPeriod\",\n    getList: true,\n    apiService: {\n      actionList: [\"filterby\", \"getcompanies\", \"getperioddetail\", \"putsubmit\"]\n    },\n    extraParams: [],\n    buttons: [{\n      name: 'reviewFinancial',\n      access: true,\n      icon: 'StatementOption',\n      cMenu: true\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }],\n    filters: [{\n      name: 'companyId',\n      type: \"select\",\n      source: self.companySelectList\n    }, {\n      name: 'submitState',\n      type: \"select\",\n      source: submitStates\n    }],\n    sortDirection: \"Ascending\",\n    sortProperty: \"id\",\n    context: self,\n    cols: groupperiodModelRes,\n    searchKeyType: \"enter\",\n    saveState: true,\n    selectRow: true,\n    contextMenu: true,\n    resizable: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    var isSelected = self.isSelectedRecord();\n\n    var permit = _h.kocnx().permitPeriodEdit();\n\n    self.visreviewFinancial(isSelected && permit);\n    self.vishelp(true);\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/groupperiod/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/magazine/model.js":
/*!*********************************************!*\
  !*** ./src/scripts/pages/magazine/model.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"Magazine\": () => (/* binding */ Magazine),\n/* harmony export */   \"MagazineDownloadFile\": () => (/* binding */ MagazineDownloadFile),\n/* harmony export */   \"MagazineFileViewModel\": () => (/* binding */ MagazineFileViewModel),\n/* harmony export */   \"MagazineForm\": () => (/* binding */ MagazineForm),\n/* harmony export */   \"MagazinePreview\": () => (/* binding */ MagazinePreview),\n/* harmony export */   \"TreeSmall\": () => (/* binding */ TreeSmall)\n/* harmony export */ });\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* provided dependency */ var _autoMapper = __webpack_require__(/*! ./src/scripts/util/autoMapper.js */ \"./src/scripts/util/autoMapper.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar _require = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\"),\n    BaseModel = _require.BaseModel,\n    BaseFormModel = _require.BaseFormModel,\n    FormBuilder = _require.FormBuilder,\n    BaseSecondaryForm = _require.BaseSecondaryForm,\n    BaseInnerModel = _require.BaseInnerModel;\n\n\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\n\nvar TreeSmall = /*#__PURE__*/function (_BaseInnerModel) {\n  _inherits(TreeSmall, _BaseInnerModel);\n\n  var _super = _createSuper(TreeSmall);\n\n  function TreeSmall(model) {\n    _classCallCheck(this, TreeSmall);\n\n    return _super.call(this, model);\n  }\n\n  return _createClass(TreeSmall);\n}(BaseInnerModel);\nvar Magazine = /*#__PURE__*/function (_BaseModel) {\n  _inherits(Magazine, _BaseModel);\n\n  var _super2 = _createSuper(Magazine);\n\n  function Magazine(model) {\n    _classCallCheck(this, Magazine);\n\n    return _super2.call(this, model);\n  }\n\n  _createClass(Magazine, [{\n    key: \"shortName\",\n    value: function shortName(name) {\n      if (!name) return \"\";\n      if (name.length < 20) return name;\n      return name.substr(0, 17) + \"...\";\n    }\n  }, {\n    key: \"refreshModel\",\n    value: function refreshModel(model) {\n      _autoMapper.fillModel(this, model);\n    }\n  }]);\n\n  return Magazine;\n}(BaseModel);\nvar MagazineForm = /*#__PURE__*/function (_BaseFormModel) {\n  _inherits(MagazineForm, _BaseFormModel);\n\n  var _super3 = _createSuper(MagazineForm);\n\n  function MagazineForm(viewModel, editMode, data) {\n    var _this;\n\n    _classCallCheck(this, MagazineForm);\n\n    _this = _super3.call(this, viewModel, editMode);\n    _this.currentPeriodTitle = data.currentPeriodTitle;\n    _this.showComparativePeriod = ko.observable(true);\n    _this.oldList = data.comparativePeriods;\n    _this.periodsMax = data.comparativePeriods.length + 1;\n\n    if (!editMode) {\n      _this.editMode(false);\n\n      _this.autoSetComparatives(false);\n\n      _this.periodsCount(1);\n\n      _this.periodId(data.currentPeriodId);\n\n      _this.startPageNumber(1);\n\n      _this.folderId(null);\n\n      if (_h.any(data.comparativePeriods)) for (var i = 0; i < data.comparativePeriods.length; i++) {\n        _this[data.comparativePeriods[i].order + \"ComparativePeriod\"] = ko.observable(data.comparativePeriods[i].id);\n        _this[\"visCP\" + data.comparativePeriods[i].order] = ko.observable(true);\n      }\n\n      _this.periodsCount(data.comparativePeriods.length + 1);\n    } else {\n      if (_h.any(data.comparativePeriods)) for (var j = 0; j < data.comparativePeriods.length; j++) {\n        if (_this.comparativePeriods() && _this.comparativePeriods().length >= j + 1) {\n          _this[data.comparativePeriods[j].order + \"ComparativePeriod\"] = ko.observable(_this.comparativePeriods()[j].id);\n        } else {\n          _this[data.comparativePeriods[j].order + \"ComparativePeriod\"] = ko.observable(data.comparativePeriods[j].id);\n        }\n\n        _this[\"visCP\" + data.comparativePeriods[j].order] = ko.observable(true);\n      }\n    }\n\n    _this.setVisComparativePeriods(_this.periodsCount());\n\n    _this.periodsCount.subscribe(function (newValue) {\n      if (newValue) {\n        this.setVisComparativePeriods(newValue);\n      }\n    }, _assertThisInitialized(_this));\n\n    _this.condFirst = ko.computed(function () {\n      return this.magazineType() === 1;\n    }, _assertThisInitialized(_this));\n    _this.condSecond = ko.computed(function () {\n      return this.magazineType() === 0;\n    }, _assertThisInitialized(_this));\n    _this.condThird = ko.computed(function () {\n      return this.autoSetComparatives();\n    }, _assertThisInitialized(_this));\n\n    if (!editMode) {\n      _this.setValidationObject(data.comparativePeriods);\n    } else {\n      _this.setValidationObject(_this.comparativePeriods());\n    }\n\n    _this.createForm();\n\n    return _this;\n  }\n\n  _createClass(MagazineForm, [{\n    key: \"setVisComparativePeriods\",\n    value: function setVisComparativePeriods(newValue) {\n      for (var _i = 0, _Object$keys = Object.keys(this); _i < _Object$keys.length; _i++) {\n        var key = _Object$keys[_i];\n        var numb = key.match(/\\d/g);\n\n        if (numb && numb.length && key.indexOf(\"visCP\") !== -1) {\n          if (numb.length > 1) {\n            numb = numb[0] + numb[1];\n          } else {\n            numb = numb[0];\n          }\n\n          numb = Number(numb);\n\n          if (numb < Number(newValue)) {\n            this[key](true);\n          } else {\n            this[key](false);\n          }\n        }\n      }\n\n      if (this.showComparativePeriod()) {\n        $(\".cp-box\").css(\"display\", \"block\");\n      } else {\n        $(\".cp-box\").css(\"display\", \"none\");\n      }\n    }\n  }, {\n    key: \"setValidationObject\",\n    value: function setValidationObject(comparativePeriods) {\n      var self = this;\n      var obj = {\n        title: self.title.extend({\n          required: true,\n          minLength: 3,\n          maxLength: 100,\n          validCharacterName: true,\n          remoteIsUniqueRule: {\n            params: [self.id, \"Magazine\", \"title\", \"remotePlaceHolder\"]\n          }\n        }),\n        magazineType: self.magazineType.extend({\n          required: true\n        })\n      };\n\n      for (var i = 0; i < comparativePeriods.length; i++) {\n        var params = [];\n\n        for (var j = 0; j < comparativePeriods.length; j++) {\n          if (comparativePeriods[j].order !== comparativePeriods[i].order) {\n            params.push(self[comparativePeriods[j].order + \"ComparativePeriod\"]);\n          }\n        }\n\n        obj[comparativePeriods[i].order + \"ComparativePeriod\"] = self[comparativePeriods[i].order + \"ComparativePeriod\"].extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.magazineType() === 0 && self.periodsCount() > i;\n            }\n          },\n          noEqualPeriod: {\n            onlyIf: function onlyIf() {\n              return self.magazineType() === 0 && self.periodsCount() > i;\n            },\n            params: {\n              params: params\n            }\n          }\n        });\n      }\n\n      self.validationObject = ko.validatedObservable(obj);\n    }\n  }, {\n    key: \"getLastOrder\",\n    value: function getLastOrder() {\n      var number = 0;\n\n      for (var _i2 = 0, _Object$keys2 = Object.keys(this); _i2 < _Object$keys2.length; _i2++) {\n        var key = _Object$keys2[_i2];\n\n        var _char = key.slice(0, 2);\n\n        var numb = _char.match(/\\d/g);\n\n        if (numb && numb.length && key.indexOf(\"ComparativePeriod\") !== -1) {\n          var number = parseFloat(_char.replace(/[^0-9]/g, ''));\n          this[key]();\n        }\n      }\n\n      return number;\n    }\n  }, {\n    key: \"getComparativePeriodsList\",\n    value: function getComparativePeriodsList() {\n      var array = [];\n      var order = this.getLastOrder();\n\n      for (var f = 0; f < order; f++) {\n        array.push({\n          order: f + 1,\n          id: this[f + 1 + \"ComparativePeriod\"]()\n        });\n      }\n\n      return array;\n    }\n  }, {\n    key: \"toogleShowComparativeperiod\",\n    value: function toogleShowComparativeperiod() {\n      if (this.showComparativePeriod()) {\n        this.showComparativePeriod(false);\n        $(\".cp-box\").css(\"display\", \"none\");\n      } else {\n        this.showComparativePeriod(true);\n        $(\".cp-box\").css(\"display\", \"block\");\n      }\n    }\n  }, {\n    key: \"toggleAutoSetComparatives\",\n    value: function toggleAutoSetComparatives() {\n      this.autoSetComparatives(!this.autoSetComparatives());\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'txb',\n        val: this.title\n      }, {\n        t: 'slc',\n        val: this.magazineType,\n        options: magazineTypes,\n        dis: this.editMode\n      }), this.createLine({\n        t: 'slc',\n        val: this.folderId,\n        options: this.parentVM.folderList\n      }, {\n        t: 'tsp',\n        val: this.startPageNumber,\n        min: 1,\n        max: 1000\n      }, this.condFirst, 30), this.createLine({\n        t: 'slc',\n        val: this.folderId,\n        options: this.parentVM.folderList\n      }, null, this.condSecond, 30), this.createLine({\n        t: 'tsp',\n        val: this.periodsCount,\n        min: 1,\n        max: this.periodsMax,\n        dis: this.condThird\n      }, {\n        t: 'chk',\n        val: this.autoSetComparatives,\n        click: this.toggleAutoSetComparatives\n      }, this.condSecond, 30), this.createLine({\n        t: 'lbl',\n        val: this.currentPeriodTitle\n      }, {\n        t: 'tsp',\n        val: this.startPageNumber,\n        min: 1,\n        max: 1000\n      }, this.condSecond, 30), this.createLine({\n        t: 'tm',\n        templateName: 'show-comparativeperiod-form-t'\n      }, undefined, this.condSecond, 30, 0)];\n\n      for (var _i3 = 0, _Object$keys3 = Object.keys(this); _i3 < _Object$keys3.length; _i3++) {\n        var key = _Object$keys3[_i3];\n\n        var _char2 = key.slice(0, 2);\n\n        var numb = _char2.match(/\\d/g);\n\n        if (numb && numb.length && key.indexOf(\"ComparativePeriod\") !== -1) {\n          if (numb.length > 1) {\n            numb = numb[0] + numb[1];\n          }\n\n          controls.push(this.createLine({\n            t: 'slc',\n            val: this[key],\n            options: this.parentVM.periodSelectedList,\n            renderFunc: _h.periodSelectRowTemplate,\n            dis: this.condThird\n          }, null, this[\"visCP\" + numb], 30, 0, \"row cp-box\"));\n        }\n      }\n\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'create',\n            vis: !this.editMode(),\n            click: this.parentVM.create\n          }, {\n            name: 'edit',\n            vis: this.editMode,\n            click: this.parentVM.edit\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n      setTimeout(function () {\n        this.toogleShowComparativeperiod();\n      }.bind(this), 150);\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      var array = [];\n\n      for (var _i4 = 0, _Object$keys4 = Object.keys(this); _i4 < _Object$keys4.length; _i4++) {\n        var key = _Object$keys4[_i4];\n        var numb = key.match(/\\d/g);\n\n        if (numb && numb.length && key.indexOf(\"visCP\") !== -1) {\n          if (numb.length > 1) {\n            numb = numb[0] + numb[1];\n          } else {\n            numb = numb[0];\n          }\n\n          if (this[key]()) {\n            array.push({\n              order: numb,\n              id: this[numb + \"ComparativePeriod\"]()\n            });\n          }\n        }\n      }\n\n      return {\n        id: this.id(),\n        title: this.title(),\n        folderId: this.folderId(),\n        periodId: this.periodId(),\n        periodsCount: this.periodsCount(),\n        magazineType: this.magazineType(),\n        startPageNumber: this.startPageNumber(),\n        autoSetComparatives: this.autoSetComparatives(),\n        comparativePeriods: array\n      };\n    }\n  }]);\n\n  return MagazineForm;\n}(BaseFormModel);\nvar MagazineFileViewModel = /*#__PURE__*/function (_FormBuilder) {\n  _inherits(MagazineFileViewModel, _FormBuilder);\n\n  var _super4 = _createSuper(MagazineFileViewModel);\n\n  function MagazineFileViewModel() {\n    var _this2;\n\n    _classCallCheck(this, MagazineFileViewModel);\n\n    _this2 = _super4.call(this);\n    _this2.width = \"1000px\";\n    _this2.caption = ko.observable(\" فهرست مجله های \" + _h.kocnx().periodItem().t);\n    ko.utils.extend(_assertThisInitialized(_this2), new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__.BaseViewModel({\n      entityName: \"MagazineFile\",\n      getList: true,\n      apiService: {\n        actionList: [\"filterby\", \"deletepdf\"]\n      },\n      buttons: [{\n        name: 'downloadPdf',\n        access: true,\n        icon: 'ExportPdf',\n        cMenu: true\n      }, {\n        name: 'deletePdf',\n        access: true,\n        icon: 'Delete',\n        cMenu: true\n      }, {\n        name: 'refresh',\n        access: false,\n        cMenu: false\n      }],\n      filters: [{\n        name: 'magazineId'\n      }],\n      sortDirection: \"Ascending\",\n      sortProperty: \"magazineTitle\",\n      tableStyle: \"table-layout: fixed;\",\n      context: _assertThisInitialized(_this2),\n      searchKeyType: \"enter\",\n      saveState: true,\n      cols: savemagazineModelRes,\n      selectRow: true,\n      contextMenu: true\n    }));\n    _this2.btnVisibility = ko.computed(function () {\n      var isSelected = this.isSelectedRecord();\n      this.visdownloadPdf(isSelected);\n      this.visdeletePdf(isSelected);\n      this.visrefresh(true);\n    }.bind(_assertThisInitialized(_this2)));\n\n    _this2.fillTableProperties();\n\n    _this2.createForm();\n\n    _this2.getRecords();\n\n    return _this2;\n  }\n\n  _createClass(MagazineFileViewModel, [{\n    key: \"downloadPdfBtn\",\n    value: function downloadPdfBtn() {\n      var item = this.getSelectedRecord();\n\n      _h.downloadFile(item.fileCode());\n    }\n  }, {\n    key: \"deletePdfBtn\",\n    value: function deletePdfBtn() {\n      var item = this.getSelectedRecord();\n      this.apiService.request({\n        name: \"deletePdf\",\n        data: {\n          id: item.id()\n        },\n        success: function (data) {\n          this.records.remove(item);\n\n          var successText = _h.getApiMessage(\"DeleteMagazinePdfFileSuccess\");\n\n          _h.successToast(successText);\n        }.bind(this),\n        error: function error(message, status, xhr) {\n          var text = _h.getApiMessage(\"DeleteMagazinePdfFileError\");\n\n          _h.failToast(text);\n        }\n      });\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'savemagazine-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return MagazineFileViewModel;\n}(FormBuilder);\nvar MagazineDownloadFile = /*#__PURE__*/function (_BaseSecondaryForm) {\n  _inherits(MagazineDownloadFile, _BaseSecondaryForm);\n\n  var _super5 = _createSuper(MagazineDownloadFile);\n\n  function MagazineDownloadFile(viewModel, saveData) {\n    var _this3;\n\n    _classCallCheck(this, MagazineDownloadFile);\n\n    _this3 = _super5.call(this, viewModel, [{\n      name: \"displayType\",\n      type: \"ob\",\n      val: 1\n    }, {\n      name: \"amountType\",\n      type: \"ob\",\n      val: 2\n    }], \"DownloadFileCaption\");\n    if (saveData.displayType) _this3.displayType(saveData.displayType);\n    if (saveData.amountType) _this3.amountType(saveData.amountType);\n    _this3.width = \"400px\";\n\n    _this3.createForm();\n\n    return _this3;\n  }\n\n  _createClass(MagazineDownloadFile, [{\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'rdo',\n        val: this.displayType,\n        list: displayTypes2\n      }, null, true, 30), this.createLine({\n        t: 'rdo',\n        val: this.amountType,\n        list: amountTypes\n      }, null, true, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'downloadPdfBtn',\n            vis: true,\n            click: this.parentVM.toPdf\n          }, {\n            name: \"custom\",\n            resText: 'SaveSettingExPdfBtn',\n            vis: true,\n            click: this.parentVM.toPdfSaveSetting\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return MagazineDownloadFile;\n}(BaseSecondaryForm);\nvar MagazinePreview = /*#__PURE__*/function (_BaseSecondaryForm2) {\n  _inherits(MagazinePreview, _BaseSecondaryForm2);\n\n  var _super6 = _createSuper(MagazinePreview);\n\n  function MagazinePreview(viewModel, model) {\n    var _this4;\n\n    _classCallCheck(this, MagazinePreview);\n\n    _this4 = _super6.call(this, viewModel, [{\n      name: \"id\",\n      type: \"ob\"\n    }, {\n      name: \"displayType\",\n      type: \"ob\",\n      val: 1\n    }, {\n      name: \"amountType\",\n      type: \"ob\",\n      val: 2\n    }, {\n      name: \"pdfSaveState\",\n      type: \"ob\",\n      val: 1\n    }, {\n      name: \"pageSelectionType\",\n      type: \"ob\",\n      val: 1\n    }, {\n      name: \"magazineType\",\n      type: \"ob\"\n    }, {\n      name: \"selectedPages\",\n      type: \"ob\"\n    }, {\n      name: \"title\",\n      type: \"ob\"\n    }, {\n      name: \"description\",\n      type: \"ob\"\n    }], \"MagazinePreviewCaption\");\n    var selectedRecord = viewModel.getSelectedRecord();\n\n    _this4.id(selectedRecord.id());\n\n    _this4.magazineType(selectedRecord.magazineType());\n\n    if (model.displayType) _this4.displayType(model.displayType);\n    if (model.amountType) _this4.amountType(model.amountType);\n    if (model.pdfSaveStates) _this4.pdfSaveStates(model.pdfSaveStates);\n    if (model.pdfSaveStates) _this4.pdfSaveStates(model.pdfSaveStates);\n    if (model.pageSelectionType) _this4.pageSelectionType(model.pageSelectionType);\n\n    _this4.createForm();\n\n    return _this4;\n  }\n\n  _createClass(MagazinePreview, [{\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'rdo',\n        val: this.displayType,\n        list: displayTypes2\n      }, null, true, 30), this.createLine({\n        t: 'rdo',\n        val: this.amountType,\n        list: amountTypes\n      }, null, true, 30), this.createLine({\n        t: 'rdo',\n        val: this.pdfSaveState,\n        list: pdfSaveStates\n      }, null, true, 30), this.createLine({\n        t: 'tm',\n        templateName: 'pdfSaveState-form-t'\n      }, undefined, true, 0, 0), this.createLine({\n        t: 'rdo',\n        val: this.pageSelectionType,\n        list: pageSelectionTypeTypes\n      }, null, this.magazineType() === 0, 30), this.createLine({\n        t: 'tm',\n        templateName: 'selectedPages-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'downloadPdfBtn',\n            vis: true,\n            click: this.parentVM.createPdf\n          }, {\n            name: \"custom\",\n            resText: 'SaveSettingExPdfBtn',\n            vis: true,\n            click: this.parentVM.createPdfSaveSetting\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return MagazinePreview;\n}(BaseSecondaryForm);\n\n//# sourceURL=webpack://domino/./src/scripts/pages/magazine/model.js?");

/***/ }),

/***/ "./src/scripts/pages/magazine/resource.js":
/*!************************************************!*\
  !*** ./src/scripts/pages/magazine/resource.js ***!
  \************************************************/
/***/ (() => {

eval("window.displayTypes2 = [{\n  text: \"همه\",\n  enText: \"All\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"گردش دار\",\n  enText: \"WithFlow\",\n  value: 2,\n  color: \"\"\n}];\nwindow.paperSizes = [{\n  text: \"A4\",\n  enText: \"A4\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"A3\",\n  enText: \"A3\",\n  value: 2,\n  color: \"\"\n}];\nwindow.magazineTypes = [{\n  text: \"صورت مالی\",\n  enText: \"FinancialStatement\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"گزارش محاسبات\",\n  enText: \"TotalCostReport\",\n  value: 1,\n  color: \"\"\n}];\nwindow.pageNumberTypes = [{\n  text: \"انتخابی\",\n  enText: \"Selective\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"جاری\",\n  enText: \"Current\",\n  value: 2,\n  color: \"\"\n}];\nwindow.magazinePageRes = {\n  pageCaption: {\n    fa: 'مجله'\n  },\n  createCaption: {\n    fa: 'تعریف مجله جدید'\n  },\n  editCaption: {\n    fa: 'ویرایش مجله'\n  },\n  deleteCaption: {\n    fa: 'حذف مجله'\n  },\n  createPdfCaption: {\n    fa: 'دانلود نسخه pdf مجله'\n  },\n  createHtmlCaption: {\n    fa: 'دانلود نسخه Html مجله'\n  },\n  designCaption: {\n    fa: 'ویرایش محتوای مجله'\n  },\n  storePdfCaption: {\n    fa: 'ذخیره سازی پی دی اف مجله'\n  },\n  getSavedMagazinesCaption: {\n    fa: 'فهرست مجله های ذخیره سازی شده'\n  },\n  returnToPage: {\n    fa: 'برگشت به جدول مجله'\n  },\n  MagazineDownloadFileCaption: {\n    fa: 'دانلود مجله'\n  },\n  downloadPdfBtn: {\n    fa: 'دانلود'\n  },\n  pageNumberType: {\n    fa: 'صفحه'\n  },\n  autoSetComparatives: {\n    fa: 'تنظیم خودکار'\n  },\n  settingsCaption: {\n    fa: 'تنظیمات'\n  },\n  SaveSettingExPdfBtn: {\n    fa: 'ذخیره تنظیمات'\n  }\n};\nwindow.magazineModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  title: {\n    fa: 'عنوان',\n    colName: 'title',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  magazineType: {\n    fa: 'نوع',\n    colName: 'magazineType',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"enum\"\n  },\n  startPageNumber: {\n    fa: 'شروع از صفحه',\n    colName: 'startPageNumber',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  periodsCount: {\n    fa: 'تعداد دوره',\n    colName: 'periodsCount',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  paperSize: {\n    fa: 'اندازه صفحه',\n    colName: 'paperSize',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"enum\"\n  },\n  folderName: {\n    fa: 'پوشه',\n    colName: 'folderName',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: \"folderId\",\n    groupBy: true,\n    groupDir: \"Ascending\",\n    type: \"string\"\n  },\n  periodId: {\n    fa: 'دوره مالی جاری',\n    colName: 'periodId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  folderId: {\n    fa: 'پوشه',\n    colName: 'folderId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  currentPeriodTitle: {\n    fa: 'دوره جاری',\n    colName: 'currentPeriodTitle',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null\n  },\n  autoSetComparatives: {\n    fa: 'تنظیم خودکار',\n    colName: 'autoSetComparatives',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"string\"\n  }\n};\nwindow.savemagazinePageRes = {\n  downloadPdfCaption: {\n    fa: 'دانلود فایل'\n  },\n  deletePdfCaption: {\n    fa: 'حذف فایل'\n  },\n  DownloadFileCaption: {\n    fa: 'دانلود فایل'\n  }\n};\nwindow.savemagazineModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  magazineTitle: {\n    fa: 'عنوان',\n    colName: 'magazineTitle',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"Ascending\",\n    alias: null,\n    type: \"string\",\n    popup: true\n  },\n  timeCreated: {\n    fa: 'تاریخ تحصیل',\n    colName: 'timeCreated',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"pdatetime\"\n  },\n  pages: {\n    fa: 'صفحات',\n    colName: 'pages',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    type: \"string\",\n    alias: null\n  },\n  magazineId: {\n    fa: 'شماره مجله',\n    colName: 'magazineId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null\n  },\n  description: {\n    fa: 'توضیحات',\n    colName: 'description',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    type: \"string\",\n    alias: null,\n    popup: true\n  }\n};\nwindow.magazinePreviewPageRes = {\n  pageSelectionType: {\n    fa: 'محدوده صفحات'\n  },\n  pdfSaveState: {\n    fa: 'نوع دانلود'\n  },\n  pdfTitlte: {\n    fa: 'عنوان'\n  },\n  pdfDesc: {\n    fa: 'توضیحات'\n  },\n  selectedPages: {\n    fa: 'توضیحات'\n  },\n  MagazinePreviewCaption: {\n    fa: 'دانلود فایل pdf'\n  },\n  displayType: {\n    fa: 'نمایش'\n  },\n  amountType: {\n    fa: 'برحسب'\n  }\n};\nwindow.tabletemplateselectModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null,\n    type: \"\"\n  },\n  title: {\n    fa: 'عنوان',\n    colName: 'title',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"stringdrag\",\n    popup: true\n  },\n  paperSize: {\n    fa: 'اندازه',\n    colName: 'paperSize',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"enum\"\n  }\n};\nwindow.pdfSaveStates = [{\n  text: \"دانلود\",\n  enText: \"JustDownload\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"دانلود و ذخیره\",\n  enText: \"Current\",\n  value: 2,\n  color: \"\"\n}];\nwindow.pageSelectionTypeTypes = [{\n  text: \"همه صفحات\",\n  enText: \"Complete\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"صفحات انتخابی\",\n  enText: \"Selective\",\n  value: 2,\n  color: \"\"\n}];\n\n//# sourceURL=webpack://domino/./src/scripts/pages/magazine/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/magazine/richtextEditor.js":
/*!******************************************************!*\
  !*** ./src/scripts/pages/magazine/richtextEditor.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"HtmlTemplateCategory\": () => (/* binding */ HtmlTemplateCategory),\n/* harmony export */   \"PageSetting\": () => (/* binding */ PageSetting),\n/* harmony export */   \"RichTextEditor\": () => (/* binding */ RichTextEditor),\n/* harmony export */   \"TableTemplateSelect\": () => (/* binding */ TableTemplateSelect),\n/* harmony export */   \"TableTemplateSelectViewModel\": () => (/* binding */ TableTemplateSelectViewModel),\n/* harmony export */   \"TextTemplate\": () => (/* binding */ TextTemplate),\n/* harmony export */   \"TextTemplateForm\": () => (/* binding */ TextTemplateForm)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _master_baseModels_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\");\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./model.js */ \"./src/scripts/pages/magazine/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n/* provided dependency */ var _autoMapper = __webpack_require__(/*! ./src/scripts/util/autoMapper.js */ \"./src/scripts/util/autoMapper.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar ruler = __webpack_require__(/*! ../../components/jsRuler.js */ \"./src/scripts/components/jsRuler.js\");\n\nvar pasteDataFormater = __webpack_require__(/*! ../../util/pasteDataFormatter.js */ \"./src/scripts/util/pasteDataFormatter.js\");\n\n\n\n\n\n\nvar rangy = __webpack_require__(/*! ../../vendors/rangy.js */ \"./src/scripts/vendors/rangy.js\");\n\nfunction RichTextEditor() {\n  var self = this;\n  self.magazine = ko.observable();\n  self.wideRight = ko.observable(false);\n  self.setting = ko.observable(new PageSetting(self));\n  self.startPageNumber = ko.observable();\n  self.textTemplates = ko.observableArray();\n  self.activeObject = ko.observable();\n  self.activeTextTemplate = ko.observable();\n  self.showMenu = ko.observable(false);\n  self.showMenuType = ko.observable(false);\n  self.evenPage = ko.observable(false);\n  self.oddPage = ko.observable(false);\n  self.removeTextTemplate = ko.observable(false);\n  self.onlyThisPageCaption = ko.observable(false);\n  self.onlyThisPage = ko.observable(false);\n  self.tagTemplates = ko.observableArray();\n\n  self.fillTagTemplates = function () {\n    var tagTemplates = [{\n      category: \"تیتر\",\n      templates: [{\n        id: 1,\n        title: \"تیتر 1\",\n        value: \"h1\",\n        textBold: true,\n        textFontSize: \"14px\"\n      }, {\n        id: 2,\n        title: \"تیتر 2\",\n        value: \"h2\",\n        textBold: true,\n        textFontSize: \"12px\"\n      }, {\n        id: 3,\n        title: \"تیتر 3\",\n        value: \"h3\",\n        textBold: false,\n        textFontSize: \"11px\"\n      }, {\n        id: 4,\n        title: \"تیتر 4\",\n        value: \"h4\",\n        textBold: false,\n        textFontSize: \"11px\"\n      }, {\n        id: 5,\n        title: \"تیتر 5\",\n        value: \"h5\",\n        textBold: false,\n        textFontSize: \"11px\"\n      }, {\n        id: 6,\n        title: \"تیتر 6\",\n        value: \"h6\",\n        textBold: false,\n        textFontSize: \"11px\"\n      }]\n    }, {\n      category: \"تیتیر شمارشی\",\n      templates: [{\n        id: 7,\n        title: \"H1 (1)\",\n        className: \"num-tag-h1\",\n        textBold: true,\n        textFontSize: \"14px\"\n      }, {\n        id: 8,\n        title: \"H2 (1-1)\",\n        className: \"num-tag-h2\",\n        textBold: true,\n        textFontSize: \"12px\"\n      }, {\n        id: 9,\n        title: \"H3 (1-1-1)\",\n        className: \"num-tag-h3\",\n        textBold: false,\n        textFontSize: \"11px\"\n      }, {\n        id: 10,\n        title: \"H4 (1-1-1-1)\",\n        className: \"num-tag-h4\",\n        textBold: false,\n        textFontSize: \"11px\"\n      }, {\n        id: 11,\n        title: \"H5 (1-1-1-1-1)\",\n        className: \"num-tag-h5\",\n        textBold: false,\n        textFontSize: \"11px\"\n      }]\n    }];\n    self.tagTemplates.removeAll();\n\n    for (var i = 0; i < tagTemplates.length; i++) {\n      var target = tagTemplates[i];\n      var record = new HtmlTemplateCategory(target);\n      self.tagTemplates.push(record);\n    }\n  };\n\n  self.addHtmlTemplate = function (model, item) {\n    if (item.id <= 6) {\n      self.toggleCommand(null, \"fontSize\", item.textFontSize);\n      self.toggleCommand(null, \"fontSize\", item.textBold);\n    }\n\n    if (item.id > 6) {\n      rangy.execSelectionCommand(\"addTemplate\", undefined, item.className);\n      self.refreshNumericalTags();\n    }\n\n    $(\".col-select\").removeClass(\"open\");\n  };\n\n  self.refreshNumericalTags = function () {\n    var lvl1 = 1,\n        lvl2 = 1,\n        lvl3 = 1,\n        phrase,\n        lvl4 = 1,\n        lvl5 = 1,\n        target;\n    var tags = $(\".num-tag\");\n    if (_h.any(tags)) for (var i = 0; i < tags.length; i++) {\n      target = $(tags[i]);\n      var span = target.children(\".num-tag-c\");\n\n      if (span.length === 0) {\n        target.prepend(\"<span class='num-tag-c'></span>\");\n        span = target.children(\".num-tag-c\");\n      }\n\n      if ($(target).hasClass(\"num-tag-h1\")) {\n        phrase = lvl1 + '.';\n        lvl1++;\n        lvl2 = 1;\n        lvl3 = 1;\n        lvl4 = 1;\n        lvl5 = 1;\n      }\n\n      if ($(target).hasClass(\"num-tag-h2\")) {\n        phrase = lvl1 + '.' + lvl2;\n        lvl2++;\n        lvl3 = 1;\n        lvl4 = 1;\n        lvl5 = 1;\n      }\n\n      if ($(target).hasClass(\"num-tag-h3\")) {\n        phrase = lvl1 + '.' + lvl2 + '.' + lvl3;\n        lvl3++;\n        lvl4 = 1;\n        lvl5 = 1;\n      }\n\n      if ($(target).hasClass(\"num-tag-h4\")) {\n        phrase = lvl1 + '.' + lvl2 + '.' + lvl3 + '.' + lvl4;\n        lvl4++;\n        lvl5 = 1;\n      }\n\n      if ($(target).hasClass(\"num-tag-h5\")) {\n        phrase = lvl1 + '.' + lvl2 + '.' + lvl3 + '.' + lvl4 + '.' + lvl5;\n        lvl5++;\n      }\n\n      $(target).attr(\"data-info\", phrase);\n      $(span).text(phrase);\n    }\n  };\n\n  self.tableTemplateModel = ko.observable(new TableTemplateSelectViewModel(self));\n\n  self.GetTableTemplateHtml = function (id, callback) {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_2__.ApiService.request({\n      url: \"/api/magazine/gettemplatepreview\",\n      data: {\n        magazineId: self.magazine().id(),\n        tableTemplateId: id\n      },\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data.data)) {\n          callback(data);\n        }\n      },\n      error: function error(data) {\n        callback(null);\n      }\n    });\n  };\n\n  self.getChartPicture = function (tableTemplateId, chartId, target) {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_2__.ApiService.request({\n      url: \"/api/magazine/getchartpreview\",\n      data: {\n        magazineId: self.magazine().id(),\n        tableTemplateId: tableTemplateId,\n        chartId: chartId\n      },\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          if (target) {\n            $(target).attr(\"src\", data.data);\n            $(target).attr(\"title\", data.title);\n          } else {\n            var imgString = $('<img/>').attr(\"src\", data.data).css({\n              \"max-height\": \"100%\",\n              \"max-width\": \"100%\"\n            }).attr({\n              title: data.title,\n              'chart-id': chartId,\n              'template-id': tableTemplateId\n            }).addClass('mimage chart-image').prop('outerHTML');\n            var p = \"<p style='text-align: center;'>\" + imgString + \"<p/>\";\n            var hasSelectHtml = self.hasSelectHtml(\"mpart\");\n            if (hasSelectHtml) document.execCommand('insertHTML', false, p);else $(\".active-ed\").append(p);\n          }\n        }\n      },\n      error: function error(data) {}\n    });\n  };\n\n  self.toggleCommand = function (parent, command, value, e) {\n    switch (command) {\n      case \"backColor\":\n      case \"textColor\":\n      case \"fontSize\":\n      case \"fontName\":\n      case \"lineHeight\":\n        rangy.execSelectionCommand(command, undefined, value);\n        break;\n\n      case \"removeFormat\":\n        document.execCommand('styleWithCSS', false, false);\n        document.execCommand(\"removeFormat\", false, value);\n        break;\n\n      default:\n        rangy.execSelectionCommand(command);\n        break;\n    }\n\n    self.htmlContentCleaner();\n    self.updateButtonPaneStatus();\n  };\n\n  self.toggleRegularTextCommand = function (parent, command, value) {\n    var activePage = self.getActivePage();\n    var header = activePage.find(\".mheader\");\n    var footer = activePage.find(\".mfooter\");\n\n    switch (command) {\n      case \"paragraphDelete\":\n        self.activeObject().remove();\n        self.refreshPartsSize();\n        self.activeObject(null);\n        self.showMenu(false);\n        break;\n\n      case \"defaultOddHeader\":\n        header.addClass(\"default-odd-header\");\n        self.setting().defaultOddHeader(header[0].outerHTML);\n        self.setting().changePages(\"defaultOddHeader\");\n        break;\n\n      case \"defaultOddFooter\":\n        footer.addClass(\"default-odd-footer\");\n        self.setting().defaultOddFooter(footer[0].outerHTML);\n        self.setting().changePages(\"defaultOddFooter\");\n        break;\n\n      case \"defaultHeader\":\n        header.addClass(\"default-header\");\n        self.setting().defaultHeader(header[0].outerHTML);\n        self.setting().changePages(\"defaultHeader\");\n        break;\n\n      case \"defaultFooter\":\n        footer.addClass(\"default-footer\");\n        self.setting().defaultFooter(footer[0].outerHTML);\n        self.setting().changePages(\"defaultFooter\");\n        break;\n\n      case \"defaultContent\":\n        var guid = _h.generateUuid();\n\n        var array = self.getRangeHtml();\n        var contentStr = \"\";\n        if (array && array.length) for (var i = 0; i < array.length; i++) {\n          var target = $(array[i]);\n          target.attr(\"data-id\", guid);\n          contentStr += target[0].outerHTML;\n        }\n\n        if (!_h.isEmpty(contentStr)) {\n          _h.kocnx().openForm(new TextTemplateForm(self, {\n            id: guid,\n            content: contentStr\n          }));\n        }\n\n        break;\n    }\n  };\n\n  self.saveTextTemplate = function (parents, btnModel, e) {\n    var item = parents[1];\n\n    if (!item.validationObject.isValid()) {\n      item.validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    var jsonModel = {\n      id: item.id(),\n      title: item.title(),\n      content: item.content()\n    };\n    var model = new TextTemplate(jsonModel);\n    self.textTemplates.push(model);\n    self.addTextTemplate(jsonModel);\n\n    _h.kocnx().closeForm();\n  };\n\n  self.getTextTemplate = function () {\n    var data = localStorage.getItem(\"TextTemplates\");\n\n    if (!_h.isNullOrEmpty(data) && data !== \"\") {\n      var list = [];\n\n      try {\n        list = JSON.parse(data);\n        var title = list[0].title.toLowerCase();\n      } catch (e) {\n        localStorage.removeItem(\"TextTemplates\");\n        list = [];\n      }\n\n      if (_h.any(list)) for (var i = 0; i < list.length; i++) {\n        var target = list[i];\n        self.textTemplates.push(new TextTemplate({\n          id: target.id,\n          title: target.title,\n          content: target.content\n        }));\n      }\n    }\n  };\n\n  self.addTextTemplate = function (item) {\n    var list = [];\n    var data = localStorage.getItem(\"TextTemplates\");\n\n    if (!_h.isNullOrEmpty(data) && data !== \"\") {\n      list = JSON.parse(data);\n      list.push(item);\n    } else {\n      list.push(item);\n    }\n\n    localStorage.setItem(\"TextTemplates\", JSON.stringify(list));\n  };\n\n  self.clearTextTemplate = function (item) {\n    var list = [];\n    var data = localStorage.getItem(\"TextTemplates\");\n\n    if (!_h.isNullOrEmpty(data) && data !== \"\") {\n      list = JSON.parse(data);\n      list = list.filter(function (e) {\n        return e.id !== item.id();\n      });\n      self.textTemplates.remove(item);\n    }\n\n    localStorage.setItem(\"TextTemplates\", JSON.stringify(list));\n  };\n\n  self.applyTextTemplate = function () {\n    var html = self.activeTextTemplate().content();\n    var pages = $(\".page\");\n\n    for (var i = 0; i < pages.length; i++) {\n      var target = $(pages[i]);\n      var parent = target.parent();\n      var pageId = Number(parent.attr(\"page-id\"));\n      var isEven = self.isEvenNumber(pageId);\n      var template = $(html);\n      template.addClass(\"text-template\");\n      var copyTarget = target.find(\".mcontent\");\n\n      if (self.removeTextTemplate()) {\n        var templateId = $(template[0]).attr(\"data-id\");\n        var templateTarget = copyTarget.find(\"[data-id='\" + templateId + \"']\");\n        if (templateTarget.length) templateTarget.remove();\n      } else {\n        if (self.evenPage() && isEven || self.oddPage() && !isEven || self.onlyThisPage() && target.hasClass(\"active-page\")) {\n          copyTarget.append(html);\n        }\n      }\n    }\n  };\n\n  self.togglePictureCommand = function (parent, command, value) {\n    switch (command) {\n      case \"rotateRight\":\n        var degreesRight = self.getRotateDegree(\"right\");\n        self.activeObject().css({\n          'transform': 'rotate(' + degreesRight + 'deg)',\n          '-ms-transform': 'rotate(' + degreesRight + 'deg)',\n          '-moz-transform': 'rotate(' + degreesRight + 'deg)',\n          '-webkit-transform': 'rotate(' + degreesRight + 'deg)',\n          '-o-transform': 'rotate(' + degreesRight + 'deg)'\n        });\n        break;\n\n      case \"rotateLeft\":\n        var degrees = self.getRotateDegree(\"left\");\n        self.activeObject().css({\n          'transform': 'rotate(' + degrees + 'deg)',\n          '-ms-transform': 'rotate(' + degrees + 'deg)',\n          '-moz-transform': 'rotate(' + degrees + 'deg)',\n          '-webkit-transform': 'rotate(' + degrees + 'deg)',\n          '-o-transform': 'rotate(' + degrees + 'deg)'\n        });\n        break;\n\n      case \"pictureDelete\":\n        $(self.activeObject().parent()[0]).remove();\n        self.activeObject(null);\n        self.showMenu(false);\n        break;\n\n      case \"pictureRight\":\n        self.activeObject().css(\"float\", \"right\");\n        break;\n\n      case \"pictureCenter\":\n        self.activeObject().css(\"float\", \"none\");\n        break;\n\n      case \"pictureLeft\":\n        self.activeObject().css(\"float\", \"left\");\n        break;\n    }\n  };\n\n  self.toggleTableTemplateCommand = function (parent, command, value) {\n    var htmlTag;\n\n    switch (command) {\n      case \"templateDelete\":\n        self.activeObject().remove();\n        self.activeObject(null);\n        self.showMenu(false);\n        break;\n\n      case \"zoomIn\":\n        htmlTag = self.activeObject().find(\"iframe\").contents().find(\"table\");\n        var zoom = parseFloat(htmlTag.css(\"zoom\")) || 1;\n        zoom = zoom + 0.1;\n        htmlTag.css(\"zoom\", zoom);\n        self.activeObject().attr(\"data-zoom\", zoom);\n        self.resizeTableTemplateFrame(self.activeObject());\n        break;\n\n      case \"zoomOut\":\n        htmlTag = self.activeObject().find(\"iframe\").contents().find(\"table\");\n        var zoomOut = parseFloat(htmlTag.css(\"zoom\")) || 1;\n        zoomOut = zoomOut - 0.1;\n        htmlTag.css(\"zoom\", zoomOut);\n        self.activeObject().attr(\"data-zoom\", zoomOut);\n        self.resizeTableTemplateFrame(self.activeObject());\n        break;\n\n      case \"dragStartTable\":\n        $(\".dragStopTable\").removeClass(\"hide\");\n        $(\".dragStartTable\").addClass(\"hide\");\n        self.activeObject().draggable({\n          cursor: \"move\",\n          axis: \"x\",\n          grid: [2, 2]\n        });\n        parent = self.activeObject().closest(\".mcontent\");\n        var groundParent = self.activeObject().closest(\".page\");\n        parent.css(\"overflow\", \"visible\");\n        groundParent.css(\"overflow\", \"visible\");\n        self.activeObject().css(\"opacity\", 0.3);\n        break;\n\n      case \"dragStopTable\":\n        self.activeObject().closest(\".mcontent\").css(\"overflow\", \"hidden\");\n        self.activeObject().closest(\".page\").css(\"overflow\", \"hidden\");\n        self.activeObject().css(\"opacity\", 1);\n        self.activeObject().draggable(\"destroy\");\n        $(\".dragStopTable\").addClass(\"hide\");\n        $(\".dragStartTable\").removeClass(\"hide\");\n        break;\n\n      case \"templateRefresh\":\n        var page = self.activeObject().closest(\".page\");\n        self.activeObject().empty();\n        self.loadPageTableTemplates(page);\n        self.showMenu(false);\n        break;\n    }\n  };\n\n  self.getRotateDegree = function (side) {\n    try {\n      parseInt(self.activeObject().attr('style').split('rotate(')[1].split('deg)')[0]);\n    } catch (e) {\n      if (side === \"right\") {\n        return 90;\n      } else {\n        return -90;\n      }\n    }\n\n    var deg = parseInt(self.activeObject().attr('style').split('rotate(')[1].split('deg)')[0]);\n\n    if (side === \"right\") {\n      if (deg === 360) {\n        if (side === \"right\") {\n          deg = 90;\n        } else {\n          deg = -90;\n        }\n      } else deg = deg + 90;\n    } else {\n      deg = deg - 90;\n    }\n\n    return deg;\n  };\n\n  self.updateButtonPaneStatus = function () {\n    if (_h.isNullOrEmpty(self.getActiveEd())) return;\n    var tags = self.getTagsRecursive(document.getSelection().anchorNode),\n        activeClass = 'selected-tools';\n    $(\".rich-texteditor\").find('.toolbar-btn').removeClass(activeClass);\n    $(\".rich-texteditor\").find(\".fontsizeVal\").val(\"\");\n    $(\".rich-texteditor\").find(\".fontfamilyVal\").val(\"\");\n    $(\".rich-texteditor\").find(\".linespaceVal\").val(\"\");\n    $(\".rich-texteditor\").find(\".textcolorVal\").css(\"color\", \"\");\n    $(\".rich-texteditor\").find(\".backcolorVal\").css(\"background-color\", \"\");\n    var hasFontFamily = false;\n    var hasLineHeight = false;\n    var hasFontSize = false;\n    $.each(tags, function (i, tag) {\n      var btnName = self.tagToButton[tag.toLowerCase()],\n          $btn = $('.' + btnName);\n\n      if ($btn.length > 0) {\n        $btn.addClass(activeClass);\n      } else {\n        var val, color;\n\n        if (tag.startsWith(\"fontSize-\")) {\n          val = tag.split(\"-\")[1];\n          $(\".rich-texteditor\").find(\".fnt-selector\").fontSelector(\"setValue\", {\n            textFontSize: val\n          });\n          hasFontSize = true;\n        }\n\n        if (tag.startsWith(\"fontFamily-\")) {\n          val = tag.split(\"-\")[1];\n          $(\".rich-texteditor\").find(\".fnt-selector\").fontSelector(\"setValue\", {\n            textFontFamily: val\n          });\n          hasFontFamily = true;\n        }\n\n        if (tag.startsWith(\"lineHeight-\")) {\n          val = Number(tag.split(\"-\")[1]);\n          $(\".linespaceVal\").val(val);\n          hasLineHeight = true;\n        }\n\n        if (tag.startsWith(\"backgroundColor-\")) {\n          val = tag.split(\"-\")[1];\n          color = _h.toHex3(val);\n          $(\".backcolorVal\").css(\"background-color\", color);\n        }\n\n        if (tag.startsWith(\"color-\")) {\n          val = tag.split(\"-\")[1];\n          color = _h.toHex3(val);\n          $(\".textcolorVal\").css(\"color\", color);\n        }\n\n        if (tag.startsWith(\"fontWeight-\")) {\n          val = tag.split(\"-\")[1];\n          $(\".boldVal\").addClass(val === \"bold\" ? activeClass : \"\");\n        }\n\n        if (tag.startsWith(\"fontStyle-\")) {\n          val = tag.split(\"-\")[1];\n          $(\".italicVal\").addClass(val === \"italic\" ? activeClass : \"\");\n        }\n\n        if (tag.startsWith(\"textDecorationLine-\")) {\n          val = tag.split(\"-\")[1];\n          $(\".underlineVal\").addClass(val === \"underline\" ? activeClass : \"\");\n        }\n\n        if (tag.startsWith(\"direction-\")) {\n          val = tag.split(\"-\")[1];\n          if (val === \"rtl\") $(\".dirRtlVal\").addClass(activeClass);else $(\".dirLtrVal\").addClass(activeClass);\n        }\n      }\n    }); //var defVal = self.getDefault();\n\n    if (!hasFontSize) {\n      $(\".rich-texteditor\").find(\".fnt-selector\").fontSelector(\"setValue\", {\n        textFontSize: \"11px\"\n      });\n    }\n\n    if (!hasFontFamily) {\n      $(\".fontfamilyVal\").val(\"Nazanin\");\n      $(\".rich-texteditor\").find(\".fnt-selector\").fontSelector(\"setValue\", {\n        textFontFamily: \"Nazanin\"\n      });\n    }\n\n    if (!hasLineHeight) {\n      $(\".rich-texteditor\").find(\".linespaceVal\").val(\"1\");\n    }\n  };\n\n  self.tagToButton = {\n    \"strong\": \"boldVal\",\n    \"em\": \"italicVal\",\n    \"u\": \"underlineVal\",\n    \"del\": \"strikethroughVal\",\n    \"right\": \"alignrightVal\",\n    \"center\": \"aligncenterVal\",\n    \"left\": \"alignleftVal\",\n    \"justify\": \"alignFullVal\",\n    \"ul\": \"listbulletsVal\",\n    \"ol\": \"listnumbersVal\"\n  };\n\n  self.getTagsRecursive = function (element, tags) {\n    tags = tags || (element && element.tagName ? [element.tagName] : []);\n    var temp;\n\n    if (element && element.parentNode) {\n      element = element.parentNode;\n    } else {\n      return tags;\n    }\n\n    var tag = element.tagName;\n\n    if (tag === 'DIV') {\n      return tags;\n    }\n\n    if (tag === 'P') {\n      tags.push(element.style.textAlign);\n      if (!_h.isNullOrEmpty(element.style.textAlign) && element.style.textAlign !== \"\") tags.push(element.style.textAlign);\n      if (!_h.isNullOrEmpty(element.style.direction) && element.style.direction !== \"\") tags.push(\"direction-\" + element.style.direction);\n      if (!_h.isNullOrEmpty(element.style.lineHeight) && element.style.lineHeight !== \"\") tags.push(\"lineHeight-\" + element.style.lineHeight);\n    }\n\n    if (tag === 'SPAN') {\n      if (!_h.isNullOrEmpty(element.style.fontSize) && element.style.fontSize !== \"\") {\n        temp = tags.filter(function (a) {\n          return a.indexOf(\"fontSize-\") !== -1;\n        });\n        if (temp.length) temp[0] = \"fontSize-\" + element.style.fontSize;else tags.push(\"fontSize-\" + element.style.fontSize);\n      }\n\n      if (!_h.isNullOrEmpty(element.style.fontFamily) && element.style.fontFamily !== \"\") {\n        temp = tags.filter(function (a) {\n          return a.indexOf(\"fontFamily-\") !== -1;\n        });\n        if (temp.length) temp[0] = \"fontFamily-\" + element.style.fontFamily;else tags.push(\"fontFamily-\" + element.style.fontFamily);\n      }\n\n      if (!_h.isNullOrEmpty(element.style.backgroundColor) && element.style.backgroundColor !== \"\") {\n        temp = tags.filter(function (a) {\n          return a.indexOf(\"backgroundColor-\") !== -1;\n        });\n        if (temp.length) temp[0] = \"backgroundColor-\" + element.style.backgroundColor;else tags.push(\"backgroundColor-\" + element.style.backgroundColor);\n      }\n\n      if (!_h.isNullOrEmpty(element.style.color) && element.style.color !== \"\") {\n        temp = tags.filter(function (a) {\n          return a.indexOf(\"color-\") !== -1;\n        });\n        if (temp.length) temp[0] = \"color-\" + element.style.color;else tags.push(\"color-\" + element.style.color);\n      }\n\n      if (!_h.isNullOrEmpty(element.style.fontWeight) && element.style.fontWeight !== \"\") tags.push(\"fontWeight-\" + element.style.fontWeight);\n      if (!_h.isNullOrEmpty(element.style.fontStyle) && element.style.fontStyle !== \"\") tags.push(\"fontStyle-\" + element.style.fontStyle);\n      if (!_h.isNullOrEmpty(element.style.textDecorationLine) && element.style.textDecorationLine !== \"\") tags.push(\"textDecorationLine-\" + element.style.textDecorationLine);\n    }\n\n    tags.push(tag);\n    return self.getTagsRecursive(element, tags).filter(function (tag) {\n      return tag != null && tag != \"\";\n    });\n  };\n\n  self.defaultSemanticMap = [{\n    name: \"font\",\n    newName: \"span\"\n  }, {\n    name: \"b\",\n    newName: \"span\",\n    style: \"font-weight: bold;\"\n  }, {\n    name: \"strong\",\n    newName: \"span\",\n    style: \"font-weight: bold;\"\n  }, {\n    name: \"i\",\n    newName: \"span\",\n    style: \"font-style: italic;\"\n  }, {\n    name: \"em\",\n    newName: \"span\",\n    style: \"font-style: italic;\"\n  }, {\n    name: \"s\",\n    newName: \"span\"\n  }, {\n    name: \"del\",\n    newName: \"span\"\n  }, {\n    name: \"strike\",\n    newName: \"span\"\n  }, {\n    name: \"div\",\n    newName: \"p\",\n    exceptionClasses: [\"iframe-shadow\", \"table-templateId\"]\n  }];\n\n  self.hasClasses = function (tag, list) {\n    if (!list || !list.length) return false;\n    var res = false;\n\n    for (var i = 0; i < list.length; i++) {\n      if (tag.hasClass(list[i])) res = true;\n    }\n\n    return res;\n  };\n\n  self.pageNumbers = ko.observableArray();\n\n  self.showPageNavigate = function () {\n    self.pageNumbers.removeAll();\n    var pages = $(\".page\");\n\n    for (var i = 0; i < pages.length; i++) {\n      var page = pages[i];\n      var pageId = $(page).parent().attr(\"page-id\");\n      var isActive = $(page).hasClass(\"active-page\");\n      self.pageNumbers.push({\n        name: pageId,\n        active: ko.observable(isActive)\n      });\n    }\n  };\n\n  self.navigateTo = function (item, e) {\n    var pageBox = $(\".tx-page-frame[page-id='\" + item.name + \"']\")[0];\n    var currentPage = $(pageBox).find(\".page\");\n\n    if (!currentPage.hasClass(\"active-page\")) {\n      self.setGuidLines();\n      $(\".page\").removeClass(\"active-page\");\n      currentPage.addClass(\"active-page\");\n      self.transferGuidLines();\n      var templateList = $(\".table-templateId:empty\");\n      var chartList = currentPage.find(\".chart-image\").filter(function (i, a) {\n        if ($(a).attr(\"src\") && $(a).attr(\"src\").endsWith(\"f//Z\")) return true;\n        return false;\n      });\n      if (_h.any(templateList) || _h.any(chartList)) self.loadPageTableTemplates(currentPage);\n    }\n\n    self.activePageAnalyzer();\n    self.updateButtonPaneStatus();\n\n    for (var i = 0; i < self.pageNumbers().length; i++) {\n      var page = self.pageNumbers()[i];\n      if (item.name === page.name) page.active(true);else page.active(false);\n    }\n\n    currentPage.get(0).scrollIntoView();\n  };\n\n  self.configTools = function () {\n    //var defVal = self.getDefault();\n    var composition = false,\n        debounceButtonPaneStatus,\n        ctrl = false;\n    $(document).on(\"click\", \".evo-palette td\", function (e) {\n      var target = e.target;\n\n      if (target) {\n        var color = $(target).css(\"background-color\");\n\n        var trColor = _h.toHex3(color);\n\n        var parent = $(target).closest(\".dropdown-menu\");\n\n        if (parent) {\n          var prop = parent.attr(\"data-prop\");\n\n          switch (prop) {\n            case \"backcolor\":\n              self.toggleCommand(null, \"backColor\", trColor);\n              break;\n\n            case \"textcolor\":\n              self.toggleCommand(null, \"textColor\", trColor);\n              break;\n          }\n\n          if (prop) {\n            var property = \".\" + prop + \"Val\";\n            $(property).css(\"background-color\", trColor);\n          }\n        }\n      }\n    });\n    $(document).on(\"click\", \".eraseColor\", function (e) {\n      var target = e.target;\n\n      if (target) {\n        var parent = $(target).closest(\".dropdown-menu\");\n\n        if (parent) {\n          var prop = parent.attr(\"data-prop\");\n\n          switch (prop) {\n            case \"backcolor\":\n              self.toggleCommand(null, \"backColor\", \"#ffffff\");\n              $(\".backcolorVal\").css(\"background-color\", \"#ffffff\");\n              break;\n\n            case \"textcolor\":\n              self.toggleCommand(null, \"textColor\", \"#000000\");\n              $(\".textcolorVal\").css(\"background-color\", \"#000000\");\n              break;\n          }\n        }\n      }\n\n      return false;\n    });\n    $(document).on('click', \".rich-texteditor\", function (e) {\n      if (self.showMenu() && !$(e.target).hasClass(\"icon-image-xsmall\") && !$(e.target).hasClass(\"toolbar-btn\")) {\n        self.showMenu(false);\n        var activePage = self.getActivePage();\n\n        if (!_h.isNullOrEmpty(self.activeObject()) && self.activeObject().hasClass(\"table-templateId\")) {\n          self.activeObject().css(\"opacity\", 1);\n          if (self.activeObject().hasClass(\"ui-draggable\")) self.activeObject().draggable(\"destroy\");\n          activePage.closest(\".mcontent \").css(\"overflow\", \"hidden\");\n          activePage.closest(\".page\").css(\"overflow\", \"hidden\");\n        }\n      }\n    });\n    $(document).on('dblclick', \".iframe-shadow\", function (e) {\n      e.preventDefault();\n      var parent = $(e.currentTarget).parent();\n\n      if (parent.hasClass(\"ui-draggable\")) {\n        parent.draggable(\"destroy\");\n        parent.css(\"opacity\", 1);\n        parent.closest(\".mcontent\").css(\"overflow\", \"hidden\");\n        parent.closest(\".page\").css(\"overflow\", \"hidden\");\n        $(\".dragStopTable\").addClass(\"hide\");\n        $(\".dragStartTable\").removeClass(\"hide\");\n      }\n    });\n    $(document).on('click', \".CopyTextTemplate\", function (e) {\n      e.preventDefault();\n      var tag = $(e.target).closest(\"tr\");\n      var model = ko.contextFor(tag[0]);\n      self.activeTextTemplate(model.$data);\n      self.showMenu(true);\n      self.showMenuType('text-template');\n      var page = self.getActivePage();\n      var parent = page.parent();\n      var id = parent.attr(\"page-id\");\n      self.onlyThisPageCaption(\"فقط صفحه \" + id);\n      $(\".image-menu\").css({\n        \"top\": e.clientY - $(\".image-menu\").height(),\n        \"left\": e.clientX\n      });\n    });\n    $(document).on(\"click\", \".page-navigate-box\", function (e) {\n      self.showPageNavigate();\n    });\n    $(document).on('compositionstart compositionupdate', \".mheader, .mcontent, .mfooter\", function (e) {\n      composition = true;\n    });\n    $(document).on('keyup compositionend', \".mheader, .mcontent, .mfooter\", function (e) {\n      if (e.type === 'compositionend') {\n        composition = false;\n      } else if (composition) {\n        return;\n      }\n\n      var keyCode = e.which;\n\n      if (keyCode >= 37 && keyCode <= 40) {\n        return;\n      }\n\n      if (keyCode === 8 || keyCode === 46) {\n        self.refreshNumericalTags();\n      }\n\n      if ((e.ctrlKey || e.metaKey) && (keyCode === 89 || keyCode === 90)) {\n        return false;\n      } else if (!ctrl && keyCode !== 17) {\n        self.htmlContentCleaner();\n      } else if (typeof e.which === 'undefined') {\n        self.htmlContentCleaner();\n      }\n\n      setTimeout(function () {\n        ctrl = false;\n      }, 50);\n    });\n    $(document).on('mouseup keydown keyup', \".mheader, .mcontent, .mfooter\", function (e) {\n      if (!e.ctrlKey && !e.metaKey || e.altKey) {\n        setTimeout(function () {\n          // \"hold on\" to the ctrl key for 50ms\n          ctrl = false;\n        }, 50);\n      }\n\n      clearTimeout(debounceButtonPaneStatus);\n      debounceButtonPaneStatus = setTimeout(function () {\n        self.updateButtonPaneStatus();\n      }, 50);\n    });\n    $(document).on('keydown', \".mheader, .mcontent, .mfooter\", function (e) {\n      var sel = rangy.getSelection();\n      var range = sel.rangeCount ? sel.getRangeAt(0) : null;\n      var tag;\n\n      if (e.keyCode === 46) {\n        if (range.endContainer === range.startContainer) {\n          tag = range.startContainer;\n\n          if (tag.nodeType !== 3) {\n            if (tag.nodeName !== \"P\") {\n              tag = self.findUpTag(tag, \"p\");\n            }\n\n            if (!_h.isNullOrEmpty(tag) && $(tag).has(\"img\").length === 0) $(tag).remove();\n            return false;\n          }\n        }\n      }\n    });\n    setTimeout(function () {\n      $(\".rich-texteditor\").find(\".fnt-selector\").fontSelector({\n        textFontSize: \"11px\",\n        textFontFamily: \"Nazanin\",\n        magazine: true\n      });\n    }, 150);\n    $(document).on('change', \".linespaceVal\", function (e) {\n      var optVal = $(e.currentTarget).val();\n      self.toggleCommand(null, \"lineHeight\", optVal);\n    });\n    $(document).on('click', \".font-select\", function (e) {\n      e.preventDefault();\n      e.stopPropagation();\n      return false;\n    });\n    $(document).on('contextmenu', \".mheader, .mcontent, .mfooter\", function (e) {\n      e.preventDefault();\n      var closestPart = $(e.currentTarget);\n      if (!closestPart.hasClass(\"mpart\")) closestPart = $(e.currentTarget).closest(\".mpart\");\n      if (!closestPart.length) closestPart = $(e.target).closest(\".mpart\");\n      var target = $(e.target);\n      self.setActivePage(closestPart);\n      self.showMenu(true);\n\n      if (target.hasClass(\"mimage\")) {\n        self.showMenuType('image');\n        self.activeObject($(e.target));\n        self.pictureHeightsub.suspend();\n        self.pictureWidthsub.suspend();\n        var jObject = $(e.target).get(0);\n        var height = jObject.style.height.replace(\"%\", \"\");\n        var width = jObject.style.width.replace(\"%\", \"\");\n        self.pictureHeight(height);\n        self.pictureWidth(width);\n        self.pictureHeightsub.unsuspend();\n        self.pictureWidthsub.unsuspend();\n        $(\".image-menu\").position({\n          my: 'right top',\n          at: 'right top',\n          of: $(e.target)\n        });\n      } else if (target.hasClass(\"iframe-shadow\") || target.hasClass(\"table-templateId\")) {\n        self.showMenuType('table-template');\n        self.activeObject($(e.target).parent());\n      } else {\n        self.showMenuType('text');\n        self.activeObject(undefined);\n      }\n\n      if (closestPart.hasClass(\"mheader\")) self.toggleToolbarVisibility(\"header\");\n      if (closestPart.hasClass(\"mcontent\")) self.toggleToolbarVisibility(\"content\");\n      if (closestPart.hasClass(\"mfooter\")) self.toggleToolbarVisibility(\"footer\");\n      if (self.showMenuType() !== 'image') $(\".image-menu\").position({\n        my: 'top top',\n        at: 'top top',\n        of: $(e.target)\n      });\n    });\n    $(document).on('click', \".image-menu .form-control, .image-menu .btn, .image-menu .input-group-addon\", function (e) {\n      e.preventDefault();\n      e.stopPropagation();\n    });\n  };\n\n  self.toggleToolbarVisibility = function (loc) {\n    var page = self.getActivePage();\n    var parent = page.parent();\n    var id = parent.attr(\"page-id\");\n    var isEven = self.isEvenNumber(id);\n    $(\".defaultOddHeader\").css(\"display\", loc === \"header\" && !isEven ? \"\" : \"none\");\n    $(\".defaultOddFooter\").css(\"display\", loc === \"footer\" && !isEven ? \"\" : \"none\");\n    $(\".defaultHeader\").css(\"display\", loc === \"header\" && isEven ? \"\" : \"none\");\n    $(\".defaultFooter\").css(\"display\", loc === \"footer\" && isEven ? \"\" : \"none\");\n    $(\".dragStartTable\").css(\"display\", loc === \"content\" && self.showMenuType() === \"table-template\" ? \"\" : \"none\"); //$(\".pasteContent\").css(\"display\",  ? \"\" : \"none\");\n  };\n\n  self.getActivePage = function () {\n    return $(\".active-page\");\n  };\n\n  self.setActivePage = function (currentTarget) {\n    if (_h.isNullOrEmpty(currentTarget)) return;\n    var currentPage = currentTarget.closest(\".page\");\n\n    if (!currentPage.hasClass(\"active-page\")) {\n      self.setGuidLines();\n      $(\".page\").removeClass(\"active-page\");\n      currentPage.addClass(\"active-page\");\n      self.transferGuidLines();\n      var templateList = $(\".table-templateId:empty\");\n      var chartList = currentPage.find(\".chart-image\").filter(function (i, a) {\n        if ($(a).attr(\"src\") && $(a).attr(\"src\").endsWith(\"f//Z\")) return true;\n        return false;\n      });\n      if (_h.any(templateList) || _h.any(chartList)) self.loadPageTableTemplates(currentPage);\n    }\n\n    self.activePageAnalyzer();\n    self.updateButtonPaneStatus();\n  };\n\n  self.handleImageUploadBtn = function (element, e) {\n    e.preventDefault();\n\n    if (!$(\".active-ed\") || $(\".active-ed\").length === 0) {\n      toast.custom(\"error\", _h.getApiMessage(\"ErrorSelectPageSection\"));\n    } else {\n      $(\"#upload:hidden\").trigger('click');\n    }\n  };\n\n  self.handleImageUpload = function (element) {\n    var file = element.files[0];\n\n    var ext = _h.getExtension(file.name);\n\n    if (ext.toLowerCase() !== \"jpg\" && ext.toLowerCase() !== \"jpeg\" && ext.toLowerCase() !== \"png\") {\n      toast.custom(\"error\", \" فرمت های صحیح تصویر\" + \" jpg, jpeg, png\" + \"می باشد\");\n      return false;\n    }\n\n    _h.toBase64(file, function (res) {\n      var model = {\n        controllerName: 7,\n        fileName: file.name,\n        file: res\n      };\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_2__.ApiService.request({\n        url: \"/api/common/postimage\",\n        data: model,\n        success: function success(data) {\n          if (!_h.isEmpty(data)) {\n            if (_h.isEmpty(data.model)) {\n              _h.failToast(\"در هنگام بارگزاری تصویر خطایی رخ داده است\");\n            } else {\n              var imgString = $('<img/>').attr(\"src\", data.model).css({\n                \"max-height\": \"100%\",\n                \"max-width\": \"100%\",\n                \"height\": \"100%\",\n                \"width\": \"100%\"\n              }).addClass('mimage').prop('outerHTML');\n              var p = \"<p style='text-align: center;'>\" + imgString + \"<p/>\";\n              var hasSelectHtml = self.hasSelectHtml(\"mpart\");\n              if (hasSelectHtml) document.execCommand('insertHTML', false, p);else $(\".active-ed\").append(p);\n            }\n          }\n\n          $(\"#upload\").val(null);\n        },\n        error: function error(data) {\n          _h.failToast(\"در هنگام بارگزاری تصویر خطایی رخ داده است\");\n        }\n      });\n    }.bind(this));\n  };\n\n  self.htmlContentCleaner = function () {\n    var $ed = $(\".active-ed\");\n    if (!$ed || $ed.length === 0) return;\n    var newTag;\n\n    for (var j = 0; j < self.defaultSemanticMap.length; j++) {\n      var oldtag = self.defaultSemanticMap[j];\n      newTag = oldtag.newName;\n      $(oldtag.name, $ed).each(function () {\n        var $oldTag = $(this);\n\n        if ($oldTag) {\n          if (!oldtag.exceptionClasses || !self.hasClasses($oldTag, oldtag.exceptionClasses)) {\n            $oldTag.wrap('<' + newTag + '/>');\n            $oldTag.contents().unwrap();\n            if (oldtag.style) $oldTag.attr(\"style\", oldtag.style);\n\n            if (newTag === \"p\") {}\n          }\n        }\n      });\n    }\n\n    if ($ed.children().length) for (var i = 0; i < $ed.children().length; i++) {\n      if ($ed.children()[i].nodeName === \"BR\") $($ed.children()[i]).remove();\n    }\n    var inlineElementsSelector = \"a,abbr,acronym,b,caption,cite,code,col,dfn,dir,dt,dd,em,font,hr,i,kbd,ol,ul,li,q,span,strikeout,strong,sub,sup,u\",\n        blockElementsSelector = ':not(' + inlineElementsSelector + ')';\n    $ed.contents().filter(function () {\n      return this.nodeType === 3 && this.nodeValue.trim().length > 0;\n    }).wrap('<span/>');\n\n    var wrapInlinesInParagraphsFrom = function wrapInlinesInParagraphsFrom($from) {\n      if ($from.length !== 0) {\n        var $finalParagraph = $from.nextUntil(blockElementsSelector).addBack().wrapAll('<p/>').parent(),\n            $nextElement = $finalParagraph.nextAll(inlineElementsSelector).first();\n        $finalParagraph.next('br').remove();\n        wrapInlinesInParagraphsFrom($nextElement);\n      }\n    };\n\n    wrapInlinesInParagraphsFrom($ed.children(inlineElementsSelector).first());\n    $.each($ed.find(\"p\"), function () {\n      var p = $(this);\n\n      if (p.text() === \"\" && !p.has(\"br\").length && !p.has(\"img\").length) {\n        p.remove();\n      } else {\n        if (p.has(\"p\").length && (p.has(\"ol\").length || p.has(\"ul\").length)) {\n          p.find(\"p\").remove();\n          var tar = $(\"<p><br></p>\").insertAfter(p);\n          self.fixCursorLocation(tar);\n        }\n      }\n    });\n    $ed.find(\".table-templateId br\").remove();\n    $.each($ed.find(\"ol li, ul li\"), function () {\n      var li = $(this);\n\n      if (li.has(\"span\")) {\n        var fontFamily, fontSize;\n        var spans = li.find(\"span\");\n        $.each(spans, function () {\n          var span = $(this);\n          var style = span.attr(\"style\");\n          if (style && style.indexOf(\"font-size\") !== -1) fontSize = span.css(\"font-size\");\n          if (style && style.indexOf(\"font-family\") !== -1) fontFamily = span.css(\"font-family\");\n        });\n        if (fontSize) li.css(\"font-size\", fontSize);\n        if (fontFamily) li.css(\"font-family\", fontFamily);\n      }\n    });\n  };\n\n  self.fixCursorLocation = function (element, toEnd) {\n    try {\n      element = element.get(0);\n    } catch (e) {//\n    }\n\n    var sel = rangy.getSelection();\n    var range = sel.rangeCount ? sel.getRangeAt(0) : null;\n    range.setStart(element, 0);\n    range.setEnd(element);\n    rangy.getSelection().setSingleRange(range);\n  };\n\n  self.fillModel = function (model) {\n    var json;\n    self.startPageNumber(self.magazine().startPageNumber());\n\n    if (!_h.isNullOrEmpty(model.setting) && model.setting !== \"\") {\n      json = JSON.parse(model.setting);\n      self.setting().fillModel(json);\n\n      if (json && !_h.isNullOrEmpty(json.guideLines) && json.guideLines !== \"\") {\n        self.guideLines.portrait = json.guideLines.portrait;\n        self.guideLines.landscape = json.guideLines.landscape;\n      }\n    }\n\n    setTimeout(function () {\n      if (!_h.isNullOrEmpty(model.pages)) {\n        var list = $(model.pages);\n        var counter = 0;\n        var targetUpdate = undefined;\n        $.each(list, function (i, p) {\n          var pageElement = $(p);\n\n          if (pageElement.hasClass(\"page\")) {\n            var page = \"<div class='col-lg-12 tx-page-frame' page-id=\" + (counter + 1) + \">\";\n            var pageOrientation = pageElement.attr(\"orientation\");\n\n            if (pageOrientation === \"Landscape\") {\n              pageElement.css({\n                \"width\": \"\",\n                \"height\": \"\"\n              });\n              pageElement.find(\".main\").css({\n                \"transform\": \"\",\n                \"width\": \"\",\n                \"height\": \"\",\n                \"right\": \"\",\n                \"bottom\": \"\"\n              });\n            }\n\n            pageElement.find(\".main\").append(\"<div class='header-area hide'></div><div class='footer-area hide'></div>\");\n            pageElement.find(\".mheader\").attr(\"contenteditable\", true);\n            pageElement.find(\".mcontent\").attr(\"contenteditable\", true);\n            pageElement.find(\".mfooter\").attr(\"contenteditable\", true);\n            if (!pageElement[0].hasAttribute(\"orientation\")) pageElement.attr(\"orientation\", \"Portrait\");\n\n            if (counter === 0) {\n              if (!pageElement.hasClass(\"active-page\")) pageElement.addClass(\"active-page\");\n              targetUpdate = counter + 1;\n            } else {\n              pageElement.removeClass(\"active-page\");\n            }\n\n            page += pageElement[0].outerHTML;\n            page += \"<div class='page-bottom-bar'>\" + \"<span class='page-number-info'>\" + (i + 1) + \" از \" + model.pages.length + \" صفحه \" + \"</span>\" + \"</div>\";\n            page += \"</div>\";\n            $(\".editor-frame\").append(page);\n            counter++;\n          }\n        });\n\n        if (targetUpdate > 0) {\n          targetUpdate = $('[page-id=\"' + targetUpdate + '\"]');\n          self.loadPageTableTemplates(targetUpdate);\n          self.configDropFunctionality();\n          self.activePageAnalyzer();\n        }\n\n        self.handlePageNumbers();\n      } else {\n        var content = self.createNewPageContent({\n          paperSize: self.setting().pageSize(),\n          setActive: true,\n          orientation: \"Portrait\"\n        }, 1);\n        $(\".editor-frame\").append(content);\n        self.tableTemplateModel().magazineId(self.magazine().id());\n        self.tableTemplateModel().init();\n        self.handlePageNumbers();\n      }\n    }, 200);\n  };\n\n  self.fillEmpty = function () {\n    var content = self.createNewPageContent({\n      paperSize: self.setting().pageSize(),\n      setActive: true,\n      orientation: \"Portrait\"\n    }, 1);\n    $(\".editor-frame\").append(content);\n    self.activePageAnalyzer();\n    self.handlePageNumbers();\n  };\n\n  self.saveChanges = function () {\n    var pages = self.getMagazineOutputHtml();\n    var setting = self.setting().toServer();\n    setting.guideLines = self.guideLines;\n    var model = {\n      setting: JSON.stringify(setting),\n      pages: pages,\n      id: self.magazine().id()\n    };\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_2__.ApiService.request({\n      url: \"/api/magazine/postsavepages\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) if (_h.any(data.errors)) {\n          _h.errorListHandler(data.errors);\n        } else {\n          var text = _h.getApiMessage(\"PostPagesMagazineSuccess\");\n\n          _h.successToast(text);\n        }\n      },\n      error: function error(data) {\n        var text = _h.getApiMessage(\"PostPagesMagazineError\");\n\n        _h.failToast(text);\n      }\n    });\n  };\n\n  self.getMagazineOutputHtml = function () {\n    var pageList = $(\".page\");\n    var outHhtml = \"<!DOCTYPE html><html><head>\";\n    outHhtml += \"<link href='\" + location.protocol + \"//\" + location.host + \"/App/src/styles/magazine-page.css' rel='stylesheet'/>\";\n    outHhtml += \"</head><body>\";\n\n    for (var i = 0; i < pageList.length; i++) {\n      var target = $(pageList[i])[0].outerHTML;\n      var newTarget = $(target);\n      var pageSize = newTarget.attr(\"size\");\n      var pageOrientation = newTarget.attr(\"orientation\");\n\n      if (pageOrientation === \"Landscape\") {\n        switch (pageSize) {\n          case \"A4\":\n            newTarget.css({\n              \"width\": \"210mm\",\n              \"height\": \"297mm\"\n            });\n            newTarget.find(\".main\").css({\n              \"transform\": \"rotate(90deg)\",\n              \"width\": \"297mm\",\n              \"height\": \"210mm\",\n              \"right\": \"-164px\",\n              \"bottom\": \"-164px\"\n            });\n            break;\n\n          case \"A3\":\n            break;\n        }\n      }\n\n      newTarget.find(\"img\").css({\n        \"max-height\": \"\",\n        \"max-width\": \"\"\n      });\n      newTarget.find(\".mheader\").removeAttr(\"contenteditable\");\n      newTarget.find(\".mcontent\").removeAttr(\"contenteditable\");\n      newTarget.find(\".mfooter\").removeAttr(\"contenteditable\");\n      newTarget.find(\".header-area\").remove();\n      newTarget.find(\".footer-area\").remove();\n      outHhtml += newTarget[0].outerHTML.trim();\n    }\n\n    outHhtml += \"</body></html>\";\n    return outHhtml;\n  };\n\n  self.guideLines = {\n    landscape: [],\n    portrait: []\n  };\n\n  self.setGuidLines = function () {\n    if (self.ruler) {\n      var activePage = self.getActivePage();\n      var direction = $(activePage).attr(\"orientation\");\n\n      if (activePage.parent().find(\".rul_wrapper\").length) {\n        var list = self.ruler.api.getGuides();\n        if (!list) list = [];\n\n        if (direction === \"Portrait\") {\n          self.guideLines.portrait = list;\n        } else {\n          self.guideLines.landscape = list;\n        }\n      }\n    }\n  };\n\n  self.transferGuidLines = function () {\n    if (self.ruler) {\n      var activePage = self.getActivePage();\n\n      if (activePage.parent().find(\".rul_wrapper\").length) {\n        var direction = $(activePage).attr(\"orientation\");\n        self.ruler.api.clearGuides();\n\n        if (direction === \"Portrait\") {\n          self.ruler.api.setGuides(self.guideLines.portrait);\n        } else {\n          self.ruler.api.setGuides(self.guideLines.landscape);\n        }\n      }\n    }\n  };\n\n  self.toggleSuspendPageControls = function (sta) {\n    if (sta) {\n      self.pageNumbersub.suspend();\n      self.marginRightsub.suspend();\n      self.marginLeftsub.suspend();\n      self.marginTopsub.suspend();\n      self.marginBottomsub.suspend();\n      self.disableHeadersub.suspend();\n      self.disableFootersub.suspend();\n      self.disableDefaultHeadersub.suspend();\n      self.disableDefaultFootersub.suspend();\n      self.disableInNumerationsub.suspend();\n      self.disableMarginHeadersub.suspend();\n      self.disableMarginFootersub.suspend();\n      self.pageOrientationsub.suspend();\n    } else {\n      self.pageNumbersub.unsuspend();\n      self.marginRightsub.unsuspend();\n      self.marginLeftsub.unsuspend();\n      self.marginTopsub.unsuspend();\n      self.marginBottomsub.unsuspend();\n      self.disableHeadersub.unsuspend();\n      self.disableFootersub.unsuspend();\n      self.disableDefaultHeadersub.unsuspend();\n      self.disableDefaultFootersub.unsuspend();\n      self.disableInNumerationsub.unsuspend();\n      self.disableMarginHeadersub.unsuspend();\n      self.disableMarginFootersub.unsuspend();\n      self.pageOrientationsub.unsuspend();\n    }\n  };\n\n  self.init = function () {\n    rangy.init();\n    self.configTools();\n    self.tableTemplateModel().magazineId(self.magazine().id());\n    self.tableTemplateModel().init();\n    self.configDropFunctionality();\n    self.getTextTemplate();\n    self.fillTagTemplates();\n    $(document).off(\"guideLineMove\", \".rul_line\");\n  };\n\n  self.ruler = undefined;\n\n  self.toggleRuler = function () {\n    var el;\n    el = document.getElementsByClassName('active-page');\n    if (!el) return;\n    el = el[0];\n\n    if (el.parentNode.getElementsByClassName(\"rul_wrapper\").length > 0) {\n      self.ruler.api.destroy();\n      self.ruler = undefined;\n      $(document).off(\"guideLineMove\", \".rul_line\");\n    } else {\n      if (self.ruler) {\n        self.ruler.api.destroy();\n        self.ruler = undefined;\n        $(document).off(\"guideLineMove\", \".rul_line\");\n      }\n\n      el = document.getElementsByClassName('active-page');\n      var pa = el[0].parentNode;\n\n      if (pa) {\n        self.ruler = new ruler({\n          container: pa,\n          orientation: self.pageOrientation(),\n          size: \"A4\",\n          enableMouseTracking: true,\n          enableToolTip: true\n        });\n        self.transferGuidLines();\n        $(document).on(\"guideLineMove\", \".rul_line\", function () {\n          self.setGuidLines();\n        });\n      }\n    }\n  };\n\n  self.createNewPageContent = function (model, priority) {\n    var isEven = self.isEvenNumber(priority);\n    var page = \"<div class='col-lg-12 tx-page-frame' page-id=\" + priority + \">\" + \"<div class='page tx-frame\" + (model.setActive === true ? \" active-page \" : \"\") + \"' orientation='\" + model.orientation + \"' size='\" + model.paperSize + \"'><div class='main'>\";\n    page += \"<div class='mheader mpart' contenteditable='true'\" + \" style='padding-top:\" + self.setting().marginTop() + \"mm;padding-left:\" + self.setting().marginLeft() + \"mm;padding-right:\" + self.setting().marginRight() + \"mm;'>\" + (isEven === true ? self.checkNullString(self.setting().defaultHeader()) : self.checkNullString(self.setting().defaultOddHeader())) + \"</div>\";\n    page += \"<div class='mcontent mpart' contenteditable='true'\" + \" style='padding-left:\" + self.setting().marginLeft() + \"mm;padding-right:\" + self.setting().marginRight() + \"mm;'\" + \" ></div>\";\n    page += \"<div class='mfooter mpart' contenteditable='true'\" + \" style='padding-bottom:\" + self.setting().marginBottom() + \"mm;padding-left:\" + self.setting().marginLeft() + \"mm;padding-right:\" + self.setting().marginRight() + \"mm;'>\" + (isEven === true ? self.checkNullString(self.setting().defaultFooter()) : self.checkNullString(self.setting().defaultOddFooter())) + \"</div>\";\n    page += \"<div class='page-number' type='\" + self.setting().pageNumber() + \"'></div>\";\n    page += \"<div class='header-area hide'></div><div class='footer-area hide'>\" + \"</div></div></div>\" + \"<div class='page-bottom-bar'>\" + \"<span class='page-number-info'>\" + priority + \" از \" + $(\".page\").length + \" صفحه \" + \"</span>\" + \"</div>\" + \"</div>\";\n    return page;\n  };\n\n  self.addPage = function (setActive) {\n    var activePage = self.getActivePage();\n    var activePageId = Number(activePage.parent().attr(\"page-id\"));\n    var nextPage = activePage.parent().next(\".tx-page-frame\");\n    var content;\n\n    if (!nextPage.length) {\n      var pageCount = $(\".page\").length;\n      content = self.createNewPageContent({\n        paperSize: self.setting().pageSize(),\n        setActive: setActive,\n        orientation: \"Portrait\"\n      }, pageCount + 1);\n      $(\".editor-frame\").append(content);\n    } else {\n      content = self.createNewPageContent({\n        paperSize: self.setting().pageSize(),\n        setActive: setActive,\n        orientation: \"Portrait\"\n      }, activePageId + 1);\n      $(content).insertAfter(activePage.parent());\n      var pages = $(\".page\");\n\n      for (var i = 0; i < pages.length; i++) {\n        var page = pages[i];\n        $(page).parent().attr(\"page-id\", i + 1);\n      }\n    }\n\n    self.handlePageNumbers();\n    self.configDragFunctionality();\n    self.configDropFunctionality();\n  };\n\n  self.removePage = function () {\n    if ($(\".page\").length > 1) {\n      var nextItem;\n      var page = self.getActivePage();\n      var parent = page.parent();\n      var pageId = Number(parent.attr(\"page-id\"));\n      if (pageId - 1 > 0) nextItem = pageId - 1;else nextItem = pageId + 1;\n      var prev = $(\".tx-page-frame[page-id='\" + nextItem + \"']\");\n      parent.remove();\n      var pages = $(\".page\");\n\n      for (var i = 0; i < pages.length; i++) {\n        var target = pages[i];\n        $(target).parent().attr(\"page-id\", i + 1);\n        $(target).removeClass(\"active-page\");\n      }\n\n      self.setGuidLines();\n      prev.find(\".page\").addClass(\"active-page\");\n      self.transferGuidLines();\n      if (!_h.isNullOrEmpty(self.setting().defaultHeader()) && self.setting().defaultHeader() !== \"\") self.setting().changePages(\"defaultHeader\");\n      if (!_h.isNullOrEmpty(self.setting().defaultOddHeader()) && self.setting().defaultOddHeader() !== \"\") self.setting().changePages(\"defaultOddHeader\");\n      if (!_h.isNullOrEmpty(self.setting().defaultFooter()) && self.setting().defaultFooter() !== \"\") self.setting().changePages(\"defaultFooter\");\n      if (!_h.isNullOrEmpty(self.setting().defaultOddFooter()) && self.setting().defaultOddFooter() !== \"\") self.setting().changePages(\"defaultOddFooter\");\n      pages = $(\".page\");\n      self.handlePageNumbers();\n\n      for (var k = 0; k < pages.length; k++) {\n        var target2 = pages[k];\n        self.setting().refreshPartsSize(target2);\n      }\n    }\n  };\n\n  self.checkNullString = function (data) {\n    return _h.isNullOrEmpty(data) ? \"\" : data;\n  };\n\n  self.isEvenNumber = function (number) {\n    return number % 2 === 0;\n  };\n\n  self.disableInNumeration = ko.observable();\n  self.pictureHeight = ko.observable();\n  self.pictureWidth = ko.observable();\n  self.pageNumber = ko.observable();\n  self.pageOrientation = ko.observable(\"Portrait\");\n  self.disableHeader = ko.observable();\n  self.disableFooter = ko.observable();\n  self.disableDefaultHeader = ko.observable();\n  self.disableDefaultFooter = ko.observable();\n  self.disableMarginHeader = ko.observable();\n  self.disableMarginFooter = ko.observable();\n  self.marginRight = ko.observable();\n  self.marginLeft = ko.observable();\n  self.marginTop = ko.observable();\n  self.marginBottom = ko.observable();\n\n  self.activePageAnalyzer = function () {\n    var page = self.getActivePage();\n    var main = page.find(\".main\");\n    self.toggleSuspendPageControls(true);\n    var pageNumber = main.find(\".page-number\").attr(\"type\");\n    self.pageNumber(pageNumber);\n    var disableInNumeration = main.attr(\"disable-innum\") || false;\n    self.disableInNumeration(disableInNumeration);\n    var margins = self.getMargins(page);\n    self.marginRight(margins.marginRight);\n    self.marginLeft(margins.marginLeft);\n    self.marginTop(margins.marginTop);\n    self.marginBottom(margins.marginBottom);\n    var disableMarginHeader = main.attr(\"disable-marginheader\") === \"true\" ? true : false;\n    var disableMarginFooter = main.attr(\"disable-marginfooter\") === \"true\" ? true : false;\n    self.disableMarginHeader(disableMarginHeader);\n    self.disableMarginFooter(disableMarginFooter);\n    var pageOrientation = page.attr(\"orientation\") || \"Portrait\";\n    self.pageOrientation(pageOrientation);\n    var disableHeader = main.find(\".mheader\").length === 0;\n    self.disableHeader(disableHeader);\n    var disableFooter = main.find(\".mfooter\").length === 0;\n    self.disableFooter(disableFooter);\n    var disableDefaultHeader = main.attr(\"disable-defh\") || false;\n    self.disableDefaultHeader(disableDefaultHeader);\n    var disableDefaultFooter = main.attr(\"disable-deff\") || false;\n    self.disableDefaultFooter(disableDefaultFooter);\n    self.toggleSuspendPageControls(false);\n  };\n\n  self.getMargins = function (element) {\n    var millimeters = {\n      marginTop: 0,\n      marginBottom: 0,\n      marginRight: 0,\n      marginLeft: 0\n    };\n    var header = element.find(\".mheader\");\n    var footer = element.find(\".mfooter\");\n    var content = element.find(\".mcontent\");\n    var main = element.find(\".main\");\n    var disableMarginHeader = main.attr(\"disable-marginheader\") === \"true\" ? true : false;\n    var disableMarginFooter = main.attr(\"disable-marginfooter\") === \"true\" ? true : false;\n    var paddingRight = self.getPaddingString(content.attr('style'), \"padding-right\");\n    var paddingLeft = self.getPaddingString(content.attr('style'), \"padding-left\");\n    var paddingTop;\n    var paddingBottom;\n    millimeters.marginRight = parseInt(paddingRight);\n    millimeters.marginLeft = parseInt(paddingLeft);\n\n    if (!disableMarginHeader) {\n      if (header.length) {\n        paddingTop = self.getPaddingString(header.attr('style'), \"padding-top\");\n        millimeters.marginTop = parseInt(paddingTop);\n      } else {\n        paddingTop = self.getPaddingString(content.attr('style'), \"padding-top\");\n        millimeters.marginTop = parseInt(paddingTop);\n      }\n    } else {\n      paddingTop = self.getPaddingString(content.attr('style'), \"padding-top\");\n      millimeters.marginTop = parseInt(paddingTop);\n    }\n\n    if (!disableMarginFooter) {\n      if (footer.length) {\n        paddingBottom = self.getPaddingString(footer.attr('style'), \"padding-bottom\");\n        millimeters.marginBottom = parseInt(paddingBottom);\n      } else {\n        paddingBottom = self.getPaddingString(content.attr('style'), \"padding-bottom\");\n        millimeters.marginBottom = parseInt(paddingBottom);\n      }\n    } else {\n      paddingBottom = self.getPaddingString(content.attr('style'), \"padding-bottom\");\n      millimeters.marginBottom = parseInt(paddingBottom);\n    }\n\n    return millimeters;\n  };\n\n  self.getPaddingString = function (style, item) {\n    if (!_h.isNullOrEmpty(style) && style !== \"\" && style.indexOf(\"padding:\") === -1) {\n      var splits = style.split(\";\");\n      var cleanStr;\n      splits = _h.cleanArray(splits);\n\n      if (_h.any(splits)) {\n        for (var i = 0; i < splits.length; i++) {\n          var target = splits[i];\n\n          if (target.indexOf(item) !== -1) {\n            cleanStr = target.replace(item, \"\").replace(\":\", \"\").trim();\n          }\n        }\n\n        return cleanStr;\n      }\n\n      return \"\";\n    }\n\n    if (!_h.isNullOrEmpty(style) && style !== \"\" && style.indexOf(\"padding:\") !== -1) {\n      var padding = style.split('padding');\n\n      for (var i = 0; i < padding.length; i++) {\n        var targetpad = padding[i];\n\n        if (!_h.isNullOrEmpty(targetpad) && targetpad !== \"\" && targetpad.startsWith(\":\")) {\n          var splits2 = targetpad.replace(\":\", \"\").split(\";\")[0];\n          splits2 = splits2.split(\" \");\n          splits2 = _h.cleanArray(splits2);\n\n          switch (splits2.length) {\n            case 1:\n              return splits2[0];\n\n            case 2:\n              if (item === \"padding-bottom\" || item === \"padding-top\") return splits2[0];\n              if (item === \"padding-right\" || item === \"padding-left\") return splits2[1];\n\n            case 3:\n              if (item === \"padding-top\") return splits2[0];\n              if (item === \"padding-bottom\") return splits2[2];\n              if (item === \"padding-right\" || item === \"padding-left\") return splits2[1];\n\n            case 4:\n              if (item === \"padding-top\") return splits2[0];\n              if (item === \"padding-right\") return splits2[1];\n              if (item === \"padding-left\") return splits2[3];\n              if (item === \"padding-bottom\") return splits2[2];\n          }\n        }\n      }\n    }\n\n    return \"\";\n  };\n\n  self.getLineHeight = function (element) {\n    var val = undefined;\n    var style = $(element).attr('style');\n\n    if (style) {\n      var padding = style.split('line-height');\n\n      for (var i = 0; i < padding.length; i++) {\n        var target = padding[i];\n\n        if (!_h.isNullOrEmpty(target) && target !== \"\") {\n          var splits = target.replace(\":\", \"\").replace(\";\", \"\").replace(\"line-height\", \"\");\n          val = parseFloat(splits.trim());\n        }\n      }\n    }\n\n    return val;\n  };\n\n  self.getFontSize = function (element) {\n    var val = undefined;\n    var style = $(element).attr('style');\n\n    if (style) {\n      var params = style.split('font-size');\n\n      for (var i = 0; i < params.length; i++) {\n        var target = params[i];\n\n        if (!_h.isNullOrEmpty(target) && target !== \"\") {\n          var splits = target.replace(\":\", \"\").replace(\";\", \"\").replace(\"font-size\", \"\");\n          val = parseFloat(splits.trim());\n        }\n      }\n    }\n\n    return val;\n  };\n\n  self.toggleCheckBox = function (name, e, parent) {\n    self[name](!self[name]());\n  };\n\n  self.pictureHeightsub = self.pictureHeight.supsendableSubscribe(function (newValue) {\n    if (newValue !== undefined && newValue !== null) {\n      self.activeObject().css(\"height\", newValue + \"%\");\n    }\n  });\n  self.pictureWidthsub = self.pictureWidth.supsendableSubscribe(function (newValue) {\n    if (newValue !== undefined && newValue !== null) {\n      self.activeObject().css(\"width\", newValue + \"%\");\n    }\n  });\n  self.marginRightsub = self.marginRight.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue) && newValue >= 0) {\n      var page = self.getActivePage();\n      page.find(\".mcontent\").css('padding-right', newValue + \"mm\");\n      if (!self.disableMarginHeader()) page.find(\".mheader\").css('padding-right', newValue + \"mm\");else page.find(\".mheader\").css('padding-right', \"\");\n      if (!self.disableMarginFooter()) page.find(\".mfooter\").css('padding-right', newValue + \"mm\");else page.find(\".mfooter\").css('padding-right', \"\");\n      self.refreshPartsSize();\n    }\n  });\n  self.marginLeftsub = self.marginLeft.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue) && newValue >= 0) {\n      var page = self.getActivePage();\n      page.find(\".mcontent\").css('padding-left', newValue + \"mm\");\n      if (!self.disableMarginHeader()) page.find(\".mheader\").css('padding-left', newValue + \"mm\");else page.find(\".mheader\").css('padding-left', \"\");\n      if (!self.disableMarginFooter()) page.find(\".mfooter\").css('padding-left', newValue + \"mm\");else page.find(\".mfooter\").css('padding-left', \"\");\n      self.refreshPartsSize();\n    }\n  });\n  self.marginTopsub = self.marginTop.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue) && newValue >= 0) {\n      var page = self.getActivePage();\n\n      if (page.find(\".mheader\").length > 0) {\n        if (!self.disableMarginHeader()) {\n          page.find(\".mheader\").css('padding-top', newValue + \"mm\");\n          page.find(\".mcontent\").css('padding-top', \"\");\n        } else {\n          page.find(\".mheader\").css('padding-top', \"\");\n          page.find(\".mcontent\").css('padding-top', newValue + \"mm\");\n        }\n      } else {\n        page.find(\".mcontent\").css('padding-top', newValue + \"mm\");\n      }\n\n      self.refreshPartsSize();\n    }\n  });\n  self.marginBottomsub = self.marginBottom.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue) && newValue >= 0) {\n      var page = self.getActivePage();\n\n      if (page.find(\".mfooter\").length > 0) {\n        if (!self.disableMarginFooter()) {\n          page.find(\".mfooter\").css('padding-bottom', newValue + \"mm\");\n          page.find(\".mcontent\").css('padding-bottom', \"\");\n        } else {\n          page.find(\".mfooter\").css('padding-bottom', \"\");\n          page.find(\".mcontent\").css('padding-bottom', newValue + \"mm\");\n        }\n      } else {\n        page.find(\".mcontent\").css('padding-bottom', newValue + \"mm\");\n      }\n\n      self.refreshPartsSize();\n    }\n  });\n  self.disableMarginHeadersub = self.disableMarginHeader.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      var page = self.getActivePage();\n\n      if (newValue) {\n        if (page.find(\".mheader\").length > 0) {\n          page.find(\".mheader\").css('padding-right', \"\");\n          page.find(\".mheader\").css('padding-left', \"\");\n          page.find(\".mheader\").css('padding-top', \"\");\n          page.find(\".mcontent\").css('padding-top', self.marginTop() + \"mm\");\n        } else {\n          page.find(\".mcontent\").css('padding-top', \"\");\n        }\n\n        page.find(\".main\").attr(\"disable-marginheader\", true);\n      } else {\n        if (page.find(\".mheader\").length > 0) {\n          page.find(\".mheader\").css('padding-right', self.marginRight() + \"mm\");\n          page.find(\".mheader\").css('padding-left', self.marginLeft() + \"mm\");\n          page.find(\".mheader\").css('padding-top', self.marginTop() + \"mm\");\n          page.find(\".mcontent\").css('padding-top', \"\");\n        } else {\n          page.find(\".mcontent\").css('padding-top', self.marginTop() + \"mm\");\n        }\n\n        page.find(\".main\").removeAttr(\"disable-marginheader\");\n      }\n    }\n  });\n  self.disableMarginFootersub = self.disableMarginFooter.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      var page = self.getActivePage();\n\n      if (newValue) {\n        if (page.find(\".mfooter\").length > 0) {\n          page.find(\".mfooter\").css('padding-right', \"\");\n          page.find(\".mfooter\").css('padding-left', \"\");\n          page.find(\".mfooter\").css('padding-bottom', \"\");\n          page.find(\".mcontent\").css('padding-bottom', self.marginBottom() + \"mm\");\n        } else {\n          page.find(\".mcontent\").css('padding-bottom', \"\");\n        }\n\n        page.find(\".main\").attr(\"disable-marginfooter\", true);\n      } else {\n        if (page.find(\".mfooter\").length > 0) {\n          page.find(\".mfooter\").css('padding-right', self.marginRight() + \"mm\");\n          page.find(\".mfooter\").css('padding-left', self.marginLeft() + \"mm\");\n          page.find(\".mfooter\").css('padding-bottom', self.marginBottom() + \"mm\");\n          page.find(\".mcontent\").css('padding-bottom', \"\");\n        } else {\n          page.find(\".mcontent\").css('padding-bottom', self.marginBottom() + \"mm\");\n        }\n\n        page.find(\".main\").removeAttr(\"disable-marginfooter\");\n      }\n    }\n  });\n  self.disableHeadersub = self.disableHeader.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      var page = self.getActivePage();\n      var main = page.find(\".main\");\n\n      if (newValue) {\n        main.find(\".mheader\").remove();\n        main.find(\".header-area\").remove();\n        page.find(\".mcontent\").css('padding-top', self.marginTop() + \"mm\");\n      } else {\n        main.append(\"<div class='mheader' contenteditable='true'></div>\");\n        main.append(\"<div class='header-area hide'></div>\");\n\n        if (!self.disableMarginHeader()) {\n          page.find(\".mheader\").css('padding-right', self.marginRight() + \"mm\");\n          page.find(\".mheader\").css('padding-left', self.marginLeft() + \"mm\");\n          page.find(\".mheader\").css('padding-top', self.marginTop() + \"mm\");\n          page.find(\".mcontent\").css('padding-top', \"\");\n        } else {\n          page.find(\".mcontent\").css('padding-top', self.marginTop() + \"mm\");\n        }\n      }\n\n      self.refreshPartsSize();\n    }\n  });\n  self.disableFootersub = self.disableFooter.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      var page = self.getActivePage();\n      var main = page.find(\".main\");\n\n      if (newValue) {\n        main.find(\".mfooter\").remove();\n        main.find(\".footer-area\").remove();\n        page.find(\".mcontent\").css('padding-bottom', self.marginBottom() + \"mm\");\n      } else {\n        main.append(\"<div class='mfooter' contenteditable='true'></div>\");\n        main.append(\"<div class='footer-area hide'></div>\");\n\n        if (!self.disableMarginFooter()) {\n          page.find(\".mfooter\").css('padding-right', self.marginRight() + \"mm\");\n          page.find(\".mfooter\").css('padding-left', self.marginLeft() + \"mm\");\n          page.find(\".mfooter\").css('padding-bottom', self.marginTop() + \"mm\");\n          page.find(\".mcontent\").css('padding-bottom', \"\");\n        } else {\n          page.find(\".mcontent\").css('padding-bottom', self.marginTop() + \"mm\");\n        }\n      }\n\n      self.refreshPartsSize();\n    }\n  });\n  self.disableDefaultHeadersub = self.disableDefaultHeader.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      var main = $(\".active-page .main\");\n\n      if (newValue) {\n        main.attr(\"disable-defh\", true);\n        main.find(\".mheader\").empty();\n      } else {\n        main.removeAttr(\"disable-defh\");\n      }\n    }\n  });\n  self.disableDefaultFootersub = self.disableDefaultFooter.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      var main = $(\".active-page .main\");\n\n      if (newValue) {\n        main.attr(\"disable-deff\", true);\n        main.find(\".mfooter\").empty();\n      } else {\n        main.removeAttr(\"disable-deff\");\n      }\n    }\n  });\n  self.disableInNumerationsub = self.disableInNumeration.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      var main = $(\".active-page .main\");\n\n      if (newValue) {\n        main.attr(\"disable-innum\", true);\n      } else {\n        main.removeAttr(\"disable-innum\");\n      }\n\n      self.handlePageNumbers();\n    }\n  });\n  self.pageNumbersub = self.pageNumber.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      var main = $(\".active-page\");\n      main.find(\".page-number\").attr(\"type\", newValue);\n      self.handlePageNumbers();\n    }\n  });\n  self.pageOrientationsub = self.pageOrientation.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      var page = $(\".active-page\");\n      page.attr(\"orientation\", newValue);\n      self.refreshPartsSize();\n      self.handlePageNumbers();\n\n      if (self.ruler) {\n        self.ruler.api.destroy();\n        self.ruler = undefined;\n        el = document.getElementsByClassName('active-page');\n        var pa = el[0].parentNode;\n\n        if (pa) {\n          self.ruler = new ruler({\n            container: pa,\n            orientation: self.pageOrientation(),\n            size: \"A4\",\n            enableMouseTracking: true,\n            enableToolTip: true\n          });\n        }\n      }\n    }\n  });\n\n  self.handlePageNumbers = function () {\n    var pages = $(\".page\");\n    var counter = self.magazine().startPageNumber();\n    var realCounter = 1;\n\n    for (var i = 0; i < pages.length; i++) {\n      var target = $(pages[i]);\n      var main = target.find(\".main\");\n      var pageNumber = main.find(\".page-number\");\n      var disableInNumeration = main.attr(\"disable-innum\");\n\n      if (_h.isNullOrEmpty(disableInNumeration)) {\n        var type = Number(pageNumber.attr(\"type\"));\n        pageNumber.text(counter);\n        var header = $(main).find(\".mheader\");\n        var content = $(main).find(\".mcontent\");\n\n        var restheight = _h.getHeight(header[0]) + _h.getHeight(content[0]);\n\n        switch (type) {\n          case 0:\n            pageNumber.css(\"display\", \"none\");\n            break;\n\n          case 1:\n            pageNumber.css({\n              \"display\": \"block\",\n              \"top\": _h.pixelToMm(restheight - 30) + \"mm\",\n              \"bottom\": \"initial\",\n              \"left\": \"7mm\",\n              \"right\": \"initial\"\n            });\n            break;\n\n          case 2:\n            pageNumber.css({\n              \"display\": \"block\",\n              \"top\": _h.pixelToMm(restheight - 30) + \"mm\",\n              \"bottom\": \"initial\",\n              \"right\": \"7mm\",\n              \"left\": \"initial\"\n            });\n            break;\n\n          case 3:\n            pageNumber.css({\n              \"display\": \"block\",\n              \"top\": _h.pixelToMm(restheight - 30) + \"mm\",\n              \"bottom\": \"initial\",\n              \"right\": \"48%\",\n              \"left\": \"initial\"\n            });\n            break;\n\n          case 4:\n            pageNumber.css({\n              \"display\": \"block\",\n              \"top\": \"initial\",\n              \"bottom\": \"5mm\",\n              \"left\": \"7mm\",\n              \"right\": \"initial\"\n            });\n            break;\n\n          case 5:\n            pageNumber.css({\n              \"display\": \"block\",\n              \"top\": \"initial\",\n              \"bottom\": \"5mm\",\n              \"left\": \"initial\",\n              \"right\": \"7mm\"\n            });\n            break;\n\n          case 6:\n            pageNumber.css({\n              \"display\": \"block\",\n              \"top\": \"initial\",\n              \"bottom\": \"5mm\",\n              \"left\": \"initial\",\n              \"right\": \"48%\"\n            });\n            break;\n        }\n\n        counter++;\n      } else {\n        pageNumber.css(\"display\", \"none\");\n      }\n\n      var pageNumberInfo = target.parent(\".tx-page-frame\").find(\".page-number-info\");\n      pageNumberInfo.text(realCounter + \" از \" + pages.length + \" صفحه \");\n      realCounter++;\n    }\n  };\n\n  self.refreshPartsSize = function () {\n    var main = $(\".active-page .main\");\n    main = main[0];\n    var pageheight = main.getBoundingClientRect().height;\n    var header = $(main).find(\".mheader\");\n    var footer = $(main).find(\".mfooter\");\n    var content = $(main).find(\".mcontent\");\n\n    var restheight = _h.getHeight(header[0]) + _h.getHeight(footer[0]);\n\n    var restTop = _h.getHeight(header[0]);\n\n    content.css({\n      'height': _h.pixelToMm(pageheight - restheight) + \"mm\",\n      'top': _h.pixelToMm(restTop) + \"mm\"\n    });\n  };\n\n  self.configDragFunctionality = function () {\n    $(\".template-item\").draggable({\n      cursor: \"pointer\",\n      cursorAt: {\n        top: 0,\n        left: 60\n      },\n      helper: function helper(event) {\n        var nodeName = event.target.innerText.length > 15 ? event.target.innerText.substring(0, 12) + \"...\" : event.target.innerText;\n        var text = \"<div id=\\\"selected-label\\\" style=\\\"font-size: 13px;z-index: 100000;margin-left: 7px;\\\" class=\\\"label label-success pull-right\\\">\" + \"<i class=\\\"fa fa-file-o\\\"></i>\" + \"<span style=\\\"margin-right: 5px;\\\">\" + nodeName + \"</span></div>\";\n        return $(text);\n      }\n    });\n    $(\".chart-item\").draggable({\n      cursor: \"pointer\",\n      cursorAt: {\n        top: 0,\n        left: 60\n      },\n      helper: function helper(event) {\n        var nodeName = event.target.title.length > 15 ? event.target.title.substring(0, 12) + \"...\" : event.target.title;\n        var text = \"<div id=\\\"selected-label\\\" style=\\\"font-size: 13px;z-index: 100000;margin-left: 7px;\\\" class=\\\"label label-success pull-right\\\">\" + \"<i class=\\\"fa fa-bar-chart\\\"></i>\" + \"<span style=\\\"margin-right: 5px;\\\">\" + nodeName + \"</span></div>\";\n        return $(text);\n      }\n    });\n  };\n\n  self.configDropFunctionality = function () {\n    $(\".page .mcontent\").droppable({\n      drop: function drop(event, ui) {\n        if ($(ui.helper).hasClass(\"table-templateId\") || $(ui.helper).hasClass(\"header-area\") || $(ui.helper).hasClass(\"footer-area\")) return;\n        var contentTag = $(event.target);\n        var value = $(ui.draggable[0]).attr(\"data-value\");\n        var title = $(ui.draggable[0]).attr(\"data-original-title\");\n        var id = $(ui.draggable[0]).attr(\"data-id\");\n        var type = $(ui.draggable[0]).attr(\"data-type\");\n\n        switch (type) {\n          case \"chart\":\n            self.getChartPicture(id, value);\n            break;\n\n          case \"template\":\n            self.GetTableTemplateHtml(id, function (res) {\n              if (!_h.isNullOrEmpty(res.data)) {\n                var p = \"<div class='table-templateId' data-id=\" + id + \" contenteditable='false'><div class='iframe-shadow' contenteditable='false'></div>\";\n                p += \"<iframe id='tabletemplate-box'>\" + \"</iframe>\";\n                p += \"</div><br>\";\n                var hasSelectHtml = self.hasSelectHtml(\"mcontent\");\n                if (hasSelectHtml) document.execCommand('insertHTML', false, p);else contentTag.append(p);\n                var div = $(\"[data-id=\" + id + \"]\");\n                div.attr(\"title\", res.title);\n                var iframe = div.find(\"iframe\").contents();\n\n                if (iframe) {\n                  iframe.find(\"head\").append(\"<link href='/App/src/styles/tabletemplate-meditor.css' rel='stylesheet'/>\");\n                  iframe.find(\"body\").append(res.data);\n                  self.resizeTableTemplateFrame(div);\n                }\n              }\n            });\n            break;\n        }\n      }\n    });\n  };\n\n  self.hasSelectHtml = function (domain) {\n    var selObj = document.getSelection();\n    var base = $(selObj.baseNode).closest(\".mpart\");\n    return base.hasClass(domain);\n  };\n\n  self.downloadModel = ko.observable();\n\n  self.toPdfBtn = function () {\n    var model = {};\n    var data = clientStorage.getSetting(\"MagazinePdfPage\");\n\n    if (!_h.isEmpty(data)) {\n      model = JSON.parse(data);\n    }\n\n    var model = new _model_js__WEBPACK_IMPORTED_MODULE_3__.MagazineDownloadFile(self, model);\n    self.downloadModel(model);\n\n    _h.kocnx().openForm(model);\n  };\n\n  self.toPdfSaveSetting = function () {\n    clientStorage.setSetting([{\n      key: \"MagazinePdfPage\",\n      value: JSON.stringify({\n        displayType: self.downloadModel().displayType(),\n        amountType: self.downloadModel().amountType()\n      })\n    }]);\n\n    var text = _h.getApiMessage(\"MagazinePdfPageSaveMessage\");\n\n    _h.successToast(text);\n  };\n\n  self.toPdf = function () {\n    var page = self.getActivePage()[0].outerHTML;\n    var outHtml = self.getPageOutputHtml(page);\n    var model = {\n      controllerName: 7,\n      inputData: {\n        id: self.magazine().id(),\n        content: outHtml,\n        displayType: self.downloadModel().displayType(),\n        amountType: self.downloadModel().amountType()\n      }\n    };\n\n    _h.kocnx().createPdf(model);\n\n    _h.kocnx().closeForm();\n  };\n\n  self.getPageOutputHtml = function (html) {\n    var outHhtml = \"<!DOCTYPE html><html><head>\";\n    outHhtml += \"<link href='\" + location.protocol + \"//\" + location.host + \"/App/src/styles/magazine-page.css' rel='stylesheet'/>\";\n    outHhtml += \"</head><body>\";\n    var page = $(html);\n    var pageSize = page.attr(\"size\");\n    var pageOrientation = page.attr(\"orientation\");\n\n    if (pageOrientation === \"Landscape\") {\n      switch (pageSize) {\n        case \"A4\":\n          page.css({\n            \"width\": \"210mm\",\n            \"height\": \"297mm\"\n          });\n          page.find(\".main\").css({\n            \"transform\": \"rotate(90deg)\",\n            \"width\": \"297mm\",\n            \"height\": \"210mm\",\n            \"right\": \"-164px\",\n            \"bottom\": \"-164px\"\n          });\n          break;\n\n        case \"A3\":\n          break;\n      }\n    }\n\n    page.find(\".mheader\").removeAttr(\"contenteditable\");\n    page.find(\".mcontent\").removeAttr(\"contenteditable\");\n    page.find(\".mfooter\").removeAttr(\"contenteditable\");\n    page.find(\"img\").css({\n      \"max-height\": \"\",\n      \"max-width\": \"\"\n    });\n    page.find(\".header-area\").remove();\n    page.find(\".footer-area\").remove();\n    outHhtml += page[0].outerHTML.trim();\n    outHhtml += \"</body></html>\";\n    return outHhtml;\n  };\n\n  self.toggleRight = function () {\n    self.wideRight(!self.wideRight());\n  };\n\n  self.loadPageTableTemplates = function (page) {\n    var templates = page.find(\".table-templateId\");\n    var target;\n\n    if (_h.any(templates)) {\n      for (var i = 0; i < templates.length; i++) {\n        target = $(templates[i]);\n        var id = Number(target.attr(\"data-id\"));\n        self.loadPageTableTemplate(target, page);\n      }\n    }\n\n    var charts = page.find(\".chart-image\").filter(function (i, a) {\n      if ($(a).attr(\"src\") && $(a).attr(\"src\").endsWith(\"f//Z\")) return true;\n      return false;\n    });\n\n    if (_h.any(charts)) {\n      for (var j = 0; j < charts.length; j++) {\n        target = $(charts[j]);\n        var id = target.attr(\"template-id\");\n        var value = target.attr(\"chart-id\");\n        self.getChartPicture(id, value, target);\n      }\n    }\n  };\n\n  self.loadPageTableTemplate = function (target) {\n    var id = target.attr(\"data-id\");\n\n    if (target.find(\".iframe-shadow\").length === 0) {\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_2__.ApiService.request({\n        url: \"/api/magazine/gettemplatepreview\",\n        data: {\n          magazineId: self.magazine().id(),\n          tableTemplateId: id\n        },\n        success: function success(res) {\n          if (!_h.isNullOrEmpty(res)) {\n            var p = \"<div class='iframe-shadow' contenteditable='false'></div>\";\n            p += \"<iframe id='tabletemplate-box'>\" + \"</iframe>\";\n            var zoom;\n            var div = target;\n            div.empty();\n\n            try {\n              zoom = parseFloat(div.attr(\"data-zoom\")) || 1;\n            } catch (e) {}\n\n            div.append(p);\n            div.attr(\"contenteditable\", false);\n            var iframe = $(div[0]).find(\"iframe\").contents();\n\n            if (iframe.length) {\n              iframe.find(\"head\").append(\"<link href='/App/src/styles/tabletemplate-meditor.css' rel='stylesheet'/>\");\n              var body = iframe.find(\"body\")[0];\n              setTimeout(function () {\n                $(body).append(res.data);\n                var table = iframe.find(\"body table\");\n                var newWidth, newHeight;\n                var width = table[0].scrollWidth;\n                var height = table[0].scrollHeight;\n\n                if (zoom !== 1) {\n                  newWidth = width * (zoom * 100) / 100;\n                  newHeight = height * (zoom * 100) / 100;\n                  table.css(\"zoom\", zoom);\n                } else {\n                  newWidth = width;\n                  newHeight = height;\n                }\n\n                div.css({\n                  'height': _h.pixelToMm(newHeight) + \"mm\",\n                  'width': _h.pixelToMm(newWidth) + \"mm\"\n                });\n                iframe.find(\"html\").css({\n                  'height': _h.pixelToMm(newHeight) + \"mm\",\n                  'width': _h.pixelToMm(newWidth) + \"mm\"\n                });\n                div.attr(\"title\", res.title);\n                div.find(\".iframe-shadow\").css({\n                  'height': _h.pixelToMm(newHeight) + \"mm\",\n                  'width': _h.pixelToMm(newWidth) + \"mm\"\n                });\n                div.find(\"iframe\").css({\n                  'height': _h.pixelToMm(newHeight) + \"mm\",\n                  'width': _h.pixelToMm(newWidth) + \"mm\"\n                });\n              }, 200);\n            }\n          }\n        },\n        error: function error(data) {}\n      });\n    }\n  };\n\n  self.resizeTableTemplateFrame = function (div) {\n    var iframe = div.find(\"iframe\").contents();\n\n    if (iframe) {\n      var table = iframe.find(\"body table\");\n      var zoom = parseFloat(table.css(\"zoom\")) || 1;\n\n      if (table.length) {\n        setTimeout(function () {\n          var newWidth, newHeight;\n          var width = table[0].scrollWidth;\n          var height = table[0].scrollHeight;\n\n          if (zoom !== 1) {\n            newWidth = width * (zoom * 100) / 100;\n            newHeight = height * (zoom * 100) / 100;\n          } else {\n            newWidth = width;\n            newHeight = height;\n          }\n\n          div.css({\n            'height': _h.pixelToMm(newHeight) + \"mm\",\n            'width': _h.pixelToMm(newWidth) + \"mm\"\n          });\n          iframe.find(\"html\").css({\n            'height': _h.pixelToMm(newHeight) + \"mm\",\n            'width': _h.pixelToMm(newWidth) + \"mm\"\n          });\n          div.find(\".iframe-shadow\").css({\n            'height': _h.pixelToMm(newHeight) + \"mm\",\n            'width': _h.pixelToMm(newWidth) + \"mm\"\n          });\n          div.find(\"iframe\").css({\n            'height': _h.pixelToMm(newHeight) + \"mm\",\n            'width': _h.pixelToMm(newWidth) + \"mm\"\n          });\n        }, 200);\n      }\n    }\n  };\n\n  self.getRangeHtml = function () {\n    var outArray = [];\n    var sel = rangy.getSelection();\n    var range = sel.rangeCount ? sel.getRangeAt(0) : null;\n\n    if (range) {\n      range.splitBoundaries();\n      var textNodes = range.getNodes([3]);\n\n      if (textNodes.length) {\n        var textNode;\n        var lastPTag;\n        var pTag,\n            parent,\n            addTag = false;\n\n        for (var i = 0, len = textNodes.length; i < len; ++i) {\n          textNode = textNodes[i];\n          parent = textNode.parentNode;\n          pTag = self.findUpTag(parent, \"p\");\n          if (!lastPTag) lastPTag = pTag;\n          var el;\n\n          if (pTag.outerHTML !== lastPTag.outerHTML || !outArray.length) {\n            el = document.createElement(\"p\");\n            $(el).attr(\"style\", $(pTag).attr(\"style\"));\n            addTag = true;\n          } else {\n            el = outArray[outArray.length - 1];\n            addTag = false;\n          }\n\n          var html;\n          var liTag = self.findUpTag(parent, \"li\");\n          if (liTag) parent = liTag;\n\n          switch (parent.nodeName.toLowerCase()) {\n            case \"span\":\n              html = $(parent.outerHTML);\n              $(html).text(textNode.textContent);\n              var finalSpan = html[0].outerHTML;\n              $(el).append(finalSpan);\n              break;\n\n            case \"p\":\n              el.innerHTML = parent.innerHTML;\n              break;\n\n            case \"li\":\n              var listTagName = \"ul\";\n              var listTag = self.findUpTag(parent, \"ul\");\n\n              if (listTag === null) {\n                listTag = self.findUpTag(parent, \"ol\");\n                listTagName = \"ol\";\n              }\n\n              var newListTag;\n\n              if (!$(el).find(listTagName + \":last\").length) {\n                newListTag = document.createElement(listTagName);\n              } else {\n                newListTag = $(el).find(listTagName + \":last\");\n              }\n\n              html = $(parent.outerHTML);\n              $(html).text(textNode.textContent);\n              var finalLi = html[0].outerHTML;\n              $(newListTag).append(finalLi);\n              $(el).append(newListTag);\n              break;\n          }\n\n          if (addTag) outArray.push(el);\n        }\n      }\n    }\n\n    return outArray;\n  };\n\n  self.copyData = function () {\n    var sel = rangy.getSelection();\n    var range = sel.rangeCount ? sel.getRangeAt(0) : null;\n\n    if (range) {\n      range.splitBoundaries();\n      var textNodes = range.getNodes([3]);\n\n      if (textNodes.length) {\n        var textNode;\n\n        for (var i = 0, len = textNodes.length; i < len; ++i) {\n          textNode = textNodes[i];\n          var parent = textNode.parentNode;\n          var pTag = self.findUpTag(parent, \"p\");\n          var el = document.createElement(\"p\"); //div.style.cssText = document.defaultView.getComputedStyle(p, \"\").cssText;\n        }\n      }\n    }\n  };\n\n  self.findUpTag = function (el, tag) {\n    if (el.tagName.toLowerCase() === tag) return el;\n\n    try {\n      while (el.parentNode) {\n        el = el.parentNode;\n        if (el.tagName.toLowerCase() === tag) return el;\n      }\n\n      return null;\n    } catch (e) {\n      return null;\n    }\n  };\n\n  self.getActiveEd = function () {\n    if ($(\".active-ed\").length) return $(\".active-ed\");\n  };\n\n  self.fullScreen = ko.observable(false);\n\n  self.toggleFullScreen = function () {\n    self.fullScreen(!self.fullScreen());\n\n    if (self.fullScreen()) {\n      $(\"body\").css(\"overflow\", \"hidden\");\n      $(\".footer\").css(\"display\", \"none\");\n    } else {\n      $(\"body\").css(\"overflow\", \"\");\n      $(\".footer\").css(\"display\", \"block\");\n    }\n  };\n\n  self.saveAsDefault = function () {\n    var textColor = $(\".rich-texteditor\").find(\".textcolorVal\")[0].style.backgroundColor;\n    var backColor = $(\".rich-texteditor\").find(\".backcolorVal\")[0].style.backgroundColor;\n    var alignRight = $(\".rich-texteditor\").find(\".alignrightVal.selected-tools\").length > 0;\n    var alignLeft = $(\".rich-texteditor\").find(\".alignleftVal.selected-tools\").length > 0;\n    var alignCenter = $(\".rich-texteditor\").find(\".aligncenterVal.selected-tools\").length > 0;\n    var linespace = $(\".linespaceVal\").val();\n    var align;\n\n    if (!alignRight && !alignLeft && !alignCenter) {\n      align = undefined;\n    } else {\n      if (alignRight) align = \"right\";\n      if (alignLeft) align = \"left\";\n      if (alignCenter) align = \"center\";\n    }\n\n    var fontData = $(\".rich-texteditor\").find(\".fnt-selector\").fontSelector(\"getValues\");\n    clientStorage.setSetting([{\n      key: \"DefaultMagazineStyle\",\n      value: JSON.stringify({\n        textColor: textColor,\n        backColor: backColor,\n        linespace: linespace,\n        textFontSize: fontData[1],\n        textFontFamily: fontData[0],\n        align: align\n      })\n    }]);\n  };\n\n  self.getDefault = function () {\n    var model = {};\n    var data = clientStorage.getSetting(\"DefaultMagazineStyle\");\n\n    if (!_h.isEmpty(data)) {\n      model = JSON.parse(data);\n    } else {\n      return {\n        textColor: \"\",\n        backColor: \"\",\n        linespace: \"1\",\n        textFontSize: \"12px\",\n        textFontFamily: \"Nazanin\",\n        align: undefined\n      };\n    }\n\n    return model;\n  };\n}\nvar PageSetting = /*#__PURE__*/function (_BaseSecondaryForm) {\n  _inherits(PageSetting, _BaseSecondaryForm);\n\n  var _super = _createSuper(PageSetting);\n\n  function PageSetting(parentForm) {\n    var _this;\n\n    _classCallCheck(this, PageSetting);\n\n    _this = _super.call(this, parentForm, [{\n      name: \"pageSize\",\n      type: \"ob\",\n      val: \"A4\"\n    }, {\n      name: \"pageNumber\",\n      type: \"ob\",\n      val: 0\n    }, {\n      name: \"marginLeft\",\n      type: \"ob\",\n      val: 2\n    }, {\n      name: \"marginTop\",\n      type: \"ob\",\n      val: 2\n    }, {\n      name: \"marginBottom\",\n      type: \"ob\",\n      val: 2\n    }, {\n      name: \"marginRight\",\n      type: \"ob\",\n      val: 2\n    }, {\n      name: \"defaultHeader\",\n      type: \"ob\",\n      val: \"\"\n    }, {\n      name: \"defaultFooter\",\n      type: \"ob\",\n      val: \"\"\n    }, {\n      name: \"defaultOddHeader\",\n      type: \"ob\",\n      val: \"\"\n    }, {\n      name: \"defaultOddFooter\",\n      type: \"ob\",\n      val: \"\"\n    }], \"editCaption\");\n    _this.disableUpdate = false;\n\n    _this.pageNumber.subscribe(function (newValue) {\n      if (!_h.isNullOrEmpty(newValue) && !this.disableUpdate) {\n        this.changePages(\"pageNumber\");\n      }\n    }.bind(_assertThisInitialized(_this)));\n\n    _this.marginRight.subscribe(function (newValue) {\n      if (!_h.isNullOrEmpty(newValue) && !this.disableUpdate) {\n        this.changePages(\"marginRight\");\n      }\n    }.bind(_assertThisInitialized(_this)));\n\n    _this.marginLeft.subscribe(function (newValue) {\n      if (!_h.isNullOrEmpty(newValue) && !this.disableUpdate) {\n        this.changePages(\"marginLeft\");\n      }\n    }.bind(_assertThisInitialized(_this)));\n\n    _this.marginTop.subscribe(function (newValue) {\n      if (!_h.isNullOrEmpty(newValue) && !this.disableUpdate) {\n        this.changePages(\"marginTop\");\n      }\n    }.bind(_assertThisInitialized(_this)));\n\n    _this.marginTop.subscribe(function (newValue) {\n      if (!_h.isNullOrEmpty(newValue) && !this.disableUpdate) {\n        this.changePages(\"marginTop\");\n      }\n    }.bind(_assertThisInitialized(_this)));\n\n    return _this;\n  }\n\n  _createClass(PageSetting, [{\n    key: \"fillModel\",\n    value: function fillModel(model) {\n      this.disableUpdate = true;\n\n      _autoMapper.fillModel(this, model);\n\n      this.disableUpdate = false;\n    }\n  }, {\n    key: \"removeContent\",\n    value: function removeContent(parentModel, param, value) {\n      var pages = $(\".page\");\n\n      for (var i = 0; i < pages.length; i++) {\n        var target = $(pages[i]);\n        var main = target.find(\".main\");\n        var parent = target.parent();\n        var pageId = Number(parent.attr(\"page-id\"));\n        var isEven = this.parentVM.isEvenNumber(pageId);\n        var disableHeader, disableDefaultHeader, header, disableFooter, disableDefaultFooter, footer;\n\n        switch (param) {\n          case \"defaultHeader\":\n            disableHeader = main.find(\".mheader\").length === 0;\n            disableDefaultHeader = main.attr(\"disable-defh\") || false;\n\n            if (!disableHeader && !disableDefaultHeader) {\n              header = main.find(\".mheader\");\n\n              if (isEven) {\n                header.empty();\n                header.remove(\"default-header\");\n              }\n            }\n\n            break;\n\n          case \"defaultOddHeader\":\n            disableHeader = main.find(\".mheader\").length === 0;\n            disableDefaultHeader = main.attr(\"disable-defh\") || false;\n\n            if (!disableHeader && !disableDefaultHeader) {\n              header = main.find(\".mheader\");\n\n              if (!isEven) {\n                header.empty();\n                header.remove(\"default-odd-header\");\n              }\n            }\n\n            break;\n\n          case \"defaultFooter\":\n            disableFooter = main.find(\".mfooter\").length === 0;\n            disableDefaultFooter = main.attr(\"disable-deff\") || false;\n\n            if (!disableFooter && !disableDefaultFooter) {\n              footer = main.find(\".mfooter\");\n\n              if (isEven) {\n                footer.empty();\n                footer.remove(\"default-footer\");\n              }\n            }\n\n            break;\n\n          case \"defaultOddFooter\":\n            disableFooter = main.find(\".mfooter\").length === 0;\n            disableDefaultFooter = main.attr(\"disable-deff\") || false;\n\n            if (!disableFooter && !disableDefaultFooter) {\n              footer = main.find(\".mfooter\");\n\n              if (!isEven) {\n                footer.empty();\n                footer.remove(\"default-odd-footer\");\n              }\n            }\n\n            break;\n        }\n\n        this.refreshPartsSize(target);\n      }\n\n      this[param](\"\");\n    }\n  }, {\n    key: \"changePages\",\n    value: function changePages(param) {\n      var pages = $(\".page\");\n\n      for (var i = 0; i < pages.length; i++) {\n        var target = $(pages[i]);\n        var main = target.find(\".main\");\n        var parent = target.parent();\n        var pageId = Number(parent.attr(\"page-id\"));\n        var isEven = this.parentVM.isEvenNumber(pageId);\n        var disableHeader, disableDefaultHeader, header, disableFooter, disableDefaultFooter, footer, disableMarginHeader, disableMarginFooter;\n        disableHeader = main.find(\".mheader\").length === 0;\n        disableMarginHeader = main.attr(\"disable-marginheader\") || false;\n        disableMarginFooter = main.attr(\"disable-marginfooter\") || false;\n\n        switch (param) {\n          case \"defaultHeader\":\n            disableHeader = main.find(\".mheader\").length === 0;\n            disableDefaultHeader = main.attr(\"disable-defh\") || false;\n\n            if (!disableHeader && !disableDefaultHeader) {\n              header = main.find(\".mheader\");\n              if (isEven) header.replaceWith(this.defaultHeader());\n            }\n\n            break;\n\n          case \"defaultOddHeader\":\n            disableHeader = main.find(\".mheader\").length === 0;\n            disableDefaultHeader = main.attr(\"disable-defh\") || false;\n\n            if (!disableHeader && !disableDefaultHeader) {\n              header = main.find(\".mheader\");\n              if (!isEven) header.replaceWith(this.defaultOddHeader());\n            }\n\n            break;\n\n          case \"defaultFooter\":\n            disableFooter = main.find(\".mfooter\").length === 0;\n            disableDefaultFooter = main.attr(\"disable-deff\") || false;\n\n            if (!disableFooter && !disableDefaultFooter) {\n              footer = main.find(\".mfooter\");\n              if (isEven) footer.replaceWith(this.defaultFooter());\n            }\n\n            break;\n\n          case \"defaultOddFooter\":\n            disableFooter = main.find(\".mfooter\").length === 0;\n            disableDefaultFooter = main.attr(\"disable-deff\") || false;\n\n            if (!disableFooter && !disableDefaultFooter) {\n              footer = main.find(\".mfooter\");\n              if (!isEven) footer.replaceWith(this.defaultOddFooter());\n            }\n\n            break;\n\n          case \"pageNumber\":\n            var pageNumber = main.find(\".page-number\");\n            var disableInNumeration = main.attr(\"disable-innum\");\n            if (_h.isNullOrEmpty(disableInNumeration)) pageNumber.attr(\"type\", this.pageNumber());\n            break;\n\n          case \"pageSize\":\n            break;\n\n          case \"marginRight\":\n            main.find(\".mcontent\").css('padding-right', this.marginRight() + \"mm\");\n\n            if (!disableMarginHeader) {\n              main.find(\".mheader\").css('padding-right', this.marginRight() + \"mm\");\n            } else main.find(\".mheader\").css('padding-right', \"\");\n\n            if (!disableMarginFooter) main.find(\".mfooter\").css('padding-right', this.marginRight() + \"mm\");else main.find(\".mfooter\").css('padding-right', \"\");\n            break;\n\n          case \"marginLeft\":\n            main.find(\".mcontent\").css('padding-left', this.marginLeft() + \"mm\");\n            if (!disableMarginHeader) main.find(\".mheader\").css('padding-left', this.marginLeft() + \"mm\");else main.find(\".mheader\").css('padding-left', \"\");\n            if (!disableMarginFooter) main.find(\".mfooter\").css('padding-left', this.marginLeft() + \"mm\");else main.find(\".mfooter\").css('padding-left', \"\");\n            break;\n\n          case \"marginTop\":\n            if (main.find(\".mheader\").length > 0) {\n              if (!disableMarginHeader) {\n                main.find(\".mheader\").css('padding-top', this.marginTop() + \"mm\");\n                main.find(\".mcontent\").css('padding-top', \"\");\n              } else {\n                main.find(\".mheader\").css('padding-top', \"\");\n                main.find(\".mcontent\").css('padding-top', this.marginTop() + \"mm\");\n              }\n            } else {\n              main.find(\".mcontent\").css('padding-top', this.marginTop() + \"mm\");\n            }\n\n            break;\n\n          case \"marginBottom\":\n            if (main.find(\".mfooter\").length > 0) {\n              if (!disableMarginFooter) {\n                main.find(\".mfooter\").css('padding-bottom', this.marginBottom() + \"mm\");\n                main.find(\".mcontent\").css('padding-bottom', \"\");\n              } else {\n                main.find(\".mfooter\").css('padding-bottom', \"\");\n                main.find(\".mcontent\").css('padding-bottom', this.marginBottom() + \"mm\");\n              }\n            } else {\n              main.find(\".mfooter\").css('padding-bottom', \"\");\n              main.find(\".mcontent\").css('padding-bottom', this.marginBottom() + \"mm\");\n            }\n\n            break;\n        }\n      }\n\n      if (param.startsWith(\"margin\") || param === \"pageNumber\") {\n        this.parentVM.handlePageNumbers();\n      }\n    }\n  }, {\n    key: \"refreshPartsSize\",\n    value: function refreshPartsSize(target) {\n      var main = $(target).find(\".main\");\n      main = main[0];\n      var pageheight = main.getBoundingClientRect().height;\n      var pageWidth = main.getBoundingClientRect().width;\n      var header = $(main).find(\".mheader\");\n      var footer = $(main).find(\".mfooter\");\n      var content = $(main).find(\".mcontent\");\n\n      var restheight = _h.getHeight(header[0]) + _h.getHeight(footer[0]);\n\n      var restTop = _h.getHeight(header[0]);\n\n      content.css({\n        'height': _h.pixelToMm(pageheight - restheight) + \"mm\",\n        'top': _h.pixelToMm(restTop) + \"mm\",\n        'width': _h.pixelToMm(pageWidth) + \"mm\"\n      });\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      return {\n        pageSize: this.pageSize(),\n        pageNumber: this.pageNumber(),\n        marginRight: this.marginRight(),\n        marginLeft: this.marginLeft(),\n        marginTop: this.marginTop(),\n        marginBottom: this.marginBottom(),\n        defaultHeader: this.defaultHeader() || \"\",\n        defaultFooter: this.defaultFooter() || \"\",\n        defaultOddHeader: this.defaultOddHeader() || \"\",\n        defaultOddFooter: this.defaultOddFooter() || \"\"\n      };\n    }\n  }]);\n\n  return PageSetting;\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_1__.BaseSecondaryForm);\nvar selector = \".mheader, .mfooter, .mcontent\";\n$(document).on('click', selector, function (e) {\n  if (!$(e.currentTarget).hasClass(\"active-ed\")) {\n    $(\".mpart\").removeClass(\"active-ed\");\n    $(e.currentTarget).addClass(\"active-ed\");\n  }\n\n  var parent = $(e.target).parent();\n\n  _h.kocnx().mgvm().designSelectedModel().setActivePage($(e.currentTarget));\n\n  if ($(e.target).hasClass(\"mpart\") === false && ($(e.target).has(\"img\").length > 0 || e.target.nodeName === \"IMG\") || parent.hasClass(\"table-templateId\") && !parent.hasClass(\"ui-draggable\")) {\n    var context = _h.kocnx().mgvm().designSelectedModel();\n\n    var target = $(e.target);\n    var tar, tagHeight, nextP, prevP;\n    if (target.nodeName !== \"P\") target = context.findUpTag(target.get(0), \"p\");\n    var templateTag = parent;\n    var imgTag = $(target).has(\"img\");\n    var offset = e.offsetY;\n\n    if (imgTag.length > 0) {\n      tagHeight = imgTag.height();\n\n      if (offset > tagHeight / 2) {\n        nextP = $(target).next();\n\n        if (nextP && nextP.length > 0 && nextP.get(0).nodeName === \"P\") {\n          if ((_h.isNullOrEmpty(nextP.text()) || nextP.text() === \"\") && !nextP.has(\"br\").length > 0) nextP.append(\"<br>\");\n          context.fixCursorLocation(nextP);\n        } else {\n          tar = $(\"<p><br></p>\").insertAfter($(target));\n          context.fixCursorLocation(tar);\n        }\n      } else {\n        prevP = imgTag.prev();\n\n        if (prevP && prevP.length > 0 && prevP.get(0).nodeName === \"P\") {\n          context.fixCursorLocation(prevP);\n        } else {\n          tar = $(\"<p><br></p>\").insertBefore($(target));\n          context.fixCursorLocation(tar);\n        }\n      }\n    } else if (templateTag.length > 0) {\n      tagHeight = templateTag.height();\n\n      if (offset > tagHeight / 2) {\n        nextP = templateTag.next();\n\n        if (nextP && nextP.length > 0 && nextP.get(0).nodeName === \"P\") {\n          if ((_h.isNullOrEmpty(nextP.text()) || nextP.text() === \"\") && !nextP.has(\"br\").length > 0) nextP.append(\"<br>\");\n          context.fixCursorLocation(nextP);\n        } else {\n          tar = $(\"<p><br></p>\").insertAfter(parent);\n          context.fixCursorLocation(tar);\n        }\n      } else {\n        prevP = templateTag.prev();\n\n        if (prevP && prevP.length > 0 && prevP.get(0).nodeName === \"P\") {\n          context.fixCursorLocation(prevP);\n        } else {\n          tar = $(\"<p><br></p>\").insertBefore(parent);\n          context.fixCursorLocation(tar);\n        }\n      }\n    }\n  }\n});\n$(document).on('cut', selector, function (e) {\n  e.preventDefault();\n\n  var array = _h.kocnx().mgvm().designSelectedModel().getRangeHtml();\n\n  var html = \"\";\n  if (array.length) for (var i = 0; i < array.length; i++) {\n    var target = $(array[i]);\n    html += target[0].outerHTML;\n  }\n\n  if (html) {\n    e.originalEvent.clipboardData.clearData('application/json');\n    e.originalEvent.clipboardData.setData('application/json', JSON.stringify({\n      content: html\n    }));\n    var sel = rangy.getSelection();\n    var range = sel.rangeCount ? sel.getRangeAt(0) : null;\n    range.deleteContents();\n    setTimeout(function () {\n      _h.kocnx().mgvm().designSelectedModel().htmlContentCleaner();\n    }, 0);\n  }\n});\n$(document).on('copy', selector, function (e) {\n  e.preventDefault();\n\n  var array = _h.kocnx().mgvm().designSelectedModel().getRangeHtml();\n\n  var html = \"\";\n  if (array.length) for (var i = 0; i < array.length; i++) {\n    var target = $(array[i]);\n    html += target[0].outerHTML;\n  }\n\n  if (html) {\n    e.originalEvent.clipboardData.clearData('application/json');\n    e.originalEvent.clipboardData.setData('text/html', html);\n    e.originalEvent.clipboardData.setData('text/plain', html);\n    e.originalEvent.clipboardData.setData('application/json', JSON.stringify({\n      content: html\n    }));\n  }\n});\n$(document).on('paste', selector, function (e) {\n  e.preventDefault();\n\n  if (window.getSelection && window.getSelection().deleteFromDocument) {\n    window.getSelection().deleteFromDocument();\n  }\n\n  var data;\n  var types = (e.originalEvent || e).clipboardData.types;\n\n  if (types.indexOf(\"text/rtf\") !== -1) {\n    data = (e.originalEvent || e).clipboardData.getData('text/html');\n    data = pasteDataFormater.getMicrosoftWordData(data);\n    if (data) document.execCommand(\"insertHTML\", false, data);\n  } else if (types.indexOf(\"application/json\") !== -1) {\n    try {\n      data = (e.originalEvent || e).clipboardData.getData('application/json');\n      data = JSON.parse(data);\n    } catch (e) {\n      data = \"\";\n    }\n\n    if (!_h.isNullOrEmpty(data) && data !== \"\") document.execCommand(\"insertHTML\", false, data.content);\n  } else if (types.indexOf(\"text/html\") !== -1) {\n    data = (e.originalEvent || e).clipboardData.getData('text/html');\n    data = pasteDataFormater.getHtmlData(data);\n    if (data) document.execCommand(\"insertHTML\", false, data);\n  } else if (types.indexOf(\"image/png\") !== -1 || types.indexOf(\"image/jpeg\") !== -1 || types.indexOf(\"image/jpg\") !== -1) {\n    var items = (e.originalEvent || e).clipboardData.items,\n        reader;\n    if (items && items.length) for (var i = items.length - 1; i >= 0; i -= 1) {\n      if (items[i].type.match(/^image\\//)) {\n        reader = new FileReader();\n\n        reader.onloadend = function (event) {\n          var imgString = $('<img/>').attr(\"src\", event.target.result).css({\n            \"max-width\": \"100%\",\n            \"max-height\": \"100%\"\n          }).addClass('mimage').prop('outerHTML');\n          var p = \"<p style='text-align: center;'>\" + imgString + \"<p/>\";\n          document.execCommand('insertHTML', false, p);\n        };\n\n        reader.readAsDataURL(items[i].getAsFile());\n      }\n    }\n  } else {\n    data = (e.originalEvent || e).clipboardData.getData('text/plain');\n    if (data) document.execCommand(\"insertText\", false, data);\n  }\n\n  setTimeout(function () {\n    _h.kocnx().mgvm().designSelectedModel().htmlContentCleaner();\n  }, 0);\n  return false;\n});\n$(document).on('dblclick', \".tx-page-frame\", function (e) {\n  var currentTarget = $(this).find(\".page\");\n  var header = currentTarget.find(\".mheader\");\n  var footer = currentTarget.find(\".mfooter\");\n  var headerArea = currentTarget.find(\".header-area\");\n  var footerArea = currentTarget.find(\".footer-area\");\n  var hasRuller = $(this).find(\".rul_wrapper\").length > 0;\n\n  if ($(e.target).hasClass(\"tx-page-frame\") && !hasRuller || hasRuller) {\n    if (headerArea.hasClass(\"hide\")) {\n      if (_h.isNullOrEmpty(header[0])) {\n        $(headerArea[0]).addClass(\"hide\");\n        return;\n      }\n\n      $(headerArea[0]).css('top', _h.pixelToMm(header[0].getBoundingClientRect().height) + \"mm\");\n      $(headerArea[0]).removeClass(\"hide\");\n      $(headerArea[0]).draggable({\n        axis: \"y\",\n        stop: function stop(event, ui) {\n          $(event.target).css(\"left\", 0);\n          var newHeight = $(headerArea[0]).css(\"top\").replace(\"px\", \"\");\n          $(header[0]).css(\"height\", _h.pixelToMm(Number(newHeight)) + \"mm\");\n\n          _h.kocnx().mgvm().designSelectedModel().refreshPartsSize();\n        }\n      });\n    } else {\n      $(headerArea[0]).addClass(\"hide\");\n    }\n\n    if (footerArea.hasClass(\"hide\")) {\n      if (_h.isNullOrEmpty(footer[0])) {\n        $(footerArea[0]).addClass(\"hide\");\n        return;\n      }\n\n      var main = $(\".active-page .main\");\n      main = main[0];\n      var pageheight = main.getBoundingClientRect().height;\n      $(footerArea[0]).removeClass(\"hide\");\n      var footerHeight = footer[0].getBoundingClientRect().height;\n      $(footerArea[0]).css('top', _h.pixelToMm(pageheight - footerHeight) + \"mm\");\n      $(footerArea[0]).draggable({\n        axis: \"y\",\n        stop: function stop(event, ui) {\n          var main = $(\".active-page .main\");\n          main = main[0];\n          var pageheight = main.getBoundingClientRect().height;\n          $(event.target).css(\"left\", 0);\n          var newHeight = $(footerArea[0]).css(\"top\").replace(\"px\", \"\");\n          $(footer[0]).css(\"height\", _h.pixelToMm(Number(pageheight - newHeight)) + \"mm\");\n\n          _h.kocnx().mgvm().designSelectedModel().refreshPartsSize();\n        }\n      });\n    } else {\n      $(footerArea[0]).addClass(\"hide\");\n    }\n  }\n});\nvar TextTemplate = /*#__PURE__*/function (_BaseInnerModel) {\n  _inherits(TextTemplate, _BaseInnerModel);\n\n  var _super2 = _createSuper(TextTemplate);\n\n  function TextTemplate(model) {\n    _classCallCheck(this, TextTemplate);\n\n    return _super2.call(this, model);\n  }\n\n  return _createClass(TextTemplate);\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_1__.BaseInnerModel);\nvar TextTemplateForm = /*#__PURE__*/function (_BaseSecondaryForm2) {\n  _inherits(TextTemplateForm, _BaseSecondaryForm2);\n\n  var _super3 = _createSuper(TextTemplateForm);\n\n  function TextTemplateForm(viewModel, model) {\n    var _this2;\n\n    _classCallCheck(this, TextTemplateForm);\n\n    _this2 = _super3.call(this, viewModel, [{\n      name: \"id\",\n      type: \"ob\",\n      val: model.id\n    }, {\n      name: \"title\",\n      type: \"ob\"\n    }, {\n      name: \"content\",\n      type: \"ob\",\n      val: model.content\n    }], \"textTemplateFormCation\");\n\n    _this2.setValidationObject();\n\n    _this2.createForm();\n\n    return _this2;\n  }\n\n  _createClass(TextTemplateForm, [{\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      self.validationObject = ko.validatedObservable({\n        title: self.title.extend({\n          required: true,\n          minLength: 3,\n          maxLength: 32\n        })\n      });\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'txb',\n        val: this.title\n      }, null, true), this.createLine({\n        t: 'tm',\n        templateName: 'texttemplate-form-t'\n      }, undefined, true, 30, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'editFormBtn',\n            vis: true,\n            click: this.parentVM.saveTextTemplate\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return TextTemplateForm;\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_1__.BaseSecondaryForm);\nvar TableTemplateSelect = /*#__PURE__*/function (_BaseInnerModel2) {\n  _inherits(TableTemplateSelect, _BaseInnerModel2);\n\n  var _super4 = _createSuper(TableTemplateSelect);\n\n  function TableTemplateSelect(model) {\n    _classCallCheck(this, TableTemplateSelect);\n\n    return _super4.call(this, model);\n  }\n\n  return _createClass(TableTemplateSelect);\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_1__.BaseInnerModel);\nfunction TableTemplateSelectViewModel(parentForm) {\n  var self = this;\n  self.parentForm = ko.observable(parentForm);\n  self.magazineId = ko.observable();\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.iconSize(\"icon-image-small\");\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"TableTemplateSelect\",\n    apiService: {\n      actionList: [\"filterby\"]\n    },\n    buttons: [{\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }],\n    sortDirection: \"Ascending\",\n    sortProperty: \"priority\",\n    context: self,\n    cols: tabletemplateselectModelRes,\n    getList: false,\n    selectRow: false,\n    saveState: false,\n    tableStyle: \"table-layout: fixed;font-size:11px;\",\n    isMultiSelectRows: false,\n    contextMenu: false\n  }));\n\n  self.getRecords = function () {\n    var filterModel = {\n      pageNumber: self.pageNumber(),\n      pageSize: self.pageSize(),\n      searchKey: self.searchKey(),\n      sortProperty: \"priority\",\n      sortDirection: self.sortDirection(),\n      magazineId: self.magazineId()\n    };\n    self.apiService.request({\n      name: \"/api/tabletemplate/gettemplatesformagazine\",\n      data: filterModel,\n      success: function success(data) {\n        self.records.removeAll();\n\n        if (!_h.isNullOrEmpty(data)) {\n          if (_h.any(data.list)) for (var j = 0; j < data.list.length; j++) {\n            var target = data.list[j];\n            var record = new TableTemplateSelect(target);\n            self.records.push(record);\n          }\n          self.total(data.total);\n          self.parentForm().configDragFunctionality();\n          self.parentForm().configDropFunctionality();\n          self.refreshTemplateTitle();\n        }\n      },\n      error: function error(data) {\n        toast.error(self.entityName, 'getList');\n      }\n    });\n  };\n\n  self.refreshTemplateTitle = function () {\n    var templates = $(\".table-templateId\");\n    var target;\n\n    if (_h.any(templates)) {\n      for (var i = 0; i < templates.length; i++) {\n        target = $(templates[i]);\n        var id = Number(target.attr(\"data-id\"));\n\n        if (_h.any(self.records())) {\n          for (var j = 0; j < self.records().length; j++) {\n            if (id === self.records()[j].id()) {\n              $(templates[i]).attr(\"title\", self.records()[j].title());\n            }\n          }\n        }\n      }\n    }\n  };\n}\nvar HtmlTemplateCategory = /*#__PURE__*/function (_BaseInnerModel3) {\n  _inherits(HtmlTemplateCategory, _BaseInnerModel3);\n\n  var _super5 = _createSuper(HtmlTemplateCategory);\n\n  function HtmlTemplateCategory(model) {\n    var _this3;\n\n    _classCallCheck(this, HtmlTemplateCategory);\n\n    _this3 = _super5.call(this, model);\n    _this3.templates = ko.observableArray(model.templates);\n    return _this3;\n  }\n\n  return _createClass(HtmlTemplateCategory);\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_1__.BaseInnerModel);\n\n//# sourceURL=webpack://domino/./src/scripts/pages/magazine/richtextEditor.js?");

/***/ }),

/***/ "./src/scripts/pages/magazine/viewModel.js":
/*!*************************************************!*\
  !*** ./src/scripts/pages/magazine/viewModel.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"MagazineViewModel\": () => (/* binding */ MagazineViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _master_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/model */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model */ \"./src/scripts/pages/magazine/model.js\");\n/* harmony import */ var _richtextEditor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./richtextEditor.js */ \"./src/scripts/pages/magazine/richtextEditor.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n__webpack_require__(/*! ./model */ \"./src/scripts/pages/magazine/model.js\");\n\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/magazine/resource.js\");\n\n\n\n\n\nfunction MagazineViewModel() {\n  var self = this;\n  self.designMode = ko.observable(false);\n  self.designSelectedModel = ko.observable();\n  self.showDesignForm = ko.observable(false);\n  self.designFormMagazineModel = ko.observable();\n  self.currentPeriodId = ko.observable();\n  self.currentPeriodTitle = ko.observable();\n  self.firstComparativePeriod = ko.observable();\n  self.secondComparativePeriod = ko.observable();\n  self.thirdComparativePeriod = ko.observable();\n  self.periodSelectedList = ko.observableArray();\n  self.treeSelectList = ko.observableArray();\n\n  self.getPeriodInfo = function (callback) {\n    self.apiService.request({\n      name: \"getPeriodsInfo\",\n      data: model,\n      success: function success(data) {\n        self.periodSelectedList.removeAll();\n        if (_h.any(data.selectivePeriods)) for (var j = 0; j < data.selectivePeriods.length; j++) {\n          self.periodSelectedList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.PeriodSelectItem(data.selectivePeriods[j]));\n        }\n        if (!_h.isNullOrEmpty(data.currentPeriodId)) self.currentPeriodId(data.currentPeriodId);\n        if (!_h.isNullOrEmpty(data.currentPeriodTitle)) self.currentPeriodTitle(data.currentPeriodTitle);\n        callback(data);\n      },\n      error: function error(message, status, xhr) {\n        var text = _h.getApiMessage(\"ErrorLoadPeriod\");\n\n        _h.failToast(text);\n      }\n    });\n  };\n\n  self.getTreeSelectList = function () {\n    var model = {\n      controllerName: 7,\n      mappingType: 0\n    };\n    self.apiService.request({\n      name: \"getMappingTreeList\",\n      data: model,\n      success: function success(data) {\n        self.treeSelectList.removeAll();\n        if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n          var target = data[j];\n          self.treeSelectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.SelectItem(target));\n        }\n      },\n      error: function error() {\n        toast.error(\"Tree\", 'getSelectList');\n      }\n    });\n  };\n\n  self.createBtn = function () {\n    self.getPeriodInfo(function (data) {\n      _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.MagazineForm(self, false, data));\n    });\n  };\n\n  self.editBtn = function () {\n    self.getPeriodInfo(function (data) {\n      _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.MagazineForm(self, true, data));\n    });\n  };\n\n  self.createPdfBtn = function () {\n    var model = {};\n    var data = clientStorage.getSetting(\"MagazinePdf\");\n\n    if (!_h.isEmpty(data)) {\n      model = JSON.parse(data);\n    }\n\n    _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.MagazinePreview(self, model));\n  };\n\n  self.createPdf = function (parents, btnModel, e) {\n    var item = parents[1];\n    var model = item.toServer();\n    self.apiService.request({\n      name: \"/api/filegenerator/postmagazinepdf\",\n      data: model,\n      success: function success(data) {\n        _h.kocnx().checkProcessQueue();\n\n        localStorage.setItem(\"ProcessToken\", \"\");\n\n        _h.kocnx().closeForm();\n      },\n      error: function error(message, status, xhr) {}\n    });\n  };\n\n  self.createPdfSaveSetting = function (parents, btnModel, e) {\n    var item = parents[1];\n    var model = item.toServer();\n    clientStorage.setSetting([{\n      key: \"MagazinePdf\",\n      value: JSON.stringify({\n        displayType: model.displayType,\n        amountType: model.amountType,\n        pdfSaveState: model.pdfSaveState,\n        magazinePageSelectionType: model.magazinePageSelectionType\n      })\n    }]);\n\n    var text = _h.getApiMessage(\"MagazinePdfPageSaveMessage\");\n\n    _h.successToast(text);\n  };\n\n  self.designBtn = function () {\n    self.getPagesMagazine(function (res) {\n      if (res) {\n        self.designSelectedModel(new _richtextEditor_js__WEBPACK_IMPORTED_MODULE_3__.RichTextEditor());\n        self.designSelectedModel().magazine(self.selectedRowRecord());\n        self.designSelectedModel().fillModel(res);\n        self.designSelectedModel().init();\n        self.designMode(true);\n        window.resSecondDomain = 'pageeditor';\n      }\n    });\n  };\n\n  self.getPagesMagazine = function (callback) {\n    var model = {\n      id: self.selectedRowRecord().id()\n    };\n    self.apiService.request({\n      name: \"getPages\",\n      data: model,\n      success: function success(data) {\n        callback(data);\n      },\n      error: function error(message, status, xhr) {\n        callback(null);\n      }\n    });\n  };\n\n  self.getSavedMagazinesBtn = function () {\n    _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.MagazineFileViewModel(self));\n  };\n\n  self.createHtmlBtn = function () {\n    _h.kocnx().createHtml(7, self.selectedRowRecord().id());\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"Magazine\",\n    getList: true,\n    apiService: {\n      actionList: [\"filterby\", \"post\", \"put\", \"delete\", \"getpages\", \"getperiodsinfo\"]\n    },\n    buttons: [{\n      name: 'edit',\n      access: true,\n      icon: 'Edit',\n      cMenu: true\n    }, {\n      name: 'delete',\n      access: true,\n      icon: 'Delete',\n      cMenu: true\n    }, {\n      name: 'createPdf',\n      access: true,\n      icon: 'ExportPdf',\n      cMenu: true\n    }, {\n      name: 'createHtml',\n      access: true,\n      cMenu: true,\n      icon: 'ExportHtml'\n    }, {\n      name: 'design',\n      access: true,\n      icon: 'ReportDesign',\n      cMenu: true\n    }, {\n      name: 'getSavedMagazines',\n      access: true,\n      icon: 'FileList',\n      cMenu: true\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'create',\n      access: true,\n      cMenu: false\n    }],\n    filters: [{\n      name: 'companyType'\n    }, {\n      name: 'state'\n    }, {\n      name: 'currencyType'\n    }],\n    sortDirection: \"Ascending\",\n    sortProperty: \"id\",\n    context: self,\n    saveState: true,\n    searchKeyType: \"enter\",\n    cols: magazineModelRes,\n    selectRow: true,\n    folderManagement: true,\n    contextMenu: true,\n    resizable: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    var isSelected = self.isSelectedRecord();\n\n    var permit = _h.kocnx().permitPeriodEdit();\n\n    var isPeriodActive = _h.kocnx().periodItem().st === 1;\n\n    if (isSelected) {\n      self.visedit(permit);\n      self.visdelete(permit);\n      self.viscreatePdf(isPeriodActive);\n      self.viscreateHtml(isPeriodActive);\n      self.visdesign(isPeriodActive);\n      self.visgetSavedMagazines(true);\n    } else {\n      self.visedit(false);\n      self.visdelete(false);\n      self.viscreatePdf(false);\n      self.viscreateHtml(false);\n      self.visdesign(false);\n      self.visgetSavedMagazines(false);\n    }\n\n    self.viscreate(permit);\n    self.vishelp(true);\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n\n  self.backToTable = function () {\n    self.designMode(false);\n    window.resSecondDomain = '';\n    self.designSelectedModel(null);\n    $(\"body\").css(\"overflow\", \"\");\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.getTreeSelectList();\n    self.getFolderList();\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/magazine/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/mapping/model.js":
/*!********************************************!*\
  !*** ./src/scripts/pages/mapping/model.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"EffectedMappingForm\": () => (/* binding */ EffectedMappingForm),\n/* harmony export */   \"FileItem\": () => (/* binding */ FileItem),\n/* harmony export */   \"MappingData\": () => (/* binding */ MappingData),\n/* harmony export */   \"MappingDataViewModel\": () => (/* binding */ MappingDataViewModel),\n/* harmony export */   \"MappingResultError\": () => (/* binding */ MappingResultError),\n/* harmony export */   \"MappingRule\": () => (/* binding */ MappingRule),\n/* harmony export */   \"MappingRuleData\": () => (/* binding */ MappingRuleData),\n/* harmony export */   \"MappingRuleDataViewModel\": () => (/* binding */ MappingRuleDataViewModel),\n/* harmony export */   \"MappingRuleForm\": () => (/* binding */ MappingRuleForm),\n/* harmony export */   \"MappingRuleViewModel\": () => (/* binding */ MappingRuleViewModel),\n/* harmony export */   \"MappingSrcViewModel\": () => (/* binding */ MappingSrcViewModel),\n/* harmony export */   \"SubstituteNode\": () => (/* binding */ SubstituteNode),\n/* harmony export */   \"SubstituteNodeForm\": () => (/* binding */ SubstituteNodeForm),\n/* harmony export */   \"SubstituteNodeViewModel\": () => (/* binding */ SubstituteNodeViewModel),\n/* harmony export */   \"TableCondition\": () => (/* binding */ TableCondition),\n/* harmony export */   \"TableConditionSet\": () => (/* binding */ TableConditionSet),\n/* harmony export */   \"TreeEffectedMappingItem\": () => (/* binding */ TreeEffectedMappingItem)\n/* harmony export */ });\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _master_phraseTranslator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../master/phraseTranslator.js */ \"./src/scripts/pages/master/phraseTranslator.js\");\n/* harmony import */ var _vendors_big_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../vendors/big.js */ \"./src/scripts/vendors/big.js\");\n/* harmony import */ var _vendors_big_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_vendors_big_js__WEBPACK_IMPORTED_MODULE_3__);\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar _require = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\"),\n    BaseModel = _require.BaseModel,\n    BaseFormModel = _require.BaseFormModel,\n    BaseInfoModel = _require.BaseInfoModel,\n    BaseSecondaryForm = _require.BaseSecondaryForm;\n\n\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\n\n\n\nvar MappingData = /*#__PURE__*/function (_BaseModel) {\n  _inherits(MappingData, _BaseModel);\n\n  var _super = _createSuper(MappingData);\n\n  function MappingData(model) {\n    var _this;\n\n    _classCallCheck(this, MappingData);\n\n    _this = _super.call(this, model);\n\n    _defineProperty(_assertThisInitialized(_this), \"notShow\", ko.observable(false));\n\n    _this.isDeleted = ko.observable();\n    _this.dragMode = ko.observable(false);\n    _this.selected = ko.observable(false);\n    _this.shiftSelected = ko.observable(false);\n    _this.pageSelect = ko.observable();\n    _this.order = ko.observable();\n\n    _this.selected.subscribe(function (newValue) {\n      var _this2 = this;\n\n      if (newValue !== undefined && newValue !== null) {\n        var context = _h.kocnx();\n\n        var isExistInList = context.mvm().childModel().hasExistRecordInSelectItem(this.id());\n\n        if (newValue) {\n          if (!this.isMapped()) {\n            if (!isExistInList) {\n              context.mvm().childModel().allSelectedRecords.push({\n                id: this.id(),\n                debtor: this.debtor(),\n                creditor: this.creditor()\n              });\n              context.mvm().childModel().calculateTotalPrice();\n            }\n          }\n        } else {\n          if (!this.isMapped()) {\n            if (isExistInList) {\n              var rest = context.mvm().childModel().allSelectedRecords().filter(function (a) {\n                return a.id !== _this2.id();\n              });\n              context.mvm().childModel().allSelectedRecords(rest);\n              context.mvm().childModel().calculateTotalPrice();\n            }\n          }\n        }\n\n        setTimeout(function () {\n          this.configDragFunctionality(context.mvm().childModel().allSelectedRecords().length);\n        }.bind(this), 100);\n      }\n    }, _assertThisInitialized(_this));\n\n    _this.styleRowValue = ko.pureComputed(function () {\n      if (this.isMapped() === true && this.notShow() === false) return 'color:  #62cb31;-webkit-user-select: none;user-select: none;';\n      return \"-webkit-user-select: none;user-select: none;\";\n    }, _assertThisInitialized(_this));\n    return _this;\n  }\n\n  _createClass(MappingData, [{\n    key: \"configDragFunctionality\",\n    value: function configDragFunctionality() {\n      var list = $(\".table-row-selected\");\n      var dlist = $(\"tr:not(.table-row-selected)\");\n      var el;\n      if (_h.any(list)) for (var i = 0; i < list.length; i++) {\n        el = list[i];\n        el.setAttribute(\"draggable\", true);\n        el.addEventListener('dragstart', function (event) {\n          var length = _h.kocnx().mvm().childModel().allSelectedRecords().length;\n\n          var div = document.getElementById('drag-label');\n          div.style.display = \"block\";\n          var span = div.getElementsByTagName(\"span\")[0];\n          span.innerText = length;\n          event.dataTransfer.setDragImage(div, 60, 0);\n        });\n      }\n      if (_h.any(dlist)) for (var j = 0; j < dlist.length; j++) {\n        var elem = dlist[j];\n        elem.setAttribute(\"draggable\", false);\n      }\n    }\n  }]);\n\n  return MappingData;\n}(BaseModel);\nfunction MappingDataViewModel() {\n  var self = this;\n  self.allSelectedRecords = ko.observableArray();\n  self.totalPrice = ko.observable(0);\n  self.totalPriceSign = ko.observable(\"\");\n  self.caption = ko.observable();\n  self.refreshSign = ko.observable(false);\n\n  self.toggleShowMapped = function () {\n    self.showMapped(!self.showMapped());\n    self.getRecords();\n  };\n\n  self.hasExistRecordInSelectItem = function (id) {\n    return self.allSelectedRecords().filter(function (a) {\n      return a.id === id;\n    }).length > 0;\n  };\n\n  self.clearAllSelectedRecords = function () {\n    if (self.selectedRowRecord() !== null && self.selectedRowRecord() !== undefined) self.selectedRowRecord(null);\n    self.selectedRowRecords.removeAll();\n\n    for (var i = 0; i < self.records().length; i++) {\n      self.records()[i].selected(false);\n    }\n\n    self.allSelectedRecords.removeAll();\n    self.totalPrice(0);\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.iconSize(\"icon-image-small\");\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__.BaseViewModel({\n    entityName: \"MappingData\",\n    getList: false,\n    apiService: {\n      actionList: [\"filterby\", \"getdatacollection\"]\n    },\n    buttons: [{\n      name: 'showMappedSw',\n      access: false,\n      cMenu: false,\n      templateName: \"showMapped-button-template\"\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }],\n    filters: [{\n      name: 'showMapped',\n      def: false\n    }, {\n      name: 'treeId'\n    }, {\n      name: 'sheetId'\n    }],\n    tableStyle: \"font-size: 11px;table-layout: fixed;\",\n    styleRow: \"styleRowValue\",\n    sortDirection: \"Ascending\",\n    sortProperty: \"code\",\n    context: self,\n    searchKeyType: \"enter\",\n    cols: mappingDataModelRes,\n    selectRow: true,\n    saveState: true,\n    contextMenu: false,\n    isMultiSelectRows: true,\n    resizable: true,\n    filterbyColumn: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    self.vishelp(true);\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n\n  self.getRecords = function () {\n    if (!self.validationObject.isValid()) {\n      self.validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    var model = self.createFilterByModel();\n    self.apiService.request({\n      name: \"filterby\",\n      data: model,\n      success: function success(data) {\n        self.records.removeAll();\n        if (!_h.isNullOrEmpty(self.selectedRowRecord())) self.selectedRowRecord(null);\n        self.selectedRowRecords.removeAll();\n        self.extraBufferKey(null);\n\n        if (!_h.isNullOrEmpty(data)) {\n          self.total(data.total);\n\n          if (_h.any(data.list)) {\n            var _loop = function _loop(j) {\n              var target = data.list[j];\n              var record = new MappingData(target);\n              isSelected = self.allSelectedRecords().filter(function (a) {\n                return a.id.indexOf(target.id) !== -1;\n              }).length > 0;\n              record.selected(isSelected);\n              self.records.push(record);\n            };\n\n            for (var j = 0; j < data.list.length; j++) {\n              var isSelected;\n\n              _loop(j);\n            }\n          }\n        }\n\n        if (self.configTable.resizable) _h.initResizeTable();\n      },\n      error: function error() {\n        toast.error(self.entityName, 'getList');\n      }\n    });\n  };\n\n  self.selectAll = ko.observable(false);\n  self.debtorOnly = ko.observable(false);\n  self.creditorOnly = ko.observable(false);\n  self.pageFrom = ko.observable();\n  self.pageTo = ko.observable();\n  self.pageNumberList = ko.observableArray();\n  self.pageList = ko.observableArray();\n  self.refreshPageList = ko.computed(function () {\n    self.pageNumberList.removeAll();\n\n    if (self.total() / self.pageSize() < 1) {\n      self.pageNumberList.push({\n        text: \"1\",\n        value: 1\n      });\n    } else {\n      var count = self.total() / self.pageSize();\n\n      for (var i = 0; i < count; i++) {\n        self.pageNumberList.push({\n          text: \"\" + (i + 1),\n          value: i + 1\n        });\n      }\n    }\n\n    self.pageList.removeAll();\n  });\n\n  self.selectBy = function () {\n    var model = self.createFilterByModel();\n    model.selectAll = self.selectAll();\n    model.debtorOnly = self.debtorOnly();\n    model.creditorOnly = self.creditorOnly();\n    model.pageFrom = self.pageFrom();\n    model.pageTo = self.pageTo();\n    if (_h.any(self.pageList())) model.pageList = self.pageList();\n    self.apiService.request({\n      name: \"getDataCollection\",\n      data: model,\n      success: function success(data) {\n        self.clearAllSelectedRecords();\n\n        if (!_h.isNullOrEmpty(data) && _h.any(data)) {\n          var _loop2 = function _loop2(j) {\n            var item = data[j];\n            isExist = self.allSelectedRecords().filter(function (a) {\n              return a.id === item.id;\n            }).length > 0;\n\n            if (!isExist) {\n              self.allSelectedRecords.push({\n                id: item.id,\n                debtor: item.debtor,\n                creditor: item.creditor\n              });\n            }\n          };\n\n          for (var j = 0; j < data.length; j++) {\n            var isExist;\n\n            _loop2(j);\n          }\n\n          var _loop3 = function _loop3(k) {\n            var target = self.records()[k];\n            isExist = self.allSelectedRecords().filter(function (a) {\n              return a.id === target.id();\n            }).length > 0;\n\n            if (isExist) {\n              target.selected(true);\n            }\n          };\n\n          for (var k = 0; k < self.records().length; k++) {\n            var isExist;\n\n            _loop3(k);\n          }\n\n          setTimeout(function () {\n            self.calculateTotalPrice();\n          }, 50);\n        }\n      },\n      error: function error() {\n        toast.error(self.entityName, 'getList', \"SelectCollection\");\n      }\n    });\n  };\n\n  self.clearSelectBoxes = function () {\n    self.selectAll(false);\n    self.debtorOnly(false);\n    self.creditorOnly(false);\n    self.pageFrom(\"\");\n    self.pageTo(\"\");\n    if (!_h.isNullOrEmpty(self.pageList()) && self.pageList().length > 0) self.pageList.removeAll();\n    self.clearAllSelectedRecords();\n  };\n\n  self.validationObject = ko.validatedObservable({\n    pageFrom: self.pageFrom.extend({\n      pageRangeValidate: [self.pageFrom, self.pageTo, self.pageNumberList]\n    }),\n    pageTo: self.pageTo.extend({\n      pageRangeValidate: [self.pageFrom, self.pageTo, self.pageNumberList]\n    })\n  });\n\n  self.afterDeleteMappingNodes = function (list) {\n    for (var i = 0; i < list.length; i++) {\n      var item = new MappingData(list[i]);\n      self.records.push(item);\n    }\n  };\n\n  self.calculateTotalPrice = function () {\n    self.totalPrice(0);\n    var positive = 0;\n    var negative = 0;\n\n    for (var i = 0; i < self.allSelectedRecords().length; i++) {\n      var target = self.allSelectedRecords()[i];\n      var isNegative = _vendors_big_js__WEBPACK_IMPORTED_MODULE_3___default()(_h.clearNumber(target.creditor)).gt(0);\n      var dblVal = _vendors_big_js__WEBPACK_IMPORTED_MODULE_3___default()(_h.clearNumber(target.creditor)).gt(0) && _vendors_big_js__WEBPACK_IMPORTED_MODULE_3___default()(_h.clearNumber(target.debtor)).gt(0);\n\n      if (!dblVal) {\n        if (isNegative) {\n          negative = negative + parseFloat(_h.clearNumber(target.creditor));\n        } else {\n          positive = positive + parseFloat(_h.clearNumber(target.debtor));\n        }\n      } else {\n        negative = negative + parseFloat(_h.clearNumber(target.creditor));\n        positive = positive + parseFloat(_h.clearNumber(target.debtor));\n      }\n    }\n\n    var res = positive - negative;\n    self.totalPrice(_h.formatNumber(res, true));\n    self.totalPriceSign(res > 0 ? 'بد' : 'بس');\n  };\n}\nvar EffectedMappingForm = /*#__PURE__*/function (_BaseSecondaryForm) {\n  _inherits(EffectedMappingForm, _BaseSecondaryForm);\n\n  var _super2 = _createSuper(EffectedMappingForm);\n\n  function EffectedMappingForm(viewModel, files, list) {\n    var _this3;\n\n    _classCallCheck(this, EffectedMappingForm);\n\n    _this3 = _super2.call(this, viewModel, [{\n      name: \"treeList\",\n      type: \"obar\"\n    }, {\n      name: \"mappingResultErrorList\",\n      type: \"obar\"\n    }, {\n      name: \"showprogressBar\",\n      type: \"ob\",\n      val: false\n    }, {\n      name: \"progressBar\",\n      type: \"ob\",\n      val: 0\n    }, {\n      name: \"selectTree\",\n      type: \"ob\"\n    }, {\n      name: \"showSaveBtn\",\n      type: \"ob\",\n      val: true\n    }, {\n      name: \"checkAllFiles\",\n      type: \"ob\",\n      val: false\n    }, {\n      name: \"notUnEffectedSelected\",\n      type: \"ob\",\n      val: false\n    }], {\n      text: \"اعمال/لغو اثر فایل تراز\"\n    });\n    _this3.width = \"50%\";\n\n    for (var i = 0; i < list.length; i++) {\n      var record = new TreeEffectedMappingItem(list[i], files);\n\n      if (i === 0) {\n        record.selected(true);\n\n        _this3.selectTree(record);\n      }\n\n      _this3.treeList.push(record);\n    }\n\n    _this3.visShowSaveBtn = ko.pureComputed(function () {\n      return !this.showSaveBtn();\n    }.bind(_assertThisInitialized(_this3)));\n\n    _this3.checkAllFiles.subscribe(function (newValue) {\n      if (!_h.isNullOrEmpty(newValue)) {\n        for (var _i = 0; _i < this.selectTree().files().length; _i++) {\n          var file = this.selectTree().files()[_i];\n\n          file.selected(newValue);\n        }\n      }\n    }.bind(_assertThisInitialized(_this3)));\n\n    _this3.createForm();\n\n    return _this3;\n  }\n\n  _createClass(EffectedMappingForm, [{\n    key: \"changeTreeTarget\",\n    value: function changeTreeTarget(item) {\n      this.selectTree(item);\n      this.clearSelectedItem();\n      item.selected(true);\n    }\n  }, {\n    key: \"clearSelectedItem\",\n    value: function clearSelectedItem() {\n      for (var i = 0; i < this.treeList().length; i++) {\n        var tree = this.treeList()[i];\n        tree.selected(false);\n      }\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      var model = {\n        list: []\n      };\n\n      for (var i = 0; i < this.treeList().length; i++) {\n        var tree = this.treeList()[i];\n        var treeItem = {\n          treeId: tree.treeId,\n          name: tree.name,\n          mappedFiles: [],\n          nonMappedFiles: []\n        };\n\n        for (var j = 0; j < tree.files().length; j++) {\n          var file = tree.files()[j];\n\n          if (file.selected() && !file.before()) {\n            treeItem.mappedFiles.push(file.value());\n          }\n\n          if (!file.selected() && file.before()) {\n            treeItem.nonMappedFiles.push(file.value());\n          }\n        }\n\n        model.list.push(treeItem);\n      }\n\n      return model;\n    }\n  }, {\n    key: \"backToForm\",\n    value: function backToForm() {\n      this.showSaveBtn(true);\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'treeeffected-content-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'exeEffectedMappingBtn',\n            vis: true,\n            click: this.parentVM.updateEffectedMapping\n          }, {\n            name: \"custom\",\n            resText: 'returnToProgressBtn',\n            vis: this.visShowSaveBtn,\n            click: this.backToForm.bind(this)\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return EffectedMappingForm;\n}(BaseSecondaryForm);\nvar TreeEffectedMappingItem = /*#__PURE__*/function (_BaseInfoModel) {\n  _inherits(TreeEffectedMappingItem, _BaseInfoModel);\n\n  var _super3 = _createSuper(TreeEffectedMappingItem);\n\n  function TreeEffectedMappingItem(model, fileList) {\n    var _this4;\n\n    _classCallCheck(this, TreeEffectedMappingItem);\n\n    _this4 = _super3.call(this, model);\n    _this4.currencyType = ko.observable(model.currencyType);\n    _this4.selected = ko.observable();\n    _this4.files = ko.observableArray();\n    if (_h.any(fileList)) for (var k = 0; k < fileList.length; k++) {\n      var p = fileList[k];\n\n      if (p.currencyType() === _this4.currencyType()) {\n        var checkItem = new FileItem(p);\n        if (_h.any(model.mappedFiles)) for (var l = 0; l < model.mappedFiles.length; l++) {\n          var mappedFile = model.mappedFiles[l];\n\n          if (p.value() === mappedFile) {\n            checkItem.selected(true);\n            checkItem.before(true);\n          }\n        }\n\n        _this4.files.push(checkItem);\n      }\n    }\n    return _this4;\n  }\n\n  return _createClass(TreeEffectedMappingItem);\n}(BaseInfoModel);\nvar FileItem = /*#__PURE__*/function (_BaseInfoModel2) {\n  _inherits(FileItem, _BaseInfoModel2);\n\n  var _super4 = _createSuper(FileItem);\n\n  function FileItem(model) {\n    var _this5;\n\n    _classCallCheck(this, FileItem);\n\n    _this5 = _super4.call(this, model);\n    _this5.selected = ko.observable(false);\n    _this5.before = ko.observable();\n    _this5.randomId = Math.random() * (10000000 - 100) + 100;\n    return _this5;\n  }\n\n  _createClass(FileItem, [{\n    key: \"createTagId\",\n    value: function createTagId() {\n      return \"FileItem-\" + this.randomId;\n    }\n  }]);\n\n  return FileItem;\n}(BaseInfoModel);\nvar MappingResultError = /*#__PURE__*/function (_BaseInfoModel3) {\n  _inherits(MappingResultError, _BaseInfoModel3);\n\n  var _super5 = _createSuper(MappingResultError);\n\n  function MappingResultError(model) {\n    var _this6;\n\n    _classCallCheck(this, MappingResultError);\n\n    _this6 = _super5.call(this, model);\n    _this6.errorMessage = ko.computed(function () {\n      var text = _h.getApiMessage(this.code);\n\n      if (this.code === \"FileNotMappedCompletely\") {\n        text += \" - \" + \"خط \" + this.differenceCount;\n      }\n\n      return text;\n    }.bind(_assertThisInitialized(_this6)));\n    return _this6;\n  }\n\n  return _createClass(MappingResultError);\n}(BaseInfoModel);\nvar SubstituteNode = /*#__PURE__*/function (_BaseModel2) {\n  _inherits(SubstituteNode, _BaseModel2);\n\n  var _super6 = _createSuper(SubstituteNode);\n\n  function SubstituteNode(model) {\n    _classCallCheck(this, SubstituteNode);\n\n    return _super6.call(this, model);\n  }\n\n  return _createClass(SubstituteNode);\n}(BaseModel);\nvar SubstituteNodeForm = /*#__PURE__*/function (_BaseFormModel) {\n  _inherits(SubstituteNodeForm, _BaseFormModel);\n\n  var _super7 = _createSuper(SubstituteNodeForm);\n\n  function SubstituteNodeForm(viewModel, editMode) {\n    var _this7;\n\n    _classCallCheck(this, SubstituteNodeForm);\n\n    _this7 = _super7.call(this, viewModel, editMode);\n    _this7.activeControl = 0;\n    _this7.nodeId = ko.observable();\n    _this7.substituteId = ko.observable();\n    _this7.nodeName = \"\";\n    _this7.substituteName = \"\";\n\n    if (editMode) {\n      var model = viewModel.getSelectedRecord();\n      _this7.nodeName = model.nodeName() + \" ( \" + model.nodeCode() + \" )\";\n      _this7.substituteName = model.substituteName() + \" ( \" + model.substituteCode() + \" )\";\n\n      _this7.nodeId(model.nodeId());\n\n      _this7.substituteId(model.substituteId());\n    }\n\n    _this7.setValidationObject();\n\n    _this7.createForm();\n\n    return _this7;\n  }\n\n  _createClass(SubstituteNodeForm, [{\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      self.validationObject = ko.validatedObservable({\n        nodeId: self.nodeId.extend({\n          required: true\n        }),\n        substituteId: self.substituteId.extend({\n          required: true\n        })\n      });\n    }\n  }, {\n    key: \"setActiveFocus\",\n    value: function setActiveFocus(name) {\n      self.activeControl = Number(name);\n    }\n  }, {\n    key: \"onNodeSelect\",\n    value: function onNodeSelect(name, value) {\n      switch (name) {\n        case \"nodeId\":\n          this.nodeId(value);\n          break;\n\n        case \"substituteId\":\n          this.substituteId(value);\n          break;\n      }\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'slcn',\n        treeId: _h.kocnx().mvm().treeId,\n        slcType: \"single\",\n        branchSelectable: false,\n        val: this.nodeId,\n        valName: this.nodeName\n      }, undefined, true), this.createLine({\n        t: 'slcn',\n        treeId: _h.kocnx().mvm().treeId,\n        slcType: \"single\",\n        branchSelectable: false,\n        val: this.substituteId,\n        valName: this.substituteName\n      }, undefined, true, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'create',\n            vis: !this.editMode(),\n            click: this.parentVM.create\n          }, {\n            name: 'edit',\n            vis: this.editMode() === true,\n            click: this.parentVM.edit\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return SubstituteNodeForm;\n}(BaseFormModel);\nfunction SubstituteNodeViewModel() {\n  var self = this;\n\n  self.createBtn = function () {\n    _h.kocnx().openForm(new SubstituteNodeForm(self));\n  };\n\n  self.editBtn = function () {\n    _h.kocnx().openForm(new SubstituteNodeForm(self, true));\n  };\n\n  self.removeFilter = function () {\n    self.nodeName(null);\n    self.nodeId(null);\n    self.getRecords();\n  };\n\n  self.refreshFormNodeSelect = function (item) {\n    if (self.showForm()) {\n      if (self.selectedRecord().activeControl === 1) {\n        self.selectedRecord().nodeId(item.id());\n        self.selectedRecord().nodeName(\"(\" + item.code + \")\" + item.name);\n        self.selectedRecord().nodeCode(item.code);\n      }\n\n      if (self.selectedRecord().activeControl === 2) {\n        self.selectedRecord().substituteId(item.id());\n        self.selectedRecord().substituteName(\"(\" + item.code + \")\" + item.name);\n        self.selectedRecord().substituteCode(item.code);\n      }\n    } else {\n      self.nodeName(item.name);\n      self.pageNumber(1);\n      self.nodeId(item.id());\n      self.getRecords();\n    }\n  };\n\n  self.deleteListBtn = function () {\n    var model = {\n      idList: []\n    };\n    var array = [],\n        items = [];\n    ko.utils.arrayFilter(self.records(), function (record) {\n      if (record.selected()) {\n        model.idList.push(record.id());\n        items.push(record);\n      }\n    });\n    var message = items.length > 1 ? toast.createMessage(self.entityName, 'delrange', null, 'confirm') : toast.createMessage(self.entityName, 'del', null, 'confirm');\n\n    _h.confirmDeleteAlert(message, function (res) {\n      if (res) {\n        self.apiService.request({\n          name: \"delete\",\n          data: model,\n          success: function success(data) {\n            if (!_h.isNullOrEmpty(data)) {\n              if (_h.any(items)) for (var i = 0; i < items.length; i++) {\n                self.records.remove(items[i]);\n              }\n              toast.success(self.entityName, 'delrange');\n            }\n          },\n          error: function error() {\n            toast.error(self.entityName, 'delrange');\n          }\n        });\n      }\n    });\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.iconSize(\"icon-image-small\");\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__.BaseViewModel({\n    entityName: \"SubstituteNode\",\n    getList: true,\n    apiService: {\n      actionList: [\"filterby\", \"post\", \"put\", \"delete\"]\n    },\n    buttons: [{\n      name: 'delete',\n      access: true,\n      icon: 'Delete',\n      cMenu: true\n    }, {\n      name: 'deleteList',\n      access: true,\n      icon: 'Delete',\n      cMenu: true\n    }, {\n      name: 'edit',\n      access: true,\n      icon: 'Edit',\n      cMenu: true\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'create',\n      access: false,\n      cMenu: false\n    }],\n    filters: [{\n      name: 'treeId'\n    }, {\n      name: 'nodeId'\n    }, {\n      name: 'nodeName'\n    }],\n    tableStyle: \"font-size: 11px;\",\n    sortDirection: \"Ascending\",\n    sortProperty: \"nodeCode\",\n    context: self,\n    searchKeyType: \"enter\",\n    cols: substituteNodeModelRes,\n    selectRow: true,\n    saveState: true,\n    contextMenu: true,\n    isMultiSelectRows: true,\n    resizable: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    var idList = self.multiCommandExecute(\"selectedItemIds\");\n    var selectedCount = idList.length;\n    self.visedit(selectedCount === 1);\n    self.visdelete(selectedCount === 1);\n    self.visdeleteList(selectedCount > 1);\n    self.viscreate(true);\n    self.vishelp(true);\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n\n  self.deleteBtn = function () {\n    self.deleteListBtn();\n  };\n\n  self.shortNodeName = ko.computed(function () {\n    if (_h.isNullOrEmpty(self.nodeName()) || self.nodeName() === \"\" || self.nodeName().length < 30) return self.nodeName();\n    return self.nodeName().substr(0, 27) + \"...\";\n  });\n}\nvar MappingRule = /*#__PURE__*/function (_BaseModel3) {\n  _inherits(MappingRule, _BaseModel3);\n\n  var _super8 = _createSuper(MappingRule);\n\n  function MappingRule(model) {\n    var _this8;\n\n    _classCallCheck(this, MappingRule);\n\n    _this8 = _super8.call(this, model);\n    _this8.shortName = ko.pureComputed(function () {\n      var code = this.nodeCode();\n      if (code) code += \"-\";\n      if (this.nodeName().length < 30) return code + this.nodeName();\n      return code + this.nodeName().substr(0, 27) + \"...\";\n    }, _assertThisInitialized(_this8));\n    return _this8;\n  }\n\n  return _createClass(MappingRule);\n}(BaseModel);\nvar MappingRuleForm = /*#__PURE__*/function (_BaseFormModel2) {\n  _inherits(MappingRuleForm, _BaseFormModel2);\n\n  var _super9 = _createSuper(MappingRuleForm);\n\n  function MappingRuleForm(viewModel, editMode, res, treeId) {\n    var _this9;\n\n    _classCallCheck(this, MappingRuleForm);\n\n    _this9 = _super9.call(this, viewModel, editMode, undefined, [\"createMappingRuleCaption\", \"editMappingRuleCaption\"]);\n    _this9.width = \"500px\";\n    _this9.ruleModel = ko.observable();\n    _this9.lastPriority = ko.observable();\n    var record = new TableConditionSet(_assertThisInitialized(_this9));\n    _this9.result = ko.observable();\n\n    if (!editMode) {\n      _this9.treeId = ko.observable(treeId);\n      _this9.autoPlacement = ko.observable(false);\n\n      _this9.lastPriority(res + 1);\n\n      _this9.priority(res + 1);\n\n      record.fillEmpty(undefined);\n\n      _this9.ruleModel(record);\n    } else {\n      var model = viewModel.multiCommandExecute(\"selectedRowRecord\");\n\n      _this9.lastPriority(res);\n\n      if (!_h.isEmpty(model.nodeName())) {\n        var nodeName = model.nodeName() + \" ( \" + model.nodeCode() + \" ) \";\n\n        _this9.nodeName(nodeName);\n      }\n\n      var rule = new _master_phraseTranslator_js__WEBPACK_IMPORTED_MODULE_2__.PhraseTranslator().getModel(model.rule());\n      record.fillModel(rule, model.ruleAggregation());\n\n      _this9.ruleModel(record);\n    }\n\n    _this9.showResultBtn = ko.observable(true);\n    _this9.showResultBlock = ko.observable(false);\n    _this9.changeResultStatus = ko.computed(function () {\n      if (this.showResultBtn()) {\n        this.showResultBlock(false);\n        this.showCancel(true);\n      } else {\n        this.showResultBlock(true);\n        this.showCancel(false);\n      }\n    }.bind(_assertThisInitialized(_this9)));\n\n    _this9.setValidationObject();\n\n    _this9.createForm();\n\n    _this9.fillResultModel();\n\n    return _this9;\n  }\n\n  _createClass(MappingRuleForm, [{\n    key: \"fillResultModel\",\n    value: function fillResultModel() {\n      var modelResult = new MappingRuleDataViewModel(this);\n      modelResult.treeId(this.treeId());\n      modelResult.rule(this.rule());\n      modelResult.balanceSheetId(_h.kocnx().mvm().sheetId());\n      this.result(modelResult);\n    }\n  }, {\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      this.validationObject = ko.validatedObservable({\n        priority: self.priority.extend({\n          required: true\n        }),\n        nodeId: self.nodeId.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.autoPlacement() === false;\n            }\n          }\n        }),\n        ruleModel: self.ruleModel.extend({\n          validation: {\n            validator: function validator(val, someOtherVal) {\n              var array = self.ruleModel().validateForm();\n              return !array.length;\n            }\n          }\n        })\n      });\n    }\n  }, {\n    key: \"toggleAutoPlacement\",\n    value: function toggleAutoPlacement() {\n      this.autoPlacement(!this.autoPlacement());\n    }\n  }, {\n    key: \"onNodeSelect\",\n    value: function onNodeSelect(name, value, itemValue) {\n      this.nodeId(value);\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'mappingrule-form-t'\n      }, undefined, true, 30, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'showResult',\n            vis: this.showResultBtn,\n            click: this.showResults.bind(this),\n            icon: \"ModalResult\"\n          }, {\n            name: \"custom\",\n            resText: 'returnToForm',\n            vis: this.showResultBlock,\n            click: this.returnToForm.bind(this),\n            icon: \"Returned\"\n          }, {\n            name: 'create',\n            vis: !this.editMode() && _h.kocnx().permitPeriodEdit(),\n            click: this.parentVM.create\n          }, {\n            name: 'edit',\n            vis: this.editMode() === true && _h.kocnx().permitPeriodEdit(),\n            click: this.parentVM.edit\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }, {\n    key: \"returnToForm\",\n    value: function returnToForm() {\n      this.showResultBtn(true);\n      $(\".modal-box\").css(\"width\", \"500px\");\n    }\n  }, {\n    key: \"showResults\",\n    value: function showResults() {\n      this.fillResultModel();\n      this.showResultBtn(false);\n      this.result().init();\n      $(\".modal-box\").css(\"width\", \"700px\");\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      var data = ko.toJS(this);\n      delete data[\"validationObject\"];\n      delete data[\"formButtons\"];\n      delete data[\"formControls\"];\n      delete data[\"parentVM\"];\n      delete data[\"editMode\"];\n      delete data[\"ad\"];\n      delete data[\"selected\"];\n      delete data[\"ruleModel\"];\n      delete data[\"result\"];\n      return data;\n    }\n  }]);\n\n  return MappingRuleForm;\n}(BaseFormModel);\nfunction MappingRuleViewModel() {\n  var self = this;\n\n  self.createBtn = function () {\n    self.getLastPriority(function (res) {\n      _h.kocnx().openForm(new MappingRuleForm(self, false, res, self.treeId()));\n    }, self.treeId());\n  };\n\n  self.editBtn = function () {\n    self.getLastPriority(function (res) {\n      _h.kocnx().openForm(new MappingRuleForm(self, true, res, self.treeId()));\n    }, self.treeId());\n  };\n\n  self.exportExcelBtn = function () {\n    var selectedRecord = self.getSelectedRecord();\n    var model = {\n      controllerName: 59,\n      inputData: {\n        mappingRuleId: selectedRecord.id(),\n        treeId: self.treeId(),\n        balanceSheetId: self.balanceSheetId(),\n        type: 1\n      }\n    };\n\n    _h.kocnx().createExcel(model);\n  };\n\n  self.applyRuleBtn = function () {\n    var item = self.multiCommandExecute(\"selectedRowRecord\");\n    var idList = [];\n    idList.push(item.id());\n    self.applyRules(idList);\n  };\n\n  self.applyRulesBtn = function () {\n    var idList = self.multiCommandExecute(\"selectedItemIds\");\n\n    if (idList.length === 0) {\n      var text = _h.getApiMessage(\"ActionSelectListEmptyError\");\n\n      _h.warningToast(text);\n    } else {\n      self.applyRules(idList);\n    }\n  };\n\n  self.applyRules = function (idList) {\n    var model = {\n      idList: idList,\n      treeId: self.treeId(),\n      balanceSheetId: self.balanceSheetId()\n    };\n    self.apiService.request({\n      name: \"postapplyrules\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          if (idList.length === 1) toast.success(self.entityName, 'custom', 'applyMappingRule');\n          if (idList.length > 1) toast.success(self.entityName, 'custom', 'applyMappingRules');\n\n          if (_h.any(data.models)) {\n            _h.kocnx().mvm().childModel().refreshSign(true);\n\n            $(\"#tree_view\").treeView(\"refreshTree\", data.models);\n          }\n\n          self.getRecords();\n        }\n      },\n      error: function error() {\n        if (idList.length === 1) toast.error(self.entityName, 'custom', 'applyMappingRule');\n        if (idList.length > 1) toast.error(self.entityName, 'custom', 'applyMappingRules');\n      }\n    });\n  };\n\n  self.cancelRuleBtn = function () {\n    var item = self.multiCommandExecute(\"selectedRowRecord\");\n    var idList = [];\n    idList.push(item.id());\n    self.cancelRules(idList);\n  };\n\n  self.cancelRulesBtn = function () {\n    var idList = self.multiCommandExecute(\"selectedItemIds\");\n\n    if (idList.length === 0) {\n      var text = _h.getApiMessage(\"ActionSelectListEmptyError\");\n\n      _h.warningToast(text);\n    } else {\n      self.cancelRules(idList);\n    }\n  };\n\n  self.cancelRules = function (idList) {\n    var model = {\n      idList: idList,\n      treeId: self.treeId(),\n      balanceSheetId: self.balanceSheetId()\n    };\n    self.apiService.request({\n      name: \"postrollbackrules\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          if (idList.length === 1) toast.success(self.entityName, 'custom', 'cancelMappingRule');\n          if (idList.length > 1) toast.success(self.entityName, 'custom', 'cancelMappingRules');\n\n          if (_h.any(data.models)) {\n            $(\"#tree_view\").treeView(\"refreshTree\", data.models);\n          }\n\n          self.getRecords();\n        }\n      },\n      error: function error() {\n        if (idList.length === 1) toast.error(self.entityName, 'custom', 'cancelMappingRule');\n        if (idList.length > 1) toast.error(self.entityName, 'custom', 'cancelMappingRules');\n      }\n    });\n  };\n\n  self.deleteListBtn = function () {\n    var model = {\n      idList: [],\n      treeId: self.treeId(),\n      balanceSheetId: self.balanceSheetId()\n    };\n    var items = [];\n\n    for (var i = 0; i < self.records().length; i++) {\n      var record = self.records()[i];\n\n      if (record.selected()) {\n        model.idList.push(record.id());\n        items.push(record);\n      }\n    }\n\n    var message;\n\n    if (items.length > 1) {\n      message = toast.createMessage(self.entityName, 'delrange', null, 'confirm');\n    } else {\n      message = toast.createMessage(self.entityName, 'del', null, 'confirm');\n    }\n\n    _h.confirmDeleteAlert(message, function (res) {\n      if (res) {\n        self.apiService.request({\n          name: \"delete\",\n          data: model,\n          success: function success(data) {\n            if (!_h.isNullOrEmpty(data)) {\n              if (_h.any(items)) for (var _i2 = 0; _i2 < items.length; _i2++) {\n                self.records.remove(items[_i2]);\n              }\n              self.afterUpdate(data.models);\n              toast.success(self.entityName, 'delrange');\n            }\n          },\n          error: function error() {\n            toast.error(self.entityName, 'delrange');\n          }\n        });\n      }\n    });\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.iconSize(\"icon-image-small\");\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__.BaseViewModel({\n    entityName: \"MappingRule\",\n    getList: true,\n    apiService: {\n      actionList: [\"filterby\", \"post\", \"put\", \"delete\", \"postapplyrules\", \"postrollbackrules\"]\n    },\n    buttons: [{\n      name: 'up',\n      access: true,\n      icon: 'Up',\n      cMenu: true\n    }, {\n      name: 'down',\n      access: true,\n      icon: 'Down',\n      cMenu: true\n    }, {\n      name: 'delete',\n      access: true,\n      icon: 'Delete',\n      cMenu: true\n    }, {\n      name: 'deleteList',\n      access: true,\n      icon: 'Delete',\n      cMenu: true\n    }, {\n      name: 'edit',\n      access: true,\n      icon: 'Edit',\n      cMenu: true\n    }, {\n      name: 'exportExcel',\n      access: true,\n      icon: 'ExportExcel',\n      cMenu: true\n    }, {\n      name: 'applyRule',\n      access: true,\n      icon: 'MappingOn',\n      cMenu: true\n    }, {\n      name: 'cancelRule',\n      access: true,\n      icon: 'MappingOff',\n      cMenu: true\n    }, {\n      name: 'applyRules',\n      access: true,\n      icon: 'MappingOn',\n      cMenu: true\n    }, {\n      name: 'cancelRules',\n      access: true,\n      icon: 'MappingOff',\n      cMenu: true\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'create',\n      access: false,\n      cMenu: false\n    }],\n    filters: [{\n      name: 'treeId'\n    }, {\n      name: 'balanceSheetId'\n    }],\n    extraParams: [\"lastPriority\"],\n    tableStyle: \"font-size: 11px;\",\n    sortDirection: \"Ascending\",\n    sortProperty: \"priority\",\n    context: self,\n    searchKeyType: \"enter\",\n    cols: mappingruleModelRes,\n    selectRow: true,\n    saveState: true,\n    contextMenu: true,\n    isMultiSelectRows: true,\n    resizable: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    var selectedList = self.multiCommandExecute(\"selectedItems\");\n\n    var context = _h.kocnx();\n\n    var permitPeriodEdit = context.permitPeriodEdit();\n    if (_h.isNullOrEmpty(selectedList)) return;\n\n    if (selectedList.length === 0) {\n      self.viscreate(permitPeriodEdit);\n      self.visedit(false);\n      self.visdelete(false);\n      self.visdeleteList(false);\n      self.visup(false);\n      self.visdown(false);\n      self.visapplyRule(false);\n      self.viscancelRule(false);\n      self.visapplyRules(false);\n      self.viscancelRules(false);\n      self.visexportExcel(false);\n    }\n\n    if (selectedList.length === 1) {\n      var item = self.getSelectedRecord();\n      if (item === null || item === undefined) item = selectedList[0];\n      self.viscreate(permitPeriodEdit);\n      self.visedit(permitPeriodEdit);\n      self.visdelete(permitPeriodEdit);\n      self.visdeleteList(false);\n      self.visup(permitPeriodEdit && item.priority() > 1);\n      self.visdown(permitPeriodEdit && self.lastPriority() !== item.priority());\n      self.visapplyRule(permitPeriodEdit);\n      self.viscancelRule(permitPeriodEdit);\n      self.visapplyRules(false);\n      self.viscancelRules(false);\n      self.visexportExcel(true);\n    }\n\n    if (selectedList.length > 1) {\n      self.viscreate(permitPeriodEdit);\n      self.visedit(false);\n      self.visdelete(false);\n      self.visdeleteList(permitPeriodEdit);\n      self.visup(false);\n      self.visdown(false);\n      self.visapplyRule(false);\n      self.viscancelRule(false);\n      self.visapplyRules(permitPeriodEdit);\n      self.viscancelRules(permitPeriodEdit);\n      self.visexportExcel(false);\n    }\n\n    self.vishelp(true);\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n\n  self.deleteBtn = function () {\n    self.deleteListBtn();\n  };\n}\nfunction TableConditionSet(parentForm) {\n  var self = this;\n  self.parentForm = parentForm;\n  self.operatorsList = [];\n  self.showDropDown = ko.observable(false);\n  self.conditions = ko.observableArray();\n  self.shortcuts = ko.observableArray();\n  self.result = ko.observable(\"\");\n  self.text = ko.observable(\"\");\n\n  self.translatePhrase = function () {\n    if (self.conditions().length === 1) {\n      self.parentForm[\"rule\"](\"\");\n\n      if (self.conditions()[0].leftSide() && self.conditions()[0].leftSide() !== \"\" && self.conditions()[0].operator() && self.conditions()[0].operator() !== \"\") {\n        var phrase = self.conditions()[0].createConditionPhrase();\n        self.result(\"[cs1:\" + phrase + \"]\");\n        self.parentForm[\"rule\"](self.result());\n      }\n    }\n\n    if (!_h.isNullOrEmpty(self.text()) && self.text() !== \"\") {\n      if (self.conditions().length > 1) {\n        var text = self.text();\n        self.parentForm[\"rule\"](\"\");\n\n        for (var i = 0; i < self.conditions().length; i++) {\n          var target = self.conditions()[i];\n          var ph = target.createConditionPhrase();\n          var cName = \"Cs\" + (i + 1);\n\n          if (self.text().indexOf(cName) !== -1) {\n            var condStr = \"[cs\" + (i + 1) + \":\" + ph + \"]\";\n            text = self.replace(text, cName, condStr);\n            self.result(text);\n          }\n        }\n\n        self.parentForm[\"rule\"](self.result());\n      }\n    }\n  };\n\n  self.replace = function (text, cName, condStr) {\n    var index = text.indexOf(cName);\n    var cNLen = cName.length;\n\n    if (index > 0) {\n      var first = text.substring(0, index);\n      var last = text.substring(index + cNLen);\n      return first + condStr + last;\n    } else {\n      var last = text.substring(index + cNLen);\n      return condStr + last;\n    }\n  };\n\n  self.fillModel = function (conditions, agr) {\n    self.init(conditions, agr);\n  };\n\n  self.fillEmpty = function () {\n    self.init(undefined);\n  };\n\n  self.addCondition = function () {\n    var record = self.getConditionModel();\n    record.fillModel(undefined);\n    self.conditions.push(record);\n  };\n\n  self.removeCondition = function (item) {\n    if (self.conditions().length > 1) {\n      self.conditions.remove(item);\n      $('a[href=\"#cond-0\"]').trigger('click');\n      self.translatePhrase();\n    }\n  };\n\n  self.init = function (conditions, agr) {\n    var record = null;\n    if (_h.any(conditions)) for (var i = 0; i < conditions.length; i++) {\n      var condition = conditions[i];\n      record = self.getConditionModel();\n      record.fillModel(condition);\n      self.conditions.push(record);\n    } else {\n      record = self.getConditionModel();\n      record.fillModel(undefined);\n      self.conditions.push(record);\n    }\n\n    if (!_h.isNullOrEmpty(agr)) {\n      agr = agr.replace(/[c]/g, \"C\");\n      self.text(agr);\n    }\n\n    self.operatorsList = {\n      1000: {\n        text: \"Cs\",\n        data: \"Cs\",\n        keyCode: 1000,\n        enabled: ko.observable(false),\n        after: [38, 124, 41]\n      },\n      40: {\n        text: \"(\",\n        data: \"(\",\n        keyCode: 40,\n        enabled: ko.observable(false),\n        after: [40, 1000]\n      },\n      41: {\n        text: \")\",\n        data: \")\",\n        keyCode: 41,\n        enabled: ko.observable(false),\n        after: [38, 124, 41]\n      },\n      38: {\n        text: \"و (AND)\",\n        data: \"&&\",\n        keyCode: 38,\n        enabled: ko.observable(false),\n        after: [1000, 40]\n      },\n      124: {\n        text: \"یا (OR)\",\n        data: \"||\",\n        keyCode: 124,\n        enabled: ko.observable(false),\n        after: [1000, 40]\n      }\n    };\n    self.updateOperatorState();\n    self.translatePhrase();\n  };\n\n  self.getConditionModel = function () {\n    return new TableCondition(self.parentForm, self);\n  };\n\n  self.lastOperator = ko.observable();\n  self.middleTyping = ko.observable();\n\n  self.updateOperatorState = function () {\n    if (_h.isNullOrEmpty(self.lastOperator()) || self.lastOperator() === \"\") {\n      self.operatorsList[40].enabled(true);\n      self.operatorsList[1000].enabled(true);\n    } else {\n      var last = self.operatorsList[self.lastOperator()];\n\n      for (var prop in self.operatorsList) {\n        if (self.operatorsList.hasOwnProperty(prop)) {\n          var target = self.operatorsList[prop];\n\n          if (last.after.indexOf(target.keyCode) !== -1) {\n            if (target.keyCode !== 41) target.enabled(true);else {\n              var rs = self.isAllowAddRightParentheses();\n              target.enabled(rs);\n            }\n          } else {\n            target.enabled(false);\n          }\n        }\n      }\n    }\n  };\n\n  self.clickOperator = function (item) {\n    self.text(self.text() + item.value.data);\n    self.lastOperator(item.value.keyCode);\n    self.updateOperatorState();\n    self.translatePhrase();\n  };\n\n  self.clickCondition = function (model, index, cond) {\n    self.text(self.text() + \"Cs\" + index);\n    self.lastOperator(self.operatorsList[1000].keyCode);\n    self.updateOperatorState();\n    self.translatePhrase();\n  };\n\n  self.isAllowAddRightParentheses = function () {\n    var lPCount = self.text().replace(/[^(]/g, \"\").length;\n    var rPCount = self.text().replace(/[^)]/g, \"\").length;\n    if (lPCount === 0) return false;\n    if (lPCount === rPCount) return false;\n    return lPCount > rPCount;\n  };\n\n  self.proxyKeyDown = function (data, event) {\n    var itemOperator = self.operatorsList[event.keyCode];\n\n    if (itemOperator && itemOperator.enabled()) {\n      self.text(self.text() + self.operatorsList[event.keyCode].data);\n      self.lastOperator(self.operatorsList[event.keyCode].keyCode);\n      self.updateOperatorState();\n    } else {\n      if (event.keyCode === 67 && !self.middleTyping()) {\n        self.middleTyping(true);\n\n        if (self.operatorsList[1000].enabled()) {\n          self.text(\"Cs\");\n        }\n      }\n\n      if (event.keyCode >= 49 && event.keyCode <= 57 && self.middleTyping()) {\n        var condition = self.conditions()[event.keyCode - 48];\n\n        if (condition && condition.validationObject.isValid()) {\n          self.text(self.text() + \"Cs\" + (event.keyCode - 48));\n          self.middleTyping(false);\n          self.lastOperator(1000);\n        }\n      }\n\n      if (event.keyCode === 46) {\n        event.preventDefault();\n        self.text(\"\");\n        self.lastOperator(undefined);\n        self.updateOperatorState();\n      }\n\n      if (event.keyCode === 8) {\n        event.preventDefault();\n        if (!self.middleTyping()) self.clearOnStep();else {\n          var rest = self.text().substring(0, self.text().length - 2);\n          self.text(rest);\n          self.middleTyping(false);\n        }\n      }\n    }\n\n    self.translatePhrase();\n  };\n\n  self.refreshShortcuts = ko.computed(function () {\n    if (self.conditions().length > 1) {\n      self.shortcuts.removeAll();\n      var and = \"\";\n      var or = \"\";\n      ko.utils.arrayForEach(self.conditions(), function (f, index) {\n        if (f.validationObject.isValid()) {\n          if (index + 1 !== self.conditions().length) {\n            and += \"Cs\" + (index + 1) + \"&&\";\n            or += \"Cs\" + (index + 1) + \"||\";\n          } else {\n            and += \"Cs\" + (index + 1);\n            or += \"Cs\" + (index + 1);\n          }\n        }\n      });\n      self.shortcuts.push(and);\n      self.shortcuts.push(or);\n    } else {\n      self.shortcuts.removeAll();\n    }\n  });\n\n  self.clickShortcut = function (item) {\n    self.text(\"\");\n    self.text(item);\n    self.lastOperator(1000);\n    self.updateOperatorState();\n    self.translatePhrase();\n  };\n\n  self.clearOnStep = function () {\n    var last = self.lastOperator();\n\n    if (last !== undefined && last !== \"\") {\n      var itemOperator = self.operatorsList[last];\n      var lastChar = \"\";\n      var rest = self.text().substring(0, self.text().lastIndexOf(itemOperator.data));\n      self.text(rest);\n      lastChar = self.text().substring(self.text().length - 1);\n      self.guessLastOperator(lastChar);\n    }\n  };\n\n  self.guessLastOperator = function (lastChar) {\n    if (lastChar === undefined || lastChar === \"\") self.lastOperator(undefined);else if ($.isNumeric(lastChar)) self.lastOperator(1000);else if (lastChar === \"(\") self.lastOperator(40);else if (lastChar === \")\") self.lastOperator(41);else if (lastChar === \"&\") self.lastOperator(38);else if (lastChar === \" |\") self.lastOperator(124);\n  };\n\n  self.validationObject = ko.validatedObservable({\n    conditions: self.conditions,\n    text: self.text.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          return self.conditions().length > 1;\n        }\n      },\n      isAllConditionsUse: {\n        params: self.conditions\n      },\n      isConditionsUseValid: {\n        params: self.conditions\n      },\n      remoteIsValidExpression: {\n        onlyIf: function onlyIf() {\n          return self.conditions().length > 1 && self.text() !== undefined && self.text() !== \"\";\n        },\n        params: [true, false, 59]\n      }\n    })\n  });\n\n  self.reset = function (loc) {\n    var zero = self.conditions()[0];\n    zero.reset(loc);\n    self.conditions.removeAll();\n    self.conditions.push(zero);\n  };\n\n  self.validateForm = function () {\n    var array = [];\n\n    for (var i = 0; i < self.conditions().length; i++) {\n      var target = self.conditions()[i];\n      var condArray = {\n        propFaName: \"شرط \" + (i + 1),\n        propName: \"Condition \" + (i + 1),\n        children: []\n      };\n\n      for (var p in target.validationObject()) {\n        if (target.validationObject().hasOwnProperty(p)) {\n          var valObj = target.validationObject()[p];\n          if (!_h.isNullOrEmpty(valObj.error())) condArray.children.push({\n            propName: p,\n            error: valObj.error()\n          });\n        }\n      }\n\n      if (condArray.children.length > 0) array.push(condArray);\n    }\n\n    if (!_h.isNullOrEmpty(self.text.error())) {\n      if (!self.validationObject.isValid()) self.validationObject.errors.showAllMessages();\n      array.push({\n        propName: \"ConditionAggregation\",\n        propFaName: \"تجمیع شروط \",\n        error: self.text.error()\n      });\n    }\n\n    return array;\n  };\n}\nfunction TableCondition(parent, parentSet) {\n  var self = this;\n  self.parentForm = parent;\n  self.parentSet = parentSet;\n  self.leftSideItems = ko.observableArray(ruleBases);\n  self.leftSide = ko.observable();\n  self.operator = ko.observable();\n  self.rightSide = ko.observable();\n  self.rightSideDataTypes = ko.observableArray([]);\n  self.rightSideDataType = ko.observable();\n  self.operators = ko.observableArray();\n\n  self.onSelect = function (controlName) {\n    switch (controlName) {\n      case \"leftSide\":\n        self.operator(undefined);\n        self.operators.removeAll();\n\n        switch (self.leftSide()) {\n          case 1:\n            self.operators.push({\n              text: \"Match\",\n              enText: \"Match\",\n              value: 14,\n              color: \"\",\n              dataTypes: [15]\n            });\n            self.rightSideDataType(15);\n            break;\n\n          case 2:\n            self.operators.push({\n              text: \">\",\n              enText: \">\",\n              value: 1,\n              color: \"\",\n              dataTypes: [0]\n            });\n            self.operators.push({\n              text: \"<\",\n              enText: \"<\",\n              value: 2,\n              color: \"\",\n              dataTypes: [0]\n            });\n            self.operators.push({\n              text: \"=\",\n              enText: \"=\",\n              value: 3,\n              color: \"\",\n              dataTypes: [0]\n            });\n            self.operators.push({\n              text: \"<>\",\n              enText: \"<>\",\n              value: 4,\n              color: \"\",\n              dataTypes: [0]\n            });\n            self.operators.push({\n              text: \">=\",\n              enText: \">=\",\n              value: 5,\n              color: \"\",\n              dataTypes: [0]\n            });\n            self.operators.push({\n              text: \"<=\",\n              enText: \"<=\",\n              value: 6,\n              color: \"\",\n              dataTypes: [0]\n            });\n            self.rightSideDataType(0);\n            break;\n        }\n\n        self.rightSide(undefined);\n        self.parentSet.translatePhrase();\n        break;\n\n      case \"operator\":\n        self.parentSet.translatePhrase();\n        break;\n    }\n  };\n\n  self.rightSideDataType.subscribe(function (newValue) {\n    self.parentSet.translatePhrase();\n  });\n  self.rightSide.subscribe(function (newValue) {\n    self.parentSet.translatePhrase();\n  });\n  self.validationObject = ko.validatedObservable({\n    rightSide: self.rightSide.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          var conditionCount = self.parentSet !== \"\" && self.parentSet.conditions().length > 1;\n          var hasLeftSideValue = self.leftSide && self.leftSide() !== \"\";\n          var hasOperatorValue = self.operator && self.operator() !== \"\";\n          var reqiureVal = self.rightSideDataType && self.rightSideDataType() !== \"\" && self.rightSideDataType() !== 13;\n          return conditionCount && (hasLeftSideValue || hasOperatorValue) && reqiureVal;\n        }\n      }\n    }),\n    leftSide: self.leftSide.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          return self.parentSet !== \"\" && self.parentSet.conditions().length > 1;\n        }\n      }\n    }),\n    operator: self.operator.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          var conditionCount = self.parentSet !== \"\" && self.parentSet.conditions().length > 1;\n          var hasLeftSideValue = self.leftSide && self.leftSide() !== \"\";\n          return conditionCount && hasLeftSideValue;\n        }\n      }\n    })\n  });\n\n  self.fillModel = function (model) {\n    if (model) {\n      self.leftSide(Number(model.leftSide));\n      self.onSelect(\"leftSide\");\n      self.operator(model.operator.value);\n      self.onSelect(\"operator\");\n      self.rightSideDataType(model.rightSide.type);\n      self.rightSide(model.rightSide.value);\n    }\n  };\n\n  self.createConditionPhrase = function () {\n    var ph = \"[compare:'\" + self.leftSide() + \"']\";\n    ph += _h.getEnumEnText([{\n      text: \"Match\",\n      enText: \"Match\",\n      value: 14,\n      color: \"\",\n      dataTypes: [15]\n    }, {\n      text: \">\",\n      enText: \">\",\n      value: 1,\n      color: \"\",\n      dataTypes: [0]\n    }, {\n      text: \"<\",\n      enText: \"<\",\n      value: 2,\n      color: \"\",\n      dataTypes: [0]\n    }, {\n      text: \"=\",\n      enText: \"=\",\n      value: 3,\n      color: \"\",\n      dataTypes: [0]\n    }, {\n      text: \"<>\",\n      enText: \"<>\",\n      value: 4,\n      color: \"\",\n      dataTypes: [0]\n    }, {\n      text: \">=\",\n      enText: \">=\",\n      value: 5,\n      color: \"\",\n      dataTypes: [0]\n    }, {\n      text: \"<=\",\n      enText: \"<=\",\n      value: 6,\n      color: \"\",\n      dataTypes: [0]\n    }], self.operator());\n    var val = self.rightSideDataType();\n    var right = \"\";\n\n    switch (val) {\n      case 0:\n        right = \"int:'\";\n        break;\n\n      case 15:\n        right = \"pattern:'\";\n        break;\n\n      case 20:\n        right = \"likepattern:'\";\n        break;\n\n      case null:\n      case undefined:\n      case \"\":\n      case \"-\":\n      case 13:\n        return ph;\n    }\n\n    if (self.rightSide() !== undefined) ph += \"[\" + right + self.rightSide() + \"']\";else ph += \"[\" + right + \"']\";\n    return ph;\n  };\n\n  self.reset = function () {\n    self.leftSide(undefined);\n    self.operator(undefined);\n    self.rightSideDataType(undefined);\n    self.rightSide(undefined);\n  };\n}\nvar MappingRuleData = /*#__PURE__*/function (_BaseModel4) {\n  _inherits(MappingRuleData, _BaseModel4);\n\n  var _super10 = _createSuper(MappingRuleData);\n\n  function MappingRuleData(model) {\n    _classCallCheck(this, MappingRuleData);\n\n    return _super10.call(this, model);\n  }\n\n  return _createClass(MappingRuleData);\n}(BaseModel);\nfunction MappingRuleDataViewModel(parent) {\n  var self = this;\n  self.parent = parent;\n\n  self.exportRuleExcelBtn = function () {\n    var model = {\n      controllerName: 59,\n      inputData: {\n        treeId: self.treeId(),\n        balanceSheetId: self.balanceSheetId(),\n        type: 0,\n        rule: self.parent.rule(),\n        mappingRuleId: self.parent.id()\n      }\n    };\n\n    _h.kocnx().createExcel(model);\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__.BaseViewModel({\n    entityName: \"MappingRuleData\",\n    getList: true,\n    apiService: {\n      actionList: [\"filterby\"]\n    },\n    buttons: [{\n      name: 'exportRuleExcel',\n      access: true,\n      icon: 'ExportExcel',\n      cMenu: true\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }],\n    extraParams: [\"totalCreditor\", \"totalDebtor\"],\n    filters: [{\n      name: 'treeId'\n    }, {\n      name: 'balanceSheetId'\n    }, {\n      name: 'rule'\n    }, {\n      name: 'mappingRuleId'\n    }],\n    footerTemplate: \"mappingruledata-footertable-template\",\n    tableStyle: \"font-size: 11px;\",\n    sortDirection: \"Ascending\",\n    sortProperty: \"code\",\n    context: self,\n    searchKeyType: \"enter\",\n    cols: mappingruledataModelRes,\n    selectRow: true,\n    saveState: true,\n    contextMenu: true,\n    resizable: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    self.visexportRuleExcel(self.records().length > 0);\n    self.visrefresh(true);\n  });\n}\nfunction MappingSrcViewModel() {\n  var self = this;\n  self.records = [];\n  self.entityName = \"MappingSrc\";\n  self.apiService = new _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService({\n    actionList: [\"autopost\", \"filterby\"]\n  }, self.entityName);\n  self.searchKey = ko.observable();\n  self.filterType = ko.observable(0);\n  self.treeId = ko.observable();\n  self.treeName = ko.observable();\n  self.showMapped = ko.observable(false);\n  self.showMapped.subscribe(function (newValue) {\n    if (_h.isNullOrEmpty(newValue)) return;\n    $(\"#tree_view_l\").treeView(\"collectOpenBranches\");\n    $(\"#tree_view_l\").treeView(\"changeShowMapped\", newValue);\n  });\n\n  self.configTools = function () {\n    $(\"#tree_view_l\").treeView({\n      tType: \"MappingSrc\",\n      location: \"MappingSrc\",\n      nodes: self.records,\n      rootId: self.treeId(),\n      permitPeriodEdit: _h.kocnx().permitPeriodEdit(),\n      controllerName: 16,\n      mappingSide: 2,\n      showMapped: self.showMapped(),\n      rootName: self.treeName()\n    });\n  };\n\n  self.onEnterSearchKey = function (model, e) {\n    if (e.keyCode === 13) {\n      self.getRecords(function (res) {});\n    }\n\n    return true;\n  };\n\n  self.showFilterItem = function (item) {\n    return item.type !== 2 && item.type !== 3;\n  };\n\n  self.expandAll = function () {\n    $(\"#tree_view_l\").treeView(\"expandAll\");\n  };\n\n  self.collapseAll = function () {\n    $(\"#tree_view_l\").treeView(\"collapseAll\");\n  };\n\n  self.toggleShowMapped = function () {\n    self.showMapped(!self.showMapped());\n    self.getRecords(function (res) {\n      $(\"#tree_view_l\").treeView(\"openBranches\");\n    });\n  };\n\n  self.autoMapBtn = function () {\n    var model = {\n      codes: [],\n      treeId: self.treeId()\n    };\n    var items = $(\"#tree_view_l\").treeView(\"selectedItems\");\n    if (items) for (var i = 0; i < items.length; i++) {\n      var item = items[i];\n      model.codes.push(item.id + \"\");\n    }\n    self.apiService.request({\n      name: \"/api/mapping/autopost\",\n      data: model,\n      success: function success(data) {\n        toast.success(self.entityName, 'custom', 'applyAutoMapping');\n\n        _h.kocnx().mvm().getRecords(function (res) {});\n\n        self.getRecords(function (res) {});\n      },\n      error: function error(data) {\n        toast.error(self.entityName, 'custom', 'applyAutoMapping');\n      }\n    });\n  };\n\n  self.exportExcelBtn = function () {\n    var model = {\n      controllerName: 16,\n      inputData: {\n        id: self.treeId()\n      }\n    };\n\n    _h.kocnx().createExcel(model);\n  };\n\n  self.getRecords = function (callback) {\n    self.apiService.request({\n      name: \"/api/mapping/filterby\",\n      data: {\n        treeId: self.treeId(),\n        filterType: self.filterType(),\n        searchKey: self.searchKey(),\n        mappingSide: 2,\n        showMapped: self.showMapped()\n      },\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          if (_h.any(data.nodes)) self.records = data.nodes;else self.records = [];\n          self.configTools();\n        }\n\n        callback(true);\n      },\n      error: function error(data) {\n        var text = _h.getApiMessage(\"ErrorLoadMapTree\");\n\n        _h.failToast(text);\n\n        callback(false);\n      }\n    });\n  };\n\n  self.init = function () {\n    self.getRecords(function (res) {});\n  };\n}\n$(document).on(\"shown.bs.tab\", '.mapping-tab a[data-toggle=\"tab\"]', function (e) {\n  var target = $(e.target).attr(\"href\");\n  var tabName = target.replace(\"-t\", \"\").replace(\"#\", \"\");\n\n  var context = _h.kocnx();\n\n  switch (tabName) {\n    case \"balancesheetmapping\":\n      _h.kocnx().mvm().activeSide(1);\n\n      if (context.mvm().childModel().refreshSign()) {\n        context.mvm().childModel().refreshSign(false);\n        context.mvm().childModel().getRecords();\n      }\n\n      break;\n\n    case \"substitutenode\":\n      context.mvm().activeSide(2);\n      context.mvm().onClickleftSideTab();\n      break;\n\n    case \"mappingruletab\":\n      context.mvm().activeSide(3);\n      context.mvm().onClickleftSideTab();\n      break;\n  }\n});\n\n//# sourceURL=webpack://domino/./src/scripts/pages/mapping/model.js?");

/***/ }),

/***/ "./src/scripts/pages/mapping/resource.js":
/*!***********************************************!*\
  !*** ./src/scripts/pages/mapping/resource.js ***!
  \***********************************************/
/***/ (() => {

eval("window.filterTypes = [{\n  text: \"کد گره\",\n  enText: \"TreeCode\",\n  value: 0,\n  type: 0\n}, {\n  text: \"عنوان گره\",\n  enText: \"TreeTitle\",\n  value: 2,\n  type: 0\n}, {\n  text: \"کد تراز\",\n  enText: \"FileCode\",\n  value: 1,\n  type: 2\n}, {\n  text: \"عنوان کد تراز\",\n  enText: \"FileTitle\",\n  value: 3,\n  type: 2\n}, {\n  text: \"کد گره مبدا\",\n  enText: \"SourceTreeCode\",\n  value: 4,\n  type: 3\n}, {\n  text: \"عنوان گره مبدا\",\n  enText: \"SourceTreeTitle\",\n  value: 5,\n  type: 3\n}];\nwindow.ruleExcelTypes = [{\n  text: \"پیش نمایش\",\n  enText: \"Preview\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"نتایج\",\n  enText: \"Result\",\n  value: 1,\n  color: \"\"\n}];\nwindow.ruleBases = [{\n  text: \"کد\",\n  enText: \"Code\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"تعداد کاراکتر های کد\",\n  enText: \"Length\",\n  value: 2,\n  color: \"\"\n}];\nwindow.mappingTypes = [{\n  text: \"نگاشت فایل تراز\",\n  enText: \"BalanceSheetMapping\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"نگاشت درخت\",\n  enText: \"TreeMapping\",\n  value: 2,\n  color: \"\"\n}];\nwindow.applyStates = [{\n  text: \"اجرا نشده\",\n  enText: \"None\",\n  value: 0,\n  color: \"blue\"\n}, {\n  text: \"موفق\",\n  enText: \"Successful\",\n  value: 1,\n  color: \"green\"\n}, {\n  text: \"ناموفق\",\n  enText: \"Failed\",\n  value: 2,\n  color: \"red\"\n}];\nwindow.mappingTreePageRes = {\n  mappingTreeCode: {\n    fa: 'کد حساب'\n  },\n  mapDataCode: {\n    fa: 'کد نگاشت'\n  },\n  updateMapping: {\n    fa: 'بروزرسانی اطلاعات نگاشت'\n  },\n  removebalancesheetFromTree: {\n    fa: 'حذف از درخت نگاشت'\n  },\n  sheetId: {\n    fa: 'انتخاب فایل تراز'\n  },\n  treeId: {\n    fa: 'درخت نگاشت'\n  },\n  changeFormTitle: {\n    fa: 'انتخاب پارامتر های نگاشت'\n  },\n  createMappingScope: {\n    fa: 'ساخت مدل'\n  },\n  roolbackChanges: {\n    fa: 'برگشت تغییرات ذخیره نشده'\n  },\n  effectedMappingBtn: {\n    fa: 'اعمال/لغو اثر فایل تراز'\n  },\n  UnEffectedMappingCaption: {\n    fa: 'لغو اعمال اثر فایل تراز'\n  },\n  effectedMappingCaption: {\n    fa: 'اعمال فایل تراز'\n  },\n  selectMappingTree: {\n    fa: 'انتخاب لیست درختواره'\n  },\n  selectBalancesheet: {\n    fa: 'انتخاب لیست فایل تراز'\n  },\n  analyzeEffectedMapping: {\n    fa: 'بررسی نگاشت'\n  },\n  selectAll: {\n    fa: 'انتخاب همه'\n  },\n  notChooseTrees: {\n    fa: 'لطفا درختواره ای را جهت  بررسی انتخاب کنید'\n  },\n  notChooseFiles: {\n    fa: 'لطفا فایل ترازی را جهت  بررسی انتخاب کنید'\n  },\n  notUnEffectedSelected: {\n    fa: 'لطفا جهت لغو اعمال اثر درختواره و یا فایل ترازی را انتخاب کنید'\n  },\n  updateEffectedMappingBtn: {\n    fa: 'ذخیره تغییرات'\n  },\n  unEffectedMappingBtn: {\n    fa: 'لغو اعمال اثر فایل تراز'\n  },\n  selectPanelTitle: {\n    fa: 'انتخاب گروهی'\n  },\n  pageslbl: {\n    fa: 'صفحات'\n  },\n  debtorOnly: {\n    fa: 'فقط بدهکار'\n  },\n  creditorOnly: {\n    fa: 'فقط بستانکار'\n  },\n  selectPanelBtn: {\n    fa: 'انتخاب'\n  },\n  pageRange: {\n    fa: 'محدوده صفحه'\n  },\n  mappingRule: {\n    fa: 'الگوی نگاشت'\n  },\n  mappingType: {\n    fa: 'نوع نگاشت'\n  },\n  soruceSide: {\n    fa: 'مبدا'\n  },\n  destinationSide: {\n    fa: 'مقصد'\n  },\n  treeDestinationSide: {\n    fa: ' (درخت نگاشت) '\n  },\n  onShowMappedTree: {\n    fa: 'نمایش همزمان گره های نگاشت شده'\n  },\n  offShowMappedTree: {\n    fa: 'عدم نمایش همزمان گره های نگاشت شده'\n  },\n  autoMapBtn: {\n    fa: 'نگاشت خودکار'\n  },\n  exportExcelBtn: {\n    fa: 'خروجی فایل اکسل'\n  },\n  exeEffectedMappingBtn: {\n    fa: 'اعمال کردن'\n  },\n  returnToProgressBtn: {\n    fa: 'بازگشت به عملیات'\n  }\n};\nwindow.mappingtreeModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null\n  },\n  balanceSheetId: {\n    fa: '',\n    colName: 'balanceSheetId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null\n  },\n  name: {\n    fa: 'کد',\n    colName: 'name',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null\n  },\n  code: {\n    fa: 'کد حساب',\n    colName: 'code',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null\n  },\n  parentId: {\n    fa: 'والد',\n    colName: 'parentId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null\n  },\n  nodeType: {\n    fa: 'نوع گره',\n    colName: 'nodeType',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null\n  }\n};\nwindow.mappingDataModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    size: 5,\n    templateName: \"checkbox-table-template\"\n  },\n  code: {\n    fa: 'کد',\n    colName: 'code',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"Ascending\",\n    alias: null,\n    size: 10,\n    type: \"string\",\n    popup: true,\n    filterType: true\n  },\n  title: {\n    fa: 'عنوان',\n    colName: 'title',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 40,\n    type: \"string\",\n    popup: true,\n    filterType: true\n  },\n  debtor: {\n    fa: 'مانده بدهکار',\n    colName: 'debtor',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 20,\n    type: \"money\",\n    popup: true,\n    filterType: true\n  },\n  creditor: {\n    fa: 'مانده بستانکار',\n    colName: 'creditor',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 20,\n    type: \"money\",\n    popup: true,\n    filterType: true\n  }\n};\nwindow.mappingDataPageRes = {\n  balancesheetSelect: {\n    fa: 'فایل تراز'\n  },\n  onShowMapped: {\n    fa: 'نمایش همزمان کدهای نگاشت شده'\n  },\n  offShowMapped: {\n    fa: 'عدم نمایش همزمان کدهای نگاشت شده'\n  },\n  balancesheetMappingTab: {\n    fa: 'کدهای فایل تراز'\n  },\n  substituteNodeTab: {\n    fa: 'حساب مقابل'\n  }\n};\nwindow.substituteNodeModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  nodeName: {\n    fa: 'نام گره',\n    colName: 'nodeName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 30,\n    type: \"string\",\n    popup: true\n  },\n  nodeCode: {\n    fa: 'کد گره',\n    colName: 'nodeCode',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 20,\n    type: \"string\",\n    popup: true\n  },\n  substituteName: {\n    fa: 'گره مقابل',\n    colName: 'substituteName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 20,\n    type: \"string\",\n    popup: true\n  },\n  substituteCode: {\n    fa: 'کد گره مقابل',\n    colName: 'substituteCode',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 20,\n    type: \"string\",\n    popup: true\n  },\n  nodeId: {\n    fa: 'نام گره',\n    colName: 'nodeId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  substituteId: {\n    fa: 'گره مقابل',\n    colName: 'substituteId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  }\n};\nwindow.substitutenodePageRes = {\n  substitutenodeTab: {\n    fa: 'حساب مقابل'\n  },\n  editCaption: {\n    fa: 'ویرایش حساب مقابل'\n  },\n  createCaption: {\n    fa: 'تعریف حساب مقابل جدید'\n  },\n  deleteCaption: {\n    fa: 'حذف حساب مقابل'\n  },\n  deleteListCaption: {\n    fa: 'حذف حساب های مقابل'\n  }\n};\nwindow.mappingruleModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  priority: {\n    fa: 'اولویت',\n    colName: 'priority',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"Ascending\",\n    alias: null,\n    size: 12,\n    type: \"string\"\n  },\n  code: {\n    fa: 'شماره',\n    colName: 'code',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    size: 10,\n    alias: null,\n    type: \"string\"\n  },\n  nodeCode: {\n    fa: 'کد گره',\n    colName: 'nodeCode',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  nodeName: {\n    fa: 'گره',\n    colName: 'nodeName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 60,\n    type: \"template\",\n    templateName: \"mappingrule-nodeName-template\"\n  },\n  applyState: {\n    fa: 'وضعیت اجرا',\n    colName: 'applyState',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 17,\n    type: \"label\"\n  },\n  rule: {\n    fa: '',\n    colName: 'rule',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"string\"\n  },\n  nodeId: {\n    fa: '',\n    colName: 'nodeId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"string\"\n  },\n  subLength: {\n    fa: '',\n    colName: 'subLength',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"string\"\n  },\n  subStart: {\n    fa: '',\n    colName: 'subStart',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"string\"\n  }\n};\nwindow.mappingrulePageRes = {\n  mappingRuleTab: {\n    fa: 'الگوی نگاشت'\n  },\n  autoPlacement: {\n    fa: 'مقصد خودکار'\n  },\n  nodeName: {\n    fa: 'گره'\n  },\n  createMappingRuleCaption: {\n    fa: 'تعریف الگوی نگاشت جدید'\n  },\n  editMappingRuleCaption: {\n    fa: 'ویرایش الگوی نگاشت'\n  },\n  upCaption: {\n    fa: 'افزایش الویت الگوی نگاشت'\n  },\n  downCaption: {\n    fa: 'کاهش الویت الگوی نگاشت'\n  },\n  exportExcelCaption: {\n    fa: 'گزارش اجرای نگاشت'\n  },\n  applyRuleCaption: {\n    fa: 'اجرای الگوی نگاشت'\n  },\n  cancelRuleCaption: {\n    fa: 'لغو الگوی نگاشت'\n  },\n  applyRulesCaption: {\n    fa: 'اجرای الگوهای نگاشت'\n  },\n  cancelRulesCaption: {\n    fa: 'لغو الگوهای نگاشت'\n  },\n  showResult: {\n    fa: 'نمایش نتایج'\n  },\n  addCondition: {\n    fa: 'اضافه'\n  },\n  removeCondition: {\n    fa: 'حذف شرط'\n  },\n  ruleMappingCondition: {\n    fa: 'تجمیع شروط'\n  },\n  invalidCondition: {\n    fa: 'شرط نامعتبر'\n  },\n  deleteCaption: {\n    fa: 'حذف الگوی نگاشت'\n  },\n  deleteListCaption: {\n    fa: 'حذف الگوهای نگاشت'\n  },\n  editCaption: {\n    fa: 'ویرایش الگوی نگاشت'\n  },\n  createCaption: {\n    fa: 'تعریف الگوی نگاشت جدید'\n  },\n  exportRuleExcelCaption: {\n    fa: 'گزارش اجرای نگاشت'\n  },\n  returnToForm: {\n    fa: 'برگشت به فرم'\n  }\n};\nwindow.mappingruledataModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  code: {\n    fa: 'کد',\n    colName: 'code',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"Ascending\",\n    alias: null,\n    size: 10,\n    type: \"string\",\n    popup: true\n  },\n  title: {\n    fa: 'عنوان',\n    colName: 'title',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 20,\n    type: \"string\",\n    popup: true\n  },\n  debtor: {\n    fa: 'مانده بدهکار',\n    colName: 'debtor',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 20,\n    type: \"money\",\n    popup: true\n  },\n  creditor: {\n    fa: 'مانده بستانکار',\n    colName: 'creditor',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 20,\n    type: \"money\",\n    popup: true\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/pages/mapping/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/mapping/viewModel.js":
/*!************************************************!*\
  !*** ./src/scripts/pages/mapping/viewModel.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"MappingViewModel\": () => (/* binding */ MappingViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _master_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/model */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model */ \"./src/scripts/pages/mapping/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n\n\n\n\n__webpack_require__(/*! ./model */ \"./src/scripts/pages/mapping/model.js\");\n\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/mapping/resource.js\");\n\nfunction MappingViewModel() {\n  var self = this;\n  self.stateEffectedMappingForm = ko.observable(false);\n  self.showConfirnForm = ko.observable(false);\n  self.showResultsModal = ko.observable(false);\n  self.resultsModel = ko.observable();\n  self.substituteNodeModel = ko.observable(new _model__WEBPACK_IMPORTED_MODULE_2__.SubstituteNodeViewModel());\n  self.mappingRuleModel = ko.observable();\n  self.mappingSrcModel = ko.observable();\n  self.confirmFormRecord = ko.observable();\n  self.childModel = ko.observable();\n  self.caption = ko.observable();\n  self.captionMappingTree = ko.observable();\n  self.mappingType = ko.observable();\n  self.sheetId = ko.observable();\n  self.treeId = ko.observable();\n  self.activeSide = ko.observable(1);\n  self.isEffected = ko.observable(false);\n  self.isTreeEffected = ko.observable(false);\n  self.filterType = ko.observable(0);\n  self.treeTitle = ko.observable(\"\");\n  self.sheetTitle = ko.observable();\n  self.records = [];\n  self.treeMappingSelectList = ko.observableArray();\n  self.balancesheetSelectList = ko.observableArray();\n  self.filterBalancesheetSelectList = ko.observableArray();\n\n  self.showResults = function () {\n    var selectedRecord = _h.kocnx().formModel();\n\n    var model = new _model__WEBPACK_IMPORTED_MODULE_2__.MappingRuleDataViewModel(selectedRecord);\n    model.treeId(self.treeId());\n    model.balanceSheetId(self.sheetId());\n    model.rule(selectedRecord.rule());\n    model.mappingRuleId(selectedRecord.id());\n    self.resultsModel(model);\n    self.resultsModel().init();\n    self.showResultsModal(true);\n  };\n\n  self.mappingType.subscribe(function (newValue) {\n    if (_h.isNullOrEmpty(newValue)) return;\n    self.getTreeMappingSelectList();\n  });\n  self.sheetId.subscribe(function (newValue) {\n    if (_h.isNullOrEmpty(newValue)) return;\n    ko.utils.arrayFilter(self.balancesheetSelectList(), function (item) {\n      if (newValue === item.value()) self.sheetTitle('( ' + item.text() + ' )');\n    });\n  });\n  self.treeId.subscribe(function (newValue) {\n    if (_h.isNullOrEmpty(newValue)) {\n      self.sheetId(null);\n      return;\n    }\n\n    var target;\n    self.sheetId(null);\n    ko.utils.arrayFilter(self.treeMappingSelectList(), function (item) {\n      if (newValue === item.value()) {\n        self.treeTitle(item.text());\n        target = item;\n      }\n    });\n    self.filterBalancesheetSelectList.removeAll();\n    if (self.balancesheetSelectList().length) for (var i = 0; i < self.balancesheetSelectList().length; i++) {\n      var sheet = self.balancesheetSelectList()[i];\n      if (sheet.currencyType() === target.currencyType()) self.filterBalancesheetSelectList.push(sheet);\n    }\n    self.substituteNodeModel().treeId(newValue);\n  });\n\n  self.onEnterSearchKey = function (d, e) {\n    if (e.keyCode === 13) {\n      self.getRecords(function (res) {});\n    }\n\n    return true;\n  };\n\n  self.getTreeMappingSelectList = function () {\n    var model = {\n      controllerName: 16,\n      mappingType: self.mappingType()\n    };\n    if (!model.mappingType) model.mappingType = 0;\n    self.apiService.request({\n      name: \"getMappingTreeList\",\n      data: model,\n      success: function success(data) {\n        self.treeMappingSelectList.removeAll();\n        if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n          var target = data[j];\n          self.treeMappingSelectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.TreeMapSelect(target));\n        }\n        self.treeId(null);\n      },\n      error: function error() {\n        toast.error(\"Tree\", 'getSelectList');\n      }\n    });\n  };\n\n  self.getBalancesheetSelectList = function (sign) {\n    self.apiService.request({\n      name: \"/api/common/getbalancesheetlist\",\n      data: {\n        controllerName: this.controllerName\n      },\n      success: function success(data) {\n        self.balancesheetSelectList.removeAll();\n        if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n          var target = data[j];\n          self.balancesheetSelectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.TreeMapSelect(target));\n        }\n        if (!sign) self.sheetId(null);\n      },\n      error: function error() {\n        var text = _h.getApiMessage(\"ErrorLoadSelectBalancesheet\");\n\n        _h.failToast(text);\n      }\n    });\n  };\n\n  self.createMappingScope = function () {\n    if (!self.validationObject.isValid()) {\n      self.validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    self.searchKey(undefined);\n\n    if (self.mappingSrcModel()) {\n      self.mappingSrcModel().searchKey(undefined);\n    }\n\n    $(\".createmodel-drop\").removeClass(\"open\");\n\n    switch (self.mappingType()) {\n      case 1:\n        self.mappingSrcModel(null);\n        self.getRecords(function (res) {\n          if (res) {\n            self.onClickleftSideTab();\n          }\n        });\n        break;\n\n      case 2:\n        self.getRecords(function (res) {\n          if (res) {//\n          }\n        });\n        self.mappingRuleModel(null);\n        self.childModel(null);\n        self.substituteNodeModel(new _model__WEBPACK_IMPORTED_MODULE_2__.SubstituteNodeViewModel());\n        var dataModel = new _model__WEBPACK_IMPORTED_MODULE_2__.MappingSrcViewModel();\n        dataModel.treeId(self.treeId());\n        dataModel.treeName(self.treeTitle());\n        self.mappingSrcModel(dataModel);\n        self.mappingSrcModel().init();\n        self.changeCaption();\n        break;\n    }\n  };\n\n  self.validationObject = ko.validatedObservable({\n    mappingType: self.mappingType.extend({\n      required: {\n        params: true,\n        message: \"لطفا نوع نگاشت را انتخاب کنید\"\n      }\n    }),\n    treeId: self.treeId.extend({\n      required: {\n        params: true,\n        message: \"لطفا درخت نگاشت را انتخاب کنید\"\n      }\n    }),\n    sheetId: self.sheetId.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          return self.mappingType() === 1;\n        },\n        message: \"لطفا فایل تراز راانتخاب کنید\"\n      }\n    })\n  });\n\n  self.onClickleftSideTab = function () {\n    var dataModel;\n\n    switch (self.activeSide()) {\n      case 1:\n        self.mappingRuleModel(null);\n        dataModel = new _model__WEBPACK_IMPORTED_MODULE_2__.MappingDataViewModel();\n        dataModel.treeId(self.treeId());\n        dataModel.sheetId(self.sheetId());\n        self.childModel(dataModel);\n        self.childModel().init();\n        self.fixChosenTab();\n        break;\n\n      case 2:\n        if (self.isTreeEffected()) return;\n        self.substituteNodeModel().init();\n        break;\n\n      case 3:\n        dataModel = new _model__WEBPACK_IMPORTED_MODULE_2__.MappingRuleViewModel();\n        dataModel.treeId(self.treeId());\n        dataModel.balanceSheetId(self.sheetId());\n        self.mappingRuleModel(dataModel);\n        self.mappingRuleModel().init();\n        break;\n    }\n\n    self.changeCaption();\n  };\n\n  self.fixChosenTab = function () {\n    if ($(\"#substitutenode-t\").hasClass(\"active\") === true && self.isTreeEffected()) {\n      $('a[href=\"#balancesheetmapping-t\"]').trigger('click');\n    }\n  };\n\n  self.getEffectedModel = function (callback) {\n    self.apiService.request({\n      name: \"getTreeListWithFiles\",\n      success: function success(data) {\n        callback(data);\n      },\n      error: function error() {\n        var text = _h.getApiMessage(\"ErrorLoadMapTreeEffected\");\n\n        _h.failToast(text);\n\n        callback(null);\n      }\n    });\n  };\n\n  self.effectedMappingBtn = function () {\n    self.getEffectedModel(function (resData) {\n      if (resData !== null) {\n        _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.EffectedMappingForm(self, self.balancesheetSelectList(), resData));\n      }\n    });\n  };\n\n  self.updateEffectedMapping = function (parents, btnModel, e) {\n    var item = parents[1];\n    var model = item.toServer();\n    item.showprogressBar(true);\n    item.progressBar(10);\n    self.apiService.request({\n      name: \"postChangeMappingResult\",\n      data: model,\n      success: function success(obj) {\n        if (obj && _h.any(obj.models)) {\n          item.progressBar(40);\n          item.progressBar(100);\n          setTimeout(function () {\n            item.showprogressBar(false);\n            item.mappingResultErrorList.removeAll();\n            $.each(obj.models, function (i, p) {\n              item.mappingResultErrorList.push(new _model__WEBPACK_IMPORTED_MODULE_2__.MappingResultError(p));\n            });\n            item.showSaveBtn(false);\n          }, 500);\n        } else {\n          item.progressBar(40);\n          item.progressBar(100);\n          setTimeout(function () {\n            _h.kocnx().closeForm();\n\n            var text = _h.getApiMessage(\"SuccessPostBothMapping\");\n\n            _h.successToast(text);\n\n            if (!_h.isNullOrEmpty(self.treeId()) && !_h.isNullOrEmpty(self.sheetId())) {\n              self.getRecords(function (res) {});\n            }\n          }, 500);\n        }\n\n        _h.kocnx().advm(null);\n      },\n      error: function error() {}\n    });\n  };\n\n  self.configTools = function () {\n    var tType = self.mappingType() === 2 ? \"MappingDest\" : \"Mapping\";\n    $(\"#tree_view\").treeView({\n      tType: tType,\n      location: tType,\n      nodes: self.records,\n      rootId: self.treeId(),\n      permitPeriodEdit: _h.kocnx().permitPeriodEdit(),\n      isEffected: self.isEffected(),\n      removeItemsFunc: self.removeMapItems,\n      onDropCallback: self.onDropCallback,\n      controllerName: 16,\n      sheetId: self.sheetId(),\n      onClickItem: self.addMapItem,\n      mappingSide: self.mappingType() === 1 ? 0 : 1,\n      mappingType: self.mappingType\n    });\n  };\n\n  self.removeMapItems = function (nodeId, count, type, code, callback) {\n    if (type === \"multi\") {\n      self.deleteItems(nodeId, code, count, function (res, list) {\n        callback(res, list);\n      });\n    } else {\n      self.deleteItems(nodeId, code, 1, function (res, list) {\n        callback(res, list);\n      });\n    }\n  };\n\n  self.deleteItems = function (nodeId, code, count, callback) {\n    var model = {\n      treeId: self.treeId(),\n      balanceSheetId: self.sheetId(),\n      nodeId: nodeId,\n      code: code\n    };\n\n    if (self.mappingType() === 2) {\n      model.showMapped = self.mappingSrcModel().showMapped();\n    }\n\n    self.apiService.request({\n      name: \"delete\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          if (_h.any(data.errors)) {\n            callback(false);\n          } else {\n            var text = _h.getApiMessage(\"MappingDeleteSuccess\");\n\n            text = text.replace(\"__\", count);\n\n            switch (self.mappingType()) {\n              case 1:\n                if (_h.any(data.balanceDataList)) self.childModel().afterDeleteMappingNodes(data.balanceDataList);\n                if (_h.any(data.model)) $(\"#tree_view\").treeView(\"refreshTree\", data.model);\n\n                _h.successToast(text);\n\n                callback(true);\n                break;\n\n              case 2:\n                if (_h.any(data.sourceNodes)) {\n                  $(\"#tree_view_l\").treeView(\"collectOpenBranches\");\n                  $(\"#tree_view_l\").treeView(\"refreshTree\", data.sourceNodes);\n                  $(\"#tree_view_l\").treeView(\"openBranches\");\n                }\n\n                _h.successToast(text);\n\n                callback(nodeId, data.destNodes);\n                break;\n            }\n          }\n        }\n      },\n      error: function error() {\n        var text = _h.getApiMessage(\"MappingDeleteError\");\n\n        _h.failToast(text);\n\n        callback(false);\n      }\n    });\n  };\n\n  self.addMapItem = function (nodeId, opts, nt, callback) {\n    if (self.mappingType() === 1) {\n      if ($(\"#substitutenode-t\").hasClass(\"active\") === false && nt === 2) {\n        if (self.childModel().allSelectedRecords().length === 0) {\n          callback(undefined);\n          return;\n        }\n\n        var codes = self.getSelectedCodes();\n        self.postMapping(nodeId, codes, function (list) {\n          callback(nodeId, list, opts);\n        });\n      }\n\n      if ($(\"#substitutenode-t\").hasClass(\"active\") && nt === 1) {\n        self.substituteNodeModel().refreshFormNodeSelect(target);\n        callback(undefined);\n      }\n    }\n\n    if (self.mappingType() === 2) {\n      var codes = self.getSelectedCodes();\n      self.postMapping(nodeId, codes, function (list) {\n        callback(nodeId, list, opts);\n      });\n    }\n  };\n\n  self.getSelectedCodes = function () {\n    var items = null,\n        item;\n    var array = [];\n\n    if (self.mappingType() === 1) {\n      for (var j = 0; j < self.childModel().allSelectedRecords().length; j++) {\n        var id = self.childModel().allSelectedRecords()[j].id;\n        array.push(id);\n      }\n    } else {\n      items = $(\"#tree_view_l\").treeView(\"selectedItems\");\n      if (items) for (var i = 0; i < items.length; i++) {\n        item = items[i];\n        array.push(item.id + \"\");\n      }\n    }\n\n    return array;\n  };\n\n  self.postMapping = function (targetId, codes, callback) {\n    var model = {\n      treeId: self.treeId(),\n      balanceSheetId: self.sheetId(),\n      nodeId: targetId,\n      codes: codes\n    };\n\n    if (self.mappingType() === 2) {\n      model.showMapped = self.mappingSrcModel().showMapped();\n    }\n\n    self.apiService.request({\n      splashId: \"#treeMap-tre\",\n      name: \"post\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          if (_h.any(data.errors)) {\n            callback(undefined);\n          } else {\n            var text;\n\n            if (self.mappingType() === 1) {\n              text = _h.getApiMessage(\"TreeMapUpdateSuccess\");\n\n              _h.successToast(text);\n\n              self.childModel().clearAllSelectedRecords();\n\n              if (_h.any(data.model)) {\n                self.childModel().refreshTable();\n                callback(data.model);\n              }\n            }\n\n            if (self.mappingType() === 2) {\n              if (_h.any(data.sourceNodes)) {\n                $(\"#tree_view_l\").treeView(\"collectOpenBranches\");\n                $(\"#tree_view_l\").treeView(\"refreshTree\", data.sourceNodes);\n                $(\"#tree_view_l\").treeView(\"openBranches\");\n              }\n\n              if (_h.any(data.destNodes)) {\n                callback(data.destNodes);\n              }\n\n              text = _h.getApiMessage(\"MappingNodeUpdateSuccess\");\n\n              _h.successToast(text);\n            }\n          }\n        }\n      },\n      error: function error() {\n        var text = _h.getApiMessage(\"TreeMapUpdateError\");\n\n        _h.failToast(text);\n\n        callback(undefined);\n      }\n    });\n  };\n\n  self.expandAll = function () {\n    $(\"#tree_view\").treeView(\"expandAll\");\n  };\n\n  self.collapseAll = function () {\n    $(\"#tree_view\").treeView(\"collapseAll\");\n  };\n\n  self.onDropCallback = function (nodeId, opts, callback) {\n    var codes = self.getSelectedCodes();\n    self.postMapping(nodeId, codes, function (list) {\n      callback(nodeId, list, opts);\n    });\n  };\n\n  self.changeCaption = function () {\n    var rTitle = \"\",\n        lTitle = \"\";\n\n    switch (self.mappingType()) {\n      case undefined:\n        self.caption(rTitle);\n        self.childModel().caption(lTitle);\n        break;\n\n      case 1:\n        rTitle = _h.getLocalizedText(\"treeDestinationSide\");\n        self.caption(rTitle);\n        lTitle = self.sheetTitle();\n        self.childModel().caption(lTitle);\n        break;\n\n      case 2:\n        rTitle = \" ( \" + _h.kocnx().currentCompany().pr + \" )\";\n        self.caption(rTitle);\n        lTitle = \" ( \" + _h.kocnx().currentCompany().n + \" )\";\n        self.captionMappingTree(lTitle);\n        break;\n    }\n  };\n\n  self.showFilterItem = function (item) {\n    switch (self.mappingType()) {\n      case 1:\n        return item.type !== 3;\n\n      case 2:\n        return item.type !== 2;\n\n      default:\n        return true;\n    }\n  };\n\n  self.init = function () {\n    var context = _h.kocnx();\n\n    if (context.loginCompanyType() === 0) {\n      self.mappingType(2);\n    } else {\n      self.getBalancesheetSelectList();\n    }\n  };\n\n  self.reInit = function () {\n    self.treeId(null);\n    self.sheetId(null);\n    self.childModel(null);\n    self.treeTitle(\"\");\n    self.sheetTitle(\"\");\n    $(\".dmn-tree\").empty();\n    self.records = [];\n    self.getBalancesheetSelectList();\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"Mapping\",\n    getList: false,\n    apiService: {\n      actionList: [\"filterby\", \"post\", \"delete\", \"gettreelistwithfiles\", \"postchangemappingresult\"]\n    },\n    buttons: [],\n    filters: [],\n    tableStyle: \"font-size: 11px;\",\n    styleRow: \"styleRowValue\",\n    sortDirection: \"Ascending\",\n    sortProperty: \"code\",\n    context: self,\n    searchKeyType: \"enter\",\n    cols: mappingtreeModelRes,\n    selectRow: false,\n    saveState: false,\n    contextMenu: false,\n    isMultiSelectRows: false\n  }));\n\n  self.getRecords = function (callback) {\n    var model = {\n      treeId: self.treeId(),\n      sheetId: self.sheetId(),\n      filterType: self.filterType(),\n      searchKey: self.searchKey()\n    };\n    if (self.mappingType() === 1) model.mappingSide = 0;\n    if (self.mappingType() === 2) model.mappingSide = 1;\n    self.apiService.request({\n      name: \"filterBy\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          self.isEffected(data.isEffected);\n          self.isTreeEffected(data.isTreeEffected);\n          if (_h.any(data.nodes)) self.records = data.nodes;else self.records = [];\n          self.configTools();\n        }\n\n        if (callback) callback(true);\n      },\n      error: function error() {\n        var text = _h.getApiMessage(\"ErrorLoadMapTree\");\n\n        _h.failToast(text);\n\n        if (callback) callback(false);\n      }\n    });\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/mapping/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/master/apiMessages.js":
/*!*************************************************!*\
  !*** ./src/scripts/pages/master/apiMessages.js ***!
  \*************************************************/
/***/ (() => {

eval("window.apiMessages = {\n  FailToLoginToDisabledCompany: {\n    fa: 'امکان ورود به شرکت و دوره مالی منتخب به دلیل غیرفعال بودن شرکت در آن دوره مالی وجود ندارد'\n  },\n  DescriptionIsTooLong: {\n    fa: 'تعداد کاراکترهای توضیحات بیش از حد مجاز است'\n  },\n  RequiredTitle: {\n    fa: 'وارد کردن عنوان الزامی است'\n  },\n  TitleLength: {\n    fa: 'عنوان باید بین 3 تا 100 کاراکتر باشد'\n  },\n  RequiredPeriodId: {\n    fa: 'دوره مالی نامشخص است'\n  },\n  RecordNotFound: {\n    fa: 'رکورد مورد نظر یافت نشد'\n  },\n  LoadPdfEmptyFileError: {\n    fa: 'محتوایی جهت تهیه فایل خروجی وجود ندارد'\n  },\n  PostSaveMagazinePdfError: {\n    fa: 'عملیات ذخیره فایل خروجی در سیستم با خطا مواجه شده است'\n  },\n  SaveFileError: {\n    fa: 'عملیات تولید فایل خروجی در سیستم با خطا مواجه شده است'\n  },\n  RepeatedFolderName: {\n    fa: 'ثبت فولدر با نام تکراری امکان پذیر نمی باشد. نام تکراری : ${name}'\n  },\n  UnableToSaveMoreProfiles: {\n    fa: 'امکان ذخیره تنظیمات جستجوی جدید به دلیل استفاده از حداکثر ظرفیت ذخیره تنظیمات وجود ندارد'\n  },\n  UnacceptableFileContent: {\n    fa: 'محتوای فایل آپلود شده قابل قبول نمی باشد '\n  },\n  UnacceptableFileSize: {\n    fa: 'حجم فایل آپلود شده بیشتر از حجم قابل قبول (${count}) می باشد'\n  },\n  UnacceptableFileName: {\n    fa: 'نام فایل آپلود شده معتبر نیست. نام فایل فقط می تواند شامل حروف، اعداد، خط فاصله و زیرخط باشد'\n  },\n  CantDeleteDefaultTags: {\n    fa: 'برچسب انتخاب شده برای حذف، برچسب پیش فرض تعریف شده توسط سیستم است و قابل حذف نیست '\n  },\n  CantDeleteUsedAdjustmentTag: {\n    fa: 'برچسب مورد نظر در ${count} سند استفاده شده است و قابل حذف نیست. اولین سند یافت شده :${name}  در ${period}'\n  },\n  RequiredFirstName: {\n    fa: 'وارد کردن نام کاربر الزامی است'\n  },\n  PasswordLengthNotCorrect: {\n    fa: 'رمز عبور باید بین 7 تا 20 کاراکتر باشد'\n  },\n  RequiredPassword: {\n    fa: 'وارد کردن رمز عبور الزامی است'\n  },\n  RequiredUserName: {\n    fa: 'وارد کردن نام کاربری الزامی است'\n  },\n  FirstNameMustBePersian: {\n    fa: 'نام باید به زبان فارسی وارد شود'\n  },\n  LastNameMustBePersian: {\n    fa: 'نام خانوادگی باید به زبان فارسی وارد شود'\n  },\n  RequiredLastName: {\n    fa: 'وارد کردن نام خانوادگی الزامی است'\n  },\n  EmailNotValid: {\n    fa: 'فرمت ایمیل صحیح نیست'\n  },\n  PasswordMustBeContainsSuitableLetters: {\n    fa: 'رمز عبور باید شامل حروف انگلیسی، اعداد و علائم باشد.'\n  },\n  UserNameMustBeContainsSuitableLetters: {\n    fa: 'نام کاربری باید شامل حروف انگلیسی، اعداد و علائم باشد.'\n  },\n  LocationMustBePersian: {\n    fa: 'شهر باید به زبان فارسی وارد شود'\n  },\n  MobileNotCorrect: {\n    fa: 'شماره موبایل صحیح نمی باشد.'\n  },\n  FaxLengthNotCorrect: {\n    fa: 'شماره فکس باید حداکثر 20 رقم باشد'\n  },\n  FaxMustBeNumeric: {\n    fa: 'شماره فکس باید عدد باشد'\n  },\n  PhoneMustBeNumeric: {\n    fa: 'شماره تلفن باید عدد باشد'\n  },\n  MobileMustBeNumeric: {\n    fa: 'موبایل باید عدد باشد'\n  },\n  PhoneLengthNotCorrect: {\n    fa: 'شماره تلفن باید حداکثر 15 رقم باشد'\n  },\n  UnacceptablePassword: {\n    fa: 'رمز عبور باید حداقل ${count} و حداکثر 20 کاراکتر و شامل حروف، اعداد و کاراکترهای ویژه باشد'\n  },\n  UnacceptableUserName: {\n    fa: 'نام کاربری وارد شده تکراری می باشد'\n  },\n  FirstNameLengthIssue: {\n    fa: 'نام کاربر باید بین 3 تا 100 کاراکتر باشد'\n  },\n  LastNameLengthIssue: {\n    fa: 'نام خانوادگی کاربر باید بین 3 تا 100 کاراکتر باشد'\n  },\n  UserCantResetHisPassword: {\n    fa: 'برای تغییر رمز کاربری خود لطفا از قسمت پروفایل کاربر اقدام کنید'\n  },\n  PasswordAndConfirmNotSame: {\n    fa: 'مقدار رمز عبور و تایید باید یکسان باشد'\n  },\n  UserCantDisableItself: {\n    fa: 'حذف شرکت /گروه نمی تواند توسط خودش انجام شود'\n  },\n  CurrentPasswordIsNotCorrect: {\n    fa: 'رمز فعلی وارد شده صحیح نیست'\n  },\n  NewPasswordSameAsCurrentPassword: {\n    fa: 'رمز جدید باید با رمز فعلی متفاوت باشد'\n  },\n  UserCantUnlockItSelf: {\n    fa: 'رفع مسدودیت یک حساب کاربری نمیتواند توسط خودش انجام شود'\n  },\n  UserCantBeEditedByAnotherCompany: {\n    fa: 'امکان ویرایش کاربر تنها در شرکتی که کاربر در آن تعریف شده است فراهم است'\n  },\n  NationalIdentityNotCorrect: {\n    fa: 'شناسه ملی گروه/شرکت میتواند حداقل 10 و حداکثر 11 رقم باشد'\n  },\n  RequiredCompanyType: {\n    fa: 'انتخاب نوع گروه/شرکت الزامی است'\n  },\n  RequiredCurrencyType: {\n    fa: 'انتخاب واحد پولی گروه/شرکت الزامی است'\n  },\n  RequiredDateOfAcquisition: {\n    fa: 'وارد کردن تاریخ تحصیل الزامی است'\n  },\n  RequiredNationalIdentity: {\n    fa: 'وارد کردن شناسه ملی گروه/شرکت الزامی است'\n  },\n  RequiredCompanyStateType: {\n    fa: 'تعیین وضعیت فعالیت گروه/شرکت الزامی است'\n  },\n  RequiredCompanyParent: {\n    fa: 'انتخاب والد برای شرکت یا گروه الزامی می باشد'\n  },\n  RootCompanyCantHaveParent: {\n    fa: 'گروه در حال ویرایش ، گروه اصلی است و نمی تواند والد داشته باشد'\n  },\n  CompanyCantBeParentOfItself: {\n    fa: ' گروه نمی تواند والد خودش باشد'\n  },\n  DescendentCompanyCantBeParentOfItsParent: {\n    fa: 'گروه انتخاب شده به عنوان والد ، زیرمجموعه گروه در حال ویرایش است  و نمیتواند به عنوان والد انتخاب شود'\n  },\n  CompanyCantBeDeletedDueToChildren: {\n    fa: 'امکان حذف گروهی که دارای زیرمجموعه است، وجود ندارد'\n  },\n  CompanyCantBeDeletedDueToPeriod: {\n    fa: 'امکان حذف شرکتی که دارای دوره مالی است، وجود ندارد'\n  },\n  CompanyCantBeDeletedDueToBeingMain: {\n    fa: 'شرکت مورد نظر، شرکت اصلی است و امکان حذف ندارد. شرکت اصلی را تغییر داده و مجددا تلاش کنید'\n  },\n  CompanyCantBeDisabledDueToBeingMain: {\n    fa: 'شرکت مورد نظر، شرکت اصلی است و امکان غیرفعال شدن ندارد. شرکت اصلی را تغییر داده و مجددا تلاش کنید'\n  },\n  CompanyCantBeDisabledDueToSubmittedPeriod: {\n    fa: 'امکان غیرفعال کردن شرکت مورد نظر به دلیل داشتن دوره مالی ارسال شده به گروه والد وجود ندارد '\n  },\n  CompanyCantDeleteItself: {\n    fa: 'حذف شرکت /گروه نمی تواند توسط خودش انجام شود'\n  },\n  CompanyCantDisableItself: {\n    fa: 'فعال یا غیر فعال کردن شرکت/گروهی که با آن به برنامه وارد شده اید مجاز نیست'\n  },\n  CompanyCantBeDeletedDueToBeingConsolidated: {\n    fa: 'امکان حذف شرکت مورد نظر به دلیل انتخاب آن به عنوان شرکت مشمول تلفیق در تنظیمات درختواره شرکت ${company} در  ${period} وجود ندارد'\n  },\n  CompanyCantBeDeletedDueToBeingUsed: {\n    fa: 'امکان حذف شرکت مورد نظر به دلیل استفاده از آن در ${item} توسط ${company} در  ${period} وجود ندارد'\n  },\n  UserIsNotAllowedToCreateUserForCompany: {\n    fa: 'شما مجاز به تعریف کاربر برای این گروه/شرکت نمی باشید'\n  },\n  CompanyParentCantBeChangedDueToPeriod: {\n    fa: 'امکان تغییر والد شرکتی که دارای دوره مالی است، وجود ندارد'\n  },\n  CompanyParentCantBeChangedDueToBeingConsolidated: {\n    fa: 'امکان تغییر والد شرکت مورد نظر به دلیل انتخاب آن به عنوان شرکت مشمول تلفیق در تنظیمات درختواره شرکت ${company} در  ${period} وجود ندارد'\n  },\n  CompanyParentCantChangeDutToBeingMain: {\n    fa: 'شرکت مورد نظر در زیرمجموعه والد قبلی ، شرکت اصلی بوده است . قبل از تغییر والد باید ابتدا برای والد قبلی شرکت دیگری را به عنوان شرکت اصلی انتخاب کنید'\n  },\n  MainCompanyCantChangeDueToConsolidation: {\n    fa: 'امکان تغییر شرکت اصلی به دلیل وجود تلفیق در ${period} ${company} وجود ندارد'\n  },\n  CompanyStateTypeCantChangeDueToConsolidation: {\n    fa: 'امکان غیرفعال کردن شرکت به دلیل تلفیق شرکت در  ${period} ${company} وجود ندارد'\n  },\n  RootCompanyStateTypeCantChange: {\n    fa: 'امکان غیرفعال کردن گروه اصلی وجود ندارد'\n  },\n  RequiredAuditState: {\n    fa: 'تعیین وضعیت حسابرسی دوره مالی الزامی است'\n  },\n  RequiredPeriodState: {\n    fa: 'تعیین وضعیت ارائه دوره مالی الزامی است'\n  },\n  RequiredPeriodType: {\n    fa: 'تعیین نوع دوره مالی الزامی است'\n  },\n  RequiredTimeEnd: {\n    fa: 'تعیین تاریخ پایان دوره مالی الزامی است'\n  },\n  RequiredStartDate: {\n    fa: 'تعیین تاریخ شروع دوره مالی الزامی است'\n  },\n  UnacceptableDateGroup: {\n    fa: 'تاریخ پایان دوره مالی نمی تواند قبل از تاریخ شروع دوره باشد'\n  },\n  RequiredGroupPeriod: {\n    fa: 'انتخاب دوره مالی مرجع الزامی است'\n  },\n  UnacceptableDateDistance: {\n    fa: 'فاصله میان تاریخ شروع و پایان دوره نمی تواند بیش از یک سال باشد'\n  },\n  PeriodCantBeClosed: {\n    fa: 'امکان بستن دوره مالی به دلیل وجود مغایرت در اسناد تعدیل وجود ندارد.سندهای دارای مغایرت : ${adjustmentname}'\n  },\n  UncertainPeriodsFound: {\n    fa: 'امکان بستن دوره مالی به دلیل وجود دوره های مالی ارسال شده و تعیین تکلیف نشده، وجود ندارد'\n  },\n  PeriodCantBeSubmitted: {\n    fa: 'دوره مالی باز قابل ارسال نمی باشد'\n  },\n  RequiredMagazineToSubmit: {\n    fa: 'انتخاب یکی از مجلات ذخیره شده دوره مالی جهت ارسال به گروه الزامی است'\n  },\n  PeriodCantBeSubmittedDueToUnmappedNode: {\n    fa: 'نگاشت تعدادی از گره ها در درختواره (های) این دوره مالی انجام نشده است که عبارتند از :${name}'\n  },\n  RejectedPeriodCantBeChanged: {\n    fa: 'امکان تغییر وضعیت دوره مالی بازگشت خورده، توسط کاربر گروه وجود ندارد'\n  },\n  ConsolidatedPeriodCantBeRejected: {\n    fa: 'این دوره مالی در ${name} گروه، مشمول تلفیق شده است و امکان عدم تایید آن وجود ندارد'\n  },\n  SubmittedPeriodCantBeOpen: {\n    fa: 'امکان باز کردن دوره مالی تایید شده در گروه، وجود ندارد'\n  },\n  ComparativeCantForClosedPeriod: {\n    fa: 'امکان تغییر دوره مقایسه ای برای دوره مالی بسته شده، وجود ندارد'\n  },\n  ComparativeCantForDisabledPeriod: {\n    fa: 'امکان تغییر دوره مقایسه ای برای دوره مالی غیرفعال شده، وجود ندارد'\n  },\n  ComparativeCantForArchivedPeriod: {\n    fa: 'امکان تغییر دوره مقایسه ای برای دوره مالی بایگانی شده، وجود ندارد'\n  },\n  SubmittedPeriodDeleteFailed: {\n    fa: 'امکان حذف دوره مالی ارسال شده برای گروه، وجود ندارد'\n  },\n  ReferencedPeriodDeleteFailed: {\n    fa: 'امکان حذف دوره مالی که مرجع دوره های مالی دیگری است وجود ندارد'\n  },\n  SelectedPeriodItemIsNotRemovable: {\n    fa: 'آیتم انتخاب شده قابل حذف نیست'\n  },\n  RequiredMainCompany: {\n    fa: 'پیش از مشمول تلفیق نمودن شرکتهای تابعه، انتخاب یک شرکت به عنوان شرکت اصلی گروه الزامی است'\n  },\n  ConfirmedPeriodDeleteFailed: {\n    fa: 'امکان حذف دوره مالی تایید شده وجود ندارد'\n  },\n  ClosedPeriodDeleteFailed: {\n    fa: 'امکان حذف دوره مالی بسته وجود ندارد'\n  },\n  ClosedPeriodUpdateFailed: {\n    fa: 'امکان ویرایش دوره مالی بسته شده وجود ندارد'\n  },\n  OpenPeriodCantBeArchived: {\n    fa: 'امکان آرشیو دوره مالی باز وجود ندارد'\n  },\n  DependencyNotComplete: {\n    fa: 'ضمایم انتخاب شده دوره مالی برای حذف قابل قبول نمی باشند'\n  },\n  UnableToCopyPeriodDataToItSelf: {\n    fa: 'دوره مالی مبدا و مقصد کپی نمی تواند یکسان باشد'\n  },\n  PeriodAlreadyExists: {\n    fa: 'دوره مالی با این مشخصات قبلا ثبت شده است'\n  },\n  PeriodCantBeDisabledDueToSubmission: {\n    fa: 'امکان غیرفعال کردن دوره مالی ارسال شده به گروه وجود ندارد'\n  },\n  PeriodCantBeArchivedDueToSubmission: {\n    fa: 'امکان بایگانی کردن دوره مالی در انتظار تایید، وجود ندارد'\n  },\n  PeriodCantBeDisabledDueToClosed: {\n    fa: 'امکان غیرفعال کردن دوره مالی بسته شده وجود ندارد'\n  },\n  ComparativePeriodsMax: {\n    fa: 'تعداد دوره های مقایسه ای نمیتواند بیش از 15 باشد'\n  },\n  RepeatedComparativePeriod: {\n    fa: 'دوره ${period} بیش از یک بار به عنوان دوره مقایسه ای انتخاب شده است'\n  },\n  UnorderedComparativePeriodFound: {\n    fa: 'به دلیل عدم انتخاب دوره مقایسه ای ${row} امکان انتخاب دوره های مقایسه ای بعد از آن وجود ندارد '\n  },\n  PeriodsWithUnorderedComparatives: {\n    fa: 'در اثر عملیات انجام شده ، ترتیب دوره های مقایسه ای ${count} دوره نیاز به بازبینی دارد'\n  },\n  RequiredFormTitle: {\n    fa: 'عنوان فرم الزامی است.'\n  },\n  RequiredFormParameterTitle: {\n    fa: 'عنوان پارامتر الزامی است.'\n  },\n  RequiredFormParameterDataType: {\n    fa: 'نوع داده الزامی است.'\n  },\n  RequiredPermissionList: {\n    fa: 'انتخاب حداقل یک مجوز برای سمت الزامی است'\n  },\n  RequiredAccessType: {\n    fa: 'تعیین حوزه دسترسی برای سمت الزامی است'\n  },\n  AccessCantBeDeleted: {\n    fa: 'امکان حذف دسترسی به علت اختصاص داده شدن به کاربران وجود ندارد'\n  },\n  RequiredNodeType: {\n    fa: 'انتخاب نوع گره الزامی است'\n  },\n  RequiredTreeName: {\n    fa: 'انتخاب نام درخت الزامی است'\n  },\n  RequiredTreeType: {\n    fa: 'انتخاب نوع درخت الزامی است'\n  },\n  RequiredAccountType: {\n    fa: 'انتخاب وضع مانده الزامی است'\n  },\n  TreeNameIsIncorrect: {\n    fa: 'نام درخت حداقل باید سه کاراکتر باشد'\n  },\n  RequiredTreeCode: {\n    fa: 'تعداد ارقام کد درخت الزامی است'\n  },\n  RequiredCashFlowCalculation: {\n    fa: 'انتخاب نحوه محاسبه مقدار الزامی است'\n  },\n  PatternNotCorrect: {\n    fa: 'تعداد ارقام کد درختواره باید بین 5 تا 24 باشد'\n  },\n  RequiredPattern: {\n    fa: 'وارد کردن تعداد ارقام کد درختواره الزامی است'\n  },\n  ProblemInGeneratingCode: {\n    fa: 'در تولید کد درختواره مشکلی پیش آمده است'\n  },\n  UnableToChangePatternDueToChildren: {\n    fa: 'امکان ویرایش تعداد ارقام کد به دلیل داشتن زیرمجموعه وجود ندارد'\n  },\n  UnableToChangeCurrencyTypeDueToMapping: {\n    fa: 'امکان ویرایش نوع ارز درختواره به دلیل انجام نگاشت بر روی درخت توسط ${company} در ${period} وجود ندارد '\n  },\n  UnableToChangePatternDueToGeneratingError: {\n    fa: 'امکان ویرایش تعداد ارقام کد به دلیل خطا در تولید کد جدید وجود ندارد'\n  },\n  TreeIsNotExportable: {\n    fa: 'امکان گرفتن خروجی اکسل و یا آپلود اکسل برای این درختواره وجود ندارد'\n  },\n  NoNodeToImport: {\n    fa: 'درختواره مورد نظر برگی جهت مقداردهی ندارد'\n  },\n  NoRelatedNodeToImport: {\n    fa: 'در فایل آپلود شده مقداری برای مقداردهی به گره های درختواره مورد نظر وجود ندارد '\n  },\n  ExcelColumnsNotComplete: {\n    fa: 'محتوای فایل درختواره در سطر${row}یکی از 3 ستون کد، عنوان یا مقدار را ندارد'\n  },\n  NonDigitIsInCode: {\n    fa: 'وجود مقدار غیرعددی در ستون کد مجاز نمی باشد. خطا در سطر${row}'\n  },\n  NonDigitCharacterInValue: {\n    fa: 'وجود مقدار غیرعددی در ستون مقدار برای درختواره عددی مجاز نمی باشد. خطا در سطر${row}'\n  },\n  DecimalNotAllowed: {\n    fa: 'ورود مقدار اعشاری برای گره درختواره مالی مجاز نمی باشد. خطا در سطر ${row}'\n  },\n  TooCharactersInValue: {\n    fa: 'مقدار ارزش  برای گره های غیر عددی حداکثر تا 255 کاراکتر مجاز است. خطا در سطر${row}'\n  },\n  OutOfRangeValue: {\n    fa: 'مقدار وارد شده برای گره درختواره عددی یا مالی در سطر${row}خارج از محدوده مجاز است'\n  },\n  TreeIsExpanded: {\n    fa: 'درختواره مورد نظر در شرکت ${name} توسعه داده شده است'\n  },\n  UnableToChangeToBranchDueToAdjustmentItem: {\n    fa: 'امکان تبدیل برگ ${name} به شاخه به دلیل وجود ${item} بر روی این گره وجود ندارد '\n  },\n  UnableToChangeToBranchDueToMapping: {\n    fa: 'امکان تبدیل برگ ${name} به شاخه به دلیل انجام نگاشت بر روی این گره وجود ندارد'\n  },\n  UnableToChangeToBranchDueToMappingRule: {\n    fa: 'امکان تبدیل برگ ${name} به شاخه به دلیل وجود الگوی نگاشت بر روی این گره وجود ندارد'\n  },\n  UnableToChangeToBranchDueToFormula: {\n    fa: 'امکان تبدیل برگ ${name} به شاخه به دلیل وجود فرمول بر روی این گره وجود ندارد'\n  },\n  UnableToChangeToBranchDueToValue: {\n    fa: 'امکان تبدیل برگ ${name} به شاخه به دلیل وجود مقدار بر روی این گره وجود ندارد'\n  },\n  UnableToChangeToBranchDueToNodeMappingSource: {\n    fa: 'امکان تبدیل برگ ${name} به شاخه به دلیل استفاده در ${item} وجود ندارد'\n  },\n  UnableToChangeToBranchDueToNodeMappingDestination: {\n    fa: 'امکان تبدیل برگ ${name}  به شاخه به دلیل استفاده در ${item} توسط ${company} در ${period} وجود ندارد '\n  },\n  UnableToChangeToBranchDueToConsolidation: {\n    fa: 'امکان تبدیل برگ مشمول تلفیق به شاخه وجود ندارد'\n  },\n  UnableToChangeToLeafDueToChildren: {\n    fa: 'امکان تبدیل شاخه ${name} به برگ به دلیل وجود گره های زیرمجموعه وجود ندارد'\n  },\n  UnableToChangeToLeafDueToConsolidation: {\n    fa: 'امکان تبدیل شاخه مشمول تلفیق به برگ وجود ندارد'\n  },\n  NodeNotFoundInPeriod: {\n    fa: 'گره(های) انتخاب شده در دوره مالی جاری ثبت نشده است '\n  },\n  InvalidFormula: {\n    fa: 'فرمول تعریف شده صحیح نمی باشد'\n  },\n  InvalidFormulaDueToLoop: {\n    fa: 'استفاده از گره ${loopmaker} در فرمول گره ${item} باعث ایجاد تکرار در محاسبات میشود '\n  },\n  InvalidFormulaDueToLoopByParents: {\n    fa: 'یکی از والدین گره مقصد ${item} باعث ایجاد تکرار در محاسبات میشود'\n  },\n  InvalidFormulaDueToLoopByGroupValue: {\n    fa: 'تغییر مقدار گره مقصد  ${item} در گروه جاری باعث ایجاد تکرار در محاسبات میشود '\n  },\n  NodeWithRequestedCodeIsNotExisted: {\n    fa: 'فرمول وارد شده صحیح نیست زیرا گره با کد ${item} در سیستم موجود نمی باشد '\n  },\n  UnableToDeleteOrphanConsolidationNode: {\n    fa: 'امکان حذف گره ${name} وجود ندارد زیرا حذف گره های مشمول تلفیق مرتبط با شرکتهای زیرمجموعه گروه جاری امکان پذیر نیست '\n  },\n  UnableToDeleteOrphanConsolidationNodeInRoot: {\n    fa: 'امکان حذف گره ${name} وجود ندارد زیرا حذف گره های مشمول تلفیق به تنهایی در گروه اصلی امکان پذیر نیست  '\n  },\n  UnableToDeleteBoundConsolidationNode: {\n    fa: 'امکان حذف گره ${name} به دلیل وجود آن در دوره مالی ${period} متعلق به  شرکت ${company} وجود ندارد'\n  },\n  UnableToDeleteNodeDueToDependency: {\n    fa: 'امکان حذف گره ${name} به دلیل استفاده در ${item} توسط ${company} ${period} وجود ندارد'\n  },\n  TreeCantBeDeletedDueToTreeUsage: {\n    fa: 'امکان حذف درخت مورد نظر به دلیل ${item} وجود ندارد '\n  },\n  TreeCantBeDeletedDueToNodesUsage: {\n    fa: 'امکان حذف درخت به دلیل استفاده از گره ${name} در ${item} وجود ندارد'\n  },\n  TreeCantBeDeletedDueToSubPeriodsUsage: {\n    fa: 'امکان حذف درخت به دلیل ${item} در ${period} متعلق به شرکت ${company} وجود ندارد'\n  },\n  UnableTiDeleteSystematicNodes: {\n    fa: 'گره های زیر به دلیل استفاده در سایر بخش های برنامه قابل حذف نیستند. برای دریافت گزارش استفاده از گره ها به بخش درختواره مراجعه کنید:${name}'\n  },\n  ForbiddenAccountTypeChangeDueToFormula: {\n    fa: 'امکان تغییر ماهیت گره ${name} به دلیل استفاده در ${item} وجود ندارد'\n  },\n  ForbiddenCashFlowTypeChangeDueToPeriod: {\n    fa: 'امکان تغییر نحوه محاسبه فرمول به دلیل ایجاد تغییر در  ${period} که بسته یا غیرفعال است وجود ندارد'\n  },\n  ForbiddenCashFlowFormulaChangeDueToPeriod: {\n    fa: 'امکان تغییر فرمول به دلیل ایجاد تغییر در  ${period} که بسته یا غیرفعال است وجود ندارد'\n  },\n  UnknownErrorInNodeDependencies: {\n    fa: 'در عملیات جستجو برای کاربردهای گره خطای ناشناخته ای رخ داده است'\n  },\n  UnableToCutDueToMappingResult: {\n    fa: 'امکان انتقال گره به دلیل وجود اعمال اثر بر روی درختواره وجود ندارد '\n  },\n  UnableToCutDueToConsolidatedPeriod: {\n    fa: 'امکان انتقال گره به دلیل وجود شرکت مشمول تلفیق در دوره مالی جاری وجود ندارد '\n  },\n  UnableToPasteOnOldParent: {\n    fa: 'گره انتخاب شده برای چسباندن گره(ها) باید گرهی غیر از والد فعلی باشد '\n  },\n  UnableToPasteOnLeaf: {\n    fa: 'امکان چسباندن گره های انتخاب شده به یک برگ وجود ندارد'\n  },\n  UnableToCutConsolidationNode: {\n    fa: 'امکان انتقال گره مشمول تلفیق وجود ندارد'\n  },\n  UnableToPasteOnConsolidationNode: {\n    fa: 'امکان چسباندن گره های منتقل شده به گره مشمول تلفیق وجود ندارد'\n  },\n  UnableToCopyToConsolidationNode: {\n    fa: 'امکان چسباندن گره های کپی شده به گره مشمول تلفیق وجود ندارد'\n  },\n  UnableToCopyOrphanConsolidationNode: {\n    fa: 'امکان کپی گره ${name} وجود ندارد زیرا کپی گره های مشمول تلفیق فقط با انتخاب شاخه مشمول تلفیق امکان پذیر است '\n  },\n  UnableToCopyConsolidationNodeWithoutChildren: {\n    fa: 'امکان کپی گره ${name} به دلیل انتخاب نشدن زیرمجموعه کامل آن وجود ندارد. برای کپی شاخه مشمول تلفیق تنها خود شاخه یا شاخه به همراه کل زیرمجموعه هایش باید انتخاب شود '\n  },\n  RepeatedNodeCode: {\n    fa: 'کد وارد شده تکراری است'\n  },\n  OverflowNumeralNodeValue: {\n    fa: 'قسمت صحیح عدد حداکثر میتواند 20 رقم باشد'\n  },\n  UnableToSyncDueToMappingResult: {\n    fa: 'امکان همگام سازی درخت با دوره مرجع ، به دلیل وجود اعمال اثر بر روی درخت وجود ندارد'\n  },\n  UnableToSyncDueToConsolidation: {\n    fa: 'امکان همگام سازی درخت با دوره مرجع ، به دلیل وجود شرکت مشمول تلفیق در دوره مالی جاری وجود ندارد'\n  },\n  UnableToSyncAddDueToMissedParent: {\n    fa: 'امکان افزودن گره ${name} به دلیل نبودن گره والد در دوره مالی جاری وجود ندارد'\n  },\n  UnableToSyncAddDueToRepeatedCode: {\n    fa: 'امکان افزودن گره ${name} به دلیل وجود کد مشابه در دوره مالی جاری وجود ندارد'\n  },\n  UnableToSyncAddDueToOrphanConsolidateNode: {\n    fa: 'امکان افزودن گره مشمول تلفیق ${name} به تنهایی وجود ندارد. برای افزودن گره مورد نظر از قسمت تنظیمات درختواره اقدام کنید'\n  },\n  UnableToSyncDeleteDueToOrphanConsolidateNode: {\n    fa: 'امکان حذف گره مشمول تلفیق ${name} به تنهایی وجود ندارد. برای حذف گره مورد نظر از قسمت تنظیمات درختواره اقدام کنید'\n  },\n  UnableToSyncMoveDueToMissedParent: {\n    fa: 'امکان تغییر والد گره ${name} به دلیل نبودن گره والد جدید در دوره مالی جاری وجود ندارد'\n  },\n  UnableToSyncCodeDueToRepeatedCode: {\n    fa: 'امکان تغییر کد گره ${name} به دلیل وجود کد مشابه در دوره مالی جاری وجود ندارد'\n  },\n  TreeWithSameNameAlreadyExisted: {\n    fa: 'درختی با نام مشابه در حال حاضر در این دوره مالی وجود دارد. لطفا ابتدا نسبت به تغییر نام درخت موجود اقدام فرمایید'\n  },\n  UserDoesNotHavePermissionToAddNode: {\n    fa: 'حساب کاربری شما مجوز لازم برای ثبت گره را ندارد'\n  },\n  UserDoesNotHavePermissionToEditNode: {\n    fa: 'حساب کاربری شما مجوز لازم برای ویرایش گره را ندارد'\n  },\n  UserDoesNotHavePermissionToSetNodeValue: {\n    fa: 'حساب کاربری شما مجوز لازم برای مقداردهی گره را ندارد'\n  },\n  UnableToDeleteCompanyDueToDescendentPeriodUse: {\n    fa: 'امکان حذف شرکتهای ${name} از تنظیمات شاخه مشمول تلفیق به دلیل وجود آنها در تنظیمات دوره مالی ${period}  شرکت ${company} وجود ندارد'\n  },\n  UnableToDeleteConsolidationNodeDueToDependency: {\n    fa: 'امکان حذف گره ${name} به دلیل استفاده در ${item} وجود ندارد'\n  },\n  UnableToCreateNodesDueToCodeGeneratingError: {\n    fa: 'امکان افزودن گره های مشمول تلفیق به درختواره ${name} به دلیل عدم امکان تولید کد جدید وجود ندارد'\n  },\n  UnableToCopyNodesDueToRepeatedCodes: {\n    fa: 'امکان افزودن گره های مشمول تلفیق به درختواره ${name} به دلیل وجود کد تکراری وجود ندارد. کد تکراری یافت شده : ${item}'\n  },\n  UnableToResetDueToNonMappingTreeType: {\n    fa: 'درختواره انتخاب شده ، درختواره از نوع نگاشت نمی باشد '\n  },\n  UnableToResetDueToNonConsolidationBranch: {\n    fa: 'شاخه انتخاب شده ، شاخه مشمول تلفیق نمی باشد '\n  },\n  ShouldSelectSomeCompany: {\n    fa: 'لطفا شرکت(های) مشمول تلفیق مورد نظر برای تهیه گزارش کاربرد را انتخاب نمایید'\n  },\n  UnableToSetBalanceSheetDataInClosedPeriod: {\n    fa: 'امکان ثبت یا ویرایش محتوای فایل تراز در دوره مالی بسته وجود ندارد'\n  },\n  UnableToSetBalanceSheetDataInDisabledPeriod: {\n    fa: 'امکان ثبت یا ویرایش محتوای فایل تراز در دوره مالی غیرفعال وجود ندارد'\n  },\n  UnableToSetBalanceSheetDataInArchivedPeriod: {\n    fa: 'امکان ثبت یا ویرایش محتوای فایل تراز در دوره مالی بایگانی شده وجود ندارد'\n  },\n  MissingBalanceCode: {\n    fa: 'یکی از کدهای تعریف شده فایل تراز در کدهای تراز جدید وجود ندارد. کد یافت شده :  ${item}'\n  },\n  SqlSelectedColumnsNotComplete: {\n    fa: 'تعداد ستونهای موجود در فایل تراز یکی از 4 ستون كد/عنوان/مبلغ بدهكار/ مبلغ بستانکار را ندارد'\n  },\n  SqlSelectedCodeColumnNotAtFirst: {\n    fa: 'اولین ستون این فایل تراز ، ستون کد نیست'\n  },\n  SqlSelectedTitleColumnNotAtSecond: {\n    fa: 'دومین ستون این فایل تراز ، ستون عنوان نیست'\n  },\n  SqlSelectedDebtorColumnNotAtThird: {\n    fa: 'سومین ستون این فایل تراز ، ستون مانده بدهکار نیست'\n  },\n  SqlSelectedCreditorColumnNotAtForth: {\n    fa: 'چهارمین ستون این فایل تراز ، ستون مانده بستانکار نیست'\n  },\n  RepeatedBalanceSheetTitle: {\n    fa: 'نام فایل تراز در دوره مالی جاری باید منحصر بفرد باشد'\n  },\n  FileColumnsNotComplete: {\n    fa: 'محتوای فایل تراز در سطر ${row} یکی از 4 ستون كد/عنوان/مبلغ بدهكار/ مبلغ بستانکار را ندارد'\n  },\n  FileHasNullCodeOrTitle: {\n    fa: ' در یکی از ستونهای کد یا عنوان در سطر ${row}مقدار خالی وجود دارد'\n  },\n  FileHasNullDebtorOrCreditor: {\n    fa: 'در سطر ${row}در یکی از ستونهای بدهکار یا بستانکار مقدار خالی وجود دارد'\n  },\n  FileHasNonAlphanumericCharacter: {\n    fa: 'در سطر ${row} در ستون کد کاراکتر غیرمجاز وجود دارد'\n  },\n  FileCreditorOrDebtorHasAlphabet: {\n    fa: 'در سطر ${row} در یکی از ستونهای بدهکار یا بستانکار مقدار غیرعددی وجود دارد'\n  },\n  FileHasRepeatedCode: {\n    fa: 'در ستون کد مقادیر تکراری وجود دارد'\n  },\n  FileTotalsAreNotEqual: {\n    fa: 'فایل تراز بالانس نمیباشد. اختلاف به میزان ${difference} ریال در ستون ${name}'\n  },\n  FileReadingHasProblem: {\n    fa: 'در خواندن فایل مشکلی پیش آمده است'\n  },\n  BalanceSheetCantBeDeleted: {\n    fa: 'این فایل تراز به دلیل اعمال اثر شدن قابل حذف نمی باشد'\n  },\n  BalanceSheetIsUsedInAdjustment: {\n    fa: 'امکان حذف این فایل تراز به دلیل استفاده در سند ${name} وجود ندارد'\n  },\n  BalanceDataCodesHaveBeenMapped: {\n    fa: 'کدهای انتخاب شده از فایل تراز قبلا نگاشت شده اند'\n  },\n  AccountTypesOfNodeAndDataAreDifferent: {\n    fa: ' ماهیت ${difference} رکورد از مجموع ${count} رکورد انتخاب شده فایل تراز با ماهیت مانده برگ ${name} مغایرت دارد '\n  },\n  InvalidSubstituteNodeDueToAccountType: {\n    fa: 'گره های انتخاب شده به عنوان حساب مقابل باید دارای ماهیت مانده متفاوت باشند'\n  },\n  NodeAlreadyHasSubstitute: {\n    fa: 'گره ${name} در حال حاضر دارای حساب مقابل است'\n  },\n  NodeAlreadyIsSubstitute: {\n    fa: 'گره ${name} در حال حاضر به عنوان حساب مقابل گره دیگری انتخاب شده است'\n  },\n  CurrencyTypeMismatch: {\n    fa: ' درختواره و فایل تراز انتخاب شده دارای نوع ارز یکسان نمی باشند'\n  },\n  NoCodeIsSelectedToMap: {\n    fa: 'کدی جهت نگاشت انتخاب نشده است'\n  },\n  UnableToSetMappingDueTopExpansion: {\n    fa: 'گره انتخاب شده توسعه داده شده است و امکان نگاشت به آن وجود ندارد'\n  },\n  RuleCantBeEmpty: {\n    fa: 'الگوی نگاشت باید حداقل دارای یک شرط باشد'\n  },\n  RuleIsNotAcceptable: {\n    fa: 'در شروط تعریف شده برای الگوی نگاشت مشکلی وجود دارد'\n  },\n  NoUnmappedBalanceDataWasFound: {\n    fa: 'همه کدهای حساب موجود در فایل تراز بر روی درخت نگاشت شده اند و کدی برای نگاشت اتوماتیک وجود ندارد'\n  },\n  RuleRollbackFailedDueToMappingResult: {\n    fa: 'امکان حذف اثر نگاشت های انجام شده بر اساس الگو به دلیل اعمال اثر شدن فایل تراز وجود ندارد'\n  },\n  RuleApplyFailedDueToMappingResult: {\n    fa: 'امکان اجرای نگاشت بر اساس الگو به دلیل اعمال اثر شدن فایل تراز وجود ندارد'\n  },\n  RulesHaveNotBeenApplied: {\n    fa: 'نگاشتی بر اساس الگو(ها)ی انتخاب شده انجام نشده است'\n  },\n  RuleHasBeenAppliedOnSheet: {\n    fa: 'از این الگو در نگاشت فایل تراز ( ${name} ) به درختواره منتخب استفاده شده است'\n  },\n  OneRuleHasBeenApplied: {\n    fa: 'از الگوی شماره ${item} در نگاشت فایل تراز ( ${name} ) به درختواره منتخب استفاده شده است'\n  },\n  NoNodeIsSelectedToMap: {\n    fa: 'گرهی از مبدا برای نگاشت انتخاب نشده است'\n  },\n  MismatchFoundInAutoNodeMapping: {\n    fa: 'امکان نگاشت ${count} عدد برگ درخت مبدا به صورت اتوماتیک وجود نداشت'\n  },\n  MismatchSubstring: {\n    fa: 'جداسازی کد ${item} با مشکل مواجه شد'\n  },\n  NoMatchedBalanceDataForRule: {\n    fa: 'هیچ کد حسابی مطابق با الگوی شماره ${item} یافت نشد '\n  },\n  TreesWithoutMappingResultWereFound: {\n    fa: 'بر روی برخی درختواره های نگاشت ، اعمال اثری انجام نشده است . درختواره های یافت شده : ${name}'\n  },\n  FileNotMappedCompletely: {\n    fa: 'نگاشت فایل تراز به درخت به طور کامل انجام نشده است'\n  },\n  FileIsEffectedOnTree: {\n    fa: 'اعمال اثر قبلا انجام شده است'\n  },\n  FileHasBeenEffected: {\n    fa: 'اعمال اثر با موفقیت انجام شد'\n  },\n  FileHasNotBeenEffected: {\n    fa: 'اعمال اثر صورت نگرفته است'\n  },\n  FileEffectHasBeenCancelled: {\n    fa: 'لغو اعمال اثر فایل انجام شد'\n  },\n  NoMappingChangeIsPossible: {\n    fa: 'فایلی برای اعمال اثر یا لغو اعمال اثر انتخاب نشده است'\n  },\n  EffectedCodeFound: {\n    fa: 'امکان لغو نگاشت به دلیل وجود کد در فایل اعمال اثر شده وجود ندارد. کد و فایل یافت شده : ${sheetdata}'\n  },\n  MappingIsNotCompleteOnTree: {\n    fa: 'نگاشت فایل تراز به درخت ${name} کامل نیست و تعداد ${difference} کد خطای نگاشت نشده دارد'\n  },\n  NoMappingTemplateFound: {\n    fa: 'الگوی نگاشتی برای کد ${item} بر روی درختواره ${name} در سیستم یافت نشد '\n  },\n  RequiredTableTemplateType: {\n    fa: 'نوع قالب جدول را انتخاب کنید'\n  },\n  RequiredTableTemplateAccountType: {\n    fa: 'اولویت ماهیت مانده قالب جدول را انتخاب کنید'\n  },\n  RequiredRowNumber: {\n    fa: 'تعداد سطر پیش فرض را انتخاب کنید'\n  },\n  RequiredColumnNumber: {\n    fa: 'تعداد ستون پیش فرض را انتخاب کنید'\n  },\n  RowNumberOutOfRange: {\n    fa: 'تعداد سطر حداکثر میتواند 100 سطر باشد'\n  },\n  ColumnNumberOutOfRange: {\n    fa: 'تعداد ستون حداکثر میتواند 100 ستون باشد'\n  },\n  CannotChangeDefaultRowColDueToContent: {\n    fa: 'امکان تغییر تعداد سطر و ستون پیش فرض به دلیل وجود محتوا در قالب جدول وجود ندارد'\n  },\n  RequiredTableTemplateId: {\n    fa: 'شناسه قالب جدول مورد نظر دریافت نشد'\n  },\n  RequiredRowsCount: {\n    fa: 'تعداد سطرهای گزارش نامشخص است'\n  },\n  RequiredColumnsCount: {\n    fa: 'تعداد ستون های گزارش نامشخص است'\n  },\n  RowsCantBeEmpty: {\n    fa: 'سطرهای گزارش نامشخص است'\n  },\n  RowNumberCantBeZero: {\n    fa: 'شماره سطر یکی از سلولهای گزارش نامشخص است'\n  },\n  ColumnNumberCantBeZero: {\n    fa: 'شماره ستون یکی از سلولهای گزارش نامشخص است'\n  },\n  CellAddressCantBeEmpty: {\n    fa: 'آدرس یکی از سلولهای گزارش نامشخص است. خطا در سطر ${row}و ستون ${col}'\n  },\n  ColspanMustBeGreaterThenZero: {\n    fa: 'ادغام ستونها در سلول ${celladdress} نامعتبر است'\n  },\n  RowSpanMustBeGreaterThenZero: {\n    fa: 'ادغام سطرها در سلول ${celladdress} نامعتبر است'\n  },\n  BothValueAndTextCantHaveValue: {\n    fa: 'در سلول ${celladdress} گزارش مقدار محاسباتی و متنی همزمان وجود دارد'\n  },\n  InvalidCellValue: {\n    fa: 'فرمت اطلاعات سلول    ${celladdress} صحیح نیست'\n  },\n  NodesInCellMustBeFromSameTree: {\n    fa: 'گره های درختواره واقع شده در سلول  ${celladdress} باید متعلق به یک درخت باشند'\n  },\n  TreeInReportContentMustBeOne: {\n    fa: 'در این نوع قالب جدول فقط استفاده از گره های یک درخت مجاز است . گره های واقع در سلولهای ${celladdress} متعلق به دو درخت متفاوت هستند '\n  },\n  NodesInReportContentMustBeMappingNodes: {\n    fa: 'در این نوع قالب جدول فقط استفاده از گره های درخت نگاشت مجاز است . در سلول ${celladdress} از گره درخت غیرنگاشت استفاده شده است'\n  },\n  NodesInCellMustBeTextualOrNonTextual: {\n    fa: 'در سلول  ${celladdress} گره از درخت متنی و گره از درخت غیرمتنی همزمان وجود دارد'\n  },\n  CellCanContainJustNodes: {\n    fa: 'فرمت اطلاعات سلول ${celladdress} صحیح نیست . در این نوع قالب جدول در گره حاوی سلول نمیتوان عبارت دیگری وارد کرد'\n  },\n  TableColumnsMustBeFromSameTable: {\n    fa: 'فیلذهای جدول موجود در سلولها باید از یک جدول باشند. فیلد موجود در سلول  ${celladdress} از جدول متفاوتی انتخاب شده است'\n  },\n  SumFunctionMustBeOnNumeralColumn: {\n    fa: 'تابع جمع واقع شده در سلول  ${celladdress} صحیح نمی باشد زیرا نوع داده ستون مورد نظر، عددی یا مالی نیست'\n  },\n  GroupSumFunctionNeedsGrouping: {\n    fa: 'تابع جمع گروهی واقع شده در سلول  ${celladdress} صحیح نمی باشد زیرا ستونی برای گروه بندی انتخاب نشده است'\n  },\n  CantHaveMultipleTotalSumInColumn: {\n    fa: 'امکان قرار دادن دو تابع جمع ستونی در یک ستون وجود ندارد. تابع تکراری در سلول  ${celladdress}'\n  },\n  CantHaveMultipleGroupSumInColumn: {\n    fa: 'امکان قرار دادن دو تابع جمع گروهی در یک ستون وجود ندارد. تابع تکراری در سلول  ${celladdress}'\n  },\n  CantHaveGroupAndTotalInSameRow: {\n    fa: 'امکان قرار دادن تابع های جمع گروهی و ستونی در یک سطر وجود ندارد. خطا در سلول  ${celladdress}'\n  },\n  FormulaCantContainCellItself: {\n    fa: 'فرمول وارد شده در سلول  ${celladdress} به دلیل استفاده از آدرس همین سلول نامعتبر است'\n  },\n  InvalidConsolidatedCell: {\n    fa: 'استفاده از آیکن گروه/شرکت در سلول  ${celladdress} در این قالب جدول غیر مجاز است'\n  },\n  InvalidConsolidatedCellInFirstRow: {\n    fa: 'استفاده از آیکن شرکت زیرمجموعه در سلول  ${celladdress} در این قالب جدول غیر مجاز است و باید از آیکن گروه استفاده کرد'\n  },\n  LoopInCellValue: {\n    fa: ' مقدار سلول ${celladdress} به صورت مستقیم یا غیرمستقیم باعث به وجود آمدن محاسبات تکرار شونده میشود'\n  },\n  LoopInLinkedCells: {\n    fa: ' اتصال موجود در سلول ${celladdress} به صورت مستقیم یا غیرمستقیم باعث به وجود آمدن محاسبات تکرار شونده میشود'\n  },\n  DuplicateCellAddressFound: {\n    fa: 'در محتوای ارسال شده سلول تکراری وجود دارد. ستون یافت شده :${name}'\n  },\n  UnacceptableSortRegion: {\n    fa: ' محدوده مرتب سازی  ${item} معتبر نمی باشد. ابتدای محدوده باید کوچکتر از انتهای آن باشد '\n  },\n  ConflictedSortRegions: {\n    fa: 'محدوده های مرتب سازی ${row} و ${item} با هم تداخل دارند'\n  },\n  MergedCellsFoundInSortRegion: {\n    fa: 'محدوده مرتب سازی ${item} به دلیل وجود سلول ادغام شده در آن معتبر نمی باشد'\n  },\n  GreaterSortRegionFound: {\n    fa: 'محدوده مرتب سازی ${item} خارج از محدوده سطرهای قالب جدول می باشد'\n  },\n  TemplateIsUsedInFinancialStatement: {\n    fa: 'از این قالب جدول در مجله ${name} در صفحه ${item} استفاده شده است '\n  },\n  TemplateIsUsedAsReferenceOfLink: {\n    fa: 'از سلولهای این قالب جدول به عنوان مبدا اتصال در قالب های زیر استفاده شده است : ${name}'\n  },\n  UnavailableNodeInPeriod: {\n    fa: ' گره ${name} واقع در سلول ${celladdress} در دوره مالی منتخب سلول وجود ندارد'\n  },\n  NotEqualCellValue: {\n    fa: 'سلول های مورد مقایسه در قالب جدول  ${name} که نابرابر بوده اند عبارتند از : ${item}'\n  },\n  UnableToCompareTextualCells: {\n    fa: 'سلول های ${name} مورد استفاده در مقایسه سلول ها دارای ماهیت متنی بوده و قابل مقایسه نمی باشند'\n  },\n  InvalidCustomReportInfoFormat: {\n    fa: 'فرمت اطلاعات وارد شده برای مورد شماره ${item} لیست اطلاعات صحیح نیست'\n  },\n  InvalidCustomReportInfo: {\n    fa: 'فرمت اطلاعات فایل وارد شده صحیح نمی باشد. '\n  },\n  ExcelCellsFileAreEmpty: {\n    fa: 'فایل وارد شده خالی است '\n  },\n  UserDoesNotHavePermissionToSetTableTemplateDefaultStyle: {\n    fa: 'حساب کاربری شما مجوز لازم برای ویرایش تنظیمات پیش فرض قالب جدول را ندارد'\n  },\n  UserDoesNotHavePermissionToSetTableTemplatePreviewOptions: {\n    fa: 'حساب کاربری شما مجوز لازم برای ویرایش تنظیمات پیش نمایش قالب جدول را ندارد'\n  },\n  TemplateIsLocked: {\n    fa: 'این قالب جدول در حال ویرایش توسط کاربر دیگری می باشد '\n  },\n  TemplateIsNotLocked: {\n    fa: 'این قالب از حالت ویرایش خارج شده است . لطفا مجددا قالب را در حالت ویرایش قرار داده و سپس اقدام به ذخیره تغییرات کنید'\n  },\n  UnableToSaveReportContentDueToLock: {\n    fa: 'در حال حاضر ( ${name} ) در حال ویرایش قالب جدول می باشد به همین دلیل امکان ذخیره تغییرات وجود ندارد'\n  },\n  UnableToDeleteReportTemplateDueToLock: {\n    fa: 'در حال حاضر ( ${name} ) در حال ویرایش قالب جدول می باشد به همین دلیل امکان حذف قالب جدول وجود ندارد'\n  },\n  ReportTemplateContentIsNull: {\n    fa: 'محتوای قالب جدول ${name} خالی می باشد'\n  },\n  ErrorInCalculatingReportTemplate: {\n    fa: 'در پردازش محتوای قالب جدول ${name} خطایی پیش آمده است'\n  },\n  RequiredMagazineTitle: {\n    fa: 'نام مجله را وارد کنید'\n  },\n  IncompatibleComparativeCount: {\n    fa: 'تعداد دوره های مالی مقایسه ای با تعداد دوره های مالی انتخاب شده برای مجله همخوانی ندارد'\n  },\n  RequiredFinancialStatementTrees: {\n    fa: 'درختواره های منتخب مجله در سیستم یافت نشد'\n  },\n  PdfGeneratingUnhandledException: {\n    fa: 'در عملیات تولید پی دی اف خطای ناشناخته ای رخ داده است'\n  },\n  PdfGenerationCanceledDueToCellBindError: {\n    fa: 'امکان تولید پی دی اف به دلیل برقرار نبودن شرط مقایسه سلول بازدارنده وجود ندارد'\n  },\n  NoPageHasBeenSelected: {\n    fa: 'صفحه ای برای دریافت خروجی انتخاب نشده است'\n  },\n  SelectedPagesAreNotInCorrectFormat: {\n    fa: 'فرمت صفحات انتخابی وارد شده صحیح نمی باشد'\n  },\n  InvalidSelectedRangeForPages: {\n    fa: 'فرمت محدوده انتخابی صفحات به شکل ${item} نامعتبر است '\n  },\n  UserDoesNotHavePermissionToSetMagazineDefaultStyle: {\n    fa: 'حساب کاربری شما مجوز لازم برای ویرایش تنظیمات پیش فرض مجله را ندارد'\n  },\n  RequiredAdjustmentCode: {\n    fa: 'وارد کردن شماره سند الزامی است'\n  },\n  RequireBalanceSheetId: {\n    fa: 'انتخاب فایل تراز الزامی است'\n  },\n  RequiredCreatedDate: {\n    fa: 'ورود تاریخ ثبت سند الزامی است'\n  },\n  CreatedDateMustBeInPeriod: {\n    fa: 'تاریخ ثبت سند باید در بازه شروع و پایان دوره مالی باشد'\n  },\n  ConfirmedAdjustmentDeleteFailed: {\n    fa: 'امکان حذف سند تایید شده وجود ندارد'\n  },\n  ConfirmedAdjustmentUpdateFailed: {\n    fa: 'امکان ویرایش سند تایید شده وجود ندارد'\n  },\n  UnableToDisableAdjustmentDueToConfirmation: {\n    fa: 'امکان غیرفعال کردن سند تایید شده وجود ندارد. سند یافت شده : ${item}'\n  },\n  NoAdjustmentToChangeStateType: {\n    fa: 'امکان تغییر وضعیت هیچ یک از سندهای انتخاب شده وجود ندارد'\n  },\n  DisablesAdjustmentUpdateFailed: {\n    fa: 'امکان ویرایش سند غیرفعال وجود ندارد'\n  },\n  IneffectiveAdjustmentUpdateFailed: {\n    fa: 'امکان ویرایش سند بلااثر وجود ندارد'\n  },\n  UnableToEditStateDueToDisabledAdjustment: {\n    fa: 'امکان فعال یا غیرفعال کردن بندهای سند${adjustmentname}  به دلیل غیرفعال بودن سند وجود ندارد '\n  },\n  UnableToEditStateDueToConfirmedAdjustment: {\n    fa: 'امکان فعال یا غیرفعال کردن بندهای سند${adjustmentname} به دلیل تایید شده بودن سند وجود ندارد '\n  },\n  UnableToEditStateDueToIneffectiveAdjustment: {\n    fa: 'امکان فعال یا غیرفعال کردن بندهای سند${adjustmentname} به دلیل بلااثر بودن سند وجود ندارد'\n  },\n  UnableTocChangeStateTypeDueToIneffectiveItem: {\n    fa: 'بند شماره ${item} بلااثر است و امکان فعال یا غیرفعال کردن آن وجود ندارد'\n  },\n  UnableToChangeStateTypeOfBalanceItem: {\n    fa: ' امکان فعال کردن بند با اولویت  ${item}از سند ${name} وجود ندارد. در حال حاضر بند بستن حساب با مشخصات این بند در سند ${adjustmentname} وجود دارد'\n  },\n  CopiedItemsHasBeenRemovedDueToLoop: {\n    fa: 'آیتم(های) با اولویت ${item} به دلیل ایجاد محاسبات تکرارشونده از اسناد کپی شده حذف شدند'\n  },\n  NoAdjustmentToChangeConfirmationState: {\n    fa: 'امکان تغییر وضعیت تایید هیچ یک از سندهای انتخاب شده وجود ندارد'\n  },\n  RequiredAdjustment: {\n    fa: 'شناسه سند تعدیل نامشخص است'\n  },\n  RequiredTreeId: {\n    fa: 'انتخاب درختواره الزامی است'\n  },\n  RequiredNodeId: {\n    fa: 'انتخاب برگ درختواره الزامی است'\n  },\n  AdjustmentItemsCantChange: {\n    fa: 'امکان تغییر بندهای اسناد غیرفعال، تاییدشده یا بلااثر وجود ندارد'\n  },\n  RepetitiveAdjustmentItemCode: {\n    fa: 'شماره وارد شده برای بند سند تکراری است'\n  },\n  UnableToDeleteAdjustmentItemCode: {\n    fa: 'امکان حذف شماره بند سند وجود ندارد. شماره بند سند به صورت خودکار جایگزین شد'\n  },\n  AdjustmentItemsCantBeDeleted: {\n    fa: 'امکان حذف بندهای اسناد تایید شده وجود ندارد'\n  },\n  ThereIsAlreadyOneBalanceAdjustmentItemOnNode: {\n    fa: ' در حال حاضر در این دوره مالی یک بند سند برای بستن حساب روی گره انتخاب شده وجود دارد'\n  },\n  ThereIsAlreadyOneVarianceAdjustmentItemInAdjustment: {\n    fa: 'در حال حاضر یک بند سند بالانس در سند انتخاب شده وجود دارد'\n  },\n  RequiredBaseFormula: {\n    fa: 'وارد کردن فرمول الزامی است'\n  },\n  RequiredLeftSidePhrase: {\n    fa: 'عبارت سمت چپ شرط نمی تواند خالی باشد'\n  },\n  RequiredIfTrueFormula: {\n    fa: 'وارد کردن فرمول در صورت برقراری شرط الزامی است'\n  },\n  RequiredOperator: {\n    fa: 'انتخاب عملگر شرطی الزامی است'\n  },\n  RequiredEmptyRightPhrase: {\n    fa: 'عبارت سمت راست شرط باید خالی باشد'\n  },\n  RequiredRightSidePhrase: {\n    fa: 'عبارت سمت راست شرط نمی تواند خالی باشد'\n  },\n  RequiredIfFalseFormula: {\n    fa: 'وارد کردن فرمول در صورت عدم برقراری شرط الزامی است'\n  },\n  RequiredNoneOperator: {\n    fa: 'انتخاب عملگر شرطی مجاز نیست'\n  },\n  RequiredJustNode: {\n    fa: 'فرمول باید تنها شامل کد یک گره باشد'\n  },\n  ForbiddenCompanyChange: {\n    fa: ' امکان تغییر شرکت وجود ندارد'\n  },\n  ForbiddenTreeChange: {\n    fa: 'امکان تغییر درختواره وجود ندارد'\n  },\n  ForbiddenBalanceSheetChange: {\n    fa: 'امکان تغییر فایل تراز وجود ندارد'\n  },\n  ExpressionIsNotArithmetic: {\n    fa: 'فرمول وارد شده صحیح نمی باشد'\n  },\n  ProblemOccuredInApplyingConsolidation: {\n    fa: 'در عملیات تلفیق دوره(های) مالی خطایی رخ داده است'\n  },\n  ProblemOccuredInRollbackConsolidation: {\n    fa: 'در بازگردانی عملیات تلفیق دوره(های) مالی خطایی رخ داده است'\n  },\n  ConsolidationIsInProgress: {\n    fa: 'اطلاعات دوره مالی در حال بروزرسانی است و اطلاعات نهایی پس از اتمام عملیات تلفیق در حال اجرا، قابل مشاهده است'\n  },\n  ImageUploadFailed: {\n    fa: 'آپلود تصویر انجام نشد'\n  },\n  RequiredTableSchemeName: {\n    fa: 'وارد کردن نام شمای جدول الزامی است'\n  },\n  RequiredTableSchemeField: {\n    fa: 'تعیین ستونهای شمای جدول الزامی است'\n  },\n  RequiredColumnName: {\n    fa: 'عنوان ستون تعریف شده شماره ${item} خالی است '\n  },\n  ColumnNameHasIllegalCharacters: {\n    fa: 'عنوان ستون تعریف شده شماره ${item} دارای کاراکتر غیرقابل قبول است '\n  },\n  ColumnNeedsFormat: {\n    fa: 'تعیین فرمت داده برای ستون تعریف شده شماره ${item} الزامی است '\n  },\n  BoolFormatNotCorrect: {\n    fa: ' فرمت داده ستون تعریف شده شماره ${item} برای نوع داده منطقی صحیح نیست '\n  },\n  DateFormatNotCorrect: {\n    fa: ' فرمت داده ستون تعریف شده شماره ${item} برای نوع داده تاریخ صحیح نیست '\n  },\n  EnumFormatNotCorrect: {\n    fa: ' فرمت داده ستون تعریف شده شماره ${item} برای نوع داده مجموعه صحیح نیست '\n  },\n  EnumKeyValuesAreNotUnique: {\n    fa: ' فرمت داده ستون تعریف شده شماره ${item} برای نوع داده مجموعه دارای مقادیر تکراری می باشد '\n  },\n  MoneyFormatNotCorrect: {\n    fa: ' فرمت داده ستون تعریف شده شماره ${item} برای نوع داده مقدار پولی صحیح نیست '\n  },\n  EditTypeOrFormatAndDeleteFieldNotPossible: {\n    fa: ' امکان حذف یا ویرایش ستون ${item} به دلیل استفاده از آن در روال محاسبه وجود ندارد. نام سند:  ${name}'\n  },\n  DeleteFieldNotPossibleDueToInvalidConditions: {\n    fa: ' امکان حذف ستون ${item} به دلیل استفاده از ستون های همجوار آن در روال محاسبه وجود ندارد. نام سند:  ${name}'\n  },\n  EditTypeOrFormatNotPossible: {\n    fa: 'امکان ویرایش نوع داده و یا فرمت ستونها به دلیل وجود داده در جدول وجود ندارد'\n  },\n  DeletePrimaryFieldsNotPossible: {\n    fa: 'ستون ${name} از نوع ستون های ضروری جدول می باشد و حذف آن امکان پذیر نمی باشد'\n  },\n  UpdatePrimaryFieldsNotPossible: {\n    fa: ' ستون ${name} از نوع ستون های ضروری جدول می باشد و ویرایش نوع داده و یا فرمت داده و یا ایندکس آن امکان پذیر نمی باشد'\n  },\n  AddColumnToAccountRepositoryNotPossible: {\n    fa: 'جدول مورد نظر از نوع جدول کد حساب می باشد و امکان اضافه کردن ستون جدید به آن وجود ندارد'\n  },\n  UndefinedScheme: {\n    fa: 'شمای جدول در سیستم موجود نمی باشد'\n  },\n  SchemeFileShouldHaveAtLeastTwoRows: {\n    fa: 'فایل اکسل شمای جدول باید حداقل 2 سطر نام ستونها و نوع داده آنها را داشته باشد'\n  },\n  SchemeColumnNeedsDataFormat: {\n    fa: 'فایل اکسل شمای جدول در ستون ${col} نیاز به تعریف فرمت داده دارد '\n  },\n  LessDynamicColumns: {\n    fa: 'تعداد ستون های فایل از تعداد ستون های شمای جدول کمتر است'\n  },\n  MoreDynamicColumns: {\n    fa: 'تعداد ستون های فایل از تعداد ستون های شمای جدول بیشتر است'\n  },\n  MoreDynamicColumnsInRow: {\n    fa: 'تعداد ستون های سطر ${row} از تعداد ستون های شمای جدول بیشتر است'\n  },\n  CellDataIsNotInt: {\n    fa: 'داده موجود در سطر ${row} و ستون ${col} با نوع داده عددی مطابقت ندارد'\n  },\n  CellDataIsNotDouble: {\n    fa: 'داده موجود در سطر ${row} و ستون ${col} با نوع داده اعشاری مطابقت ندارد'\n  },\n  CellDataIsNotMoney: {\n    fa: 'داده موجود در سطر ${row} و ستون ${col} با نوع داده مالی مطابقت ندارد'\n  },\n  CellDataIsNotMoneyWithoutDecimals: {\n    fa: 'داده موجود در سطر ${row} و ستون ${col} با فرمت مشخص شده برای نوع داده مالی مطابقت ندارد'\n  },\n  CellDataIsNotDateTime: {\n    fa: 'داده موجود در سطر ${row} و ستون ${col} با فرمت نوع داده تاریخ مطابقت ندارد'\n  },\n  CellDataIsNotMemberOfEnum: {\n    fa: 'داده موجود در سطر ${row} و ستون ${col} با فرمت نوع داده مجموعه مطابقت ندارد'\n  },\n  CellDataIsNotBool: {\n    fa: 'داده موجود در سطر ${row} و ستون ${col} با فرمت نوع داده منطقی مطابقت ندارد'\n  },\n  CellDataIsTooLong: {\n    fa: 'داده موجود در سطر ${row} و ستون ${col} حداکثر می تواند 255 کاراکتر باشد'\n  },\n  UndefinedColumnName: {\n    fa: 'سلول عنوان در سطر ${row} و ستون ${col} خالی است'\n  },\n  RepeatedColumnName: {\n    fa: 'عنوان تکراری در سطر ${row} و ستون ${col} وجود دارد'\n  },\n  UndefinedDataType: {\n    fa: 'نوع داده در سطر ${row} و ستون ${col} نامشخص است'\n  },\n  UnKnownDataType: {\n    fa: 'نوع داده تعیین شده در سطر ${row} و ستون ${col} قابل قبول نیست '\n  },\n  IllegalCharacter: {\n    fa: 'عنوان ذکر شده در سطر ${row} و ستون ${col}دارای کاراکتر غیرمجاز می باشد'\n  },\n  UnAcceptableSignForIndex: {\n    fa: 'کاراکتر وارد شده در سطر ${row} و ستون ${col} غیرمجاز می باشد'\n  },\n  RequiredBoolFormat: {\n    fa: 'فرمت نوع داده منطقی در سطر ${row} و ستون ${col} باید وارد شود '\n  },\n  BoolValuesShouldBeSeparatedByPipe: {\n    fa: 'مقادیر در نظر گرفته شده به عنوان فرمت نوع داده منطقی در سطر ${row} و ستون ${col} باید توسط | از هم جدا شوند'\n  },\n  BoolValuesShouldBeJustTwoItems: {\n    fa: 'فرمت نوع داده منطقی در سطر ${row} و ستون ${col} باید تنها دارای دو آیتم جدا شده توسط | باشد'\n  },\n  BoolItemsFormatNotAcceptable: {\n    fa: 'مقادیر وارد شده برای فرمت نوع داده منطقی  در سطر ${row} و ستون ${col} صحیح نیست '\n  },\n  RequiredEnumFormat: {\n    fa: 'فرمت نوع داده مجموعه در سطر ${row} و ستون ${col} باید وارد شود '\n  },\n  EnumFormatNeedsTwoParts: {\n    fa: 'فرمت نوع داده مجموعه در سطر ${row} و ستون ${col} باید دارای دو لیست کلیدها و مقادیر باشد  '\n  },\n  EnumFormatPartsMustBeInBracket: {\n    fa: 'دو لیست کلیدها و مقادیر در فرمت نوع داده مجموعه در سطر ${row} و ستون ${col} باید به شکل [کلیدها]:[مقادیر] باشد'\n  },\n  EnumKeysAndValuesMustBeEqualInNumbers: {\n    fa: 'دو لیست کلیدها و مقادیر در فرمت نوع داده مجموعه در سطر ${row} و ستون ${col} باید دارای تعداد اعضای برابر باشند  '\n  },\n  EnumValuesShouldBeSeparatedByPipe: {\n    fa: 'کلیدها و مقادیر وارد شده برای نوع داده مجموعه در سطر ${row} و ستون ${col} باید توسط | از هم جدا شوند '\n  },\n  EnumKeysAndValuesMustBeUnique: {\n    fa: 'کلیدها و مقادیر وارد شده برای نوع داده مجموعه در سطر ${row} و ستون ${col} باید دارای مقادیر منحصر به فرد باشند '\n  },\n  EnumsValuesMustBeMoreThanOne: {\n    fa: 'مقدار وارد شده برای نوع داده مجموعه در سطر ${row}و ستون ${col}باید بیش از یک آیتم باشند '\n  },\n  EnumValuesCantBeNullOrEmpty: {\n    fa: 'مقادیر وارد شده برای نوع داده مجموعه در سطر ${row} و ستون ${col} دارای یک آیتم خالی هستند '\n  },\n  EnumValuesFormatNotAcceptable: {\n    fa: 'در میان مقادیر وارد شده برای نوع داده مجموعه در سطر ${row} و ستون ${col} آیتم نامعتبر وجود دارد '\n  },\n  RequiredDateFormat: {\n    fa: 'فرمت نوع داده تاریخ در سطر ${row} و ستون ${col} باید وارد شود '\n  },\n  DateFormatCharactersCountNotCorrect: {\n    fa: 'تعداد کاراکترهای وارد شده برای فرمت تاریخ در سطر ${row} و ستون ${col} برای تاریخ میلادی باید 8 یا 10 و برای تاریخ شمسی 11 یا 13 کاراکتر باشد'\n  },\n  DateFormatHasIllegalCharacters: {\n    fa: 'مقدار وارد شده برای فرمت تاریخ در سطر ${row} و ستون ${col} دارای کاراکتر غیرمجاز می باشد'\n  },\n  DateSeparatorsMustBeTheSame: {\n    fa: 'جداکننده ها برای فرمت تاریخ در سطر ${row} و ستون ${col} باید مشابه هم باشند'\n  },\n  RequiredMoneyFormat: {\n    fa: 'فرمت نوع داده مقدار پولی در سطر ${row} و ستون ${col} باید وارد شود '\n  },\n  MoneyFormatNotAcceptable: {\n    fa: 'مقدار وارد شده برای فرمت نوع داده پولی در سطر ${row} و ستون ${col} صحیح نیست '\n  },\n  UnknownDestinationTable: {\n    fa: 'کد جدول مقصد در فایل موجود نیست'\n  },\n  RepeatedSchemeName: {\n    fa: 'شمای جدولی با نام مشابه هم اکنون در سیستم وجود دارد'\n  },\n  AnotherCodeRepositoryAlreadyExist: {\n    fa: 'در حال حاضر جدول داینامیکی از نوع منبع کدهای حساب در سیستم ثبت شده است'\n  },\n  AnotherApportionmentDocumentTableAlreadyExist: {\n    fa: 'در حال حاضر جدول داینامیکی از نوع جدول شرح اسناد تسهیم در سیستم ثبت شده است'\n  },\n  TooMuchIndexed: {\n    fa: ' حداکثر تعداد ایندکس های قابل تعریف در یک شمای جدول ${count} عدد می باشد '\n  },\n  RepeatedCodeInExpenseCenterTable: {\n    fa: 'وجود کد حساب تکراری در جدول از نوع مرکز هزینه مجاز نمی باشد. کد تکراری : ${name}'\n  },\n  NullCodeInExpenseCenterTable: {\n    fa: 'وجود کد مرکز هزینه خالی در جدول از نوع مرکز هزینه مجاز نمی باشد'\n  },\n  TableCantBeDeletedDueToComputationalDocument: {\n    fa: ' امکان حذف جدول به دلیل استفاده از آن در سند محاسباتی${name} در ${date}  وجود ندارد '\n  },\n  TableCantBeDeletedDueToApportionmentDocument: {\n    fa: ' امکان حذف جدول به دلیل استفاده از آن در سند تسهیم یا انتقال${name} در ${date} وجود ندارد '\n  },\n  TableCantBeDeletedDueToAggregationDocument: {\n    fa: ' امکان حذف جدول به دلیل استفاده از آن در سند تجمیع${name} در ${date}  وجود ندارد '\n  },\n  TableCantBeDeletedDueToColumnDocument: {\n    fa: ' امکان حذف جدول به دلیل استفاده از آن در سند ستونی${name} در ${date}  وجود ندارد '\n  },\n  TableCantBeDeletedDueToDeleteCostDocument: {\n    fa: ' امکان حذف جدول به دلیل استفاده از آن در سند حذف هزینه${name} در ${date}  وجود ندارد '\n  },\n  TableHasBeenUsedForReport: {\n    fa: 'این جدول در قالب جدول ${item} در ${period} استفاده شده است '\n  },\n  TableCantBeArchivedDueToComputationalDocument: {\n    fa: ' امکان بایگانی کردن جدول به دلیل استفاده از آن در سند محاسباتی سطری${name}  وجود ندارد '\n  },\n  TableCantBeArchivedDueToApportionmentDocument: {\n    fa: ' امکان بایگانی کردن جدول به دلیل استفاده از آن در سند تسهیم یا نتقال${name}  وجود ندارد '\n  },\n  TableCantBeArchivedDueToAggregationDocument: {\n    fa: ' امکان بایگانی کردن جدول به دلیل استفاده از آن در سند تجمیع${name}  وجود ندارد '\n  },\n  TableCantBeArchivedDueToColumnDocument: {\n    fa: ' امکان بایگانی کردن جدول به دلیل استفاده از آن در سند ستونی ${name}  وجود ندارد '\n  },\n  TableCantBeArchivedDueToDeleteCostDocument: {\n    fa: ' امکان بایگانی کردن جدول به دلیل استفاده از آن در سند حذف هزینه ${name}  وجود ندارد '\n  },\n  TableCantBeArchivedDueToConnection: {\n    fa: ' امکان بایگانی کردن جدول به دلیل استفاده از آن در ارتباط دریافت داده ${name}  وجود ندارد '\n  },\n  NoActiveDocumentToCalculate: {\n    fa: 'هیچکدام از اسناد انتخاب شده برای محاسبه، فعال نیستند'\n  },\n  ForbiddenAccountRepositoryCopy: {\n    fa: 'امکان کپی جدول از نوع جدول کدهای حساب وجود ندارد'\n  },\n  CopyTableDataFailed: {\n    fa: 'عملیات کپی داده جدول با خطا متوقف شد'\n  },\n  TableHasMoreThanAcceptedRowsCount: {\n    fa: 'تعداد رکوردهای جدول در دوره مالی جاری بیش از تعداد مجاز برای تهیه گزارش است'\n  },\n  RepeatedCodeFound: {\n    fa: 'شماره سند وارد شده تکراری می باشد'\n  },\n  RequiredDynamicDocumentType: {\n    fa: 'تعیین نوع روال محاسبه الزامی است'\n  },\n  RequiredDynamicDocumentProperties: {\n    fa: 'اطلاعات لازم جهت ثبت روال محاسبه یافت نشد'\n  },\n  RequiredDocumentEffectiveDate: {\n    fa: 'تعیین تاریخ موثر برای اسناد تسهیم و انتقال الزامی است'\n  },\n  RequiredDocumentSourceTable: {\n    fa: 'تعیین جدول مبدا برای اسناد تسهیم و انتقال الزامی است'\n  },\n  RequiredDocumentDestinationTable: {\n    fa: 'تعیین جدول مقصد برای اسناد تسهیم و انتقال الزامی است'\n  },\n  RequiredDocumentExpenseTable: {\n    fa: 'تعیین جدول مرکز هزینه برای اسناد تسهیم الزامی است'\n  },\n  RequiredColumnTreeId: {\n    fa: 'تعیین درختواره برای اسناد ستونی الزامی است'\n  },\n  NoMappingOnSelectedNode: {\n    fa: 'نگاشتی بر روی گره های منتخب و زیرمجموعه های آن ها انجام نشده است '\n  },\n  AccountCodeRepositoryNotFound: {\n    fa: 'جدول کد حساب در سیستم یافت نشد'\n  },\n  AccountCodeNotFoundInRepository: {\n    fa: 'کد حساب مقصد وارد شده ( ${name}) در جدول کدهای حساب موجود نمی باشد'\n  },\n  DestinationAccountCodeConditionMismatch: {\n    fa: 'مقدار وارد شده در سطر ${item} از کدهای حساب مقصد، از نظر نوع و یا فرمت داده قابل مقایسه با مقادیر ستون مرجع منتخب نمی باشد'\n  },\n  AutomatedColumnCantBeInitialized: {\n    fa: 'ستون هایی که به صورت خودکار مقداردهی می شوند باید از لیست مقداردهی سایر ستون ها حذف شوند. ستون های مورد نظر : ${col}'\n  },\n  DocumentConditionNotCorrect: {\n    fa: 'در شروط ثبت شده برای سند مشکلی وجود دارد. خطا در شروط ${name}'\n  },\n  DocumentConditionAggregationNotCorrect: {\n    fa: 'در تجمیع شروط ثبت شده برای سند مشکلی وجود دارد. خطا در تجمیع شروط ${name}'\n  },\n  LeftSideColumnNotFound: {\n    fa: 'ستون انتخاب شده در عبارت اول شرط یافت نشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightSideFormatNotCorrect: {\n    fa: 'فرمت عبارت دوم شرط صحیح نمی باشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightSidePhraseIsNotValidPattern: {\n    fa: 'الگوی وارد شده در عبارت دوم شرط معتبر نمی باشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  ConditionOperatorNotMatchWithLeftSide: {\n    fa: 'عملگر شرطی انتخاب شده، قابل اعمال بر روی ستون جدول منتخب برای شرط نمی باشد. خطا در شرط شماره  ${set} از شروط ${name}'\n  },\n  ConditionRightSideNotMatchWithLeftSide: {\n    fa: 'عبارت های دو سمت شرط قابل مقایسه با هم نیستند. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightColumnTypeNotMatchWithLeftColumnType: {\n    fa: 'نوع داده ستون های جدول منتخب در دو سمت شرط قابل مقایسه نیست. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightSideColumnNotFound: {\n    fa: 'ستون انتخاب شده در عبارت دوم شرط یافت نشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightSideDateNotMatchWithLeftSidePersianDate: {\n    fa: 'تاریخ وارد شده در عبارت دوم شرط باید مطابق با نوع تاریخ ستون جدول منتخب در عبارت اول (شمسی) باشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightSideDateNotMatchWithLeftSideGregorianDate: {\n    fa: 'تاریخ وارد شده در عبارت دوم شرط باید مطابق با نوع تاریخ ستون جدول منتخب در عبارت اول (میلادی) باشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightSideValueMustBeInt: {\n    fa: 'مقدار وارد شده در سمت راست شرط باید عدد صحیح باشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightSideFormulaIsInvalid: {\n    fa: 'فرمول وارد شده در سمت راست شرط صحیح نمی باشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightSideValueMustBeNumber: {\n    fa: 'مقدار وارد شده در سمت راست شرط باید عدد صحیح یا اعشاری باشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightSideValueMustBePrice: {\n    fa: 'مقدار وارد شده در سمت راست شرط باید مقدار مالی و مطابق فرمت باشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightSideValueMustBePersianDate: {\n    fa: 'مقدار وارد شده در سمت راست شرط باید تاریخ شمسی باشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightSideValueMustBeGregorianDate: {\n    fa: 'مقدار وارد شده در سمت راست شرط باید تاریخ میلادی باشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightValueMustBeCompatibleWithBoolFormat: {\n    fa: 'مقدار وارد شده در سمت راست شرط باید مطابق فرمت داده ستون ( ${format} ) باشد. خطا در شرط ${set} از شروط ${name}'\n  },\n  RightListItemHasIllegalCharacters: {\n    fa: 'آیتم شماره ${item} در لیست عبارت دوم شرط دارای کاراکتر غیرمجاز است. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightSideItemMustBeInteger: {\n    fa: 'آیتم شماره ${item}در لیست عبارت دوم شرط باید عدد صحیح باشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightSideItemMustBeNumber: {\n    fa: 'آیتم شماره ${item}در لیست عبارت دوم شرط باید عدد صحیح یا اعشاری باشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightSideItemMustBePrice: {\n    fa: 'آیتم شماره ${item}در لیست عبارت دوم شرط باید مقدار مالی باشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightListItemMustBePersianDate: {\n    fa: 'آیتم شماره ${item}در لیست عبارت دوم شرط باید تاریخ شمسی معتبر باشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  RightListItemMustBeGregorianDate: {\n    fa: 'آیتم شماره ${item}در لیست عبارت دوم شرط باید تاریخ میلادی معتبر باشد. خطا در شرط شماره ${set} از شروط ${name}'\n  },\n  AssignedColumnsToIncompatibleType: {\n    fa: 'خطا در مقداردهی ستون ${name} . نوع داده ستونهای انتخاب شده باید برابر با نوع داده ستون مورد نظر باشد'\n  },\n  AssignedColumnsToIncompatibleFormat: {\n    fa: 'خطا در مقداردهی ستون ${name} . فرمت داده ستونهای مالی انتخاب شده باید برابر با فرمت داده ستون مالی مورد نظر باشد'\n  },\n  AssignedValueMustBeInt: {\n    fa: ' در قسمت مقداردهی ستونهای مقصد، مقدار منتسب به ستون${col} باید عدد صحیح باشد '\n  },\n  AssignedValueIsTooLong: {\n    fa: ' در قسمت مقداردهی ستونهای مقصد، مقدار منتسب به ستون${col} طولانی تر از حد مجاز است '\n  },\n  AssignedValueMustBeDouble: {\n    fa: ' در قسمت مقداردهی ستونهای مقصد، مقدار منتسب به ستون${col} باید عدد اعشاری باشد '\n  },\n  AssignedValueMustBePrice: {\n    fa: ' در قسمت مقداردهی ستونهای مقصد، مقدار منتسب به ستون${col} باید مقدار مالی باشد '\n  },\n  AssignedValueMustBePriceWithoutDecimal: {\n    fa: ' در قسمت مقداردهی ستونهای مقصد، مقدار منتسب به ستون${col} باید مقدار مالی بدون اعشار باشد '\n  },\n  AssignedValueMustBeCompatibleWithFormat: {\n    fa: ' در قسمت مقداردهی ستونهای مقصد، مقدار منتسب به ستون${col} باید مطابق یکی از مقادیر مشخص شده در فرمت ستون ( ${format} ) باشد'\n  },\n  AssignedValueMustBePersianDate: {\n    fa: ' در قسمت مقداردهی ستونهای مقصد، مقدار منتسب به ستون${col} باید تاریخ شمسی باشد '\n  },\n  AssignedValueMustBeGregorianDate: {\n    fa: ' در قسمت مقداردهی ستونهای مقصد، مقدار منتسب به ستون${col} باید تاریخ میلادی باشد '\n  },\n  InputDateNotCompatibleWithFormat: {\n    fa: ' در قسمت مقداردهی ستونهای مقصد، فرمت مقدار منتسب به ستون${col} باید مطابق فرمت تعریف شده برای ستون (${format}) باشد '\n  },\n  AssignedFieldFormatMisMatch: {\n    fa: ' در قسمت مقداردهی ستونهای مقصد، فرمت ستون ${col} از جدول مقصد با ستون منتخب برای مقداردهی تفاوت دارد '\n  },\n  AssignedFieldFormatMustBePersianDate: {\n    fa: '  در قسمت مقداردهی ستونهای مقصد، فرمت ستون منتخب برای مقدارهی ستون${col} باید تاریخ شمسی باشد '\n  },\n  AssignedFieldFormatMustBeGregorianDate: {\n    fa: '  در قسمت مقداردهی ستونهای مقصد، فرمت ستون منتخب برای مقدارهی ستون${col} باید تاریخ میلادی باشد '\n  },\n  SubstringOfDestinationKeyIsInvalid: {\n    fa: 'امکان استفاده از تابع جداسازی رشته برای ستون  منتخب به عنوان کلید مقصد وجود ندارد. خطا در مقداردهی ستون ${name}'\n  },\n  CancelCalculationNoApportionDocumentTableFound: {\n    fa: 'توقف اجرای سند ${name}. خطا : جدول شرح تسهیم در سیستم یافت نشد'\n  },\n  CancelCalculationNoDestinationTableFound: {\n    fa: 'توقف اجرای سند ${name}. خطا : جدول مقصد در سیستم یافت نشد'\n  },\n  CancelCalculationNoCalculationTable: {\n    fa: 'توقف اجرای سند ${name}. خطا : جدول محاسبات در سیستم یافت نشد'\n  },\n  CancelCalculationNoSourceTable: {\n    fa: 'توقف اجرای سند ${name}. خطا : جدول مبدا در سیستم یافت نشد'\n  },\n  CancelCalculationNoMappedCode: {\n    fa: 'توقف اجرای سند ${name}. خطا : نگاشتی در زیرمجموعه گره های منتخب سند یافت نشد'\n  },\n  CancelCalculationNoSourceRecord: {\n    fa: 'توقف اجرای سند ${name}. خطا : رکوردی از جدول مبدا برای محاسبه وجود ندارد'\n  },\n  CancelCalculationNoExpenseTable: {\n    fa: 'توقف اجرای سند ${name}. خطا : جدول مرکز هزینه در سیستم یافت نشد'\n  },\n  CancelCalculationMoreThanOneRecordForTransferor: {\n    fa: 'توقف اجرای سند ${name}. خطا : به ازای هر رکورد جدول مبدا بیش از یک رکورد مرکز هزینه موجود است'\n  },\n  CancelCalculationLessThanOneRecordForTransferor: {\n    fa: 'توقف اجرای سند ${name}. خطا : به ازای هر رکورد جدول مبدا  یک رکورد مرکز هزینه موجود نیست'\n  },\n  CancelCalculationNoRowsGenerated: {\n    fa: 'توقف اجرای سند ${name} خطا : هیچ رکوردی در اثر اجرای سند تولید نشد'\n  },\n  CancelCalculationFatalError: {\n    fa: 'توقف اجرای سند ${name} خطا : اجرای سند با خطا مواجه شد'\n  },\n  DocumentWillGenerateUnacceptableRecords: {\n    fa: 'توقف اجرای سند ${name} خطا : تعداد رکوردهای خروجی این سند از تعداد مجاز بیشتر می باشد'\n  },\n  CancelCalculationDueToSaveError: {\n    fa: 'توقف اجرای سند ${name} خطا : ذخیره رکوردهای ایجاد شده با خطا مواجه شد'\n  },\n  CancelCalculationDueToUpdateError: {\n    fa: 'توقف اجرای سند ${name} خطا : مقداردهی رکوردهای مقصد با خطا مواجه شد'\n  },\n  CancelCalculationDueToCalculationError: {\n    fa: 'توقف اجرای سند ${name} خطا : محاسبه رکوردهای مقصد با خطا مواجه شد'\n  },\n  CancelCalculationDueToConvertError: {\n    fa: 'توقف اجرای سند ${name} خطا : مقدار منتسب به ستون ${col} دارای فرمت مناسب نمی باشد'\n  },\n  CalculationUnhandledError: {\n    fa: 'در اجرای اسناد خطای ناشناخته ای رخ داده است'\n  },\n  RequiredSourceTable: {\n    fa: 'انتخاب جدول مبدا الزامی است'\n  },\n  RequiredDestinationTable: {\n    fa: 'انتخاب جدول مقصد الزامی است'\n  },\n  RequiredCalculationValue: {\n    fa: 'تعیین روش مقداردهی باید حداقل برای یکی از ستونهای مقصد انجام شود'\n  },\n  RequiredSourceFormulas: {\n    fa: 'مقداردهی باید حداقل برای یکی از ستونهای جدول مبدا انجام شود'\n  },\n  RequiredDestNodeValue: {\n    fa: 'مقداردهی باید حداقل برای یکی از برگهای درخت منتخب سند انجام شود'\n  },\n  RequiredDestinationCondition: {\n    fa: 'برای سند تجمیع با نوع عملیات مقداردهی، تعریف حداقل یک شرط بر روی جدول مقصد الزامی است'\n  },\n  RequiredConnectionType: {\n    fa: 'وارد کردن نوع اتصال الزامی است'\n  },\n  RequiredConnectionString: {\n    fa: 'وارد کردن رشته اتصال برای این نوع اتصال الزامی است'\n  },\n  RequiredQuery: {\n    fa: 'وارد کردن کوئری برای این نوع اتصال الزامی است'\n  },\n  RequiredModuleName: {\n    fa: 'وارد کردن نام فایل اجرایی الزامی است'\n  },\n  ParameterFileTypeIsNotAcceptable: {\n    fa: 'نوع فایل وارد شده برای پارامتر ${item} قابل قبول نمی باشد '\n  },\n  ThereIsARunningInstanceOfConnection: {\n    fa: 'یک نسخه از این ارتباط توسط کاربر جاری در حال اجرا می باشد. پس از پایان اجرای موجود مجددا تلاش کنید '\n  },\n  ProblemOccuredInRunningConnection: {\n    fa: 'در مراحل اجرای مدیریت ارتباط خطایی رخ داده است'\n  },\n  JustRootCompanyCanManipulateForms: {\n    fa: 'فقط گروه اصلی امکان ثبت، ویرایش و حذف فرم ها را دارد'\n  },\n  ProblemOccurredInSavingForm: {\n    fa: 'در ذخیره فرم مشکلی پیش امده است'\n  },\n  FormWithSimilarNameAlreadyExists: {\n    fa: 'فرمی با نا مشابه قبلا تعریف شده است'\n  },\n  UnableToDeleteFormDueToData: {\n    fa: 'امکان حذف فرم به دلیل وجود اطلاعات شرکتها وجود ندارد'\n  },\n  InvalidValueForField: {\n    fa: 'مقدار وارد شده برای فیلد ${name} قابل قبول نیست'\n  },\n  NoValueForRequiredField: {\n    fa: 'ورود مقدار برای فیلد ${name} الزامی است'\n  },\n  UnableToUpdateFieldDueToData: {\n    fa: 'امکان حذف یا ویرایش نوع داده فیلد فرم به دلیل وجود اطلاعات شرکتها وجود ندارد'\n  },\n  UnableToUpdateOrDeleteArchivedForm: {\n    fa: 'امکان حذف یا ویرایش فرم بایگانی شده وجود ندارد '\n  },\n  IpIsNotValid: {\n    fa: 'فرمت وارد شده برای ${item} قابل قبول نیست'\n  },\n  InvalidValueForSecurityItem: {\n    fa: 'مقدار وارد شده برای ${item} قابل قبول نیست'\n  },\n  IISWillRestartShortly: {\n    fa: 'به دلیل تغییرات صورت گرفته برنامه راه اندازی مجدد و تمامی کاربران حاضر در سیستم لاگ اوت خواهند شد'\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/pages/master/apiMessages.js?");

/***/ }),

/***/ "./src/scripts/pages/master/baseModels.js":
/*!************************************************!*\
  !*** ./src/scripts/pages/master/baseModels.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"BaseFormModel\": () => (/* binding */ BaseFormModel),\n/* harmony export */   \"BaseInfoModel\": () => (/* binding */ BaseInfoModel),\n/* harmony export */   \"BaseInnerModel\": () => (/* binding */ BaseInnerModel),\n/* harmony export */   \"BaseModel\": () => (/* binding */ BaseModel),\n/* harmony export */   \"BaseSecondaryForm\": () => (/* binding */ BaseSecondaryForm),\n/* harmony export */   \"FormBuilder\": () => (/* binding */ FormBuilder)\n/* harmony export */ });\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var _autoMapper = __webpack_require__(/*! ./src/scripts/util/autoMapper.js */ \"./src/scripts/util/autoMapper.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\n__webpack_require__(/*! ../../util/bindingHandlers.js */ \"./src/scripts/util/bindingHandlers.js\");\n\nvar FormBuilder = /*#__PURE__*/function () {\n  function FormBuilder() {\n    _classCallCheck(this, FormBuilder);\n\n    this.showCancel = ko.observable(true);\n    this.formControls = ko.observableArray();\n    this.formButtons = ko.observableArray();\n    this.hideBodyForm = ko.observable(false);\n  }\n\n  _createClass(FormBuilder, [{\n    key: \"toggleHideBodyForm\",\n    value: function toggleHideBodyForm() {\n      this.hideBodyForm(!this.hideBodyForm());\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      var data = ko.toJS(this);\n      delete data[\"validationObject\"];\n      delete data[\"formButtons\"];\n      delete data[\"formControls\"];\n      delete data[\"parentVM\"];\n      delete data[\"editMode\"];\n      delete data[\"ad\"];\n      delete data[\"selected\"];\n      delete data[\"ruleModel\"];\n      return data;\n    }\n  }, {\n    key: \"propName\",\n    value: function propName(value) {\n      var se = this;\n\n      for (var i in se) {\n        if (se[i] === value) {\n          return i;\n        }\n      }\n\n      return false;\n    }\n  }, {\n    key: \"createLine\",\n    value: function createLine(property1, property2) {\n      var vis = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n      var t = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n      var b = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;\n      var className = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : undefined;\n      var row = {};\n\n      if (property1.t === \"tm\") {\n        row = {\n          name: property1.templateName,\n          data: this,\n          vis: true\n        };\n      } else {\n        row = {\n          name: 'row-form-t',\n          data: {\n            className: className,\n            items: [{\n              t: property1.t,\n              name: this.propName(property1.val),\n              val: property1.val,\n              click: property1[\"click\"] ? property1[\"click\"] : null,\n              type: property1[\"type\"] ? property1[\"type\"] : 'text',\n              hlp: property1[\"hlp\"] ? property1[\"hlp\"] : undefined\n            }],\n            t: t,\n            b: b,\n            vis: vis\n          }\n        };\n      }\n\n      switch (property1.t) {\n        case \"txb\":\n          row.data.items[0].dis = property1[\"dis\"] ? property1[\"dis\"] : false;\n          break;\n\n        case \"tsp\":\n          row.data.items[0].min = property1.min;\n          row.data.items[0].max = property1.max;\n          row.data.items[0].dis = property1[\"dis\"] ? property1[\"dis\"] : false;\n          break;\n\n        case \"rdo\":\n          row.data.items[0].list = property1.list;\n          row.data.items[0].className = property1[\"className\"] ? \"radio radio-inline \" + property1[\"className\"] : \"radio radio-success radio-inline\";\n          break;\n\n        case \"txf\":\n          row.data.items[0].dis = property1[\"dis\"] ? property1[\"dis\"] : false;\n          break;\n\n        case \"slcfm\":\n          row.data.items[0].comName = 'ko-formulamaker';\n          row.data.items[0].params = {\n            parent: this,\n            name: this.propName(property1.val),\n            disable: property1[\"dis\"] ? property1[\"dis\"] : false,\n            value: property1.val,\n            controllerName: this.parentVM.controllerName\n          };\n          break;\n\n        case \"slcn\":\n          row.data.items[0].comName = 'ko-nodeselect';\n          row.data.items[0].params = {\n            type: property1[\"slcType\"] ? property1[\"slcType\"] : '',\n            parent: this,\n            name: this.propName(property1.val),\n            disable: property1[\"dis\"] ? property1[\"dis\"] : false,\n            value: property1.val,\n            valName: property1.valName,\n            controllerName: this.parentVM.controllerName,\n            treeId: property1.treeId,\n            values: property1[\"slcType\"] ? property1.values : null,\n            branchSelectable: property1.branchSelectable,\n            location: property1.location\n          };\n          break;\n\n        case \"slc\":\n          row.data.items[0].comName = 'ko-select';\n          row.data.items[0].params = {\n            options: property1.options,\n            parent: this,\n            controllerName: this.parentVM.controllerName,\n            renderFunc: property1[\"renderFunc\"] ? property1[\"renderFunc\"] : '',\n            disable: property1[\"dis\"] ? property1[\"dis\"] : false,\n            name: this.propName(property1.val),\n            value: property1.val,\n            tagManager: property1[\"tagManager\"] ? property1[\"tagManager\"] : null,\n            values: property1[\"slcType\"] ? property1.val : null,\n            type: property1[\"slcType\"] ? property1[\"slcType\"] : '',\n            refreshFunc: property1[\"refreshFunc\"] ? property1[\"refreshFunc\"] : undefined\n          };\n          break;\n\n        case \"dpk\":\n          row.data.items[0].comName = 'ko-datepicker';\n          row.data.items[0].params = {\n            dateType: property1.dateType,\n            parent: this,\n            disable: property1[\"dis\"] ? property1[\"dis\"] : false,\n            name: this.propName(property1.val),\n            value: property1.val\n          };\n          break;\n      }\n\n      if (property2) {\n        row.data.items[1] = {\n          t: property2.t,\n          name: this.propName(property2.val),\n          val: property2.val,\n          type: property2[\"type\"] ? property2[\"type\"] : 'text'\n        };\n\n        switch (property2.t) {\n          case \"txb\":\n            row.data.items[1].dis = property2[\"dis\"] ? property2[\"dis\"] : false;\n            break;\n\n          case \"tsp\":\n            row.data.items[1].min = property2.min;\n            row.data.items[1].max = property2.max;\n            row.data.items[1].dis = property2[\"dis\"] ? property2[\"dis\"] : false;\n            break;\n\n          case \"txf\":\n            row.data.items[1].dis = property2[\"dis\"] ? property2[\"dis\"] : false;\n            break;\n\n          case \"slc\":\n            row.data.items[1].comName = 'ko-select';\n            row.data.items[1].params = {\n              options: property2.options,\n              parent: this,\n              renderFunc: property2[\"renderFunc\"] ? property2[\"renderFunc\"] : '',\n              disable: property2[\"dis\"] ? property2[\"dis\"] : false,\n              name: this.propName(property2.val),\n              value: property2.val,\n              values: property2[\"slcType\"] ? property2.val : null,\n              tagManager: property2[\"tagManager\"] ? property2[\"tagManager\"] : null,\n              type: property2[\"slcType\"] ? property2[\"slcType\"] : ''\n            };\n            break;\n\n          case \"dpk\":\n            row.data.items[1].comName = 'ko-datepicker';\n            row.data.items[1].params = {\n              dateType: property2.dateType,\n              parent: this,\n              disable: property2[\"dis\"] ? property2[\"dis\"] : false,\n              name: this.propName(property2.val),\n              value: property2.val\n            };\n            break;\n        }\n      }\n\n      return row;\n    }\n  }]);\n\n  return FormBuilder;\n}();\nvar BaseFormModel = /*#__PURE__*/function (_FormBuilder) {\n  _inherits(BaseFormModel, _FormBuilder);\n\n  var _super = _createSuper(BaseFormModel);\n\n  function BaseFormModel(viewModel, editMode, excludeList, customCaptions) {\n    var _this;\n\n    _classCallCheck(this, BaseFormModel);\n\n    _this = _super.call(this);\n    _this.parentVM = viewModel;\n    _this.editMode = ko.observable(editMode || false);\n    if (!customCaptions) _this.caption = ko.observable(!_this.editMode() ? _h.getLocalizedText('createCaption') : _h.getLocalizedText('editCaption'));else _this.caption = ko.observable(!_this.editMode() ? _h.getLocalizedText(customCaptions[0]) : _h.getLocalizedText(customCaptions[1]));\n    if (!excludeList) excludeList = [\"gParent\"];else excludeList.push(\"gParent\");\n\n    if (editMode) {\n      var model = viewModel.multiCommandExecute(\"selectedRowRecord\");\n\n      _autoMapper.fillForm(_assertThisInitialized(_this), model, excludeList);\n    } else {\n      var entityName = _this.parentVM.entityName;\n\n      if (entityName) {}\n\n      var res = window[_this.constructor.name.replace(\"Form\", \"\").toLowerCase() + \"ModelRes\"];\n\n      if (!res) {\n        res = window[entityName.replace(\"Form\", \"\").toLowerCase() + \"ModelRes\"];\n      }\n\n      _autoMapper.createProps(_assertThisInitialized(_this), res, excludeList);\n    }\n\n    return _this;\n  }\n\n  return _createClass(BaseFormModel);\n}(FormBuilder);\nvar BaseModel = /*#__PURE__*/function () {\n  function BaseModel(model) {\n    _classCallCheck(this, BaseModel);\n\n    _autoMapper.fillModel(this, model);\n\n    this.selected = ko.observable(false);\n  }\n\n  _createClass(BaseModel, [{\n    key: \"createTagId\",\n    value: function createTagId() {\n      if (this[\"id\"]) return this.constructor.name + \"-\" + this.id();else return \"\";\n    }\n  }, {\n    key: \"refreshModel\",\n    value: function refreshModel(model) {\n      _autoMapper.fillModel(this, model);\n    }\n  }]);\n\n  return BaseModel;\n}();\nvar BaseInnerModel = /*#__PURE__*/function () {\n  function BaseInnerModel(model, paramList) {\n    _classCallCheck(this, BaseInnerModel);\n\n    if (model !== null) _autoMapper.fillModel(this, model);\n    if (paramList && paramList.length > 0) _autoMapper.createPropsFromList(this, paramList);\n  }\n\n  _createClass(BaseInnerModel, [{\n    key: \"createTagId\",\n    value: function createTagId() {\n      if (this[\"id\"]) return this.constructor.name + \"-\" + this.id();else if (this[\"value\"]) return this.constructor.name + \"-\" + this.value();else return \"\";\n    }\n  }]);\n\n  return BaseInnerModel;\n}();\nvar BaseInfoModel = /*#__PURE__*/_createClass(function BaseInfoModel(model) {\n  _classCallCheck(this, BaseInfoModel);\n\n  _autoMapper.fillInfoModel(this, model);\n});\nvar BaseSecondaryForm = /*#__PURE__*/function (_FormBuilder2) {\n  _inherits(BaseSecondaryForm, _FormBuilder2);\n\n  var _super2 = _createSuper(BaseSecondaryForm);\n\n  function BaseSecondaryForm(viewModel, paramList, caption) {\n    var _this2;\n\n    _classCallCheck(this, BaseSecondaryForm);\n\n    _this2 = _super2.call(this);\n    _this2.parentVM = viewModel;\n    if (_typeof(caption) !== 'object') _this2.caption = _h.getLocalizedText(caption);else _this2.caption = caption.text;\n\n    _autoMapper.createPropsFromList(_assertThisInitialized(_this2), paramList);\n\n    return _this2;\n  }\n\n  return _createClass(BaseSecondaryForm);\n}(FormBuilder);\n\n//# sourceURL=webpack://domino/./src/scripts/pages/master/baseModels.js?");

/***/ }),

/***/ "./src/scripts/pages/master/baseViewModel.js":
/*!***************************************************!*\
  !*** ./src/scripts/pages/master/baseViewModel.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"BaseViewModel\": () => (/* binding */ BaseViewModel)\n/* harmony export */ });\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* harmony import */ var _modelsIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modelsIndex.js */ \"./src/scripts/pages/modelsIndex.js\");\n/* harmony import */ var _period_model_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../period/model.js */ \"./src/scripts/pages/period/model.js\");\n/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./model.js */ \"./src/scripts/pages/master/model.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n\n\n\n\nfunction BaseViewModel(config) {\n  var self = this;\n  self.entityName = config.entityName;\n  self.controllerName = _h.findControllerName(config.entityName);\n  self.firstView = true;\n  self.groupDirection = ko.observable();\n  self.groupProperty = ko.observable();\n  self.showType = ko.observable(\"Table\");\n  self.iconSize = ko.observable(\"icon-image\");\n  self.apiService = new _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService(config.apiService, config.entityName);\n  self.filterType = ko.observable(\"_\");\n\n  if (config.filterProfile) {\n    self.activeFilterProfile = ko.observable();\n    self.inputFilterProfile = ko.observable();\n    self.showInputFilterProfile = ko.observable(false);\n\n    self.toggleInputFilterProfile = function (m, event) {\n      event.stopPropagation();\n      self.showInputFilterProfile(true);\n\n      if (!_h.isNullOrEmpty(self.activeFilterProfile())) {\n        var item = self.getFilterProfile(self.activeFilterProfile());\n        self.inputFilterProfile(item.text);\n      } else {\n        self.inputFilterProfile(\"\");\n      }\n    };\n\n    self.getFilterProfile = function (id) {\n      var target = null;\n\n      if (self.filterProfiles().length > 0) {\n        for (var i = 0; i < self.filterProfiles().length; i++) {\n          if (self.filterProfiles()[i].value === id) target = self.filterProfiles()[i];\n        }\n      }\n\n      return target;\n    };\n\n    self.updateFilterProfile = function (controllerName) {\n      if (self.inputFilterProfile().length > 0) {\n        var model = {\n          controllerName: controllerName,\n          id: self.activeFilterProfile(),\n          title: self.inputFilterProfile(),\n          filters: self.createFilterByModel()\n        };\n        self.apiService.request({\n          name: \"postSearchProfile\",\n          data: model,\n          success: function success(data) {\n            if (!_h.isNullOrEmpty(data)) {\n              if (_h.isNullOrEmpty(self.activeFilterProfile())) {\n                data.model.value = data.model.id;\n                data.model.text = data.model.title;\n                self.filterProfiles.push(data.model);\n                self.activeFilterProfile(data.model.id);\n              } else {\n                for (var i = 0; i < self.filterProfiles().length; i++) {\n                  if (self.filterProfiles()[i].value === self.activeFilterProfile()) {\n                    self.filterProfiles()[i].text = model.title;\n                    self.filterProfiles()[i].title = model.title;\n                  }\n                }\n              }\n\n              self.showInputFilterProfile(false);\n            }\n          }\n        });\n      }\n    };\n\n    self.cancelFilterProfile = function (m, event) {\n      event.stopPropagation();\n      self.showInputFilterProfile(false);\n      self.inputFilterProfile(null);\n    };\n\n    self.filterProfiles = ko.observableArray();\n\n    self.deleteFilterProfile = function () {\n      var item = self.getFilterProfile(self.activeFilterProfile());\n      if (!item) return;\n      var model = {\n        id: item.value\n      };\n      self.apiService.request({\n        name: \"DeleteSearchProfile\",\n        data: model,\n        success: function success(data) {\n          if (!_h.isNullOrEmpty(data)) {\n            self.activeFilterProfile(null);\n            self.filterProfiles.remove(item);\n          }\n        }\n      });\n    };\n  }\n\n  if (_h.any(config.extraParams)) for (var m in config.extraParams) {\n    if (config.extraParams.hasOwnProperty(m)) {\n      var param = config.extraParams[m];\n      self[param] = ko.observable();\n    }\n  }\n  if (_h.any(config.parentParams)) for (var k in config.parentParams) {\n    if (config.parentParams.hasOwnProperty(k)) {\n      var parentParam = config.parentParams[k];\n      self[parentParam] = ko.observable();\n    }\n  }\n  self.configTable = config;\n  self.dynamicCols = config.dynamicCols;\n  self.saveState = config.saveState;\n  self.isMultiSelectRows = config.isMultiSelectRows;\n  self.selectedRowRecords = ko.observableArray();\n  self.filters = config.filters;\n  self.extraParams = config.extraParams;\n\n  if (self.dynamicCols) {\n    self.tableFields = ko.observable(config.cols);\n    self.tableCode = ko.observable(config.tableCode);\n    self.tableName = ko.observable(config.tableName);\n  }\n\n  self.showCreateForm = ko.observable(false);\n  self.createFormModel = ko.observable();\n  self.wideRight = ko.observable(true);\n  self.showForm = ko.observable(false);\n  self.selectedRecord = ko.observable(null);\n  self.selectedRowRecord = ko.observable(null);\n  self.childModel = ko.observable(null);\n  self.records = ko.observableArray();\n  self.total = ko.observable(0);\n  self.tableProperties = ko.observableArray();\n  self.sortDirection = ko.observable(config.sortDirection);\n  self.sortProperty = ko.observable(config.sortProperty);\n  self.pageSize = ko.observable(24);\n  self.pageNumber = ko.observable(1);\n  self.searchKey = ko.observable();\n  self.showPaggingMenu = ko.observable(false);\n  self.pageNumberStr = ko.observable(1);\n  self.folderList = ko.observableArray();\n  self.tagList = ko.observableArray();\n\n  self.getFolderList = function () {\n    var model = {\n      controllerName: self.controllerName\n    };\n    self.apiService.request({\n      name: \"getTableInfo\",\n      data: model,\n      success: function success(data) {\n        self.folderList.removeAll();\n        self.tagList.removeAll();\n        if (_h.any(data.folders)) for (var j = 0; j < data.folders.length; j++) {\n          var target = data.folders[j];\n          self.folderList.push(new _model_js__WEBPACK_IMPORTED_MODULE_3__.Folder(target));\n        }\n        if (_h.any(data.tags)) for (var k = 0; k < data.tags.length; k++) {\n          self.tagList.push({\n            text: data.tags[k],\n            value: data.tags[k]\n          });\n        }\n      },\n      messageType: 'getList',\n      messageKey: \"Folder\"\n    });\n  };\n\n  self.pageNumberStrsub = self.pageNumberStr.supsendableSubscribe(function (newValue) {\n    if (newValue !== undefined && newValue !== null) {\n      self.pageNumberStrsub.suspend();\n      var number = Number(newValue);\n      var pageCount = parseInt(self.total() / self.pageSize());\n\n      if (self.total() % self.pageSize() !== 0) {\n        pageCount += 1;\n      }\n\n      if (number < 1 || number > pageCount) {\n        self.pageNumberStr(self.pageNumber());\n      }\n\n      self.pageNumberStrsub.unsuspend();\n    }\n  });\n  self.pageNumbers = ko.observableArray([]);\n  self.paggingMenu = ko.computed(function () {\n    self.pageNumberStr(self.pageNumber());\n    var pageCount = parseInt(self.total() / self.pageSize());\n\n    if (self.total() % self.pageSize() !== 0) {\n      pageCount += 1;\n    }\n\n    self.pageNumbers.removeAll();\n    var isActive;\n\n    if (pageCount < 2) {\n      self.showPaggingMenu(false);\n    } else if (pageCount < 100) {\n      for (var i = 0; i < pageCount; i++) {\n        isActive = self.pageNumber() === i + 1;\n        self.pageNumbers.push({\n          name: i + 1,\n          active: ko.observable(isActive)\n        });\n      }\n\n      self.showPaggingMenu(true);\n    } else if (pageCount > 100) {\n      self.pageNumbers.push({\n        name: pageCount - 2,\n        active: ko.observable(self.pageNumber() === pageCount - 2)\n      });\n      self.pageNumbers.push({\n        name: pageCount - 1,\n        active: ko.observable(self.pageNumber() === pageCount - 1)\n      });\n      self.pageNumbers.push({\n        name: pageCount,\n        active: ko.observable(self.pageNumber() === pageCount)\n      });\n      self.showPaggingMenu(true);\n    }\n  });\n\n  self.paggingMenuItemClick = function (item) {\n    self.pageNumber(item.name);\n    config.context.getRecords();\n  };\n\n  self.onClickPageNumberStr = function (d, e) {\n    var number = Number(self.pageNumberStr());\n    var pageCount = parseInt(self.total() / self.pageSize());\n\n    if (self.total() % self.pageSize() !== 0) {\n      pageCount += 1;\n    }\n\n    var res = false;\n\n    if (!_h.isNullOrEmpty(number) && number <= pageCount) {\n      self.pageNumber(number);\n      config.context.getRecords();\n      res = true;\n    }\n\n    if (res && self.pageNumbers().length) {\n      for (var i = 0; i < self.pageNumbers().length; i++) {\n        if (self.pageNumbers()[i].name === number) self.pageNumbers()[i].active(true);else self.pageNumbers()[i].active(false);\n      }\n    }\n  };\n\n  if (_h.isNullOrEmpty(config.searchKeyType)) {\n    self.searchKey.subscribe(function (newValue) {\n      self.pageNumber(1);\n      config.context.getRecords();\n    });\n  }\n\n  if (!_h.isNullOrEmpty(config.searchKeyType) && config.searchKeyType === \"enter\") {\n    self.onEnterSearchKey = function (d, e) {\n      if (e.keyCode === 13) {\n        self.pageNumber(1);\n        config.context.getRecords();\n\n        switch (self.entityName) {\n          case \"Period\":\n            self.wideRight(true);\n            self.childModel(null);\n            break;\n        }\n      }\n\n      return true;\n    };\n  }\n\n  self.changePageSize = function (model, e) {\n    var target = e.currentTarget;\n    var count = target.innerText;\n\n    if (count) {\n      self.pageSize(Number(count));\n      self.pageNumber(1);\n      self.total(0);\n      config.context.getRecords();\n    }\n  };\n\n  self.changeSortProperty = function (item) {\n    ko.utils.arrayFilter(self.tableProperties(), function (sortItem) {\n      if (item.name === sortItem.name) {\n        if (sortItem.sortDir() === \"Ascending\") sortItem.sortDir(\"Descending\");else sortItem.sortDir(\"Ascending\");\n      } else {\n        sortItem.sortDir(\"None\");\n      }\n    });\n    if (item[\"alias\"] !== null && item[\"alias\"] !== undefined && item[\"alias\"] !== \"\") self.sortProperty(item.alias);else self.sortProperty(item.name);\n    self.sortDirection(item.sortDir());\n    config.context.getRecords();\n  };\n\n  self.isVisibleColumn = function (name) {\n    var record = null;\n\n    for (var i = 0; i < self.tableProperties().length; i++) {\n      if (self.tableProperties()[i].name === name) {\n        record = self.tableProperties()[i];\n      }\n    }\n\n    if (record === null) return false;\n\n    if (self.showType() === \"Table\") {\n      if (record.name === 'id') return true;\n      return record.visibleCol();\n    } else {\n      if (record.name === 'id') return false;\n      return record.visibleItem();\n    }\n  };\n\n  self.checkVisibleItem = function (target) {\n    var count = 0;\n\n    for (var i = 0; i < self.tableProperties().length; i++) {\n      if (self.tableProperties()[i].visibleItem()) count++;\n    }\n\n    if (count > 3) target.visibleItem(false);\n  };\n\n  self.groupByClick = function (item, e, state) {\n    if (state === undefined) {\n      if (item.groupBy === true && (_h.isNullOrEmpty(self.groupProperty()) || self.groupProperty() === item.name)) {\n        self.records.removeAll();\n\n        if (!item.activeGroupBy()) {\n          item.activeGroupBy(true);\n          self.groupProperty(item.name);\n          self.groupDirection(item.groupDir());\n        } else {\n          if (item.groupDir() === \"Ascending\") {\n            item.groupDir(\"Descending\");\n          } else {\n            item.groupDir(\"Ascending\");\n          }\n\n          self.groupDirection(item.groupDir());\n        }\n\n        item.visibleCol(false);\n        self.filterBy();\n      }\n\n      if (item.groupBy === true && !_h.isNullOrEmpty(self.groupProperty()) && self.groupProperty() !== item.name) {\n        self.records.removeAll();\n        ko.utils.arrayFilter(self.tableProperties(), function (sortItem) {\n          sortItem.activeGroupBy(false);\n        });\n\n        if (!item.activeGroupBy()) {\n          item.activeGroupBy(true);\n          self.groupProperty(item.name);\n        } else {\n          if (item.groupDir() === \"Ascending\") {\n            item.groupDir(\"Descending\");\n          } else {\n            item.groupDir(\"Ascending\");\n          }\n\n          self.groupDirection(item.groupDir());\n        }\n\n        item.visibleCol(false);\n        self.filterBy();\n      }\n    } else {\n      self.groupProperty(item.name);\n      self.groupDirection(item.groupDir());\n      item.visibleCol(false);\n    }\n\n    _h.kocnx().saveTableState(self);\n  };\n\n  self.cancelGroupBy = function (item) {\n    self.groupProperty(undefined);\n    self.groupDirection(undefined);\n    ko.utils.arrayFilter(self.tableProperties(), function (sortItem) {\n      sortItem.activeGroupBy(false);\n    });\n    if (self.entityName !== \"TableTemplate\") item.visibleCol(true);\n    self.filterBy();\n    if (self.entityName === \"TableTemplate\") _h.kocnx().saveTableState(self);\n  };\n\n  self.backward = function () {\n    if (self.pageNumber() > 1) {\n      self.pageNumber(self.pageNumber() - 1);\n      config.context.getRecords();\n    }\n  };\n\n  self.goTo = function (model, e) {\n    var pageNumber = Number($(e.target).attr(\"data-pageid\"));\n\n    if (pageNumber > 0) {\n      config.context.pageNumber(pageNumber);\n      config.context.getRecords();\n    }\n  };\n\n  self.forward = function () {\n    if (self.records().length !== self.total()) {\n      self.pageNumber(self.pageNumber() + 1);\n      self.refreshTable();\n    }\n  };\n\n  self.refreshTable = function () {\n    switch (self.entityName) {\n      case \"BalanceReport\":\n        if (!config.context.filterBox().validationObject.isValid()) {\n          config.context.filterBox().validationObject.errors.showAllMessages();\n          return false;\n        }\n\n        config.context.getRecords();\n        break;\n\n      case \"Period\":\n        self.wideRight(true);\n        self.childModel(null);\n        config.context.getRecords();\n        break;\n\n      case \"ActionLog\":\n        self.wideRight(true);\n        self.childModel(null);\n        config.context.getRecords();\n        break;\n\n      default:\n        self.childModel(null);\n        config.context.getRecords();\n        break;\n    }\n  };\n\n  self.filterBy = function () {\n    self.pageNumber(1);\n    config.context.getRecords();\n  };\n\n  self.extraBufferKey = ko.observable();\n\n  self.changeSelectedRecord = function (target, ctrlSelect, shiftSelect, rightClick) {\n    if (self.isMultiSelectRows && self.showType() !== \"List\") {\n      if (shiftSelect) {\n        if (self.extraBufferKey() === null || self.extraBufferKey() === undefined) {\n          self.extraBufferKey(target);\n          target.selected(true);\n        } else {\n          var first,\n              second,\n              groupRoot,\n              indexFirst,\n              indexSecond,\n              cr = false;\n          ;\n\n          if (self.groupProperty()) {\n            for (var i = 0; i < self.records().length; i++) {\n              var rec = self.records()[i];\n\n              for (var j = 0; j < rec.list().length; j++) {\n                var innerRec = rec.list()[j];\n\n                if (self.extraBufferKey().id() === innerRec.id()) {\n                  groupRoot = rec;\n                  indexFirst = rec.list().indexOf(self.extraBufferKey());\n                  indexSecond = rec.list().indexOf(target);\n                }\n              }\n            }\n\n            if (indexFirst === indexSecond) return;\n\n            if (indexFirst > indexSecond) {\n              first = target;\n              second = self.extraBufferKey();\n            }\n\n            if (indexFirst < indexSecond) {\n              first = self.extraBufferKey();\n              second = target;\n            }\n\n            ko.utils.arrayFilter(groupRoot.list(), function (rec) {\n              if (rec.id() === first.id()) cr = true;\n              if (cr) rec.selected(true);\n              if (rec.id() === second.id()) cr = false;\n            });\n          } else {\n            indexFirst = self.records().indexOf(self.extraBufferKey());\n            indexSecond = self.records().indexOf(target);\n\n            if (indexFirst === indexSecond) {\n              return;\n            }\n\n            if (indexFirst > indexSecond) {\n              first = target;\n              second = self.extraBufferKey();\n            }\n\n            if (indexFirst < indexSecond) {\n              first = self.extraBufferKey();\n              second = target;\n            }\n\n            ko.utils.arrayFilter(self.records(), function (rec) {\n              if (rec.id() === first.id()) cr = true;\n              if (cr) rec.selected(true);\n              if (rec.id() === second.id()) cr = false;\n            });\n          }\n        }\n      } else {\n        if (ctrlSelect) {\n          if (target.selected() === false) self.extraBufferKey(target);\n          target.selected(!target.selected());\n        } else {\n          if (rightClick) {\n            if (!target.selected()) {\n              self.extraBufferKey(target);\n              self.multiCommandExecute(\"toggle\", false);\n              target.selected(true);\n            }\n\n            target.selected(true);\n          } else {\n            self.extraBufferKey(target);\n            self.multiCommandExecute(\"toggle\", false);\n            if (self.configTable.isMultiSelectRows) self.selectedRowRecord(target);\n            target.selected(true);\n          }\n        }\n      }\n    } else {\n      self.extraBufferKey(target);\n      if (self.selectedRowRecord() !== null && self.selectedRowRecord() !== undefined) self.selectedRowRecord().selected(false);\n      self.selectedRowRecord(target);\n      target.selected(true);\n    }\n  };\n\n  self.onlySelectedRow = function (target) {\n    self.multiCommandExecute(\"toggle\", false);\n    if (self.selectedRowRecord() !== null && self.selectedRowRecord() !== undefined) self.selectedRowRecord().selected(false);\n    self.selectedRowRecord(target);\n    target.selected(true);\n  };\n\n  if (config.selectRow) {\n    self.isValidClickSingleRow = function (e) {\n      var tag;\n      if (e.target === undefined) tag = e.tagName.toLowerCase();else tag = e.target.tagName.toLowerCase();\n\n      switch (tag) {\n        case \"span\":\n        case \"label\":\n          return \"label\";\n\n        case \"button\":\n        case \"i\":\n        case \"a\":\n        case \"li\":\n          return false;\n\n        default:\n          return true;\n      }\n    };\n\n    self.getSelectedRecord = function () {\n      return self.selectedRowRecord();\n    };\n\n    self.isSelectedRecord = ko.computed(function () {\n      return self.selectedRowRecord() !== null && self.selectedRowRecord() !== undefined;\n    });\n\n    self.selectedRow = function (target, e, rightClick) {\n      var ctrlSelect = e.ctrlKey;\n      var shiftSelect = e.shiftKey;\n      if (shiftSelect === undefined) shiftSelect = false;\n      if (ctrlSelect === undefined) ctrlSelect = false;\n      var res = self.isValidClickSingleRow(e);\n\n      if (res !== \"label\") {\n        self.changeSelectedRecord(target, ctrlSelect, shiftSelect, rightClick);\n        self.fillChildModel(target);\n      } else {\n        self.changeSelectedRecord(target, ctrlSelect, shiftSelect, rightClick);\n        self.fillChildModel(target);\n      }\n    };\n  }\n\n  self.fillChildModel = function (target) {\n    switch (self.entityName) {\n      case \"Period\":\n        if (!self.wideRight()) {\n          var model = new _period_model_js__WEBPACK_IMPORTED_MODULE_2__.HistoryViewModel();\n          model.periodId(target.id());\n          self.childModel(model);\n          self.childModel().init();\n        }\n\n        break;\n\n      case \"SourceTableData\":\n      case \"Balancesheet\":\n      case \"BalanceReportData\":\n      case \"Tree\":\n      case \"User\":\n      case \"AdjustmentDocument\":\n        if (self.showBlockType() === \"sideBySide\" || self.showBlockType() === \"fullDetails\") config.context.changeChildModel(target);\n        break;\n\n      case \"ActionLog\":\n        if (!self.wideRight()) config.context.changeChildModel(target);\n        break;\n\n      case \"CompanyInfo\":\n        config.context.changeChildModel(target);\n        break;\n    }\n\n    if (config.context[\"onSelectRecord\"]) config.context.onSelectRecord(target);\n  };\n\n  if (config.isMultiSelectRows) {\n    self.checkAll = ko.observable();\n\n    self.checkAllClick = function () {\n      self.checkAll(!self.checkAll());\n      self.multiCommandExecute(\"checkAll\", self.checkAll());\n    };\n  }\n\n  self.clearAllSelected = function () {\n    if (self.selectedRowRecord() !== null && self.selectedRowRecord() !== undefined) {\n      self.selectedRowRecord().selected(false);\n      self.selectedRowRecord(null);\n    }\n\n    ko.utils.arrayFilter(self.records(), function (record) {\n      record.selected(false);\n    });\n    self.childModel(null);\n  };\n\n  self.fillTableProperties = function () {\n    var list = null;\n\n    if (self.saveState) {\n      var model;\n      if (config.dynamicCols) model = clientStorage.getSetting(self.tableCode() + \"_TableState_\" + _h.kocnx().loginCompanyType());else model = clientStorage.getSetting(self.entityName + \"_TableState_\" + _h.kocnx().loginCompanyType());\n\n      if (!_h.isNullOrEmpty(model) && model !== \"\") {\n        list = JSON.parse(model);\n\n        switch (self.entityName) {\n          case \"AdjustmentDocument\":\n          case \"AdjustmentDocumentItem\":\n            var defList = config.context.createColList();\n\n            for (var j = 0; j < defList.length; j++) {\n              for (var n = 0; n < list.length; n++) {\n                if (defList[j].colName === list[n].colName) {\n                  defList[j].tablecol = list[n].tablecol;\n                  defList[j].visibleCol = list[n].visibleCol;\n                  defList[j].groupBy = list[n].groupBy;\n                  defList[j].groupDir = list[n].groupDir;\n                  defList[j].groupDir = list[n].groupDir;\n                  defList[j].activeGroupBy = list[n].activeGroupBy;\n                  defList[j].width = list[n].width;\n                  defList[j].enumSourceName = list[n].enumSourceName;\n                }\n              }\n            }\n\n            list = defList;\n            break;\n        }\n      } else {\n        list = config.cols;\n      }\n    } else {\n      list = config.cols;\n    }\n\n    self.tableProperties.removeAll();\n    var targetGroupBy = null;\n\n    for (var p in list) {\n      if (list.hasOwnProperty(p)) {\n        var target = list[p];\n        var colRecord = new _model_js__WEBPACK_IMPORTED_MODULE_3__.Column(target, self);\n        self.tableProperties.push(colRecord);\n\n        if (target.sortDir !== \"None\") {\n          self.sortDirection(target.sortDir);\n          self.sortProperty(target.colName);\n        }\n\n        if (target.activeGroupBy) {\n          targetGroupBy = colRecord;\n        }\n      }\n    }\n\n    if (targetGroupBy !== null) {\n      self.groupByClick(targetGroupBy, null, true);\n    }\n\n    var showType = clientStorage.getSetting(self.entityName + \"_ShowTableState_\" + _h.kocnx().loginCompanyType());\n    if (!showType) showType = \"Table\";\n    self.showType(showType);\n  };\n\n  self.toggleParentItemVisibleCols = function (item, val) {\n    for (var k = 0; k < self.tableProperties().length; k++) {\n      var target = self.tableProperties()[k];\n\n      if (target.colParent === item.id) {\n        target.visibleCol(val);\n      }\n    }\n  };\n\n  self.getInstance = function (target, parent) {\n    var model = _modelsIndex_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"][self.entityName];\n    if (parent) return new model(target, parent);\n    return new model(target);\n  };\n\n  self.clearSearchBoxes = function () {\n    for (var p in self.filters) {\n      if (self.filters.hasOwnProperty(p)) {\n        var target = self.filters[p];\n        if (_h.isNullOrEmpty(target[\"clear\"]) && (!target.type || target.type !== \"list\")) self[target.name](target.def);\n        if (_h.isNullOrEmpty(target[\"clear\"]) && target.type && target.type === \"list\") self[target.name].removeAll();\n      }\n    }\n\n    self.searchKey(\"\");\n    self.pageNumber(1);\n    config.context.getRecords();\n  };\n\n  self.createFilterByModel = function () {\n    var filterModel = {\n      searchKey: self.searchKey(),\n      pageNumber: self.pageNumber(),\n      pageSize: self.pageSize(),\n      sortProperty: self.sortProperty(),\n      sortDirection: self.sortDirection(),\n      groupDirection: self.groupDirection(),\n      groupProperty: self.groupProperty(),\n      filterType: self.filterType()\n    };\n\n    if (self.firstView && self.configTable.filterProfile) {\n      filterModel.profileIncluded = true;\n      self.firstView = false;\n    }\n\n    if (self.filters !== undefined && self.filters.length > 0) for (var p in self.filters) {\n      if (self.filters.hasOwnProperty(p)) {\n        var target = self.filters[p];\n\n        if (target.toServer === undefined) {\n          filterModel[target.name] = _h.normalizeAmpersand(self[target.name]());\n        }\n      }\n    }\n    return filterModel;\n  };\n\n  self.rightClickSelectRow = function (target, eventTarget, event) {\n    if (self.configTable.selectRow && self.configTable.contextMenu) self.selectedRow(target, event, true);\n  };\n\n  if (_h.any(config.filters)) {\n    for (var p in config.filters) {\n      if (config.filters.hasOwnProperty(p)) {\n        var target = config.filters[p];\n        if (target.type && (target.type === \"list\" || target.type === \"multiselect\")) self[target.name] = ko.observableArray(target.def);else self[target.name] = ko.observable(target.def);\n      }\n    }\n  }\n\n  self.handleOpenFolder = function (type) {\n    var target,\n        array = [];\n\n    switch (type) {\n      case \"set\":\n        if (self.records().length) for (var i = 0; i < self.records().length; i++) {\n          target = self.records()[i];\n\n          if (target[\"vis\"] && target.vis()) {\n            array.push(target.title);\n          }\n        }\n        if (array.length) localStorage.setItem(\"Open_Folders_\" + self.entityName, JSON.stringify(array));else localStorage.removeItem(\"Open_Folders_\" + self.entityName);\n        break;\n\n      case \"apply\":\n        var data = localStorage.getItem(\"Open_Folders_\" + self.entityName);\n\n        if (data) {\n          array = JSON.parse(data);\n\n          for (var j = 0; j < self.records().length; j++) {\n            target = self.records()[j];\n\n            for (var n = 0; n < array.length; n++) {\n              if (array[n] === target.title) target.vis(true);\n            }\n          }\n        }\n\n        break;\n    }\n  };\n\n  if (config.getList) {\n    self.getRecords = function (selectedId) {\n      var address = \"filterby\";\n\n      if (self.configTable.dynamicCols) {\n        switch (self.entityName) {\n          case \"CompanyInfoData\":\n            address = \"/api/companyinfodata/filterby\";\n            break;\n\n          default:\n            address = \"/api/dynamictabledata/filterby\";\n            break;\n        }\n      }\n\n      var filterModel = self.createFilterByModel();\n      self.handleOpenFolder(\"set\");\n      self.apiService.request({\n        name: address,\n        data: filterModel,\n        success: function success(data) {\n          self.records.removeAll();\n\n          if (!_h.isNullOrEmpty(data)) {\n            self.total(data.total);\n            self.checkPageNumber(data.total);\n\n            if (_h.any(self.extraParams)) {\n              self.updateExtraParams(data);\n            }\n\n            if (_h.any(data.list)) for (var m = 0; m < data.list.length; m++) {\n              var target = data.list[m];\n              var record;\n              if (self.dynamicCols) record = self.getInstance(target, self.tableFields());else record = self.getInstance(target);\n              self.records.push(record);\n            }\n\n            if (_h.any(data.groupList)) {\n              for (var j = 0; j < data.groupList.length; j++) {\n                var target2 = data.groupList[j];\n                var object = {\n                  title: target2.title,\n                  vis: ko.observable(false),\n                  list: ko.observableArray()\n                };\n                if (_h.any(target2.list)) for (var i = 0; i < target2.list.length; i++) {\n                  var record2;\n                  if (self.dynamicCols) record2 = self.getInstance(target2.list[i], self.tableFields());else record2 = self.getInstance(target2.list[i]);\n                  record2.gParent = object;\n                  object.list.push(record2);\n                }\n                self.records.push(object);\n              }\n\n              self.handleOpenFolder(\"apply\");\n            }\n          }\n\n          self.childModel(null);\n          if (self[\"checkAll\"]) self.checkAll(false);\n          self.extraBufferKey(null);\n          self.unSelectItem();\n          if (config.context[\"afterFilterBy\"]) config.context.afterFilterBy(data, selectedId);\n          if (self.configTable.resizable) _h.initResizeTable();\n        },\n        messageType: 'getList',\n        messageKey: self.entityName\n      });\n    };\n  }\n\n  self.checkPageNumber = function (total) {\n    if (total > 0) {\n      var pageCount = total / self.pageSize();\n      var rest = total % self.pageSize();\n\n      if (rest > 0) {\n        pageCount++;\n      }\n\n      if (self.pageNumber() > pageCount) {\n        self.pageNumber(self.pageNumber() - 1);\n        self.getRecords();\n      }\n    }\n  };\n\n  self.groupByToggleBtn = function (item) {\n    item.vis(!item.vis());\n  };\n\n  self.groupByToggleDblBtn = function (item) {\n    if (config.isMultiSelectRows && _h.any(item.list())) {\n      var first = item.list()[0];\n      var res = !first.selected();\n\n      for (var i = 0; i < item.list().length; i++) {\n        item.list()[i].selected(res);\n      }\n    }\n\n    if (!config.isMultiSelectRows) {\n      item.vis(!item.vis());\n    }\n  };\n\n  self.up = function () {\n    var index;\n\n    if (self.groupProperty()) {\n      var groupTarget = null;\n\n      for (var i = 0; i < self.records().length; i++) {\n        var rec = self.records()[i];\n\n        for (var j = 0; j < rec.list().length; j++) {\n          var innerRec = rec.list()[j];\n\n          if (self.getSelectedRecord().id() === innerRec.id()) {\n            groupTarget = rec;\n          }\n        }\n      }\n\n      if (groupTarget) {\n        index = groupTarget.list().indexOf(self.getSelectedRecord()) - 1;\n        if (index < 0) index = 0;\n        self.changeSelectedRecord(groupTarget.list()[index]);\n        self.fillChildModel(groupTarget.list()[index]);\n      }\n    } else {\n      switch (self.entityName) {\n        case \"Company\":\n          var item = self.getSelectedRecord();\n\n          if (!_h.isNullOrEmpty(item)) {\n            var id = self.entityName + \"-\" + item.id();\n            var element = $(\"#\" + id);\n            var preElement = element.prev(\":visible\");\n\n            if (preElement.length) {\n              var prvItem = ko.dataFor(preElement[0]);\n              self.changeSelectedRecord(prvItem);\n              self.fillChildModel(self.records()[index]);\n            }\n          } else {\n            index = self.records().indexOf(self.getSelectedRecord()) - 1;\n            if (index === -2) return;\n            if (index === -1) index = 0;\n            self.changeSelectedRecord(self.records()[index]);\n            self.fillChildModel(self.records()[index]);\n          }\n\n          break;\n\n        default:\n          index = self.records().indexOf(self.getSelectedRecord()) - 1;\n          if (index === -2) return;\n          if (index === -1) index = 0;\n          self.changeSelectedRecord(self.records()[index]);\n          self.fillChildModel(self.records()[index]);\n          break;\n      }\n    }\n  };\n\n  self.down = function () {\n    var index;\n\n    if (self.groupProperty()) {\n      var groupTarget = null;\n\n      for (var i = 0; i < self.records().length; i++) {\n        var rec = self.records()[i];\n\n        for (var j = 0; j < rec.list().length; j++) {\n          var innerRec = rec.list()[j];\n\n          if (self.getSelectedRecord().id() === innerRec.id()) {\n            groupTarget = rec;\n          }\n        }\n      }\n\n      if (groupTarget) {\n        index = groupTarget.list().indexOf(self.getSelectedRecord()) + 1;\n        if (index >= groupTarget.list().length) index = groupTarget.list().length - 1;\n        self.changeSelectedRecord(groupTarget.list()[index]);\n        self.fillChildModel(groupTarget.list()[index]);\n      }\n    } else {\n      switch (self.entityName) {\n        case \"Company\":\n          var item = self.getSelectedRecord();\n\n          if (!_h.isNullOrEmpty(item)) {\n            var id = self.entityName + \"-\" + item.id();\n            var element = $(\"#\" + id);\n            var nextElement = element.next(\":visible\");\n\n            if (nextElement.length) {\n              var nextItem = ko.dataFor(nextElement[0]);\n              self.changeSelectedRecord(nextItem);\n              self.fillChildModel(nextItem);\n            }\n          } else {\n            index = self.records().indexOf(self.getSelectedRecord()) + 1;\n            if (index >= self.records().length) index = self.records().length - 1;\n            self.changeSelectedRecord(self.records()[index]);\n            self.fillChildModel(self.records()[index]);\n          }\n\n          break;\n\n        default:\n          index = self.records().indexOf(self.getSelectedRecord()) + 1;\n          if (index >= self.records().length) index = self.records().length - 1;\n          self.changeSelectedRecord(self.records()[index]);\n          self.fillChildModel(self.records()[index]);\n          break;\n      }\n    }\n  };\n\n  self.right = function () {\n    var item = self.getSelectedRecord();\n\n    if (!_h.isNullOrEmpty(item)) {\n      if (item[\"childrenShow\"] !== null && item[\"childrenShow\"] !== undefined && item.childrenShow()) item.childrenShow(false);else {\n        return true;\n      }\n    } else {\n      return true;\n    }\n  };\n\n  self.left = function () {\n    var item = self.getSelectedRecord();\n\n    if (!_h.isNullOrEmpty(item)) {\n      if (item[\"childrenShow\"] !== null && item[\"childrenShow\"] !== undefined && item.childrenShow()) item.childrenShow(false);else {\n        return true;\n      }\n    } else {\n      return true;\n    }\n  };\n\n  if (_h.any(config.buttons)) {\n    for (var l in config.buttons) {\n      if (config.buttons.hasOwnProperty(l)) {\n        var action = config.buttons[l];\n        self[\"vis\" + action.name] = ko.observable();\n\n        switch (action.name) {\n          case \"refresh\":\n            action.icon = \"Refresh\";\n            action.title = 'refreshTable';\n            action.action = self.refreshTable;\n            break;\n\n          case \"help\":\n            action.icon = \"Help\";\n            action.title = 'helpBtn';\n            action.action = _h.kocnx().openHelp;\n            break;\n        }\n      }\n    }\n  }\n\n  self.multiCommandExecute = function (command, val, ids, data) {\n    if (self.entityName === \"Company\") return self.parentChildMultiCommandExecute(command, val, ids, data);else {\n      var record,\n          innerRecord,\n          selectedItems = [],\n          selectedRowRecord = null,\n          enableCount = 0,\n          disableCount = 0,\n          selectedList = 0,\n          temporaryCount = 0,\n          confirmCount = 0,\n          archiveCount = 0,\n          unArchiveCount = 0,\n          rightDocumentsCount = 0,\n          cr = false,\n          failCount = 0,\n          successCount = 0,\n          unconfirmActionCount = 0,\n          temp = null;\n      if (_h.any(self.records())) for (var i = 0; i < self.records().length; i++) {\n        record = self.records()[i];\n\n        if (record[\"list\"]) {\n          for (var j = 0; j < record.list().length; j++) {\n            innerRecord = record.list()[j];\n\n            switch (command) {\n              case \"checkAll\":\n                innerRecord.selected(val);\n                break;\n\n              case \"toggle\":\n                innerRecord.selected(val);\n                break;\n\n              case \"selectedItems\":\n                if (innerRecord.selected()) selectedItems.push(innerRecord);\n                break;\n\n              case \"selectedItemIds\":\n                if (innerRecord.selected()) selectedItems.push(innerRecord.id());\n                break;\n\n              case \"selectedRowRecord\":\n                if (innerRecord.selected()) selectedRowRecord = innerRecord;\n                break;\n\n              case \"btnVisibilityData\":\n                if (innerRecord.selected()) {\n                  if (innerRecord.stateType() === 0) disableCount++;\n                  if (innerRecord.stateType() === 1) enableCount++;\n                  rightDocumentsCount++;\n                  selectedList++;\n                  temp = innerRecord;\n                }\n\n                break;\n\n              case \"btnVisibilityData2\":\n                if (innerRecord.selected()) {\n                  if (innerRecord.stateType() === 0) disableCount++;\n                  if (innerRecord.stateType() === 1) enableCount++;\n                  if (innerRecord.confirmationState() === 1) temporaryCount++;\n                  if (innerRecord.confirmationState() === 2) confirmCount++;\n                  selectedList++;\n                  temp = innerRecord;\n                }\n\n                break;\n\n              case \"btnVisibilityData4\":\n                if (innerRecord.selected()) {\n                  if (innerRecord.archived()) archiveCount++;\n                  if (!innerRecord.archived()) unArchiveCount++;\n                  selectedList++;\n                  temp = innerRecord;\n                }\n\n                break;\n\n              case \"changesLocalStateType\":\n                if (ids.indexOf(innerRecord.id()) !== -1) {\n                  innerRecord.stateType(val);\n                  innerRecord.selected(false);\n                }\n\n                break;\n\n              case \"changesLocalConfirmState\":\n                if (val === 2) {\n                  if (data.failed.indexOf(innerRecord.id()) !== -1) {\n                    innerRecord.selected(false);\n                    innerRecord.messageType(1);\n                    failCount++;\n                  }\n\n                  if (data.successful.indexOf(innerRecord.id()) !== -1) {\n                    innerRecord.confirmationState(val);\n                    innerRecord.selected(false);\n                    innerRecord.messageType(2);\n                    successCount++;\n                  }\n                } else {\n                  if (ids.indexOf(innerRecord.id()) !== -1) {\n                    innerRecord.confirmationState(val);\n                    innerRecord.selected(false);\n                    unconfirmActionCount++;\n                  }\n                }\n\n                break;\n\n              case \"resetMessageType\":\n                innerRecord.messageType(0);\n                break;\n            }\n          }\n        } else {\n          switch (command) {\n            case \"checkAll\":\n              record.selected(val);\n              break;\n\n            case \"selectedItems\":\n              if (record.selected()) selectedItems.push(record);\n              break;\n\n            case \"selectedItemIds\":\n              if (record.selected()) selectedItems.push(record.id());\n              break;\n\n            case \"toggle\":\n              record.selected(val);\n              break;\n\n            case \"selectedRowRecord\":\n              if (record.selected()) selectedRowRecord = record;\n              break;\n\n            case \"btnVisibilityData\":\n              if (record.selected()) {\n                if (record.stateType() === 0) disableCount++;\n                if (record.stateType() === 1) enableCount++;\n                rightDocumentsCount++;\n                selectedList++;\n                temp = record;\n              }\n\n              break;\n\n            case \"btnVisibilityData2\":\n              if (record.selected()) {\n                if (record.stateType() === 0) disableCount++;\n                if (record.stateType() === 1) enableCount++;\n                if (record.confirmationState() === 1) temporaryCount++;\n                if (record.confirmationState() === 2) confirmCount++;\n                selectedList++;\n                temp = record;\n              }\n\n              break;\n\n            case \"btnVisibilityData3\":\n              if (record.selected()) {\n                if (!self.adjustmentId()) {\n                  if (record.stateType() === 0 && record.stateTypeEditable()) disableCount++;\n                  if (record.stateType() === 1 && record.stateTypeEditable()) enableCount++;\n                } else {\n                  if (record.stateType() === 0) disableCount++;\n                  if (record.stateType() === 1) enableCount++;\n                }\n\n                selectedList++;\n                temp = record;\n              }\n\n              break;\n\n            case \"btnVisibilityData4\":\n              if (record.selected()) {\n                if (record.archived()) archiveCount++;\n                if (!record.archived()) unArchiveCount++;\n                selectedList++;\n                temp = record;\n              }\n\n              break;\n\n            case \"changesLocalStateType\":\n              if (ids.indexOf(record.id()) !== -1) {\n                record.stateType(val);\n                record.selected(false);\n\n                if (!_h.isNullOrEmpty(self.childModel()) && record.id() === self.childModel().adjustmentId()) {\n                  temp = record;\n                }\n              }\n\n              break;\n\n            case \"changesUnlockUser\":\n              if (ids.indexOf(record.id()) !== -1) {\n                record.locked(val);\n                record.selected(false);\n              }\n\n              break;\n\n            case \"changesLocalConfirmState\":\n              if (val === 2) {\n                if (data.failed.indexOf(record.id()) !== -1) {\n                  record.selected(false);\n                  record.messageType(1);\n                  failCount++;\n                }\n\n                if (data.successful.indexOf(record.id()) !== -1) {\n                  record.confirmationState(val);\n                  record.selected(false);\n                  record.messageType(2);\n                  successCount++;\n                }\n              } else {\n                if (ids.indexOf(record.id()) !== -1) {\n                  record.confirmationState(val);\n                  record.selected(false);\n                  unconfirmActionCount++;\n                }\n              }\n\n              break;\n\n            case \"resetMessageType\":\n              record.messageType(0);\n              break;\n          }\n        }\n      }\n\n      switch (command) {\n        case \"checkAll\":\n          self.selectedRowRecord(null);\n          break;\n\n        case \"btnVisibilityData\":\n          return [temp, enableCount, disableCount, selectedList, rightDocumentsCount];\n\n        case \"btnVisibilityData2\":\n          return [temp, enableCount, disableCount, selectedList, temporaryCount, confirmCount];\n\n        case \"btnVisibilityData3\":\n          return [temp, enableCount, disableCount, selectedList];\n\n        case \"btnVisibilityData4\":\n          return [temp, archiveCount, unArchiveCount, selectedList];\n\n        case \"selectedItems\":\n        case \"selectedItemIds\":\n          return selectedItems;\n\n        case \"selectedRowRecord\":\n          return selectedRowRecord;\n\n        case \"changesLocalStateType\":\n          if (!_h.isNullOrEmpty(self.childModel()) && temp) {\n            config.context.changeChildModel(temp, true);\n          }\n\n          break;\n\n        case \"changesLocalConfirmState\":\n          if (failCount > 0) {\n            toast.custom(\"error\", _h.getApiMessage(\"PutConfirmTypesError\").replace(\"__\", failCount).replace(\"--\", toast.getEntitiesValue(self.entityName, 'put', null)));\n          }\n\n          if (successCount > 0) {\n            var successMessage = toast.createMessage(self.entityName, 'custom', 'ConfirmTypes', 'success');\n            toast.custom(\"success\", successMessage.replace(\"__\", successCount));\n          }\n\n          if (unconfirmActionCount > 0) {\n            if (ids.length === 1) toast.success(self.entityName, 'custom', 'UnConfirmType');\n            if (ids.length > 1) toast.success(self.entityName, 'custom', 'UnConfirmTypes');\n          }\n\n          if (self.childModel() !== null && self.childModel() !== undefined) {\n            if (val === 1) self.childModel().isRightEdit(true);else self.childModel().isRightEdit(false);\n          }\n\n          setTimeout(function () {\n            self.multiCommandExecute(\"resetMessageType\");\n          }, 10000);\n          break;\n      }\n    }\n  };\n\n  self.parentChildMultiCommandExecute = function (command, val, ids, data) {\n    var record,\n        targetChild,\n        selectedItems = [];\n    if (_h.any(self.records())) for (var i = 0; i < self.records().length; i++) {\n      record = self.records()[i];\n\n      switch (command) {\n        case \"selectedItems\":\n          if (record.selected()) selectedItems.push(record);\n\n          for (var j = 0; j < record.children().length; j++) {\n            targetChild = record.children()[j];\n            if (targetChild.selected()) selectedItems.selected(targetChild);\n          }\n\n          return selectedItems;\n\n        case \"selectedItemIds\":\n          if (record.selected()) selectedItems.push(record.id());\n\n          for (var j = 0; j < record.children().length; j++) {\n            targetChild = record.children()[j];\n            if (targetChild.selected()) selectedItems.push(targetChild.id());\n          }\n\n          return selectedItems;\n\n        case \"toggle\":\n          record.selected(val);\n\n          for (var l = 0; l < record.children().length; l++) {\n            targetChild = record.children()[l];\n            targetChild.selected(val);\n          }\n\n          break;\n\n        case \"selectedRowRecord\":\n          return self.selectedRowRecord();\n\n        case \"changesLocalStateType\":\n          if (ids.indexOf(record.id()) !== -1) {\n            record.stateType(val);\n            record.selected(false);\n          }\n\n          self.changesChildrenLocalStateType(record, ids, val);\n          break;\n      }\n    }\n  };\n\n  self.changesChildrenLocalStateType = function (record, ids, val) {\n    if (record.children().length > 0) for (var i = 0; i < record.children().length; i++) {\n      if (ids.indexOf(record.children()[i].id()) !== -1) {\n        record.children()[i].stateType(val);\n        record.children()[i].selected(false);\n      }\n\n      self.changesChildrenLocalStateType(record.children()[i], ids, val);\n    }\n  };\n\n  self.create = function (m, mo, e) {\n    var model;\n    var item = m[1];\n\n    switch (self.entityName) {\n      case \"DynamicDocument\":\n        if (!item.validateForm()) {\n          return false;\n        }\n\n        model = item.toServer();\n        break;\n\n      default:\n        if (!item.validationObject.isValid()) {\n          item.validationObject.errors.showAllMessages();\n          return false;\n        }\n\n        model = item.toServer();\n        break;\n    }\n\n    self.apiService.request({\n      splashId: e,\n      name: \"post\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          switch (self.entityName) {\n            case \"Period\":\n              self.afterCreate(data.models);\n              break;\n\n            case \"AdjustmentDocumentItem\":\n              if (!self.adjustmentId()) {\n                self.refreshTable();\n              } else {\n                self.afterCreate(data.models);\n\n                _h.kocnx().advm().callBackItemCountData(self.total());\n              }\n\n              break;\n\n            case \"Company\":\n              config.context.collectOpenBranches();\n              self.afterCreate(data.models, true);\n              config.context.configTools();\n              $(\"#tree_view\").treeView(\"expand\", config.context.treeOpenBranches);\n              config.context.getSelectList();\n\n              _h.kocnx().headerSection.resetActiveSelectMenu(true);\n\n              break;\n\n            case \"TableTemplate\":\n              self.afterCreate(data.models);\n              config.context.getTableTemplateList();\n              break;\n\n            default:\n              self.afterCreate(data.models);\n              break;\n          }\n\n          _h.kocnx().closeForm();\n\n          self.unSelectItem();\n          toast.success(self.entityName, 'post');\n          self.updateExtraParams(data);\n        }\n      },\n      messageType: 'post',\n      messageKey: self.entityName\n    });\n  };\n\n  self.unSelectItem = function () {\n    if (!_h.isNullOrEmpty(self.selectedRowRecord())) {\n      self.selectedRowRecord().selected(false);\n      self.selectedRowRecord(null);\n    }\n  };\n\n  self.afterCreate = function (models, searchDeep) {\n    if (_h.any(models)) {\n      for (var i = 0; i < models.length; i++) {\n        if (models[i].ad === true) {\n          var item = self.getInstance(models[i]);\n\n          if (!_h.isNullOrEmpty(self.groupProperty())) {\n            var groupProp = self.getGroupPropertyTitle(models[i]);\n            var addItem = false;\n\n            for (var j = 0; j < self.records().length; j++) {\n              var record = self.records()[j];\n\n              if (!_h.isNullOrEmpty(groupProp) && record.title === groupProp) {\n                record.list.push(item);\n                addItem = true;\n              }\n\n              if (_h.isNullOrEmpty(groupProp) && record.title === \"دسته بندی نشده\") {\n                record.list.push(item);\n                addItem = true;\n              }\n            }\n\n            var object;\n\n            if (addItem === false && _h.isNullOrEmpty(groupProp)) {\n              object = {\n                title: \"دسته بندی نشده\",\n                vis: ko.observable(false),\n                list: ko.observableArray()\n              };\n              object.list.push(item);\n              self.records.push(object);\n              self.increaseTotal();\n            }\n\n            if (addItem === false && !_h.isNullOrEmpty(groupProp)) {\n              object = {\n                title: groupProp,\n                vis: ko.observable(false),\n                list: ko.observableArray()\n              };\n              object.list.push(item);\n              self.records.push(object);\n              self.increaseTotal();\n            }\n          } else {\n            if (models[i][\"children\"] && !_h.isNullOrEmpty(models[i].pi) && searchDeep) {\n              var parent = self.findRecord(models[i].pi, true);\n              models[i].depth = parent.depth + 1;\n              item = self.getInstance(models[i], parent);\n              parent.children.push(item);\n              if (self.entityName === \"Company\" && (_h.isNullOrEmpty(self.searchKey()) || self.searchKey() === \"\")) self.increaseTotal();\n            } else {\n              self.records.push(item);\n              self.increaseTotal();\n            }\n          }\n        } else {\n          var oldRecord = self.findRecord(models[i].id);\n\n          if (!_h.isNullOrEmpty(oldRecord)) {\n            oldRecord.refreshModel(models[i]);\n          }\n        }\n      }\n\n      self.sortAfterChanges();\n    }\n  };\n\n  self.sortAfterChanges = function () {\n    if (self.entityName === \"Company\") return;\n\n    if (!_h.isNullOrEmpty(self.groupProperty())) {\n      var folderList = ko.toJS(self.folderList);\n      self.records.sort(function (left, right) {\n        var lIndex;\n        var rIndex;\n        folderList.filter(function (el, index) {\n          if (el.text === left.title) {\n            lIndex = index;\n          }\n\n          if (el.text === right.title) {\n            rIndex = index;\n          }\n        });\n\n        if (self.groupDirection() === \"Ascending\") {\n          self.sortList(left.list);\n          return lIndex > rIndex ? 1 : lIndex < rIndex ? -1 : 0; // return new Intl.Collator(\"fa\").compare(left.title, right.title);\n        } else {\n          self.sortList(left.list);\n          return lIndex < rIndex ? 1 : lIndex > rIndex ? -1 : 0; // return new Intl.Collator(\"fa\").compare(right.title, left.title);\n        }\n      });\n    } else {\n      self.sortList(self.records);\n    }\n  };\n\n  self.sortList = function (list) {\n    list.sort(function (left, right) {\n      if (self.sortDirection() === \"Ascending\") {\n        if (left[self.sortProperty()] && ko.isObservable(left[self.sortProperty()]) === true) {\n          return left[self.sortProperty()]() === right[self.sortProperty()]() ? 0 : left[self.sortProperty()]() < right[self.sortProperty()]() ? -1 : 1;\n        }\n\n        if (left[self.sortProperty()] && ko.isObservable(left[self.sortProperty()]) === false) {\n          return left[self.sortProperty()] === right[self.sortProperty()] ? 0 : left[self.sortProperty()] < right[self.sortProperty()] ? -1 : 1;\n        }\n      } else {\n        if (left[self.sortProperty()] && ko.isObservable(left[self.sortProperty()]) === true) {\n          return left[self.sortProperty()]() === right[self.sortProperty()]() ? 0 : left[self.sortProperty()]() > right[self.sortProperty()]() ? -1 : 1;\n        }\n\n        if (left[self.sortProperty()] && ko.isObservable(left[self.sortProperty()]) === false) {\n          return left[self.sortProperty()] === right[self.sortProperty()] ? 0 : left[self.sortProperty()] > right[self.sortProperty()] ? -1 : 1;\n        }\n      }\n    });\n  };\n\n  self.findRecord = function (itemId, searchDeep) {\n    var item;\n\n    if (!_h.isNullOrEmpty(self.groupProperty())) {\n      for (var i = 0; i < self.records().length; i++) {\n        var target = self.records()[i];\n\n        if (_h.any(target.list())) {\n          for (var j = 0; j < target.list().length; j++) {\n            if (itemId === target.list()[j].id()) {\n              return target.list()[j];\n            }\n\n            if (searchDeep === true && _h.any(target.list()[j].children())) {\n              item = self.findChildrenRecord(target.list()[j], itemId);\n              if (!_h.isNullOrEmpty(item)) return item;\n            }\n          }\n        }\n      }\n    } else {\n      for (var l = 0; l < self.records().length; l++) {\n        if (itemId === self.records()[l].id()) {\n          return self.records()[l];\n        }\n\n        if (searchDeep === true && _h.any(self.records()[l].children())) {\n          item = self.findChildrenRecord(self.records()[l], itemId);\n          if (!_h.isNullOrEmpty(item)) return item;\n        }\n      }\n    }\n\n    return undefined;\n  };\n\n  self.findChildrenRecord = function (parent, itemId) {\n    for (var i = 0; i < parent.children().length; i++) {\n      var target = parent.children()[i];\n\n      if (target.id() === itemId) {\n        return target;\n      }\n\n      if (_h.any(target.children())) {\n        var item = self.findChildrenRecord(target, itemId);\n        if (!_h.isNullOrEmpty(item)) return item;\n      }\n    }\n  };\n\n  self.getGroupPropertyTitle = function (model) {\n    var groupProp,\n        val = null;\n\n    for (var i = 0; i < self.tableProperties().length; i++) {\n      var col = self.tableProperties()[i];\n      if (col.name === self.groupProperty()) groupProp = col;\n    }\n\n    if (groupProp) {\n      if (groupProp.type === \"enum\") {\n        var temp = model[self.groupProperty()];\n        val = _h.getEnumText(groupProp.name + \"s\", temp);\n      }\n\n      if (groupProp.type === \"string\") {\n        val = model[self.groupProperty()];\n      }\n    }\n\n    return val;\n  };\n\n  self.edit = function (m, mo, e) {\n    var item = m[1];\n\n    switch (self.entityName) {\n      case \"DynamicDocument\":\n        if (!item.validateForm()) {\n          return false;\n        }\n\n        break;\n\n      default:\n        if (!item.validationObject.isValid()) {\n          item.validationObject.errors.showAllMessages();\n          return false;\n        }\n\n        break;\n    }\n\n    var model = item.toServer();\n\n    switch (self.entityName) {\n      case \"MappingRule\":\n        model.balanceSheetId = self.balanceSheetId();\n        break;\n    }\n\n    self.apiService.request({\n      splashId: e,\n      name: \"put\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          switch (self.entityName) {\n            case \"TableTemplate\":\n              //todo   bug remove from editlist\n              self.afterUpdate(data.models);\n              break;\n\n            case \"AdjustmentDocumentItem\":\n              if (!self.adjustmentId()) {\n                self.refreshTable();\n              }\n\n              self.afterUpdate(data.models);\n              break;\n\n            case \"Company\":\n              config.context.collectOpenBranches();\n              config.context.afterUpdate(data.models, true);\n              config.context.configTools();\n              $(\"#tree_view\").treeView(\"expand\", config.context.treeOpenBranches);\n              config.context.getSelectList();\n\n              _h.kocnx().headerSection.resetActiveSelectMenu(true);\n\n              break;\n\n            case \"CompanyInfoData\":\n              self.refreshTable();\n              break;\n\n            default:\n              self.afterUpdate(data.models);\n              break;\n          }\n\n          _h.kocnx().closeForm();\n\n          self.unSelectItem();\n          toast.success(self.entityName, 'put');\n          self.updateExtraParams(data);\n        }\n      },\n      messageType: 'put',\n      messageKey: self.entityName\n    });\n  };\n\n  self.afterUpdate = function (models, searchDeep) {\n    if (_h.any(models)) {\n      for (var i = 0; i < models.length; i++) {\n        var oldRecord = self.findRecord(models[i].id, searchDeep);\n\n        if (_h.isNullOrEmpty(self.groupProperty())) {\n          if (!_h.isNullOrEmpty(oldRecord)) {\n            oldRecord.refreshModel(models[i]);\n          }\n        } else {\n          if (!_h.isNullOrEmpty(oldRecord)) {\n            if (_h.isNullOrEmpty(oldRecord[self.groupProperty()]()) && _h.isNullOrEmpty(models[i][self.groupProperty()]) || oldRecord[self.groupProperty()]() === models[i][self.groupProperty()]) {\n              oldRecord.refreshModel(models[i]);\n            } else {\n              var oldFolder, newFolder, index, uncatFolder, item, object;\n\n              for (var k = 0; k < self.records().length; k++) {\n                if (oldRecord[self.groupProperty()]() === self.records()[k].title) {\n                  oldFolder = self.records()[k];\n                }\n\n                if (models[i][self.groupProperty()] === self.records()[k].title) {\n                  newFolder = self.records()[k];\n                }\n\n                if (_h.isNullOrEmpty(self.records()[k].title) || self.records()[k].title === \"دسته بندی نشده\") {\n                  uncatFolder = self.records()[k];\n\n                  if (_h.isNullOrEmpty(oldRecord[self.groupProperty()]())) {\n                    oldFolder = self.records()[k];\n                  }\n                }\n              }\n\n              if (_h.isNullOrEmpty(newFolder)) {\n                newFolder = uncatFolder;\n              }\n\n              if (!_h.isNullOrEmpty(oldFolder)) {\n                index = oldFolder.list().indexOf(oldRecord);\n\n                if (index > -1) {\n                  item = oldFolder.list.remove(oldRecord);\n                  item = oldRecord;\n\n                  if (!_h.isNullOrEmpty(models[i][self.groupProperty()]) && _h.isNullOrEmpty(item[self.groupProperty()]())) {\n                    newFolder.list.push(item);\n                    item.refreshModel(models[i]);\n                  }\n\n                  if (_h.isNullOrEmpty(models[i][self.groupProperty()]) && !_h.isNullOrEmpty(item[self.groupProperty()]())) {\n                    if (!_h.isNullOrEmpty(uncatFolder)) {\n                      uncatFolder.list.push(item);\n                      item.refreshModel(models[i]);\n                    } else {\n                      object = {\n                        title: \"دسته بندی نشده\",\n                        vis: ko.observable(false),\n                        list: ko.observableArray()\n                      };\n                      object.list.push(item);\n                      item.refreshModel(models[i]);\n                      self.records.push(object);\n                      self.increaseTotal();\n                    }\n                  }\n\n                  if (!_h.isNullOrEmpty(models[i][self.groupProperty()]) && !_h.isNullOrEmpty(item[self.groupProperty()]()) && oldFolder.title !== \"دسته بندی نشده\") {\n                    if (!_h.isNullOrEmpty(newFolder)) {\n                      newFolder.list.push(item);\n                      item.refreshModel(models[i]);\n                    } else {\n                      object = {\n                        title: models[i][self.groupProperty()],\n                        vis: ko.observable(false),\n                        list: ko.observableArray()\n                      };\n                      object.list.push(item);\n                      self.records.push(object);\n                      self.increaseTotal();\n                    }\n                  }\n                }\n              }\n\n              if (self.records().length === 1 && self.records()[0].title === \"دسته بندی نشده\") {\n                item = uncatFolder.list.remove(oldRecord);\n                object = {\n                  title: models[i][self.groupProperty()],\n                  vis: ko.observable(false),\n                  list: ko.observableArray()\n                };\n                oldRecord.refreshModel(models[i]);\n                object.list.push(oldRecord);\n                self.records.push(object);\n                self.increaseTotal();\n              }\n            }\n          }\n        }\n      }\n\n      self.removeEmptyFolders();\n      self.sortAfterChanges();\n    }\n  };\n\n  self.updateExtraParams = function (extraParams) {\n    for (var m in extraParams) {\n      if (extraParams.hasOwnProperty(m)) {\n        var value = extraParams[m];\n\n        if (self[m] && value && m !== \"searchProfiles\") {\n          self[m](value);\n        }\n\n        if (self[m] && value && m === \"searchProfiles\") {\n          for (var i = 0; i < value.length; i++) {\n            self.filterProfiles.push({\n              text: value[i].title,\n              value: value[i].id,\n              filters: value[i].filters\n            });\n          }\n        }\n      }\n    }\n  };\n\n  self.deleteBtn = function () {\n    var selectedRecord = self.multiCommandExecute(\"selectedRowRecord\");\n    var id;\n    var confirmText;\n\n    switch (self.entityName) {\n      case \"AdjustmentDocument\":\n        id = selectedRecord.id();\n\n        if (selectedRecord.confirmationState() === 2) {\n          toast.custom('error', _h.getApiMessage(\"DeleteConfirmed\" + self.entityName + \"Error\"));\n          return;\n        }\n\n        confirmText = toast.createMessage(self.entityName, 'del', null, 'confirm');\n        break;\n\n      case \"Consolidate\":\n        id = selectedRecord.periodId();\n        confirmText = toast.createMessage(self.entityName, 'del', null, 'confirm');\n        break;\n\n      default:\n        id = selectedRecord.id();\n        confirmText = toast.createMessage(self.entityName, 'del', null, 'confirm');\n        break;\n    }\n\n    _h.confirmDeleteAlert(confirmText, function (res) {\n      if (res) {\n        var model = {\n          id: id\n        };\n\n        switch (self.entityName) {\n          case \"AdjustmentDocumentItem\":\n            model.amountType = self.amountType();\n            break;\n\n          case \"CompanyInfoData\":\n            model.formId = self.formId();\n            break;\n        }\n\n        self.apiService.request({\n          name: \"delete\",\n          data: model,\n          success: function success(data) {\n            if (!_h.isNullOrEmpty(data)) {\n              switch (self.entityName) {\n                case \"Company\":\n                  config.context.collectOpenBranches();\n                  self.afterDelete(id, data.models, true);\n                  config.context.configTools();\n                  $(\"#tree_view\").treeView(\"expand\", config.context.treeOpenBranches);\n                  config.context.getSelectList();\n\n                  _h.kocnx().headerSection.resetActiveSelectMenu(true);\n\n                  break;\n\n                case \"AdjustmentDocumentItem\":\n                  if (!self.adjustmentId()) {\n                    self.refreshTable();\n                  } else {\n                    self.afterDelete(id, data.models);\n\n                    _h.kocnx().advm().callBackItemCountData(self.total());\n                  }\n\n                  break;\n\n                case \"Consolidate\":\n                  self.selectedRowRecord(null);\n\n                  _h.kocnx().advm(null);\n\n                  self.afterDelete(id, data.models);\n                  break;\n\n                case \"Tree\":\n                  _h.kocnx().treevm().resetTrees();\n\n                  self.afterDelete(id, data.models);\n                  break;\n\n                default:\n                  self.afterDelete(id, data.models);\n                  break;\n              }\n\n              self.selectedRecord(null);\n              toast.success(self.entityName, 'del');\n              self.updateExtraParams(data);\n            }\n          },\n          messageType: 'del',\n          messageKey: self.entityName\n        });\n      }\n    });\n  };\n\n  self.afterDelete = function (id, models, searchDeep) {\n    var group, record;\n\n    if (!_h.isNullOrEmpty(self.groupProperty())) {\n      for (var i = 0; i < self.records().length; i++) {\n        var target = self.records()[i];\n\n        if (_h.any(target.list())) {\n          for (var j = 0; j < target.list().length; j++) {\n            if (id === target.list()[j].id()) {\n              group = target;\n              record = target.list()[j];\n            }\n          }\n        }\n      }\n\n      if (group && record) {\n        group.list.remove(record);\n      }\n\n      self.removeEmptyFolders();\n    } else {\n      record = self.findRecord(id, searchDeep);\n\n      if (record && record[\"children\"] && !_h.isNullOrEmpty(record.pi()) && searchDeep) {\n        var parent = record.parent();\n        parent.children.remove(record);\n        if (self.entityName === \"Company\" && (_h.isNullOrEmpty(self.searchKey()) || self.searchKey() === \"\")) self.decreaseTotal();\n      }\n\n      if (record && !record[\"children\"] || !searchDeep) {\n        self.records.remove(record);\n        self.decreaseTotal();\n      }\n    }\n\n    if (_h.any(models)) {\n      self.afterUpdate(models, searchDeep);\n    }\n  };\n\n  self.getLastPriority = function (callback, id, e) {\n    var model = {\n      controllerName: self.controllerName,\n      id: id\n    };\n    self.apiService.request({\n      splashId: e,\n      name: \"getLastPriority\",\n      data: model,\n      success: function success(data) {\n        callback(data);\n      },\n      error: function error(data) {\n        toast.error(self.entityName, 'get', 'LastPriority');\n        callback(null);\n      },\n      messageType: 'get',\n      messageKey: \"LastPriority\"\n    });\n  };\n\n  self.upBtn = function () {\n    var item = self.multiCommandExecute(\"selectedRowRecord\");\n    if (item.priority() < 1) return;\n    self.changePriority(item, 1);\n  };\n\n  self.downBtn = function () {\n    var item = self.multiCommandExecute(\"selectedRowRecord\");\n    self.changePriority(item, 2);\n  };\n\n  self.changePriority = function (item, action) {\n    var model = {\n      controllerName: self.controllerName,\n      inputData: {\n        direction: action,\n        id: item.id()\n      }\n    };\n\n    switch (self.entityName) {\n      case \"AdjustmentDocumentItem\":\n        model.inputData.amountType = self.amountType();\n        break;\n\n      case \"MappingRule\":\n        model.inputData.treeId = config.context.treeId();\n        model.inputData.balanceSheetId = config.context.balanceSheetId();\n        break;\n    }\n\n    self.apiService.request({\n      name: \"putpriority\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          self.afterUpdate(data.models);\n          toast.success(self.entityName, 'putUpdate', 'ChangeOrder');\n          self.updateExtraParams(data);\n        }\n      },\n      messageType: 'putUpdate',\n      messageKey: \"ChangeOrder\"\n    });\n  };\n\n  self.disableBtn = function () {\n    var item = self.multiCommandExecute(\"selectedRowRecord\");\n    var idList = [];\n    idList.push(item.id());\n    self.changeStateList(idList, 0, item);\n  };\n\n  self.enableBtn = function () {\n    var item = self.multiCommandExecute(\"selectedRowRecord\");\n    var idList = [];\n    idList.push(item.id());\n    self.changeStateList(idList, 1, item);\n  };\n\n  self.disablesBtn = function () {\n    var idList = self.multiCommandExecute(\"selectedItemIds\");\n\n    if (idList.length === 0) {\n      var text = _h.getApiMessage(\"ActionSelectListEmptyError\");\n\n      _h.warningToast(text);\n    } else {\n      self.changeStateList(idList, 0);\n    }\n  };\n\n  self.enablesBtn = function () {\n    var idList = self.multiCommandExecute(\"selectedItemIds\");\n\n    if (idList.length === 0) {\n      var text = _h.getApiMessage(\"ActionSelectListEmptyError\");\n\n      _h.warningToast(text);\n    } else {\n      self.changeStateList(idList, 1);\n    }\n  };\n\n  self.changeStateList = function (ids, action, itemTarget) {\n    var model = {\n      controllerName: self.controllerName,\n      inputData: {\n        idList: ids,\n        stateType: action\n      }\n    };\n\n    switch (self.entityName) {\n      case \"DynamicTableData\":\n        model.inputData.tableId = self.configTable.context.tableId();\n        break;\n\n      case \"AdjustmentDocumentItem\":\n        model.inputData.amountType = self.amountType();\n        break;\n    }\n\n    self.apiService.request({\n      name: \"putStateType\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          if (ids.length === 1) toast.success(self.entityName, 'putUpdate', 'StateType');\n          if (ids.length > 1) toast.success(self.entityName, 'putUpdate', 'StateTypes');\n\n          switch (self.entityName) {\n            case \"Period\":\n              self.multiCommandExecute(\"changesLocalStateType\", action, ids);\n              break;\n\n            case \"AdjustmentDocument\":\n              self.multiCommandExecute(\"changesLocalStateType\", action, ids);\n\n              if (ids.length === 1) {\n                config.context.changeChildModel(itemTarget, true);\n              }\n\n              break;\n\n            case \"AdjustmentDocumentItem\":\n              if (!self.adjustmentId()) {\n                self.refreshTable();\n              } else {\n                if (_h.any(data.models)) for (var i = 0; i < data.models.length; i++) {\n                  var record = self.findRecord(data.models[i].id);\n\n                  if (record) {\n                    record.refreshModel(data.models[i]);\n                  }\n                }\n              }\n\n              break;\n\n            case \"Company\":\n              self.multiCommandExecute(\"changesLocalStateType\", action, ids);\n              config.context.collectOpenBranches();\n              config.context.configTools();\n              $(\"#tree_view\").treeView(\"expand\", config.context.treeOpenBranches);\n              break;\n\n            default:\n              self.multiCommandExecute(\"changesLocalStateType\", action, ids);\n              break;\n          }\n\n          self.selectedRecord(null);\n          self.selectedRowRecord(null);\n          self.updateExtraParams(data);\n        }\n      },\n      error: function error(data) {\n        if (ids.length === 1) toast.error(self.entityName, 'putUpdate', 'StateType');\n        if (ids.length > 1) toast.error(self.entityName, 'putUpdate', 'StateTypes');\n      }\n    });\n  };\n\n  self.showBlockType = ko.observable(\"fullMaster\");\n\n  self.changeShowBlock = function (type, model, parent, g) {\n    var item = self.multiCommandExecute(\"selectedRowRecord\");\n    if (!item) return;\n\n    switch (type) {\n      case \"sideBySide\":\n        self.showType(\"List\");\n        self.showBlockType(\"sideBySide\");\n        config.context.changeChildModel(item);\n        self.iconSize(\"icon-image-small\");\n        if (!_h.isNullOrEmpty(self.childModel())) self.childModel().iconSize(\"icon-image-small\");\n        self.renderedHandler();\n        setTimeout(function () {\n          $(\".User-tbl\").css(\"table-layout\", \"fixed\");\n        }, 100);\n        break;\n\n      case \"fullMaster\":\n        self.showType(\"Table\");\n        self.showBlockType(\"fullMaster\");\n        self.iconSize(\"icon-image\");\n        if (!_h.isNullOrEmpty(self.childModel())) self.childModel().iconSize(\"icon-image\");\n\n        if (self.entityName === \"User\") {\n          self.childModel(undefined);\n        }\n\n        $(\".row-group\").css(\"display\", \"none\");\n        self.renderedHandler();\n        setTimeout(function () {\n          $(\".row-group\").css(\"display\", \"\");\n          $(\".User-tbl\").css(\"table-layout\", \"auto\");\n        }, 100);\n        break;\n\n      case \"fullDetails\":\n        self.showType(\"Table\");\n        self.showBlockType(\"fullDetails\");\n        self.iconSize(\"icon-image\");\n        if (!_h.isNullOrEmpty(self.childModel())) self.childModel().iconSize(\"icon-image\");\n        self.renderedHandler();\n        break;\n    }\n  };\n\n  self.visibleColCount = ko.computed(function () {\n    var count = 2;\n    if (self.showType() === \"Table\") ko.utils.arrayFilter(self.tableProperties(), function (col) {\n      if (col.visibleCol() === true) {\n        count++;\n      }\n    });else ko.utils.arrayFilter(self.tableProperties(), function (col) {\n      if (col.visibleItem() === true) {\n        count++;\n      }\n    });\n    return count;\n  });\n  self.menuItems = ko.computed(function () {\n    if (!_h.any(self.configTable.buttons)) return [];\n    var array = [];\n    var textPrefix = self.entityName.indexOf(\"Item\") !== -1 ? \"ItemCaption\" : \"Caption\";\n\n    for (var i = 0; i < self.configTable.buttons.length; i++) {\n      if (self.configTable.buttons[i].cMenu) array.push({\n        visName: 'vis' + self.configTable.buttons[i].name,\n        text: _h.getLocalizedText(self.configTable.buttons[i].name + textPrefix, self.entityName),\n        visible: self['vis' + self.configTable.buttons[i].name](),\n        action: config.context[self.configTable.buttons[i].name + \"Btn\"],\n        icon: self.configTable.buttons[i].icon\n      });\n    }\n\n    return array;\n  });\n\n  self.increaseTotal = function () {\n    self.total(self.total() + 1);\n  };\n\n  self.decreaseTotal = function () {\n    self.total(self.total() - 1);\n  };\n\n  self.removeEmptyFolders = function () {\n    if (!_h.isNullOrEmpty(self.groupProperty())) {\n      var rArray = [];\n\n      if (_h.any(self.records())) {\n        for (var i = 0; i < self.records().length; i++) {\n          var item = self.records()[i];\n          if (item.list().length === 0) rArray.push(i);\n        }\n\n        if (_h.any(rArray)) for (var j = 0; j < rArray.length; j++) {\n          self.records.splice(rArray[j], 1);\n        }\n      }\n    }\n  };\n\n  self.colSpan = ko.observable();\n\n  self.renderedHandler = function () {\n    if (self.groupProperty()) {\n      var en = self.entityName;\n      var table = $(\".\" + en + \"-tbl\");\n      var colList = table.find(\"thead th:visible\");\n      self.colSpan(colList.length - 1);\n    }\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/master/baseViewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/master/cmdMessages.js":
/*!*************************************************!*\
  !*** ./src/scripts/pages/master/cmdMessages.js ***!
  \*************************************************/
/***/ (() => {

eval("window.cmdMessages = {\n  100: {\n    fa: 'لیست پارامترهای ارسال شده کمتر از تعداد مورد نیاز است'\n  },\n  101: {\n    fa: 'تعداد پارامترهای ارسال شده بیش از تعداد مجاز است'\n  },\n  102: {\n    fa: 'در خواندن پارامترهای ارسالی مشکلی به وجود آمده است'\n  },\n  103: {\n    fa: 'عملیات در پس زمینه در حال اجرا می باشد و پس از اتمام بسته خواهد شد '\n  },\n  200: {\n    fa: 'پارامتر کانکشن استرینگ خالی است'\n  },\n  201: {\n    fa: 'پارامتر کوئری خالی است'\n  },\n  202: {\n    fa: 'پارامتر مسیر ذخیره فایل خروجی خالی است'\n  },\n  203: {\n    fa: 'پارامتر نام فایل خروجی خالی است'\n  },\n  204: {\n    fa: 'پارامتر تعداد فیلذهای برگشتی در هر رکورد خالی است'\n  },\n  205: {\n    fa: 'باز کردن اتصال به اسکیوال سرور با خطا مواجه شد'\n  },\n  206: {\n    fa: 'اجرای کوئری با خطا مواجه شد'\n  },\n  207: {\n    fa: 'کوئری مورد نظر هیچ رکورد خروجی ندارد'\n  },\n  208: {\n    fa: 'تعداد فیلدهای رکوردهای خروجی کوئری با تعداد فیلدهای درخواست شده برابر نیست '\n  },\n  209: {\n    fa: 'در خواندن رکوردهای خروجی مشکلی پیش آمده است'\n  },\n  400: {\n    fa: 'در تولید فایل خروجی مشکلی پیش آمده است'\n  },\n  500: {\n    fa: 'در مراحل اجرای درخواست مشکل ناشناخته ای رخ داده است'\n  },\n  4: {\n    fa: 'در اجرای ماژول خطایی رخ داده است'\n  },\n  600: {\n    fa: 'فرمت تاریخ شروع صحیح نیست'\n  },\n  601: {\n    fa: 'فرمت تاریخ پایان صحیح نیست'\n  },\n  602: {\n    fa: 'فرمت فیلدهای ورودی صحیح نیست'\n  },\n  603: {\n    fa: 'ارتباط با سرور قطع است'\n  },\n  604: {\n    fa: 'خطای ناشناخته ای رخ داده است'\n  },\n  605: {\n    fa: 'داده ای وجود ندارد'\n  },\n  606: {\n    fa: 'ستون کد تراز نمی تواند خالی باشد'\n  },\n  607: {\n    fa: 'تراز دارای کد تکراری است'\n  },\n  608: {\n    fa: 'تراز بالانس نیست'\n  },\n  609: {\n    fa: 'مشکلی در داده های دریافتی وجود دارد'\n  },\n  610: {\n    fa: 'فرمت ستون های جدول انتخابی صحیح نیست'\n  },\n  611: {\n    fa: '\tمسیر ساخت فایل نامشخص است'\n  },\n  612: {\n    fa: '\tتاریخ شروع نمی تواند پس از تاریخ پایان باشد'\n  },\n  613: {\n    fa: '\tتاریخ شروع نمی تواند قبل از شروع دوره مالی باشد'\n  },\n  614: {\n    fa: '\tتاریخ پایان نمی تواند بعد از پایان دوره مالی باشد'\n  },\n  615: {\n    fa: '\tنام فایل نامشخص است'\n  },\n  616: {\n    fa: '\tدوره مالی نامشخص است'\n  },\n  617: {\n    fa: 'نام ارتباط نامشخص است'\n  },\n  618: {\n    fa: 'ارتباطی با این نام وجود ندارد'\n  },\n  619: {\n    fa: 'آی دی شرکت نامشخص است'\n  },\n  620: {\n    fa: 'فرمت لیست اسناد صحیح نیست'\n  },\n  621: {\n    fa: 'فرمت بازه اسناد صحیح نیست'\n  },\n  700: {\n    fa: 'اطلاعات دوره مالی نامشخص است'\n  },\n  701: {\n    fa: 'فرمت فیلد فعال صحیح نیست'\n  },\n  702: {\n    fa: 'فایل تراز انتخاب نشده است'\n  },\n  703: {\n    fa: 'فرمت داده ی ستون مانده بدهکار یا بستانکار عدد بدون اعشار نیست'\n  },\n  704: {\n    fa: 'ستون نام حساب نمی تواند خالی باشد'\n  },\n  705: {\n    fa: 'ستون مانده بدهکار و بستانکار نمی توانند هر دو دارای مقدار باشند'\n  },\n  706: {\n    fa: 'تعداد ستون داده های دریافتی نامشخص است'\n  },\n  707: {\n    fa: 'تمام کدهای تراز دارای الگوی نگاشت نیستند'\n  },\n  708: {\n    fa: 'دیتاهای ورودی لازم در مدیریت ارتباط این شرکت وجود ندارند'\n  },\n  709: {\n    fa: 'بازه ی تاریخ شروع و پایان در بیش از یک سال مالی قرار دارد'\n  },\n  710: {\n    fa: 'فرمت لیست اسناد / بازه اسناد صحیح نیست'\n  },\n  800: {\n    fa: 'درخت نامشخص است'\n  },\n  801: {\n    fa: 'نباید ترازی بر روی درختواره اعمال اثر شده باشد'\n  },\n  802: {\n    fa: 'هیچ نگاشتی روی برگ های انتخابی وجود ندارد'\n  },\n  803: {\n    fa: 'بر روی گره های منتخب نگاشتی اعمال اثر نشده است'\n  },\n  804: {\n    fa: 'دوره مالی مبدا وجود ندارد'\n  },\n  805: {\n    fa: 'دوره مالی مقصد وجود ندارد'\n  },\n  806: {\n    fa: 'استاندارد درختواره وجود ندارد'\n  },\n  807: {\n    fa: 'درختی با آی دی وارد شده در دوره مالی مبدا وجود ندارد'\n  },\n  808: {\n    fa: 'یکی از فیلدهای مشخص کننده نحوه محاسبه باید دارای مقدار باشند'\n  },\n  809: {\n    fa: 'فرمت فیلد حداکثر تعداد مشتریان باید عددی باشد'\n  },\n  810: {\n    fa: 'در فیلد افشای الزامی مشتریان باید کد یا کدهای تفصیل وارد نمایید'\n  },\n  811: {\n    fa: 'در فیلد عدم افشای مشتریان باید کد یا کد های تفصیل وارد نمایید'\n  },\n  812: {\n    fa: 'در فیلد اعمال در شاخه ها باید کد یا کدهای درختواره وارد نمایید'\n  },\n  813: {\n    fa: 'فرمت فیلد درصد صحیح نیست'\n  },\n  814: {\n    fa: 'فرمت فیلد تعداد صحیح نیست'\n  },\n  815: {\n    fa: 'فرمت فیلد مبلغ صحیح نیست'\n  },\n  816: {\n    fa: 'مقدار فیلد حداکثر تعداد مشتریان باید بزرگتر از صفر باشد'\n  },\n  817: {\n    fa: 'فیلد تعداد نمی تواند بزرگتر از فیلد حداکثر تعداد مشتریان باشد'\n  },\n  818: {\n    fa: 'داده های تمام جداول حذف نشدند'\n  },\n  819: {\n    fa: 'وضعیت تمام اسناد به محاسبه نشده تغییر نکرد'\n  },\n  820: {\n    fa: 'فرمت کد یا کدهای معین وارد شده صحیح نیست'\n  },\n  821: {\n    fa: 'حداقل یک کد ارز باید وارد نمایید'\n  },\n  822: {\n    fa: 'در لیست کدهای ارز مقدار خالی وجود دارد'\n  },\n  823: {\n    fa: 'کد یا کد های درختواره وارد شده در لیست شاخه های سایر نیستند'\n  },\n  824: {\n    fa: 'ترازی بر روی درختواره تکسونومی گروه بانک ملت اعمال اثر نشده است',\n    en: ''\n  },\n  825: {\n    fa: 'نباید ترازی بر روی درختواره تسهیلات دولتی و غیر دولتی اعمال اثر شده باشد',\n    en: ''\n  },\n  826: {\n    fa: 'نباید ترازی بر روی درختواره سپرده اعمال اثر شده باشد',\n    en: ''\n  },\n  827: {\n    fa: 'نباید ترازی بر روی درختواره گردش اعمال اثر شده باشد',\n    en: ''\n  },\n  828: {\n    fa: 'ترازی بر روی درختواره تسهیلات دولتی و غیر دولتی اعمال اثر نشده است',\n    en: ''\n  },\n  829: {\n    fa: 'ترازی بر روی درختواره سپرده اعمال اثر نشده است',\n    en: ''\n  },\n  830: {\n    fa: 'تراز های معادل باید روی درختواره تکسونومی گروه بانک ملت اعمال اثر شده باشند',\n    en: ''\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/pages/master/cmdMessages.js?");

/***/ }),

/***/ "./src/scripts/pages/master/model.js":
/*!*******************************************!*\
  !*** ./src/scripts/pages/master/model.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"AppConfigForm\": () => (/* binding */ AppConfigForm),\n/* harmony export */   \"AppVersion\": () => (/* binding */ AppVersion),\n/* harmony export */   \"BlockIpAddress\": () => (/* binding */ BlockIpAddress),\n/* harmony export */   \"ChangeLogViewModel\": () => (/* binding */ ChangeLogViewModel),\n/* harmony export */   \"Column\": () => (/* binding */ Column),\n/* harmony export */   \"ColumnSelectItem\": () => (/* binding */ ColumnSelectItem),\n/* harmony export */   \"CompanySelectItem\": () => (/* binding */ CompanySelectItem),\n/* harmony export */   \"CompanyTokenInfo\": () => (/* binding */ CompanyTokenInfo),\n/* harmony export */   \"Connection\": () => (/* binding */ Connection),\n/* harmony export */   \"ConnectionManager\": () => (/* binding */ ConnectionManager),\n/* harmony export */   \"ConnectionParameter\": () => (/* binding */ ConnectionParameter),\n/* harmony export */   \"DesignItem\": () => (/* binding */ DesignItem),\n/* harmony export */   \"FileUploadForm\": () => (/* binding */ FileUploadForm),\n/* harmony export */   \"Folder\": () => (/* binding */ Folder),\n/* harmony export */   \"FolderManagement\": () => (/* binding */ FolderManagement),\n/* harmony export */   \"Help\": () => (/* binding */ Help),\n/* harmony export */   \"HelpViewModel\": () => (/* binding */ HelpViewModel),\n/* harmony export */   \"LoginHistory\": () => (/* binding */ LoginHistory),\n/* harmony export */   \"LoginViewModel\": () => (/* binding */ LoginViewModel),\n/* harmony export */   \"MagazineFile\": () => (/* binding */ MagazineFile),\n/* harmony export */   \"Menu\": () => (/* binding */ Menu),\n/* harmony export */   \"ModuleConnectionProperties\": () => (/* binding */ ModuleConnectionProperties),\n/* harmony export */   \"NodeReportForm\": () => (/* binding */ NodeReportForm),\n/* harmony export */   \"NodeReportSelect\": () => (/* binding */ NodeReportSelect),\n/* harmony export */   \"PeriodInfo\": () => (/* binding */ PeriodInfo),\n/* harmony export */   \"PeriodSelectItem\": () => (/* binding */ PeriodSelectItem),\n/* harmony export */   \"ProcessItem\": () => (/* binding */ ProcessItem),\n/* harmony export */   \"ProcessQueue\": () => (/* binding */ ProcessQueue),\n/* harmony export */   \"ReportGroup\": () => (/* binding */ ReportGroup),\n/* harmony export */   \"ReportPreview\": () => (/* binding */ ReportPreview),\n/* harmony export */   \"ReportPreviewColumn\": () => (/* binding */ ReportPreviewColumn),\n/* harmony export */   \"ReportPreviewRow\": () => (/* binding */ ReportPreviewRow),\n/* harmony export */   \"ResetPasswordModel\": () => (/* binding */ ResetPasswordModel),\n/* harmony export */   \"ResultConnectionProperties\": () => (/* binding */ ResultConnectionProperties),\n/* harmony export */   \"SecurityConfig\": () => (/* binding */ SecurityConfig),\n/* harmony export */   \"SelectItem\": () => (/* binding */ SelectItem),\n/* harmony export */   \"TableSelectItem\": () => (/* binding */ TableSelectItem),\n/* harmony export */   \"TableTemplateInfo\": () => (/* binding */ TableTemplateInfo),\n/* harmony export */   \"TipItem\": () => (/* binding */ TipItem),\n/* harmony export */   \"TreeAdjustmentSelectItem\": () => (/* binding */ TreeAdjustmentSelectItem),\n/* harmony export */   \"TreeBalanceReportSelectItem\": () => (/* binding */ TreeBalanceReportSelectItem),\n/* harmony export */   \"TreeFormulaMakerSelectItem\": () => (/* binding */ TreeFormulaMakerSelectItem),\n/* harmony export */   \"TreeFormulaSelectItem\": () => (/* binding */ TreeFormulaSelectItem),\n/* harmony export */   \"TreeMapSelect\": () => (/* binding */ TreeMapSelect),\n/* harmony export */   \"TreeSelectItem\": () => (/* binding */ TreeSelectItem),\n/* harmony export */   \"UserProfile\": () => (/* binding */ UserProfile)\n/* harmony export */ });\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar _require = __webpack_require__(/*! ./baseModels.js */ \"./src/scripts/pages/master/baseModels.js\"),\n    BaseInnerModel = _require.BaseInnerModel,\n    FormBuilder = _require.FormBuilder,\n    BaseModel = _require.BaseModel,\n    BaseInfoModel = _require.BaseInfoModel,\n    BaseSecondaryForm = _require.BaseSecondaryForm;\n\n\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\nvar SelectItem = /*#__PURE__*/function (_BaseInnerModel) {\n  _inherits(SelectItem, _BaseInnerModel);\n\n  var _super = _createSuper(SelectItem);\n\n  function SelectItem(model) {\n    var _this;\n\n    _classCallCheck(this, SelectItem);\n\n    _this = _super.call(this, model);\n    if (!_this[\"selected\"]) _this.selected = ko.observable(false);\n    return _this;\n  }\n\n  return _createClass(SelectItem);\n}(BaseInnerModel);\nvar DesignItem = /*#__PURE__*/_createClass(function DesignItem(model) {\n  _classCallCheck(this, DesignItem);\n\n  this.text = ko.observable(model.text);\n  this.value = ko.observable(model.value);\n  this.type = ko.observable(model.type);\n  this.active = ko.observable(model.active);\n  this.previewMode = ko.observable(false);\n  this.triggerEditable = ko.observable(false);\n  this.refreshToolBar = ko.observable(false);\n  this.editable = ko.observable(model.editable || false);\n  this.lockedBy = ko.observable(model.lockedBy);\n  this.lockedByUserId = ko.observable(model.lockedByUserId);\n  this.lockedCaption = ko.pureComputed(function () {\n    var lockedBy = this.lockedBy();\n    if (lockedBy) return \"قفل شده توسط \" + lockedBy;\n  }, this);\n});\nvar TreeMapSelect = /*#__PURE__*/function (_BaseInnerModel2) {\n  _inherits(TreeMapSelect, _BaseInnerModel2);\n\n  var _super2 = _createSuper(TreeMapSelect);\n\n  function TreeMapSelect(model) {\n    var _this2;\n\n    _classCallCheck(this, TreeMapSelect);\n\n    _this2 = _super2.call(this, model);\n    _this2.currencyType = ko.observable(model[\"currencyType\"]);\n    return _this2;\n  }\n\n  return _createClass(TreeMapSelect);\n}(BaseInnerModel);\nvar ColumnSelectItem = /*#__PURE__*/function (_BaseInnerModel3) {\n  _inherits(ColumnSelectItem, _BaseInnerModel3);\n\n  var _super3 = _createSuper(ColumnSelectItem);\n\n  function ColumnSelectItem(model) {\n    var _this3;\n\n    _classCallCheck(this, ColumnSelectItem);\n\n    _this3 = _super3.call(this, model);\n    _this3.selected = ko.observable();\n    _this3.enumValues = ko.observableArray();\n\n    if (_h.any(model.values)) {\n      for (var i = 0; i < model.values.length; i++) {\n        var val = model.values[i];\n        if (_typeof(val) === 'object') _this3.enumValues.push(new SelectItem(val));else _this3.enumValues.push(new SelectItem({\n          text: val,\n          value: val\n        }));\n      }\n    }\n\n    return _this3;\n  }\n\n  return _createClass(ColumnSelectItem);\n}(BaseInnerModel);\nvar TableSelectItem = /*#__PURE__*/function (_BaseInnerModel4) {\n  _inherits(TableSelectItem, _BaseInnerModel4);\n\n  var _super4 = _createSuper(TableSelectItem);\n\n  function TableSelectItem(model) {\n    var _this4;\n\n    _classCallCheck(this, TableSelectItem);\n\n    _this4 = _super4.call(this, model);\n    _this4.fields = ko.observableArray();\n    if (_h.any(model.fields)) for (var j = 0; j < model.fields.length; j++) {\n      var field = new ColumnSelectItem(model.fields[j]);\n\n      _this4.fields.push(field);\n    }\n    return _this4;\n  }\n\n  return _createClass(TableSelectItem);\n}(BaseInnerModel);\nvar CompanySelectItem = /*#__PURE__*/function (_BaseInnerModel5) {\n  _inherits(CompanySelectItem, _BaseInnerModel5);\n\n  var _super5 = _createSuper(CompanySelectItem);\n\n  function CompanySelectItem(model) {\n    var _this5;\n\n    _classCallCheck(this, CompanySelectItem);\n\n    _this5 = _super5.call(this, model);\n    _this5.disabled = ko.observable(false);\n    _this5.hide = ko.observable(false);\n    return _this5;\n  }\n\n  return _createClass(CompanySelectItem);\n}(BaseInnerModel);\nvar TreeBalanceReportSelectItem = /*#__PURE__*/function (_BaseInnerModel6) {\n  _inherits(TreeBalanceReportSelectItem, _BaseInnerModel6);\n\n  var _super6 = _createSuper(TreeBalanceReportSelectItem);\n\n  function TreeBalanceReportSelectItem(model) {\n    var _this6;\n\n    _classCallCheck(this, TreeBalanceReportSelectItem);\n\n    _this6 = _super6.call(this, model);\n    _this6.selected = ko.observable();\n    return _this6;\n  }\n\n  return _createClass(TreeBalanceReportSelectItem);\n}(BaseInnerModel);\nvar TreeSelectItem = /*#__PURE__*/function (_BaseInnerModel7) {\n  _inherits(TreeSelectItem, _BaseInnerModel7);\n\n  var _super7 = _createSuper(TreeSelectItem);\n\n  function TreeSelectItem(model) {\n    var _this7;\n\n    _classCallCheck(this, TreeSelectItem);\n\n    _this7 = _super7.call(this, model);\n    _this7.text = ko.observable(model.name);\n    _this7.value = ko.observable(model.id);\n    _this7.files = model.files;\n    return _this7;\n  }\n\n  return _createClass(TreeSelectItem);\n}(BaseInnerModel);\nvar TreeAdjustmentSelectItem = /*#__PURE__*/function (_BaseInnerModel8) {\n  _inherits(TreeAdjustmentSelectItem, _BaseInnerModel8);\n\n  var _super8 = _createSuper(TreeAdjustmentSelectItem);\n\n  function TreeAdjustmentSelectItem(model) {\n    var _this8;\n\n    _classCallCheck(this, TreeAdjustmentSelectItem);\n\n    _this8 = _super8.call(this, model);\n    _this8.items = ko.observableArray();\n    if (_h.any(model.items)) for (var i = 0; i < model.items.length; i++) {\n      _this8.items.push(new SelectItem(model.items[i]));\n    }\n    return _this8;\n  }\n\n  return _createClass(TreeAdjustmentSelectItem);\n}(BaseInnerModel);\nvar CompanyTokenInfo = /*#__PURE__*/function () {\n  function CompanyTokenInfo(model, companyId) {\n    _classCallCheck(this, CompanyTokenInfo);\n\n    this.id = ko.observable(model.id);\n    this.name = ko.observable(model.name);\n    this.show = ko.observable(true);\n    this.selected = ko.observable(model.id === companyId);\n    this.preSelected = ko.observable(false);\n    this.periods = ko.observableArray();\n    this.fillPeriods(model.periods);\n  }\n\n  _createClass(CompanyTokenInfo, [{\n    key: \"fillPeriods\",\n    value: function fillPeriods(list) {\n      this.periods.removeAll();\n\n      if (_h.any(list)) {\n        for (var i = 0; i < list.length; i++) {\n          var target = list[i];\n          this.periods.push(new PeriodInfo(target));\n        }\n      }\n    }\n  }]);\n\n  return CompanyTokenInfo;\n}();\nvar PeriodInfo = /*#__PURE__*/function (_BaseInfoModel) {\n  _inherits(PeriodInfo, _BaseInfoModel);\n\n  var _super9 = _createSuper(PeriodInfo);\n\n  function PeriodInfo(model) {\n    var _this9;\n\n    _classCallCheck(this, PeriodInfo);\n\n    _this9 = _super9.call(this, model);\n    _this9.preSelected = ko.observable(model.selected || false);\n    _this9.getColorRow = ko.pureComputed(function () {\n      if (this.stateType === 0) return '#ccc';\n      if (this.closed) return 'red';\n      return 'black';\n    }.bind(_assertThisInitialized(_this9)));\n    return _this9;\n  }\n\n  return _createClass(PeriodInfo);\n}(BaseInfoModel);\nvar PeriodSelectItem = /*#__PURE__*/function (_BaseInnerModel9) {\n  _inherits(PeriodSelectItem, _BaseInnerModel9);\n\n  var _super10 = _createSuper(PeriodSelectItem);\n\n  function PeriodSelectItem(model) {\n    var _this10;\n\n    _classCallCheck(this, PeriodSelectItem);\n\n    _this10 = _super10.call(this, model);\n    _this10.description = model.description;\n    return _this10;\n  }\n\n  return _createClass(PeriodSelectItem);\n}(BaseInnerModel);\nfunction Column(item, parent) {\n  var self = this;\n  self.parentContext = parent;\n  self.colParent = item.colParent;\n  self.name = item.colName;\n  self.fa = item.fa;\n  self.tablecol = item.tablecol;\n  self.sortDir = ko.observable(item.sortDir);\n  self.visibleCol = ko.observable(item.visibleCol);\n  self.visibleItem = ko.observable(item.visibleItem || false);\n  self.activeGroupBy = ko.observable(item.activeGroupBy);\n  self.groupDir = ko.observable(item.groupDir);\n  self.groupBy = item.groupBy;\n  self.className = item.className;\n  self.size = item.size;\n  self.width = item.width;\n  self.type = item.type;\n  self.alias = item.alias;\n  self.template = item.template;\n  self.popup = item.popup;\n  self.click = item.click;\n  self.disableSort = item.disableSort;\n  self.enumSourceName = item.enumSourceName;\n  self.templateName = item.templateName;\n  self.filterType = item.filterType || false;\n  self.randomId = Math.random() * (10000000 - 100) + 100;\n  self.createTagId = ko.computed(function () {\n    return \"col-\" + self.randomId;\n  });\n  self.sortDir.subscribe(function (newValue) {\n    if (newValue !== undefined && newValue !== null && self.parentContext) {\n      _h.kocnx().saveTableState(self.parentContext);\n    }\n  });\n  self.visibleCol.subscribe(function (newValue) {\n    if (newValue !== undefined && newValue !== null && self.parentContext) {\n      _h.kocnx().saveTableState(self.parentContext);\n\n      setTimeout(function () {\n        self.parentContext.renderedHandler();\n      }, 1);\n    }\n  });\n  self.visibleItem.subscribe(function (newValue) {\n    if (newValue !== undefined && newValue !== null && self.parentContext) {\n      self.parentContext.checkVisibleItem(self);\n\n      _h.kocnx().saveTableState(self.parentContext);\n\n      setTimeout(function () {\n        self.parentContext.renderedHandler();\n      }, 1);\n    }\n  });\n\n  self.getSize = function () {\n    if (self.width) return self.width + \"px\";else return self.size + \"%\";\n  };\n\n  self.getClass = function () {\n    return \"col-title \" + self.type + \"-ty\";\n  };\n}\n;\nvar TreeFormulaSelectItem = /*#__PURE__*/function (_BaseInfoModel2) {\n  _inherits(TreeFormulaSelectItem, _BaseInfoModel2);\n\n  var _super11 = _createSuper(TreeFormulaSelectItem);\n\n  function TreeFormulaSelectItem(model) {\n    _classCallCheck(this, TreeFormulaSelectItem);\n\n    return _super11.call(this, model);\n  }\n\n  return _createClass(TreeFormulaSelectItem);\n}(BaseInfoModel);\nvar TreeFormulaMakerSelectItem = /*#__PURE__*/function (_BaseInfoModel3) {\n  _inherits(TreeFormulaMakerSelectItem, _BaseInfoModel3);\n\n  var _super12 = _createSuper(TreeFormulaMakerSelectItem);\n\n  function TreeFormulaMakerSelectItem(model) {\n    var _this11;\n\n    _classCallCheck(this, TreeFormulaMakerSelectItem);\n\n    _this11 = _super12.call(this, model);\n    _this11.valueTypeText = _h.getEnumText(valueTypes, model.valueType);\n    _this11.disabled = ko.observable(false);\n    _this11.hide = ko.observable(false);\n    return _this11;\n  }\n\n  return _createClass(TreeFormulaMakerSelectItem);\n}(BaseInfoModel);\nvar UserProfile = /*#__PURE__*/function (_BaseSecondaryForm) {\n  _inherits(UserProfile, _BaseSecondaryForm);\n\n  var _super13 = _createSuper(UserProfile);\n\n  function UserProfile(viewmodel, model) {\n    var _this12;\n\n    _classCallCheck(this, UserProfile);\n\n    _this12 = _super13.call(this, viewmodel, [{\n      name: \"id\",\n      type: \"ob\",\n      val: model.id\n    }, {\n      name: \"firstName\",\n      type: \"ob\",\n      val: model.firstName\n    }, {\n      name: \"lastName\",\n      type: \"ob\",\n      val: model.lastName\n    }, {\n      name: \"userName\",\n      type: \"ob\",\n      val: model.userName\n    }, {\n      name: \"mobile\",\n      type: \"ob\",\n      val: model.mobile\n    }, {\n      name: \"email\",\n      type: \"ob\",\n      val: model.email\n    }, {\n      name: \"phoneNumber\",\n      type: \"ob\",\n      val: model.phoneNumber\n    }, {\n      name: \"fax\",\n      type: \"ob\",\n      val: model.fax\n    }, {\n      name: \"location\",\n      type: \"ob\",\n      val: model.location\n    }], \"userProfileCaption\");\n\n    _this12.setValidationObject();\n\n    _this12.createForm();\n\n    return _this12;\n  }\n\n  _createClass(UserProfile, [{\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      this.validationObject = ko.validatedObservable({\n        firstName: self.firstName.extend({\n          required: true,\n          minLength: 3,\n          maxLength: 32,\n          persianOnly: null\n        }),\n        lastName: self.lastName.extend({\n          required: true,\n          minLength: 3,\n          maxLength: 32,\n          persianOnly: null\n        }),\n        userName: this.userName.extend({\n          required: true,\n          minLength: 4,\n          remoteIsUniqueRule: {\n            params: [this.id, \"User\", \"userName\"]\n          },\n          userNameValidation: null,\n          maxLength: 20\n        }),\n        email: self.email.extend({\n          englishOnly: null,\n          email: true\n        }),\n        mobile: self.mobile.extend({\n          persianMobile: null,\n          numberOnly: null,\n          minLength: {\n            params: 11,\n            message: \"شماره تلفن همراه باید 11 کاراکتر عددی باشد\"\n          },\n          maxLength: {\n            params: 11,\n            message: \"شماره تلفن همراه باید 11 کاراکتر عددی باشد\"\n          }\n        }),\n        phoneNumber: self.phoneNumber.extend({\n          phoneNumberCheck: null\n        }),\n        fax: self.fax.extend({\n          phoneNumberCheck: null\n        }),\n        location: self.location.extend({\n          maxLength: 32,\n          persianOnly: null\n        })\n      });\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'txb',\n        val: this.firstName\n      }, {\n        t: 'txb',\n        val: this.lastName\n      }, true, 0), this.createLine({\n        t: 'txb',\n        val: this.userName\n      }, {\n        t: 'txb',\n        val: this.email\n      }, true, 30), this.createLine({\n        t: 'txb',\n        val: this.phoneNumber\n      }, {\n        t: 'txb',\n        val: this.mobile\n      }, true, 30), this.createLine({\n        t: 'txb',\n        val: this.location\n      }, {\n        t: 'txb',\n        val: this.fax\n      }, true, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'editFormBtn',\n            vis: true,\n            click: this.parentVM.editUserProfile\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return UserProfile;\n}(BaseSecondaryForm);\nvar ResetPasswordModel = /*#__PURE__*/function (_BaseSecondaryForm2) {\n  _inherits(ResetPasswordModel, _BaseSecondaryForm2);\n\n  var _super14 = _createSuper(ResetPasswordModel);\n\n  function ResetPasswordModel(viewModel, model) {\n    var _this13;\n\n    _classCallCheck(this, ResetPasswordModel);\n\n    _this13 = _super14.call(this, viewModel, [{\n      name: \"userId\",\n      type: \"ob\",\n      val: model[\"userId\"]\n    }, {\n      name: \"currentPassword\",\n      type: \"ob\"\n    }, {\n      name: \"newPassword\",\n      type: \"ob\"\n    }, {\n      name: \"confirmNewPassword\",\n      type: \"ob\"\n    }], \"adminResetPasswordCaption\");\n\n    _this13.setValidationObject(model);\n\n    _this13.createForm();\n\n    return _this13;\n  }\n\n  _createClass(ResetPasswordModel, [{\n    key: \"setValidationObject\",\n    value: function setValidationObject(model) {\n      var obj = {};\n      var self = this;\n\n      var min = _h.getSd().pmc;\n\n      if (!model.userId) obj.currentPassword = self.currentPassword.extend({\n        englishOnly: 1,\n        required: true\n      });\n      obj.newPassword = self.newPassword.extend({\n        required: true,\n        englishOnly: true,\n        passwordComplexity: [min]\n      });\n      obj.confirmNewPassword = self.confirmNewPassword.extend({\n        confirmPassword: {\n          params: self.newPassword\n        },\n        required: true\n      });\n      self.validationObject = ko.validatedObservable(obj);\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [];\n      if (_h.isNullOrEmpty(this.userId())) controls.push(this.createLine({\n        t: 'txb',\n        val: this.currentPassword,\n        type: 'password'\n      }, null, true, 30));\n      controls.push(this.createLine({\n        t: 'txb',\n        val: this.newPassword,\n        type: 'password'\n      }, {\n        t: 'txb',\n        val: this.confirmNewPassword,\n        type: 'password'\n      }, true, 30));\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'editFormBtn',\n            vis: true,\n            click: !_h.isNullOrEmpty(this.userId()) ? this.parentVM.adminResetPassword : _h.kocnx().editChangePassword\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return ResetPasswordModel;\n}(BaseSecondaryForm);\nvar Menu = /*#__PURE__*/function (_BaseInfoModel4) {\n  _inherits(Menu, _BaseInfoModel4);\n\n  var _super15 = _createSuper(Menu);\n\n  function Menu(model) {\n    var _this14;\n\n    _classCallCheck(this, Menu);\n\n    _this14 = _super15.call(this, model);\n    _this14.disable = ko.observable(model.disable);\n    _this14.active = ko.observable(model.active);\n    return _this14;\n  }\n\n  return _createClass(Menu);\n}(BaseInfoModel);\nvar MagazineFile = /*#__PURE__*/function (_BaseModel) {\n  _inherits(MagazineFile, _BaseModel);\n\n  var _super16 = _createSuper(MagazineFile);\n\n  function MagazineFile(model) {\n    _classCallCheck(this, MagazineFile);\n\n    return _super16.call(this, model);\n  }\n\n  return _createClass(MagazineFile);\n}(BaseModel);\nvar ChangeLogViewModel = /*#__PURE__*/function (_FormBuilder) {\n  _inherits(ChangeLogViewModel, _FormBuilder);\n\n  var _super17 = _createSuper(ChangeLogViewModel);\n\n  function ChangeLogViewModel() {\n    var _this15;\n\n    _classCallCheck(this, ChangeLogViewModel);\n\n    _this15 = _super17.call(this);\n    _this15.caption = ko.observable(_h.getLocalizedText(\"changeslogCaption\"));\n    _this15.appVersions = ko.observableArray();\n\n    _this15.init();\n\n    _this15.createForm();\n\n    return _this15;\n  }\n\n  _createClass(ChangeLogViewModel, [{\n    key: \"init\",\n    value: function init() {\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/changelog/filterby\",\n        data: {\n          id: this.id\n        },\n        success: function (data) {\n          this.appVersions.removeAll();\n          if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n            var target2 = data[j];\n            var record2 = new AppVersion(target2);\n            this.appVersions.push(record2);\n          }\n        }.bind(this),\n        error: function error(data) {\n          var text = _h.getApiMessage(\"ErrorLoadVersion\");\n\n          _h.failToast(text);\n        }\n      });\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'changelog-content-f'\n      }, undefined, true, 30, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return ChangeLogViewModel;\n}(FormBuilder);\nvar AppVersion = /*#__PURE__*/function (_BaseInfoModel5) {\n  _inherits(AppVersion, _BaseInfoModel5);\n\n  var _super18 = _createSuper(AppVersion);\n\n  function AppVersion(model) {\n    var _this16;\n\n    _classCallCheck(this, AppVersion);\n\n    _this16 = _super18.call(this, model);\n    _this16.changeLogs = ko.observableArray(model.changeLogs);\n    return _this16;\n  }\n\n  return _createClass(AppVersion);\n}(BaseInfoModel);\nvar HelpViewModel = /*#__PURE__*/function (_FormBuilder2) {\n  _inherits(HelpViewModel, _FormBuilder2);\n\n  var _super19 = _createSuper(HelpViewModel);\n\n  function HelpViewModel(parent, e) {\n    var _this17;\n\n    _classCallCheck(this, HelpViewModel);\n\n    _this17 = _super19.call(this);\n    _this17.parent = parent;\n    _this17.caption = ko.observable(_h.getLocalizedText(\"helpCaption\"));\n    _this17.selectedRow = ko.observable();\n    _this17.na = ko.observable();\n    _this17.de = ko.observable();\n    _this17.records = [];\n\n    _this17.init(e);\n\n    _this17.createForm();\n\n    return _this17;\n  }\n\n  _createClass(HelpViewModel, [{\n    key: \"init\",\n    value: function init(searchKey, e) {\n      var tab;\n      var loc = $(e.target).attr(\"data-location\");\n      if (loc) tab = _h.getEnumItem(controllerNames, loc);\n\n      var menu = _h.getEnumItemByText(pageNames, this.parent.pageName());\n\n      if (_h.isNullOrEmpty(tab)) $.each(controllerNames, function (i, p) {\n        if (p.enText.toLowerCase() === window.resDomain.toLowerCase()) tab = p;\n      });\n      var model = {\n        menu: menu.value,\n        tab: tab.value,\n        searchKey: searchKey\n      };\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/help/filterby\",\n        data: model,\n        success: function (data) {\n          this.records = [];\n\n          if (_h.any(data)) {\n            for (var j = 0; j < data.length; j++) {\n              var record = new Help(data[j]);\n              this.records.push(record);\n            }\n\n            $(\"#tree_view_hp\").treeView({\n              tType: \"Help\",\n              location: \"Help\",\n              nodes: this.records,\n              rootId: \"10\",\n              onSelectRow: this.onSelectRow\n            });\n          }\n        }.bind(this),\n        error: function error(data) {}\n      });\n    }\n  }, {\n    key: \"onSelectRow\",\n    value: function onSelectRow(item) {\n      this.na = ko.observable(item.na);\n      this.de = ko.observable(item.de);\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'help-content-t'\n      }, undefined, true, 30, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return HelpViewModel;\n}(FormBuilder);\nvar Help = /*#__PURE__*/function (_BaseInfoModel6) {\n  _inherits(Help, _BaseInfoModel6);\n\n  var _super20 = _createSuper(Help);\n\n  function Help(model) {\n    var _this18;\n\n    _classCallCheck(this, Help);\n\n    _this18 = _super20.call(this, model);\n    _this18.children = [];\n    if (_h.any(model.children)) for (var i = 0; i < model.children.length; i++) {\n      var target = model.children[j];\n      var record = new Help(target);\n\n      _this18.children.push(record);\n    }\n    return _this18;\n  }\n\n  return _createClass(Help);\n}(BaseInfoModel);\nvar TipItem = /*#__PURE__*/function (_BaseInfoModel7) {\n  _inherits(TipItem, _BaseInfoModel7);\n\n  var _super21 = _createSuper(TipItem);\n\n  function TipItem(model) {\n    var _this19;\n\n    _classCallCheck(this, TipItem);\n\n    _this19 = _super21.call(this, model);\n    if (!_h.isNullOrEmpty(model.pathNodes)) self.path = model.pathNodes.join('=>');else self.path = \"\";\n    return _this19;\n  }\n\n  return _createClass(TipItem);\n}(BaseInfoModel);\nvar ConnectionManager = /*#__PURE__*/function (_BaseSecondaryForm3) {\n  _inherits(ConnectionManager, _BaseSecondaryForm3);\n\n  var _super22 = _createSuper(ConnectionManager);\n\n  function ConnectionManager(viewModel, model) {\n    var _this20;\n\n    _classCallCheck(this, ConnectionManager);\n\n    _this20 = _super22.call(this, viewModel, [{\n      name: \"entityName\",\n      type: \"\",\n      val: \"Connection\"\n    }, {\n      name: \"controllerName\",\n      type: \"\",\n      val: model.controllerName\n    }, {\n      name: \"selectedRow\",\n      type: \"ob\"\n    }, {\n      name: \"hasNextStage\",\n      type: \"ob\"\n    }, {\n      name: \"lastPriority\",\n      type: \"ob\"\n    }, {\n      name: \"records\",\n      type: \"obar\"\n    }, {\n      name: \"permissions\",\n      type: \"obar\"\n    }, {\n      name: \"selectItems\",\n      type: \"obar\"\n    }], model.caption);\n    _this20.visCreateBtn = ko.pureComputed(function () {\n      var first = !this.selectedRow() || !this.selectedRow().processItem() || this.selectedRow().processItem().percent() === 100;\n      var second = !_h.isNullOrEmpty(this.selectedRow()) && this.selectedRow().resultMode() === false;\n      return first && second && this.permissions().indexOf(3) !== -1 && this.selectedRow().id() === undefined;\n    }.bind(_assertThisInitialized(_this20)));\n    _this20.visEditBtn = ko.pureComputed(function () {\n      var first = !this.selectedRow() || !this.selectedRow().processItem() || this.selectedRow().processItem().percent() === 100;\n      var second = !_h.isNullOrEmpty(this.selectedRow()) && this.selectedRow().resultMode() === false;\n      return first && second && this.permissions().indexOf(3) !== -1 && this.selectedRow().id() !== undefined;\n    }.bind(_assertThisInitialized(_this20)));\n    _this20.visExecuteBtn = ko.pureComputed(function () {\n      var first = !this.selectedRow() || !this.selectedRow().processItem() || this.selectedRow().processItem().percent() === 100;\n      var second = !_h.isNullOrEmpty(this.selectedRow()) && this.selectedRow().resultMode() === false;\n      return first && second && this.selectedRow().id() !== undefined;\n    }.bind(_assertThisInitialized(_this20)));\n    _this20.visCompleteRunBtn = ko.pureComputed(function () {\n      var first = !this.selectedRow() || !this.selectedRow().processItem() || this.selectedRow().processItem().percent() === 100;\n      var second = !_h.isNullOrEmpty(this.selectedRow()) && this.selectedRow().resultMode() === true;\n      return first && second && this.selectedRow().resultErrors().length === 0;\n    }.bind(_assertThisInitialized(_this20)));\n\n    _this20.getRecords();\n\n    _this20.getSelectList();\n\n    _this20.createForm();\n\n    return _this20;\n  }\n\n  _createClass(ConnectionManager, [{\n    key: \"getRecords\",\n    value: function getRecords() {\n      var filterModel = {\n        controllerName: this.controllerName\n      };\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/connection/filterby\",\n        data: filterModel,\n        success: function (data) {\n          this.records.removeAll();\n          this.permissions.removeAll();\n\n          if (!_h.isNullOrEmpty(data)) {\n            if (_h.any(data.list)) {\n              for (var m = 0; m < data.list.length; m++) {\n                var target = data.list[m];\n                var record = new Connection();\n                record.fillModel(target, data.lastPriority);\n                this.records.push(record);\n              }\n\n              var first = this.records()[0];\n\n              if (_h.isNullOrEmpty(this.selectedRow())) {\n                this.selectedRow(first);\n                first.selected(true);\n              }\n            }\n\n            if (_h.any(data.permissions)) {\n              for (var i = 0; i < data.permissions.length; i++) {\n                this.permissions.push(data.permissions[i]);\n              }\n            }\n\n            this.lastPriority(data.lastPriority);\n          }\n\n          _h.fixLabelsSize();\n        }.bind(this),\n        error: function (data) {\n          toast.error(this.entityName, 'getList');\n        }.bind(this)\n      });\n    }\n  }, {\n    key: \"getSelectList\",\n    value: function getSelectList() {\n      var filterModel = {\n        controllerName: this.controllerName\n      };\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/connection/getselectitems\",\n        data: filterModel,\n        success: function (data) {\n          this.selectItems.removeAll();\n\n          if (_h.any(data)) {\n            for (var m = 0; m < data.length; m++) {\n              var target = data[m];\n              var record = new SelectItem(target);\n              this.selectItems.push(record);\n            }\n          }\n        }.bind(this),\n        error: function error(data) {}\n      });\n    }\n  }, {\n    key: \"executeBtn\",\n    value: function executeBtn(item) {\n      var model = item[1].selectedRow().getRunProperties();\n      if (model === false) return model;\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/connection/postrun\",\n        data: model,\n        success: function success(data) {\n          _h.kocnx().checkProcessQueue();\n\n          localStorage.setItem(\"ProcessToken\", \"\");\n        },\n        error: function error(data) {}\n      });\n    }\n  }, {\n    key: \"cancelExecuteBtn\",\n    value: function cancelExecuteBtn() {\n      this.resultMode(false);\n      this.properties.removeAll();\n      this.resultErrors.removeAll();\n      this.outputFiles.removeAll();\n    }\n  }, {\n    key: \"createBtn\",\n    value: function createBtn() {\n      var self = this;\n      this.getLastPriority(function (res) {\n        if (res !== null) {\n          var record = new Connection();\n          record.fillEmpty(self.controllerName, res);\n          var moduleConnection = new ModuleConnectionProperties(self);\n          moduleConnection.fillEmpty();\n          record.connectionProperties(moduleConnection);\n          self.selectedRow(record);\n          record.editMode(false);\n        }\n      });\n    }\n  }, {\n    key: \"getLastPriority\",\n    value: function getLastPriority(callback, id) {\n      var model = {\n        controllerName: this.controllerName,\n        isConnection: true,\n        id: id\n      };\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/common/getlastpriority\",\n        data: model,\n        success: function success(data) {\n          callback(data);\n        },\n        error: function error(data) {\n          toast.error(self.entityName, 'get', 'LastPriority');\n          callback(null);\n        },\n        messageType: 'get',\n        messageKey: \"LastPriority\"\n      });\n    }\n  }, {\n    key: \"create\",\n    value: function create() {\n      var model = this.selectedRow().toServer();\n      if (model === false) return model;\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/connection/post\",\n        data: model,\n        success: function (data) {\n          if (!_h.isNullOrEmpty(data)) {\n            this.getRecords();\n            this.lastPriority(data.lastPriority);\n            toast.success(this.entityName, 'post');\n          }\n        }.bind(this),\n        error: function (data) {\n          toast.error(this.entityName, 'post');\n        }.bind(this)\n      });\n    }\n  }, {\n    key: \"edit\",\n    value: function edit() {\n      var model = this.selectedRow().toServer(true);\n      if (model === false) return model;\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/connection/put\",\n        data: model,\n        success: function (data) {\n          if (!_h.isNullOrEmpty(data)) {\n            this.getRecords();\n            this.lastPriority(data.lastPriority);\n            toast.success(this.entityName, 'put');\n          }\n        }.bind(this),\n        error: function (data) {\n          toast.error(this.entityName, 'put');\n        }.bind(this)\n      });\n    }\n  }, {\n    key: \"deleteBtn\",\n    value: function deleteBtn(parents, item) {\n      if (_h.isNullOrEmpty(item.id())) {\n        this.selectedRow(null);\n        return;\n      }\n\n      var id = item.id();\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/connection/delete\",\n        data: {\n          id: id\n        },\n        success: function (data) {\n          if (!_h.isNullOrEmpty(data)) {\n            parents[0].getRecords();\n            parents[0].lastPriority(data.lastPriority);\n            toast.success(parents[0].entityName, 'del');\n          }\n        }.bind(this),\n        error: function (data) {\n          toast.error(parents[0].entityName, 'del');\n        }.bind(this)\n      });\n    }\n  }, {\n    key: \"onRowClick\",\n    value: function onRowClick(item) {\n      if (this.selectedRow() !== null && this.selectedRow() !== undefined) this.selectedRow().selected(false);\n      item.lastPriority(this.lastPriority());\n      this.selectedRow(item);\n      item.selected(true);\n      item.connectionProperties().getInformation(this.permissions(), item.id());\n      this.fixLabelSize();\n    }\n  }, {\n    key: \"fixLabelSize\",\n    value: function fixLabelSize() {\n      var modal = $(\".modal.in\");\n      var labels = modal.find(\".control-label\");\n\n      for (var i = 0; i < labels.length; i++) {\n        var label = labels[i];\n\n        var sizes = _h.calDim($(label).text(), \"11px\", \"Iransans\", \"400\");\n\n        $(label).css(\"width\", sizes[1] + 10);\n      }\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      this.width = \"60%\";\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'connection-manager-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'createFormBtn',\n            vis: this.visCreateBtn,\n            click: this.create.bind(this)\n          }, {\n            name: \"custom\",\n            resText: 'editFormBtn',\n            vis: this.visEditBtn,\n            click: this.edit.bind(this)\n          }, {\n            name: \"custom\",\n            resText: 'executeConnction',\n            vis: this.visExecuteBtn,\n            click: this.executeBtn.bind(this)\n          }, {\n            name: \"tmp\",\n            templateName: 'connection-manager-footer-form-t',\n            vis: true,\n            click: null\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return ConnectionManager;\n}(BaseSecondaryForm);\nfunction Connection() {\n  var self = this;\n  self.selected = ko.observable(false);\n  self.editMode = ko.observable(true);\n  self.id = ko.observable(undefined);\n  self.priority = ko.observable();\n  self.lastPriority = ko.observable();\n  self.name = ko.observable();\n  self.controllerName = 0;\n  self.timeCreated = ko.observable();\n  self.connectionProperties = ko.observable();\n  self.outputType = ko.observable();\n  self.properties = ko.observableArray();\n  self.resultErrors = ko.observableArray();\n  self.resultMode = ko.observable(false);\n  self.outputFiles = ko.observableArray();\n  self.processItem = ko.observable();\n\n  self.fillEmpty = function (controllerName, priority) {\n    self.controllerName = controllerName;\n    self.priority(priority + 1);\n    self.lastPriority(priority + 1);\n  };\n\n  self.fillModel = function (model, lastPriority) {\n    self.id(model.id);\n    self.name(model.name);\n    self.priority(model.priority);\n    self.lastPriority(lastPriority);\n    self.controllerName = model.controllerName;\n    self.timeCreated(model.timeCreated);\n    var record = new ModuleConnectionProperties(self);\n    record.fillEmpty();\n    self.connectionProperties(record);\n    self.connectionProperties().fillModel(model.connectionProperties);\n  };\n\n  self.downloadFile = function (item) {\n    window.open(item.address);\n  };\n\n  self.toServer = function (editMode) {\n    if (!self.validationObject.isValid()) {\n      self.validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    var model = {\n      id: self.id(),\n      name: self.name(),\n      priority: self.priority(),\n      controllerName: self.controllerName,\n      timeCreated: self.timeCreated(),\n      connectionProperties: null\n    };\n\n    if (!self.connectionProperties().validationObject.isValid()) {\n      self.connectionProperties().validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    model.connectionProperties = self.connectionProperties().toServer(editMode);\n\n    if (model.connectionProperties && _h.any(model.connectionProperties.parameters)) {\n      model.connectionProperties.parameters = ko.toJS(model.connectionProperties.parameters);\n    }\n\n    if (!model.connectionProperties.isValidParameters && self.editMode() === true) {\n      return false;\n    }\n\n    return model;\n  };\n\n  self.getRunProperties = function () {\n    if (!self.validationObject.isValid()) {\n      self.validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    if (!self.connectionProperties().validationObject.isValid()) {\n      self.connectionProperties().validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    model.connectionProperties = self.connectionProperties().toServer();\n\n    if (!model.connectionProperties.isValidParameters) {\n      return false;\n    }\n\n    if (model.connectionProperties && _h.any(model.connectionProperties.parameters)) {\n      var validParams = [\"name\", \"key\", \"value\", \"file\", \"fileType\"];\n      var data = [];\n\n      for (var i = 0; i < model.connectionProperties.parameters.length; i++) {\n        var param = model.connectionProperties.parameters[i];\n        var objParam = {};\n\n        for (var l in param) {\n          if (param.hasOwnProperty(l) && validParams.indexOf(l) !== -1) {\n            objParam[l] = param[l]();\n          }\n        }\n\n        data.push(objParam);\n      }\n\n      model.connectionProperties.parameters = data;\n    }\n\n    return {\n      connectionId: self.id(),\n      parameterValues: model.connectionProperties.parameters\n    };\n  };\n\n  self.validationObject = ko.validatedObservable({\n    name: self.name.extend({\n      required: true\n    }),\n    priority: self.priority.extend({\n      required: true\n    }),\n    connectionProperties: self.connectionProperties\n  });\n\n  self.onCancel = function () {\n    _h.kocnx().processManagement().cancelBtn(self.processItem);\n  };\n}\nfunction ModuleConnectionProperties() {\n  var self = this;\n  self.executableFileName = ko.observable();\n  self.parameters = ko.observableArray();\n  self.connectionString = ko.observable();\n  self.query = ko.observable();\n\n  self.fillEmpty = function () {};\n\n  self.fillModel = function (model) {\n    self.executableFileName(model.executableFileName);\n    if (_h.any(model.parameters)) for (var i = 0; i < model.parameters.length; i++) {\n      var record = new ConnectionParameter(model.parameters[i]);\n      self.parameters.push(record);\n      if (model.parameters[i].customSelectSource) record.getSelectData();\n    }\n  };\n\n  self.toServer = function (editMode) {\n    var isValid = true;\n    var hasFile = false;\n    if (_h.any(self.parameters())) for (var i = 0; i < self.parameters().length; i++) {\n      var param = self.parameters()[i];\n\n      if (param.require() === true && (_h.isNullOrEmpty(param.value()) || param.value() === \"\")) {\n        isValid = false;\n        param.error(true);\n      } else {\n        param.error(false);\n      }\n\n      if (param.parameterType() === 6 && param.isFileValid() === false) {\n        isValid = false;\n        param.error(true);\n      } else if (param.parameterType() === 6 && _h.isNullOrEmpty(param.file()) && param.require() === true) {\n        isValid = false;\n        param.error(true);\n      } else if (param.parameterType() === 6 && (!_h.isNullOrEmpty(param.file()) || param.require() === false)) {\n        param.error(false);\n        param.fileMessage(undefined);\n      }\n\n      if (!_h.isNullOrEmpty(param.file())) hasFile = true;\n    }\n    return {\n      executableFileName: self.executableFileName(),\n      parameters: self.parameters(),\n      isValidParameters: isValid,\n      hasFile: hasFile\n    };\n  };\n\n  self.validationObject = ko.validatedObservable({\n    executableFileName: self.executableFileName.extend({\n      required: true\n    })\n  });\n\n  self.addParameter = function () {\n    self.parameters.push(new ConnectionParameter({\n      key: \"\",\n      name: \"\",\n      value: undefined\n    }));\n  };\n\n  self.removeParameter = function (item) {\n    self.parameters.remove(item);\n  };\n\n  self.getInformation = function (permissions, id) {\n    for (var i = 0; i < self.parameters().length; i++) {\n      if (self.parameters()[i].parameterType() === 6 && permissions.indexOf(3) === -1 && !self.parameters()[i].loadInfo()) self.parameters()[i].getInfo(id);\n    }\n  };\n}\nfunction ResultConnectionProperties(model) {\n  var self = this;\n  self.faName = ko.observable(model.faName);\n  self.name = ko.observable(model.name);\n  self.parameterType = ko.observable(model.parameterType);\n  self.value = ko.observable(model.defaultValue);\n  self.selectList = ko.observable(model.selectList);\n  self.valueList = ko.observableArray();\n  self.require = ko.observable(model.require);\n  self.error = ko.observable(false);\n  self.outputType = ko.observable(model.outputType);\n  self.valueList.subscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      self.value(newValue);\n    }\n  });\n}\nfunction ConnectionParameter(model) {\n  var self = this;\n  self.loadInfo = ko.observable(false);\n  self.key = ko.observable(model.key);\n  self.name = ko.observable(model.name);\n  self.value = ko.observable(model.defaultValue);\n  self.selectList = ko.observableArray(model.selectList);\n  self.valueList = ko.observableArray();\n  self.defaultValueList = ko.observableArray();\n  self.parameterType = ko.observable(model.parameterType);\n  self.require = ko.observable(model.require);\n  self.defaultValue = ko.observable(model.defaultValue);\n  self.error = ko.observable(false);\n  self.tip = ko.observable(model.tip);\n  self.error.subscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      try {\n        if (_h.kocnx().formModel().permissions().indexOf(3) === -1) {\n          setTimeout(function () {\n            self.error(false);\n          }, 5000);\n        }\n      } catch (e) {//\n      }\n    }\n  });\n  self.customSelectSource = ko.observable(model.customSelectSource);\n\n  self.toggleRequire = function () {\n    self.require(!self.require());\n  };\n\n  self.valueList.subscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      self.value(newValue);\n    }\n  });\n  self.defaultValueList.subscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      self.defaultValue(newValue);\n    }\n  });\n  self.parameterType.subscribe(function (newValue) {\n    if (newValue === 4) {\n      if (self.selectList().length === 0) self.selectList.push({\n        text: \"\",\n        value: \"\"\n      });\n    }\n  });\n\n  self.addSelectItem = function () {\n    self.selectList.push({\n      text: \"\",\n      value: \"\"\n    });\n  };\n\n  self.removeSelectItem = function (item) {\n    self.selectList.remove(item);\n  };\n\n  self.fileName = ko.observable();\n  self.file = ko.observable();\n  self.isFileValid = ko.observable();\n  self.fileType = ko.observable();\n  self.fileMessage = ko.observable();\n\n  self.handleFileChoose = function (files) {\n    var file = files;\n\n    var ext = _h.getExtension(file.name);\n\n    self.fileName(file.name);\n\n    switch (ext.toLowerCase()) {\n      case \"csv\":\n        self.fileType(0);\n\n        _h.toBase64(file, function (res) {\n          self.file(res);\n        });\n\n        self.fileName(file.name);\n        self.fileMessage(\"\");\n        self.isFileValid(true);\n        break;\n\n      case \"xls\":\n        self.fileType(8);\n\n        _h.toBase64(file, function (res) {\n          self.file(res);\n        });\n\n        self.fileName(file.name);\n        self.fileMessage(\"\");\n        self.isFileValid(true);\n        break;\n\n      case \"xlsx\":\n        self.fileType(9);\n\n        _h.toBase64(file, function (res) {\n          self.file(res);\n        });\n\n        self.fileName(file.name);\n        self.fileMessage(\"\");\n        self.isFileValid(true);\n        break;\n\n      default:\n        self.fileType(-1);\n\n        _h.toBase64(file, function (res) {\n          self.file(res);\n        });\n\n        self.fileName(file.name);\n        self.fileMessage(\" فرمت های صحیح فایل \" + \" xls, xlsx, csv \" + \"می باشد\");\n        self.isFileValid(false);\n        break;\n    }\n  };\n\n  self.getSelectData = function () {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n      url: \"/api/connection/getcustomselectitems\",\n      data: {\n        procedureName: self.customSelectSource()\n      },\n      success: function success(data) {\n        self.selectList.removeAll();\n\n        if (_h.any(data)) {\n          for (var i = 0; i < data.length; i++) {\n            self.selectList.push(data[i]);\n          }\n        }\n      },\n      error: function error(data) {}\n    });\n  };\n\n  self.getInfo = function (id) {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n      url: \"/api/connection/getconnectioninfo\",\n      data: {\n        id: id\n      },\n      success: function success(data) {\n        self.selectList.removeAll();\n\n        if (!_h.any(data)) {\n          for (var i = 0; i < data.length; i++) {\n            self.selectList.push(data[i]);\n          }\n        }\n      },\n      error: function error(data) {}\n    });\n  };\n}\nvar Folder = /*#__PURE__*/function (_BaseModel2) {\n  _inherits(Folder, _BaseModel2);\n\n  var _super23 = _createSuper(Folder);\n\n  function Folder(model) {\n    _classCallCheck(this, Folder);\n\n    return _super23.call(this, model);\n  }\n\n  return _createClass(Folder);\n}(BaseModel);\nvar FolderManagement = /*#__PURE__*/function (_BaseSecondaryForm4) {\n  _inherits(FolderManagement, _BaseSecondaryForm4);\n\n  var _super24 = _createSuper(FolderManagement);\n\n  function FolderManagement(viewModel, model) {\n    var _this21;\n\n    _classCallCheck(this, FolderManagement);\n\n    _this21 = _super24.call(this, viewModel, [{\n      name: \"parent\",\n      type: \"\",\n      val: viewModel\n    }, {\n      name: \"controllerName\",\n      type: \"\",\n      val: model.controllerName\n    }, {\n      name: \"folders\",\n      type: \"obar\"\n    }, {\n      name: \"tags\",\n      type: \"obar\"\n    }], \"folderManagementCaption\");\n\n    _this21.getRecords();\n\n    _this21.createForm();\n\n    return _this21;\n  }\n\n  _createClass(FolderManagement, [{\n    key: \"getRecords\",\n    value: function getRecords() {\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"getTableInfo\",\n        data: {\n          controllerName: this.controllerName\n        },\n        success: function (data) {\n          this.folders.removeAll();\n          this.tags.removeAll();\n          if (_h.any(data.folders)) for (var j = 0; j < data.folders.length; j++) {\n            var target = data.folders[j];\n            this.folders.push(new Folder(target));\n          }\n          if (_h.any(data.tags)) for (var k = 0; k < data.tags.length; k++) {\n            this.tags.push({\n              text: data.tags[k],\n              value: data.tags[k]\n            });\n          }\n        }.bind(this),\n        error: function error(data) {\n          toast.error(\"Folder\", 'getList');\n        }\n      });\n    }\n  }, {\n    key: \"update\",\n    value: function update() {\n      var model = {\n        controllerName: this.controllerName,\n        Folders: ko.toJS(this.folders)\n      };\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"putfolders\",\n        data: model,\n        success: function (data) {\n          if (!_h.isNullOrEmpty(data)) {\n            this.parent.getFolderList();\n            this.parent.getRecords();\n\n            _h.kocnx().closeForm();\n          }\n        }.bind(this),\n        error: function error(data) {}\n      });\n    }\n  }, {\n    key: \"addFolder\",\n    value: function addFolder() {\n      this.folders.push(new Folder({\n        text: \"\",\n        value: undefined\n      }));\n    }\n  }, {\n    key: \"removeFolder\",\n    value: function removeFolder(item) {\n      if (this.folders().length > 0) this.folders.remove(item);\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'folder-management-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'editFormBtn',\n            vis: true,\n            click: this.update.bind(this)\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return FolderManagement;\n}(BaseSecondaryForm);\nvar ProcessQueue = /*#__PURE__*/function (_BaseSecondaryForm5) {\n  _inherits(ProcessQueue, _BaseSecondaryForm5);\n\n  var _super25 = _createSuper(ProcessQueue);\n\n  function ProcessQueue(viewModel) {\n    var _this22;\n\n    _classCallCheck(this, ProcessQueue);\n\n    _this22 = _super25.call(this, viewModel, [{\n      name: \"sign\",\n      type: \"ob\",\n      val: false\n    }, {\n      name: \"hasActiveItem\",\n      type: \"ob\",\n      val: false\n    }, {\n      name: \"showForm\",\n      type: \"ob\",\n      val: false\n    }, {\n      name: \"list\",\n      type: \"obar\"\n    }, {\n      name: \"interval\",\n      type: \"\",\n      val: null\n    }], \"ongoingOperations\");\n    _this22.checkActiveItems = ko.computed(function () {\n      var hasActiveProcess = false,\n          hasConsolidation = false,\n          hasConnection = false,\n          hasReportNode = false;\n      if (this.list().length > 0) for (var i = 0; i < this.list().length; i++) {\n        if ((this.list()[i].processStatus() === 1 || this.list()[i].processStatus() === 2 || this.list()[i].processStatus() === 6) && this.list()[i].processType() !== 4 && this.list()[i].processType() !== 3) hasActiveProcess = true;\n        if ((this.list()[i].processStatus() === 1 || this.list()[i].processStatus() === 2 || this.list()[i].processStatus() === 6) && this.list()[i].processType() === 4) hasReportNode = true;\n        if ((this.list()[i].processStatus() === 1 || this.list()[i].processStatus() === 2 || this.list()[i].processStatus() === 6) && this.list()[i].processType() === 5) hasConsolidation = true;\n      }\n      this.hasActiveItem(hasActiveProcess || hasReportNode || hasConsolidation || hasConnection);\n\n      if (hasReportNode || hasConsolidation || hasConnection) {\n        this.showForm(false);\n      }\n    }.bind(_assertThisInitialized(_this22)));\n    return _this22;\n  }\n\n  _createClass(ProcessQueue, [{\n    key: \"deleteBtn\",\n    value: function deleteBtn(item) {\n      var model = {\n        id: item.id()\n      };\n      var parent = this[0];\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/process/delete\",\n        data: model,\n        success: function (data) {\n          parent.list.remove(item);\n          parent.toggleInterval();\n        }.bind(this),\n        error: function error(data) {}\n      });\n    }\n  }, {\n    key: \"cancelBtn\",\n    value: function cancelBtn(item) {\n      var model = {\n        id: item.id()\n      };\n      var parent = this[0];\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/process/putcancel\",\n        data: model,\n        success: function (data) {\n          item.processStatus(2);\n          parent.toggleInterval();\n        }.bind(this),\n        error: function error(data) {}\n      });\n    }\n  }, {\n    key: \"getData\",\n    value: function getData(isFirstLoad, callback) {\n      if (window.inCTvm) return;\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        notShowAjaxLoader: true,\n        url: \"/api/process/getlist\",\n        data: \"\",\n        success: function (data) {\n          if (!_h.isNullOrEmpty(data)) {\n            this.list.removeAll();\n\n            for (var i = 0; i < data.length; i++) {\n              var item;\n\n              if (isFirstLoad) {\n                if (data[i].processType !== 4) {\n                  item = new ProcessItem(data[i]);\n                  this.list.push(item);\n                }\n              } else {\n                item = new ProcessItem(data[i]);\n                this.list.push(item);\n              }\n            }\n\n            setTimeout(function () {\n              localStorage.removeItem(\"ProcessToken\");\n            }, 400);\n            callback(true);\n          }\n        }.bind(this),\n        error: function error(data) {\n          callback(false);\n        }\n      });\n    }\n  }, {\n    key: \"toggleInterval\",\n    value: function toggleInterval(sign) {\n      if (!_h.isNullOrEmpty(this.interval)) {\n        clearInterval(this.interval);\n      }\n\n      if (this.hasActiveItem()) {\n        this.interval = setInterval(function () {\n          if (this.hasActiveItem()) this.getData(undefined, function () {});else clearInterval(this.interval);\n        }.bind(this), 1000 * 3);\n      }\n    }\n  }, {\n    key: \"init\",\n    value: function init(sign, isFirstLoad) {\n      if (!sign) {\n        this.openForm();\n      }\n\n      this.getData(isFirstLoad, function (res) {\n        if (res) {\n          this.toggleInterval(sign);\n        }\n      }.bind(this));\n    }\n  }, {\n    key: \"toggleShowErrors\",\n    value: function toggleShowErrors(item) {\n      item.showErrors(!item.showErrors());\n    }\n  }, {\n    key: \"toggleShowWarning\",\n    value: function toggleShowWarning(item) {\n      item.showWarning(!item.showWarning());\n    }\n  }, {\n    key: \"toggleShowOutputFiles\",\n    value: function toggleShowOutputFiles(item) {\n      item.showOutputFiles(!item.showOutputFiles());\n    }\n  }, {\n    key: \"closeForm\",\n    value: function closeForm() {\n      this.showForm(false);\n    }\n  }, {\n    key: \"getActiveItem\",\n    value: function getActiveItem(type) {\n      var item = null;\n      if (this.list().length > 0) for (var i = 0; i < this.list().length; i++) {\n        var target = this.list()[i];\n        if ((target.processStatus() === 1 || target.processStatus() === 2 || target.processStatus() === 6) && target.processType() === type) item = target;\n      }\n      return item;\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'process-management-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }, {\n    key: \"openForm\",\n    value: function openForm() {\n      this.showForm(true);\n      $(\".process-box\").draggable({\n        scroll: true,\n        handle: \".panel-heading\"\n      });\n    }\n  }]);\n\n  return ProcessQueue;\n}(BaseSecondaryForm);\nvar ProcessItem = /*#__PURE__*/function (_BaseInnerModel10) {\n  _inherits(ProcessItem, _BaseInnerModel10);\n\n  var _super26 = _createSuper(ProcessItem);\n\n  function ProcessItem(model) {\n    var _this23;\n\n    _classCallCheck(this, ProcessItem);\n\n    _this23 = _super26.call(this, null, [{\n      name: \"id\",\n      type: \"ob\",\n      val: model.id\n    }, {\n      name: \"title\",\n      type: \"ob\",\n      val: model.title\n    }, {\n      name: \"processType\",\n      type: \"ob\",\n      val: model.processType\n    }, {\n      name: \"processStatus\",\n      type: \"ob\",\n      val: model.processStatus\n    }, {\n      name: \"percent\",\n      type: \"ob\",\n      val: model.percent\n    }, {\n      name: \"remainingSeconds\",\n      type: \"ob\",\n      val: model.remainingSeconds\n    }, {\n      name: \"outputFiles\",\n      type: \"obar\",\n      val: model.outputFiles\n    }, {\n      name: \"errors\",\n      type: \"obar\"\n    }, {\n      name: \"warnings\",\n      type: \"obar\"\n    }, {\n      name: \"showErrors\",\n      type: \"ob\",\n      val: false\n    }, {\n      name: \"showWarning\",\n      type: \"ob\",\n      val: false\n    }, {\n      name: \"showOutputFiles\",\n      type: \"ob\",\n      val: false\n    }, {\n      name: \"refresh\",\n      type: \"ob\",\n      val: false\n    }, {\n      name: \"output\",\n      type: \"ob\",\n      val: model.output\n    }, {\n      name: \"input\",\n      type: \"ob\",\n      val: model.input\n    }]);\n    if (_h.any(model.errors)) for (var i = 0; i < model.errors.length; i++) {\n      var target = model.errors[i];\n\n      if (target.selfDescriptive) {\n        _this23.errors.push(target.description);\n      } else {\n        var text = _h.getApiMessage(target.code);\n\n        text = _h.completeError(text, target);\n\n        _this23.errors.push(text);\n      }\n    }\n    if (_h.any(model.warnings)) for (var j = 0; j < model.warnings.length; j++) {\n      var warning = model.warnings[j];\n\n      if (warning.selfDescriptive) {\n        _this23.warnings.push(warning.description);\n      } else {\n        var textWarning = _h.getApiMessage(warning.code);\n\n        textWarning = _h.completeError(textWarning, warning);\n\n        _this23.warnings.push(textWarning);\n      }\n    }\n    if (!_h.isNullOrEmpty(model.output)) _this23.setOutput(model.output);\n    return _this23;\n  }\n\n  _createClass(ProcessItem, [{\n    key: \"setOutput\",\n    value: function setOutput(list) {\n      var context = _h.kocnx();\n\n      switch (this.processType()) {\n        case 1:\n          if (!_h.isNullOrEmpty(_h.kocnx().ddvm())) _h.kocnx().ddvm().changeCalculateDocumentsStatus(list);\n          break;\n\n        case 4:\n          if (context.treevm()) context.treevm().nodeReportHandler(this.id(), this.input(), this.output(), this.percent(), this.title(), this.processStatus());\n          break;\n\n        case 5:\n          if (context.covm()) context.covm().consolidationProcessHandler(this.id(), this.input(), this.output(), this.percent(), this.title(), this.processStatus(), this);\n          break;\n\n        case 6:\n          var host = \"\";\n          if (context.brvm()) host = \"brvm\";\n          if (context.bvm()) host = \"bvm\";\n          if (context.tavm()) host = \"tavm\";\n          context.connectionProcessHandler(this.id(), this.input(), this.output(), this.percent(), this.title(), this.processStatus(), this, host);\n          break;\n      }\n    }\n  }, {\n    key: \"downloadFile\",\n    value: function downloadFile(m) {\n      if (!_h.isEmpty(m.address)) {\n        _h.downloadFile(m.address.replace(\"~\", \"\"));\n      } else {\n        var file = m.outputFiles()[0];\n\n        _h.downloadFile(file.address.replace(\"~\", \"\"));\n      }\n    }\n  }]);\n\n  return ProcessItem;\n}(BaseInnerModel);\nvar NodeReportForm = /*#__PURE__*/function (_BaseSecondaryForm6) {\n  _inherits(NodeReportForm, _BaseSecondaryForm6);\n\n  var _super27 = _createSuper(NodeReportForm);\n\n  function NodeReportForm(viewModel) {\n    var _this24;\n\n    _classCallCheck(this, NodeReportForm);\n\n    _this24 = _super27.call(this, viewModel, [{\n      name: \"id\",\n      type: \"ob\"\n    }, {\n      name: \"percent\",\n      type: \"ob\"\n    }, {\n      name: \"title\",\n      type: \"ob\"\n    }, {\n      name: \"processStatus\",\n      type: \"ob\"\n    }, {\n      name: \"nodeReportSelects\",\n      type: \"obar\"\n    }, {\n      name: \"reportGroups\",\n      type: \"obar\"\n    }, {\n      name: \"inProgress\",\n      type: \"ob\",\n      val: false\n    }], \"nodeReportCaption\");\n    _this24.visBtn = ko.pureComputed(function () {\n      if (this.inProgress()) {\n        _h.adjustModalPosition(\"60%\");\n\n        return false;\n      } else {\n        _h.adjustModalPosition(\"\");\n\n        return true;\n      }\n    }.bind(_assertThisInitialized(_this24)));\n\n    _this24.createForm();\n\n    return _this24;\n  }\n\n  _createClass(NodeReportForm, [{\n    key: \"fillReports\",\n    value: function fillReports(list) {\n      var activeTab;\n      if (_h.any(list)) for (var i = 0; i < list.length; i++) {\n        var target = list[i];\n        var oldRecord = false;\n        if (_h.any(this.reportGroups())) for (var j = 0; j < this.reportGroups().length; j++) {\n          var old = this.reportGroups()[j];\n          if (old.title() === target.title) oldRecord = old;\n        }\n\n        if (oldRecord) {\n          oldRecord.fillItems();\n          if (target.reportItems.length > 0 && !activeTab) activeTab = oldRecord;\n        } else {\n          var newRecord = new ReportGroup(target);\n          this.reportGroups.push(newRecord);\n          if (target.reportItems.length > 0 && !activeTab) activeTab = newRecord;\n        }\n      }\n      if (activeTab) activeTab.active(true);\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'nodereport-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'createFormBtn',\n            vis: this.visBtn,\n            click: this.parentVM.nodeReport\n          }, {\n            name: 'cancel',\n            click: this.parentVM.nodeReportCancel\n          }]\n        }\n      });\n    }\n  }]);\n\n  return NodeReportForm;\n}(BaseSecondaryForm);\nvar ReportGroup = /*#__PURE__*/function () {\n  function ReportGroup(model) {\n    _classCallCheck(this, ReportGroup);\n\n    this.randomId = _h.createRandomNumber();\n    this.title = ko.observable(model.title);\n    this.reportItems = ko.observableArray(model.reportItems);\n    this.active = ko.observable(false);\n    this.createTagId = ko.pureComputed(function () {\n      return this.constructor.name + this.randomId;\n    }.bind(this));\n  }\n\n  _createClass(ReportGroup, [{\n    key: \"fillItems\",\n    value: function fillItems() {\n      this.reportItems(undefined);\n    }\n  }]);\n\n  return ReportGroup;\n}();\nvar NodeReportSelect = /*#__PURE__*/_createClass(function NodeReportSelect(model) {\n  _classCallCheck(this, NodeReportSelect);\n\n  this.id = ko.observable(model.value);\n  this.title = ko.observable(model.text);\n  this.selected = ko.observable(true);\n  this.randomId = _h.createRandomNumber();\n  this.createTagId = ko.computed(function () {\n    return this.constructor.name + this.randomId;\n  }.bind(this));\n});\nvar ReportPreviewColumn = /*#__PURE__*/function (_BaseInnerModel11) {\n  _inherits(ReportPreviewColumn, _BaseInnerModel11);\n\n  var _super28 = _createSuper(ReportPreviewColumn);\n\n  function ReportPreviewColumn(model) {\n    _classCallCheck(this, ReportPreviewColumn);\n\n    return _super28.call(this, model);\n  }\n\n  _createClass(ReportPreviewColumn, [{\n    key: \"toggleExcluded\",\n    value: function toggleExcluded() {\n      if (this.required()) this.excluded(false);else {\n        this.excluded(!this.excluded());\n      }\n    }\n  }, {\n    key: \"formatName\",\n    value: function formatName() {\n      if (this.required()) return _h.getLocalizedText(this.name()) + \" (ضروری) \";\n      return _h.getLocalizedText(this.name());\n    }\n  }]);\n\n  return ReportPreviewColumn;\n}(BaseInnerModel);\nvar ReportPreviewRow = /*#__PURE__*/function (_BaseInnerModel12) {\n  _inherits(ReportPreviewRow, _BaseInnerModel12);\n\n  var _super29 = _createSuper(ReportPreviewRow);\n\n  function ReportPreviewRow(model, parent) {\n    var _this25;\n\n    _classCallCheck(this, ReportPreviewRow);\n\n    _this25 = _super29.call(this, null, [{\n      name: \"parent\",\n      type: \"\",\n      val: parent\n    }, {\n      name: \"excluded\",\n      type: \"ob\",\n      val: false\n    }, {\n      name: \"id\",\n      type: \"ob\",\n      val: model.id\n    }, {\n      name: \"horizontalCell\",\n      type: \"ob\",\n      val: model.horizontalCells.length ? model.horizontalCells[0] : undefined\n    }]);\n    if (_h.any(model.cells)) for (var j = 0; j < model.cells.length; j++) {\n      var field = model.cells[j];\n      _this25[field.order] = field.value;\n    }\n    _this25.visibleHorizontalCell = ko.computed(function () {\n      var count = 0;\n\n      for (var i = 0; i < this.parent.columns().length; i++) {\n        var col = this.parent.columns()[i];\n\n        if (!col.excluded() && col.isHorizontal()) {\n          count++;\n        }\n      }\n\n      return count === 1;\n    }.bind(_assertThisInitialized(_this25)));\n    return _this25;\n  }\n\n  return _createClass(ReportPreviewRow);\n}(BaseInnerModel);\nvar ReportPreview = /*#__PURE__*/function (_BaseSecondaryForm7) {\n  _inherits(ReportPreview, _BaseSecondaryForm7);\n\n  var _super30 = _createSuper(ReportPreview);\n\n  function ReportPreview(viewModel, model) {\n    var _this26;\n\n    _classCallCheck(this, ReportPreview);\n\n    _this26 = _super30.call(this, viewModel, [{\n      name: \"columns\",\n      type: \"obar\"\n    }, {\n      name: \"rows\",\n      type: \"obar\"\n    }, {\n      name: \"pageOrientation\",\n      type: \"ob\",\n      val: 1\n    }, {\n      name: \"reportType\",\n      type: \"ob\",\n      val: 1\n    }, {\n      name: \"controllerName\",\n      type: \"\",\n      val: model.controllerName\n    }], {\n      text: \"پیش نمایش\"\n    });\n    _this26.visibleColCount = ko.computed(function () {\n      var count = 2;\n\n      for (var _i = 0; _i < this.columns().length; _i++) {\n        var col = this.columns()[_i];\n\n        if (!col.excluded() && !col.isHorizontal()) {\n          count++;\n        }\n      }\n\n      return count;\n    }.bind(_assertThisInitialized(_this26)));\n\n    _this26.configResizeFunctionality();\n\n    if (_h.any(model.columns)) for (var i = 0; i < model.columns.length; i++) {\n      var col = new ReportPreviewColumn(model.columns[i]);\n\n      _this26.columns.push(col);\n    }\n    if (_h.any(model.rows)) for (var j = 0; j < model.rows.length; j++) {\n      var row = new ReportPreviewRow(model.rows[j], _assertThisInitialized(_this26));\n\n      _this26.rows.push(row);\n    }\n\n    _this26.createForm();\n\n    return _this26;\n  }\n\n  _createClass(ReportPreview, [{\n    key: \"configResizeFunctionality\",\n    value: function configResizeFunctionality() {\n      $('#report-table th.report-column').resizable({\n        handles: 'w',\n        minWidth: 5,\n        _h: \"resizable-_h\",\n        stop: function stop(event, ui) {\n          $(event.target).css(\"left\", 0);\n        }\n      });\n    }\n  }, {\n    key: \"clickRow\",\n    value: function clickRow(row) {\n      row.excluded(!row.excluded());\n    }\n  }, {\n    key: \"clickInnerRow\",\n    value: function clickInnerRow(row, x, m) {\n      row.excluded(!row.excluded());\n    }\n  }, {\n    key: \"togglePageOrientation\",\n    value: function togglePageOrientation() {\n      if (this.pageOrientation() === 1) this.pageOrientation(2);else this.pageOrientation(1);\n    }\n  }, {\n    key: \"toggleReportType\",\n    value: function toggleReportType() {\n      if (this.reportType() === 1) this.reportType(2);else this.reportType(1);\n    }\n  }, {\n    key: \"getColsData\",\n    value: function getColsData() {\n      var colsWidth = [];\n      var cols = $(\"#report-table thead th\");\n\n      for (var i = 0; i < cols.length; i++) {\n        var col = cols[i];\n        var name = $(col).attr(\"data-name\");\n        var target = this.getColumn(name);\n\n        if (target) {\n          var width = $(col).css(\"width\");\n          target.width(width);\n          target.order(i + 1);\n        }\n      }\n\n      return colsWidth;\n    }\n  }, {\n    key: \"getColumn\",\n    value: function getColumn(name) {\n      var target = null;\n\n      for (var i = 0; i < this.columns().length; i++) {\n        var col = this.columns()[i];\n        if (name === col.name()) target = col;\n      }\n\n      return target;\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      this.getColsData();\n      var excludedRows = [];\n\n      for (var i = 0; i < this.rows().length; i++) {\n        if (this.rows()[i].excluded()) excludedRows.push(this.rows()[i].id());\n      }\n\n      return {\n        excludedRows: excludedRows,\n        input: {},\n        pageOrientation: this.pageOrientation(),\n        columns: ko.toJS(this.columns()),\n        controllerName: this.controllerName,\n        reportType: this.reportType()\n      };\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      this.width = \"80%\";\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'reportpreview-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'createFileBtn',\n            vis: true,\n            click: this.parentVM.downloadReport\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return ReportPreview;\n}(BaseSecondaryForm);\nvar FileUploadForm = /*#__PURE__*/function (_FormBuilder3) {\n  _inherits(FileUploadForm, _FormBuilder3);\n\n  var _super31 = _createSuper(FileUploadForm);\n\n  function FileUploadForm(model, parent, schemaMode) {\n    var _this27;\n\n    _classCallCheck(this, FileUploadForm);\n\n    _this27 = _super31.call(this);\n    _this27.width = \"600px\";\n    _this27.parent = parent;\n    _this27.fileTypeExpect = model.fileType;\n    _this27.id = ko.observable(model.id);\n    _this27.file = ko.observable();\n    _this27.fileName = ko.observable();\n    _this27.fileType = ko.observable();\n    if (schemaMode) _this27.schemaMode = ko.observable(schemaMode);else _this27.schemaMode = ko.observable(false);\n\n    _this27.setValidationObject(model.fileType);\n\n    switch (model.fileType) {\n      case \"Excel\":\n        _this27.caption = _h.getLocalizedText(\"ImportExcelCaption\");\n        break;\n\n      case \"BackUp\":\n        _this27.caption = _h.getLocalizedText(\"ImportBackUpCaption\");\n        break;\n    }\n\n    _this27.createForm();\n\n    return _this27;\n  }\n\n  _createClass(FileUploadForm, [{\n    key: \"handleFileChoose\",\n    value: function handleFileChoose(files) {\n      var file = files;\n      this.fileName(file.name);\n\n      var ext = _h.getExtension(file.name);\n\n      _h.toBase64(file, function (res) {\n        this.file(res);\n      }.bind(this));\n\n      if (this.fileTypeExpect === \"Excel\") {\n        switch (ext) {\n          case \"xls\":\n            this.fileType(8);\n            break;\n\n          case \"xlsx\":\n            this.fileType(9);\n            break;\n\n          case \"csv\":\n            this.fileType(0);\n            break;\n        }\n      }\n\n      if (this.fileTypeExpect === \"BackUp\") {\n        switch (ext) {\n          case \"dbuf\":\n            this.fileType(10);\n            break;\n        }\n      }\n\n      this.fileName(file.name);\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      return {\n        controllerName: _h.findControllerName(this.parent.entityName),\n        inputData: {\n          id: this.id(),\n          fileType: this.fileType(),\n          fileTypeExpect: this.fileTypeExpect,\n          fileName: this.fileName(),\n          file: this.file()\n        }\n      };\n    }\n  }, {\n    key: \"setValidationObject\",\n    value: function setValidationObject(fileType) {\n      var items = {};\n      var self = this;\n\n      switch (fileType) {\n        case \"Excel\":\n          items.file = this.file.extend({\n            require: true,\n            checkExcel: {\n              params: [self.fileName]\n            }\n          });\n          break;\n\n        case \"Image\":\n          items.file = this.file.extend({\n            require: true,\n            checkImage: {\n              params: [self.fileName]\n            }\n          });\n          break;\n\n        case \"BackUp\":\n          items.file = this.file.extend({\n            require: true,\n            checkBackupFile: {\n              params: self.fileName\n            }\n          });\n          break;\n      }\n\n      this.validationObject = ko.validatedObservable(items);\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'upload-controlform-t'\n      }, undefined, true, 30, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'create',\n            vis: true,\n            click: _h.kocnx().importFile\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return FileUploadForm;\n}(FormBuilder);\nvar TableTemplateInfo = /*#__PURE__*/function (_BaseInnerModel13) {\n  _inherits(TableTemplateInfo, _BaseInnerModel13);\n\n  var _super32 = _createSuper(TableTemplateInfo);\n\n  function TableTemplateInfo(model) {\n    var _this28;\n\n    _classCallCheck(this, TableTemplateInfo);\n\n    _this28 = _super32.call(this, model);\n    _this28.showContent = ko.observable(false);\n    return _this28;\n  }\n\n  return _createClass(TableTemplateInfo);\n}(BaseInnerModel);\nvar LoginViewModel = /*#__PURE__*/function (_BaseSecondaryForm8) {\n  _inherits(LoginViewModel, _BaseSecondaryForm8);\n\n  var _super33 = _createSuper(LoginViewModel);\n\n  function LoginViewModel(viewModel) {\n    var _this29;\n\n    _classCallCheck(this, LoginViewModel);\n\n    _this29 = _super33.call(this, viewModel, [{\n      name: \"isPasswordComplexity\",\n      type: \"ob\"\n    }, {\n      name: \"showCaptcha\",\n      type: \"ob\"\n    }, {\n      name: \"userName\",\n      type: \"ob\",\n      val: _h.kocnx().currentUser().un\n    }, {\n      name: \"password\",\n      type: \"ob\"\n    }, {\n      name: \"captchaStr\",\n      type: \"ob\"\n    }], \"LoginCaption\");\n\n    _this29.captchaStr.subscribe(function (newValue) {\n      if (newValue !== null) {\n        if (this.captchaError() !== null) this.captchaError(null);\n      }\n    }.bind(_assertThisInitialized(_this29)));\n\n    _this29.width = \"500px\";\n    _this29.minWidth = \"500px\"; //this.backgroundColor = true;\n\n    _this29.showCancel(false);\n\n    _this29.createForm();\n\n    _this29.init();\n\n    return _this29;\n  }\n\n  _createClass(LoginViewModel, [{\n    key: \"refreshValidationMessages\",\n    value: function refreshValidationMessages() {\n      this.userName.valueHasMutated();\n      this.password.valueHasMutated();\n    }\n  }, {\n    key: \"setValidationObject\",\n    value: function setValidationObject(complexity, showCaptcha) {\n      var obj = {};\n      var self = this;\n\n      var min = _h.getSd().pmc;\n\n      obj.userName = self.userName.extend({\n        required: true,\n        englishOnly: true,\n        minLength: 4,\n        maxlength: 20\n      });\n      obj.password = self.password.extend({\n        required: true,\n        englishOnly: true\n      });\n      if (showCaptcha) obj.captchaStr = self.captchaStr.extend({\n        required: true\n      });\n      self.validationObject = ko.validatedObservable(obj);\n    }\n  }, {\n    key: \"getCaptcha\",\n    value: function getCaptcha() {\n      this.captchaStr(null);\n      var root = location.protocol + '//' + location.host;\n      var img = document.getElementById(\"Captcha_Image\");\n      img.src = root + '/account/getcaptcha' + \"?t=\" + new Date().getTime();\n    }\n  }, {\n    key: \"login\",\n    value: function login(parents) {\n      var loginModel = parents[1];\n\n      if (!loginModel.validationObject.isValid()) {\n        loginModel.validationObject.errors.showAllMessages();\n        return false;\n      }\n\n      var model = {\n        userName: loginModel.userName(),\n        password: loginModel.password(),\n        captcha: loginModel.captchaStr()\n      };\n      window.inCTvm = true;\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/account/postnewtoken\",\n        data: model,\n        success: function (d) {\n          if (_h.isEmpty(d)) {\n            var text = _h.getApiMessage(\"ErrorUnknownServer\");\n\n            _h.failToast(text);\n\n            _h.backToLogin();\n\n            return;\n          }\n\n          if (window.resDomain === \"Magazine\" && window.resSecondDomain === \"pageeditor\" || window.resDomain === \"TableTemplate\") _h.kocnx().changeTvm(d, false);else _h.kocnx().changeTvm(d, true);\n          $(\".modal-back\").removeClass(\"trans-modal-back\");\n\n          _h.kocnx().closeForm();\n\n          window.inCTvm = false;\n        }.bind(this),\n        error: function error(status) {\n          var text;\n          window.inCTvm = false;\n\n          switch (status) {\n            case 552:\n              text = _h.getApiMessage(\"InvalidUserOrPasswordError\");\n\n              _h.failToast(text);\n\n              loginModel.showCaptcha(true);\n              loginModel.getCaptcha();\n              loginModel.setValidationObject(true, true);\n              break;\n\n            case 553:\n            case 558:\n            case 554:\n            case 556:\n            case 557:\n              _h.backToLogin();\n\n              break;\n\n            case 559:\n              text = _h.getApiMessage(\"CaptchaInValid\");\n              loginModel.captchaError(text);\n              loginModel.getCaptcha();\n              break;\n\n            case 560:\n              text = _h.getApiMessage(\"CaptchaTimeOut\");\n              loginModel.captchaError(text);\n              loginModel.getCaptcha();\n              break;\n\n            case 561:\n              text = _h.getApiMessage(\"UserHasNoAccessInSystem\");\n\n              _h.failToast(text);\n\n              break;\n\n            case 571:\n              text = _h.getApiMessage(\"CompanyIsNotActive\");\n\n              _h.failToast(text);\n\n              break;\n\n            default:\n              text = _h.getApiMessage(\"ErrorUnknownServer\");\n\n              _h.failToast(text);\n\n              break;\n          }\n        }\n      });\n    }\n  }, {\n    key: \"init\",\n    value: function init() {\n      var res = $(\".login-box\").attr(\"data-tag\") === \"True\";\n\n      if (res) {\n        this.showCaptcha(true);\n        this.getCaptcha();\n        this.setValidationObject(true, true);\n      } else {\n        this.setValidationObject(true, false);\n      }\n\n      this.refreshValidationMessages();\n      $(\".modal-back\").addClass(\"trans-modal-back\");\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'mini-login-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'loginbtn',\n            vis: true,\n            click: this.login\n          }]\n        }\n      });\n    }\n  }]);\n\n  return LoginViewModel;\n}(BaseSecondaryForm);\nvar AppConfigForm = /*#__PURE__*/function (_BaseSecondaryForm9) {\n  _inherits(AppConfigForm, _BaseSecondaryForm9);\n\n  var _super34 = _createSuper(AppConfigForm);\n\n  function AppConfigForm(viewModel, data) {\n    var _this30;\n\n    _classCallCheck(this, AppConfigForm);\n\n    _this30 = _super34.call(this, viewModel, [{\n      name: \"blockedIpList\",\n      type: \"obar\"\n    }], \"AppConfigCaption\");\n    _this30.pattern = {\n      mask: \"999.999.999.999/99\",\n      placeholder: \"___.___.___.___/__\"\n    };\n    _this30.mask = ko.observable(_this30.mask);\n    _this30.placeholder = ko.observable(_this30.placeholder);\n\n    _this30.createForm();\n\n    _this30.init(data);\n\n    _this30.setValidationObject();\n\n    return _this30;\n  }\n\n  _createClass(AppConfigForm, [{\n    key: \"init\",\n    value: function init(data) {\n      if (_h.any(data.blockedIpList)) for (var i = 0; i < data.blockedIpList.length; i++) {\n        var item = data.blockedIpList[i];\n        this.blockedIpList.push(new BlockIpAddress(item));\n      } else this.blockedIpList.push(new BlockIpAddress({\n        id: 0,\n        ip: \"\"\n      }));\n    }\n  }, {\n    key: \"addIP\",\n    value: function addIP() {\n      this.blockedIpList.push(new BlockIpAddress({\n        id: 0,\n        ip: \"\"\n      }));\n    }\n  }, {\n    key: \"removeIP\",\n    value: function removeIP(item) {\n      this.blockedIpList.remove(item);\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'blockedIpList-form-t'\n      }, undefined, true, 30, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'editFormBtn',\n            vis: true,\n            click: this.parentVM.editAppConfig\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }, {\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      self.validationObject = ko.validatedObservable({\n        blockedIpList: self.blockedIpList\n      });\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      return {\n        blockedIpList: ko.toJS(this.blockedIpList)\n      };\n    }\n  }]);\n\n  return AppConfigForm;\n}(BaseSecondaryForm);\nvar BlockIpAddress = /*#__PURE__*/_createClass(function BlockIpAddress(model) {\n  _classCallCheck(this, BlockIpAddress);\n\n  this.id = ko.observable(model.id);\n  this.ip = ko.observable(model.ip);\n  this.validationObject = ko.validatedObservable({\n    ip: this.ip.extend({\n      required: true,\n      IsValidIpAddress: true\n    })\n  });\n});\nvar LoginHistory = /*#__PURE__*/function (_BaseSecondaryForm10) {\n  _inherits(LoginHistory, _BaseSecondaryForm10);\n\n  var _super35 = _createSuper(LoginHistory);\n\n  function LoginHistory(viewModel, model) {\n    var _this31;\n\n    _classCallCheck(this, LoginHistory);\n\n    _this31 = _super35.call(this, viewModel, [{\n      name: \"lastFailedLogin\",\n      type: \"ob\"\n    }, {\n      name: \"failedLoginCount\",\n      type: \"ob\"\n    }, {\n      name: \"list\",\n      type: \"obar\"\n    }], \"LoginHistoryCaption\");\n    _this31.lastFailedLogin = ko.observable(model.lastFailedLogin);\n    _this31.failedLoginCount = ko.observable(model.failedLoginCount);\n    _this31.list = ko.observableArray(model.models);\n\n    _this31.createForm();\n\n    return _this31;\n  }\n\n  _createClass(LoginHistory, [{\n    key: \"createForm\",\n    value: function createForm() {\n      this.width = \"40%\";\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'loginhistory-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return LoginHistory;\n}(BaseSecondaryForm);\nvar SecurityConfig = /*#__PURE__*/function (_BaseSecondaryForm11) {\n  _inherits(SecurityConfig, _BaseSecondaryForm11);\n\n  var _super36 = _createSuper(SecurityConfig);\n\n  function SecurityConfig(viewModel, list) {\n    var _this32;\n\n    _classCallCheck(this, SecurityConfig);\n\n    _this32 = _super36.call(this, viewModel, [{\n      name: \"list\",\n      type: \"obar\"\n    }, {\n      name: \"lastGroup\",\n      type: \"ob\"\n    }], \"SecurityConfigCaption\");\n    if (_h.any(list)) for (var i = 0; i < list.length; i++) {\n      var target = list[i];\n      var gName = target.groupName;\n      if (!_this32.lastGroup() || _this32.lastGroup() !== gName) _this32.lastGroup(gName);else _this32.lastGroup(\"\");\n      target.groupName = _this32.lastGroup();\n      var record = new SecurityConfigItem(target);\n\n      _this32.list.push(record);\n    }\n\n    _this32.createForm();\n\n    return _this32;\n  }\n\n  _createClass(SecurityConfig, [{\n    key: \"createForm\",\n    value: function createForm() {\n      this.width = \"40%\";\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'securityconfig-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'editFormBtn',\n            vis: true,\n            click: this.parentVM.changeSecurityConfig\n          }, {\n            name: 'cancel',\n            click: this.parentVM.closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return SecurityConfig;\n}(BaseSecondaryForm);\n\nvar SecurityConfigItem = /*#__PURE__*/_createClass(function SecurityConfigItem(model) {\n  _classCallCheck(this, SecurityConfigItem);\n\n  this.id = model.id;\n  this.groupName = model.groupName;\n  this.title = model.title;\n  this.description = model.description;\n  this.dataType = model.dataType;\n  this.value = ko.observable(model.value);\n});\n\n//# sourceURL=webpack://domino/./src/scripts/pages/master/model.js?");

/***/ }),

/***/ "./src/scripts/pages/master/phraseTranslator.js":
/*!******************************************************!*\
  !*** ./src/scripts/pages/master/phraseTranslator.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"PhraseTranslator\": () => (/* binding */ PhraseTranslator)\n/* harmony export */ });\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\nfunction PhraseTranslator() {\n  var self = this;\n\n  self.splitConditionStrings = function (phrase) {\n    var skipround = false;\n    var array = [];\n    if (_h.isNullOrEmpty(phrase)) return array;\n\n    for (var i = 0; i < phrase.length; i++) {\n      var target = phrase[i];\n\n      if (!skipround) {\n        var nextChar = null;\n\n        if (target.indexOf(\"&\") !== -1) {\n          nextChar = phrase[i + 1].indexOf(\"&\") !== -1;\n\n          if (nextChar) {\n            array.push(i);\n            skipround = true;\n          }\n        }\n\n        if (target.indexOf(\"|\") !== -1) {\n          nextChar = phrase[i + 1].indexOf(\"|\") !== -1;\n\n          if (nextChar) {\n            array.push(i);\n            skipround = true;\n          }\n        }\n      } else {\n        skipround = false;\n      }\n    }\n\n    if (array.length === 0) return [phrase];\n    var firstPoint = 0;\n    var outArray = [];\n\n    for (var j = 0; j < array.length; j++) {\n      var indexTarget = array[j];\n      outArray.push(phrase.substring(firstPoint, indexTarget));\n      if (array.length === 1) outArray.push(phrase.substring(indexTarget + 2));\n      if (array.length > 1) firstPoint = indexTarget + 2;\n      if (j + 1 === array.length) outArray.push(phrase.substring(firstPoint));\n    }\n\n    return outArray;\n  };\n\n  self.getModel = function (phrase) {\n    var array = [];\n    var arrayIndex = [];\n    var conds = self.splitConditionStrings(phrase);\n    conds = _h.cleanArray(conds);\n\n    for (var i = 0; i < conds.length; i++) {\n      var cond = self.getCondition(conds[i]);\n      if (arrayIndex.indexOf(cond.id) === -1) array.push(cond);\n      arrayIndex.push(cond.id);\n    }\n\n    array.sort(function (a, b) {\n      return a.id > b.id;\n    });\n    return array;\n  };\n\n  self.getCondition = function (str) {\n    var strCl = self.clearConditionString(str);\n    var number = self.getNumber(str);\n    var operator = self.getOperator(str);\n    var rightSide = self.getRightSide(strCl, operator.enText);\n    var leftSide = self.getLeftSide(strCl, operator.enText);\n    return {\n      id: number,\n      operator: operator,\n      condition: str,\n      clr: strCl,\n      leftSide: leftSide,\n      rightSide: rightSide\n    };\n  };\n\n  self.getOperator = function (str) {\n    var op = null;\n\n    for (var i = 0; i < dynamicConditionalOperators2.length; i++) {\n      if (str.indexOf(dynamicConditionalOperators2[i].enText) !== -1) op = dynamicConditionalOperators2[i];\n    }\n\n    return op;\n  };\n\n  self.getNumber = function (str) {\n    var first = str.search(/cs\\d/i);\n    var firstD = str.search(/\\:/i);\n    var tex = str.substring(first, firstD);\n    return Number(tex.replace(\"cs\", \"\"));\n  };\n\n  self.clearConditionString = function (str) {\n    str = str.trim();\n    var firstBracket = str.indexOf(\"[\");\n    if (firstBracket !== undefined && firstBracket !== 0) str = str.substring(firstBracket);\n    var lastBracket = str.lastIndexOf(\"]\");\n    if (lastBracket !== undefined && lastBracket + 1 !== str.length) str = str.substring(0, lastBracket);\n    str = str.trim().replace(/cs\\d:/i, \"\");\n    return str.substring(1, str.length - 1);\n  };\n\n  self.getLeftSide = function (str, operator) {\n    var splits = str.split(operator);\n    var val = splits[0].substring(str.indexOf(\"'\"), str.lastIndexOf(\"'\")).replace(/[\\[]/g, \"\").replace(/[\\]]/g, \"\").replace(/[\\']/g, \"\");\n    return Number(val);\n  };\n\n  self.getRightSide = function (str, operator) {\n    var split = str.split(operator)[1];\n    var type = null;\n    var val = \"\";\n    if (split !== \"\") val = split.substring(split.indexOf(\"'\") + 1, split.lastIndexOf(\"'\")).replace(/[\\']/g, \"\"); //val = self.clearBracets(val);\n\n    if (split === \"\") type = 13;else if (split.indexOf(\"listtext\") !== -1) type = 9;else if (split.indexOf(\"listdate\") !== -1) type = 10;else if (split.indexOf(\"listenum\") !== -1) type = 12;else if (split.indexOf(\"listint\") !== -1) type = 14;else if (split.indexOf(\"int\") !== -1) type = 0;else if (split.indexOf(\"text\") !== -1) type = 1;else if (split.indexOf(\"decimal\") !== -1) type = 2;else if (split.indexOf(\"money\") !== -1) type = 3;else if (split.indexOf(\"date\") !== -1) type = 4;else if (split.indexOf(\"enum\") !== -1) type = 7;else if (split.indexOf(\"sourcetable\") !== -1) type = 17;else if (split.indexOf(\"calculationtable\") !== -1) type = 18;else if (split.indexOf(\"table\") !== -1) type = 8;else if (split.indexOf(\"likepattern\") !== -1) type = 20;else if (split.indexOf(\"pattern\") !== -1) type = 15;else if (split.indexOf(\"value\") !== -1) type = 16;else if (split.indexOf(\"formula\") !== -1) type = 21;\n    return {\n      type: type,\n      value: val\n    };\n  };\n\n  self.clearBracets = function (str) {\n    if (str.startsWith(\"[\")) str = str.substring(1);\n    if (str.endsWith(\"]\")) str = str.substring(0, str.length - 1);\n    return str;\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/master/phraseTranslator.js?");

/***/ }),

/***/ "./src/scripts/pages/master/viewModel.js":
/*!***********************************************!*\
  !*** ./src/scripts/pages/master/viewModel.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"HeaderSection\": () => (/* binding */ HeaderSection),\n/* harmony export */   \"MasterViewModel\": () => (/* binding */ MasterViewModel)\n/* harmony export */ });\n/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./model.js */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _util_keyboardHandler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/keyboardHandler.js */ \"./src/scripts/util/keyboardHandler.js\");\n/* harmony import */ var _viewModelsIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../viewModelsIndex.js */ \"./src/scripts/pages/viewModelsIndex.js\");\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n/* provided dependency */ var dateHelper = __webpack_require__(/*! ./src/scripts/util/dateHelper.js */ \"./src/scripts/util/dateHelper.js\");\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\n\n\n\n\nfunction MasterViewModel() {\n  var self = this;\n\n  for (var m in window.entities) {\n    if (window.entities.hasOwnProperty(m)) {\n      self[window.entities[m].prop] = ko.observable();\n    }\n  }\n\n  self.pageName = ko.observable();\n  self.loginCompanyId = ko.observable();\n  self.loginCompanyType = ko.observable();\n  self.currentUser = ko.observable();\n  self.userName = ko.observable();\n  self.lsl = ko.observable();\n  self.currentMappingEnabled = ko.observable();\n  self.currentCompany = ko.observable();\n  self.captionCompany = ko.observable();\n  self.periodItem = ko.observable();\n  self.permitPeriodEdit = ko.observable(true);\n  self.processManagement = ko.observable(new _model_js__WEBPACK_IMPORTED_MODULE_0__.ProcessQueue(self));\n  self.keysHandler = ko.observable(new _util_keyboardHandler_js__WEBPACK_IMPORTED_MODULE_1__.KeyboardHandler());\n  self.headerSection = new HeaderSection(self);\n  self.showBalanceAdjustmentDocumentForm = ko.observable(false);\n  self.balanceAdjustmentDocumentForm = ko.observable();\n\n  self.closeBalanceAdjustmentDocument = function () {\n    self.showBalanceAdjustmentDocumentForm(false);\n    self.balanceAdjustmentDocumentForm(null);\n  };\n\n  self.initModel = function (refresh) {\n    var model;\n    var container = self[entities[window.resDomain].prop];\n\n    switch (window.resDomain) {\n      case \"Mapping\":\n        if (_h.isNullOrEmpty(container())) {\n          var vmName = window.resDomain + 'ViewModel';\n          model = _viewModelsIndex_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"][vmName];\n          container(new model());\n          if (refresh === undefined) container().init();else container().reInit();\n        }\n\n        container().getBalancesheetSelectList(true);\n        break;\n\n      case \"Magazine\":\n        if (_h.isNullOrEmpty(container()) || refresh) {\n          var vmName = window.resDomain + 'ViewModel';\n          model = _viewModelsIndex_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"][vmName];\n          container(new model());\n          container().init();\n        }\n\n        if (!_h.isNullOrEmpty(container()) && !_h.isNullOrEmpty(container().designSelectedModel())) {\n          container().designSelectedModel().tableTemplateModel().getRecords();\n          if (container().designMode() === true) window.resSecondDomain = 'pageeditor';\n        }\n\n        break;\n\n      case \"DynamicDocument\":\n        var vmName = window.resDomain + 'ViewModel';\n        model = _viewModelsIndex_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"][vmName];\n        container(new model());\n        container().init();\n        break;\n\n      default:\n        if (_h.isNullOrEmpty(container()) || refresh) {\n          var vmName = window.resDomain + 'ViewModel';\n          model = _viewModelsIndex_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"][vmName];\n          container(new model());\n          container().init();\n        }\n\n        break;\n    }\n  };\n\n  self.refreshSysData = function (data, refreshUi) {\n    if (_h.isNullOrEmpty(data.prd)) self.periodItem(null);else {\n      self.periodItem(new _model_js__WEBPACK_IMPORTED_MODULE_0__.PeriodInfo(data.prd));\n      if (data.prd.cl === true || data.prd.st === 0) self.permitPeriodEdit(false);else self.permitPeriodEdit(true);\n    }\n    self.currentUser(data.ur);\n    if (_h.isEmpty(data.ur.fn)) self.userName(data.ur.un);else self.userName(data.ur.fn);\n\n    if (refreshUi || refreshUi === undefined) {\n      var activeMenu = entities[window.resDomain].menu;\n\n      for (var _m in entities) {\n        if (entities.hasOwnProperty(_m) && entities[_m].menu === activeMenu) {\n          self[entities[_m].prop](null);\n        }\n      }\n    }\n\n    self.currentCompany(data.cmp);\n    self.loginCompanyType(data.cmp.ct);\n    self.loginCompanyId(data.cmp.ci);\n    self.currentMappingEnabled(data.cmp.mpe);\n    if (self.loginCompanyType() === 0) self.captionCompany(_h.getLocalizedText(\"activeGroup\"));else self.captionCompany(_h.getLocalizedText(\"activeCompany\"));\n  };\n\n  self.getCurrentInfo = function (callback) {\n    var data = _h.getUd();\n\n    if (_h.isEmpty(data)) {\n      _h.backToLogin();\n    } else {\n      self.refreshSysData(data);\n      callback(true);\n    }\n  };\n\n  self.refreshToken = function () {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/account/postrefreshtoken\",\n      success: function success(d) {\n        if (_h.isEmpty(d)) {\n          var text = _h.getApiMessage(\"ErrorUnknownServer\");\n\n          _h.failToast(text);\n\n          _h.backToLogin();\n\n          return;\n        }\n\n        self.changeTvm(d, true);\n      },\n      error: function error() {\n        _h.backToLogin();\n      }\n    });\n  };\n\n  self.changeTvm = function (d, refreshUi) {\n    _h.setUd(d.ud);\n\n    _h.setSd(d.sd);\n\n    if (d.sts.length > 0) localStorage.setItem(\"sts\", JSON.stringify(d.sts));else {\n      d.sts = [{\n        key: \"RepGenAutoSave\",\n        value: \"0\",\n        scopeAccess: 1\n      }];\n      localStorage.setItem(\"sts\", JSON.stringify(d.sts));\n    }\n    self.refreshSysData(d.ud, refreshUi);\n\n    if (refreshUi) {\n      self.refreshUi();\n\n      _h.toggleDisableSections(false);\n    }\n\n    if (window.resDomain === \"TableTemplate\") {\n      self.ttvm().refreshPage();\n    }\n  };\n\n  self.refreshUi = function () {\n    var activeMenu = entities[window.resDomain].menu;\n\n    for (var _m2 in entities) {\n      if (entities.hasOwnProperty(_m2) && entities[_m2].menu === activeMenu) {\n        self[entities[_m2].prop](null);\n      }\n    }\n\n    if (activeMenu === \"Operation\") {\n      self.initialiseTabs();\n    }\n\n    self.initModel();\n  };\n\n  self.changeLogBtn = function () {\n    self.openForm(new _model_js__WEBPACK_IMPORTED_MODULE_0__.ChangeLogViewModel());\n  };\n\n  self.openHelp = function (dataModel, e) {\n    self.showForm(new _model_js__WEBPACK_IMPORTED_MODULE_0__.HelpViewModel(self, e));\n  };\n\n  self.getAppConfig = function (callback) {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/common/getconfigs\",\n      success: function success(data) {\n        if (data !== null && data !== undefined) {\n          callback(data);\n        }\n      },\n      error: function error(data) {\n        var text = _h.getApiMessage(\"LoadAppConfigError\");\n\n        _h.failToast(text);\n\n        callback(null);\n      }\n    });\n  };\n\n  self.appConfigBtn = function () {\n    self.getAppConfig(function (data) {\n      if (data) {\n        _h.kocnx().openForm(new _model_js__WEBPACK_IMPORTED_MODULE_0__.AppConfigForm(self, data));\n      }\n    });\n  };\n\n  self.editAppConfig = function (parents, btnModel, e) {\n    var item = parents[1];\n\n    if (!item.validationObject.isValid()) {\n      item.validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    var model = item.toServer();\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/common/postconfigs\",\n      data: model,\n      success: function success(data) {\n        _h.kocnx().closeForm();\n\n        var text = _h.getApiMessage(\"PutAppConfigSuccess\");\n\n        _h.successToast(text);\n      },\n      error: function error(data) {\n        var text = _h.getApiMessage(\"PutAppConfigError\");\n\n        _h.failToast(text);\n      }\n    });\n  };\n\n  self.getUserProfile = function (callback) {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/user/getprofile\",\n      success: function success(data) {\n        if (data !== null && data !== undefined) {\n          callback(data);\n        }\n      },\n      error: function error(data) {\n        var text = _h.getApiMessage(\"LoadUserProfileError\");\n\n        _h.failToast(text);\n\n        callback(null);\n      }\n    });\n  };\n\n  self.userProfileBtn = function () {\n    self.getUserProfile(function (data) {\n      if (data) {\n        _h.kocnx().openForm(new _model_js__WEBPACK_IMPORTED_MODULE_0__.UserProfile(self, data));\n      }\n    });\n  };\n\n  self.logout = function () {\n    $('.splash').css('display', 'block');\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/account/postlogoff\",\n      data: model,\n      success: function success(data) {\n        _h.backToLogin();\n      },\n      error: function error(data) {\n        _h.backToLogin();\n      }\n    });\n  };\n\n  self.editUserProfile = function (parents, btnModel, e) {\n    var item = parents[1];\n\n    if (!item.validationObject.isValid()) {\n      item.validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    var model = item.toServer();\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/user/putprofile\",\n      data: model,\n      success: function success(data) {\n        _h.kocnx().closeForm();\n\n        if (self.pageName() === \"Users\") {\n          self.uvm().refreshTable();\n        }\n\n        var text = _h.getApiMessage(\"PutUserProfileSuccess\");\n\n        _h.successToast(text);\n      },\n      error: function error(data) {\n        var text = _h.getApiMessage(\"PutUserProfileError\");\n\n        _h.failToast(text);\n      }\n    });\n  };\n\n  self.changePasswordBtn = function () {\n    self.openForm(new _model_js__WEBPACK_IMPORTED_MODULE_0__.ResetPasswordModel(self, {}));\n  };\n\n  self.editChangePassword = function (parents, btnModel, e) {\n    var item = parents[1];\n\n    if (!item.validationObject.isValid()) {\n      item.validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    var model = item.toServer();\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/user/postuserresetpassword\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          self.closeForm();\n\n          var text = _h.getApiMessage(\"PostChangePasswordSuccess\");\n\n          _h.successToast(text);\n        }\n      },\n      error: function error(data) {\n        var text = _h.getApiMessage(\"PostChangePasswordError\");\n\n        _h.failToast(text);\n      }\n    });\n  };\n\n  self.toggleChildren = function (item) {\n    if (item.childrenShow() === false) {\n      item.childrenShow(true);\n      if (item[\"usersShow\"]) item[\"usersShow\"](false);\n    } else {\n      item.childrenShow(false);\n    }\n  };\n\n  self.showAll = function (list, type) {\n    var status = type === \"plus\";\n    list = ko.isObservable(list) ? list() : list;\n    if (_h.any(list)) for (var i = 0; i < list.length; i++) {\n      var target = list[i];\n      self.showChildrenAll(target, status);\n    }\n  };\n\n  self.showChildrenAll = function (item, status) {\n    item.childrenShow(status);\n    if (_h.any(item.children())) for (var i = 0; i < item.children().length; i++) {\n      var target = item.children()[i];\n      target.childrenShow(status);\n      self.showChildrenAll(target, status);\n    }\n  };\n\n  self.saveTableState = function (context, hasParent) {\n    var list = [];\n\n    if (!hasParent) {\n      ko.utils.arrayFilter(context.tableProperties(), function (property) {\n        list.push({\n          fa: property.fa,\n          className: property.className,\n          type: property.type,\n          colName: property.name,\n          tablecol: property.tablecol,\n          visibleCol: property.visibleCol(),\n          visibleItem: property.visibleItem(),\n          sortDir: property.sortDir(),\n          size: property.size,\n          width: property.width,\n          alias: property.alias,\n          template: property.template,\n          popup: property.popup,\n          click: property.click,\n          disableSort: property.disableSort,\n          activeGroupBy: property.activeGroupBy(),\n          groupBy: property.groupBy,\n          groupDir: property.groupDir(),\n          colParent: property.colParent,\n          templateName: property.templateName,\n          filterType: property.filterType\n        });\n      });\n      clientStorage.setSetting([{\n        key: context.entityName + \"_TableState_\" + self.loginCompanyType(),\n        value: JSON.stringify(list)\n      }]);\n    } else {\n      ko.utils.arrayFilter(context.tableParentProperties(), function (property) {\n        list.push({\n          id: property.id,\n          name: property.name,\n          visibleCol: property.visibleCol(),\n          size: property.size\n        });\n      });\n      clientStorage.setSetting([{\n        key: context.entityName + \"_Parent_TableState_\" + self.loginCompanyType(),\n        value: JSON.stringify(list)\n      }]);\n    }\n  };\n\n  self.resetTableState = function (context, i, e) {\n    clientStorage.removeSetting(context.entityName + \"_TableState_\" + self.loginCompanyType());\n    clientStorage.removeSetting(context.entityName + \"_Parent_TableState_\" + self.loginCompanyType());\n    clientStorage.removeSetting(context.entityName + \"_ShowTableState_\" + self.loginCompanyType());\n    context.groupProperty(undefined);\n    context.groupDirection(undefined);\n    context.fillTableProperties();\n    context.getRecords();\n  };\n\n  self.changeColWidth = function (e) {\n    var list = [];\n    var context = ko.contextFor(e).$parent;\n    if (!context) return;\n    var cols = $(\".\" + context.entityName + \"-tbl\").find(\"th:visible\");\n    ko.utils.arrayFilter(context.tableProperties(), function (property) {\n      var width;\n\n      for (var i = 0; i < cols.length; i++) {\n        var dataName = $(cols[i]).attr(\"data-name\");\n        if (property.name === dataName && cols[i].style.width && cols[i].style.width.indexOf(\"%\") === -1) width = cols[i].style.width.replace(\"px\", \"\");\n      }\n\n      var item = {\n        fa: property.fa,\n        className: property.className,\n        type: property.type,\n        colName: property.name,\n        tablecol: property.tablecol,\n        visibleCol: property.visibleCol(),\n        visibleItem: property.visibleItem(),\n        sortDir: property.sortDir(),\n        size: property.size,\n        width: undefined,\n        alias: property.alias,\n        template: property.template,\n        popup: property.popup,\n        click: property.click,\n        activeGroupBy: property.activeGroupBy(),\n        groupBy: property.groupBy,\n        groupDir: property.groupDir(),\n        colParent: property.colParent,\n        templateName: property.templateName\n      };\n      if (width) item.width = width;\n      list.push(item);\n    });\n    clientStorage.setSetting([{\n      key: context.entityName + \"_TableState_\" + self.loginCompanyType(),\n      value: JSON.stringify(list),\n      scopeAccess: 1\n    }]);\n  };\n\n  self.createPdf = function (model) {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/filegenerator/postPdf\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.downloadFile(data.model);\n        }\n      },\n      error: function error(data) {\n        var text = _h.getApiMessage(\"GetFileError\");\n\n        _h.failToast(text);\n      }\n    });\n  };\n\n  self.createHtml = function (controllerName, id) {\n    var model = {\n      controllerName: controllerName,\n      id: id\n    };\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/filegenerator/gethtml\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.downloadFile(data.model);\n        }\n      },\n      error: function error(data) {\n        var text = _h.getApiMessage(\"GetFileError\");\n\n        _h.failToast(text);\n      }\n    });\n  };\n\n  self.createExcel = function (model) {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/filegenerator/postdownloadexcel\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.downloadFile(data.model);\n        }\n      },\n      error: function error(data) {\n        var text = _h.getApiMessage(\"GetFileError\");\n\n        _h.failToast(text);\n      }\n    });\n  };\n\n  self.toggleChkBox = function (parent, item, model) {\n    if (item() === undefined) item(true);else {\n      item(!item());\n    }\n  };\n\n  self.openConnectMan = function (controllerName, caption) {\n    self.openForm(new _model_js__WEBPACK_IMPORTED_MODULE_0__.ConnectionManager(self, {\n      controllerName: controllerName,\n      caption: caption\n    }));\n  };\n\n  self.folderManagementBtn = function (context, i, e) {\n    var controllerName;\n\n    for (var j = 0; j < controllerNames.length; j++) {\n      var target = controllerNames[j];\n\n      if (context.entityName === target.enText) {\n        controllerName = target.value;\n      }\n    }\n\n    if (controllerName) {\n      self.openForm(new _model_js__WEBPACK_IMPORTED_MODULE_0__.FolderManagement(context, {\n        controllerName: controllerName\n      }));\n    }\n  };\n\n  self.init = function () {\n    self.getCurrentInfo(function (res) {\n      if (res) {\n        self.initialiseTabs();\n        self.initModel();\n\n        _h.toggleDisableSections(false);\n      }\n    });\n    var lsl = localStorage.getItem(\"lsl\");\n    self.lsl(lsl);\n    var fs = localStorage.getItem(\"fs\");\n\n    if (fs) {\n      self.showLoginHistory();\n    }\n  };\n\n  self.loginHistoryBtn = function () {\n    self.showLoginHistory();\n  };\n\n  self.showLoginHistory = function () {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/actionlog/getloginhistory\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          self.openForm(new _model_js__WEBPACK_IMPORTED_MODULE_0__.LoginHistory(self, data));\n        }\n\n        localStorage.removeItem(\"fs\");\n      },\n      error: function error(data) {\n        var text = _h.getApiMessage(\"GetLoginHistoryError\");\n\n        _h.failToast(text);\n\n        localStorage.removeItem(\"fs\");\n      }\n    });\n  };\n\n  self.openLoginModal = function () {\n    self.openForm(new _model_js__WEBPACK_IMPORTED_MODULE_0__.LoginViewModel(self));\n  };\n\n  self.initialiseTabs = function () {\n    switch (self.pageName()) {\n      case \"Operation\":\n        $(\".master-tab\").find(\"li\").removeClass(\"active\");\n\n        if (self.loginCompanyType() === 0 && self.currentCompany().irt === false) {\n          window.resDomain = 'Mapping';\n          $(\"#Mapping-t\").addClass(\"active\");\n          $(\"[href='#Mapping-t']\").parent().addClass(\"active\");\n        }\n\n        if (self.loginCompanyType() === 0 && self.currentCompany().irt === true) {\n          window.resDomain = 'GroupPeriod';\n          $(\"#GroupPeriod-t\").addClass(\"active\");\n          $(\"[href='#GroupPeriod-t']\").parent().addClass(\"active\");\n        }\n\n        if (self.loginCompanyType() === 1) {\n          window.resDomain = 'Balancesheet';\n          $(\"[href='#Balancesheet-t']\").parent().addClass(\"active\");\n          $(\"#Balancesheet-t\").addClass(\"active\");\n        }\n\n        break;\n    }\n  };\n\n  self.checkProcessQueue = function (sign, firstLoad) {\n    self.processManagement().init(sign, firstLoad);\n  };\n\n  self.connectionProcessHandler = function (id, input, output, percent, title, processStatus, item, host) {\n    var connModal = self.formModel();\n\n    if (self.showForm() && connModal.entityName === \"Connection\") {\n      connModal.selectedRow().processItem(item);\n\n      if (_h.any(output.errors)) {\n        connModal.selectedRow().resultErrors.removeAll();\n\n        for (var b = 0; b < output.errors.length; b++) {\n          var target = output.errors[b];\n\n          var text2 = _h.getApiMessage(target.code);\n\n          text2 = _h.completeError(text2, target);\n          connModal.selectedRow().resultErrors.push(text2);\n        }\n      }\n\n      if (_h.any(output.outputFiles)) {\n        connModal.selectedRow().outputFiles.removeAll();\n\n        for (var i = 0; i < output.outputFiles.length; i++) {\n          connModal.selectedRow().outputFiles.push(output.outputFiles[i]);\n        }\n\n        connModal.selectedRow().resultMode(true);\n      }\n\n      if (_h.any(output.properties) && output.hasNextStage) {\n        for (var k = 0; k < output.properties.length; k++) {\n          var prop = new _model_js__WEBPACK_IMPORTED_MODULE_0__.ResultConnectionProperties(output.properties[k]);\n          connModal.selectedRow().properties.push(prop);\n        }\n\n        if (!connModal.selectedRow().resultMode()) connModal.selectedRow().resultMode(true);\n      }\n\n      if (!_h.any(output.errors) && !_h.any(output.outputFiles) && !_h.any(output.properties) && (percent === 100 || percent === \"100\")) {\n        connModal.selectedRow().resultMode(false);\n        connModal.selectedRow().properties.removeAll();\n        connModal.selectedRow().resultErrors.removeAll();\n        connModal.selectedRow().outputFiles.removeAll();\n        toast.success(connModal.entityName, 'postUpdate', 'CompleteRun');\n        connModal.getRecords();\n      }\n\n      connModal.hasNextStage(output.hasNextStage);\n    }\n  };\n\n  self.importFileBtn = function (id, parent, fileType, schemaMode) {\n    self.openForm(new _model_js__WEBPACK_IMPORTED_MODULE_0__.FileUploadForm({\n      fileType: fileType,\n      id: id\n    }, parent, schemaMode));\n  };\n\n  self.importFile = function (parents, btnModel, e) {\n    var item = parents[1];\n\n    if (!item.validationObject.isValid()) {\n      item.validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    var model = item.toServer();\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      splashId: e,\n      url: \"/api/common/postimportfile\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          switch (item.parent.entityName) {\n            case \"Tree\":\n              item.parent.refreshEditor();\n              toast.success(item.parent.entityName, 'custom', \"Import\".concat(item.fileTypeExpect));\n              break;\n\n            case \"TableTemplate\":\n              item.parent.afterCreate(data.models);\n              toast.success(item.parent.entityName, 'custom', \"Import\".concat(item.fileTypeExpect));\n              break;\n\n            case \"DynamicTable\":\n              if (item.schemaMode()) {\n                item.parent.afterCreate(data.models);\n                toast.success(item.parent.entityName, 'custom', 'ImportExcel');\n              } else {\n                toast.success(\"DynamicTableData\", 'custom', 'ImportExcel');\n                item.parent.childModel().getRecords();\n              }\n\n              break;\n          }\n\n          self.closeForm();\n        }\n      },\n      error: function error() {\n        toast.error(item.parent.entityName, 'custom', \"Import\".concat(item.fileTypeExpect));\n      }\n    });\n  };\n\n  self.securityConfigBtn = function () {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/account/getconfigs\",\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          self.openForm(new _model_js__WEBPACK_IMPORTED_MODULE_0__.SecurityConfig(self, data));\n        }\n      },\n      error: function error(data) {}\n    });\n  };\n\n  self.changeSecurityConfig = function (parents, btnModel, e) {\n    var item = parents[1];\n    var model = {\n      list: item.toServer()\n    };\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/account/postoverwrite\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.kocnx().closeForm();\n        }\n      },\n      error: function error(data) {}\n    });\n  };\n}\nMasterViewModel.prototype.showForm = ko.observable(false);\nMasterViewModel.prototype.formModel = ko.observable();\n\nMasterViewModel.prototype.openForm = function (formModel, target) {\n  var mb = $(\".modal-box\");\n  mb.css(\"width\", \"\");\n  mb.css(\"min-width\", \"\");\n  mb.css(\"left\", \"\");\n  mb.css(\"top\", \"\");\n  MasterViewModel.prototype.formModel(formModel);\n  MasterViewModel.prototype.showForm(true);\n  if (_h.isEmpty(formModel.backgroundModal)) $(\".modal-back\").css(\"display\", \"block\");\n  if (!_h.isEmpty(formModel.backgroundColor)) $(\".modal-back\").css(\"background-color\", \"white\");\n  if (formModel.width) _h.adjustModalPosition(formModel.width, formModel.minWidth);\n  mb.draggable({\n    scroll: true,\n    handle: \".panel-heading\"\n  });\n  var className = formModel.constructor.name;\n  var selector, selectedTag;\n\n  if (target) {\n    selectedTag = $(target);\n  } else {\n    selector = className === \"NodeForm\" || className === \"CompanyForm\" ? \".dmn-selected\" : \".table-row-selected\";\n    selectedTag = $(selector);\n  }\n\n  if (selectedTag.length) {\n    var pos = _h.getPosition(selectedTag[0]);\n\n    mb.css(\"top\", pos.scrollTop + \"px\");\n  }\n};\n\nMasterViewModel.prototype.closeForm = function () {\n  MasterViewModel.prototype.showForm(false);\n  MasterViewModel.prototype.formModel(null);\n  $(\".modal-back\").css(\"display\", \"\");\n};\n\n$(document).on(\"shown.bs.tab\", '.master-tab a[data-toggle=\"tab\"]', function (e) {\n  var target = $(e.target).attr(\"href\");\n  if (_h.isEmpty(target)) return;\n  window.resDomain = target.replace(\"-t\", \"\").replace(\"#\", \"\");\n\n  _h.kocnx().initModel();\n});\nvar HeaderSection = /*#__PURE__*/function () {\n  function HeaderSection(parent) {\n    _classCallCheck(this, HeaderSection);\n\n    this.parent = parent;\n    this.preSelectedCompany = ko.observable();\n    this.preSelectedPeriod = ko.observable();\n    this.companies = ko.observableArray();\n    var date = dateHelper.getCurrentJalaaliYear();\n    this.yearPeriod = ko.observable(date.jy).extend({\n      rateLimit: 500\n    });\n    this.monthPeriod = ko.observable(undefined).extend({\n      rateLimit: 500\n    });\n    this.searchCompany = ko.observable();\n    this.searchCompany.subscribe(function (val) {\n      for (var i = 0; i < this.companies().length; i++) {\n        if (_h.isEmpty(val) || this.companies()[i].name().indexOf(val) !== -1) {\n          this.companies()[i].show(true);\n        } else {\n          this.companies()[i].show(false);\n        }\n      }\n    }.bind(this));\n    this.getVerticalAlignLogotype = ko.pureComputed(function () {\n      if (this.parent.currentCompany() !== null && this.parent.currentCompany() !== undefined) {\n        var name = _h.getLogoType(this.parent.currentCompany().n);\n\n        if (name === \"ا\" || name === \"آ\") return \"vertical-align :sub\";\n        if (name === \"ط\" || name === \"ظ\" || name === \"گ\" || name === \"ک\") return \"vertical-align :text-bottom\";\n      }\n\n      return \"\";\n    }.bind(this));\n  }\n\n  _createClass(HeaderSection, [{\n    key: \"changeActiveCompany\",\n    value: function changeActiveCompany(item) {\n      this.preSelectedPeriod(null);\n\n      for (var i = 0; i < this.companies().length; i++) {\n        if (this.companies()[i].id() === item.id()) {\n          this.companies()[i].preSelected(!item.preSelected());\n          this.preSelectedCompany(item);\n\n          for (var j = 0; j < this.preSelectedCompany().periods().length; j++) {\n            if (this.preSelectedCompany().periods()[j].preSelected()) {\n              this.preSelectedPeriod(this.preSelectedCompany().periods()[j]);\n            }\n          }\n        } else this.companies()[i].preSelected(false);\n      }\n    }\n  }, {\n    key: \"changeActivePeriod\",\n    value: function changeActivePeriod(item) {\n      for (var j = 0; j < this.preSelectedCompany().periods().length; j++) {\n        this.preSelectedCompany().periods()[j].preSelected(false);\n      }\n\n      item.preSelected(true);\n      this.preSelectedPeriod(item);\n    }\n  }, {\n    key: \"changeActiveItems\",\n    value: function changeActiveItems(item) {\n      var isPreNull = _h.isNullOrEmpty(this.preSelectedPeriod());\n\n      var isPeriodItemNull = _h.isNullOrEmpty(this.parent.periodItem());\n\n      if (!isPreNull && !isPeriodItemNull) {\n        if (this.preSelectedPeriod().id === this.parent.periodItem().pi && this.preSelectedCompany().id() === this.parent.loginCompanyId()) {\n          return;\n        }\n      }\n\n      var periodId, companyId;\n\n      if (!_h.isEmpty(this.preSelectedPeriod())) {\n        periodId = this.preSelectedPeriod().id;\n      } else {\n        periodId = 0;\n      }\n\n      if (!_h.isEmpty(this.preSelectedCompany())) {\n        companyId = this.preSelectedCompany().id();\n      } else {\n        companyId = this.parent.loginCompanyId();\n      }\n\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n        url: \"/api/common/postcurrentdata\",\n        data: {\n          periodId: periodId,\n          companyId: companyId\n        },\n        success: function (data) {\n          var text = _h.getApiMessage(\"ActivePeriodSelectSuccess\");\n\n          _h.successToast(text);\n\n          for (var i = 0; i < this.companies().length; i++) {\n            if (this.companies()[i].id() === this.preSelectedCompany().id()) {\n              this.companies()[i].selected(true);\n              this.companies()[i].preSelected(false);\n\n              for (var j = 0; j < this.companies()[i].periods().length; j++) {\n                if (this.companies()[i].periods()[j].preSelected()) {\n                  this.companies()[i].periods()[j].selected = true;\n                } else {\n                  this.companies()[i].periods()[j].selected = false;\n                }\n              }\n            } else {\n              this.companies()[i].selected(false);\n              this.companies()[i].preSelected(false);\n\n              for (var _j = 0; _j < this.companies()[i].periods().length; _j++) {\n                if (this.companies()[i].periods()[_j].selected) this.companies()[i].periods()[_j].preSelected(true);else this.companies()[i].periods()[_j].preSelected(false);\n              }\n            }\n          }\n        }.bind(this),\n        error: function error(data) {\n          var text = _h.getApiMessage(\"ActivePeriodSelectError\");\n\n          _h.failToast(text);\n        }\n      });\n    }\n  }, {\n    key: \"getCompanies\",\n    value: function getCompanies(defaultList) {\n      var activeCompanyId;\n\n      if (!_h.isEmpty(this.preSelectedCompany())) {\n        activeCompanyId = this.preSelectedCompany().id();\n      } else {\n        activeCompanyId = this.parent.loginCompanyId();\n      }\n\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n        url: \"/api/common/getcurrentoptions\",\n        data: {\n          year: this.yearPeriod(),\n          month: this.monthPeriod(),\n          activeCompanyId: activeCompanyId,\n          defaultList: defaultList\n        },\n        success: function (data) {\n          if (defaultList === false) {\n            if (this.preSelectedCompany()) this.preSelectedCompany().fillPeriods(data[0].periods);\n          } else {\n            this.companies.removeAll();\n\n            if (_h.any(data)) {\n              for (var i = 0; i < data.length; i++) {\n                var target = data[i];\n                this.companies.push(new _model_js__WEBPACK_IMPORTED_MODULE_0__.CompanyTokenInfo(target, this.parent.loginCompanyId()));\n\n                if (this.parent.currentCompany().ci === this.companies()[i].id()) {\n                  this.preSelectedCompany(this.companies()[i]);\n                  this.preSelectedCompany().preSelected(true);\n\n                  for (var j = 0; j < this.preSelectedCompany().periods().length; j++) {\n                    if (this.preSelectedCompany().periods()[j].selected) {\n                      this.preSelectedPeriod(this.preSelectedCompany().periods()[j]);\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }.bind(this),\n        error: function error(data) {\n          var text = _h.getApiMessage(\"ErrorLoadSelectCompany\");\n\n          _h.failToast(text);\n        }\n      });\n    }\n  }, {\n    key: \"resetActiveSelectMenu\",\n    value: function resetActiveSelectMenu(def) {\n      var date = dateHelper.getCurrentJalaaliYear();\n      this.yearPeriod(date.jy);\n      this.monthPeriod(undefined);\n      this.getCompanies(def === true);\n    }\n  }, {\n    key: \"openActiveSelectMenu\",\n    value: function openActiveSelectMenu() {\n      if (this.companies().length === 0) {\n        this.getCompanies(true);\n      }\n    }\n  }, {\n    key: \"getPeriodBtn\",\n    value: function getPeriodBtn() {\n      this.getCompanies(false);\n    }\n  }, {\n    key: \"openProcessManagementForm\",\n    value: function openProcessManagementForm() {\n      this.parent.processManagement().showForm(true);\n      $(\".process-box\").draggable({\n        scroll: true,\n        handle: \".panel-heading\"\n      });\n    }\n  }]);\n\n  return HeaderSection;\n}();\n\n//# sourceURL=webpack://domino/./src/scripts/pages/master/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/modelsIndex.js":
/*!******************************************!*\
  !*** ./src/scripts/pages/modelsIndex.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _user_model_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./user/model.js */ \"./src/scripts/pages/user/model.js\");\n/* harmony import */ var _actionlog_model_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./actionlog/model.js */ \"./src/scripts/pages/actionlog/model.js\");\n/* harmony import */ var _access_model_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./access/model.js */ \"./src/scripts/pages/access/model.js\");\n/* harmony import */ var _company_model_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./company/model.js */ \"./src/scripts/pages/company/model.js\");\n/* harmony import */ var _groupperiod_model_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./groupperiod/model.js */ \"./src/scripts/pages/groupperiod/model.js\");\n/* harmony import */ var _consolidate_model_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./consolidate/model.js */ \"./src/scripts/pages/consolidate/model.js\");\n/* harmony import */ var _onlineuser_model_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./onlineuser/model.js */ \"./src/scripts/pages/onlineuser/model.js\");\n/* harmony import */ var _dynamictable_model_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dynamictable/model.js */ \"./src/scripts/pages/dynamictable/model.js\");\n/* harmony import */ var _companyinfo_model_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./companyinfo/model.js */ \"./src/scripts/pages/companyinfo/model.js\");\n/* harmony import */ var _dynamicdocument_model_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dynamicdocument/model.js */ \"./src/scripts/pages/dynamicdocument/model.js\");\n/* harmony import */ var _period_model_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./period/model.js */ \"./src/scripts/pages/period/model.js\");\n/* harmony import */ var _trees_model_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./trees/model.js */ \"./src/scripts/pages/trees/model.js\");\n/* harmony import */ var _balancesheet_model_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./balancesheet/model.js */ \"./src/scripts/pages/balancesheet/model.js\");\n/* harmony import */ var _mapping_model_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./mapping/model.js */ \"./src/scripts/pages/mapping/model.js\");\n/* harmony import */ var _balancereport_model_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./balancereport/model.js */ \"./src/scripts/pages/balancereport/model.js\");\n/* harmony import */ var _tabletemplate_model_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./tabletemplate/model.js */ \"./src/scripts/pages/tabletemplate/model.js\");\n/* harmony import */ var _magazine_model_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./magazine/model.js */ \"./src/scripts/pages/magazine/model.js\");\n/* harmony import */ var _adjustmentdocument_model_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./adjustmentdocument/model.js */ \"./src/scripts/pages/adjustmentdocument/model.js\");\n/* harmony import */ var _master_model_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./master/model.js */ \"./src/scripts/pages/master/model.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n  User: _user_model_js__WEBPACK_IMPORTED_MODULE_0__.User,\n  Access: _access_model_js__WEBPACK_IMPORTED_MODULE_2__.Access,\n  Company: _company_model_js__WEBPACK_IMPORTED_MODULE_3__.Company,\n  GroupPeriod: _groupperiod_model_js__WEBPACK_IMPORTED_MODULE_4__.GroupPeriod,\n  Consolidate: _consolidate_model_js__WEBPACK_IMPORTED_MODULE_5__.Consolidate,\n  ActionLog: _actionlog_model_js__WEBPACK_IMPORTED_MODULE_1__.ActionLog,\n  DynamicTable: _dynamictable_model_js__WEBPACK_IMPORTED_MODULE_7__.DynamicTable,\n  CompanyInfo: _companyinfo_model_js__WEBPACK_IMPORTED_MODULE_8__.CompanyInfo,\n  DynamicDocument: _dynamicdocument_model_js__WEBPACK_IMPORTED_MODULE_9__.DynamicDocument,\n  Period: _period_model_js__WEBPACK_IMPORTED_MODULE_10__.Period,\n  Tree: _trees_model_js__WEBPACK_IMPORTED_MODULE_11__.Tree,\n  Balancesheet: _balancesheet_model_js__WEBPACK_IMPORTED_MODULE_12__.Balancesheet,\n  TableTemplate: _tabletemplate_model_js__WEBPACK_IMPORTED_MODULE_15__.TableTemplate,\n  Magazine: _magazine_model_js__WEBPACK_IMPORTED_MODULE_16__.Magazine,\n  AdjustmentDocument: _adjustmentdocument_model_js__WEBPACK_IMPORTED_MODULE_17__.AdjustmentDocument,\n  OnlineUser: _onlineuser_model_js__WEBPACK_IMPORTED_MODULE_6__.OnlineUser,\n  MappingData: _mapping_model_js__WEBPACK_IMPORTED_MODULE_13__.MappingData,\n  BalanceReportData: _balancereport_model_js__WEBPACK_IMPORTED_MODULE_14__.BalanceReportData,\n  BalanceReportCompanyData: _balancereport_model_js__WEBPACK_IMPORTED_MODULE_14__.BalanceReportCompanyData,\n  TotalBalanceReportData: _balancereport_model_js__WEBPACK_IMPORTED_MODULE_14__.TotalBalanceReportData,\n  SubstituteNode: _mapping_model_js__WEBPACK_IMPORTED_MODULE_13__.SubstituteNode,\n  MappingRule: _mapping_model_js__WEBPACK_IMPORTED_MODULE_13__.MappingRule,\n  AdjustmentDocumentItem: _adjustmentdocument_model_js__WEBPACK_IMPORTED_MODULE_17__.AdjustmentDocumentItem,\n  BalancesheetContent: _balancesheet_model_js__WEBPACK_IMPORTED_MODULE_12__.BalancesheetContent,\n  MagazineFile: _master_model_js__WEBPACK_IMPORTED_MODULE_18__.MagazineFile,\n  SourceTableData: _dynamicdocument_model_js__WEBPACK_IMPORTED_MODULE_9__.SourceTableData,\n  ExpenseCenterTableData: _dynamicdocument_model_js__WEBPACK_IMPORTED_MODULE_9__.ExpenseCenterTableData,\n  DynamicTableData: _dynamictable_model_js__WEBPACK_IMPORTED_MODULE_7__.DynamicTableData,\n  CompanyDynamicItem: _company_model_js__WEBPACK_IMPORTED_MODULE_3__.CompanyDynamicItem,\n  CompanyInfoData: _company_model_js__WEBPACK_IMPORTED_MODULE_3__.CompanyInfoData,\n  History: _period_model_js__WEBPACK_IMPORTED_MODULE_10__.History,\n  NodeValuePart: _trees_model_js__WEBPACK_IMPORTED_MODULE_11__.NodeValuePart,\n  UserContent: _user_model_js__WEBPACK_IMPORTED_MODULE_0__.UserContent,\n  TableInfo: _tabletemplate_model_js__WEBPACK_IMPORTED_MODULE_15__.TableInfo,\n  MappingRuleData: _mapping_model_js__WEBPACK_IMPORTED_MODULE_13__.MappingRuleData\n});\n\n//# sourceURL=webpack://domino/./src/scripts/pages/modelsIndex.js?");

/***/ }),

/***/ "./src/scripts/pages/onlineuser/model.js":
/*!***********************************************!*\
  !*** ./src/scripts/pages/onlineuser/model.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"OnlineUser\": () => (/* binding */ OnlineUser)\n/* harmony export */ });\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar _require = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\"),\n    BaseModel = _require.BaseModel;\n\nvar OnlineUser = /*#__PURE__*/function (_BaseModel) {\n  _inherits(OnlineUser, _BaseModel);\n\n  var _super = _createSuper(OnlineUser);\n\n  function OnlineUser(model) {\n    _classCallCheck(this, OnlineUser);\n\n    return _super.call(this, model);\n  }\n\n  return _createClass(OnlineUser);\n}(BaseModel);\n\n//# sourceURL=webpack://domino/./src/scripts/pages/onlineuser/model.js?");

/***/ }),

/***/ "./src/scripts/pages/onlineuser/resource.js":
/*!**************************************************!*\
  !*** ./src/scripts/pages/onlineuser/resource.js ***!
  \**************************************************/
/***/ (() => {

eval("window.onlineuserModelRes = {\n  userId: {\n    fa: '#',\n    colName: 'userId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null,\n    type: \"string\"\n  },\n  userName: {\n    fa: 'کاربر',\n    colName: 'userName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  lastLogin: {\n    fa: 'آخرین ورود موفق',\n    colName: 'lastLogin',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"timeago\"\n  },\n  lastAction: {\n    fa: 'آخرین اقدام',\n    colName: 'lastAction',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"timeago\"\n  },\n  actionName: {\n    fa: 'عنوان آخرین اقدام',\n    colName: 'actionName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  }\n};\nwindow.onlineuserPageRes = {};\n\n//# sourceURL=webpack://domino/./src/scripts/pages/onlineuser/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/onlineuser/viewModel.js":
/*!***************************************************!*\
  !*** ./src/scripts/pages/onlineuser/viewModel.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"OnlineUserViewModel\": () => (/* binding */ OnlineUserViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n__webpack_require__(/*! ./model */ \"./src/scripts/pages/onlineuser/model.js\");\n\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/onlineuser/resource.js\");\n\n\nfunction OnlineUserViewModel() {\n  var self = this;\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"OnlineUser\",\n    getList: true,\n    apiService: {\n      actionList: [\"filterby\"]\n    },\n    buttons: [{\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }],\n    sortDirection: \"Ascending\",\n    sortProperty: \"userId\",\n    context: self,\n    cols: onlineuserModelRes,\n    searchKeyType: \"enter\",\n    saveState: true,\n    selectRow: false,\n    contextMenu: false,\n    resizable: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    self.vishelp(true);\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/onlineuser/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/period/model.js":
/*!*******************************************!*\
  !*** ./src/scripts/pages/period/model.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"ComparativePeriodsForm\": () => (/* binding */ ComparativePeriodsForm),\n/* harmony export */   \"History\": () => (/* binding */ History),\n/* harmony export */   \"HistoryViewModel\": () => (/* binding */ HistoryViewModel),\n/* harmony export */   \"Period\": () => (/* binding */ Period),\n/* harmony export */   \"PeriodDeleteForm\": () => (/* binding */ PeriodDeleteForm),\n/* harmony export */   \"PeriodDependency\": () => (/* binding */ PeriodDependency),\n/* harmony export */   \"PeriodForm\": () => (/* binding */ PeriodForm),\n/* harmony export */   \"SendPeriodForm\": () => (/* binding */ SendPeriodForm)\n/* harmony export */ });\n/* harmony import */ var _master_baseModels_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\");\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* harmony import */ var _master_model_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../master/model.js */ \"./src/scripts/pages/master/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var dateHelper = __webpack_require__(/*! ./src/scripts/util/dateHelper.js */ \"./src/scripts/util/dateHelper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\nvar Period = /*#__PURE__*/function (_BaseModel) {\n  _inherits(Period, _BaseModel);\n\n  var _super = _createSuper(Period);\n\n  function Period(model) {\n    var _this;\n\n    _classCallCheck(this, Period);\n\n    _this = _super.call(this, model);\n    _this.styleRowValue = ko.pureComputed(function () {\n      if (this.stateType() === 0) return 'color: #ccc;';\n      if (this.closed()) return 'color: red;';\n      return 'color: black;';\n    }, _assertThisInitialized(_this));\n    return _this;\n  }\n\n  return _createClass(Period);\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_0__.BaseModel);\nvar PeriodForm = /*#__PURE__*/function (_BaseFormModel) {\n  _inherits(PeriodForm, _BaseFormModel);\n\n  var _super2 = _createSuper(PeriodForm);\n\n  function PeriodForm(model, editMode, copyMode, list) {\n    var _this2;\n\n    _classCallCheck(this, PeriodForm);\n\n    _this2 = _super2.call(this, model, editMode);\n    _this2.copyMode = ko.observable(copyMode || false);\n    _this2.periodCopyType = ko.observable(0);\n    _this2.periodHistoryItemsMessage = ko.observable();\n    _this2.destinationPeriodId = ko.observable(null);\n    _this2.periodHistoryItems = ko.observableArray();\n    _this2.destinationPeriods = ko.observableArray();\n    _this2.selectList = ko.observableArray();\n    _this2.basePeriodId = ko.observable();\n\n    if (!editMode) {\n      _this2.periodType(0);\n\n      _this2.endDateAdjust();\n    }\n\n    if (copyMode) {\n      var selectedRecord = model.getSelectedRecord();\n\n      _this2.fillCopyModel(selectedRecord.id(), list);\n    }\n\n    _this2.periodState.subscribe(function (newValue) {\n      if (newValue !== undefined && newValue !== null) {\n        if (this.auditState() >= 0 && newValue >= 0) {\n          this.timeEnd.valueHasMutated();\n          this.timeEnd.isValid();\n        }\n      }\n    }.bind(_assertThisInitialized(_this2)));\n\n    _this2.auditState.subscribe(function (newValue) {\n      if (newValue !== undefined && newValue !== null) {\n        if (this.periodState() >= 0 && newValue >= 0) {\n          this.timeEnd.valueHasMutated();\n          this.timeEnd.isValid();\n        }\n      }\n    }.bind(_assertThisInitialized(_this2)));\n\n    _this2.timeEnd.subscribe(function (newValue) {\n      if (newValue !== undefined && newValue !== null) {\n        this.getSelectList(newValue);\n      }\n    }.bind(_assertThisInitialized(_this2)));\n\n    _this2.isLockDateControl = ko.pureComputed(function () {\n      if (this.periodState() === null || this.periodState() === undefined || this.auditState() === null || this.auditState() === undefined) {\n        return true;\n      } else {\n        return this.editMode();\n      }\n    }, _assertThisInitialized(_this2));\n    _this2.condFirst = ko.pureComputed(function () {\n      return this.copyMode() === false || this.copyMode() === true && this.periodCopyType() === 0;\n    }, _assertThisInitialized(_this2));\n    _this2.condSecond = ko.pureComputed(function () {\n      return _h.kocnx().currentCompany().irt === false && (this.copyMode() === false || this.copyMode() === true && this.periodCopyType() === 0) && !_h.isNullOrEmpty(this.startDate()) && !_h.isNullOrEmpty(this.timeEnd());\n    }, _assertThisInitialized(_this2));\n    _this2.condThird = ko.pureComputed(function () {\n      return this.copyMode() === true && this.periodCopyType() === 1;\n    }, _assertThisInitialized(_this2));\n\n    _this2.setValidationObject();\n\n    _this2.createForm();\n\n    return _this2;\n  }\n\n  _createClass(PeriodForm, [{\n    key: \"fillCopyModel\",\n    value: function fillCopyModel(id, modelList) {\n      this.basePeriodId(id);\n      this.periodType(0);\n      if (_h.any(modelList.dependancies)) for (var p in modelList.dependancies) {\n        if (modelList.dependancies.hasOwnProperty(p)) {\n          var target = modelList.dependancies[p];\n          var rec = new PeriodDependency(target, this);\n          this.periodHistoryItems.push(rec);\n        }\n      }\n      if (_h.any(modelList.destinationPeriods)) for (var j = 0; j < modelList.destinationPeriods.length; j++) {\n        this.destinationPeriods.push(new _master_model_js__WEBPACK_IMPORTED_MODULE_2__.PeriodSelectItem(modelList.destinationPeriods[j]));\n      }\n\n      for (var i = 0; i < this.periodHistoryItems().length; i++) {\n        this.periodHistoryItems()[i].assign(true);\n      }\n    }\n  }, {\n    key: \"checkDependentList\",\n    value: function checkDependentList(target) {\n      var checkDependents = target.checkDependent;\n      var uncheckDependents = target.uncheckDependent;\n\n      if (target.assign()) {\n        for (var i = 0; i < this.periodHistoryItems().length; i++) {\n          var rec = this.periodHistoryItems()[i];\n\n          if (checkDependents.length > 0 && checkDependents.indexOf(rec.id()) !== -1) {\n            rec.assign(true);\n            rec.disabled(true);\n          }\n        }\n      } else {\n        var anyCheck = false;\n\n        for (var _i = 0; _i < this.periodHistoryItems().length; _i++) {\n          var record = this.periodHistoryItems()[_i];\n\n          if (uncheckDependents.length > 0 && uncheckDependents.indexOf(record.id()) !== -1 && record.assign()) {\n            anyCheck = true;\n          }\n\n          if (checkDependents.length > 0 && checkDependents.indexOf(record.id()) !== -1) {\n            var targetId = record.id();\n            var countDependent = 0;\n\n            for (var j = 0; j < this.periodHistoryItems().length; j++) {\n              var innerRecord = this.periodHistoryItems()[j];\n\n              if (innerRecord.checkDependent.length > 0 && targetId !== target.id() && innerRecord.checkDependent.indexOf(targetId) !== -1 && innerRecord.assign()) {\n                countDependent++;\n              }\n            }\n\n            if (countDependent === 0) record.disabled(false);\n          }\n        }\n\n        if (anyCheck) target.assign(true);\n      }\n    }\n  }, {\n    key: \"getSelectList\",\n    value: function getSelectList(newValue) {\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__.ApiService.request({\n        url: \"/api/period/getparentperiodlist\",\n        data: {\n          endDate: newValue\n        },\n        success: function (data) {\n          this.selectList.removeAll();\n          if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n            this.selectList.push(new _master_model_js__WEBPACK_IMPORTED_MODULE_2__.PeriodSelectItem(data[j]));\n          }\n        }.bind(this),\n        error: function error(data) {}\n      });\n    }\n  }, {\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      self.validationObject = ko.validatedObservable({\n        periodState: self.periodState.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.periodCopyType() === 0 || self.copyMode() === false;\n            }\n          }\n        }),\n        periodType: self.periodType.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.periodCopyType() === 0 || self.copyMode() === false;\n            }\n          }\n        }),\n        auditState: self.auditState.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.periodCopyType() === 0 || self.copyMode() === false;\n            }\n          }\n        }),\n        startDate: self.startDate.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.editMode() === false || self.copyMode() === true && self.periodCopyType() === 0;\n            }\n          },\n          beforeEndDate: {\n            params: [self.timeEnd]\n          }\n        }),\n        periodCopyType: self.periodCopyType.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.copyMode() === true;\n            }\n          }\n        }),\n        destinationPeriodId: self.destinationPeriodId.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.periodCopyType() === 1 && self.copyMode() === true;\n            }\n          }\n        }),\n        timeEnd: self.timeEnd.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.editMode() === false || self.copyMode() === true && self.periodCopyType() === 0;\n            }\n          },\n          afterStartDate: {\n            params: [self.startDate]\n          },\n          onlyOneYearDef: {\n            params: [self.startDate]\n          },\n          remoteIsPeriodUniqueValidationRule: {\n            params: [self.id, self.periodState, self.auditState, self.startDate, self.periodType]\n          }\n        }),\n        groupPeriod: self.groupPeriod.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return _h.kocnx().currentCompany().irt === false;\n            }\n          }\n        })\n      });\n    }\n  }, {\n    key: \"endDateAdjust\",\n    value: function endDateAdjust() {\n      var date = dateHelper.getDateLastDayOfYear();\n      this.timeEnd(date);\n      ko.validation.registerExtenders();\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      var period = ko.toJS(this);\n      delete period[\"validationObject\"];\n      delete period[\"formButtons\"];\n      delete period[\"formControls\"];\n      delete period[\"parentVM\"];\n      delete period[\"editMode\"];\n      delete period[\"ad\"];\n      delete period[\"selected\"];\n      delete period[\"ruleModel\"];\n      var list = [];\n      ko.utils.arrayFilter(this.periodHistoryItems(), function (item) {\n        if (item.assign()) {\n          list.push(item.id());\n        }\n      });\n      period.periodItems = list;\n      period.periodHistoryItems = null;\n\n      if (list.length === 0 && this.copyMode()) {\n        this.periodHistoryItemsMessage(_h.getApiMessage(\"ErrorMinPeriodCopyItem\"));\n        return null;\n      }\n\n      this.periodHistoryItemsMessage(\"\");\n      return period;\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'slc',\n        val: this.periodCopyType,\n        options: periodCopyTypes\n      }, undefined, this.copyMode), this.createLine({\n        t: 'slc',\n        val: this.periodState,\n        options: periodStates\n      }, {\n        t: 'slc',\n        val: this.periodType,\n        options: periodTypes\n      }, this.condFirst, 30), this.createLine({\n        t: 'slc',\n        val: this.auditState,\n        options: auditStates\n      }, undefined, this.condFirst, 30), this.createLine({\n        t: 'dpk',\n        val: this.startDate,\n        dateType: 'fa',\n        dis: this.editMode\n      }, {\n        t: 'dpk',\n        val: this.timeEnd,\n        dateType: 'fa',\n        dis: this.isLockDateControl\n      }, this.condFirst, 30), this.createLine({\n        t: 'txa',\n        val: this.description\n      }, undefined, this.condFirst, 30), this.createLine({\n        t: 'slc',\n        val: this.groupPeriod,\n        options: this.selectList,\n        dis: this.editMode,\n        renderFunc: _h.periodSelectRowTemplate\n      }, undefined, this.condSecond, 30), this.createLine({\n        t: 'slc',\n        val: this.destinationPeriodId,\n        options: this.destinationPeriods,\n        renderFunc: _h.periodSelectRowTemplate\n      }, undefined, this.condThird, 30), this.createLine({\n        t: 'tm',\n        templateName: 'period-history-form-t'\n      }, undefined, true, 30, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'create',\n            vis: !this.editMode() && !this.copyMode(),\n            click: this.parentVM.create\n          }, {\n            name: 'edit',\n            vis: this.editMode() === true && !this.copyMode(),\n            click: this.parentVM.edit\n          }, {\n            name: 'copy',\n            vis: this.copyMode,\n            click: this.parentVM.copy\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return PeriodForm;\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_0__.BaseFormModel);\nvar ComparativePeriodsForm = /*#__PURE__*/function (_BaseSecondaryForm) {\n  _inherits(ComparativePeriodsForm, _BaseSecondaryForm);\n\n  var _super3 = _createSuper(ComparativePeriodsForm);\n\n  function ComparativePeriodsForm(viewModel, model) {\n    var _this3;\n\n    _classCallCheck(this, ComparativePeriodsForm);\n\n    _this3 = _super3.call(this, viewModel, [{\n      name: \"id\",\n      type: \"ob\",\n      val: model.id\n    }, {\n      name: \"title\",\n      type: \"ob\",\n      val: model.title\n    }], \"comparativesCaption\");\n    if (_h.any(model.comparativePeriods)) for (var i = 0; i < model.comparativePeriods.length; i++) {\n      _this3[model.comparativePeriods[i].order + \"ComparativePeriod\"] = ko.observable(model.comparativePeriods[i].id);\n    } else {\n      _this3[\"1ComparativePeriod\"] = ko.observable(null);\n      model.comparativePeriods = [{\n        order: 1,\n        id: null\n      }];\n    }\n\n    _this3.setValidationObject();\n\n    _this3.createForm();\n\n    return _this3;\n  }\n\n  _createClass(ComparativePeriodsForm, [{\n    key: \"addComparativePeriods\",\n    value: function addComparativePeriods() {\n      var order = this.getLastOrder() + 1;\n      if (order > 15) return;\n      this[order + \"ComparativePeriod\"] = ko.observable(null);\n      this.formControls.push(this.createLine({\n        t: 'slc',\n        val: this[order + \"ComparativePeriod\"],\n        options: this.parentVM.filteredSelectList,\n        renderFunc: _h.periodSelectRowTemplate,\n        hlp: \"secondComparativePeriodHelp\"\n      }, null, true, 40));\n      this.setValidationObject();\n    }\n  }, {\n    key: \"getLastOrder\",\n    value: function getLastOrder() {\n      var number = 0;\n\n      for (var _i2 = 0, _Object$keys = Object.keys(this); _i2 < _Object$keys.length; _i2++) {\n        var key = _Object$keys[_i2];\n\n        var _char = key.slice(0, 2);\n\n        var numb = _char.match(/\\d/g);\n\n        if (numb && numb.length) {\n          var number = parseFloat(_char.replace(/[^0-9]/g, ''));\n        }\n      }\n\n      return number;\n    }\n  }, {\n    key: \"getComparativePeriodsList\",\n    value: function getComparativePeriodsList() {\n      var array = [];\n      var order = this.getLastOrder();\n\n      for (var f = 0; f < order; f++) {\n        array.push({\n          order: f + 1,\n          id: this[f + 1 + \"ComparativePeriod\"]()\n        });\n      }\n\n      return array;\n    }\n  }, {\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      var obj = {};\n      self.validationObject = ko.validatedObservable(obj);\n      var comparativePeriods = this.getComparativePeriodsList();\n\n      for (var i = 0; i < comparativePeriods.length; i++) {\n        var params = [];\n\n        for (var j = 0; j < comparativePeriods.length; j++) {\n          if (comparativePeriods[j].order !== comparativePeriods[i].order) {\n            params.push(self[comparativePeriods[j].order + \"ComparativePeriod\"]);\n          }\n        }\n\n        if (i === comparativePeriods.length - 1) {\n          obj[comparativePeriods[i].order + \"ComparativePeriod\"] = self[comparativePeriods[i].order + \"ComparativePeriod\"].extend({\n            validation: {\n              validator: function validator(val, someOtherVal) {\n                var count = 0;\n                var order = self.getLastOrder();\n\n                for (var f = 0; f < order; f++) {\n                  var cpVal = self[f + 1 + \"ComparativePeriod\"]();\n\n                  if (!_h.isEmpty(cpVal) && cpVal > 0) {\n                    count = count + 1;\n                  }\n                }\n\n                if (count > 0 || val > 0) return true;\n                return false;\n              },\n              message: 'حداقل یکی از دوره های مقایسه باید انتخاب شده باشد'\n            },\n            noEqualPeriod: {\n              params: params\n            }\n          });\n        } else {\n          obj[comparativePeriods[i].order + \"ComparativePeriod\"] = self[comparativePeriods[i].order + \"ComparativePeriod\"].extend({\n            noEqualPeriod: {\n              params: params\n            }\n          });\n        }\n      }\n\n      self.validationObject = ko.validatedObservable(obj);\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'comparative-title-form-t'\n      }, undefined, true, 30, 0)];\n\n      for (var _i3 = 0, _Object$keys2 = Object.keys(this); _i3 < _Object$keys2.length; _i3++) {\n        var key = _Object$keys2[_i3];\n\n        var _char2 = key.slice(0, 2);\n\n        var numb = _char2.match(/\\d/g);\n\n        if (numb && numb.length) {\n          var number = parseFloat(_char2.replace(/[^0-9]/g, ''));\n          var hlp = \"firstComparativePeriodHelp\";\n\n          if (number > 1) {\n            hlp = \"secondComparativePeriodHelp\";\n          }\n\n          controls.push(this.createLine({\n            t: 'slc',\n            val: this[key],\n            options: this.parentVM.filteredSelectList,\n            renderFunc: _h.periodSelectRowTemplate,\n            hlp: hlp\n          }, null, true, 40));\n        }\n      }\n\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'custom',\n            resText: \"comparativesEditBtn\",\n            vis: true,\n            click: this.parentVM.editComparatives\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      var list = this.getComparativePeriodsList();\n      return {\n        id: this.id(),\n        comparativePeriods: list\n      };\n    }\n  }]);\n\n  return ComparativePeriodsForm;\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_0__.BaseSecondaryForm);\nvar PeriodDeleteForm = /*#__PURE__*/function (_BaseSecondaryForm2) {\n  _inherits(PeriodDeleteForm, _BaseSecondaryForm2);\n\n  var _super4 = _createSuper(PeriodDeleteForm);\n\n  function PeriodDeleteForm(viewModel, model, list) {\n    var _this4;\n\n    _classCallCheck(this, PeriodDeleteForm);\n\n    _this4 = _super4.call(this, viewModel, [{\n      name: \"id\",\n      type: \"ob\",\n      val: model.id()\n    }, {\n      name: \"title\",\n      type: \"ob\",\n      val: model.title()\n    }, {\n      name: \"list\",\n      type: \"obar\"\n    }], {\n      text: 'حذف ' + model.title()\n    });\n\n    for (var p in list) {\n      if (list.hasOwnProperty(p)) {\n        var target = new PeriodDependency(list[p], _assertThisInitialized(_this4));\n\n        _this4.list.push(target);\n      }\n    }\n\n    _this4.createForm();\n\n    return _this4;\n  }\n\n  _createClass(PeriodDeleteForm, [{\n    key: \"checkDependentList\",\n    value: function checkDependentList(target) {\n      var checkDependents = target.checkDependent;\n      var uncheckDependents = target.uncheckDependent;\n\n      if (target.assign()) {\n        for (var i = 0; i < this.list().length; i++) {\n          var rec = this.list()[i];\n\n          if (checkDependents.length > 0 && checkDependents.indexOf(rec.id()) !== -1) {\n            rec.assign(true);\n            rec.disabled(true);\n          }\n        }\n      } else {\n        var anyCheck = false;\n\n        for (var _i4 = 0; _i4 < this.list().length; _i4++) {\n          var _rec = this.list()[_i4];\n\n          if (uncheckDependents.length > 0 && uncheckDependents.indexOf(_rec.id()) !== -1 && _rec.assign()) {\n            anyCheck = true;\n          }\n\n          if (checkDependents.length > 0 && checkDependents.indexOf(_rec.id()) !== -1) {\n            var targetId = _rec.id();\n\n            var countDependent = 0;\n\n            for (var j = 0; j < this.list().length; j++) {\n              var innerRecord = this.list()[j];\n\n              if (innerRecord.checkDependent.length > 0 && targetId !== target.id() && innerRecord.checkDependent.indexOf(targetId) !== -1 && innerRecord.assign()) {\n                countDependent++;\n              }\n            }\n\n            if (countDependent === 0) _rec.disabled(false);\n          }\n        }\n\n        if (anyCheck) target.assign(true);\n      }\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      var array = [];\n\n      for (var i = 0; i < this.list().length; i++) {\n        var rec = this.list()[i];\n\n        if (rec.assign()) {\n          array.push(rec.id());\n        }\n      }\n\n      return {\n        id: this.id(),\n        items: array\n      };\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'delete-content-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'custom',\n            resText: \"deletePeriodCaption\",\n            vis: true,\n            click: this.parentVM[\"delete\"]\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return PeriodDeleteForm;\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_0__.BaseSecondaryForm);\nvar PeriodDependency = /*#__PURE__*/function (_BaseInnerModel) {\n  _inherits(PeriodDependency, _BaseInnerModel);\n\n  var _super5 = _createSuper(PeriodDependency);\n\n  function PeriodDependency(model, parent) {\n    var _this5;\n\n    _classCallCheck(this, PeriodDependency);\n\n    _this5 = _super5.call(this, model);\n    _this5.parent = parent;\n    _this5.checkDependent = model.checkDependent;\n    _this5.uncheckDependent = model.uncheckDependent;\n    _this5.assign = ko.observable(false);\n    _this5.disabled = ko.observable(false);\n\n    _this5.assign.subscribe(function (newValue) {\n      if (newValue !== undefined && newValue !== null) {\n        this.parent.checkDependentList(this);\n      }\n    }.bind(_assertThisInitialized(_this5)));\n\n    return _this5;\n  }\n\n  return _createClass(PeriodDependency);\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_0__.BaseInnerModel);\nvar SendPeriodForm = /*#__PURE__*/function (_BaseSecondaryForm3) {\n  _inherits(SendPeriodForm, _BaseSecondaryForm3);\n\n  var _super6 = _createSuper(SendPeriodForm);\n\n  function SendPeriodForm(viewModel, model) {\n    var _this6;\n\n    _classCallCheck(this, SendPeriodForm);\n\n    _this6 = _super6.call(this, viewModel, [{\n      name: \"magazineFileId\",\n      type: \"ob\",\n      val: model.submittedMagazine\n    }], \"sendPeriodInfo\");\n    _this6.magazines = ko.observableArray();\n\n    _this6.getList(model.id);\n\n    _this6.setValidationObject();\n\n    _this6.createForm();\n\n    return _this6;\n  }\n\n  _createClass(SendPeriodForm, [{\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      self.validationObject = ko.validatedObservable({\n        magazineFileId: self.magazineFileId.extend({\n          required: true\n        })\n      });\n    }\n  }, {\n    key: \"getList\",\n    value: function getList(id) {\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__.ApiService.request({\n        url: \"/api/period/getSavedMagazines\",\n        data: {\n          id: id\n        },\n        success: function (list) {\n          var inList = false;\n          if (this.magazineFileId() && list.length) for (var i = 0; i < list.length; i++) {\n            if (list[i].value === this.magazineFileId()) {\n              inList = true;\n            }\n          }\n          if (!inList) this.magazineFileId(null);\n          this.magazines(list);\n        }.bind(this),\n        error: function error() {\n          toast.error(\"Period\", 'getList', 'SavedMagazines');\n        }\n      });\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'slc',\n        val: this.magazineFileId,\n        options: this.magazines\n      }, null, true, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'custom',\n            resText: \"SendFormBtn\",\n            vis: true,\n            click: this.parentVM.send\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return SendPeriodForm;\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_0__.BaseSecondaryForm);\nfunction HistoryViewModel() {\n  var self = this;\n  self.records = ko.observableArray();\n  self.tableProperties = ko.observableArray();\n  self.grecords = ko.observableArray();\n  self.gtableProperties = ko.observableArray();\n  self.periodId = ko.observable();\n  self.showHistory = ko.observable(true);\n  self.showGroupHistory = ko.observable(true);\n\n  self.getRecords = function () {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__.ApiService.request({\n      url: \"/api/period/gethistory\",\n      data: {\n        id: self.periodId()\n      },\n      success: function success(data) {\n        self.records.removeAll();\n        self.grecords.removeAll();\n\n        if (!_h.isNullOrEmpty(data)) {\n          if (_h.any(data.closingHistory)) {\n            for (var j = 0; j < data.closingHistory.length; j++) {\n              var closingHistory = data.closingHistory[j];\n              self.records.push(new History(closingHistory));\n            }\n          }\n\n          if (_h.any(data.submitHistory)) {\n            for (var i = 0; i < data.submitHistory.length; i++) {\n              var submitHistory = data.submitHistory[i];\n              self.grecords.push(new History(submitHistory));\n            }\n          }\n        }\n\n        _h.fixLabelsSize();\n      },\n      error: function error(data) {\n        var text = _h.getApiMessage(\"errorLoadHistoryPeriod\");\n\n        _h.failToast(text);\n      }\n    });\n  };\n\n  self.init = function () {\n    for (var p in periodhistoryModelRes) {\n      if (periodhistoryModelRes.hasOwnProperty(p)) {\n        var target1 = periodhistoryModelRes[p];\n\n        if (!target1.onlyGroup && target1.tablecol) {\n          self.tableProperties.push(new _master_model_js__WEBPACK_IMPORTED_MODULE_2__.Column(target1));\n        }\n      }\n    }\n\n    for (var g in periodhistoryModelRes) {\n      if (periodhistoryModelRes.hasOwnProperty(g)) {\n        var target = periodhistoryModelRes[g];\n        if (target.tablecol) self.gtableProperties.push(new _master_model_js__WEBPACK_IMPORTED_MODULE_2__.Column(target));\n      }\n    }\n\n    self.getRecords();\n  };\n}\nvar History = /*#__PURE__*/function (_BaseModel2) {\n  _inherits(History, _BaseModel2);\n\n  var _super7 = _createSuper(History);\n\n  function History(model) {\n    _classCallCheck(this, History);\n\n    return _super7.call(this, model);\n  }\n\n  return _createClass(History);\n}(_master_baseModels_js__WEBPACK_IMPORTED_MODULE_0__.BaseModel);\n\n//# sourceURL=webpack://domino/./src/scripts/pages/period/model.js?");

/***/ }),

/***/ "./src/scripts/pages/period/resource.js":
/*!**********************************************!*\
  !*** ./src/scripts/pages/period/resource.js ***!
  \**********************************************/
/***/ (() => {

eval("window.periodModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  title: {\n    fa: 'عنوان دوره',\n    colName: 'title',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 15,\n    type: \"template\",\n    templateName: \"period-title-template\"\n  },\n  periodState: {\n    fa: 'وضعیت ارائه',\n    colName: 'periodState',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"enum\"\n  },\n  periodType: {\n    fa: 'نوع دوره',\n    colName: 'periodType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"enum\"\n  },\n  closed: {\n    fa: 'وضعیت',\n    colName: 'closed',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"period-closed-template\"\n  },\n  submitState: {\n    fa: 'وضعیت ارتباط با گروه',\n    colName: 'submitState',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"label\"\n  },\n  auditState: {\n    fa: 'وضعیت حسابرسی',\n    colName: 'auditState',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"enum\"\n  },\n  stateType: {\n    fa: 'وضعیت فعالیت',\n    colName: 'stateType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"stateSwitch\"\n  },\n  description: {\n    fa: 'توضیحات',\n    colName: 'description',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alzias: null,\n    type: \"string\"\n  },\n  timeCreated: {\n    fa: 'زمان ایجاد',\n    colName: 'timeCreated',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"date\"\n  },\n  startDate: {\n    fa: 'شروع سال مالی',\n    colName: 'startDate',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"date\"\n  },\n  timeEnd: {\n    fa: 'پایان سال مالی',\n    colName: 'timeEnd',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"date\"\n  },\n  userId: {\n    fa: 'ایجاد کننده',\n    colName: 'userId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  groupPeriod: {\n    fa: 'دوره مالی مرجع',\n    colName: 'groupPeriod',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  archived: {\n    fa: 'بایگانی',\n    colName: 'archived',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"bool\"\n  }\n};\nwindow.periodPageRes = {\n  pageTitle: {\n    fa: 'مدیریت دوره مالی'\n  },\n  showArchived: {\n    fa: 'نمایش دوره های بایگانی شده'\n  },\n  HistoryTitle: {\n    fa: 'سابقه تغییرات'\n  },\n  pageDesc: {\n    fa: 'ورود اطلاعات دوره مالی'\n  },\n  tableTitle: {\n    fa: 'دوره مالی'\n  },\n  editCaption: {\n    fa: 'ویرایش دوره مالی'\n  },\n  createCaption: {\n    fa: 'تعریف دوره مالی جدید'\n  },\n  deleteCaption: {\n    fa: 'حذف دوره مالی'\n  },\n  comparativesCaption: {\n    fa: 'تنظیم مقایسه دوره ها'\n  },\n  comparativesEditBtn: {\n    fa: 'ثبت'\n  },\n  firstComparativePeriodHelp: {\n    fa: 'دوره مقایسه اول در فرمول درخت وجوه نقد و تنظیمات ستون های مقایسه پیش نمایش قالب جدول مورد استفاده قرار میگیرد'\n  },\n  secondComparativePeriodHelp: {\n    fa: 'این دوره مقایسه در تنظیمات ستون های مقایسه پیش نمایش قالب جداول مورد استفاده قرار میگیرد'\n  },\n  sendCaption: {\n    fa: 'ارسال دوره مالی'\n  },\n  tackBackCaption: {\n    fa: 'لغو ارسال دوره مالی'\n  },\n  openCaption: {\n    fa: 'باز کردن دوره مالی'\n  },\n  closeCaption: {\n    fa: 'بستن دوره مالی'\n  },\n  open: {\n    fa: 'دوره مالی باز'\n  },\n  close: {\n    fa: 'دوره مالی بسته'\n  },\n  unArchiveCaption: {\n    fa: ' لغو بایگانی دوره مالی'\n  },\n  archiveCaption: {\n    fa: 'بایگانی دوره مالی'\n  },\n  SendFormBtn: {\n    fa: 'ارسال دوره مالی'\n  },\n  copyCaption: {\n    fa: 'کپی دوره مالی'\n  },\n  copyFormCaption: {\n    fa: 'کپی'\n  },\n  periodCopyType: {\n    fa: 'نوع عملیات'\n  },\n  destinationPeriodId: {\n    fa: 'دوره منتخب'\n  },\n  sendPeriodInfo: {\n    fa: \"اطلاعات ارسال دوره مالی\"\n  },\n  magazineFileId: {\n    fa: \"فایل مجله\"\n  },\n  deletePeriodCaption: {\n    fa: \"حذف\"\n  },\n  comparativeWarning: {\n    fa: \"نیازمند اصلاح دوره های مقایسه ای\"\n  }\n};\nwindow.comparativeperiodsModelRes = {\n  title: {\n    fa: 'دوره منتخب'\n  }\n};\nwindow.periodhistoryModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null,\n    onlyGroup: false\n  },\n  timeCreated: {\n    fa: 'تاریخ',\n    colName: 'timeCreated',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    onlyGroup: false\n  },\n  closed: {\n    fa: 'وضعیت',\n    colName: 'closed',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    onlyGroup: false\n  },\n  userFullName: {\n    fa: 'نام کاربری',\n    colName: 'userFullName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    onlyGroup: false\n  },\n  description: {\n    fa: 'توضیحات',\n    colName: 'description',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    onlyGroup: true\n  }\n};\nwindow.periodHistoryPageRes = {\n  periodHistoryTitle: {\n    fa: 'تاریخچه دوره'\n  }\n};\nwindow.periodGroupHistoryPageRes = {\n  periodHistoryGroupTitle: {\n    fa: 'تاریخچه ارتباط با گروه'\n  }\n};\nwindow.periodCopyTypes = [{\n  text: \"کپی در دوره مالی جدید\",\n  enText: \"Create\",\n  value: 0\n}, {\n  text: \"کپی به دوره مالی منتخب\",\n  enText: \"Select\",\n  value: 1\n}];\n\n//# sourceURL=webpack://domino/./src/scripts/pages/period/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/period/viewModel.js":
/*!***********************************************!*\
  !*** ./src/scripts/pages/period/viewModel.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"PeriodViewModel\": () => (/* binding */ PeriodViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _master_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/model */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model */ \"./src/scripts/pages/period/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/period/resource.js\");\n\n__webpack_require__(/*! ./model */ \"./src/scripts/pages/period/model.js\");\n\n\n\n\nfunction PeriodViewModel() {\n  var self = this;\n  self.selectList = ko.observableArray();\n  self.filteredSelectList = ko.observableArray();\n\n  self.getSelectList = function () {\n    self.apiService.request({\n      name: \"/api/common/getperiodlist\",\n      data: {\n        controllerName: this.controllerName\n      },\n      success: function success(data) {\n        self.selectList.removeAll();\n        if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n          var item = new _master_model__WEBPACK_IMPORTED_MODULE_1__.PeriodSelectItem(data[j]);\n          self.selectList.push(item);\n        }\n      },\n      messageType: 'getSelectList',\n      messageKey: self.entityName\n    });\n  };\n\n  self.filterSelectList = function (notIncludeId) {\n    self.filteredSelectList.removeAll();\n    ko.utils.arrayFilter(self.selectList(), function (target) {\n      if (target.value() !== notIncludeId) self.filteredSelectList.push(target);\n    });\n  };\n\n  self.toggleRight = function () {\n    if (self.wideRight()) {\n      if (self.isSelectedRecord()) {\n        var selectedRecord = self.getSelectedRecord();\n        self.wideRight(false);\n        var model = new _model__WEBPACK_IMPORTED_MODULE_2__.HistoryViewModel();\n        model.periodId(selectedRecord.id());\n        self.childModel(model);\n        self.childModel().init();\n        self.iconSize(\"icon-image-small\");\n      } else toast.custom(\"warning\", _h.getApiMessage(\"firstSelectPeriodRecordWarning\"));\n    } else {\n      self.wideRight(true);\n      self.childModel(null);\n      self.iconSize(\"icon-image\");\n    }\n  };\n\n  self.createBtn = function () {\n    _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.PeriodForm(self, false));\n  };\n\n  self.editBtn = function () {\n    _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.PeriodForm(self, true));\n  };\n\n  self.resetSelectedTableTemplate = function () {\n    clientStorage.removeSetting(\"RepGenAutoSave\");\n    clientStorage.removeSetting(\"TableTemplateEditList\");\n  };\n\n  self.getComparativesData = function (id, callback) {\n    self.apiService.request({\n      name: \"getForComparatives\",\n      data: {\n        id: id\n      },\n      success: function success(data) {\n        callback(data);\n      },\n      error: function error(data) {\n        toast.error(self.entityName, 'get', 'Comparatives');\n        callback(null);\n      },\n      messageType: 'get',\n      messageKey: \"Comparatives\"\n    });\n  };\n\n  self.comparativesBtn = function () {\n    var selectedRecord = self.getSelectedRecord();\n    self.getComparativesData(selectedRecord.id(), function (data) {\n      self.selectList.removeAll();\n      if (_h.any(data.list)) for (var j = 0; j < data.list.length; j++) {\n        self.selectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.PeriodSelectItem(data.list[j]));\n      }\n      self.filterSelectList(selectedRecord.id());\n\n      _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.ComparativePeriodsForm(self, data));\n    });\n  };\n\n  self.editComparatives = function (parents, btnModel, e) {\n    var item = parents[1];\n\n    if (!item.validationObject.isValid()) {\n      item.validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    var comparatives = item.toServer();\n    self.apiService.request({\n      splashId: e,\n      name: \"putComparatives\",\n      data: comparatives,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          self.afterUpdate(data.models);\n\n          _h.kocnx().closeForm();\n\n          toast.success(self.entityName, 'putUpdate', 'Comparatives');\n          self.updateExtraParams(data);\n        }\n      },\n      messageType: 'putUpdate',\n      messageKey: \"Comparatives\"\n    });\n  };\n\n  self.closeBtn = function () {\n    self.changeClosed(true);\n  };\n\n  self.openBtn = function () {\n    self.changeClosed(false);\n  };\n\n  self.changeClosed = function (action) {\n    var selectedRecord = self.getSelectedRecord();\n    var model = {\n      id: selectedRecord.id(),\n      closed: action\n    };\n    self.apiService.request({\n      name: \"putClosed\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          toast.success(self.entityName, 'putUpdate', 'PeriodClosed');\n          selectedRecord.closed(action);\n        }\n      },\n      messageType: 'putUpdate',\n      messageKey: \"PeriodClosed\"\n    });\n  };\n\n  self.sendBtn = function () {\n    var selectedRecord = self.getSelectedRecord();\n\n    _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.SendPeriodForm(self, {\n      submittedMagazine: selectedRecord.submittedMagazine(),\n      id: selectedRecord.id()\n    }));\n  };\n\n  self.send = function (parents, btnModel, e) {\n    var item = parents[1];\n\n    if (!item.validationObject.isValid()) {\n      item.validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    self.changeSubmitState(1, item.magazineFileId());\n  };\n\n  self.tackBackBtn = function () {\n    self.changeSubmitState(0);\n  };\n\n  self.changeSubmitState = function (action, magazineFileId) {\n    var selectedRecord = self.getSelectedRecord();\n    var model = {\n      id: selectedRecord.id(),\n      submitState: action,\n      magazineFileId: magazineFileId\n    };\n    self.apiService.request({\n      name: \"putSubmit\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.kocnx().closeForm();\n\n          toast.success(self.entityName, 'putUpdate', 'SubmitState');\n          selectedRecord.submitState(action);\n        }\n      },\n      messageType: 'putUpdate',\n      messageKey: \"SubmitState\"\n    });\n  };\n\n  self.archiveBtn = function () {\n    self.changeArchiveState(true);\n  };\n\n  self.unArchiveBtn = function () {\n    self.changeArchiveState(false);\n  };\n\n  self.changeArchiveState = function (action) {\n    var selectedRecord = self.getSelectedRecord();\n    self.apiService.request({\n      name: \"putArchivePeriod\",\n      data: {\n        id: selectedRecord.id()\n      },\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          toast.success(self.entityName, 'putUpdate', 'PeriodArchive');\n          if (self.showArchived()) selectedRecord.archived(action);else self.records.remove(selectedRecord);\n        }\n      },\n      messageType: 'putUpdate',\n      messageKey: \"PeriodArchive\"\n    });\n  };\n\n  self.copyBtn = function () {\n    var selectedRecord = self.getSelectedRecord();\n    self.getCopyDependencies(selectedRecord.id(), function (res) {\n      _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.PeriodForm(self, false, true, res));\n    });\n  };\n\n  self.copy = function (parents, btnModel, e) {\n    var item = parents[1];\n\n    if (!item.validationObject.isValid()) {\n      item.validationObject.errors.showAllMessages();\n\n      if (item.periodCopyType() === 1 && item.copyMode() === true && !_h.isNullOrEmpty(item.destinationPeriodId())) {//\n      } else {\n        return false;\n      }\n    }\n\n    var period = item.toServer();\n\n    if (period === null) {\n      return false;\n    }\n\n    self.apiService.request({\n      splashId: e,\n      name: \"postCopy\",\n      data: period,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.kocnx().closeForm();\n\n          self.afterCreate(data.models);\n          toast.success(self.entityName, 'custom', 'CopyPeriod');\n\n          var context = _h.kocnx();\n        }\n      },\n      messageType: 'custom',\n      messageKey: \"CopyPeriod\"\n    });\n  };\n\n  self.getDeleteModel = function (id, callback) {\n    self.apiService.request({\n      name: \"getPeriodSummary\",\n      data: {\n        id: id\n      },\n      success: function success(data) {\n        callback(data);\n      },\n      error: function error() {\n        toast.error(self.entityName, 'get', 'PeriodSummary');\n        callback(null);\n      }\n    });\n  };\n\n  self.getCopyDependencies = function (id, callback) {\n    self.apiService.request({\n      name: \"getCopyDependancies\",\n      data: {\n        id: id\n      },\n      success: function success(data) {\n        callback(data);\n      },\n      error: function error() {\n        toast.error(self.entityName, 'get', 'CopyDependencies');\n        callback(null);\n      },\n      messageType: 'off'\n    });\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.getSelectList();\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"Period\",\n    getList: true,\n    apiService: {\n      actionList: [\"filterby\", \"post\", \"put\", \"delete\", \"getforcomparatives\", \"putcomparatives\", \"putclosed\", \"putsubmit\", \"putarchiveperiod\", \"getperiodsummary\", \"getcopydependancies\", \"getsavedmagazines\", \"gethistory\", \"postcopy\", \"getparentperiodlist\"]\n    },\n    buttons: [{\n      name: 'edit',\n      access: true,\n      icon: 'Edit',\n      cMenu: true\n    }, {\n      name: 'delete',\n      access: true,\n      icon: 'Delete',\n      cMenu: true\n    }, {\n      name: 'disable',\n      access: true,\n      icon: 'DocDisable',\n      cMenu: true\n    }, {\n      name: 'enable',\n      access: true,\n      icon: 'DocEnable',\n      cMenu: true\n    }, {\n      name: 'comparatives',\n      access: true,\n      icon: 'Comparatives',\n      cMenu: true\n    }, {\n      name: 'close',\n      access: true,\n      icon: 'ClosePeriod',\n      cMenu: true\n    }, {\n      name: 'open',\n      access: true,\n      icon: 'OpenPeriod',\n      cMenu: true\n    }, {\n      name: 'send',\n      access: true,\n      icon: 'SendPeriod',\n      cMenu: true\n    }, {\n      name: 'tackBack',\n      access: true,\n      icon: 'TakebackPeriod',\n      cMenu: true\n    }, {\n      name: 'archive',\n      access: true,\n      icon: 'Archive',\n      cMenu: true\n    }, {\n      name: 'unArchive',\n      access: true,\n      icon: 'UnArchive',\n      cMenu: true\n    }, {\n      name: 'copy',\n      access: true,\n      icon: 'Copy',\n      cMenu: true\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'create',\n      access: false,\n      cMenu: false\n    }],\n    filters: [{\n      name: 'auditState',\n      type: \"select\",\n      source: auditStates\n    }, {\n      name: 'periodType',\n      type: \"select\",\n      source: periodTypes\n    }, {\n      name: 'periodState',\n      type: \"select\",\n      source: periodStates\n    }, {\n      name: 'submitState',\n      type: \"select\",\n      source: submitStates\n    }, {\n      name: 'stateType',\n      type: \"select\",\n      source: stateTypes\n    }, {\n      name: 'closed',\n      type: \"select\",\n      source: [{\n        text: 'بسته',\n        value: 'true'\n      }, {\n        text: 'باز',\n        value: 'false'\n      }]\n    }, {\n      name: 'year'\n    }, {\n      name: 'month'\n    }, {\n      name: 'day'\n    }, {\n      name: 'fullDate',\n      type: \"template\",\n      template: \"fulldatefilter-template\"\n    }, {\n      name: 'showArchived',\n      type: \"bool\"\n    }],\n    searchKeyType: \"enter\",\n    styleRow: \"styleRowValue\",\n    sortDirection: \"Ascending\",\n    sortProperty: \"id\",\n    tableClass: \"table ko-tbl period-tbl\",\n    tableStyle: \"font-size: 11px;\",\n    context: self,\n    cols: periodModelRes,\n    saveState: true,\n    selectRow: true,\n    contextMenu: true,\n    resizable: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    var isSelected = self.isSelectedRecord();\n    var item = self.getSelectedRecord();\n\n    if (isSelected) {\n      var closed = item.closed();\n      var archive = item.archived();\n      var submitState = item.submitState();\n      self.visedit(!closed);\n      self.visdelete(!closed);\n      self.visarchive(!archive && submitState !== 1);\n      self.visunArchive(archive && submitState !== 1);\n      self.visclose(!closed);\n      self.visopen(closed && !archive && submitState !== 1 && submitState !== 2);\n      self.vistackBack(submitState === 1);\n      self.vissend(closed && (!archive && submitState === 0 || submitState === 3));\n      self.viscomparatives(!closed);\n      self.viscopy(true);\n      self.visdisable(item.stateType() === 1);\n      self.visenable(item.stateType() === 0);\n    } else {\n      self.visedit(false);\n      self.visdelete(false);\n      self.viscomparatives(false);\n      self.visclose(false);\n      self.visopen(false);\n      self.vissend(false);\n      self.vistackBack(false);\n      self.visarchive(false);\n      self.visunArchive(false);\n      self.viscopy(false);\n      self.visdisable(false);\n      self.visenable(false);\n    }\n\n    self.viscreate(true);\n    self.vishelp(true);\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n\n  self.deleteBtn = function () {\n    var selectedRecord = self.getSelectedRecord();\n    self.getDeleteModel(selectedRecord.id(), function (data) {\n      if (data !== null) {\n        _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.PeriodDeleteForm(self, selectedRecord, data));\n      }\n    });\n  };\n\n  self[\"delete\"] = function (parents, btnModel, e) {\n    var item = parents[1];\n    var model = item.toServer();\n    self.apiService.request({\n      splashId: e,\n      name: \"delete\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          if (data.completeDelete === true) {\n            self.afterDelete(model.id, data.models);\n\n            var context = _h.kocnx();\n\n            context.headerSection.resetActiveSelectMenu();\n            toast.success(self.entityName, 'del');\n            self.selectedRecord(null);\n            self.selectedRowRecord(null);\n          } else {\n            toast.custom(\"success\", _h.getApiMessage(\"PeriodHalfDeletedSuccess\"));\n          }\n\n          _h.kocnx().closeForm();\n\n          self.resetSelectedTableTemplate();\n        }\n      },\n      messageType: 'del',\n      messageKey: self.entityName\n    });\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/period/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/tabletemplate/model.js":
/*!**************************************************!*\
  !*** ./src/scripts/pages/tabletemplate/model.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"ActionMenu\": () => (/* binding */ ActionMenu),\n/* harmony export */   \"CellBind\": () => (/* binding */ CellBind),\n/* harmony export */   \"CellBindForm\": () => (/* binding */ CellBindForm),\n/* harmony export */   \"CellRegion\": () => (/* binding */ CellRegion),\n/* harmony export */   \"CellSelectForm\": () => (/* binding */ CellSelectForm),\n/* harmony export */   \"CellSpecMenu\": () => (/* binding */ CellSpecMenu),\n/* harmony export */   \"ChartDataLabel\": () => (/* binding */ ChartDataLabel),\n/* harmony export */   \"ChartDataSet\": () => (/* binding */ ChartDataSet),\n/* harmony export */   \"ChartMenu\": () => (/* binding */ ChartMenu),\n/* harmony export */   \"ChartTitle\": () => (/* binding */ ChartTitle),\n/* harmony export */   \"ContextMenu\": () => (/* binding */ ContextMenu),\n/* harmony export */   \"CustomStyle\": () => (/* binding */ CustomStyle),\n/* harmony export */   \"CustomStyleCategory\": () => (/* binding */ CustomStyleCategory),\n/* harmony export */   \"CustomStyleForm\": () => (/* binding */ CustomStyleForm),\n/* harmony export */   \"CustomStyleMenu\": () => (/* binding */ CustomStyleMenu),\n/* harmony export */   \"DescCell\": () => (/* binding */ DescCell),\n/* harmony export */   \"DomChart\": () => (/* binding */ DomChart),\n/* harmony export */   \"InfoDropDown\": () => (/* binding */ InfoDropDown),\n/* harmony export */   \"NodeValue\": () => (/* binding */ NodeValue),\n/* harmony export */   \"RgMenu\": () => (/* binding */ RgMenu),\n/* harmony export */   \"RgMenuInfo\": () => (/* binding */ RgMenuInfo),\n/* harmony export */   \"RpSetting\": () => (/* binding */ RpSetting),\n/* harmony export */   \"SubMenu\": () => (/* binding */ SubMenu),\n/* harmony export */   \"TableInfo\": () => (/* binding */ TableInfo),\n/* harmony export */   \"TableInfoViewModel\": () => (/* binding */ TableInfoViewModel),\n/* harmony export */   \"TableTemplate\": () => (/* binding */ TableTemplate),\n/* harmony export */   \"TableTemplateForm\": () => (/* binding */ TableTemplateForm),\n/* harmony export */   \"TableTemplatePreview\": () => (/* binding */ TableTemplatePreview),\n/* harmony export */   \"TableTemplatePreviewDefault\": () => (/* binding */ TableTemplatePreviewDefault),\n/* harmony export */   \"TreeInfoViewModel\": () => (/* binding */ TreeInfoViewModel),\n/* harmony export */   \"XbrlConceptViewModel\": () => (/* binding */ XbrlConceptViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/model */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var apexcharts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! apexcharts */ \"./node_modules/apexcharts/dist/apexcharts.common.js\");\n/* harmony import */ var apexcharts__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(apexcharts__WEBPACK_IMPORTED_MODULE_3__);\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var _autoMapper = __webpack_require__(/*! ./src/scripts/util/autoMapper.js */ \"./src/scripts/util/autoMapper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar _require = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\"),\n    BaseModel = _require.BaseModel,\n    BaseFormModel = _require.BaseFormModel,\n    FormBuilder = _require.FormBuilder,\n    BaseSecondaryForm = _require.BaseSecondaryForm,\n    BaseInnerModel = _require.BaseInnerModel,\n    BaseInfoModel = _require.BaseInfoModel;\n\n\n\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\n\n\nvar TableTemplate = /*#__PURE__*/function (_BaseModel) {\n  _inherits(TableTemplate, _BaseModel);\n\n  var _super = _createSuper(TableTemplate);\n\n  function TableTemplate(model) {\n    var _this;\n\n    _classCallCheck(this, TableTemplate);\n\n    _this = _super.call(this, model);\n    _this.shortDesc = ko.pureComputed(function () {\n      var code = this.code();\n\n      var templateTableType = _h.getEnumText(templateTableTypes, this.templateTableType());\n\n      return code + \"-\" + templateTableType;\n      ;\n    }, _assertThisInitialized(_this));\n    _this.shortName = ko.pureComputed(function () {\n      var title = this.title();\n\n      if (!_h.isEmpty(title)) {\n        if (title.length < 50) return title;\n        return title.substr(0, 47) + \"...\";\n      }\n\n      return \"\";\n    }, _assertThisInitialized(_this));\n    _this.lockedCaption = ko.pureComputed(function () {\n      var lockedBy = this.lockedBy();\n      if (lockedBy) return \"قفل شده توسط \" + lockedBy;\n    }, _assertThisInitialized(_this));\n    return _this;\n  }\n\n  return _createClass(TableTemplate);\n}(BaseModel);\nvar TableTemplateForm = /*#__PURE__*/function (_BaseFormModel) {\n  _inherits(TableTemplateForm, _BaseFormModel);\n\n  var _super2 = _createSuper(TableTemplateForm);\n\n  function TableTemplateForm(viewModel, editMode, res) {\n    var _this2;\n\n    _classCallCheck(this, TableTemplateForm);\n\n    _this2 = _super2.call(this, viewModel, editMode);\n    _this2.updateTemplateTableType = true;\n    _this2.lastPriority = ko.observable();\n    _this2.fileName = ko.observable();\n    _this2.file = ko.observable();\n    _this2.fileType = ko.observable();\n    _this2.templateTypes = [{\n      text: \"صورت مالی\",\n      enText: \"FinanceStatement\",\n      value: 1,\n      color: \"\"\n    }, {\n      text: \"یادداشت همراه\",\n      enText: \"Note\",\n      value: 2,\n      color: \"\"\n    }];\n\n    _this2.fillLists();\n\n    if (editMode) {\n      var model = viewModel.getSelectedRecord();\n\n      _this2.lastPriority(res);\n\n      _this2.updateTemplateTableType = false;\n\n      _this2.templateTableType(model.templateTableType());\n\n      _this2.updateTemplateTableType = true;\n    } else {\n      _this2.lastPriority(res + 1);\n\n      _this2.priority(res + 1);\n    }\n\n    _this2.condFirst = ko.pureComputed(function () {\n      return this.templateTableType() !== 4;\n    }, _assertThisInitialized(_this2));\n    _this2.condSecond = ko.pureComputed(function () {\n      return !_h.isNullOrEmpty(this.templateTableType()) && this.templateTableType() !== 4;\n    }, _assertThisInitialized(_this2));\n    _this2.condThird = ko.pureComputed(function () {\n      return this.templateTableType() === 4;\n    }, _assertThisInitialized(_this2));\n\n    _this2.setValidationObject();\n\n    _this2.createForm();\n\n    return _this2;\n  }\n\n  _createClass(TableTemplateForm, [{\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      self.validationObject = ko.validatedObservable({\n        title: self.title.extend({\n          required: true,\n          minLength: 3,\n          maxLength: 100,\n          validCharacterName: true,\n          remoteIsUniqueRule: {\n            params: [self.id, \"TableTemplate\", \"title\", \"remotePlaceHolder\"]\n          }\n        }),\n        templateTableType: self.templateTableType.extend({\n          required: true\n        }),\n        accountType: self.accountType.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return self.templateTableType() !== 4;\n            }\n          }\n        }),\n        defaultRowNumber: self.defaultRowNumber.extend({\n          required: true,\n          number: true,\n          min: 1,\n          max: 100\n        }),\n        defaultColumnNumber: self.defaultColumnNumber.extend({\n          required: true,\n          number: true,\n          min: 1,\n          max: 100\n        }),\n        file: self.file.extend({\n          checkOnlyExcel: {\n            params: [self.fileName]\n          }\n        })\n      });\n    }\n  }, {\n    key: \"handleFileChoose\",\n    value: function handleFileChoose(files) {\n      var file = files;\n\n      var ext = _h.getExtension(file.name);\n\n      _h.toBase64(file, function (res) {\n        this.file(res);\n      }.bind(this));\n\n      switch (ext) {\n        case \"xls\":\n          this.fileType(8);\n          break;\n\n        case \"xlsx\":\n          this.fileType(9);\n          break;\n\n        default:\n      }\n\n      this.fileName(file.name);\n    }\n  }, {\n    key: \"fillLists\",\n    value: function fillLists() {\n      this.templateTypes = [{\n        text: \"صورت مالی\",\n        enText: \"FinanceStatement\",\n        value: 1,\n        color: \"\"\n      }, {\n        text: \"یادداشت همراه\",\n        enText: \"Note\",\n        value: 2,\n        color: \"\"\n      }];\n\n      var context = _h.kocnx();\n\n      if (context.loginCompanyType() === 0) {\n        this.templateTypes.push({\n          text: \"حساب های متقابل\",\n          enText: \"BilateralAccounts\",\n          value: 3,\n          color: \"\"\n        });\n        this.templateTypes.push({\n          text: \"گزارش ماتریسی\",\n          enText: \"MatrixReport\",\n          value: 5,\n          color: \"\"\n        });\n      }\n\n      this.templateTypes.push({\n        text: \"محاسبات\",\n        enText: \"TotalCost\",\n        value: 4,\n        color: \"\"\n      });\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tsp',\n        val: this.priority,\n        min: 1,\n        max: this.editMode() === true ? this.lastPriority() : this.priority()\n      }, {\n        t: 'txb',\n        val: this.title\n      }), this.createLine({\n        t: 'slc',\n        val: this.templateTableType,\n        options: this.templateTypes,\n        dis: this.editMode\n      }, null, true, 30), this.createLine({\n        t: 'tsp',\n        val: this.defaultRowNumber,\n        min: 1,\n        max: 100,\n        dis: this.editMode\n      }, {\n        t: 'tsp',\n        val: this.defaultColumnNumber,\n        min: 1,\n        max: 100,\n        dis: this.editMode\n      }, true, 30), this.createLine({\n        t: 'tm',\n        templateName: 'upload-tabletemplate-form-t'\n      }, undefined, true, 30, 30), this.createLine({\n        t: 'slc',\n        val: this.accountType,\n        options: accountTypes\n      }, null, this.condFirst, 30), this.createLine({\n        t: 'slc',\n        val: this.folderId,\n        options: this.parentVM.folderList\n      }, null, true, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'create',\n            vis: !this.editMode(),\n            click: this.parentVM.create\n          }, {\n            name: 'edit',\n            vis: this.editMode,\n            click: this.parentVM.edit\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return TableTemplateForm;\n}(BaseFormModel);\nvar TableTemplatePreviewDefault = /*#__PURE__*/function (_FormBuilder) {\n  _inherits(TableTemplatePreviewDefault, _FormBuilder);\n\n  var _super3 = _createSuper(TableTemplatePreviewDefault);\n\n  function TableTemplatePreviewDefault(viewModel, model) {\n    var _this3;\n\n    _classCallCheck(this, TableTemplatePreviewDefault);\n\n    _this3 = _super3.call(this);\n    _this3.parentVM = viewModel;\n    _this3.showComparativePeriod = ko.observable(true);\n\n    _this3.fillModel(model);\n\n    _this3.createForm();\n\n    return _this3;\n  }\n\n  _createClass(TableTemplatePreviewDefault, [{\n    key: \"fillModel\",\n    value: function fillModel(model) {\n      var paramList = [{\n        name: \"selectivePeriods\",\n        type: \"obar\"\n      }, {\n        name: \"caption\",\n        type: \"ob\",\n        val: _h.getLocalizedText('previewDefaultCaption')\n      }, {\n        name: \"tableTemplateId\",\n        type: \"ob\",\n        val: model.tableTemplateId\n      }, {\n        name: \"paperSize\",\n        type: \"ob\",\n        val: model.paperSize\n      }, {\n        name: \"amountType\",\n        type: \"ob\",\n        val: model.amountType\n      }, {\n        name: \"pageOrientation\",\n        type: \"ob\",\n        val: model.pageOrientation\n      }, {\n        name: \"displayType\",\n        type: \"ob\",\n        val: model.displayType\n      }, {\n        name: \"currentPeriodId\",\n        type: \"ob\",\n        val: model.currentPeriodId\n      }, {\n        name: \"currentPeriodTitle\",\n        type: \"ob\",\n        val: model.currentPeriodTitle\n      }];\n\n      _autoMapper.createPropsFromList(this, paramList);\n\n      if (_h.any(model.comparativePeriods)) for (var i = 0; i < model.comparativePeriods.length; i++) {\n        this[model.comparativePeriods[i].order + \"ComparativePeriod\"] = ko.observable(model.comparativePeriods[i].id);\n      }\n\n      for (var j = 0; j < model.selectivePeriods.length; j++) {\n        this.selectivePeriods.push(new _master_model__WEBPACK_IMPORTED_MODULE_0__.PeriodSelectItem(model.selectivePeriods[j]));\n      }\n    }\n  }, {\n    key: \"getLastOrder\",\n    value: function getLastOrder() {\n      var number = 0;\n\n      for (var _i = 0, _Object$keys = Object.keys(this); _i < _Object$keys.length; _i++) {\n        var key = _Object$keys[_i];\n\n        var _char = key.slice(0, 2);\n\n        var numb = _char.match(/\\d/g);\n\n        if (numb && numb.length) {\n          var number = parseFloat(_char.replace(/[^0-9]/g, ''));\n        }\n      }\n\n      return number;\n    }\n  }, {\n    key: \"getComparativePeriodsList\",\n    value: function getComparativePeriodsList() {\n      var array = [];\n      var order = this.getLastOrder();\n\n      for (var f = 0; f < order; f++) {\n        array.push({\n          order: f + 1,\n          id: this[f + 1 + \"ComparativePeriod\"]()\n        });\n      }\n\n      return array;\n    }\n  }, {\n    key: \"toogleShowComparativeperiod\",\n    value: function toogleShowComparativeperiod() {\n      if (this.showComparativePeriod()) {\n        this.showComparativePeriod(false);\n        $(\".cp-box\").css(\"display\", \"none\");\n      } else {\n        this.showComparativePeriod(true);\n        $(\".cp-box\").css(\"display\", \"block\");\n      }\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'rdo',\n        val: this.amountType,\n        list: amountTypes,\n        className: \"radio-info\"\n      }, null, this.visFormControls, 0), this.createLine({\n        t: 'rdo',\n        val: this.displayType,\n        list: displayTypes2,\n        className: \"radio-info\"\n      }, null, this.visFormControls, 30), this.createLine({\n        t: 'rdo',\n        val: this.pageOrientation,\n        list: pageOrientations\n      }, null, this.visFormControls, 30)];\n      controls.push(this.createLine({\n        t: 'tm',\n        templateName: 'show-comparativeperiod-form-t'\n      }, undefined, true, 30, 0));\n\n      for (var _i2 = 0, _Object$keys2 = Object.keys(this); _i2 < _Object$keys2.length; _i2++) {\n        var key = _Object$keys2[_i2];\n\n        var _char2 = key.slice(0, 2);\n\n        var numb = _char2.match(/\\d/g);\n\n        if (numb && numb.length) {\n          controls.push(this.createLine({\n            t: 'slc',\n            val: this[key],\n            options: this.selectivePeriods,\n            renderFunc: _h.periodSelectRowTemplate\n          }, null, this[key]() > 0, 30, 0, \"row cp-box\"));\n        }\n      }\n\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'edit',\n            vis: true,\n            click: this.parentVM.savePreviewDefault\n          }, {\n            name: 'cancel',\n            vis: true,\n            click: this.parentVM.closePreviewForm\n          }]\n        }\n      });\n      setTimeout(function () {\n        this.toogleShowComparativeperiod();\n      }.bind(this), 150);\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      var list = this.getComparativePeriodsList();\n      var model = {\n        tableTemplateId: this.tableTemplateId(),\n        amountType: this.amountType(),\n        displayType: this.displayType(),\n        pageOrientation: this.pageOrientation(),\n        currentPeriodId: this.currentPeriodId(),\n        comparativePeriods: list\n      };\n      return model;\n    }\n  }]);\n\n  return TableTemplatePreviewDefault;\n}(FormBuilder);\nfunction TreeInfoViewModel() {\n  var self = this;\n  self.treeId = ko.observable();\n  self.periodId = ko.observable();\n  self.treeName = ko.observable();\n  self.nodeDisplayType = ko.observable(1);\n  self.controllerName = 19;\n  self.treeOpenBranches = [];\n  self.treeSelectList = ko.observableArray();\n\n  self.collectOpenBranches = function () {\n    var tree = $(\"#tablestructure-tree-sec\").find(\".dmn-tree\");\n    var ulList = tree.find(\"ul:not(.dmn-c)\");\n    var array = [];\n    if (ulList.length) for (var i = 0; i < ulList.length; i++) {\n      var item = ulList[i];\n      var parent = $(item).parent();\n      if (parent) array.push(parent.attr(\"did\"));\n    }\n    self.treeOpenBranches = array;\n    return array;\n  };\n\n  self.getTreeName = function (id) {\n    var name = \"-\";\n    ko.utils.arrayFilter(self.treeSelectList(), function (item) {\n      if (id === item.value) name = item.text;\n    });\n    return name;\n  };\n\n  self.treeSelectConfig = function (item) {\n    var model = self.getTree(item.text);\n    return '<div>' + '<span class=\"item-title\">' + '<span class=\"item-name\">' + item.text + '</span>' + '<span class=\"item-valueType\">' + _h.getEnumText(valueTypes, model.valueType) + '</span>' + '</span>' + '<ul class=\"item-meta\">' + '<li class=\"item-type\">' + model.type + '</li></ul></div>';\n  };\n\n  self.getTree = function (text) {\n    var name = \"-\";\n    ko.utils.arrayFilter(self.treeSelectList(), function (item) {\n      if (text === item.text) name = item;\n    });\n    return name;\n  };\n\n  self.onSelect = function (type, item) {\n    switch (type) {\n      case \"treeId\":\n        if (item) {\n          if (_h.isNullOrEmpty(self.periodId())) return;\n          var treeName = self.getTreeName(item.value);\n          self.treeName(treeName);\n          self.getRecords();\n        } else {\n          $(\"#tree_view\").treeView(\"removeTree\");\n        }\n\n        self.treeOpenBranches = [];\n        break;\n\n      case \"periodId\":\n        if (!item) {\n          self.treeId(null);\n          self.treeSelectList.removeAll();\n          $(\"#tree_view\").treeView(\"removeTree\");\n        } else {\n          self.treeId(null);\n          $(\"#tree_view\").treeView(\"removeTree\");\n          self.getTreeSelectList();\n        }\n\n        break;\n    }\n  };\n\n  self.getTreeSelectList = function (oldTreeId) {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__.ApiService.request({\n      url: \"/api/common/getgeneraltreelist\",\n      data: {\n        controllerName: 19,\n        period: self.periodId()\n      },\n      success: function success(data) {\n        self.treeSelectList.removeAll();\n        if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n          if (!_h.isNullOrEmpty(data[j])) {\n            var item = new _master_model__WEBPACK_IMPORTED_MODULE_0__.TreeFormulaSelectItem(data[j]);\n            self.treeSelectList.push(item);\n          }\n        }\n        if (oldTreeId) self.treeId(oldTreeId);else self.treeId(null);\n      },\n      error: function error(data) {\n        var text = _h.getApiMessage(\"ErrorLoadTree\");\n\n        _h.failToast(text);\n      }\n    });\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_2__.BaseViewModel({\n    entityName: \"TreeInfo\",\n    getList: false,\n    apiService: {\n      actionList: []\n    },\n    buttons: [{\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }],\n    filters: [{\n      name: 'treeId'\n    }, {\n      name: 'period'\n    }, {\n      name: 'treeName'\n    }, {\n      name: 'controllerName'\n    }],\n    tableStyle: \"font-size: 11px;\",\n    sortDirection: \"Ascending\",\n    sortProperty: \"code\",\n    context: self,\n    cols: treeInfoModelRes,\n    searchKeyType: \"enter\",\n    selectRow: true,\n    saveState: true,\n    contextMenu: false,\n    isMultiSelectRows: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n\n  self.init = function (oldModel) {\n    self.fillTableProperties();\n\n    if (oldModel) {\n      self.periodId(oldModel.periodId);\n      self.treeOpenBranches = oldModel.treeOpenBranches;\n      if (oldModel.nodeDisplayType) self.nodeDisplayType(oldModel.nodeDisplayType);\n      self.getTreeSelectList(oldModel.treeId);\n    }\n\n    self.getRecords();\n    self.iconSize(\"icon-image-small\");\n  };\n\n  self.getRecords = function () {\n    var filterModel = {\n      id: self.treeId(),\n      searchKey: self.searchKey(),\n      controllerName: 19,\n      period: self.periodId()\n    };\n    if (_h.isNullOrEmpty(filterModel.id)) return;\n    self.apiService.request({\n      name: \"getNodeSelection\",\n      data: filterModel,\n      success: function success(data) {\n        if (_h.any(data)) {\n          self.records = data;\n        }\n\n        self.configTools();\n\n        _h.fixLabelsSize();\n      },\n      error: function error() {\n        var text = _h.getApiMessage(\"ErrorLoadTree\");\n\n        _h.failToast(text);\n      }\n    });\n  };\n\n  self.expandAll = function () {\n    $(\"#tree_view\").treeView(\"expandAll\");\n  };\n\n  self.collapseAll = function () {\n    $(\"#tree_view\").treeView(\"collapseAll\");\n  };\n\n  self.configTools = function () {\n    $(\"#tree_view\").treeView({\n      tType: self.entityName,\n      location: self.entityName,\n      nodes: self.records,\n      rootId: self.treeId(),\n      controllerName: 19,\n      rootName: self.treeName(),\n      periodId: self.periodId(),\n      treeId: self.treeId(),\n      nodeDisplayType: self.nodeDisplayType\n    });\n    if (self.treeOpenBranches && self.treeOpenBranches.length) $(\"#tree_view\").treeView(\"expand\", self.treeOpenBranches);\n  };\n}\nfunction TableInfoViewModel(parent) {\n  var self = this;\n  self.parent = parent;\n  self.controllerName = 19;\n  self.tableName = ko.observable();\n  self.tableId = ko.observable();\n\n  self.getTable = function (text) {\n    var target;\n    ko.utils.arrayFilter(self.tableSelectList(), function (item) {\n      if (text === item.text) target = item;\n    });\n    return target;\n  };\n\n  self.getTableName = function (id) {\n    var name = \"-\";\n    ko.utils.arrayFilter(self.tableSelectList(), function (item) {\n      if (id === item.value()) name = item.text;\n    });\n    return name;\n  };\n\n  self.onSelect = function (type, item) {\n    switch (type) {\n      case \"tableId\":\n        if (!_h.isNullOrEmpty(item.value)) {\n          var tableName = self.getTableName(item.value);\n          self.tableName(tableName);\n          self.getRecords();\n        }\n\n        if (_h.isNullOrEmpty(item.value)) {\n          self.tableName(\"\");\n          self.records.removeAll();\n        }\n\n        break;\n    }\n  };\n\n  self.tableSelectList = ko.observableArray();\n\n  self.gettableSelectList = function (oldTableId) {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__.ApiService.request({\n      url: \"/api/common/gettablelist\",\n      data: {\n        controllerName: 19\n      },\n      success: function success(data) {\n        self.tableSelectList.removeAll();\n        if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n          data[j].id = data[j].value;\n          var item = new _master_model__WEBPACK_IMPORTED_MODULE_0__.SelectItem(data[j]);\n          self.tableSelectList.push(item);\n        }\n        if (oldTableId) self.tableId(oldTableId);else self.tableId(null);\n        self.onSelect(\"tableId\", {\n          value: oldTableId\n        });\n      },\n      error: function error(data) {}\n    });\n  };\n\n  self.getRecords = function () {\n    self.apiService.request({\n      name: \"/api/selectlist/gettablefields\",\n      data: {\n        id: self.tableId()\n      },\n      success: function success(data) {\n        self.records.removeAll();\n\n        if (_h.any(data)) {\n          for (var j = 0; j < data.length; j++) {\n            var target = data[j];\n            var record = new TableInfo(target);\n            self.records.push(record);\n          }\n        }\n\n        _h.fixLabelsSize();\n      },\n      error: function error(message, level) {}\n    });\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_2__.BaseViewModel({\n    entityName: \"TableInfo\",\n    getList: false,\n    apiService: {\n      actionList: [\"filterby\"]\n    },\n    buttons: [{\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }],\n    filters: [{\n      name: 'tableId'\n    }, {\n      name: 'tableName'\n    }, {\n      name: 'controllerName'\n    }],\n    tableStyle: \"font-size: 11px;\",\n    sortDirection: \"Ascending\",\n    sortProperty: \"id\",\n    context: self,\n    cols: tableModelRes,\n    saveState: true,\n    contextMenu: false\n  }));\n  self.btnVisibility = ko.computed(function () {\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n\n  self.init = function (oldModel) {\n    self.fillTableProperties();\n    self.gettableSelectList(oldModel[\"tableId\"]);\n    self.iconSize(\"icon-image-small\");\n  };\n\n  self.selectedRow = function (target, e, rightClick) {\n    var ctrlSelect = e.ctrlKey;\n    var shiftSelect = e.shiftKey;\n    if (shiftSelect === undefined) shiftSelect = false;\n    if (ctrlSelect === undefined) ctrlSelect = false;\n    var res = self.isValidClickSingleRow(e);\n\n    if (res !== \"label\") {\n      self.changeSelectedRecord(target, ctrlSelect, shiftSelect, rightClick);\n      self.fillChildModel(target);\n    } else {\n      self.changeSelectedRecord(target, ctrlSelect, shiftSelect, rightClick);\n    }\n  };\n\n  self.changeSelectedRecord = function (target, ctrlSelect, shiftSelect, rightClick) {\n    if (self.isMultiSelectRows && self.showType() !== \"List\") {\n      if (shiftSelect) {\n        if (self.extraBufferKey() === null || self.extraBufferKey() === undefined) {\n          self.extraBufferKey(target);\n          target.selected(true);\n        } else {\n          var first,\n              second,\n              groupRoot,\n              indexFirst,\n              indexSecond,\n              cr = false;\n          ;\n\n          if (self.groupProperty()) {\n            for (var i = 0; i < self.records().length; i++) {\n              var rec = self.records()[i];\n\n              for (var j = 0; j < rec.list().length; j++) {\n                var innerRec = rec.list()[j];\n\n                if (self.extraBufferKey().id() === innerRec.id()) {\n                  groupRoot = rec;\n                  indexFirst = rec.list().indexOf(self.extraBufferKey());\n                  indexSecond = rec.list().indexOf(target);\n                }\n              }\n            }\n\n            if (indexFirst === indexSecond) return;\n\n            if (indexFirst > indexSecond) {\n              first = target;\n              second = self.extraBufferKey();\n            }\n\n            if (indexFirst < indexSecond) {\n              first = self.extraBufferKey();\n              second = target;\n            }\n\n            ko.utils.arrayFilter(groupRoot.list(), function (rec) {\n              if (rec.id() === first.id()) cr = true;\n              if (cr) rec.selected(true);\n              if (rec.id() === second.id()) cr = false;\n            });\n          } else {\n            indexFirst = self.records().indexOf(self.extraBufferKey());\n            indexSecond = self.records().indexOf(target);\n\n            if (indexFirst === indexSecond) {\n              return;\n            }\n\n            if (indexFirst > indexSecond) {\n              first = target;\n              second = self.extraBufferKey();\n            }\n\n            if (indexFirst < indexSecond) {\n              first = self.extraBufferKey();\n              second = target;\n            }\n\n            ko.utils.arrayFilter(self.records(), function (rec) {\n              if (rec.id() === first.id()) cr = true;\n              if (cr) rec.selected(true);\n              if (rec.id() === second.id()) cr = false;\n            });\n          }\n        }\n      } else {\n        if (ctrlSelect) {\n          if (target.selected() === false) self.extraBufferKey(target);\n          target.selected(!target.selected());\n        } else {\n          if (rightClick) {\n            if (!target.selected()) {\n              self.extraBufferKey(target);\n              self.multiCommandExecute(\"toggle\", false);\n              target.selected(true);\n            }\n\n            target.selected(true);\n          } else {\n            self.extraBufferKey(target);\n            self.multiCommandExecute(\"toggle\", false);\n            if (self.configTable.isMultiSelectRows) self.selectedRowRecord(target);\n            target.selected(true);\n          }\n        }\n      }\n    } else {\n      self.extraBufferKey(target);\n      if (self.selectedRowRecord() !== null && self.selectedRowRecord() !== undefined) self.selectedRowRecord().selected(false);\n      self.selectedRowRecord(target);\n      target.selected(true);\n    }\n  };\n\n  self.isValidClickSingleRow = function (e) {\n    var tag;\n    if (e.target === undefined) tag = e.tagName.toLowerCase();else tag = e.target.tagName.toLowerCase();\n\n    switch (tag) {\n      case \"span\":\n      case \"label\":\n        return \"label\";\n\n      case \"button\":\n      case \"i\":\n      case \"a\":\n      case \"li\":\n        return false;\n\n      default:\n        return true;\n    }\n  };\n}\nvar TableInfo = /*#__PURE__*/function (_BaseInnerModel) {\n  _inherits(TableInfo, _BaseInnerModel);\n\n  var _super4 = _createSuper(TableInfo);\n\n  function TableInfo(model) {\n    var _this4;\n\n    _classCallCheck(this, TableInfo);\n\n    _this4 = _super4.call(this, model);\n    _this4.selected = ko.observable(false);\n\n    _this4.selected.subscribe(function (newValue) {\n      setTimeout(function () {\n        var list = $(\"#dyn_col_list .table-row-selected\");\n        var dlist = $(\"#dyn_col_list tr:not(.table-row-selected)\");\n        var el;\n        if (_h.any(list)) for (var i = 0; i < list.length; i++) {\n          el = list[i];\n          el.setAttribute(\"draggable\", true);\n          el.addEventListener('dragstart', function (event) {\n            var title = $(event.currentTarget).attr(\"data-title\");\n            var id = $(event.currentTarget).attr(\"data-id\");\n            var tableId = $(event.currentTarget).attr(\"data-table\");\n            var div = document.getElementById('drag-label');\n            div.style.display = \"block\";\n            var span = div.getElementsByTagName(\"span\")[0];\n            span.innerText = title;\n            event.dataTransfer.setData('application/json', JSON.stringify({\n              action: \"tableCol\",\n              model: {\n                id: id,\n                title: title,\n                tableId: tableId\n              }\n            }));\n            event.dataTransfer.setDragImage(div, 60, 0);\n          });\n        }\n        if (_h.any(dlist)) for (var j = 0; j < dlist.length; j++) {\n          var elem = dlist[j];\n          elem.setAttribute(\"draggable\", false);\n        }\n      }, 100);\n    });\n\n    return _this4;\n  }\n\n  return _createClass(TableInfo);\n}(BaseInnerModel);\nfunction CellBindForm() {\n  var self = this;\n  self.parent = null;\n  self.gParent = null;\n  self.id = null;\n  self.selectedItem = ko.observable();\n  self.cellBinds = ko.observableArray();\n\n  self.addCellBindBtn = function () {\n    if (!_h.isNullOrEmpty(self.selectedItem())) {\n      if (!self.selectedItem().validationObject.isValid()) {\n        self.selectedItem().validationObject.errors.showAllMessages();\n        return false;\n      }\n\n      self.selectedItem().editMode(false);\n    }\n\n    var record = new CellBind({\n      title: \"\",\n      firstCell: undefined,\n      secondCell: undefined,\n      deterrent: false,\n      errorRate: undefined\n    }, self, self.parent);\n    record.editMode(true);\n    self.cellBinds.unshift(record);\n    self.selectedItem(record);\n  };\n\n  self.removeCellBindBtn = function (item) {\n    self.cellBinds.remove(item);\n    self.selectedItem(null);\n  };\n\n  self.closeMode = ko.observable(false);\n\n  self.saveCellBindBtn = function () {\n    if (!_h.isNullOrEmpty(self.selectedItem())) {\n      if (!self.selectedItem().validationObject.isValid()) {\n        self.selectedItem().validationObject.errors.showAllMessages();\n        return false;\n      }\n    }\n\n    if (_h.isNullOrEmpty(self.selectedItem().errorRate()) || self.selectedItem().errorRate() === \"\") {\n      self.selectedItem().errorRate(0);\n    }\n\n    self.closeMode(true);\n    self.selectedItem().editMode(false);\n    self.selectedItem(null);\n    var list = [];\n    if (self.cellBinds().length) for (var i = 0; i < self.cellBinds().length; i++) {\n      var target = self.cellBinds()[i];\n\n      if (target.validationObject.isValid()) {\n        var record = {\n          title: target.title(),\n          firstCell: target.firstCell(),\n          secondCell: target.secondCell(),\n          deterrent: target.deterrent(),\n          errorRate: target.errorRate()\n        };\n        list.push(record);\n      }\n    }\n    $(\"#rg-\" + self.id).rg(\"setCellBinds\", list);\n  };\n\n  self.onRowClick = function (item) {\n    if (item.editMode()) return;\n\n    if (self.closeMode()) {\n      self.closeMode(false);\n      return;\n    }\n\n    if (!_h.isNullOrEmpty(self.selectedItem())) {\n      if (!self.selectedItem().validationObject.isValid()) {\n        self.selectedItem().validationObject.errors.showAllMessages();\n        return false;\n      }\n\n      self.selectedItem().editMode(false);\n    }\n\n    self.selectedItem(item);\n    item.editMode(true);\n  };\n\n  self.init = function (model) {\n    self.parent = model.parent;\n    self.gParent = model.gParent;\n    self.id = model.id;\n    self.refresh(model.cellBinds);\n  };\n\n  self.refresh = function (cellBinds) {\n    if (!cellBinds) cellBinds = $(\"#rg-\" + self.id).rg(\"getCellBinds\");\n    self.cellBinds.removeAll();\n    if (_h.any(cellBinds)) for (var l = 0; l < cellBinds.length; l++) {\n      var cellBind = new CellBind(cellBinds[l], self, self.parent);\n      self.cellBinds.push(cellBind);\n    }\n  };\n}\nfunction CellBind(model, parent, parentModel) {\n  var self = this;\n  self.parentForm = parent;\n  self.parentModel = parentModel;\n  self.editMode = ko.observable(false);\n  self.title = ko.observable(model.title);\n  self.firstCell = ko.observable(model.firstCell);\n  self.secondCell = ko.observable(model.secondCell);\n  self.deterrent = ko.observable(model.deterrent);\n  self.errorRate = ko.observable(model.errorRate);\n\n  self.addCell = function (address) {\n    if (self.activeCell() === 1) self.firstCell(address);else self.secondCell(address);\n  };\n\n  self.firstCellKeyDown = function (data, event) {\n    var cols = self.parentModel.cols;\n    var rows = self.parentModel.rows;\n    var val = self.firstCell();\n    var number, letter;\n\n    if (event.keyCode >= 96 && event.keyCode <= 105 || event.keyCode >= 48 && event.keyCode <= 57) {\n      if (!_h.isNullOrEmpty(val) && val !== \"\") {\n        number = self.firstCell().replace(/^\\D+/g, '');\n        letter = self.firstCell().replace(number, '');\n\n        if (_h.isEmpty(number)) {\n          if (Number(number) + Number(event.key) <= rows) self.firstCell(self.firstCell() + event.key);\n        } else {\n          if (Number(number) + Number(event.key) <= rows) self.firstCell(self.firstCell() + event.key);\n        }\n      }\n    } else if (event.keyCode >= 65 && event.keyCode <= 90) {\n      if (_h.isNullOrEmpty(val) || val === \"\") {\n        if (_h.alphabetToNumber(event.key.toUpperCase()) <= cols) self.firstCell(self.firstCell() + event.key.toUpperCase());\n      } else {\n        number = self.firstCell().replace(/^\\D+/g, '');\n        letter = self.firstCell().replace(number, '');\n\n        if (_h.isEmpty(number)) {\n          if (_h.alphabetToNumber(letter + event.key) <= cols) self.firstCell(self.firstCell() + event.key.toUpperCase());\n        }\n      }\n    } else {\n      if (event.keyCode === 35 || event.keyCode === 8) return true;\n    }\n  };\n\n  self.secondCellKeyDown = function (data, event) {\n    var cols = self.parentModel.cols;\n    var rows = self.parentModel.rows;\n    var val = self.secondCell();\n    var number, letter;\n\n    if (event.keyCode >= 96 && event.keyCode <= 105 || event.keyCode >= 48 && event.keyCode <= 57) {\n      if (!_h.isNullOrEmpty(val) && val !== \"\") {\n        number = self.secondCell().replace(/^\\D+/g, '');\n\n        if (_h.isEmpty(number)) {\n          if (Number(number) + Number(event.key) <= rows) self.secondCell(self.secondCell() + event.key);\n        } else {\n          if (Number(number) + Number(event.key) <= rows) self.secondCell(self.secondCell() + event.key);\n        }\n      }\n    } else if (event.keyCode >= 65 && event.keyCode <= 90) {\n      if (_h.isNullOrEmpty(val) || val === \"\") {\n        if (_h.alphabetToNumber(event.key.toUpperCase()) <= cols) self.secondCell(self.secondCell() + event.key.toUpperCase());\n      } else {\n        number = self.secondCell().replace(/^\\D+/g, '');\n        letter = self.secondCell().replace(number, '');\n\n        if (_h.isEmpty(number)) {\n          if (_h.alphabetToNumber(letter + event.key) <= cols) self.secondCell(self.secondCell() + event.key.toUpperCase());\n        }\n      }\n    } else {\n      if (event.keyCode === 35 || event.keyCode === 8) return true;\n    }\n  };\n\n  self.validationObject = ko.validatedObservable({\n    title: self.title.extend({\n      required: true\n    }),\n    firstCell: self.firstCell.extend({\n      required: true,\n      englishOnly: true,\n      chkStringTypeCell: [self.parentForm],\n      duplicateCell: [self.parentForm],\n      compareSameCell: [self.parentForm, self.secondCell]\n    }),\n    secondCell: self.secondCell.extend({\n      required: true,\n      englishOnly: true,\n      chkStringTypeCell: [self.parentForm],\n      duplicateCell: [self.parentForm],\n      compareSameCell: [self.parentForm, self.firstCell]\n    }),\n    errorRate: self.errorRate.extend({\n      chkErrorRate: true,\n      chkPercentRate: true\n    })\n  });\n\n  self.toggleDeterrent = function () {\n    self.deterrent(!self.deterrent());\n  };\n}\nfunction CellSelectForm() {\n  var self = this;\n  self.templateName = ko.observable();\n  self.caption = ko.observable(\"اتصال به قالب جداول دیگر\");\n  self.dataModel = ko.observable();\n  self.tableTemplateId = ko.observable();\n  self.tableTemplateListFiltered = ko.observableArray();\n\n  self.getTemplateName = function (id) {\n    var name = \"-\";\n\n    var context = _h.kocnx();\n\n    for (var j = 0; j < context.ttvm().tableTemplateList().length; j++) {\n      var target = context.ttvm().tableTemplateList()[j];\n      if (id === target.value()) name = target.text();\n    }\n\n    return name;\n  };\n\n  self.filterList = function () {\n    var context = _h.kocnx();\n\n    var designItem = context.ttvm().findFocusDesignItem();\n    self.tableTemplateListFiltered.removeAll();\n    if (_h.any(context.ttvm().tableTemplateList())) for (var j = 0; j < context.ttvm().tableTemplateList().length; j++) {\n      var target = context.ttvm().tableTemplateList()[j];\n\n      if (designItem.value() !== target.value()) {\n        switch (target.tableTemplateType()) {\n          case 3:\n            if (designItem.type() === 3) self.tableTemplateListFiltered.push(target);\n            break;\n\n          case 5:\n          case 1:\n          case 2:\n            if (designItem.type() === 1 || designItem.type() === 2 || designItem.type() === 5) self.tableTemplateListFiltered.push(target);\n            break;\n        }\n      }\n    }\n  };\n\n  self.onSelect = function (type, item) {\n    switch (type) {\n      case \"tableTemplateId\":\n        if (item && item.value) {\n          var name = self.getTemplateName(item.value);\n          self.templateName(name);\n        }\n\n        if (!item) {\n          self.templateName(\"\");\n        }\n\n        break;\n    }\n  };\n\n  self.init = function (oldModel) {\n    self.tableTemplateId(oldModel.tableTemplateId);\n  };\n}\nfunction CellSpecMenu() {\n  var self = this;\n  self.parent = ko.observable();\n  self.caption = ko.observable();\n  self.show = ko.observable(false);\n  self.nodeCount = ko.observable(0);\n  self.tableTemplateType = ko.observable();\n  self.cellAddress = \"\";\n  self.cellCount = \"\";\n  self.viewType = ko.observable();\n  self.xbrlConcept = ko.observable();\n  self.decimalPlaces = ko.observable();\n  self.dataType = ko.observable();\n  self.accountType = ko.observable();\n  self.valueSource = ko.observable();\n  self.groupType = ko.observable();\n  self.valueAccountType = ko.observable();\n  self.sortDirection = ko.observable();\n  self.negativeInParentheses = ko.observable(false);\n  self.negativeRedNumber = ko.observable(false);\n  self.zeroDisplay = ko.observable(1);\n  self.percent = ko.observable(false);\n  self.valueDisplay = ko.observable(false);\n  self.financialPeriod = ko.observable();\n  self.roundingApproach = ko.observable(1);\n\n  self.applyToTable = function (dataType, newValue) {\n    var record = self.parent().getFocusDesignRecord();\n    $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"command\", {\n      viewType: self.viewType(),\n      value: newValue,\n      id: dataType\n    });\n\n    _h.kocnx().ttvm().focusDesignItem().refreshToolBar(true);\n  };\n\n  self.roundingApproachsub = self.roundingApproach.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"roundingApproach\", newValue);\n  });\n  self.valueAccountTypesub = self.valueAccountType.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"valueAccountType\", newValue);\n  });\n  self.valueSourcesub = self.valueSource.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"valueSource\", newValue);\n  });\n  self.decimalPlacessub = self.decimalPlaces.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"decimals\", newValue);\n  });\n  self.dataTypesub = self.dataType.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"dataType\", newValue);\n  });\n  self.accountTypesub = self.accountType.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"accountType\", newValue);\n  });\n  self.financialPeriodsub = self.financialPeriod.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"financialPeriod\", newValue);\n  });\n  self.negativeInParenthesessub = self.negativeInParentheses.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"minusParenthese\", newValue);\n  });\n  self.negativeRedNumbersub = self.negativeRedNumber.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"minusRedText\", newValue);\n  });\n  self.percentsub = self.percent.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"percent\", newValue);\n  });\n  self.valueDisplaysub = self.valueDisplay.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"valueDisplay\", newValue);\n  });\n  self.groupTypesub = self.groupType.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"groupType\", newValue);\n  });\n  self.sortDirectionsub = self.sortDirection.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"sortDirection\", newValue);\n  });\n  self.zeroDisplaysub = self.zeroDisplay.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"zeroDisplay\", newValue);\n  });\n  self.sizeClass = ko.observable(\"col-lg-2 floating-menu\");\n\n  self.toggleNegativeInParentheses = function () {\n    self.negativeInParentheses(!self.negativeInParentheses());\n  };\n\n  self.toggleNegativeRedNumber = function () {\n    self.negativeRedNumber(!self.negativeRedNumber());\n  };\n\n  self.togglePercent = function () {\n    self.percent(!self.percent());\n  };\n\n  self.toggleXbrlConcept = function () {\n    self.applyToTable(\"xbrlConcept\", false);\n  };\n\n  self.init = function (option) {\n    self.show(true);\n    self.viewType(option.viewType);\n    self.parent(option.parent);\n    self.tableTemplateType(option.templateTableType);\n    self.nodeCount(option.nodeCount);\n    var cell = option.cell;\n\n    switch (option.viewType) {\n      case \"cell\":\n        self.caption(\"خصوصیات سلول\");\n        self.sizeClass(\"col-lg-3 floating-menu cell-spec-menu\");\n        self.toggleSuspendPageControls(true);\n        self.decimalPlaces(cell.extraParams.decimals);\n        self.dataType(cell.extraParams.dataType);\n        self.accountType(cell.extraParams.accountType);\n        self.financialPeriod(cell.extraParams.financialPeriod);\n        self.negativeInParentheses(cell.extraParams.minusParenthese);\n        self.zeroDisplay(cell.extraParams.zeroDisplay);\n        self.negativeRedNumber(cell.extraParams.minusRedText);\n        self.percent(cell.extraParams.percent);\n        self.valueDisplay(cell.extraParams.valueDisplay);\n        self.valueSource(cell.extraParams.valueSource);\n        self.valueAccountType(cell.extraParams.valueAccountType);\n        self.roundingApproach(cell.extraParams.roundingApproach);\n        if (cell.xbrlConcept) self.xbrlConcept(cell.xbrlConcept.title);\n        self.sortDirection(option.sortDirection);\n        self.groupType(option.groupType);\n        self.toggleSuspendPageControls(false);\n        self.cellAddress = cell.cellAddress;\n        break;\n\n      case \"cells\":\n        self.sizeClass(\"col-lg-3 floating-menu cell-spec-menu\");\n        self.caption(\"خصوصیات سلول ها\");\n        self.toggleSuspendPageControls(true);\n        self.financialPeriod(0);\n        self.roundingApproach(1);\n        self.decimalPlaces(0);\n        self.accountType(null);\n        self.valueSource(null);\n        self.valueAccountType(0);\n        self.dataType(null);\n        self.cellCount = \"\";\n        self.negativeInParentheses(false);\n        self.zeroDisplay(null);\n        self.negativeRedNumber(false);\n        self.percent(false);\n        self.valueDisplay(undefined);\n        self.toggleSuspendPageControls(false);\n        break;\n    }\n\n    self.toggleHeightMenu(option);\n    $(\".cell-spec-menu\").draggable({\n      scroll: true,\n      handle: \".cellspec-drag-handle\"\n    });\n  };\n\n  self.toggleHeightMenu = function (option) {\n    if (option.target) $(\".floating-menu\").position({\n      my: 'center top',\n      at: 'center bottom',\n      of: $(option.target),\n      offset: '0 5',\n      collision: 'fit'\n    });\n  };\n\n  self.toggleSuspendPageControls = function (sta) {\n    if (sta) {\n      self.negativeInParenthesessub.suspend();\n      self.zeroDisplaysub.suspend();\n      self.negativeRedNumbersub.suspend();\n      self.percentsub.suspend();\n      self.valueDisplaysub.suspend();\n      self.financialPeriodsub.suspend();\n      self.accountTypesub.suspend();\n      self.dataTypesub.suspend();\n      self.decimalPlacessub.suspend();\n      self.valueSourcesub.suspend();\n      self.valueAccountTypesub.suspend();\n      self.groupTypesub.suspend();\n      self.sortDirectionsub.suspend();\n      self.roundingApproachsub.suspend();\n    } else {\n      self.negativeInParenthesessub.unsuspend();\n      self.zeroDisplaysub.unsuspend();\n      self.negativeRedNumbersub.unsuspend();\n      self.percentsub.unsuspend();\n      self.valueDisplaysub.unsuspend();\n      self.financialPeriodsub.unsuspend();\n      self.accountTypesub.unsuspend();\n      self.dataTypesub.unsuspend();\n      self.decimalPlacessub.unsuspend();\n      self.valueSourcesub.unsuspend();\n      self.valueAccountTypesub.unsuspend();\n      self.groupTypesub.unsuspend();\n      self.sortDirectionsub.unsuspend();\n      self.roundingApproachsub.unsuspend();\n    }\n  };\n\n  self.hide = function () {\n    self.show(false);\n  };\n}\nfunction ContextMenu() {\n  var self = this;\n  self.show = ko.observable(false);\n  self.parent = ko.observable();\n  self.element = null;\n  self.caption = ko.observable();\n  self.textWrap = ko.observable(false);\n  self.viewType = ko.observable();\n  self.sortDirection = ko.observable();\n  self.regions = ko.observableArray();\n  self.width = ko.observable().extend({\n    formatSize: {\n      min: 5,\n      max: 1000\n    }\n  });\n  self.height = ko.observable().extend({\n    formatSize: {\n      min: 5,\n      max: 200\n    }\n  });\n\n  self.applyToTable = function (dataType, newValue, colNumber, rowNumber) {\n    self.parent().scope.find(\".rp-gen\").rg(\"command\", {\n      viewType: self.viewType(),\n      value: newValue,\n      id: dataType,\n      colNumber: colNumber,\n      rowNumber: rowNumber\n    });\n\n    _h.kocnx().ttvm().focusDesignItem().refreshToolBar(true);\n  };\n\n  self.textWrapsub = self.textWrap.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"textWrap\", newValue, self.colNumber, undefined);\n  });\n  self.heightsub = self.height.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"height\", newValue, undefined, self.rowNumber);\n  });\n  self.widthsub = self.width.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"width\", newValue, self.colNumber, undefined);\n  });\n  self.sortDirectionsub = self.sortDirection.supsendableSubscribe(function (newValue) {\n    self.applyToTable(\"colSortDirection\", newValue, self.colNumber);\n  });\n\n  self.addRegion = function () {\n    self.regions.push(new CellRegion({}, self));\n  };\n\n  self.removeRegion = function (item) {\n    self.regions.remove(item);\n    self.subscribeRegions();\n  };\n\n  self.subscribeRegions = function (data) {\n    var array = [];\n\n    for (var i = 0; i < self.regions().length; i++) {\n      var start = self.regions()[i].start() ? Number(self.regions()[i].start()) : undefined;\n      var end = self.regions()[i].end() ? Number(self.regions()[i].end()) : undefined;\n      array.push({\n        start: start,\n        end: end\n      });\n    }\n\n    var filtered = array.filter(function (a) {\n      return !_h.isEmpty(a.start) && !_h.isEmpty(a.end);\n    });\n    self.applyToTable(\"region\", filtered, self.colNumber, undefined);\n  };\n\n  self.init = function (option) {\n    self.show(true);\n    self.viewType(option.viewType);\n    self.parent(option.parent);\n    self.element = option.element;\n    self.colNumber = option.colNumber;\n    self.rowNumber = option.rowNumber;\n\n    switch (option.viewType) {\n      case \"col\":\n        self.caption(\"تنظیمات ستون\");\n        self.toggleSuspendPageControls(true);\n        self.textWrap(option.textWrap);\n        self.width(option.width);\n        self.sortDirection(option.sortDirection);\n        self.regions.removeAll();\n        if (_h.any(option.regions)) for (var i = 0; i < option.regions.length; i++) {\n          var rec = new CellRegion(option.regions[i], self);\n          self.regions.push(rec);\n        }\n        self.toggleSuspendPageControls(false);\n        break;\n\n      case \"row\":\n        self.caption(\"تنظیمات سطر\");\n        self.toggleSuspendPageControls(true);\n        self.height(option.height);\n        self.toggleSuspendPageControls(false);\n        break;\n\n      case \"cross\":\n        self.caption(\"تنظیمات سطر و ستون\");\n        self.toggleSuspendPageControls(true);\n        self.width(option.width);\n        self.height(option.height);\n        self.toggleSuspendPageControls(false);\n        break;\n    }\n\n    self.toggleHeightMenu(option);\n  };\n\n  self.toggleTextWrap = function () {\n    self.textWrap(!self.textWrap());\n  };\n\n  self.toggleHeightMenu = function (option) {\n    $(\".rg-cotext-menu\").position({\n      my: 'center top',\n      at: 'center bottom',\n      of: $(option.element),\n      offset: '0 5',\n      collision: 'fit'\n    });\n  };\n\n  self.toggleSuspendPageControls = function (sta) {\n    if (sta) {\n      self.widthsub.suspend();\n      self.textWrapsub.suspend();\n      self.heightsub.suspend();\n      self.sortDirectionsub.suspend();\n    } else {\n      self.heightsub.unsuspend();\n      self.textWrapsub.unsuspend();\n      self.widthsub.unsuspend();\n      self.sortDirectionsub.unsuspend();\n    }\n  };\n}\nfunction NodeValue(model, parent, pageNumber) {\n  var self = this;\n  self.parent = parent;\n  self.pageNumber = pageNumber;\n  self.isDisabled = ko.observable(false);\n  self.code = model.code;\n  self.title = model.title;\n  self.type = model.type;\n  self.operator = ko.observable(model.operator);\n  self.operator.subscribe(function (value) {\n    if (!_h.isEmpty(value)) self.parent.changeOperator();\n  });\n}\nfunction InfoDropDown(parent) {\n  var self = this;\n  self.show = ko.observable(false);\n  self.list = ko.observableArray();\n  self.parentForm = parent;\n\n  self.init = function () {\n    self.pageNumber(1);\n    self.pageNumberStr(1);\n    self.showPaggingMenu(false);\n    self.total(0);\n    self.pageNumbers([]);\n    var list = self.parentForm.scope.find(\".rp-gen\").rg(\"getCellValues\");\n    var pagenumber = 1;\n    self.total(list.length);\n    if (list && list.length) for (var i = 0; i < list.length; i++) {\n      var div = (i + 1) / 12;\n      if (div > pagenumber) pagenumber = pagenumber + 1;\n      var item = new NodeValue(list[i], self, pagenumber);\n      self.list.push(item);\n    }\n    self.show(true);\n    self.operatorConfig();\n  };\n\n  self.refresh = function () {\n    self.show(false);\n    self.list.removeAll();\n    self.pageNumber(1);\n    self.pageNumberStr(1);\n    self.showPaggingMenu(false);\n    self.total(0);\n    self.pageNumbers([]);\n    var list = self.parentForm.scope.find(\".rp-gen\").rg(\"getCellValues\");\n    var pagenumber = 1;\n    self.total(list.length);\n\n    for (var i = 0; i < list.length; i++) {\n      var div = (i + 1) / 12;\n      if (div > pagenumber) pagenumber = pagenumber + 1;\n      var item = new NodeValue(list[i], self, pagenumber);\n      self.list.push(item);\n    }\n\n    self.show(true);\n    self.operatorConfig();\n  };\n\n  self.terminate = function () {\n    self.show(false);\n    self.list.removeAll();\n  };\n\n  self.removeItem = function (item) {\n    self.list.remove(item);\n    var list = self.prepareList();\n    var cell = self.parentForm.scope.find(\".rp-gen\").rg(\"setFormula\", {\n      id: \"NodeInCell\",\n      value: list\n    });\n    if (cell) self.parentForm.scope.find(\".txtFormula\").val(cell.value);else self.parentForm.scope.find(\".txtFormula\").val(\"\");\n    if (self.list().length === 0) self.show(false);\n    self.operatorConfig();\n  };\n\n  self.operatorConfig = function () {\n    if (self.list().length === 0) return;\n    if (self.list().length === 1) self.list()[0].isDisabled(true);else self.list()[self.list().length - 1].isDisabled(true);\n  };\n\n  self.changeOperator = function (item) {\n    var list = self.prepareList();\n    var cell = self.parentForm.scope.find(\".rp-gen\").rg(\"setFormula\", {\n      id: \"NodeInCell\",\n      value: list\n    });\n    self.parentForm.scope.find(\".txtFormula\").val(cell.value);\n  };\n\n  self.prepareList = function () {\n    var array = [];\n    if (_h.any(self.list())) for (var i = 0; i < self.list().length; i++) {\n      array.push({\n        code: self.list()[i].code,\n        title: self.list()[i].title,\n        type: self.list()[i].type,\n        operator: self.list()[i].operator()\n      });\n    }\n    return array;\n  };\n\n  self.pageNumbers = ko.observableArray([]);\n  self.pageSize = ko.observable(12);\n  self.pageNumber = ko.observable(1);\n  self.pageNumberStr = ko.observable(1);\n  self.showPaggingMenu = ko.observable(false);\n  self.total = ko.observable(0);\n\n  self.forward = function () {\n    self.pageNumber(self.pageNumber() + 1);\n  };\n\n  self.backward = function () {\n    if (self.pageNumber() > 1) {\n      self.pageNumber(self.pageNumber() - 1);\n    }\n  };\n\n  self.paggingMenu = ko.computed(function () {\n    self.pageNumberStr(self.pageNumber());\n    var pageCount = parseInt(self.total() / self.pageSize());\n\n    if (self.total() % self.pageSize() !== 0) {\n      pageCount += 1;\n    }\n\n    self.pageNumbers.removeAll();\n    var isActive;\n\n    if (pageCount < 2) {\n      self.showPaggingMenu(false);\n    } else if (pageCount < 100) {\n      for (var i = 0; i < pageCount; i++) {\n        isActive = self.pageNumber() === i + 1;\n        self.pageNumbers.push({\n          name: i + 1,\n          active: ko.observable(isActive)\n        });\n      }\n\n      self.showPaggingMenu(true);\n    } else if (pageCount > 100) {\n      self.pageNumbers.push({\n        name: pageCount - 2,\n        active: ko.observable(self.pageNumber() === pageCount - 2)\n      });\n      self.pageNumbers.push({\n        name: pageCount - 1,\n        active: ko.observable(self.pageNumber() === pageCount - 1)\n      });\n      self.pageNumbers.push({\n        name: pageCount,\n        active: ko.observable(self.pageNumber() === pageCount)\n      });\n      self.showPaggingMenu(true);\n    }\n  });\n\n  self.paggingMenuItemClick = function (item) {\n    self.pageNumber(item.name);\n    return false;\n  };\n\n  self.onClickPageNumberStr = function (d, e) {\n    var number = Number(self.pageNumberStr());\n    var pageCount = parseInt(self.total() / self.pageSize());\n\n    if (self.total() % self.pageSize() !== 0) {\n      pageCount += 1;\n    }\n\n    var res = false;\n\n    if (!_h.isNullOrEmpty(number) && number <= pageCount) {\n      self.pageNumber(number);\n      res = true;\n    }\n\n    if (res && self.pageNumbers().length) {\n      for (var i = 0; i < self.pageNumbers().length; i++) {\n        if (self.pageNumbers()[i].name === number) self.pageNumbers()[i].active(true);else self.pageNumbers()[i].active(false);\n      }\n    }\n  };\n}\nfunction RpSetting() {\n  var self = this;\n  self.autoSave = ko.observable(0);\n\n  self.setItems = function () {\n    clientStorage.setSetting({\n      key: \"RepGenAutoSave\",\n      value: self.autoSave()\n    });\n\n    if (!_h.isEmpty(autoSave) && autoSave !== \"null\" && autoSave !== \"0\" && autoSave !== 0) {\n      var time = Number(autoSave) * 1000;\n      self.removeTimers();\n      self.initTimers(time);\n    } else {\n      self.removeTimers();\n    }\n  };\n\n  self.saveinterval = null;\n\n  self.init = function () {\n    var autoSave = clientStorage.getSetting(\"RepGenAutoSave\");\n\n    if (!_h.isEmpty(autoSave) && autoSave !== \"null\" && autoSave !== \"0\" && autoSave !== 0) {\n      self.autoSave(Number(autoSave));\n      var time = Number(autoSave) * 1000;\n      self.initTimers(time);\n    }\n  };\n\n  self.initTimers = function (time) {\n    self.saveinterval = setInterval(function () {\n      var record = _h.kocnx().ttvm().getFocusDesignRecord();\n\n      if (record) {\n        var arrayData = $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"toServer\");\n        var model = arrayData[0];\n\n        _h.kocnx().ttvm().saveChanges(model, function (dataRes) {\n          if (dataRes !== false) {\n            if (_h.any(dataRes.bindErrors)) $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"setWarning\", dataRes.bindErrors);\n            if (_h.any(dataRes.cellsTag)) $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"refreshCellsTag\", dataRes.cellsTag);\n          }\n        });\n      }\n    }, time);\n  };\n\n  self.removeTimers = function () {\n    if (!_h.isNullOrEmpty(self.saveinterval)) {\n      clearInterval(self.saveinterval);\n      self.saveinterval = null;\n    }\n  };\n}\nvar CustomStyleCategory = /*#__PURE__*/function (_BaseInnerModel2) {\n  _inherits(CustomStyleCategory, _BaseInnerModel2);\n\n  var _super5 = _createSuper(CustomStyleCategory);\n\n  function CustomStyleCategory(model) {\n    var _this5;\n\n    _classCallCheck(this, CustomStyleCategory);\n\n    _this5 = _super5.call(this, model);\n    _this5.isCustom = ko.observable(false);\n    _this5.styles = ko.observableArray(model.styles);\n    return _this5;\n  }\n\n  return _createClass(CustomStyleCategory);\n}(BaseInnerModel);\nvar CustomStyle = /*#__PURE__*/function (_BaseInfoModel) {\n  _inherits(CustomStyle, _BaseInfoModel);\n\n  var _super6 = _createSuper(CustomStyle);\n\n  function CustomStyle(model) {\n    var _this6;\n\n    _classCallCheck(this, CustomStyle);\n\n    _this6 = _super6.call(this, model);\n    _this6.showPanel = ko.observable(false);\n    return _this6;\n  }\n\n  _createClass(CustomStyle, [{\n    key: \"togglePanel\",\n    value: function togglePanel() {\n      this.showPanel(!this.showPanel());\n    }\n  }]);\n\n  return CustomStyle;\n}(BaseInfoModel);\nvar CustomStyleForm = /*#__PURE__*/function (_BaseSecondaryForm) {\n  _inherits(CustomStyleForm, _BaseSecondaryForm);\n\n  var _super7 = _createSuper(CustomStyleForm);\n\n  function CustomStyleForm(viewModel, model) {\n    var _this7;\n\n    _classCallCheck(this, CustomStyleForm);\n\n    _this7 = _super7.call(this, viewModel, [{\n      name: \"backColor\",\n      type: \"ob\"\n    }, {\n      name: \"textColor\",\n      type: \"ob\"\n    }, {\n      name: \"titleStyle\",\n      type: \"ob\"\n    }, {\n      name: \"textAlign\",\n      type: \"\",\n      val: model.textAlign\n    }, {\n      name: \"textBold\",\n      type: \"\",\n      val: model.textBold\n    }, {\n      name: \"textItalic\",\n      type: \"\",\n      val: model.textItalic\n    }, {\n      name: \"textUnderline\",\n      type: \"\",\n      val: model.textUnderline\n    }, {\n      name: \"textFontFamily\",\n      type: \"\",\n      val: model.textFontFamily\n    }, {\n      name: \"textFontSize\",\n      type: \"\",\n      val: model.textFontSize\n    }, {\n      name: \"textWrap\",\n      type: \"\",\n      val: model.textWrap\n    }, {\n      name: \"borderStyle\",\n      type: \"\",\n      val: model.borderStyle\n    }, {\n      name: \"borderWidth\",\n      type: \"\",\n      val: model.borderWidth\n    }, {\n      name: \"borderColor\",\n      type: \"\",\n      val: model.borderColor\n    }], \"CustomStyleCaption\");\n\n    if (!_h.isEmpty(model.backColor)) {\n      var backColor = _h.toHex3(model.backColor);\n\n      _this7.backColor(backColor);\n    }\n\n    if (!_h.isEmpty(model.textColor)) {\n      var textColor = _h.toHex3(model.textColor);\n\n      _this7.textColor(textColor);\n    }\n\n    _this7.setValidationObject();\n\n    _this7.createForm();\n\n    return _this7;\n  }\n\n  _createClass(CustomStyleForm, [{\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      this.validationObject = ko.validatedObservable({\n        titleStyle: this.titleStyle.extend({\n          required: true,\n          minLength: 3,\n          maxLength: 20\n        })\n      });\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      var _ref;\n\n      return _ref = {\n        id: _h.generateUuid(),\n        backColor: this.backColor(),\n        borderColor: this.borderColor,\n        borderStyle: this.borderStyle\n      }, _defineProperty(_ref, \"borderColor\", this.borderColor), _defineProperty(_ref, \"borderWidth\", this.borderWidth), _defineProperty(_ref, \"textAlign\", this.textAlign), _defineProperty(_ref, \"textBold\", this.textBold), _defineProperty(_ref, \"textColor\", this.textColor()), _defineProperty(_ref, \"textFontFamily\", this.textFontFamily), _defineProperty(_ref, \"textFontSize\", this.textFontSize), _defineProperty(_ref, \"textItalic\", this.textItalic), _defineProperty(_ref, \"textUnderline\", this.textUnderline), _defineProperty(_ref, \"textWrap\", this.textWrap), _defineProperty(_ref, \"title\", this.titleStyle()), _ref;\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'txb',\n        val: this.titleStyle\n      }, null, true, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'createFormBtn',\n            vis: true,\n            click: this.parentVM.addCustomStyle\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return CustomStyleForm;\n}(BaseSecondaryForm);\nfunction CustomStyleMenu() {\n  var self = this;\n  self.show = ko.observable(false);\n  self.caption = ko.observable(false);\n  self.cellStyles = ko.observableArray();\n\n  self.fillCellStyle = function (id) {\n    var cellStyles = [{\n      category: \"مالی و پولی\",\n      styles: [{\n        id: -1,\n        title: \"جمع میانی 1\",\n        textColor: \"\",\n        backColor: \"#ffb886\",\n        textAlign: \"\",\n        textBold: true,\n        textItalic: false,\n        textUnderline: false,\n        textFontFamily: \"\",\n        textFontSize: \"\",\n        borderStyle: \"solid none solid none\",\n        borderWidth: \"1px 0px 1px 0px\",\n        borderColor: \"#ff842d #ffffff #ff842d #ffffff\"\n      }, {\n        id: -1,\n        title: \"جمع میانی 2\",\n        textColor: \"\",\n        backColor: \"#ffffff\",\n        textAlign: \"\",\n        textBold: true,\n        textItalic: false,\n        textUnderline: false,\n        textFontFamily: \"\",\n        textFontSize: \"\",\n        borderStyle: \"solid none solid none\",\n        borderWidth: \"1px 0px 1px 0px\",\n        borderColor: \"#000000 #ffffff #000000 #ffffff\"\n      }, {\n        id: -1,\n        title: \"جمع نهایی 1\",\n        textColor: \"\",\n        backColor: \"#ffb886\",\n        textBold: true,\n        textItalic: false,\n        textUnderline: false,\n        textFontFamily: \"\",\n        textFontSize: \"\",\n        borderStyle: \"solid none double none\",\n        borderWidth: \"1px 4px 3px 4px\",\n        borderColor: \"#ff842d #ffffff #ff842d #ffffff\"\n      }, {\n        id: -1,\n        title: \"جمع نهایی 2\",\n        textColor: \"\",\n        backColor: \"#ffffff\",\n        textBold: true,\n        textItalic: false,\n        textUnderline: false,\n        textFontFamily: \"\",\n        textFontSize: \"\",\n        borderStyle: \"solid none double none\",\n        borderWidth: \"1px 4px 3px 4px\",\n        borderColor: \"#000000 #ffffff #000000 #ffffff\"\n      }]\n    }, {\n      category: \"سرتیتر و عنوان\",\n      styles: [{\n        id: -1,\n        title: \"ستون عنوان\",\n        textColor: \"\",\n        backColor: \"#cecece\",\n        textAlign: \"center\",\n        textBold: false,\n        textItalic: false,\n        textUnderline: false,\n        textFontFamily: \"\",\n        textFontSize: \"\",\n        borderStyle: \"solid solid solid solid\",\n        borderWidth: \"1px 4px 1px 4px\",\n        borderColor: \"#ffffff #ffffff #808080 #ffffff\"\n      }]\n    }];\n    self.cellStyles.removeAll();\n\n    for (var i = 0; i < cellStyles.length; i++) {\n      var target = cellStyles[i];\n      var record = new CustomStyleCategory(target);\n      self.cellStyles.push(record);\n    }\n\n    var customStyles = new CustomStyleCategory({\n      category: \"استایل سفارشی\"\n    });\n    customStyles.isCustom(true);\n    var list = clientStorage.getSetting(\"CustomStyles\");\n\n    if (list) {\n      if (_h.any(list)) for (var j = 0; j < list.length; j++) {\n        var rec = new CustomStyle(list[j]);\n        if (!id || id !== list[j].id) customStyles.styles.push(rec);\n      }\n    }\n\n    self.cellStyles.push(customStyles);\n  };\n\n  self.addCustomStyleBtn = function () {\n    var record = _h.kocnx().ttvm().getFocusDesignRecord();\n\n    self.selectedCells = $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"getSelectedCells\");\n\n    if (self.selectedCells.length === 1) {\n      _h.kocnx().openForm(new CustomStyleForm(self, self.selectedCells[0].style));\n    }\n  };\n\n  self.addCustomStyle = function (parents, btnModel, e) {\n    var item = parents[1];\n\n    if (!item.validationObject.isValid()) {\n      item.validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    var model = item.toServer();\n    var customStyles;\n\n    for (var i = 0; i < self.cellStyles().length; i++) {\n      var item = self.cellStyles()[i];\n\n      if (item.isCustom()) {\n        customStyles = item;\n      }\n    }\n\n    if (customStyles) {\n      var rec = new CustomStyle(model);\n      customStyles.styles.push(rec);\n    }\n\n    _h.kocnx().closeForm();\n\n    self.changeList();\n  };\n\n  self.deleteCustomStyle = function (item) {\n    var confirmText = toast.createMessage(\"CustomStyle\", 'del', null, 'confirm');\n\n    _h.confirmDeleteAlert(confirmText, function (res) {\n      if (res) {\n        self.fillCellStyle(item.id);\n        self.changeList();\n      }\n    });\n  };\n\n  self.changeList = function () {\n    var list = [],\n        customStyles;\n\n    for (var i = 0; i < self.cellStyles().length; i++) {\n      var item = self.cellStyles()[i];\n\n      if (item.isCustom()) {\n        customStyles = item;\n      }\n    }\n\n    list = ko.toJS(customStyles.styles());\n    clientStorage.setSetting([{\n      key: \"CustomStyles\",\n      value: list\n    }]);\n  };\n\n  self.applyCustomStyle = function (parent, command, model) {\n    var record = _h.kocnx().ttvm().getFocusDesignRecord();\n\n    $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"command\", {\n      id: \"cellStyle\",\n      value: model\n    });\n\n    _h.kocnx().ttvm().focusDesignItem().refreshToolBar(true);\n\n    _h.kocnx().ttvm().focusDesignItem().refreshToolBar(false);\n  };\n}\nfunction RgMenu(parent) {\n  var self = this;\n  self.parentModel = parent;\n  self.treeDataSource = ko.observable(new TreeInfoViewModel());\n  self.tableDataSource = ko.observable(new TableInfoViewModel(self));\n  self.cellSelectModel = ko.observable(new CellSelectForm());\n  self.xbrlConceptModel = ko.observable(new XbrlConceptViewModel());\n  self.showTableDataSource = ko.observable(false);\n  self.showTreeDataSource = ko.observable(false);\n  self.showXbrlConcept = ko.observable(false);\n  self.showPreview = ko.observable(false);\n  self.showConsolidate = ko.observable(false);\n  self.showCompare = ko.observable(false);\n  self.showCellSelect = ko.observable(false);\n  self.showInfo = ko.observable(false);\n  self.childInfoModel = ko.observable();\n  self.compareCellModel = ko.observable();\n  self.companySelectList = ko.observableArray();\n  self.companiesFiltered = ko.observableArray();\n  self.companySearchKey = ko.observable();\n  self.companySearchKey.subscribe(function (value) {\n    if (_h.isEmpty(value)) {\n      //var allCompanies = ko.toJS(self.companySelectList());\n      self.companiesFiltered(self.companySelectList().slice());\n    } else {\n      self.companiesFiltered.removeAll();\n\n      for (var i = 0; i < self.companySelectList().length; i++) {\n        var isValueMultiPart = value.indexOf(\" \") !== -1;\n\n        if (!isValueMultiPart) {\n          if (self.checkWordInCompanies(self.companySelectList()[i], value)) self.companiesFiltered.push(self.companySelectList()[i]);\n        } else {\n          var splits = value.split(\" \");\n          var result = false;\n\n          for (var j = 0; j < splits.length; j++) {\n            if (!_h.isEmpty(splits[j]) && self.checkWordInCompanies(self.companySelectList()[i], splits[j])) {\n              result = result || true;\n            }\n          }\n\n          if (result) self.companiesFiltered.push(self.companySelectList()[i]);\n        }\n      }\n    }\n\n    self.configConsolidate();\n  });\n\n  self.checkWordInCompanies = function (company, value) {\n    return company.text().indexOf(value) !== -1;\n  };\n\n  self.configConsolidate = function () {\n    var items = document.getElementsByClassName(\"consolidate-item\");\n\n    if (items && items.length) {\n      for (var i = 0; i < items.length; i++) {\n        items[i].addEventListener('dragstart', function (event) {\n          var img = this.getElementsByTagName(\"img\")[0];\n          var model = {\n            id: this.getAttribute(\"data-id\"),\n            name: this.getAttribute(\"data-name\"),\n            isRoot: this.getAttribute(\"data-root\")\n          };\n          event.dataTransfer.setData('application/json', JSON.stringify({\n            action: \"consolidate\",\n            model: model\n          }));\n          event.dataTransfer.setDragImage(img, 30, 0);\n        });\n\n        items[i].ondragover = function (e) {\n          e.preventDefault();\n        };\n\n        items[i].ondragleave = function (e) {\n          e.preventDefault();\n        };\n\n        items[i].ondragend = function (e) {\n          e.preventDefault();\n        };\n      }\n    }\n  };\n\n  self.getCompanySelectList = function () {\n    var model = _h.kocnx().ttvm().getFocusDesignRecord();\n\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__.ApiService.request({\n      url: \"/api/tablestructure/getconsolidated\",\n      data: {\n        id: model.id\n      },\n      success: function success(data) {\n        self.companySelectList.removeAll();\n        self.companiesFiltered.removeAll();\n\n        if (_h.any(data)) {\n          for (var j = 0; j < data.length; j++) {\n            var target = data[j];\n            self.companySelectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_0__.CompanySelectItem(target));\n            self.companiesFiltered.push(new _master_model__WEBPACK_IMPORTED_MODULE_0__.CompanySelectItem(target));\n          }\n\n          self.configConsolidate();\n        }\n      },\n      error: function error(data) {\n        toast.error(self.entityName, 'getSelectList', 'Consolidated');\n      }\n    });\n  };\n\n  self.toggleConsolidate = function () {\n    self.showConsolidate(!self.showConsolidate());\n\n    if (self.showConsolidate()) {\n      self.getCompanySelectList();\n      $(\".consolidate-box\").draggable({\n        scroll: true,\n        handle: \".consolidate-drag-handle\"\n      });\n    }\n  };\n\n  self.toggleTableDataSource = function () {\n    self.showTableDataSource(!self.showTableDataSource());\n\n    if (self.showTableDataSource()) {\n      self.tableDataSource().init({});\n      $(\".datasource-box\").draggable({\n        scroll: true,\n        handle: \".tabledatasource-drag-handle\"\n      });\n    }\n  };\n\n  self.toggleTreeDataSource = function () {\n    if (self.showTreeDataSource()) {\n      self.treeDataSource().collectOpenBranches();\n    }\n\n    self.showTreeDataSource(!self.showTreeDataSource());\n\n    if (self.showTreeDataSource()) {\n      self.treeDataSource().init();\n      $(\".datasource-box\").draggable({\n        scroll: true,\n        handle: \".treedatasource-drag-handle\"\n      });\n    }\n  };\n\n  self.toggleXbrlConcept = function () {\n    if (self.showXbrlConcept()) {\n      self.xbrlConceptModel().collectOpenBranches();\n    }\n\n    self.showXbrlConcept(!self.showXbrlConcept());\n\n    if (self.showXbrlConcept()) {\n      self.xbrlConceptModel().init();\n      $(\".xbrlconcept-box\").draggable({\n        scroll: true,\n        handle: \".xbrlconcept-drag-handle\"\n      });\n    }\n  };\n\n  self.togglePreview = function (vm, e) {\n    if ($(e.currentTarget).attr(\"locked\")) return;\n    self.showPreview(!self.showPreview());\n    var designItem = self.parentModel.findFocusDesignItem();\n    if (!designItem) return;\n\n    if (self.showPreview()) {\n      $(e.currentTarget).attr(\"locked\", \"true\");\n      var templateModel = self.parentModel.getFocusDesignRecord();\n      var arrayData = $(\"#rg-\" + templateModel.id).find(\".rp-gen\").rg(\"toServer\");\n      self.showTableDataSource(false);\n      self.showTreeDataSource(false);\n      self.showConsolidate(false);\n      _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__.ApiService.request({\n        url: \"/api/tabletemplate/postPreview\",\n        data: {\n          tableTemplateId: templateModel.id,\n          data: arrayData[0]\n        },\n        success: function (data) {\n          if (!_h.isEmpty(data)) {\n            $(e.currentTarget).attr(\"locked\", \"\");\n            designItem.previewMode(false);\n            designItem.previewResult = data.models;\n            designItem.hiddenRows = data.hiddenRows;\n            designItem.hiddenCols = data.hiddenCols;\n            designItem.bindErrors = data.bindErrors;\n            designItem.previewMode(true);\n          }\n        }.bind(this),\n        error: function error() {\n          $(e.currentTarget).attr(\"locked\", \"\");\n          toast.error(\"TableTemplate\", 'get', \"Preview\");\n        }\n      });\n    } else {\n      self.saveState();\n      designItem.previewMode(false);\n    }\n  };\n\n  self.toggleCompareValueCell = function () {\n    var context = _h.kocnx();\n\n    var templateModel = context.ttvm().getFocusDesignRecord();\n    var cellBinds = $(\"#rg-\" + templateModel.id).rg(\"getCellBinds\");\n\n    if (self.showCompare()) {\n      var list = [];\n      if (self.compareCellModel().cellBinds().length) for (var i = 0; i < self.compareCellModel().cellBinds().length; i++) {\n        var target = self.compareCellModel().cellBinds()[i];\n\n        if (target.validationObject.isValid()) {\n          var record = {\n            title: target.title(),\n            firstCell: target.firstCell(),\n            deterrent: target.deterrent(),\n            secondCell: target.secondCell(),\n            errorRate: target.errorRate()\n          };\n          list.push(record);\n        }\n      }\n      $(\"#rg-\" + templateModel.id).rg(\"setCellBinds\", list);\n      self.compareCellModel().selectedItem(null);\n      self.showCompare(!self.showCompare());\n    } else {\n      var cCell = new CellBindForm();\n      self.compareCellModel(cCell);\n      self.compareCellModel().init({\n        parent: templateModel,\n        gParent: self,\n        cellBinds: cellBinds,\n        id: templateModel.id\n      });\n      self.showCompare(!self.showCompare());\n      $(\".compare-value-cell-box\").draggable({\n        scroll: true,\n        handle: \".compare-value-drag-handle\"\n      });\n    }\n  };\n\n  self.toggleCellSelect = function () {\n    if (self.showCellSelect()) self.showCellSelect(false);else {\n      if (self.hasSelectedCell()) {\n        self.showCellSelect(true);\n        self.cellSelectModel().filterList();\n        $(\".select-cell-box\").draggable({\n          scroll: true,\n          handle: \".selectcell-drag-handle\"\n        });\n      } else toast.custom(\"error\", \"لطفا سلولی از جدول  را جهت اتصال انتخاب نمایید\");\n    }\n  };\n\n  self.onSelectCellAction = function (cell) {\n    var designItem = context.ttvm().findFocusDesignItem();\n    $(\"#rg-\" + designItem.value()).find(\".rp-gen\").rg(\"command\", {\n      id: \"cellSelect\",\n      value: cell.tag,\n      title: self.cellSelectModel().templateName() + \"(\" + cell.address + \")\"\n    });\n  };\n\n  self.hasSelectedCell = function () {\n    var context = _h.kocnx();\n\n    var designItem = context.ttvm().findFocusDesignItem();\n    var selectedItems = $(\"#rg-\" + designItem.value()).find(\".rp-gen\").rg(\"getSelectedCells\");\n    if (!selectedItems || selectedItems.length === 0) return false;\n    return true;\n  };\n\n  self.toolItemDragFunctionality = function () {\n    var items = document.getElementsByClassName(\"tool-item\");\n\n    if (items && items.length) {\n      for (var i = 0; i < items.length; i++) {\n        items[i].addEventListener('dragstart', function (event) {\n          var img = this.getElementsByTagName(\"img\")[0];\n          event.dataTransfer.setData('application/json', JSON.stringify({\n            action: \"sign\",\n            actionType: this.getAttribute(\"data-action\")\n          }));\n          event.dataTransfer.setDragImage(img, 20, 0);\n        }, false);\n        items[i].addEventListener('dragover', function (event) {\n          event.preventDefault();\n        }, false);\n        items[i].addEventListener('dragleave', function (event) {\n          event.preventDefault();\n        }, false);\n        items[i].addEventListener('dragend', function (event) {\n          event.preventDefault();\n        }, false);\n      }\n    }\n  };\n\n  self.toggleShowInfo = function () {\n    if (!self.showInfo()) {\n      self.childInfoModel(new RgMenuInfo());\n      self.showInfo(true);\n      self.childInfoModel().init();\n    } else {\n      self.showInfo(false);\n      self.childInfoModel(null);\n    }\n  };\n\n  self.resetWindows = function () {\n    self.showTableDataSource(false);\n    self.showTreeDataSource(false);\n    self.showConsolidate(false);\n    self.showPreview(false);\n    self.showCompareValueCell(false);\n  };\n\n  self.saveState = function () {\n    var model = {\n      treeOpenBranches: self.treeDataSource().treeOpenBranches,\n      treeId: self.treeDataSource().treeId(),\n      periodId: self.treeDataSource().periodId(),\n      nodeDisplayType: self.treeDataSource().nodeDisplayType(),\n      tableId: self.tableDataSource().tableId()\n    };\n\n    if (self.cellSelectModel()) {\n      model.tableTemplateId = self.cellSelectModel().tableTemplateId();\n    }\n\n    clientStorage.setSetting([{\n      key: \"RgMenu_\",\n      value: JSON.stringify(model)\n    }]);\n  };\n\n  self.loadState = function () {\n    model = self.readstate();\n\n    if (model.periodId && model.treeId) {\n      self.treeDataSource().init(model);\n    }\n\n    if (model.tableId) {\n      self.tableDataSource().init(model);\n    }\n\n    if (model.tableTemplateId) {\n      self.cellSelectModel().init(model);\n    }\n\n    return model;\n  };\n\n  self.readstate = function () {\n    var context = _h.kocnx();\n\n    var model = {};\n    var data = clientStorage.getSetting(\"RgMenu_\" + context.loginCompanyId());\n\n    if (!_h.isEmpty(data)) {\n      model = JSON.parse(data);\n    }\n\n    return model;\n  };\n\n  self.init = function () {\n    self.loadState();\n  };\n\n  self.init();\n\n  self.closeAllModals = function () {\n    if (self.showPreview()) {\n      self.saveState();\n      var designItem = self.parentModel.findFocusDesignItem();\n      designItem.previewMode(false);\n      self.showPreview(false);\n    }\n\n    if (self.showXbrlConcept()) {\n      self.xbrlConceptModel().collectOpenBranches();\n      self.showXbrlConcept(false);\n    }\n\n    if (self.showCompare()) {\n      self.showCompare(false);\n      self.compareCellModel().selectedItem(null);\n    }\n\n    if (self.showConsolidate()) self.showConsolidate(false);\n\n    if (self.showInfo()) {\n      self.showInfo(false);\n      self.childInfoModel(null);\n    }\n\n    if (self.showTreeDataSource()) {\n      self.treeDataSource().collectOpenBranches();\n      self.showTreeDataSource(false);\n    }\n\n    if (self.showTableDataSource()) {\n      self.showTableDataSource(false);\n    }\n\n    if (self.showCellSelect()) self.showCellSelect(false);\n  };\n}\nvar ActionMenu = /*#__PURE__*/function (_BaseInnerModel3) {\n  _inherits(ActionMenu, _BaseInnerModel3);\n\n  var _super8 = _createSuper(ActionMenu);\n\n  function ActionMenu(model) {\n    var _this8;\n\n    _classCallCheck(this, ActionMenu);\n\n    _this8 = _super8.call(this, model);\n    _this8.show = ko.observable(model.inner ? false : true);\n    _this8.header = model.header;\n    _this8.inner = model.inner;\n    _this8.iconAddr = '/App/src/images/Icons/' + model.icon + \".png\";\n\n    switch (model.icon) {\n      case 33:\n      case 34:\n      case 35:\n        _this8.iconAddr = '/App/src/images/Icons/' + model.icon + '/' + model.value + \".png\";\n        break;\n    }\n\n    _this8.actionName = ko.observable(model.name || model.title);\n    _this8.oldPattern = \"\";\n    _this8.value = ko.observable(model.value);\n    _this8.pattern = ko.observable(model.pattern);\n\n    _this8.pattern.subscribe(function (value) {\n      if (_h.isEmpty(value)) {\n        this.pattern(this.oldPattern);\n      }\n    }.bind(_assertThisInitialized(_this8)));\n\n    _this8.changeToDefualt = function () {\n      this.pattern(this.defaultValue());\n    };\n\n    return _this8;\n  }\n\n  return _createClass(ActionMenu);\n}(BaseInnerModel);\nvar SubMenu = /*#__PURE__*/function (_BaseInnerModel4) {\n  _inherits(SubMenu, _BaseInnerModel4);\n\n  var _super9 = _createSuper(SubMenu);\n\n  function SubMenu(model) {\n    var _this9;\n\n    _classCallCheck(this, SubMenu);\n\n    _this9 = _super9.call(this, model);\n    _this9.editMode = ko.observable(false);\n    _this9.actions = ko.observableArray();\n    if (_h.any(model.actions)) for (var j = 0; j < model.actions.length; j++) {\n      var action = model.actions[j];\n\n      _this9.actions.push(new ActionMenu(action));\n    }\n    return _this9;\n  }\n\n  _createClass(SubMenu, [{\n    key: \"onHeaderSelect\",\n    value: function onHeaderSelect(item) {\n      this.actions().filter(function (a) {\n        if (a.icon() === item.icon()) {\n          a.show(!a.show());\n        }\n      });\n    }\n  }]);\n\n  return SubMenu;\n}(BaseInnerModel);\nfunction RgMenuInfo() {\n  var self = this;\n  self.subMenuItems = ko.observableArray();\n\n  self.toolItemDragFunctionality = function () {\n    var items = document.getElementsByClassName(\"tool-item\");\n\n    if (items && items.length) {\n      for (var i = 0; i < items.length; i++) {\n        items[i].addEventListener('dragstart', function (event) {\n          var img = this.getElementsByTagName(\"img\")[0];\n          event.dataTransfer.setData('application/json', JSON.stringify({\n            action: \"sign\",\n            actionType: this.getAttribute(\"data-action\")\n          }));\n          event.dataTransfer.setDragImage(img, 20, 0);\n        }, false);\n        items[i].addEventListener('dragover', function (event) {\n          event.preventDefault();\n        }, false);\n        items[i].addEventListener('dragleave', function (event) {\n          event.preventDefault();\n        }, false);\n        items[i].addEventListener('dragend', function (event) {\n          event.preventDefault();\n        }, false);\n      }\n    }\n  };\n\n  self.selectSubMenu = function (item) {\n    if (item.selected() && item.actions().length > 0) {\n      item.selected(false);\n      return;\n    }\n\n    if (item.actions().length > 0) {\n      for (var i = 0; i < self.subMenuItems().length; i++) {\n        self.subMenuItems()[i].selected(false);\n      }\n\n      item.selected(true);\n    }\n  };\n\n  self.fillMenuItems = function () {\n    var context = _h.kocnx();\n\n    var designItem = context.ttvm().findFocusDesignItem();\n    self.getInfoMenuDataForm(function (list) {\n      var infoActions = [];\n\n      if (list) {\n        var c1 = false,\n            c2 = false,\n            c3 = false;\n\n        for (var i = 0; i < list.length; i++) {\n          var infoAction;\n\n          var info = _h.getEnumItem(cellInfoTypes, list[i].cellInfoType);\n\n          if (info.value !== 33 && info.value !== 34 && info.value !== 35) {\n            if (info.value !== 25) {\n              infoAction = {\n                name: list[i].title,\n                value: list[i].value,\n                icon: info.value,\n                action: \"info:'\" + info.value + \"'\",\n                defaultValue: list[i].defaultValue,\n                pattern: list[i].pattern,\n                oldPattern: list[i].pattern\n              };\n              infoActions.push(infoAction);\n            } else {\n              if (designItem.type() === 4) {\n                infoAction = {\n                  name: \"شماره سطر\",\n                  value: list[i].value,\n                  icon: 25,\n                  action: \"info:'25'\",\n                  defaultValue: list[i].defaultValue,\n                  pattern: list[i].pattern,\n                  oldPattern: list[i].pattern\n                };\n                infoActions.push(infoAction);\n              }\n            }\n          } else {\n            var action = \"\";\n\n            switch (info.value) {\n              case 33:\n                action = \"periodname:'\" + list[i].value + \"'\";\n\n                if (!c1) {\n                  c1 = true;\n                  infoActions.push({\n                    name: \"دوره مالی/مقایسه ای\",\n                    icon: 33,\n                    header: true,\n                    defaultValue: list[i].defaultValue,\n                    pattern: list[i].pattern,\n                    oldPattern: list[i].pattern,\n                    action: action,\n                    inner: false\n                  });\n                }\n\n                list[i].icon = 33;\n                list[i].action = action;\n                list[i].header = false;\n                list[i].inner = true;\n                infoActions.push(list[i]);\n                break;\n\n              case 34:\n                action = \"perioddate:'\" + list[i].value + \"'\";\n\n                if (!c2) {\n                  var _infoActions$push;\n\n                  c2 = true;\n                  infoActions.push((_infoActions$push = {\n                    name: \"تاریخ/دوره مقایسه ای\",\n                    icon: 34,\n                    header: true,\n                    action: action,\n                    defaultValue: list[i].defaultValue,\n                    pattern: list[i].pattern,\n                    oldPattern: list[i].pattern\n                  }, _defineProperty(_infoActions$push, \"action\", action), _defineProperty(_infoActions$push, \"inner\", false), _infoActions$push));\n                }\n\n                list[i].icon = 34;\n                list[i].action = action;\n                list[i].header = false;\n                list[i].inner = true;\n                infoActions.push(list[i]);\n                break;\n\n              case 35:\n                action = \"periodyear:'\" + list[i].value + \"'\";\n\n                if (!c3) {\n                  c3 = true;\n                  infoActions.push({\n                    name: \"تاریخ/سال مقایسه ای\",\n                    icon: 35,\n                    header: true,\n                    defaultValue: list[i].defaultValue,\n                    pattern: list[i].pattern,\n                    oldPattern: list[i].pattern,\n                    action: action,\n                    inner: false\n                  });\n                }\n\n                list[i].icon = 35;\n                list[i].action = action;\n                list[i].header = false;\n                list[i].inner = true;\n                infoActions.push(list[i]);\n                break;\n            }\n          }\n        }\n      }\n\n      self.subMenuItems.push(new SubMenu({\n        name: \"اطلاعات\",\n        selected: false,\n        actions: infoActions\n      }));\n      var actions = [];\n\n      if (designItem.type() !== 4) {\n        actions = [{\n          name: \"جمع کلی\",\n          icon: 11,\n          action: \"TotalSum\",\n          operator: \"Sum\"\n        }, {\n          name: \"جمع جزیی\",\n          icon: 12,\n          action: \"PartialSum\",\n          operator: \"Sum\"\n        }, {\n          name: \"میانگین\",\n          icon: 13,\n          action: \"Average\",\n          operator: \"Avg\"\n        }, {\n          name: \"بیشترین\",\n          icon: 14,\n          action: \"Max\",\n          operator: \"Max\"\n        }, {\n          name: \"کمترین\",\n          icon: 15,\n          action: \"Min\",\n          operator: \"Min\"\n        }];\n      } else {\n        actions = [{\n          name: \"جمع گروهی\",\n          icon: 26,\n          action: \"GroupSum\",\n          operator: \"GSum\"\n        }, {\n          name: \"جمع ستونی\",\n          icon: 27,\n          action: \"ColumnSum\",\n          operator: \"CSum\"\n        }];\n      }\n\n      self.subMenuItems.push(new SubMenu({\n        name: \"محاسبات\",\n        selected: false,\n        actions: actions\n      }));\n      self.toolItemDragFunctionality();\n    });\n  };\n\n  self.onEdit = function (item) {\n    item.editMode(true);\n    item.selected(true);\n  };\n\n  self.getInfoMenuDataForm = function (callback) {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__.ApiService.request({\n      url: \"/api/tablestructure/getcustomreportinfo\",\n      data: model,\n      success: function success(list) {\n        callback(list);\n      },\n      error: function error(data) {\n        callback(null);\n      }\n    });\n  };\n\n  self.setInfoMenuDataForm = function (item) {\n    var array = [];\n\n    for (var j = 0; j < item.actions().length; j++) {\n      var action = item.actions()[j];\n      array.push({\n        value: action.value(),\n        cellInfoType: action.icon(),\n        pattern: action.pattern()\n      });\n    }\n\n    var model = {\n      list: array\n    };\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_1__.ApiService.request({\n      url: \"/api/tablestructure/postcustomreportinfo\",\n      data: model,\n      success: function success(data) {\n        item.editMode(false);\n        toast.custom('success', 'عملیات بروزرسانی بخش اطلاعات با موفقیت انجام شد');\n        self.toolItemDragFunctionality();\n      },\n      error: function error(data) {\n        toast.custom('error', 'عملیات بروزرسانی بخش اطلاعات با خطا متوقف شد');\n      }\n    });\n  };\n\n  self.init = function () {\n    self.fillMenuItems();\n    setTimeout(function () {\n      $(\".left-menu-rg\").draggable({\n        scroll: true,\n        handle: \".left-menu-drag-handle\"\n      });\n    }, 150);\n  };\n}\nfunction DomChart(pa, newChart) {\n  var self = this;\n  self.parent = pa;\n  self.randomId = _h.createRandomNumber();\n  self.id = ko.observable(\"chart-\" + self.randomId);\n  self.showChart = ko.observable(false);\n  self.originalChartType = ko.observable();\n  self.chartType = ko.observable();\n  self.originalChartType = ko.observable();\n  self.dataSource = ko.observable();\n  self.left = ko.observable();\n  self.top = ko.observable();\n  self.width = ko.observable(350);\n  self.height = ko.observable(220);\n  self.colorPalette = ko.observable(\"palette1\");\n  self.series = ko.observableArray();\n  self.labels = ko.observableArray();\n  self.fontSize = ko.observable(\"12px\");\n  self.fontFamily = ko.observable(\"Nazanin\");\n  self.mixedMode = ko.observable(false);\n  self.legendPosition = ko.observable(1);\n  self.dataLabelColor = ko.observable(\"#000000\");\n  self.labelFontWeight = ko.observable(false);\n  self.chartObject = null;\n  self.options = {\n    series: [],\n    chart: {\n      type: \"bar\",\n      width: self.width(),\n      height: self.height(),\n      stacked: false,\n      animations: {\n        enabled: false\n      },\n      zoom: {\n        enabled: false\n      },\n      toolbar: {\n        show: false,\n        tools: {\n          download: false\n        }\n      },\n      events: {\n        legendClick: function legendClick(chartContext, seriesIndex, config) {}\n      }\n    },\n    theme: {\n      palette: \"palette1\"\n    },\n    title: {\n      display: ko.observable(true),\n      text: ko.observable(),\n      align: 'center',\n      style: {\n        fontSize: self.fontSize(),\n        fontFamily: self.fontFamily()\n      }\n    },\n    legend: {\n      show: ko.observable(true),\n      position: 'bottom',\n      fontFamily: self.fontFamily(),\n      onItemClick: {\n        toggleDataSeries: false\n      }\n    },\n    tooltip: {\n      enabled: false\n    },\n    dataLabels: {\n      enabled: ko.observable(false),\n      formatter: function formatter(val, opt) {\n        return _h.formatNumber(val, false);\n      },\n      style: {\n        fontFamily: self.fontFamily(),\n        fontWeight: \"bold\",\n        colors: [\"#000\"]\n      }\n    },\n    noData: {\n      text: 'داده ای برای نمایش وجود ندارد',\n      align: 'center',\n      verticalAlign: 'middle',\n      offsetX: 0,\n      offsetY: 0,\n      style: {\n        color: undefined,\n        fontSize: '13px',\n        fontFamily: \"IranSans\"\n      }\n    },\n    xaxis: {\n      categories: [],\n      labels: {\n        style: {\n          fontFamily: self.fontFamily()\n        }\n      }\n    },\n    yaxis: {\n      labels: {\n        style: {\n          fontFamily: self.fontFamily()\n        }\n      }\n    }\n  };\n\n  self.fillOptions = function (model) {\n    if (model) {\n      self.options.chart.width = self.width();\n      self.options.chart.height = self.height();\n      self.options.theme.palette = model.colorPalette;\n      self.options.title.text(model.options.title.text);\n      self.options.title.display(model.options.title.display);\n      self.options.legend.show(model.options.legend.show);\n      self.options.legend.position = model.options.legend.position;\n      self.options.dataLabels.enabled(model.options.dataLabels.enabled);\n\n      if (model.options.dataLabels[\"style\"]) {\n        self.options.dataLabels.style.fontFamily = self.fontFamily();\n        self.options.dataLabels.style.fontWeight = model.options.dataLabels.style.fontWeight || \"500\";\n\n        if (model.options.dataLabels.style.fontWeight === \"bold\") {\n          self.labelFontWeight(true);\n        }\n\n        self.options.dataLabels.style.colors = model.options.dataLabels.style.colors;\n      }\n\n      if (model.chartType === \"pie\") self.options.dataLabels.enabled(true);\n\n      switch (model.originalChartType) {\n        case \"bar\":\n          self.options.plotOptions = {\n            bar: {\n              horizontal: true,\n              columnWidth: \"55%\",\n              endingShape: \"rounded\"\n            }\n          };\n          break;\n\n        case \"column\":\n          self.options.plotOptions = {\n            bar: {\n              horizontal: false,\n              columnWidth: \"55%\",\n              endingShape: \"rounded\"\n            }\n          };\n          break;\n\n        case \"pie\":\n          self.options.dataLabels.enabled(true);\n          break;\n      }\n    }\n  };\n\n  self.fillModel = function (model) {\n    self.id(model.id);\n\n    if (_h.isEmpty(self.id())) {\n      self.randomId = _h.createRandomNumber();\n      self.id(\"chart-\" + self.randomId);\n    }\n\n    self.mixedMode(model.mixedMode);\n    self.toggleSuspendControls(true);\n    self.dataSource(model.dataSource);\n    self.fontSize(model.fontSize);\n    self.fontFamily(model.fontFamily);\n    self.left(model.left);\n    self.top(model.top);\n    self.width(model.width);\n    self.height(model.height);\n    self.colorPalette(model.colorPalette);\n    self.legendPosition(model.legendPosition);\n    self.fillOptions(model);\n    self.originalChartType(model.originalChartType);\n    self.chartType(model.chartType);\n    if (self.options.dataLabels[\"style\"]) self.dataLabelColor(self.options.dataLabels.style.colors[0]);\n    self.configTools();\n    var list = self.getTargetCells();\n    self.detectDataTable(list, model, true);\n    self.toggleSuspendControls(false);\n  };\n\n  self.fillEmpty = function (itemType, count, list) {\n    self.showChart(true);\n    self.toggleSuspendControls(true);\n    self.options.title.text(\"نمودار \" + itemType.text + \" \" + count);\n\n    var _h$findMinMaxCells = _h.findMinMaxCells(list),\n        _h$findMinMaxCells2 = _slicedToArray(_h$findMinMaxCells, 2),\n        minAddress = _h$findMinMaxCells2[0],\n        maxAddress = _h$findMinMaxCells2[1];\n\n    self.dataSource(\"[\" + minAddress + \":\" + maxAddress + \"]\");\n\n    switch (itemType.enText) {\n      case \"bar\":\n        self.chartType(itemType.enText);\n        self.originalChartType(itemType.enText);\n        self.options.plotOptions = {\n          bar: {\n            horizontal: true,\n            columnWidth: \"55%\",\n            endingShape: \"rounded\"\n          }\n        };\n        break;\n\n      case \"column\":\n        self.chartType(\"bar\");\n        self.originalChartType(\"column\");\n        self.options.plotOptions = {\n          bar: {\n            horizontal: false,\n            columnWidth: \"55%\",\n            endingShape: \"rounded\"\n          }\n        };\n        break;\n\n      case \"pie\":\n        self.chartType(itemType.enText);\n        self.originalChartType(itemType.enText);\n        self.options.dataLabels.enabled(true);\n        break;\n\n      default:\n        self.originalChartType(itemType.enText);\n        self.chartType(itemType.enText);\n        break;\n    }\n\n    self.configTools();\n    self.detectDataTable(list);\n    self.toggleSuspendControls(false);\n  };\n\n  self.configTools = function () {\n    if (self.top()) $(\"#box\" + self.id()).css(\"top\", self.top());\n    if (self.left()) $(\"#box\" + self.id()).css(\"left\", self.left());\n    $(\"#box\" + self.id()).draggable({\n      scroll: true,\n      stop: function stop(event, ui) {}\n    });\n  };\n\n  self.changePosition = function () {\n    var target = $(\"#box\" + self.id()).get(0);\n    self.toggleSuspendControls(true);\n    var left = parseFloat(target.style.left.replace(\"px\", \"\"));\n    var top = parseFloat(target.style.top.replace(\"px\", \"\"));\n    var width, height;\n    var real = $(target).find(\".chart-object\");\n\n    if (real.length) {\n      width = parseFloat(real.css(\"width\"));\n      height = parseFloat(real.css(\"height\"));\n\n      if (self.chartType() === \"pie\") {\n        height = height + 32;\n      } else {\n        height = height - 15;\n      }\n\n      self.width(width);\n      self.height(height);\n\n      if (self.height() === 0) {\n        self.height(220);\n      }\n    }\n\n    self.left(left);\n    self.top(top);\n    self.toggleSuspendControls(false);\n  };\n\n  self.detectDataTable = function (list, oldModel, editMode) {\n    self.series.removeAll();\n    self.labels.removeAll();\n    var colorSet = chartColors.filter(function (a) {\n      return a.text === self.colorPalette();\n    })[0];\n    var isOfflineTable = list.filter(function (a) {\n      return !_h.isEmpty(a.value);\n    }).length === 0;\n\n    var _h$analyzeCells = _h.analyzeCells(list),\n        _h$analyzeCells2 = _slicedToArray(_h$analyzeCells, 2),\n        columns = _h$analyzeCells2[0],\n        rows = _h$analyzeCells2[1];\n\n    var col, row, oldLabel;\n    if (_h.any(columns)) for (var i = 0; i < columns.length; i++) {\n      var column = columns[i];\n\n      if (!editMode) {\n        column.type = self.chartType();\n        column.originalChartType = self.originalChartType();\n        col = new ChartDataSet(column, self);\n        if (!col.color()) col.color(colorSet.values[i]);\n        self.series.push(col);\n      } else {\n        var oldCol = oldModel.series.filter(function (a) {\n          return a.address === column.address;\n        });\n\n        if (oldCol.length) {\n          col = new ChartDataSet(oldCol[0], self);\n          self.series.push(col);\n        }\n      }\n    }\n    if (_h.any(rows)) for (var j = 0; j < rows.length; j++) {\n      if (!editMode) {\n        row = new ChartDataLabel(rows[j], self);\n        self.labels.push(row);\n      } else {\n        oldLabel = oldModel.categories.filter(function (a) {\n          return a.address === rows[j].address;\n        });\n\n        if (oldLabel.length) {\n          row = new ChartDataLabel(oldLabel[0], self);\n          self.labels.push(row);\n        }\n      }\n    }\n    if (isOfflineTable) self.configChart();\n  };\n\n  self.createChartDataModel = function (onlineValue, empty) {\n    self.options.series = [];\n    self.options.xaxis.categories = [];\n    self.options.labels = [];\n    if (empty) return ko.toJS(self.options);\n    var cells = self.getTargetCells();\n    var invalidRows = self.labels().filter(function (a) {\n      return !a.enable();\n    }).map(function (v) {\n      return Number(v.address().replace(/^\\D+/g, \"\"));\n    });\n    var labels = self.labels().filter(function (a) {\n      return a.enable();\n    }).map(function (v) {\n      if (!v.label()) {\n        var cell = cells.filter(function (a) {\n          return a.address === v.address();\n        });\n        if (cell.length) v.label(cell[0].text);\n        return v.label();\n      }\n\n      return v.label();\n    });\n    if (self.chartType() === \"pie\") self.options.labels = labels;else self.options.xaxis.categories = labels;\n\n    for (var i = 0; i < self.series().length; i++) {\n      var target = self.series()[i];\n      var number = target.address().replace(/^\\D+/g, \"\");\n      var letter = target.address().replace(number, \"\");\n\n      var colNumber = _h.alphabetToNumber(letter);\n\n      var colCells = cells.filter(function (a) {\n        return a.col === colNumber && a.row !== Number(number);\n      });\n      var values = colCells.map(function (v) {\n        if (invalidRows.indexOf(v.row) === -1) {\n          try {\n            if (onlineValue) {\n              var dValue = _h.replaceAll(v.text, \",\", \"\");\n\n              return parseFloat(dValue);\n            } else {\n              if (v.text) return parseFloat(v.text);\n              return 0;\n            }\n          } catch (e) {\n            return 0;\n          }\n        } else {\n          return \"___Null___\";\n        }\n      });\n\n      if (target.enable()) {\n        var dataSet;\n\n        if (self.chartType() === \"pie\") {\n          dataSet = values.filter(function (a) {\n            return a !== \"___Null___\";\n          });\n          self.options.series = dataSet;\n        } else {\n          dataSet = {\n            name: target.label(),\n            data: values.filter(function (a) {\n              return a !== \"___Null___\";\n            }),\n            type: target.type()\n          };\n          self.options.series.push(dataSet);\n        }\n      }\n    }\n\n    self.options.chart.width = self.width();\n    self.options.chart.height = self.height();\n    if (self.options.chart.height <= 0) self.options.chart.height = 220;\n    self.options.theme.palette = self.colorPalette();\n    self.options.chart.type = self.chartType();\n    self.options.legend.fontFamily = self.fontFamily();\n    self.options.dataLabels.style.colors = [];\n\n    for (var j = 0; j < 10; j++) {\n      self.options.dataLabels.style.colors.push(self.dataLabelColor());\n    }\n\n    if (self.labelFontWeight()) {\n      self.options.dataLabels.style.fontWeight = \"bold\";\n    } else {\n      self.options.dataLabels.style.fontWeight = \"300\";\n    }\n\n    var data = ko.toJS(self.options);\n\n    if (self.options.title.display()) {\n      data.title.style.fontSize = self.fontSize();\n      data.title.style.fontFamily = self.fontFamily();\n      data.title.text = self.options.title.text();\n    } else {\n      data.title.text = undefined;\n    }\n\n    return data;\n  };\n\n  self.configChart = function (changeToMixedType) {\n    if (changeToMixedType && !self.mixedMode()) {\n      self.mixedMode(true);\n      self.chartType(\"line\");\n    }\n\n    if (self.mixedMode() && self.chartType() !== \"line\") {\n      self.mixedMode(true);\n      self.chartType(\"line\");\n    }\n\n    var cells = self.getTargetCells();\n    if (!cells.length) return;\n\n    if (self.chartObject != null) {\n      try {\n        self.chartObject.destroy();\n      } catch (e) {}\n    }\n\n    var isOfflineTable = cells.filter(function (a) {\n      return !_h.isEmpty(a.value);\n    }).length === 0;\n    var hasOnlineValue = cells.filter(function (a) {\n      return a.hasDynamicValue;\n    }).length > 0;\n    var previewMode = self.parent.previewMode();\n    var config;\n    var element = document.querySelector(\"#\" + self.id());\n\n    if (isOfflineTable) {\n      config = self.createChartDataModel();\n      self.chartObject = new (apexcharts__WEBPACK_IMPORTED_MODULE_3___default())(element, config);\n    } else if (previewMode && hasOnlineValue) {\n      config = self.createChartDataModel(true);\n      self.chartObject = new (apexcharts__WEBPACK_IMPORTED_MODULE_3___default())(element, config);\n    } else {\n      config = self.createChartDataModel(false, true);\n      self.chartObject = new (apexcharts__WEBPACK_IMPORTED_MODULE_3___default())(element, config);\n    }\n\n    console.log(config); //        console.log(self.height());\n\n    if (!element) return;\n    self.chartObject.render();\n  };\n\n  self.changeChartColor = function (item, m) {\n    self.colorPalette(item.text);\n  };\n\n  self.onChangeRange = function () {\n    var cells = self.getTargetCells();\n    self.detectDataTable(cells);\n  };\n\n  self.getTargetCells = function () {\n    var text = self.dataSource().replace(\"[\", \"\").replace(\"]\", \"\");\n    var splits = text.split(':');\n    var numberA = splits[0].replace(/^\\D+/g, '');\n    var letterA = splits[0].replace(numberA, '');\n\n    var colNumberA = _h.alphabetToNumber(letterA);\n\n    var numberB = splits[1].replace(/^\\D+/g, '');\n    var letterB = splits[1].replace(numberB, '');\n\n    var colNumberB = _h.alphabetToNumber(letterB);\n\n    var list = [];\n\n    for (var i = 0; i < numberB; i++) {\n      for (var j = 0; j < colNumberB; j++) {\n        var xi = i + 1;\n        var xj = j + 1;\n\n        if (xi >= numberA && xi <= numberB && xj >= colNumberA && xj <= colNumberB) {\n          list.push(_h.numberToAlphabet(xj) + xi);\n        }\n      }\n    }\n\n    var cells = self.parent.scope.find(\".rp-gen\").rg(\"selectGroupCells\", list);\n    return cells;\n  };\n\n  self.dataLabelColorsub = self.dataLabelColor.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      self.configChart();\n    }\n  });\n  self.fontSizesub = self.fontSize.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      self.configChart();\n    }\n  });\n  self.fontFamilysub = self.fontFamily.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      self.configChart();\n    }\n  });\n  self.displaysub = self.options.title.display.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      self.configChart();\n    }\n  });\n  self.colorPalettesub = self.colorPalette.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      self.configChart();\n    }\n  });\n  self.textsub = self.options.title.text.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      self.configChart();\n    }\n  });\n  self.showlegendsub = self.options.legend.show.supsendableSubscribe(function (newValue) {\n    self.configChart();\n  });\n  self.positionlegendsub = self.legendPosition.supsendableSubscribe(function (newValue) {\n    if (!_h.isEmpty(newValue)) {\n      var item = _h.getEnumItem(positions, newValue);\n\n      self.options.legend.position = item.enText;\n      self.configChart();\n    } else {\n      self.options.legend.position = \"bottom\";\n      self.configChart();\n    }\n  });\n  self.dataLabelsenabledsub = self.options.dataLabels.enabled.supsendableSubscribe(function (newValue) {\n    self.configChart();\n  });\n  self.dataLabelsfontWeightsub = self.labelFontWeight.supsendableSubscribe(function (newValue) {\n    self.configChart();\n  });\n  self.dataLabelsColorsub = self.dataLabelColor.supsendableSubscribe(function (newValue) {\n    self.configChart();\n  });\n  self.heightsub = self.height.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      self.configChart();\n    }\n  });\n  self.widthsub = self.width.supsendableSubscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      self.configChart();\n    }\n  });\n\n  self.toggleSuspendControls = function (sta) {\n    if (sta) {\n      self.fontSizesub.suspend();\n      self.fontFamilysub.suspend();\n      self.displaysub.suspend();\n      self.colorPalettesub.suspend();\n      self.textsub.suspend();\n      self.showlegendsub.suspend();\n      self.positionlegendsub.suspend();\n      self.dataLabelsenabledsub.suspend();\n      self.dataLabelsfontWeightsub.suspend();\n      self.dataLabelsColorsub.suspend();\n      self.heightsub.suspend();\n      self.widthsub.suspend();\n    } else {\n      self.fontSizesub.unsuspend();\n      self.fontFamilysub.unsuspend();\n      self.displaysub.unsuspend();\n      self.colorPalettesub.unsuspend();\n      self.textsub.unsuspend();\n      self.showlegendsub.unsuspend();\n      self.positionlegendsub.unsuspend();\n      self.dataLabelsenabledsub.unsuspend();\n      self.dataLabelsfontWeightsub.unsuspend();\n      self.dataLabelsColorsub.unsuspend();\n      self.heightsub.unsuspend();\n      self.widthsub.unsuspend();\n    }\n\n    ;\n  };\n\n  self.toggleShow = function () {\n    self.showChart(self.showChart());\n\n    if (!self.showChart() && item.chartObject) {\n      item.chartObject.destroy();\n    } else {\n      self.configTools();\n    }\n  };\n\n  self.toServer = function () {\n    var objChart = {\n      showChart: false,\n      id: self.id(),\n      randomId: self.randomId,\n      chartType: self.mixedMode() ? self.originalChartType() : self.chartType(),\n      originalChartType: self.originalChartType(),\n      dataSource: self.dataSource(),\n      left: self.left(),\n      top: self.top(),\n      width: self.width(),\n      height: self.height(),\n      colorPalette: self.colorPalette(),\n      fontSize: self.fontSize(),\n      fontFamily: self.fontFamily(),\n      mixedMode: self.mixedMode(),\n      legendPosition: self.legendPosition(),\n      categories: [],\n      series: [],\n      options: ko.toJS(self.options)\n    };\n\n    if (!objChart.top) {\n      var top = $(\"#box\" + self.id()).css(\"top\");\n      objChart.top = parseFloat(top.replace(\"px\", \"\"));\n    }\n\n    for (var j = 0; j < self.labels().length; j++) {\n      var label = self.labels()[j];\n      objChart.categories.push({\n        address: label.address(),\n        label: label.label(),\n        enable: label.enable()\n      });\n    }\n\n    for (var j = 0; j < self.series().length; j++) {\n      var item = self.series()[j];\n      objChart.series.push({\n        color: item.color(),\n        address: item.address(),\n        type: item.type(),\n        typeNumber: item.typeNumber(),\n        label: item.label(),\n        borderColor: item.borderColor(),\n        backgroundColor: item.backgroundColor(),\n        fill: item.fill(),\n        enable: item.enable()\n      });\n    }\n\n    if (objChart.options.xaxis) objChart.options.xaxis.categories = [];\n    objChart.options.labels = [];\n    objChart.options.series = [];\n    return objChart;\n  };\n}\nfunction ChartMenu() {\n  var self = this;\n  self.show = ko.observable(false);\n\n  self.open = function (event, chartModel) {\n    ko.utils.extend(self, chartModel);\n    self.show(true);\n    $(\".chart-menu\").draggable({\n      scroll: true,\n      handle: \".chart-setting-draghandler\"\n    });\n    $(\".chart-menu\").position({\n      my: 'center top',\n      at: 'center bottom',\n      of: $(event.target),\n      offset: '0 5',\n      collision: 'fit'\n    });\n  };\n\n  self.close = function (item) {\n    try {\n      if (item.chartObject) item.chartObject.destroy();\n    } catch (e) {}\n\n    self.show(false);\n  };\n\n  self.categoryTagSelectTemplate = function (item) {\n    var temp = '<div style=\"padding: 3px;\">' + '<span class=\"item-title\">' + '<span class=\"item-name\">' + item.text + '</span>' + '</span>' + '<div class=\"label label-primary2 remove-tag\" style=\"float: left;padding-top: 4px;background-color: #ccc;\">حذف</div>' + '</div>';\n    return temp;\n  };\n\n  self.onCheckItem = function (item) {\n    item.enable(!item.enable());\n  };\n}\nfunction ChartTitle(model) {\n  this.color = model.color ? model.color : '';\n  this.align = model.align ? model.align : 'center'; //'start' 'center' 'end'\n\n  this.display = model.display;\n  this.position = model.position ? model.position : 'bottom'; //'top'  'left'  'bottom'  'right'\n\n  this.padding = model.padding ? model.padding : {\n    top: 10,\n    bottom: 10\n  };\n  this.text = model.text;\n}\nfunction ChartDataSet(model, parent) {\n  this.parent = parent;\n  this.color = ko.observable(model.color);\n  this.address = ko.observable(model.address);\n  this.type = ko.observable(model.type);\n\n  if (!model.typeNumber) {\n    var x = _h.getEnumItemByText(chartTypes, model.originalChartType).value;\n\n    this.typeNumber = ko.observable(x);\n  } else {\n    this.typeNumber = ko.observable(model.typeNumber);\n  }\n\n  this.label = ko.observable(model.label);\n  this.data = ko.observable(model.data);\n  this.borderColor = ko.observable(model.borderColor);\n  this.backgroundColor = ko.observable(model.backgroundColor);\n  this.fill = ko.observable(model.fill || true);\n  this.enable = ko.observable(model.enable || true);\n  this.enable.subscribe(function (newValue) {\n    this.parent.configChart();\n  }.bind(this));\n  this.typeNumber.subscribe(function (newValue) {\n    if (!_h.isNullOrEmpty(newValue)) {\n      var item = _h.getEnumItem(chartTypes, newValue);\n\n      this.type(item.enText);\n      parent.configChart(this.address());\n    }\n  }.bind(this));\n}\nfunction ChartDataLabel(model, parent) {\n  this.parent = parent;\n  this.address = ko.observable(model.address);\n  this.label = ko.observable(model.label);\n  this.enable = ko.observable(model.enable || true);\n  this.enable.subscribe(function (newValue) {\n    parent.configChart();\n  });\n}\nfunction XbrlConceptViewModel() {\n  var self = this;\n  self.treeOpenBranches = [];\n\n  self.collectOpenBranches = function () {\n    var tree = $(\"#xbrlconcept-tree-sec\").find(\".dmn-tree\");\n    var ulList = tree.find(\"ul:not(.dmn-c)\");\n    var array = [];\n    if (ulList.length) for (var i = 0; i < ulList.length; i++) {\n      var item = ulList[i];\n      var parent = $(item).parent();\n      if (parent) array.push(parent.attr(\"did\"));\n    }\n    self.treeOpenBranches = array;\n    return array;\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_2__.BaseViewModel({\n    entityName: \"XbrlConcept\",\n    getList: false,\n    apiService: {\n      actionList: []\n    },\n    buttons: [{\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }],\n    filters: [],\n    tableStyle: \"font-size: 11px;\",\n    sortDirection: \"Ascending\",\n    sortProperty: \"code\",\n    context: self,\n    cols: treeInfoModelRes,\n    searchKeyType: \"enter\",\n    selectRow: true,\n    saveState: true,\n    contextMenu: false,\n    isMultiSelectRows: false\n  }));\n  self.btnVisibility = ko.computed(function () {\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.iconSize(\"icon-image-small\");\n  };\n\n  self.getRecords = function () {\n    var filterModel = {\n      searchKey: self.searchKey()\n    };\n    self.apiService.request({\n      name: \"getXbrlConcepts\",\n      data: filterModel,\n      success: function success(data) {\n        if (data && _h.any(data.list)) {\n          self.records = data.list;\n        }\n\n        self.configTools();\n      },\n      messageType: 'getList',\n      messageKey: self.entityName\n    });\n  };\n\n  self.expandAll = function () {\n    $(\"#xbrl_tree_view\").treeView(\"expandAll\");\n  };\n\n  self.collapseAll = function () {\n    $(\"#xbrl_tree_view\").treeView(\"collapseAll\");\n  };\n\n  self.configTools = function () {\n    $(\"#xbrl_tree_view\").treeView({\n      tType: self.entityName,\n      location: self.entityName,\n      nodes: self.records,\n      rootId: \"x\",\n      rootName: \"XbrlConcept\"\n    });\n    if (self.treeOpenBranches && self.treeOpenBranches.length) $(\"#xbrl_tree_view\").treeView(\"expand\", self.treeOpenBranches);\n  };\n}\nfunction DescCell(cell) {\n  var self = this;\n  self.cell = cell;\n  self.input = ko.observable(cell.desc);\n  self.input.subscribe(function (value) {\n    var context = _h.kocnx();\n\n    var templateModel = context.ttvm().getFocusDesignRecord();\n    $(\"#rg-\" + templateModel.id).rg(\"command\", {\n      value: value,\n      id: \"ChangeDesc\",\n      cell: self.cell\n    });\n    context.ttvm().focusDesignItem().refreshToolBar(true);\n  });\n}\nfunction CellRegion(model, parent) {\n  var self = this;\n  self.start = ko.observable(model.start);\n  self.end = ko.observable(model.end);\n  self.parent = parent;\n  self.start.subscribe(function (val) {\n    self.parent.subscribeRegions();\n  });\n  self.end.subscribe(function (val) {\n    self.parent.subscribeRegions();\n  });\n}\nvar TableTemplatePreview = /*#__PURE__*/function (_FormBuilder2) {\n  _inherits(TableTemplatePreview, _FormBuilder2);\n\n  var _super10 = _createSuper(TableTemplatePreview);\n\n  function TableTemplatePreview(viewModel, model) {\n    var _this10;\n\n    _classCallCheck(this, TableTemplatePreview);\n\n    _this10 = _super10.call(this);\n    _this10.parentVM = viewModel;\n\n    _this10.fillModel(model);\n\n    _this10.createForm();\n\n    _this10.calculateWidthModel();\n\n    return _this10;\n  }\n\n  _createClass(TableTemplatePreview, [{\n    key: \"fillModel\",\n    value: function fillModel(model) {\n      var paramList = [{\n        name: \"caption\",\n        type: \"ob\",\n        val: _h.getLocalizedText('previewCaption')\n      }, {\n        name: \"htmlContent\",\n        type: \"ob\",\n        val: model.data\n      }, {\n        name: \"oldResult\",\n        type: \"ob\"\n      }, {\n        name: \"showResult\",\n        type: \"ob\",\n        val: false\n      }];\n\n      _autoMapper.createPropsFromList(this, paramList);\n    }\n  }, {\n    key: \"calculateWidthModel\",\n    value: function calculateWidthModel() {\n      var table = $(\"#prv-html\").find(\"table\");\n      var width = table.width();\n      $(\".modal-box\").css(\"width\", width + 65);\n      var screenWidth = $(\"body\").width();\n      var rest = (screenWidth - (width + 65)) / 2;\n      $(\".modal-box\").css(\"left\", rest + \"px\");\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'table-htmlcontent-form-t'\n      }, undefined, this.visHtmlContent, 30, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'cancel',\n            click: this.parentVM.closePreviewForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return TableTemplatePreview;\n}(FormBuilder);\n\n//# sourceURL=webpack://domino/./src/scripts/pages/tabletemplate/model.js?");

/***/ }),

/***/ "./src/scripts/pages/tabletemplate/resource.js":
/*!*****************************************************!*\
  !*** ./src/scripts/pages/tabletemplate/resource.js ***!
  \*****************************************************/
/***/ (() => {

eval("window.templateTableTypes = [{\n  text: \"صورت مالی\",\n  enText: \"FinanceStatement\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"یادداشت همراه\",\n  enText: \"Note\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"حساب های متقابل\",\n  enText: \"BilateralAccounts\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"محاسبات\",\n  enText: \"TotalCost\",\n  value: 4,\n  color: \"\"\n}, {\n  text: \"گزارش ماتریسی\",\n  enText: \"MatrixReport\",\n  value: 5,\n  color: \"\"\n}];\nwindow.nodeOperators = [{\n  text: \"جمع\",\n  enText: \"None\",\n  value: \"+\"\n}, {\n  text: \"تفریق\",\n  enText: \"Current\",\n  value: \"-\"\n}, {\n  text: \"ضرب\",\n  enText: \"FirstComparative\",\n  value: \"*\"\n}, {\n  text: \"تقسیم\",\n  enText: \"SecondComparative\",\n  value: \"/\"\n}];\nwindow.cellDataTypes = [{\n  text: \"عددی\",\n  enText: \"Numeric\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"مالی\",\n  enText: \"Money\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"متنی\",\n  enText: \"Text\",\n  value: 2,\n  color: \"\"\n}];\nwindow.cellInfoTypes = [{\n  text: \"عدد منفی پرانتز دار\",\n  enText: \"NegativeInParentheses\",\n  value: 1\n}, {\n  text: \"عدد منفی قرمز\",\n  enText: \"NegativeRedNumber\",\n  value: 2\n}, {\n  text: \"درصد\",\n  enText: \"Percent\",\n  value: 3\n}, {\n  text: \"دوره جاری\",\n  enText: \"info:'4'\",\n  value: 4\n}, {\n  text: \"ریال/میلیون ریال\",\n  enText: \"info:'7'\",\n  value: 7\n}, {\n  text: \"نام شرکت/گروه\",\n  enText: \"info:'8'\",\n  value: 8\n}, {\n  text: \"تاریخ/دوره جاری\",\n  enText: \"info:'9'\",\n  value: 9\n}, {\n  text: \"تاریخ/سال دوره جاری\",\n  enText: \"info:'10'\",\n  value: 10\n}, {\n  text: \"جمع کلی\",\n  enText: \"TotalSum\",\n  value: 11,\n  ph: \"Sum\"\n}, {\n  text: \"جمع جزیی\",\n  enText: \"PartialSum\",\n  value: 12,\n  ph: \"Sum\"\n}, {\n  text: \"جمع گروهی\",\n  enText: \"GroupSum\",\n  value: 26,\n  ph: \"GSum\"\n}, {\n  text: \"جمع ستونی\",\n  enText: \"ColumnSum\",\n  value: 27,\n  ph: \"CSum\"\n}, {\n  text: \"میانگین\",\n  enText: \"Average\",\n  value: 13,\n  ph: \"Avg\"\n}, {\n  text: \"بزرگترین\",\n  enText: \"Max\",\n  value: 14,\n  ph: \"Max\"\n}, {\n  text: \"کوچکترین\",\n  enText: \"Min\",\n  value: 15,\n  ph: \"Min\"\n}, {\n  text: \"فرمول\",\n  enText: \"Formula\",\n  value: 16\n}, {\n  text: \"\",\n  enText: \"NodeInCell\",\n  value: 17\n}, {\n  text: \"\",\n  enText: \"LinkedCell\",\n  value: 18\n}, {\n  text: \"\",\n  enText: \"Consolidate\",\n  value: 19\n}, {\n  text: \"\",\n  enText: \"Column\",\n  value: 24\n}, {\n  text: \"شماره سطر\",\n  enText: \"info:'25'\",\n  value: 25\n}, {\n  text: \"دوره مالی/ مقایسه ای\",\n  enText: \"periodname:'_'\",\n  value: 33\n}, {\n  text: \"تاریخ / دوره مقایسه ای\",\n  enText: \"perioddate:'_'\",\n  value: 34\n}, {\n  text: \"تاریخ / سال دوره مقایسه ای\",\n  enText: \"periodyear:'_'\",\n  value: 35\n}, {\n  text: \"\",\n  enText: \"NodeNameInCell\",\n  value: 36\n}];\nwindow.valueSources = [{\n  text: \"مانده بعد از سند\",\n  enText: \"FinalValue\",\n  value: 1\n}, {\n  text: \"مانده قبل از سند\",\n  enText: \"BaseValue\",\n  value: 2\n}, {\n  text: \"مانده سند\",\n  enText: \"AdjustmentValue \",\n  value: 3\n}];\nwindow.groupTypes = [{\n  text: \"تشابه کل\",\n  enText: \"CompleteMatch\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"تشابه ابتدا\",\n  enText: \"StartMatch\",\n  value: 1,\n  color: \"\"\n}];\nwindow.sortDirections = [{\n  text: \"صعودی\",\n  enText: \"Ascending\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"نزولی\",\n  enText: \"Descending\",\n  value: 1,\n  color: \"\"\n}];\nwindow.tabletemplateModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  priority: {\n    fa: 'اولویت',\n    colName: 'priority',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"Ascending\",\n    alias: null,\n    size: 5,\n    type: \"string\"\n  },\n  code: {\n    fa: 'کد',\n    colName: 'code',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  title: {\n    fa: 'عنوان',\n    colName: 'title',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"title-tabletemplate-template\",\n    size: 30\n  },\n  templateTableType: {\n    fa: 'نوع قالب',\n    colName: 'templateTableType',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"enum\"\n  },\n  folderName: {\n    fa: 'پوشه',\n    colName: 'folderName',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: \"folderId\",\n    groupBy: true,\n    groupDir: \"Ascending\",\n    type: \"string\"\n  },\n  defaultRowNumber: {\n    fa: 'تعداد سطر پیش فرض',\n    colName: 'defaultRowNumber',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  defaultColumnNumber: {\n    fa: 'تعداد ستون پیش فرض',\n    colName: 'defaultColumnNumber',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  accountType: {\n    fa: ' اولویت ماهیت مانده',\n    colName: 'accountType',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"enum\"\n  },\n  folderId: {\n    fa: 'پوشه',\n    colName: 'folderId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  editable: {\n    fa: 'وضعیت قفل',\n    colName: 'editable',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"bool\"\n  },\n  lockedBy: {\n    fa: 'قفل شده توسط',\n    colName: 'lockedBy',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  },\n  lockedByUserId: {\n    fa: '',\n    colName: 'lockedByUserId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  }\n};\nwindow.tabletemplatepreviewModelRes = {\n  amountType: {\n    fa: 'برحسب',\n    colName: 'amountType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null\n  },\n  displayType: {\n    fa: 'نمایش',\n    colName: 'displayType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null\n  },\n  currentPeriodId: {\n    fa: 'نوع قالب',\n    colName: 'currentPeriodId',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null\n  },\n  currentPeriodTitle: {\n    fa: 'دوره جاری',\n    colName: 'currentPeriodTitle',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null\n  }\n};\nwindow.tabletemplatePageRes = {\n  pageTitle: {\n    fa: 'قالب جداول'\n  },\n  createCaption: {\n    fa: 'تعریف قالب جدول جدید'\n  },\n  editCaption: {\n    fa: 'ویرایش قالب جدول'\n  },\n  deleteCaption: {\n    fa: 'حذف قالب جدول'\n  },\n  previewDefaultCaption: {\n    fa: 'تنظیمات پیش نمایش'\n  },\n  editBtn: {\n    fa: 'ویرایش قالب جدول'\n  },\n  deleteBtn: {\n    fa: 'حذف قالب جدول'\n  },\n  upCaption: {\n    fa: 'افزایش اولویت قالب جدول'\n  },\n  downCaption: {\n    fa: 'کاهش اولویت قالب جدول'\n  },\n  copyCaption: {\n    fa: 'کپی قالب جدول'\n  },\n  exportExcelCaption: {\n    fa: 'خروجی Excel قالب جدول'\n  },\n  exportExcelsCaption: {\n    fa: 'خروجی Excel قالبهای جدول'\n  },\n  exportPdfCaption: {\n    fa: 'خروجی Pdf قالب جدول'\n  },\n  importFileCaption: {\n    fa: 'بارگذاری قالب های جدول از فایل پشتیبان'\n  },\n  exportFileCaption: {\n    fa: 'تولید فایل پشتیبان از قالب های جدول'\n  },\n  TemplateList: {\n    fa: 'فهرست'\n  },\n  CellSpecs: {\n    fa: 'خصوصیات سلول'\n  },\n  BlueMenu: {\n    fa: 'منوی ابزار'\n  },\n  TemplateEditor: {\n    fa: 'ویرایشگر قالب'\n  },\n  designCaption: {\n    fa: 'ویرایش محتوای قالب جدول'\n  },\n  designCloseAlert: {\n    fa: 'در صورت بستن قالب __، تغییرات انجام شده حذف خواهند شد . آیا مایل به ذخیره تغییرات هستید ؟'\n  },\n  designCloseAllAlert: {\n    fa: 'آیا مایل به ذخیره تغییرات هستید؟'\n  },\n  cellSelectCaption: {\n    fa: 'اتصال به قالب جدول'\n  },\n  deterrent: {\n    fa: 'جلوگیری از تولید مجله'\n  },\n  editableMode: {\n    fa: 'ویرایش قالب'\n  },\n  unEditableMode: {\n    fa: 'خروج از حالت ویرایش'\n  }\n};\nwindow.tableStructurePageRes = {\n  TreeDataSourceCaption: {\n    fa: 'منبع داده درختواره'\n  },\n  XbrlConceptCaption: {\n    fa: 'گزارش Xbrl'\n  },\n  TableDataSourceCaption: {\n    fa: 'منبع داده جدول'\n  },\n  previewBtn: {\n    fa: 'پیش نمایش'\n  },\n  previewCaption: {\n    fa: 'پیش نمایش'\n  },\n  cancelPreviewCaption: {\n    fa: 'خروج از حالت پیش نمایش'\n  },\n  compareValueCellCaption: {\n    fa: 'مقایسه مقادیر سلول ها'\n  },\n  descCellCaption: {\n    fa: 'توضیحات سلول'\n  },\n  wideReportGenerator: {\n    fa: 'بزرگ کردن گزارش ساز'\n  },\n  unwideReportGenerator: {\n    fa: 'کوچک کردن گزارش ساز'\n  },\n  excelBtn: {\n    fa: 'Excel'\n  },\n  pdfBtn: {\n    fa: 'Pdf'\n  },\n  negativeInParentheses: {\n    fa: 'عدد منفی پرانتز دار'\n  },\n  negativeRedNumber: {\n    fa: 'عدد منفی قرمز'\n  },\n  percent: {\n    fa: 'درصد'\n  },\n  consolidateCaption: {\n    fa: 'فهرست گروه/ شرکتهای تابعه'\n  },\n  treeSelectPl: {\n    fa: 'درختواره'\n  },\n  TableSelectPl: {\n    fa: 'جدول'\n  },\n  periodIdCaption: {\n    fa: 'دوره مالی'\n  },\n  treeSelectCaption: {\n    fa: 'درختواره'\n  },\n  tableSelectCaption: {\n    fa: 'جدول'\n  },\n  firstCell: {\n    fa: 'سلول اول'\n  },\n  secondCell: {\n    fa: 'سلول دوم'\n  },\n  errorRate: {\n    fa: 'ضریب خطا'\n  },\n  EditPickNodes: {\n    fa: 'ویرایش گره های انتخاب شده'\n  },\n  infoCalculateCaption: {\n    fa: 'اطلاعات و محاسبات'\n  },\n  adminUnlockCaption: {\n    fa: 'باز کردن قفل ویرایش قالب'\n  },\n  undoAction: {\n    fa: 'واگرد'\n  },\n  redoAction: {\n    fa: 'بازانجام'\n  }\n};\nwindow.treeInfoModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null,\n    size: 1,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  name: {\n    fa: 'نام',\n    colName: 'name',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 6,\n    type: \"string\"\n  },\n  nodeType: {\n    fa: 'نوع',\n    colName: 'nodeType',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    size: 1,\n    type: \"enum\"\n  }\n};\nwindow.tableModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\",\n    size: 1\n  },\n  title: {\n    fa: 'نام',\n    colName: 'title',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 6\n  },\n  dataType: {\n    fa: 'نوع داده',\n    colName: 'dataType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 2\n  }\n};\nwindow.tabMenuItems = [{\n  visName: \"CloseThis\",\n  text: \"بستن\",\n  action: \"closeThis\"\n}, {\n  visName: \"CloseAll\",\n  text: \"بستن همه\",\n  action: \"closeAll\"\n}, {\n  visName: \"CloseAllButThis\",\n  text: \"بستن همه به جز این تب\",\n  action: \"closeAllButThis\"\n}, {\n  visName: \"CloseRight\",\n  text: \"بستن تب های قبلی\",\n  action: \"closeRight\"\n}, {\n  visName: \"CloseLeft\",\n  text: \"بستن تب های بعدی\",\n  action: \"closeLeft\"\n}];\nwindow.chartTypes = [{\n  text: \"ستونی\",\n  enText: \"column\",\n  value: 1,\n  icon: \"charts_column.png\"\n}, {\n  text: \"خطی\",\n  enText: \"line\",\n  value: 2,\n  icon: \"charts_line.png\"\n}, {\n  text: \"میله ای\",\n  enText: \"bar\",\n  value: 4,\n  icon: \"charts_bar.png\"\n}, {\n  text: \"سطحی\",\n  enText: \"area\",\n  value: 5,\n  icon: \"charts_area.png\"\n}, {\n  text: \"دایره ای\",\n  enText: \"pie\",\n  value: 6,\n  icon: \"charts_pie.png\"\n}];\nwindow.chartInnerTypes = [{\n  text: \"ستونی\",\n  enText: \"column\",\n  value: 1,\n  icon: \"charts_column.png\"\n}, {\n  text: \"خطی\",\n  enText: \"line\",\n  value: 2,\n  icon: \"charts_line.png\"\n}, {\n  text: \"سطحی\",\n  enText: \"area\",\n  value: 5,\n  icon: \"charts_area.png\"\n}];\nwindow.chartColors = [{\n  text: \"palette1\",\n  values: [\"#008FFB\", \"#00E396\", \"#FEB019\", \"#FF4560\", \"#775DD0\"]\n}, {\n  text: \"palette2\",\n  values: [\"#3F51B5\", \"#03A9F4\", \"#4CAF50\", \"#F9CE1D\", \"#FF9800\"]\n}, {\n  text: \"palette3\",\n  values: [\"#33B2DF\", \"#546E7A\", \"#D4526E\", \"#13D8AA\", \"#A5978B\"]\n}, {\n  text: \"palette4\",\n  values: [\"#4ECDC4\", \"#C7F464\", \"#81D4FA\", \"#546E7A\", \"#FD6A6A\"]\n}, {\n  text: \"palette5\",\n  values: [\"#2B908F\", \"#F9A3A4\", \"#90EE7E\", \"#FA4443\", \"#69D2E7\"]\n}, {\n  text: \"palette6\",\n  values: [\"#449DD1\", \"#F86624\", \"#EA3546\", \"#662E9B\", \"#C5D86D\"]\n}, {\n  text: \"palette7\",\n  values: [\"#D7263D\", \"#1B998B\", \"#2E294E\", \"#F46036\", \"#E2C044\"]\n}, {\n  text: \"palette8\",\n  values: [\"#662E9B\", \"#F86624\", \"#F9C80E\", \"#EA3546\", \"#43BCCD\"]\n}, {\n  text: \"palette9\",\n  values: [\"#5C4742\", \"#A5978B\", \"#8D5B4C\", \"#5A2A27\", \"#C4BBAF\"]\n}, {\n  text: \"palette10\",\n  values: [\"#A300D6\", \"#7D02EB\", \"#5653FE\", \"#2983FF\", \"#00B1F2\"]\n}];\nwindow.xbrlPeriodTypes = [{\n  text: \"-\",\n  enText: \"Unknown\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"بازه زمانی\",\n  enText: \"Duration\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"تاریخ\",\n  enText: \"Instant\",\n  value: 2,\n  color: \"\"\n}];\nwindow.xbrlDataTypes = [{\n  text: \"-\",\n  enText: \"Unknown\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"Monetary\",\n  enText: \"Monetary\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"PerShare\",\n  enText: \"PerShare\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"Axis\",\n  enText: \"Axis\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"Table\",\n  enText: \"Table\",\n  value: 4,\n  color: \"\"\n}, {\n  text: \"Member\",\n  enText: \"Member\",\n  value: 5,\n  color: \"\"\n}, {\n  text: \"MemberDefault\",\n  enText: \"MemberDefault\",\n  value: 6,\n  color: \"\"\n}, {\n  text: \"LineItems\",\n  enText: \"LineItems\",\n  value: 7,\n  color: \"\"\n}, {\n  text: \"Text\",\n  enText: \"Text\",\n  value: 8,\n  color: \"\"\n}];\nwindow.Taxonomies = [{\n  text: \"-\",\n  enText: \"Unknown\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"full-ifrs\",\n  enText: \"FullIfrs\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"cbi-iras\",\n  enText: \"CbiIras\",\n  value: 2,\n  color: \"\"\n}];\nwindow.xbrlConceptModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    alias: null,\n    size: 1,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  name: {\n    fa: 'نام',\n    colName: 'name',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 6,\n    type: \"string\"\n  },\n  nodeType: {\n    fa: 'نوع',\n    colName: 'nodeType',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    size: 1,\n    type: \"enum\"\n  }\n};\nwindow.zeroDisplayTypes = [{\n  text: \"0\",\n  enText: \"Zero\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"-\",\n  enText: \"Dash\",\n  value: 2,\n  color: \"\"\n}];\nwindow.valueDisplayTypes = [{\n  text: \"بدون تغییر\",\n  enText: \"NoModify\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"معکوس مانده\",\n  enText: \"Negate\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"به صورت منفی\",\n  enText: \"Minus\",\n  value: 3,\n  color: \"\"\n}];\nwindow.roundingApproaches = [{\n  text: \"رند کردن خودکار\",\n  enText: \"Default\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"رند کردن رو به بالا\",\n  enText: \"Ceiling\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"رند کردن رو به پایین\",\n  enText: \"Floor\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"بدون رند کردن\",\n  enText: \"NoRounding\",\n  value: 4,\n  color: \"\"\n}];\nwindow.nodeDisplayTypes = [{\n  text: \"مقدار گره\",\n  enText: \"NodeInCell\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"نام گره\",\n  enText: \"NodeNameInCell\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"مقدار و نام گره\",\n  enText: \"NodeValueNameInCell\",\n  value: 3,\n  color: \"\"\n}];\n\n//# sourceURL=webpack://domino/./src/scripts/pages/tabletemplate/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/tabletemplate/viewModel.js":
/*!******************************************************!*\
  !*** ./src/scripts/pages/tabletemplate/viewModel.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"TableTemplateViewModel\": () => (/* binding */ TableTemplateViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _master_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/model */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model */ \"./src/scripts/pages/tabletemplate/model.js\");\n/* harmony import */ var _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/apiService.js */ \"./src/scripts/util/apiService.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n__webpack_require__(/*! ./model */ \"./src/scripts/pages/tabletemplate/model.js\");\n\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/tabletemplate/resource.js\");\n\n\n\n\n\nfunction TableTemplateViewModel() {\n  var self = this;\n  self.setting = ko.observable(new _model__WEBPACK_IMPORTED_MODULE_2__.RpSetting());\n  self.rgMenu = ko.observable(new _model__WEBPACK_IMPORTED_MODULE_2__.RgMenu(self));\n  self.customStyleMenuModel = ko.observable(new _model__WEBPACK_IMPORTED_MODULE_2__.CustomStyleMenu());\n  self.showList = ko.observable(true);\n  self.showCellSpecMenu = ko.observable(false);\n  self.showCustomStyleMenu = ko.observable(false);\n  self.fullScreen = ko.observable(false);\n\n  self.toggleShowList = function () {\n    if (self.editList().length === 0 && self.showList()) {\n      return;\n    }\n\n    self.showList(!self.showList());\n  };\n\n  self.closeAllSubModal = function (callback) {\n    self.rgMenu().closeAllModals();\n    self.cellSpecMenuModel.show(false);\n\n    if (self.showCustomStyleMenu()) {\n      self.showCustomStyleMenu(false);\n    }\n\n    callback(true);\n  };\n\n  self.editList = ko.observableArray([]);\n  self.backupSelectedRecords = ko.observableArray();\n  self.treeSelectList = ko.observableArray();\n  self.focusDesignItem = ko.observable();\n  self.tableTemplateList = ko.observableArray();\n  self.cellSpecMenuModel = new _model__WEBPACK_IMPORTED_MODULE_2__.CellSpecMenu();\n  self.periodList = ko.observableArray();\n  self.firstLoadError = false;\n\n  self.getPeriods = function () {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/common/getselectableperiods\",\n      data: {\n        controllerName: 19\n      },\n      success: function success(data) {\n        self.periodList.removeAll();\n        if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n          if (!_h.isNullOrEmpty(data[j])) {\n            self.periodList.push(data[j]);\n          }\n        }\n      },\n      error: function error(data) {\n        if (data === 550) self.firstLoadError = true;\n      }\n    });\n  };\n\n  self.getTableTemplateList = function () {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/tablestructure/gettabletemplateslist\",\n      success: function success(data) {\n        self.tableTemplateList.removeAll();\n        if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n          var target = data[j];\n          self.tableTemplateList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.SelectItem(target));\n        }\n      },\n      error: function error(data) {\n        var text = _h.getApiMessage(\"ErrorLoadTableTemplate\");\n\n        _h.failToast(text);\n      }\n    });\n  };\n\n  self.getTreeSelectList = function () {\n    var model = {\n      controllerName: 20,\n      mappingType: 0\n    };\n    self.apiService.request({\n      name: \"getMappingTreeList\",\n      data: model,\n      success: function success(data) {\n        self.treeSelectList.removeAll();\n        if (_h.any(data)) for (var j = 0; j < data.length; j++) {\n          var target = data[j];\n          self.treeSelectList.push(new _master_model__WEBPACK_IMPORTED_MODULE_1__.SelectItem(target));\n        }\n      },\n      error: function error() {\n        toast.error(\"Tree\", 'getSelectList');\n      }\n    });\n  };\n\n  self.changeDesignItem = function (item) {\n    self.closeAllSubModal(function () {\n      for (var i = 0; i < self.editList().length; i++) {\n        if (self.editList()[i].active() === true) self.editList()[i].active(false);\n      }\n\n      item.active(true);\n      self.focusDesignItem(item);\n    });\n  };\n\n  self.closePreviewForm = function () {\n    if (self.focusDesignItem()) {\n      self.focusDesignItem().previewResult = null;\n      self.focusDesignItem().bindErrors = null;\n      self.focusDesignItem().previewMode(false);\n    }\n\n    _h.kocnx().closeForm();\n  };\n\n  self.designBtn = function (parents) {\n    self.closeAllSubModal(function () {\n      var item = ko.toJS(parents[0]);\n\n      var permit = _h.kocnx().permitPeriodEdit();\n\n      var isPeriodActive = _h.kocnx().periodItem().st === 1;\n\n      if (!item || !isPeriodActive) {\n        return;\n      }\n\n      var canAdd = true;\n\n      for (var i = 0; i < self.editList().length; i++) {\n        if (item.id === self.editList()[i].value()) {\n          canAdd = false;\n          self.editList()[i].active(true);\n          self.focusDesignItem(self.editList()[i]);\n        } else {\n          self.editList()[i].active(false);\n        }\n      }\n\n      if (canAdd) {\n        var record = new _master_model__WEBPACK_IMPORTED_MODULE_1__.DesignItem({\n          type: item.templateTableType,\n          text: item.title,\n          value: item.id,\n          active: true,\n          editable: item.editable,\n          lockedByUserId: item.lockedByUserId,\n          lockedBy: item.lockedBy\n        });\n        self.editList.push(record);\n        self.focusDesignItem(record);\n        self.saveEditList();\n      }\n\n      self.findFocusDesignItem();\n    });\n  };\n\n  self.findFocusDesignItem = function () {\n    var focus = self.editList().filter(function (a) {\n      return a.active();\n    })[0];\n    self.focusDesignItem(focus);\n    return focus;\n  };\n\n  self.getFocusDesignRecord = function () {\n    if (self.focusDesignItem()) {\n      var dataModel = $(\"table.tcs:visible\").data(\"model\");\n      if (dataModel) return {\n        code: dataModel.code,\n        id: dataModel.id,\n        rows: dataModel.rows,\n        cols: dataModel.cols,\n        accountType: dataModel.accountType,\n        defaultColumnNumber: dataModel.defaultColumnNumber,\n        defaultRowNumber: dataModel.defaultRowNumber,\n        folderId: dataModel.folderId,\n        linked: dataModel.linked,\n        name: dataModel.name,\n        periodId: dataModel.periodId,\n        priority: dataModel.priority,\n        tableId: dataModel.tableId,\n        tableTemplateType: dataModel.tableTemplateType\n      };else return {\n        id: self.focusDesignItem().value(),\n        name: self.focusDesignItem().text()\n      };\n    }\n  };\n\n  self.closeDesignItem = function (item) {\n    var id = item.value();\n    var editable = item.editable();\n    self.closeDesign(item, function () {\n      self.clearEditable(id, editable);\n    });\n  };\n\n  self.clearEditable = function (id, editable) {\n    if (editable) {\n      var userId = _h.kocnx().currentUser().ui;\n\n      var target = self.records().filter(function (a) {\n        return a.id() === id;\n      });\n\n      if (target.length && userId === target[0].lockedByUserId()) {\n        target[0].editable(false);\n        target[0].lockedBy(undefined);\n        target[0].lockedByUserId(undefined);\n      }\n    }\n\n    self.postTemplateEditable(id, false, function () {});\n  };\n\n  self.closeDesign = function (item, callback) {\n    self.closeAllSubModal(function () {\n      var record = self.getFocusDesignRecord();\n      var arrayData = $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"toServer\");\n\n      if (!arrayData || !arrayData[1]) {\n        self.afterCloseDesignItem(item);\n        self.findFocusDesignItem();\n        callback(true);\n      } else {\n        var model = arrayData[0];\n\n        var confirmText = _h.getLocalizedText(\"designCloseAlert\");\n\n        confirmText = confirmText.replace(\"__\", \"\\\"\".concat(item.text(), \"\\\"\"));\n\n        _h.confirmTableTemplateAlert(confirmText, function (res) {\n          switch (res) {\n            case true:\n              self.saveChanges(model, function (dataRes) {\n                if (dataRes !== false) {\n                  if (_h.any(dataRes.bindErrors)) $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"setWarning\", dataRes.bindErrors);\n                  if (_h.any(dataRes.cellsTag)) $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"refreshCellsTag\", dataRes.cellsTag);\n                  self.afterCloseDesignItem(item);\n                  self.findFocusDesignItem();\n                  callback(true);\n                }\n              });\n              break;\n\n            case false:\n              self.afterCloseDesignItem(item);\n              self.findFocusDesignItem();\n              callback(true);\n              break;\n          }\n        }, true);\n      }\n    });\n  };\n\n  self.closeGroupDesign = function (item, callback, confirm) {\n    self.closeAllSubModal(function () {\n      var arrayData = $(\"#rg-\" + item.value()).find(\".rp-gen\").rg(\"toServer\");\n\n      if (!arrayData || !arrayData[1] || !confirm) {\n        self.afterCloseDesignItem(item);\n        self.findFocusDesignItem();\n        callback(true);\n      } else {\n        var model = arrayData[0];\n        self.saveChanges(model, function (dataRes) {\n          self.afterCloseDesignItem(item);\n          self.findFocusDesignItem();\n          callback(true);\n        });\n      }\n    });\n  };\n\n  self.afterCloseDesignItem = function (item) {\n    var index;\n    if (!item) return;\n\n    for (var i = 0; i < self.editList().length; i++) {\n      if (!item || !item.value) {\n        x = 1;\n      }\n\n      if (item.value() === self.editList()[i].value()) {\n        index = i;\n      }\n    }\n\n    if (self.editList().length === 1) {\n      self.editList.remove(item);\n      self.saveEditList();\n      return;\n    }\n\n    if (self.editList()[index].active() === false) {\n      self.editList.remove(item);\n      self.saveEditList();\n      return;\n    }\n\n    if (index === 0 && self.editList().length > 1) {\n      self.editList()[index + 1].active(true);\n      item.active(false);\n      self.editList.remove(item);\n      self.saveEditList();\n      return;\n    }\n\n    if (index > 0) {\n      self.editList()[index - 1].active(true);\n      item.active(false);\n      self.editList.remove(item);\n      self.saveEditList();\n      return;\n    }\n  };\n\n  self.saveChanges = function (model, callback) {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/tablestructure/postsaveexceldata\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          var text = _h.getApiMessage(\"PostExcelDataSuccess\");\n\n          _h.successToast(text);\n\n          callback(data.bindErrors);\n        }\n      },\n      error: function error(data) {\n        var text = _h.getApiMessage(\"PostExcelDataError\");\n\n        _h.failToast(text);\n\n        callback(false);\n      }\n    });\n  };\n\n  self.saveEditList = function () {\n    var list = ko.toJS(self.editList());\n\n    var key = \"TableTemplateEditList_\" + _h.kocnx().periodItem().pi;\n\n    clientStorage.setSetting([{\n      key: key,\n      value: JSON.stringify(list)\n    }]);\n  };\n\n  self.createBtn = function () {\n    self.getLastPriority(function (res) {\n      if (res !== null) {\n        _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.TableTemplateForm(self, false, res));\n      }\n    });\n  };\n\n  self.editBtn = function () {\n    if (!self.checkForEdit()) {\n      return;\n    }\n\n    self.getLastPriority(function (res) {\n      if (res !== null) {\n        _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.TableTemplateForm(self, true, res));\n      }\n    });\n  };\n\n  self.previewDefaultBtn = function () {\n    var id = self.getFocusDesignRecord().id;\n    self.getTableTemplatePreview(id, function (res) {\n      if (res) _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.TableTemplatePreviewDefault(self, res));\n    });\n  };\n\n  self.getTableTemplatePreview = function (id, callback) {\n    if (_h.isEmpty(id)) {\n      id = self.getSelectedRecord().id();\n    }\n\n    self.apiService.request({\n      name: \"getPreviewOptions\",\n      data: {\n        id: id\n      },\n      success: function success(data) {\n        callback(data);\n      },\n      error: function error() {\n        callback(null);\n      }\n    });\n  };\n\n  self.savePreviewDefault = function (m) {\n    var item = m[1];\n    var model = item.toServer();\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/tabletemplate/postpreviewoptions\",\n      data: model,\n      success: function success(data) {\n        toast.success(self.entityName, 'custom', 'PreviewDefault');\n\n        _h.kocnx().closeForm();\n      },\n      error: function error(data) {}\n    });\n  };\n\n  self.previewBtn = function () {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/tabletemplate/postPreview\",\n      data: {\n        tableTemplateId: self.getSelectedRecord().id()\n      },\n      success: function (data) {\n        if (!_h.isEmpty(data)) {\n          _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.TableTemplatePreview(self, data));\n        }\n      }.bind(this),\n      error: function error() {\n        toast.error(\"TableTemplate\", 'get', \"Preview\");\n      }\n    });\n  };\n\n  self.exportExcelBtn = function (type) {\n    var model = {\n      controllerName: 20,\n      inputData: {\n        tableTemplateId: 0,\n        idList: []\n      }\n    };\n\n    switch (type) {\n      case \"1\":\n        // rpg\n        var record = self.getFocusDesignRecord();\n        var arrayData = $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"toServer\", true);\n        model.inputData.tableTemplateId = record.id;\n        model.inputData.data = arrayData[0];\n        break;\n\n      case \"3\":\n        //multi\n        var list = self.multiCommandExecute(\"selectedItems\");\n\n        if (self.backupSelectedRecords().length > 0) {\n          model.inputData.idList = self.backupSelectedRecords();\n        } else {\n          list.filter(function (a) {\n            return model.inputData.idList.push(a.id());\n          });\n        }\n\n        break;\n\n      default:\n        model.inputData.tableTemplateId = self.getSelectedRecord().id();\n        break;\n    }\n\n    _h.kocnx().createExcel(model);\n  };\n\n  self.exportExcelsBtn = function () {\n    self.exportExcelBtn(\"3\");\n  };\n\n  self.exportPdfBtn = function (type) {\n    var model = {\n      controllerName: 20,\n      inputData: {\n        tableTemplateId: 0\n      }\n    };\n\n    switch (type) {\n      case \"1\":\n        // rpg\n        var record = self.getFocusDesignRecord();\n        var arrayData = $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"toServer\", true);\n        model.inputData.tableTemplateId = record.id;\n        model.inputData.data = arrayData[0];\n        break;\n\n      default:\n        model.inputData.tableTemplateId = self.getSelectedRecord().id();\n        break;\n    }\n\n    _h.kocnx().createPdf(model);\n  };\n\n  self.checkForEdit = function () {\n    var record = self.getSelectedRecord();\n    var inEdit = self.editList().filter(function (a) {\n      return a.value() === record.id();\n    }).length > 0;\n\n    if (inEdit) {\n      var text = _h.getApiMessage(\"EditLockedTableTemplate\");\n\n      _h.failToast(text);\n\n      return false;\n    }\n\n    return true;\n  };\n\n  self.copyBtn = function () {\n    var record = self.getSelectedRecord();\n\n    if (!self.checkForEdit()) {\n      return;\n    }\n\n    self.apiService.request({\n      name: \"postCopy\",\n      data: {\n        id: record.id()\n      },\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          toast.success(self.entityName, 'custom', \"Copy\");\n          self.afterCreate(data.models);\n          self.getTableTemplateList();\n        }\n      },\n      error: function error() {\n        toast.error(self.entityName, 'custom', \"Copy\");\n      }\n    });\n  };\n\n  self.importFileBtn = function () {\n    _h.kocnx().importFileBtn(undefined, self, \"BackUp\");\n  };\n\n  self.exportFileBtn = function () {\n    if (self.backupSelectedRecords().length > 0) {\n      var model = {\n        idList: self.backupSelectedRecords()\n      };\n      self.apiService.request({\n        name: \"getToExport\",\n        data: model,\n        success: function success(data) {\n          if (!_h.isNullOrEmpty(data)) {\n            toast.success(self.entityName, 'custom', 'ExportFile');\n\n            _h.downloadFile(data);\n\n            self.backupSelectedRecords.removeAll();\n          }\n        },\n        error: function error() {\n          toast.error(self.entityName, 'custom', 'ExportFile');\n        }\n      });\n    }\n  };\n\n  self.init = function () {\n    self.iconSize(\"icon-image-xsmall\");\n    self.getTreeSelectList();\n    self.getTableTemplateList();\n    self.fillTableProperties();\n    self.getRecords();\n\n    var key = \"TableTemplateEditList_\" + _h.kocnx().periodItem().pi;\n\n    var model = clientStorage.getSetting(key);\n\n    if (model !== null && model !== undefined) {\n      var list = JSON.parse(model);\n\n      if (_h.any(list)) {\n        for (var i = 0; i < list.length; i++) {\n          var record = new _master_model__WEBPACK_IMPORTED_MODULE_1__.DesignItem(list[i]);\n          self.editList.push(record);\n          if (record.active()) self.focusDesignItem(record);\n        }\n\n        self.showList(false);\n      }\n    }\n\n    self.getFolderList();\n    self.setting().init();\n    self.customStyleMenuModel().fillCellStyle();\n    self.getPeriods();\n    self.internal = setInterval(30000, function () {\n      self.getLockData();\n    });\n  };\n\n  self.copyClipboard = function () {\n    ko.utils.arrayFilter(self.records(), function (record) {\n      if (record[\"list\"]) {\n        ko.utils.arrayFilter(record.list(), function (innerRecord) {\n          if (innerRecord.selected() && self.backupSelectedRecords().indexOf(innerRecord.id()) === -1) self.backupSelectedRecords.push(innerRecord.id());\n          if (!innerRecord.selected() && self.backupSelectedRecords().indexOf(innerRecord.id()) !== -1) self.backupSelectedRecords.remove(innerRecord.id());\n        });\n      } else {\n        if (record.selected() && self.backupSelectedRecords().indexOf(record.id()) === -1) self.backupSelectedRecords.push(record.id());\n        if (!record.selected() && self.backupSelectedRecords().indexOf(record.id()) !== -1) self.backupSelectedRecords.remove(record.id());\n      }\n    });\n  };\n\n  self.refreshTable = function () {\n    self.getRecords();\n    self.getTreeSelectList();\n  };\n\n  self.refreshCellSpecMenu = function () {\n    if (self.cellSpecMenuModel.show()) {\n      var model = self.getSpecCellData();\n      self.cellSpecMenuModel.init(model);\n    }\n  };\n\n  self.getSpecCellData = function () {\n    var record = self.getFocusDesignRecord();\n    var selectedItems = $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"getSelectedCells\");\n\n    if (selectedItems.length === 1) {\n      var nodes = $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"getCellValues\");\n      var columnModel = $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"getTotalCostModel\", selectedItems[0].value);\n      var model = {\n        element: null,\n        viewType: \"cell\",\n        parent: self,\n        cell: selectedItems[0],\n        templateTableType: record.templateTableType,\n        nodeCount: nodes.length,\n        sortDirection: columnModel.sortDirection,\n        groupType: columnModel.groupType\n      };\n    }\n\n    if (selectedItems.length > 1) {\n      var model = {\n        element: null,\n        viewType: \"cells\",\n        parent: self,\n        templateTableType: record.templateTableType,\n        cellCount: selectedItems.length\n      };\n    }\n\n    return model;\n  };\n\n  self.toggleCellSpecMenu = function () {\n    var record = self.getFocusDesignRecord();\n\n    if (record) {\n      var selectedItems = $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"getSelectedCells\");\n\n      if (selectedItems.length > 0) {\n        self.cellSpecMenuModel.show(!self.cellSpecMenuModel.show());\n        self.refreshCellSpecMenu();\n      }\n    } else {\n      self.cellSpecMenuModel.show(false);\n    }\n  };\n\n  self.toggleCustomStyleMenu = function () {\n    var focusItem = self.findFocusDesignItem();\n    self.showCustomStyleMenu(!self.showCustomStyleMenu());\n    $(\".custom-styles-menu\").draggable({\n      scroll: true,\n      handle: \".customstyle-drag-handle\"\n    });\n  };\n\n  self.toggleFullScreen = function () {\n    self.fullScreen(!self.fullScreen());\n\n    if (self.fullScreen()) {\n      $(\".menu-box\").css(\"display\", \"none\");\n      $(\".header-bar\").css(\"display\", \"none\");\n    } else {\n      $(\".menu-box\").css(\"display\", \"\");\n      $(\".header-bar\").css(\"display\", \"\");\n    }\n  };\n\n  ko.utils.extend(self, new RGCloseUtility(self));\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"TableTemplate\",\n    apiService: {\n      actionList: [\"filterby\", \"post\", \"put\", \"delete\", \"postcopy\", \"postpreview\", \"getpreviewoptions\", \"postImport\", \"gettoexport\"]\n    },\n    buttons: [{\n      name: 'edit',\n      access: true,\n      icon: 'Edit',\n      cMenu: true\n    }, {\n      name: 'delete',\n      access: true,\n      icon: 'Delete',\n      cMenu: true\n    }, {\n      name: 'up',\n      access: true,\n      icon: 'Up',\n      cMenu: true\n    }, {\n      name: 'down',\n      access: true,\n      icon: 'Down',\n      cMenu: true\n    }, {\n      name: 'adminUnlock',\n      access: true,\n      icon: 'UnlockTemplate',\n      cMenu: true\n    }, {\n      name: 'importFile',\n      access: true,\n      icon: 'ImportFile',\n      cMenu: true\n    }, {\n      name: 'exportFile',\n      access: true,\n      icon: 'ExportFile',\n      cMenu: true\n    }, {\n      name: 'exportPdf',\n      access: true,\n      icon: 'ExportPdf',\n      cMenu: true\n    }, {\n      name: 'exportExcel',\n      access: true,\n      icon: 'ExportExcel',\n      cMenu: true\n    }, {\n      name: 'exportExcels',\n      access: true,\n      icon: 'ExportExcels',\n      cMenu: true\n    }, {\n      name: 'preview',\n      access: true,\n      icon: 'Preview',\n      cMenu: true\n    }, {\n      name: 'copy',\n      access: true,\n      icon: 'Copy',\n      cMenu: true\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      templateName: \"toolsbtn-tabletemplate-template\",\n      access: false,\n      cMenu: false\n    }, {\n      name: 'create',\n      access: true,\n      cMenu: false\n    }],\n    extraParams: [\"lastPriority\"],\n    filters: [],\n    sortDirection: \"Ascending\",\n    sortProperty: \"priority\",\n    context: self,\n    cols: tabletemplateModelRes,\n    getList: true,\n    selectRow: true,\n    saveState: true,\n    searchKeyType: \"enter\",\n    tableClass: \"table ko-tbl tbl-template\",\n    styleRow: \"styleRowValue\",\n    isMultiSelectRows: true,\n    folderManagement: true,\n    contextMenu: true,\n    resizable: true\n  }));\n  self.countSelectedRecord = ko.pureComputed(function () {\n    if (self.records() && self.records().length) {\n      var count = 0;\n      ko.utils.arrayFilter(self.records(), function (record) {\n        if (record['list'] === undefined) {\n          if (record.selected()) count++;\n        } else {\n          if (_h.any(record['list']())) for (var i = 0; i < record['list']().length; i++) {\n            if (record['list']()[i].selected()) count++;\n          }\n        }\n      });\n      return count;\n    }\n\n    return 0;\n  });\n\n  self.getCountSelectedRecord = function () {\n    var aaray = 0;\n    ko.utils.arrayFilter(self.records(), function (record) {\n      if (record['list'] === undefined) {\n        if (record.selected()) count++;\n      } else {\n        if (_h.any(record['list']())) for (var i = 0; i < record['list']().length; i++) {\n          if (record['list']()[i].selected()) count++;\n        }\n      }\n    });\n    return count;\n  };\n\n  self.btnVisibility = ko.computed(function () {\n    var permit = _h.kocnx().permitPeriodEdit();\n\n    var isPeriodActive = _h.kocnx().periodItem().st === 1;\n    var list = self.multiCommandExecute(\"selectedItems\");\n    var count = list.length;\n\n    if (count === 0 || count > 1) {\n      self.visedit(false);\n      self.visdelete(false);\n      self.vispreview(false);\n      self.viscopy(false);\n      self.visup(false);\n      self.visdown(false);\n      self.visexportPdf(false);\n      self.visexportExcel(false);\n      self.visadminUnlock(false);\n    }\n\n    if (count === 1) {\n      var priority = list[0].priority();\n      self.visedit(permit);\n      self.visdelete(permit);\n      self.vispreview(isPeriodActive);\n      self.viscopy(permit);\n      self.visup(permit && priority > 1);\n      self.visdown(permit && self.lastPriority() !== priority);\n      self.visexportPdf(true);\n      self.visexportExcel(true);\n\n      var cond = list[0].editable() === true && list[0].lockedByUserId() !== _h.kocnx().loginCompanyId();\n\n      self.visadminUnlock(cond);\n      self.visexportExcels(false);\n    }\n\n    self.visexportFile(self.backupSelectedRecords().length > 0);\n    self.visexportExcels(self.backupSelectedRecords().length > 0 || count > 1);\n    self.visimportFile(true);\n    self.viscreate(permit);\n    self.vishelp(true);\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n\n  self.renderedHandler = function () {\n    if (self.groupProperty()) {\n      var en = self.entityName;\n      var table = $(\".\" + en + \"-tbl\");\n      var colList = table.find(\"thead th\").get();\n\n      if (colList.length) {\n        var count = colList.filter(function (a) {\n          return a.style.display !== \"none\";\n        }).length;\n        self.colSpan(count - 1);\n      }\n    }\n  };\n\n  self.tabMenuItems = ko.computed(function () {\n    var array = [];\n\n    for (var i = 0; i < tabMenuItems.length; i++) {\n      array.push({\n        visName: tabMenuItems[i].visName,\n        text: tabMenuItems[i].text,\n        visible: true,\n        action: self[tabMenuItems[i].action],\n        icon: tabMenuItems[i].visName\n      });\n    }\n\n    return array;\n  });\n\n  self.refreshPage = function () {\n    if (self.firstLoadError) {\n      self.editList.removeAll();\n      self.init();\n      self.firstLoadError = false;\n    } else {//var record = self.getFocusDesignRecord();\n      //var arrayData = $(\"#rg-\" + record.id).find(\".rp-gen\").rg(\"toServer\");\n      //if (!arrayData && arrayData[0] && !arrayData[1]) {\n      //}\n    }\n  };\n\n  self.getDeleteData = function (id, callback) {\n    self.apiService.request({\n      name: \"/api/tabletemplate/gettemplatesummary\",\n      data: {\n        id: id\n      },\n      success: function success(data) {\n        callback(data);\n      },\n      error: function error() {\n        callback(null);\n      }\n    });\n  };\n\n  self.deleteBtn = function () {\n    var record = self.getSelectedRecord();\n    var id = record.id();\n\n    if (!self.checkForEdit()) {\n      return;\n    }\n\n    id = record.id();\n    self.getDeleteData(id, function (list) {\n      if (_h.any(list)) {\n        var confirmText = _h.getApiMessage(\"DeleteTableTemplateConfirm\");\n\n        var strings = [];\n        list.filter(function (a) {\n          return strings.push(a.text);\n        });\n        var text = strings.join(\", \");\n        confirmText = confirmText.replace(\"__\", text);\n\n        _h.confirmDeleteAlert(confirmText, function (res) {\n          if (res) {\n            self[\"delete\"](id);\n          }\n        });\n      } else {\n        var confirmText = toast.createMessage(self.entityName, 'del', null, 'confirm');\n\n        _h.confirmDeleteAlert(confirmText, function (res) {\n          if (res) {\n            self[\"delete\"](id);\n          }\n        });\n      }\n    });\n  };\n\n  self[\"delete\"] = function (id) {\n    var model = {\n      id: id\n    };\n    self.apiService.request({\n      name: \"delete\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          self.afterDelete(id, data.models);\n          self.selectedRecord(null);\n          toast.success(self.entityName, 'del');\n          self.updateExtraParams(data);\n        }\n      },\n      messageType: 'del',\n      messageKey: self.entityName\n    });\n  };\n\n  self.getLockData = function () {\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/common/getlockedlist\",\n      data: {\n        controllerName: 19\n      },\n      success: function success(data) {\n        if (_h.any(data)) self.setLockedList(data);\n      },\n      error: function error(data) {}\n    });\n  };\n\n  self.setLockedList = function (list) {\n    if (_h.any(self.records())) for (var j = 0; j < self.records().length; j++) {\n      var target = list.filter(function (a) {\n        return a.id === self.records()[j].id();\n      });\n\n      if (_h.any(target)) {\n        self.records()[j].editable(target[0].editable);\n        self.records()[j].lockedBy(target[0].lockedBy);\n        self.records()[j].lockedByUserId(target[0].lockedByUserId);\n      } else {\n        self.records()[j].editable(false);\n        self.records()[j].lockedBy(undefined);\n        self.records()[j].lockedByUserId(undefined);\n      }\n    }\n    if (_h.any(self.editList())) for (var j = 0; j < self.editList().length; j++) {\n      var target = list.filter(function (a) {\n        return a.id === self.editList()[j].value();\n      });\n\n      if (_h.any(target)) {\n        self.editList()[j].editable(target[0].editable);\n        self.editList()[j].lockedBy(target[0].lockedBy);\n        self.editList()[j].lockedByUserId(target[0].lockedByUserId);\n      } else {\n        self.editList()[j].editable(false);\n        self.editList()[j].lockedBy(undefined);\n        self.editList()[j].lockedByUserId(undefined);\n      }\n    }\n  };\n\n  self.setLockedItem = function (item) {\n    if (_h.any(self.records())) {\n      var target = self.records().filter(function (a) {\n        return a.id() === item.id;\n      });\n\n      if (_h.any(target)) {\n        target[0].editable(item.editable);\n        target[0].lockedBy(item.lockedBy);\n        target[0].lockedByUserId(item.lockedByUserId);\n      }\n    }\n\n    if (_h.any(self.editList())) {\n      var target = self.editList().filter(function (a) {\n        return a.value() === item.id;\n      });\n\n      if (_h.any(target)) {\n        target[0].editable(item.editable);\n        target[0].lockedBy(item.lockedBy);\n        target[0].lockedByUserId(item.lockedByUserId);\n      }\n    }\n  };\n\n  self.adminUnlockBtn = function () {\n    var record = self.getSelectedRecord();\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/common/postadminunlock\",\n      data: {\n        id: record.id(),\n        controllerName: 19\n      },\n      success: function success(data) {\n        var target = self.records().filter(function (a) {\n          return a.id() === record.id();\n        });\n        var targetEditList = self.editList().filter(function (a) {\n          return a.value() === record.id();\n        });\n\n        if (target.length) {\n          target[0].editable(false);\n          target[0].lockedBy(undefined);\n          target[0].lockedByUserId(undefined);\n          targetEditList[0].editable(false);\n          targetEditList[0].lockedBy(undefined);\n          targetEditList[0].lockedByUserId(undefined);\n        }\n      },\n      error: function error(data) {}\n    });\n  };\n\n  self.postTemplateEditable = function (id, editable, calback) {\n    var model = {\n      controllerName: 19,\n      editable: editable,\n      id: id\n    };\n    _util_apiService_js__WEBPACK_IMPORTED_MODULE_3__.ApiService.request({\n      url: \"/api/common/posteditable\",\n      data: model,\n      success: function success(data) {\n        calback(data);\n      },\n      error: function error(data) {},\n      concurrencyHandler: function concurrencyHandler(data) {\n        if (data) {\n          calback(data);\n        }\n      }\n    });\n  };\n\n  self.proxyEditable = function (item) {\n    var userId = _h.kocnx().currentUser().ui;\n\n    if (userId === item.lockedByUserId()) {\n      item.triggerEditable(true);\n      item.triggerEditable(false);\n    } else {\n      var massage = _h.getApiMessage(\"lockedByOtherUserError\");\n\n      toast.custom(\"error\", massage);\n    }\n  };\n}\n\nfunction RGCloseUtility(parent) {\n  var self = this;\n  self.parent = parent;\n\n  self.rightClickSelectTab = function (item) {\n    setTimeout(function () {\n      self.parent.changeDesignItem(item);\n    }, 10);\n  };\n\n  self.closeThis = function (item, e) {\n    var id = item.value();\n    var editable = item.editable();\n    self.parent.closeDesign(item, function () {\n      self.parent.clearEditable(id, editable);\n    });\n  };\n\n  self.closeAll = function (item, e) {\n    if (e !== undefined) {\n      if (self.parent.editList().length < 1) return false;\n    }\n\n    self.getCloseList(\"all\");\n    var needConfirm = self.parent.editList().filter(function (a) {\n      return a[\"changed\"];\n    }).length > 0;\n\n    if (!needConfirm) {\n      self.closeFunc(item, false);\n    } else {\n      var confirmText = _h.getLocalizedText(\"designCloseAllAlert\");\n\n      _h.confirmTableTemplateAlert(confirmText, function (res) {\n        if (res !== undefined) {\n          self.closeFunc(item, res);\n        }\n      }, true);\n    }\n  };\n\n  self.closeFunc = function (item, confirm) {\n    var id = item.value();\n    var editable = item.editable();\n    self.parent.closeGroupDesign(item, function () {\n      self.parent.clearEditable(id, editable);\n\n      if (self.parent.editList().length > 0) {\n        var focus = self.parent.editList().filter(function (a) {\n          return a[\"needClose\"];\n        })[0];\n        if (focus) self.closeFunc(focus, confirm);\n      }\n    }, confirm);\n  };\n\n  self.closeAllButThis = function (item, e) {\n    if (e !== undefined) {\n      if (self.parent.editList().length < 2) return false;\n    }\n\n    self.getCloseList(\"butthis\");\n    var focus = self.parent.editList().filter(function (a) {\n      return a[\"needClose\"];\n    })[0];\n\n    if (!focus) {\n      return;\n    }\n\n    var needConfirm = self.parent.editList().filter(function (a) {\n      return a[\"changed\"];\n    }).length > 0;\n\n    if (!needConfirm) {\n      self.closeFunc(focus, false);\n    } else {\n      var confirmText = _h.getLocalizedText(\"designCloseAllAlert\");\n\n      _h.confirmTableTemplateAlert(confirmText, function (res) {\n        if (res !== undefined) {\n          self.closeFunc(focus, res);\n        }\n      }, true);\n    }\n  };\n\n  self.closeRight = function (item, e) {\n    if (e !== undefined) {\n      if (self.parent.editList().length < 2) return false;\n    }\n\n    self.getCloseList(\"right\");\n    var focus = self.parent.editList().filter(function (a) {\n      return a[\"needClose\"];\n    })[0];\n\n    if (!focus) {\n      return;\n    }\n\n    var needConfirm = self.parent.editList().filter(function (a) {\n      return a[\"changed\"];\n    }).length > 0;\n\n    if (!needConfirm) {\n      self.closeFunc(focus, false);\n    } else {\n      var confirmText = _h.getLocalizedText(\"designCloseAllAlert\");\n\n      _h.confirmTableTemplateAlert(confirmText, function (res) {\n        if (res !== undefined) {\n          self.closeFunc(focus, res);\n        }\n      }, true);\n    }\n  };\n\n  self.closeLeft = function (item, e) {\n    if (e !== undefined) {\n      if (self.parent.editList().length < 2) return false;\n    }\n\n    self.getCloseList(\"left\");\n    var focus = self.parent.editList().filter(function (a) {\n      return a[\"needClose\"];\n    })[0];\n\n    if (!focus) {\n      return;\n    }\n\n    var needConfirm = self.parent.editList().filter(function (a) {\n      return a[\"changed\"];\n    }).length > 0;\n\n    if (!needConfirm) {\n      self.closeFunc(focus, false);\n    } else {\n      var confirmText = _h.getLocalizedText(\"designCloseAllAlert\");\n\n      _h.confirmTableTemplateAlert(confirmText, function (res) {\n        if (res !== undefined) {\n          self.closeFunc(focus, res);\n        }\n      }, true);\n    }\n  };\n\n  self.getCloseList = function (type) {\n    var focus = self.parent.editList().filter(function (a) {\n      return a.active();\n    })[0];\n    var focusIndex = self.parent.editList().indexOf(focus);\n    ko.utils.arrayForEach(self.parent.editList(), function (item, index) {\n      var condtion = true;\n\n      switch (type) {\n        case \"all\":\n          condtion = true;\n          break;\n\n        case \"left\":\n          condtion = index > focusIndex;\n          break;\n\n        case \"right\":\n          condtion = index < focusIndex;\n          break;\n\n        case \"butthis\":\n          condtion = index !== focusIndex;\n          break;\n      }\n\n      if (condtion) {\n        var arrayData = $(\"#rg-\" + item.value()).find(\".rp-gen\").rg(\"toServer\");\n\n        if (arrayData) {\n          var model = arrayData[0];\n          var isChanged = arrayData[1];\n\n          if (model && isChanged) {\n            item.needClose = true;\n            item.changed = true;\n          } else {\n            item.needClose = true;\n            item.changed = false;\n          }\n        } else {\n          item.needClose = true;\n          item.changed = false;\n        }\n      }\n    });\n  };\n}\n\n$(document).on(\"focus\", '.focus-area', function (e) {\n  var loc = $(e.currentTarget).attr(\"data-loc\");\n  window.resSecondDomain = loc;\n});\n\n//# sourceURL=webpack://domino/./src/scripts/pages/tabletemplate/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/trees/model.js":
/*!******************************************!*\
  !*** ./src/scripts/pages/trees/model.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"NodeForm\": () => (/* binding */ NodeForm),\n/* harmony export */   \"NodeValuePart\": () => (/* binding */ NodeValuePart),\n/* harmony export */   \"NodeValuePartViewModel\": () => (/* binding */ NodeValuePartViewModel),\n/* harmony export */   \"Tree\": () => (/* binding */ Tree),\n/* harmony export */   \"TreeForm\": () => (/* binding */ TreeForm),\n/* harmony export */   \"TreeSettingForm\": () => (/* binding */ TreeSettingForm)\n/* harmony export */ });\n/* harmony import */ var _util_apiService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/apiService */ \"./src/scripts/util/apiService.js\");\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar _require = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\"),\n    BaseModel = _require.BaseModel,\n    BaseFormModel = _require.BaseFormModel,\n    FormBuilder = _require.FormBuilder,\n    BaseSecondaryForm = _require.BaseSecondaryForm,\n    BaseInnerModel = _require.BaseInnerModel;\n\n\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\n\nvar Tree = /*#__PURE__*/function (_BaseModel) {\n  _inherits(Tree, _BaseModel);\n\n  var _super = _createSuper(Tree);\n\n  function Tree(model) {\n    var _this;\n\n    _classCallCheck(this, Tree);\n\n    _this = _super.call(this, model);\n    _this.shortDesc = ko.pureComputed(function () {\n      var valueType = _h.getEnumText(valueTypes, this.valueType());\n\n      var currencyType;\n\n      switch (this.treeType()) {\n        case 0:\n          currencyType = _h.getEnumText(currencyTypes, this.currencyType());\n          break;\n\n        case 3:\n          valueType = \"تلفیقی عددی \";\n          break;\n\n        case 2:\n          valueType = \"تلفیقی مالی \";\n          break;\n      }\n\n      var asType = this.treeType() === 1 ? 'جریان وجوه نقد' : _h.getEnumText(assignmentTypes, this.assignmentType());\n      var text = asType + \" - \" + valueType;\n      if (currencyType) text = text + \" - \" + currencyType;\n      if (this.accountType()) text += \" - \" + _h.getEnumText(accountTypes, this.accountType());\n      return text;\n    }, _assertThisInitialized(_this));\n    _this.shortName = ko.pureComputed(function () {\n      var name = this.name();\n\n      if (!_h.isEmpty(name)) {\n        if (name.length < 50) return name + \" (\" + this.code() + \")\";\n        return name.substr(0, 47) + \"...\" + \" (\" + this.code() + \")\";\n      }\n\n      return \"\";\n    }, _assertThisInitialized(_this));\n    return _this;\n  }\n\n  return _createClass(Tree);\n}(BaseModel);\nvar TreeForm = /*#__PURE__*/function (_BaseFormModel) {\n  _inherits(TreeForm, _BaseFormModel);\n\n  var _super2 = _createSuper(TreeForm);\n\n  function TreeForm(viewModel, editMode) {\n    var _this2;\n\n    _classCallCheck(this, TreeForm);\n\n    _this2 = _super2.call(this, viewModel, editMode, [\"gParent\"]);\n\n    if (!editMode) {\n      _this2.id(0);\n\n      _this2.cbCompanyId = ko.observable(_h.kocnx().loginCompanyId());\n\n      _this2.valueType(viewModel.valueType());\n\n      _this2.name(\"\");\n\n      _this2.description(\"\");\n\n      _this2.currencyType = ko.observable(1);\n    }\n\n    _this2.isOwner = _this2.cbCompanyId() === _h.kocnx().loginCompanyId();\n\n    if (_h.kocnx().loginCompanyType() === 0) {\n      _this2.treeTypes = ko.observableArray(treeTypes);\n    } else {\n      _this2.treeTypes = ko.observableArray(treeTypes2);\n    }\n\n    _this2.disabledAccountType = ko.computed(function () {\n      if (!this.isOwner) return true;\n      var cond = this.treeType() !== 0 && this.treeType() !== 1 && this.treeType() !== 4;\n      if (this.editMode()) return this.hasChildren() || cond;else return cond;\n    }, _assertThisInitialized(_this2));\n    _this2.condFirst = ko.computed(function () {\n      return this.treeType() === 0;\n    }, _assertThisInitialized(_this2));\n    _this2.condSecond = ko.computed(function () {\n      if (!this.isOwner) return true;\n      if (!this.editMode()) return false;\n      return this.editMode() === true && this.hasChildren() === true;\n    }, _assertThisInitialized(_this2));\n\n    _this2.setValidationObject();\n\n    _this2.createForm();\n\n    return _this2;\n  }\n\n  _createClass(TreeForm, [{\n    key: \"setValidationObject\",\n    value: function setValidationObject() {\n      var self = this;\n      self.validationObject = ko.validatedObservable({\n        name: self.name.extend({\n          required: true,\n          minLength: 3,\n          maxLength: 100,\n          remoteIsUniqueRule: {\n            params: [self.id, \"Tree\", \"name\"]\n          }\n        }),\n        treeType: self.treeType.extend({\n          required: true\n        }),\n        pattern: self.pattern.extend({\n          required: true,\n          min: 5,\n          max: 24,\n          numberOnly: null\n        }),\n        accountType: self.accountType.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return _h.contains([0, 1, 4], self.treeType());\n            }\n          }\n        }),\n        currencyType: self.currencyType.extend({\n          required: {\n            onlyIf: function onlyIf() {\n              return _h.contains([0], self.treeType());\n            }\n          }\n        })\n      });\n    }\n  }, {\n    key: \"filterTree\",\n    value: function filterTree(item) {\n      if (_h.kocnx().loginCompanyType() === 1 && item.value !== 2 && item.value !== 3) {\n        return true;\n      }\n\n      return _h.kocnx().loginCompanyType() === 0;\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'txb',\n        val: this.name,\n        dis: !this.isOwner\n      }, {\n        t: 'txb',\n        val: this.pattern,\n        dis: this.condSecond\n      }, true), this.createLine({\n        t: 'slc',\n        val: this.treeType,\n        options: this.treeTypes,\n        dis: this.editMode() || !this.isOwner\n      }, {\n        t: 'slc',\n        val: this.accountType,\n        options: accountTypes,\n        dis: this.disabledAccountType\n      }, true, 30), this.createLine({\n        t: 'slc',\n        val: this.currencyType,\n        options: currencyTypes,\n        dis: !this.isOwner\n      }, null, this.condFirst, 30), this.createLine({\n        t: 'slc',\n        val: this.folderId,\n        options: this.parentVM.folderList\n      }, null, true, 30), this.createLine({\n        t: 'txa',\n        val: this.description\n      }, undefined, true, 30)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'create',\n            vis: !this.editMode(),\n            click: this.parentVM.create\n          }, {\n            name: 'edit',\n            vis: this.editMode,\n            click: this.parentVM.edit\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return TreeForm;\n}(BaseFormModel);\nfunction NodeForm() {\n  var _ = this;\n\n  _.liTarget = null;\n  _.uid = ko.observable();\n  _.id = ko.observable();\n  _.code = ko.observable();\n  _.treeType = ko.observable();\n  _.valueType = ko.observable();\n  _.formula = ko.observable();\n  _.assignmentType = ko.observable();\n  _.parentNodeTemplate = ko.observable();\n  _.showAccountType = ko.observable(false);\n  _.accountType = ko.observable();\n  _.parentId = ko.observable();\n  _.nodeType = ko.observable();\n  _.nodeTemplate = ko.observable();\n  _.name = ko.observable(\"\");\n  _.description = ko.observable();\n  _.cashFlowCalculation = ko.observable();\n  _.consolidateCompany = ko.observable();\n  _.companyList = ko.observableArray();\n  _.addByAutoComplete = ko.observable();\n  _.cbCompanyId = ko.observable();\n  _.refreshValue = ko.observable(false);\n\n  _.createValueProperty = function (treeType) {\n    switch (treeType) {\n      case 0:\n      case 1:\n      case 4:\n      case 5:\n        _.value = ko.observable();\n        break;\n\n      case 2:\n        _.value = ko.observable().extend({\n          inputNumberFormatter: {\n            negative: true,\n            decimalNumber: false\n          },\n          treeFiscalValueValidate: true\n        });\n        break;\n\n      case 3:\n        _.value = ko.observable().extend({\n          inputNumberFormatter: {\n            negative: true,\n            decimalNumber: true\n          },\n          treeNumeralDecimalValueValidate: true\n        });\n        break;\n\n      case 6:\n        _.value = ko.observable().extend({\n          treeNonNumeralValueValidate: true\n        });\n        break;\n\n      case 7:\n        _.value = ko.observable().extend({\n          inputNumberFormatter: {\n            negative: true,\n            decimalNumber: true\n          },\n          treeNumeralDecimalValueValidate: true\n        });\n        break;\n\n      case 8:\n        _.value = ko.observable().extend({\n          inputNumberFormatter: {\n            negative: true,\n            decimalNumber: false\n          },\n          treeFiscalValueValidate: true\n        });\n        break;\n    }\n  };\n\n  _.fillModel = function (model) {\n    _.refreshValue(true);\n\n    if (model.uid) _.uid(model.uid);\n\n    _.id(model.id);\n\n    if (!ko.isObservable(_.value)) _.createValueProperty(model.tt);\n    _.liTarget = model.liTarget;\n    if (model.parentNodeTemplate) _.parentNodeTemplate(model.parentNodeTemplate);\n    if (model.co !== \"null\") _.code(model.co);\n\n    _.assignmentType(model.as);\n\n    _.treeType(model.tt);\n\n    if (model.pId) _.parentId(model.pId);\n\n    _.valueType(model.vt);\n\n    if (model.v !== \"null\") {\n      _.value(model.v);\n    }\n\n    _.nodeType(model.nt);\n\n    _.accountType(model.at);\n\n    _.name(model.na);\n\n    if (model.f !== \"null\") _.formula(model.f);\n    if (_h.isNullOrEmpty(model.cfc) || model.cfc === 0) _.cashFlowCalculation(1);else _.cashFlowCalculation(model.cfc);\n    if (_h.isNullOrEmpty(model.nte) || model.nte === 0) _.nodeTemplate(null);else _.nodeTemplate(model.nte);\n    if (_h.isNullOrEmpty(model.cc) || model.cc === 0) _.consolidateCompany(null);else _.consolidateCompany(model.cc);\n\n    _.description(model.de);\n\n    _.isShowAccountType(model);\n\n    _.cbCompanyId(model.ci);\n\n    _.refreshValue(false);\n  };\n\n  _.showNodeTemplate = ko.computed(function () {\n    return _.id() === 0 && _.treeType() === 0 && _h.kocnx().loginCompanyType() === 0 && (_h.isNullOrEmpty(_.parentNodeTemplate()) || _.parentNodeTemplate() === 0 || _.parentNodeTemplate() === undefined);\n  });\n\n  _.onChangeFormula = function (val) {\n    _.formula(val);\n  };\n\n  _.isShowAccountType = function (itemTarget) {\n    var res = _h.contains([0, 1, 4], itemTarget.tt);\n\n    _.showAccountType(res);\n  };\n\n  _.validationObject = ko.validatedObservable({\n    name: _.name.extend({\n      required: true,\n      minLength: 2,\n      maxLength: 100\n    }),\n    nodeType: _.nodeType.extend({\n      required: true\n    }),\n    accountType: _.accountType.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          return _h.contains([0, 1, 4], _.treeType());\n        }\n      }\n    }),\n    cashFlowCalculation: _.cashFlowCalculation.extend({\n      required: {\n        onlyIf: function onlyIf() {\n          var context = _h.kocnx();\n\n          var periodClosed = context.periodItem() !== null && context.periodItem() !== undefined && context.periodItem().cl;\n          return !periodClosed && _h.contains([1], _.treeType()) && _.nodeType() === 2;\n        }\n      }\n    }),\n    formula: _.formula.extend({\n      remoteIsValidateFormula: {\n        params: 4\n      }\n    }),\n    code: _.code.extend({\n      minLength: 3,\n      maxLength: 24,\n      remoteIsUniqueRule: {\n        params: [_.id, \"Node\", \"code\"]\n      }\n    })\n  });\n\n  _.toUpdateTree = function () {\n    var uid = _.uid();\n\n    if (_.uid() === \"undefined\") uid = \"\";\n    return {\n      id: _.id(),\n      uid: uid,\n      nt: _.nodeType(),\n      nte: _.nodeTemplate(),\n      co: _.code(),\n      tt: _.treeType(),\n      at: _.accountType(),\n      cfc: _.cashFlowCalculation(),\n      v: _.value(),\n      f: _.formula(),\n      na: _h.clearHtmlTag(_.name()),\n      as: _.assignmentType(),\n      dv: _h.formatTextIfNull(_.value()),\n      de: _h.clearHtmlTag(_.description()),\n      ci: _.cbCompanyId(),\n      children: [],\n      gid: _.addByAutoComplete()\n    };\n  };\n\n  _.isValid = function () {\n    if (!_.validationObject.isValid()) {\n      _.validationObject.errors.showAllMessages();\n\n      return false;\n    }\n\n    return true;\n  };\n\n  _.onNodeAutoSelect = function (controlName, item) {\n    _.addByAutoComplete(item.id);\n\n    item.id = 0;\n\n    _.parentId(model.pi);\n\n    _.fillModel(item);\n  };\n}\nvar NodeValuePartViewModel = /*#__PURE__*/function (_FormBuilder) {\n  _inherits(NodeValuePartViewModel, _FormBuilder);\n\n  var _super3 = _createSuper(NodeValuePartViewModel);\n\n  function NodeValuePartViewModel(id) {\n    var _this3;\n\n    _classCallCheck(this, NodeValuePartViewModel);\n\n    _this3 = _super3.call(this);\n    _this3.width = \"600px\";\n    _this3.caption = ko.observable();\n    _this3.treeName = ko.observable();\n    _this3.nodeName = ko.observable();\n    ko.utils.extend(_assertThisInitialized(_this3), new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_1__.BaseViewModel({\n      entityName: \"NodeValuePart\",\n      apiService: {\n        actionList: [\"filterby\"]\n      },\n      filters: [{\n        name: 'nodeId'\n      }],\n      extraParams: [\"tree\", \"node\", \"sum\"],\n      buttons: [{\n        name: 'help',\n        access: false,\n        cMenu: false\n      }, {\n        name: 'refresh',\n        access: false,\n        cMenu: false\n      }],\n      sortDirection: \"Ascending\",\n      sortProperty: \"company\",\n      context: _assertThisInitialized(_this3),\n      cols: valuepartsModelRes,\n      getList: true,\n      saveState: true,\n      tableStyle: \"font-size: 11px;\",\n      footerTemplate: \"nodevaluepart-footertable-template\",\n      selectRow: false,\n      contextMenu: false\n    }));\n\n    _this3.nodeId(id);\n\n    _this3.createCaption = ko.computed(function () {\n      if (!_h.isEmpty(this.tree())) this.caption(this.tree() + \" - \" + this.node());\n      return \"\";\n    }.bind(_assertThisInitialized(_this3)));\n    _this3.btnVisibility = ko.computed(function () {\n      this.vishelp(true);\n      this.visrefresh(true);\n    }.bind(_assertThisInitialized(_this3)));\n\n    _this3.fillTableProperties();\n\n    _this3.createForm();\n\n    _this3.getRecords();\n\n    return _this3;\n  }\n\n  _createClass(NodeValuePartViewModel, [{\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'nodevaluepart-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return NodeValuePartViewModel;\n}(FormBuilder);\nvar NodeValuePart = /*#__PURE__*/function (_BaseModel2) {\n  _inherits(NodeValuePart, _BaseModel2);\n\n  var _super4 = _createSuper(NodeValuePart);\n\n  function NodeValuePart(model) {\n    _classCallCheck(this, NodeValuePart);\n\n    return _super4.call(this, model);\n  }\n\n  return _createClass(NodeValuePart);\n}(BaseModel);\nvar TreeSettingForm = /*#__PURE__*/function (_BaseSecondaryForm) {\n  _inherits(TreeSettingForm, _BaseSecondaryForm);\n\n  var _super5 = _createSuper(TreeSettingForm);\n\n  function TreeSettingForm(viewModel, model) {\n    var _this4;\n\n    _classCallCheck(this, TreeSettingForm);\n\n    _this4 = _super5.call(this, viewModel, [{\n      name: \"consolidatedNodes\",\n      type: \"ar\",\n      val: model.consolidatedNodes\n    }, {\n      name: \"selectedItems\",\n      type: \"obar\"\n    }, {\n      name: \"selector\",\n      type: \"\",\n      val: \"#tree_view_cs\"\n    }], \"treeSettingCaption\");\n\n    _this4.createForm();\n\n    _this4.configTools();\n\n    return _this4;\n  }\n\n  _createClass(TreeSettingForm, [{\n    key: \"configTools\",\n    value: function configTools() {\n      if (this.consolidatedNodes && this.consolidatedNodes.length) for (var i = 0; i < this.consolidatedNodes.length; i++) {\n        if (this.consolidatedNodes[i].selected) this.selectedItems.push({\n          value: this.consolidatedNodes[i].id\n        });\n        if (this.consolidatedNodes[i].children && this.consolidatedNodes[i].children.length) this.findSelectedChild(this.consolidatedNodes[i].children);\n      }\n      var array = this.consolidatedNodes;\n      setTimeout(function () {\n        $(\"#tree_view_cs\").treeView({\n          tType: \"CompanySetting\",\n          location: \"CompanySetting\",\n          nodes: array,\n          rootId: 10001,\n          permitPeriodEdit: _h.kocnx().permitPeriodEdit()\n        });\n      }, 1);\n    }\n  }, {\n    key: \"findSelectedChild\",\n    value: function findSelectedChild(children) {\n      for (var i = 0; i < children.length; i++) {\n        if (children[i].selected) this.selectedItems.push({\n          value: children[i].id\n        });\n        if (children[i].children && children[i].children.length) this.findSelectedChild(children[i].children);\n      }\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      var items = $(this.selector).treeView(\"selectedCheckedItems\");\n      return {\n        consolidatedNodes: items\n      };\n    }\n  }, {\n    key: \"exportExcelBtn\",\n    value: function exportExcelBtn(formModel, btnm) {\n      var items = $(\"#tree_view_cs\").treeView(\"selectedCheckedItems\");\n      var model = {\n        controllerName: 5,\n        inputData: items\n      };\n\n      _h.kocnx().createExcel(model);\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'treesetting-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'confirmedCaption',\n            vis: _h.kocnx().permitPeriodEdit,\n            click: this.parentVM.confirmSettingNode\n          }, {\n            name: \"custom\",\n            resText: 'exportExcelSetting',\n            vis: true,\n            click: this.exportExcelBtn,\n            icon: \"ExportExcel\"\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return TreeSettingForm;\n}(BaseSecondaryForm);\n\n//# sourceURL=webpack://domino/./src/scripts/pages/trees/model.js?");

/***/ }),

/***/ "./src/scripts/pages/trees/resource.js":
/*!*********************************************!*\
  !*** ./src/scripts/pages/trees/resource.js ***!
  \*********************************************/
/***/ (() => {

eval("window.treeFilterTypes = [{\n  text: \"کد گره\",\n  enText: \"TreeCode\",\n  value: 0\n}, {\n  text: \"عنوان گره\",\n  enText: \"TreeTitle\",\n  value: 2\n}];\nwindow.assignmentTypes = [{\n  text: \"نگاشت\",\n  enText: \"Mapping\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"بارگذاری فایل\",\n  enText: \"Import\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"فرمول\",\n  enText: \"Formula\",\n  value: 4,\n  color: \"\"\n}];\nwindow.nodeTypes = [{\n  text: \"درخت\",\n  enText: \"Root\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"شاخه\",\n  enText: \"Branch\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"برگ\",\n  enText: \"Leaf\",\n  value: 2,\n  color: \"\"\n}];\nwindow.nodeTypes2 = [{\n  text: \"برگ\",\n  enText: \"Leaf\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"شاخه\",\n  enText: \"Branch\",\n  value: 1,\n  color: \"\"\n}];\nwindow.exportTypes = [{\n  text: \"همه گره ها\",\n  enText: \"All\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"گره های فاقد مقدار\",\n  enText: \"NonValue\",\n  value: 1,\n  color: \"\"\n}];\nwindow.nodeTemplates = [{\n  text: \"شاخه مشمول تلفیق\",\n  enText: \"Consolidation\",\n  value: 1,\n  color: \"\"\n}];\nwindow.cashFlowCalculations = [{\n  text: \"دوره جاری منهای دوره مقایسه ای اول\",\n  enText: \"CurrentFirst\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"دوره مقایسه ای اول منهای دوره جاری\",\n  enText: \"ComparativeFirst \",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"دوره جاری منهای دوره مقایسه ای دوم\",\n  enText: \"CurrentSecond\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"دوره مقایسه ای دوم منهای دوره جاری\",\n  enText: \"SecondCurrent\",\n  value: 4,\n  color: \"\"\n}, {\n  text: \"دوره جاری\",\n  enText: \"Current\",\n  value: 5,\n  color: \"\"\n}];\nwindow.treeModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  name: {\n    fa: 'عنوان',\n    colName: 'name',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"template\",\n    templateName: \"treename-table-template\",\n    size: 30\n  },\n  code: {\n    fa: 'کد حساب',\n    colName: 'code',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\",\n    size: 10\n  },\n  accountType: {\n    fa: 'وضعیت مانده',\n    colName: 'accountType',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"enum\",\n    alias: null,\n    size: 10\n  },\n  folderName: {\n    fa: 'پوشه',\n    colName: 'folderName',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: \"folderId\",\n    groupBy: true,\n    groupDir: \"Ascending\",\n    type: \"string\",\n    size: 12\n  },\n  description: {\n    fa: 'شرح',\n    colName: 'description',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    size: 20,\n    type: \"string\",\n    alias: null\n  },\n  pattern: {\n    fa: 'تعداد ارقام کد',\n    colName: 'pattern',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"string\",\n    alias: null\n  },\n  treeType: {\n    fa: 'نوع',\n    colName: 'treeType',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    size: 10,\n    groupBy: true,\n    groupDir: \"Ascending\"\n  },\n  valueType: {\n    fa: 'نوع ارزش',\n    colName: 'valueType',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    size: 8\n  },\n  assignmentType: {\n    fa: 'نحوه مقداردهی',\n    colName: 'assignmentType',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    size: 8,\n    alias: null,\n    groupBy: true,\n    groupDir: \"Ascending\"\n  },\n  folderId: {\n    fa: 'پوشه',\n    colName: 'folderId',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    alias: null,\n    type: \"string\"\n  }\n};\nwindow.treePageRes = {\n  editCaption: {\n    fa: 'ویرایش درختواره'\n  },\n  createCaption: {\n    fa: 'تعریف درختواره جدید'\n  },\n  deleteCaption: {\n    fa: 'حذف درختواره'\n  },\n  createNodeCaption: {\n    fa: 'افزودن زیر مجموعه'\n  },\n  editFormulaNodeCaption: {\n    fa: 'ویرایش فرمول گره'\n  },\n  formulaNodeCaption: {\n    fa: 'ویرایش فرمول گره'\n  },\n  changeToBranchCaption: {\n    fa: 'تبدیل برگ  به شاخه'\n  },\n  changeToLeafCaption: {\n    fa: 'تبدیل شاخه به برگ'\n  },\n  updateNodeCaption: {\n    fa: 'ویرایش گره'\n  },\n  deleteNodesCaption: {\n    fa: 'حذف گروهی گره'\n  },\n  deleteNodeCaption: {\n    fa: 'حذف گره'\n  },\n  paste: {\n    fa: 'چسباندن در ...'\n  },\n  copy: {\n    fa: 'کپی گره های درختواره'\n  },\n  cut: {\n    fa: 'انتقال گره'\n  },\n  selectCopyItem: {\n    fa: 'انتخاب'\n  },\n  activeOrderSubCaption: {\n    fa: 'ترتیب زیرمجموعه'\n  },\n  update: {\n    fa: 'ذخیره '\n  },\n  importExcelCaption: {\n    fa: 'ورود فایل داده های درختواره'\n  },\n  importTreeExcelCaption: {\n    fa: 'ورود داده های درختواره از فایل اکسل'\n  },\n  nodeSelectCaption: {\n    fa: 'انتخاب گره'\n  },\n  treeId: {\n    fa: 'انتخاب درختواره'\n  },\n  nodeId: {\n    fa: 'گره'\n  },\n  exportExcel: {\n    fa: 'خروجی فایل اکسل - فاقد مقدار'\n  },\n  exportExcelSetting: {\n    fa: 'گزارش کاربرد گره های مشمول تلفیق'\n  },\n  exportExcelCaption: {\n    fa: 'دریافت خروجی فایل اکسل'\n  },\n  exportExcelAll: {\n    fa: 'خروجی فایل اکسل - همه گره ها'\n  },\n  exportExcelCompanyCaption: {\n    fa: 'خروجی فایل اکسل - کاربرد گره'\n  },\n  excelExportFormBtn: {\n    fa: 'دریافت فایل'\n  },\n  companyId: {\n    fa: 'شرکت مشمول تلفیق'\n  },\n  createNodeAndNewBtn: {\n    fa: 'ثبت و رکورد جدید'\n  },\n  consolidateCompany: {\n    fa: 'شرکت مشمول تلفیق'\n  },\n  nodeReportsCaption: {\n    fa: 'گزارش کاربرد گره ها'\n  },\n  nodeReportCaption: {\n    fa: 'گزارش کاربرد گره'\n  },\n  nodeUpdateCaption: {\n    fa: 'ذخیره تغییرات گره ها'\n  },\n  cancel: {\n    fa: 'انصراف'\n  },\n  formula: {\n    fa: 'فرمول'\n  },\n  currencyType: {\n    fa: 'نوع ارز'\n  },\n  cashFlowCalculation: {\n    fa: 'نحوه محاسبه مقدار'\n  },\n  filterType: {\n    fa: 'فیلتر'\n  },\n  treeEditor: {\n    fa: 'ویرایشگر'\n  },\n  saveChanges: {\n    fa: 'ذخیره تغییرات'\n  },\n  newTreeCaption: {\n    fa: 'تعین وضعیت درختواره جدید'\n  },\n  changesTreeCaption: {\n    fa: 'تعین وضعیت تغییرات درخت'\n  },\n  nodeTemplate: {\n    fa: 'الگوی شاخه'\n  },\n  EditCaption: {\n    fa: 'ویرایش گره'\n  },\n  nodeType: {\n    fa: 'نوع گره'\n  },\n  showRejected: {\n    fa: 'نمایش درختواره های لغو / حذف شده دوره مرجع'\n  },\n  openSetting: {\n    fa: 'تنظیمات'\n  },\n  treeSettingCaption: {\n    fa: 'تنظیمات درختواره'\n  },\n  ResetTreeConsolidateCaption: {\n    fa: 'بازگشت شاخه های مشمول تلفیق به تنظیمات اولیه'\n  },\n  ResetBranchConsolidateCaption: {\n    fa: 'بازگشت شاخه مشمول تلفیق به تنظیمات اولیه'\n  }\n};\nwindow.valuepartsModelRes = {\n  company: {\n    fa: 'گروه/شرکت',\n    colName: 'company',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"Ascending\",\n    alias: null,\n    size: 30,\n    type: \"string\"\n  },\n  value: {\n    fa: 'مقدار',\n    colName: 'value',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    size: 30,\n    type: \"smoney\"\n  }\n};\nwindow.nodeReportTypes = [{\n  text: \"بند سند اصلاحی\",\n  enText: \"AdjustmentItem\",\n  value: 1\n}, {\n  text: \"حساب مقابل\",\n  enText: \"SubstituteNode\",\n  value: 2\n}, {\n  text: \"مقدار\",\n  enText: \"SetValue\",\n  value: 3\n}, {\n  text: \"فرمول\",\n  enText: \"SetFormula\",\n  value: 4\n}, {\n  text: \"فرمول بندهای اسناد\",\n  enText: \"AdjustmentItemFormula\",\n  value: 5\n}, {\n  text: \"فرمول گره ها\",\n  enText: \"NodeFormula\",\n  value: 6\n}, {\n  text: \"قالب های جدول\",\n  enText: \"ReportTemplate\",\n  value: 7\n}, {\n  text: \"گسترش درختواره\",\n  enText: \"Expansion\",\n  value: 8\n}, {\n  text: \"نگاشت فایل تراز\",\n  enText: \"Mapping\",\n  value: 9\n}, {\n  text: \"نگاشت گره\",\n  enText: \"NodeMapping\",\n  value: 12\n}];\n\n//# sourceURL=webpack://domino/./src/scripts/pages/trees/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/trees/viewModel.js":
/*!**********************************************!*\
  !*** ./src/scripts/pages/trees/viewModel.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"TreeViewModel\": () => (/* binding */ TreeViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _master_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../master/model */ \"./src/scripts/pages/master/model.js\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model */ \"./src/scripts/pages/trees/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n__webpack_require__(/*! ./model */ \"./src/scripts/pages/trees/model.js\");\n\n__webpack_require__(/*! ./resource */ \"./src/scripts/pages/trees/resource.js\");\n\n\n\n\nfunction TreeViewModel() {\n  var _ = this;\n\n  _.filterType = ko.observable(0);\n  _.treeTitle = ko.observable();\n  _.treeValue = ko.observable();\n  _.treeId = ko.observable(0);\n  _.treeType = ko.observable();\n  _.slfOwnerTree = ko.observable(undefined);\n  _.newTree = ko.observable(undefined);\n  _.nodeEditModel = ko.observable();\n  _.showNodeEdit = ko.observable(false);\n  _.showReferenceTab = ko.observable(false);\n  _.searchNodeKey = ko.observable();\n  _.refSearchNodeKey = ko.observable();\n  _.refFilterType = ko.observable(0);\n  _.eButtons = {\n    \"EditNode\": ko.observable(false),\n    \"DeleteNode\": ko.observable(false),\n    \"DeleteNodes\": ko.observable(false),\n    \"CreateNode\": ko.observable(false),\n    \"Sort\": ko.observable(false),\n    \"NodeReport\": ko.observable(false),\n    \"NodeReports\": ko.observable(false),\n    \"ToBranch\": ko.observable(false),\n    \"ToLeaf\": ko.observable(false),\n    \"ExportExcel\": ko.observable(false),\n    \"ExportAllExcel\": ko.observable(false),\n    \"ImportExcel\": ko.observable(false),\n    \"Paste\": ko.observable(false),\n    \"Copy\": ko.observable(false),\n    \"Cut\": ko.observable(false),\n    \"SaveChange\": ko.observable(false),\n    \"Cancel\": ko.observable(false),\n    \"SaveSort\": ko.observable(false),\n    \"Refresh\": ko.observable(false),\n    \"ResetConsolidate\": ko.observable(false),\n    \"Setting\": ko.observable(false)\n  };\n  _.edSelector = \"#tree_view_ed\";\n\n  _.onCallbackAction = function (disable) {\n    for (var k in _.eButtons) {\n      if (_.eButtons.hasOwnProperty(k)) {\n        var param = _.eButtons[k];\n        param(false);\n      }\n    }\n\n    if (disable) {\n      _.eButtons.Refresh(true);\n\n      _.eButtons.Setting(true);\n\n      return;\n    }\n\n    if (!_.treeId()) return;\n\n    var item = _.selectedRowRecord();\n\n    if (item.changeCount() === -1) return;\n    var complexMode = false;\n    var actions = $(_.edSelector).treeView(\"getToolbarData\");\n    if (actions.length) for (var i = 0; i < actions.length; i++) {\n      if (actions[i].visible) _.eButtons[actions[i].name](true);\n      if (actions[i].name === \"Paste\") complexMode = true;\n    }\n\n    _.eButtons.Setting(!complexMode);\n\n    if (_.nodes.length === 0) _.eButtons.CreateNode(true);\n\n    _.eButtons.Refresh(!complexMode);\n  };\n\n  _.onClickToolbar = function (action) {\n    var selectedItems;\n\n    switch (action) {\n      case \"Refresh\":\n        _.refreshEditor();\n\n        break;\n\n      case \"ImportExcel\":\n        selectedItems = $(_.edSelector).treeView(\"selectedItems\");\n\n        if (selectedItems.length === 1) {\n          _.importExcelBtn(selectedItems.id);\n        }\n\n        break;\n\n      case \"ExportAllExcel\":\n      case \"ExportExcel\":\n      case 1:\n      case 2:\n        selectedItems = $(_.edSelector).treeView(\"selectedItems\");\n\n        if (selectedItems.length === 1) {\n          var model = {\n            controllerName: 4,\n            inputData: {\n              id: selectedItems[0].id,\n              getAll: action === \"ExportAllExcel\" || action === 2\n            }\n          };\n\n          _h.kocnx().createExcel(model);\n        }\n\n        break;\n\n      case \"SaveChange\":\n        _.saveChanges();\n\n        break;\n\n      default:\n        $(_.edSelector).treeView(\"exeAction\", action);\n        break;\n    }\n  };\n\n  _.onImportExcel = function () {\n    _.onClickToolbar(\"ImportExcel\");\n  };\n\n  _.onExportAllExcel = function () {\n    _.onClickToolbar(\"ExportAllExcel\");\n  };\n\n  _.onExportExcel = function () {\n    _.onClickToolbar(\"ExportExcel\");\n  };\n\n  _.nodes = [];\n  _.referenceNodes = [];\n  _.currentNodes = [];\n\n  _.onNodeEnterSearchKey = function (d, e) {\n    if (e.keyCode === 13) {\n      if (window.resSecondDomain === \"treeList\") {\n        _.getDiffNodes(function (res) {\n          if (res) {\n            _.configTools(true);\n          }\n        });\n      } else {\n        if (_.showReferenceTab()) {\n          _.getDiffNodes(function (res) {\n            if (res) {\n              _.configTools(true);\n            }\n          });\n        } else {\n          if (_.treeId()) _.getNodes(function (res) {\n            if (res) {\n              _.configTools();\n            }\n          });\n        }\n      }\n    }\n\n    return true;\n  };\n\n  _.treeList = ko.observableArray();\n\n  _.getTreeSelectList = function (callback) {\n    _.apiService.request({\n      name: \"generalTreeList\",\n      data: {\n        controllerName: 4\n      },\n      success: function success(data) {\n        _.treeList.removeAll();\n\n        if (!_h.isNullOrEmpty(data)) {\n          for (var j = 0; j < data.length; j++) {\n            var item = new _master_model__WEBPACK_IMPORTED_MODULE_1__.TreeFormulaSelectItem(data[j]);\n\n            _.treeList.push(item);\n          }\n        }\n\n        callback(true);\n      },\n      error: function error() {\n        var text = _h.getApiMessage(\"ErrorLoadTree\");\n\n        _h.failToast(text);\n\n        callback(false);\n      }\n    });\n  };\n\n  _.createBtn = function () {\n    _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.TreeForm(_));\n  };\n\n  _.editBtn = function () {\n    _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.TreeForm(_, true));\n  };\n\n  _.exportExcelBtn = function (i, e) {\n    var item = _.selectedRowRecord();\n\n    var type = $(e.target).attr(\"data-type\");\n    var model = {\n      controllerName: 4,\n      inputData: {\n        id: item.id(),\n        getAll: Number(type) === 2\n      }\n    };\n\n    _h.kocnx().createExcel(model);\n  };\n\n  _.showNodeReport = ko.observable(false);\n  _.nodeReportModel = ko.observable();\n\n  _.nodeCreateBtn = function () {\n    var item = _.selectedRowRecord();\n\n    $(_.edSelector).treeView(\"nodeCreate\", item.treeType(), item.assignmentType(), item.accountType(), _h.kocnx().loginCompanyId());\n  };\n\n  _.nodeSortBtn = function () {\n    $(_.edSelector).treeView(\"nodeSort\");\n  };\n\n  _.onNodeReport = function () {\n    _.nodeReportHandler();\n  };\n\n  _.onNodeReports = function () {\n    _.nodeReportHandler();\n  };\n\n  _.nodeReportHandler = function (id, inModel, outList, percent, title, processStatus) {\n    if (document.hidden) return false;\n\n    var context = _h.kocnx();\n\n    if (!_.showNodeReport()) {\n      var model = new _master_model__WEBPACK_IMPORTED_MODULE_1__.NodeReportForm(_);\n\n      for (var j = 0; j < nodeReportTypes.length; j++) {\n        var target = new _master_model__WEBPACK_IMPORTED_MODULE_1__.NodeReportSelect(nodeReportTypes[j]);\n\n        if (inModel && inModel.items.indexOf(target.id()) !== -1) {\n          target.selected(true);\n        }\n\n        model.nodeReportSelects.push(target);\n      }\n\n      if (outList) {\n        model.id(id);\n        model.processStatus(processStatus);\n        model.title(title);\n        model.percent(percent);\n        model.fillReports(outList);\n        model.inProgress(true);\n      }\n\n      context.openForm(model);\n    } else {\n      context.formModel().id(id);\n      context.formModel().processStatus(processStatus);\n      context.formModel().title(title);\n      context.formModel().percent(percent);\n      context.formModel().fillReports(outList);\n      context.formModel().inProgress(true);\n    }\n  };\n\n  _.nodeReportCancel = function (model, e) {\n    if (!_h.kocnx().formModel().inProgress()) {\n      _h.kocnx().closeForm();\n\n      return;\n    }\n\n    _.apiService.request({\n      splashId: \".node-report-modal\",\n      name: \"/api/process/putcancel\",\n      data: {\n        id: _h.kocnx().formModel().id()\n      },\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.kocnx().closeForm();\n        }\n      },\n      error: function error() {}\n    });\n  };\n\n  _.nodeReport = function () {\n    var selectedItems = $(_.edSelector).treeView(\"selectedItems\");\n\n    if (selectedItems.length === 0) {\n      var error = _h.getApiMessage(\"NodeReportZeroCountError\");\n\n      _h.failToast(error);\n\n      return;\n    }\n\n    var model = {\n      treeId: _.treeId(),\n      idList: [],\n      items: []\n    };\n    selectedItems.filter(function (a) {\n      return model.idList.push(a.id);\n    });\n\n    for (var i = 0; i < _h.kocnx().formModel().nodeReportSelects().length; i++) {\n      var target = _h.kocnx().formModel().nodeReportSelects()[i];\n\n      if (target.selected()) model.items.push(target.id());\n    }\n\n    _.apiService.request({\n      name: \"postNodeReport\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.kocnx().checkProcessQueue(true);\n\n          localStorage.setItem(\"ProcessToken\", \"\");\n        }\n      },\n      error: function error() {}\n    });\n  };\n\n  _.importExcelBtn = function (id) {\n    if (_h.isEmpty(id) || _typeof(id) === 'object') id = _.selectedRowRecord().id();\n\n    _h.kocnx().importFileBtn(id, _, \"Excel\");\n  };\n\n  _.onDeleteNode = function () {\n    _.onDeleteNodes();\n  };\n\n  _.onDeleteNodes = function () {\n    var error;\n    var selectedItems = $(_.edSelector).treeView(\"selectedItems\");\n\n    if (selectedItems.length === 0) {\n      error = _h.getApiMessage(\"NodeDeletedZeroCountError\");\n\n      _h.failToast(error);\n\n      return;\n    }\n\n    $(_.edSelector).treeView(\"selectSubSet\", selectedItems);\n    selectedItems = $(_.edSelector).treeView(\"selectedItems\");\n    var nodeIdList = [];\n    if (selectedItems.length) for (var i = 0; i < selectedItems.length; i++) {\n      nodeIdList.push(selectedItems[i].id);\n    }\n    var model = {\n      treeId: _.treeId(),\n      idList: nodeIdList\n    };\n    var menu = document.getElementsByClassName(\"context-menu\")[0];\n    if (menu) menu.parentNode.removeChild(menu);\n\n    var confirmText = _h.getApiMessage(\"NodeDeletedConfirm\").replace(\"__\", selectedItems.length);\n\n    _h.confirmDeleteAlert(confirmText, function (res) {\n      if (res) {\n        _.apiService.request({\n          name: \"deleteNode\",\n          data: model,\n          success: function success(data) {\n            if (!_h.isNullOrEmpty(data)) {\n              $(_.edSelector).treeView(\"removeItems\");\n              toast.success(_.entityName, 'custom', selectedItems.length > 1 ? 'NodesDelete' : 'NodeDelete');\n            }\n          },\n          error: function error() {\n            toast.error(_.entityName, 'custom', selectedItems.length > 1 ? 'NodesDelete' : 'NodeDelete');\n          }\n        });\n      }\n    });\n  };\n\n  _.onToBranch = function () {\n    _.changeNodeType();\n  };\n\n  _.onToLeaf = function () {\n    _.changeNodeType();\n  };\n\n  _.changeNodeType = function () {\n    var selectedItems = $(_.edSelector).treeView(\"selectedItems\");\n\n    _.apiService.request({\n      name: \"putNodeType\",\n      data: {\n        id: Number(selectedItems[0].id)\n      },\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          toast.success(_.entityName, 'custom', selectedItems[0].nodeType === 2 ? 'ToLeaf' : 'ToBranch');\n\n          if (_h.any(data.models)) {\n            $(_.edSelector).treeView(\"refreshTree\", data.models);\n          }\n        }\n      },\n      error: function error() {\n        toast.error(_.entityName, 'custom', selectedItems[0].nodeType === 2 ? 'ToLeaf' : 'ToBranch');\n      }\n    });\n  };\n\n  _.pasteBtn = function () {\n    var inComplex = $(_.edSelector).treeView(\"inComplexMode\");\n    if (inComplex.cut || inComplex.copy) _.onPaste(true);\n  };\n\n  _.onPaste = function (inRoot) {\n    _.collectOpenBranches();\n\n    var model = $(_.edSelector).treeView(\"getPasteModel\", inRoot);\n\n    _.apiService.request({\n      name: \"putPaste\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          if (_h.any(data.models)) {\n            $(_.edSelector).treeView(\"refreshTree\", data.models);\n          }\n\n          if (_.treeOpenBranches && _.treeOpenBranches.length) $(_.edSelector).treeView(\"expand\", _.treeOpenBranches);\n          $(_.edSelector).treeView(\"refreshAfterPaste\", model.type);\n          toast.success(_.entityName, 'custom', model.type === 1 ? 'Copy' : 'Cut');\n          if (model.type !== 1) _.onCallbackAction();\n        }\n      },\n      error: function error() {\n        toast.error(_.entityName, 'custom', model.type === 1 ? 'Copy' : 'Cut');\n\n        _.onCallbackAction();\n      }\n    });\n  };\n\n  _.confirmEditNode = function () {\n    if (!_h.isNullOrEmpty(_.nodeEditModel()) && _.nodeEditModel().isValid()) {\n      var editModel = _.nodeEditModel().toUpdateTree();\n\n      $(_.edSelector).treeView(\"refreshTree\", [editModel], true);\n    }\n\n    _.onCallbackAction();\n  };\n\n  _.closeEditNode = function () {\n    if (!_h.isNullOrEmpty(_.nodeEditModel())) {\n      _.showNodeEdit(false);\n    }\n\n    _.onCallbackAction();\n  };\n\n  _.onEditNode = function (el, object) {\n    if (!_.showNodeEdit()) {\n      var model = new _model__WEBPACK_IMPORTED_MODULE_2__.NodeForm();\n      object = _.fixNodeCreateModel(object);\n      model.fillModel(object);\n\n      _.nodeEditModel(model);\n\n      var pos = _h.getPosition(el);\n\n      _.showNodeEdit(true);\n\n      $(\".nodeedit-box\").css({\n        left: pos.left + \"px\",\n        top: pos.top - 410 + \"px\"\n      });\n      $(\".nodeedit-box\").draggable({\n        scroll: true,\n        handle: \".nodeEdit-drag-handle\"\n      });\n    } else {\n      if (!_h.isNullOrEmpty(_.nodeEditModel()) && _.nodeEditModel().isValid()) {\n        object = _.fixNodeCreateModel(object);\n\n        var editModel = _.nodeEditModel().toUpdateTree();\n\n        $(_.edSelector).treeView(\"refreshTree\", [editModel], true);\n\n        _.nodeEditModel().fillModel(object);\n      }\n    }\n\n    _.onCallbackAction();\n  };\n\n  _.fixNodeCreateModel = function (obj) {\n    if (obj.id === 0) {\n      var item = _.selectedRowRecord();\n\n      for (var k in obj) {\n        if (obj.hasOwnProperty(k)) {\n          var data = obj[k];\n\n          if (data + \"\" == \"NaN\") {\n            switch (k) {\n              case \"tt\":\n                obj.tt = item.treeType();\n                break;\n\n              case \"as\":\n                obj.as = item.assignmentType();\n                break;\n\n              case \"at\":\n                obj.at = item.accountType();\n                break;\n            }\n          }\n        }\n      }\n    }\n\n    return obj;\n  };\n\n  _.onNodeValuePart = function (id) {\n    _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.NodeValuePartViewModel(id));\n  };\n\n  _.saveChanges = function (i, e) {\n    if (_.showNodeEdit()) {\n      var text = _h.getApiMessage(\"PreventSaveForOpenDialog\");\n\n      toast.custom(\"error\", text);\n      return;\n    }\n\n    _.collectOpenBranches();\n\n    var list = $(_.edSelector).treeView(\"getChangedItems\");\n    if (!list || !list.length) return;\n    var model = {\n      treeId: _.treeId(),\n      list: list\n    };\n\n    _.apiService.request({\n      name: \"putNode\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _.treeValue(data.treeValue);\n\n          if (_h.any(data.models)) {\n            $(_.edSelector).treeView(\"refreshTree\", data.models);\n            if (_.treeOpenBranches && _.treeOpenBranches.length) $(_.edSelector).treeView(\"expand\", _.treeOpenBranches);\n          }\n\n          if (_h.any(data.nodeErrors)) {\n            $(_.edSelector).treeView(\"setErrors\", data.nodeErrors);\n\n            var text = _h.getApiMessage(\"NodeUpdateErrors\");\n\n            text = text.replace(\"__\", data.nodeErrors.length);\n            toast.custom(\"warning\", text);\n\n            _.eButtons.SaveChange(true);\n          } else {\n            $(_.edSelector).treeView(\"resetErrors\");\n            toast.success(_.entityName, 'custom', 'UpdateNode');\n\n            _.onCallbackAction();\n          }\n        }\n      },\n      error: function error() {\n        toast.error(_.entityName, 'custom', 'UpdateNode');\n      }\n    });\n  };\n\n  _.refreshEditor = function (model, e) {\n    if (!e || !_.showReferenceTab()) {\n      var item = _.selectedRowRecord();\n\n      if (item.changeCount() !== -1) _.getNodes(function (res) {\n        if (res) {\n          _.configTools();\n        }\n      });\n    }\n\n    if (_.showReferenceTab()) {\n      _.getDiffNodes(function (res) {\n        if (res) {\n          _.configTools(true);\n        }\n      });\n\n      _.onCallbackAction(true);\n    }\n  };\n\n  _.getNodes = function (callback) {\n    var model = {\n      treeId: _.treeId(),\n      filterType: _.filterType(),\n      searchKey: _.searchNodeKey()\n    };\n\n    _.apiService.request({\n      name: \"getNode\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _.nodes = data.models;\n\n          _.treeValue(data.treeValue);\n\n          callback(true);\n        } else {\n          _.treeValue(undefined);\n\n          $(_.edSelector).treeView(\"removeTree\");\n        }\n\n        _.onCallbackAction();\n      },\n      error: function error() {\n        var text = _h.getApiMessage(\"ErrorLoadTree\");\n\n        _h.failToast(text);\n\n        callback(false);\n      }\n    });\n  };\n\n  _.configTools = function (deffTreesConfig) {\n    var context = _h.kocnx();\n\n    var period = !_h.isNullOrEmpty(context.periodItem()) && context.permitPeriodEdit();\n\n    if (deffTreesConfig) {\n      if (_.referenceNodes.length) $(\"#tree_view_rf\").treeView({\n        tType: \"Reference\",\n        location: \"Reference\",\n        nodes: _.referenceNodes,\n        rootId: _.treeId(),\n        controllerName: 5,\n        onApplyItem: _.onApplyItem,\n        onRejectItem: _.onRejectItem,\n        permitPeriodEdit: period,\n        onDeffTreeSelect: _.onDeffTreeSelect\n      });\n      if (_.currentNodes.length) $(\"#tree_view_cr\").treeView({\n        tType: \"Current\",\n        location: \"Current\",\n        nodes: _.currentNodes,\n        rootId: _.treeId(),\n        controllerName: 5,\n        permitPeriodEdit: period,\n        onDeffTreeSelect: _.onDeffTreeSelect\n      });\n\n      _.onCallbackAction(true);\n    } else {\n      var item = _.selectedRowRecord();\n\n      $(_.edSelector).treeView({\n        tType: \"Editor\",\n        location: \"Editor\",\n        nodes: _.nodes,\n        rootId: item.id(),\n        controllerName: 5,\n        permitPeriodEdit: period,\n        companyId: context.loginCompanyId(),\n        companyType: context.loginCompanyType(),\n        companyIsRoot: context.currentCompany().irt,\n        actions: {\n          onNodeReport: _.onNodeReport,\n          onNodeReports: _.onNodeReports,\n          onDeleteNode: _.onDeleteNode,\n          onDeleteNodes: _.onDeleteNodes,\n          onToBranch: _.onToBranch,\n          onToLeaf: _.onToLeaf,\n          onEditNode: _.onEditNode,\n          onNodeValuePart: _.onNodeValuePart,\n          onCallbackAction: _.onCallbackAction,\n          onPaste: _.onPaste,\n          onExportExcel: _.onExportExcel,\n          onImportExcel: _.onImportExcel,\n          onExportAllExcel: _.onExportAllExcel,\n          onResetConsolidate: _.onResetBranchConsolidate\n        }\n      });\n    }\n  };\n\n  _.onDeffTreeSelect = function (type, list) {\n    if (type === \"ref\") {\n      $(\"#tree_view_cr\").treeView(\"changeSelectedItem\", list);\n    } else {\n      $(\"#tree_view_rf\").treeView(\"changeSelectedItem\", list);\n    }\n  };\n\n  _.onSelectRecord = function (target, sign) {\n    if (target.id() === _.treeId()) {\n      return;\n    }\n\n    _.slfOwnerTree(_h.kocnx().loginCompanyId() === target.cbCompanyId());\n\n    _.newTree(target.changeCount() === -1);\n\n    _.treeId(target.id());\n\n    _.treeTitle(target.name());\n\n    _.treeType(target.treeType());\n\n    _.nodeEditModel(null);\n\n    if (target.changeCount() !== -1) {\n      _.getNodes(function (res) {\n        if (res) {\n          _.configTools();\n\n          if (sign) $('a[href=\"#reference-t\"]').trigger('click');\n        }\n      });\n\n      _.onCallbackAction();\n    } else {\n      _.treeValue(undefined);\n\n      $(_.edSelector).treeView(\"removeTree\");\n\n      _.onCallbackAction();\n    }\n  };\n\n  _.expandAll = function () {\n    $(_.edSelector).treeView(\"expandAll\");\n  };\n\n  _.collapseAll = function () {\n    $(_.edSelector).treeView(\"collapseAll\");\n  };\n\n  _.init = function () {\n    window.resSecondDomain = \"tree\";\n\n    _.fillTableProperties();\n\n    _.getRecords();\n\n    _.getFolderList();\n\n    _.iconSize(\"icon-image-small\");\n  };\n\n  _.newTreeBtn = function (btn, item) {\n    if (!item || item[\"icon\"]) item = _.selectedRowRecord();\n    if (!item[\"name\"] && btn[\"name\"]) item = btn;\n\n    var message = _h.getApiMessage(\"NewTreeConfirm\");\n\n    message = message.replace(\"__\", item.name());\n\n    _h.confirmChooseAlert(message, function (res) {\n      _.syncTrees(res ? 0 : 1);\n    });\n  };\n\n  _.onApplyItem = function (list) {\n    _.syncTrees(3, list);\n  };\n\n  _.onRejectItem = function (list) {\n    _.syncTrees(4, list);\n  };\n\n  _.changesTreeBtn = function () {\n    var item = _.selectedRowRecord();\n\n    var text = _h.getApiMessage(\"ChangesTreeConfirm\");\n\n    text = text.replace(\"__\", item.name());\n\n    _h.confirmChooseAlert(text, function (res) {\n      switch (res) {\n        case true:\n          _.syncTrees(0);\n\n          break;\n\n        case false:\n          _.syncTrees(1);\n\n          break;\n      }\n    });\n  };\n\n  _.syncTrees = function (type, list) {\n    _.collectOpenBranches();\n\n    var model = {};\n\n    switch (type) {\n      case 0:\n      case 1:\n        model = {\n          id: _.treeId(),\n          acceptAll: type === 0,\n          rejectAll: type === 1,\n          accepted: [],\n          rejected: []\n        };\n        break;\n\n      case 3:\n        model = {\n          id: _.treeId(),\n          acceptAll: false,\n          rejectAll: false,\n          accepted: list,\n          rejected: []\n        };\n        break;\n\n      case 4:\n        model = {\n          id: _.treeId(),\n          acceptAll: false,\n          rejectAll: false,\n          accepted: [],\n          rejected: list\n        };\n        break;\n    }\n\n    _.apiService.request({\n      name: \"postSyncTrees\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          switch (type) {\n            case 0:\n              $(_.edSelector).treeView(\"removeTree\");\n              toast.success(_.entityName, 'custom', 'AcceptAllSyncTree');\n\n              _.newTree(false);\n\n              _.treeId(undefined);\n\n              _.treeTitle(undefined);\n\n              _.getRecords();\n\n              break;\n\n            case 1:\n              $(_.edSelector).treeView(\"removeTree\");\n              toast.success(_.entityName, 'custom', 'RejectAllSyncTree');\n\n              _.newTree(false);\n\n              _.treeId(undefined);\n\n              _.treeTitle(undefined);\n\n              _.getRecords();\n\n              break;\n\n            case 3:\n              toast.success(_.entityName, 'custom', 'AcceptListSyncTree');\n\n              _.getDiffNodes(function (res) {\n                if (res) {\n                  _.configTools(true);\n\n                  setTimeout(function () {\n                    if (_.treeOpenBranches && _.treeOpenBranches.length) $(\"#tree_view_rf\").treeView(\"expand\", _.treeOpenBranches);\n                  }, 150);\n                }\n              });\n\n              break;\n\n            case 4:\n              toast.success(_.entityName, 'custom', 'RejectListSyncTree');\n\n              _.getDiffNodes(function (res) {\n                if (res) {\n                  _.configTools(true);\n\n                  setTimeout(function () {\n                    if (_.treeOpenBranches && _.treeOpenBranches.length) $(\"#tree_view_rf\").treeView(\"expand\", _.treeOpenBranches);\n                  }, 150);\n                }\n              });\n\n              break;\n          }\n        }\n      },\n      error: function error() {\n        toast.error(_.entityName, 'custom', 'SyncTree');\n      }\n    });\n  };\n\n  ko.utils.extend(_, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"Tree\",\n    apiService: {\n      actionList: [\"filterby\", \"post\", \"put\", \"delete\", \"postnodereport\", \"deleteNode\", \"getnode\", \"putnode\", \"deletenode\", \"putnodetype\", \"putpaste\", \"postsynctrees\", \"getdifftrees\", \"gettreesetting\", \"puttreesetting\", \"postresetbranch\"]\n    },\n    getList: true,\n    filters: [{\n      name: 'accountType',\n      type: \"select\",\n      source: accountTypes\n    }, {\n      name: 'assignmentType',\n      type: \"select\",\n      source: assignmentTypes\n    }, {\n      name: 'valueType',\n      type: \"select\",\n      source: valueTypes\n    }, {\n      name: 'showRejected',\n      type: \"bool\"\n    }],\n    buttons: [{\n      name: 'edit',\n      access: true,\n      icon: 'Edit',\n      cMenu: true\n    }, {\n      name: 'delete',\n      access: true,\n      icon: 'Delete',\n      cMenu: true\n    }, {\n      name: 'exportExcel',\n      access: true,\n      icon: 'ExportExcel',\n      cMenu: true,\n      templateName: \"excelexport-table-template\"\n    }, {\n      name: 'newTree',\n      access: true,\n      icon: 'AcceptTable',\n      cMenu: true\n    }, {\n      name: 'changesTree',\n      access: true,\n      icon: 'AcceptTable',\n      cMenu: true\n    }, {\n      name: 'importExcel',\n      access: true,\n      icon: 'ImportExcel',\n      cMenu: true\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      templateName: \"toolsbtn-tree-template\",\n      access: false,\n      cMenu: false\n    }, {\n      name: 'create',\n      access: true,\n      cMenu: false\n    }],\n    sortDirection: \"Ascending\",\n    sortProperty: \"id\",\n    context: _,\n    cols: treeModelRes,\n    searchKeyType: \"enter\",\n    selectRow: true,\n    contextMenu: true,\n    tableStyle: \"font-size: 11px;table-layout: auto;\",\n    tableClass: \"table ko-tbl\",\n    saveState: true,\n    folderManagement: true\n  }));\n  _.btnVisibility = ko.computed(function () {\n    var context = _h.kocnx();\n\n    var period = !_h.isNullOrEmpty(context.periodItem()) && context.permitPeriodEdit();\n\n    var item = _.selectedRowRecord();\n\n    if (!_h.isNullOrEmpty(item)) {\n      var owner = item.cbCompanyId() === context.loginCompanyId();\n      var hasChild = item.hasChildren();\n      var group = context.loginCompanyType() !== 1;\n      var isNew = item.changeCount() === -1;\n\n      _.visedit(period && !isNew);\n\n      _.visdelete(owner && !hasChild && period && !isNew || !owner && period && !isNew);\n\n      if (group) {\n        _.visexportExcel(_h.contains([6, 7, 8], item.treeType()) && !_h.isNullOrEmpty(context.periodItem()) && !isNew);\n\n        _.visimportExcel(_h.contains([6, 7, 8], item.treeType()) && period && !isNew);\n      } else {\n        _.visexportExcel(_h.contains([2, 3, 6, 7, 8], item.treeType()) && !_h.isNullOrEmpty(context.periodItem()) && !isNew);\n\n        _.visimportExcel(_h.contains([2, 3, 6, 7, 8], item.treeType()) && period && !isNew);\n      }\n\n      _.visnewTree(isNew);\n\n      _.vischangesTree(item.changeCount() > 0);\n    } else {\n      _.visedit(false);\n\n      _.visdelete(false);\n\n      _.visexportExcel(false);\n\n      _.visimportExcel(false);\n\n      _.visnewTree(false);\n\n      _.vischangesTree(false);\n    }\n\n    _.viscreate(period);\n\n    _.vistools(true);\n\n    _.vishelp(true);\n\n    _.visrefresh(true);\n  });\n\n  _.proxyKeyboard = function (type) {\n    switch (type) {\n      case \"create\":\n        if (window.resSecondDomain === \"editor\") {\n          $(_.edSelector).treeView(\"nodeCreate\");\n        } else {\n          if (_.viscreate()) _.createBtn();\n        }\n\n        break;\n\n      case \"refresh\":\n        if (window.resSecondDomain === \"editor\") {\n          _.getNodes(function (res) {\n            if (res) {\n              _.configTools();\n            }\n          });\n        } else {\n          _.refreshTable();\n        }\n\n        break;\n\n      case \"delete\":\n        if (window.resSecondDomain === \"editor\") {\n          _.onDeleteNodes();\n        } else {\n          if (_.visdelete()) _.deleteBtn();\n        }\n\n        break;\n\n      case \"edit\":\n        if (window.resSecondDomain === \"editor\") {\n          $(_.edSelector).treeView(\"nodeEditTrigger\");\n        } else {\n          if (_.visedit()) _.editBtn();\n        }\n\n        break;\n    }\n  };\n\n  _.isVisibleColumn = function (name) {\n    var record = null;\n    ko.utils.arrayFilter(_.tableProperties(), function (col) {\n      if (col.name === name) {\n        record = col;\n      }\n    });\n    if (record === null) return false;\n    if (record.name === 'id') return true;\n    return record.visibleCol() && record.tablecol;\n  };\n\n  _.getDiffNodes = function (callback) {\n    if (!_.treeId()) return;\n    var model = {\n      treeId: _.treeId(),\n      referenceFilterType: _.refFilterType(),\n      referenceSearchKey: _.refSearchNodeKey(),\n      currentFilterType: _.filterType(),\n      currentSearchKey: _.searchNodeKey()\n    };\n\n    _.apiService.request({\n      name: \"getDiffTrees\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          if (_h.any(data.referenceTree)) {\n            _.referenceNodes = data.referenceTree;\n            $(\"#tree_view_rf\").treeView(\"removeTree\");\n          } else {\n            _.referenceNodes = [];\n            $(\"#tree_view_rf\").treeView(\"removeTree\");\n          }\n\n          if (_h.any(data.currentTree)) {\n            $(\"#tree_view_cr\").treeView(\"removeTree\");\n            _.currentNodes = data.currentTree;\n          } else {\n            $(\"#tree_view_cr\").treeView(\"removeTree\");\n            _.currentNodes = [];\n          }\n\n          callback(true);\n        }\n      },\n      error: function error() {\n        callback(false);\n      }\n    });\n  };\n\n  _.toggleReferenceTab = function (href) {\n    var item = _.selectedRowRecord();\n\n    switch (href) {\n      case \"#reference-t\":\n        _.showReferenceTab(true);\n\n        _.searchNodeKey(undefined);\n\n        _.refSearchNodeKey(undefined);\n\n        _.filterType(0);\n\n        _.getDiffNodes(function (res) {\n          if (res) {\n            _.configTools(true);\n          }\n        });\n\n        break;\n\n      case \"#list-t\":\n        _.showReferenceTab(false);\n\n        _.searchNodeKey(undefined);\n\n        _.refSearchNodeKey(undefined);\n\n        _.filterType(0);\n\n        _.getRecords(item.id());\n\n        break;\n    }\n  };\n\n  _.afterFilterBy = function (data, selectedId) {\n    if (selectedId && _.records().length) {\n      for (var i = 0; i < _.records().length; i++) {\n        var target = _.records()[i];\n\n        if (!_.groupProperty()) {\n          if (target.id() === selectedId) {\n            _.treeId(undefined);\n\n            _.onlySelectedRow(target);\n\n            _.onSelectRecord(target);\n          }\n        } else {\n          for (var j = 0; j < target.list().length; j++) {\n            var innerTarget = target.list()[j];\n\n            if (innerTarget.id() === selectedId) {\n              _.treeId(undefined);\n\n              _.onlySelectedRow(innerTarget);\n\n              _.onSelectRecord(innerTarget);\n            }\n          }\n        }\n      }\n    }\n\n    _.resetTrees();\n  };\n\n  _.onChangeLabelClick = function (item) {\n    _.onSelectRecord(item[0], true);\n  };\n\n  _.onNewLabelClick = function (item) {\n    _.newTreeBtn(null, item[0]);\n  };\n\n  _.resetTrees = function () {\n    _.treeId(0);\n\n    _.treeTitle(undefined);\n\n    $(\".dmn-tree\").empty();\n  };\n\n  _.rightClickSelectRow = function (target, eventTarget, event) {\n    if (_.configTable.selectRow && _.configTable.contextMenu) _.selectedRow(target, event, true);\n  };\n\n  _.selectedRow = function (target, e, rightClick) {\n    if (!_.eButtons.SaveChange()) {\n      var ctrlSelect = e.ctrlKey;\n      var shiftSelect = e.shiftKey;\n      if (shiftSelect === undefined) shiftSelect = false;\n      if (ctrlSelect === undefined) ctrlSelect = false;\n\n      var res = _.isValidClickSingleRow(e);\n\n      if (res !== \"label\") {\n        _.changeSelectedRecord(target, ctrlSelect, shiftSelect, rightClick);\n\n        _.fillChildModel(target);\n      } else {\n        _.changeSelectedRecord(target, ctrlSelect, shiftSelect, rightClick);\n\n        _.fillChildModel(target);\n      }\n    } else {\n      var confirmText = _h.getApiMessage(\"HasChangedConfirm\");\n\n      confirmText = confirmText.replace(\"__\", \"درختواره\");\n\n      _h.confirmDeleteAlert(confirmText, function (res) {\n        if (res) {\n          var ctrlSelect = e.ctrlKey;\n          var shiftSelect = e.shiftKey;\n          if (shiftSelect === undefined) shiftSelect = false;\n          if (ctrlSelect === undefined) ctrlSelect = false;\n\n          var isValid = _.isValidClickSingleRow(e);\n\n          if (isValid !== \"label\") {\n            _.changeSelectedRecord(target, ctrlSelect, shiftSelect, rightClick);\n\n            _.fillChildModel(target);\n          } else {\n            _.changeSelectedRecord(target, ctrlSelect, shiftSelect, rightClick);\n\n            _.fillChildModel(target);\n          }\n        }\n      });\n    }\n  };\n\n  _.treeOpenBranches = [];\n\n  _.collectOpenBranches = function () {\n    _.treeOpenBranches = [];\n    var tree = $(_.edSelector);\n\n    if (tree.length === 0) {\n      tree = $(\"#tree_view_rf\");\n    }\n\n    var ulList = tree.find(\"ul:not(.dmn-c)\");\n    var array = [];\n    if (ulList.length) for (var i = 0; i < ulList.length; i++) {\n      var item = ulList[i];\n      var parent = $(item).parent();\n      if (parent) array.push(parent.attr(\"did\"));\n    }\n    _.treeOpenBranches = array;\n  };\n\n  _.openTreeSetting = function () {\n    _.apiService.request({\n      name: \"getTreeSetting\",\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.kocnx().openForm(new _model__WEBPACK_IMPORTED_MODULE_2__.TreeSettingForm(_, data));\n        }\n      },\n      error: function error() {}\n    });\n  };\n\n  _.confirmSettingNode = function (parents, btnModel, e) {\n    var item = parents[1];\n    var model = item.toServer();\n\n    _.apiService.request({\n      name: \"putTreeSetting\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          _h.kocnx().closeForm();\n\n          toast.success(_.entityName, 'custom', 'SaveSettingNode');\n\n          _.getNodes(function (res) {\n            if (res) {\n              _.configTools();\n            }\n          });\n        }\n      },\n      error: function error() {}\n    });\n  };\n\n  _.onResetBranchConsolidate = function (nodeId) {\n    var confirmText = _h.getApiMessage(\"ResetConsolidateBranchConfirm\");\n\n    _h.confirmDeleteAlert(confirmText, function (res) {\n      if (res) {\n        _.resetConsolidate(1, nodeId);\n      }\n    });\n  };\n\n  _.onResetTreeConsolidate = function () {\n    var confirmText = _h.getApiMessage(\"ResetConsolidateBranchConfirm\");\n\n    _h.confirmDeleteAlert(confirmText, function (res) {\n      if (res) {\n        _.resetConsolidate(2);\n      }\n    });\n  };\n\n  _.resetConsolidate = function (type, nodeId) {\n    _.collectOpenBranches();\n\n    var model = {};\n\n    switch (type) {\n      case 1:\n        model.treeId = _.treeId();\n        model.nodeId = nodeId;\n        break;\n\n      case 2:\n        model.treeId = _.treeId();\n        break;\n    }\n\n    _.apiService.request({\n      name: \"postResetBranch\",\n      data: model,\n      success: function success(data) {\n        if (!_h.isNullOrEmpty(data)) {\n          switch (type) {\n            case 1:\n              if (_h.any(data.models)) {\n                $(_.edSelector).treeView(\"refreshTree\", data.models);\n                if (_.treeOpenBranches && _.treeOpenBranches.length) $(_.edSelector).treeView(\"expand\", _.treeOpenBranches);\n              }\n\n              toast.success(_.entityName, 'custom', 'ResetConsolidationBranch');\n              break;\n\n            case 2:\n              toast.success(_.entityName, 'custom', 'ResetConsolidationTree');\n\n              _.getNodes(function (res) {\n                if (res) {\n                  _.configTools();\n                }\n              });\n\n              break;\n          }\n        }\n      },\n      error: function error() {}\n    });\n  };\n}\n$(document).on(\"shown.bs.tab\", '.tree-tab a[data-toggle=\"tab\"]', function () {\n  var href = $(this).attr(\"href\");\n\n  _h.kocnx().treevm().toggleReferenceTab(href);\n\n  return false;\n});\n$(document).on(\"focus\", '.focus-area', function (e) {\n  var parent = $(e.currentTarget).parent();\n  $(parent).find(\".header-title\").css(\"font-weight\", \"300\");\n  var loc = $(e.currentTarget).attr(\"data-loc\");\n\n  switch (loc) {\n    case \"editor\":\n      $(e.currentTarget).find(\".header-title\").css(\"font-weight\", \"bold\");\n      break;\n\n    case \"treeList\":\n      $(e.currentTarget).find(\".header-title\").css(\"font-weight\", \"bold\");\n      break;\n  }\n\n  window.resSecondDomain = loc;\n});\n\n//# sourceURL=webpack://domino/./src/scripts/pages/trees/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/user/model.js":
/*!*****************************************!*\
  !*** ./src/scripts/pages/user/model.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"User\": () => (/* binding */ User),\n/* harmony export */   \"UserAccessForm\": () => (/* binding */ UserAccessForm),\n/* harmony export */   \"UserContent\": () => (/* binding */ UserContent),\n/* harmony export */   \"UserContentViewModel\": () => (/* binding */ UserContentViewModel),\n/* harmony export */   \"UserForm\": () => (/* binding */ UserForm)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar _require = __webpack_require__(/*! ../master/baseModels.js */ \"./src/scripts/pages/master/baseModels.js\"),\n    BaseModel = _require.BaseModel,\n    BaseFormModel = _require.BaseFormModel,\n    BaseSecondaryForm = _require.BaseSecondaryForm;\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\n\nvar User = /*#__PURE__*/function (_BaseModel) {\n  _inherits(User, _BaseModel);\n\n  var _super = _createSuper(User);\n\n  function User(model) {\n    _classCallCheck(this, User);\n\n    return _super.call(this, model);\n  }\n\n  return _createClass(User);\n}(BaseModel);\nvar UserForm = /*#__PURE__*/function (_BaseFormModel) {\n  _inherits(UserForm, _BaseFormModel);\n\n  var _super2 = _createSuper(UserForm);\n\n  function UserForm(model, editMode) {\n    var _this;\n\n    _classCallCheck(this, UserForm);\n\n    _this = _super2.call(this, model, editMode);\n    _this.password = ko.observable();\n    _this.passwordConfirm = ko.observable();\n\n    _this.setValidationObject(editMode);\n\n    _this.createForm(editMode);\n\n    return _this;\n  }\n\n  _createClass(UserForm, [{\n    key: \"setValidationObject\",\n    value: function setValidationObject(editMode) {\n      var obj = {};\n      obj.firstName = this.firstName.extend({\n        required: true,\n        minLength: 3,\n        maxLength: 32,\n        persianOnly: null\n      });\n      obj.lastName = this.lastName.extend({\n        required: true,\n        minLength: 3,\n        maxLength: 32,\n        persianOnly: null\n      });\n      obj.description = this.description.extend({\n        maxLength: 1024\n      });\n      obj.userName = this.userName.extend({\n        required: true,\n        minLength: 4,\n        remoteIsUniqueRule: {\n          params: [this.id, \"User\", \"userName\"]\n        },\n        userNameValidation: null,\n        maxLength: 20\n      });\n      obj.mobile = this.mobile.extend({\n        persianMobile: null,\n        numberOnly: null,\n        minLength: {\n          params: 11,\n          message: \"شماره تلفن همراه باید 11 کاراکتر عددی باشد\"\n        },\n        maxLength: {\n          params: 11,\n          message: \"شماره تلفن همراه باید 11 کاراکتر عددی باشد\"\n        }\n      });\n      obj.phoneNumber = this.phoneNumber.extend({\n        phoneNumberCheck: null\n      });\n      obj.email = this.email.extend({\n        englishOnly: null,\n        email: true\n      });\n      obj.fax = this.fax.extend({\n        phoneNumberCheck: null\n      });\n      obj.location = this.location.extend({\n        maxLength: 32,\n        persianOnly: null\n      });\n\n      if (!editMode) {\n        var min = _h.getSd().pmc;\n\n        obj.password = this.password.extend({\n          required: {\n            onlyIf: function () {\n              return !this.editMode();\n            }.bind(this)\n          },\n          englishOnly: true,\n          passwordComplexity: [min]\n        });\n        obj.passwordConfirm = this.passwordConfirm.extend({\n          required: {\n            onlyIf: function () {\n              return !this.editMode();\n            }.bind(this)\n          },\n          confirmPassword: {\n            params: this.password\n          }\n        });\n      }\n\n      this.validationObject = ko.validatedObservable(obj);\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm(editMode) {\n      var controls = [this.createLine({\n        t: 'txb',\n        val: this.firstName\n      }, {\n        t: 'txb',\n        val: this.lastName\n      }), this.createLine({\n        t: 'txb',\n        val: this.phoneNumber\n      }, {\n        t: 'txb',\n        val: this.mobile\n      }, true, 30), this.createLine({\n        t: 'txb',\n        val: this.userName,\n        dis: this.editMode\n      }, null, true, 30), this.createLine({\n        t: 'txb',\n        val: this.email\n      }, null, true, 30)];\n\n      if (!editMode) {\n        controls.push(this.createLine({\n          t: 'tm',\n          templateName: 'passwordfield-form-t'\n        }, undefined, true, 30, 0));\n      }\n\n      controls.push(this.createLine({\n        t: 'txb',\n        val: this.location\n      }, {\n        t: 'txb',\n        val: this.fax\n      }, true, 30));\n      controls.push(this.createLine({\n        t: 'txa',\n        val: this.description\n      }, undefined, true, 30));\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: 'create',\n            vis: !this.editMode(),\n            click: this.parentVM.create\n          }, {\n            name: 'edit',\n            vis: this.editMode,\n            click: this.parentVM.edit\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return UserForm;\n}(BaseFormModel);\nvar UserAccessForm = /*#__PURE__*/function (_BaseSecondaryForm) {\n  _inherits(UserAccessForm, _BaseSecondaryForm);\n\n  var _super3 = _createSuper(UserAccessForm);\n\n  function UserAccessForm(viewModel, model) {\n    var _this2;\n\n    _classCallCheck(this, UserAccessForm);\n\n    _this2 = _super3.call(this, viewModel, [{\n      name: \"userId\",\n      type: \"ob\",\n      val: model.userId\n    }, {\n      name: \"accessList\",\n      type: \"obar\",\n      val: model.accessList\n    }, {\n      name: \"selector\",\n      type: \"\",\n      val: \"#tree_view_au\"\n    }], \"userRolesManagement\");\n    _this2.width = \"50%\";\n\n    _this2.createForm();\n\n    _this2.configTools();\n\n    return _this2;\n  }\n\n  _createClass(UserAccessForm, [{\n    key: \"configTools\",\n    value: function configTools() {\n      setTimeout(function () {\n        $(this.selector).treeView({\n          tType: \"CompanyAccessUser\",\n          location: \"CompanyAccessUser\",\n          nodes: this.accessList,\n          rootId: \"1\",\n          showAccessList: this.showAccessList,\n          selfParent: this\n        });\n      }.bind(this), 400);\n    }\n  }, {\n    key: \"toServer\",\n    value: function toServer() {\n      var model = {\n        userId: this.userId(),\n        accessList: []\n      };\n      model.accessList = $(this.selector).treeView(\"getCompanyAccess\");\n      return model;\n    }\n  }, {\n    key: \"expandAll\",\n    value: function expandAll() {\n      $(this.selector).treeView(\"expandAll\");\n    }\n  }, {\n    key: \"collapseAll\",\n    value: function collapseAll() {\n      $(this.selector).treeView(\"collapseAll\");\n    }\n  }, {\n    key: \"createForm\",\n    value: function createForm() {\n      var controls = [this.createLine({\n        t: 'tm',\n        templateName: 'useraccess-form-t'\n      }, undefined, true, 0, 0)];\n      this.formControls(controls);\n      this.formButtons({\n        name: 'footer-form-t',\n        data: {\n          buttons: [{\n            name: \"custom\",\n            resText: 'userAccessEditBtn',\n            vis: true,\n            click: this.parentVM.editUserAccess\n          }, {\n            name: 'cancel',\n            click: _h.kocnx().closeForm\n          }]\n        }\n      });\n    }\n  }]);\n\n  return UserAccessForm;\n}(BaseSecondaryForm);\nvar UserContent = /*#__PURE__*/function (_BaseModel2) {\n  _inherits(UserContent, _BaseModel2);\n\n  var _super4 = _createSuper(UserContent);\n\n  function UserContent(model) {\n    _classCallCheck(this, UserContent);\n\n    return _super4.call(this, model);\n  }\n\n  return _createClass(UserContent);\n}(BaseModel);\nfunction UserContentViewModel(parent) {\n  var self = this;\n  self.parentModel = parent;\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"UserContent\",\n    apiService: {\n      actionList: [\"filterby\"]\n    },\n    filters: [{\n      name: 'userId',\n      type: \"select\",\n      source: self.parentModel.userSelectList\n    }, {\n      name: 'startDate',\n      type: \"datepiker\"\n    }, {\n      name: 'endDate',\n      type: \"datepiker\"\n    }, {\n      name: 'actionNames',\n      type: \"multiselect\",\n      source: actionNames.filter(function (a) {\n        return a.accountFilter;\n      }),\n      groupBy: \"group\"\n    }, {\n      name: 'resultState',\n      type: \"select\",\n      source: resultStates\n    }, {\n      name: 'unknownUser',\n      type: \"bool\"\n    }],\n    buttons: [{\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }],\n    sortDirection: \"Ascending\",\n    sortProperty: \"id\",\n    context: self,\n    saveState: true,\n    cols: usercontentModelRes,\n    isMultiSelectRows: false,\n    selectRow: true,\n    contextMenu: false,\n    getList: true,\n    searchKeyType: \"enter\",\n    tableClass: \"table ko-tbl ko-tbl-child\",\n    tableStyle: \"table-layout: fixed;margin-top:10px;font-size:11px;\",\n    resizable: true\n  }));\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.userId.subscribe(function (newValue) {\n      self.parentModel.changeShowBlock('fullDetails');\n    });\n  };\n\n  self.btnVisibility = ko.computed(function () {\n    self.vishelp(true);\n    self.visrefresh(true);\n    self.vistools(true);\n  });\n\n  self.clearSearchBoxes = function () {\n    for (var p in self.filters) {\n      if (self.filters.hasOwnProperty(p)) {\n        var target = self.filters[p];\n\n        switch (target.type) {\n          case \"multiselect\":\n            self[target.name].removeAll();\n            break;\n\n          default:\n            self[target.name](target.def);\n            break;\n        }\n      }\n    }\n\n    self.searchKey(\"\");\n    self.pageNumber(1);\n    self.getRecords();\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/user/model.js?");

/***/ }),

/***/ "./src/scripts/pages/user/resource.js":
/*!********************************************!*\
  !*** ./src/scripts/pages/user/resource.js ***!
  \********************************************/
/***/ (() => {

eval("window.userModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  firstName: {\n    fa: 'نام',\n    colName: 'firstName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    type: \"string\",\n    visibleItem: true\n  },\n  lastName: {\n    fa: 'نام خانوادگی',\n    colName: 'lastName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    type: \"string\",\n    visibleItem: true\n  },\n  userName: {\n    fa: 'نام کاربری',\n    colName: 'userName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    type: \"template\",\n    templateName: \"userName-table-template\",\n    visibleItem: true\n  },\n  stateType: {\n    fa: 'وضعیت',\n    colName: 'stateType',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    type: \"stateSwitch\"\n  },\n  phoneNumber: {\n    fa: 'تلفن ثابت',\n    colName: 'phoneNumber',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"string\"\n  },\n  mobile: {\n    fa: 'تلفن همراه',\n    colName: 'mobile',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"string\"\n  },\n  email: {\n    fa: 'ایمیل',\n    colName: 'email',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"string\"\n  },\n  timeCreated: {\n    fa: 'تاریخ ثبت نام',\n    colName: 'timeCreated',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"pdate\"\n  },\n  location: {\n    fa: 'شهر',\n    colName: 'location',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"string\"\n  },\n  description: {\n    fa: 'توضیحات',\n    colName: 'description',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"lstring\"\n  },\n  accessFailedCount: {\n    fa: 'ورود ناموفق',\n    colName: 'accessFailedCount',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"string\"\n  },\n  password: {\n    fa: 'رمز عبور',\n    colName: 'password',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"string\"\n  },\n  passwordConfirm: {\n    fa: 'تایید رمز عبور',\n    colName: 'passwordConfirm',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"string\"\n  },\n  fax: {\n    fa: 'شماره فکس',\n    colName: 'fax',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"string\"\n  }\n};\nwindow.userPageRes = {\n  userpageCaption: {\n    fa: 'کاربر'\n  },\n  editCaption: {\n    fa: 'ویرایش کاربر'\n  },\n  createCaption: {\n    fa: 'تعریف کاربر جدید'\n  },\n  deleteCaption: {\n    fa: 'حذف کاربر'\n  },\n  searchPanelTitle: {\n    fa: 'جستجوی پیشرفته'\n  },\n  searchPanelBtn: {\n    fa: 'اعمال کن'\n  },\n  trueStateBtn: {\n    fa: 'فعال'\n  },\n  falseStateBtn: {\n    fa: 'غیر فعال'\n  },\n  userAccessEditBtn: {\n    fa: 'ذخیره تغییرات'\n  },\n  accessManagerCaption: {\n    fa: 'مدیریت سمت'\n  },\n  unlockUserCaption: {\n    fa: 'باز کردن حساب مسدود'\n  },\n  lockedUserCaption: {\n    fa: 'حساب کاربری مسدود'\n  },\n  userRolesManagement: {\n    fa: \"مدیریت سمت های کاربر\"\n  }\n};\nwindow.usercontentModelRes = {\n  id: {\n    fa: '#',\n    colName: 'id',\n    tablecol: false,\n    visibleCol: false,\n    sortDir: \"Ascending\",\n    type: \"template\",\n    templateName: \"checkbox-table-template\"\n  },\n  accountName: {\n    fa: 'کاربر',\n    colName: 'accountName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    type: \"string\"\n  },\n  userAccount: {\n    fa: 'حساب کاربری',\n    colName: 'userAccount',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    type: \"string\"\n  },\n  date: {\n    fa: 'تاریخ',\n    colName: 'date',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    type: \"pdatetime\"\n  },\n  actionName: {\n    fa: 'عملیات',\n    colName: 'actionName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    type: \"string\"\n  },\n  resultState: {\n    fa: 'وضعیت',\n    colName: 'resultState',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    alias: null,\n    type: \"label\"\n  },\n  networkIp: {\n    fa: 'آی پی',\n    colName: 'networkIp',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    type: \"string\"\n  },\n  userName: {\n    fa: 'کاربر اقدام کننده',\n    colName: 'userName',\n    tablecol: true,\n    visibleCol: true,\n    sortDir: \"None\",\n    type: \"string\"\n  },\n  description: {\n    fa: 'خطای عملیات',\n    colName: 'description',\n    tablecol: true,\n    visibleCol: false,\n    sortDir: \"None\",\n    type: \"lstring\",\n    popup: true\n  }\n};\nwindow.usercontentPageRes = {\n  userContentPageCaption: {\n    fa: 'رویداد امنیتی'\n  },\n  startDate: {\n    fa: 'از تاریخ'\n  },\n  endDate: {\n    fa: 'تا تاریخ'\n  },\n  actionNames: {\n    fa: 'عملیات'\n  },\n  userId: {\n    fa: 'کاربر'\n  },\n  resultStates: {\n    fa: 'وضعیت'\n  },\n  unknownUser: {\n    fa: 'کاربر نامعتبر'\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/pages/user/resource.js?");

/***/ }),

/***/ "./src/scripts/pages/user/viewModel.js":
/*!*********************************************!*\
  !*** ./src/scripts/pages/user/viewModel.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"UserViewModel\": () => (/* binding */ UserViewModel)\n/* harmony export */ });\n/* harmony import */ var _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../master/baseViewModel.js */ \"./src/scripts/pages/master/baseViewModel.js\");\n/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./model.js */ \"./src/scripts/pages/user/model.js\");\n/* harmony import */ var _master_model_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../master/model.js */ \"./src/scripts/pages/master/model.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n__webpack_require__(/*! ./resource.js */ \"./src/scripts/pages/user/resource.js\");\n\n__webpack_require__(/*! ../../util/commonResources.js */ \"./src/scripts/util/commonResources.js\");\n\n\n\n\nfunction UserViewModel() {\n  var self = this;\n\n  self.getUserAccesses = function (callback) {\n    var model = {\n      id: self.getSelectedRecord().id()\n    };\n    self.apiService.request({\n      name: \"getAccess\",\n      data: model,\n      success: function success(data) {\n        callback(data);\n      },\n      error: function error() {\n        callback(null);\n      },\n      messageType: 'getList',\n      messageKey: \"UserAccessList\"\n    });\n  };\n\n  self.userSelectList = ko.observableArray();\n\n  self.getUserSelectList = function () {\n    self.apiService.request({\n      name: \"/api/common/getuserslist\",\n      data: {\n        controllerName: self.controllerName\n      },\n      success: function success(data) {\n        self.userSelectList.removeAll();\n\n        if (_h.any(data)) {\n          for (var j = 0; j < data.length; j++) {\n            var target = new _master_model_js__WEBPACK_IMPORTED_MODULE_2__.SelectItem(data[j]);\n            self.userSelectList.push(target);\n          }\n        }\n      },\n      messageType: 'getSelectList',\n      messageKey: \"User\"\n    });\n  };\n\n  self.createBtn = function () {\n    _h.kocnx().openForm(new _model_js__WEBPACK_IMPORTED_MODULE_1__.UserForm(self));\n  };\n\n  self.editBtn = function () {\n    _h.kocnx().openForm(new _model_js__WEBPACK_IMPORTED_MODULE_1__.UserForm(self, true));\n  };\n\n  self.accessManagerBtn = function () {\n    self.getUserAccesses(function (data) {\n      _h.kocnx().openForm(new _model_js__WEBPACK_IMPORTED_MODULE_1__.UserAccessForm(self, data));\n    });\n  };\n\n  self.editUserAccess = function (parents, btnModel, e) {\n    var item = parents[1];\n    var model = item.toServer();\n    self.apiService.request({\n      splashId: e,\n      name: \"postAccess\",\n      data: model,\n      success: function success(data) {\n        _h.kocnx().closeForm();\n\n        toast.success(self.entityName, 'put', 'UserAccess');\n      },\n      messageType: 'put',\n      messageKey: \"UserAccess\"\n    });\n  };\n\n  self.adminResetPasswordBtn = function () {\n    var selectedRecord = self.getSelectedRecord();\n\n    _h.kocnx().openForm(new _master_model_js__WEBPACK_IMPORTED_MODULE_2__.ResetPasswordModel(self, {\n      \"userId\": selectedRecord.id()\n    }));\n  };\n\n  self.adminResetPassword = function (parents, btnModel, e) {\n    var item = parents[1];\n\n    if (!item.validationObject.isValid()) {\n      item.validationObject.errors.showAllMessages();\n      return false;\n    }\n\n    var model = item.toServer();\n    self.apiService.request({\n      splashId: e,\n      name: \"postAdminResetPassword\",\n      data: model,\n      success: function success(data) {\n        _h.kocnx().closeForm();\n\n        toast.success(self.entityName, 'put', 'ResetPassword');\n      },\n      messageType: 'put',\n      messageKey: \"ResetPassword\"\n    });\n  };\n\n  self.unlockUserBtn = function () {\n    var selectedRecord = self.getSelectedRecord();\n    self.apiService.request({\n      name: \"putUnlock\",\n      data: {\n        id: selectedRecord.id()\n      },\n      success: function success(data) {\n        self.multiCommandExecute(\"changesUnlockUser\", !selectedRecord.locked(), [selectedRecord.id()]);\n        self.selectedRecord(null);\n        self.selectedRowRecord(null);\n        toast.success(self.entityName, 'custom', 'UnlockUser');\n      },\n      messageType: 'custom',\n      messageKey: \"UnlockUser\"\n    });\n  };\n\n  self.init = function () {\n    self.fillTableProperties();\n    self.getRecords();\n    self.getUserSelectList();\n  };\n\n  ko.utils.extend(self, new _master_baseViewModel_js__WEBPACK_IMPORTED_MODULE_0__.BaseViewModel({\n    entityName: \"User\",\n    apiService: {\n      actionList: [\"filterby\", \"post\", \"put\", \"postadminresetpassword\", \"isusernameunique\", \"postaccess\", \"getaccessselectlist\", \"getaccess\", \"putunlock\"]\n    },\n    filters: [{\n      name: 'stateType',\n      type: \"select\",\n      source: stateTypes\n    }],\n    sortDirection: \"Ascending\",\n    buttons: [{\n      name: 'edit',\n      access: true,\n      icon: 'Edit',\n      cMenu: true\n    }, {\n      name: 'adminResetPassword',\n      access: true,\n      icon: 'ChangePassword',\n      cMenu: true\n    }, {\n      name: 'accessManager',\n      access: true,\n      icon: 'RoleUser',\n      cMenu: true\n    }, {\n      name: 'disable',\n      access: true,\n      icon: 'DocDisable',\n      cMenu: true\n    }, {\n      name: 'enable',\n      access: true,\n      icon: 'DocEnable',\n      cMenu: true\n    }, {\n      name: 'unlockUser',\n      access: true,\n      icon: 'UnlockUser',\n      cMenu: true\n    }, {\n      name: 'help',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'refresh',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'tools',\n      access: false,\n      cMenu: false\n    }, {\n      name: 'create',\n      access: true,\n      cMenu: false\n    }],\n    sortProperty: \"id\",\n    context: self,\n    cols: userModelRes,\n    getList: true,\n    saveState: true,\n    selectRow: true,\n    searchKeyType: \"enter\",\n    contextMenu: true,\n    resizable: true\n  }));\n  self.btnVisibility = ko.computed(function () {\n    var selectedRecord = self.selectedRowRecord();\n    var inListView = self.showType() === \"List\";\n\n    if (!_h.isNullOrEmpty(selectedRecord)) {\n      self.visedit(!inListView);\n      self.visadminResetPassword(!inListView);\n      self.visaccessManager(!inListView);\n      self.visdisable(selectedRecord.stateType() === 1 && !inListView);\n      self.visenable(selectedRecord.stateType() === 0 && !inListView);\n      self.visunlockUser(selectedRecord.locked() && !inListView);\n    } else {\n      self.visedit(false);\n      self.visadminResetPassword(false);\n      self.visaccessManager(false);\n      self.visdisable(false);\n      self.visenable(false);\n    }\n\n    self.vishelp(!inListView);\n    self.visrefresh(!inListView);\n    self.vistools(true);\n    self.viscreate(!inListView);\n  });\n\n  self.changeChildModel = function (target) {\n    var model = new _model_js__WEBPACK_IMPORTED_MODULE_1__.UserContentViewModel(self);\n    self.childModel(model);\n    self.childModel().userId(target.id());\n    self.childModel().init();\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/pages/user/viewModel.js?");

/***/ }),

/***/ "./src/scripts/pages/viewModelsIndex.js":
/*!**********************************************!*\
  !*** ./src/scripts/pages/viewModelsIndex.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _user_viewModel_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./user/viewModel.js */ \"./src/scripts/pages/user/viewModel.js\");\n/* harmony import */ var _access_viewModel_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./access/viewModel.js */ \"./src/scripts/pages/access/viewModel.js\");\n/* harmony import */ var _actionlog_viewModel_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./actionlog/viewModel.js */ \"./src/scripts/pages/actionlog/viewModel.js\");\n/* harmony import */ var _onlineuser_viewModel_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./onlineuser/viewModel.js */ \"./src/scripts/pages/onlineuser/viewModel.js\");\n/* harmony import */ var _adjustmentdocument_viewModel_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./adjustmentdocument/viewModel.js */ \"./src/scripts/pages/adjustmentdocument/viewModel.js\");\n/* harmony import */ var _balancereport_viewModel_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./balancereport/viewModel.js */ \"./src/scripts/pages/balancereport/viewModel.js\");\n/* harmony import */ var _balancesheet_viewModel_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./balancesheet/viewModel.js */ \"./src/scripts/pages/balancesheet/viewModel.js\");\n/* harmony import */ var _company_viewModel_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./company/viewModel.js */ \"./src/scripts/pages/company/viewModel.js\");\n/* harmony import */ var _companyinfo_viewModel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./companyinfo/viewModel.js */ \"./src/scripts/pages/companyinfo/viewModel.js\");\n/* harmony import */ var _consolidate_viewModel_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./consolidate/viewModel.js */ \"./src/scripts/pages/consolidate/viewModel.js\");\n/* harmony import */ var _dynamicdocument_viewModel_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./dynamicdocument/viewModel.js */ \"./src/scripts/pages/dynamicdocument/viewModel.js\");\n/* harmony import */ var _dynamictable_viewModel_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./dynamictable/viewModel.js */ \"./src/scripts/pages/dynamictable/viewModel.js\");\n/* harmony import */ var _groupperiod_viewModel_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./groupperiod/viewModel.js */ \"./src/scripts/pages/groupperiod/viewModel.js\");\n/* harmony import */ var _magazine_viewModel_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./magazine/viewModel.js */ \"./src/scripts/pages/magazine/viewModel.js\");\n/* harmony import */ var _mapping_viewModel_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./mapping/viewModel.js */ \"./src/scripts/pages/mapping/viewModel.js\");\n/* harmony import */ var _period_viewModel_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./period/viewModel.js */ \"./src/scripts/pages/period/viewModel.js\");\n/* harmony import */ var _tabletemplate_viewModel_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./tabletemplate/viewModel.js */ \"./src/scripts/pages/tabletemplate/viewModel.js\");\n/* harmony import */ var _trees_viewModel_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./trees/viewModel.js */ \"./src/scripts/pages/trees/viewModel.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n  UserViewModel: _user_viewModel_js__WEBPACK_IMPORTED_MODULE_0__.UserViewModel,\n  AccessViewModel: _access_viewModel_js__WEBPACK_IMPORTED_MODULE_1__.AccessViewModel,\n  ActionLogViewModel: _actionlog_viewModel_js__WEBPACK_IMPORTED_MODULE_2__.ActionLogViewModel,\n  OnlineUserViewModel: _onlineuser_viewModel_js__WEBPACK_IMPORTED_MODULE_3__.OnlineUserViewModel,\n  AdjustmentDocumentViewModel: _adjustmentdocument_viewModel_js__WEBPACK_IMPORTED_MODULE_4__.AdjustmentDocumentViewModel,\n  BalanceReportViewModel: _balancereport_viewModel_js__WEBPACK_IMPORTED_MODULE_5__.BalanceReportViewModel,\n  BalancesheetViewModel: _balancesheet_viewModel_js__WEBPACK_IMPORTED_MODULE_6__.BalancesheetViewModel,\n  CompanyViewModel: _company_viewModel_js__WEBPACK_IMPORTED_MODULE_7__.CompanyViewModel,\n  CompanyInfoViewModel: _companyinfo_viewModel_js__WEBPACK_IMPORTED_MODULE_8__.CompanyInfoViewModel,\n  ConsolidateViewModel: _consolidate_viewModel_js__WEBPACK_IMPORTED_MODULE_9__.ConsolidateViewModel,\n  DynamicDocumentViewModel: _dynamicdocument_viewModel_js__WEBPACK_IMPORTED_MODULE_10__.DynamicDocumentViewModel,\n  DynamicTableViewModel: _dynamictable_viewModel_js__WEBPACK_IMPORTED_MODULE_11__.DynamicTableViewModel,\n  GroupPeriodViewModel: _groupperiod_viewModel_js__WEBPACK_IMPORTED_MODULE_12__.GroupPeriodViewModel,\n  MagazineViewModel: _magazine_viewModel_js__WEBPACK_IMPORTED_MODULE_13__.MagazineViewModel,\n  MappingViewModel: _mapping_viewModel_js__WEBPACK_IMPORTED_MODULE_14__.MappingViewModel,\n  PeriodViewModel: _period_viewModel_js__WEBPACK_IMPORTED_MODULE_15__.PeriodViewModel,\n  TableTemplateViewModel: _tabletemplate_viewModel_js__WEBPACK_IMPORTED_MODULE_16__.TableTemplateViewModel,\n  TreeViewModel: _trees_viewModel_js__WEBPACK_IMPORTED_MODULE_17__.TreeViewModel\n});\n\n//# sourceURL=webpack://domino/./src/scripts/pages/viewModelsIndex.js?");

/***/ }),

/***/ "./src/scripts/util/apiService.js":
/*!****************************************!*\
  !*** ./src/scripts/util/apiService.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"ApiService\": () => (/* binding */ ApiService)\n/* harmony export */ });\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar NProgress = __webpack_require__(/*! ../vendors/nprogress.js */ \"./src/scripts/vendors/nprogress.js\");\n\nvar ApiService = /*#__PURE__*/function () {\n  function ApiService(model, entityName) {\n    _classCallCheck(this, ApiService);\n\n    _defineProperty(this, \"_entityName\", \"\");\n\n    _defineProperty(this, \"_actionList\", []);\n\n    this._entityName = entityName;\n    this._actionList = model.actionList;\n    this._self = this;\n  }\n\n  _createClass(ApiService, [{\n    key: \"createApiAddress\",\n    value: function createApiAddress(name) {\n      name = name.toLowerCase();\n      if (name.indexOf(\"/api\") !== -1) return name;\n\n      if (this._actionList.indexOf(name) !== -1) {\n        return \"/api/\".concat(this._entityName.toLowerCase(), \"/\").concat(name);\n      }\n\n      if (commonActionList.indexOf(name) !== -1) {\n        return \"/api/common/\".concat(name);\n      }\n    }\n  }, {\n    key: \"request\",\n    value: function request(model) {\n      var rId;\n      var verb = ApiService.getActionVerb(model.name);\n      var url = this.createApiAddress(model.name);\n      var dataModel = ApiService.prepareData(model.data, verb);\n      var headers = ApiService.createHeader(verb, model.data);\n      var options = {\n        method: verb,\n        headers: headers\n      };\n\n      switch (verb) {\n        case \"POST\":\n          options.body = dataModel;\n          break;\n\n        case \"GET\":\n          url = ApiService.appendQueryString(url, model.data);\n          break;\n      }\n\n      if (!model.splashId) {\n        ApiService.startLoader();\n      } else {\n        rId = ApiService.startSplash(model.splashId);\n      }\n\n      fetch(url, options).then(function (response) {\n        if (!model.splashId) {\n          ApiService.stopLoader();\n        } else {\n          ApiService.stopSplash(rId);\n        }\n\n        ApiService.handleResponseHeaders(response);\n\n        try {\n          switch (response.status) {\n            case 200:\n              try {\n                response.text().then(function (res) {\n                  var data = res === \"\" ? {} : JSON.parse(res);\n\n                  if (!_h.isNullOrEmpty(data)) {\n                    if (!_h.isNullOrEmpty(data.tvm)) {\n                      _h.kocnx().changeTvm(data.tvm, true);\n                    }\n\n                    if (!_h.isNullOrEmpty(data.aft)) {\n                      _h.changeAft(data.aft);\n                    }\n\n                    if (_h.any(data.warnings)) {\n                      _h.warningListHandler(data.warnings);\n                    }\n\n                    if (_h.any(data.errors)) {\n                      _h.errorListHandler(data.errors);\n                    } else {\n                      model.success(data);\n                    }\n                  }\n                });\n              } catch (e) {\n                return \"\";\n              }\n\n              break;\n\n            default:\n              ApiService.handleError(response.status, model, verb);\n              break;\n          }\n        } catch (e) {\n          var data = {};\n\n          if (!_h.isNullOrEmpty(data)) {\n            if (_h.any(data.warnings)) {\n              _h.warningListHandler(data.warnings);\n            }\n\n            if (_h.any(data.errors)) {\n              _h.errorListHandler(data.errors);\n            } else {\n              model.success(data);\n            }\n          }\n        }\n      });\n    }\n  }], [{\n    key: \"createHeader\",\n    value: function createHeader(verb, data) {\n      var token = _h.getTvm();\n\n      if (token === null) _h.backToLogin();\n      var header = {};\n\n      if (data && _typeof(data) === 'object') {\n        header['Content-Type'] = 'application/json';\n      }\n\n      header['dmo_cur_ucp'] = token;\n      header['__RequestVerificationToken'] = document.getElementsByName(\"__RequestVerificationToken\")[0].value;\n      return header;\n    }\n  }, {\n    key: \"prepareData\",\n    value: function prepareData(data, verb) {\n      if (!data) return \"\";\n      if (_typeof(data) !== 'object') return data;\n      if (verb === \"POST\") return JSON.stringify(data);\n      return data;\n    }\n  }, {\n    key: \"getActionVerb\",\n    value: function getActionVerb(name) {\n      name = name.toLowerCase();\n      if (name.indexOf(\"filterby\") !== -1 || name.indexOf(\"get\") !== -1) return \"GET\";else if (name.indexOf(\"post\") !== -1 || name.indexOf(\"put\") !== -1 || name.indexOf(\"delete\") !== -1) return \"POST\";\n    }\n  }, {\n    key: \"appendQueryString\",\n    value: function appendQueryString(url, data) {\n      if (data) {\n        url += '?';\n\n        for (var key in data) {\n          if (Object.prototype.hasOwnProperty.call(data, key)) {\n            if (!_h.isEmpty(data[key])) {\n              if (Array.isArray(data[key])) {\n                if (data[key].length > 0) {\n                  var arrStr = \"\";\n\n                  for (var i = 0; i < data[key].length; i++) {\n                    arrStr += \"\".concat(key, \"[\").concat(i, \"]=\").concat(data[key][i], \"&\");\n                  }\n\n                  url += arrStr;\n                }\n              } else url += \"\".concat(key, \"=\").concat(data[key], \"&\");\n            }\n          }\n        }\n      }\n\n      if (url.endsWith(\"&\")) url = url.substring(0, url.length - 1);\n      return url;\n    }\n  }, {\n    key: \"handleResponseHeaders\",\n    value: function handleResponseHeaders(response) {\n      if (!response || !response.headers) return;\n      var process = response.headers.get('Process');\n\n      if (process !== null && process !== undefined) {\n        _h.kocnx().checkProcessQueue(true, window.firstload);\n\n        window.firstload = false;\n      }\n\n      var serverDate = response.headers.get('ServerDate');\n\n      if (serverDate !== null && serverDate !== undefined) {\n        localStorage.setItem(\"ServerDate\", serverDate);\n      }\n    }\n  }, {\n    key: \"request\",\n    value: function request(model) {\n      var rId;\n      var url = model.url;\n      if (model.url.indexOf(\"/api\") === -1) url = \"/api/common/\".concat(model.url);\n      if (model.url.indexOf(\"/account\") !== -1) url = model.url;\n      var verb = model.verb ? model.verb : ApiService.getActionVerb(url);\n      var headers = ApiService.createHeader(verb, model.data);\n\n      if (!model.notShowAjaxLoader) {\n        if (!model.splashId) {\n          ApiService.startLoader();\n        } else {\n          rId = ApiService.startSplash(model.splashId);\n        }\n      }\n\n      var options = {\n        method: verb,\n        headers: headers\n      };\n      var dataModel = ApiService.prepareData(model.data, verb);\n\n      switch (verb) {\n        case \"POST\":\n          options.body = dataModel;\n          break;\n\n        case \"GET\":\n          url = ApiService.appendQueryString(url, model.data);\n          break;\n      }\n\n      fetch(url, options).then(function (response) {\n        if (!model.splashId) {\n          ApiService.stopLoader();\n        } else {\n          ApiService.stopSplash(rId);\n        }\n\n        ApiService.handleResponseHeaders(response);\n\n        switch (response.status) {\n          case 200:\n            try {\n              response.text().then(function (res) {\n                var data = res === \"\" ? {} : JSON.parse(res);\n\n                if (!_h.isNullOrEmpty(data)) {\n                  if (!_h.isNullOrEmpty(data.tvm)) {\n                    _h.kocnx().changeTvm(data.tvm, true);\n                  }\n\n                  if (!_h.isNullOrEmpty(data.aft)) {\n                    _h.changeAft(data.aft);\n                  }\n\n                  if (_h.any(data.warnings)) {\n                    _h.warningListHandler(data.warnings);\n                  }\n\n                  if (_h.any(data.errors)) {\n                    _h.errorListHandler(data.errors);\n\n                    if (model[\"concurrencyHandler\"]) model.concurrencyHandler(data);\n                  } else {\n                    model.success(data);\n                  }\n                }\n              });\n            } catch (e) {\n              var data = {};\n\n              if (!_h.isNullOrEmpty(data)) {\n                if (_h.any(data.warnings)) {\n                  _h.warningListHandler(data.warnings);\n                }\n\n                if (_h.any(data.errors)) {\n                  _h.errorListHandler(data.errors);\n                } else {\n                  model.success(data);\n                }\n              }\n            }\n\n            break;\n\n          default:\n            if (model.url.indexOf(\"newtoken\") !== -1) {\n              model.error(response.status);\n            } else {\n              ApiService.handleError(response.status, model, verb);\n            }\n\n            break;\n        }\n      });\n    }\n  }, {\n    key: \"handleError\",\n    value: function handleError(status, model, verb) {\n      var context = _h.kocnx();\n\n      switch (status) {\n        case 500:\n          var text = _h.getApiMessage(\"ErrorUnknownServer\");\n\n          _h.failToast(text);\n\n          break;\n\n        case 550:\n          context.openLoginModal();\n          if (model[\"error\"]) model.error(status);\n          break;\n\n        case 551:\n          _h.failToast(\"دسترسی شما به این بخش محدود شده است\");\n\n          break;\n\n        case 554:\n          _h.failToast(\"حساب کاربری شما غیر فعال شده است\");\n\n          setTimeout(function () {\n            _h.backToLogin();\n          }, 2000);\n          break;\n\n        case 553:\n        case 558:\n        case 574:\n          _h.backToLogin();\n\n          break;\n\n        case 561:\n          var text = _h.getApiMessage(\"UserHasNoAccessInSystem\");\n\n          _h.failToast(text);\n\n          setTimeout(function () {\n            _h.backToLogin();\n          }, 2000);\n          break;\n\n        case 562:\n          context.openLoginModal();\n          break;\n\n        case 571:\n          var text = _h.getApiMessage(\"CompanyIsNotActive\");\n\n          _h.failToast(text);\n\n          setTimeout(function () {\n            context.refreshToken();\n          }, 2000);\n          break;\n\n        case 572:\n          var periodIsClosed = _h.getApiMessage(\"PeriodIsClosed\");\n\n          _h.failToast(periodIsClosed);\n\n          break;\n\n        case 573:\n          var periodIsDisabled = _h.getApiMessage(\"PeriodIsDisabled\");\n\n          _h.failToast(periodIsDisabled);\n\n          break;\n\n        case 591:\n          context.refreshToken();\n          break;\n\n        case 592:\n          var noEnabledPeriod = _h.getApiMessage(\"NoEnabledPeriod\");\n\n          _h.failToast(noEnabledPeriod);\n\n          setTimeout(function () {\n            window.location.href = \"/basicinfo\";\n          }, 2000);\n          break;\n\n        case 600:\n          var insufficientInfo = _h.getApiMessage(\"InsufficientInformations\");\n\n          _h.failToast(insufficientInfo);\n\n          break;\n\n        case 601:\n          var fingerPrintMismatch = _h.getApiMessage(\"FingerPrintMismatch\");\n\n          _h.failToast(fingerPrintMismatch);\n\n          break;\n\n        case 602:\n          var limitedCpuOrMemory = _h.getApiMessage(\"LimitedCpuOrMemory\");\n\n          _h.failToast(limitedCpuOrMemory);\n\n          break;\n\n        case 610:\n          _h.toggleDisableSections(true);\n\n          break;\n\n        case 611:\n          var consolidationInProgress = _h.getApiMessage(\"ConsolidationInProgress\");\n\n          _h.failToast(consolidationInProgress);\n\n          break;\n\n        case 612:\n          var fileUploadTimeError = _h.getApiMessage(\"FileUploadTimeError\");\n\n          _h.failToast(fileUploadTimeError);\n\n          break;\n\n        default:\n          if (!model[\"error\"] && !model.messageType) {\n            if (model.messageType) toast.error(this._entityName, model.messageType, model.messageKey);else toast.error(this._entityName, verb.toLowerCase(), model.messageKey);\n          }\n\n          if (model[\"error\"]) model.error();\n          break;\n      }\n    }\n  }, {\n    key: \"startLoader\",\n    value: function startLoader() {\n      NProgress.configure({\n        parent: \"#np-bar\",\n        showSpinner: false\n      });\n      NProgress.start();\n    }\n  }, {\n    key: \"stopLoader\",\n    value: function stopLoader() {\n      NProgress.done();\n    }\n  }, {\n    key: \"startSplash\",\n    value: function startSplash(e) {\n      var randomId = Number((Math.random() * (10000000 - 100) + 100).toString().replace(\".\", \"\"));\n      var tag = '<div class=\"splash\" style=\"opacity: .9;position: absolute;\" id=\"bd-' + randomId + '\">' + '<div class=\"splash-title\" style=\"position: absolute;top: 55%;left: 44%;margin:0;\">' + '<div class=\"spinner\">' + '<div class=\"rect1\"></div>' + '<div class=\"rect2\"></div>' + '<div class=\"rect3\"></div>' + '<div class=\"rect4\"></div>' + '<div class=\"rect5\"></div>' + '</div></div></div>';\n\n      if (typeof e === \"string\") {\n        var target = $(e);\n\n        if (target.length) {\n          target.prepend(tag);\n        }\n      } else {\n        var targetFooterModal = $(e.target).closest(\".modal-footer\");\n\n        if (targetFooterModal.length) {\n          targetFooterModal.prepend(tag);\n        }\n      }\n\n      return randomId;\n    }\n  }, {\n    key: \"stopSplash\",\n    value: function stopSplash(randomId) {\n      var targetBody = $(\"#bd-\" + randomId);\n\n      if (targetBody.length) {\n        targetBody.remove();\n      } else {\n        var splashes = $(\".splash\");\n        if (splashes.length) for (var i = 0; i < splashes.length; i++) {\n          var target = splashes[i];\n          $(target).remove();\n        }\n      }\n    }\n  }, {\n    key: \"isOnline\",\n    value: function isOnline() {\n      var nav = window.navigator;\n      var isInline = nav.onLine;\n    }\n  }]);\n\n  return ApiService;\n}();\nvar commonActionList = [\"gettableinfo\", \"putfolders\", \"getconsolidationbranch\", \"postisunique\", \"getformulatooltip\", \"postsearchprofile\", \"deletesearchprofile\", \"postsetting\", \"gettablelist\", \"getcompanyownership\", \"putstatetype\", \"getlastpriority\", \"getmappingtreelist\", \"getnodeselection\", \"putpriority\", \"getgeneraltreelist\", \"getxbrlconcepts\"];\n\n//# sourceURL=webpack://domino/./src/scripts/util/apiService.js?");

/***/ }),

/***/ "./src/scripts/util/autoMapper.js":
/*!****************************************!*\
  !*** ./src/scripts/util/autoMapper.js ***!
  \****************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\nmodule.exports = function () {\n  var createProps = function createProps(classInstance, resources) {\n    for (var property in resources) {\n      if (Object.prototype.hasOwnProperty.call(resources, property)) {\n        if (!classInstance[property]) classInstance[property] = ko.observable();\n      }\n    }\n  };\n\n  var fillForm = function fillForm(classInstance, model, excludeList) {\n    for (var property in model) {\n      if (Object.prototype.hasOwnProperty.call(model, property)) {\n        if (!excludeList || excludeList.indexOf(property) === -1) {\n          var value = ko.isObservable(model[property]) ? model[property]() : model[property];\n          if (!Array.isArray(model[property]())) classInstance[property] = ko.observable(value);\n          if (Array.isArray(model[property]())) classInstance[property] = ko.observableArray(value);\n        }\n      }\n    }\n  };\n\n  var fillModel = function fillModel(classInstance, model) {\n    for (var property in model) {\n      if (Object.prototype.hasOwnProperty.call(model, property)) {\n        if (!classInstance[property] && !Array.isArray(model[property])) classInstance[property] = ko.observable(model[property]);else if (!classInstance[property] && Array.isArray(model[property])) classInstance[property] = ko.observableArray(model[property]);else classInstance[property](model[property]);\n      }\n    }\n  };\n\n  var fillInfoModel = function fillInfoModel(classInstance, model) {\n    for (var property in model) {\n      if (Object.prototype.hasOwnProperty.call(model, property)) {\n        classInstance[property] = model[property];\n      }\n    }\n  };\n\n  var createPropsFromList = function createPropsFromList(classInstance, paramList) {\n    if (_h.any(paramList)) for (var i = 0; i < paramList.length; i++) {\n      var param = paramList[i];\n      var value = void 0;\n\n      switch (param.type) {\n        case \"\":\n          value = undefined;\n          if (!_h.isNullOrEmpty(param[\"def\"])) value = param[\"def\"];\n          if (!_h.isNullOrEmpty(param[\"val\"])) value = param[\"val\"];\n          classInstance[param.name] = value;\n          break;\n\n        case \"obar\":\n          value = [];\n          if (!_h.isNullOrEmpty(param[\"def\"])) value = param[\"def\"];\n          if (!_h.isNullOrEmpty(param[\"val\"])) value = param[\"val\"];\n          classInstance[param.name] = ko.observableArray(value);\n          break;\n\n        case \"ar\":\n          value = [];\n          if (!_h.isNullOrEmpty(param[\"def\"])) value = param[\"def\"];\n          if (!_h.isNullOrEmpty(param[\"val\"])) value = param[\"val\"];\n          classInstance[param.name] = value;\n          break;\n\n        case \"ob\":\n          value = undefined;\n          if (!_h.isNullOrEmpty(param[\"def\"])) value = param[\"def\"];\n          if (!_h.isNullOrEmpty(param[\"val\"])) value = param[\"val\"];\n          classInstance[param.name] = ko.observable(value);\n          break;\n      }\n    }\n  };\n\n  return {\n    fillInfoModel: fillInfoModel,\n    fillForm: fillForm,\n    createProps: createProps,\n    createPropsFromList: createPropsFromList,\n    fillModel: fillModel\n  };\n}();\n\n//# sourceURL=webpack://domino/./src/scripts/util/autoMapper.js?");

/***/ }),

/***/ "./src/scripts/util/bindingHandlers.js":
/*!*********************************************!*\
  !*** ./src/scripts/util/bindingHandlers.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n__webpack_require__(/*! ../vendors/jquery.bootstrap-touchspin.min.js */ \"./src/scripts/vendors/jquery.bootstrap-touchspin.min.js\");\n\n__webpack_require__(/*! ../vendors/jquery.maskedinput.min.js */ \"./src/scripts/vendors/jquery.maskedinput.min.js\");\n\nko.bindingHandlers.restext = {\n  update: function update(element, valueAccessor, allBindingsAccessor, viewModel, context) {\n    var text = _h.getLocalizedText(ko.utils.unwrapObservable(valueAccessor()));\n\n    if ($(element).hasClass(\"control-label\")) {\n      var size = _h.calDim(text, \"11px\", \"Iransans\", \"400\");\n\n      $(element).css(\"width\", size[1] + 20 + \"px\");\n    }\n\n    ko.bindingHandlers.text.update(element, function () {\n      return text;\n    }, allBindingsAccessor, viewModel, context);\n  }\n};\nko.bindingHandlers.resattr = {\n  update: function update(element, valueAccessor, allBindingsAccessor, viewModel, context) {\n    var json = ko.utils.unwrapObservable(valueAccessor());\n\n    for (var attr in json) {\n      var text = _h.getLocalizedText(json[attr]);\n\n      ko.bindingHandlers.attr.update(element, function () {\n        var x = {};\n        x[attr] = text;\n        return x;\n      }, allBindingsAccessor, viewModel, context);\n    }\n  }\n};\nko.bindingHandlers.restitle = {\n  update: function update(element, valueAccessor, allBindingsAccessor, viewModel, context) {\n    var json = ko.utils.unwrapObservable(valueAccessor());\n\n    var text = _h.getLocalizedText(json['title'], json['entityName']);\n\n    ko.bindingHandlers.attr.update(element, function () {\n      return {\n        title: text\n      };\n    }, allBindingsAccessor, viewModel, context);\n  }\n};\nko.bindingHandlers.restext.getText = _h.getLocalizedText;\nko.bindingHandlers.label = {\n  init: function init() {\n    return {\n      controlsDescendantBindings: true\n    };\n  },\n  update: function update(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n    var $element = $(element),\n        value = valueAccessor(),\n        color = value[\"color\"],\n        text = value[\"text\"];\n    if (value === null || value === undefined) throw new Error('label binding value is null');\n\n    if (element.nodeType === (typeof Node !== 'undefined' && Node.ELEMENT_NODE || 1)) {\n      $element.removeClass(\"label-info label-danger label-success label-default label-warning label-none\");\n\n      switch (color) {\n        case \"green\":\n          $element.addClass('label').addClass('label label-success').text(text);\n          break;\n\n        case \"red\":\n          $element.addClass('label').addClass('label label-danger').text(text);\n          break;\n\n        case \"orange\":\n          $element.addClass('label').addClass('label label-warning').text(text);\n          break;\n\n        case \"blue\":\n          $element.addClass('label').addClass('label label-info').text(text);\n          break;\n\n        case \"navy\":\n          $element.addClass('label').addClass('label label-primary').text(text);\n          break;\n\n        case \"gray\":\n          $element.addClass('label').addClass('label label-default').text(text);\n          break;\n\n        case \"none\":\n          $element.addClass('label').addClass('label label-none').text(text);\n          break;\n\n        case \"\":\n          $element.addClass('label').addClass('label label-none').text(text);\n          break;\n      }\n    }\n  }\n};\nko.bindingHandlers.touchSpin = {\n  init: function init(element, valueAccessor, allBindingsAccessor, viewModel) {\n    var allBindings = allBindingsAccessor(),\n        value = ko.utils.unwrapObservable(valueAccessor()),\n        touchSpinOptions = allBindings.touchSpinOptions || {},\n        defaults = ko.bindingHandlers.touchSpin.defaults,\n        $element = $(element);\n    var options = $.extend(false, {\n      initval: value\n    }, defaults, touchSpinOptions);\n    ko.bindingHandlers.value.init(element, valueAccessor, allBindingsAccessor);\n    $element.TouchSpin(options);\n    $element.parent(\".input-group\").css(\"width\", \"96%\");\n    ko.bindingHandlers.touchSpin.updateEnableState(element, allBindings);\n  },\n  update: function update(element, valueAccessor, allBindingsAccessor) {\n    var allBindings = allBindingsAccessor();\n    ko.bindingHandlers.value.update(element, valueAccessor);\n    ko.bindingHandlers.touchSpin.updateEnableState(element, allBindings);\n  },\n  updateEnableState: function updateEnableState(element, allBindings) {\n    var $element = $(element),\n        $plus = $element.parent().find(\".bootstrap-touchspin-up\"),\n        $minus = $element.parent().find(\".bootstrap-touchspin-down\");\n\n    if (allBindings.enable !== undefined) {\n      if (ko.utils.unwrapObservable(allBindings.enable) === true) {\n        $plus.removeAttr('disabled');\n        $minus.removeAttr('disabled');\n      } else {\n        $plus.attr('disabled', 'disabled');\n        $minus.attr('disabled', 'disabled');\n      }\n    }\n\n    if (allBindings.disable !== undefined) {\n      if (ko.utils.unwrapObservable(allBindings.disable) === false) {\n        $plus.removeAttr('disabled');\n        $minus.removeAttr('disabled');\n      } else {\n        $plus.attr('disabled', 'disabled');\n        $minus.attr('disabled', 'disabled');\n      }\n    }\n  },\n  defaults: {\n    min: 1,\n    max: 20,\n    initval: \"\",\n    step: 1,\n    verticalbuttons: true,\n    decimals: 0,\n    stepinterval: 20,\n    forcestepdivisibility: 'round',\n    // none | floor | round | ceil\n    stepintervaldelay: 500,\n    prefix: \"\",\n    postfix: \"\",\n    prefix_extraclass: \"\",\n    postfix_extraclass: \"\",\n    booster: true,\n    boostat: 10,\n    maxboostedstep: false,\n    mousewheel: false\n  }\n};\nko.bindingHandlers.tooltip = {\n  'init': function init(element, valueAccessor) {\n    var local = ko.utils.unwrapObservable(valueAccessor());\n    var options = {};\n    ko.utils.extend(options, ko.bindingHandlers.tooltip.options);\n    ko.utils.extend(options, local);\n    $(element).tooltip(options);\n    ko.utils.domNodeDisposal.addDisposeCallback(element, function () {\n      $(element).tooltip(\"destroy\");\n    });\n  },\n  'update': function update(element, valueAccessor) {\n    var local = ko.utils.unwrapObservable(valueAccessor());\n    var options = {};\n    ko.utils.extend(options, ko.bindingHandlers.tooltip.options);\n    ko.utils.extend(options, local);\n    $(element).data(\"bs.tooltip\").options.title = options.title;\n  },\n  options: {\n    placement: \"top\",\n    trigger: \"hover\"\n  }\n};\n\nko.extenders.inputNumberFormatter = function (target, options) {\n  target.formatted = ko.computed({\n    read: function read() {\n      if (target() === null || target() === undefined || target() === \"\") return \"\";\n      if (target() === \"-\") return \"-\";\n      var temp = ko.isObservable(target) ? target() : target;\n      var decimalPart, numberPart;\n      var decimalNumber = ko.isObservable(options[\"decimalNumber\"]) ? options[\"decimalNumber\"]() : options[\"decimalNumber\"];\n\n      if (decimalNumber) {\n        if (temp.toString().indexOf(\".\") !== -1) {\n          numberPart = temp.toString().split(\".\")[0];\n          decimalPart = temp.toString().split(\".\")[1];\n          if (options[\"negative\"]) return numberPart.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\") + \".\" + decimalPart;else return numberPart.toString().replace('-', '').replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\") + \".\" + decimalPart;\n        } else {\n          if (options[\"negative\"]) return temp.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");else return temp.toString().replace('-', '').replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n        }\n      } else {\n        if (options[\"negative\"]) return target().toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");else return target().toString().replace('-', '').replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n      }\n    },\n    write: function write(newValue) {\n      var decimalPart, numberPart;\n      var current = target();\n\n      var hasChar = _h.stringHasAlphabet(newValue);\n\n      if (hasChar) {\n        target(undefined);\n        target.notifySubscribers(undefined);\n      } else {\n        var newValueAsNum;\n        var decimalNumber = ko.isObservable(options[\"decimalNumber\"]) ? options[\"decimalNumber\"]() : options[\"decimalNumber\"];\n\n        if (decimalNumber) {\n          newValueAsNum = String(newValue).replace(/[^0-9\\.\\-]/g, '');\n        } else {\n          if (newValue.toString().indexOf(\".\") !== -1) {\n            numberPart = newValue.toString().split(\".\")[0];\n            decimalPart = newValue.toString().split(\".\")[1];\n            newValueAsNum = String(numberPart).replace(/[^0-9\\-]/g, '');\n          } else {\n            newValueAsNum = String(newValue).replace(/[^0-9\\-]/g, '');\n          }\n        }\n\n        var valueToWrite = newValueAsNum;\n\n        if (valueToWrite !== current) {\n          target(valueToWrite);\n          if (options.callback) options.callback(valueToWrite);\n        } else {\n          if (newValue !== current) {\n            target.notifySubscribers(valueToWrite);\n            if (options.callback) options.callback(valueToWrite);\n          }\n        }\n      }\n    }\n  }).extend({\n    notify: 'always'\n  });\n  return target;\n};\n\nko.bindingHandlers.singleOrDoubleClick = {\n  init: function init(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n    var singleHandler = valueAccessor().click,\n        doubleHandler = valueAccessor().dblclick,\n        delay = valueAccessor().delay || 300,\n        clicks = 0;\n    $(element).click(function (event) {\n      clicks++;\n\n      if (clicks === 1) {\n        setTimeout(function () {\n          if (clicks === 1) {\n            if (singleHandler !== undefined) {\n              singleHandler.call(viewModel, bindingContext.$data, event);\n            }\n          } else {\n            if (doubleHandler !== undefined) {\n              doubleHandler.call(viewModel, bindingContext.$data, event);\n            }\n          }\n\n          clicks = 0;\n        }, delay);\n      }\n    });\n  }\n};\nko.bindingHandlers.foreachprop = {\n  transformObject: function transformObject(obj) {\n    var properties = [];\n    ko.utils.objectForEach(obj, function (key, value) {\n      properties.push({\n        key: key,\n        value: value\n      });\n    });\n    return properties;\n  },\n  init: function init(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n    var properties = ko.pureComputed(function () {\n      var obj = ko.utils.unwrapObservable(valueAccessor());\n      return ko.bindingHandlers.foreachprop.transformObject(obj);\n    });\n    ko.applyBindingsToNode(element, {\n      foreach: properties\n    }, bindingContext);\n    return {\n      controlsDescendantBindings: true\n    };\n  }\n};\nko.bindingHandlers.debug = {\n  init: function init(element, valueAccessor) {\n    console.log('Knockoutbinding:');\n    console.log(element);\n    console.log(ko.toJS(valueAccessor()));\n  }\n};\n\nko.subscribable.fn.supsendableSubscribe = function (callback, callbackTarget, event) {\n  var isSuspended = false;\n  return ko.utils.extend(this.subscribe(function () {\n    if (!isSuspended) return callback.apply(this, arguments);\n  }, callbackTarget, event), {\n    suspend: function suspend() {\n      isSuspended = true;\n    },\n    unsuspend: function unsuspend() {\n      isSuspended = false;\n    }\n  });\n};\n\nko.extenders.formatSize = function (target, options) {\n  var result = ko.computed({\n    read: function read() {\n      return target();\n    },\n    write: function write(newValue) {\n      if (newValue) {\n        var current = target();\n\n        if (newValue >= options.min && newValue <= options.max) {\n          if (newValue !== current) {\n            target(newValue);\n          }\n        } else {\n          if (newValue !== current) {\n            target.notifySubscribers(current);\n          }\n        }\n      }\n    }\n  }).extend({\n    notify: 'always'\n  });\n\n  target.upClick = function (fg) {};\n\n  result(target());\n  return result;\n};\n\nko.bindingHandlers.masked = {\n  init: function init(element, valueAccessor, allBindingsAccessor) {\n    var mask = allBindingsAccessor().mask;\n    var placeholder = allBindingsAccessor().placeholder;\n\n    var getCaretPosition = function getCaretPosition(element) {\n      var caretPos = 0,\n          sel;\n\n      if (document.selection) {\n        element.focus();\n        sel = document.selection.createRange();\n        sel.moveStart('character', -element.value.length);\n        caretPos = sel.text.length;\n      } else if (element.selectionStart || element.selectionStart === '0') {\n        caretPos = element.selectionStart;\n      }\n\n      return caretPos;\n    };\n\n    var setCaretPosition = function setCaretPosition(element, pos) {\n      var range;\n\n      if (element.setSelectionRange) {\n        element.focus();\n        element.setSelectionRange(pos, pos);\n      } else if (element.createTextRange) {\n        range = element.createTextRange();\n        range.collapse(true);\n        range.moveEnd('character', pos);\n        range.moveStart('character', pos);\n        range.select();\n      }\n    };\n\n    $(element).mask(mask(), {\n      placeholder: placeholder()\n    });\n    ko.utils.registerEventHandler(element, 'keypress', function () {\n      var observable = valueAccessor(),\n          position;\n\n      if ($(element).val().length === 10) {\n        position = getCaretPosition(this);\n        observable($(element).val());\n        setCaretPosition(this, position);\n      }\n    });\n    ko.utils.registerEventHandler(element, 'blur', function () {\n      var observable = valueAccessor();\n      observable($(element).val());\n    });\n    ko.utils.registerEventHandler(element, 'change', function () {\n      var observable = valueAccessor();\n      observable($(element).val());\n    });\n  },\n  update: function update(element, valueAccessor) {\n    var value = ko.utils.unwrapObservable(valueAccessor());\n    $(element).val(value);\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/util/bindingHandlers.js?");

/***/ }),

/***/ "./src/scripts/util/clientStorage.js":
/*!*******************************************!*\
  !*** ./src/scripts/util/clientStorage.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"ClientStorage\": () => (/* binding */ ClientStorage)\n/* harmony export */ });\n/* harmony import */ var _apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./apiService.js */ \"./src/scripts/util/apiService.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\n\nvar ClientStorage = /*#__PURE__*/function () {\n  function ClientStorage() {\n    _classCallCheck(this, ClientStorage);\n\n    this.time = 3000;\n    this.changed = false;\n    this.locked = false;\n    this.removeItem = null;\n    this.init();\n  }\n\n  _createClass(ClientStorage, [{\n    key: \"init\",\n    value: function init() {\n      this.interval = setInterval(function () {\n        if (this.changed && !this.locked) {\n          this.locked = true;\n          this.sendToServer();\n        }\n      }.bind(this), this.time);\n    }\n  }, {\n    key: \"setSetting\",\n    value: function setSetting(items) {\n      var settings = this.getAllSetting();\n      if (!settings || settings === null) settings = [];\n\n      for (var i = 0; i < items.length; i++) {\n        if (_h.any(settings)) {\n          var item = settings.filter(function (a) {\n            return a.key === items[i].key;\n          });\n\n          if (item.length > 0) {\n            item[0].value = items[i].value;\n            item[0].changed = true;\n          } else {\n            items[i].changed = true;\n            settings.push(items[i]);\n          }\n        } else {\n          items[i].changed = true;\n          settings.push(items[i]);\n        }\n      }\n\n      this.set(\"sts\", JSON.stringify(settings));\n      this.changed = true;\n    }\n  }, {\n    key: \"getSetting\",\n    value: function getSetting(key) {\n      try {\n        var item;\n        var settings = this.getAllSetting();\n        item = settings.filter(function (a) {\n          return a.key === key;\n        })[0];\n        return item.value;\n      } catch (e) {\n        return undefined;\n      }\n    }\n  }, {\n    key: \"get\",\n    value: function get(key) {\n      try {\n        return localStorage.getItem(key);\n      } catch (e) {\n        return undefined;\n      }\n    }\n  }, {\n    key: \"set\",\n    value: function set(key, value) {\n      try {\n        localStorage.setItem(key, value);\n        return true;\n      } catch (e) {\n        return false;\n      }\n    }\n  }, {\n    key: \"sendToServer\",\n    value: function sendToServer() {\n      if (!this.removeItem) {\n        var settings = this.getAllSetting();\n\n        if (settings && settings.length > 0) {\n          settings = settings.filter(function (a) {\n            return a.changed;\n          });\n        }\n\n        if (_h.isEmpty(settings) || settings.length === 0) return;\n        var model = {\n          settings: settings\n        };\n        _apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n          url: \"/api/common/postsetting\",\n          data: model,\n          notShowAjaxLoader: true,\n          success: function (data) {\n            this.changed = false;\n            this.locked = false;\n            this.resetChangedItems();\n          }.bind(this),\n          error: function (data) {\n            this.locked = false;\n          }.bind(this)\n        });\n      } else {\n        var model = {\n          list: [this.removeItem.key]\n        };\n        _apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n          url: \"/api/common/deletesetting\",\n          data: model,\n          success: function (data) {\n            this.changed = false;\n            this.locked = false;\n            this.removeItem = null;\n          }.bind(this),\n          error: function error(data) {\n            this.locked = false;\n          }\n        });\n      }\n    }\n  }, {\n    key: \"removeSetting\",\n    value: function removeSetting(key) {\n      var settings = this.getAllSetting();\n      var newList = [];\n      var item = null;\n\n      if (settings && settings.length > 0) {\n        for (var i = 0; i < settings.length; i++) {\n          if (key !== settings[i].key) {\n            newList.push(settings[i]);\n          } else {\n            item = settings[i];\n          }\n        }\n\n        if (item) {\n          this.set(\"sts\", JSON.stringify(newList));\n          this.removeItem = item;\n          this.changed = true;\n        }\n      }\n    }\n  }, {\n    key: \"getAllSetting\",\n    value: function getAllSetting() {\n      var text = this.get(\"sts\");\n\n      if (!_h.isEmpty(text)) {\n        return JSON.parse(text);\n      }\n    }\n  }, {\n    key: \"resetChangedItems\",\n    value: function resetChangedItems() {\n      var settings = this.getAllSetting();\n\n      if (settings && settings.length > 0) {\n        for (var i = 0; i < settings.length; i++) {\n          delete settings[i][\"changed\"];\n        }\n\n        this.set(\"sts\", JSON.stringify(settings));\n      }\n    }\n  }]);\n\n  return ClientStorage;\n}();\n\n//# sourceURL=webpack://domino/./src/scripts/util/clientStorage.js?");

/***/ }),

/***/ "./src/scripts/util/commonResources.js":
/*!*********************************************!*\
  !*** ./src/scripts/util/commonResources.js ***!
  \*********************************************/
/***/ (() => {

eval("var _window$commonRes;\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nwindow.controllerNames = [{\n  text: 'کاربران',\n  enText: 'User',\n  value: 2,\n  group: 'کاربران',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'فعالیتهای کاربر',\n  enText: 'ActionLog',\n  value: 9,\n  group: 'کاربران',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'کاربران برخط',\n  enText: 'OnlineUser',\n  value: 62,\n  group: 'کاربران',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'دسترسی ها',\n  enText: 'Access',\n  value: 8,\n  group: 'کاربران',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'حساب کاربری',\n  enText: 'Account',\n  value: 44,\n  group: 'کاربران',\n  hidden: true,\n  color: 'none'\n}, {\n  text: 'دوره مالی',\n  enText: 'Period',\n  value: 6,\n  group: 'اطلاعات پایه',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'شرکت های تابعه',\n  enText: 'Company',\n  value: 1,\n  group: 'اطلاعات پایه',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'اطلاعات شرکت ها',\n  enText: 'CompanyInfo',\n  value: 61,\n  group: 'اطلاعات پایه',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'فهرست درختواره',\n  enText: 'Tree',\n  value: 4,\n  group: 'درختواره ها',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'ویرایشگر درختواره',\n  enText: 'Node',\n  value: 5,\n  group: 'درختواره ها',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'جدول های محاسبات',\n  enText: 'DynamicTable',\n  value: 49,\n  group: 'محاسبات',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'دیتای جدول محاسبات',\n  enText: 'DynamicTableData',\n  value: 60,\n  group: 'محاسبات',\n  hidden: true,\n  color: 'none'\n}, {\n  text: 'روال های محاسبه',\n  enText: 'DynamicDocument',\n  value: 50,\n  group: 'محاسبات',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'فایل تراز',\n  enText: 'BalanceSheet',\n  value: 13,\n  group: 'عملیات',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'نگاشت',\n  enText: 'Mapping',\n  value: 16,\n  group: 'عملیات',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'الگوی نگاشت',\n  enText: 'MappingRule',\n  value: 59,\n  group: 'عملیات',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'اسناد اصلاحی و طبقه بندی',\n  enText: 'AdjustmentDocument',\n  value: 10,\n  group: 'عملیات',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'بندهای سند اصلاحی و طبقه بندی',\n  enText: 'AdjustmentDocumentItem',\n  value: 32,\n  group: 'عملیات',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'بررسی صورت های مالی شرکتهای تابعه',\n  enText: 'GroupPeriod',\n  value: 37,\n  group: 'عملیات',\n  hidden: false,\n  color: 'none'\n}, {\n  text: ' شرکتهای مشمول تلفیق',\n  enText: 'Consolidate',\n  value: 39,\n  group: 'عملیات',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'کاربرگ',\n  enText: 'BalanceReport',\n  value: 12,\n  group: 'گزارشات',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'قالب جدول',\n  enText: 'TableTemplate',\n  value: 20,\n  group: 'یادداشت های همراه',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'ساختار جدول',\n  enText: 'TableStructure',\n  value: 19,\n  group: 'یادداشت های همراه',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'مجله',\n  enText: 'Magazine',\n  value: 7,\n  group: 'یادداشت های همراه',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'نامشخص',\n  enText: 'NoName',\n  value: 0,\n  group: 'سایر',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'مدیریت ارتباط',\n  enText: 'Connection',\n  value: 53,\n  group: 'سایر',\n  hidden: false,\n  color: 'none'\n}, {\n  text: ' تغییرات نرم افزار',\n  enText: 'ChangeLog',\n  value: 36,\n  group: 'سایر',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'عمومی',\n  enText: 'Common',\n  value: 54,\n  group: 'سایر',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'سرویس سامانه اکسیر',\n  enText: 'DominoEndpoint',\n  value: 56,\n  group: 'سایر',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'تولید فایل خروجی',\n  enText: 'FileGenerator',\n  value: 52,\n  group: 'سایر',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'راهنما',\n  enText: 'Help',\n  value: 41,\n  group: 'سایر',\n  hidden: false,\n  color: 'none'\n}, {\n  text: 'پردازش',\n  enText: 'Process',\n  value: 55,\n  group: 'سایر',\n  hidden: true,\n  color: 'none'\n}, {\n  text: 'لیست ها',\n  enText: 'SelectList',\n  value: 57,\n  group: 'سایر',\n  hidden: true,\n  color: 'none'\n}];\nwindow.entities = {\n  \"User\": {\n    menu: \"Users\",\n    prop: \"uvm\"\n  },\n  \"ActionLog\": {\n    menu: \"Users\",\n    prop: \"avm\"\n  },\n  \"OnlineUser\": {\n    menu: \"Users\",\n    prop: \"ovm\"\n  },\n  \"Access\": {\n    menu: \"Users\",\n    prop: \"acvm\"\n  },\n  \"Period\": {\n    menu: \"BasicInfo\",\n    prop: \"pvm\"\n  },\n  \"Company\": {\n    menu: \"BasicInfo\",\n    prop: \"cvm\"\n  },\n  \"CompanyInfo\": {\n    menu: \"BasicInfo\",\n    prop: \"civm\"\n  },\n  \"Tree\": {\n    menu: \"Trees\",\n    prop: \"treevm\"\n  },\n  \"TableTemplate\": {\n    menu: \"Notes\",\n    prop: \"ttvm\"\n  },\n  \"Magazine\": {\n    menu: \"Notes\",\n    prop: \"mgvm\"\n  },\n  \"DynamicTable\": {\n    menu: \"Operation\",\n    prop: \"tavm\"\n  },\n  \"DynamicDocument\": {\n    menu: \"Operation\",\n    prop: \"ddvm\"\n  },\n  \"BalanceReport\": {\n    menu: \"Operation\",\n    prop: \"brvm\"\n  },\n  \"Balancesheet\": {\n    menu: \"Operation\",\n    prop: \"bvm\"\n  },\n  \"Mapping\": {\n    menu: \"Operation\",\n    prop: \"mvm\"\n  },\n  \"AdjustmentDocument\": {\n    menu: \"Operation\",\n    prop: \"advm\"\n  },\n  \"GroupPeriod\": {\n    menu: \"Operation\",\n    prop: \"gpvm\"\n  },\n  \"Consolidate\": {\n    menu: \"Operation\",\n    prop: \"covm\"\n  }\n};\nwindow.nodeLocations = [{\n  text: \"\",\n  enText: \"middle\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"\",\n  enText: \"first\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"\",\n  enText: \"last\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"\",\n  enText: \"root\",\n  value: 3,\n  color: \"\"\n}];\nwindow.stateTypes = [{\n  text: \"فعال\",\n  enText: \"\",\n  value: 1,\n  color: \"green\"\n}, {\n  text: \"غیر فعال\",\n  enText: \"\",\n  value: 0,\n  color: \"red\"\n}];\nwindow.currencyTypes = [{\n  text: \"ریال\",\n  enText: \"Rial \",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"سایر ارزها\",\n  enText: \"OtherCurrencies \",\n  value: 2,\n  color: \"\"\n}];\nwindow.pageNames = [{\n  text: \"نامشخص\",\n  enText: \"NoName\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"اطلاعات پایه\",\n  enText: \"BasicInfo\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"یادداشت های همراه\",\n  enText: \"Notes\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"عملیات\",\n  enText: \"Operation\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"گزارشات\",\n  enText: \"Reports\",\n  value: 4,\n  color: \"\"\n}, {\n  text: \"درختواره ها\",\n  enText: \"Trees\",\n  value: 5,\n  color: \"\"\n}, {\n  text: \"کاربران\",\n  enText: \"Users\",\n  value: 6,\n  color: \"\"\n}, {\n  text: \"محاسبات\",\n  enText: \"Tables\",\n  value: 7,\n  color: \"\"\n}];\nwindow.amountTypes = [{\n  text: \"ریال\",\n  enText: \"Rial\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"میلیون ریال\",\n  enText: \"MillionRial\",\n  value: 2,\n  color: \"\"\n}];\nwindow.displayTypes = [{\n  text: \"گردش دار\",\n  enText: \"WithFlow\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"بدون گردش\",\n  enText: \"WithoutFlow\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"همه\",\n  enText: \"All\",\n  value: 1,\n  color: \"\"\n}];\nwindow.accountTypes = [{\n  text: \"بدهکار\",\n  enText: \"Debtor\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"بستانکار\",\n  enText: \"Creditor\",\n  value: 1,\n  color: \"\"\n}];\nwindow.periodTypes = [{\n  text: \"قطعی\",\n  enText: \"\",\n  value: 0,\n  color: \"danger\"\n}, {\n  text: \"پیش بینی شده\",\n  enText: \"\",\n  value: 1,\n  color: \"success\"\n}];\nwindow.submitStates = [{\n  text: \"ارسال نشده\",\n  enText: \"NotSubmitted\",\n  value: 0,\n  color: \"blue\"\n}, {\n  text: \"در انتظار تایید\",\n  enText: \"Submitted\",\n  value: 1,\n  color: \"orange\"\n}, {\n  text: \"تایید شده\",\n  enText: \"Confirmed\",\n  value: 2,\n  color: \"green\"\n}, {\n  text: \"برگشت شده\",\n  enText: \"Rejected\",\n  value: 3,\n  color: \"red\"\n}];\nwindow.periodStates = [{\n  text: \"عملکرد\",\n  enText: \"\",\n  value: 0,\n  color: \"danger\"\n}, {\n  text: \"تجدید ارائه\",\n  enText: \"\",\n  value: 1,\n  color: \"success\"\n}];\nwindow.auditStates = [{\n  text: \"حسابرسی شده\",\n  enText: \"\",\n  value: 1,\n  color: \"success\"\n}, {\n  text: \"حسابرسی نشده\",\n  enText: \"\",\n  value: 0,\n  color: \"danger\"\n}];\nwindow.confirmationStates = [{\n  text: \"پیش نویس\",\n  enText: \"Temporary\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"تایید شده\",\n  enText: \"Confirmed\",\n  value: 2,\n  color: \"\"\n}];\nwindow.valueTypes = [{\n  text: \"مالی\",\n  enText: \"Fiscal\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"عددی\",\n  enText: \"Numeral\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"غیر عددی\",\n  enText: \"NonNumeral\",\n  value: 2,\n  color: \"\"\n}];\nwindow.menus = [{\n  text: \"کاربران\",\n  enText: \"Users\",\n  \"default\": \"User\"\n}, {\n  text: \"اطلاعات پایه\",\n  enText: \"BasicInfo\",\n  \"default\": \"Period\"\n}, {\n  text: \"درختواره ها\",\n  enText: \"Trees\",\n  \"default\": \"Tree\"\n}, {\n  text: \"عملیات\",\n  enText: \"Operation\",\n  \"default\": \"Balancesheet\"\n}, {\n  text: \"جدول ها\",\n  enText: \"Tables\",\n  \"default\": \"DynamicTable\"\n}, {\n  text: \"گزارشات\",\n  enText: \"Reports\",\n  \"default\": \"BalanceReport\"\n}, {\n  text: \"یادداشت های همراه\",\n  enText: \"Notes\",\n  \"default\": \"TableTemplate\"\n}];\nwindow.financialPeriods2 = [{\n  text: \"جاری\",\n  enText: \"Current\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"دوره مقایسه ای اول\",\n  enText: \"FirstComparative\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"دوره مقایسه ای دوم\",\n  enText: \"SecondComparative\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"دوره مقایسه ای سوم\",\n  enText: \" ThirdComparative\",\n  value: 4,\n  color: \"\"\n}];\nwindow.fontFamilies = [{\n  text: \"نازنین\",\n  value: \"Nazanin\"\n}, {\n  text: \"هما\",\n  value: \"Homa\"\n}, {\n  text: \"میترا\",\n  value: \"Mitra\"\n}, {\n  text: \"یکان\",\n  value: \"Yekan\"\n}, {\n  text: \"تیتر\",\n  value: \"Titr\"\n}];\nwindow.fontSizes = [{\n  text: \"6\",\n  value: \"6px\"\n}, {\n  text: \"7\",\n  value: \"7px\"\n}, {\n  text: \"8\",\n  value: \"8px\"\n}, {\n  text: \"9\",\n  value: \"9px\"\n}, {\n  text: \"10\",\n  value: \"10px\"\n}, {\n  text: \"11\",\n  value: \"11px\"\n}, {\n  text: \"12\",\n  value: \"12px\"\n}, {\n  text: \"13\",\n  value: \"13px\"\n}, {\n  text: \"14\",\n  value: \"14px\"\n}, {\n  text: \"16\",\n  value: \"16px\"\n}, {\n  text: \"18\",\n  value: \"18px\"\n}, {\n  text: \"20\",\n  value: \"20px\"\n}, {\n  text: \"22\",\n  value: \"22px\"\n}, {\n  text: \"24\",\n  value: \"24px\"\n}, {\n  text: \"26\",\n  value: \"26px\"\n}, {\n  text: \"28\",\n  value: \"28px\"\n}, {\n  text: \"36\",\n  value: \"36px\"\n}, {\n  text: \"48\",\n  value: \"48px\"\n}, {\n  text: \"72\",\n  value: \"72px\"\n}];\nwindow.lineSpaces = [{\n  text: \".5\",\n  value: \".5\"\n}, {\n  text: \"1\",\n  value: \"1\"\n}, {\n  text: \"1.5\",\n  value: \"1.5\"\n}, {\n  text: \"2\",\n  value: \"2\"\n}, {\n  text: \"2.5\",\n  value: \"2.5\"\n}, {\n  text: \"3\",\n  value: \"3\"\n}, {\n  text: \"3.5\",\n  value: \"3.5\"\n}, {\n  text: \"4\",\n  value: \"4\"\n}];\nwindow.pageOrientations = [{\n  text: \"عمودی\",\n  enText: \"Portrait\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"افقی\",\n  enText: \"Landscape\",\n  value: 2,\n  color: \"\"\n}];\nwindow.reportTypes = [{\n  text: \"Pdf\",\n  enText: \"Pdf\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"Excel\",\n  enText: \"Excel\",\n  value: 2,\n  color: \"\"\n}];\nwindow.tableconditiondataTypes = [{\n  text: \"عدد صحیح\",\n  value: 0\n}, {\n  text: \"رشته\",\n  value: 1\n}, {\n  text: \"عدد اعشاری\",\n  value: 2\n}, {\n  text: \"مقدار پولی\",\n  value: 3\n}, {\n  text: \"تاریخ\",\n  value: 4\n}, {\n  text: \"داده منطقی\",\n  value: 5\n}, {\n  text: \"مجموعه\",\n  value: 7\n}, {\n  text: \"ستون جدول مبدا\",\n  value: 8\n}, {\n  text: \"فهرست رشته\",\n  value: 9\n}, {\n  text: \"فهرست تاریخ\",\n  value: 10\n}, {\n  text: \"فهرست مجموعه\",\n  value: 12\n}, {\n  text: \"-\",\n  value: 13\n}, {\n  text: \"فهرست اعداد\",\n  value: 14\n}, {\n  text: \"الگو\",\n  value: 15\n}, {\n  text: \"الگو\",\n  value: 20\n}, {\n  text: \"فرمول\",\n  value: 21\n}];\nwindow.parameterTypes = [{\n  text: \"مقدار ساده\",\n  enText: \"Input\",\n  value: 1\n}, {\n  text: \"انتخاب رکورد جدول\",\n  enText: \"TableSelect\",\n  value: 2\n}, {\n  text: \"انتخاب رکورد های جدول\",\n  enText: \"TableMultiSelect\",\n  value: 3\n}, {\n  text: \"انتخاب\",\n  enText: \"Select\",\n  value: 4\n}, {\n  text: \"انتخاب از لیست پویا\",\n  enText: \"CustomSelect\",\n  value: 5\n}, {\n  text: \"فایل\",\n  enText: \"File\",\n  value: 6\n}];\nwindow.formulaValueTypes = [{\n  text: \"مانده نهایی\",\n  value: \"F\"\n}, {\n  text: \"مانده اولیه\",\n  value: \"B\"\n}];\nwindow.moduleOutputTypes = [{\n  text: \"ورود داده\",\n  enText: \"Insert\",\n  value: 1\n}, {\n  text: \"ویرایش داده\",\n  enText: \"Updated\",\n  value: 2\n}];\nwindow.processTypes = [{\n  text: \"اجرای روال محاسبه\",\n  enText: \"DynamicDocumentCalculation\",\n  value: 1\n}, {\n  text: \"\",\n  enText: \"PdfCreation\",\n  value: 2\n}, {\n  text: \"\",\n  enText: \"NodeDelete\",\n  value: 3\n}, {\n  text: \"\",\n  enText: \"NodeReport\",\n  value: 4\n}, {\n  text: \"\",\n  enText: \"Consolidation\",\n  value: 5\n}, {\n  text: \"\",\n  enText: \"Connection\",\n  value: 6\n}];\nwindow.processStatuses = [{\n  color: \"blue\",\n  enText: \"Unknown\",\n  value: 0,\n  text: \"نامشخص\"\n}, {\n  color: \"orange\",\n  enText: \"InProgress\",\n  value: 1,\n  text: \"در حال اجرا\"\n}, {\n  color: \"orange\",\n  enText: \"Rollbacking\",\n  value: 2,\n  text: \"در حال بازگردانی\"\n}, {\n  color: \"red\",\n  enText: \"CanceledByUser\",\n  value: 3,\n  text: \"متوقف شده توسط کاربر\"\n}, {\n  color: \"green\",\n  enText: \"DoneSuccessfully\",\n  value: 4,\n  text: \"تمام شده با موفقیت\"\n}, {\n  color: \"red\",\n  enText: \"DoneWithError\",\n  value: 5,\n  text: \"متوقف شده با خطا\"\n}, {\n  color: \"orange\",\n  enText: \"InQueue\",\n  value: 6,\n  text: \"درصف اجرا\"\n}];\nwindow.dataTypes = [{\n  text: \"عدد صحیح\",\n  enText: \"Int\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"رشته\",\n  enText: \"String\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"عدد اعشاری\",\n  enText: \"Decimal\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"مقدار پولی\",\n  enText: \"Money\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"تاریخ\",\n  enText: \"DateTime\",\n  value: 4,\n  color: \"\"\n}, {\n  text: \"داده منطقی\",\n  enText: \"Bool\",\n  value: 5,\n  color: \"\"\n}, {\n  text: \"مجموعه\",\n  enText: \"Enum \",\n  value: 7,\n  color: \"\"\n}];\nwindow.pageNumberLocs = [{\n  text: \"عدم نمایش\",\n  value: 0\n}, {\n  text: \"محتوا صفحه -چپ\",\n  value: 1\n}, {\n  text: \"محتوا صفحه -راست\",\n  value: 2\n}, {\n  text: \"محتوا صفحه -وسط\",\n  value: 3\n}, {\n  text: \"پانویس صفحه -چپ\",\n  value: 4\n}, {\n  text: \"پانویس صفحه -راست\",\n  value: 5\n}, {\n  text: \"پانویس صفحه -وسط\",\n  value: 6\n}];\nwindow.treeTypes = [{\n  text: \"درختواره نگاشت\",\n  enText: \"Mapping\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"درختواره جریان وجوه نقد\",\n  enText: \"CashFlow\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"درختواره تلفیقی مالی\",\n  enText: \"FiscalSubTree\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"درختواره تلفیقی عددی\",\n  enText: \"NumeralSubTree\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"درختواره فرمول دار مالی\",\n  enText: \"FiscalFormulaTree\",\n  value: 4,\n  color: \"\"\n}, {\n  text: \"درختواره فرمول دار عددی\",\n  enText: \"NumeralFormulaTree\",\n  value: 5,\n  color: \"\"\n}, {\n  text: \"درختواره متنی\",\n  enText: \"TextualTree\",\n  value: 6,\n  color: \"\"\n}, {\n  text: \"درختواره عددی\",\n  enText: \"NumeralTree\",\n  value: 7,\n  color: \"\"\n}, {\n  text: \"درختواره مالی\",\n  enText: \"FiscalTree\",\n  value: 8,\n  color: \"\"\n}];\nwindow.treeTypes2 = [{\n  text: \"درختواره نگاشت\",\n  enText: \"Mapping\",\n  value: 0,\n  color: \"\"\n}, {\n  text: \"درختواره جریان وجوه نقد\",\n  enText: \"CashFlow\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"درختواره فرمول دار مالی\",\n  enText: \"FiscalFormulaTree\",\n  value: 4,\n  color: \"\"\n}, {\n  text: \"درختواره فرمول دار عددی\",\n  enText: \"NumeralFormulaTree\",\n  value: 5,\n  color: \"\"\n}, {\n  text: \"درختواره متنی\",\n  enText: \"TextualTree\",\n  value: 6,\n  color: \"\"\n}, {\n  text: \"درختواره عددی\",\n  enText: \"NumeralTree\",\n  value: 7,\n  color: \"\"\n}, {\n  text: \"درختواره مالی\",\n  enText: \"FiscalTree\",\n  value: 8,\n  color: \"\"\n}];\nwindow.reportgenRes = {\n  sectionTitle: {\n    fa: 'صفحه گسترده طراحی گزارش'\n  },\n  sectionmeditorTitle: {\n    fa: 'ویرایشگر صفحه مجله'\n  },\n  CustomStyleCaption: {\n    fa: 'تعریف استایل سفارشی'\n  },\n  titleStyle: {\n    fa: 'عنوان استایل'\n  },\n  textWrap: {\n    fa: 'عدم شکستن متن'\n  },\n  bold: {\n    fa: 'توپر'\n  },\n  italic: {\n    fa: 'کج'\n  },\n  underline: {\n    fa: 'زیر خط'\n  },\n  FontFamily: {\n    fa: 'قلم'\n  },\n  fontsize: {\n    fa: 'اندازه قلم'\n  },\n  alignright: {\n    fa: 'راست چین'\n  },\n  alignleft: {\n    fa: 'چپ چین'\n  },\n  aligncenter: {\n    fa: 'وسط چین'\n  },\n  direction: {\n    fa: 'جهت'\n  },\n  backcolor: {\n    fa: 'رنگ پس زمینه'\n  },\n  textcolor: {\n    fa: 'رنگ نوشته'\n  },\n  border: {\n    fa: 'حاشیه'\n  },\n  bordertype: {\n    fa: 'نوع حاشیه'\n  },\n  borderstroke: {\n    fa: 'ضخامت قلم'\n  },\n  styles: {\n    fa: 'استایل سلول'\n  },\n  eraseStyleCells: {\n    fa: 'حذف استایل سلول'\n  },\n  eraseDataCells: {\n    fa: 'حذف محتوای سلول'\n  },\n  copyCell: {\n    fa: 'کپی کردن سلول'\n  },\n  toolsCaption: {\n    fa: 'ابزارها'\n  },\n  saveChanges: {\n    fa: 'ذخیره اطلاعات'\n  },\n  refreshTemplate: {\n    fa: 'تازه سازی اطلاعات قالب جدول'\n  },\n  mergeCells: {\n    fa: 'ادغام سلول ها'\n  },\n  deleteRow: {\n    fa: 'حذف سطر'\n  },\n  deleteCol: {\n    fa: 'حذف ستون'\n  },\n  addRowTop: {\n    fa: 'افزودن سطر به بالا'\n  },\n  addColRight: {\n    fa: 'افزودن ستون به راست'\n  },\n  hideCol: {\n    fa: 'پنهان کردن ستون'\n  },\n  showCol: {\n    fa: 'نمایش ستون'\n  },\n  hideRow: {\n    fa: 'پنهان کردن سطر'\n  },\n  showRow: {\n    fa: 'نمایش سطر'\n  },\n  colSize: {\n    fa: 'عرض'\n  },\n  rowSize: {\n    fa: 'ارتفاع'\n  },\n  decimalPlaces: {\n    fa: 'تعداد ارقام اعشار'\n  },\n  xbrlConceptLabel: {\n    fa: 'برچسب XBRL'\n  },\n  financialPeriod: {\n    fa: 'دوره مالی'\n  },\n  cellDataType: {\n    fa: 'ماهیت سلول'\n  },\n  unmergeCells: {\n    fa: 'جداسازی سلول ها'\n  },\n  addCustomStyleBtn: {\n    fa: 'تعریف استایل سفارشی'\n  },\n  cellAccountType: {\n    fa: 'ماهیت حسابداری'\n  },\n  paperSizeAreaCaption: {\n    fa: 'نمایش حریم صفحه'\n  },\n  strikethrough: {\n    fa: 'خط خورده'\n  },\n  paragraphspacing: {\n    fa: 'فاصله خطوط'\n  },\n  listbullets: {\n    fa: 'لیست دایره ای'\n  },\n  listnumbers: {\n    fa: 'لیست شماره ای'\n  },\n  indent: {\n    fa: 'کاهش تورفتگی'\n  },\n  outdent: {\n    fa: 'افزایش تورفتگی'\n  },\n  insertpicture: {\n    fa: 'اضافه کردن تصویر'\n  },\n  pageNumber: {\n    fa: 'نمایش شماره صفحه'\n  },\n  pageOrientation: {\n    fa: 'جهت صفحه'\n  },\n  marginLeft: {\n    fa: 'چپ'\n  },\n  marginRight: {\n    fa: 'راست'\n  },\n  marginTop: {\n    fa: 'بالا'\n  },\n  marginBottom: {\n    fa: 'پایین'\n  },\n  disableMarginHeader: {\n    fa: 'حذف حاشیه سربرگ'\n  },\n  disableMarginFooter: {\n    fa: 'حذف حاشیه پانویس'\n  },\n  disableInNumeration: {\n    fa: 'عدم شمارش  در صفحه بندی'\n  },\n  showPageNumber: {\n    fa: 'نمایش شماره صفحه'\n  },\n  disableHeader: {\n    fa: 'عدم نمایش سربرگ'\n  },\n  disableFooter: {\n    fa: 'عدم نمایش پانویس'\n  },\n  disableDefaultHeader: {\n    fa: 'عدم نمایش سربرگ پیش فرض'\n  },\n  disableDefaultFooter: {\n    fa: 'عدم نمایش پانویس پیش فرض'\n  },\n  widthFullSize: {\n    fa: 'تصویر تمام عرض'\n  },\n  heightFullSize: {\n    fa: 'تصویر تمام ارتفاع'\n  },\n  BothFullSize: {\n    fa: 'تصویر تمام صفحه'\n  },\n  rotateLeft: {\n    fa: 'چرخش تصویر به چپ'\n  },\n  rotateRight: {\n    fa: 'چرخش تصویر به راست'\n  },\n  pictureDelete: {\n    fa: 'حذف عکس'\n  },\n  eraseAll: {\n    fa: 'حذف استایل'\n  },\n  paragraphDelete: {\n    fa: 'حذف پارگراف'\n  },\n  templateDelete: {\n    fa: 'حذف قالب جدول'\n  },\n  zoomIn: {\n    fa: 'بزرگنمایی قالب جدول'\n  },\n  zoomOut: {\n    fa: 'بزرگنمایی قالب جدول'\n  },\n  toPdf: {\n    fa: 'خروجی فایل پی دی اف صفحه'\n  },\n  dragStartTable: {\n    fa: 'جابه جایی قاب جدول'\n  },\n  dragStopTable: {\n    fa: 'اعمال جابه جایی قاب جدول'\n  },\n  addPage: {\n    fa: 'اضافه کردن صفحه مجله'\n  },\n  removePage: {\n    fa: 'حذف صفحه مجله'\n  },\n  defaultHeader: {\n    fa: 'سربرگ پیش فرض'\n  },\n  defaultFooter: {\n    fa: 'پانویس پیش فرض'\n  },\n  defaultContent: {\n    fa: 'ذخیره بعنوان قالب متن'\n  },\n  defaultOddHeader: {\n    fa: 'سربرگ پیش فرض'\n  },\n  defaultOddFooter: {\n    fa: 'پانویس پیش فرض'\n  },\n  defaultOddContent: {\n    fa: 'محتوای پیش فرض'\n  },\n  paragraphSpacingAfter: {\n    fa: 'اضافه کردن فاصله بعد از پارگراف'\n  },\n  paragraphSpacingBefore: {\n    fa: 'اضافه کردن فاصله قبل از پارگراف'\n  },\n  fontUp: {\n    fa: 'بزرگ کردن اندازه قلم'\n  },\n  fontDown: {\n    fa: 'کوچک کردن اندازه قلم'\n  },\n  resizeHeader: {\n    fa: 'تغییر اندازه قسمت'\n  },\n  removeTextTemplate: {\n    fa: 'حذف قالب متن'\n  },\n  copyTextTemplate: {\n    fa: 'کپی قالب متن'\n  },\n  evenPage: {\n    fa: 'صفحات زوج'\n  },\n  oddPage: {\n    fa: 'صفحات فرد'\n  },\n  justifyFull: {\n    fa: 'تراز کردن متن'\n  },\n  dirRtl: {\n    fa: 'راست به چپ'\n  },\n  dirLtr: {\n    fa: 'چپ به راست'\n  },\n  textTemplateFormCation: {\n    fa: 'تعریف قالب متن'\n  },\n  title: {\n    fa: 'عنوان'\n  },\n  templateRefresh: {\n    fa: 'بروز رسانی قالب'\n  },\n  copyContent: {\n    fa: 'نسخه برداری'\n  },\n  cutContent: {\n    fa: 'برش'\n  },\n  pasteContent: {\n    fa: 'چسباندن'\n  },\n  pictureHeight: {\n    fa: 'ارتفاع'\n  },\n  pictureWidth: {\n    fa: 'عرض'\n  },\n  fullScreen: {\n    fa: 'تمام صفحه'\n  },\n  realSizeScreen: {\n    fa: 'اندازه واقعی'\n  },\n  pageNavigate: {\n    fa: 'پیمایش صفحات مجله'\n  },\n  nodeOperatorEditBtn: {\n    fa: 'ویرایش گره های سلول'\n  },\n  valueSource: {\n    fa: 'نوع مقدار'\n  },\n  htmlTemplates: {\n    fa: 'قالب متن'\n  },\n  operatorCaption: {\n    fa: 'عملگر'\n  },\n  ruler: {\n    fa: 'خط کش'\n  },\n  cellSortDirection: {\n    fa: 'مرتب سازی'\n  },\n  cellGroupType: {\n    fa: 'گروه بندی'\n  },\n  removeParameter: {\n    fa: 'حذف پارامتر'\n  },\n  saveCellBindBtn: {\n    fa: 'ذخیره'\n  },\n  valueAccountType: {\n    fa: 'ماهیت مقدار'\n  },\n  zeroDisplay: {\n    fa: 'نمایش صفر'\n  },\n  valueDisplay: {\n    fa: 'نمایش مانده'\n  },\n  refreshEditor: {\n    fa: 'بروزرسانی'\n  },\n  wideInfobox: {\n    fa: 'بزرگ کردن'\n  },\n  unwideInfobox: {\n    fa: 'کوچک کردن'\n  },\n  ongoingOperations: {\n    fa: 'عملیات های در حال پردازش'\n  },\n  chartsCaption: {\n    fa: 'نمودار'\n  },\n  chartStyleTab: {\n    fa: 'استایل'\n  },\n  chartDataTab: {\n    fa: 'داده'\n  },\n  chartSettingTab: {\n    fa: 'تنظیمات'\n  },\n  chartTitle: {\n    fa: 'عنوان'\n  },\n  dataSource: {\n    fa: 'منبع داده'\n  },\n  chartTitlepadtop: {\n    fa: 'حاشیه بالا'\n  },\n  chartTitlepadbottom: {\n    fa: 'حاشیه پایین'\n  },\n  categories: {\n    fa: 'سطر ها'\n  },\n  series: {\n    fa: 'ستون ها'\n  },\n  fontSize: {\n    fa: 'اندازه قلم'\n  },\n  fontFamily: {\n    fa: 'نوع قلم'\n  },\n  settingChartBtn: {\n    fa: 'تنظیمات چارت'\n  },\n  refreshChartBtn: {\n    fa: 'بروزرسانی اطلاعات'\n  },\n  legendPosition: {\n    fa: 'محل قرارگیری'\n  },\n  InnerTypePlaceholder: {\n    fa: 'انتخاب نوع'\n  },\n  LoginCaption: {\n    fa: 'ورود به برنامه'\n  },\n  LoginHistoryCaption: {\n    fa: 'سوابق ورود کاربر'\n  },\n  SecurityConfigCaption: {\n    fa: 'تنظیمات برنامه'\n  },\n  loginbtn: {\n    fa: 'ورود'\n  },\n  colSortDirection: {\n    fa: 'مرتب سازی'\n  },\n  priority: {\n    fa: 'اولویت'\n  },\n  \"1ComparativePeriod\": {\n    fa: 'دوره مقایسه اول'\n  },\n  \"2ComparativePeriod\": {\n    fa: 'دوره مقایسه دوم'\n  },\n  \"3ComparativePeriod\": {\n    fa: 'دوره مقایسه سوم'\n  },\n  \"4ComparativePeriod\": {\n    fa: 'دوره مقایسه چهارم'\n  },\n  \"5ComparativePeriod\": {\n    fa: 'دوره مقایسه پنجم'\n  },\n  \"6ComparativePeriod\": {\n    fa: 'دوره مقایسه ششم'\n  },\n  \"7ComparativePeriod\": {\n    fa: 'دوره مقایسه هفتم'\n  },\n  \"8ComparativePeriod\": {\n    fa: 'دوره مقایسه هشتم'\n  },\n  \"9ComparativePeriod\": {\n    fa: 'دوره مقایسه نهم'\n  },\n  \"10ComparativePeriod\": {\n    fa: 'دوره مقایسه دهم'\n  },\n  \"11ComparativePeriod\": {\n    fa: 'دوره مقایسه یازدهم'\n  },\n  \"12ComparativePeriod\": {\n    fa: 'دوره مقایسه دوازدهم'\n  },\n  \"13ComparativePeriod\": {\n    fa: 'دوره مقایسه سیزدهم'\n  },\n  \"14ComparativePeriod\": {\n    fa: 'دوره مقایسه چهاردهم'\n  },\n  \"15ComparativePeriod\": {\n    fa: 'دوره مقایسه پانزدهم'\n  },\n  showComparativePeriod: {\n    fa: 'نمایش دوره های مقایسه ای'\n  },\n  hideComparativePeriod: {\n    fa: 'مخفی کردن دوره های مقایسه ای'\n  }\n};\nwindow.dynamicConditionalOperators2 = [{\n  text: \">\",\n  enText: \">\",\n  value: 1,\n  color: \"\",\n  dataTypes: [0, 1, 2, 3, 4]\n}, {\n  text: \"<\",\n  enText: \"<\",\n  value: 2,\n  color: \"\",\n  dataTypes: [0, 1, 2, 3, 4]\n}, {\n  text: \"=\",\n  enText: \"=\",\n  value: 3,\n  color: \"\",\n  dataTypes: [0, 1, 2, 3, 4, 7]\n}, {\n  text: \"<>\",\n  enText: \"<>\",\n  value: 4,\n  color: \"\",\n  dataTypes: [0, 1, 2, 3, 4, 7]\n}, {\n  text: \">=\",\n  enText: \">=\",\n  value: 5,\n  color: \"\",\n  dataTypes: [0, 1, 2, 3, 4]\n}, {\n  text: \"<=\",\n  enText: \"<=\",\n  value: 6,\n  color: \"\",\n  dataTypes: [0, 1, 2, 3, 4]\n}, {\n  text: \"بدون مقدار\",\n  enText: \"IsNull\",\n  value: 7,\n  color: \"\",\n  dataTypes: [0, 1, 2, 3, 4, 5, 7]\n}, {\n  text: \"دارای مقدار\",\n  enText: \"IsNotNull\",\n  value: 8,\n  color: \"\",\n  dataTypes: [0, 1, 2, 3, 4, 5, 7]\n}, {\n  text: \"درست\",\n  enText: \"IsTrue\",\n  value: 9,\n  color: \"\",\n  dataTypes: [5]\n}, {\n  text: \"نادرست\",\n  enText: \"IsFalse\",\n  value: 10,\n  color: \"\",\n  dataTypes: [5]\n}, {\n  text: \"شامل\",\n  enText: \"Contain\",\n  value: 11,\n  color: \"\",\n  dataTypes: [1, 7]\n}, {\n  text: \"In\",\n  enText: \"In\",\n  value: 12,\n  color: \"\",\n  dataTypes: [0, 1, 4, 7]\n}, {\n  text: \"NotIn\",\n  enText: \"NotIn\",\n  value: 13,\n  color: \"\",\n  dataTypes: [0, 1, 4, 7]\n}, {\n  text: \"Match\",\n  enText: \"Match\",\n  value: 14,\n  color: \"\",\n  dataTypes: [1]\n}, {\n  text: \"Like\",\n  enText: \"Like\",\n  value: 15,\n  color: \"\",\n  dataTypes: [1]\n}, {\n  text: \"NotLike\",\n  enText: \"NotLike\",\n  value: 16,\n  color: \"\",\n  dataTypes: [1]\n}];\nwindow.dyanamicFieldDataTypes = [{\n  text: \"عدد صحیح\",\n  enText: \"\",\n  value: 1,\n  color: \"\"\n}, {\n  text: \"متن\",\n  enText: \"\",\n  value: 2,\n  color: \"\"\n}, {\n  text: \"تاریخ\",\n  enText: \"\",\n  value: 3,\n  color: \"\"\n}, {\n  text: \"فایل\",\n  enText: \"File\",\n  value: 4,\n  color: \"\"\n}];\nwindow.positions = [{\n  text: \"پایین\",\n  enText: \"bottom\",\n  value: 1\n}, {\n  text: \"بالا\",\n  enText: \"top\",\n  value: 2\n}];\nwindow.commonRes = (_window$commonRes = {\n  nextBtn: {\n    fa: 'صفحه بعدی'\n  },\n  prvBtn: {\n    fa: 'صفحه قبلی'\n  },\n  editBtn: {\n    fa: 'ویرایش'\n  },\n  filterType: {\n    fa: 'فیلتر'\n  },\n  deleteBtn: {\n    fa: 'حذف'\n  },\n  createFormBtn: {\n    fa: 'ثبت اطلاعات'\n  },\n  cancelFormBtn: {\n    fa: 'انصراف'\n  },\n  editFormBtn: {\n    fa: 'بروزرسانی'\n  },\n  rowActions: {\n    fa: 'عملیات',\n    en: 'Actions'\n  },\n  searchPanelTitle: {\n    fa: 'جستجوی پیشرفته'\n  },\n  refreshTable: {\n    fa: 'تازه سازی اطلاعات جدول'\n  },\n  refreshCaption: {\n    fa: 'تازه سازی اطلاعات جدول'\n  },\n  searchPanelBtn: {\n    fa: 'اعمال کن'\n  },\n  searchKeyLabel: {\n    fa: 'جستجو'\n  },\n  ClearSearchLabel: {\n    fa: 'پاک کن'\n  },\n  yesConfirm: {\n    fa: 'بله'\n  },\n  noConfirm: {\n    fa: 'خیر'\n  },\n  cancelConfirm: {\n    fa: 'انصراف'\n  },\n  activeGroup: {\n    fa: 'گروه جاری :'\n  },\n  activeCompany: {\n    fa: 'شرکت جاری :'\n  },\n  expandAll: {\n    fa: 'باز کردن همه گره ها درختواره'\n  },\n  collapseAll: {\n    fa: 'بستن همه گره ها درختواره'\n  },\n  nodeSelectCaption: {\n    fa: 'انتخاب گره درختواره'\n  },\n  chooseNodeBtn: {\n    fa: 'انتخاب'\n  },\n  calculatorCaption: {\n    fa: 'فرمول'\n  },\n  changeslogCaption: {\n    fa: 'تغییرات نرم افزار'\n  },\n  tableSettings: {\n    fa: 'تنظیمات جدول'\n  },\n  colSelect: {\n    fa: 'انتخاب ستون ها'\n  },\n  showArchive: {\n    fa: 'نمایش رکورد های آرشیو'\n  },\n  hideArchive: {\n    fa: 'مخفی کردن رکورد های آرشیو'\n  },\n  refreshList: {\n    fa: 'تازه سازی اطلاعات لیست'\n  },\n  editChangeLogBtn: {\n    fa: 'ذخیره تغییرات نسخه نرم افزار'\n  },\n  deleteChangeLogBtn: {\n    fa: 'حذف نسخه نرم افزار'\n  },\n  helpBtn: {\n    fa: 'راهنما'\n  },\n  helpCaption: {\n    fa: 'راهنمای نرم افزار'\n  },\n  helpListCaption: {\n    fa: 'فهرست مطالب'\n  },\n  percentage: {\n    fa: 'درصد مالکیت'\n  },\n  formulaValueType: {\n    fa: 'نوع مقدار'\n  },\n  sourceColumn: {\n    fa: 'ستون جدول'\n  },\n  nodeId: {\n    fa: 'گره'\n  },\n  enablesCaption: {\n    fa: 'فعال کردن'\n  },\n  disablesCaption: {\n    fa: 'غیر فعال کردن'\n  },\n  enableCaption: {\n    fa: 'فعال کردن'\n  },\n  disableCaption: {\n    fa: 'غیر فعال کردن'\n  },\n  enablesItemCaption: {\n    fa: 'فعال کردن'\n  },\n  disablesItemCaption: {\n    fa: 'غیر فعال کردن'\n  },\n  enableItemCaption: {\n    fa: 'فعال کردن'\n  },\n  disableItemCaption: {\n    fa: 'غیر فعال کردن'\n  },\n  temporarysCaption: {\n    fa: 'عدم تایید'\n  },\n  confirmedsCaption: {\n    fa: 'تایید'\n  },\n  temporaryCaption: {\n    fa: 'عدم تایید'\n  },\n  confirmedCaption: {\n    fa: 'تایید'\n  },\n  fullScreen: {\n    fa: 'تمام صفحه'\n  },\n  sideBySide: {\n    fa: 'نمایش کنار هم'\n  },\n  defaultSetting: {\n    fa: 'تنظیمات پیش فرض'\n  },\n  pageNumberStr: {\n    fa: 'برو به صفحه'\n  },\n  connectManCaption: {\n    fa: 'مدیریت ارتباط '\n  },\n  connectManCaption2: {\n    fa: 'گزارشات'\n  },\n  ConnectionListCaption: {\n    fa: 'فهرست ارتباط ها'\n  },\n  addConnection: {\n    fa: 'ارتباط جدید'\n  },\n  removeConnection: {\n    fa: 'حذف ارتباط'\n  },\n  parameterName: {\n    fa: 'نام پارامتر'\n  },\n  parameterKey: {\n    fa: 'کلید پارامتر'\n  },\n  executeConnction: {\n    fa: 'اجرا'\n  },\n  nameConnection: {\n    fa: 'نام'\n  },\n  connectionString: {\n    fa: 'رشته اتصال'\n  },\n  query: {\n    fa: 'کوئری'\n  },\n  executableFileName: {\n    fa: 'نام فایل اجرایی'\n  },\n  addParameter: {\n    fa: 'اضافه کردن پارامتر'\n  },\n  settingRgCaption: {\n    fa: 'تنظیمات گزارش ساز'\n  },\n  complateRun: {\n    fa: 'تایید نتیجه'\n  },\n  folderId: {\n    fa: 'پوشه'\n  },\n  removeFolder: {\n    fa: 'حذف پوشه'\n  },\n  mergeFolder: {\n    fa: 'ادغام پوشه با...'\n  },\n  addFolder: {\n    fa: 'ساخت پوشه جدید'\n  },\n  addIpAddress: {\n    fa: 'اضافه کردن آدرس ای پی'\n  },\n  removeIpAddress: {\n    fa: 'حذف'\n  }\n}, _defineProperty(_window$commonRes, \"removeFolder\", {\n  fa: 'حذف پوشه'\n}), _defineProperty(_window$commonRes, \"mergeLandingFolder\", {\n  fa: 'ادغام'\n}), _defineProperty(_window$commonRes, \"folderManagementCaption\", {\n  fa: 'مدیریت پوشه ها'\n}), _defineProperty(_window$commonRes, \"AppConfigCaption\", {\n  fa: 'تنظیمات نرم افزار'\n}), _defineProperty(_window$commonRes, \"outputType\", {\n  fa: 'نوع خروجی'\n}), _defineProperty(_window$commonRes, \"closeBtn\", {\n  fa: 'بستن فرم'\n}), _defineProperty(_window$commonRes, \"parameterType\", {\n  fa: 'نوع'\n}), _defineProperty(_window$commonRes, \"requireParameter\", {\n  fa: 'الزامی'\n}), _defineProperty(_window$commonRes, \"codePlaceholder\", {\n  fa: 'کدی را جهت جستجو وارد کنید'\n}), _defineProperty(_window$commonRes, \"selectPlaceholder\", {\n  fa: 'انتخاب'\n}), _defineProperty(_window$commonRes, \"cancelProccessBtn\", {\n  fa: 'توقف عملیات'\n}), _defineProperty(_window$commonRes, \"deleteProccessBtn\", {\n  fa: 'حذف'\n}), _defineProperty(_window$commonRes, \"downloadFileProccessBtn\", {\n  fa: 'دانلود فایل'\n}), _defineProperty(_window$commonRes, \"filterProfile\", {\n  fa: 'پروفایل جستجو'\n}), _defineProperty(_window$commonRes, \"path\", {\n  fa: 'مسیر'\n}), _defineProperty(_window$commonRes, \"downloadReportColSetting\", {\n  fa: 'تنظیمات ستون های گزارش'\n}), _defineProperty(_window$commonRes, \"pageOrientationCaption\", {\n  fa: 'جهت گزارش'\n}), _defineProperty(_window$commonRes, \"reportTypeCaption\", {\n  fa: 'نوع فایل خروجی'\n}), _defineProperty(_window$commonRes, \"createFileBtn\", {\n  fa: 'ساخت فایل'\n}), _defineProperty(_window$commonRes, \"codeRangeItem\", {\n  fa: 'شماره بند'\n}), _defineProperty(_window$commonRes, \"selectConsolidatePlaceholder\", {\n  fa: 'انتخاب'\n}), _defineProperty(_window$commonRes, \"remotePlaceHolder\", {\n  fa: ' در دوره مالی جاری '\n}), _defineProperty(_window$commonRes, \"ImportExcelCaption\", {\n  fa: 'بارگذاری فایل اکسل'\n}), _defineProperty(_window$commonRes, \"ImportBackUpCaption\", {\n  fa: 'بارگذاری فایل پشتیبان'\n}), _defineProperty(_window$commonRes, \"userProfileCaption\", {\n  fa: 'ویرایش پروفایل کاربری'\n}), _defineProperty(_window$commonRes, \"currentPassword\", {\n  fa: \"رمز عبور فعلی\"\n}), _defineProperty(_window$commonRes, \"adminResetPasswordCaption\", {\n  fa: 'تغییر رمز عبور'\n}), _defineProperty(_window$commonRes, \"newPassword\", {\n  fa: 'رمز عبور جدید'\n}), _defineProperty(_window$commonRes, \"confirmNewPassword\", {\n  fa: 'تایید رمز عبور'\n}), _defineProperty(_window$commonRes, \"firstName\", {\n  fa: 'نام'\n}), _defineProperty(_window$commonRes, \"lastName\", {\n  fa: 'نام خانوادگی'\n}), _defineProperty(_window$commonRes, \"phoneNumber\", {\n  fa: 'تلفن ثابت'\n}), _defineProperty(_window$commonRes, \"mobile\", {\n  fa: 'تلفن همراه'\n}), _defineProperty(_window$commonRes, \"location\", {\n  fa: 'شهر'\n}), _defineProperty(_window$commonRes, \"fax\", {\n  fa: 'شماره فکس'\n}), _defineProperty(_window$commonRes, \"email\", {\n  fa: 'ایمیل'\n}), _defineProperty(_window$commonRes, \"userName\", {\n  fa: 'نام کاربری'\n}), _defineProperty(_window$commonRes, \"closeForm\", {\n  fa: 'بستن فرم'\n}), _window$commonRes);\nwindow.tabNameRes = {\n  userTab: {\n    fa: 'کاربران'\n  },\n  actionlogTab: {\n    fa: 'فعالیت ها'\n  },\n  accessTab: {\n    fa: 'دسترسی ها'\n  },\n  periodTab: {\n    fa: 'دوره مالی'\n  },\n  treeTab: {\n    fa: 'درختواره'\n  },\n  companyTab: {\n    fa: 'شرکت های تابعه'\n  },\n  companyinfoTab: {\n    fa: 'اطلاعات شرکت'\n  },\n  dynamictableTab: {\n    fa: 'جدول ها'\n  },\n  dynamicdocumentTab: {\n    fa: 'روال های محاسبه'\n  },\n  balancereportTab: {\n    fa: 'گزارش تراز حساب ها'\n  },\n  groupperiodTab: {\n    fa: 'بررسی صورت های مالی شرکت های تابعه'\n  },\n  consolidateTab: {\n    fa: 'شرکت های مشمول تلفیق'\n  },\n  mappingTab: {\n    fa: 'نگاشت'\n  },\n  balancesheetTab: {\n    fa: 'فایل تراز'\n  },\n  adjustmentdocumentTab: {\n    fa: 'اسناد اصلاحی و طبقه بندی'\n  },\n  tabletemplateTab: {\n    fa: 'قالب جداول'\n  },\n  magazineTab: {\n    fa: 'مجله'\n  },\n  usersMenu: {\n    fa: 'مدیریت کاربران'\n  },\n  basicinfoMenu: {\n    fa: 'اطلاعات پایه'\n  },\n  treesMenu: {\n    fa: 'درختواره ها'\n  },\n  tablesMenu: {\n    fa: 'محاسبات'\n  },\n  operationMenu: {\n    fa: 'عملیات'\n  },\n  reportsMenu: {\n    fa: 'گزارشات'\n  },\n  notesMenu: {\n    fa: 'یادداشت های همراه'\n  },\n  onlineuserTab: {\n    fa: 'کاربران برخط'\n  }\n};\nwindow.clientMessages = {\n  ConsolidationInProgress: {\n    fa: 'به علت در جریان بودن عملیات تلفیق در دوره مالی جاری، امکان انجام عملیات مورد نظر وجود ندارد'\n  },\n  FileUploadTimeError: {\n    fa: 'فاصله زمانی مجاز بین آپلود ها رعایت نشده است.لطفا دقایقی دیگر مجددا تلاش کنید'\n  },\n  LimitedCpuOrMemory: {\n    fa: 'در حال حاضر سرور مشغول می باشد لطفا لحظاتی دیگر دوباره تلاش کنید'\n  },\n  ErrorMinPeriodCopyItem: {\n    fa: 'حداقل باید یک مورد را برای عملیات کپی انتخاب نمایید'\n  },\n  ErrorMaxColReportGenerator: {\n    fa: 'حداکثر تعداد ستون های یک گزارش 100 عدد می باشد'\n  },\n  ErrorMaxRowReportGenerator: {\n    fa: 'حداکثر تعداد سطر های یک گزارش 100 عدد می باشد'\n  },\n  ErrorLoadTemplateDynamicValues: {\n    fa: 'دریافت اطلاعات داده های داینامیک قالب جدول با خطا مواجه شده است'\n  },\n  CalculateDocumentNotHavePermission: {\n    fa: 'حساب کاربری شما دارای مجوز لازم برای محاسبه اسناد نمی باشد'\n  },\n  ErrorLoadTableTemplate: {\n    fa: 'دریافت اطلاعات لیست قالب جداول با خطا مواجه شده است'\n  },\n  ErrorLoadSelectCompany: {\n    fa: 'دریافت اطلاعات لیست انتخاب گروه و شرکت با خطا مواجه شده است'\n  },\n  ErrorLoadPeriod: {\n    fa: 'دریافت اطلاعات لیست دوره های مالی با خطا مواجه شده است'\n  },\n  ErrorLoadNodeSelect: {\n    fa: 'دریافت اطلاعات لیست انتخاب گره های درخت با خطا مواجه شده است'\n  },\n  ErrorLoadTree: {\n    fa: 'دریافت اطلاعات لیست درخت با خطا مواجه شده است'\n  },\n  ErrorLoadMapTree: {\n    fa: 'دریافت اطلاعات درخت  نگاشت با خطا مواجه شده است'\n  },\n  ErrorLoadMapTreeEffected: {\n    fa: 'دریافت اطلاعات لغو اعمال اثر با خطا مواجه شده است'\n  },\n  ErrorLoadSelectBalancesheet: {\n    fa: 'دریافت اطلاعات لیست فایل های تراز با خطا مواجه شده است'\n  },\n  ErrorLoginFail: {\n    fa: 'نام کاربری و یا رمز عبور شما صحیح نیست'\n  },\n  ErrorAlreadyLoggedIn: {\n    fa: 'این نام کاربری در حال حاظر به سیستم وارد شده است'\n  },\n  ErrorUnknownServer: {\n    fa: 'در هنگام ارتباط با سرور خطای ناشناخته ای رخ داده است'\n  },\n  PeriodHalfDeletedSuccess: {\n    fa: 'ضمایم انتخاب شده دوره مالی حذف شد'\n  },\n  NodeUpdateErrors: {\n    fa: 'تغییرات __ عدد از گره ها با خطا مواجه شد'\n  },\n  PreventSaveForOpenDialog: {\n    fa: 'برای ذخیره تغییرات لطفا ابتدا فرم ویرایش گره را ببندید'\n  },\n  FormulaMakerEnglishOnly: {\n    fa: 'لطفا از صفحه کلید انگلیسی استفاده کنید'\n  },\n  NodeEditorUnableToCopy: {\n    fa: 'لطفا قبل از انجام کپی و انتقال گره ها تغییرات را ذخیره کنید'\n  },\n  NodeDeletedConfirm: {\n    fa: 'تعداد __ گره جهت انجام عملیات حذف انتخاب شده است.آیا از حذف آنها اطمینان دارید؟'\n  },\n  NodeDeletedZeroCountError: {\n    fa: 'شما مجاز به حذف هیچکدام از گره های انتخاب شده نیستید'\n  },\n  ResetConsolidateBranchConfirm: {\n    fa: 'در صورت بازگردانی شاخه(های) مشمول تلفیق همه تغییرات انجام گرفته روی آن(ها) به حالت قبل بازخواهد گشت. آیا میخواهید ادامه دهید؟'\n  },\n  NodeReportZeroCountError: {\n    fa: 'ابتدا باید گره ای را انتخاب کنید'\n  },\n  TreeMapUpdateError: {\n    fa: 'عملیات ثبت گره نگاشت با خطا مواجه شده است'\n  },\n  TreeMapUpdateSuccess: {\n    fa: 'عملیات ثبت گره نگاشت با موفقیت انجام شد'\n  },\n  MappingNodeUpdateSuccess: {\n    fa: 'عملیات  نگاشت  گره با موفقیت انجام شد'\n  },\n  TreeMapUpdateRequire: {\n    fa: 'ابتدا باید تغییرات قبلی را ذخیره و یا حذف نمایید'\n  },\n  RejectedPeriodCantBeSubmitted: {\n    fa: ' برای دوره مالی برگشت خورده این امکان وجود ندارد'\n  },\n  ErrorValidateEffectedMapping: {\n    fa: 'بررسی اعمال فایل تراز با خطا مواجه شده است '\n  },\n  ErrorPostEffectedMapping: {\n    fa: 'ثبت اعمال فایل تراز با خطا مواجه شده است '\n  },\n  ErrorPutEffectedMapping: {\n    fa: 'ثبت لغو اعمال فایل تراز با خطا مواجه شده است '\n  },\n  SuccessPostEffectedMapping: {\n    fa: ' اعمال اثر فایل تراز با موفقیت انجام شد'\n  },\n  SuccessPostBothMapping: {\n    fa: ' اعمال/لغو اثر فایل تراز با موفقیت انجام شد'\n  },\n  EditLockedTableTemplate: {\n    fa: 'محتوای قالب جدول در حال نمایش است. برای ویرایش/حذف/کپی قالب ابتدا تب محتوای قالب جدول را ببندید'\n  },\n  SuccessPutEffectedMapping: {\n    fa: ' لغواعمال اثر فایل تراز با موفقیت انجام شد'\n  },\n  SuccessAnalazedEffectedMapping: {\n    fa: 'بررسی اعمال فایل تراز با موفقیت  به اتمام رسید'\n  },\n  PostRemoveMagazinePictureError: {\n    fa: 'حذف تصویر هدر/فوتر مجله با خطا متوقف شد'\n  },\n  ErrorRemoveLogo: {\n    fa: 'حذف لوگوی گروه/شرکت با خطا متوقف شد'\n  },\n  SuccessRemoveLogo: {\n    fa: 'حذف لوگوی گروه/شرکت با موفقیت انجام شد'\n  },\n  RemoveLogoConfirm: {\n    fa: 'آیا از حذف لوگو گروه/شرکت اطمینان دارید؟'\n  },\n  ErrorRemoveAvatar: {\n    fa: 'حذف تصویر پروفایل کاربر با خطا متوقف شد'\n  },\n  SuccessRemoveAvatar: {\n    fa: 'حذف تصویر پروفایل کاربر با موفقیت انجام شد'\n  },\n  ErrorUploadAvatar: {\n    fa: 'بارگزاری تصویر پروفایل کاربر با خطا متوقف شد'\n  },\n  SuccessUploadAvatar: {\n    fa: 'بارگزاری تصویر پروفایل کاربر با موفقیت انجام شد'\n  },\n  PostChangePasswordSuccess: {\n    fa: ' عملیات تغییر رمز عبور کاربر با خطا متوقف شد'\n  },\n  PostChangePasswordError: {\n    fa: 'عملیات تغییر رمز عبور کاربر با موفقیت انجام شد'\n  },\n  LoadMagazineContentError: {\n    fa: 'دریافت اطلاعات ظاهری  مجله با خطا مواجه شده است'\n  },\n  LoadTableTemplateSelectError: {\n    fa: 'دریافت اطلاعات لیست قالب های جدول با خطا مواجه شده است'\n  },\n  ActivePeriodSelectSuccess: {\n    fa: 'شرکت / دوره مالی جاری با موفقیت تغییر کرد'\n  },\n  ActivePeriodSelectError: {\n    fa: 'تغییر دوره مالی جاری با خطا متوقف شد'\n  },\n  InvalidTableTemplate: {\n    fa: 'اندازه صفحه با قالب جدول هماهنگ نیست'\n  },\n  ErrorChangeDatabase: {\n    fa: 'عملیات تغییر پایگاه داده با خطا مواجه شده است'\n  },\n  LoadTreeElementsError: {\n    fa: 'دریافت اطلاعات عناصر گره درخت با خطا مواجه شده است'\n  },\n  LoadCompanyTreeError: {\n    fa: 'دریافت اطلاعات لیست دسترسی گروه/شرکت با خطا مواجه شده است'\n  },\n  PutConfirmTypesError: {\n    fa: 'تعداد __ -- بدلیل مغایرت  و یا عدم وجود بند قابل تایید نیستند'\n  },\n  ActionSelectListEmptyError: {\n    fa: 'ابتدا باید سندی راانتخاب کنید'\n  },\n  LoadTreeNodeAmountError: {\n    fa: 'دریافت اطلاعات مانده قبلی گره با خطا مواجه شده است'\n  },\n  LoadTreeBranchesError: {\n    fa: 'دریافت اطلاعات گره های درختواره با خطا مواجه شده است'\n  },\n  RequiredOneTotal: {\n    fa: 'مانده نهایی نمی تواند صفر باشد'\n  },\n  RequiredAutoAmendmentCode: {\n    fa: 'وارد کردن شماره سند الزامی است'\n  },\n  RepeatedAutoAmendmentCode: {\n    fa: 'شماره سند وارد شده تکراری می باشد'\n  },\n  RequiredAutoAmendmentTitle: {\n    fa: 'وارد کردن عنوان سند الزامی است'\n  },\n  RepeatedAutoAmendmentTitle: {\n    fa: 'عنوان وارد شده تکراری می باشد'\n  },\n  PutChangeAutoAmendmentPrioritySuccess: {\n    fa: 'عملیات جابه جایی اولویت سند اتوماتیک با موفقیت انجام شد'\n  },\n  PutChangeAutoAmendmentPriorityError: {\n    fa: 'عملیات جابه جایی اولویت سند اتوماتیک با خطا متوقف شد'\n  },\n  PutChangeAutoAmendmentItemPrioritySuccess: {\n    fa: 'عملیات جابه جایی اولویت قلم سند اتوماتیک با موفقیت انجام شد'\n  },\n  PutChangeAutoAmendmentItemPriorityError: {\n    fa: 'عملیات جابه جایی اولویت قلم سند اتوماتیک با خطا متوقف شد'\n  },\n  ExpressionBracketsAreNotCorrect: {\n    fa: 'در براکت های موجود در عبارت، کاراکترهای نامعتبر وجود دارد'\n  },\n  AccountTypeMappingConfilict: {\n    fa: 'تعداد __ رکورد از -- رکورد فایل تراز با ماهیت مانده برگ انتخابی مغایرت دارد'\n  },\n  ConfilictPageSizeError: {\n    fa: 'اندازه قالب جدول با صفحه مجله مطابقت ندارند'\n  },\n  ErrorLoadChangeLog: {\n    fa: 'دریافت اطلاعات تغییرات نسخه با خطا مواجه شده است'\n  },\n  ErrorLoadVersion: {\n    fa: 'دریافت اطلاعات تغییرات نرم افزار با خطا مواجه شده است'\n  },\n  LoadGroupPeriodError: {\n    fa: 'دریافت اطلاعات دوره های مالی شرکت های تابعه با خطا مواجه شده است'\n  },\n  ErrorLoadBalanceReport: {\n    fa: 'دریافت اطلاعات کاربرگ 6020 با خطا مواجه شده است'\n  },\n  ErrorLoadReportBalancesheetData: {\n    fa: 'دریافت اطلاعات فهرست کدهای نگاشت شده، با خطا مواجه شده است'\n  },\n  PostResetPasswordSuccess: {\n    fa: 'رمز عبور کاربر مورد نظر با موفقیت تغییر کرد'\n  },\n  PostResetPasswordError: {\n    fa: 'عملیات تغییر رمز عبور کاربر با خطا متوقف شد'\n  },\n  ErrorLoadExcel: {\n    fa: 'دریافت اطلاعات ذخیره شده گزارش ساز با خطا متوقف شد'\n  },\n  PostExcelDataSuccess: {\n    fa: 'عملیات ذخیره اطلاعات گزارش ساز با موفقیت انجام شد'\n  },\n  PostExcelDataError: {\n    fa: 'عملیات ذخیره اطلاعات گزارشساز با خطا مواجه شده است'\n  },\n  GetAdjustmentDocumentDataFail: {\n    fa: 'هیچ سند اصلاحی و طبقه بندی ذیل این گره ثبت نشده است'\n  },\n  LoadOnlineUserError: {\n    fa: 'دریافت اطلاعات کاربران برخط با خطا مواجه شده است'\n  },\n  AccessDeletedError: {\n    fa: 'عملیات حذف دسترسی با خطا مواجه شده است'\n  },\n  CompanyIsNotActive: {\n    fa: 'حساب کاربری این شرکت غیرفعال می باشد'\n  },\n  UserHasNoAccessInSystem: {\n    fa: 'این حساب کاربری مجوز ورود به هیچ یک از شرکتهای تعریف شده در سیستم را ندارد'\n  },\n  PeriodIsClosed: {\n    fa: 'امکان انجام عملیات مورد نظر در دوره مالی بسته وجود ندارد'\n  },\n  PeriodIsDisabled: {\n    fa: 'امکان انجام عملیات مورد نظر در دوره مالی غیرفعال وجود ندارد'\n  },\n  InsufficientInformations: {\n    fa: 'خطایی در ارسال اطلاعات به سرور رخ داده است'\n  },\n  DeleteAppVersionSuccess: {\n    fa: 'عملیات حذف نسخه نرم افزار با موفقیت انجام شد'\n  },\n  DeleteAppVersionError: {\n    fa: 'عملیات حذف نسخه نرم افزار با خطا مواجه شده است'\n  },\n  PutAppVersionError: {\n    fa: 'عملیات ذخیره نسخه نرم افزار با خطا متوقف شد'\n  },\n  PutAppVersionSuccess: {\n    fa: 'عملیات ذخیره نسخه نرم افزار با موفقیت انجام شد'\n  },\n  LoadUserProfileError: {\n    fa: 'دریافت اطلاعات پروفایل کاربری با خطا متوقف شد'\n  },\n  PutUserProfileSuccess: {\n    fa: 'عملیات ویرایش پروفایل کاربری با موفقیت انجام شد'\n  },\n  PutUserProfileError: {\n    fa: 'عملیات ویرایش پروفایل کاربری با خطا متوقف شد'\n  },\n  PutAppConfigSuccess: {\n    fa: 'عملیات ویرایش تنظیمات نرم افزار با موفقیت انجام شد'\n  },\n  PutAppConfigError: {\n    fa: 'عملیات ویرایش تنظیمات نرم افزار با خطا متوقف شد'\n  },\n  LoadAppConfigError: {\n    fa: 'دریافت اطلاعات تنظیمات برنامه با خطا متوقف شد'\n  },\n  MappingDeleteSuccess: {\n    fa: 'تعداد __ گره نگاشت با موفقیت حذف شد'\n  },\n  MappingDeleteError: {\n    fa: 'عملیات حذف گره نگاشت با خطا متوقف شد'\n  },\n  DeleteConfirmedAmendmentError: {\n    fa: 'جهت حذف سند تعدیل ابتدا باید وضعیت تایید سند را به حالت پیش نویس تغییر دهید'\n  },\n  DeleteConfirmedAutoAmendmentError: {\n    fa: 'جهت حذف سند اتوماتیک ابتدا باید وضعیت تایید سند را به حالت پیش نویس تغییر دهید'\n  },\n  PeriodIsInUse: {\n    fa: 'دوره مالی به دلیل وجود عملیات در آن قابل حذف نیست'\n  },\n  PeriodIsUsedAsComprative: {\n    fa: 'دوره مالی به عنوان دوره مالی مقایسه ای ثبت شده است'\n  },\n  PeriodHasMapping: {\n    fa: 'امکان حذف دوره مالی به دلیل انجام عملیات نگاشت وجود ندارد'\n  },\n  PutLeafValueSuccess: {\n    fa: 'عملیات ذخیره مقدار ارزش گره با موفقیت انجام شد'\n  },\n  PutLeafValueError: {\n    fa: 'عملیات ذخیره مقدار ارزش گره با خطا متوقف شد'\n  },\n  LoadBalancesheetExcelFileError: {\n    fa: 'عملیات تولید خروجی اکسل فایل تراز با خطا مواجه شده است'\n  },\n  ExportExcelTreeError: {\n    fa: 'عملیات تولید خروجی اکسل درختواره با خطا مواجه شده است'\n  },\n  GetFileError: {\n    fa: 'عملیات دریافت فایل خروجی با خطا متوقف شد'\n  },\n  GetLoginHistoryError: {\n    fa: 'عملیات دریافت اطلاعات ورود کاربر با خطا متوقف شد'\n  },\n  LoadSavedMagazinesError: {\n    fa: 'دریافت اطلاعات فایل های ذخیره شده در سیستم با خطا مواجه شده است'\n  },\n  DeleteMagazinePdfFileSuccess: {\n    fa: 'عملیات حذف فایل با موفقیت انجام شد'\n  },\n  DeleteMagazinePdfFileError: {\n    fa: 'عملیات حذف فایل با خطا مواجه شده است'\n  },\n  LoadGroupPeriodTemplatePdfError: {\n    fa: 'عملیات تولید فایل خروجی از قالب جدول با خطا مواجه شده است'\n  },\n  NoEnabledPeriod: {\n    fa: 'امکان ورود به منوی درخواست شده به دلیل عدم وجود دوره مالی وجود ندارد'\n  },\n  firstSelectPeriodRecordWarning: {\n    fa: 'برای نمایش تاریخچه ابتدا باید یک دوره مالی را انتخاب کنید'\n  },\n  ChangeIneffectiveAmendmentError: {\n    fa: 'ویرایش سند تعدیل و طبقه بندی در حالت بلااثر مجاز نیست'\n  },\n  ChangeIneffectiveAutoAmendmentError: {\n    fa: 'ویرایش سند اتوماتیک در حالت بلااثر مجاز نیست'\n  },\n  ChangeIneffectiveCashFlowError: {\n    fa: 'ویرایش سند تعدیل  جریان وجوه نقد در حالت بلااثر مجاز نیست'\n  },\n  RequiredItemCountAdjustmentDocument: {\n    fa: 'ابتدا باید قلم سند اصلاحی و طبقه بندی ایجاد کنید'\n  },\n  PutCashFlowConfirmationTypeError: {\n    fa: 'عملیات تایید سند تعدیل جریان وجوه نقد با خطا متوقف شد'\n  },\n  PutCashFlowConfirmationTypesError: {\n    fa: 'عملیات تایید اسناد تعدیل جریان وجوه نقد با خطا متوقف شد'\n  },\n  PutCashFlowConfirmTypesError: {\n    fa: 'تعداد __ سند تعدیل جریان وجوه نقد بدلیل مغایرت  و یا عدم وجود بند قابل تایید نیستند'\n  },\n  PutCashFlowConfirmTypesSuccess: {\n    fa: 'عملیات تایید __ سند تعدیل جریان وجوه نقد با موفقیت انجام شد'\n  },\n  PutCashFlowUnConfirmTypeSuccess: {\n    fa: 'عملیات عدم تایید سند تعدیل جریان وجوه نقد با موفقیت انجام شد'\n  },\n  PutCashFlowUnConfirmTypesSuccess: {\n    fa: 'عملیات عدم تایید اسناد تعدیل جریان وجوه نقد با موفقیت انجام شد'\n  },\n  ClosedShareInitialBalance: {\n    fa: 'امکان مقداردهی اولیه نماد در دوره مالی بسته وجود ندارد'\n  },\n  ShowExpenseCenterTableCondition: {\n    fa: 'برای مشاهده رکوردهای زیرمجموعه ، انتخاب جدول مرکز هزینه الزامی است'\n  },\n  PostPagesMagazineSuccess: {\n    fa: 'عملیات ذخیره صفحات مجله با موفقیت انجام شد'\n  },\n  PostPagesMagazineError: {\n    fa: 'عملیات ذخیره صفحات مجله با خطا متوقف شد'\n  },\n  ErrorSelectPageSection: {\n    fa: 'لطفا ابتدا محل نمایش عکس را انتخاب نمایید'\n  },\n  atLeastOneEditableCell: {\n    fa: 'انتخاب حداقل یک سلول حاوی گره درختواره الزامیست'\n  },\n  MaxEditableCell: {\n    fa: 'حداکثر 10 سلول حاوی گره درختواره میتوانید انتخاب کنید'\n  },\n  PostRpSettingSuccess: {\n    fa: 'عملیات ذخیره تنظیمات گزارش ساز با موفقیت انجام شد'\n  },\n  PostRpSettingError: {\n    fa: 'عملیات ذخیره تنظیمات گزارش ساز با خطا مواجه شده است'\n  },\n  NewTreeConfirm: {\n    fa: 'آیا درختواره __ به فهرست درختواره ها اضافه گردد؟'\n  },\n  ChangesTreeConfirm: {\n    fa: 'آیا همه تغییرات درختواره __ در دوره مالی مرجع، به دوره مالی جاری منتقل شود؟'\n  },\n  HasChangedConfirm: {\n    fa: 'در صورت خروج از ویرایشگر __، تغییرات ذخیره نشده حذف خواهند شد . مایل به خروج هستید؟'\n  },\n  NotFound: {\n    fa: 'صفحه مورد نظر موجود نمی باشد'\n  },\n  Forbidden: {\n    fa: 'صفحه مورد نظر موجود نمی باشد'\n  },\n  RpError1: {\n    fa: 'امکان قرار دادن ستون های جدول و شماره سطر در بیش از یک سطر وجود ندارد'\n  },\n  RpError2: {\n    fa: 'همه ستونهای مورد استفاده در گزارش باید از یک جدول انتخاب شوند'\n  },\n  RpError3: {\n    fa: 'ستون جدول و شماره سطر نمی توانند همزمان در یک ستون استفاده شوند'\n  },\n  RpError4: {\n    fa: 'محل نمایش حاصل جمع ، باید خارج از مجدوده انتخاب شده باشد'\n  },\n  RpError5: {\n    fa: 'سلول انتخاب شده برای نمایش حاصل جمع ، باید در همان ستون محدوده انتخاب شده باشد'\n  },\n  RpError6: {\n    fa: 'ابتدا باید سلول هایی که میخواهید در فرمول باشد را انتخاب نمایید'\n  },\n  RpError7: {\n    fa: 'ستون جدول و شماره سطر نمی توانند همزمان در یک ستون استفاده شوند'\n  },\n  RpError8: {\n    fa: 'امکان قرار دادن ستون های جدول و شماره سطر در بیش از یک سطر وجود ندارد'\n  },\n  RgNotAllwedSaveChange: {\n    fa: 'برای ذخیره محتوای قالب جدول باید ابتدا از حالت پیش نمایش خارج شوید'\n  },\n  SaveSetting: {\n    fa: 'تنظیمات گزارش ساز با موفقیت ذخیره شد.'\n  },\n  ConfirmNotSaveChange: {\n    fa: 'تغییرات انجام شده بر روی قالب از بین خواهد رفت .آیا تایید میکنید؟'\n  },\n  NotEnoughCol: {\n    fa: 'حداقل دو ستون برای انداختن مقادیر لازم است'\n  },\n  InvalidUserOrPasswordError: {\n    fa: 'نام کاربری و یا رمز عبور صحیح نیست'\n  },\n  DeleteTableTemplateConfirm: {\n    fa: 'از سلول های این قالب به عنوان مبدا اتصال در قالب های __ استفاده شده است، آیا مایل به حذف قالب جدول هستید؟'\n  },\n  lockedByOtherUserError: {\n    fa: 'این قالب جدول در حال ویرایش توسط کاربر دیگری می باشد'\n  },\n  MagazinePdfPageSaveMessage: {\n    fa: 'ذخیره تنضیمات دانلود صفحه مجله با موفقیت انجام شد'\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/util/commonResources.js?");

/***/ }),

/***/ "./src/scripts/util/comparator.js":
/*!****************************************!*\
  !*** ./src/scripts/util/comparator.js ***!
  \****************************************/
/***/ ((module) => {

eval("function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nmodule.exports = function () {\n  var isEqual = function isEqual(object1, object2) {\n    var keys1 = Object.keys(object1).sort();\n    var keys2 = Object.keys(object2).sort();\n\n    if (keys1.length !== keys2.length) {\n      /* console.log(\"length : \" + keys1 + \" \" + keys2);*/\n      return false;\n    }\n\n    var _iterator = _createForOfIteratorHelper(keys1),\n        _step;\n\n    try {\n      for (_iterator.s(); !(_step = _iterator.n()).done;) {\n        var key = _step.value;\n        var val1 = object1[key];\n        var val2 = object2[key];\n        var areObjects = isObject(val1) && isObject(val2);\n\n        if (areObjects && !isEqual(val1, val2) || !areObjects && isEqualValue(val1, val2)) {\n          //console.log(\"value Not Equal : \");\n          //console.log(val1);\n          //console.log(val2);\n          //console.log(\"---------------\");\n          return false;\n        }\n      }\n    } catch (err) {\n      _iterator.e(err);\n    } finally {\n      _iterator.f();\n    }\n\n    return true;\n  };\n\n  var isObject = function isObject(object) {\n    return object != null && _typeof(object) === 'object';\n  };\n\n  var isEqualValue = function isEqualValue(val1, val2) {\n    return val1 !== val2;\n  };\n\n  return {\n    isEqual: isEqual\n  };\n}();\n\n//# sourceURL=webpack://domino/./src/scripts/util/comparator.js?");

/***/ }),

/***/ "./src/scripts/util/confirm.js":
/*!*************************************!*\
  !*** ./src/scripts/util/confirm.js ***!
  \*************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nmodule.exports = function () {\n  var template = '<div class=\"modal fade confirm-box\" tabindex=\"-1\" role=\"dialog\">' + '<div class=\"modal-dialog\"><div class=\"modal-content\" style=\"width: 450px;\"><div class=\"modal-body\">' + '{BODY}</div><div class=\"modal-footer\">{Buttons} </div></div></div></div>';\n\n  var run = function run(options, callback) {\n    $(\".confirm-box\").remove();\n    var html = $(renderTemplate(options));\n    $(document.body).append(html);\n    $(\".confirm-box\").modal({\n      show: true,\n      backdrop: 'static',\n      keyboard: false\n    });\n\n    if (options.buttons) {\n      for (var i = 0; i < options.buttons.length; i++) {\n        var btnItem = options.buttons[i];\n        var btnTag = $(\".confirm-box\").find(\".btn-\" + btnItem.type).get(0);\n        btnTag.addEventListener('click', function (event) {\n          var value = event.target.getAttribute(\"data-value\");\n          $(\".confirm-box\").modal('hide');\n          if (value === \"true\") callback(true);else if (value === \"false\") callback(false);else if (value === \"undefined\") callback(undefined);else callback(value);\n        });\n      }\n    }\n  };\n\n  var renderTemplate = function renderTemplate(options) {\n    var temp = template;\n\n    if (options.text) {\n      temp = temp.replace(\"{BODY}\", '<p style=\"font-size: 12px;font-weight: 300;\">' + options.text + \"</p>\");\n    }\n\n    if (options.buttons) {\n      var btTags = \"\";\n      var signType;\n\n      for (var i = 0; i < options.buttons.length; i++) {\n        var btnItem = options.buttons[i];\n        btTags += '<button type=\"button\" data-value=\"' + btnItem.value + '\" class=\"btn btn-' + btnItem.type + ' btn-sm\">' + btnItem.text + '</button>';\n        if (btnItem.value === true) signType = btnItem.type;\n      }\n\n      temp = temp.replace(\"{Buttons}\", btTags);\n      return temp;\n    }\n  };\n\n  var renderIcon = function renderIcon(type) {\n    switch (type) {\n      case \"success\":\n        return '<div class=\"swal2-icon swal2-success\"><div class=\"swal2-success-circular-line-left\"></div><span class=\"swal2-success-line-tip\"></span> <span class=\"swal2-success-line-long\"></span><div class=\"swal2-success-ring\"></div> <div class=\"swal2-success-fix\"></div><div class=\"swal2-success-circular-line-right\"></div></div>';\n\n      case \"danger\":\n        return '<div class=\"swal2-icon swal2-error\"><span class=\"swal2-x-mark\"><span class=\"swal2-x-mark-line-left\"></span><span class=\"swal2-x-mark-line-right\"></span></span></div>';\n\n      case \"warning\":\n        return '<div class=\"swal2-icon swal2-warning\"><div class=\"swal2-icon-content\">!</div></div>';\n\n      case \"info\":\n        return '<div class=\"swal2-icon swal2-info\"><div class=\"swal2-icon-content\">i</div></div>';\n    }\n  };\n\n  return {\n    run: run\n  };\n}();\n\n//# sourceURL=webpack://domino/./src/scripts/util/confirm.js?");

/***/ }),

/***/ "./src/scripts/util/dateHelper.js":
/*!****************************************!*\
  !*** ./src/scripts/util/dateHelper.js ***!
  \****************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\nmodule.exports = function (options) {\n  var undf = undefined;\n\n  var isNullOrEmpty = function isNullOrEmpty(str) {\n    return str === null || str === undefined || str === \"\";\n  };\n\n  var div = function div(a, b) {\n    return ~~(a / b);\n  };\n\n  var mod = function mod(a, b) {\n    return a - ~~(a / b) * b;\n  };\n\n  var mod2 = function mod2(a, b) {\n    return Math.abs(a - b * Math.floor(a / b));\n  };\n\n  var toInt = function toInt(text) {\n    return parseInt(text, 10);\n  };\n\n  var getDays = function getDays(date) {\n    var dateArray = date.split('/');\n    if (dateArray[1] < 8) return (dateArray[1] - 1) * 31 + toInt(dateArray[2]);\n    return 6 * 31 + (dateArray[1] - 7) * 30 + toInt(dateArray[2]);\n  };\n\n  var isLeapYear = function isLeapYear(year) {\n    return (year + 12) % 33 % 4 === 1;\n  };\n\n  var getDiffDays = function getDiffDays(date1, date2) {\n    var diffDays = getDays(date2) - getDays(date1);\n    var dateArray1 = date1.split('/');\n    var dateArray2 = date2.split('/');\n    var y1 = dateArray1[0] < dateArray2[0] ? dateArray1[0] : dateArray2[0];\n    var y2 = dateArray1[0] < dateArray2[0] ? dateArray2[0] : dateArray1[0];\n\n    for (var y = y1; y < y2; y++) {\n      if (isLeapYear(y)) diffDays += dateArray1[0] < dateArray2[0] ? 366 : -366;else diffDays += dateArray1[0] < dateArray2[0] ? 365 : -365;\n    }\n\n    return toInt(diffDays);\n  };\n\n  var compare = function compare(date1, date2) {\n    var d1, d2;\n    if (isNullOrEmpty(date1) || isNullOrEmpty(date2)) return undf;\n    if (Object.prototype.toString.call(date1) !== '[object Date]') d1 = new Date(date1);else d1 = date1;\n    if (Object.prototype.toString.call(date2) !== '[object Date]') d2 = new Date(date2);else d2 = date2;\n    if (d1.getDate() === d2.getDate() && d1.getMonth() === d2.getMonth() && d1.getFullYear() === d2.getFullYear()) return 0;\n    if (d1.getFullYear() > d2.getFullYear()) return 1;\n    if (d1.getFullYear() < d2.getFullYear()) return 2;\n    if (d1.getMonth() > d2.getMonth()) return 1;\n    if (d1.getMonth() < d2.getMonth()) return 2;\n    if (d1.getDate() > d2.getDate()) return 1;\n    if (d1.getDate() < d2.getDate()) return 2;\n  };\n\n  var daysBetween = function daysBetween(date1, date2) {\n    var d1, d2;\n    if (isNullOrEmpty(date1) || isNullOrEmpty(date2)) return undf;\n    if (Object.prototype.toString.call(date1) !== '[object Date]') d1 = new Date(date1);else d1 = date1;\n    if (Object.prototype.toString.call(date2) !== '[object Date]') d2 = new Date(date2);else d2 = date2;\n    if (d1.getDate() === d2.getDate() && d1.getMonth() === d2.getMonth() && d1.getFullYear() === d2.getFullYear()) return 0;\n    var startDate = Date.UTC(d1.getFullYear(), d1.getMonth(), d1.getDate());\n    var endDate = Date.UTC(d2.getFullYear(), d2.getMonth(), d2.getDate());\n    var timeDiff = new Date(startDate) - new Date(endDate);\n    var days = timeDiff / (1000 * 60 * 60 * 24);\n    return days;\n  };\n\n  var isFirstHalfYear = function isFirstHalfYear(date) {\n    var persianDate = toJalaali(date);\n    var month = persianDate[1];\n    return parseInt(month + 1) >= 1 && parseInt(month + 1) <= 6;\n  };\n\n  var monthsBetween = function monthsBetween(firstDate, secondDate) {\n    var diff = daysBetween(secondDate, firstDate);\n    var isInFirstHalf = isFirstHalfYear(firstDate);\n    var monthCount = isInFirstHalf ? diff / 30 : diff / 29;\n    return Number(monthCount);\n  };\n\n  var getWeekDay = function getWeekDay(date) {\n    return mod2(getDiffDays('1392/03/25', date), 7);\n  };\n\n  var jalCal = function jalCal(jy) {\n    var breaks = [-61, 9, 38, 199, 426, 686, 756, 818, 1111, 1181, 1210, 1635, 2060, 2097, 2192, 2262, 2324, 2394, 2456, 3178],\n        bl = breaks.length,\n        gy = jy + 621,\n        leapJ = -14,\n        jp = breaks[0],\n        jm,\n        jump,\n        leap,\n        n,\n        i;\n    if (jy < jp || jy >= breaks[bl - 1]) throw new Error('Invalid Jalaali year ' + jy);\n\n    for (i = 1; i < bl; i += 1) {\n      jm = breaks[i];\n      jump = jm - jp;\n      if (jy < jm) break;\n      leapJ = leapJ + div(jump, 33) * 8 + div(mod(jump, 33), 4);\n      jp = jm;\n    }\n\n    n = jy - jp;\n    leapJ = leapJ + div(n, 33) * 8 + div(mod(n, 33) + 3, 4);\n    if (mod(jump, 33) === 4 && jump - n === 4) leapJ += 1;\n    var leapG = div(gy, 4) - div((div(gy, 100) + 1) * 3, 4) - 150;\n    var march = 20 + leapJ - leapG;\n    if (jump - n < 6) n = n - jump + div(jump + 4, 33) * 33;\n    leap = mod(mod(n + 1, 33) - 1, 4);\n\n    if (leap === -1) {\n      leap = 4;\n    }\n\n    return {\n      leap: leap,\n      gy: gy,\n      march: march\n    };\n  };\n\n  var g2D = function g2D(gy, gm, gd) {\n    var d = div((gy + div(gm - 8, 6) + 100100) * 1461, 4) + div(153 * mod(gm + 9, 12) + 2, 5) + gd - 34840408;\n    d = d - div(div(gy + 100100 + div(gm - 8, 6), 100) * 3, 4) + 752;\n    return d;\n  };\n\n  var d2G = function d2G(jdn) {\n    var j;\n    j = 4 * jdn + 139361631;\n    j = j + div(div(4 * jdn + 183187720, 146097) * 3, 4) * 4 - 3908;\n    var i = div(mod(j, 1461), 4) * 5 + 308;\n    var gd = div(mod(i, 153), 5) + 1;\n    var gm = mod(div(i, 153), 12) + 1;\n    var gy = div(j, 1461) - 100100 + div(8 - gm, 6);\n    return {\n      gy: gy,\n      gm: gm,\n      gd: gd\n    };\n  };\n\n  var j2D = function j2D(jy, jm, jd) {\n    var r = jalCal(jy);\n    return g2D(r.gy, 3, r.march) + (jm - 1) * 31 - div(jm, 7) * (jm - 7) + jd - 1;\n  };\n\n  var d2J = function d2J(jdn) {\n    var gy = d2G(jdn).gy,\n        jy = gy - 621,\n        r = jalCal(jy),\n        jdn1F = g2D(gy, 3, r.march),\n        jd,\n        jm,\n        k;\n    k = jdn - jdn1F;\n\n    if (k >= 0) {\n      if (k <= 185) {\n        jm = 1 + div(k, 31);\n        jd = mod(k, 31) + 1;\n        return {\n          jy: jy,\n          jm: jm,\n          jd: jd\n        };\n      } else {\n        k -= 186;\n      }\n    } else {\n      jy -= 1;\n      k += 179;\n      if (r.leap === 1) k += 1;\n    }\n\n    jm = 7 + div(k, 30);\n    jd = mod(k, 30) + 1;\n    return {\n      jy: jy,\n      jm: jm,\n      jd: jd\n    };\n  };\n\n  var getMonthDays = function getMonthDays(date) {\n    var dateArray = date.split('/');\n    if (dateArray[1] < 7) return 31;\n    if (dateArray[1] < 12) return 30;\n    return isLeapYear(dateArray[0]) ? 30 : 29;\n  };\n\n  var isLeapJalaaliYear = function isLeapJalaaliYear(jy) {\n    return jalCal(jy).leap === 0;\n  };\n\n  var isLeapGregorianYear = function isLeapGregorianYear(year) {\n    return (year & 3) === 0 && (year % 25 !== 0 || (year & 15) === 0);\n  };\n\n  var jalaaliMonthLength = function jalaaliMonthLength(jy, jm) {\n    if (jm <= 6) return 31;\n    if (jm <= 11) return 30;\n    if (isLeapJalaaliYear(jy)) return 30;\n    return 29;\n  };\n\n  var gregorianMonthLength = function gregorianMonthLength(jy, jm) {\n    return new Date(jy, jm, 0).getDate();\n  };\n\n  var isValidJalaaliDate = function isValidJalaaliDate(jy, jm, jd) {\n    return jy >= -61 && jy <= 3177 && jm >= 1 && jm <= 12 && jd >= 1 && jd <= jalaaliMonthLength(jy, jm);\n  };\n\n  var isValidGregorianDate = function isValidGregorianDate(gy, gm, gd) {\n    return gy >= 1920 && gm >= 1 && gm <= 12 && gd >= 1 && gd <= gregorianMonthLength(gy, gm);\n  };\n\n  var toJalaali = function toJalaali(gy, gm, gd) {\n    var date;\n    if (isNullOrEmpty(gy)) return undf;else if (Object.prototype.toString.call(gy) === '[object Date]') {\n      gd = gy.getDate();\n      gm = gy.getMonth() + 1;\n      gy = gy.getFullYear();\n    } else if (Object.prototype.toString.call(gy) === '[object String]' && (gy.indexOf(\":\") !== -1 || gy.indexOf(\"-\") !== -1)) {\n      date = new Date(gy);\n      gd = date.getDate();\n      gm = date.getMonth() + 1;\n      gy = date.getFullYear();\n    } else if (Object.prototype.toString.call(gy) === '[object String]' && gy.indexOf(\"/\") !== -1) {\n      var splits = gy.split(\"/\");\n\n      if (splits.length === 3 && splits[2].length === 4) {\n        gd = Number(splits[1]);\n        gm = Number(splits[0]);\n        gy = Number(splits[2]);\n      } else {\n        return undf;\n      }\n    }\n\n    if (isValidGregorianDate(gy, gm, gd)) {\n      date = d2J(g2D(gy, gm, gd));\n      if (isValidJalaaliDate(date.jy, date.jm, date.jd)) return date;\n    }\n\n    return undf;\n  };\n\n  var getCurrentJalaaliYear = function getCurrentJalaaliYear() {\n    var jDate = toJalaali(new Date());\n    return jDate;\n  };\n\n  var getCurrentGregorianYear = function getCurrentGregorianYear() {\n    var date = new Date();\n    return date.getYear();\n  };\n\n  var getActionLogDate = function getActionLogDate(startDate, endDate) {\n    var date = dateNow(\"en\");\n    var now;\n\n    if (isNullOrEmpty(startDate) && isNullOrEmpty(endDate)) {\n      endDate = date;\n      var persianEndDate = toJalaali(endDate);\n      var persianStartDate = formatDate(persianEndDate.jy, persianEndDate.jm, 1, \"jyyyy/jmm/jdd\");\n      var fm = toGregorian(persianStartDate);\n      startDate = formatDate(fm.gy, fm.gm, fm.gd, \"mm/dd/yyyy\");\n      return [startDate, endDate];\n    }\n\n    if (isNullOrEmpty(startDate) && !isNullOrEmpty(endDate)) {\n      startDate = new Date(endDate);\n      startDate.setMonth(startDate.getMonth() - 6);\n      now = new Date();\n      if (endDate > now) endDate = now;\n      startDate = formatDate(startDate.getFullYear(), startDate.getMonth() + 1, startDate.getDate(), \"mm/dd/yyyy\");\n      return [startDate, endDate];\n    }\n\n    if (!isNullOrEmpty(startDate) && isNullOrEmpty(endDate)) {\n      endDate = new Date(startDate);\n      endDate.setMonth(endDate.getMonth() + 6);\n      now = new Date();\n      if (endDate > now) endDate = now;\n      endDate = formatDate(endDate.getFullYear(), endDate.getMonth() + 1, endDate.getDate(), \"mm/dd/yyyy\");\n      return [startDate, endDate];\n    }\n\n    if (daysBetween(startDate, endDate) > 0) {\n      endDate = new Date(endDate);\n      now = new Date();\n      if (endDate > now) endDate = now;\n      startDate = new Date(endDate);\n      startDate.setMonth(endDate.getMonth() - 6);\n      startDate = formatDate(startDate.getFullYear(), startDate.getMonth() + 1, startDate.getDate(), \"mm/dd/yyyy\");\n      endDate = formatDate(endDate.getFullYear(), endDate.getMonth() + 1, endDate.getDate(), \"mm/dd/yyyy\");\n      return [startDate, endDate];\n    }\n\n    if (monthsBetween(startDate, endDate) > 6) {\n      endDate = new Date(endDate);\n      startDate = new Date(endDate);\n      startDate.setMonth(endDate.getMonth() - 6);\n      startDate = formatDate(startDate.getFullYear(), startDate.getMonth() + 1, startDate.getDate(), \"mm/dd/yyyy\");\n      endDate = formatDate(endDate.getFullYear(), endDate.getMonth() + 1, endDate.getDate(), \"mm/dd/yyyy\");\n      return [startDate, endDate];\n    }\n\n    return [startDate, endDate];\n  };\n\n  var toGregorian = function toGregorian(jd, jm, jy) {\n    if (isNullOrEmpty(jd)) {\n      return undefined;\n    } else if (!jm || !jy) {\n      var splits = jd.split(\"/\");\n      jd = Number(splits[2]);\n      jm = Number(splits[1]);\n      jy = Number(splits[0]);\n    }\n\n    if (isValidJalaaliDate(jy, jm, jd)) var date = d2G(j2D(jy, jm, jd));\n    if (!isNullOrEmpty(date) && isValidGregorianDate(date.gy, date.gm, date.gd)) return date;\n    return undf;\n  };\n\n  var formatDate = function formatDate(y, m, d, pattren) {\n    switch (pattren) {\n      case \"jyyyy/jmm/jdd\":\n        return y + \"/\" + m + \"/\" + d;\n\n      case \"mm/dd/yyyy\":\n        return m + \"/\" + d + \"/\" + y;\n    }\n  };\n\n  var formatPersianDate = function formatPersianDate(date) {\n    var jalali;\n\n    if (ko.isObservable(date)) {\n      if (date() !== null && date() !== undefined && date() !== \"\") {\n        jalali = toJalaali(new Date(date()));\n        return formatDate(jalali.jy, jalali.jm, jalali.jd, \"jyyyy/jmm/jdd\");\n      } else return \"--\";\n    } else {\n      if (date !== null && date !== undefined && date !== \"\") {\n        jalali = toJalaali(new Date(date));\n        return formatDate(jalali.jy, jalali.jm, jalali.jd, \"jyyyy/jmm/jdd\");\n      } else return \"--\";\n    }\n  };\n\n  var formatPersianDateTime = function formatPersianDateTime(date) {\n    var jalali, formated, newDate;\n\n    if (ko.isObservable(date)) {\n      if (date() !== null && date() !== undefined && date() !== \"\") {\n        newDate = new Date(date());\n        jalali = toJalaali(newDate);\n        formated = formatDate(jalali.jy, jalali.jm, jalali.jd, \"jyyyy/jmm/jdd\");\n        return formated + \" \" + newDate.getHours() + \":\" + newDate.getMinutes() + \":\" + newDate.getSeconds();\n      } else return \"--\";\n    } else {\n      if (date !== null && date !== undefined && date !== \"\") {\n        newDate = new Date(date);\n        jalali = toJalaali(newDate);\n        formated = formatDate(jalali.jy, jalali.jm, jalali.jd, \"jyyyy/jmm/jdd\");\n        return formated + \" \" + newDate.getHours() + \":\" + newDate.getMinutes() + \":\" + newDate.getSeconds();\n      } else return \"--\";\n    }\n  };\n\n  var spliteDateStr = function spliteDateStr(str) {\n    var d, m, y, date;\n\n    try {\n      if (str.indexOf(\":\") !== -1 || str.indexOf(\"-\") !== -1) {\n        date = new Date(str);\n        d = date.getDate();\n        m = date.getMonth() + 1;\n        y = date.getFullYear();\n        return {\n          y: y,\n          m: m,\n          d: d,\n          type: \"g\"\n        };\n      } else if (str.indexOf(\"/\") !== -1) {\n        var splits = str.split(\"/\");\n\n        if (splits.length === 3 && splits[2].length === 4) {\n          d = Number(splits[1]);\n          m = Number(splits[0]);\n          y = Number(splits[2]);\n          return {\n            y: y,\n            m: m,\n            d: d,\n            type: \"g\"\n          };\n        }\n\n        if (splits.length === 3 && splits[0].length === 4) {\n          d = Number(splits[2]);\n          m = Number(splits[1]);\n          y = Number(splits[0]);\n          return {\n            y: y,\n            m: m,\n            d: d,\n            type: \"j\"\n          };\n        }\n      }\n\n      return undf;\n    } catch (e) {\n      return undf;\n    }\n  };\n\n  var fromDatePicker = function fromDatePicker(newValue, dateType) {\n    var date = spliteDateStr(newValue);\n    if (!date) return undf;\n\n    switch (dateType) {\n      case \"fa\":\n        if (date.type === \"j\") {\n          var gDate = toGregorian(date.d, date.m, date.y);\n          if (gDate) return formatDate(gDate.gy, gDate.gm, gDate.gd, \"mm/dd/yyyy\");\n          return undf;\n        }\n\n        break;\n    }\n\n    return undf;\n  };\n\n  var toDatePicker = function toDatePicker(str) {\n    var data = spliteDateStr(str);\n\n    if (data.type === \"j\") {\n      return [data, formatDate(data.y, data.m, data.d, \"jyyyy/jmm/jdd\")];\n    }\n\n    if (data.type === \"g\") {\n      var jalaliDate = toJalaali(data.y, data.m, data.d);\n      return [jalaliDate, formatDate(jalaliDate.jy, jalaliDate.jm, jalaliDate.jd, \"jyyyy/jmm/jdd\")];\n    }\n  };\n\n  var dateNow = function dateNow(dateType) {\n    var dateStr = localStorage.getItem(\"ServerDate\");\n    var date;\n    if (!isNullOrEmpty(dateStr) && dateStr !== \"\") date = new Date(dateStr);else date = new Date();\n    var day = date.getDate();\n    var month = date.getMonth() + 1;\n    var year = date.getFullYear();\n\n    switch (dateType) {\n      case \"fa\":\n        var jalaliDate = toJalaali(year, month, day);\n        return formatDate(jalaliDate.jy, jalaliDate.jm, jalaliDate.jd, \"jyyyy/jmm/jdd\");\n\n      case undefined:\n      case \"\":\n      case \"en\":\n        return formatDate(year, month, day, \"mm/dd/yyyy\");\n    }\n  };\n\n  var getDateLastDayOfYear = function getDateLastDayOfYear() {\n    var endDate;\n    var jalali = toJalaali(new Date());\n    var formated = formatDate(jalali.jy, jalali.jm, jalali.jd, \"jyyyy/jmm/jdd\");\n    var year = formated.substring(0, 4);\n    var isLeap = isLeapJalaaliYear(year);\n    if (isLeap) endDate = year + \"/12/30\";else endDate = year + \"/12/29\";\n    var m = toGregorian(endDate);\n    return formatDate(m.gy, m.gm, m.gd, \"mm/dd/yyyy\");\n  };\n\n  return {\n    formatPersianDate: formatPersianDate,\n    formatPersianDateTime: formatPersianDateTime,\n    getDateLastDayOfYear: getDateLastDayOfYear,\n    getCurrentGregorianYear: getCurrentGregorianYear,\n    daysBetween: daysBetween,\n    compare: compare,\n    getMonthDays: getMonthDays,\n    dateNow: dateNow,\n    getWeekDay: getWeekDay,\n    toDatePicker: toDatePicker,\n    fromDatePicker: fromDatePicker,\n    spliteDateStr: spliteDateStr,\n    toJalaali: toJalaali,\n    toGregorian: toGregorian,\n    isLeapGregorianYear: isLeapGregorianYear,\n    isValidJalaaliDate: isValidJalaaliDate,\n    isLeapJalaaliYear: isLeapJalaaliYear,\n    getCurrentJalaaliYear: getCurrentJalaaliYear,\n    getActionLogDate: getActionLogDate,\n    mod: mod,\n    g2d: g2D,\n    d2j: d2J,\n    j2d: j2D,\n    jalCal: jalCal\n  };\n}();\n\n//# sourceURL=webpack://domino/./src/scripts/util/dateHelper.js?");

/***/ }),

/***/ "./src/scripts/util/expparser.js":
/*!***************************************!*\
  !*** ./src/scripts/util/expparser.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"ExpParser\": () => (/* binding */ ExpParser)\n/* harmony export */ });\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\nvar jsep = __webpack_require__(/*! ../vendors/jsep.js */ \"./src/scripts/vendors/jsep.js\");\n\nfunction ExpParser() {\n  var self = this;\n  self.phrase = \"\";\n  self.parts = [];\n\n  self.addCol = function (phrase, col) {\n    phrase = phrase.replace(\"=\", \"\");\n    self.phrase = _h.replaceAll(phrase, \" \", \"\");\n    var temp = self.phrase.replace(/[\\])}[{(=]/g, '');\n    temp = _h.replaceAll(temp, ' ', '');\n\n    var splits = _h.splitMulti(temp, ['+', '-', '*', '/']);\n\n    splits = _h.cleanArray(splits);\n    var repArray = [];\n\n    for (var b = 0; b < splits.length; b++) {\n      var number = splits[b].replace(/^\\D+/g, '');\n      var letter = splits[b].replace(number, '');\n\n      if (letter) {\n        var t = Number(_h.alphabetToNumber(letter));\n\n        if (t >= col) {\n          repArray.push({\n            old: splits[b],\n            \"new\": _h.numberToAlphabet(t + 1) + Number(number)\n          });\n        }\n      }\n    }\n\n    self.phrase = self.replaceParts(self.phrase, repArray);\n    return \"=\" + self.phrase;\n  };\n\n  self.addNodeCol = function (phrase, col) {\n    self.phrase = _h.replaceAll(phrase, \" \", \"\");\n\n    var splits = _h.multiSplit(self.phrase, ['+', '-', '/', '*']);\n\n    var repArray = [];\n    if (_h.any(splits)) for (var i = 0; i < splits.length; i++) {\n      if (!splits[i].startsWith(\"{\")) {\n        var number = splits[i].replace(/^\\D+/g, '');\n        var letter = splits[i].replace(number, '');\n        var t = Number(_h.alphabetToNumber(letter));\n\n        if (t >= col) {\n          repArray.push({\n            old: splits[i],\n            \"new\": _h.numberToAlphabet(t + 1) + Number(number)\n          });\n        }\n      }\n    }\n    self.phrase = self.replaceParts(self.phrase, repArray);\n    return self.phrase;\n  };\n\n  self.removeCol = function (phrase, col) {\n    phrase = phrase.replace(\"=\", \"\");\n    self.phrase = _h.replaceAll(phrase, \" \", \"\");\n    var parse = jsep(self.phrase);\n    var res = self.removeColToString(parse, _h.numberToAlphabet(col));\n    var temp = res.replace(/[\\])}[{(=]/g, '');\n    temp = _h.replaceAll(temp, ' ', '');\n\n    var splits = _h.splitMulti(temp, ['+', '-', '*', '/']);\n\n    splits = _h.cleanArray(splits);\n\n    for (var b = 0; b < splits.length; b++) {\n      var number = splits[b].replace(/^\\D+/g, '');\n      var letter = splits[b].replace(number, '');\n      var t = Number(_h.alphabetToNumber(letter));\n\n      if (letter) {\n        if (t > col) {\n          res = _h.replaceAll(res, splits[b], _h.numberToAlphabet(t - 1) + number);\n        }\n      }\n    }\n\n    return \"=\" + res;\n  };\n\n  self.removeNodeCol = function (phrase, col) {\n    self.phrase = _h.replaceAll(phrase, \" \", \"\");\n\n    var splits = _h.multiSplit(self.phrase, ['+', '-', '/', '*']);\n\n    if (_h.any(splits)) for (var i = 0; i < splits.length; i++) {\n      if (!splits[i].startsWith(\"{\")) {\n        var number = splits[i].replace(/^\\D+/g, '');\n        var letter = splits[i].replace(number, '');\n        var t = Number(_h.alphabetToNumber(letter));\n\n        if (t > col) {\n          self.phrase = _h.replaceAll(self.phrase, splits[i], _h.numberToAlphabet(t - 1) + number);\n        }\n\n        if (t === col) {\n          if (splits.length === i + 1) {\n            self.phrase = _h.replaceAll(self.phrase, splits[i], \"\");\n            self.phrase = self.phrase.substring(0, self.phrase.length - 1);\n          } else {\n            var part1 = self.phrase.substring(0, self.phrase.indexOf(splits[i]) - 1);\n            var part2 = self.phrase.substring(self.phrase.indexOf(splits[i]) + splits[i].length);\n            self.phrase = part1 + part2;\n          }\n        }\n      }\n    }\n    return self.phrase;\n  };\n\n  self.removeColToString = function (obj, col) {\n    var left, right;\n\n    if (obj.type === \"BinaryExpression\") {\n      if (obj.left.type === \"Identifier\") {\n        left = obj.left.name;\n      }\n\n      if (obj.right.type === \"Identifier\") {\n        right = obj.right.name;\n      }\n\n      if (obj.left.type === \"Literal\") {\n        left = obj.left.value;\n      }\n\n      if (obj.right.type === \"Literal\") {\n        right = obj.right.value;\n      }\n\n      if (obj.left.type === \"BinaryExpression\") {\n        left = self.removeColToString(obj.left, col);\n      }\n\n      if (obj.right.type === \"BinaryExpression\") {\n        right = self.removeColToString(obj.right, col);\n      }\n\n      if (obj.right.type === \"UnaryExpression\") {\n        right = obj.right.operator + obj.right.argument.value;\n      }\n\n      if (obj.type === \"Identifier\") {\n        return obj.name;\n      }\n\n      var numberLeft, letterLeft, numberRight, letterRight;\n\n      try {\n        numberLeft = left.replace(/^\\D+/g, '');\n        letterLeft = left.replace(numberLeft, '');\n      } catch (e) {//\n      }\n\n      try {\n        numberRight = right.replace(/^\\D+/g, '');\n        letterRight = right.replace(numberRight, '');\n      } catch (e) {//\n      }\n\n      if (letterLeft && letterRight && (letterLeft === col || letterRight === col)) {\n        if (letterLeft === col && letterRight === col) {\n          return \"\";\n        }\n\n        if (letterRight === col) {\n          return left;\n        }\n\n        if (letterLeft === col) {\n          return right;\n        }\n      } else {\n        var exp = left + obj.operator + right;\n\n        if (self.phrase.indexOf(\"(\" + exp + \")\") !== -1) {\n          return \"(\" + exp + \")\";\n        } else {\n          return exp;\n        }\n      }\n    }\n  };\n\n  self.addRow = function (phrase, rowNumber) {\n    phrase = phrase.replace(\"=\", \"\");\n    self.phrase = _h.replaceAll(phrase, \" \", \"\");\n    var res = self.phrase;\n    var temp = self.phrase.replace(/[\\])}[{(=]/g, '');\n    temp = _h.replaceAll(temp, ' ', '');\n\n    var splits = _h.splitMulti(temp, ['+', '-', '*', '/']);\n\n    splits = _h.cleanArray(splits);\n    var repArray = [];\n\n    for (var j = 0; j < splits.length; j++) {\n      var number = splits[j].replace(/^\\D+/g, '');\n      var letter = splits[j].replace(number, '');\n\n      if (letter) {\n        if (Number(number) >= rowNumber) repArray.push({\n          old: splits[j],\n          \"new\": letter + (Number(number) + 1)\n        });\n      } else {\n        repArray.push({\n          old: splits[j],\n          \"new\": Number(number)\n        });\n      }\n    }\n\n    res = self.replaceParts(res, repArray);\n    return \"=\" + res;\n  };\n\n  self.addNodeRow = function (phrase, rowNumber) {\n    self.phrase = _h.replaceAll(phrase, \" \", \"\");\n\n    var splits = _h.multiSplit(self.phrase, ['+', '-', '/', '*']);\n\n    var repArray = [];\n    if (_h.any(splits)) for (var i = 0; i < splits.length; i++) {\n      if (!splits[i].startsWith(\"{\")) {\n        var number = splits[i].replace(/^\\D+/g, '');\n        var letter = splits[i].replace(number, '');\n\n        if (Number(number) >= rowNumber) {\n          repArray.push({\n            old: splits[i],\n            \"new\": letter + (Number(number) + 1)\n          });\n        }\n      }\n    }\n    self.phrase = self.replaceParts(self.phrase, repArray);\n    return self.phrase;\n  };\n\n  self.replaceParts = function (phrase, array) {\n    if (array.length === 0 || _h.isNullOrEmpty(phrase) || phrase === \"\") return phrase;\n    array.sort(function (a, b) {\n      return a[\"new\"] < b[\"new\"] ? 1 : -1;\n    });\n\n    for (var i = 0; i < array.length; i++) {\n      phrase = _h.replaceAll(phrase, array[i].old, array[i][\"new\"]);\n    }\n\n    return phrase;\n  };\n\n  self.removeRow = function (phrase, rowNumber) {\n    phrase = phrase.replace(\"=\", \"\");\n    self.phrase = _h.replaceAll(phrase, \" \", \"\");\n    var parse = jsep(self.phrase);\n    var res = self.removeRowToString(parse, rowNumber);\n    var temp = res.replace(/[\\])}[{(=]/g, '');\n    temp = _h.replaceAll(temp, ' ', '');\n\n    var splits = _h.splitMulti(temp, ['+', '-', '*', '/']);\n\n    splits = _h.cleanArray(splits);\n\n    for (var j = 0; j < splits.length; j++) {\n      var number = splits[j].replace(/^\\D+/g, '');\n      var letter = splits[j].replace(number, '');\n\n      if (letter) {\n        if (Number(number) > rowNumber) {\n          res = _h.replaceAll(res, splits[j], letter + (number - 1));\n        }\n      }\n    }\n\n    return \"=\" + res;\n  };\n\n  self.removeNodeRow = function (phrase, rowNumber) {\n    self.phrase = _h.replaceAll(phrase, \" \", \"\");\n\n    var splits = _h.multiSplit(self.phrase, ['+', '-', '/', '*']);\n\n    if (_h.any(splits)) for (var i = 0; i < splits.length; i++) {\n      if (!splits[i].startsWith(\"{\")) {\n        var number = splits[i].replace(/^\\D+/g, '');\n        var letter = splits[i].replace(number, '');\n\n        if (Number(number) > rowNumber) {\n          self.phrase = _h.replaceAll(self.phrase, splits[i], letter + (number - 1));\n        }\n\n        if (Number(number) === rowNumber) {\n          if (splits.length === i + 1) {\n            self.phrase = _h.replaceAll(self.phrase, splits[i], \"\");\n            self.phrase = self.phrase.substring(0, self.phrase.length - 1);\n          } else {\n            var part1 = self.phrase.substring(0, self.phrase.indexOf(splits[i]) - 1);\n            var part2 = self.phrase.substring(self.phrase.indexOf(splits[i]) + splits[i].length);\n            self.phrase = part1 + part2;\n          }\n        }\n      }\n    }\n    return self.phrase;\n  };\n\n  self.removeRowToString = function (obj, rowNumber) {\n    var left, right, res;\n\n    if (obj.type === \"BinaryExpression\") {\n      if (obj.left.type === \"Identifier\") {\n        left = obj.left.name;\n      }\n\n      if (obj.right.type === \"Identifier\") {\n        right = obj.right.name;\n      }\n\n      if (obj.left.type === \"Literal\") {\n        left = obj.left.value;\n      }\n\n      if (obj.right.type === \"Literal\") {\n        right = obj.right.value;\n      }\n\n      if (obj.left.type === \"BinaryExpression\") {\n        left = self.removeRowToString(obj.left, rowNumber);\n      }\n\n      if (obj.right.type === \"BinaryExpression\") {\n        right = self.removeRowToString(obj.right, rowNumber);\n      }\n\n      if (obj.right.type === \"UnaryExpression\") {\n        right = obj.right.operator + obj.right.argument.value;\n      }\n\n      if (obj.type === \"Identifier\") {\n        return obj.name;\n      }\n\n      var numberLeft, letterLeft, numberRight, letterRight;\n\n      try {\n        numberLeft = left.replace(/^\\D+/g, '');\n        letterLeft = left.replace(numberLeft, '');\n      } catch (e) {//\n      }\n\n      try {\n        numberRight = right.replace(/^\\D+/g, '');\n        letterRight = right.replace(numberRight, '');\n      } catch (e) {//\n      }\n\n      if (letterLeft && letterRight && (Number(numberLeft) === rowNumber || Number(numberRight) === rowNumber)) {\n        if (Number(numberLeft) === rowNumber && Number(numberRight) === rowNumber) {\n          return \"\";\n        }\n\n        if (Number(numberLeft) === rowNumber) {\n          return right;\n        }\n\n        if (Number(numberRight) === rowNumber) {\n          return left;\n        }\n      } else {\n        var exp = left + obj.operator + right;\n\n        if (self.phrase.indexOf(\"(\" + exp + \")\") !== -1) {\n          return \"(\" + exp + \")\";\n        } else {\n          return exp;\n        }\n      }\n    }\n  };\n\n  self.expToString = function (obj) {\n    var left, right, res;\n\n    if (obj.type === \"BinaryExpression\") {\n      if (obj.left.type === \"Identifier\") {\n        left = obj.left.name;\n      }\n\n      if (obj.right.type === \"Identifier\") {\n        right = obj.right.name;\n      }\n\n      if (obj.left.type === \"Literal\") {\n        left = obj.left.value;\n      }\n\n      if (obj.right.type === \"Literal\") {\n        right = obj.right.value;\n      }\n\n      if (obj.left.type === \"BinaryExpression\") {\n        left = self.expToString(obj.left);\n      }\n\n      if (obj.right.type === \"BinaryExpression\") {\n        right = self.expToString(obj.right);\n      }\n\n      var exp = left + obj.operator + right;\n\n      if (self.phrase.indexOf(\"(\" + exp + \")\") !== -1) {\n        return \"(\" + exp + \")\";\n      } else {\n        return exp;\n      }\n    }\n\n    if (obj.type === \"Identifier\") {\n      return obj.name;\n    }\n  };\n\n  self.afterColCopy = function (phrase, maxCol, maxRow, cellRow, lastNumber) {\n    self.phrase = phrase.replace(/[\\])}[{(=]/g, '');\n    self.phrase = _h.replaceAll(self.phrase, ' ', '');\n    var parse = jsep(self.phrase);\n    self.phrase = self.changeParts(parse, cellRow, lastNumber);\n\n    var splits = _h.splitMulti(self.phrase, ['+', '-', '*', '/']);\n\n    splits = _h.cleanArray(splits);\n    var inValidItems = [],\n        validItems = [];\n    if (_h.any(splits)) for (var i = 0; i < splits.length; i++) {\n      if (/^\\d+$/.test(splits[i])) {\n        validItems.push(splits[i]);\n      } else {\n        var number = splits[i].replace(/^\\D+/g, '');\n        var letter = splits[i].replace(number, '');\n\n        var letterNumber = _h.alphabetToNumber(letter);\n\n        if (letterNumber > maxCol || Number(number) > maxRow) inValidItems.push(splits[i]);else validItems.push(splits[i]);\n      }\n    }\n\n    if (validItems.length >= 2) {\n      if (inValidItems.length > 0) {\n        parse = jsep(self.phrase);\n        var res = self.removeInValidPart(parse, inValidItems);\n        return \"=\" + res;\n      } else {\n        return \"=\" + self.phrase;\n      }\n    } else {\n      return \"\";\n    }\n  };\n\n  self.minMaxControl = function (phrase, maxCol, maxRow) {\n    self.phrase = phrase.replace(/[\\])}[{(=]/g, '');\n    self.phrase = _h.replaceAll(self.phrase, ' ', '');\n\n    var splits = _h.splitMulti(self.phrase, ['+', '-', '*', '/']);\n\n    splits = _h.cleanArray(splits);\n    var inValidItems = [],\n        validItems = [];\n    if (_h.any(splits)) for (var i = 0; i < splits.length; i++) {\n      if (/^\\d+$/.test(splits[i])) {\n        validItems.push(splits[i]);\n      } else {\n        var number = splits[i].replace(/^\\D+/g, '');\n        var letter = splits[i].replace(number, '');\n\n        var letterNumber = _h.alphabetToNumber(letter);\n\n        if (letterNumber > maxCol || Number(number) > maxRow) inValidItems.push(splits[i]);else validItems.push(splits[i]);\n      }\n    }\n\n    if (validItems.length >= 2) {\n      if (inValidItems.length > 0) {\n        var parse = jsep(phrase);\n        var res = self.removeInValidPart(parse, inValidItems);\n        return \"=\" + res;\n      } else {\n        return phrase;\n      }\n    } else {\n      return \"\";\n    }\n  };\n\n  self.removeInValidPart = function (obj, parts) {\n    var left, right, res;\n\n    if (obj.type === \"BinaryExpression\") {\n      if (obj.left.type === \"Identifier\") {\n        left = obj.left.name;\n      }\n\n      if (obj.right.type === \"Identifier\") {\n        right = obj.right.name;\n      }\n\n      if (obj.left.type === \"Literal\") {\n        left = obj.left.value;\n      }\n\n      if (obj.right.type === \"Literal\") {\n        right = obj.right.value;\n      }\n\n      if (obj.left.type === \"BinaryExpression\") {\n        left = self.removeInValidPart(obj.left, parts);\n      }\n\n      if (obj.right.type === \"BinaryExpression\") {\n        right = self.removeInValidPart(obj.right, parts);\n      }\n\n      if (obj.right.type === \"UnaryExpression\") {\n        right = obj.right.operator + obj.right.argument.value;\n      }\n\n      if (obj.type === \"Identifier\") {\n        return obj.name;\n      }\n\n      if (parts.indexOf(left) === -1 && parts.indexOf(right) === -1) {\n        var exp = left + obj.operator + right;\n\n        if (self.phrase.indexOf(\"(\" + exp + \")\") !== -1) {\n          return \"(\" + exp + \")\";\n        } else {\n          return exp;\n        }\n      }\n\n      if (parts.indexOf(left) === -1 && parts.indexOf(right) !== -1) {\n        return left;\n      }\n\n      if (parts.indexOf(right) === -1 && parts.indexOf(left) !== -1) {\n        return right;\n      }\n\n      if (parts.indexOf(right) !== -1 && parts.indexOf(left) !== -1) {\n        return \"\";\n      }\n    }\n  };\n\n  self.changeParts = function (obj, cellRow, lastNumber) {\n    var left, right;\n\n    if (obj.type === \"BinaryExpression\") {\n      if (obj.left.type === \"Identifier\") {\n        left = obj.left.name;\n      }\n\n      if (obj.right.type === \"Identifier\") {\n        right = obj.right.name;\n      }\n\n      if (obj.left.type === \"Literal\") {\n        left = obj.left.value;\n      }\n\n      if (obj.right.type === \"Literal\") {\n        right = obj.right.value;\n      }\n\n      if (obj.left.type === \"BinaryExpression\") {\n        left = self.changeParts(obj.left, cellRow, lastNumber);\n      }\n\n      if (obj.right.type === \"BinaryExpression\") {\n        right = self.changeParts(obj.right, cellRow, lastNumber);\n      }\n\n      if (obj.right.type === \"UnaryExpression\") {\n        right = obj.right.operator + obj.right.argument.value;\n      }\n\n      if (obj.type === \"Identifier\") {\n        return obj.name;\n      }\n\n      var newLeft, newRight, number, letter;\n      var exp = left + obj.operator + right;\n\n      if (/^\\d+$/.test(left) || self.anyOprator(left)) {\n        newLeft = left;\n      }\n\n      if (/^\\d+$/.test(right) || self.anyOprator(right)) {\n        newRight = right;\n      }\n\n      if (/^\\d+$/.test(left) === false && self.anyOprator(left) === false) {\n        number = left.replace(/^\\D+/g, '');\n        letter = left.replace(number, \"\");\n        newLeft = letter + (cellRow - lastNumber + Number(number));\n      }\n\n      if (/^\\d+$/.test(right) === false && self.anyOprator(right) === false) {\n        number = right.replace(/^\\D+/g, '');\n        letter = right.replace(number, \"\");\n        newRight = letter + (cellRow - lastNumber + Number(number));\n      }\n\n      var newExp = newLeft + obj.operator + newRight;\n\n      if (self.phrase.indexOf(\"(\" + exp + \")\") !== -1) {\n        return \"(\" + newExp + \")\";\n      } else {\n        return newExp;\n      }\n    }\n  };\n\n  self.anyOprator = function (phrase) {\n    if (phrase.indexOf(\"+\") !== -1 || phrase.indexOf(\"-\") !== -1 || phrase.indexOf(\"*\") !== -1 || phrase.indexOf(\"/\") !== -1) {\n      return true;\n    }\n\n    return false;\n  };\n}\n\n//# sourceURL=webpack://domino/./src/scripts/util/expparser.js?");

/***/ }),

/***/ "./src/scripts/util/helper.js":
/*!************************************!*\
  !*** ./src/scripts/util/helper.js ***!
  \************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var confirmBox = __webpack_require__(/*! ./src/scripts/util/confirm.js */ \"./src/scripts/util/confirm.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var dateHelper = __webpack_require__(/*! ./src/scripts/util/dateHelper.js */ \"./src/scripts/util/dateHelper.js\");\n/* provided dependency */ var _hh = __webpack_require__(/*! ./src/scripts/util/htmlHelper.js */ \"./src/scripts/util/htmlHelper.js\");\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n__webpack_require__(/*! ../vendors/jquery-ui.min.js */ \"./src/scripts/vendors/jquery-ui.min.js\");\n\nvar toastr = __webpack_require__(/*! ../vendors/toastr.js */ \"./src/scripts/vendors/toastr.js\");\n\nmodule.exports = function (options) {\n  var resizeTable = function resizeTable() {\n    setTimeout(function () {\n      $('.ko-tbl th:not(.checkbox-col, .stateSwitch-ty, .label-ty)').resizable({\n        handles: 'w',\n        minWidth: 100,\n        _h: \"resizable-_h-t\",\n        start: function start(event, ui) {//var table = $(event.target).closest(\"table\");\n          //table.css(\"table-layout\", \"auto\");\n        },\n        stop: function stop(event, ui) {\n          $(event.target).css(\"left\", 0);\n          kocnx().changeColWidth(event.target); //var table = $(event.target).closest(\"table\");\n          //table.css(\"table-layout\", \"fixed\");\n        },\n        resize: function resize(event, ui) {\n          $(event.target).css(\"left\", 0);\n        }\n      });\n    }, 200);\n  };\n\n  var confirmDeleteAlert = function confirmDeleteAlert(message, callback, withCancelBtn) {\n    var yes = getLocalizedText(\"yesConfirm\");\n    var no = getLocalizedText(\"noConfirm\");\n    var buttons = [{\n      text: yes,\n      type: \"danger\",\n      value: true\n    }, {\n      text: no,\n      type: \"default\",\n      value: false\n    }];\n\n    if (withCancelBtn) {\n      var cancel = getLocalizedText(\"cancelConfirm\");\n      buttons.push({\n        text: cancel,\n        type: \"success\",\n        value: undefined\n      });\n    }\n\n    confirmBox.run({\n      text: message,\n      buttons: buttons\n    }, function (res) {\n      callback(res);\n    });\n  };\n\n  var confirmTableTemplateAlert = function confirmTableTemplateAlert(message, callback, withCancelBtn) {\n    var yes = getLocalizedText(\"yesConfirm\");\n    var no = getLocalizedText(\"noConfirm\");\n    var buttons = [{\n      text: yes,\n      type: \"success\",\n      value: true\n    }, {\n      text: no,\n      type: \"danger\",\n      value: false\n    }];\n\n    if (withCancelBtn) {\n      var cancel = getLocalizedText(\"cancelConfirm\");\n      buttons.push({\n        text: cancel,\n        type: \"warning\",\n        value: undefined\n      });\n    }\n\n    confirmBox.run({\n      text: message,\n      buttons: buttons\n    }, function (res) {\n      callback(res);\n    });\n  };\n\n  var confirmChooseAlert = function confirmChooseAlert(message, callback) {\n    confirmBox.run({\n      text: message,\n      buttons: [{\n        text: \"اعمال\",\n        type: \"success\",\n        value: true\n      }, {\n        text: \"لغو\",\n        type: \"danger\",\n        value: false\n      }, {\n        text: \"انصراف\",\n        type: \"default\",\n        value: undefined\n      }]\n    }, function (res) {\n      callback(res);\n    });\n  };\n\n  var warningToast = function warningToast(message) {\n    toastr.options = {\n      \"newestOnTop\": false,\n      \"positionClass\": \"toast-bottom-left\",\n      \"closeButton\": false,\n      \"toastClass\": \"animated fadeInDown\"\n    };\n    toastr.options.rtl = true;\n    toastr.warning(message);\n  };\n\n  var successToast = function successToast(message) {\n    toastr.options = {\n      \"newestOnTop\": false,\n      \"positionClass\": \"toast-bottom-left\",\n      \"closeButton\": false,\n      \"toastClass\": \"animated fadeInDown\"\n    };\n    toastr.options.rtl = true;\n    toastr.success(message);\n  };\n\n  var failToast = function failToast(message) {\n    toastr.options = {\n      \"newestOnTop\": false,\n      \"positionClass\": \"toast-top-left\",\n      \"closeButton\": false,\n      \"toastClass\": \"animated fadeInDown\"\n    };\n    toastr.options.rtl = true;\n    toastr.error(message);\n  };\n\n  var findControllerName = function findControllerName(name) {\n    var value = 0;\n\n    for (var i = 0; i < controllerNames.length; i++) {\n      if (controllerNames[i].enText.toLowerCase() === name.toLowerCase()) value = controllerNames[i].value;\n    }\n\n    return value;\n  };\n\n  var getEnumText = function getEnumText(values, id) {\n    var value = null;\n    $.each(values, function (i, p) {\n      if (p.value === id) value = p.text;\n    });\n    return value;\n  };\n\n  var getEnumEnText = function getEnumEnText(values, id) {\n    var value = null;\n    $.each(values, function (i, p) {\n      if (p.value === id) value = p.enText;\n    });\n    return value;\n  };\n\n  var getEnumItem = function getEnumItem(values, id) {\n    var value = null;\n    $.each(values, function (i, p) {\n      if (p.value === id) value = p;\n    });\n    return value;\n  };\n\n  var getEnumItemByText = function getEnumItemByText(values, text) {\n    var value = null;\n    $.each(values, function (i, p) {\n      if (p.enText === text) value = p;\n    });\n    return value;\n  };\n\n  var kocnx = function kocnx() {\n    var wrapper = $(\"#ko_wrapper\");\n\n    if (wrapper) {\n      var context = ko.contextFor(wrapper[0]);\n      if (context) return context.$data;\n    }\n  };\n\n  var countBackNumberZero = function countBackNumberZero(str) {\n    var count = 0;\n\n    for (var i = 0; i < str.length; i++) {\n      var target = str.substring(i, i + 1);\n      if (target === \"0\") count++;else {\n        return count;\n      }\n    }\n\n    return count;\n  };\n\n  var isNumeric = function isNumeric(obj) {\n    return !jQuery.isArray(obj) && obj - parseFloat(obj) + 1 >= 0;\n  };\n\n  var abd = function abd(a, n) {\n    n = (n + \"\").replace(\"9\", \"\").replace(\"0\", \"\");\n    n = n.split(\"\");\n    var s = \"\";\n    n.forEach(function (x) {\n      var p = Number(x);\n      var ab = a[p - 1];\n      s += ab;\n    });\n    return s;\n  };\n\n  var getExtension = function getExtension(value) {\n    if (!value) return \"\";\n    var filename = value.replace(/^.*[\\\\\\/]/, \"\");\n    return filename.slice((filename.lastIndexOf(\".\") - 1 >>> 0) + 2);\n  };\n\n  var getApiMessage = function getApiMessage(key) {\n    var item = apiMessages[key];\n    if (item === undefined || item === \"\") item = clientMessages[key];\n    if (item === undefined || item === \"\") item = cmdMessages[key];\n    var text = item[locale] || item['default'] || \"\";\n    return text;\n  };\n\n  var generateUuid = function generateUuid() {\n    var d = new Date().getTime();\n    var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n      var r = (d + Math.random() * 16) % 16 | 0;\n      d = Math.floor(d / 16);\n      return (c == 'x' ? r : r & 0x3 | 0x8).toString(16);\n    });\n    return uuid;\n  };\n\n  var getLocalizedText = function getLocalizedText(binding, subDomain) {\n    var domain = window.resDomain;\n\n    if (typeof domain === \"undefined\") {\n      throw \"res domain is empty\";\n    }\n\n    if (typeof locale === \"undefined\") {\n      throw \"ko.localationbinding.getLocalizedText: locale object is not defined\";\n    }\n\n    if (Object.prototype.toString.call(binding) === '[object String]') {\n      binding = {\n        key: binding\n      };\n    }\n\n    if (!binding) var y = 2;\n    var key = binding.key;\n    var item = commonRes[key];\n\n    if (!item) {\n      item = reportgenRes[key];\n    }\n\n    if (!item) {\n      item = findModelRes(key, domain);\n    }\n\n    if (!item) {\n      item = findPageRes(key, domain, subDomain);\n    }\n\n    if (!item) {\n      item = tabNameRes[key];\n    }\n\n    if (!item) {\n      var x = 2;\n    }\n\n    var text = item[locale] || item['default'] || \"\";\n\n    if (binding.params) {\n      for (var replaceKey in binding.params) {\n        if (binding.params.hasOwnProperty(replaceKey)) {\n          var replacement = binding.params[replaceKey];\n\n          if (typeof replacement === \"function\") {\n            replacement = ko.utils.unwrapObservable(replacement());\n          }\n\n          text = text.replace(\"#\" + replaceKey, replacement);\n        }\n      }\n    }\n\n    return text;\n  };\n\n  var findModelRes = function findModelRes(key, domain) {\n    switch (domain) {\n      case \"ActionLog\":\n      case \"Access\":\n      case \"Company\":\n      case \"GroupPeriod\":\n      case \"Consolidate\":\n      case \"OnlineUser\":\n      case \"DynamicTable\":\n      case \"CompanyInfo\":\n      case \"DynamicDocument\":\n        return window[domain.toLowerCase() + \"ModelRes\"][key];\n\n      case \"Period\":\n        var periodVal = periodModelRes[key];\n        if (periodVal === null || periodVal === undefined) periodVal = comparativeperiodsModelRes[key];\n        if (periodVal === null || periodVal === undefined) periodVal = periodhistoryModelRes[key];\n        return periodVal;\n\n      case \"User\":\n        var userVal = userModelRes[key];\n        if (userVal === null || userVal === undefined) userVal = usercontentModelRes[key];\n        return userVal;\n\n      case \"Tree\":\n        var treeVal = treeModelRes[key];\n        if (treeVal === null || treeVal === undefined) treeVal = valuepartsModelRes[key];\n        return treeVal;\n\n      case \"Balancesheet\":\n        var val = balancesheetModelRes[key];\n        if (val === null || val === undefined) val = balancesheetcontentModelRes[key];\n        return val;\n\n      case \"Mapping\":\n        var valMapping = mappingtreeModelRes[key];\n        if (valMapping === null || valMapping === undefined) valMapping = mappingDataModelRes[key];\n        if (valMapping === null || valMapping === undefined) valMapping = substituteNodeModelRes[key];\n        if (valMapping === null || valMapping === undefined) valMapping = mappingruleModelRes[key];\n        if (valMapping === null || valMapping === undefined) valMapping = mappingruledataModelRes[key];\n        return valMapping;\n\n      case \"BalanceReport\":\n        var valBalancereport = balancereportModelRes[key];\n        if (valBalancereport === null || valBalancereport === undefined) valBalancereport = reportbalancedataModelRes[key];\n        if (valBalancereport === null || valBalancereport === undefined) valBalancereport = totalbalancereportModelRes[key];\n        if (valBalancereport === null || valBalancereport === undefined) valBalancereport = reportbalancedatadetailsModelRes[key];\n        return valBalancereport;\n\n      case \"TableTemplate\":\n        var valTableTemplate = tabletemplateModelRes[key];\n        if (valTableTemplate === null || valTableTemplate === undefined) valTableTemplate = tabletemplatepreviewModelRes[key];\n        if (valTableTemplate === null || valTableTemplate === undefined) valTableTemplate = treeInfoModelRes[key];\n        if (valTableTemplate === null || valTableTemplate === undefined) valTableTemplate = tableModelRes[key];\n        return valTableTemplate;\n\n      case \"Magazine\":\n        var valMagazine = magazineModelRes[key];\n        if (valMagazine === null || valMagazine === undefined) valMagazine = savemagazineModelRes[key];\n        if (valMagazine === null || valMagazine === undefined) valMagazine = magazinePreviewPageRes[key];\n        return valMagazine;\n\n      case \"AdjustmentDocument\":\n        var valadjustmentdocument = adjustmentdocumentModelRes[key];\n        if (valadjustmentdocument === null || valadjustmentdocument === undefined) valadjustmentdocument = adjustmentdocumentitemModelRes[key];\n        return valadjustmentdocument;\n    }\n\n    return null;\n  };\n\n  var findPageRes = function findPageRes(key, domain, subDomain) {\n    switch (domain) {\n      case \"CompanyInfoData\":\n      case \"CompanyInfo\":\n        var companyInfoData = companyinfoPageRes[key];\n        if (companyInfoData === null || companyInfoData === undefined) companyInfoData = companyInfoDataPageRes[key];\n        return companyInfoData;\n\n      case \"ActionLog\":\n        return actionlogPageRes[key];\n\n      case \"Company\":\n        return companyPageRes[key];\n\n      case \"Period\":\n        var period = periodPageRes[key];\n        if (period === null || period === undefined) period = periodHistoryPageRes[key];\n        if (period === null || period === undefined) period = periodGroupHistoryPageRes[key];\n        return period;\n\n      case \"Tree\":\n        return treePageRes[key];\n\n      case \"User\":\n        var userVal = userPageRes[key];\n        if (userVal === null || userVal === undefined) userVal = usercontentPageRes[key];\n        return userVal;\n\n      case \"Access\":\n        return accessPageRes[key];\n\n      case \"Balancesheet\":\n        var val = balancesheetPageRes[key];\n        if (val === null || val === undefined) val = balancesheetContentPageRes[key];\n        return val;\n\n      case \"Mapping\":\n        var valMapping;\n\n        switch (subDomain) {\n          case \"MappingRule\":\n            valMapping = mappingrulePageRes[key];\n            break;\n\n          case \"SubstituteNode\":\n            valMapping = substitutenodePageRes[key];\n            break;\n\n          default:\n            valMapping = mappingTreePageRes[key];\n            if (valMapping === null || valMapping === undefined) valMapping = mappingDataPageRes[key];\n            if (valMapping === null || valMapping === undefined) valMapping = substitutenodePageRes[key];\n            if (valMapping === null || valMapping === undefined) valMapping = mappingrulePageRes[key];\n            break;\n        }\n\n        return valMapping;\n\n      case \"BalanceReport\":\n        var valBalanceReport = balancereportFilterRes[key];\n        if (valBalanceReport === null || valBalanceReport === undefined) valBalanceReport = balancereportPageRes[key];\n        if (valBalanceReport === null || valBalanceReport === undefined) valBalanceReport = totalBalanceReportPageRes[key];\n        if (valBalanceReport === null || valBalanceReport === undefined) valBalanceReport = reportBalanceDataPageRes[key];\n        return valBalanceReport;\n\n      case \"TableTemplate\":\n        var valTableTemplate = tabletemplatePageRes[key];\n        if (valTableTemplate === null || valTableTemplate === undefined) valTableTemplate = tableStructurePageRes[key];\n        if (valTableTemplate === null || valTableTemplate === undefined) valTableTemplate = reportgenRes[key];\n        return valTableTemplate;\n\n      case \"Magazine\":\n        var valMagazine = magazinePageRes[key];\n        if (valMagazine === null || valMagazine === undefined) valMagazine = savemagazinePageRes[key];\n        return valMagazine;\n\n      case \"AdjustmentDocument\":\n        var valadjustmentdocument = adjustmentdocumentPageRes[key];\n        if (valadjustmentdocument === null || valadjustmentdocument === undefined) valadjustmentdocument = adjustmentdocumentitemPageRes[key];\n        return valadjustmentdocument;\n\n      case \"GroupPeriod\":\n        return groupperiodPageRes[key];\n\n      case \"Consolidate\":\n        return consolidatePageRes[key];\n\n      case \"DynamicTable\":\n        var valdynamictable = dynamictablePageRes[key];\n        if (valdynamictable === null || valdynamictable === undefined) valdynamictable = dynamictabledataPageRes[key];\n        return valdynamictable;\n\n      case \"DynamicDocument\":\n        return dynamicdocumentPageRes[key];\n\n      case \"OnlineUser\":\n        return onlineuserPageRes[key];\n    }\n\n    return null;\n  };\n\n  var createOneDepthLines = function createOneDepthLines(item) {\n    ko.utils.arrayFilter(item.children(), function (child) {\n      child.createlines();\n    });\n  };\n\n  var toggleChildren = function toggleChildren(item) {\n    if (item.childrenShow() === false) {\n      item.childrenShow(true);\n      createOneDepthLines(item);\n    } else {\n      item.childrenShow(false);\n    }\n  };\n\n  var fixLabelsSize = function fixLabelsSize() {\n    var list = $(\".control-label\");\n    if (list && list.length) for (var i = 0; i < list.length; i++) {\n      var target = list[i];\n      var size = calDim($(target).text(), \"11px\", \"Iransans\", \"400\");\n      $(target).css(\"width\", size[1] + 5 + \"px\");\n    }\n  };\n\n  var setSd = function setSd(object) {\n    localStorage.setItem(\"sd\", JSON.stringify(object));\n  };\n\n  var getSd = function getSd() {\n    var object = localStorage.getItem('sd');\n\n    if (object !== null && object !== undefined && object !== \"\") {\n      return JSON.parse(object);\n    }\n\n    return null;\n  };\n\n  var setUd = function setUd(object) {\n    localStorage.setItem(\"ud\", JSON.stringify(object));\n  };\n\n  var getUd = function getUd() {\n    var object = localStorage.getItem('ud');\n\n    if (object !== null && object !== undefined && object !== \"\") {\n      return JSON.parse(object);\n    }\n\n    return null;\n  };\n\n  var toggleParent = function toggleParent() {\n    var a = getUd();\n    var b = getSd();\n    return {\n      a: [a.ur.usr_cks, a.cmp.cmp_cks, a.prd.prd_cks, b.sys_dt_rf, a.sys_date_trs, a.ur.avt_bg, b.cks_sys_bg, a.prd.col_lt],\n      b: a.cmp.log_cl_cks\n    };\n  };\n\n  var getTvm = function getTvm() {\n    var a = toggleParent();\n    var b = abd(a.a, a.b);\n\n    if (b) {\n      return b;\n    }\n\n    return null;\n  };\n\n  var backToLogin = function backToLogin() {\n    var pathName = \"\";\n    if (window.location.pathname) pathName = \"?returnUrl=\" + window.location.pathname;\n    window.location.href = \"/account/login\" + pathName;\n  };\n\n  var isNullOrEmpty = function isNullOrEmpty(model) {\n    if (model === null || model === undefined) {\n      return true;\n    }\n\n    return false;\n  };\n\n  var isEmpty = function isEmpty(model) {\n    if (model === null || model === undefined || model === \"\") {\n      return true;\n    }\n\n    return false;\n  };\n\n  var isBigger = function isBigger(number, cond) {\n    return number !== null && number !== undefined && number > cond;\n  };\n\n  var any = function any(model) {\n    if (model !== null && model !== undefined && model.length > 0) {\n      return true;\n    }\n\n    return false;\n  };\n\n  var errorListHandler = function errorListHandler(list) {\n    for (var j = 0; j < list.length; j++) {\n      var target = list[j];\n\n      if (target[\"selfDescriptive\"] && target.selfDescriptive === true) {\n        failToast(target.description);\n      } else {\n        var text = getApiMessage(target.code);\n        text = completeError(text, target);\n        failToast(text);\n      }\n    }\n  };\n\n  var warningListHandler = function warningListHandler(list) {\n    for (var j = 0; j < list.length; j++) {\n      var target = list[j];\n\n      if (target[\"selfDescriptive\"] && target.selfDescriptive === true) {\n        failToast(target.description);\n      } else {\n        var text = getApiMessage(target.code);\n        text = completeError(text, target);\n        warningToast(text);\n      }\n    }\n  };\n\n  var successListHandler = function successListHandler(list) {\n    for (var j = 0; j < list.length; j++) {\n      var target = list[j];\n      var text = getApiMessage(target.code);\n      text = completeError(text, target);\n      successToast(text);\n    }\n  };\n\n  var formatTextIfNull = function formatTextIfNull(text, sign) {\n    var outIfNull = sign;\n    if (outIfNull === null || outIfNull === undefined) outIfNull = \"-\";\n    if (text === null || text === undefined || text === \"undefined\" || text === \"null\" || text === \"\" || text === 0 || text === '0') return outIfNull;\n\n    if ($.isNumeric(text)) {\n      return formatNumber(text, false);\n    }\n\n    return text;\n  };\n\n  var emptyTextIfNull = function emptyTextIfNull(text, sign) {\n    var outIfNull = sign;\n    if (outIfNull === null || outIfNull === undefined) outIfNull = \"\";\n    if (text === null || text === undefined || text === \"undefined\" || text === \"null\" || text === \"\" || text === 0 || text === '0') return outIfNull;\n    return text;\n  };\n\n  var setAppSetting = function setAppSetting(data) {\n    var cast = JSON.parse(data);\n\n    for (var p in cast) {\n      if (cast.hasOwnProperty(p)) {\n        var target = cast[p];\n        localStorage.setItem(target.Key, target.Value);\n      }\n    }\n  };\n\n  var getAppSetting = function getAppSetting(key) {\n    var value = localStorage.getItem(key);\n\n    if (value === null || value === undefined || value === \"\") {\n      return null;\n    }\n\n    return value;\n  };\n\n  var toggleDisableSections = function toggleDisableSections(signalMappingStructureDisable) {\n    var context = kocnx();\n    var isExistPeriod = context.periodItem() !== null && context.periodItem() !== undefined;\n    var isExistMappingStructure = context.currentMappingEnabled();\n    var isCompany = context.loginCompanyType() === 1;\n\n    if (isExistPeriod) {\n      $(\".trees-dis-menu a\").attr(\"href\", \"/trees\");\n      $(\".operation-dis-menu a\").attr(\"href\", \"/operation\");\n      $(\".reports-dis-menu a\").attr(\"href\", \"/reports\");\n      $(\".notes-dis-menu a\").attr(\"href\", \"/notes\");\n      $(\".operation-dis-menu\").addClass(\"operation-menu\");\n      $(\".reports-dis-menu\").addClass(\"reports-menu\");\n      $(\".notes-dis-menu\").addClass(\"notes-menu\");\n      $(\".operation-menu\").removeClass(\"operation-dis-menu\");\n      $(\".reports-menu\").removeClass(\"reports-dis-menu\");\n      $(\".notes-menu\").removeClass(\"notes-dis-menu\");\n      $(\".trees-menu\").removeClass(\"trees-dis-menu\");\n\n      if (!isCompany) {\n        $('a[href=\"#Company-t\"]').parent().removeClass(\"disabledTab\");\n        return;\n      }\n\n      if (isExistMappingStructure) {\n        $('a[href=\"#Mapping-t\"]').parent().removeClass(\"disabledTab\");\n        $('a[href=\"#Balancesheet-t\"]').parent().removeClass(\"disabledTab\");\n        $('a[href=\"#AdjustmentDocument-t\"]').parent().removeClass(\"disabledTab\");\n      }\n\n      if (!isExistMappingStructure || signalMappingStructureDisable === true) {\n        $('a[href=\"#Mapping-t\"]').parent().addClass(\"disabledTab\");\n        $('a[href=\"#Balancesheet-t\"]').parent().addClass(\"disabledTab\");\n        $('a[href=\"#AdjustmentDocument-t\"]').parent().addClass(\"disabledTab\");\n        var path = window.location.pathname.toLowerCase().split(\"?\");\n\n        if (path[0] !== \"\") {\n          var array = path[0].split(\"/\");\n          array = $.grep(array, function (n) {\n            return n !== \"\";\n          });\n\n          if (array.length > 0) {\n            if (\"reports\".indexOf(array[0]) !== -1 || \"notes\".indexOf(array[0]) !== -1) {\n              window.location.href = \"/operation\";\n            }\n\n            if (\"operation\".indexOf(array[0]) !== -1) {\n              $('a[href=\"#Balancesheet-t\"]').trigger('click');\n            }\n          }\n        }\n      }\n    } else {\n      $(\".trees-menu a\").attr(\"href\", \"#\");\n      $(\".operation-menu a\").attr(\"href\", \"#\");\n      $(\".reports-menu a\").attr(\"href\", \"#\");\n      $(\".notes-menu a\").attr(\"href\", \"#\");\n      $(\".trees-menu\").addClass(\"trees-dis-menu\");\n      $(\".operation-menu\").addClass(\"operation-dis-menu\");\n      $(\".reports-menu\").addClass(\"reports-dis-menu\");\n      $(\".notes-menu\").addClass(\"notes-dis-menu\");\n      $(\".trees-dis-menu\").removeClass(\"trees-menu\");\n      $(\".operation-dis-menu\").removeClass(\"operation-menu\");\n      $(\".reports-dis-menu\").removeClass(\"reports-menu\");\n      $(\".notes-dis-menu\").removeClass(\"notes-menu\");\n\n      if (!isCompany) {\n        $('a[href=\"#Company-t\"]').parent().addClass(\"disabledTab\");\n      }\n    }\n  };\n\n  var buildTree = function buildTree(list) {\n    var idFieldName = 'id';\n    var parentKeyFieldName = 'pi';\n    var fieldNameForChildren = 'children';\n    var rootElements = [];\n    var lookup = {};\n    list.forEach(function (flatItem) {\n      var itemId = flatItem[idFieldName];\n      lookup[itemId] = flatItem;\n      flatItem[fieldNameForChildren] = [];\n    });\n    list.forEach(function (flatItem) {\n      var parentKey = flatItem[parentKeyFieldName];\n\n      if (parentKey !== null) {\n        var parentObject = lookup[flatItem[parentKeyFieldName]];\n\n        if (parentObject) {\n          parentObject[fieldNameForChildren].push(flatItem);\n        } else {\n          rootElements.push(flatItem);\n        }\n      } else {\n        rootElements.push(flatItem);\n      }\n    });\n    return rootElements;\n  };\n\n  var numberToAlphabet = function numberToAlphabet(num) {\n    if (num) {\n      for (var ret = '', a = 1, b = 26; (num -= a) >= 0; a = b, b *= 26) {\n        ret = String.fromCharCode(parseInt(num % b / a) + 65) + ret;\n      }\n\n      return ret;\n    }\n  };\n\n  var alphabetToNumber = function alphabetToNumber(alfabet) {\n    if (alfabet) {\n      var base = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\n          i,\n          j,\n          result = 0;\n\n      for (i = 0, j = alfabet.length - 1; i < alfabet.length; i += 1, j -= 1) {\n        result += Math.pow(base.length, j) * (base.indexOf(alfabet[i]) + 1);\n      }\n\n      return result;\n    }\n  };\n\n  var getIcon = function getIcon(key) {\n    if (key === null || key === undefined) return '';\n    var array = {\n      Create: {\n        fa: 'create.png'\n      },\n      create: {\n        fa: 'create.png'\n      },\n      Edit: {\n        fa: 'edit.png'\n      },\n      edit: {\n        fa: 'edit.png'\n      },\n      Delete: {\n        fa: 'delete.png'\n      },\n      \"delete\": {\n        fa: 'delete.png'\n      },\n      Cancel: {\n        fa: 'cancel.png'\n      },\n      Refresh: {\n        fa: 'refresh.png'\n      },\n      Copy: {\n        fa: 'copy.png'\n      },\n      Paste: {\n        fa: 'paste.png'\n      },\n      Cut: {\n        fa: 'cut.png'\n      },\n      Up: {\n        fa: 'up.png'\n      },\n      Down: {\n        fa: 'down.png'\n      },\n      RoleUser: {\n        fa: 'access.png'\n      },\n      ChangePassword: {\n        fa: 'password.png'\n      },\n      Comparatives: {\n        fa: 'comparatives.png'\n      },\n      ClosePeriod: {\n        fa: 'closeperiod.png'\n      },\n      OpenPeriod: {\n        fa: 'openperiod.png'\n      },\n      SendPeriod: {\n        fa: 'period-send.png'\n      },\n      TakebackPeriod: {\n        fa: 'period-takeback.png'\n      },\n      Archive: {\n        fa: 'archive.png'\n      },\n      UnArchive: {\n        fa: 'unarchive.png'\n      },\n      Calculator: {\n        fa: 'calculator.png'\n      },\n      ExportExcel: {\n        fa: 'exportexcel.png'\n      },\n      ImportExcel: {\n        fa: 'importexcel.png'\n      },\n      Key: {\n        fa: 'key.png'\n      },\n      Sort: {\n        fa: 'sort.png'\n      },\n      Save: {\n        fa: 'save.png'\n      },\n      TreeCreate: {\n        fa: 'treecreate.png'\n      },\n      ValueEdit: {\n        fa: 'valueedit.png'\n      },\n      ExportPdf: {\n        fa: 'exportpdf.png'\n      },\n      storePdf: {\n        fa: 'storePdf.png'\n      },\n      ExportHtml: {\n        fa: 'export_html.png'\n      },\n      ReportDesign: {\n        fa: 'reportdesign.png'\n      },\n      FileList: {\n        fa: 'filelist.png'\n      },\n      SelectRow: {\n        fa: 'selectrow.png'\n      },\n      Preview: {\n        fa: 'preview.png'\n      },\n      PageContent: {\n        fa: 'pagecontent.png'\n      },\n      Statement: {\n        fa: 'statement.png'\n      },\n      StatementOption: {\n        fa: 'statementoption.png'\n      },\n      PercentOwnership: {\n        fa: 'percentownership.png'\n      },\n      Consolidate: {\n        fa: 'consolidate.png'\n      },\n      DocsEnable: {\n        fa: 'docs-enable.png'\n      },\n      DocsDisable: {\n        fa: 'docs-disable.png'\n      },\n      DocsConfirm: {\n        fa: 'docs-confirm.png'\n      },\n      DocsTemporary: {\n        fa: 'docs-temporary.png'\n      },\n      DocEnable: {\n        fa: 'doc-enable.png'\n      },\n      DocDisable: {\n        fa: 'doc-disable.png'\n      },\n      DocConfirm: {\n        fa: 'doc-confirm.png'\n      },\n      DocTemporary: {\n        fa: 'doc-temporary.png'\n      },\n      AccountingNature: {\n        fa: 'account-statement.png'\n      },\n      EraseCell: {\n        fa: 'cell_style-erase.png'\n      },\n      MergeCells: {\n        fa: 'cells_merge.png'\n      },\n      Help: {\n        fa: 'help.png'\n      },\n      CalculateToday: {\n        fa: 'calculatortoday.png'\n      },\n      CalculateDate: {\n        fa: 'calculatordate.png'\n      },\n      ImportFile: {\n        fa: 'import_from_database.png'\n      },\n      ExportFile: {\n        fa: 'export_to_database.png'\n      },\n      CalculateDocument: {\n        fa: 'calculatordocment.png'\n      },\n      CalculateDocumentDelete: {\n        fa: 'calculatedocument-delete.png'\n      },\n      StockBuy: {\n        fa: 'buy.png'\n      },\n      StockSell: {\n        fa: 'sell.png'\n      },\n      ListDelete: {\n        fa: \"list-delete.png\"\n      },\n      DatabaseLink: {\n        fa: \"database-link.png\"\n      },\n      NodeReport: {\n        fa: \"node-report.png\"\n      },\n      ReportDownload: {\n        fa: \"report-preview.png\"\n      },\n      MappingOn: {\n        fa: \"link-add2.png\"\n      },\n      MappingOff: {\n        fa: \"link-delete2.png\"\n      },\n      AcceptTreeChange: {\n        fa: \"tree-ok.png\"\n      },\n      RejectTreeChange: {\n        fa: \"tree-delete2.png\"\n      },\n      AcceptTable: {\n        fa: \"tree-new.png\"\n      },\n      Info: {\n        fa: \"info.png\"\n      },\n      ResetConsolidate: {\n        fa: \"buildings-update.png\"\n      },\n      UnlockUser: {\n        fa: \"unlock-user.png\"\n      },\n      UnlockTemplate: {\n        fa: \"security_unlock.png\"\n      },\n      ModalResult: {\n        fa: \"report_open-new.png\"\n      },\n      Returned: {\n        fa: \"returned.png\"\n      },\n      FormMaker: {\n        fa: \"form.png\"\n      },\n      CloseThis: {\n        fa: \"closethis.png\"\n      },\n      CloseAll: {\n        fa: \"closeall.png\"\n      },\n      CloseAllButThis: {\n        fa: \"closeallbutthis.png\"\n      },\n      CloseRight: {\n        fa: \"closeright.png\"\n      },\n      CloseLeft: {\n        fa: \"closeleft.png\"\n      },\n      ExportExcels: {\n        fa: \"exporttexcels.png\"\n      }\n    };\n    var item = array[key];\n    return item[\"fa\"];\n  };\n\n  var int2Hex = function int2Hex(i) {\n    var h = i.toString(16);\n\n    if (h.length == 1) {\n      h = '0' + h;\n    }\n\n    return h;\n  };\n\n  var st2Hex = function st2Hex(s) {\n    return int2Hex(Number(s));\n  };\n\n  var toHex3 = function toHex3(c) {\n    if (c.length > 10) {\n      // IE9\n      var p1 = 1 + c.indexOf('('),\n          p2 = c.indexOf(')'),\n          cs = c.substring(p1, p2).split(',');\n      return ['#', st2Hex(cs[0]), st2Hex(cs[1]), st2Hex(cs[2])].join('');\n    } else {\n      return c;\n    }\n  };\n\n  var cleanArray = function cleanArray(actual) {\n    var newArray = new Array();\n\n    for (var i = 0; i < actual.length; i++) {\n      if (actual[i]) {\n        newArray.push(actual[i]);\n      }\n    }\n\n    return newArray;\n  };\n\n  var jsonToStyle = function jsonToStyle(item) {\n    var style = \"\";\n    if (item.textColor && item.textColor !== \"\") style += \"color: \" + item.textColor + \";\";\n    if (item.backColor) style += \"background-color: \" + item.backColor + \";\";\n    if (item.textAlign) style += \"text-align: \" + item.textAlign + \";\";\n    if (item.textBold) style += \"font-weight: bold;\";\n    if (item.borderStyle) style += \"border-style: \" + item.borderStyle + \";\";\n    if (item.borderWidth) style += \"border-width: \" + item.borderWidth + \";\";\n    if (item.borderColor) style += \"border-color: \" + item.borderColor + \";\";\n    if (item.textFontFamily) style += \"font-family: \" + item.textFontFamily + \";\";\n    if (item.textFontSize) style += \"font-size: \" + item.textFontSize + \";\";\n    return style;\n  };\n\n  var template = function template(tpl, args) {\n    var keys = Object.keys(args),\n        fn = _construct(Function, _toConsumableArray(keys).concat(['return ` ' + tpl.replace(/`/g, '\\\\ ` ') + '`']));\n\n    return fn.apply(void 0, _toConsumableArray(keys.map(function (x) {\n      return \" \" + args[x];\n    })));\n  };\n\n  var arrayToObject = function arrayToObject(list) {\n    var object = {};\n\n    for (var i = 0; i < list.length; i++) {\n      object[list[i].key] = list[i].value;\n    }\n\n    return object;\n  };\n\n  var completeError = function completeError(message, error) {\n    if (message.indexOf(\"$\") === -1) return message;\n    return template(message, arrayToObject(error.keyValues));\n  };\n\n  var formatNumber = function formatNumber(number, removeSign) {\n    var decimalPart, numberPart;\n    number = ko.isObservable(number) ? number() : number;\n    if (number === null || number === undefined) return 0;\n\n    if (number.toString().indexOf(\".\") !== -1) {\n      numberPart = number.toString().split(\".\")[0];\n      decimalPart = number.toString().split(\".\")[1];\n      if (removeSign) return numberPart.toString().replace('-', '').replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\") + \".\" + decimalPart;else return numberPart.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\") + \".\" + decimalPart;\n    } else {\n      if (removeSign) return number.toString().replace('-', '').replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");else return number.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n    }\n  };\n\n  var isNumberNegative = function isNumberNegative(number) {\n    number = number.toString();\n    if (isNullOrEmpty(number) || number === \"\" || number === \"0\" || number.indexOf(\"-\") === -1) return false;\n    return true;\n  };\n\n  var timeAgo = function timeAgo(date) {\n    if (ko.isObservable(date)) {\n      if (date() !== null && date() !== undefined && date() !== \"\") return $.timeago(date());else return \"--\";\n    } else {\n      if (date !== null && date !== undefined && date !== \"\") return $.timeago(date);else return \"--\";\n    }\n  };\n\n  var anyFilters = function anyFilters(filters) {\n    if (any(filters)) {\n      var hasActiveFilter = false;\n\n      for (var i = 0; i < filters.length; i++) {\n        if (!isNullOrEmpty(filters[i].source) || filters[i].type && filters[i].type === \"text\") hasActiveFilter = true;\n      }\n\n      return hasActiveFilter;\n    }\n\n    return false;\n  };\n\n  var pixelToMm = function pixelToMm(val) {\n    return val * 0.2645833333;\n  };\n\n  var shortString = function shortString(text, limit) {\n    text = ko.isObservable(text) ? text() : text;\n\n    if (!isNullOrEmpty(text)) {\n      if (text.length < limit) return text;\n      return text.substr(0, limit - 3) + \"...\";\n    }\n\n    return \"\";\n  };\n\n  var getWidth = function getWidth(element) {\n    try {\n      return element.getBoundingClientRect().width;\n    } catch (e) {\n      return 0;\n    }\n  };\n\n  var getHeight = function getHeight(element) {\n    try {\n      return element.getBoundingClientRect().height;\n    } catch (e) {\n      return 0;\n    }\n  };\n\n  var getLogoType = function getLogoType(name) {\n    name = name.trim();\n    name = name.replace(\"شرکت\", \"\");\n    name = name.replace(\"گروه\", \"\");\n    name = name.trim().substring(0, 1);\n    if (name !== null && name !== undefined && name !== \"\") return name;\n    return \"آ\";\n  };\n\n  var generateTotalTableCaption = function generateTotalTableCaption(context) {\n    var phrase = \"\";\n    phrase += (context.pageNumber() - 1) * context.pageSize() + 1;\n    if (context.total() < 1) phrase = 0;\n    phrase += \" تا \";\n    var last = context.pageSize() * context.pageNumber();\n    if (last > context.total()) phrase += context.total();else phrase += last;\n    phrase += \" از \" + context.total() + \" رکورد\";\n    return phrase;\n  };\n\n  var splitStringList = function splitStringList(str, seprator) {\n    if (isNullOrEmpty(str) || str === \"\") return [];\n    if (isNullOrEmpty(seprator) || seprator === \"\") seprator = \",\";\n    var splites = str.split(seprator);\n    splites = cleanArray(splites);\n    return splites;\n  };\n\n  var concatStringList = function concatStringList(list, seprator) {\n    if (!list && list.length === 0) return \"\";\n    var phrase = \"\";\n\n    for (var i = 0; i < list.length; i++) {\n      if (list.length === i + 1) {\n        phrase += list[i];\n      } else {\n        phrase += list[i] + \",\";\n      }\n    }\n\n    return phrase;\n  };\n\n  var contains = function contains(set, val) {\n    var res = false;\n\n    for (var i = 0; i < set.length; i++) {\n      if (set[i] === val) res = true;\n    }\n\n    return res;\n  };\n\n  var splitMulti = function splitMulti(str, tokens) {\n    var tempChar = tokens[0];\n\n    for (var i = 1; i < tokens.length; i++) {\n      str = str.split(tokens[i]).join(tempChar);\n    }\n\n    str = str.split(tempChar);\n    return str;\n  };\n\n  var escapeRegExp = function escapeRegExp(str) {\n    return str.replace(/([.*+?^=!:${}()|\\[\\]\\/\\\\])/g, \"\\\\$1\");\n  };\n\n  var replaceAll = function replaceAll(str, find, replace) {\n    if (isNullOrEmpty(str) || str === \"\") return str;\n    return str.replace(new RegExp(find, 'g'), replace);\n  };\n\n  var tdOutput = function tdOutput(record, col, parents) {\n    var value,\n        className,\n        span = \"<span>\";\n\n    switch (col.type) {\n      case \"enum\":\n        value = getEnumText(window[col.name + 's'], record[col.name]());\n\n        if (value === null && col['enumSourceName']) {\n          value = getEnumText(window[col['enumSourceName']], record[col.name]());\n        }\n\n        if (value === null && col['enumSourceName'] === null) {\n          value = \"-\";\n        }\n\n        span = \"<span>\" + value + \"</span>\";\n        return span;\n\n      case \"template\":\n        value = record[col.name]();\n        span = \"<div class='awcheckbox awcheckbox-success awcheckbox-inline'><input type='checkbox' checked='\" + value + \"' id='\" + col.name + record.id() + \"'><label for='\" + col.name + record.id() + \" ></label></div>\";\n        return span;\n\n      case \"label\":\n        var item = getEnumItem(window[col.name + 's'], record[col.name]());\n\n        switch (item.color) {\n          case \"green\":\n            className = 'label label-success';\n            break;\n\n          case \"red\":\n            className = 'label label-danger';\n            break;\n\n          case \"orange\":\n            className = 'label label-warning';\n            break;\n\n          case \"blue\":\n            className = 'label label-info';\n            break;\n\n          case \"navy\":\n            className = 'label label-primary';\n            break;\n\n          case \"gray\":\n            className = 'label label-default';\n            break;\n\n          case \"none\":\n            className = 'label label-none';\n            break;\n\n          case \"\":\n            className = 'label label-none';\n            break;\n        }\n\n        span = \"<span class='\" + className + \"'>\" + item.text + \"</span>\";\n        return span;\n\n      case \"timeago\":\n        span = \"<span>\" + timeAgo(record[col.name]) + \"</span>\";\n        return span;\n\n      case \"pdatetime\":\n        span = \"<span style='unicode-bidi: plaintext;'>\" + dateHelper.formatPersianDateTime(record[col.name]) + \"</span>\";\n        return span;\n\n      case \"pdate\":\n        span = \"<span>\" + dateHelper.formatPersianDate(record[col.name]) + \"</span>\";\n        return span;\n\n      case \"money-abs\":\n        value = formatValue(record, col);\n        span = \"<span data-original-title='\" + formatNumber(Math.abs(value), true) + \"'>\" + formatNumber(Math.abs(value), true) + \"</span>\";\n        return span;\n\n      case \"money\":\n        value = formatValue(record, col);\n        span = \"<span data-original-title='\" + formatNumber(value, true) + \"'>\" + formatNumber(value, true) + \"</span>\";\n        return span;\n\n      case \"smoney\":\n        value = formatValue(record, col);\n        span = \"<span data-original-title='\" + formatNumber(value, false) + \"'>\" + formatNumber(value, false) + \"</span>\";\n        return span;\n\n      case 'stringdrag':\n        value = formatValue(record, col);\n        var id = ko.isObservable(record['id']) ? record['id']() : record['id'];\n        span = \"<span class='template-item ui-draggable ui-draggable-handle' data-id='\" + id + \"'>\" + value + \"</span>\";\n        return span;\n\n      case \"lstring\":\n        value = formatValue(record, col);\n        span = \"<span  style='unicode-bidi: plaintext;'>\" + value + \"</span>\";\n        return span;\n\n      case \"string\":\n        value = formatValue(record, col);\n        return \"<span style='unicode-bidi: plaintext;'>\" + value + \"</span>\";\n\n      case \"stateSwitch\":\n        var div;\n\n        if (record[col.name]() === true || record[col.name]() === 1) {\n          div = '<div class=\"onoffswitch\" style=\"margin-right: 20px;\">' + '<input type=\"checkbox\" name=\"state\" checked=\"checked\" class=\"onoffswitch-checkbox\">' + '<label class=\"onoffswitch-label\"></label></div>';\n        } else {\n          div = '<div class=\"onoffswitch\" style=\"margin-right: 20px;\">' + '<input type=\"checkbox\" name=\"state\" class=\"onoffswitch-checkbox\">' + '<label class=\"onoffswitch-label\"></label></div>';\n        }\n\n        return div;\n\n      case \"file\":\n        var index = Number(col.name);\n        value = record[index];\n        if (!value) return \"\";\n        value = getFileIcon(value);\n        var title = ko.isObservable(record[index]) ? record[index]() : record[index];\n        var div = '<a class=\"file-download-item\" title=\"' + title + '\" data-order=\"' + index + '\"><img class=\"icon-image-xsmall selectable\" style=\"vertical-align: middle;\" src=\"' + value + '\"/><a/>';\n        return div;\n        break;\n\n      case \"bool\":\n        value = formatValue(record, col);\n        if (value) span = \"<span  style='unicode-bidi: plaintext;'>بایگانی شده</span>\";else span = \"<span  style='unicode-bidi: plaintext;'>-</span>\";\n        return span;\n        break;\n    }\n  };\n\n  var getVm = function getVm(parents) {\n    if (parents[1][\"isVisibleColumn\"]) return parents[1];\n    return parents[2];\n  };\n\n  var formatValue = function formatValue(record, col) {\n    var value = ko.isObservable(record[col.name]) ? record[col.name]() : record[col.name];\n    if (value === null || value === \"null\" || value === undefined) return \"-\";\n    return value;\n  };\n\n  var clearNumber = function clearNumber(num) {\n    if (!num) return undefined;\n    return replaceAll(num, \",\", \"\");\n  };\n\n  var calDim = function calDim(val, fontSize, fontFamily, fontWeight) {\n    var test = document.getElementsByClassName(\"test-el\")[0];\n    test.style.fontSize = fontSize;\n    test.style.fontFamily = fontFamily;\n    test.style.fontWeight = fontWeight;\n    test.innerText = val;\n    var height = test.clientHeight + 1;\n    var width = test.clientWidth + 1;\n    test.innerText = \"\";\n    return [height, width];\n  };\n\n  var fixItemHeight = function fixItemHeight(id) {\n    var ul = document.getElementById(id);\n    if (!ul) return;\n    var liList = $(ul).find(\"li\");\n    var height = 0;\n\n    if (liList && liList.length > 0) {\n      for (var i = 0; i < liList.length; i++) {\n        var li = liList[i];\n        height += $(li).height();\n      }\n\n      if (height > 210 || liList.length > 7) {\n        $(ul).height(\"210px\");\n      } else {\n        $(ul).height(height + 22 + \"px\");\n      }\n    } else {\n      $(ul).height(\"10px\");\n    }\n  };\n\n  var createRandomNumber = function createRandomNumber() {\n    var min = Math.ceil(1);\n    var max = Math.floor(999999999);\n    return Math.floor(Math.random() * (max - min) + min);\n  };\n\n  var isEnglishKeyboard = function isEnglishKeyboard(input) {\n    var rtlChars = \"\\u0600-\\u06FF\";\n    rtlChars += \"\\u0750-\\u077F\";\n    rtlChars += \"\\uFB50-\\uFDFF\";\n    rtlChars += \"\\uFE70-\\uFEFF\";\n    var controlChars = \"\\0- \";\n    controlChars += \"\\u2000-\\u200D\";\n    var reRTL = new RegExp('^[' + controlChars + ']*[' + rtlChars + ']');\n    var reControl = new RegExp('^[' + controlChars + ']*$');\n    var value = input;\n    if (value === undefined) return false;\n\n    if (value.match(reRTL)) {\n      return false;\n    } else if (value.match(reControl)) {\n      return false;\n    } else {\n      return true;\n    }\n  };\n\n  var multiSplit = function multiSplit(str, delimiter) {\n    if (!(delimiter instanceof Array)) return str.split(delimiter);\n    if (!delimiter || delimiter.length == 0) return [str];\n    var hashSet = new Set(delimiter);\n    if (hashSet.has(\"\")) return str.split(\"\");\n    var lastIndex = 0;\n    var result = [];\n\n    for (var i = 0; i < str.length; i++) {\n      if (hashSet.has(str[i])) {\n        result.push(str.substring(lastIndex, i));\n        lastIndex = i + 1;\n      }\n    }\n\n    result.push(str.substring(lastIndex));\n    return result;\n  };\n\n  var shortName = function shortName(name, num) {\n    if (!num) num = 35;\n    if (name.length < num) return [name, false];\n    return [name.substr(0, num - 3) + \"...\", true];\n  };\n\n  var shortValue = function shortValue(val) {\n    return val.replace(\"-\", \"\");\n  };\n\n  var abs = function abs(val) {\n    return val.replace(\"-\", \"\");\n  };\n\n  var getPosition = function getPosition(el) {\n    var rect = el.getBoundingClientRect(),\n        scrollLeft = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,\n        scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;\n    var l, t, w, h, sw, sh, sbw, sbh;\n\n    if (el == document.body) {\n      l = 0;\n      t = 0;\n      w = document.body.clientWidth || document.documentElement.clientWidth || window.innerWidth; //don't change this order\n\n      h = document.body.clientHeight || document.documentElement.clientHeight || window.innerHeight; //don't change this order\n\n      sw = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth);\n      sh = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);\n      sbw = document.documentElement.clientWidth - document.body.offsetWidth; //16\n\n      sbh = document.documentElement.clientHeight - document.body.offsetHeight; //16\n    } else {\n      l = rect.left + scrollLeft;\n      t = rect.top + scrollTop;\n      w = rect.right - rect.left;\n      h = rect.bottom - rect.top;\n      sw = el.scrollWidth;\n      sh = el.scrollHeight;\n      sbw = el.offsetWidth - el.clientWidth; //17\n\n      sbh = el.offsetHeight - el.clientHeight; //17\n    }\n\n    return {\n      left: l,\n      top: t,\n      width: w,\n      height: h,\n      right: l + w,\n      bottom: t + h,\n      scrollLeft: scrollLeft,\n      scrollTop: scrollTop,\n      scrollWidth: sw,\n      scrollHeight: sh\n    };\n  };\n\n  var periodSelectRowTemplate = function periodSelectRowTemplate(item) {\n    var temp = '<div>' + '<span class=\"item-title\">' + '<span class=\"item-name\">' + item.text + '</span></span>' + '<ul class=\"item-meta\">' + '<li class=\"item-type\">' + getEnumText(periodTypes, item.periodType) + \" - \" + getEnumText(periodStates, item.periodState) + \" - \" + getEnumText(auditStates, item.auditState);\n    if (item.description) temp += '<i class=\"dmn-info fa fa-info-circle\" title=\"' + item.description + '\"></i>';\n    temp += '</li></ul></div>';\n    return temp;\n  };\n\n  var tagSelectRowTemplate = function tagSelectRowTemplate(item) {\n    var temp = '<div style=\"padding: 3px;\">' + '<span class=\"item-title\">' + '<span class=\"item-name\">' + item.text + '</span>' + '</span>' + '<div class=\"label label-primary2 remove-tag\" style=\"float: left;padding-top: 4px;background-color: #ccc;\">حذف</div>' + '</div>';\n    return temp;\n  };\n\n  var activeTooltip = function activeTooltip(onlyVisible) {\n    if (!onlyVisible) {\n      var elements = $('[title]');\n      $(elements).tooltip({\n        placement: 'top'\n      });\n    } else {\n      $('[title]:visible').tooltip({\n        placement: 'top'\n      });\n    }\n  };\n\n  var removeDragLabel = function removeDragLabel() {\n    var div = document.getElementById('drag-label');\n    div.style.display = \"none\";\n  };\n\n  var toBase64 = function toBase64(file, callback) {\n    var reader = new FileReader();\n    reader.readAsDataURL(file);\n\n    reader.onload = function () {\n      callback(reader.result);\n    };\n\n    reader.onerror = function (error) {\n      callback(undefined);\n    };\n  };\n\n  var stringHasAlphabet = function stringHasAlphabet(str) {\n    var index;\n    var res = false;\n    var english = \" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()_+<>?|\\\\/\";\n\n    for (index = str.length - 1; index >= 0; --index) {\n      var x = str.substring(index, index + 1);\n\n      if (english.indexOf(x) > 0) {\n        res = true;\n      }\n    }\n\n    for (var i = 0, len = str.length; i < len; i++) {\n      var target = str[i];\n\n      if (/[^\\u0600-\\u06FF\\s]/g.test(target) === false) {\n        res = true;\n      }\n    }\n\n    return res;\n  };\n\n  var prop1Class = function prop1Class(data) {\n    switch (data.items[0]['t']) {\n      case \"rdo\":\n      case \"chk\":\n        return 'col-xs-12';\n\n      case \"tsp\":\n        if (data.items.length === 1) return 'form-full-line form-full-tuchpin-line col-xs-12';\n        if (data.items.length > 1) return 'form-line form-tuchpin-line  col-xs-6';\n        break;\n\n      default:\n        if (data.items.length === 1) return 'form-full-line col-xs-12';\n        if (data.items.length > 1) return 'form-line col-xs-6';\n    }\n  };\n\n  var prop2Class = function prop2Class(data) {\n    switch (data.items[1]['t']) {\n      case \"rdo\":\n      case \"chk\":\n        return 'col-xs-6';\n\n      case \"tsp\":\n        return 'form-line form-tuchpin-line  col-xs-6';\n\n      default:\n        return 'form-line col-xs-6';\n    }\n  };\n\n  var hasSpecialChar = function hasSpecialChar(str) {\n    if (!str) return false;\n    var res = false;\n\n    for (var i = 0; i < str.length; i++) {\n      if (/^[!@#\\$%\\^\\&*\\)\\(+=._-]+$/g.test(str[i])) res = true;\n    }\n\n    return res;\n  };\n\n  var adjustModalPosition = function adjustModalPosition(width, minWidth) {\n    var mb = $(\".modal-box\");\n    mb.css(\"width\", width);\n    var screenWidth = $(\"body\").width();\n    var modalWidth = mb.width();\n    var rest = (screenWidth - (modalWidth + 65)) / 2;\n    mb.css(\"left\", rest + \"px\");\n    if (minWidth) mb.css(\"min-width\", minWidth);\n  };\n\n  var getFileIcon = function getFileIcon(fileName) {\n    var value = ko.isObservable(fileName) ? fileName() : fileName;\n    var ext = getExtension(value);\n    var base = \"/App/src/images/ico/\";\n\n    switch (ext.toLowerCase()) {\n      case \"txt\":\n        return base + \"file_text.png\";\n\n      case \"xlsx\":\n      case \"xls\":\n        return base + \"file_excel.png\";\n\n      case \"html\":\n        return base + \"file_html.png\";\n\n      case \"csv\":\n        return base + \"file_csv.png\";\n\n      case \"pdf\":\n        return base + \"file_pdf.png\";\n\n      case \"png\":\n      case \"jpg\":\n      case \"jpeg\":\n        return base + \"file_image.png\";\n\n      case \"\":\n        return \"\";\n\n      default:\n        return base + \"file_txt.png\";\n    }\n  };\n\n  var normalizeAmpersand = function normalizeAmpersand(phrase) {\n    if (isEmpty(phrase)) return \"\";\n    if (typeof phrase !== \"string\" || phrase.indexOf(\"&&\") === -1) return phrase;\n    return replaceAll(phrase, \"&&\", \"\\\\u0026\\\\u0026\");\n  };\n\n  var findMinMaxCells = function findMinMaxCells(list) {\n    var minCol = Math.min.apply(Math, _toConsumableArray(list.map(function (item) {\n      return item.col;\n    })));\n    var minRow = Math.min.apply(Math, _toConsumableArray(list.map(function (item) {\n      return item.row;\n    })));\n    var maxCol = Math.max.apply(Math, _toConsumableArray(list.map(function (item) {\n      return item.col;\n    })));\n    var maxRow = Math.max.apply(Math, _toConsumableArray(list.map(function (item) {\n      return item.row;\n    })));\n    var minCell = list.filter(function (item) {\n      return item.col === minCol && item.row === minRow;\n    })[0];\n    var maxCell = list.filter(function (item) {\n      return item.col === maxCol && item.row === maxRow;\n    })[0];\n    return [minCell.address, maxCell.address];\n  };\n\n  var analyzeCells = function analyzeCells(list) {\n    var minCol = Math.min.apply(Math, _toConsumableArray(list.map(function (item) {\n      return item.col;\n    })));\n    var minRow = Math.min.apply(Math, _toConsumableArray(list.map(function (item) {\n      return item.row;\n    })));\n    var canShowChartOffline = list.filter(function (a) {\n      return !isNullOrEmpty(a.value);\n    }).length;\n    var series = list.filter(function (item) {\n      return item.row === minRow && item.col !== minCol;\n    }); // columns name\n\n    var categories = list.filter(function (item) {\n      return item.col === minCol && item.row !== minRow;\n    }); // rows name\n\n    var columns = series.map(function (v) {\n      return {\n        label: v.text,\n        address: v.address\n      };\n    });\n    var rows = categories.map(function (v) {\n      return {\n        label: v.text,\n        address: v.address\n      };\n    });\n    return [columns, rows, canShowChartOffline];\n  };\n\n  var downloadFile = function downloadFile(code) {\n    var url = \"/reports/downloadfile?code=\" + code;\n    window.open(url);\n  };\n\n  var clearHtmlTag = function clearHtmlTag(str) {\n    if (isEmpty(str)) return \"\";\n    return str.replace(/<\\/?[^>]+(>|$)/g, \"\");\n  };\n\n  var createNodeTooltip = function createNodeTooltip(str) {\n    var list = str.split('|');\n\n    var ul = _hh.createTag({\n      name: \"ul\",\n      attach: false,\n      className: \"none-style\",\n      styles: \"direction: rtl;\"\n    });\n\n    for (var i = 0; i < list.length; i++) {\n      var li = _hh.createTag({\n        name: \"li\",\n        parent: ul,\n        styles: \"font-size: 10px; font-weight: 400;\"\n      });\n\n      var divRow = _hh.createTag({\n        name: \"div\",\n        parent: li,\n        className: \"row m-b-m\"\n      });\n\n      var div = _hh.createTag({\n        name: \"div\",\n        parent: divRow,\n        className: \"col-lg-12\",\n        styles: \"margin-top: 11px;\"\n      });\n\n      _hh.createTag({\n        name: \"span\",\n        parent: div,\n        text: i + 1 + '- '\n      });\n\n      _hh.createTag({\n        name: \"span\",\n        parent: div,\n        text: list[i]\n      });\n    }\n\n    return ul;\n  };\n\n  var changeAft = function changeAft(val) {\n    if (val) document.getElementsByName(\"__RequestVerificationToken\")[0].value = val;\n  };\n\n  return {\n    changeAft: changeAft,\n    createNodeTooltip: createNodeTooltip,\n    clearHtmlTag: clearHtmlTag,\n    downloadFile: downloadFile,\n    findMinMaxCells: findMinMaxCells,\n    analyzeCells: analyzeCells,\n    normalizeAmpersand: normalizeAmpersand,\n    getFileIcon: getFileIcon,\n    adjustModalPosition: adjustModalPosition,\n    hasSpecialChar: hasSpecialChar,\n    prop2Class: prop2Class,\n    prop1Class: prop1Class,\n    stringHasAlphabet: stringHasAlphabet,\n    toBase64: toBase64,\n    findControllerName: findControllerName,\n    setSd: setSd,\n    getSd: getSd,\n    abs: abs,\n    abd: abd,\n    shortValue: shortValue,\n    shortName: shortName,\n    periodSelectRowTemplate: periodSelectRowTemplate,\n    emptyTextIfNull: emptyTextIfNull,\n    isEnglishKeyboard: isEnglishKeyboard,\n    getPosition: getPosition,\n    createRandomNumber: createRandomNumber,\n    fixItemHeight: fixItemHeight,\n    calDim: calDim,\n    removeDragLabel: removeDragLabel,\n    clearNumber: clearNumber,\n    tdOutput: tdOutput,\n    formatValue: formatValue,\n    replaceAll: replaceAll,\n    splitMulti: splitMulti,\n    escapeRegExp: escapeRegExp,\n    contains: contains,\n    concatStringList: concatStringList,\n    splitStringList: splitStringList,\n    generateTotalTableCaption: generateTotalTableCaption,\n    getLogoType: getLogoType,\n    getWidth: getWidth,\n    getHeight: getHeight,\n    shortString: shortString,\n    pixelToMm: pixelToMm,\n    timeAgo: timeAgo,\n    formatNumber: formatNumber,\n    isNumberNegative: isNumberNegative,\n    anyFilters: anyFilters,\n    completeError: completeError,\n    jsonToStyle: jsonToStyle,\n    cleanArray: cleanArray,\n    toHex3: toHex3,\n    getIcon: getIcon,\n    alphabetToNumber: alphabetToNumber,\n    numberToAlphabet: numberToAlphabet,\n    setAppSetting: setAppSetting,\n    getAppSetting: getAppSetting,\n    initResizeTable: resizeTable,\n    errorListHandler: errorListHandler,\n    warningListHandler: warningListHandler,\n    successListHandler: successListHandler,\n    formatTextIfNull: formatTextIfNull,\n    isNumeric: isNumeric,\n    isNullOrEmpty: isNullOrEmpty,\n    isEmpty: isEmpty,\n    isBigger: isBigger,\n    multiSplit: multiSplit,\n    tagSelectRowTemplate: tagSelectRowTemplate,\n    any: any,\n    confirmDeleteAlert: confirmDeleteAlert,\n    confirmTableTemplateAlert: confirmTableTemplateAlert,\n    confirmChooseAlert: confirmChooseAlert,\n    successToast: successToast,\n    failToast: failToast,\n    warningToast: warningToast,\n    getEnumText: getEnumText,\n    getEnumEnText: getEnumEnText,\n    getEnumItemByText: getEnumItemByText,\n    kocnx: kocnx,\n    getVm: getVm,\n    countBackNumberZero: countBackNumberZero,\n    getExtension: getExtension,\n    getApiMessage: getApiMessage,\n    generateUuid: generateUuid,\n    getLocalizedText: getLocalizedText,\n    findModelRes: findModelRes,\n    findPageRes: findPageRes,\n    getEnumItem: getEnumItem,\n    toggleChildren: toggleChildren,\n    fixLabelsSize: fixLabelsSize,\n    setUd: setUd,\n    getUd: getUd,\n    getTvm: getTvm,\n    backToLogin: backToLogin,\n    toggleDisableSections: toggleDisableSections,\n    buildTree: buildTree,\n    activeTooltip: activeTooltip\n  };\n}();\n\nArray.prototype.remove = function (val) {\n  for (var i = 0; i < this.length; i++) {\n    if (this[i] === val) {\n      this.splice(i, 1);\n      i--;\n    }\n  }\n\n  return this;\n};\n\n//# sourceURL=webpack://domino/./src/scripts/util/helper.js?");

/***/ }),

/***/ "./src/scripts/util/htmlHelper.js":
/*!****************************************!*\
  !*** ./src/scripts/util/htmlHelper.js ***!
  \****************************************/
/***/ ((module) => {

eval("var tagStack = {};\n\nmodule.exports = function () {\n  var hasClass = function hasClass(el, className) {\n    return el && el.classList && el.classList.contains(className);\n  };\n\n  var removeElement = function removeElement(el) {\n    el.parentNode.removeChild(el);\n  };\n\n  var getClosest = function getClosest(elem, selector) {\n    // Element.matches() polyfill\n    if (!Element.prototype.matches) {\n      Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector || function (s) {\n        var matches = (this.document || this.ownerDocument).querySelectorAll(s),\n            i = matches.length;\n\n        while (--i >= 0 && matches.item(i) !== this) {}\n\n        return i > -1;\n      };\n    } // Get the closest matching element\n\n\n    for (; elem && elem !== document; elem = elem.parentNode) {\n      if (elem.matches(selector)) return elem;\n    }\n\n    return null;\n  };\n\n  var setClassName = function setClassName(element, className) {\n    element.className = className;\n  };\n\n  var setInnerHtml = function setInnerHtml(element, html) {\n    element.innerHTML = html;\n  };\n\n  var createElement = function createElement(tag, parent) {\n    var element = document.createElement(tag);\n    if (parent) parent.appendChild(element);\n    return element;\n  };\n\n  var createTag = function createTag(obj) {\n    var element = document.createElement(obj.name);\n    if (obj.className) element.className = obj.className;\n    if (obj.id) element.id = obj.id;\n    if (obj.styles) element.setAttribute(\"style\", obj.styles);else element.setAttribute(\"style\", \"\");\n    if (obj.text) element.innerText = obj.text;\n    if (obj.html) element.innerHTML = obj.html;\n    if (obj.value) element.value = obj.value;\n    if (obj.attributes) setAttributes(element, obj.attributes);\n\n    if (obj.attach !== false) {\n      if (obj.addBefore) obj.parent.prepend(element);else obj.parent.appendChild(element);\n    }\n\n    if (obj.onclick) element.onclick = obj.onclick;\n    if (obj.ondblclick) element.ondblclick = obj.ondblclick;\n\n    if (obj.children) {\n      for (var i = 0; i < obj.children.length; i++) {\n        obj.children[i].parent = element;\n        createTag(obj.children[i]);\n      }\n    }\n\n    return element;\n  };\n\n  var cloneTag = function cloneTag(obj) {\n    var element;\n    if (tagStack[obj.className]) element = tagStack[obj.className].cloneNode();else element = document.createElement(obj.name);\n    if (obj.className) element.className = obj.className;\n    if (obj.styles) element.setAttribute(\"style\", obj.styles);\n    if (obj.text) element.innerText = obj.text;\n    element.value = obj.value;\n    if (obj.attributes) setAttributes(element, obj.attributes);\n    obj.parent.appendChild(element);\n    if (!tagStack[obj.className]) tagStack[obj.className] = element;\n    return element;\n  };\n\n  var setAttributes = function setAttributes(el, args) {\n    for (var k in args) {\n      if (args.hasOwnProperty(k)) {\n        var val = args[k];\n        el.setAttribute(k, val);\n      }\n    }\n  };\n\n  return {\n    hasClass: hasClass,\n    removeElement: removeElement,\n    getClosest: getClosest,\n    setClassName: setClassName,\n    setInnerHtml: setInnerHtml,\n    createElement: createElement,\n    cloneTag: cloneTag,\n    createTag: createTag,\n    setAttributes: setAttributes\n  };\n}();\n\nArray.prototype.remove = function (val) {\n  for (var i = 0; i < this.length; i++) {\n    if (this[i] === val) {\n      this.splice(i, 1);\n      i--;\n    }\n  }\n\n  return this;\n};\n\n//# sourceURL=webpack://domino/./src/scripts/util/htmlHelper.js?");

/***/ }),

/***/ "./src/scripts/util/keyboardHandler.js":
/*!*********************************************!*\
  !*** ./src/scripts/util/keyboardHandler.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"KeyboardHandler\": () => (/* binding */ KeyboardHandler)\n/* harmony export */ });\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\nfunction KeyboardHandler() {\n  var self = this; // todo fix anyOpenModal \n\n  self.masterCreateBtn = function () {\n    if (anyOpenModal || focusSearchInput) return true;\n    var cont = self.findActiveSection();\n\n    if (cont[\"proxyKeyboard\"]) {\n      cont.proxyKeyboard(\"create\");\n    } else if (cont[\"createBtn\"] !== null && cont[\"createBtn\"] !== undefined && resDomain !== \"Tree\") {\n      if (cont[\"viscreate\"] !== null && cont[\"viscreate\"] !== undefined && cont.viscreate()) cont.createBtn();\n    }\n  };\n\n  self.masterEditBtn = function () {\n    if (anyOpenModal || focusSearchInput) return true;\n    var cont = self.findActiveSection();\n\n    if (cont[\"proxyKeyboard\"]) {\n      cont.proxyKeyboard(\"edit\");\n    } else if (cont[\"editBtn\"] !== null && cont[\"editBtn\"] !== undefined && resDomain !== \"Tree\") {\n      if (cont[\"isSelectedRecord\"] !== null && cont[\"isSelectedRecord\"] !== undefined) cont.editBtn();\n    }\n  };\n\n  self.masterDeleteBtn = function () {\n    if (anyOpenModal || focusSearchInput) return true;\n    var cont = self.findActiveSection();\n\n    if (cont[\"proxyKeyboard\"]) {\n      cont.proxyKeyboard(\"delete\");\n    } else if (cont[\"deleteBtn\"] !== null && cont[\"deleteBtn\"] !== undefined && resDomain !== \"Tree\") {\n      if (cont[\"visdelete\"] !== null && cont[\"visdelete\"] !== undefined && cont.visdelete()) cont.deleteBtn();\n    } else if (cont[\"deleteListBtn\"] !== null && cont[\"deleteListBtn\"] !== undefined && resDomain !== \"Tree\") {\n      if (cont[\"hasSelectedRecord\"] !== null && cont[\"hasSelectedRecord\"] !== undefined && cont.hasSelectedRecord()) cont.deleteListBtn();\n    }\n  };\n\n  self.masterRefreshBtn = function () {\n    if (anyOpenModal || focusSearchInput) return true;\n    var cont = self.findActiveSection();\n\n    if (cont[\"proxyKeyboard\"]) {\n      cont.proxyKeyboard(\"refresh\");\n    } else if (cont[\"refreshTable\"] !== null && cont[\"refreshTable\"] !== undefined) {\n      cont.refreshTable();\n    }\n  };\n\n  self.masterHelpBtn = function (shiftKey) {\n    if (anyOpenModal || focusSearchInput) return true;\n\n    _h.kocnx().getHelpData(undefined, undefined, \"\", function (data) {\n      if (data) {\n        var model = new HelpViewModel();\n        model.fillModel(data);\n\n        _h.kocnx().helpModal(model);\n\n        _h.kocnx().showHelp(true);\n      }\n    });\n  };\n\n  self.masterUpKey = function (e, shiftKey) {\n    var cont = self.findActiveSection(e, shiftKey);\n\n    if (cont[\"up\"] !== null && cont[\"up\"] !== undefined) {\n      cont.up(shiftKey);\n    }\n  };\n\n  self.masterDownKey = function (e, shiftKey) {\n    var cont = self.findActiveSection(e, shiftKey);\n\n    if (cont[\"down\"] !== null && cont[\"down\"] !== undefined) {\n      cont.down(shiftKey);\n    }\n  };\n\n  self.masterRightKey = function (e, shiftKey) {\n    var cont = self.findActiveSection(e, shiftKey);\n\n    if (cont[\"right\"] !== null && cont[\"right\"] !== undefined) {\n      return cont.right(shiftKey);\n    }\n\n    return true;\n  };\n\n  self.masterLeftKey = function (e, shiftKey) {\n    var cont = self.findActiveSection(e, shiftKey);\n\n    if (cont[\"left\"] !== null && cont[\"left\"] !== undefined) {\n      return cont.left(shiftKey);\n    }\n\n    return true;\n  };\n\n  self.findActiveSection = function () {\n    var tables = $(\".ko-tbl:visible\");\n    var openModal = $(\".modal.in\");\n\n    if (openModal.length) {\n      tables = openModal.find(\".ko-tbl:visible\");\n    }\n\n    var viewModel, master, detail;\n\n    switch (tables.length) {\n      case 1:\n        return ko.contextFor(tables[0]).$data;\n\n      case 2:\n        if ($(\"#Tree-t\").hasClass(\"active\")) {\n          for (var b = 0; b < tables.length; b++) {\n            if ($(tables[b]).hasClass(\"tree-tbl\")) return ko.contextFor(tables[b]).$data;\n          }\n        } else {\n          for (var j = 0; j < tables.length; j++) {\n            if ($(tables[j]).hasClass(\"ko-tbl-master\") && !activeSection || activeSection === \"master\") {\n              return ko.contextFor(tables[j]).$data;\n            }\n\n            if ($(tables[j]).hasClass(\"ko-tbl-child\") && window.activeSection && window.activeSection === \"detail\") {\n              return ko.contextFor(tables[j]).$data;\n            }\n\n            if ($(tables[j]).hasClass(\"ko-tbl-dyninfo\")) return ko.contextFor(tables[j]).$data;\n          }\n        }\n\n        break;\n\n      case 3:\n        if ($(\"#Period-t\").hasClass(\"active\") || $(\"#Tree-t\").hasClass(\"active\")) {\n          for (var i = 0; i < tables.length; i++) {\n            if ($(tables[i]).hasClass(\"period-tbl\") || $(tables[i]).hasClass(\"tree-tbl\")) return ko.contextFor(tables[i]).$data;\n          }\n        }\n\n        break;\n\n      case 4:\n        break;\n    }\n  };\n}\n$(document).on(\"click\", \".master-section\", function (evt) {\n  activeSection = \"master\";\n  evt.preventDefault();\n});\n$(document).on(\"click\", \".detail-section\", function (evt) {\n  activeSection = \"detail\";\n  evt.preventDefault();\n});\nvar pressed = false;\n$(document).on(\"keydown\", function (evt) {\n  if (anyOpenModal || focusSearchInput || resDomain === \"TableTemplate\" && resSecondDomain === \"editor\" || $(evt.target).hasClass(\"key-on\") || resSecondDomain === 'pageeditor') return true;\n  if ($(evt.target).parent() && $(evt.target).parent().hasClass(\"selectize-input\")) return true;\n  var res;\n\n  var context = _h.kocnx();\n\n  switch (evt.keyCode) {\n    case 37:\n      res = context.keysHandler().masterLeftKey(evt, evt.shiftKey);\n      return res;\n\n    case 38:\n      res = context.keysHandler().masterUpKey(evt, evt.shiftKey);\n      return res;\n\n    case 39:\n      res = context.keysHandler().masterRightKey(evt, evt.shiftKey);\n      return res;\n\n    case 40:\n      res = context.keysHandler().masterDownKey(evt, evt.shiftKey);\n      return res;\n\n    case 67:\n      pressed = true;\n\n      if (evt.ctrlKey) {\n        if ($(\"#TableTemplate-t\").hasClass(\"active\")) context.ttvm().copyClipboard();else return true;\n      } else {\n        return true;\n      }\n\n      break;\n\n    case 68:\n      if (evt.shiftKey) context.keysHandler().masterDeleteBtn();\n      break;\n\n    case 69:\n      if (evt.shiftKey) context.keysHandler().masterEditBtn();\n      break;\n\n    case 78:\n      if (evt.shiftKey) context.keysHandler().masterCreateBtn();\n      break;\n\n    case 82:\n      if (evt.shiftKey) context.keysHandler().masterRefreshBtn();\n      break;\n\n    case 186:\n      if (evt.shiftKey && evt.ctrlKey) context.securityConfigBtn();\n      break;\n  }\n\n  evt.stopPropagation();\n  evt.preventDefault();\n});\n$(document).on(\"keyup\", function (evt) {\n  if (evt.which === 67) {\n    // e\n    pressed = false;\n  }\n});\n$(document).on(\"click\", \".ko-tbl, #br_Table\", function (evt) {\n  if (evt.ctrlKey && pressed) {\n    evt.preventDefault();\n    var target = evt.target;\n    var oldColor = evt.target.style.color;\n    evt.target.style.color = \"red\";\n    var temp = \"\";\n    if ($(target).hasClass(\"table-node-code\")) temp = target.innerText.replace(\"(\", \"\").replace(\")\", \"\");else temp = target.innerText;\n\n    if (window.navigator.clipboard) {\n      window.navigator.clipboard.writeText(temp);\n    } else {\n      var $temp = $(\"<input>\");\n      $(\"body\").append($temp);\n      if ($(target).hasClass(\"table-node-code\")) $temp.val(target.innerText.replace(\"(\", \"\").replace(\")\", \"\")).select();else $temp.val(target.innerText).select();\n      document.execCommand(\"copy\");\n    }\n\n    setTimeout(function () {\n      evt.target.style.color = oldColor;\n    }, 350);\n  }\n});\n$(document).on(\"dblclick\", \".ko-tbl tr\", function (evt) {\n  if (!$(evt.currentTarget).hasClass(\"row-group\")) _h.kocnx().keysHandler().masterEditBtn();\n});\n\n//# sourceURL=webpack://domino/./src/scripts/util/keyboardHandler.js?");

/***/ }),

/***/ "./src/scripts/util/pasteDataFormatter.js":
/*!************************************************!*\
  !*** ./src/scripts/util/pasteDataFormatter.js ***!
  \************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nmodule.exports = function () {\n  var getMicrosoftWordData = function getMicrosoftWordData(html) {\n    var tag = document.createElement(\"div\");\n    tag = $(tag);\n    tag.html(html);\n    var content = tag.html();\n    content = content.replace(/<!--[\\s\\S]+?-->/gi, '');\n    content = content.replace(/<(!|script[^>]*>.*?<\\/script(?=[>\\s])|\\/?(\\?xml(:\\w+)?|img|meta|link|style|\\w:\\w+)(?=[\\s\\/>]))[^>]*>/gi, '');\n    content = content.replace(/<(\\/?)s>/gi, \"<$1strike>\");\n    content = content.replace(/&nbsp;/gi, ' ');\n    content = content.replace(/<span\\s+style\\s*=\\s*\"\\s*mso-spacerun\\s*:\\s*yes\\s*;?\\s*\"\\s*>([\\s\\u00a0]*)<\\/span>/gi, function (str, spaces) {\n      return spaces.length > 0 ? spaces.replace(/./, \" \").slice(Math.floor(spaces.length / 2)).split(\"\").join(\"\\xA0\") : '';\n    });\n    tag.html(content);\n    turnTags(tag, true);\n    $('p', tag).each(function () {\n      var str = $(this).attr('style');\n      var matches = /mso-list:\\w+ \\w+([0-9]+)/.exec(str);\n\n      if (matches) {\n        $(this).data('_listLevel', parseInt(matches[1], 10));\n      }\n    });\n    var lastLevel = 0;\n    var pnt = null;\n    $('p', tag).each(function () {\n      var curLevel = $(this).data('_listLevel');\n\n      if (curLevel != undefined) {\n        var txt = $(this).text();\n        var listTag = '<ul></ul>';\n\n        if (/^\\s*\\w+\\./.test(txt)) {\n          var matches = /([0-9])\\./.exec(txt);\n\n          if (matches) {\n            var start = parseInt(matches[1], 10);\n            listTag = start > 1 ? '<ol start=\"' + start + '\"></ol>' : '<ol></ol>';\n          } else {\n            listTag = '<ol></ol>';\n          }\n        }\n\n        if (curLevel > lastLevel) {\n          if (lastLevel == 0) {\n            $(this).before(listTag);\n            pnt = $(this).prev();\n          } else {\n            pnt = $(listTag).appendTo(pnt);\n          }\n        }\n\n        if (curLevel < lastLevel) {\n          for (var i = 0; i < lastLevel - curLevel; i++) {\n            pnt = pnt.parent();\n          }\n        }\n\n        $('span:first', this).remove();\n        pnt.append('<li>' + $(this).html() + '</li>');\n        $(this).remove();\n        lastLevel = curLevel;\n      } else {\n        lastLevel = 0;\n      }\n    });\n    $('span:empty', tag).remove();\n    $('[style]', tag).removeAttr('style');\n    $('[align]', tag).removeAttr('align');\n    $('[dir]', tag).removeAttr('dir');\n    $('span', tag).replaceWith(function () {\n      return $(this).contents();\n    });\n    $('input', tag).remove();\n    $('button', tag).remove();\n    $('label', tag).remove();\n    $('a', tag).remove();\n    $(\"[class^='Mso']\", tag).removeAttr('class');\n    $('p:empty', tag).remove();\n    var outHtml = tag.html().trim().replace(/\\u200C/g, ' ').replace(/\\&zwnj;/g, ' ');\n    return outHtml;\n  };\n\n  var getHtmlData = function getHtmlData(html) {\n    var tag = document.createElement(\"div\");\n    tag = $(tag);\n    tag.html(html);\n    var content = tag.html();\n    content = content.replace(/<!--[\\s\\S]+?-->/gi, '');\n    content = content.replace(/<(!|script[^>]*>.*?<\\/script(?=[>\\s])|\\/?(\\?xml(:\\w+)?|meta|link|style|\\w:\\w+)(?=[\\s\\/>]))[^>]*>/gi, '');\n    content = content.replace(/<(\\/?)s>/gi, \"<$1strike>\");\n    content = content.replace(/&nbsp;/gi, ' ');\n    content = content.replace(/<span\\s+style\\s*=\\s*\"\\s*mso-spacerun\\s*:\\s*yes\\s*;?\\s*\"\\s*>([\\s\\u00a0]*)<\\/span>/gi, function (str, spaces) {\n      return spaces.length > 0 ? spaces.replace(/./, \" \").slice(Math.floor(spaces.length / 2)).split(\"\").join(\"\\xA0\") : '';\n    });\n    tag.html(content);\n    turnTags(tag, true);\n    $('span:empty', tag).remove();\n    $('[style]', tag).removeAttr('style');\n    $('[align]', tag).removeAttr('align');\n    $('[dir]', tag).removeAttr('dir');\n    $('[class]', tag).removeAttr('class');\n    $('span', tag).replaceWith(function () {\n      return $(this).contents();\n    });\n    $('p:empty', tag).remove();\n    $('input', tag).remove();\n    $('button', tag).remove();\n    $('label', tag).remove();\n    $('a', tag).remove();\n    $('img', tag).addClass(\"mimage\");\n    var outHtml = tag.html().trim().replace(/\\u200C/g, ' ').replace(/\\&zwnj;/g, ' ');\n    return outHtml;\n  };\n\n  var turnTags = function turnTags(oldTag, first) {\n    var tagChildren = $(oldTag).children();\n    $.each(tagChildren, function () {\n      var tableLines = [];\n      var tag = $(this);\n      var replaceTag;\n\n      if (tag.length) {\n        switch (tag[0].nodeName.toLowerCase()) {\n          case \"u\":\n            replaceTag = \"<span style='text-decoration-line: underline;'>\" + tag.text() + \"</span>\";\n            tag.replaceWith(replaceTag);\n            break;\n\n          case \"i\":\n            replaceTag = \"<span style='font-style: italic;'>\" + tag.text() + \"</span>\";\n            tag.replaceWith(replaceTag);\n            break;\n\n          case \"p\":\n            if (!first) {\n              replaceTag = \"<span>\" + tag.text() + \"</span>\";\n              tag.replaceWith(replaceTag);\n            }\n\n            break;\n\n          case \"b\":\n          case \"strong\":\n            replaceTag = \"<span style='font-weight: bold;'>\" + tag.text() + \"</span>\";\n            tag.replaceWith(replaceTag);\n            break;\n\n          case \"img\":\n            tag.css({\n              \"max-width\": \"100%\",\n              \"max-height\": \"100%\"\n            });\n            break;\n\n          case \"table\":\n            var trList = tag.find('tbody tr');\n\n            if (trList.length) {\n              $.each(trList, function () {\n                var tr = $(this);\n                var newTag;\n                if (first) newTag = \"<p>\" + tr.text().trim() + \"</p>\";else newTag = \"<span>\" + tr.text().trim() + \"</span><br>\";\n                tableLines.push(newTag);\n              });\n              tag.replaceWith(tableLines);\n            } else {\n              tag.replaceWith(\"<span></span>\");\n            }\n\n            break;\n        }\n\n        if (tag.children().length) turnTags(tag, false);\n      }\n    });\n  };\n\n  var textToJson = function textToJson(pastedInput) {\n    var rawRows = pastedInput.split(\"\\n\");\n    var output = [];\n    rawRows.forEach(function (rawRow, idx) {\n      var values = rawRow.split(\"\\t\");\n      if (values && values.length) for (var i = 0; i < values.length; i++) {\n        output.push(trimText(values[i]));\n      }\n    });\n    return output;\n  };\n\n  var trimText = function trimText(val) {\n    try {\n      return val.trim();\n    } catch (e) {\n      return \"\";\n    }\n  };\n\n  return {\n    textToJson: textToJson,\n    getMicrosoftWordData: getMicrosoftWordData,\n    getHtmlData: getHtmlData\n  };\n}();\n\n//# sourceURL=webpack://domino/./src/scripts/util/pasteDataFormatter.js?");

/***/ }),

/***/ "./src/scripts/util/toast.js":
/*!***********************************!*\
  !*** ./src/scripts/util/toast.js ***!
  \***********************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n__webpack_require__(/*! ../vendors/toastr.js */ \"./src/scripts/vendors/toastr.js\");\n\nvar toastr = __webpack_require__(/*! ../vendors/toastr.js */ \"./src/scripts/vendors/toastr.js\");\n\nmodule.exports = function () {\n  var messagePatterns = {\n    getList: {\n      error: 'دریافت اطلاعات فهرست __ با خطا مواجه شده است'\n    },\n    getSelectList: {\n      error: 'دریافت اطلاعات فهرست انتخاب __ با خطا مواجه شده است'\n    },\n    get: {\n      error: 'دریافت اطلاعات __ با خطا مواجه شده است'\n    },\n    post: {\n      success: 'عملیات ثبت __ جدید با موفقیت انجام شد',\n      error: 'عملیات ثبت __ جدید با خطا متوقف شد'\n    },\n    postUpdate: {\n      success: 'عملیات ثبت __  با موفقیت انجام شد',\n      error: 'عملیات ثبت __  با خطا متوقف شد'\n    },\n    putUpdate: {\n      success: 'عملیات بروزرسانی __  با موفقیت انجام شد',\n      error: 'عملیات بروزرسانی __  با خطا متوقف شد'\n    },\n    custom: {\n      success: 'عملیات  __  با موفقیت انجام شد',\n      error: 'عملیات  __  با خطا متوقف شد'\n    },\n    put: {\n      success: 'عملیات ویرایش __ با موفقیت انجام شد',\n      error: 'عملیات ویرایش __ با خطا متوقف شد'\n    },\n    del: {\n      confirm: 'آیا از حذف رکورد __ اطمینان دارید؟',\n      success: 'عملیات حذف __ با موفقیت انجام شد',\n      error: 'عملیات حذف __ با خطا متوقف شد'\n    },\n    delrange: {\n      confirm: 'آیا از حذف  __ اطمینان دارید؟',\n      success: 'عملیات حذف __ با موفقیت انجام شد',\n      error: 'عملیات حذف __ با خطا متوقف شد'\n    },\n    cond: {\n      confirm: 'آیا از  __ اطمینان دارید؟'\n    },\n    validation: {\n      error: '{propertyName} باید منحصر به فرد باشد'\n    }\n  };\n  var entities = {\n    User: {\n      plural: 'کاربران',\n      singular: 'کاربر',\n      UserAccess: 'سمت کاربر',\n      UserAccessList: 'سمت های کاربر',\n      AccessList: 'سمت ها',\n      CompanyList: 'گروه و شرکت',\n      ResetPassword: 'رمز عبور کاربر',\n      StateType: 'وضعیت کاربر',\n      StateFalse: 'غیرفعال کردن کاربر',\n      StateTrue: 'فعال کردن کاربر',\n      UnlockUser: 'فعالسازی حساب کاربری'\n    },\n    Company: {\n      plural: 'گروه/شرکت',\n      singular: 'گروه/شرکت',\n      StateType: 'وضعیت گروه/شرکت',\n      UserState: 'وضعیت کاربر گروه/شرکت',\n      StateFalse: 'غیرفعال کردن گروه/شرکت',\n      StateTrue: 'فعال کردن گروه/شرکت',\n      GroupCompanies: 'شرکت های تابعه'\n    },\n    ActionLog: {\n      plural: 'فعالیت های کاربران',\n      singular: 'گزارشات فعالیت کاربر'\n    },\n    Access: {\n      plural: 'دسترسی ها',\n      singular: 'دسترسی',\n      PermissionList: 'مجوز ها'\n    },\n    Period: {\n      plural: 'دوره های مالی',\n      singular: 'دوره مالی',\n      PeriodSummary: 'حذف دوره  مالی',\n      CopyDependencies: 'کپی دوره مالی',\n      PeriodArchive: 'وضعیت بایگانی دوره مالی',\n      CopyPeriod: 'کپی دوره مالی و ضمایم منتخب آن',\n      Comparatives: 'تنظیم مقایسه ای دوره ها',\n      PeriodClosed: 'وضعیت دوره مالی',\n      StateType: 'وضعیت فعالیت دوره مالی',\n      StateFalse: 'غیرفعال کردن دوره مالی',\n      StateTrue: 'فعال کردن دوره مالی',\n      SavedMagazines: 'مجله های ذخیره شده',\n      SubmitState: 'وضعیت ارسال دوره مالی'\n    },\n    AdjustmentDocument: {\n      plural: 'اسناد اصلاحی و طبقه بندی',\n      singular: 'سند اصلاحی و طبقه بندی',\n      Pdf: 'تولید فایل Pdf',\n      ConfirmationType: 'تایید سند اصلاحی و طبقه بندی',\n      ConfirmationTypes: 'تایید اسناد اصلاحی و طبقه بندی',\n      StateType: 'وضعیت سند اصلاحی و طبقه بندی',\n      StateTypes: 'وضعیت اسناد اصلاحی و طبقه بندی',\n      ConfirmTypes: 'تایید __ سند اصلاحی و طبقه بندی',\n      UnConfirmType: 'عدم تایید سند اصلاحی و طبقه بندی',\n      UnConfirmTypes: 'عدم تایید اسناد اصلاحی و طبقه بندی',\n      Lastpriority: 'آخرین شماره اولویت سند اصلاحی و طبقه بندی',\n      StateFalse: 'غیرفعال کردن سند اصلاحی و طبقه بندی',\n      StateTrue: 'فعال کردن سند اصلاحی و طبقه بندی',\n      Copy: 'کپی سند اصلاحی و طبقه بندی',\n      Copies: 'کپی اسناد اصلاحی و طبقه بندی',\n      ChangeOrder: 'اولویت سند اصلاحی و طبقه بندی'\n    },\n    AdjustmentDocumentItem: {\n      plural: 'بند سند اصلاحی و طبقه بندی',\n      singular: 'بند سند اصلاحی و طبقه بندی',\n      ChangeOrder: 'اولویت بند سند اصلاحی و طبقه بندی',\n      StateFalse: 'غیرفعال کردن بند سند اصلاحی و طبقه بندی',\n      StateTrue: 'فعال کردن بند سند اصلاحی و طبقه بندی',\n      StateType: 'وضعیت بند سند اصلاحی و طبقه بندی',\n      StateTypes: 'وضعیت بند های سند اصلاحی و طبقه بندی'\n    },\n    Tree: {\n      plural: 'درختواره ها',\n      singular: 'درختواره',\n      Fiscal: 'درخت های مالی',\n      ImportExcel: 'ورود داده های درختواره',\n      NodeDelete: 'حذف گره درختواره',\n      NodesDelete: 'حذف گره های درختواره',\n      ToBranch: 'تبدیل برگ به شاخه',\n      ToLeaf: 'تبدیل شاخه به برگ',\n      Copy: 'کپی گره های درختواره',\n      Cut: 'انتقال گره های درختواره',\n      UpdateNode: 'ویرایش گره های درختواره',\n      AcceptAllSyncTree: 'بروزرسانی درختواره',\n      RejectAllSyncTree: 'لغو بروزرسانی درختواره',\n      AcceptListSyncTree: 'اعمال گره های انتخاب شده',\n      RejectListSyncTree: 'لغو گره های انتخاب شده',\n      ResetConsolidationBranch: 'بازگشت به تنظیمات اولیه شاخه',\n      ResetConsolidationTree: 'بازگشت به تنظیمات اولیه درختواره',\n      SaveSettingNode: 'ذخیره تنظیمات درختواره'\n    },\n    GroupPeriod: {\n      plural: ' صورت های مالی شرکت های تابعه',\n      singular: 'صورت های مالی شرکت های تابعه',\n      PeriodDetail: 'گزارشات همراه دوره مالی',\n      SubmitState: 'وضعیت ارسال دوره مالی شرکت تابعه'\n    },\n    TableTemplate: {\n      plural: 'قالب های جدول',\n      singular: 'قالب جدول',\n      Copy: 'کپی قالب جدول',\n      Preview: 'پیش نمایش قالب جدول',\n      Excel: 'تولید فایل اکسل قالب جدول',\n      Priority: 'جابه جایی اولویت قالب های جدول',\n      ImportBackUp: 'بارگذاری قالب های جدول',\n      ExportFile: 'تولید فایل پشتیبان',\n      ChangeOrder: 'اولویت قالب جدول',\n      PreviewDefault: 'تنظیمات پیش نمایش'\n    },\n    Consolidate: {\n      plural: 'شرکت های مشمول تلفیق',\n      singular: 'شرکت مشمول تلفیق',\n      SelectivePeriods: 'ویرایش شرکت های مشمول تلفیق',\n      PostConsolidate: 'تغییرات شرکت های مشمول تلفیق',\n      Ownership: 'تعیین درصد مالکیت مستقیم'\n    },\n    Balancesheet: {\n      plural: ' فایل های تراز',\n      singular: ' فایل تراز',\n      Excel: 'تولید خروچی فایل اکسل'\n    },\n    DynamicTable: {\n      plural: 'جدول های داده',\n      singular: 'جدول داده',\n      LastPriority: 'آخرین شماره اولویت جدول داده',\n      ChangeOrder: 'تغییر اولویت جدول داده',\n      ImportExcel: 'بارگذاری شمای جدول',\n      Archive: 'بایگانی جدول داده',\n      UnArchive: 'لغو بایگانی جدول داده',\n      Archives: 'بایگانی جدول های داده',\n      UnArchives: 'لغو بایگانی جدول های داده',\n      Copy: 'کپی شمای جدول'\n    },\n    DynamicTableData: {\n      plural: 'داده های جدول',\n      singular: 'داده جدول',\n      ExportExcel: 'دریافت فایل خروجی داده های جدول',\n      ImportExcel: 'بارگذاری داده جدول از اکسل',\n      StateType: 'وضعیت داده جدول',\n      StateTypes: 'وضعیت داده های جدول'\n    },\n    DynamicDocument: {\n      plural: 'روال های محاسبه',\n      singular: 'روال محاسبه',\n      TableList: 'چدول های داده',\n      LastCode: 'اولیه روال محاسبه',\n      StateType: 'وضعیت روال محاسبه',\n      StateTypes: 'وضعیت روال های محاسبه',\n      CalculateDocument: 'اجرای روال',\n      CalculateDocuments: 'اجرای روال ها',\n      Copy: 'کپی روال محاسبه',\n      Copies: 'کپی روال های محاسبه',\n      StopCalculateDocuments: 'لغو محاسبه روال ها',\n      DeleteCalculateDocument: 'حذف اثر اجرای روال',\n      DeleteCalculateDocuments: 'حذف اثر اجرای روال ها',\n      StateFalse: 'غیرفعال کردن روال محاسبه',\n      StateTrue: 'فعال کردن روال محاسبه'\n    },\n    SourceTableData: {\n      plural: 'جدول تراز مبدا',\n      singular: 'جدول تراز مبدا'\n    },\n    ExpenseCenterTableData: {\n      plural: 'جدول',\n      singular: 'جدول'\n    },\n    TableStructure: {\n      plural: '',\n      singular: '',\n      Consolidated: 'گروه/ شرکتهای تابعه'\n    },\n    ReportGenerator: {\n      plural: '',\n      singular: 'استایل سفارشی',\n      CustomStyle: 'استایل سفارشی'\n    },\n    TotalBalanceReportData: {\n      plural: 'ستون مانده نهایی',\n      singular: ''\n    },\n    BalancesheetContent: {\n      plural: 'محتوای فایل تراز',\n      singular: ''\n    },\n    MapData: {\n      plural: 'محتوای فایل تراز',\n      singular: '',\n      SelectCollection: \"فهرست انتخاب گروهی\"\n    },\n    BalanceReport: {\n      plural: 'گزارش تراز حساب ها/کاربرگ 6020',\n      singular: ''\n    },\n    Magazine: {\n      plural: 'مجله ها',\n      singular: 'مجله'\n    },\n    NodeValuePart: {\n      plural: 'مقادیر گره متناظر در شرکت های مشمول',\n      singular: ''\n    },\n    TableTemplateSelect: {\n      plural: 'قالب های جدول',\n      singular: 'قالب جدول'\n    },\n    Connection: {\n      plural: 'ارتباط دریافت داده',\n      singular: 'ارتباط دریافت داده',\n      CompleteRun: 'نتایج'\n    },\n    Folder: {\n      plural: 'پوشه ها',\n      singular: 'پوشه'\n    },\n    SubstituteNode: {\n      plural: 'حساب های متقابل',\n      singular: 'حساب متقابل'\n    },\n    MappingRule: {\n      plural: 'الگوهای نگاشت',\n      singular: 'الگوی نگاشت',\n      applyMappingRule: 'اجرای الگوی نگاشت',\n      applyMappingRules: 'اجرای الگوهای نگاشت',\n      cancelMappingRule: 'لغوالگوی نگاشت',\n      cancelMappingRules: 'لغو الگوهای نگاشت',\n      ChangeOrder: 'اولویت الگوی نگاشت'\n    },\n    MappingRuleData: {\n      plural: 'نتایج الگوهای نگاشت',\n      singular: 'نتایج الگوی نگاشت'\n    },\n    MappingSrc: {\n      plural: '',\n      singular: '',\n      applyAutoMapping: 'نگاشت اتوماتیک'\n    },\n    CompanyDyanamic: {\n      plural: '',\n      singular: 'طراحی گزارش'\n    },\n    CompanyInfo: {\n      plural: '',\n      singular: 'گزارش'\n    },\n    CustomStyle: {\n      plural: '',\n      singular: 'استایل'\n    },\n    XbrlConcept: {\n      plural: '',\n      singular: 'گزارش XBRL'\n    },\n    CompanyInfoData: {\n      plural: '',\n      singular: 'اطلاعات گزارش'\n    }\n  };\n\n  var getPattern = function getPattern(key, type) {\n    var ar = messagePatterns[key];\n    return ar[type];\n  };\n\n  var getEntitiesValue = function getEntitiesValue(entityName, actionType, key) {\n    var entity = entities[entityName];\n\n    if (key === null || key === undefined) {\n      if (actionType === \"put\" || actionType === \"post\" || actionType === \"del\" || actionType === \"get\") return entity[\"singular\"];\n      if (actionType === \"getList\" || actionType === \"getSelectList\" || actionType === \"delrange\") return entity[\"plural\"];\n    } else return entity[key];\n  };\n\n  var createMessage = function createMessage(entityName, actionType, key, messageType) {\n    var pat = getPattern(actionType, messageType);\n    var enKey = getEntitiesValue(entityName, actionType, key);\n    return pat.replace(\"__\", enKey);\n  };\n\n  var createVMessage = function createVMessage(param) {\n    var pat = messagePatterns[\"validation\"].error;\n\n    var propVal = _h.getLocalizedText(param[2]);\n\n    pat = pat.replace(\"{propertyName}\", propVal); // var placeHolder = \"\";\n    // if (param.length > 3) \n    //     placeHolder = _h.getLocalizedText(param[3]);\n    // pat = pat.replace(\"{PlaceHolder}\", placeHolder);\n\n    return pat;\n  };\n\n  var getToaster = function getToaster(type) {\n    switch (type) {\n      case \"error\":\n        toastr.options = {\n          \"newestOnTop\": false,\n          \"positionClass\": \"toast-top-left\",\n          \"closeButton\": false,\n          \"toastClass\": \"animated fadeInDown\"\n        };\n        break;\n\n      case \"success\":\n        toastr.options = {\n          \"newestOnTop\": false,\n          \"positionClass\": \"toast-bottom-left\",\n          \"closeButton\": false,\n          \"toastClass\": \"animated fadeInDown\"\n        };\n        break;\n\n      case \"warning\":\n        toastr.options = {\n          \"newestOnTop\": false,\n          \"positionClass\": \"toast-bottom-left\",\n          \"closeButton\": false,\n          \"toastClass\": \"animated fadeInDown\"\n        };\n        break;\n    }\n\n    toastr.options.rtl = true;\n    return toastr;\n  };\n\n  var warning = function warning(name, actionType, key) {\n    var message = createMessage(name, actionType, key, \"warning\");\n    getToaster(\"warning\").warning(message);\n  };\n\n  var success = function success(name, actionType, key) {\n    var message = createMessage(name, actionType, key, \"success\");\n    getToaster(\"success\").success(message);\n  };\n\n  var error = function error(name, actionType, key) {\n    var message = createMessage(name, actionType, key, \"error\");\n    getToaster(\"error\").error(message);\n  };\n\n  var custom = function custom(type, message) {\n    switch (type) {\n      case \"success\":\n        getToaster(type).success(message);\n        break;\n\n      case \"error\":\n        getToaster(type).error(message);\n        break;\n\n      case \"warning\":\n        getToaster(type).warning(message);\n        break;\n    }\n  };\n\n  return {\n    getEntitiesValue: getEntitiesValue,\n    createMessage: createMessage,\n    createVMessage: createVMessage,\n    warning: warning,\n    success: success,\n    error: error,\n    custom: custom\n  };\n}();\n\n//# sourceURL=webpack://domino/./src/scripts/util/toast.js?");

/***/ }),

/***/ "./src/scripts/util/validationRules.js":
/*!*********************************************!*\
  !*** ./src/scripts/util/validationRules.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _apiService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./apiService.js */ \"./src/scripts/util/apiService.js\");\n/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\n/* provided dependency */ var dateHelper = __webpack_require__(/*! ./src/scripts/util/dateHelper.js */ \"./src/scripts/util/dateHelper.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var toast = __webpack_require__(/*! ./src/scripts/util/toast.js */ \"./src/scripts/util/toast.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n\n\n\nfunction stringIsEnglish(str) {\n  var index;\n  var english = \" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~!@#$%^&*()_+-.<>?|\\\\/\";\n\n  for (index = str.length - 1; index >= 0; --index) {\n    if (english.indexOf(str.substring(index, index + 1)) < 0) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\nfunction IsUserNameValid(str) {\n  var index;\n  str = str.replace(/\\u200C/g, ' ').replace(/\\&zwnj;/g, ' ');\n  var english = \" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.\";\n\n  for (index = str.length - 1; index >= 0; --index) {\n    if (english.indexOf(str.substring(index, index + 1)) < 0) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\nfunction isValidIP(ipAddress) {\n  var maskbit = 0;\n\n  if (ipAddress.indexOf(\"/\") !== -1) {\n    var index = ipAddress.indexOf(\"/\");\n    var maskPart = ipAddress.substring(index);\n    maskbit = parseInt(maskPart.replace(\"/\", \"\"));\n    ipAddress = ipAddress.replace(maskPart, \"\");\n    if (isNaN(maskbit)) return false;\n    if (maskbit < 0 || maskbit > 32) return false;\n  }\n\n  var ipParts = ipAddress.split('.');\n  if (ipParts.length !== 4) return false;\n\n  for (var i = 0; i < 4; i++) {\n    var ipPart = parseInt(ipParts[i]);\n    if (isNaN(ipPart)) return false;\n    if (ipPart < 0 || ipPart > 255) return false;\n  }\n\n  return true;\n}\n\nko.validation.rules['IsValidIpAddress'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(val) {\n    var value = this.getValue(val);\n    if (!value) return false;\n    var res = isValidIP(value);\n    return res;\n  },\n  message: function message(params, observable, hg) {\n    return 'فرمت آدرس IP صحیح نیست';\n  }\n};\nko.validation.rules['checkImage'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(file, otherField, callback) {\n    if (file === undefined || file === null) return true;\n\n    var ext = _h.getExtension(otherField.params[0]());\n\n    if ((file.indexOf(\"png\") !== -1 || file.indexOf(\"jpg\") !== -1 || file.indexOf(\"jpeg\") !== -1) && (ext.indexOf(\"png\") !== -1 || ext.indexOf(\"jpg\") !== -1 || ext.indexOf(\"jpeg\") !== -1)) return true;\n    return false;\n  },\n  message: 'تصویر لوگو باید حداکثر 120 پیکسل و با یکی از فرمت های \"png\", \"jpg\" باشد'\n};\nko.validation.rules['checkExcel'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(file, otherField, callback) {\n    if (file === undefined || file === null) return true;\n\n    var ext = _h.getExtension(otherField.params[0]());\n\n    if ((file.indexOf(\"officedocument\") !== -1 || file.indexOf(\"ms-excel\") !== -1) && (ext.indexOf(\"csv\") !== -1 || ext.indexOf(\"xls\") !== -1 || ext.indexOf(\"xlsx\") !== -1)) return true;\n    return false;\n  },\n  message: 'فقط بارگزاری فایل با فرمت های \"csv\", \"xls\", \"xlsx\" امکان پذیر است'\n};\nko.validation.rules['checkOnlyExcel'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(file, otherField, callback) {\n    if (file === undefined || file === null) return true;\n\n    var ext = _h.getExtension(otherField.params[0]());\n\n    if ((file.indexOf(\"officedocument\") !== -1 || file.indexOf(\"ms-excel\") !== -1) && (ext.indexOf(\"xls\") !== -1 || ext.indexOf(\"xlsx\") !== -1)) return true;\n    return false;\n  },\n  message: 'فقط بارگزاری فایل با فرمت های \"csv\", \"xls\", \"xlsx\" امکان پذیر است'\n};\nko.validation.rules['checkBackupFile'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(file, otherField, callback) {\n    if (file === undefined || file === null) return true;\n    var value = this.getValue(otherField.params);\n    if (value === null || value === undefined) value = 0;\n\n    var ext = _h.getExtension(value);\n\n    if (ext.indexOf(\"dbuf\") !== -1) return true;\n    return false;\n  },\n  message: 'فقط بارگذاری فایل با فرمت  \"dbuf\" امکان پذیر است'\n};\nko.validation.rules['confirmPassword'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(val, otherField) {\n    var value2 = this.getValue(otherField.params);\n    if (value2 === val) return true;else return false;\n  },\n  message: 'مقدار رمز عبور و تایید باید یکسان باشد'\n};\nko.validation.rules['passwordComplexity'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(val, otherField) {\n    var arr = this.getValue(otherField);\n    var rx = /(?=^[^\\s]{4,20}$)((?=.*?\\d)(?=.*?[A-Z])(?=.*?[a-z])|(?=.*?\\d)(?=.*?[^\\w\\d\\s])(?=.*?[a-z])|(?=.*?[^\\w\\d\\s])(?=.*?[A-Z])(?=.*?[a-z])|(?=.*?\\d)(?=.*?[A-Z])(?=.*?[^\\w\\d\\s]))^.*/;\n    return _h.hasSpecialChar(val) && rx.test('' + val) && val.length >= arr[0];\n  },\n  message: function message(params, observable, hg) {\n    var min = params[0];\n    return \"\\u0631\\u0645\\u0632 \\u0639\\u0628\\u0648\\u0631 \\u0628\\u0627\\u06CC\\u062F \\u062D\\u062F\\u0627\\u0642\\u0644  \".concat(min, \" \\u06A9\\u0627\\u0631\\u0627\\u06A9\\u062A\\u0631 \\u060C \\u062D\\u062F\\u0627\\u06A9\\u062B\\u0631 20 \\u06A9\\u0627\\u0631\\u0627\\u06A9\\u062A\\u0631 \\u0648 \\u0634\\u0627\\u0645\\u0644 \\u062D\\u0631\\u0648\\u0641\\u060C \\u0627\\u0639\\u062F\\u0627\\u062F \\u0648 \\u06A9\\u0627\\u0631\\u06A9\\u062A\\u0631\\u0647\\u0627\\u06CC \\u0648\\u06CC\\u0698\\u0647 \\u0628\\u0627\\u0634\\u062F\");\n  }\n};\nko.validation.rules['englishOnly'] = {\n  validator: function validator(val, otherVal) {\n    if (val === null || val === undefined) return true;\n    var res = true;\n    return stringIsEnglish(val);\n  },\n  message: 'لطفا به زبان انگلیسی وارد کنید'\n};\nko.validation.rules['userNameValidation'] = {\n  validator: function validator(val, otherVal) {\n    if (val === null || val === undefined) return true;\n    return IsUserNameValid(val);\n  },\n  message: 'کاراکتر های مجاز شامل حروف فارسی و انگلیسی، اعداد، نقطه و علامت زیر خط (_) میباشند'\n};\nko.validation.rules['persianOnly'] = {\n  validator: function validator(val, otherVal) {\n    if (val === null || val === undefined) return true;\n    var res = true;\n    val = val.replace(/\\u200C/g, ' ').replace(/\\&zwnj;/g, ' ');\n\n    for (var i = 0, len = val.length; i < len; i++) {\n      var target = val[i];\n\n      if (/[^\\u0600-\\u06FF\\s]/g.test(target)) {\n        res = false;\n      }\n    }\n\n    return res;\n  },\n  message: 'لطفا به زبان فارسی وارد کنید'\n};\nko.validation.rules['notOnlyNumberAndSpChr'] = {\n  validator: function validator(val, otherVal) {\n    if (val === null || val === undefined) return true;\n    var hasEngCharacters = false;\n    var hasFaCharacters = false;\n    var hasSpCharacters = false;\n    var hasNumber = false;\n\n    for (var i = 0, len = val.length; i < len; i++) {\n      var target = val[i];\n\n      if (/[\\u0600-\\u06FF]/g.test(target)) {\n        hasFaCharacters = true;\n      }\n\n      if (/[%#@*+?^${}()|[\\]\\\\]/g.test(target)) {\n        hasSpCharacters = true;\n      }\n\n      if (/[a-zA-Z]/g.test(target)) {\n        hasEngCharacters = true;\n      }\n\n      if (/[0-9]/g.test(target)) {\n        hasNumber = true;\n      }\n    }\n\n    if ((hasNumber === true || hasSpCharacters === true) && hasFaCharacters === false && hasEngCharacters === false) return false;\n    return true;\n  },\n  message: 'استفاده از علامت و اعداد به تنهایی مجاز نیست'\n};\nko.validation.rules['notBeginNumberAndSpChr'] = {\n  validator: function validator(val, otherVal) {\n    if (val === null || val === undefined) return true;\n    var hasSpCharacters = false;\n    var hasNumber = false;\n    var target = val[0];\n\n    if (/[%#@*+?^${}()|[\\]\\\\]/g.test(target)) {\n      hasSpCharacters = true;\n    }\n\n    if (/[0-9]/g.test(target)) {\n      hasNumber = true;\n    }\n\n    if (hasNumber === true || hasSpCharacters === true) return false;\n    return true;\n  },\n  message: 'استفاده از علامت و اعداد در ابتدای رشته مجاز نیست'\n};\nko.validation.rules['validCharacterName'] = {\n  validator: function validator(val, otherVal) {\n    if (val === null || val === undefined) return true;\n    var isValidC = true;\n    val = val.replace(/\\u200C/g, ' ').replace(/\\&zwnj;/g, ' ');\n\n    for (var i = 0, len = val.length; i < len; i++) {\n      var target = val[i];\n\n      if (/[^a-zA-Z0-9\\u0600-\\u06FF\\s\\.\\_()-]/g.test(target)) {\n        isValidC = false;\n      }\n    }\n\n    return isValidC;\n  },\n  message: 'کاراکترهای مجاز حروف فارسی،انگلیسی،اعداد،نقطه،خط فاصله،زیر خط و پرانتز می باشد'\n};\nko.validation.rules['persianMobile'] = {\n  validator: function validator(val, otherVal) {\n    var mobileReg = /(0|\\+98)?([ ]|-|[()]){0,2}9[1|2|3|4]([ ]|-|[()]){0,2}(?:[0-9]([ ]|-|[()]){0,2}){8}/ig;\n    if (val !== null && val !== undefined && val !== \"\") return val.match(mobileReg);\n    return true;\n  },\n  message: 'فرمت شماره تلفن همراه صحیح نیست'\n};\nko.validation.rules['numberOnly'] = {\n  validator: function validator(val, otherVal) {\n    if (val !== null && val !== undefined && val !== \"\") {\n      var test = val.toString();\n      var a = parseInt(test);\n      var afterParse = a.toString();\n      if (afterParse.length <= 0) return false;\n      if (afterParse.length === test.length) return true;else {\n        var backZero = _h.countBackNumberZero(test);\n\n        if (test.length - (afterParse.length + backZero) === 0) {\n          return true;\n        } else {\n          return false;\n        }\n      }\n    }\n\n    return true;\n  },\n  message: ' فقط ورود اعداد مجاز است'\n};\nko.validation.rules['phoneNumberCheck'] = {\n  validator: function validator(val, otherVal) {\n    if (val !== null && val !== undefined && val !== \"\") {\n      var res;\n      var test = val.toString();\n      var a = parseInt(test);\n      var afterParse = a.toString();\n      if (afterParse.length <= 0) res = false;\n      if (afterParse.length === test.length) res = true;else {\n        var backZero = _h.countBackNumberZero(test);\n\n        if (test.length - (afterParse.length + backZero) === 0) {\n          res = true;\n        } else {\n          res = false;\n        }\n      }\n      if (res === false || test.length > 15) return false;else {\n        return true;\n      }\n    }\n\n    return true;\n  },\n  message: 'شماره باید حتما عدد و حداکثر 15 کاراکتر باشد'\n};\nko.validation.rules['shamsiYear'] = {\n  validator: function validator(val, otherVal) {\n    if (val === null || val === undefined || val === \"\") return true;\n    var number = Number(val);\n    if (number < 1350 || number > 1450) return false;\n    return true;\n  },\n  message: 'لطفا سال را با قالب معتبر و کامل وارد کنید'\n};\nko.validation.rules['notBeginWithZero'] = {\n  validator: function validator(val, otherVal) {\n    if (val === null || val === undefined || val === \"\") return true;\n    var test = val.toString();\n\n    var backZero = _h.countBackNumberZero(test);\n\n    if (backZero > 0) return false;\n    return true;\n  },\n  message: 'الگوی کد نباید با صفر شروع شود'\n};\nko.validation.rules['atLeastOne'] = {\n  validator: function validator(val, otherField) {\n    return val.length > 0;\n  },\n  message: 'لطفا حداقل یک مجوز برای این سمت انتخاب کنید'\n};\nko.validation.rules['treeFiscalValueValidate'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(val, otherField, validate) {\n    if (val === null || val === undefined || val === \"\") return true;\n\n    if (_h.isNumeric(val)) {\n      if (val.toString().indexOf('.') !== -1) return false;\n      var a = val.toString().length;\n      var isNegative = Number(val) < 0;\n      if (isNegative && a <= 28) return true;\n      if (!isNegative && a <= 29) return true;\n    }\n\n    return false;\n  },\n  message: 'مقدار ارزش گره در درختواره های مالی باید شامل اعداد صحیح و حداکثر 29 رقم باشد'\n};\nko.validation.rules['treeNumeralDecimalValueValidate'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(val, otherField, validate) {\n    if (val === null || val === undefined || val === \"\") return true;\n\n    if (_h.isNumeric(val)) {\n      var a = val.toString().length;\n      var isNegative = Number(val) < 0;\n      if (isNegative && a <= 28) return true;\n      if (!isNegative && a <= 29) return true;\n    }\n\n    return false;\n  },\n  message: 'مقدار ارزش گره در درختواره های عددی فقط باید شامل اعداد صحیح و اعشاری و حداکثر 29 رقم باشد'\n};\nko.validation.rules['treeNumeralValueValidate'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(val, otherField, validate) {\n    if (val === null || val === undefined || val === \"\") return true;\n\n    if (_h.isNumeric(val)) {\n      if (val.toString().indexOf('.') !== -1) return false;\n      var a = val.toString().length;\n      var isNegative = Number(val) < 0;\n      if (isNegative && a <= 28) return true;\n      if (!isNegative && a <= 29) return true;\n    }\n\n    return false;\n  },\n  message: 'مقدار ارزش گره در درختواره های عددی فقط باید شامل اعداد صحیح و حداکثر 29 رقم باشد'\n};\nko.validation.rules['treeNonNumeralValueValidate'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(val, otherField, validate) {\n    if (val === null || val === undefined || val === \"\") return true;\n    if (val.toString().length <= 255) return true;\n    return false;\n  },\n  message: 'مقدار ارزش گره در درختواره های غیر عددی باید حداکثر 255 کاراکتر باشد'\n};\nko.validation.rules['onlyOneYearDef'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(val, otherField, callback) {\n    var b = this.getValue(otherField.params[0]);\n    if (val === null || val === undefined || val === \"\") return true;\n    if (b === null || b === undefined || b === \"\") return true;\n    var date = new Date(val);\n    var date2 = new Date(b);\n    var isleap = dateHelper.isLeapGregorianYear(date.getFullYear());\n    var days = dateHelper.daysBetween(date, date2);\n\n    if (days <= 365 && !isleap || days <= 366 && isleap) {\n      return true;\n    }\n\n    return false;\n  },\n  message: 'فاصله میان تاریخ شروع و پایان دوره نمی تواند بیش از یک سال باشد'\n};\nko.validation.rules['beforeEndDate'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(val, otherField, callback) {\n    var endDate = this.getValue(otherField.params[0]);\n    if (val === null || val === undefined || val === \"\") return true;\n    if (endDate === null || endDate === undefined || endDate === \"\") return true;\n    var date = new Date(val);\n    var date2 = new Date(endDate);\n    var res = dateHelper.compare(date, date2);\n    return res === 2;\n  },\n  message: 'تاریخ شروع دوره مالی نمی تواند بعد از تاریخ پایان دوره باشد'\n};\nko.validation.rules['afterStartDate'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(val, otherField, callback) {\n    var startDate = this.getValue(otherField.params[0]);\n    if (val === null || val === undefined || val === \"\") return true;\n    if (startDate === null || startDate === undefined || startDate === \"\") return true;\n    var date = new Date(startDate);\n    var date2 = new Date(val);\n    var res = dateHelper.compare(date, date2);\n    return res === 2;\n  },\n  message: 'تاریخ پایان دوره مالی نمی تواند قبل از تاریخ شروع دوره باشد'\n};\nko.validation.rules['countValue'] = {\n  validator: function validator(val, otherVal) {\n    if (val === null || val === undefined || val > 0) return true;\n    return false;\n  },\n  message: 'لطفا تعداد را وارد نمایید'\n};\nko.validation.rules['priceValue'] = {\n  validator: function validator(val, otherVal) {\n    if (val === null || val === undefined || val > 0) return true;\n    return false;\n  },\n  message: 'لطفا مبلغ را وارد نمایید'\n};\nko.validation.rules['periodIdValue'] = {\n  validator: function validator(val, otherVal) {\n    if (val > 0) return true;\n    return false;\n  },\n  message: 'لطفا دوره مالی مورد نظر خود را از لیست انتخاب کنید'\n};\nko.validation.rules['atLeastSelectedOneTree'] = {\n  validator: function validator(val, otherField) {\n    if (val.length > 0) {\n      return true;\n    }\n\n    return false;\n  },\n  message: 'انتخاب حداقل یک درختواره الزامی است'\n};\nko.validation.rules['remoteIsPeriodUniqueValidationRule'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  async: true,\n  validator: function validator(val, otherField, callback) {\n    if (!val) return true;\n    var value = this.getValue(otherField.params[0]);\n    if (value === null || value === undefined) value = 0;\n    var periodState = this.getValue(otherField.params[1]);\n\n    if (periodState === null || periodState === undefined) {\n      return false;\n    }\n\n    var auditState = this.getValue(otherField.params[2]);\n\n    if (auditState === null || auditState === undefined) {\n      return false;\n    }\n\n    var startDate = this.getValue(otherField.params[3]);\n\n    if (startDate === null || startDate === undefined) {\n      return false;\n    }\n\n    var periodType = this.getValue(otherField.params[4]);\n\n    if (periodType === null || periodType === undefined) {\n      return false;\n    }\n\n    _apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n      url: \"postIsUnique\",\n      data: {\n        controllerName: 6,\n        inputData: {\n          id: value,\n          endDate: val,\n          periodState: periodState,\n          auditState: auditState,\n          startDate: startDate,\n          periodType: periodType\n        }\n      },\n      success: function success(data) {\n        callback(data);\n      },\n      error: function error(data) {}\n    });\n  },\n  message: 'هم اکنون دوره مالی مشابهی برای این تاریخ ثبت شده است'\n};\nko.validation.rules['remoteIsValidateFormula'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  async: true,\n  validator: function validator(val, otherField, callback) {\n    if (val === null || val === undefined || val === \"\" || val === \"undefined\") return true;\n    var model = {\n      formula: val.toString(),\n      controllerName: otherField\n    };\n\n    if (_typeof(otherField) === 'object' && otherField !== null) {\n      model.controllerName = otherField.params;\n    }\n\n    _apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n      url: \"/api/common/postisValidFormula\",\n      data: model,\n      success: function success(data) {\n        callback(data);\n      },\n      error: function error(data) {}\n    });\n    return true;\n  },\n  message: 'فرمت فرمول صحیح نیست'\n};\nko.validation.rules['remoteIsValidExpression'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  async: true,\n  validator: function validator(val, otherField, callback) {\n    if (val !== null && val !== undefined && val !== \"\") {\n      _apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n        url: \"/api/common/postisvalidexpression\",\n        data: {\n          data: val.toString(),\n          isCondition: otherField[0],\n          isFormula: otherField[1],\n          controllerName: otherField[2]\n        },\n        success: function success(data) {\n          callback(data);\n        },\n        error: function error(data) {}\n      });\n    }\n\n    return true;\n  },\n  message: function message(params, observable, hg) {\n    return 'فرمت عبارت تجمیع شروط نامعتبر است';\n  }\n};\nko.validation.rules['isAllConditionsUse'] = {\n  newParam: \"\",\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(phrase, otherField, callback) {\n    var conditions = this.getValue(otherField.params);\n    if (conditions.length < 2) return true;\n    if (_h.isNullOrEmpty(phrase) || phrase === \"\") return false;\n    var all = true;\n\n    for (var i = 0; i < conditions.length; i++) {\n      var cName = \"cs\" + (i + 1);\n      if (phrase.toLowerCase().indexOf(cName) === -1) all = false;\n    }\n\n    return all;\n  },\n  message: function message(params, observable, hg) {\n    return 'استفاده از همه شرط های تعریف شده، در تجمیع شروط الزامی است';\n  }\n};\nko.validation.rules['isConditionsUseValid'] = {\n  newParam: \"\",\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(phrase, otherField, callback) {\n    var conditions = this.getValue(otherField.params);\n    if (conditions.length < 2) return true;\n    var array = [];\n\n    for (var i = 0; i < conditions.length; i++) {\n      var target = conditions[i];\n\n      if (!target.validationObject.isValid()) {\n        array.push(i + 1);\n      }\n    }\n\n    if (array.length > 0) {\n      //newParam = array;\n      return false;\n    }\n\n    return true;\n  },\n  message: function message(params, observable, hg) {\n    return 'یکی از شرط های موجود در تجمیع شروط، صحیح نمی باشد';\n  }\n};\nko.validation.rules['atleastOneDestinationValues'] = {\n  validator: function validator(val, otherField) {\n    if (val.length > 0) {\n      var res = false;\n      $.each(val, function (i, p) {\n        if (!_h.isNullOrEmpty(p.destinationField()) && !_h.isNullOrEmpty(p.calculationValueType()) && !_h.isNullOrEmpty(p.value()) && p.value() !== \"\") res = true;\n      });\n      return res;\n    }\n\n    return false;\n  },\n  message: 'تعیین روش مقداردهی باید حداقل برای یکی از ستونهای مقصد انجام شود'\n};\nko.validation.rules['atleastOneDeleteCostDestinationValues'] = {\n  validator: function validator(val, otherField) {\n    if (val.length > 0) {\n      var res = false;\n      $.each(val, function (i, p) {\n        if (!_h.isNullOrEmpty(p.sourceFieldOrder()) && !_h.isNullOrEmpty(p.destinationFieldOrder())) res = true;\n      });\n      return res;\n    }\n\n    return false;\n  },\n  message: 'تعیین روش مقداردهی باید حداقل برای یکی از ستونهای مقصد انجام شود'\n};\nko.validation.rules['atleastOneColumnDestinationValues'] = {\n  validator: function validator(val, otherField) {\n    if (val.length > 0) {\n      var res = false;\n      $.each(val, function (i, p) {\n        if (!_h.isNullOrEmpty(p.nodeId()) && !_h.isNullOrEmpty(p.columnFunction()) && !_h.isNullOrEmpty(p.fieldOrder())) res = true;\n      });\n      return res;\n    }\n\n    return false;\n  },\n  message: 'تعیین روش مقداردهی باید حداقل برای یکی از برگ های درخت منتخب انجام شود'\n};\nko.validation.rules['atleastOnesourceFieldFormulas'] = {\n  validator: function validator(val, otherField) {\n    if (val.length > 0) {\n      var res = false;\n      $.each(val, function (i, p) {\n        if (!_h.isNullOrEmpty(p.fieldOrder()) && !_h.isNullOrEmpty(p.computeType()) && !_h.isNullOrEmpty(p.value())) res = true;\n      });\n      return res;\n    }\n\n    return false;\n  },\n  message: 'تعیین مقدار باید حداقل برای یکی از ستونهای جدول مبدا انجام شود'\n};\nko.validation.rules['onlyDecimal'] = {\n  validator: function validator(val, validate) {\n    return val !== null && val !== \"\" && /^-?\\d*(?:\\.\\d*)?$/.test(val.toString());\n  },\n  message: 'فقط ورود اعداد مجاز است'\n};\nko.validation.rules['onlyTenDigitDecimal'] = {\n  validator: function validator(val, fg, validate) {\n    if (_h.isNullOrEmpty(val) || val.toString().indexOf(\".\") === -1) return true;\n    var decimalPart = val.toString().split(\".\")[1];\n    return decimalPart && decimalPart.length <= 10;\n  },\n  message: 'حداکثر تا 10 رقم اعشار مجاز است'\n};\nko.validation.rules['max29Digit'] = {\n  validator: function validator(val, fg, validate) {\n    if (val === null || val === undefined || val === \"\") return true;\n\n    if (_h.isNumeric(val)) {\n      var a = val.toString().length;\n      var isNegative = Number(val) < 0;\n      if (isNegative && a <= 28) return true;\n      if (!isNegative && a <= 29) return true;\n    }\n\n    return false;\n  },\n  message: 'حداکثر تا 29 رقم مجاز است'\n};\nko.validation.rules['pageRangeValidate'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(val, otherField, callback) {\n    var pageFrom = this.getValue(otherField[0]);\n    var pageTo = this.getValue(otherField[1]);\n    var pageCount = this.getValue(otherField[2]);\n    if (!pageFrom || !pageTo) return true;\n    pageFrom = Number(pageFrom);\n    pageTo = Number(pageTo);\n    pageCount = pageCount.length;\n    this.newParam = pageCount;\n    if (pageFrom < 1 || pageFrom > pageCount) return false;\n    if (pageTo < pageFrom || pageTo < 1 || pageFrom > pageCount || pageTo > pageCount) return false;\n    return true;\n  },\n  message: function message(params, observable, hg) {\n    var pageCount = params[2]().length;\n    return 'محدوده صفحات انتخاب شده باید حداقل یک و حداکثر ' + pageCount + ' باشد';\n  }\n};\nko.validation.rules['chkStringTypeCell'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(val, otherField, callback) {\n    var parent = this.getValue(otherField[0]);\n    if (_h.isNullOrEmpty(val)) return true;\n    var model = $(\"#rg-\" + parent.id).rg(\"getModel\");\n    var firstCell = model.cells.filter(function (a) {\n      return a.address === val;\n    })[0];\n\n    if (firstCell) {\n      if (firstCell.extraParams.dataType === 2) return false;\n    }\n\n    return true;\n  },\n  message: 'انتخاب سلول های متنی جهت مقایسه مجاز نیست'\n};\nko.validation.rules['chkErrorRate'] = {\n  validator: function validator(val, otherVal) {\n    if (_h.isEmpty(val) || val == 0) return true;\n    var isValid = true;\n\n    for (var i = 0, len = val.length; i < len; i++) {\n      var target = val[i];\n      if (/[%]/g.test(target) === false && /[0-9]/g.test(target) === false) isValid = false;\n    }\n\n    return isValid;\n  },\n  message: 'فقط اعداد و علامت % مجاز است'\n};\nko.validation.rules['chkPercentRate'] = {\n  validator: function validator(val, otherVal) {\n    if (_h.isEmpty(val) || val == 0 || val.indexOf(\"%\") === -1) return true;\n    var isValid = true;\n    var hasNumber = false;\n\n    for (var i = 0, len = val.length; i < len; i++) {\n      var target = val[i];\n      if (/[0-9]/g.test(target) === true) hasNumber = true;\n    }\n\n    if (!hasNumber) isValid = false;\n    var number = val.trim().replace(\"%\", \"\");\n    if (number && Number(number) > 100) isValid = false;\n    return isValid;\n  },\n  message: 'علامت % بهمراه عدد کوچکتر یا مساوی 100 مجاز است'\n};\nko.validation.rules['duplicateCell'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(val, otherField, callback) {\n    var parent = this.getValue(otherField[0]);\n    if (_h.isNullOrEmpty(val)) return true;\n    var model = $(\"#rg-\" + parent.id).rg(\"getModel\");\n    var firstCell = model.cells.filter(function (a) {\n      return a.address === val;\n    })[0];\n\n    if (firstCell) {\n      var count = 0;\n\n      for (var i = 0; i < parent.cellBinds().length; i++) {\n        var target = parent.cellBinds()[i];\n        if (target.firstCell() === firstCell.address || target.secondCell() === firstCell.address) count++;\n      }\n\n      if (count > 1) return false;\n    }\n\n    return true;\n  },\n  message: 'هر سلول فقط یکبار میتواند مورد مقایسه قرار بگیرد'\n};\nko.validation.rules['compareSameCell'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(val, otherField, callback) {\n    var parent = this.getValue(otherField[0]);\n    var second = this.getValue(otherField[1]);\n    if (_h.isNullOrEmpty(val) || _h.isNullOrEmpty(second)) return true;\n    var model = $(\"#rg-\" + parent.id).rg(\"getModel\");\n    var firstCell = model.cells.filter(function (a) {\n      return a.address === val;\n    })[0];\n    var secondCell = model.cells.filter(function (a) {\n      return a.address === second;\n    })[0];\n\n    if (firstCell && secondCell) {\n      if (firstCell.address === secondCell.address) return false;\n    }\n\n    return true;\n  },\n  message: 'امکان مقایسه سلول با خودش وجود ندارد'\n};\nko.validation.rules['noEqualPeriod'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  validator: function validator(val, otherField, callback) {\n    var first = this.getValue(otherField.params[0]);\n    var second = this.getValue(otherField.params[1]);\n    if (first > 0 && val > 0 && first === val) return false;\n    if (second > 0 && val > 0 && second === val) return false;\n    return true;\n  },\n  message: 'انتخاب دوره های مالی مشابه جهت مقایسه مجاز نیست'\n};\nko.validation.rules['remoteIsUniqueRule'] = {\n  getValue: function getValue(o) {\n    return typeof o === 'function' ? o() : o;\n  },\n  async: true,\n  validator: function validator(val, otherField, callback) {\n    if (!val) return true;\n    var value = this.getValue(otherField.params[0]);\n    if (value === null || value === undefined) value = 0;\n\n    var co = _h.findControllerName(otherField.params[1]);\n\n    var model = {\n      propertyName: otherField.params[2],\n      id: value,\n      value: val.toString()\n    };\n\n    if (otherField.params.length > 3) {\n      var adjustmentId = this.getValue(otherField.params[3]);\n      if (adjustmentId === null || adjustmentId === undefined) adjustmentId = 0;\n      model.adjustmentId = adjustmentId;\n    }\n\n    _apiService_js__WEBPACK_IMPORTED_MODULE_0__.ApiService.request({\n      url: \"postIsUnique\",\n      data: {\n        controllerName: co,\n        inputData: model\n      },\n      success: function success(data) {\n        callback(data);\n      },\n      error: function error(data) {}\n    });\n  },\n  message: function message(model, observable, hg) {\n    return toast.createVMessage(model.params);\n  }\n};\n\n//# sourceURL=webpack://domino/./src/scripts/util/validationRules.js?");

/***/ }),

/***/ "./src/scripts/vendors/big.js":
/*!************************************!*\
  !*** ./src/scripts/vendors/big.js ***!
  \************************************/
/***/ (function(module, exports, __webpack_require__) {

eval("var __WEBPACK_AMD_DEFINE_RESULT__;;\n\n(function (global) {\n  'use strict';\n  /***************************** EDITABLE DEFAULTS ******************************/\n  // The default values below must be integers within the stated ranges.\n\n  /*\r\n   * The maximum number of decimal places of the results of operations\r\n   * involving division: div and sqrt, and pow with negative exponents.\r\n   */\n\n  var DP = 20,\n      // 0 to MAX_DP\n\n  /*\r\n   * The rounding mode used when rounding to the above decimal places.\r\n   *\r\n   * 0 Towards zero (i.e. truncate, no rounding).       (ROUND_DOWN)\r\n   * 1 To nearest neighbour. If equidistant, round up.  (ROUND_HALF_UP)\r\n   * 2 To nearest neighbour. If equidistant, to even.   (ROUND_HALF_EVEN)\r\n   * 3 Away from zero.                                  (ROUND_UP)\r\n   */\n  RM = 1,\n      // 0, 1, 2 or 3\n  // The maximum value of DP and Big.DP.\n  MAX_DP = 1E6,\n      // 0 to 1000000\n  // The maximum magnitude of the exponent argument to the pow method.\n  MAX_POWER = 1E6,\n      // 1 to 1000000\n\n  /*\r\n   * The exponent value at and beneath which toString returns exponential\r\n   * notation.\r\n   * JavaScript's Number type: -7\r\n   * -1000000 is the minimum recommended exponent value of a Big.\r\n   */\n  E_NEG = -7,\n      // 0 to -1000000\n\n  /*\r\n   * The exponent value at and above which toString returns exponential\r\n   * notation.\r\n   * JavaScript's Number type: 21\r\n   * 1000000 is the maximum recommended exponent value of a Big.\r\n   * (This limit is not enforced or checked.)\r\n   */\n  E_POS = 21,\n      // 0 to 1000000\n\n  /******************************************************************************/\n  // The shared prototype object.\n  P = {},\n      isValid = /^-?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\n      Big;\n  /*\r\n   * Create and return a Big constructor.\r\n   *\r\n   */\n\n  function bigFactory() {\n    /*\r\n     * The Big constructor and exported function.\r\n     * Create and return a new instance of a Big number object.\r\n     *\r\n     * n {number|string|Big} A numeric value.\r\n     */\n    function Big(n) {\n      var x = this; // Enable constructor usage without new.\n\n      if (!(x instanceof Big)) {\n        return n === void 0 ? bigFactory() : new Big(n);\n      } // Duplicate.\n\n\n      if (n instanceof Big) {\n        x.s = n.s;\n        x.e = n.e;\n        x.c = n.c.slice();\n      } else {\n        parse(x, n);\n      }\n      /*\r\n       * Retain a reference to this Big constructor, and shadow\r\n       * Big.prototype.constructor which points to Object.\r\n       */\n\n\n      x.constructor = Big;\n    }\n\n    Big.prototype = P;\n    Big.DP = DP;\n    Big.RM = RM;\n    Big.E_NEG = E_NEG;\n    Big.E_POS = E_POS;\n    return Big;\n  } // Private functions\n\n  /*\r\n   * Return a string representing the value of Big x in normal or exponential\r\n   * notation to dp fixed decimal places or significant digits.\r\n   *\r\n   * x {Big} The Big to format.\r\n   * dp {number} Integer, 0 to MAX_DP inclusive.\r\n   * toE {number} 1 (toExponential), 2 (toPrecision) or undefined (toFixed).\r\n   */\n\n\n  function format(x, dp, toE) {\n    var Big = x.constructor,\n        // The index (normal notation) of the digit that may be rounded up.\n    i = dp - (x = new Big(x)).e,\n        c = x.c; // Round?\n\n    if (c.length > ++dp) {\n      rnd(x, i, Big.RM);\n    }\n\n    if (!c[0]) {\n      ++i;\n    } else if (toE) {\n      i = dp; // toFixed\n    } else {\n      c = x.c; // Recalculate i as x.e may have changed if value rounded up.\n\n      i = x.e + i + 1;\n    } // Append zeros?\n\n\n    for (; c.length < i; c.push(0)) {}\n\n    i = x.e;\n    /*\r\n     * toPrecision returns exponential notation if the number of\r\n     * significant digits specified is less than the number of digits\r\n     * necessary to represent the integer part of the value in normal\r\n     * notation.\r\n     */\n\n    return toE === 1 || toE && (dp <= i || i <= Big.E_NEG) ? // Exponential notation.\n    (x.s < 0 && c[0] ? '-' : '') + (c.length > 1 ? c[0] + '.' + c.join('').slice(1) : c[0]) + (i < 0 ? 'e' : 'e+') + i // Normal notation.\n    : x.toString();\n  }\n  /*\r\n   * Parse the number or string value passed to a Big constructor.\r\n   *\r\n   * x {Big} A Big number instance.\r\n   * n {number|string} A numeric value.\r\n   */\n\n\n  function parse(x, n) {\n    var e, i, nL; // Minus zero?\n\n    if (n === 0 && 1 / n < 0) {\n      n = '-0'; // Ensure n is string and check validity.\n    } else if (!isValid.test(n += '')) {\n      throwErr(NaN);\n    } // Determine sign.\n\n\n    x.s = n.charAt(0) == '-' ? (n = n.slice(1), -1) : 1; // Decimal point?\n\n    if ((e = n.indexOf('.')) > -1) {\n      n = n.replace('.', '');\n    } // Exponential form?\n\n\n    if ((i = n.search(/e/i)) > 0) {\n      // Determine exponent.\n      if (e < 0) {\n        e = i;\n      }\n\n      e += +n.slice(i + 1);\n      n = n.substring(0, i);\n    } else if (e < 0) {\n      // Integer.\n      e = n.length;\n    } // Determine leading zeros.\n\n\n    for (i = 0; n.charAt(i) == '0'; i++) {}\n\n    if (i == (nL = n.length)) {\n      // Zero.\n      x.c = [x.e = 0];\n    } else {\n      // Determine trailing zeros.\n      for (; n.charAt(--nL) == '0';) {}\n\n      x.e = e - i - 1;\n      x.c = []; // Convert string to array of digits without leading/trailing zeros.\n\n      for (e = 0; i <= nL; x.c[e++] = +n.charAt(i++)) {}\n    }\n\n    return x;\n  }\n  /*\r\n   * Round Big x to a maximum of dp decimal places using rounding mode rm.\r\n   * Called by div, sqrt and round.\r\n   *\r\n   * x {Big} The Big to round.\r\n   * dp {number} Integer, 0 to MAX_DP inclusive.\r\n   * rm {number} 0, 1, 2 or 3 (DOWN, HALF_UP, HALF_EVEN, UP)\r\n   * [more] {boolean} Whether the result of division was truncated.\r\n   */\n\n\n  function rnd(x, dp, rm, more) {\n    var u,\n        xc = x.c,\n        i = x.e + dp + 1;\n\n    if (rm === 1) {\n      // xc[i] is the digit after the digit that may be rounded up.\n      more = xc[i] >= 5;\n    } else if (rm === 2) {\n      more = xc[i] > 5 || xc[i] == 5 && (more || i < 0 || xc[i + 1] !== u || xc[i - 1] & 1);\n    } else if (rm === 3) {\n      more = more || xc[i] !== u || i < 0;\n    } else {\n      more = false;\n\n      if (rm !== 0) {\n        throwErr('!Big.RM!');\n      }\n    }\n\n    if (i < 1 || !xc[0]) {\n      if (more) {\n        // 1, 0.1, 0.01, 0.001, 0.0001 etc.\n        x.e = -dp;\n        x.c = [1];\n      } else {\n        // Zero.\n        x.c = [x.e = 0];\n      }\n    } else {\n      // Remove any digits after the required decimal places.\n      xc.length = i--; // Round up?\n\n      if (more) {\n        // Rounding up may mean the previous digit has to be rounded up.\n        for (; ++xc[i] > 9;) {\n          xc[i] = 0;\n\n          if (!i--) {\n            ++x.e;\n            xc.unshift(1);\n          }\n        }\n      } // Remove trailing zeros.\n\n\n      for (i = xc.length; !xc[--i]; xc.pop()) {}\n    }\n\n    return x;\n  }\n  /*\r\n   * Throw a BigError.\r\n   *\r\n   * message {string} The error message.\r\n   */\n\n\n  function throwErr(message) {\n    var err = new Error(message);\n    err.name = 'BigError';\n    throw err;\n  } // Prototype/instance methods\n\n  /*\r\n   * Return a new Big whose value is the absolute value of this Big.\r\n   */\n\n\n  P.abs = function () {\n    var x = new this.constructor(this);\n    x.s = 1;\n    return x;\n  };\n  /*\r\n   * Return\r\n   * 1 if the value of this Big is greater than the value of Big y,\r\n   * -1 if the value of this Big is less than the value of Big y, or\r\n   * 0 if they have the same value.\r\n  */\n\n\n  P.cmp = function (y) {\n    var xNeg,\n        x = this,\n        xc = x.c,\n        yc = (y = new x.constructor(y)).c,\n        i = x.s,\n        j = y.s,\n        k = x.e,\n        l = y.e; // Either zero?\n\n    if (!xc[0] || !yc[0]) {\n      return !xc[0] ? !yc[0] ? 0 : -j : i;\n    } // Signs differ?\n\n\n    if (i != j) {\n      return i;\n    }\n\n    xNeg = i < 0; // Compare exponents.\n\n    if (k != l) {\n      return k > l ^ xNeg ? 1 : -1;\n    }\n\n    i = -1;\n    j = (k = xc.length) < (l = yc.length) ? k : l; // Compare digit by digit.\n\n    for (; ++i < j;) {\n      if (xc[i] != yc[i]) {\n        return xc[i] > yc[i] ^ xNeg ? 1 : -1;\n      }\n    } // Compare lengths.\n\n\n    return k == l ? 0 : k > l ^ xNeg ? 1 : -1;\n  };\n  /*\r\n   * Return a new Big whose value is the value of this Big divided by the\r\n   * value of Big y, rounded, if necessary, to a maximum of Big.DP decimal\r\n   * places using rounding mode Big.RM.\r\n   */\n\n\n  P.div = function (y) {\n    var x = this,\n        Big = x.constructor,\n        // dividend\n    dvd = x.c,\n        //divisor\n    dvs = (y = new Big(y)).c,\n        s = x.s == y.s ? 1 : -1,\n        dp = Big.DP;\n\n    if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\n      throwErr('!Big.DP!');\n    } // Either 0?\n\n\n    if (!dvd[0] || !dvs[0]) {\n      // If both are 0, throw NaN\n      if (dvd[0] == dvs[0]) {\n        throwErr(NaN);\n      } // If dvs is 0, throw +-Infinity.\n\n\n      if (!dvs[0]) {\n        throwErr(s / 0);\n      } // dvd is 0, return +-0.\n\n\n      return new Big(s * 0);\n    }\n\n    var dvsL,\n        dvsT,\n        next,\n        cmp,\n        remI,\n        u,\n        dvsZ = dvs.slice(),\n        dvdI = dvsL = dvs.length,\n        dvdL = dvd.length,\n        // remainder\n    rem = dvd.slice(0, dvsL),\n        remL = rem.length,\n        // quotient\n    q = y,\n        qc = q.c = [],\n        qi = 0,\n        digits = dp + (q.e = x.e - y.e) + 1;\n    q.s = s;\n    s = digits < 0 ? 0 : digits; // Create version of divisor with leading zero.\n\n    dvsZ.unshift(0); // Add zeros to make remainder as long as divisor.\n\n    for (; remL++ < dvsL; rem.push(0)) {}\n\n    do {\n      // 'next' is how many times the divisor goes into current remainder.\n      for (next = 0; next < 10; next++) {\n        // Compare divisor and remainder.\n        if (dvsL != (remL = rem.length)) {\n          cmp = dvsL > remL ? 1 : -1;\n        } else {\n          for (remI = -1, cmp = 0; ++remI < dvsL;) {\n            if (dvs[remI] != rem[remI]) {\n              cmp = dvs[remI] > rem[remI] ? 1 : -1;\n              break;\n            }\n          }\n        } // If divisor < remainder, subtract divisor from remainder.\n\n\n        if (cmp < 0) {\n          // Remainder can't be more than 1 digit longer than divisor.\n          // Equalise lengths using divisor with extra leading zero?\n          for (dvsT = remL == dvsL ? dvs : dvsZ; remL;) {\n            if (rem[--remL] < dvsT[remL]) {\n              remI = remL;\n\n              for (; remI && !rem[--remI]; rem[remI] = 9) {}\n\n              --rem[remI];\n              rem[remL] += 10;\n            }\n\n            rem[remL] -= dvsT[remL];\n          }\n\n          for (; !rem[0]; rem.shift()) {}\n        } else {\n          break;\n        }\n      } // Add the 'next' digit to the result array.\n\n\n      qc[qi++] = cmp ? next : ++next; // Update the remainder.\n\n      if (rem[0] && cmp) {\n        rem[remL] = dvd[dvdI] || 0;\n      } else {\n        rem = [dvd[dvdI]];\n      }\n    } while ((dvdI++ < dvdL || rem[0] !== u) && s--); // Leading zero? Do not remove if result is simply zero (qi == 1).\n\n\n    if (!qc[0] && qi != 1) {\n      // There can't be more than one zero.\n      qc.shift();\n      q.e--;\n    } // Round?\n\n\n    if (qi > digits) {\n      rnd(q, dp, Big.RM, rem[0] !== u);\n    }\n\n    return q;\n  };\n  /*\r\n   * Return true if the value of this Big is equal to the value of Big y,\r\n   * otherwise returns false.\r\n   */\n\n\n  P.eq = function (y) {\n    return !this.cmp(y);\n  };\n  /*\r\n   * Return true if the value of this Big is greater than the value of Big y,\r\n   * otherwise returns false.\r\n   */\n\n\n  P.gt = function (y) {\n    return this.cmp(y) > 0;\n  };\n  /*\r\n   * Return true if the value of this Big is greater than or equal to the\r\n   * value of Big y, otherwise returns false.\r\n   */\n\n\n  P.gte = function (y) {\n    return this.cmp(y) > -1;\n  };\n  /*\r\n   * Return true if the value of this Big is less than the value of Big y,\r\n   * otherwise returns false.\r\n   */\n\n\n  P.lt = function (y) {\n    return this.cmp(y) < 0;\n  };\n  /*\r\n   * Return true if the value of this Big is less than or equal to the value\r\n   * of Big y, otherwise returns false.\r\n   */\n\n\n  P.lte = function (y) {\n    return this.cmp(y) < 1;\n  };\n  /*\r\n   * Return a new Big whose value is the value of this Big minus the value\r\n   * of Big y.\r\n   */\n\n\n  P.sub = P.minus = function (y) {\n    var i,\n        j,\n        t,\n        xLTy,\n        x = this,\n        Big = x.constructor,\n        a = x.s,\n        b = (y = new Big(y)).s; // Signs differ?\n\n    if (a != b) {\n      y.s = -b;\n      return x.plus(y);\n    }\n\n    var xc = x.c.slice(),\n        xe = x.e,\n        yc = y.c,\n        ye = y.e; // Either zero?\n\n    if (!xc[0] || !yc[0]) {\n      // y is non-zero? x is non-zero? Or both are zero.\n      return yc[0] ? (y.s = -b, y) : new Big(xc[0] ? x : 0);\n    } // Determine which is the bigger number.\n    // Prepend zeros to equalise exponents.\n\n\n    if (a = xe - ye) {\n      if (xLTy = a < 0) {\n        a = -a;\n        t = xc;\n      } else {\n        ye = xe;\n        t = yc;\n      }\n\n      t.reverse();\n\n      for (b = a; b--; t.push(0)) {}\n\n      t.reverse();\n    } else {\n      // Exponents equal. Check digit by digit.\n      j = ((xLTy = xc.length < yc.length) ? xc : yc).length;\n\n      for (a = b = 0; b < j; b++) {\n        if (xc[b] != yc[b]) {\n          xLTy = xc[b] < yc[b];\n          break;\n        }\n      }\n    } // x < y? Point xc to the array of the bigger number.\n\n\n    if (xLTy) {\n      t = xc;\n      xc = yc;\n      yc = t;\n      y.s = -y.s;\n    }\n    /*\r\n     * Append zeros to xc if shorter. No need to add zeros to yc if shorter\r\n     * as subtraction only needs to start at yc.length.\r\n     */\n\n\n    if ((b = (j = yc.length) - (i = xc.length)) > 0) {\n      for (; b--; xc[i++] = 0) {}\n    } // Subtract yc from xc.\n\n\n    for (b = i; j > a;) {\n      if (xc[--j] < yc[j]) {\n        for (i = j; i && !xc[--i]; xc[i] = 9) {}\n\n        --xc[i];\n        xc[j] += 10;\n      }\n\n      xc[j] -= yc[j];\n    } // Remove trailing zeros.\n\n\n    for (; xc[--b] === 0; xc.pop()) {} // Remove leading zeros and adjust exponent accordingly.\n\n\n    for (; xc[0] === 0;) {\n      xc.shift();\n      --ye;\n    }\n\n    if (!xc[0]) {\n      // n - n = +0\n      y.s = 1; // Result must be zero.\n\n      xc = [ye = 0];\n    }\n\n    y.c = xc;\n    y.e = ye;\n    return y;\n  };\n  /*\r\n   * Return a new Big whose value is the value of this Big modulo the\r\n   * value of Big y.\r\n   */\n\n\n  P.mod = function (y) {\n    var yGTx,\n        x = this,\n        Big = x.constructor,\n        a = x.s,\n        b = (y = new Big(y)).s;\n\n    if (!y.c[0]) {\n      throwErr(NaN);\n    }\n\n    x.s = y.s = 1;\n    yGTx = y.cmp(x) == 1;\n    x.s = a;\n    y.s = b;\n\n    if (yGTx) {\n      return new Big(x);\n    }\n\n    a = Big.DP;\n    b = Big.RM;\n    Big.DP = Big.RM = 0;\n    x = x.div(y);\n    Big.DP = a;\n    Big.RM = b;\n    return this.minus(x.times(y));\n  };\n  /*\r\n   * Return a new Big whose value is the value of this Big plus the value\r\n   * of Big y.\r\n   */\n\n\n  P.add = P.plus = function (y) {\n    var t,\n        x = this,\n        Big = x.constructor,\n        a = x.s,\n        b = (y = new Big(y)).s; // Signs differ?\n\n    if (a != b) {\n      y.s = -b;\n      return x.minus(y);\n    }\n\n    var xe = x.e,\n        xc = x.c,\n        ye = y.e,\n        yc = y.c; // Either zero?\n\n    if (!xc[0] || !yc[0]) {\n      // y is non-zero? x is non-zero? Or both are zero.\n      return yc[0] ? y : new Big(xc[0] ? x : a * 0);\n    }\n\n    xc = xc.slice(); // Prepend zeros to equalise exponents.\n    // Note: Faster to use reverse then do unshifts.\n\n    if (a = xe - ye) {\n      if (a > 0) {\n        ye = xe;\n        t = yc;\n      } else {\n        a = -a;\n        t = xc;\n      }\n\n      t.reverse();\n\n      for (; a--; t.push(0)) {}\n\n      t.reverse();\n    } // Point xc to the longer array.\n\n\n    if (xc.length - yc.length < 0) {\n      t = yc;\n      yc = xc;\n      xc = t;\n    }\n\n    a = yc.length;\n    /*\r\n     * Only start adding at yc.length - 1 as the further digits of xc can be\r\n     * left as they are.\r\n     */\n\n    for (b = 0; a;) {\n      b = (xc[--a] = xc[a] + yc[a] + b) / 10 | 0;\n      xc[a] %= 10;\n    } // No need to check for zero, as +x + +y != 0 && -x + -y != 0\n\n\n    if (b) {\n      xc.unshift(b);\n      ++ye;\n    } // Remove trailing zeros.\n\n\n    for (a = xc.length; xc[--a] === 0; xc.pop()) {}\n\n    y.c = xc;\n    y.e = ye;\n    return y;\n  };\n  /*\r\n   * Return a Big whose value is the value of this Big raised to the power n.\r\n   * If n is negative, round, if necessary, to a maximum of Big.DP decimal\r\n   * places using rounding mode Big.RM.\r\n   *\r\n   * n {number} Integer, -MAX_POWER to MAX_POWER inclusive.\r\n   */\n\n\n  P.pow = function (n) {\n    var x = this,\n        one = new x.constructor(1),\n        y = one,\n        isNeg = n < 0;\n\n    if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) {\n      throwErr('!pow!');\n    }\n\n    n = isNeg ? -n : n;\n\n    for (;;) {\n      if (n & 1) {\n        y = y.times(x);\n      }\n\n      n >>= 1;\n\n      if (!n) {\n        break;\n      }\n\n      x = x.times(x);\n    }\n\n    return isNeg ? one.div(y) : y;\n  };\n  /*\r\n   * Return a new Big whose value is the value of this Big rounded to a\r\n   * maximum of dp decimal places using rounding mode rm.\r\n   * If dp is not specified, round to 0 decimal places.\r\n   * If rm is not specified, use Big.RM.\r\n   *\r\n   * [dp] {number} Integer, 0 to MAX_DP inclusive.\r\n   * [rm] 0, 1, 2 or 3 (ROUND_DOWN, ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_UP)\r\n   */\n\n\n  P.round = function (dp, rm) {\n    var x = this,\n        Big = x.constructor;\n\n    if (dp == null) {\n      dp = 0;\n    } else if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\n      throwErr('!round!');\n    }\n\n    rnd(x = new Big(x), dp, rm == null ? Big.RM : rm);\n    return x;\n  };\n  /*\r\n   * Return a new Big whose value is the square root of the value of this Big,\r\n   * rounded, if necessary, to a maximum of Big.DP decimal places using\r\n   * rounding mode Big.RM.\r\n   */\n\n\n  P.sqrt = function () {\n    var estimate,\n        r,\n        approx,\n        x = this,\n        Big = x.constructor,\n        xc = x.c,\n        i = x.s,\n        e = x.e,\n        half = new Big('0.5'); // Zero?\n\n    if (!xc[0]) {\n      return new Big(x);\n    } // If negative, throw NaN.\n\n\n    if (i < 0) {\n      throwErr(NaN);\n    } // Estimate.\n\n\n    i = Math.sqrt(x.toString()); // Math.sqrt underflow/overflow?\n    // Pass x to Math.sqrt as integer, then adjust the result exponent.\n\n    if (i === 0 || i === 1 / 0) {\n      estimate = xc.join('');\n\n      if (!(estimate.length + e & 1)) {\n        estimate += '0';\n      }\n\n      r = new Big(Math.sqrt(estimate).toString());\n      r.e = ((e + 1) / 2 | 0) - (e < 0 || e & 1);\n    } else {\n      r = new Big(i.toString());\n    }\n\n    i = r.e + (Big.DP += 4); // Newton-Raphson iteration.\n\n    do {\n      approx = r;\n      r = half.times(approx.plus(x.div(approx)));\n    } while (approx.c.slice(0, i).join('') !== r.c.slice(0, i).join(''));\n\n    rnd(r, Big.DP -= 4, Big.RM);\n    return r;\n  };\n  /*\r\n   * Return a new Big whose value is the value of this Big times the value of\r\n   * Big y.\r\n   */\n\n\n  P.mul = P.times = function (y) {\n    var c,\n        x = this,\n        Big = x.constructor,\n        xc = x.c,\n        yc = (y = new Big(y)).c,\n        a = xc.length,\n        b = yc.length,\n        i = x.e,\n        j = y.e; // Determine sign of result.\n\n    y.s = x.s == y.s ? 1 : -1; // Return signed 0 if either 0.\n\n    if (!xc[0] || !yc[0]) {\n      return new Big(y.s * 0);\n    } // Initialise exponent of result as x.e + y.e.\n\n\n    y.e = i + j; // If array xc has fewer digits than yc, swap xc and yc, and lengths.\n\n    if (a < b) {\n      c = xc;\n      xc = yc;\n      yc = c;\n      j = a;\n      a = b;\n      b = j;\n    } // Initialise coefficient array of result with zeros.\n\n\n    for (c = new Array(j = a + b); j--; c[j] = 0) {} // Multiply.\n    // i is initially xc.length.\n\n\n    for (i = b; i--;) {\n      b = 0; // a is yc.length.\n\n      for (j = a + i; j > i;) {\n        // Current sum of products at this digit position, plus carry.\n        b = c[j] + yc[i] * xc[j - i - 1] + b;\n        c[j--] = b % 10; // carry\n\n        b = b / 10 | 0;\n      }\n\n      c[j] = (c[j] + b) % 10;\n    } // Increment result exponent if there is a final carry.\n\n\n    if (b) {\n      ++y.e;\n    } // Remove any leading zero.\n\n\n    if (!c[0]) {\n      c.shift();\n    } // Remove trailing zeros.\n\n\n    for (i = c.length; !c[--i]; c.pop()) {}\n\n    y.c = c;\n    return y;\n  };\n  /*\r\n   * Return a string representing the value of this Big.\r\n   * Return exponential notation if this Big has a positive exponent equal to\r\n   * or greater than Big.E_POS, or a negative exponent equal to or less than\r\n   * Big.E_NEG.\r\n   */\n\n\n  P.toString = P.valueOf = P.toJSON = function () {\n    var x = this,\n        Big = x.constructor,\n        e = x.e,\n        str = x.c.join(''),\n        strL = str.length; // Exponential notation?\n\n    if (e <= Big.E_NEG || e >= Big.E_POS) {\n      str = str.charAt(0) + (strL > 1 ? '.' + str.slice(1) : '') + (e < 0 ? 'e' : 'e+') + e; // Negative exponent?\n    } else if (e < 0) {\n      // Prepend zeros.\n      for (; ++e; str = '0' + str) {}\n\n      str = '0.' + str; // Positive exponent?\n    } else if (e > 0) {\n      if (++e > strL) {\n        // Append zeros.\n        for (e -= strL; e--; str += '0') {}\n      } else if (e < strL) {\n        str = str.slice(0, e) + '.' + str.slice(e);\n      } // Exponent zero.\n\n    } else if (strL > 1) {\n      str = str.charAt(0) + '.' + str.slice(1);\n    } // Avoid '-0'\n\n\n    return x.s < 0 && x.c[0] ? '-' + str : str;\n  };\n  /*\r\n   ***************************************************************************\r\n   * If toExponential, toFixed, toPrecision and format are not required they\r\n   * can safely be commented-out or deleted. No redundant code will be left.\r\n   * format is used only by toExponential, toFixed and toPrecision.\r\n   ***************************************************************************\r\n   */\n\n  /*\r\n   * Return a string representing the value of this Big in exponential\r\n   * notation to dp fixed decimal places and rounded, if necessary, using\r\n   * Big.RM.\r\n   *\r\n   * [dp] {number} Integer, 0 to MAX_DP inclusive.\r\n   */\n\n\n  P.toExponential = function (dp) {\n    if (dp == null) {\n      dp = this.c.length - 1;\n    } else if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\n      throwErr('!toExp!');\n    }\n\n    return format(this, dp, 1);\n  };\n  /*\r\n   * Return a string representing the value of this Big in normal notation\r\n   * to dp fixed decimal places and rounded, if necessary, using Big.RM.\r\n   *\r\n   * [dp] {number} Integer, 0 to MAX_DP inclusive.\r\n   */\n\n\n  P.toFixed = function (dp) {\n    var str,\n        x = this,\n        Big = x.constructor,\n        neg = Big.E_NEG,\n        pos = Big.E_POS; // Prevent the possibility of exponential notation.\n\n    Big.E_NEG = -(Big.E_POS = 1 / 0);\n\n    if (dp == null) {\n      str = x.toString();\n    } else if (dp === ~~dp && dp >= 0 && dp <= MAX_DP) {\n      str = format(x, x.e + dp); // (-0).toFixed() is '0', but (-0.1).toFixed() is '-0'.\n      // (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\n\n      if (x.s < 0 && x.c[0] && str.indexOf('-') < 0) {\n        //E.g. -0.5 if rounded to -0 will cause toString to omit the minus sign.\n        str = '-' + str;\n      }\n    }\n\n    Big.E_NEG = neg;\n    Big.E_POS = pos;\n\n    if (!str) {\n      throwErr('!toFix!');\n    }\n\n    return str;\n  };\n  /*\r\n   * Return a string representing the value of this Big rounded to sd\r\n   * significant digits using Big.RM. Use exponential notation if sd is less\r\n   * than the number of digits necessary to represent the integer part of the\r\n   * value in normal notation.\r\n   *\r\n   * sd {number} Integer, 1 to MAX_DP inclusive.\r\n   */\n\n\n  P.toPrecision = function (sd) {\n    if (sd == null) {\n      return this.toString();\n    } else if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {\n      throwErr('!toPre!');\n    }\n\n    return format(this, sd - 1, 2);\n  }; // Export\n\n\n  Big = bigFactory(); //AMD.\n\n  if (true) {\n    !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n      return Big;\n    }).call(exports, __webpack_require__, exports, module),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); // Node and other CommonJS-like environments that support module.exports.\n  } else {}\n})(this);\n\n//# sourceURL=webpack://domino/./src/scripts/vendors/big.js?");

/***/ }),

/***/ "./src/scripts/vendors/bootstrap.js":
/*!******************************************!*\
  !*** ./src/scripts/vendors/bootstrap.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nif (typeof jQuery === 'undefined') {\n  throw new Error('Bootstrap\\'s JavaScript requires jQuery');\n}\n\n+function ($) {\n  'use strict';\n\n  var version = $.fn.jquery.split(' ')[0].split('.'); //if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 2)) {\n  //  throw new Error('Bootstrap\\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3')\n  //}\n}(jQuery);\n+function ($) {\n  'use strict'; // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)\n  // ============================================================\n\n  function transitionEnd() {\n    var el = document.createElement('bootstrap');\n    var transEndEventNames = {\n      WebkitTransition: 'webkitTransitionEnd',\n      MozTransition: 'transitionend',\n      OTransition: 'oTransitionEnd otransitionend',\n      transition: 'transitionend'\n    };\n\n    for (var name in transEndEventNames) {\n      if (el.style[name] !== undefined) {\n        return {\n          end: transEndEventNames[name]\n        };\n      }\n    }\n\n    return false; // explicit for ie8 (  ._.)\n  } // http://blog.alexmaccaw.com/css-transitions\n\n\n  $.fn.emulateTransitionEnd = function (duration) {\n    var called = false;\n    var $el = this;\n    $(this).one('bsTransitionEnd', function () {\n      called = true;\n    });\n\n    var callback = function callback() {\n      if (!called) $($el).trigger($.support.transition.end);\n    };\n\n    setTimeout(callback, duration);\n    return this;\n  };\n\n  $(function () {\n    $.support.transition = transitionEnd();\n    if (!$.support.transition) return;\n    $.event.special.bsTransitionEnd = {\n      bindType: $.support.transition.end,\n      delegateType: $.support.transition.end,\n      handle: function handle(e) {\n        if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments);\n      }\n    };\n  });\n}(jQuery);\n+function ($) {\n  'use strict'; // ALERT CLASS DEFINITION\n  // ======================\n\n  var dismiss = '[data-dismiss=\"alert\"]';\n\n  var Alert = function Alert(el) {\n    $(el).on('click', dismiss, this.close);\n  };\n\n  Alert.VERSION = '3.3.6';\n  Alert.TRANSITION_DURATION = 150;\n\n  Alert.prototype.close = function (e) {\n    var $this = $(this);\n    var selector = $this.attr('data-target');\n\n    if (!selector) {\n      selector = $this.attr('href');\n      selector = selector && selector.replace(/.*(?=#[^\\s]*$)/, ''); // strip for ie7\n    }\n\n    var $parent = $(selector);\n    if (e) e.preventDefault();\n\n    if (!$parent.length) {\n      $parent = $this.closest('.alert');\n    }\n\n    $parent.trigger(e = $.Event('close.bs.alert'));\n    if (e.isDefaultPrevented()) return;\n    $parent.removeClass('in');\n\n    function removeElement() {\n      // detach from parent, fire event then clean up data\n      $parent.detach().trigger('closed.bs.alert').remove();\n    }\n\n    $.support.transition && $parent.hasClass('fade') ? $parent.one('bsTransitionEnd', removeElement).emulateTransitionEnd(Alert.TRANSITION_DURATION) : removeElement();\n  }; // ALERT PLUGIN DEFINITION\n  // =======================\n\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this = $(this);\n      var data = $this.data('bs.alert');\n      if (!data) $this.data('bs.alert', data = new Alert(this));\n      if (typeof option == 'string') data[option].call($this);\n    });\n  }\n\n  var old = $.fn.alert;\n  $.fn.alert = Plugin;\n  $.fn.alert.Constructor = Alert; // ALERT NO CONFLICT\n  // =================\n\n  $.fn.alert.noConflict = function () {\n    $.fn.alert = old;\n    return this;\n  }; // ALERT DATA-API\n  // ==============\n\n\n  $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close);\n}(jQuery);\n+function ($) {\n  'use strict'; // BUTTON PUBLIC CLASS DEFINITION\n  // ==============================\n\n  var Button = function Button(element, options) {\n    this.$element = $(element);\n    this.options = $.extend({}, Button.DEFAULTS, options);\n    this.isLoading = false;\n  };\n\n  Button.VERSION = '3.3.6';\n  Button.DEFAULTS = {\n    loadingText: 'loading...'\n  };\n\n  Button.prototype.setState = function (state) {\n    var d = 'disabled';\n    var $el = this.$element;\n    var val = $el.is('input') ? 'val' : 'html';\n    var data = $el.data();\n    state += 'Text';\n    if (data.resetText == null) $el.data('resetText', $el[val]()); // push to event loop to allow forms to submit\n\n    setTimeout($.proxy(function () {\n      $el[val](data[state] == null ? this.options[state] : data[state]);\n\n      if (state == 'loadingText') {\n        this.isLoading = true;\n        $el.addClass(d).attr(d, d);\n      } else if (this.isLoading) {\n        this.isLoading = false;\n        $el.removeClass(d).removeAttr(d);\n      }\n    }, this), 0);\n  };\n\n  Button.prototype.toggle = function () {\n    var changed = true;\n    var $parent = this.$element.closest('[data-toggle=\"buttons\"]');\n\n    if ($parent.length) {\n      var $input = this.$element.find('input');\n\n      if ($input.prop('type') == 'radio') {\n        if ($input.prop('checked')) changed = false;\n        $parent.find('.active').removeClass('active');\n        this.$element.addClass('active');\n      } else if ($input.prop('type') == 'checkbox') {\n        if ($input.prop('checked') !== this.$element.hasClass('active')) changed = false;\n        this.$element.toggleClass('active');\n      }\n\n      $input.prop('checked', this.$element.hasClass('active'));\n      if (changed) $input.trigger('change');\n    } else {\n      this.$element.attr('aria-pressed', !this.$element.hasClass('active'));\n      this.$element.toggleClass('active');\n    }\n  }; // BUTTON PLUGIN DEFINITION\n  // ========================\n\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this = $(this);\n      var data = $this.data('bs.button');\n      var options = _typeof(option) == 'object' && option;\n      if (!data) $this.data('bs.button', data = new Button(this, options));\n      if (option == 'toggle') data.toggle();else if (option) data.setState(option);\n    });\n  }\n\n  var old = $.fn.button;\n  $.fn.button = Plugin;\n  $.fn.button.Constructor = Button; // BUTTON NO CONFLICT\n  // ==================\n\n  $.fn.button.noConflict = function () {\n    $.fn.button = old;\n    return this;\n  }; // BUTTON DATA-API\n  // ===============\n\n\n  $(document).on('click.bs.button.data-api', '[data-toggle^=\"button\"]', function (e) {\n    var $btn = $(e.target);\n    if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn');\n    Plugin.call($btn, 'toggle');\n    if (!($(e.target).is('input[type=\"radio\"]') || $(e.target).is('input[type=\"checkbox\"]'))) e.preventDefault();\n  }).on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^=\"button\"]', function (e) {\n    $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type));\n  });\n}(jQuery);\n+function ($) {\n  'use strict'; // CAROUSEL CLASS DEFINITION\n  // =========================\n\n  var Carousel = function Carousel(element, options) {\n    this.$element = $(element);\n    this.$indicators = this.$element.find('.carousel-indicators');\n    this.options = options;\n    this.paused = null;\n    this.sliding = null;\n    this.interval = null;\n    this.$active = null;\n    this.$items = null;\n    this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this));\n    this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element.on('mouseenter.bs.carousel', $.proxy(this.pause, this)).on('mouseleave.bs.carousel', $.proxy(this.cycle, this));\n  };\n\n  Carousel.VERSION = '3.3.6';\n  Carousel.TRANSITION_DURATION = 600;\n  Carousel.DEFAULTS = {\n    interval: 5000,\n    pause: 'hover',\n    wrap: true,\n    keyboard: true\n  };\n\n  Carousel.prototype.keydown = function (e) {\n    if (/input|textarea/i.test(e.target.tagName)) return;\n\n    switch (e.which) {\n      case 37:\n        this.prev();\n        break;\n\n      case 39:\n        this.next();\n        break;\n\n      default:\n        return;\n    }\n\n    e.preventDefault();\n  };\n\n  Carousel.prototype.cycle = function (e) {\n    e || (this.paused = false);\n    this.interval && clearInterval(this.interval);\n    this.options.interval && !this.paused && (this.interval = setInterval($.proxy(this.next, this), this.options.interval));\n    return this;\n  };\n\n  Carousel.prototype.getItemIndex = function (item) {\n    this.$items = item.parent().children('.item');\n    return this.$items.index(item || this.$active);\n  };\n\n  Carousel.prototype.getItemForDirection = function (direction, active) {\n    var activeIndex = this.getItemIndex(active);\n    var willWrap = direction == 'prev' && activeIndex === 0 || direction == 'next' && activeIndex == this.$items.length - 1;\n    if (willWrap && !this.options.wrap) return active;\n    var delta = direction == 'prev' ? -1 : 1;\n    var itemIndex = (activeIndex + delta) % this.$items.length;\n    return this.$items.eq(itemIndex);\n  };\n\n  Carousel.prototype.to = function (pos) {\n    var that = this;\n    var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'));\n    if (pos > this.$items.length - 1 || pos < 0) return;\n    if (this.sliding) return this.$element.one('slid.bs.carousel', function () {\n      that.to(pos);\n    }); // yes, \"slid\"\n\n    if (activeIndex == pos) return this.pause().cycle();\n    return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos));\n  };\n\n  Carousel.prototype.pause = function (e) {\n    e || (this.paused = true);\n\n    if (this.$element.find('.next, .prev').length && $.support.transition) {\n      this.$element.trigger($.support.transition.end);\n      this.cycle(true);\n    }\n\n    this.interval = clearInterval(this.interval);\n    return this;\n  };\n\n  Carousel.prototype.next = function () {\n    if (this.sliding) return;\n    return this.slide('next');\n  };\n\n  Carousel.prototype.prev = function () {\n    if (this.sliding) return;\n    return this.slide('prev');\n  };\n\n  Carousel.prototype.slide = function (type, next) {\n    var $active = this.$element.find('.item.active');\n    var $next = next || this.getItemForDirection(type, $active);\n    var isCycling = this.interval;\n    var direction = type == 'next' ? 'left' : 'right';\n    var that = this;\n    if ($next.hasClass('active')) return this.sliding = false;\n    var relatedTarget = $next[0];\n    var slideEvent = $.Event('slide.bs.carousel', {\n      relatedTarget: relatedTarget,\n      direction: direction\n    });\n    this.$element.trigger(slideEvent);\n    if (slideEvent.isDefaultPrevented()) return;\n    this.sliding = true;\n    isCycling && this.pause();\n\n    if (this.$indicators.length) {\n      this.$indicators.find('.active').removeClass('active');\n      var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]);\n      $nextIndicator && $nextIndicator.addClass('active');\n    }\n\n    var slidEvent = $.Event('slid.bs.carousel', {\n      relatedTarget: relatedTarget,\n      direction: direction\n    }); // yes, \"slid\"\n\n    if ($.support.transition && this.$element.hasClass('slide')) {\n      $next.addClass(type);\n      $next[0].offsetWidth; // force reflow\n\n      $active.addClass(direction);\n      $next.addClass(direction);\n      $active.one('bsTransitionEnd', function () {\n        $next.removeClass([type, direction].join(' ')).addClass('active');\n        $active.removeClass(['active', direction].join(' '));\n        that.sliding = false;\n        setTimeout(function () {\n          that.$element.trigger(slidEvent);\n        }, 0);\n      }).emulateTransitionEnd(Carousel.TRANSITION_DURATION);\n    } else {\n      $active.removeClass('active');\n      $next.addClass('active');\n      this.sliding = false;\n      this.$element.trigger(slidEvent);\n    }\n\n    isCycling && this.cycle();\n    return this;\n  }; // CAROUSEL PLUGIN DEFINITION\n  // ==========================\n\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this = $(this);\n      var data = $this.data('bs.carousel');\n      var options = $.extend({}, Carousel.DEFAULTS, $this.data(), _typeof(option) == 'object' && option);\n      var action = typeof option == 'string' ? option : options.slide;\n      if (!data) $this.data('bs.carousel', data = new Carousel(this, options));\n      if (typeof option == 'number') data.to(option);else if (action) data[action]();else if (options.interval) data.pause().cycle();\n    });\n  }\n\n  var old = $.fn.carousel;\n  $.fn.carousel = Plugin;\n  $.fn.carousel.Constructor = Carousel; // CAROUSEL NO CONFLICT\n  // ====================\n\n  $.fn.carousel.noConflict = function () {\n    $.fn.carousel = old;\n    return this;\n  }; // CAROUSEL DATA-API\n  // =================\n\n\n  var clickHandler = function clickHandler(e) {\n    var href;\n    var $this = $(this);\n    var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\\s]+$)/, '')); // strip for ie7\n\n    if (!$target.hasClass('carousel')) return;\n    var options = $.extend({}, $target.data(), $this.data());\n    var slideIndex = $this.attr('data-slide-to');\n    if (slideIndex) options.interval = false;\n    Plugin.call($target, options);\n\n    if (slideIndex) {\n      $target.data('bs.carousel').to(slideIndex);\n    }\n\n    e.preventDefault();\n  };\n\n  $(document).on('click.bs.carousel.data-api', '[data-slide]', clickHandler).on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler);\n  $(window).on('load', function () {\n    $('[data-ride=\"carousel\"]').each(function () {\n      var $carousel = $(this);\n      Plugin.call($carousel, $carousel.data());\n    });\n  });\n}(jQuery);\n+function ($) {\n  'use strict'; // COLLAPSE PUBLIC CLASS DEFINITION\n  // ================================\n\n  var Collapse = function Collapse(element, options) {\n    this.$element = $(element);\n    this.options = $.extend({}, Collapse.DEFAULTS, options);\n    this.$trigger = $('[data-toggle=\"collapse\"][href=\"#' + element.id + '\"],' + '[data-toggle=\"collapse\"][data-target=\"#' + element.id + '\"]');\n    this.transitioning = null;\n\n    if (this.options.parent) {\n      this.$parent = this.getParent();\n    } else {\n      this.addAriaAndCollapsedClass(this.$element, this.$trigger);\n    }\n\n    if (this.options.toggle) this.toggle();\n  };\n\n  Collapse.VERSION = '3.3.6';\n  Collapse.TRANSITION_DURATION = 350;\n  Collapse.DEFAULTS = {\n    toggle: true\n  };\n\n  Collapse.prototype.dimension = function () {\n    var hasWidth = this.$element.hasClass('width');\n    return hasWidth ? 'width' : 'height';\n  };\n\n  Collapse.prototype.show = function () {\n    if (this.transitioning || this.$element.hasClass('in')) return;\n    var activesData;\n    var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing');\n\n    if (actives && actives.length) {\n      activesData = actives.data('bs.collapse');\n      if (activesData && activesData.transitioning) return;\n    }\n\n    var startEvent = $.Event('show.bs.collapse');\n    this.$element.trigger(startEvent);\n    if (startEvent.isDefaultPrevented()) return;\n\n    if (actives && actives.length) {\n      Plugin.call(actives, 'hide');\n      activesData || actives.data('bs.collapse', null);\n    }\n\n    var dimension = this.dimension();\n    this.$element.removeClass('collapse').addClass('collapsing')[dimension](0).attr('aria-expanded', true);\n    this.$trigger.removeClass('collapsed').attr('aria-expanded', true);\n    this.transitioning = 1;\n\n    var complete = function complete() {\n      this.$element.removeClass('collapsing').addClass('collapse in')[dimension]('');\n      this.transitioning = 0;\n      this.$element.trigger('shown.bs.collapse');\n    };\n\n    if (!$.support.transition) return complete.call(this);\n    var scrollSize = $.camelCase(['scroll', dimension].join('-'));\n    this.$element.one('bsTransitionEnd', $.proxy(complete, this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]);\n  };\n\n  Collapse.prototype.hide = function () {\n    if (this.transitioning || !this.$element.hasClass('in')) return;\n    var startEvent = $.Event('hide.bs.collapse');\n    this.$element.trigger(startEvent);\n    if (startEvent.isDefaultPrevented()) return;\n    var dimension = this.dimension();\n    this.$element[dimension](this.$element[dimension]())[0].offsetHeight;\n    this.$element.addClass('collapsing').removeClass('collapse in').attr('aria-expanded', false);\n    this.$trigger.addClass('collapsed').attr('aria-expanded', false);\n    this.transitioning = 1;\n\n    var complete = function complete() {\n      this.transitioning = 0;\n      this.$element.removeClass('collapsing').addClass('collapse').trigger('hidden.bs.collapse');\n    };\n\n    if (!$.support.transition) return complete.call(this);\n    this.$element[dimension](0).one('bsTransitionEnd', $.proxy(complete, this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION);\n  };\n\n  Collapse.prototype.toggle = function () {\n    this[this.$element.hasClass('in') ? 'hide' : 'show']();\n  };\n\n  Collapse.prototype.getParent = function () {\n    return $(this.options.parent).find('[data-toggle=\"collapse\"][data-parent=\"' + this.options.parent + '\"]').each($.proxy(function (i, element) {\n      var $element = $(element);\n      this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element);\n    }, this)).end();\n  };\n\n  Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {\n    var isOpen = $element.hasClass('in');\n    $element.attr('aria-expanded', isOpen);\n    $trigger.toggleClass('collapsed', !isOpen).attr('aria-expanded', isOpen);\n  };\n\n  function getTargetFromTrigger($trigger) {\n    var href;\n    var target = $trigger.attr('data-target') || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\\s]+$)/, ''); // strip for ie7\n\n    return $(target);\n  } // COLLAPSE PLUGIN DEFINITION\n  // ==========================\n\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this = $(this);\n      var data = $this.data('bs.collapse');\n      var options = $.extend({}, Collapse.DEFAULTS, $this.data(), _typeof(option) == 'object' && option);\n      if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false;\n      if (!data) $this.data('bs.collapse', data = new Collapse(this, options));\n      if (typeof option == 'string') data[option]();\n    });\n  }\n\n  var old = $.fn.collapse;\n  $.fn.collapse = Plugin;\n  $.fn.collapse.Constructor = Collapse; // COLLAPSE NO CONFLICT\n  // ====================\n\n  $.fn.collapse.noConflict = function () {\n    $.fn.collapse = old;\n    return this;\n  }; // COLLAPSE DATA-API\n  // =================\n\n\n  $(document).on('click.bs.collapse.data-api', '[data-toggle=\"collapse\"]', function (e) {\n    var $this = $(this);\n    if (!$this.attr('data-target')) e.preventDefault();\n    var $target = getTargetFromTrigger($this);\n    var data = $target.data('bs.collapse');\n    var option = data ? 'toggle' : $this.data();\n    Plugin.call($target, option);\n  });\n}(jQuery);\n+function ($) {\n  'use strict'; // DROPDOWN CLASS DEFINITION\n  // =========================\n\n  var backdrop = '.dropdown-backdrop';\n  var toggle = '[data-toggle=\"dropdown\"]';\n\n  var Dropdown = function Dropdown(element) {\n    $(element).on('click.bs.dropdown', this.toggle);\n  };\n\n  Dropdown.VERSION = '3.3.6';\n\n  function getParent($this) {\n    var selector = $this.attr('data-target');\n\n    if (!selector) {\n      selector = $this.attr('href');\n      selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\\s]*$)/, ''); // strip for ie7\n    }\n\n    var $parent = selector && $(selector);\n    return $parent && $parent.length ? $parent : $this.parent();\n  }\n\n  function clearMenus(e) {\n    if (e && e.which === 3) return;\n    $(backdrop).remove();\n    $(toggle).each(function () {\n      var $this = $(this);\n      var $parent = getParent($this);\n      var relatedTarget = {\n        relatedTarget: this\n      };\n      if (!$parent.hasClass('open')) return;\n      if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return;\n      $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget));\n      if (e.isDefaultPrevented()) return;\n      $this.attr('aria-expanded', 'false');\n      $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget));\n    });\n  }\n\n  Dropdown.prototype.toggle = function (e) {\n    var $this = $(this);\n    if ($this.is('.disabled, :disabled')) return;\n    var $parent = getParent($this);\n    var isActive = $parent.hasClass('open');\n    clearMenus();\n\n    if (!isActive) {\n      if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {\n        // if mobile we use a backdrop because click events don't delegate\n        $(document.createElement('div')).addClass('dropdown-backdrop').insertAfter($(this)).on('click', clearMenus);\n      }\n\n      var relatedTarget = {\n        relatedTarget: this\n      };\n      $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget));\n      if (e.isDefaultPrevented()) return;\n      $this.trigger('focus').attr('aria-expanded', 'true');\n      $parent.toggleClass('open').trigger($.Event('shown.bs.dropdown', relatedTarget));\n    }\n\n    return false;\n  };\n\n  Dropdown.prototype.keydown = function (e) {\n    if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return;\n    var $this = $(this);\n    e.preventDefault();\n    e.stopPropagation();\n    if ($this.is('.disabled, :disabled')) return;\n    var $parent = getParent($this);\n    var isActive = $parent.hasClass('open');\n\n    if (!isActive && e.which != 27 || isActive && e.which == 27) {\n      if (e.which == 27) $parent.find(toggle).trigger('focus');\n      return $this.trigger('click');\n    }\n\n    var desc = ' li:not(.disabled):visible a';\n    var $items = $parent.find('.dropdown-menu' + desc);\n    if (!$items.length) return;\n    var index = $items.index(e.target);\n    if (e.which == 38 && index > 0) index--; // up\n\n    if (e.which == 40 && index < $items.length - 1) index++; // down\n\n    if (!~index) index = 0;\n    $items.eq(index).trigger('focus');\n  }; // DROPDOWN PLUGIN DEFINITION\n  // ==========================\n\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this = $(this);\n      var data = $this.data('bs.dropdown');\n      if (!data) $this.data('bs.dropdown', data = new Dropdown(this));\n      if (typeof option == 'string') data[option].call($this);\n    });\n  }\n\n  var old = $.fn.dropdown;\n  $.fn.dropdown = Plugin;\n  $.fn.dropdown.Constructor = Dropdown; // DROPDOWN NO CONFLICT\n  // ====================\n\n  $.fn.dropdown.noConflict = function () {\n    $.fn.dropdown = old;\n    return this;\n  }; // APPLY TO STANDARD DROPDOWN ELEMENTS\n  // ===================================\n\n\n  $(document).on('click.bs.dropdown.data-api', clearMenus).on('click.bs.dropdown.data-api', '.dropdown form', function (e) {\n    e.stopPropagation();\n  }).on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle).on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown).on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown);\n}(jQuery);\n+function ($) {\n  'use strict'; // MODAL CLASS DEFINITION\n  // ======================\n\n  var Modal = function Modal(element, options) {\n    this.options = options;\n    this.$body = $(document.body);\n    this.$element = $(element);\n    this.$dialog = this.$element.find('.modal-dialog');\n    this.$backdrop = null;\n    this.isShown = null;\n    this.originalBodyPad = null;\n    this.scrollbarWidth = 0;\n    this.ignoreBackdropClick = false;\n\n    if (this.options.remote) {\n      this.$element.find('.modal-content').load(this.options.remote, $.proxy(function () {\n        this.$element.trigger('loaded.bs.modal');\n      }, this));\n    }\n  };\n\n  Modal.VERSION = '3.3.6';\n  Modal.TRANSITION_DURATION = 300;\n  Modal.BACKDROP_TRANSITION_DURATION = 150;\n  Modal.DEFAULTS = {\n    backdrop: true,\n    keyboard: true,\n    show: true\n  };\n\n  Modal.prototype.toggle = function (_relatedTarget) {\n    return this.isShown ? this.hide() : this.show(_relatedTarget);\n  };\n\n  Modal.prototype.show = function (_relatedTarget) {\n    var that = this;\n    var e = $.Event('show.bs.modal', {\n      relatedTarget: _relatedTarget\n    });\n    this.$element.trigger(e);\n    if (this.isShown || e.isDefaultPrevented()) return;\n    this.isShown = true;\n    this.checkScrollbar();\n    this.setScrollbar();\n    this.$body.addClass('modal-open');\n    this.escape();\n    this.resize();\n    this.$element.on('click.dismiss.bs.modal', '[data-dismiss=\"modal\"]', $.proxy(this.hide, this));\n    this.$dialog.on('mousedown.dismiss.bs.modal', function () {\n      that.$element.one('mouseup.dismiss.bs.modal', function (e) {\n        if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true;\n      });\n    });\n    this.backdrop(function () {\n      var transition = $.support.transition && that.$element.hasClass('fade');\n\n      if (!that.$element.parent().length) {\n        that.$element.appendTo(that.$body); // don't move modals dom position\n      }\n\n      that.$element.show().scrollTop(0);\n      that.adjustDialog();\n\n      if (transition) {\n        that.$element[0].offsetWidth; // force reflow\n      }\n\n      that.$element.addClass('in');\n      that.enforceFocus();\n      var e = $.Event('shown.bs.modal', {\n        relatedTarget: _relatedTarget\n      });\n      transition ? that.$dialog // wait for modal to slide in\n      .one('bsTransitionEnd', function () {\n        that.$element.trigger('focus').trigger(e);\n      }).emulateTransitionEnd(Modal.TRANSITION_DURATION) : that.$element.trigger('focus').trigger(e);\n    });\n  };\n\n  Modal.prototype.hide = function (e) {\n    if (e) e.preventDefault();\n    e = $.Event('hide.bs.modal');\n    this.$element.trigger(e);\n    if (!this.isShown || e.isDefaultPrevented()) return;\n    this.isShown = false;\n    this.escape();\n    this.resize();\n    $(document).off('focusin.bs.modal');\n    this.$element.removeClass('in').off('click.dismiss.bs.modal').off('mouseup.dismiss.bs.modal');\n    this.$dialog.off('mousedown.dismiss.bs.modal');\n    $.support.transition && this.$element.hasClass('fade') ? this.$element.one('bsTransitionEnd', $.proxy(this.hideModal, this)).emulateTransitionEnd(Modal.TRANSITION_DURATION) : this.hideModal();\n  };\n\n  Modal.prototype.enforceFocus = function () {\n    $(document).off('focusin.bs.modal') // guard against infinite focus loop\n    .on('focusin.bs.modal', $.proxy(function (e) {\n      if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {\n        this.$element.trigger('focus');\n      }\n    }, this));\n  };\n\n  Modal.prototype.escape = function () {\n    if (this.isShown && this.options.keyboard) {\n      this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {\n        e.which == 27 && this.hide();\n      }, this));\n    } else if (!this.isShown) {\n      this.$element.off('keydown.dismiss.bs.modal');\n    }\n  };\n\n  Modal.prototype.resize = function () {\n    if (this.isShown) {\n      $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this));\n    } else {\n      $(window).off('resize.bs.modal');\n    }\n  };\n\n  Modal.prototype.hideModal = function () {\n    var that = this;\n    this.$element.hide();\n    this.backdrop(function () {\n      that.$body.removeClass('modal-open');\n      that.resetAdjustments();\n      that.resetScrollbar();\n      that.$element.trigger('hidden.bs.modal');\n    });\n  };\n\n  Modal.prototype.removeBackdrop = function () {\n    this.$backdrop && this.$backdrop.remove();\n    this.$backdrop = null;\n  };\n\n  Modal.prototype.backdrop = function (callback) {\n    var that = this;\n    var animate = this.$element.hasClass('fade') ? 'fade' : '';\n\n    if (this.isShown && this.options.backdrop) {\n      var doAnimate = $.support.transition && animate;\n      this.$backdrop = $(document.createElement('div')).addClass('modal-backdrop ' + animate).appendTo(this.$body);\n      this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {\n        if (this.ignoreBackdropClick) {\n          this.ignoreBackdropClick = false;\n          return;\n        }\n\n        if (e.target !== e.currentTarget) return;\n        this.options.backdrop == 'static' ? this.$element[0].focus() : this.hide();\n      }, this));\n      if (doAnimate) this.$backdrop[0].offsetWidth; // force reflow\n\n      this.$backdrop.addClass('in');\n      if (!callback) return;\n      doAnimate ? this.$backdrop.one('bsTransitionEnd', callback).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : callback();\n    } else if (!this.isShown && this.$backdrop) {\n      this.$backdrop.removeClass('in');\n\n      var callbackRemove = function callbackRemove() {\n        that.removeBackdrop();\n        callback && callback();\n      };\n\n      $.support.transition && this.$element.hasClass('fade') ? this.$backdrop.one('bsTransitionEnd', callbackRemove).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : callbackRemove();\n    } else if (callback) {\n      callback();\n    }\n  }; // these following methods are used to handle overflowing modals\n\n\n  Modal.prototype.handleUpdate = function () {\n    this.adjustDialog();\n  };\n\n  Modal.prototype.adjustDialog = function () {\n    var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight;\n    this.$element.css({\n      paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',\n      paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''\n    });\n  };\n\n  Modal.prototype.resetAdjustments = function () {\n    this.$element.css({\n      paddingLeft: '',\n      paddingRight: ''\n    });\n  };\n\n  Modal.prototype.checkScrollbar = function () {\n    var fullWindowWidth = window.innerWidth;\n\n    if (!fullWindowWidth) {\n      // workaround for missing window.innerWidth in IE8\n      var documentElementRect = document.documentElement.getBoundingClientRect();\n      fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left);\n    }\n\n    this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth;\n    this.scrollbarWidth = this.measureScrollbar();\n  };\n\n  Modal.prototype.setScrollbar = function () {\n    var bodyPad = parseInt(this.$body.css('padding-right') || 0, 10);\n    this.originalBodyPad = document.body.style.paddingRight || '';\n    if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth);\n  };\n\n  Modal.prototype.resetScrollbar = function () {\n    this.$body.css('padding-right', this.originalBodyPad);\n  };\n\n  Modal.prototype.measureScrollbar = function () {\n    // thx walsh\n    var scrollDiv = document.createElement('div');\n    scrollDiv.className = 'modal-scrollbar-measure';\n    this.$body.append(scrollDiv);\n    var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;\n    this.$body[0].removeChild(scrollDiv);\n    return scrollbarWidth;\n  }; // MODAL PLUGIN DEFINITION\n  // =======================\n\n\n  function Plugin(option, _relatedTarget) {\n    return this.each(function () {\n      var $this = $(this);\n      var data = $this.data('bs.modal');\n      var options = $.extend({}, Modal.DEFAULTS, $this.data(), _typeof(option) == 'object' && option);\n      if (!data) $this.data('bs.modal', data = new Modal(this, options));\n      if (typeof option == 'string') data[option](_relatedTarget);else if (options.show) data.show(_relatedTarget);\n    });\n  }\n\n  var old = $.fn.modal;\n  $.fn.modal = Plugin;\n  $.fn.modal.Constructor = Modal; // MODAL NO CONFLICT\n  // =================\n\n  $.fn.modal.noConflict = function () {\n    $.fn.modal = old;\n    return this;\n  }; // MODAL DATA-API\n  // ==============\n\n\n  $(document).on('click.bs.modal.data-api', '[data-toggle=\"modal\"]', function (e) {\n    var $this = $(this);\n    var href = $this.attr('href');\n    var $target = $($this.attr('data-target') || href && href.replace(/.*(?=#[^\\s]+$)/, '')); // strip for ie7\n\n    var option = $target.data('bs.modal') ? 'toggle' : $.extend({\n      remote: !/#/.test(href) && href\n    }, $target.data(), $this.data());\n    if ($this.is('a')) e.preventDefault();\n    $target.one('show.bs.modal', function (showEvent) {\n      if (showEvent.isDefaultPrevented()) return; // only register focus restorer if modal will actually get shown\n\n      $target.one('hidden.bs.modal', function () {\n        $this.is(':visible') && $this.trigger('focus');\n      });\n    });\n    Plugin.call($target, option, this);\n  });\n}(jQuery);\n+function ($) {\n  'use strict'; // TOOLTIP PUBLIC CLASS DEFINITION\n  // ===============================\n\n  var Tooltip = function Tooltip(element, options) {\n    this.type = null;\n    this.options = null;\n    this.enabled = null;\n    this.timeout = null;\n    this.hoverState = null;\n    this.$element = null;\n    this.inState = null;\n    this.init('tooltip', element, options);\n  };\n\n  Tooltip.VERSION = '3.3.6';\n  Tooltip.TRANSITION_DURATION = 150;\n  Tooltip.DEFAULTS = {\n    animation: true,\n    placement: 'top',\n    selector: false,\n    template: '<div class=\"tooltip\" role=\"tooltip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\"></div></div>',\n    trigger: 'hover focus',\n    title: '',\n    delay: 0,\n    html: false,\n    container: false,\n    viewport: {\n      selector: 'body',\n      padding: 0\n    }\n  };\n\n  Tooltip.prototype.init = function (type, element, options) {\n    this.enabled = true;\n    this.type = type;\n    this.$element = $(element);\n    this.options = this.getOptions(options);\n    this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : this.options.viewport.selector || this.options.viewport);\n    this.inState = {\n      click: false,\n      hover: false,\n      focus: false\n    };\n\n    if (this.$element[0] instanceof document.constructor && !this.options.selector) {\n      throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!');\n    }\n\n    var triggers = this.options.trigger.split(' ');\n\n    for (var i = triggers.length; i--;) {\n      var trigger = triggers[i];\n\n      if (trigger == 'click') {\n        this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this));\n      } else if (trigger != 'manual') {\n        var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin';\n        var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout';\n        this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this));\n        this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this));\n      }\n    }\n\n    this.options.selector ? this._options = $.extend({}, this.options, {\n      trigger: 'manual',\n      selector: ''\n    }) : this.fixTitle();\n  };\n\n  Tooltip.prototype.getDefaults = function () {\n    return Tooltip.DEFAULTS;\n  };\n\n  Tooltip.prototype.getOptions = function (options) {\n    options = $.extend({}, this.getDefaults(), this.$element.data(), options);\n\n    if (options.delay && typeof options.delay == 'number') {\n      options.delay = {\n        show: options.delay,\n        hide: options.delay\n      };\n    }\n\n    return options;\n  };\n\n  Tooltip.prototype.getDelegateOptions = function () {\n    var options = {};\n    var defaults = this.getDefaults();\n    this._options && $.each(this._options, function (key, value) {\n      if (defaults[key] != value) options[key] = value;\n    });\n    return options;\n  };\n\n  Tooltip.prototype.enter = function (obj) {\n    var self = obj instanceof this.constructor ? obj : $(obj.currentTarget).data('bs.' + this.type);\n\n    if (!self) {\n      self = new this.constructor(obj.currentTarget, this.getDelegateOptions());\n      $(obj.currentTarget).data('bs.' + this.type, self);\n    }\n\n    if (obj instanceof $.Event) {\n      self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true;\n    }\n\n    if (self.tip().hasClass('in') || self.hoverState == 'in') {\n      self.hoverState = 'in';\n      return;\n    }\n\n    clearTimeout(self.timeout);\n    self.hoverState = 'in';\n    if (!self.options.delay || !self.options.delay.show) return self.show();\n    self.timeout = setTimeout(function () {\n      if (self.hoverState == 'in') self.show();\n    }, self.options.delay.show);\n  };\n\n  Tooltip.prototype.isInStateTrue = function () {\n    for (var key in this.inState) {\n      if (this.inState[key]) return true;\n    }\n\n    return false;\n  };\n\n  Tooltip.prototype.leave = function (obj) {\n    var self = obj instanceof this.constructor ? obj : $(obj.currentTarget).data('bs.' + this.type);\n\n    if (!self) {\n      self = new this.constructor(obj.currentTarget, this.getDelegateOptions());\n      $(obj.currentTarget).data('bs.' + this.type, self);\n    }\n\n    if (obj instanceof $.Event) {\n      self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false;\n    }\n\n    if (self.isInStateTrue()) return;\n    clearTimeout(self.timeout);\n    self.hoverState = 'out';\n    if (!self.options.delay || !self.options.delay.hide) return self.hide();\n    self.timeout = setTimeout(function () {\n      if (self.hoverState == 'out') self.hide();\n    }, self.options.delay.hide);\n  };\n\n  Tooltip.prototype.show = function () {\n    var e = $.Event('show.bs.' + this.type);\n\n    if (this.hasContent() && this.enabled) {\n      this.$element.trigger(e);\n      var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]);\n      if (e.isDefaultPrevented() || !inDom) return;\n      var that = this;\n      var $tip = this.tip();\n      var tipId = this.getUID(this.type);\n      this.setContent();\n      $tip.attr('id', tipId);\n      this.$element.attr('aria-describedby', tipId);\n      if (this.options.animation) $tip.addClass('fade');\n      var placement = typeof this.options.placement == 'function' ? this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement;\n      var autoToken = /\\s?auto?\\s?/i;\n      var autoPlace = autoToken.test(placement);\n      if (autoPlace) placement = placement.replace(autoToken, '') || 'top';\n      $tip.detach().css({\n        top: 0,\n        left: 0,\n        display: 'block'\n      }).addClass(placement).data('bs.' + this.type, this);\n      this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element);\n      this.$element.trigger('inserted.bs.' + this.type);\n      var pos = this.getPosition();\n      var actualWidth = $tip[0].offsetWidth;\n      var actualHeight = $tip[0].offsetHeight;\n\n      if (autoPlace) {\n        var orgPlacement = placement;\n        var viewportDim = this.getPosition(this.$viewport);\n        placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : placement;\n        $tip.removeClass(orgPlacement).addClass(placement);\n      }\n\n      var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight);\n      this.applyPlacement(calculatedOffset, placement);\n\n      var complete = function complete() {\n        var prevHoverState = that.hoverState;\n        that.$element.trigger('shown.bs.' + that.type);\n        that.hoverState = null;\n        if (prevHoverState == 'out') that.leave(that);\n      };\n\n      $.support.transition && this.$tip.hasClass('fade') ? $tip.one('bsTransitionEnd', complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete();\n    }\n  };\n\n  Tooltip.prototype.applyPlacement = function (offset, placement) {\n    var $tip = this.tip();\n    var width = $tip[0].offsetWidth;\n    var height = $tip[0].offsetHeight; // manually read margins because getBoundingClientRect includes difference\n\n    var marginTop = parseInt($tip.css('margin-top'), 10);\n    var marginLeft = parseInt($tip.css('margin-left'), 10); // we must check for NaN for ie 8/9\n\n    if (isNaN(marginTop)) marginTop = 0;\n    if (isNaN(marginLeft)) marginLeft = 0;\n    offset.top += marginTop;\n    offset.left += marginLeft; // $.fn.offset doesn't round pixel values\n    // so we use setOffset directly with our own function B-0\n\n    $.offset.setOffset($tip[0], $.extend({\n      using: function using(props) {\n        $tip.css({\n          top: Math.round(props.top),\n          left: Math.round(props.left)\n        });\n      }\n    }, offset), 0);\n    $tip.addClass('in'); // check to see if placing tip in new offset caused the tip to resize itself\n\n    var actualWidth = $tip[0].offsetWidth;\n    var actualHeight = $tip[0].offsetHeight;\n\n    if (placement == 'top' && actualHeight != height) {\n      offset.top = offset.top + height - actualHeight;\n    }\n\n    var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight);\n    if (delta.left) offset.left += delta.left;else offset.top += delta.top;\n    var isVertical = /top|bottom/.test(placement);\n    var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight;\n    var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight';\n    $tip.offset(offset);\n    this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical);\n  };\n\n  Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {\n    this.arrow().css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%').css(isVertical ? 'top' : 'left', '');\n  };\n\n  Tooltip.prototype.setContent = function () {\n    var $tip = this.tip();\n    var title = this.getTitle();\n\n    if ((title !== null && title !== void 0 ? title : \"\").includes(\"=>\")) {\n      var htmlContent = _h.createNodeTooltip(title);\n\n      $tip.find('.tooltip-inner')['html'](htmlContent);\n    } else {\n      $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title);\n    }\n\n    $tip.removeClass('fade in top bottom left right');\n  };\n\n  Tooltip.prototype.hide = function (callback) {\n    var that = this;\n    var $tip = $(this.$tip);\n    var e = $.Event('hide.bs.' + this.type);\n\n    function complete() {\n      if (that.hoverState != 'in') $tip.detach();\n      that.$element.removeAttr('aria-describedby').trigger('hidden.bs.' + that.type);\n      callback && callback();\n    }\n\n    this.$element.trigger(e);\n    if (e.isDefaultPrevented()) return;\n    $tip.removeClass('in');\n    $.support.transition && $tip.hasClass('fade') ? $tip.one('bsTransitionEnd', complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete();\n    this.hoverState = null;\n    return this;\n  };\n\n  Tooltip.prototype.fixTitle = function () {\n    var $e = this.$element;\n\n    if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {\n      $e.attr('data-original-title', $e.attr('title') || '').attr('title', '');\n    }\n  };\n\n  Tooltip.prototype.hasContent = function () {\n    return this.getTitle();\n  };\n\n  Tooltip.prototype.getPosition = function ($element) {\n    $element = $element || this.$element;\n    var el = $element[0];\n    var isBody = el.tagName == 'BODY';\n    var elRect = el.getBoundingClientRect();\n\n    if (elRect.width == null) {\n      // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093\n      elRect = $.extend({}, elRect, {\n        width: elRect.right - elRect.left,\n        height: elRect.bottom - elRect.top\n      });\n    }\n\n    var elOffset = isBody ? {\n      top: 0,\n      left: 0\n    } : $element.offset();\n    var scroll = {\n      scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop()\n    };\n    var outerDims = isBody ? {\n      width: $(window).width(),\n      height: $(window).height()\n    } : null;\n    return $.extend({}, elRect, scroll, outerDims, elOffset);\n  };\n\n  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {\n    return placement == 'bottom' ? {\n      top: pos.top + pos.height,\n      left: pos.left + pos.width / 2 - actualWidth / 2\n    } : placement == 'top' ? {\n      top: pos.top - actualHeight,\n      left: pos.left + pos.width / 2 - actualWidth / 2\n    } : placement == 'left' ? {\n      top: pos.top + pos.height / 2 - actualHeight / 2,\n      left: pos.left - actualWidth\n    } :\n    /* placement == 'right' */\n    {\n      top: pos.top + pos.height / 2 - actualHeight / 2,\n      left: pos.left + pos.width\n    };\n  };\n\n  Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {\n    var delta = {\n      top: 0,\n      left: 0\n    };\n    if (!this.$viewport) return delta;\n    var viewportPadding = this.options.viewport && this.options.viewport.padding || 0;\n    var viewportDimensions = this.getPosition(this.$viewport);\n\n    if (/right|left/.test(placement)) {\n      var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll;\n      var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight;\n\n      if (topEdgeOffset < viewportDimensions.top) {\n        // top overflow\n        delta.top = viewportDimensions.top - topEdgeOffset;\n      } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) {\n        // bottom overflow\n        delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset;\n      }\n    } else {\n      var leftEdgeOffset = pos.left - viewportPadding;\n      var rightEdgeOffset = pos.left + viewportPadding + actualWidth;\n\n      if (leftEdgeOffset < viewportDimensions.left) {\n        // left overflow\n        delta.left = viewportDimensions.left - leftEdgeOffset;\n      } else if (rightEdgeOffset > viewportDimensions.right) {\n        // right overflow\n        delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset;\n      }\n    }\n\n    return delta;\n  };\n\n  Tooltip.prototype.getTitle = function () {\n    var title;\n    var $e = this.$element;\n    var o = this.options;\n    title = $e.attr('data-original-title') || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title);\n    return title;\n  };\n\n  Tooltip.prototype.getUID = function (prefix) {\n    do {\n      prefix += ~~(Math.random() * 1000000);\n    } while (document.getElementById(prefix));\n\n    return prefix;\n  };\n\n  Tooltip.prototype.tip = function () {\n    if (!this.$tip) {\n      this.$tip = $(this.options.template);\n\n      if (this.$tip.length != 1) {\n        throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!');\n      }\n    }\n\n    return this.$tip;\n  };\n\n  Tooltip.prototype.arrow = function () {\n    return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow');\n  };\n\n  Tooltip.prototype.enable = function () {\n    this.enabled = true;\n  };\n\n  Tooltip.prototype.disable = function () {\n    this.enabled = false;\n  };\n\n  Tooltip.prototype.toggleEnabled = function () {\n    this.enabled = !this.enabled;\n  };\n\n  Tooltip.prototype.toggle = function (e) {\n    var self = this;\n\n    if (e) {\n      self = $(e.currentTarget).data('bs.' + this.type);\n\n      if (!self) {\n        self = new this.constructor(e.currentTarget, this.getDelegateOptions());\n        $(e.currentTarget).data('bs.' + this.type, self);\n      }\n    }\n\n    if (e) {\n      self.inState.click = !self.inState.click;\n      if (self.isInStateTrue()) self.enter(self);else self.leave(self);\n    } else {\n      self.tip().hasClass('in') ? self.leave(self) : self.enter(self);\n    }\n  };\n\n  Tooltip.prototype.destroy = function () {\n    var that = this;\n    clearTimeout(this.timeout);\n    this.hide(function () {\n      that.$element.off('.' + that.type).removeData('bs.' + that.type);\n\n      if (that.$tip) {\n        that.$tip.detach();\n      }\n\n      that.$tip = null;\n      that.$arrow = null;\n      that.$viewport = null;\n    });\n  }; // TOOLTIP PLUGIN DEFINITION\n  // =========================\n\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this = $(this);\n      var data = $this.data('bs.tooltip');\n      var options = _typeof(option) == 'object' && option;\n      if (!data && /destroy|hide/.test(option)) return;\n      if (!data) $this.data('bs.tooltip', data = new Tooltip(this, options));\n      if (typeof option == 'string') data[option]();\n    });\n  }\n\n  var old = $.fn.tooltip;\n  $.fn.tooltip = Plugin;\n  $.fn.tooltip.Constructor = Tooltip; // TOOLTIP NO CONFLICT\n  // ===================\n\n  $.fn.tooltip.noConflict = function () {\n    $.fn.tooltip = old;\n    return this;\n  };\n}(jQuery);\n+function ($) {\n  'use strict'; // POPOVER PUBLIC CLASS DEFINITION\n  // ===============================\n\n  var Popover = function Popover(element, options) {\n    this.init('popover', element, options);\n  };\n\n  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js');\n  Popover.VERSION = '3.3.6';\n  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {\n    placement: 'right',\n    trigger: 'click',\n    content: '',\n    template: '<div class=\"popover\" role=\"tooltip\"><div class=\"arrow\"></div><h3 class=\"popover-title\"></h3><div class=\"popover-content\"></div></div>'\n  }); // NOTE: POPOVER EXTENDS tooltip.js\n  // ================================\n\n  Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype);\n  Popover.prototype.constructor = Popover;\n\n  Popover.prototype.getDefaults = function () {\n    return Popover.DEFAULTS;\n  };\n\n  Popover.prototype.setContent = function () {\n    var $tip = this.tip();\n    var title = this.getTitle();\n    var content = this.getContent();\n    $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title);\n    $tip.find('.popover-content').children().detach().end()[// we use append for html objects to maintain js events\n    this.options.html ? typeof content == 'string' ? 'html' : 'append' : 'text'](content);\n    $tip.removeClass('fade top bottom left right in'); // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do\n    // this manually by checking the contents.\n\n    if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide();\n  };\n\n  Popover.prototype.hasContent = function () {\n    return this.getTitle() || this.getContent();\n  };\n\n  Popover.prototype.getContent = function () {\n    var $e = this.$element;\n    var o = this.options;\n    return $e.attr('data-content') || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content);\n  };\n\n  Popover.prototype.arrow = function () {\n    return this.$arrow = this.$arrow || this.tip().find('.arrow');\n  }; // POPOVER PLUGIN DEFINITION\n  // =========================\n\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this = $(this);\n      var data = $this.data('bs.popover');\n      var options = _typeof(option) == 'object' && option;\n      if (!data && /destroy|hide/.test(option)) return;\n      if (!data) $this.data('bs.popover', data = new Popover(this, options));\n      if (typeof option == 'string') data[option]();\n    });\n  }\n\n  var old = $.fn.popover;\n  $.fn.popover = Plugin;\n  $.fn.popover.Constructor = Popover; // POPOVER NO CONFLICT\n  // ===================\n\n  $.fn.popover.noConflict = function () {\n    $.fn.popover = old;\n    return this;\n  };\n}(jQuery);\n+function ($) {\n  'use strict'; // SCROLLSPY CLASS DEFINITION\n  // ==========================\n\n  function ScrollSpy(element, options) {\n    this.$body = $(document.body);\n    this.$scrollElement = $(element).is(document.body) ? $(window) : $(element);\n    this.options = $.extend({}, ScrollSpy.DEFAULTS, options);\n    this.selector = (this.options.target || '') + ' .nav li > a';\n    this.offsets = [];\n    this.targets = [];\n    this.activeTarget = null;\n    this.scrollHeight = 0;\n    this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this));\n    this.refresh();\n    this.process();\n  }\n\n  ScrollSpy.VERSION = '3.3.6';\n  ScrollSpy.DEFAULTS = {\n    offset: 10\n  };\n\n  ScrollSpy.prototype.getScrollHeight = function () {\n    return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight);\n  };\n\n  ScrollSpy.prototype.refresh = function () {\n    var that = this;\n    var offsetMethod = 'offset';\n    var offsetBase = 0;\n    this.offsets = [];\n    this.targets = [];\n    this.scrollHeight = this.getScrollHeight();\n\n    if (!$.isWindow(this.$scrollElement[0])) {\n      offsetMethod = 'position';\n      offsetBase = this.$scrollElement.scrollTop();\n    }\n\n    this.$body.find(this.selector).map(function () {\n      var $el = $(this);\n      var href = $el.data('target') || $el.attr('href');\n      var $href = /^#./.test(href) && $(href);\n      return $href && $href.length && $href.is(':visible') && [[$href[offsetMethod]().top + offsetBase, href]] || null;\n    }).sort(function (a, b) {\n      return a[0] - b[0];\n    }).each(function () {\n      that.offsets.push(this[0]);\n      that.targets.push(this[1]);\n    });\n  };\n\n  ScrollSpy.prototype.process = function () {\n    var scrollTop = this.$scrollElement.scrollTop() + this.options.offset;\n    var scrollHeight = this.getScrollHeight();\n    var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height();\n    var offsets = this.offsets;\n    var targets = this.targets;\n    var activeTarget = this.activeTarget;\n    var i;\n\n    if (this.scrollHeight != scrollHeight) {\n      this.refresh();\n    }\n\n    if (scrollTop >= maxScroll) {\n      return activeTarget != (i = targets[targets.length - 1]) && this.activate(i);\n    }\n\n    if (activeTarget && scrollTop < offsets[0]) {\n      this.activeTarget = null;\n      return this.clear();\n    }\n\n    for (i = offsets.length; i--;) {\n      activeTarget != targets[i] && scrollTop >= offsets[i] && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) && this.activate(targets[i]);\n    }\n  };\n\n  ScrollSpy.prototype.activate = function (target) {\n    this.activeTarget = target;\n    this.clear();\n    var selector = this.selector + '[data-target=\"' + target + '\"],' + this.selector + '[href=\"' + target + '\"]';\n    var active = $(selector).parents('li').addClass('active');\n\n    if (active.parent('.dropdown-menu').length) {\n      active = active.closest('li.dropdown').addClass('active');\n    }\n\n    active.trigger('activate.bs.scrollspy');\n  };\n\n  ScrollSpy.prototype.clear = function () {\n    $(this.selector).parentsUntil(this.options.target, '.active').removeClass('active');\n  }; // SCROLLSPY PLUGIN DEFINITION\n  // ===========================\n\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this = $(this);\n      var data = $this.data('bs.scrollspy');\n      var options = _typeof(option) == 'object' && option;\n      if (!data) $this.data('bs.scrollspy', data = new ScrollSpy(this, options));\n      if (typeof option == 'string') data[option]();\n    });\n  }\n\n  var old = $.fn.scrollspy;\n  $.fn.scrollspy = Plugin;\n  $.fn.scrollspy.Constructor = ScrollSpy; // SCROLLSPY NO CONFLICT\n  // =====================\n\n  $.fn.scrollspy.noConflict = function () {\n    $.fn.scrollspy = old;\n    return this;\n  }; // SCROLLSPY DATA-API\n  // ==================\n\n\n  $(window).on('load.bs.scrollspy.data-api', function () {\n    $('[data-spy=\"scroll\"]').each(function () {\n      var $spy = $(this);\n      Plugin.call($spy, $spy.data());\n    });\n  });\n}(jQuery);\n+function ($) {\n  'use strict'; // TAB CLASS DEFINITION\n  // ====================\n\n  var Tab = function Tab(element) {\n    // jscs:disable requireDollarBeforejQueryAssignment\n    this.element = $(element); // jscs:enable requireDollarBeforejQueryAssignment\n  };\n\n  Tab.VERSION = '3.3.6';\n  Tab.TRANSITION_DURATION = 150;\n\n  Tab.prototype.show = function () {\n    var $this = this.element;\n    var $ul = $this.closest('ul:not(.dropdown-menu)');\n    var selector = $this.data('target');\n\n    if (!selector) {\n      selector = $this.attr('href');\n      selector = selector && selector.replace(/.*(?=#[^\\s]*$)/, ''); // strip for ie7\n    }\n\n    if ($this.parent('li').hasClass('active')) return;\n    var $previous = $ul.find('.active:last a');\n    var hideEvent = $.Event('hide.bs.tab', {\n      relatedTarget: $this[0]\n    });\n    var showEvent = $.Event('show.bs.tab', {\n      relatedTarget: $previous[0]\n    });\n    $previous.trigger(hideEvent);\n    $this.trigger(showEvent);\n    if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return;\n    var $target = $(selector);\n    this.activate($this.closest('li'), $ul);\n    this.activate($target, $target.parent(), function () {\n      $previous.trigger({\n        type: 'hidden.bs.tab',\n        relatedTarget: $this[0]\n      });\n      $this.trigger({\n        type: 'shown.bs.tab',\n        relatedTarget: $previous[0]\n      });\n    });\n  };\n\n  Tab.prototype.activate = function (element, container, callback) {\n    var $active = container.find('> .active');\n    var transition = callback && $.support.transition && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length);\n\n    function next() {\n      $active.removeClass('active').find('> .dropdown-menu > .active').removeClass('active').end().find('[data-toggle=\"tab\"]').attr('aria-expanded', false);\n      element.addClass('active').find('[data-toggle=\"tab\"]').attr('aria-expanded', true);\n\n      if (transition) {\n        element[0].offsetWidth; // reflow for transition\n\n        element.addClass('in');\n      } else {\n        element.removeClass('fade');\n      }\n\n      if (element.parent('.dropdown-menu').length) {\n        element.closest('li.dropdown').addClass('active').end().find('[data-toggle=\"tab\"]').attr('aria-expanded', true);\n      }\n\n      callback && callback();\n    }\n\n    $active.length && transition ? $active.one('bsTransitionEnd', next).emulateTransitionEnd(Tab.TRANSITION_DURATION) : next();\n    $active.removeClass('in');\n  }; // TAB PLUGIN DEFINITION\n  // =====================\n\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this = $(this);\n      var data = $this.data('bs.tab');\n      if (!data) $this.data('bs.tab', data = new Tab(this));\n      if (typeof option == 'string') data[option]();\n    });\n  }\n\n  var old = $.fn.tab;\n  $.fn.tab = Plugin;\n  $.fn.tab.Constructor = Tab; // TAB NO CONFLICT\n  // ===============\n\n  $.fn.tab.noConflict = function () {\n    $.fn.tab = old;\n    return this;\n  }; // TAB DATA-API\n  // ============\n\n\n  var clickHandler = function clickHandler(e) {\n    e.preventDefault();\n    Plugin.call($(this), 'show');\n  };\n\n  $(document).on('click.bs.tab.data-api', '[data-toggle=\"tab\"]', clickHandler).on('click.bs.tab.data-api', '[data-toggle=\"pill\"]', clickHandler);\n}(jQuery);\n+function ($) {\n  'use strict'; // AFFIX CLASS DEFINITION\n  // ======================\n\n  var Affix = function Affix(element, options) {\n    this.options = $.extend({}, Affix.DEFAULTS, options);\n    this.$target = $(this.options.target).on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)).on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this));\n    this.$element = $(element);\n    this.affixed = null;\n    this.unpin = null;\n    this.pinnedOffset = null;\n    this.checkPosition();\n  };\n\n  Affix.VERSION = '3.3.6';\n  Affix.RESET = 'affix affix-top affix-bottom';\n  Affix.DEFAULTS = {\n    offset: 0,\n    target: window\n  };\n\n  Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {\n    var scrollTop = this.$target.scrollTop();\n    var position = this.$element.offset();\n    var targetHeight = this.$target.height();\n    if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false;\n\n    if (this.affixed == 'bottom') {\n      if (offsetTop != null) return scrollTop + this.unpin <= position.top ? false : 'bottom';\n      return scrollTop + targetHeight <= scrollHeight - offsetBottom ? false : 'bottom';\n    }\n\n    var initializing = this.affixed == null;\n    var colliderTop = initializing ? scrollTop : position.top;\n    var colliderHeight = initializing ? targetHeight : height;\n    if (offsetTop != null && scrollTop <= offsetTop) return 'top';\n    if (offsetBottom != null && colliderTop + colliderHeight >= scrollHeight - offsetBottom) return 'bottom';\n    return false;\n  };\n\n  Affix.prototype.getPinnedOffset = function () {\n    if (this.pinnedOffset) return this.pinnedOffset;\n    this.$element.removeClass(Affix.RESET).addClass('affix');\n    var scrollTop = this.$target.scrollTop();\n    var position = this.$element.offset();\n    return this.pinnedOffset = position.top - scrollTop;\n  };\n\n  Affix.prototype.checkPositionWithEventLoop = function () {\n    setTimeout($.proxy(this.checkPosition, this), 1);\n  };\n\n  Affix.prototype.checkPosition = function () {\n    if (!this.$element.is(':visible')) return;\n    var height = this.$element.height();\n    var offset = this.options.offset;\n    var offsetTop = offset.top;\n    var offsetBottom = offset.bottom;\n    var scrollHeight = Math.max($(document).height(), $(document.body).height());\n    if (_typeof(offset) != 'object') offsetBottom = offsetTop = offset;\n    if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element);\n    if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element);\n    var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom);\n\n    if (this.affixed != affix) {\n      if (this.unpin != null) this.$element.css('top', '');\n      var affixType = 'affix' + (affix ? '-' + affix : '');\n      var e = $.Event(affixType + '.bs.affix');\n      this.$element.trigger(e);\n      if (e.isDefaultPrevented()) return;\n      this.affixed = affix;\n      this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null;\n      this.$element.removeClass(Affix.RESET).addClass(affixType).trigger(affixType.replace('affix', 'affixed') + '.bs.affix');\n    }\n\n    if (affix == 'bottom') {\n      this.$element.offset({\n        top: scrollHeight - height - offsetBottom\n      });\n    }\n  }; // AFFIX PLUGIN DEFINITION\n  // =======================\n\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this = $(this);\n      var data = $this.data('bs.affix');\n      var options = _typeof(option) == 'object' && option;\n      if (!data) $this.data('bs.affix', data = new Affix(this, options));\n      if (typeof option == 'string') data[option]();\n    });\n  }\n\n  var old = $.fn.affix;\n  $.fn.affix = Plugin;\n  $.fn.affix.Constructor = Affix; // AFFIX NO CONFLICT\n  // =================\n\n  $.fn.affix.noConflict = function () {\n    $.fn.affix = old;\n    return this;\n  }; // AFFIX DATA-API\n  // ==============\n\n\n  $(window).on('load', function () {\n    $('[data-spy=\"affix\"]').each(function () {\n      var $spy = $(this);\n      var data = $spy.data();\n      data.offset = data.offset || {};\n      if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom;\n      if (data.offsetTop != null) data.offset.top = data.offsetTop;\n      Plugin.call($spy, data);\n    });\n  });\n}(jQuery);\n\n//# sourceURL=webpack://domino/./src/scripts/vendors/bootstrap.js?");

/***/ }),

/***/ "./src/scripts/vendors/jquery-ui.min.js":
/*!**********************************************!*\
  !*** ./src/scripts/vendors/jquery-ui.min.js ***!
  \**********************************************/
/***/ ((module, exports, __webpack_require__) => {

eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (t) {\n   true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")], __WEBPACK_AMD_DEFINE_FACTORY__ = (t),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;\n})(function (t) {\n  t.ui = t.ui || {}, t.ui.version = \"1.12.1\";\n  var e = 0,\n      i = Array.prototype.slice;\n  t.cleanData = function (e) {\n    return function (i) {\n      var s, n, o;\n\n      for (o = 0; null != (n = i[o]); o++) {\n        try {\n          s = t._data(n, \"events\"), s && s.remove && t(n).triggerHandler(\"remove\");\n        } catch (a) {}\n      }\n\n      e(i);\n    };\n  }(t.cleanData), t.widget = function (e, i, s) {\n    var n,\n        o,\n        a,\n        r = {},\n        h = e.split(\".\")[0];\n    e = e.split(\".\")[1];\n    var l = h + \"-\" + e;\n    return s || (s = i, i = t.Widget), t.isArray(s) && (s = t.extend.apply(null, [{}].concat(s))), t.expr[\":\"][l.toLowerCase()] = function (e) {\n      return !!t.data(e, l);\n    }, t[h] = t[h] || {}, n = t[h][e], o = t[h][e] = function (t, e) {\n      return this._createWidget ? (arguments.length && this._createWidget(t, e), void 0) : new o(t, e);\n    }, t.extend(o, n, {\n      version: s.version,\n      _proto: t.extend({}, s),\n      _childConstructors: []\n    }), a = new i(), a.options = t.widget.extend({}, a.options), t.each(s, function (e, s) {\n      return t.isFunction(s) ? (r[e] = function () {\n        function t() {\n          return i.prototype[e].apply(this, arguments);\n        }\n\n        function n(t) {\n          return i.prototype[e].apply(this, t);\n        }\n\n        return function () {\n          var e,\n              i = this._super,\n              o = this._superApply;\n          return this._super = t, this._superApply = n, e = s.apply(this, arguments), this._super = i, this._superApply = o, e;\n        };\n      }(), void 0) : (r[e] = s, void 0);\n    }), o.prototype = t.widget.extend(a, {\n      widgetEventPrefix: n ? a.widgetEventPrefix || e : e\n    }, r, {\n      constructor: o,\n      namespace: h,\n      widgetName: e,\n      widgetFullName: l\n    }), n ? (t.each(n._childConstructors, function (e, i) {\n      var s = i.prototype;\n      t.widget(s.namespace + \".\" + s.widgetName, o, i._proto);\n    }), delete n._childConstructors) : i._childConstructors.push(o), t.widget.bridge(e, o), o;\n  }, t.widget.extend = function (e) {\n    for (var s, n, o = i.call(arguments, 1), a = 0, r = o.length; r > a; a++) {\n      for (s in o[a]) {\n        n = o[a][s], o[a].hasOwnProperty(s) && void 0 !== n && (e[s] = t.isPlainObject(n) ? t.isPlainObject(e[s]) ? t.widget.extend({}, e[s], n) : t.widget.extend({}, n) : n);\n      }\n    }\n\n    return e;\n  }, t.widget.bridge = function (e, s) {\n    var n = s.prototype.widgetFullName || e;\n\n    t.fn[e] = function (o) {\n      var a = \"string\" == typeof o,\n          r = i.call(arguments, 1),\n          h = this;\n      return a ? this.length || \"instance\" !== o ? this.each(function () {\n        var i,\n            s = t.data(this, n);\n        return \"instance\" === o ? (h = s, !1) : s ? t.isFunction(s[o]) && \"_\" !== o.charAt(0) ? (i = s[o].apply(s, r), i !== s && void 0 !== i ? (h = i && i.jquery ? h.pushStack(i.get()) : i, !1) : void 0) : t.error(\"no such method '\" + o + \"' for \" + e + \" widget instance\") : t.error(\"cannot call methods on \" + e + \" prior to initialization; \" + \"attempted to call method '\" + o + \"'\");\n      }) : h = void 0 : (r.length && (o = t.widget.extend.apply(null, [o].concat(r))), this.each(function () {\n        var e = t.data(this, n);\n        e ? (e.option(o || {}), e._init && e._init()) : t.data(this, n, new s(o, this));\n      })), h;\n    };\n  }, t.Widget = function () {}, t.Widget._childConstructors = [], t.Widget.prototype = {\n    widgetName: \"widget\",\n    widgetEventPrefix: \"\",\n    defaultElement: \"<div>\",\n    options: {\n      classes: {},\n      disabled: !1,\n      create: null\n    },\n    _createWidget: function _createWidget(i, s) {\n      s = t(s || this.defaultElement || this)[0], this.element = t(s), this.uuid = e++, this.eventNamespace = \".\" + this.widgetName + this.uuid, this.bindings = t(), this.hoverable = t(), this.focusable = t(), this.classesElementLookup = {}, s !== this && (t.data(s, this.widgetFullName, this), this._on(!0, this.element, {\n        remove: function remove(t) {\n          t.target === s && this.destroy();\n        }\n      }), this.document = t(s.style ? s.ownerDocument : s.document || s), this.window = t(this.document[0].defaultView || this.document[0].parentWindow)), this.options = t.widget.extend({}, this.options, this._getCreateOptions(), i), this._create(), this.options.disabled && this._setOptionDisabled(this.options.disabled), this._trigger(\"create\", null, this._getCreateEventData()), this._init();\n    },\n    _getCreateOptions: function _getCreateOptions() {\n      return {};\n    },\n    _getCreateEventData: t.noop,\n    _create: t.noop,\n    _init: t.noop,\n    destroy: function destroy() {\n      var e = this;\n      this._destroy(), t.each(this.classesElementLookup, function (t, i) {\n        e._removeClass(i, t);\n      }), this.element.off(this.eventNamespace).removeData(this.widgetFullName), this.widget().off(this.eventNamespace).removeAttr(\"aria-disabled\"), this.bindings.off(this.eventNamespace);\n    },\n    _destroy: t.noop,\n    widget: function widget() {\n      return this.element;\n    },\n    option: function option(e, i) {\n      var s,\n          n,\n          o,\n          a = e;\n      if (0 === arguments.length) return t.widget.extend({}, this.options);\n      if (\"string\" == typeof e) if (a = {}, s = e.split(\".\"), e = s.shift(), s.length) {\n        for (n = a[e] = t.widget.extend({}, this.options[e]), o = 0; s.length - 1 > o; o++) {\n          n[s[o]] = n[s[o]] || {}, n = n[s[o]];\n        }\n\n        if (e = s.pop(), 1 === arguments.length) return void 0 === n[e] ? null : n[e];\n        n[e] = i;\n      } else {\n        if (1 === arguments.length) return void 0 === this.options[e] ? null : this.options[e];\n        a[e] = i;\n      }\n      return this._setOptions(a), this;\n    },\n    _setOptions: function _setOptions(t) {\n      var e;\n\n      for (e in t) {\n        this._setOption(e, t[e]);\n      }\n\n      return this;\n    },\n    _setOption: function _setOption(t, e) {\n      return \"classes\" === t && this._setOptionClasses(e), this.options[t] = e, \"disabled\" === t && this._setOptionDisabled(e), this;\n    },\n    _setOptionClasses: function _setOptionClasses(e) {\n      var i, s, n;\n\n      for (i in e) {\n        n = this.classesElementLookup[i], e[i] !== this.options.classes[i] && n && n.length && (s = t(n.get()), this._removeClass(n, i), s.addClass(this._classes({\n          element: s,\n          keys: i,\n          classes: e,\n          add: !0\n        })));\n      }\n    },\n    _setOptionDisabled: function _setOptionDisabled(t) {\n      this._toggleClass(this.widget(), this.widgetFullName + \"-disabled\", null, !!t), t && (this._removeClass(this.hoverable, null, \"ui-state-hover\"), this._removeClass(this.focusable, null, \"ui-state-focus\"));\n    },\n    enable: function enable() {\n      return this._setOptions({\n        disabled: !1\n      });\n    },\n    disable: function disable() {\n      return this._setOptions({\n        disabled: !0\n      });\n    },\n    _classes: function _classes(e) {\n      function i(i, o) {\n        var a, r;\n\n        for (r = 0; i.length > r; r++) {\n          a = n.classesElementLookup[i[r]] || t(), a = e.add ? t(t.unique(a.get().concat(e.element.get()))) : t(a.not(e.element).get()), n.classesElementLookup[i[r]] = a, s.push(i[r]), o && e.classes[i[r]] && s.push(e.classes[i[r]]);\n        }\n      }\n\n      var s = [],\n          n = this;\n      return e = t.extend({\n        element: this.element,\n        classes: this.options.classes || {}\n      }, e), this._on(e.element, {\n        remove: \"_untrackClassesElement\"\n      }), e.keys && i(e.keys.match(/\\S+/g) || [], !0), e.extra && i(e.extra.match(/\\S+/g) || []), s.join(\" \");\n    },\n    _untrackClassesElement: function _untrackClassesElement(e) {\n      var i = this;\n      t.each(i.classesElementLookup, function (s, n) {\n        -1 !== t.inArray(e.target, n) && (i.classesElementLookup[s] = t(n.not(e.target).get()));\n      });\n    },\n    _removeClass: function _removeClass(t, e, i) {\n      return this._toggleClass(t, e, i, !1);\n    },\n    _addClass: function _addClass(t, e, i) {\n      return this._toggleClass(t, e, i, !0);\n    },\n    _toggleClass: function _toggleClass(t, e, i, s) {\n      s = \"boolean\" == typeof s ? s : i;\n      var n = \"string\" == typeof t || null === t,\n          o = {\n        extra: n ? e : i,\n        keys: n ? t : e,\n        element: n ? this.element : t,\n        add: s\n      };\n      return o.element.toggleClass(this._classes(o), s), this;\n    },\n    _on: function _on(e, i, s) {\n      var n,\n          o = this;\n      \"boolean\" != typeof e && (s = i, i = e, e = !1), s ? (i = n = t(i), this.bindings = this.bindings.add(i)) : (s = i, i = this.element, n = this.widget()), t.each(s, function (s, a) {\n        function r() {\n          return e || o.options.disabled !== !0 && !t(this).hasClass(\"ui-state-disabled\") ? (\"string\" == typeof a ? o[a] : a).apply(o, arguments) : void 0;\n        }\n\n        \"string\" != typeof a && (r.guid = a.guid = a.guid || r.guid || t.guid++);\n        var h = s.match(/^([\\w:-]*)\\s*(.*)$/),\n            l = h[1] + o.eventNamespace,\n            c = h[2];\n        c ? n.on(l, c, r) : i.on(l, r);\n      });\n    },\n    _off: function _off(e, i) {\n      i = (i || \"\").split(\" \").join(this.eventNamespace + \" \") + this.eventNamespace, e.off(i).off(i), this.bindings = t(this.bindings.not(e).get()), this.focusable = t(this.focusable.not(e).get()), this.hoverable = t(this.hoverable.not(e).get());\n    },\n    _delay: function _delay(t, e) {\n      function i() {\n        return (\"string\" == typeof t ? s[t] : t).apply(s, arguments);\n      }\n\n      var s = this;\n      return setTimeout(i, e || 0);\n    },\n    _hoverable: function _hoverable(e) {\n      this.hoverable = this.hoverable.add(e), this._on(e, {\n        mouseenter: function mouseenter(e) {\n          this._addClass(t(e.currentTarget), null, \"ui-state-hover\");\n        },\n        mouseleave: function mouseleave(e) {\n          this._removeClass(t(e.currentTarget), null, \"ui-state-hover\");\n        }\n      });\n    },\n    _focusable: function _focusable(e) {\n      this.focusable = this.focusable.add(e), this._on(e, {\n        focusin: function focusin(e) {\n          this._addClass(t(e.currentTarget), null, \"ui-state-focus\");\n        },\n        focusout: function focusout(e) {\n          this._removeClass(t(e.currentTarget), null, \"ui-state-focus\");\n        }\n      });\n    },\n    _trigger: function _trigger(e, i, s) {\n      var n,\n          o,\n          a = this.options[e];\n      if (s = s || {}, i = t.Event(i), i.type = (e === this.widgetEventPrefix ? e : this.widgetEventPrefix + e).toLowerCase(), i.target = this.element[0], o = i.originalEvent) for (n in o) {\n        n in i || (i[n] = o[n]);\n      }\n      return this.element.trigger(i, s), !(t.isFunction(a) && a.apply(this.element[0], [i].concat(s)) === !1 || i.isDefaultPrevented());\n    }\n  }, t.each({\n    show: \"fadeIn\",\n    hide: \"fadeOut\"\n  }, function (e, i) {\n    t.Widget.prototype[\"_\" + e] = function (s, n, o) {\n      \"string\" == typeof n && (n = {\n        effect: n\n      });\n      var a,\n          r = n ? n === !0 || \"number\" == typeof n ? i : n.effect || i : e;\n      n = n || {}, \"number\" == typeof n && (n = {\n        duration: n\n      }), a = !t.isEmptyObject(n), n.complete = o, n.delay && s.delay(n.delay), a && t.effects && t.effects.effect[r] ? s[e](n) : r !== e && s[r] ? s[r](n.duration, n.easing, o) : s.queue(function (i) {\n        t(this)[e](), o && o.call(s[0]), i();\n      });\n    };\n  }), t.widget, function () {\n    function e(t, e, i) {\n      return [parseFloat(t[0]) * (u.test(t[0]) ? e / 100 : 1), parseFloat(t[1]) * (u.test(t[1]) ? i / 100 : 1)];\n    }\n\n    function i(e, i) {\n      return parseInt(t.css(e, i), 10) || 0;\n    }\n\n    function s(e) {\n      var i = e[0];\n      return 9 === i.nodeType ? {\n        width: e.width(),\n        height: e.height(),\n        offset: {\n          top: 0,\n          left: 0\n        }\n      } : t.isWindow(i) ? {\n        width: e.width(),\n        height: e.height(),\n        offset: {\n          top: e.scrollTop(),\n          left: e.scrollLeft()\n        }\n      } : i.preventDefault ? {\n        width: 0,\n        height: 0,\n        offset: {\n          top: i.pageY,\n          left: i.pageX\n        }\n      } : {\n        width: e.outerWidth(),\n        height: e.outerHeight(),\n        offset: e.offset()\n      };\n    }\n\n    var n,\n        o = Math.max,\n        a = Math.abs,\n        r = /left|center|right/,\n        h = /top|center|bottom/,\n        l = /[\\+\\-]\\d+(\\.[\\d]+)?%?/,\n        c = /^\\w+/,\n        u = /%$/,\n        d = t.fn.position;\n    t.position = {\n      scrollbarWidth: function scrollbarWidth() {\n        if (void 0 !== n) return n;\n        var e,\n            i,\n            s = t(\"<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>\"),\n            o = s.children()[0];\n        return t(\"body\").append(s), e = o.offsetWidth, s.css(\"overflow\", \"scroll\"), i = o.offsetWidth, e === i && (i = s[0].clientWidth), s.remove(), n = e - i;\n      },\n      getScrollInfo: function getScrollInfo(e) {\n        var i = e.isWindow || e.isDocument ? \"\" : e.element.css(\"overflow-x\"),\n            s = e.isWindow || e.isDocument ? \"\" : e.element.css(\"overflow-y\"),\n            n = \"scroll\" === i || \"auto\" === i && e.width < e.element[0].scrollWidth,\n            o = \"scroll\" === s || \"auto\" === s && e.height < e.element[0].scrollHeight;\n        return {\n          width: o ? t.position.scrollbarWidth() : 0,\n          height: n ? t.position.scrollbarWidth() : 0\n        };\n      },\n      getWithinInfo: function getWithinInfo(e) {\n        var i = t(e || window),\n            s = t.isWindow(i[0]),\n            n = !!i[0] && 9 === i[0].nodeType,\n            o = !s && !n;\n        return {\n          element: i,\n          isWindow: s,\n          isDocument: n,\n          offset: o ? t(e).offset() : {\n            left: 0,\n            top: 0\n          },\n          scrollLeft: i.scrollLeft(),\n          scrollTop: i.scrollTop(),\n          width: i.outerWidth(),\n          height: i.outerHeight()\n        };\n      }\n    }, t.fn.position = function (n) {\n      if (!n || !n.of) return d.apply(this, arguments);\n      n = t.extend({}, n);\n\n      var u,\n          p,\n          f,\n          m,\n          g,\n          _,\n          v = t(n.of),\n          b = t.position.getWithinInfo(n.within),\n          y = t.position.getScrollInfo(b),\n          w = (n.collision || \"flip\").split(\" \"),\n          k = {};\n\n      return _ = s(v), v[0].preventDefault && (n.at = \"left top\"), p = _.width, f = _.height, m = _.offset, g = t.extend({}, m), t.each([\"my\", \"at\"], function () {\n        var t,\n            e,\n            i = (n[this] || \"\").split(\" \");\n        1 === i.length && (i = r.test(i[0]) ? i.concat([\"center\"]) : h.test(i[0]) ? [\"center\"].concat(i) : [\"center\", \"center\"]), i[0] = r.test(i[0]) ? i[0] : \"center\", i[1] = h.test(i[1]) ? i[1] : \"center\", t = l.exec(i[0]), e = l.exec(i[1]), k[this] = [t ? t[0] : 0, e ? e[0] : 0], n[this] = [c.exec(i[0])[0], c.exec(i[1])[0]];\n      }), 1 === w.length && (w[1] = w[0]), \"right\" === n.at[0] ? g.left += p : \"center\" === n.at[0] && (g.left += p / 2), \"bottom\" === n.at[1] ? g.top += f : \"center\" === n.at[1] && (g.top += f / 2), u = e(k.at, p, f), g.left += u[0], g.top += u[1], this.each(function () {\n        var s,\n            r,\n            h = t(this),\n            l = h.outerWidth(),\n            c = h.outerHeight(),\n            d = i(this, \"marginLeft\"),\n            _ = i(this, \"marginTop\"),\n            x = l + d + i(this, \"marginRight\") + y.width,\n            D = c + _ + i(this, \"marginBottom\") + y.height,\n            C = t.extend({}, g),\n            T = e(k.my, h.outerWidth(), h.outerHeight());\n\n        \"right\" === n.my[0] ? C.left -= l : \"center\" === n.my[0] && (C.left -= l / 2), \"bottom\" === n.my[1] ? C.top -= c : \"center\" === n.my[1] && (C.top -= c / 2), C.left += T[0], C.top += T[1], s = {\n          marginLeft: d,\n          marginTop: _\n        }, t.each([\"left\", \"top\"], function (e, i) {\n          t.ui.position[w[e]] && t.ui.position[w[e]][i](C, {\n            targetWidth: p,\n            targetHeight: f,\n            elemWidth: l,\n            elemHeight: c,\n            collisionPosition: s,\n            collisionWidth: x,\n            collisionHeight: D,\n            offset: [u[0] + T[0], u[1] + T[1]],\n            my: n.my,\n            at: n.at,\n            within: b,\n            elem: h\n          });\n        }), n.using && (r = function r(t) {\n          var e = m.left - C.left,\n              i = e + p - l,\n              s = m.top - C.top,\n              r = s + f - c,\n              u = {\n            target: {\n              element: v,\n              left: m.left,\n              top: m.top,\n              width: p,\n              height: f\n            },\n            element: {\n              element: h,\n              left: C.left,\n              top: C.top,\n              width: l,\n              height: c\n            },\n            horizontal: 0 > i ? \"left\" : e > 0 ? \"right\" : \"center\",\n            vertical: 0 > r ? \"top\" : s > 0 ? \"bottom\" : \"middle\"\n          };\n          l > p && p > a(e + i) && (u.horizontal = \"center\"), c > f && f > a(s + r) && (u.vertical = \"middle\"), u.important = o(a(e), a(i)) > o(a(s), a(r)) ? \"horizontal\" : \"vertical\", n.using.call(this, t, u);\n        }), h.offset(t.extend(C, {\n          using: r\n        }));\n      });\n    }, t.ui.position = {\n      fit: {\n        left: function left(t, e) {\n          var i,\n              s = e.within,\n              n = s.isWindow ? s.scrollLeft : s.offset.left,\n              a = s.width,\n              r = t.left - e.collisionPosition.marginLeft,\n              h = n - r,\n              l = r + e.collisionWidth - a - n;\n          e.collisionWidth > a ? h > 0 && 0 >= l ? (i = t.left + h + e.collisionWidth - a - n, t.left += h - i) : t.left = l > 0 && 0 >= h ? n : h > l ? n + a - e.collisionWidth : n : h > 0 ? t.left += h : l > 0 ? t.left -= l : t.left = o(t.left - r, t.left);\n        },\n        top: function top(t, e) {\n          var i,\n              s = e.within,\n              n = s.isWindow ? s.scrollTop : s.offset.top,\n              a = e.within.height,\n              r = t.top - e.collisionPosition.marginTop,\n              h = n - r,\n              l = r + e.collisionHeight - a - n;\n          e.collisionHeight > a ? h > 0 && 0 >= l ? (i = t.top + h + e.collisionHeight - a - n, t.top += h - i) : t.top = l > 0 && 0 >= h ? n : h > l ? n + a - e.collisionHeight : n : h > 0 ? t.top += h : l > 0 ? t.top -= l : t.top = o(t.top - r, t.top);\n        }\n      },\n      flip: {\n        left: function left(t, e) {\n          var i,\n              s,\n              n = e.within,\n              o = n.offset.left + n.scrollLeft,\n              r = n.width,\n              h = n.isWindow ? n.scrollLeft : n.offset.left,\n              l = t.left - e.collisionPosition.marginLeft,\n              c = l - h,\n              u = l + e.collisionWidth - r - h,\n              d = \"left\" === e.my[0] ? -e.elemWidth : \"right\" === e.my[0] ? e.elemWidth : 0,\n              p = \"left\" === e.at[0] ? e.targetWidth : \"right\" === e.at[0] ? -e.targetWidth : 0,\n              f = -2 * e.offset[0];\n          0 > c ? (i = t.left + d + p + f + e.collisionWidth - r - o, (0 > i || a(c) > i) && (t.left += d + p + f)) : u > 0 && (s = t.left - e.collisionPosition.marginLeft + d + p + f - h, (s > 0 || u > a(s)) && (t.left += d + p + f));\n        },\n        top: function top(t, e) {\n          var i,\n              s,\n              n = e.within,\n              o = n.offset.top + n.scrollTop,\n              r = n.height,\n              h = n.isWindow ? n.scrollTop : n.offset.top,\n              l = t.top - e.collisionPosition.marginTop,\n              c = l - h,\n              u = l + e.collisionHeight - r - h,\n              d = \"top\" === e.my[1],\n              p = d ? -e.elemHeight : \"bottom\" === e.my[1] ? e.elemHeight : 0,\n              f = \"top\" === e.at[1] ? e.targetHeight : \"bottom\" === e.at[1] ? -e.targetHeight : 0,\n              m = -2 * e.offset[1];\n          0 > c ? (s = t.top + p + f + m + e.collisionHeight - r - o, (0 > s || a(c) > s) && (t.top += p + f + m)) : u > 0 && (i = t.top - e.collisionPosition.marginTop + p + f + m - h, (i > 0 || u > a(i)) && (t.top += p + f + m));\n        }\n      },\n      flipfit: {\n        left: function left() {\n          t.ui.position.flip.left.apply(this, arguments), t.ui.position.fit.left.apply(this, arguments);\n        },\n        top: function top() {\n          t.ui.position.flip.top.apply(this, arguments), t.ui.position.fit.top.apply(this, arguments);\n        }\n      }\n    };\n  }(), t.ui.position, t.extend(t.expr[\":\"], {\n    data: t.expr.createPseudo ? t.expr.createPseudo(function (e) {\n      return function (i) {\n        return !!t.data(i, e);\n      };\n    }) : function (e, i, s) {\n      return !!t.data(e, s[3]);\n    }\n  }), t.fn.extend({\n    disableSelection: function () {\n      var t = \"onselectstart\" in document.createElement(\"div\") ? \"selectstart\" : \"mousedown\";\n      return function () {\n        return this.on(t + \".ui-disableSelection\", function (t) {\n          t.preventDefault();\n        });\n      };\n    }(),\n    enableSelection: function enableSelection() {\n      return this.off(\".ui-disableSelection\");\n    }\n  }), t.ui.keyCode = {\n    BACKSPACE: 8,\n    COMMA: 188,\n    DELETE: 46,\n    DOWN: 40,\n    END: 35,\n    ENTER: 13,\n    ESCAPE: 27,\n    HOME: 36,\n    LEFT: 37,\n    PAGE_DOWN: 34,\n    PAGE_UP: 33,\n    PERIOD: 190,\n    RIGHT: 39,\n    SPACE: 32,\n    TAB: 9,\n    UP: 38\n  }, t.fn.scrollParent = function (e) {\n    var i = this.css(\"position\"),\n        s = \"absolute\" === i,\n        n = e ? /(auto|scroll|hidden)/ : /(auto|scroll)/,\n        o = this.parents().filter(function () {\n      var e = t(this);\n      return s && \"static\" === e.css(\"position\") ? !1 : n.test(e.css(\"overflow\") + e.css(\"overflow-y\") + e.css(\"overflow-x\"));\n    }).eq(0);\n    return \"fixed\" !== i && o.length ? o : t(this[0].ownerDocument || document);\n  }, t.fn.extend({\n    uniqueId: function () {\n      var t = 0;\n      return function () {\n        return this.each(function () {\n          this.id || (this.id = \"ui-id-\" + ++t);\n        });\n      };\n    }(),\n    removeUniqueId: function removeUniqueId() {\n      return this.each(function () {\n        /^ui-id-\\d+$/.test(this.id) && t(this).removeAttr(\"id\");\n      });\n    }\n  }), t.ui.ie = !!/msie [\\w.]+/.exec(navigator.userAgent.toLowerCase());\n  var s = !1;\n  t(document).on(\"mouseup\", function () {\n    s = !1;\n  }), t.widget(\"ui.mouse\", {\n    version: \"1.12.1\",\n    options: {\n      cancel: \"input, textarea, button, select, option\",\n      distance: 1,\n      delay: 0\n    },\n    _mouseInit: function _mouseInit() {\n      var e = this;\n      this.element.on(\"mousedown.\" + this.widgetName, function (t) {\n        return e._mouseDown(t);\n      }).on(\"click.\" + this.widgetName, function (i) {\n        return !0 === t.data(i.target, e.widgetName + \".preventClickEvent\") ? (t.removeData(i.target, e.widgetName + \".preventClickEvent\"), i.stopImmediatePropagation(), !1) : void 0;\n      }), this.started = !1;\n    },\n    _mouseDestroy: function _mouseDestroy() {\n      this.element.off(\".\" + this.widgetName), this._mouseMoveDelegate && this.document.off(\"mousemove.\" + this.widgetName, this._mouseMoveDelegate).off(\"mouseup.\" + this.widgetName, this._mouseUpDelegate);\n    },\n    _mouseDown: function _mouseDown(e) {\n      if (!s) {\n        this._mouseMoved = !1, this._mouseStarted && this._mouseUp(e), this._mouseDownEvent = e;\n        var i = this,\n            n = 1 === e.which,\n            o = \"string\" == typeof this.options.cancel && e.target.nodeName ? t(e.target).closest(this.options.cancel).length : !1;\n        return n && !o && this._mouseCapture(e) ? (this.mouseDelayMet = !this.options.delay, this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function () {\n          i.mouseDelayMet = !0;\n        }, this.options.delay)), this._mouseDistanceMet(e) && this._mouseDelayMet(e) && (this._mouseStarted = this._mouseStart(e) !== !1, !this._mouseStarted) ? (e.preventDefault(), !0) : (!0 === t.data(e.target, this.widgetName + \".preventClickEvent\") && t.removeData(e.target, this.widgetName + \".preventClickEvent\"), this._mouseMoveDelegate = function (t) {\n          return i._mouseMove(t);\n        }, this._mouseUpDelegate = function (t) {\n          return i._mouseUp(t);\n        }, this.document.on(\"mousemove.\" + this.widgetName, this._mouseMoveDelegate).on(\"mouseup.\" + this.widgetName, this._mouseUpDelegate), e.preventDefault(), s = !0, !0)) : !0;\n      }\n    },\n    _mouseMove: function _mouseMove(e) {\n      if (this._mouseMoved) {\n        if (t.ui.ie && (!document.documentMode || 9 > document.documentMode) && !e.button) return this._mouseUp(e);\n        if (!e.which) if (e.originalEvent.altKey || e.originalEvent.ctrlKey || e.originalEvent.metaKey || e.originalEvent.shiftKey) this.ignoreMissingWhich = !0;else if (!this.ignoreMissingWhich) return this._mouseUp(e);\n      }\n\n      return (e.which || e.button) && (this._mouseMoved = !0), this._mouseStarted ? (this._mouseDrag(e), e.preventDefault()) : (this._mouseDistanceMet(e) && this._mouseDelayMet(e) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, e) !== !1, this._mouseStarted ? this._mouseDrag(e) : this._mouseUp(e)), !this._mouseStarted);\n    },\n    _mouseUp: function _mouseUp(e) {\n      this.document.off(\"mousemove.\" + this.widgetName, this._mouseMoveDelegate).off(\"mouseup.\" + this.widgetName, this._mouseUpDelegate), this._mouseStarted && (this._mouseStarted = !1, e.target === this._mouseDownEvent.target && t.data(e.target, this.widgetName + \".preventClickEvent\", !0), this._mouseStop(e)), this._mouseDelayTimer && (clearTimeout(this._mouseDelayTimer), delete this._mouseDelayTimer), this.ignoreMissingWhich = !1, s = !1, e.preventDefault();\n    },\n    _mouseDistanceMet: function _mouseDistanceMet(t) {\n      return Math.max(Math.abs(this._mouseDownEvent.pageX - t.pageX), Math.abs(this._mouseDownEvent.pageY - t.pageY)) >= this.options.distance;\n    },\n    _mouseDelayMet: function _mouseDelayMet() {\n      return this.mouseDelayMet;\n    },\n    _mouseStart: function _mouseStart() {},\n    _mouseDrag: function _mouseDrag() {},\n    _mouseStop: function _mouseStop() {},\n    _mouseCapture: function _mouseCapture() {\n      return !0;\n    }\n  }), t.ui.plugin = {\n    add: function add(e, i, s) {\n      var n,\n          o = t.ui[e].prototype;\n\n      for (n in s) {\n        o.plugins[n] = o.plugins[n] || [], o.plugins[n].push([i, s[n]]);\n      }\n    },\n    call: function call(t, e, i, s) {\n      var n,\n          o = t.plugins[e];\n      if (o && (s || t.element[0].parentNode && 11 !== t.element[0].parentNode.nodeType)) for (n = 0; o.length > n; n++) {\n        t.options[o[n][0]] && o[n][1].apply(t.element, i);\n      }\n    }\n  }, t.ui.safeActiveElement = function (t) {\n    var e;\n\n    try {\n      e = t.activeElement;\n    } catch (i) {\n      e = t.body;\n    }\n\n    return e || (e = t.body), e.nodeName || (e = t.body), e;\n  }, t.ui.safeBlur = function (e) {\n    e && \"body\" !== e.nodeName.toLowerCase() && t(e).trigger(\"blur\");\n  }, t.widget(\"ui.draggable\", t.ui.mouse, {\n    version: \"1.12.1\",\n    widgetEventPrefix: \"drag\",\n    options: {\n      addClasses: !0,\n      appendTo: \"parent\",\n      axis: !1,\n      connectToSortable: !1,\n      containment: !1,\n      cursor: \"auto\",\n      cursorAt: !1,\n      grid: !1,\n      handle: !1,\n      helper: \"original\",\n      iframeFix: !1,\n      opacity: !1,\n      refreshPositions: !1,\n      revert: !1,\n      revertDuration: 500,\n      scope: \"default\",\n      scroll: !0,\n      scrollSensitivity: 20,\n      scrollSpeed: 20,\n      snap: !1,\n      snapMode: \"both\",\n      snapTolerance: 20,\n      stack: !1,\n      zIndex: !1,\n      drag: null,\n      start: null,\n      stop: null\n    },\n    _create: function _create() {\n      \"original\" === this.options.helper && this._setPositionRelative(), this.options.addClasses && this._addClass(\"ui-draggable\"), this._setHandleClassName(), this._mouseInit();\n    },\n    _setOption: function _setOption(t, e) {\n      this._super(t, e), \"handle\" === t && (this._removeHandleClassName(), this._setHandleClassName());\n    },\n    _destroy: function _destroy() {\n      return (this.helper || this.element).is(\".ui-draggable-dragging\") ? (this.destroyOnClear = !0, void 0) : (this._removeHandleClassName(), this._mouseDestroy(), void 0);\n    },\n    _mouseCapture: function _mouseCapture(e) {\n      var i = this.options;\n      return this.helper || i.disabled || t(e.target).closest(\".ui-resizable-handle\").length > 0 ? !1 : (this.handle = this._getHandle(e), this.handle ? (this._blurActiveElement(e), this._blockFrames(i.iframeFix === !0 ? \"iframe\" : i.iframeFix), !0) : !1);\n    },\n    _blockFrames: function _blockFrames(e) {\n      this.iframeBlocks = this.document.find(e).map(function () {\n        var e = t(this);\n        return t(\"<div>\").css(\"position\", \"absolute\").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0];\n      });\n    },\n    _unblockFrames: function _unblockFrames() {\n      this.iframeBlocks && (this.iframeBlocks.remove(), delete this.iframeBlocks);\n    },\n    _blurActiveElement: function _blurActiveElement(e) {\n      var i = t.ui.safeActiveElement(this.document[0]),\n          s = t(e.target);\n      s.closest(i).length || t.ui.safeBlur(i);\n    },\n    _mouseStart: function _mouseStart(e) {\n      var i = this.options;\n      return this.helper = this._createHelper(e), this._addClass(this.helper, \"ui-draggable-dragging\"), this._cacheHelperProportions(), t.ui.ddmanager && (t.ui.ddmanager.current = this), this._cacheMargins(), this.cssPosition = this.helper.css(\"position\"), this.scrollParent = this.helper.scrollParent(!0), this.offsetParent = this.helper.offsetParent(), this.hasFixedAncestor = this.helper.parents().filter(function () {\n        return \"fixed\" === t(this).css(\"position\");\n      }).length > 0, this.positionAbs = this.element.offset(), this._refreshOffsets(e), this.originalPosition = this.position = this._generatePosition(e, !1), this.originalPageX = e.pageX, this.originalPageY = e.pageY, i.cursorAt && this._adjustOffsetFromHelper(i.cursorAt), this._setContainment(), this._trigger(\"start\", e) === !1 ? (this._clear(), !1) : (this._cacheHelperProportions(), t.ui.ddmanager && !i.dropBehaviour && t.ui.ddmanager.prepareOffsets(this, e), this._mouseDrag(e, !0), t.ui.ddmanager && t.ui.ddmanager.dragStart(this, e), !0);\n    },\n    _refreshOffsets: function _refreshOffsets(t) {\n      this.offset = {\n        top: this.positionAbs.top - this.margins.top,\n        left: this.positionAbs.left - this.margins.left,\n        scroll: !1,\n        parent: this._getParentOffset(),\n        relative: this._getRelativeOffset()\n      }, this.offset.click = {\n        left: t.pageX - this.offset.left,\n        top: t.pageY - this.offset.top\n      };\n    },\n    _mouseDrag: function _mouseDrag(e, i) {\n      if (this.hasFixedAncestor && (this.offset.parent = this._getParentOffset()), this.position = this._generatePosition(e, !0), this.positionAbs = this._convertPositionTo(\"absolute\"), !i) {\n        var s = this._uiHash();\n\n        if (this._trigger(\"drag\", e, s) === !1) return this._mouseUp(new t.Event(\"mouseup\", e)), !1;\n        this.position = s.position;\n      }\n\n      return this.helper[0].style.left = this.position.left + \"px\", this.helper[0].style.top = this.position.top + \"px\", t.ui.ddmanager && t.ui.ddmanager.drag(this, e), !1;\n    },\n    _mouseStop: function _mouseStop(e) {\n      var i = this,\n          s = !1;\n      return t.ui.ddmanager && !this.options.dropBehaviour && (s = t.ui.ddmanager.drop(this, e)), this.dropped && (s = this.dropped, this.dropped = !1), \"invalid\" === this.options.revert && !s || \"valid\" === this.options.revert && s || this.options.revert === !0 || t.isFunction(this.options.revert) && this.options.revert.call(this.element, s) ? t(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () {\n        i._trigger(\"stop\", e) !== !1 && i._clear();\n      }) : this._trigger(\"stop\", e) !== !1 && this._clear(), !1;\n    },\n    _mouseUp: function _mouseUp(e) {\n      return this._unblockFrames(), t.ui.ddmanager && t.ui.ddmanager.dragStop(this, e), this.handleElement.is(e.target) && this.element.trigger(\"focus\"), t.ui.mouse.prototype._mouseUp.call(this, e);\n    },\n    cancel: function cancel() {\n      return this.helper.is(\".ui-draggable-dragging\") ? this._mouseUp(new t.Event(\"mouseup\", {\n        target: this.element[0]\n      })) : this._clear(), this;\n    },\n    _getHandle: function _getHandle(e) {\n      return this.options.handle ? !!t(e.target).closest(this.element.find(this.options.handle)).length : !0;\n    },\n    _setHandleClassName: function _setHandleClassName() {\n      this.handleElement = this.options.handle ? this.element.find(this.options.handle) : this.element, this._addClass(this.handleElement, \"ui-draggable-handle\");\n    },\n    _removeHandleClassName: function _removeHandleClassName() {\n      this._removeClass(this.handleElement, \"ui-draggable-handle\");\n    },\n    _createHelper: function _createHelper(e) {\n      var i = this.options,\n          s = t.isFunction(i.helper),\n          n = s ? t(i.helper.apply(this.element[0], [e])) : \"clone\" === i.helper ? this.element.clone().removeAttr(\"id\") : this.element;\n      return n.parents(\"body\").length || n.appendTo(\"parent\" === i.appendTo ? this.element[0].parentNode : i.appendTo), s && n[0] === this.element[0] && this._setPositionRelative(), n[0] === this.element[0] || /(fixed|absolute)/.test(n.css(\"position\")) || n.css(\"position\", \"absolute\"), n;\n    },\n    _setPositionRelative: function _setPositionRelative() {\n      /^(?:r|a|f)/.test(this.element.css(\"position\")) || (this.element[0].style.position = \"relative\");\n    },\n    _adjustOffsetFromHelper: function _adjustOffsetFromHelper(e) {\n      \"string\" == typeof e && (e = e.split(\" \")), t.isArray(e) && (e = {\n        left: +e[0],\n        top: +e[1] || 0\n      }), \"left\" in e && (this.offset.click.left = e.left + this.margins.left), \"right\" in e && (this.offset.click.left = this.helperProportions.width - e.right + this.margins.left), \"top\" in e && (this.offset.click.top = e.top + this.margins.top), \"bottom\" in e && (this.offset.click.top = this.helperProportions.height - e.bottom + this.margins.top);\n    },\n    _isRootNode: function _isRootNode(t) {\n      return /(html|body)/i.test(t.tagName) || t === this.document[0];\n    },\n    _getParentOffset: function _getParentOffset() {\n      var e = this.offsetParent.offset(),\n          i = this.document[0];\n      return \"absolute\" === this.cssPosition && this.scrollParent[0] !== i && t.contains(this.scrollParent[0], this.offsetParent[0]) && (e.left += this.scrollParent.scrollLeft(), e.top += this.scrollParent.scrollTop()), this._isRootNode(this.offsetParent[0]) && (e = {\n        top: 0,\n        left: 0\n      }), {\n        top: e.top + (parseInt(this.offsetParent.css(\"borderTopWidth\"), 10) || 0),\n        left: e.left + (parseInt(this.offsetParent.css(\"borderLeftWidth\"), 10) || 0)\n      };\n    },\n    _getRelativeOffset: function _getRelativeOffset() {\n      if (\"relative\" !== this.cssPosition) return {\n        top: 0,\n        left: 0\n      };\n\n      var t = this.element.position(),\n          e = this._isRootNode(this.scrollParent[0]);\n\n      return {\n        top: t.top - (parseInt(this.helper.css(\"top\"), 10) || 0) + (e ? 0 : this.scrollParent.scrollTop()),\n        left: t.left - (parseInt(this.helper.css(\"left\"), 10) || 0) + (e ? 0 : this.scrollParent.scrollLeft())\n      };\n    },\n    _cacheMargins: function _cacheMargins() {\n      this.margins = {\n        left: parseInt(this.element.css(\"marginLeft\"), 10) || 0,\n        top: parseInt(this.element.css(\"marginTop\"), 10) || 0,\n        right: parseInt(this.element.css(\"marginRight\"), 10) || 0,\n        bottom: parseInt(this.element.css(\"marginBottom\"), 10) || 0\n      };\n    },\n    _cacheHelperProportions: function _cacheHelperProportions() {\n      this.helperProportions = {\n        width: this.helper.outerWidth(),\n        height: this.helper.outerHeight()\n      };\n    },\n    _setContainment: function _setContainment() {\n      var e,\n          i,\n          s,\n          n = this.options,\n          o = this.document[0];\n      return this.relativeContainer = null, n.containment ? \"window\" === n.containment ? (this.containment = [t(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, t(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, t(window).scrollLeft() + t(window).width() - this.helperProportions.width - this.margins.left, t(window).scrollTop() + (t(window).height() || o.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top], void 0) : \"document\" === n.containment ? (this.containment = [0, 0, t(o).width() - this.helperProportions.width - this.margins.left, (t(o).height() || o.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top], void 0) : n.containment.constructor === Array ? (this.containment = n.containment, void 0) : (\"parent\" === n.containment && (n.containment = this.helper[0].parentNode), i = t(n.containment), s = i[0], s && (e = /(scroll|auto)/.test(i.css(\"overflow\")), this.containment = [(parseInt(i.css(\"borderLeftWidth\"), 10) || 0) + (parseInt(i.css(\"paddingLeft\"), 10) || 0), (parseInt(i.css(\"borderTopWidth\"), 10) || 0) + (parseInt(i.css(\"paddingTop\"), 10) || 0), (e ? Math.max(s.scrollWidth, s.offsetWidth) : s.offsetWidth) - (parseInt(i.css(\"borderRightWidth\"), 10) || 0) - (parseInt(i.css(\"paddingRight\"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (e ? Math.max(s.scrollHeight, s.offsetHeight) : s.offsetHeight) - (parseInt(i.css(\"borderBottomWidth\"), 10) || 0) - (parseInt(i.css(\"paddingBottom\"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom], this.relativeContainer = i), void 0) : (this.containment = null, void 0);\n    },\n    _convertPositionTo: function _convertPositionTo(t, e) {\n      e || (e = this.position);\n\n      var i = \"absolute\" === t ? 1 : -1,\n          s = this._isRootNode(this.scrollParent[0]);\n\n      return {\n        top: e.top + this.offset.relative.top * i + this.offset.parent.top * i - (\"fixed\" === this.cssPosition ? -this.offset.scroll.top : s ? 0 : this.offset.scroll.top) * i,\n        left: e.left + this.offset.relative.left * i + this.offset.parent.left * i - (\"fixed\" === this.cssPosition ? -this.offset.scroll.left : s ? 0 : this.offset.scroll.left) * i\n      };\n    },\n    _generatePosition: function _generatePosition(t, e) {\n      var i,\n          s,\n          n,\n          o,\n          a = this.options,\n          r = this._isRootNode(this.scrollParent[0]),\n          h = t.pageX,\n          l = t.pageY;\n\n      return r && this.offset.scroll || (this.offset.scroll = {\n        top: this.scrollParent.scrollTop(),\n        left: this.scrollParent.scrollLeft()\n      }), e && (this.containment && (this.relativeContainer ? (s = this.relativeContainer.offset(), i = [this.containment[0] + s.left, this.containment[1] + s.top, this.containment[2] + s.left, this.containment[3] + s.top]) : i = this.containment, t.pageX - this.offset.click.left < i[0] && (h = i[0] + this.offset.click.left), t.pageY - this.offset.click.top < i[1] && (l = i[1] + this.offset.click.top), t.pageX - this.offset.click.left > i[2] && (h = i[2] + this.offset.click.left), t.pageY - this.offset.click.top > i[3] && (l = i[3] + this.offset.click.top)), a.grid && (n = a.grid[1] ? this.originalPageY + Math.round((l - this.originalPageY) / a.grid[1]) * a.grid[1] : this.originalPageY, l = i ? n - this.offset.click.top >= i[1] || n - this.offset.click.top > i[3] ? n : n - this.offset.click.top >= i[1] ? n - a.grid[1] : n + a.grid[1] : n, o = a.grid[0] ? this.originalPageX + Math.round((h - this.originalPageX) / a.grid[0]) * a.grid[0] : this.originalPageX, h = i ? o - this.offset.click.left >= i[0] || o - this.offset.click.left > i[2] ? o : o - this.offset.click.left >= i[0] ? o - a.grid[0] : o + a.grid[0] : o), \"y\" === a.axis && (h = this.originalPageX), \"x\" === a.axis && (l = this.originalPageY)), {\n        top: l - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (\"fixed\" === this.cssPosition ? -this.offset.scroll.top : r ? 0 : this.offset.scroll.top),\n        left: h - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (\"fixed\" === this.cssPosition ? -this.offset.scroll.left : r ? 0 : this.offset.scroll.left)\n      };\n    },\n    _clear: function _clear() {\n      this._removeClass(this.helper, \"ui-draggable-dragging\"), this.helper[0] === this.element[0] || this.cancelHelperRemoval || this.helper.remove(), this.helper = null, this.cancelHelperRemoval = !1, this.destroyOnClear && this.destroy();\n    },\n    _trigger: function _trigger(e, i, s) {\n      return s = s || this._uiHash(), t.ui.plugin.call(this, e, [i, s, this], !0), /^(drag|start|stop)/.test(e) && (this.positionAbs = this._convertPositionTo(\"absolute\"), s.offset = this.positionAbs), t.Widget.prototype._trigger.call(this, e, i, s);\n    },\n    plugins: {},\n    _uiHash: function _uiHash() {\n      return {\n        helper: this.helper,\n        position: this.position,\n        originalPosition: this.originalPosition,\n        offset: this.positionAbs\n      };\n    }\n  }), t.ui.plugin.add(\"draggable\", \"connectToSortable\", {\n    start: function start(e, i, s) {\n      var n = t.extend({}, i, {\n        item: s.element\n      });\n      s.sortables = [], t(s.options.connectToSortable).each(function () {\n        var i = t(this).sortable(\"instance\");\n        i && !i.options.disabled && (s.sortables.push(i), i.refreshPositions(), i._trigger(\"activate\", e, n));\n      });\n    },\n    stop: function stop(e, i, s) {\n      var n = t.extend({}, i, {\n        item: s.element\n      });\n      s.cancelHelperRemoval = !1, t.each(s.sortables, function () {\n        var t = this;\n        t.isOver ? (t.isOver = 0, s.cancelHelperRemoval = !0, t.cancelHelperRemoval = !1, t._storedCSS = {\n          position: t.placeholder.css(\"position\"),\n          top: t.placeholder.css(\"top\"),\n          left: t.placeholder.css(\"left\")\n        }, t._mouseStop(e), t.options.helper = t.options._helper) : (t.cancelHelperRemoval = !0, t._trigger(\"deactivate\", e, n));\n      });\n    },\n    drag: function drag(e, i, s) {\n      t.each(s.sortables, function () {\n        var n = !1,\n            o = this;\n        o.positionAbs = s.positionAbs, o.helperProportions = s.helperProportions, o.offset.click = s.offset.click, o._intersectsWith(o.containerCache) && (n = !0, t.each(s.sortables, function () {\n          return this.positionAbs = s.positionAbs, this.helperProportions = s.helperProportions, this.offset.click = s.offset.click, this !== o && this._intersectsWith(this.containerCache) && t.contains(o.element[0], this.element[0]) && (n = !1), n;\n        })), n ? (o.isOver || (o.isOver = 1, s._parent = i.helper.parent(), o.currentItem = i.helper.appendTo(o.element).data(\"ui-sortable-item\", !0), o.options._helper = o.options.helper, o.options.helper = function () {\n          return i.helper[0];\n        }, e.target = o.currentItem[0], o._mouseCapture(e, !0), o._mouseStart(e, !0, !0), o.offset.click.top = s.offset.click.top, o.offset.click.left = s.offset.click.left, o.offset.parent.left -= s.offset.parent.left - o.offset.parent.left, o.offset.parent.top -= s.offset.parent.top - o.offset.parent.top, s._trigger(\"toSortable\", e), s.dropped = o.element, t.each(s.sortables, function () {\n          this.refreshPositions();\n        }), s.currentItem = s.element, o.fromOutside = s), o.currentItem && (o._mouseDrag(e), i.position = o.position)) : o.isOver && (o.isOver = 0, o.cancelHelperRemoval = !0, o.options._revert = o.options.revert, o.options.revert = !1, o._trigger(\"out\", e, o._uiHash(o)), o._mouseStop(e, !0), o.options.revert = o.options._revert, o.options.helper = o.options._helper, o.placeholder && o.placeholder.remove(), i.helper.appendTo(s._parent), s._refreshOffsets(e), i.position = s._generatePosition(e, !0), s._trigger(\"fromSortable\", e), s.dropped = !1, t.each(s.sortables, function () {\n          this.refreshPositions();\n        }));\n      });\n    }\n  }), t.ui.plugin.add(\"draggable\", \"cursor\", {\n    start: function start(e, i, s) {\n      var n = t(\"body\"),\n          o = s.options;\n      n.css(\"cursor\") && (o._cursor = n.css(\"cursor\")), n.css(\"cursor\", o.cursor);\n    },\n    stop: function stop(e, i, s) {\n      var n = s.options;\n      n._cursor && t(\"body\").css(\"cursor\", n._cursor);\n    }\n  }), t.ui.plugin.add(\"draggable\", \"opacity\", {\n    start: function start(e, i, s) {\n      var n = t(i.helper),\n          o = s.options;\n      n.css(\"opacity\") && (o._opacity = n.css(\"opacity\")), n.css(\"opacity\", o.opacity);\n    },\n    stop: function stop(e, i, s) {\n      var n = s.options;\n      n._opacity && t(i.helper).css(\"opacity\", n._opacity);\n    }\n  }), t.ui.plugin.add(\"draggable\", \"scroll\", {\n    start: function start(t, e, i) {\n      i.scrollParentNotHidden || (i.scrollParentNotHidden = i.helper.scrollParent(!1)), i.scrollParentNotHidden[0] !== i.document[0] && \"HTML\" !== i.scrollParentNotHidden[0].tagName && (i.overflowOffset = i.scrollParentNotHidden.offset());\n    },\n    drag: function drag(e, i, s) {\n      var n = s.options,\n          o = !1,\n          a = s.scrollParentNotHidden[0],\n          r = s.document[0];\n      a !== r && \"HTML\" !== a.tagName ? (n.axis && \"x\" === n.axis || (s.overflowOffset.top + a.offsetHeight - e.pageY < n.scrollSensitivity ? a.scrollTop = o = a.scrollTop + n.scrollSpeed : e.pageY - s.overflowOffset.top < n.scrollSensitivity && (a.scrollTop = o = a.scrollTop - n.scrollSpeed)), n.axis && \"y\" === n.axis || (s.overflowOffset.left + a.offsetWidth - e.pageX < n.scrollSensitivity ? a.scrollLeft = o = a.scrollLeft + n.scrollSpeed : e.pageX - s.overflowOffset.left < n.scrollSensitivity && (a.scrollLeft = o = a.scrollLeft - n.scrollSpeed))) : (n.axis && \"x\" === n.axis || (e.pageY - t(r).scrollTop() < n.scrollSensitivity ? o = t(r).scrollTop(t(r).scrollTop() - n.scrollSpeed) : t(window).height() - (e.pageY - t(r).scrollTop()) < n.scrollSensitivity && (o = t(r).scrollTop(t(r).scrollTop() + n.scrollSpeed))), n.axis && \"y\" === n.axis || (e.pageX - t(r).scrollLeft() < n.scrollSensitivity ? o = t(r).scrollLeft(t(r).scrollLeft() - n.scrollSpeed) : t(window).width() - (e.pageX - t(r).scrollLeft()) < n.scrollSensitivity && (o = t(r).scrollLeft(t(r).scrollLeft() + n.scrollSpeed)))), o !== !1 && t.ui.ddmanager && !n.dropBehaviour && t.ui.ddmanager.prepareOffsets(s, e);\n    }\n  }), t.ui.plugin.add(\"draggable\", \"snap\", {\n    start: function start(e, i, s) {\n      var n = s.options;\n      s.snapElements = [], t(n.snap.constructor !== String ? n.snap.items || \":data(ui-draggable)\" : n.snap).each(function () {\n        var e = t(this),\n            i = e.offset();\n        this !== s.element[0] && s.snapElements.push({\n          item: this,\n          width: e.outerWidth(),\n          height: e.outerHeight(),\n          top: i.top,\n          left: i.left\n        });\n      });\n    },\n    drag: function drag(e, i, s) {\n      var n,\n          o,\n          a,\n          r,\n          h,\n          l,\n          c,\n          u,\n          d,\n          p,\n          f = s.options,\n          m = f.snapTolerance,\n          g = i.offset.left,\n          _ = g + s.helperProportions.width,\n          v = i.offset.top,\n          b = v + s.helperProportions.height;\n\n      for (d = s.snapElements.length - 1; d >= 0; d--) {\n        h = s.snapElements[d].left - s.margins.left, l = h + s.snapElements[d].width, c = s.snapElements[d].top - s.margins.top, u = c + s.snapElements[d].height, h - m > _ || g > l + m || c - m > b || v > u + m || !t.contains(s.snapElements[d].item.ownerDocument, s.snapElements[d].item) ? (s.snapElements[d].snapping && s.options.snap.release && s.options.snap.release.call(s.element, e, t.extend(s._uiHash(), {\n          snapItem: s.snapElements[d].item\n        })), s.snapElements[d].snapping = !1) : (\"inner\" !== f.snapMode && (n = m >= Math.abs(c - b), o = m >= Math.abs(u - v), a = m >= Math.abs(h - _), r = m >= Math.abs(l - g), n && (i.position.top = s._convertPositionTo(\"relative\", {\n          top: c - s.helperProportions.height,\n          left: 0\n        }).top), o && (i.position.top = s._convertPositionTo(\"relative\", {\n          top: u,\n          left: 0\n        }).top), a && (i.position.left = s._convertPositionTo(\"relative\", {\n          top: 0,\n          left: h - s.helperProportions.width\n        }).left), r && (i.position.left = s._convertPositionTo(\"relative\", {\n          top: 0,\n          left: l\n        }).left)), p = n || o || a || r, \"outer\" !== f.snapMode && (n = m >= Math.abs(c - v), o = m >= Math.abs(u - b), a = m >= Math.abs(h - g), r = m >= Math.abs(l - _), n && (i.position.top = s._convertPositionTo(\"relative\", {\n          top: c,\n          left: 0\n        }).top), o && (i.position.top = s._convertPositionTo(\"relative\", {\n          top: u - s.helperProportions.height,\n          left: 0\n        }).top), a && (i.position.left = s._convertPositionTo(\"relative\", {\n          top: 0,\n          left: h\n        }).left), r && (i.position.left = s._convertPositionTo(\"relative\", {\n          top: 0,\n          left: l - s.helperProportions.width\n        }).left)), !s.snapElements[d].snapping && (n || o || a || r || p) && s.options.snap.snap && s.options.snap.snap.call(s.element, e, t.extend(s._uiHash(), {\n          snapItem: s.snapElements[d].item\n        })), s.snapElements[d].snapping = n || o || a || r || p);\n      }\n    }\n  }), t.ui.plugin.add(\"draggable\", \"stack\", {\n    start: function start(e, i, s) {\n      var n,\n          o = s.options,\n          a = t.makeArray(t(o.stack)).sort(function (e, i) {\n        return (parseInt(t(e).css(\"zIndex\"), 10) || 0) - (parseInt(t(i).css(\"zIndex\"), 10) || 0);\n      });\n      a.length && (n = parseInt(t(a[0]).css(\"zIndex\"), 10) || 0, t(a).each(function (e) {\n        t(this).css(\"zIndex\", n + e);\n      }), this.css(\"zIndex\", n + a.length));\n    }\n  }), t.ui.plugin.add(\"draggable\", \"zIndex\", {\n    start: function start(e, i, s) {\n      var n = t(i.helper),\n          o = s.options;\n      n.css(\"zIndex\") && (o._zIndex = n.css(\"zIndex\")), n.css(\"zIndex\", o.zIndex);\n    },\n    stop: function stop(e, i, s) {\n      var n = s.options;\n      n._zIndex && t(i.helper).css(\"zIndex\", n._zIndex);\n    }\n  }), t.ui.draggable, t.widget(\"ui.droppable\", {\n    version: \"1.12.1\",\n    widgetEventPrefix: \"drop\",\n    options: {\n      accept: \"*\",\n      addClasses: !0,\n      greedy: !1,\n      scope: \"default\",\n      tolerance: \"intersect\",\n      activate: null,\n      deactivate: null,\n      drop: null,\n      out: null,\n      over: null\n    },\n    _create: function _create() {\n      var e,\n          i = this.options,\n          s = i.accept;\n      this.isover = !1, this.isout = !0, this.accept = t.isFunction(s) ? s : function (t) {\n        return t.is(s);\n      }, this.proportions = function () {\n        return arguments.length ? (e = arguments[0], void 0) : e ? e : e = {\n          width: this.element[0].offsetWidth,\n          height: this.element[0].offsetHeight\n        };\n      }, this._addToManager(i.scope), i.addClasses && this._addClass(\"ui-droppable\");\n    },\n    _addToManager: function _addToManager(e) {\n      t.ui.ddmanager.droppables[e] = t.ui.ddmanager.droppables[e] || [], t.ui.ddmanager.droppables[e].push(this);\n    },\n    _splice: function _splice(t) {\n      for (var e = 0; t.length > e; e++) {\n        t[e] === this && t.splice(e, 1);\n      }\n    },\n    _destroy: function _destroy() {\n      var e = t.ui.ddmanager.droppables[this.options.scope];\n\n      this._splice(e);\n    },\n    _setOption: function _setOption(e, i) {\n      if (\"accept\" === e) this.accept = t.isFunction(i) ? i : function (t) {\n        return t.is(i);\n      };else if (\"scope\" === e) {\n        var s = t.ui.ddmanager.droppables[this.options.scope];\n        this._splice(s), this._addToManager(i);\n      }\n\n      this._super(e, i);\n    },\n    _activate: function _activate(e) {\n      var i = t.ui.ddmanager.current;\n      this._addActiveClass(), i && this._trigger(\"activate\", e, this.ui(i));\n    },\n    _deactivate: function _deactivate(e) {\n      var i = t.ui.ddmanager.current;\n      this._removeActiveClass(), i && this._trigger(\"deactivate\", e, this.ui(i));\n    },\n    _over: function _over(e) {\n      var i = t.ui.ddmanager.current;\n      i && (i.currentItem || i.element)[0] !== this.element[0] && this.accept.call(this.element[0], i.currentItem || i.element) && (this._addHoverClass(), this._trigger(\"over\", e, this.ui(i)));\n    },\n    _out: function _out(e) {\n      var i = t.ui.ddmanager.current;\n      i && (i.currentItem || i.element)[0] !== this.element[0] && this.accept.call(this.element[0], i.currentItem || i.element) && (this._removeHoverClass(), this._trigger(\"out\", e, this.ui(i)));\n    },\n    _drop: function _drop(e, i) {\n      var s = i || t.ui.ddmanager.current,\n          o = !1;\n      return s && (s.currentItem || s.element)[0] !== this.element[0] ? (this.element.find(\":data(ui-droppable)\").not(\".ui-draggable-dragging\").each(function () {\n        var i = t(this).droppable(\"instance\");\n        return i.options.greedy && !i.options.disabled && i.options.scope === s.options.scope && i.accept.call(i.element[0], s.currentItem || s.element) && n(s, t.extend(i, {\n          offset: i.element.offset()\n        }), i.options.tolerance, e) ? (o = !0, !1) : void 0;\n      }), o ? !1 : this.accept.call(this.element[0], s.currentItem || s.element) ? (this._removeActiveClass(), this._removeHoverClass(), this._trigger(\"drop\", e, this.ui(s)), this.element) : !1) : !1;\n    },\n    ui: function ui(t) {\n      return {\n        draggable: t.currentItem || t.element,\n        helper: t.helper,\n        position: t.position,\n        offset: t.positionAbs\n      };\n    },\n    _addHoverClass: function _addHoverClass() {\n      this._addClass(\"ui-droppable-hover\");\n    },\n    _removeHoverClass: function _removeHoverClass() {\n      this._removeClass(\"ui-droppable-hover\");\n    },\n    _addActiveClass: function _addActiveClass() {\n      this._addClass(\"ui-droppable-active\");\n    },\n    _removeActiveClass: function _removeActiveClass() {\n      this._removeClass(\"ui-droppable-active\");\n    }\n  });\n\n  var n = t.ui.intersect = function () {\n    function t(t, e, i) {\n      return t >= e && e + i > t;\n    }\n\n    return function (e, i, s, n) {\n      if (!i.offset) return !1;\n      var o = (e.positionAbs || e.position.absolute).left + e.margins.left,\n          a = (e.positionAbs || e.position.absolute).top + e.margins.top,\n          r = o + e.helperProportions.width,\n          h = a + e.helperProportions.height,\n          l = i.offset.left,\n          c = i.offset.top,\n          u = l + i.proportions().width,\n          d = c + i.proportions().height;\n\n      switch (s) {\n        case \"fit\":\n          return o >= l && u >= r && a >= c && d >= h;\n\n        case \"intersect\":\n          return o + e.helperProportions.width / 2 > l && u > r - e.helperProportions.width / 2 && a + e.helperProportions.height / 2 > c && d > h - e.helperProportions.height / 2;\n\n        case \"pointer\":\n          return t(n.pageY, c, i.proportions().height) && t(n.pageX, l, i.proportions().width);\n\n        case \"touch\":\n          return (a >= c && d >= a || h >= c && d >= h || c > a && h > d) && (o >= l && u >= o || r >= l && u >= r || l > o && r > u);\n\n        default:\n          return !1;\n      }\n    };\n  }();\n\n  t.ui.ddmanager = {\n    current: null,\n    droppables: {\n      \"default\": []\n    },\n    prepareOffsets: function prepareOffsets(e, i) {\n      var s,\n          n,\n          o = t.ui.ddmanager.droppables[e.options.scope] || [],\n          a = i ? i.type : null,\n          r = (e.currentItem || e.element).find(\":data(ui-droppable)\").addBack();\n\n      t: for (s = 0; o.length > s; s++) {\n        if (!(o[s].options.disabled || e && !o[s].accept.call(o[s].element[0], e.currentItem || e.element))) {\n          for (n = 0; r.length > n; n++) {\n            if (r[n] === o[s].element[0]) {\n              o[s].proportions().height = 0;\n              continue t;\n            }\n          }\n\n          o[s].visible = \"none\" !== o[s].element.css(\"display\"), o[s].visible && (\"mousedown\" === a && o[s]._activate.call(o[s], i), o[s].offset = o[s].element.offset(), o[s].proportions({\n            width: o[s].element[0].offsetWidth,\n            height: o[s].element[0].offsetHeight\n          }));\n        }\n      }\n    },\n    drop: function drop(e, i) {\n      var s = !1;\n      return t.each((t.ui.ddmanager.droppables[e.options.scope] || []).slice(), function () {\n        this.options && (!this.options.disabled && this.visible && n(e, this, this.options.tolerance, i) && (s = this._drop.call(this, i) || s), !this.options.disabled && this.visible && this.accept.call(this.element[0], e.currentItem || e.element) && (this.isout = !0, this.isover = !1, this._deactivate.call(this, i)));\n      }), s;\n    },\n    dragStart: function dragStart(e, i) {\n      e.element.parentsUntil(\"body\").on(\"scroll.droppable\", function () {\n        e.options.refreshPositions || t.ui.ddmanager.prepareOffsets(e, i);\n      });\n    },\n    drag: function drag(e, i) {\n      e.options.refreshPositions && t.ui.ddmanager.prepareOffsets(e, i), t.each(t.ui.ddmanager.droppables[e.options.scope] || [], function () {\n        if (!this.options.disabled && !this.greedyChild && this.visible) {\n          var s,\n              o,\n              a,\n              r = n(e, this, this.options.tolerance, i),\n              h = !r && this.isover ? \"isout\" : r && !this.isover ? \"isover\" : null;\n          h && (this.options.greedy && (o = this.options.scope, a = this.element.parents(\":data(ui-droppable)\").filter(function () {\n            return t(this).droppable(\"instance\").options.scope === o;\n          }), a.length && (s = t(a[0]).droppable(\"instance\"), s.greedyChild = \"isover\" === h)), s && \"isover\" === h && (s.isover = !1, s.isout = !0, s._out.call(s, i)), this[h] = !0, this[\"isout\" === h ? \"isover\" : \"isout\"] = !1, this[\"isover\" === h ? \"_over\" : \"_out\"].call(this, i), s && \"isout\" === h && (s.isout = !1, s.isover = !0, s._over.call(s, i)));\n        }\n      });\n    },\n    dragStop: function dragStop(e, i) {\n      e.element.parentsUntil(\"body\").off(\"scroll.droppable\"), e.options.refreshPositions || t.ui.ddmanager.prepareOffsets(e, i);\n    }\n  }, t.uiBackCompat !== !1 && t.widget(\"ui.droppable\", t.ui.droppable, {\n    options: {\n      hoverClass: !1,\n      activeClass: !1\n    },\n    _addActiveClass: function _addActiveClass() {\n      this._super(), this.options.activeClass && this.element.addClass(this.options.activeClass);\n    },\n    _removeActiveClass: function _removeActiveClass() {\n      this._super(), this.options.activeClass && this.element.removeClass(this.options.activeClass);\n    },\n    _addHoverClass: function _addHoverClass() {\n      this._super(), this.options.hoverClass && this.element.addClass(this.options.hoverClass);\n    },\n    _removeHoverClass: function _removeHoverClass() {\n      this._super(), this.options.hoverClass && this.element.removeClass(this.options.hoverClass);\n    }\n  }), t.ui.droppable, t.widget(\"ui.resizable\", t.ui.mouse, {\n    version: \"1.12.1\",\n    widgetEventPrefix: \"resize\",\n    options: {\n      alsoResize: !1,\n      animate: !1,\n      animateDuration: \"slow\",\n      animateEasing: \"swing\",\n      aspectRatio: !1,\n      autoHide: !1,\n      classes: {\n        \"ui-resizable-se\": \"ui-icon ui-icon-gripsmall-diagonal-se\"\n      },\n      containment: !1,\n      ghost: !1,\n      grid: !1,\n      handles: \"e,s,se\",\n      helper: !1,\n      maxHeight: null,\n      maxWidth: null,\n      minHeight: 10,\n      minWidth: 10,\n      zIndex: 90,\n      resize: null,\n      start: null,\n      stop: null\n    },\n    _num: function _num(t) {\n      return parseFloat(t) || 0;\n    },\n    _isNumber: function _isNumber(t) {\n      return !isNaN(parseFloat(t));\n    },\n    _hasScroll: function _hasScroll(e, i) {\n      if (\"hidden\" === t(e).css(\"overflow\")) return !1;\n      var s = i && \"left\" === i ? \"scrollLeft\" : \"scrollTop\",\n          n = !1;\n      return e[s] > 0 ? !0 : (e[s] = 1, n = e[s] > 0, e[s] = 0, n);\n    },\n    _create: function _create() {\n      var e,\n          i = this.options,\n          s = this;\n      this._addClass(\"ui-resizable\"), t.extend(this, {\n        _aspectRatio: !!i.aspectRatio,\n        aspectRatio: i.aspectRatio,\n        originalElement: this.element,\n        _proportionallyResizeElements: [],\n        _helper: i.helper || i.ghost || i.animate ? i.helper || \"ui-resizable-helper\" : null\n      }), this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i) && (this.element.wrap(t(\"<div class='ui-wrapper' style='overflow: hidden;'></div>\").css({\n        position: this.element.css(\"position\"),\n        width: this.element.outerWidth(),\n        height: this.element.outerHeight(),\n        top: this.element.css(\"top\"),\n        left: this.element.css(\"left\")\n      })), this.element = this.element.parent().data(\"ui-resizable\", this.element.resizable(\"instance\")), this.elementIsWrapper = !0, e = {\n        marginTop: this.originalElement.css(\"marginTop\"),\n        marginRight: this.originalElement.css(\"marginRight\"),\n        marginBottom: this.originalElement.css(\"marginBottom\"),\n        marginLeft: this.originalElement.css(\"marginLeft\")\n      }, this.element.css(e), this.originalElement.css(\"margin\", 0), this.originalResizeStyle = this.originalElement.css(\"resize\"), this.originalElement.css(\"resize\", \"none\"), this._proportionallyResizeElements.push(this.originalElement.css({\n        position: \"static\",\n        zoom: 1,\n        display: \"block\"\n      })), this.originalElement.css(e), this._proportionallyResize()), this._setupHandles(), i.autoHide && t(this.element).on(\"mouseenter\", function () {\n        i.disabled || (s._removeClass(\"ui-resizable-autohide\"), s._handles.show());\n      }).on(\"mouseleave\", function () {\n        i.disabled || s.resizing || (s._addClass(\"ui-resizable-autohide\"), s._handles.hide());\n      }), this._mouseInit();\n    },\n    _destroy: function _destroy() {\n      this._mouseDestroy();\n\n      var e,\n          i = function i(e) {\n        t(e).removeData(\"resizable\").removeData(\"ui-resizable\").off(\".resizable\").find(\".ui-resizable-handle\").remove();\n      };\n\n      return this.elementIsWrapper && (i(this.element), e = this.element, this.originalElement.css({\n        position: e.css(\"position\"),\n        width: e.outerWidth(),\n        height: e.outerHeight(),\n        top: e.css(\"top\"),\n        left: e.css(\"left\")\n      }).insertAfter(e), e.remove()), this.originalElement.css(\"resize\", this.originalResizeStyle), i(this.originalElement), this;\n    },\n    _setOption: function _setOption(t, e) {\n      switch (this._super(t, e), t) {\n        case \"handles\":\n          this._removeHandles(), this._setupHandles();\n          break;\n\n        default:\n      }\n    },\n    _setupHandles: function _setupHandles() {\n      var e,\n          i,\n          s,\n          n,\n          o,\n          a = this.options,\n          r = this;\n      if (this.handles = a.handles || (t(\".ui-resizable-handle\", this.element).length ? {\n        n: \".ui-resizable-n\",\n        e: \".ui-resizable-e\",\n        s: \".ui-resizable-s\",\n        w: \".ui-resizable-w\",\n        se: \".ui-resizable-se\",\n        sw: \".ui-resizable-sw\",\n        ne: \".ui-resizable-ne\",\n        nw: \".ui-resizable-nw\"\n      } : \"e,s,se\"), this._handles = t(), this.handles.constructor === String) for (\"all\" === this.handles && (this.handles = \"n,e,s,w,se,sw,ne,nw\"), s = this.handles.split(\",\"), this.handles = {}, i = 0; s.length > i; i++) {\n        e = t.trim(s[i]), n = \"ui-resizable-\" + e, o = t(\"<div>\"), this._addClass(o, \"ui-resizable-handle \" + n), o.css({\n          zIndex: a.zIndex\n        }), this.handles[e] = \".ui-resizable-\" + e, this.element.append(o);\n      }\n      this._renderAxis = function (e) {\n        var i, s, n, o;\n        e = e || this.element;\n\n        for (i in this.handles) {\n          this.handles[i].constructor === String ? this.handles[i] = this.element.children(this.handles[i]).first().show() : (this.handles[i].jquery || this.handles[i].nodeType) && (this.handles[i] = t(this.handles[i]), this._on(this.handles[i], {\n            mousedown: r._mouseDown\n          })), this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i) && (s = t(this.handles[i], this.element), o = /sw|ne|nw|se|n|s/.test(i) ? s.outerHeight() : s.outerWidth(), n = [\"padding\", /ne|nw|n/.test(i) ? \"Top\" : /se|sw|s/.test(i) ? \"Bottom\" : /^e$/.test(i) ? \"Right\" : \"Left\"].join(\"\"), e.css(n, o), this._proportionallyResize()), this._handles = this._handles.add(this.handles[i]);\n        }\n      }, this._renderAxis(this.element), this._handles = this._handles.add(this.element.find(\".ui-resizable-handle\")), this._handles.disableSelection(), this._handles.on(\"mouseover\", function () {\n        r.resizing || (this.className && (o = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)), r.axis = o && o[1] ? o[1] : \"se\");\n      }), a.autoHide && (this._handles.hide(), this._addClass(\"ui-resizable-autohide\"));\n    },\n    _removeHandles: function _removeHandles() {\n      this._handles.remove();\n    },\n    _mouseCapture: function _mouseCapture(e) {\n      var i,\n          s,\n          n = !1;\n\n      for (i in this.handles) {\n        s = t(this.handles[i])[0], (s === e.target || t.contains(s, e.target)) && (n = !0);\n      }\n\n      return !this.options.disabled && n;\n    },\n    _mouseStart: function _mouseStart(e) {\n      var i,\n          s,\n          n,\n          o = this.options,\n          a = this.element;\n      return this.resizing = !0, this._renderProxy(), i = this._num(this.helper.css(\"left\")), s = this._num(this.helper.css(\"top\")), o.containment && (i += t(o.containment).scrollLeft() || 0, s += t(o.containment).scrollTop() || 0), this.offset = this.helper.offset(), this.position = {\n        left: i,\n        top: s\n      }, this.size = this._helper ? {\n        width: this.helper.width(),\n        height: this.helper.height()\n      } : {\n        width: a.width(),\n        height: a.height()\n      }, this.originalSize = this._helper ? {\n        width: a.outerWidth(),\n        height: a.outerHeight()\n      } : {\n        width: a.width(),\n        height: a.height()\n      }, this.sizeDiff = {\n        width: a.outerWidth() - a.width(),\n        height: a.outerHeight() - a.height()\n      }, this.originalPosition = {\n        left: i,\n        top: s\n      }, this.originalMousePosition = {\n        left: e.pageX,\n        top: e.pageY\n      }, this.aspectRatio = \"number\" == typeof o.aspectRatio ? o.aspectRatio : this.originalSize.width / this.originalSize.height || 1, n = t(\".ui-resizable-\" + this.axis).css(\"cursor\"), t(\"body\").css(\"cursor\", \"auto\" === n ? this.axis + \"-resize\" : n), this._addClass(\"ui-resizable-resizing\"), this._propagate(\"start\", e), !0;\n    },\n    _mouseDrag: function _mouseDrag(e) {\n      var i,\n          s,\n          n = this.originalMousePosition,\n          o = this.axis,\n          a = e.pageX - n.left || 0,\n          r = e.pageY - n.top || 0,\n          h = this._change[o];\n      return this._updatePrevProperties(), h ? (i = h.apply(this, [e, a, r]), this._updateVirtualBoundaries(e.shiftKey), (this._aspectRatio || e.shiftKey) && (i = this._updateRatio(i, e)), i = this._respectSize(i, e), this._updateCache(i), this._propagate(\"resize\", e), s = this._applyChanges(), !this._helper && this._proportionallyResizeElements.length && this._proportionallyResize(), t.isEmptyObject(s) || (this._updatePrevProperties(), this._trigger(\"resize\", e, this.ui()), this._applyChanges()), !1) : !1;\n    },\n    _mouseStop: function _mouseStop(e) {\n      this.resizing = !1;\n      var i,\n          s,\n          n,\n          o,\n          a,\n          r,\n          h,\n          l = this.options,\n          c = this;\n      return this._helper && (i = this._proportionallyResizeElements, s = i.length && /textarea/i.test(i[0].nodeName), n = s && this._hasScroll(i[0], \"left\") ? 0 : c.sizeDiff.height, o = s ? 0 : c.sizeDiff.width, a = {\n        width: c.helper.width() - o,\n        height: c.helper.height() - n\n      }, r = parseFloat(c.element.css(\"left\")) + (c.position.left - c.originalPosition.left) || null, h = parseFloat(c.element.css(\"top\")) + (c.position.top - c.originalPosition.top) || null, l.animate || this.element.css(t.extend(a, {\n        top: h,\n        left: r\n      })), c.helper.height(c.size.height), c.helper.width(c.size.width), this._helper && !l.animate && this._proportionallyResize()), t(\"body\").css(\"cursor\", \"auto\"), this._removeClass(\"ui-resizable-resizing\"), this._propagate(\"stop\", e), this._helper && this.helper.remove(), !1;\n    },\n    _updatePrevProperties: function _updatePrevProperties() {\n      this.prevPosition = {\n        top: this.position.top,\n        left: this.position.left\n      }, this.prevSize = {\n        width: this.size.width,\n        height: this.size.height\n      };\n    },\n    _applyChanges: function _applyChanges() {\n      var t = {};\n      return this.position.top !== this.prevPosition.top && (t.top = this.position.top + \"px\"), this.position.left !== this.prevPosition.left && (t.left = this.position.left + \"px\"), this.size.width !== this.prevSize.width && (t.width = this.size.width + \"px\"), this.size.height !== this.prevSize.height && (t.height = this.size.height + \"px\"), this.helper.css(t), t;\n    },\n    _updateVirtualBoundaries: function _updateVirtualBoundaries(t) {\n      var e,\n          i,\n          s,\n          n,\n          o,\n          a = this.options;\n      o = {\n        minWidth: this._isNumber(a.minWidth) ? a.minWidth : 0,\n        maxWidth: this._isNumber(a.maxWidth) ? a.maxWidth : 1 / 0,\n        minHeight: this._isNumber(a.minHeight) ? a.minHeight : 0,\n        maxHeight: this._isNumber(a.maxHeight) ? a.maxHeight : 1 / 0\n      }, (this._aspectRatio || t) && (e = o.minHeight * this.aspectRatio, s = o.minWidth / this.aspectRatio, i = o.maxHeight * this.aspectRatio, n = o.maxWidth / this.aspectRatio, e > o.minWidth && (o.minWidth = e), s > o.minHeight && (o.minHeight = s), o.maxWidth > i && (o.maxWidth = i), o.maxHeight > n && (o.maxHeight = n)), this._vBoundaries = o;\n    },\n    _updateCache: function _updateCache(t) {\n      this.offset = this.helper.offset(), this._isNumber(t.left) && (this.position.left = t.left), this._isNumber(t.top) && (this.position.top = t.top), this._isNumber(t.height) && (this.size.height = t.height), this._isNumber(t.width) && (this.size.width = t.width);\n    },\n    _updateRatio: function _updateRatio(t) {\n      var e = this.position,\n          i = this.size,\n          s = this.axis;\n      return this._isNumber(t.height) ? t.width = t.height * this.aspectRatio : this._isNumber(t.width) && (t.height = t.width / this.aspectRatio), \"sw\" === s && (t.left = e.left + (i.width - t.width), t.top = null), \"nw\" === s && (t.top = e.top + (i.height - t.height), t.left = e.left + (i.width - t.width)), t;\n    },\n    _respectSize: function _respectSize(t) {\n      var e = this._vBoundaries,\n          i = this.axis,\n          s = this._isNumber(t.width) && e.maxWidth && e.maxWidth < t.width,\n          n = this._isNumber(t.height) && e.maxHeight && e.maxHeight < t.height,\n          o = this._isNumber(t.width) && e.minWidth && e.minWidth > t.width,\n          a = this._isNumber(t.height) && e.minHeight && e.minHeight > t.height,\n          r = this.originalPosition.left + this.originalSize.width,\n          h = this.originalPosition.top + this.originalSize.height,\n          l = /sw|nw|w/.test(i),\n          c = /nw|ne|n/.test(i);\n      return o && (t.width = e.minWidth), a && (t.height = e.minHeight), s && (t.width = e.maxWidth), n && (t.height = e.maxHeight), o && l && (t.left = r - e.minWidth), s && l && (t.left = r - e.maxWidth), a && c && (t.top = h - e.minHeight), n && c && (t.top = h - e.maxHeight), t.width || t.height || t.left || !t.top ? t.width || t.height || t.top || !t.left || (t.left = null) : t.top = null, t;\n    },\n    _getPaddingPlusBorderDimensions: function _getPaddingPlusBorderDimensions(t) {\n      for (var e = 0, i = [], s = [t.css(\"borderTopWidth\"), t.css(\"borderRightWidth\"), t.css(\"borderBottomWidth\"), t.css(\"borderLeftWidth\")], n = [t.css(\"paddingTop\"), t.css(\"paddingRight\"), t.css(\"paddingBottom\"), t.css(\"paddingLeft\")]; 4 > e; e++) {\n        i[e] = parseFloat(s[e]) || 0, i[e] += parseFloat(n[e]) || 0;\n      }\n\n      return {\n        height: i[0] + i[2],\n        width: i[1] + i[3]\n      };\n    },\n    _proportionallyResize: function _proportionallyResize() {\n      if (this._proportionallyResizeElements.length) for (var t, e = 0, i = this.helper || this.element; this._proportionallyResizeElements.length > e; e++) {\n        t = this._proportionallyResizeElements[e], this.outerDimensions || (this.outerDimensions = this._getPaddingPlusBorderDimensions(t)), t.css({\n          height: i.height() - this.outerDimensions.height || 0,\n          width: i.width() - this.outerDimensions.width || 0\n        });\n      }\n    },\n    _renderProxy: function _renderProxy() {\n      var e = this.element,\n          i = this.options;\n      this.elementOffset = e.offset(), this._helper ? (this.helper = this.helper || t(\"<div style='overflow:hidden;'></div>\"), this._addClass(this.helper, this._helper), this.helper.css({\n        width: this.element.outerWidth(),\n        height: this.element.outerHeight(),\n        position: \"absolute\",\n        left: this.elementOffset.left + \"px\",\n        top: this.elementOffset.top + \"px\",\n        zIndex: ++i.zIndex\n      }), this.helper.appendTo(\"body\").disableSelection()) : this.helper = this.element;\n    },\n    _change: {\n      e: function e(t, _e) {\n        return {\n          width: this.originalSize.width + _e\n        };\n      },\n      w: function w(t, e) {\n        var i = this.originalSize,\n            s = this.originalPosition;\n        return {\n          left: s.left + e,\n          width: i.width - e\n        };\n      },\n      n: function n(t, e, i) {\n        var s = this.originalSize,\n            n = this.originalPosition;\n        return {\n          top: n.top + i,\n          height: s.height - i\n        };\n      },\n      s: function s(t, e, i) {\n        return {\n          height: this.originalSize.height + i\n        };\n      },\n      se: function se(e, i, s) {\n        return t.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [e, i, s]));\n      },\n      sw: function sw(e, i, s) {\n        return t.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [e, i, s]));\n      },\n      ne: function ne(e, i, s) {\n        return t.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [e, i, s]));\n      },\n      nw: function nw(e, i, s) {\n        return t.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [e, i, s]));\n      }\n    },\n    _propagate: function _propagate(e, i) {\n      t.ui.plugin.call(this, e, [i, this.ui()]), \"resize\" !== e && this._trigger(e, i, this.ui());\n    },\n    plugins: {},\n    ui: function ui() {\n      return {\n        originalElement: this.originalElement,\n        element: this.element,\n        helper: this.helper,\n        position: this.position,\n        size: this.size,\n        originalSize: this.originalSize,\n        originalPosition: this.originalPosition\n      };\n    }\n  }), t.ui.plugin.add(\"resizable\", \"animate\", {\n    stop: function stop(e) {\n      var i = t(this).resizable(\"instance\"),\n          s = i.options,\n          n = i._proportionallyResizeElements,\n          o = n.length && /textarea/i.test(n[0].nodeName),\n          a = o && i._hasScroll(n[0], \"left\") ? 0 : i.sizeDiff.height,\n          r = o ? 0 : i.sizeDiff.width,\n          h = {\n        width: i.size.width - r,\n        height: i.size.height - a\n      },\n          l = parseFloat(i.element.css(\"left\")) + (i.position.left - i.originalPosition.left) || null,\n          c = parseFloat(i.element.css(\"top\")) + (i.position.top - i.originalPosition.top) || null;\n      i.element.animate(t.extend(h, c && l ? {\n        top: c,\n        left: l\n      } : {}), {\n        duration: s.animateDuration,\n        easing: s.animateEasing,\n        step: function step() {\n          var s = {\n            width: parseFloat(i.element.css(\"width\")),\n            height: parseFloat(i.element.css(\"height\")),\n            top: parseFloat(i.element.css(\"top\")),\n            left: parseFloat(i.element.css(\"left\"))\n          };\n          n && n.length && t(n[0]).css({\n            width: s.width,\n            height: s.height\n          }), i._updateCache(s), i._propagate(\"resize\", e);\n        }\n      });\n    }\n  }), t.ui.plugin.add(\"resizable\", \"containment\", {\n    start: function start() {\n      var e,\n          i,\n          s,\n          n,\n          o,\n          a,\n          r,\n          h = t(this).resizable(\"instance\"),\n          l = h.options,\n          c = h.element,\n          u = l.containment,\n          d = u instanceof t ? u.get(0) : /parent/.test(u) ? c.parent().get(0) : u;\n      d && (h.containerElement = t(d), /document/.test(u) || u === document ? (h.containerOffset = {\n        left: 0,\n        top: 0\n      }, h.containerPosition = {\n        left: 0,\n        top: 0\n      }, h.parentData = {\n        element: t(document),\n        left: 0,\n        top: 0,\n        width: t(document).width(),\n        height: t(document).height() || document.body.parentNode.scrollHeight\n      }) : (e = t(d), i = [], t([\"Top\", \"Right\", \"Left\", \"Bottom\"]).each(function (t, s) {\n        i[t] = h._num(e.css(\"padding\" + s));\n      }), h.containerOffset = e.offset(), h.containerPosition = e.position(), h.containerSize = {\n        height: e.innerHeight() - i[3],\n        width: e.innerWidth() - i[1]\n      }, s = h.containerOffset, n = h.containerSize.height, o = h.containerSize.width, a = h._hasScroll(d, \"left\") ? d.scrollWidth : o, r = h._hasScroll(d) ? d.scrollHeight : n, h.parentData = {\n        element: d,\n        left: s.left,\n        top: s.top,\n        width: a,\n        height: r\n      }));\n    },\n    resize: function resize(e) {\n      var i,\n          s,\n          n,\n          o,\n          a = t(this).resizable(\"instance\"),\n          r = a.options,\n          h = a.containerOffset,\n          l = a.position,\n          c = a._aspectRatio || e.shiftKey,\n          u = {\n        top: 0,\n        left: 0\n      },\n          d = a.containerElement,\n          p = !0;\n      d[0] !== document && /static/.test(d.css(\"position\")) && (u = h), l.left < (a._helper ? h.left : 0) && (a.size.width = a.size.width + (a._helper ? a.position.left - h.left : a.position.left - u.left), c && (a.size.height = a.size.width / a.aspectRatio, p = !1), a.position.left = r.helper ? h.left : 0), l.top < (a._helper ? h.top : 0) && (a.size.height = a.size.height + (a._helper ? a.position.top - h.top : a.position.top), c && (a.size.width = a.size.height * a.aspectRatio, p = !1), a.position.top = a._helper ? h.top : 0), n = a.containerElement.get(0) === a.element.parent().get(0), o = /relative|absolute/.test(a.containerElement.css(\"position\")), n && o ? (a.offset.left = a.parentData.left + a.position.left, a.offset.top = a.parentData.top + a.position.top) : (a.offset.left = a.element.offset().left, a.offset.top = a.element.offset().top), i = Math.abs(a.sizeDiff.width + (a._helper ? a.offset.left - u.left : a.offset.left - h.left)), s = Math.abs(a.sizeDiff.height + (a._helper ? a.offset.top - u.top : a.offset.top - h.top)), i + a.size.width >= a.parentData.width && (a.size.width = a.parentData.width - i, c && (a.size.height = a.size.width / a.aspectRatio, p = !1)), s + a.size.height >= a.parentData.height && (a.size.height = a.parentData.height - s, c && (a.size.width = a.size.height * a.aspectRatio, p = !1)), p || (a.position.left = a.prevPosition.left, a.position.top = a.prevPosition.top, a.size.width = a.prevSize.width, a.size.height = a.prevSize.height);\n    },\n    stop: function stop() {\n      var e = t(this).resizable(\"instance\"),\n          i = e.options,\n          s = e.containerOffset,\n          n = e.containerPosition,\n          o = e.containerElement,\n          a = t(e.helper),\n          r = a.offset(),\n          h = a.outerWidth() - e.sizeDiff.width,\n          l = a.outerHeight() - e.sizeDiff.height;\n      e._helper && !i.animate && /relative/.test(o.css(\"position\")) && t(this).css({\n        left: r.left - n.left - s.left,\n        width: h,\n        height: l\n      }), e._helper && !i.animate && /static/.test(o.css(\"position\")) && t(this).css({\n        left: r.left - n.left - s.left,\n        width: h,\n        height: l\n      });\n    }\n  }), t.ui.plugin.add(\"resizable\", \"alsoResize\", {\n    start: function start() {\n      var e = t(this).resizable(\"instance\"),\n          i = e.options;\n      t(i.alsoResize).each(function () {\n        var e = t(this);\n        e.data(\"ui-resizable-alsoresize\", {\n          width: parseFloat(e.width()),\n          height: parseFloat(e.height()),\n          left: parseFloat(e.css(\"left\")),\n          top: parseFloat(e.css(\"top\"))\n        });\n      });\n    },\n    resize: function resize(e, i) {\n      var s = t(this).resizable(\"instance\"),\n          n = s.options,\n          o = s.originalSize,\n          a = s.originalPosition,\n          r = {\n        height: s.size.height - o.height || 0,\n        width: s.size.width - o.width || 0,\n        top: s.position.top - a.top || 0,\n        left: s.position.left - a.left || 0\n      };\n      t(n.alsoResize).each(function () {\n        var e = t(this),\n            s = t(this).data(\"ui-resizable-alsoresize\"),\n            n = {},\n            o = e.parents(i.originalElement[0]).length ? [\"width\", \"height\"] : [\"width\", \"height\", \"top\", \"left\"];\n        t.each(o, function (t, e) {\n          var i = (s[e] || 0) + (r[e] || 0);\n          i && i >= 0 && (n[e] = i || null);\n        }), e.css(n);\n      });\n    },\n    stop: function stop() {\n      t(this).removeData(\"ui-resizable-alsoresize\");\n    }\n  }), t.ui.plugin.add(\"resizable\", \"ghost\", {\n    start: function start() {\n      var e = t(this).resizable(\"instance\"),\n          i = e.size;\n      e.ghost = e.originalElement.clone(), e.ghost.css({\n        opacity: .25,\n        display: \"block\",\n        position: \"relative\",\n        height: i.height,\n        width: i.width,\n        margin: 0,\n        left: 0,\n        top: 0\n      }), e._addClass(e.ghost, \"ui-resizable-ghost\"), t.uiBackCompat !== !1 && \"string\" == typeof e.options.ghost && e.ghost.addClass(this.options.ghost), e.ghost.appendTo(e.helper);\n    },\n    resize: function resize() {\n      var e = t(this).resizable(\"instance\");\n      e.ghost && e.ghost.css({\n        position: \"relative\",\n        height: e.size.height,\n        width: e.size.width\n      });\n    },\n    stop: function stop() {\n      var e = t(this).resizable(\"instance\");\n      e.ghost && e.helper && e.helper.get(0).removeChild(e.ghost.get(0));\n    }\n  }), t.ui.plugin.add(\"resizable\", \"grid\", {\n    resize: function resize() {\n      var e,\n          i = t(this).resizable(\"instance\"),\n          s = i.options,\n          n = i.size,\n          o = i.originalSize,\n          a = i.originalPosition,\n          r = i.axis,\n          h = \"number\" == typeof s.grid ? [s.grid, s.grid] : s.grid,\n          l = h[0] || 1,\n          c = h[1] || 1,\n          u = Math.round((n.width - o.width) / l) * l,\n          d = Math.round((n.height - o.height) / c) * c,\n          p = o.width + u,\n          f = o.height + d,\n          m = s.maxWidth && p > s.maxWidth,\n          g = s.maxHeight && f > s.maxHeight,\n          _ = s.minWidth && s.minWidth > p,\n          v = s.minHeight && s.minHeight > f;\n\n      s.grid = h, _ && (p += l), v && (f += c), m && (p -= l), g && (f -= c), /^(se|s|e)$/.test(r) ? (i.size.width = p, i.size.height = f) : /^(ne)$/.test(r) ? (i.size.width = p, i.size.height = f, i.position.top = a.top - d) : /^(sw)$/.test(r) ? (i.size.width = p, i.size.height = f, i.position.left = a.left - u) : ((0 >= f - c || 0 >= p - l) && (e = i._getPaddingPlusBorderDimensions(this)), f - c > 0 ? (i.size.height = f, i.position.top = a.top - d) : (f = c - e.height, i.size.height = f, i.position.top = a.top + o.height - f), p - l > 0 ? (i.size.width = p, i.position.left = a.left - u) : (p = l - e.width, i.size.width = p, i.position.left = a.left + o.width - p));\n    }\n  }), t.ui.resizable, t.widget(\"ui.sortable\", t.ui.mouse, {\n    version: \"1.12.1\",\n    widgetEventPrefix: \"sort\",\n    ready: !1,\n    options: {\n      appendTo: \"parent\",\n      axis: !1,\n      connectWith: !1,\n      containment: !1,\n      cursor: \"auto\",\n      cursorAt: !1,\n      dropOnEmpty: !0,\n      forcePlaceholderSize: !1,\n      forceHelperSize: !1,\n      grid: !1,\n      handle: !1,\n      helper: \"original\",\n      items: \"> *\",\n      opacity: !1,\n      placeholder: !1,\n      revert: !1,\n      scroll: !0,\n      scrollSensitivity: 20,\n      scrollSpeed: 20,\n      scope: \"default\",\n      tolerance: \"intersect\",\n      zIndex: 1e3,\n      activate: null,\n      beforeStop: null,\n      change: null,\n      deactivate: null,\n      out: null,\n      over: null,\n      receive: null,\n      remove: null,\n      sort: null,\n      start: null,\n      stop: null,\n      update: null\n    },\n    _isOverAxis: function _isOverAxis(t, e, i) {\n      return t >= e && e + i > t;\n    },\n    _isFloating: function _isFloating(t) {\n      return /left|right/.test(t.css(\"float\")) || /inline|table-cell/.test(t.css(\"display\"));\n    },\n    _create: function _create() {\n      this.containerCache = {}, this._addClass(\"ui-sortable\"), this.refresh(), this.offset = this.element.offset(), this._mouseInit(), this._setHandleClassName(), this.ready = !0;\n    },\n    _setOption: function _setOption(t, e) {\n      this._super(t, e), \"handle\" === t && this._setHandleClassName();\n    },\n    _setHandleClassName: function _setHandleClassName() {\n      var e = this;\n      this._removeClass(this.element.find(\".ui-sortable-handle\"), \"ui-sortable-handle\"), t.each(this.items, function () {\n        e._addClass(this.instance.options.handle ? this.item.find(this.instance.options.handle) : this.item, \"ui-sortable-handle\");\n      });\n    },\n    _destroy: function _destroy() {\n      this._mouseDestroy();\n\n      for (var t = this.items.length - 1; t >= 0; t--) {\n        this.items[t].item.removeData(this.widgetName + \"-item\");\n      }\n\n      return this;\n    },\n    _mouseCapture: function _mouseCapture(e, i) {\n      var s = null,\n          n = !1,\n          o = this;\n      return this.reverting ? !1 : this.options.disabled || \"static\" === this.options.type ? !1 : (this._refreshItems(e), t(e.target).parents().each(function () {\n        return t.data(this, o.widgetName + \"-item\") === o ? (s = t(this), !1) : void 0;\n      }), t.data(e.target, o.widgetName + \"-item\") === o && (s = t(e.target)), s ? !this.options.handle || i || (t(this.options.handle, s).find(\"*\").addBack().each(function () {\n        this === e.target && (n = !0);\n      }), n) ? (this.currentItem = s, this._removeCurrentsFromItems(), !0) : !1 : !1);\n    },\n    _mouseStart: function _mouseStart(e, i, s) {\n      var n,\n          o,\n          a = this.options;\n      if (this.currentContainer = this, this.refreshPositions(), this.helper = this._createHelper(e), this._cacheHelperProportions(), this._cacheMargins(), this.scrollParent = this.helper.scrollParent(), this.offset = this.currentItem.offset(), this.offset = {\n        top: this.offset.top - this.margins.top,\n        left: this.offset.left - this.margins.left\n      }, t.extend(this.offset, {\n        click: {\n          left: e.pageX - this.offset.left,\n          top: e.pageY - this.offset.top\n        },\n        parent: this._getParentOffset(),\n        relative: this._getRelativeOffset()\n      }), this.helper.css(\"position\", \"absolute\"), this.cssPosition = this.helper.css(\"position\"), this.originalPosition = this._generatePosition(e), this.originalPageX = e.pageX, this.originalPageY = e.pageY, a.cursorAt && this._adjustOffsetFromHelper(a.cursorAt), this.domPosition = {\n        prev: this.currentItem.prev()[0],\n        parent: this.currentItem.parent()[0]\n      }, this.helper[0] !== this.currentItem[0] && this.currentItem.hide(), this._createPlaceholder(), a.containment && this._setContainment(), a.cursor && \"auto\" !== a.cursor && (o = this.document.find(\"body\"), this.storedCursor = o.css(\"cursor\"), o.css(\"cursor\", a.cursor), this.storedStylesheet = t(\"<style>*{ cursor: \" + a.cursor + \" !important; }</style>\").appendTo(o)), a.opacity && (this.helper.css(\"opacity\") && (this._storedOpacity = this.helper.css(\"opacity\")), this.helper.css(\"opacity\", a.opacity)), a.zIndex && (this.helper.css(\"zIndex\") && (this._storedZIndex = this.helper.css(\"zIndex\")), this.helper.css(\"zIndex\", a.zIndex)), this.scrollParent[0] !== this.document[0] && \"HTML\" !== this.scrollParent[0].tagName && (this.overflowOffset = this.scrollParent.offset()), this._trigger(\"start\", e, this._uiHash()), this._preserveHelperProportions || this._cacheHelperProportions(), !s) for (n = this.containers.length - 1; n >= 0; n--) {\n        this.containers[n]._trigger(\"activate\", e, this._uiHash(this));\n      }\n      return t.ui.ddmanager && (t.ui.ddmanager.current = this), t.ui.ddmanager && !a.dropBehaviour && t.ui.ddmanager.prepareOffsets(this, e), this.dragging = !0, this._addClass(this.helper, \"ui-sortable-helper\"), this._mouseDrag(e), !0;\n    },\n    _mouseDrag: function _mouseDrag(e) {\n      var i,\n          s,\n          n,\n          o,\n          a = this.options,\n          r = !1;\n\n      for (this.position = this._generatePosition(e), this.positionAbs = this._convertPositionTo(\"absolute\"), this.lastPositionAbs || (this.lastPositionAbs = this.positionAbs), this.options.scroll && (this.scrollParent[0] !== this.document[0] && \"HTML\" !== this.scrollParent[0].tagName ? (this.overflowOffset.top + this.scrollParent[0].offsetHeight - e.pageY < a.scrollSensitivity ? this.scrollParent[0].scrollTop = r = this.scrollParent[0].scrollTop + a.scrollSpeed : e.pageY - this.overflowOffset.top < a.scrollSensitivity && (this.scrollParent[0].scrollTop = r = this.scrollParent[0].scrollTop - a.scrollSpeed), this.overflowOffset.left + this.scrollParent[0].offsetWidth - e.pageX < a.scrollSensitivity ? this.scrollParent[0].scrollLeft = r = this.scrollParent[0].scrollLeft + a.scrollSpeed : e.pageX - this.overflowOffset.left < a.scrollSensitivity && (this.scrollParent[0].scrollLeft = r = this.scrollParent[0].scrollLeft - a.scrollSpeed)) : (e.pageY - this.document.scrollTop() < a.scrollSensitivity ? r = this.document.scrollTop(this.document.scrollTop() - a.scrollSpeed) : this.window.height() - (e.pageY - this.document.scrollTop()) < a.scrollSensitivity && (r = this.document.scrollTop(this.document.scrollTop() + a.scrollSpeed)), e.pageX - this.document.scrollLeft() < a.scrollSensitivity ? r = this.document.scrollLeft(this.document.scrollLeft() - a.scrollSpeed) : this.window.width() - (e.pageX - this.document.scrollLeft()) < a.scrollSensitivity && (r = this.document.scrollLeft(this.document.scrollLeft() + a.scrollSpeed))), r !== !1 && t.ui.ddmanager && !a.dropBehaviour && t.ui.ddmanager.prepareOffsets(this, e)), this.positionAbs = this._convertPositionTo(\"absolute\"), this.options.axis && \"y\" === this.options.axis || (this.helper[0].style.left = this.position.left + \"px\"), this.options.axis && \"x\" === this.options.axis || (this.helper[0].style.top = this.position.top + \"px\"), i = this.items.length - 1; i >= 0; i--) {\n        if (s = this.items[i], n = s.item[0], o = this._intersectsWithPointer(s), o && s.instance === this.currentContainer && n !== this.currentItem[0] && this.placeholder[1 === o ? \"next\" : \"prev\"]()[0] !== n && !t.contains(this.placeholder[0], n) && (\"semi-dynamic\" === this.options.type ? !t.contains(this.element[0], n) : !0)) {\n          if (this.direction = 1 === o ? \"down\" : \"up\", \"pointer\" !== this.options.tolerance && !this._intersectsWithSides(s)) break;\n          this._rearrange(e, s), this._trigger(\"change\", e, this._uiHash());\n          break;\n        }\n      }\n\n      return this._contactContainers(e), t.ui.ddmanager && t.ui.ddmanager.drag(this, e), this._trigger(\"sort\", e, this._uiHash()), this.lastPositionAbs = this.positionAbs, !1;\n    },\n    _mouseStop: function _mouseStop(e, i) {\n      if (e) {\n        if (t.ui.ddmanager && !this.options.dropBehaviour && t.ui.ddmanager.drop(this, e), this.options.revert) {\n          var s = this,\n              n = this.placeholder.offset(),\n              o = this.options.axis,\n              a = {};\n          o && \"x\" !== o || (a.left = n.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft)), o && \"y\" !== o || (a.top = n.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop)), this.reverting = !0, t(this.helper).animate(a, parseInt(this.options.revert, 10) || 500, function () {\n            s._clear(e);\n          });\n        } else this._clear(e, i);\n\n        return !1;\n      }\n    },\n    cancel: function cancel() {\n      if (this.dragging) {\n        this._mouseUp(new t.Event(\"mouseup\", {\n          target: null\n        })), \"original\" === this.options.helper ? (this.currentItem.css(this._storedCSS), this._removeClass(this.currentItem, \"ui-sortable-helper\")) : this.currentItem.show();\n\n        for (var e = this.containers.length - 1; e >= 0; e--) {\n          this.containers[e]._trigger(\"deactivate\", null, this._uiHash(this)), this.containers[e].containerCache.over && (this.containers[e]._trigger(\"out\", null, this._uiHash(this)), this.containers[e].containerCache.over = 0);\n        }\n      }\n\n      return this.placeholder && (this.placeholder[0].parentNode && this.placeholder[0].parentNode.removeChild(this.placeholder[0]), \"original\" !== this.options.helper && this.helper && this.helper[0].parentNode && this.helper.remove(), t.extend(this, {\n        helper: null,\n        dragging: !1,\n        reverting: !1,\n        _noFinalSort: null\n      }), this.domPosition.prev ? t(this.domPosition.prev).after(this.currentItem) : t(this.domPosition.parent).prepend(this.currentItem)), this;\n    },\n    serialize: function serialize(e) {\n      var i = this._getItemsAsjQuery(e && e.connected),\n          s = [];\n\n      return e = e || {}, t(i).each(function () {\n        var i = (t(e.item || this).attr(e.attribute || \"id\") || \"\").match(e.expression || /(.+)[\\-=_](.+)/);\n        i && s.push((e.key || i[1] + \"[]\") + \"=\" + (e.key && e.expression ? i[1] : i[2]));\n      }), !s.length && e.key && s.push(e.key + \"=\"), s.join(\"&\");\n    },\n    toArray: function toArray(e) {\n      var i = this._getItemsAsjQuery(e && e.connected),\n          s = [];\n\n      return e = e || {}, i.each(function () {\n        s.push(t(e.item || this).attr(e.attribute || \"id\") || \"\");\n      }), s;\n    },\n    _intersectsWith: function _intersectsWith(t) {\n      var e = this.positionAbs.left,\n          i = e + this.helperProportions.width,\n          s = this.positionAbs.top,\n          n = s + this.helperProportions.height,\n          o = t.left,\n          a = o + t.width,\n          r = t.top,\n          h = r + t.height,\n          l = this.offset.click.top,\n          c = this.offset.click.left,\n          u = \"x\" === this.options.axis || s + l > r && h > s + l,\n          d = \"y\" === this.options.axis || e + c > o && a > e + c,\n          p = u && d;\n      return \"pointer\" === this.options.tolerance || this.options.forcePointerForContainers || \"pointer\" !== this.options.tolerance && this.helperProportions[this.floating ? \"width\" : \"height\"] > t[this.floating ? \"width\" : \"height\"] ? p : e + this.helperProportions.width / 2 > o && a > i - this.helperProportions.width / 2 && s + this.helperProportions.height / 2 > r && h > n - this.helperProportions.height / 2;\n    },\n    _intersectsWithPointer: function _intersectsWithPointer(t) {\n      var e,\n          i,\n          s = \"x\" === this.options.axis || this._isOverAxis(this.positionAbs.top + this.offset.click.top, t.top, t.height),\n          n = \"y\" === this.options.axis || this._isOverAxis(this.positionAbs.left + this.offset.click.left, t.left, t.width),\n          o = s && n;\n\n      return o ? (e = this._getDragVerticalDirection(), i = this._getDragHorizontalDirection(), this.floating ? \"right\" === i || \"down\" === e ? 2 : 1 : e && (\"down\" === e ? 2 : 1)) : !1;\n    },\n    _intersectsWithSides: function _intersectsWithSides(t) {\n      var e = this._isOverAxis(this.positionAbs.top + this.offset.click.top, t.top + t.height / 2, t.height),\n          i = this._isOverAxis(this.positionAbs.left + this.offset.click.left, t.left + t.width / 2, t.width),\n          s = this._getDragVerticalDirection(),\n          n = this._getDragHorizontalDirection();\n\n      return this.floating && n ? \"right\" === n && i || \"left\" === n && !i : s && (\"down\" === s && e || \"up\" === s && !e);\n    },\n    _getDragVerticalDirection: function _getDragVerticalDirection() {\n      var t = this.positionAbs.top - this.lastPositionAbs.top;\n      return 0 !== t && (t > 0 ? \"down\" : \"up\");\n    },\n    _getDragHorizontalDirection: function _getDragHorizontalDirection() {\n      var t = this.positionAbs.left - this.lastPositionAbs.left;\n      return 0 !== t && (t > 0 ? \"right\" : \"left\");\n    },\n    refresh: function refresh(t) {\n      return this._refreshItems(t), this._setHandleClassName(), this.refreshPositions(), this;\n    },\n    _connectWith: function _connectWith() {\n      var t = this.options;\n      return t.connectWith.constructor === String ? [t.connectWith] : t.connectWith;\n    },\n    _getItemsAsjQuery: function _getItemsAsjQuery(e) {\n      function i() {\n        r.push(this);\n      }\n\n      var s,\n          n,\n          o,\n          a,\n          r = [],\n          h = [],\n          l = this._connectWith();\n\n      if (l && e) for (s = l.length - 1; s >= 0; s--) {\n        for (o = t(l[s], this.document[0]), n = o.length - 1; n >= 0; n--) {\n          a = t.data(o[n], this.widgetFullName), a && a !== this && !a.options.disabled && h.push([t.isFunction(a.options.items) ? a.options.items.call(a.element) : t(a.options.items, a.element).not(\".ui-sortable-helper\").not(\".ui-sortable-placeholder\"), a]);\n        }\n      }\n\n      for (h.push([t.isFunction(this.options.items) ? this.options.items.call(this.element, null, {\n        options: this.options,\n        item: this.currentItem\n      }) : t(this.options.items, this.element).not(\".ui-sortable-helper\").not(\".ui-sortable-placeholder\"), this]), s = h.length - 1; s >= 0; s--) {\n        h[s][0].each(i);\n      }\n\n      return t(r);\n    },\n    _removeCurrentsFromItems: function _removeCurrentsFromItems() {\n      var e = this.currentItem.find(\":data(\" + this.widgetName + \"-item)\");\n      this.items = t.grep(this.items, function (t) {\n        for (var i = 0; e.length > i; i++) {\n          if (e[i] === t.item[0]) return !1;\n        }\n\n        return !0;\n      });\n    },\n    _refreshItems: function _refreshItems(e) {\n      this.items = [], this.containers = [this];\n\n      var i,\n          s,\n          n,\n          o,\n          a,\n          r,\n          h,\n          l,\n          c = this.items,\n          u = [[t.isFunction(this.options.items) ? this.options.items.call(this.element[0], e, {\n        item: this.currentItem\n      }) : t(this.options.items, this.element), this]],\n          d = this._connectWith();\n\n      if (d && this.ready) for (i = d.length - 1; i >= 0; i--) {\n        for (n = t(d[i], this.document[0]), s = n.length - 1; s >= 0; s--) {\n          o = t.data(n[s], this.widgetFullName), o && o !== this && !o.options.disabled && (u.push([t.isFunction(o.options.items) ? o.options.items.call(o.element[0], e, {\n            item: this.currentItem\n          }) : t(o.options.items, o.element), o]), this.containers.push(o));\n        }\n      }\n\n      for (i = u.length - 1; i >= 0; i--) {\n        for (a = u[i][1], r = u[i][0], s = 0, l = r.length; l > s; s++) {\n          h = t(r[s]), h.data(this.widgetName + \"-item\", a), c.push({\n            item: h,\n            instance: a,\n            width: 0,\n            height: 0,\n            left: 0,\n            top: 0\n          });\n        }\n      }\n    },\n    refreshPositions: function refreshPositions(e) {\n      this.floating = this.items.length ? \"x\" === this.options.axis || this._isFloating(this.items[0].item) : !1, this.offsetParent && this.helper && (this.offset.parent = this._getParentOffset());\n      var i, s, n, o;\n\n      for (i = this.items.length - 1; i >= 0; i--) {\n        s = this.items[i], s.instance !== this.currentContainer && this.currentContainer && s.item[0] !== this.currentItem[0] || (n = this.options.toleranceElement ? t(this.options.toleranceElement, s.item) : s.item, e || (s.width = n.outerWidth(), s.height = n.outerHeight()), o = n.offset(), s.left = o.left, s.top = o.top);\n      }\n\n      if (this.options.custom && this.options.custom.refreshContainers) this.options.custom.refreshContainers.call(this);else for (i = this.containers.length - 1; i >= 0; i--) {\n        o = this.containers[i].element.offset(), this.containers[i].containerCache.left = o.left, this.containers[i].containerCache.top = o.top, this.containers[i].containerCache.width = this.containers[i].element.outerWidth(), this.containers[i].containerCache.height = this.containers[i].element.outerHeight();\n      }\n      return this;\n    },\n    _createPlaceholder: function _createPlaceholder(e) {\n      e = e || this;\n      var i,\n          s = e.options;\n      s.placeholder && s.placeholder.constructor !== String || (i = s.placeholder, s.placeholder = {\n        element: function element() {\n          var s = e.currentItem[0].nodeName.toLowerCase(),\n              n = t(\"<\" + s + \">\", e.document[0]);\n          return e._addClass(n, \"ui-sortable-placeholder\", i || e.currentItem[0].className)._removeClass(n, \"ui-sortable-helper\"), \"tbody\" === s ? e._createTrPlaceholder(e.currentItem.find(\"tr\").eq(0), t(\"<tr>\", e.document[0]).appendTo(n)) : \"tr\" === s ? e._createTrPlaceholder(e.currentItem, n) : \"img\" === s && n.attr(\"src\", e.currentItem.attr(\"src\")), i || n.css(\"visibility\", \"hidden\"), n;\n        },\n        update: function update(t, n) {\n          (!i || s.forcePlaceholderSize) && (n.height() || n.height(e.currentItem.innerHeight() - parseInt(e.currentItem.css(\"paddingTop\") || 0, 10) - parseInt(e.currentItem.css(\"paddingBottom\") || 0, 10)), n.width() || n.width(e.currentItem.innerWidth() - parseInt(e.currentItem.css(\"paddingLeft\") || 0, 10) - parseInt(e.currentItem.css(\"paddingRight\") || 0, 10)));\n        }\n      }), e.placeholder = t(s.placeholder.element.call(e.element, e.currentItem)), e.currentItem.after(e.placeholder), s.placeholder.update(e, e.placeholder);\n    },\n    _createTrPlaceholder: function _createTrPlaceholder(e, i) {\n      var s = this;\n      e.children().each(function () {\n        t(\"<td>&#160;</td>\", s.document[0]).attr(\"colspan\", t(this).attr(\"colspan\") || 1).appendTo(i);\n      });\n    },\n    _contactContainers: function _contactContainers(e) {\n      var i,\n          s,\n          n,\n          o,\n          a,\n          r,\n          h,\n          l,\n          c,\n          u,\n          d = null,\n          p = null;\n\n      for (i = this.containers.length - 1; i >= 0; i--) {\n        if (!t.contains(this.currentItem[0], this.containers[i].element[0])) if (this._intersectsWith(this.containers[i].containerCache)) {\n          if (d && t.contains(this.containers[i].element[0], d.element[0])) continue;\n          d = this.containers[i], p = i;\n        } else this.containers[i].containerCache.over && (this.containers[i]._trigger(\"out\", e, this._uiHash(this)), this.containers[i].containerCache.over = 0);\n      }\n\n      if (d) if (1 === this.containers.length) this.containers[p].containerCache.over || (this.containers[p]._trigger(\"over\", e, this._uiHash(this)), this.containers[p].containerCache.over = 1);else {\n        for (n = 1e4, o = null, c = d.floating || this._isFloating(this.currentItem), a = c ? \"left\" : \"top\", r = c ? \"width\" : \"height\", u = c ? \"pageX\" : \"pageY\", s = this.items.length - 1; s >= 0; s--) {\n          t.contains(this.containers[p].element[0], this.items[s].item[0]) && this.items[s].item[0] !== this.currentItem[0] && (h = this.items[s].item.offset()[a], l = !1, e[u] - h > this.items[s][r] / 2 && (l = !0), n > Math.abs(e[u] - h) && (n = Math.abs(e[u] - h), o = this.items[s], this.direction = l ? \"up\" : \"down\"));\n        }\n\n        if (!o && !this.options.dropOnEmpty) return;\n        if (this.currentContainer === this.containers[p]) return this.currentContainer.containerCache.over || (this.containers[p]._trigger(\"over\", e, this._uiHash()), this.currentContainer.containerCache.over = 1), void 0;\n        o ? this._rearrange(e, o, null, !0) : this._rearrange(e, null, this.containers[p].element, !0), this._trigger(\"change\", e, this._uiHash()), this.containers[p]._trigger(\"change\", e, this._uiHash(this)), this.currentContainer = this.containers[p], this.options.placeholder.update(this.currentContainer, this.placeholder), this.containers[p]._trigger(\"over\", e, this._uiHash(this)), this.containers[p].containerCache.over = 1;\n      }\n    },\n    _createHelper: function _createHelper(e) {\n      var i = this.options,\n          s = t.isFunction(i.helper) ? t(i.helper.apply(this.element[0], [e, this.currentItem])) : \"clone\" === i.helper ? this.currentItem.clone() : this.currentItem;\n      return s.parents(\"body\").length || t(\"parent\" !== i.appendTo ? i.appendTo : this.currentItem[0].parentNode)[0].appendChild(s[0]), s[0] === this.currentItem[0] && (this._storedCSS = {\n        width: this.currentItem[0].style.width,\n        height: this.currentItem[0].style.height,\n        position: this.currentItem.css(\"position\"),\n        top: this.currentItem.css(\"top\"),\n        left: this.currentItem.css(\"left\")\n      }), (!s[0].style.width || i.forceHelperSize) && s.width(this.currentItem.width()), (!s[0].style.height || i.forceHelperSize) && s.height(this.currentItem.height()), s;\n    },\n    _adjustOffsetFromHelper: function _adjustOffsetFromHelper(e) {\n      \"string\" == typeof e && (e = e.split(\" \")), t.isArray(e) && (e = {\n        left: +e[0],\n        top: +e[1] || 0\n      }), \"left\" in e && (this.offset.click.left = e.left + this.margins.left), \"right\" in e && (this.offset.click.left = this.helperProportions.width - e.right + this.margins.left), \"top\" in e && (this.offset.click.top = e.top + this.margins.top), \"bottom\" in e && (this.offset.click.top = this.helperProportions.height - e.bottom + this.margins.top);\n    },\n    _getParentOffset: function _getParentOffset() {\n      this.offsetParent = this.helper.offsetParent();\n      var e = this.offsetParent.offset();\n      return \"absolute\" === this.cssPosition && this.scrollParent[0] !== this.document[0] && t.contains(this.scrollParent[0], this.offsetParent[0]) && (e.left += this.scrollParent.scrollLeft(), e.top += this.scrollParent.scrollTop()), (this.offsetParent[0] === this.document[0].body || this.offsetParent[0].tagName && \"html\" === this.offsetParent[0].tagName.toLowerCase() && t.ui.ie) && (e = {\n        top: 0,\n        left: 0\n      }), {\n        top: e.top + (parseInt(this.offsetParent.css(\"borderTopWidth\"), 10) || 0),\n        left: e.left + (parseInt(this.offsetParent.css(\"borderLeftWidth\"), 10) || 0)\n      };\n    },\n    _getRelativeOffset: function _getRelativeOffset() {\n      if (\"relative\" === this.cssPosition) {\n        var t = this.currentItem.position();\n        return {\n          top: t.top - (parseInt(this.helper.css(\"top\"), 10) || 0) + this.scrollParent.scrollTop(),\n          left: t.left - (parseInt(this.helper.css(\"left\"), 10) || 0) + this.scrollParent.scrollLeft()\n        };\n      }\n\n      return {\n        top: 0,\n        left: 0\n      };\n    },\n    _cacheMargins: function _cacheMargins() {\n      this.margins = {\n        left: parseInt(this.currentItem.css(\"marginLeft\"), 10) || 0,\n        top: parseInt(this.currentItem.css(\"marginTop\"), 10) || 0\n      };\n    },\n    _cacheHelperProportions: function _cacheHelperProportions() {\n      this.helperProportions = {\n        width: this.helper.outerWidth(),\n        height: this.helper.outerHeight()\n      };\n    },\n    _setContainment: function _setContainment() {\n      var e,\n          i,\n          s,\n          n = this.options;\n      \"parent\" === n.containment && (n.containment = this.helper[0].parentNode), (\"document\" === n.containment || \"window\" === n.containment) && (this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, \"document\" === n.containment ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left, (\"document\" === n.containment ? this.document.height() || document.body.parentNode.scrollHeight : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]), /^(document|window|parent)$/.test(n.containment) || (e = t(n.containment)[0], i = t(n.containment).offset(), s = \"hidden\" !== t(e).css(\"overflow\"), this.containment = [i.left + (parseInt(t(e).css(\"borderLeftWidth\"), 10) || 0) + (parseInt(t(e).css(\"paddingLeft\"), 10) || 0) - this.margins.left, i.top + (parseInt(t(e).css(\"borderTopWidth\"), 10) || 0) + (parseInt(t(e).css(\"paddingTop\"), 10) || 0) - this.margins.top, i.left + (s ? Math.max(e.scrollWidth, e.offsetWidth) : e.offsetWidth) - (parseInt(t(e).css(\"borderLeftWidth\"), 10) || 0) - (parseInt(t(e).css(\"paddingRight\"), 10) || 0) - this.helperProportions.width - this.margins.left, i.top + (s ? Math.max(e.scrollHeight, e.offsetHeight) : e.offsetHeight) - (parseInt(t(e).css(\"borderTopWidth\"), 10) || 0) - (parseInt(t(e).css(\"paddingBottom\"), 10) || 0) - this.helperProportions.height - this.margins.top]);\n    },\n    _convertPositionTo: function _convertPositionTo(e, i) {\n      i || (i = this.position);\n      var s = \"absolute\" === e ? 1 : -1,\n          n = \"absolute\" !== this.cssPosition || this.scrollParent[0] !== this.document[0] && t.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent,\n          o = /(html|body)/i.test(n[0].tagName);\n      return {\n        top: i.top + this.offset.relative.top * s + this.offset.parent.top * s - (\"fixed\" === this.cssPosition ? -this.scrollParent.scrollTop() : o ? 0 : n.scrollTop()) * s,\n        left: i.left + this.offset.relative.left * s + this.offset.parent.left * s - (\"fixed\" === this.cssPosition ? -this.scrollParent.scrollLeft() : o ? 0 : n.scrollLeft()) * s\n      };\n    },\n    _generatePosition: function _generatePosition(e) {\n      var i,\n          s,\n          n = this.options,\n          o = e.pageX,\n          a = e.pageY,\n          r = \"absolute\" !== this.cssPosition || this.scrollParent[0] !== this.document[0] && t.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent,\n          h = /(html|body)/i.test(r[0].tagName);\n      return \"relative\" !== this.cssPosition || this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0] || (this.offset.relative = this._getRelativeOffset()), this.originalPosition && (this.containment && (e.pageX - this.offset.click.left < this.containment[0] && (o = this.containment[0] + this.offset.click.left), e.pageY - this.offset.click.top < this.containment[1] && (a = this.containment[1] + this.offset.click.top), e.pageX - this.offset.click.left > this.containment[2] && (o = this.containment[2] + this.offset.click.left), e.pageY - this.offset.click.top > this.containment[3] && (a = this.containment[3] + this.offset.click.top)), n.grid && (i = this.originalPageY + Math.round((a - this.originalPageY) / n.grid[1]) * n.grid[1], a = this.containment ? i - this.offset.click.top >= this.containment[1] && i - this.offset.click.top <= this.containment[3] ? i : i - this.offset.click.top >= this.containment[1] ? i - n.grid[1] : i + n.grid[1] : i, s = this.originalPageX + Math.round((o - this.originalPageX) / n.grid[0]) * n.grid[0], o = this.containment ? s - this.offset.click.left >= this.containment[0] && s - this.offset.click.left <= this.containment[2] ? s : s - this.offset.click.left >= this.containment[0] ? s - n.grid[0] : s + n.grid[0] : s)), {\n        top: a - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (\"fixed\" === this.cssPosition ? -this.scrollParent.scrollTop() : h ? 0 : r.scrollTop()),\n        left: o - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (\"fixed\" === this.cssPosition ? -this.scrollParent.scrollLeft() : h ? 0 : r.scrollLeft())\n      };\n    },\n    _rearrange: function _rearrange(t, e, i, s) {\n      i ? i[0].appendChild(this.placeholder[0]) : e.item[0].parentNode.insertBefore(this.placeholder[0], \"down\" === this.direction ? e.item[0] : e.item[0].nextSibling), this.counter = this.counter ? ++this.counter : 1;\n      var n = this.counter;\n\n      this._delay(function () {\n        n === this.counter && this.refreshPositions(!s);\n      });\n    },\n    _clear: function _clear(t, e) {\n      function i(t, e, i) {\n        return function (s) {\n          i._trigger(t, s, e._uiHash(e));\n        };\n      }\n\n      this.reverting = !1;\n      var s,\n          n = [];\n\n      if (!this._noFinalSort && this.currentItem.parent().length && this.placeholder.before(this.currentItem), this._noFinalSort = null, this.helper[0] === this.currentItem[0]) {\n        for (s in this._storedCSS) {\n          (\"auto\" === this._storedCSS[s] || \"static\" === this._storedCSS[s]) && (this._storedCSS[s] = \"\");\n        }\n\n        this.currentItem.css(this._storedCSS), this._removeClass(this.currentItem, \"ui-sortable-helper\");\n      } else this.currentItem.show();\n\n      for (this.fromOutside && !e && n.push(function (t) {\n        this._trigger(\"receive\", t, this._uiHash(this.fromOutside));\n      }), !this.fromOutside && this.domPosition.prev === this.currentItem.prev().not(\".ui-sortable-helper\")[0] && this.domPosition.parent === this.currentItem.parent()[0] || e || n.push(function (t) {\n        this._trigger(\"update\", t, this._uiHash());\n      }), this !== this.currentContainer && (e || (n.push(function (t) {\n        this._trigger(\"remove\", t, this._uiHash());\n      }), n.push(function (t) {\n        return function (e) {\n          t._trigger(\"receive\", e, this._uiHash(this));\n        };\n      }.call(this, this.currentContainer)), n.push(function (t) {\n        return function (e) {\n          t._trigger(\"update\", e, this._uiHash(this));\n        };\n      }.call(this, this.currentContainer)))), s = this.containers.length - 1; s >= 0; s--) {\n        e || n.push(i(\"deactivate\", this, this.containers[s])), this.containers[s].containerCache.over && (n.push(i(\"out\", this, this.containers[s])), this.containers[s].containerCache.over = 0);\n      }\n\n      if (this.storedCursor && (this.document.find(\"body\").css(\"cursor\", this.storedCursor), this.storedStylesheet.remove()), this._storedOpacity && this.helper.css(\"opacity\", this._storedOpacity), this._storedZIndex && this.helper.css(\"zIndex\", \"auto\" === this._storedZIndex ? \"\" : this._storedZIndex), this.dragging = !1, e || this._trigger(\"beforeStop\", t, this._uiHash()), this.placeholder[0].parentNode.removeChild(this.placeholder[0]), this.cancelHelperRemoval || (this.helper[0] !== this.currentItem[0] && this.helper.remove(), this.helper = null), !e) {\n        for (s = 0; n.length > s; s++) {\n          n[s].call(this, t);\n        }\n\n        this._trigger(\"stop\", t, this._uiHash());\n      }\n\n      return this.fromOutside = !1, !this.cancelHelperRemoval;\n    },\n    _trigger: function _trigger() {\n      t.Widget.prototype._trigger.apply(this, arguments) === !1 && this.cancel();\n    },\n    _uiHash: function _uiHash(e) {\n      var i = e || this;\n      return {\n        helper: i.helper,\n        placeholder: i.placeholder || t([]),\n        position: i.position,\n        originalPosition: i.originalPosition,\n        offset: i.positionAbs,\n        item: i.currentItem,\n        sender: e ? e.element : null\n      };\n    }\n  }), t.widget(\"ui.menu\", {\n    version: \"1.12.1\",\n    defaultElement: \"<ul>\",\n    delay: 300,\n    options: {\n      icons: {\n        submenu: \"ui-icon-caret-1-e\"\n      },\n      items: \"> *\",\n      menus: \"ul\",\n      position: {\n        my: \"left top\",\n        at: \"right top\"\n      },\n      role: \"menu\",\n      blur: null,\n      focus: null,\n      select: null\n    },\n    _create: function _create() {\n      this.activeMenu = this.element, this.mouseHandled = !1, this.element.uniqueId().attr({\n        role: this.options.role,\n        tabIndex: 0\n      }), this._addClass(\"ui-menu\", \"ui-widget ui-widget-content\"), this._on({\n        \"mousedown .ui-menu-item\": function mousedownUiMenuItem(t) {\n          t.preventDefault();\n        },\n        \"click .ui-menu-item\": function clickUiMenuItem(e) {\n          var i = t(e.target),\n              s = t(t.ui.safeActiveElement(this.document[0]));\n          !this.mouseHandled && i.not(\".ui-state-disabled\").length && (this.select(e), e.isPropagationStopped() || (this.mouseHandled = !0), i.has(\".ui-menu\").length ? this.expand(e) : !this.element.is(\":focus\") && s.closest(\".ui-menu\").length && (this.element.trigger(\"focus\", [!0]), this.active && 1 === this.active.parents(\".ui-menu\").length && clearTimeout(this.timer)));\n        },\n        \"mouseenter .ui-menu-item\": function mouseenterUiMenuItem(e) {\n          if (!this.previousFilter) {\n            var i = t(e.target).closest(\".ui-menu-item\"),\n                s = t(e.currentTarget);\n            i[0] === s[0] && (this._removeClass(s.siblings().children(\".ui-state-active\"), null, \"ui-state-active\"), this.focus(e, s));\n          }\n        },\n        mouseleave: \"collapseAll\",\n        \"mouseleave .ui-menu\": \"collapseAll\",\n        focus: function focus(t, e) {\n          var i = this.active || this.element.find(this.options.items).eq(0);\n          e || this.focus(t, i);\n        },\n        blur: function blur(e) {\n          this._delay(function () {\n            var i = !t.contains(this.element[0], t.ui.safeActiveElement(this.document[0]));\n            i && this.collapseAll(e);\n          });\n        },\n        keydown: \"_keydown\"\n      }), this.refresh(), this._on(this.document, {\n        click: function click(t) {\n          this._closeOnDocumentClick(t) && this.collapseAll(t), this.mouseHandled = !1;\n        }\n      });\n    },\n    _destroy: function _destroy() {\n      var e = this.element.find(\".ui-menu-item\").removeAttr(\"role aria-disabled\"),\n          i = e.children(\".ui-menu-item-wrapper\").removeUniqueId().removeAttr(\"tabIndex role aria-haspopup\");\n      this.element.removeAttr(\"aria-activedescendant\").find(\".ui-menu\").addBack().removeAttr(\"role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex\").removeUniqueId().show(), i.children().each(function () {\n        var e = t(this);\n        e.data(\"ui-menu-submenu-caret\") && e.remove();\n      });\n    },\n    _keydown: function _keydown(e) {\n      var i,\n          s,\n          n,\n          o,\n          a = !0;\n\n      switch (e.keyCode) {\n        case t.ui.keyCode.PAGE_UP:\n          this.previousPage(e);\n          break;\n\n        case t.ui.keyCode.PAGE_DOWN:\n          this.nextPage(e);\n          break;\n\n        case t.ui.keyCode.HOME:\n          this._move(\"first\", \"first\", e);\n\n          break;\n\n        case t.ui.keyCode.END:\n          this._move(\"last\", \"last\", e);\n\n          break;\n\n        case t.ui.keyCode.UP:\n          this.previous(e);\n          break;\n\n        case t.ui.keyCode.DOWN:\n          this.next(e);\n          break;\n\n        case t.ui.keyCode.LEFT:\n          this.collapse(e);\n          break;\n\n        case t.ui.keyCode.RIGHT:\n          this.active && !this.active.is(\".ui-state-disabled\") && this.expand(e);\n          break;\n\n        case t.ui.keyCode.ENTER:\n        case t.ui.keyCode.SPACE:\n          this._activate(e);\n\n          break;\n\n        case t.ui.keyCode.ESCAPE:\n          this.collapse(e);\n          break;\n\n        default:\n          a = !1, s = this.previousFilter || \"\", o = !1, n = e.keyCode >= 96 && 105 >= e.keyCode ? \"\" + (e.keyCode - 96) : String.fromCharCode(e.keyCode), clearTimeout(this.filterTimer), n === s ? o = !0 : n = s + n, i = this._filterMenuItems(n), i = o && -1 !== i.index(this.active.next()) ? this.active.nextAll(\".ui-menu-item\") : i, i.length || (n = String.fromCharCode(e.keyCode), i = this._filterMenuItems(n)), i.length ? (this.focus(e, i), this.previousFilter = n, this.filterTimer = this._delay(function () {\n            delete this.previousFilter;\n          }, 1e3)) : delete this.previousFilter;\n      }\n\n      a && e.preventDefault();\n    },\n    _activate: function _activate(t) {\n      this.active && !this.active.is(\".ui-state-disabled\") && (this.active.children(\"[aria-haspopup='true']\").length ? this.expand(t) : this.select(t));\n    },\n    refresh: function refresh() {\n      var e,\n          i,\n          s,\n          n,\n          o,\n          a = this,\n          r = this.options.icons.submenu,\n          h = this.element.find(this.options.menus);\n      this._toggleClass(\"ui-menu-icons\", null, !!this.element.find(\".ui-icon\").length), s = h.filter(\":not(.ui-menu)\").hide().attr({\n        role: this.options.role,\n        \"aria-hidden\": \"true\",\n        \"aria-expanded\": \"false\"\n      }).each(function () {\n        var e = t(this),\n            i = e.prev(),\n            s = t(\"<span>\").data(\"ui-menu-submenu-caret\", !0);\n        a._addClass(s, \"ui-menu-icon\", \"ui-icon \" + r), i.attr(\"aria-haspopup\", \"true\").prepend(s), e.attr(\"aria-labelledby\", i.attr(\"id\"));\n      }), this._addClass(s, \"ui-menu\", \"ui-widget ui-widget-content ui-front\"), e = h.add(this.element), i = e.find(this.options.items), i.not(\".ui-menu-item\").each(function () {\n        var e = t(this);\n        a._isDivider(e) && a._addClass(e, \"ui-menu-divider\", \"ui-widget-content\");\n      }), n = i.not(\".ui-menu-item, .ui-menu-divider\"), o = n.children().not(\".ui-menu\").uniqueId().attr({\n        tabIndex: -1,\n        role: this._itemRole()\n      }), this._addClass(n, \"ui-menu-item\")._addClass(o, \"ui-menu-item-wrapper\"), i.filter(\".ui-state-disabled\").attr(\"aria-disabled\", \"true\"), this.active && !t.contains(this.element[0], this.active[0]) && this.blur();\n    },\n    _itemRole: function _itemRole() {\n      return {\n        menu: \"menuitem\",\n        listbox: \"option\"\n      }[this.options.role];\n    },\n    _setOption: function _setOption(t, e) {\n      if (\"icons\" === t) {\n        var i = this.element.find(\".ui-menu-icon\");\n\n        this._removeClass(i, null, this.options.icons.submenu)._addClass(i, null, e.submenu);\n      }\n\n      this._super(t, e);\n    },\n    _setOptionDisabled: function _setOptionDisabled(t) {\n      this._super(t), this.element.attr(\"aria-disabled\", t + \"\"), this._toggleClass(null, \"ui-state-disabled\", !!t);\n    },\n    focus: function focus(t, e) {\n      var i, s, n;\n      this.blur(t, t && \"focus\" === t.type), this._scrollIntoView(e), this.active = e.first(), s = this.active.children(\".ui-menu-item-wrapper\"), this._addClass(s, null, \"ui-state-active\"), this.options.role && this.element.attr(\"aria-activedescendant\", s.attr(\"id\")), n = this.active.parent().closest(\".ui-menu-item\").children(\".ui-menu-item-wrapper\"), this._addClass(n, null, \"ui-state-active\"), t && \"keydown\" === t.type ? this._close() : this.timer = this._delay(function () {\n        this._close();\n      }, this.delay), i = e.children(\".ui-menu\"), i.length && t && /^mouse/.test(t.type) && this._startOpening(i), this.activeMenu = e.parent(), this._trigger(\"focus\", t, {\n        item: e\n      });\n    },\n    _scrollIntoView: function _scrollIntoView(e) {\n      var i, s, n, o, a, r;\n      this._hasScroll() && (i = parseFloat(t.css(this.activeMenu[0], \"borderTopWidth\")) || 0, s = parseFloat(t.css(this.activeMenu[0], \"paddingTop\")) || 0, n = e.offset().top - this.activeMenu.offset().top - i - s, o = this.activeMenu.scrollTop(), a = this.activeMenu.height(), r = e.outerHeight(), 0 > n ? this.activeMenu.scrollTop(o + n) : n + r > a && this.activeMenu.scrollTop(o + n - a + r));\n    },\n    blur: function blur(t, e) {\n      e || clearTimeout(this.timer), this.active && (this._removeClass(this.active.children(\".ui-menu-item-wrapper\"), null, \"ui-state-active\"), this._trigger(\"blur\", t, {\n        item: this.active\n      }), this.active = null);\n    },\n    _startOpening: function _startOpening(t) {\n      clearTimeout(this.timer), \"true\" === t.attr(\"aria-hidden\") && (this.timer = this._delay(function () {\n        this._close(), this._open(t);\n      }, this.delay));\n    },\n    _open: function _open(e) {\n      var i = t.extend({\n        of: this.active\n      }, this.options.position);\n      clearTimeout(this.timer), this.element.find(\".ui-menu\").not(e.parents(\".ui-menu\")).hide().attr(\"aria-hidden\", \"true\"), e.show().removeAttr(\"aria-hidden\").attr(\"aria-expanded\", \"true\").position(i);\n    },\n    collapseAll: function collapseAll(e, i) {\n      clearTimeout(this.timer), this.timer = this._delay(function () {\n        var s = i ? this.element : t(e && e.target).closest(this.element.find(\".ui-menu\"));\n        s.length || (s = this.element), this._close(s), this.blur(e), this._removeClass(s.find(\".ui-state-active\"), null, \"ui-state-active\"), this.activeMenu = s;\n      }, this.delay);\n    },\n    _close: function _close(t) {\n      t || (t = this.active ? this.active.parent() : this.element), t.find(\".ui-menu\").hide().attr(\"aria-hidden\", \"true\").attr(\"aria-expanded\", \"false\");\n    },\n    _closeOnDocumentClick: function _closeOnDocumentClick(e) {\n      return !t(e.target).closest(\".ui-menu\").length;\n    },\n    _isDivider: function _isDivider(t) {\n      return !/[^\\-\\u2014\\u2013\\s]/.test(t.text());\n    },\n    collapse: function collapse(t) {\n      var e = this.active && this.active.parent().closest(\".ui-menu-item\", this.element);\n      e && e.length && (this._close(), this.focus(t, e));\n    },\n    expand: function expand(t) {\n      var e = this.active && this.active.children(\".ui-menu \").find(this.options.items).first();\n      e && e.length && (this._open(e.parent()), this._delay(function () {\n        this.focus(t, e);\n      }));\n    },\n    next: function next(t) {\n      this._move(\"next\", \"first\", t);\n    },\n    previous: function previous(t) {\n      this._move(\"prev\", \"last\", t);\n    },\n    isFirstItem: function isFirstItem() {\n      return this.active && !this.active.prevAll(\".ui-menu-item\").length;\n    },\n    isLastItem: function isLastItem() {\n      return this.active && !this.active.nextAll(\".ui-menu-item\").length;\n    },\n    _move: function _move(t, e, i) {\n      var s;\n      this.active && (s = \"first\" === t || \"last\" === t ? this.active[\"first\" === t ? \"prevAll\" : \"nextAll\"](\".ui-menu-item\").eq(-1) : this.active[t + \"All\"](\".ui-menu-item\").eq(0)), s && s.length && this.active || (s = this.activeMenu.find(this.options.items)[e]()), this.focus(i, s);\n    },\n    nextPage: function nextPage(e) {\n      var i, s, n;\n      return this.active ? (this.isLastItem() || (this._hasScroll() ? (s = this.active.offset().top, n = this.element.height(), this.active.nextAll(\".ui-menu-item\").each(function () {\n        return i = t(this), 0 > i.offset().top - s - n;\n      }), this.focus(e, i)) : this.focus(e, this.activeMenu.find(this.options.items)[this.active ? \"last\" : \"first\"]())), void 0) : (this.next(e), void 0);\n    },\n    previousPage: function previousPage(e) {\n      var i, s, n;\n      return this.active ? (this.isFirstItem() || (this._hasScroll() ? (s = this.active.offset().top, n = this.element.height(), this.active.prevAll(\".ui-menu-item\").each(function () {\n        return i = t(this), i.offset().top - s + n > 0;\n      }), this.focus(e, i)) : this.focus(e, this.activeMenu.find(this.options.items).first())), void 0) : (this.next(e), void 0);\n    },\n    _hasScroll: function _hasScroll() {\n      return this.element.outerHeight() < this.element.prop(\"scrollHeight\");\n    },\n    select: function select(e) {\n      this.active = this.active || t(e.target).closest(\".ui-menu-item\");\n      var i = {\n        item: this.active\n      };\n      this.active.has(\".ui-menu\").length || this.collapseAll(e, !0), this._trigger(\"select\", e, i);\n    },\n    _filterMenuItems: function _filterMenuItems(e) {\n      var i = e.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\"),\n          s = RegExp(\"^\" + i, \"i\");\n      return this.activeMenu.find(this.options.items).filter(\".ui-menu-item\").filter(function () {\n        return s.test(t.trim(t(this).children(\".ui-menu-item-wrapper\").text()));\n      });\n    }\n  }), t.widget(\"ui.autocomplete\", {\n    version: \"1.12.1\",\n    defaultElement: \"<input>\",\n    options: {\n      appendTo: null,\n      autoFocus: !1,\n      delay: 300,\n      minLength: 1,\n      position: {\n        my: \"left top\",\n        at: \"left bottom\",\n        collision: \"none\"\n      },\n      source: null,\n      change: null,\n      close: null,\n      focus: null,\n      open: null,\n      response: null,\n      search: null,\n      select: null\n    },\n    requestIndex: 0,\n    pending: 0,\n    _create: function _create() {\n      var e,\n          i,\n          s,\n          n = this.element[0].nodeName.toLowerCase(),\n          o = \"textarea\" === n,\n          a = \"input\" === n;\n      this.isMultiLine = o || !a && this._isContentEditable(this.element), this.valueMethod = this.element[o || a ? \"val\" : \"text\"], this.isNewMenu = !0, this._addClass(\"ui-autocomplete-input\"), this.element.attr(\"autocomplete\", \"off\"), this._on(this.element, {\n        keydown: function keydown(n) {\n          if (this.element.prop(\"readOnly\")) return e = !0, s = !0, i = !0, void 0;\n          e = !1, s = !1, i = !1;\n          var o = t.ui.keyCode;\n\n          switch (n.keyCode) {\n            case o.PAGE_UP:\n              e = !0, this._move(\"previousPage\", n);\n              break;\n\n            case o.PAGE_DOWN:\n              e = !0, this._move(\"nextPage\", n);\n              break;\n\n            case o.UP:\n              e = !0, this._keyEvent(\"previous\", n);\n              break;\n\n            case o.DOWN:\n              e = !0, this._keyEvent(\"next\", n);\n              break;\n\n            case o.ENTER:\n              this.menu.active && (e = !0, n.preventDefault(), this.menu.select(n));\n              break;\n\n            case o.TAB:\n              this.menu.active && this.menu.select(n);\n              break;\n\n            case o.ESCAPE:\n              this.menu.element.is(\":visible\") && (this.isMultiLine || this._value(this.term), this.close(n), n.preventDefault());\n              break;\n\n            default:\n              i = !0, this._searchTimeout(n);\n          }\n        },\n        keypress: function keypress(s) {\n          if (e) return e = !1, (!this.isMultiLine || this.menu.element.is(\":visible\")) && s.preventDefault(), void 0;\n\n          if (!i) {\n            var n = t.ui.keyCode;\n\n            switch (s.keyCode) {\n              case n.PAGE_UP:\n                this._move(\"previousPage\", s);\n\n                break;\n\n              case n.PAGE_DOWN:\n                this._move(\"nextPage\", s);\n\n                break;\n\n              case n.UP:\n                this._keyEvent(\"previous\", s);\n\n                break;\n\n              case n.DOWN:\n                this._keyEvent(\"next\", s);\n\n            }\n          }\n        },\n        input: function input(t) {\n          return s ? (s = !1, t.preventDefault(), void 0) : (this._searchTimeout(t), void 0);\n        },\n        focus: function focus() {\n          this.selectedItem = null, this.previous = this._value();\n        },\n        blur: function blur(t) {\n          return this.cancelBlur ? (delete this.cancelBlur, void 0) : (clearTimeout(this.searching), this.close(t), this._change(t), void 0);\n        }\n      }), this._initSource(), this.menu = t(\"<ul>\").appendTo(this._appendTo()).menu({\n        role: null\n      }).hide().menu(\"instance\"), this._addClass(this.menu.element, \"ui-autocomplete\", \"ui-front\"), this._on(this.menu.element, {\n        mousedown: function mousedown(e) {\n          e.preventDefault(), this.cancelBlur = !0, this._delay(function () {\n            delete this.cancelBlur, this.element[0] !== t.ui.safeActiveElement(this.document[0]) && this.element.trigger(\"focus\");\n          });\n        },\n        menufocus: function menufocus(e, i) {\n          var s, n;\n          return this.isNewMenu && (this.isNewMenu = !1, e.originalEvent && /^mouse/.test(e.originalEvent.type)) ? (this.menu.blur(), this.document.one(\"mousemove\", function () {\n            t(e.target).trigger(e.originalEvent);\n          }), void 0) : (n = i.item.data(\"ui-autocomplete-item\"), !1 !== this._trigger(\"focus\", e, {\n            item: n\n          }) && e.originalEvent && /^key/.test(e.originalEvent.type) && this._value(n.value), s = i.item.attr(\"aria-label\") || n.value, s && t.trim(s).length && (this.liveRegion.children().hide(), t(\"<div>\").text(s).appendTo(this.liveRegion)), void 0);\n        },\n        menuselect: function menuselect(e, i) {\n          var s = i.item.data(\"ui-autocomplete-item\"),\n              n = this.previous;\n          this.element[0] !== t.ui.safeActiveElement(this.document[0]) && (this.element.trigger(\"focus\"), this.previous = n, this._delay(function () {\n            this.previous = n, this.selectedItem = s;\n          })), !1 !== this._trigger(\"select\", e, {\n            item: s\n          }) && this._value(s.value), this.term = this._value(), this.close(e), this.selectedItem = s;\n        }\n      }), this.liveRegion = t(\"<div>\", {\n        role: \"status\",\n        \"aria-live\": \"assertive\",\n        \"aria-relevant\": \"additions\"\n      }).appendTo(this.document[0].body), this._addClass(this.liveRegion, null, \"ui-helper-hidden-accessible\"), this._on(this.window, {\n        beforeunload: function beforeunload() {\n          this.element.removeAttr(\"autocomplete\");\n        }\n      });\n    },\n    _destroy: function _destroy() {\n      clearTimeout(this.searching), this.element.removeAttr(\"autocomplete\"), this.menu.element.remove(), this.liveRegion.remove();\n    },\n    _setOption: function _setOption(t, e) {\n      this._super(t, e), \"source\" === t && this._initSource(), \"appendTo\" === t && this.menu.element.appendTo(this._appendTo()), \"disabled\" === t && e && this.xhr && this.xhr.abort();\n    },\n    _isEventTargetInWidget: function _isEventTargetInWidget(e) {\n      var i = this.menu.element[0];\n      return e.target === this.element[0] || e.target === i || t.contains(i, e.target);\n    },\n    _closeOnClickOutside: function _closeOnClickOutside(t) {\n      this._isEventTargetInWidget(t) || this.close();\n    },\n    _appendTo: function _appendTo() {\n      var e = this.options.appendTo;\n      return e && (e = e.jquery || e.nodeType ? t(e) : this.document.find(e).eq(0)), e && e[0] || (e = this.element.closest(\".ui-front, dialog\")), e.length || (e = this.document[0].body), e;\n    },\n    _initSource: function _initSource() {\n      var e,\n          i,\n          s = this;\n      t.isArray(this.options.source) ? (e = this.options.source, this.source = function (i, s) {\n        s(t.ui.autocomplete.filter(e, i.term));\n      }) : \"string\" == typeof this.options.source ? (i = this.options.source, this.source = function (e, n) {\n        s.xhr && s.xhr.abort(), s.xhr = t.ajax({\n          url: i,\n          data: e,\n          dataType: \"json\",\n          success: function success(t) {\n            n(t);\n          },\n          error: function error() {\n            n([]);\n          }\n        });\n      }) : this.source = this.options.source;\n    },\n    _searchTimeout: function _searchTimeout(t) {\n      clearTimeout(this.searching), this.searching = this._delay(function () {\n        var e = this.term === this._value(),\n            i = this.menu.element.is(\":visible\"),\n            s = t.altKey || t.ctrlKey || t.metaKey || t.shiftKey;\n\n        (!e || e && !i && !s) && (this.selectedItem = null, this.search(null, t));\n      }, this.options.delay);\n    },\n    search: function search(t, e) {\n      return t = null != t ? t : this._value(), this.term = this._value(), t.length < this.options.minLength ? this.close(e) : this._trigger(\"search\", e) !== !1 ? this._search(t) : void 0;\n    },\n    _search: function _search(t) {\n      this.pending++, this._addClass(\"ui-autocomplete-loading\"), this.cancelSearch = !1, this.source({\n        term: t\n      }, this._response());\n    },\n    _response: function _response() {\n      var e = ++this.requestIndex;\n      return t.proxy(function (t) {\n        e === this.requestIndex && this.__response(t), this.pending--, this.pending || this._removeClass(\"ui-autocomplete-loading\");\n      }, this);\n    },\n    __response: function __response(t) {\n      t && (t = this._normalize(t)), this._trigger(\"response\", null, {\n        content: t\n      }), !this.options.disabled && t && t.length && !this.cancelSearch ? (this._suggest(t), this._trigger(\"open\")) : this._close();\n    },\n    close: function close(t) {\n      this.cancelSearch = !0, this._close(t);\n    },\n    _close: function _close(t) {\n      this._off(this.document, \"mousedown\"), this.menu.element.is(\":visible\") && (this.menu.element.hide(), this.menu.blur(), this.isNewMenu = !0, this._trigger(\"close\", t));\n    },\n    _change: function _change(t) {\n      this.previous !== this._value() && this._trigger(\"change\", t, {\n        item: this.selectedItem\n      });\n    },\n    _normalize: function _normalize(e) {\n      return e.length && e[0].label && e[0].value ? e : t.map(e, function (e) {\n        return \"string\" == typeof e ? {\n          label: e,\n          value: e\n        } : t.extend({}, e, {\n          label: e.label || e.value,\n          value: e.value || e.label\n        });\n      });\n    },\n    _suggest: function _suggest(e) {\n      var i = this.menu.element.empty();\n      this._renderMenu(i, e), this.isNewMenu = !0, this.menu.refresh(), i.show(), this._resizeMenu(), i.position(t.extend({\n        of: this.element\n      }, this.options.position)), this.options.autoFocus && this.menu.next(), this._on(this.document, {\n        mousedown: \"_closeOnClickOutside\"\n      });\n    },\n    _resizeMenu: function _resizeMenu() {\n      var t = this.menu.element;\n      t.outerWidth(Math.max(t.width(\"\").outerWidth() + 1, this.element.outerWidth()));\n    },\n    _renderMenu: function _renderMenu(e, i) {\n      var s = this;\n      t.each(i, function (t, i) {\n        s._renderItemData(e, i);\n      });\n    },\n    _renderItemData: function _renderItemData(t, e) {\n      return this._renderItem(t, e).data(\"ui-autocomplete-item\", e);\n    },\n    _renderItem: function _renderItem(e, i) {\n      return t(\"<li>\").append(t(\"<div>\").text(i.label)).appendTo(e);\n    },\n    _move: function _move(t, e) {\n      return this.menu.element.is(\":visible\") ? this.menu.isFirstItem() && /^previous/.test(t) || this.menu.isLastItem() && /^next/.test(t) ? (this.isMultiLine || this._value(this.term), this.menu.blur(), void 0) : (this.menu[t](e), void 0) : (this.search(null, e), void 0);\n    },\n    widget: function widget() {\n      return this.menu.element;\n    },\n    _value: function _value() {\n      return this.valueMethod.apply(this.element, arguments);\n    },\n    _keyEvent: function _keyEvent(t, e) {\n      (!this.isMultiLine || this.menu.element.is(\":visible\")) && (this._move(t, e), e.preventDefault());\n    },\n    _isContentEditable: function _isContentEditable(t) {\n      if (!t.length) return !1;\n      var e = t.prop(\"contentEditable\");\n      return \"inherit\" === e ? this._isContentEditable(t.parent()) : \"true\" === e;\n    }\n  }), t.extend(t.ui.autocomplete, {\n    escapeRegex: function escapeRegex(t) {\n      return t.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n    },\n    filter: function filter(e, i) {\n      var s = RegExp(t.ui.autocomplete.escapeRegex(i), \"i\");\n      return t.grep(e, function (t) {\n        return s.test(t.label || t.value || t);\n      });\n    }\n  }), t.widget(\"ui.autocomplete\", t.ui.autocomplete, {\n    options: {\n      messages: {\n        noResults: \"No search results.\",\n        results: function results(t) {\n          return t + (t > 1 ? \" results are\" : \" result is\") + \" available, use up and down arrow keys to navigate.\";\n        }\n      }\n    },\n    __response: function __response(e) {\n      var i;\n      this._superApply(arguments), this.options.disabled || this.cancelSearch || (i = e && e.length ? this.options.messages.results(e.length) : this.options.messages.noResults, this.liveRegion.children().hide(), t(\"<div>\").text(i).appendTo(this.liveRegion));\n    }\n  }), t.ui.autocomplete;\n});\n\n//# sourceURL=webpack://domino/./src/scripts/vendors/jquery-ui.min.js?");

/***/ }),

/***/ "./src/scripts/vendors/jquery.bootstrap-touchspin.min.js":
/*!***************************************************************!*\
  !*** ./src/scripts/vendors/jquery.bootstrap-touchspin.min.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/*\r\n *  Bootstrap TouchSpin - v3.0.1\r\n *  A mobile and touch friendly input spinner component for Bootstrap 3.\r\n *  http://www.virtuosoft.eu/code/bootstrap-touchspin/\r\n *\r\n *  Made by István Ujj-Mészáros\r\n *  Under Apache License v2.0 License\r\n */\n!function (a) {\n  \"use strict\";\n\n  function b(a, b) {\n    return a + \".touchspin_\" + b;\n  }\n\n  function c(c, d) {\n    return a.map(c, function (a) {\n      return b(a, d);\n    });\n  }\n\n  var d = 0;\n\n  a.fn.TouchSpin = function (b) {\n    if (\"destroy\" === b) return void this.each(function () {\n      var b = a(this),\n          d = b.data();\n      a(document).off(c([\"mouseup\", \"touchend\", \"touchcancel\", \"mousemove\", \"touchmove\", \"scroll\", \"scrollstart\"], d.spinnerid).join(\" \"));\n    });\n    var e = {\n      min: 0,\n      max: 100,\n      initval: \"\",\n      step: 1,\n      decimals: 0,\n      stepinterval: 100,\n      forcestepdivisibility: \"round\",\n      stepintervaldelay: 500,\n      verticalbuttons: !1,\n      verticalupclass: \"fa fa-chevron-up\",\n      verticaldownclass: \"fa fa-chevron-down\",\n      prefix: \"\",\n      postfix: \"\",\n      prefix_extraclass: \"\",\n      postfix_extraclass: \"\",\n      booster: !0,\n      boostat: 10,\n      maxboostedstep: !1,\n      mousewheel: !0,\n      buttondown_class: \"btn btn-default\",\n      buttonup_class: \"btn btn-default\"\n    },\n        f = {\n      min: \"min\",\n      max: \"max\",\n      initval: \"init-val\",\n      step: \"step\",\n      decimals: \"decimals\",\n      stepinterval: \"step-interval\",\n      verticalbuttons: \"vertical-buttons\",\n      verticalupclass: \"vertical-up-class\",\n      verticaldownclass: \"vertical-down-class\",\n      forcestepdivisibility: \"force-step-divisibility\",\n      stepintervaldelay: \"step-interval-delay\",\n      prefix: \"prefix\",\n      postfix: \"postfix\",\n      prefix_extraclass: \"prefix-extra-class\",\n      postfix_extraclass: \"postfix-extra-class\",\n      booster: \"booster\",\n      boostat: \"boostat\",\n      maxboostedstep: \"max-boosted-step\",\n      mousewheel: \"mouse-wheel\",\n      buttondown_class: \"button-down-class\",\n      buttonup_class: \"button-up-class\"\n    };\n    return this.each(function () {\n      function g() {\n        if (!J.data(\"alreadyinitialized\")) {\n          if (J.data(\"alreadyinitialized\", !0), d += 1, J.data(\"spinnerid\", d), !J.is(\"input\")) return void console.log(\"Must be an input.\");\n          j(), h(), u(), m(), p(), q(), r(), s(), D.input.css(\"display\", \"block\");\n        }\n      }\n\n      function h() {\n        \"\" !== B.initval && \"\" === J.val() && J.val(B.initval);\n      }\n\n      function i(a) {\n        l(a), u();\n        var b = D.input.val();\n        \"\" !== b && (b = Number(D.input.val()), D.input.val(b.toFixed(B.decimals)));\n      }\n\n      function j() {\n        B = a.extend({}, e, K, k(), b);\n      }\n\n      function k() {\n        var b = {};\n        return a.each(f, function (a, c) {\n          var d = \"bts-\" + c;\n          J.is(\"[data-\" + d + \"]\") && (b[a] = J.data(d));\n        }), b;\n      }\n\n      function l(b) {\n        B = a.extend({}, B, b);\n      }\n\n      function m() {\n        var a = J.val(),\n            b = J.parent();\n        \"\" !== a && (a = Number(a).toFixed(B.decimals)), J.data(\"initvalue\", a).val(a), J.addClass(\"form-control\"), b.hasClass(\"input-group\") ? n(b) : o();\n      }\n\n      function n(b) {\n        b.addClass(\"bootstrap-touchspin\");\n        var c,\n            d,\n            e = J.prev(),\n            f = J.next(),\n            g = '<span class=\"input-group-addon bootstrap-touchspin-prefix\">' + B.prefix + \"</span>\",\n            h = '<span class=\"input-group-addon bootstrap-touchspin-postfix\">' + B.postfix + \"</span>\";\n        e.hasClass(\"input-group-btn\") ? (c = '<button class=\"' + B.buttondown_class + ' bootstrap-touchspin-down\" type=\"button\">-</button>', e.append(c)) : (c = '<span class=\"input-group-btn\"><button class=\"' + B.buttondown_class + ' bootstrap-touchspin-down\" type=\"button\">-</button></span>', a(c).insertBefore(J)), f.hasClass(\"input-group-btn\") ? (d = '<button class=\"' + B.buttonup_class + ' bootstrap-touchspin-up\" type=\"button\">+</button>', f.prepend(d)) : (d = '<span class=\"input-group-btn\"><button class=\"' + B.buttonup_class + ' bootstrap-touchspin-up\" type=\"button\">+</button></span>', a(d).insertAfter(J)), a(g).insertBefore(J), a(h).insertAfter(J), C = b;\n      }\n\n      function o() {\n        var b;\n        b = B.verticalbuttons ? '<div class=\"input-group bootstrap-touchspin\"><span class=\"input-group-addon bootstrap-touchspin-prefix\">' + B.prefix + '</span><span class=\"input-group-addon bootstrap-touchspin-postfix\">' + B.postfix + '</span><span class=\"input-group-btn-vertical\"><button class=\"' + B.buttondown_class + ' bootstrap-touchspin-up\" type=\"button\"><i class=\"' + B.verticalupclass + '\"></i></button><button class=\"' + B.buttonup_class + ' bootstrap-touchspin-down\" type=\"button\"><i class=\"' + B.verticaldownclass + '\"></i></button></span></div>' : '<div class=\"input-group bootstrap-touchspin\"><span class=\"input-group-btn\"><button class=\"' + B.buttondown_class + ' bootstrap-touchspin-down\" type=\"button\">-</button></span><span class=\"input-group-addon bootstrap-touchspin-prefix\">' + B.prefix + '</span><span class=\"input-group-addon bootstrap-touchspin-postfix\">' + B.postfix + '</span><span class=\"input-group-btn\"><button class=\"' + B.buttonup_class + ' bootstrap-touchspin-up\" type=\"button\">+</button></span></div>', C = a(b).insertBefore(J), a(\".bootstrap-touchspin-prefix\", C).after(J), J.hasClass(\"input-sm\") ? C.addClass(\"input-group-sm\") : J.hasClass(\"input-lg\") && C.addClass(\"input-group-lg\");\n      }\n\n      function p() {\n        D = {\n          down: a(\".bootstrap-touchspin-down\", C),\n          up: a(\".bootstrap-touchspin-up\", C),\n          input: a(\"input\", C),\n          prefix: a(\".bootstrap-touchspin-prefix\", C).addClass(B.prefix_extraclass),\n          postfix: a(\".bootstrap-touchspin-postfix\", C).addClass(B.postfix_extraclass)\n        };\n      }\n\n      function q() {\n        \"\" === B.prefix && D.prefix.hide(), \"\" === B.postfix && D.postfix.hide();\n      }\n\n      function r() {\n        J.on(\"keydown\", function (a) {\n          var b = a.keyCode || a.which;\n          38 === b ? (\"up\" !== M && (w(), z()), a.preventDefault()) : 40 === b && (\"down\" !== M && (x(), y()), a.preventDefault());\n        }), J.on(\"keyup\", function (a) {\n          var b = a.keyCode || a.which;\n          38 === b ? A() : 40 === b && A();\n        }), J.on(\"blur\", function () {\n          u();\n        }), D.down.on(\"keydown\", function (a) {\n          var b = a.keyCode || a.which;\n          (32 === b || 13 === b) && (\"down\" !== M && (x(), y()), a.preventDefault());\n        }), D.down.on(\"keyup\", function (a) {\n          var b = a.keyCode || a.which;\n          (32 === b || 13 === b) && A();\n        }), D.up.on(\"keydown\", function (a) {\n          var b = a.keyCode || a.which;\n          (32 === b || 13 === b) && (\"up\" !== M && (w(), z()), a.preventDefault());\n        }), D.up.on(\"keyup\", function (a) {\n          var b = a.keyCode || a.which;\n          (32 === b || 13 === b) && A();\n        }), D.down.on(\"mousedown.touchspin\", function (a) {\n          D.down.off(\"touchstart.touchspin\"), J.is(\":disabled\") || (x(), y(), a.preventDefault(), a.stopPropagation());\n        }), D.down.on(\"touchstart.touchspin\", function (a) {\n          D.down.off(\"mousedown.touchspin\"), J.is(\":disabled\") || (x(), y(), a.preventDefault(), a.stopPropagation());\n        }), D.up.on(\"mousedown.touchspin\", function (a) {\n          D.up.off(\"touchstart.touchspin\"), J.is(\":disabled\") || (w(), z(), a.preventDefault(), a.stopPropagation());\n        }), D.up.on(\"touchstart.touchspin\", function (a) {\n          D.up.off(\"mousedown.touchspin\"), J.is(\":disabled\") || (w(), z(), a.preventDefault(), a.stopPropagation());\n        }), D.up.on(\"mouseout touchleave touchend touchcancel\", function (a) {\n          M && (a.stopPropagation(), A());\n        }), D.down.on(\"mouseout touchleave touchend touchcancel\", function (a) {\n          M && (a.stopPropagation(), A());\n        }), D.down.on(\"mousemove touchmove\", function (a) {\n          M && (a.stopPropagation(), a.preventDefault());\n        }), D.up.on(\"mousemove touchmove\", function (a) {\n          M && (a.stopPropagation(), a.preventDefault());\n        }), a(document).on(c([\"mouseup\", \"touchend\", \"touchcancel\"], d).join(\" \"), function (a) {\n          M && (a.preventDefault(), A());\n        }), a(document).on(c([\"mousemove\", \"touchmove\", \"scroll\", \"scrollstart\"], d).join(\" \"), function (a) {\n          M && (a.preventDefault(), A());\n        }), J.on(\"mousewheel DOMMouseScroll\", function (a) {\n          if (B.mousewheel && J.is(\":focus\")) {\n            var b = a.originalEvent.wheelDelta || -a.originalEvent.deltaY || -a.originalEvent.detail;\n            a.stopPropagation(), a.preventDefault(), 0 > b ? x() : w();\n          }\n        });\n      }\n\n      function s() {\n        J.on(\"touchspin.uponce\", function () {\n          A(), w();\n        }), J.on(\"touchspin.downonce\", function () {\n          A(), x();\n        }), J.on(\"touchspin.startupspin\", function () {\n          z();\n        }), J.on(\"touchspin.startdownspin\", function () {\n          y();\n        }), J.on(\"touchspin.stopspin\", function () {\n          A();\n        }), J.on(\"touchspin.updatesettings\", function (a, b) {\n          i(b);\n        });\n      }\n\n      function t(a) {\n        switch (B.forcestepdivisibility) {\n          case \"round\":\n            return (Math.round(a / B.step) * B.step).toFixed(B.decimals);\n\n          case \"floor\":\n            return (Math.floor(a / B.step) * B.step).toFixed(B.decimals);\n\n          case \"ceil\":\n            return (Math.ceil(a / B.step) * B.step).toFixed(B.decimals);\n\n          default:\n            return a;\n        }\n      }\n\n      function u() {\n        var a, b, c;\n        a = J.val(), \"\" !== a && (B.decimals > 0 && \".\" === a || (b = parseFloat(a), isNaN(b) && (b = 0), c = b, b.toString() !== a && (c = b), b < B.min && (c = B.min), b > B.max && (c = B.max), c = t(c), Number(a).toString() !== c.toString() && (J.val(c), J.trigger(\"change\"))));\n      }\n\n      function v() {\n        if (B.booster) {\n          var a = Math.pow(2, Math.floor(L / B.boostat)) * B.step;\n          return B.maxboostedstep && a > B.maxboostedstep && (a = B.maxboostedstep, E = Math.round(E / a) * a), Math.max(B.step, a);\n        }\n\n        return B.step;\n      }\n\n      function w() {\n        u(), E = parseFloat(D.input.val()), isNaN(E) && (E = 0);\n        var a = E,\n            b = v();\n        E += b, E > B.max && (E = B.max, J.trigger(\"touchspin.on.max\"), A()), D.input.val(Number(E).toFixed(B.decimals)), a !== E && J.trigger(\"change\");\n      }\n\n      function x() {\n        u(), E = parseFloat(D.input.val()), isNaN(E) && (E = 0);\n        var a = E,\n            b = v();\n        E -= b, E < B.min && (E = B.min, J.trigger(\"touchspin.on.min\"), A()), D.input.val(E.toFixed(B.decimals)), a !== E && J.trigger(\"change\");\n      }\n\n      function y() {\n        A(), L = 0, M = \"down\", J.trigger(\"touchspin.on.startspin\"), J.trigger(\"touchspin.on.startdownspin\"), H = setTimeout(function () {\n          F = setInterval(function () {\n            L++, x();\n          }, B.stepinterval);\n        }, B.stepintervaldelay);\n      }\n\n      function z() {\n        A(), L = 0, M = \"up\", J.trigger(\"touchspin.on.startspin\"), J.trigger(\"touchspin.on.startupspin\"), I = setTimeout(function () {\n          G = setInterval(function () {\n            L++, w();\n          }, B.stepinterval);\n        }, B.stepintervaldelay);\n      }\n\n      function A() {\n        switch (clearTimeout(H), clearTimeout(I), clearInterval(F), clearInterval(G), M) {\n          case \"up\":\n            J.trigger(\"touchspin.on.stopupspin\"), J.trigger(\"touchspin.on.stopspin\");\n            break;\n\n          case \"down\":\n            J.trigger(\"touchspin.on.stopdownspin\"), J.trigger(\"touchspin.on.stopspin\");\n        }\n\n        L = 0, M = !1;\n      }\n\n      var B,\n          C,\n          D,\n          E,\n          F,\n          G,\n          H,\n          I,\n          J = a(this),\n          K = J.data(),\n          L = 0,\n          M = !1;\n      g();\n    });\n  };\n}(jQuery);\n\n//# sourceURL=webpack://domino/./src/scripts/vendors/jquery.bootstrap-touchspin.min.js?");

/***/ }),

/***/ "./src/scripts/vendors/jquery.maskedinput.min.js":
/*!*******************************************************!*\
  !*** ./src/scripts/vendors/jquery.maskedinput.min.js ***!
  \*******************************************************/
/***/ ((module, exports, __webpack_require__) => {

eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n/*\r\n    jQuery Masked Input Plugin\r\n    Copyright (c) 2007 - 2015 Josh Bush (digitalbush.com)\r\n    Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)\r\n    Version: 1.4.1\r\n*/\n!function (a) {\n   true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")], __WEBPACK_AMD_DEFINE_FACTORY__ = (a),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;\n}(function (a) {\n  var b,\n      c = navigator.userAgent,\n      d = /iphone/i.test(c),\n      e = /chrome/i.test(c),\n      f = /android/i.test(c);\n  a.mask = {\n    definitions: {\n      9: \"[0-9]\",\n      a: \"[A-Za-z]\",\n      \"*\": \"[A-Za-z0-9]\"\n    },\n    autoclear: !0,\n    dataName: \"rawMaskFn\",\n    placeholder: \"_\"\n  }, a.fn.extend({\n    caret: function caret(a, b) {\n      var c;\n      if (0 !== this.length && !this.is(\":hidden\")) return \"number\" == typeof a ? (b = \"number\" == typeof b ? b : a, this.each(function () {\n        this.setSelectionRange ? this.setSelectionRange(a, b) : this.createTextRange && (c = this.createTextRange(), c.collapse(!0), c.moveEnd(\"character\", b), c.moveStart(\"character\", a), c.select());\n      })) : (this[0].setSelectionRange ? (a = this[0].selectionStart, b = this[0].selectionEnd) : document.selection && document.selection.createRange && (c = document.selection.createRange(), a = 0 - c.duplicate().moveStart(\"character\", -1e5), b = a + c.text.length), {\n        begin: a,\n        end: b\n      });\n    },\n    unmask: function unmask() {\n      return this.trigger(\"unmask\");\n    },\n    mask: function mask(c, g) {\n      var h, i, j, k, l, m, n, o;\n\n      if (!c && this.length > 0) {\n        h = a(this[0]);\n        var p = h.data(a.mask.dataName);\n        return p ? p() : void 0;\n      }\n\n      return g = a.extend({\n        autoclear: a.mask.autoclear,\n        placeholder: a.mask.placeholder,\n        completed: null\n      }, g), i = a.mask.definitions, j = [], k = n = c.length, l = null, a.each(c.split(\"\"), function (a, b) {\n        \"?\" == b ? (n--, k = a) : i[b] ? (j.push(new RegExp(i[b])), null === l && (l = j.length - 1), k > a && (m = j.length - 1)) : j.push(null);\n      }), this.trigger(\"unmask\").each(function () {\n        function h() {\n          if (g.completed) {\n            for (var a = l; m >= a; a++) {\n              if (j[a] && C[a] === p(a)) return;\n            }\n\n            g.completed.call(B);\n          }\n        }\n\n        function p(a) {\n          return g.placeholder.charAt(a < g.placeholder.length ? a : 0);\n        }\n\n        function q(a) {\n          for (; ++a < n && !j[a];) {\n            ;\n          }\n\n          return a;\n        }\n\n        function r(a) {\n          for (; --a >= 0 && !j[a];) {\n            ;\n          }\n\n          return a;\n        }\n\n        function s(a, b) {\n          var c, d;\n\n          if (!(0 > a)) {\n            for (c = a, d = q(b); n > c; c++) {\n              if (j[c]) {\n                if (!(n > d && j[c].test(C[d]))) break;\n                C[c] = C[d], C[d] = p(d), d = q(d);\n              }\n            }\n\n            z(), B.caret(Math.max(l, a));\n          }\n        }\n\n        function t(a) {\n          var b, c, d, e;\n\n          for (b = a, c = p(a); n > b; b++) {\n            if (j[b]) {\n              if (d = q(b), e = C[b], C[b] = c, !(n > d && j[d].test(e))) break;\n              c = e;\n            }\n          }\n        }\n\n        function u() {\n          var a = B.val(),\n              b = B.caret();\n\n          if (o && o.length && o.length > a.length) {\n            for (A(!0); b.begin > 0 && !j[b.begin - 1];) {\n              b.begin--;\n            }\n\n            if (0 === b.begin) for (; b.begin < l && !j[b.begin];) {\n              b.begin++;\n            }\n            B.caret(b.begin, b.begin);\n          } else {\n            for (A(!0); b.begin < n && !j[b.begin];) {\n              b.begin++;\n            }\n\n            B.caret(b.begin, b.begin);\n          }\n\n          h();\n        }\n\n        function v() {\n          A(), B.val() != E && B.change();\n        }\n\n        function w(a) {\n          if (!B.prop(\"readonly\")) {\n            var b,\n                c,\n                e,\n                f = a.which || a.keyCode;\n            o = B.val(), 8 === f || 46 === f || d && 127 === f ? (b = B.caret(), c = b.begin, e = b.end, e - c === 0 && (c = 46 !== f ? r(c) : e = q(c - 1), e = 46 === f ? q(e) : e), y(c, e), s(c, e - 1), a.preventDefault()) : 13 === f ? v.call(this, a) : 27 === f && (B.val(E), B.caret(0, A()), a.preventDefault());\n          }\n        }\n\n        function x(b) {\n          if (!B.prop(\"readonly\")) {\n            var c,\n                d,\n                e,\n                g = b.which || b.keyCode,\n                i = B.caret();\n\n            if (!(b.ctrlKey || b.altKey || b.metaKey || 32 > g) && g && 13 !== g) {\n              if (i.end - i.begin !== 0 && (y(i.begin, i.end), s(i.begin, i.end - 1)), c = q(i.begin - 1), n > c && (d = String.fromCharCode(g), j[c].test(d))) {\n                if (t(c), C[c] = d, z(), e = q(c), f) {\n                  var k = function k() {\n                    a.proxy(a.fn.caret, B, e)();\n                  };\n\n                  setTimeout(k, 0);\n                } else B.caret(e);\n\n                i.begin <= m && h();\n              }\n\n              b.preventDefault();\n            }\n          }\n        }\n\n        function y(a, b) {\n          var c;\n\n          for (c = a; b > c && n > c; c++) {\n            j[c] && (C[c] = p(c));\n          }\n        }\n\n        function z() {\n          B.val(C.join(\"\"));\n        }\n\n        function A(a) {\n          var b,\n              c,\n              d,\n              e = B.val(),\n              f = -1;\n\n          for (b = 0, d = 0; n > b; b++) {\n            if (j[b]) {\n              for (C[b] = p(b); d++ < e.length;) {\n                if (c = e.charAt(d - 1), j[b].test(c)) {\n                  C[b] = c, f = b;\n                  break;\n                }\n              }\n\n              if (d > e.length) {\n                y(b + 1, n);\n                break;\n              }\n            } else C[b] === e.charAt(d) && d++, k > b && (f = b);\n          }\n\n          return a ? z() : k > f + 1 ? g.autoclear || C.join(\"\") === D ? (B.val() && B.val(\"\"), y(0, n)) : z() : (z(), B.val(B.val().substring(0, f + 1))), k ? b : l;\n        }\n\n        var B = a(this),\n            C = a.map(c.split(\"\"), function (a, b) {\n          return \"?\" != a ? i[a] ? p(b) : a : void 0;\n        }),\n            D = C.join(\"\"),\n            E = B.val();\n        B.data(a.mask.dataName, function () {\n          return a.map(C, function (a, b) {\n            return j[b] && a != p(b) ? a : null;\n          }).join(\"\");\n        }), B.one(\"unmask\", function () {\n          B.off(\".mask\").removeData(a.mask.dataName);\n        }).on(\"focus.mask\", function () {\n          if (!B.prop(\"readonly\")) {\n            clearTimeout(b);\n            var a;\n            E = B.val(), a = A(), b = setTimeout(function () {\n              B.get(0) === document.activeElement && (z(), a == c.replace(\"?\", \"\").length ? B.caret(0, a) : B.caret(a));\n            }, 10);\n          }\n        }).on(\"blur.mask\", v).on(\"keydown.mask\", w).on(\"keypress.mask\", x).on(\"input.mask paste.mask\", function () {\n          B.prop(\"readonly\") || setTimeout(function () {\n            var a = A(!0);\n            B.caret(a), h();\n          }, 0);\n        }), e && f && B.off(\"input.mask\").on(\"input.mask\", u), A();\n      });\n    }\n  });\n});\n\n//# sourceURL=webpack://domino/./src/scripts/vendors/jquery.maskedinput.min.js?");

/***/ }),

/***/ "./src/scripts/vendors/jsep.js":
/*!*************************************!*\
  !*** ./src/scripts/vendors/jsep.js ***!
  \*************************************/
/***/ (function(module, exports) {

eval("//     JavaScript Expression Parser (JSEP) <%= version %>\n//     JSEP may be freely distributed under the MIT License\n//     https://ericsmekens.github.io/jsep/\n\n/*global module: true, exports: true, console: true */\n(function (root) {\n  'use strict'; // Node Types\n  // ----------\n  // This is the full set of types that any JSEP node can be.\n  // Store them here to save space when minified\n\n  var COMPOUND = 'Compound',\n      IDENTIFIER = 'Identifier',\n      MEMBER_EXP = 'MemberExpression',\n      LITERAL = 'Literal',\n      THIS_EXP = 'ThisExpression',\n      CALL_EXP = 'CallExpression',\n      UNARY_EXP = 'UnaryExpression',\n      BINARY_EXP = 'BinaryExpression',\n      LOGICAL_EXP = 'LogicalExpression',\n      CONDITIONAL_EXP = 'ConditionalExpression',\n      ARRAY_EXP = 'ArrayExpression',\n      PERIOD_CODE = 46,\n      // '.'\n  COMMA_CODE = 44,\n      // ','\n  SQUOTE_CODE = 39,\n      // single quote\n  DQUOTE_CODE = 34,\n      // double quotes\n  OPAREN_CODE = 40,\n      // (\n  CPAREN_CODE = 41,\n      // )\n  OBRACK_CODE = 91,\n      // [\n  CBRACK_CODE = 93,\n      // ]\n  QUMARK_CODE = 63,\n      // ?\n  SEMCOL_CODE = 59,\n      // ;\n  COLON_CODE = 58,\n      // :\n  throwError = function throwError(message, index) {\n    var error = new Error(message + ' at character ' + index);\n    error.index = index;\n    error.description = message;\n    throw error;\n  },\n      // Operations\n  // ----------\n  // Set `t` to `true` to save space (when minified, not gzipped)\n  t = true,\n      // Use a quickly-accessible map to store all of the unary operators\n  // Values are set to `true` (it really doesn't matter)\n  unary_ops = {\n    '-': t,\n    '!': t,\n    '~': t,\n    '+': t\n  },\n      // Also use a map for the binary operations but set their values to their\n  // binary precedence for quick reference:\n  // see [Order of operations](http://en.wikipedia.org/wiki/Order_of_operations#Programming_language)\n  binary_ops = {\n    '||': 1,\n    '&&': 2,\n    '|': 3,\n    '^': 4,\n    '&': 5,\n    '==': 6,\n    '!=': 6,\n    '===': 6,\n    '!==': 6,\n    '<': 7,\n    '>': 7,\n    '<=': 7,\n    '>=': 7,\n    '<<': 8,\n    '>>': 8,\n    '>>>': 8,\n    '+': 9,\n    '-': 9,\n    '*': 10,\n    '/': 10,\n    '%': 10\n  },\n      // Get return the longest key length of any object\n  getMaxKeyLen = function getMaxKeyLen(obj) {\n    var max_len = 0,\n        len;\n\n    for (var key in obj) {\n      if ((len = key.length) > max_len && obj.hasOwnProperty(key)) {\n        max_len = len;\n      }\n    }\n\n    return max_len;\n  },\n      max_unop_len = getMaxKeyLen(unary_ops),\n      max_binop_len = getMaxKeyLen(binary_ops),\n      // Literals\n  // ----------\n  // Store the values to return for the various literals we may encounter\n  literals = {\n    'true': true,\n    'false': false,\n    'null': null\n  },\n      // Except for `this`, which is special. This could be changed to something like `'self'` as well\n  this_str = 'this',\n      // Returns the precedence of a binary operator or `0` if it isn't a binary operator\n  binaryPrecedence = function binaryPrecedence(op_val) {\n    return binary_ops[op_val] || 0;\n  },\n      // Utility function (gets called from multiple places)\n  // Also note that `a && b` and `a || b` are *logical* expressions, not binary expressions\n  createBinaryExpression = function createBinaryExpression(operator, left, right) {\n    var type = operator === '||' || operator === '&&' ? LOGICAL_EXP : BINARY_EXP;\n    return {\n      type: type,\n      operator: operator,\n      left: left,\n      right: right\n    };\n  },\n      // `ch` is a character code in the next three functions\n  isDecimalDigit = function isDecimalDigit(ch) {\n    return ch >= 48 && ch <= 57; // 0...9\n  },\n      isIdentifierStart = function isIdentifierStart(ch) {\n    return ch === 36 || ch === 95 || // `$` and `_`\n    ch >= 65 && ch <= 90 || // A...Z\n    ch >= 97 && ch <= 122 || // a...z\n    ch >= 128 && !binary_ops[String.fromCharCode(ch)]; // any non-ASCII that is not an operator\n  },\n      isIdentifierPart = function isIdentifierPart(ch) {\n    return ch === 36 || ch === 95 || // `$` and `_`\n    ch >= 65 && ch <= 90 || // A...Z\n    ch >= 97 && ch <= 122 || // a...z\n    ch >= 48 && ch <= 57 || // 0...9\n    ch >= 128 && !binary_ops[String.fromCharCode(ch)]; // any non-ASCII that is not an operator\n  },\n      // Parsing\n  // -------\n  // `expr` is a string with the passed in expression\n  jsep = function jsep(expr) {\n    // `index` stores the character number we are currently at while `length` is a constant\n    // All of the gobbles below will modify `index` as we move along\n    var index = 0,\n        charAtFunc = expr.charAt,\n        charCodeAtFunc = expr.charCodeAt,\n        exprI = function exprI(i) {\n      return charAtFunc.call(expr, i);\n    },\n        exprICode = function exprICode(i) {\n      return charCodeAtFunc.call(expr, i);\n    },\n        length = expr.length,\n        // Push `index` up to the next non-space character\n    gobbleSpaces = function gobbleSpaces() {\n      var ch = exprICode(index); // space or tab\n\n      while (ch === 32 || ch === 9 || ch === 10 || ch === 13) {\n        ch = exprICode(++index);\n      }\n    },\n        // The main parsing function. Much of this code is dedicated to ternary expressions\n    gobbleExpression = function gobbleExpression() {\n      var test = gobbleBinaryExpression(),\n          consequent,\n          alternate;\n      gobbleSpaces();\n\n      if (exprICode(index) === QUMARK_CODE) {\n        // Ternary expression: test ? consequent : alternate\n        index++;\n        consequent = gobbleExpression();\n\n        if (!consequent) {\n          throwError('Expected expression', index);\n        }\n\n        gobbleSpaces();\n\n        if (exprICode(index) === COLON_CODE) {\n          index++;\n          alternate = gobbleExpression();\n\n          if (!alternate) {\n            throwError('Expected expression', index);\n          }\n\n          return {\n            type: CONDITIONAL_EXP,\n            test: test,\n            consequent: consequent,\n            alternate: alternate\n          };\n        } else {\n          throwError('Expected :', index);\n        }\n      } else {\n        return test;\n      }\n    },\n        // Search for the operation portion of the string (e.g. `+`, `===`)\n    // Start by taking the longest possible binary operations (3 characters: `===`, `!==`, `>>>`)\n    // and move down from 3 to 2 to 1 character until a matching binary operation is found\n    // then, return that binary operation\n    gobbleBinaryOp = function gobbleBinaryOp() {\n      gobbleSpaces();\n      var biop,\n          to_check = expr.substr(index, max_binop_len),\n          tc_len = to_check.length;\n\n      while (tc_len > 0) {\n        // Don't accept a binary op when it is an identifier.\n        // Binary ops that start with a identifier-valid character must be followed\n        // by a non identifier-part valid character\n        if (binary_ops.hasOwnProperty(to_check) && (!isIdentifierStart(exprICode(index)) || index + to_check.length < expr.length && !isIdentifierPart(exprICode(index + to_check.length)))) {\n          index += tc_len;\n          return to_check;\n        }\n\n        to_check = to_check.substr(0, --tc_len);\n      }\n\n      return false;\n    },\n        // This function is responsible for gobbling an individual expression,\n    // e.g. `1`, `1+2`, `a+(b*2)-Math.sqrt(2)`\n    gobbleBinaryExpression = function gobbleBinaryExpression() {\n      var ch_i, node, biop, prec, stack, biop_info, left, right, i, cur_biop; // First, try to get the leftmost thing\n      // Then, check to see if there's a binary operator operating on that leftmost thing\n\n      left = gobbleToken();\n      biop = gobbleBinaryOp(); // If there wasn't a binary operator, just return the leftmost node\n\n      if (!biop) {\n        return left;\n      } // Otherwise, we need to start a stack to properly place the binary operations in their\n      // precedence structure\n\n\n      biop_info = {\n        value: biop,\n        prec: binaryPrecedence(biop)\n      };\n      right = gobbleToken();\n\n      if (!right) {\n        throwError(\"Expected expression after \" + biop, index);\n      }\n\n      stack = [left, biop_info, right]; // Properly deal with precedence using [recursive descent](http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm)\n\n      while (biop = gobbleBinaryOp()) {\n        prec = binaryPrecedence(biop);\n\n        if (prec === 0) {\n          break;\n        }\n\n        biop_info = {\n          value: biop,\n          prec: prec\n        };\n        cur_biop = biop; // Reduce: make a binary expression from the three topmost entries.\n\n        while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {\n          right = stack.pop();\n          biop = stack.pop().value;\n          left = stack.pop();\n          node = createBinaryExpression(biop, left, right);\n          stack.push(node);\n        }\n\n        node = gobbleToken();\n\n        if (!node) {\n          throwError(\"Expected expression after \" + cur_biop, index);\n        }\n\n        stack.push(biop_info, node);\n      }\n\n      i = stack.length - 1;\n      node = stack[i];\n\n      while (i > 1) {\n        node = createBinaryExpression(stack[i - 1].value, stack[i - 2], node);\n        i -= 2;\n      }\n\n      return node;\n    },\n        // An individual part of a binary expression:\n    // e.g. `foo.bar(baz)`, `1`, `\"abc\"`, `(a % 2)` (because it's in parenthesis)\n    gobbleToken = function gobbleToken() {\n      var ch, to_check, tc_len;\n      gobbleSpaces();\n      ch = exprICode(index);\n\n      if (isDecimalDigit(ch) || ch === PERIOD_CODE) {\n        // Char code 46 is a dot `.` which can start off a numeric literal\n        return gobbleNumericLiteral();\n      } else if (ch === SQUOTE_CODE || ch === DQUOTE_CODE) {\n        // Single or double quotes\n        return gobbleStringLiteral();\n      } else if (ch === OBRACK_CODE) {\n        return gobbleArray();\n      } else {\n        to_check = expr.substr(index, max_unop_len);\n        tc_len = to_check.length;\n\n        while (tc_len > 0) {\n          // Don't accept an unary op when it is an identifier.\n          // Unary ops that start with a identifier-valid character must be followed\n          // by a non identifier-part valid character\n          if (unary_ops.hasOwnProperty(to_check) && (!isIdentifierStart(exprICode(index)) || index + to_check.length < expr.length && !isIdentifierPart(exprICode(index + to_check.length)))) {\n            index += tc_len;\n            return {\n              type: UNARY_EXP,\n              operator: to_check,\n              argument: gobbleToken(),\n              prefix: true\n            };\n          }\n\n          to_check = to_check.substr(0, --tc_len);\n        }\n\n        if (isIdentifierStart(ch) || ch === OPAREN_CODE) {\n          // open parenthesis\n          // `foo`, `bar.baz`\n          return gobbleVariable();\n        }\n      }\n\n      return false;\n    },\n        // Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to\n    // keep track of everything in the numeric literal and then calling `parseFloat` on that string\n    gobbleNumericLiteral = function gobbleNumericLiteral() {\n      var number = '',\n          ch,\n          chCode;\n\n      while (isDecimalDigit(exprICode(index))) {\n        number += exprI(index++);\n      }\n\n      if (exprICode(index) === PERIOD_CODE) {\n        // can start with a decimal marker\n        number += exprI(index++);\n\n        while (isDecimalDigit(exprICode(index))) {\n          number += exprI(index++);\n        }\n      }\n\n      ch = exprI(index);\n\n      if (ch === 'e' || ch === 'E') {\n        // exponent marker\n        number += exprI(index++);\n        ch = exprI(index);\n\n        if (ch === '+' || ch === '-') {\n          // exponent sign\n          number += exprI(index++);\n        }\n\n        while (isDecimalDigit(exprICode(index))) {\n          //exponent itself\n          number += exprI(index++);\n        }\n\n        if (!isDecimalDigit(exprICode(index - 1))) {\n          throwError('Expected exponent (' + number + exprI(index) + ')', index);\n        }\n      }\n\n      chCode = exprICode(index); // Check to make sure this isn't a variable name that start with a number (123abc)\n\n      if (isIdentifierStart(chCode)) {\n        throwError('Variable names cannot start with a number (' + number + exprI(index) + ')', index);\n      } else if (chCode === PERIOD_CODE) {\n        throwError('Unexpected period', index);\n      }\n\n      return {\n        type: LITERAL,\n        value: parseFloat(number),\n        raw: number\n      };\n    },\n        // Parses a string literal, staring with single or double quotes with basic support for escape codes\n    // e.g. `\"hello world\"`, `'this is\\nJSEP'`\n    gobbleStringLiteral = function gobbleStringLiteral() {\n      var str = '',\n          quote = exprI(index++),\n          closed = false,\n          ch;\n\n      while (index < length) {\n        ch = exprI(index++);\n\n        if (ch === quote) {\n          closed = true;\n          break;\n        } else if (ch === '\\\\') {\n          // Check for all of the common escape codes\n          ch = exprI(index++);\n\n          switch (ch) {\n            case 'n':\n              str += '\\n';\n              break;\n\n            case 'r':\n              str += '\\r';\n              break;\n\n            case 't':\n              str += '\\t';\n              break;\n\n            case 'b':\n              str += '\\b';\n              break;\n\n            case 'f':\n              str += '\\f';\n              break;\n\n            case 'v':\n              str += '\\x0B';\n              break;\n\n            default:\n              str += ch;\n          }\n        } else {\n          str += ch;\n        }\n      }\n\n      if (!closed) {\n        throwError('Unclosed quote after \"' + str + '\"', index);\n      }\n\n      return {\n        type: LITERAL,\n        value: str,\n        raw: quote + str + quote\n      };\n    },\n        // Gobbles only identifiers\n    // e.g.: `foo`, `_value`, `$x1`\n    // Also, this function checks if that identifier is a literal:\n    // (e.g. `true`, `false`, `null`) or `this`\n    gobbleIdentifier = function gobbleIdentifier() {\n      var ch = exprICode(index),\n          start = index,\n          identifier;\n\n      if (isIdentifierStart(ch)) {\n        index++;\n      } else {\n        throwError('Unexpected ' + exprI(index), index);\n      }\n\n      while (index < length) {\n        ch = exprICode(index);\n\n        if (isIdentifierPart(ch)) {\n          index++;\n        } else {\n          break;\n        }\n      }\n\n      identifier = expr.slice(start, index);\n\n      if (literals.hasOwnProperty(identifier)) {\n        return {\n          type: LITERAL,\n          value: literals[identifier],\n          raw: identifier\n        };\n      } else if (identifier === this_str) {\n        return {\n          type: THIS_EXP\n        };\n      } else {\n        return {\n          type: IDENTIFIER,\n          name: identifier\n        };\n      }\n    },\n        // Gobbles a list of arguments within the context of a function call\n    // or array literal. This function also assumes that the opening character\n    // `(` or `[` has already been gobbled, and gobbles expressions and commas\n    // until the terminator character `)` or `]` is encountered.\n    // e.g. `foo(bar, baz)`, `my_func()`, or `[bar, baz]`\n    gobbleArguments = function gobbleArguments(termination) {\n      var ch_i,\n          args = [],\n          node,\n          closed = false;\n      var separator_count = 0;\n\n      while (index < length) {\n        gobbleSpaces();\n        ch_i = exprICode(index);\n\n        if (ch_i === termination) {\n          // done parsing\n          closed = true;\n          index++;\n\n          if (termination === CPAREN_CODE && separator_count && separator_count >= args.length) {\n            throwError('Unexpected token ' + String.fromCharCode(termination), index);\n          }\n\n          break;\n        } else if (ch_i === COMMA_CODE) {\n          // between expressions\n          index++;\n          separator_count++;\n\n          if (separator_count !== args.length) {\n            // missing argument\n            if (termination === CPAREN_CODE) {\n              throwError('Unexpected token ,', index);\n            } else if (termination === CBRACK_CODE) {\n              for (var arg = args.length; arg < separator_count; arg++) {\n                args.push(null);\n              }\n            }\n          }\n        } else {\n          node = gobbleExpression();\n\n          if (!node || node.type === COMPOUND) {\n            throwError('Expected comma', index);\n          }\n\n          args.push(node);\n        }\n      }\n\n      if (!closed) {\n        throwError('Expected ' + String.fromCharCode(termination), index);\n      }\n\n      return args;\n    },\n        // Gobble a non-literal variable name. This variable name may include properties\n    // e.g. `foo`, `bar.baz`, `foo['bar'].baz`\n    // It also gobbles function calls:\n    // e.g. `Math.acos(obj.angle)`\n    gobbleVariable = function gobbleVariable() {\n      var ch_i, node;\n      ch_i = exprICode(index);\n\n      if (ch_i === OPAREN_CODE) {\n        node = gobbleGroup();\n      } else {\n        node = gobbleIdentifier();\n      }\n\n      gobbleSpaces();\n      ch_i = exprICode(index);\n\n      while (ch_i === PERIOD_CODE || ch_i === OBRACK_CODE || ch_i === OPAREN_CODE) {\n        index++;\n\n        if (ch_i === PERIOD_CODE) {\n          gobbleSpaces();\n          node = {\n            type: MEMBER_EXP,\n            computed: false,\n            object: node,\n            property: gobbleIdentifier()\n          };\n        } else if (ch_i === OBRACK_CODE) {\n          node = {\n            type: MEMBER_EXP,\n            computed: true,\n            object: node,\n            property: gobbleExpression()\n          };\n          gobbleSpaces();\n          ch_i = exprICode(index);\n\n          if (ch_i !== CBRACK_CODE) {\n            throwError('Unclosed [', index);\n          }\n\n          index++;\n        } else if (ch_i === OPAREN_CODE) {\n          // A function call is being made; gobble all the arguments\n          node = {\n            type: CALL_EXP,\n            'arguments': gobbleArguments(CPAREN_CODE),\n            callee: node\n          };\n        }\n\n        gobbleSpaces();\n        ch_i = exprICode(index);\n      }\n\n      return node;\n    },\n        // Responsible for parsing a group of things within parentheses `()`\n    // This function assumes that it needs to gobble the opening parenthesis\n    // and then tries to gobble everything within that parenthesis, assuming\n    // that the next thing it should see is the close parenthesis. If not,\n    // then the expression probably doesn't have a `)`\n    gobbleGroup = function gobbleGroup() {\n      index++;\n      var node = gobbleExpression();\n      gobbleSpaces();\n\n      if (exprICode(index) === CPAREN_CODE) {\n        index++;\n        return node;\n      } else {\n        throwError('Unclosed (', index);\n      }\n    },\n        // Responsible for parsing Array literals `[1, 2, 3]`\n    // This function assumes that it needs to gobble the opening bracket\n    // and then tries to gobble the expressions as arguments.\n    gobbleArray = function gobbleArray() {\n      index++;\n      return {\n        type: ARRAY_EXP,\n        elements: gobbleArguments(CBRACK_CODE)\n      };\n    },\n        nodes = [],\n        ch_i,\n        node;\n\n    while (index < length) {\n      ch_i = exprICode(index); // Expressions can be separated by semicolons, commas, or just inferred without any\n      // separators\n\n      if (ch_i === SEMCOL_CODE || ch_i === COMMA_CODE) {\n        index++; // ignore separators\n      } else {\n        // Try to gobble each expression individually\n        if (node = gobbleExpression()) {\n          nodes.push(node); // If we weren't able to find a binary expression and are out of room, then\n          // the expression passed in probably has too much\n        } else if (index < length) {\n          throwError('Unexpected \"' + exprI(index) + '\"', index);\n        }\n      }\n    } // If there's only one expression just try returning the expression\n\n\n    if (nodes.length === 1) {\n      return nodes[0];\n    } else {\n      return {\n        type: COMPOUND,\n        body: nodes\n      };\n    }\n  }; // To be filled in by the template\n\n\n  jsep.version = '<%= version %>';\n\n  jsep.toString = function () {\n    return 'JavaScript Expression Parser (JSEP) v' + jsep.version;\n  };\n  /**\r\n   * @method jsep.addUnaryOp\r\n   * @param {string} op_name The name of the unary op to add\r\n   * @return jsep\r\n   */\n\n\n  jsep.addUnaryOp = function (op_name) {\n    max_unop_len = Math.max(op_name.length, max_unop_len);\n    unary_ops[op_name] = t;\n    return this;\n  };\n  /**\r\n   * @method jsep.addBinaryOp\r\n   * @param {string} op_name The name of the binary op to add\r\n   * @param {number} precedence The precedence of the binary op (can be a float)\r\n   * @return jsep\r\n   */\n\n\n  jsep.addBinaryOp = function (op_name, precedence) {\n    max_binop_len = Math.max(op_name.length, max_binop_len);\n    binary_ops[op_name] = precedence;\n    return this;\n  };\n  /**\r\n   * @method jsep.addLiteral\r\n   * @param {string} literal_name The name of the literal to add\r\n   * @param {*} literal_value The value of the literal\r\n   * @return jsep\r\n   */\n\n\n  jsep.addLiteral = function (literal_name, literal_value) {\n    literals[literal_name] = literal_value;\n    return this;\n  };\n  /**\r\n   * @method jsep.removeUnaryOp\r\n   * @param {string} op_name The name of the unary op to remove\r\n   * @return jsep\r\n   */\n\n\n  jsep.removeUnaryOp = function (op_name) {\n    delete unary_ops[op_name];\n\n    if (op_name.length === max_unop_len) {\n      max_unop_len = getMaxKeyLen(unary_ops);\n    }\n\n    return this;\n  };\n  /**\r\n   * @method jsep.removeAllUnaryOps\r\n   * @return jsep\r\n   */\n\n\n  jsep.removeAllUnaryOps = function () {\n    unary_ops = {};\n    max_unop_len = 0;\n    return this;\n  };\n  /**\r\n   * @method jsep.removeBinaryOp\r\n   * @param {string} op_name The name of the binary op to remove\r\n   * @return jsep\r\n   */\n\n\n  jsep.removeBinaryOp = function (op_name) {\n    delete binary_ops[op_name];\n\n    if (op_name.length === max_binop_len) {\n      max_binop_len = getMaxKeyLen(binary_ops);\n    }\n\n    return this;\n  };\n  /**\r\n   * @method jsep.removeAllBinaryOps\r\n   * @return jsep\r\n   */\n\n\n  jsep.removeAllBinaryOps = function () {\n    binary_ops = {};\n    max_binop_len = 0;\n    return this;\n  };\n  /**\r\n   * @method jsep.removeLiteral\r\n   * @param {string} literal_name The name of the literal to remove\r\n   * @return jsep\r\n   */\n\n\n  jsep.removeLiteral = function (literal_name) {\n    delete literals[literal_name];\n    return this;\n  };\n  /**\r\n   * @method jsep.removeAllLiterals\r\n   * @return jsep\r\n   */\n\n\n  jsep.removeAllLiterals = function () {\n    literals = {};\n    return this;\n  }; // In desktop environments, have a way to restore the old value for `jsep`\n\n\n  if (false) { var old_jsep; } else {\n    // In Node.JS environments\n    if ( true && module.exports) {\n      exports = module.exports = jsep;\n    } else {\n      exports.parse = jsep;\n    }\n  }\n})(this);\n\n//# sourceURL=webpack://domino/./src/scripts/vendors/jsep.js?");

/***/ }),

/***/ "./src/scripts/vendors/json2.js":
/*!**************************************!*\
  !*** ./src/scripts/vendors/json2.js ***!
  \**************************************/
/***/ (() => {

eval("function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n//  json2.js\n//  2016-05-01\n//  Public Domain.\n//  NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n//  See http://www.JSON.org/js.html\n//  This code should be minified before deployment.\n//  See http://javascript.crockford.com/jsmin.html\n//  USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n//  NOT CONTROL.\n//  This file creates a global JSON object containing two methods: stringify\n//  and parse. This file is provides the ES5 JSON capability to ES3 systems.\n//  If a project might run on IE8 or earlier, then this file should be included.\n//  This file does nothing on ES5 systems.\n//      JSON.stringify(value, replacer, space)\n//          value       any JavaScript value, usually an object or array.\n//          replacer    an optional parameter that determines how object\n//                      values are stringified for objects. It can be a\n//                      function or an array of strings.\n//          space       an optional parameter that specifies the indentation\n//                      of nested structures. If it is omitted, the text will\n//                      be packed without extra whitespace. If it is a number,\n//                      it will specify the number of spaces to indent at each\n//                      level. If it is a string (such as \"\\t\" or \"&nbsp;\"),\n//                      it contains the characters used to indent at each level.\n//          This method produces a JSON text from a JavaScript value.\n//          When an object value is found, if the object contains a toJSON\n//          method, its toJSON method will be called and the result will be\n//          stringified. A toJSON method does not serialize: it returns the\n//          value represented by the name/value pair that should be serialized,\n//          or undefined if nothing should be serialized. The toJSON method\n//          will be passed the key associated with the value, and this will be\n//          bound to the value.\n//          For example, this would serialize Dates as ISO strings.\n//              Date.prototype.toJSON = function (key) {\n//                  function f(n) {\n//                      // Format integers to have at least two digits.\n//                      return (n < 10)\n//                          ? \"0\" + n\n//                          : n;\n//                  }\n//                  return this.getUTCFullYear()   + \"-\" +\n//                       f(this.getUTCMonth() + 1) + \"-\" +\n//                       f(this.getUTCDate())      + \"T\" +\n//                       f(this.getUTCHours())     + \":\" +\n//                       f(this.getUTCMinutes())   + \":\" +\n//                       f(this.getUTCSeconds())   + \"Z\";\n//              };\n//          You can provide an optional replacer method. It will be passed the\n//          key and value of each member, with this bound to the containing\n//          object. The value that is returned from your method will be\n//          serialized. If your method returns undefined, then the member will\n//          be excluded from the serialization.\n//          If the replacer parameter is an array of strings, then it will be\n//          used to select the members to be serialized. It filters the results\n//          such that only members with keys listed in the replacer array are\n//          stringified.\n//          Values that do not have JSON representations, such as undefined or\n//          functions, will not be serialized. Such values in objects will be\n//          dropped; in arrays they will be replaced with null. You can use\n//          a replacer function to replace those with JSON values.\n//          JSON.stringify(undefined) returns undefined.\n//          The optional space parameter produces a stringification of the\n//          value that is filled with line breaks and indentation to make it\n//          easier to read.\n//          If the space parameter is a non-empty string, then that string will\n//          be used for indentation. If the space parameter is a number, then\n//          the indentation will be that many spaces.\n//          Example:\n//          text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n//          // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n//          text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n//          // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n//          text = JSON.stringify([new Date()], function (key, value) {\n//              return this[key] instanceof Date\n//                  ? \"Date(\" + this[key] + \")\"\n//                  : value;\n//          });\n//          // text is '[\"Date(---current time---)\"]'\n//      JSON.parse(text, reviver)\n//          This method parses a JSON text to produce an object or array.\n//          It can throw a SyntaxError exception.\n//          The optional reviver parameter is a function that can filter and\n//          transform the results. It receives each of the keys and values,\n//          and its return value is used instead of the original value.\n//          If it returns what it received, then the structure is not modified.\n//          If it returns undefined then the member is deleted.\n//          Example:\n//          // Parse the text. Values that look like ISO date strings will\n//          // be converted to Date objects.\n//          myData = JSON.parse(text, function (key, value) {\n//              var a;\n//              if (typeof value === \"string\") {\n//                  a =\n//   /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n//                  if (a) {\n//                      return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n//                          +a[5], +a[6]));\n//                  }\n//              }\n//              return value;\n//          });\n//          myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n//              var d;\n//              if (typeof value === \"string\" &&\n//                      value.slice(0, 5) === \"Date(\" &&\n//                      value.slice(-1) === \")\") {\n//                  d = new Date(value.slice(5, -1));\n//                  if (d) {\n//                      return d;\n//                  }\n//              }\n//              return value;\n//          });\n//  This is a reference implementation. You are free to copy, modify, or\n//  redistribute.\n\n/*jslint\r\n    eval, for, this\r\n*/\n\n/*property\r\n    JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\r\n    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\r\n    lastIndex, length, parse, prototype, push, replace, slice, stringify,\r\n    test, toJSON, toString, valueOf\r\n*/\n// Create a JSON object only if one does not already exist. We create the\n// methods in a closure to avoid creating global variables.\nif ((typeof JSON === \"undefined\" ? \"undefined\" : _typeof(JSON)) !== \"object\") {\n  JSON = {};\n}\n\n(function () {\n  \"use strict\";\n\n  var rx_one = /^[\\],:{}\\s]*$/;\n  var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n  var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n  var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n  var rx_escapable = /[\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n  var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n  function f(n) {\n    // Format integers to have at least two digits.\n    return n < 10 ? \"0\" + n : n;\n  }\n\n  function this_value() {\n    return this.valueOf();\n  }\n\n  if (typeof Date.prototype.toJSON !== \"function\") {\n    Date.prototype.toJSON = function () {\n      return isFinite(this.valueOf()) ? this.getUTCFullYear() + \"-\" + f(this.getUTCMonth() + 1) + \"-\" + f(this.getUTCDate()) + \"T\" + f(this.getUTCHours()) + \":\" + f(this.getUTCMinutes()) + \":\" + f(this.getUTCSeconds()) + \"Z\" : null;\n    };\n\n    Boolean.prototype.toJSON = this_value;\n    Number.prototype.toJSON = this_value;\n    String.prototype.toJSON = this_value;\n  }\n\n  var gap;\n  var indent;\n  var meta;\n  var rep;\n\n  function quote(string) {\n    // If the string contains no control characters, no quote characters, and no\n    // backslash characters, then we can safely slap some quotes around it.\n    // Otherwise we must also replace the offending characters with safe escape\n    // sequences.\n    rx_escapable.lastIndex = 0;\n    return rx_escapable.test(string) ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n      var c = meta[a];\n      return typeof c === \"string\" ? c : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n    }) + \"\\\"\" : \"\\\"\" + string + \"\\\"\";\n  }\n\n  function str(key, holder) {\n    // Produce a string from holder[key].\n    var i; // The loop counter.\n\n    var k; // The member key.\n\n    var v; // The member value.\n\n    var length;\n    var mind = gap;\n    var partial;\n    var value = holder[key]; // If the value has a toJSON method, call it to obtain a replacement value.\n\n    if (value && _typeof(value) === \"object\" && typeof value.toJSON === \"function\") {\n      value = value.toJSON(key);\n    } // If we were called with a replacer function, then call the replacer to\n    // obtain a replacement value.\n\n\n    if (typeof rep === \"function\") {\n      value = rep.call(holder, key, value);\n    } // What happens next depends on the value's type.\n\n\n    switch (_typeof(value)) {\n      case \"string\":\n        return quote(value);\n\n      case \"number\":\n        // JSON numbers must be finite. Encode non-finite numbers as null.\n        return isFinite(value) ? String(value) : \"null\";\n\n      case \"boolean\":\n      case \"null\":\n        // If the value is a boolean or null, convert it to a string. Note:\n        // typeof null does not produce \"null\". The case is included here in\n        // the remote chance that this gets fixed someday.\n        return String(value);\n      // If the type is \"object\", we might be dealing with an object or an array or\n      // null.\n\n      case \"object\":\n        // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n        // so watch out for that case.\n        if (!value) {\n          return \"null\";\n        } // Make an array to hold the partial results of stringifying this object value.\n\n\n        gap += indent;\n        partial = []; // Is the value an array?\n\n        if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n          // The value is an array. Stringify every element. Use null as a placeholder\n          // for non-JSON values.\n          length = value.length;\n\n          for (i = 0; i < length; i += 1) {\n            partial[i] = str(i, value) || \"null\";\n          } // Join all of the elements together, separated with commas, and wrap them in\n          // brackets.\n\n\n          v = partial.length === 0 ? \"[]\" : gap ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\" : \"[\" + partial.join(\",\") + \"]\";\n          gap = mind;\n          return v;\n        } // If the replacer is an array, use it to select the members to be stringified.\n\n\n        if (rep && _typeof(rep) === \"object\") {\n          length = rep.length;\n\n          for (i = 0; i < length; i += 1) {\n            if (typeof rep[i] === \"string\") {\n              k = rep[i];\n              v = str(k, value);\n\n              if (v) {\n                partial.push(quote(k) + (gap ? \": \" : \":\") + v);\n              }\n            }\n          }\n        } else {\n          // Otherwise, iterate through all of the keys in the object.\n          for (k in value) {\n            if (Object.prototype.hasOwnProperty.call(value, k)) {\n              v = str(k, value);\n\n              if (v) {\n                partial.push(quote(k) + (gap ? \": \" : \":\") + v);\n              }\n            }\n          }\n        } // Join all of the member texts together, separated with commas,\n        // and wrap them in braces.\n\n\n        v = partial.length === 0 ? \"{}\" : gap ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\" : \"{\" + partial.join(\",\") + \"}\";\n        gap = mind;\n        return v;\n    }\n  } // If the JSON object does not yet have a stringify method, give it one.\n\n\n  if (typeof JSON.stringify !== \"function\") {\n    meta = {\n      // table of character substitutions\n      \"\\b\": \"\\\\b\",\n      \"\\t\": \"\\\\t\",\n      \"\\n\": \"\\\\n\",\n      \"\\f\": \"\\\\f\",\n      \"\\r\": \"\\\\r\",\n      \"\\\"\": \"\\\\\\\"\",\n      \"\\\\\": \"\\\\\\\\\"\n    };\n\n    JSON.stringify = function (value, replacer, space) {\n      // The stringify method takes a value and an optional replacer, and an optional\n      // space parameter, and returns a JSON text. The replacer can be a function\n      // that can replace values, or an array of strings that will select the keys.\n      // A default replacer method can be provided. Use of the space parameter can\n      // produce text that is more easily readable.\n      var i;\n      gap = \"\";\n      indent = \"\"; // If the space parameter is a number, make an indent string containing that\n      // many spaces.\n\n      if (typeof space === \"number\") {\n        for (i = 0; i < space; i += 1) {\n          indent += \" \";\n        } // If the space parameter is a string, it will be used as the indent string.\n\n      } else if (typeof space === \"string\") {\n        indent = space;\n      } // If there is a replacer, it must be a function or an array.\n      // Otherwise, throw an error.\n\n\n      rep = replacer;\n\n      if (replacer && typeof replacer !== \"function\" && (_typeof(replacer) !== \"object\" || typeof replacer.length !== \"number\")) {\n        throw new Error(\"JSON.stringify\");\n      } // Make a fake root object containing our value under the key of \"\".\n      // Return the result of stringifying the value.\n\n\n      return str(\"\", {\n        \"\": value\n      });\n    };\n  } // If the JSON object does not yet have a parse method, give it one.\n\n\n  if (typeof JSON.parse !== \"function\") {\n    JSON.parse = function (text, reviver) {\n      // The parse method takes a text and an optional reviver function, and returns\n      // a JavaScript value if the text is a valid JSON text.\n      var j;\n\n      function walk(holder, key) {\n        // The walk method is used to recursively walk the resulting structure so\n        // that modifications can be made.\n        var k;\n        var v;\n        var value = holder[key];\n\n        if (value && _typeof(value) === \"object\") {\n          for (k in value) {\n            if (Object.prototype.hasOwnProperty.call(value, k)) {\n              v = walk(value, k);\n\n              if (v !== undefined) {\n                value[k] = v;\n              } else {\n                delete value[k];\n              }\n            }\n          }\n        }\n\n        return reviver.call(holder, key, value);\n      } // Parsing happens in four stages. In the first stage, we replace certain\n      // Unicode characters with escape sequences. JavaScript handles many characters\n      // incorrectly, either silently deleting them, or treating them as line endings.\n\n\n      text = String(text);\n      rx_dangerous.lastIndex = 0;\n\n      if (rx_dangerous.test(text)) {\n        text = text.replace(rx_dangerous, function (a) {\n          return \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n        });\n      } // In the second stage, we run the text against regular expressions that look\n      // for non-JSON patterns. We are especially concerned with \"()\" and \"new\"\n      // because they can cause invocation, and \"=\" because it can cause mutation.\n      // But just to be safe, we want to reject all unexpected forms.\n      // We split the second stage into 4 regexp operations in order to work around\n      // crippling inefficiencies in IE's and Safari's regexp engines. First we\n      // replace the JSON backslash pairs with \"@\" (a non-JSON character). Second, we\n      // replace all simple value tokens with \"]\" characters. Third, we delete all\n      // open brackets that follow a colon or comma or that begin the text. Finally,\n      // we look to see that the remaining characters are only whitespace or \"]\" or\n      // \",\" or \":\" or \"{\" or \"}\". If that is so, then the text is safe for eval.\n\n\n      if (rx_one.test(text.replace(rx_two, \"@\").replace(rx_three, \"]\").replace(rx_four, \"\"))) {\n        // In the third stage we use the eval function to compile the text into a\n        // JavaScript structure. The \"{\" operator is subject to a syntactic ambiguity\n        // in JavaScript: it can begin a block or an object literal. We wrap the text\n        // in parens to eliminate the ambiguity.\n        j = eval(\"(\" + text + \")\"); // In the optional fourth stage, we recursively walk the new structure, passing\n        // each name/value pair to a reviver function for possible transformation.\n\n        return typeof reviver === \"function\" ? walk({\n          \"\": j\n        }, \"\") : j;\n      } // If the text is not JSON parseable, then a SyntaxError is thrown.\n\n\n      throw new SyntaxError(\"JSON.parse\");\n    };\n  }\n})();\n\n//# sourceURL=webpack://domino/./src/scripts/vendors/json2.js?");

/***/ }),

/***/ "./src/scripts/vendors/knockout.contextmenu.js":
/*!*****************************************************!*\
  !*** ./src/scripts/vendors/knockout.contextmenu.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* provided dependency */ var _h = __webpack_require__(/*! ./src/scripts/util/helper.js */ \"./src/scripts/util/helper.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n(function (undefined) {\n  'use strict'; // client\n\n  if ((typeof ko === \"undefined\" ? \"undefined\" : _typeof(ko)) !== undefined + '') {\n    bindContextMenu(ko);\n  } // // node\n  // if (typeof module !== undefined + '' && module.exports && typeof require !== undefined + '') {\n  //   bindContextMenu(ko);\n  // }\n\n\n  function bindContextMenu(ko) {\n    var currentMenu;\n    var elementMapping = [];\n    var utils = ko.utils;\n    var registerEvent = utils.registerEventHandler;\n    var isObservable = ko.isObservable;\n    registerEvent(document, 'click', function (event) {\n      var button = event.which || event.button;\n\n      if (!event.defaultPrevented && button < 2) {\n        hideCurrentMenu();\n      }\n    });\n    utils.contextMenu = {\n      getMenuFor: function getMenuFor(element, event) {\n        var result = getMapping(element);\n\n        if (result) {\n          return result.get(event);\n        }\n      },\n      openMenuFor: function openMenuFor(element, event) {\n        var result = getMapping(element);\n\n        if (result) {\n          return result.open(event);\n        }\n      }\n    };\n    ko.bindingHandlers.contextMenu = {\n      init: function init(element, valueAccessor, allBindingsAccessor, viewModel) {\n        var eventsToHandle = valueAccessor() || {};\n        var allBindings = allBindingsAccessor();\n        var defaultClass = allBindings.contextMenuClass || 'context-menu';\n        var activeElement; // bind on click? bind on context click?\n\n        if (allBindings.bindMenuOnClick) {\n          registerEvent(element, 'click', openMenu);\n        }\n\n        if (allBindings.bindMenuOnContextMenu === undefined || allBindings.bindMenuOnContextMenu) {\n          registerEvent(element, 'contextmenu', openMenu);\n        }\n\n        elementMapping.push({\n          element: element,\n          get: function get() {\n            return activeElement;\n          },\n          open: openMenu,\n          hide: function hide() {\n            if (activeElement) {\n              activeElement.hide();\n            }\n          }\n        });\n\n        function mouseX(evt) {\n          if (evt.pageX) {\n            return evt.pageX;\n          } else if (evt.clientX) {\n            return evt.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft);\n          } else {\n            return null;\n          }\n        }\n\n        function mouseY(evt) {\n          if (evt.pageY) {\n            return evt.pageY;\n          } else if (evt.clientY) {\n            return evt.clientY + (document.documentElement.scrollTop || document.body.scrollTop);\n          } else {\n            return null;\n          }\n        }\n\n        function openMenu(event) {\n          var menuElement;\n          var context;\n          var tr = $(event.target).closest(\"tr\");\n          var li = $(event.target).closest(\"li.template-tab\");\n\n          if (tr.length) {\n            var tr = $(event.target).closest(\"tr\");\n            context = ko.contextFor(tr[0]);\n            if (context.$parent[\"rightClickSelectRow\"] !== null && context.$parent[\"rightClickSelectRow\"] !== undefined) context.$parent.rightClickSelectRow(context.$data, event.target, event);else {\n              $.each(context.$parents, function (key, value) {\n                if (value[\"rightClickSelectRow\"] !== null && value[\"rightClickSelectRow\"] !== undefined) context.$parents[key].rightClickSelectRow(context.$data, event.target, event);\n              });\n            }\n          }\n\n          if (li.length) {\n            context = ko.contextFor(li[0]);\n            context.$parent.rightClickSelectTab(context.$data, event.target, event);\n          }\n\n          activeElement = getMenu(event);\n          if (event.target.nodeName === \"LABEL\") return false;\n          menuElement = activeElement.element;\n          hideCurrentMenu();\n\n          if (menuElement) {\n            // make visibility hidden, then add to DOM so that we can get the height/width of the menu\n            menuElement.style.visibility = 'hidden';\n            (document.body || document).appendChild(menuElement); // set location\n\n            if (event) {\n              var bottomOfViewport = window.innerHeight + window.pageYOffset;\n              var rightOfViewport = window.innerWidth + window.pageXOffset;\n\n              if (mouseY(event) + menuElement.offsetHeight > bottomOfViewport) {\n                menuElement.style.top = 1 * (bottomOfViewport - menuElement.offsetHeight - 10) + 'px';\n              } else {\n                menuElement.style.top = mouseY(event) + 'px';\n              }\n\n              if (mouseX(event) + menuElement.offsetWidth > rightOfViewport) {\n                menuElement.style.left = 1 * (rightOfViewport - menuElement.offsetWidth - 10) + 'px';\n              } else {\n                menuElement.style.left = mouseX(event) + 'px';\n              }\n\n              event.preventDefault();\n              event.stopPropagation();\n            } else {\n              menuElement.style.top = element.offsetTop + element.offsetHeight + 'px';\n              menuElement.style.left = element.offsetLeft + element.offsetWidth + 'px';\n            }\n\n            menuElement.style.visibility = '';\n          }\n\n          currentMenu = menuElement;\n          return activeElement;\n        }\n\n        function getMenu(event) {\n          var menu;\n          var hasChecks = false;\n          var elements = [];\n          var actions = [];\n          var items = [];\n          var props = Object.keys(ko.isObservable(eventsToHandle) ? eventsToHandle() : eventsToHandle);\n          props.forEach(function (eventNameOutsideClosure) {\n            pushItem(eventNameOutsideClosure);\n          });\n\n          if (elements.length) {\n            menu = document.createElement('nav');\n            menu.className = defaultClass; // you may need padding to menus that has checks\n\n            menu.innerHTML = '<ul class=\"mt-contextmenu\">' + elements.join('') + '</ul>'; // map items to actions\n\n            elements.forEach(function (item, index) {\n              registerEvent(menu.children[0].children[index], 'click', function (event) {\n                var result = actions[index](viewModel, event);\n\n                if (!result && event) {\n                  event.preventDefault();\n                }\n              });\n            });\n          }\n\n          return {\n            element: menu,\n            items: items,\n            open: openMenu,\n            hide: function hide() {\n              if (menu && menu.parentNode) {\n                menu.parentNode.removeChild(menu);\n              }\n\n              currentMenu = null;\n            }\n          };\n\n          function pushItem(eventName) {\n            var item = getMenuProperties(eventName);\n            var classes = [];\n            var id = '';\n            var liHtml;\n\n            if (item.isVisible) {\n              hasChecks = hasChecks || item.isBoolean;\n\n              if (item.id) {\n                id = item.id;\n              } // set css classes\n\n\n              if (item.isChecked) {\n                classes.push('checked');\n              }\n\n              if (item.isDisabled) {\n                classes.push('disabled');\n              }\n\n              if (item.isSeparator) {\n                classes.push('separator');\n              } //if (item.url) {\n              //  classes.push('with-url');\n              //}\n\n\n              liHtml = '<li><a class=\"' + (item.isDisabled === true ? 'disabled' : '') + '\"><span class=\"mt-contextmenu-text\">' + item.html + '</span><span class=\"mt-contextmenu-icon\"><img src=\"/App/src/images/ico/' + _h.getIcon(item.icon) + '\"></span></a></li>';\n              elements.push(liHtml);\n              actions.push(item.action);\n            }\n\n            items.push(item);\n          }\n        }\n\n        function getMenuProperties(eventName) {\n          var text = '';\n          var html = '';\n          var icon = '';\n          var currentEvent = ko.isObservable(eventsToHandle) ? eventsToHandle()[eventName] : eventsToHandle[eventName];\n          var item = currentEvent || {};\n          var id = item.id;\n          var url = isObservable(item.url) ? item.url() : item.url;\n          var isVisible = item.visible === undefined || item.visible === null || isObservable(item.visible) && item.visible() || !isObservable(item.visible) && !!item.visible;\n          var isChecked = false;\n          var isEnabled = !item.disabled || isObservable(item.disabled) && !item.disabled() || isObservable(item.enabled) && item.enabled() || !isObservable(item.enabled) && !!item.enabled;\n          var isBoolean = false;\n          var isDisabled = !isEnabled;\n          var isSeparator = !!currentEvent.separator;\n\n          if (!isSeparator) {\n            text = isObservable(item.text) ? item.text() : item.text;\n            icon = isObservable(item.icon) ? item.icon() : item.icon;\n\n            if (!text) {\n              text = eventName;\n            }\n\n            if (url) {\n              html = '<a href=\"' + url + '\">' + text + '</a>';\n            } else {\n              html = text;\n            }\n          }\n\n          if (isObservable(item) && typeof item() === 'boolean' || isObservable(item.action) && typeof item.action() === 'boolean') {\n            isBoolean = true;\n\n            if (item.action && item.action() || typeof item === 'function' && item()) {\n              isChecked = true;\n            }\n          }\n\n          return {\n            html: html,\n            text: text,\n            url: url,\n            id: id,\n            icon: icon,\n            isVisible: isVisible,\n            isChecked: isChecked,\n            isEnabled: isEnabled,\n            isDisabled: isDisabled,\n            isBoolean: isBoolean,\n            isSeparator: isSeparator,\n            action: action\n          };\n\n          function action(viewModel, event) {\n            var error = eventName + ' option must have an action or an url.';\n\n            if (isDisabled) {\n              return false;\n            } // check if option is a boolean\n\n\n            if (isObservable(item) && typeof item() === 'boolean') {\n              item(!item());\n            } // is an object? well, lets check it properties\n            else if (_typeof(item) === 'object') {\n              // check if has an action or if its a separator\n              if (!item.action && !url && !isSeparator) {\n                throw error;\n              } // evaluate action\n              else if (item.action) {\n                if (isObservable(item.action) && typeof item.action() === 'boolean') {\n                  item.action(!item.action());\n                } else {\n                  item.action(viewModel, event);\n                }\n              }\n            } // its not an observable, should be a function\n            else if (typeof item === 'function') {\n              item(viewModel, event);\n            } // nothing to do with this\n            else {\n              throw error;\n            }\n\n            return true;\n          }\n        }\n      }\n    };\n\n    function hideCurrentMenu() {\n      if (currentMenu && currentMenu.parentNode) {\n        currentMenu.parentNode.removeChild(currentMenu);\n      }\n\n      currentMenu = null;\n    }\n\n    function getMapping(element) {\n      var i = 0;\n\n      for (; i < elementMapping.length; i++) {\n        if (elementMapping[i].element === element) {\n          return elementMapping[i];\n        }\n      }\n    }\n  }\n})();\n\n//# sourceURL=webpack://domino/./src/scripts/vendors/knockout.contextmenu.js?");

/***/ }),

/***/ "./src/scripts/vendors/knockout.sortable.js":
/*!**************************************************!*\
  !*** ./src/scripts/vendors/knockout.sortable.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n__webpack_require__(/*! ./jquery-ui.min.js */ \"./src/scripts/vendors/jquery-ui.min.js\");\n\n(function (factory) {\n  factory(ko, jQuery);\n})(function (ko, $) {\n  var ITEMKEY = \"ko_sortItem\",\n      INDEXKEY = \"ko_sourceIndex\",\n      LISTKEY = \"ko_sortList\",\n      PARENTKEY = \"ko_parentList\",\n      DRAGKEY = \"ko_dragItem\",\n      unwrap = ko.utils.unwrapObservable,\n      dataGet = ko.utils.domData.get,\n      dataSet = ko.utils.domData.set,\n      version = $.ui && $.ui.version,\n      //1.8.24 included a fix for how events were triggered in nested sortables. indexOf checks will fail if version starts with that value (0 vs. -1)\n  hasNestedSortableFix = version && version.indexOf(\"1.6.\") && version.indexOf(\"1.7.\") && (version.indexOf(\"1.8.\") || version === \"1.8.24\"); //internal afterRender that adds meta-data to children\n\n  var addMetaDataAfterRender = function addMetaDataAfterRender(elements, data) {\n    ko.utils.arrayForEach(elements, function (element) {\n      if (element.nodeType === 1) {\n        dataSet(element, ITEMKEY, data);\n        dataSet(element, PARENTKEY, dataGet(element.parentNode, LISTKEY));\n      }\n    });\n  }; //prepare the proper options for the template binding\n\n\n  var prepareTemplateOptions = function prepareTemplateOptions(valueAccessor, dataName) {\n    var result = {},\n        options,\n        actualAfterRender;\n    ko.ignoreDependencies(function () {\n      options = unwrap(valueAccessor() || {});\n    }); //build our options to pass to the template engine\n\n    if (options.data) {\n      result[dataName] = options.data;\n      result.name = options.template;\n    } else {\n      result[dataName] = valueAccessor();\n    }\n\n    ko.utils.arrayForEach([\"afterAdd\", \"afterRender\", \"as\", \"beforeRemove\", \"includeDestroyed\", \"templateEngine\", \"templateOptions\", \"nodes\"], function (option) {\n      if (options.hasOwnProperty(option)) {\n        result[option] = options[option];\n      } else if (ko.bindingHandlers.sortable.hasOwnProperty(option)) {\n        result[option] = ko.bindingHandlers.sortable[option];\n      }\n    }); //use an afterRender function to add meta-data\n\n    if (dataName === \"foreach\") {\n      if (result.afterRender) {\n        //wrap the existing function, if it was passed\n        actualAfterRender = result.afterRender;\n\n        result.afterRender = function (element, data) {\n          addMetaDataAfterRender.call(data, element, data);\n          actualAfterRender.call(data, element, data);\n        };\n      } else {\n        result.afterRender = addMetaDataAfterRender;\n      }\n    } //return options to pass to the template binding\n\n\n    return result;\n  };\n\n  var updateIndexFromDestroyedItems = function updateIndexFromDestroyedItems(index, items) {\n    var unwrapped = unwrap(items);\n\n    if (unwrapped) {\n      for (var i = 0; i <= index; i++) {\n        //add one for every destroyed item we find before the targetIndex in the target array\n        if (unwrapped[i] && unwrap(unwrapped[i]._destroy)) {\n          index++;\n        }\n      }\n    }\n\n    return index;\n  }; //remove problematic leading/trailing whitespace from templates\n\n\n  var stripTemplateWhitespace = function stripTemplateWhitespace(element, name) {\n    var templateSource, templateElement; //process named templates\n\n    if (name) {\n      templateElement = document.getElementById(name);\n\n      if (templateElement) {\n        templateSource = new ko.templateSources.domElement(templateElement);\n        templateSource.text($.trim(templateSource.text()));\n      }\n    } else {\n      //remove leading/trailing non-elements from anonymous templates\n      $(element).contents().each(function () {\n        if (this && this.nodeType !== 1) {\n          element.removeChild(this);\n        }\n      });\n    }\n  }; //connect items with observableArrays\n\n\n  ko.bindingHandlers.sortable = {\n    init: function init(element, valueAccessor, allBindingsAccessor, data, context) {\n      var $element = $(element),\n          value = unwrap(valueAccessor()) || {},\n          templateOptions = prepareTemplateOptions(valueAccessor, \"foreach\"),\n          sortable = {},\n          startActual,\n          updateActual;\n      stripTemplateWhitespace(element, templateOptions.name); //build a new object that has the global options with overrides from the binding\n\n      $.extend(true, sortable, ko.bindingHandlers.sortable);\n\n      if (value.options && sortable.options) {\n        ko.utils.extend(sortable.options, value.options);\n        delete value.options;\n      }\n\n      ko.utils.extend(sortable, value); //if allowDrop is an observable or a function, then execute it in a computed observable\n\n      if (sortable.connectClass && (ko.isObservable(sortable.allowDrop) || typeof sortable.allowDrop == \"function\")) {\n        ko.computed({\n          read: function read() {\n            var value = unwrap(sortable.allowDrop),\n                shouldAdd = typeof value == \"function\" ? value.call(this, templateOptions.foreach) : value;\n            ko.utils.toggleDomNodeCssClass(element, sortable.connectClass, shouldAdd);\n          },\n          disposeWhenNodeIsRemoved: element\n        }, this);\n      } else {\n        ko.utils.toggleDomNodeCssClass(element, sortable.connectClass, sortable.allowDrop);\n      } //wrap the template binding\n\n\n      ko.bindingHandlers.template.init(element, function () {\n        return templateOptions;\n      }, allBindingsAccessor, data, context); //keep a reference to start/update functions that might have been passed in\n\n      startActual = sortable.options.start;\n      updateActual = sortable.options.update; //ensure draggable table row cells maintain their width while dragging (unless a helper is provided)\n\n      if (!sortable.options.helper) {\n        sortable.options.helper = function (e, ui) {\n          if (ui.is(\"tr\")) {\n            ui.children().each(function () {\n              $(this).width($(this).width());\n            });\n          }\n\n          return ui;\n        };\n      } //initialize sortable binding after template binding has rendered in update function\n\n\n      var createTimeout = setTimeout(function () {\n        var dragItem;\n        var originalReceive = sortable.options.receive;\n        $element.sortable(ko.utils.extend(sortable.options, {\n          start: function start(event, ui) {\n            //track original index\n            var el = ui.item[0];\n            dataSet(el, INDEXKEY, ko.utils.arrayIndexOf(ui.item.parent().children(), el)); //make sure that fields have a chance to update model\n\n            ui.item.find(\"input:focus\").change();\n\n            if (startActual) {\n              startActual.apply(this, arguments);\n            }\n          },\n          receive: function receive(event, ui) {\n            //optionally apply an existing receive handler\n            if (typeof originalReceive === \"function\") {\n              originalReceive.call(this, event, ui);\n            }\n\n            dragItem = dataGet(ui.item[0], DRAGKEY);\n\n            if (dragItem) {\n              //copy the model item, if a clone option is provided\n              if (dragItem.clone) {\n                dragItem = dragItem.clone();\n              } //configure a handler to potentially manipulate item before drop\n\n\n              if (sortable.dragged) {\n                dragItem = sortable.dragged.call(this, dragItem, event, ui) || dragItem;\n              }\n            }\n          },\n          update: function update(event, ui) {\n            var sourceParent,\n                targetParent,\n                sourceIndex,\n                targetIndex,\n                arg,\n                el = ui.item[0],\n                parentEl = ui.item.parent()[0],\n                item = dataGet(el, ITEMKEY) || dragItem;\n\n            if (!item) {\n              $(el).remove();\n            }\n\n            dragItem = null; //make sure that moves only run once, as update fires on multiple containers\n\n            if (item && this === parentEl || !hasNestedSortableFix && $.contains(this, parentEl)) {\n              //identify parents\n              sourceParent = dataGet(el, PARENTKEY);\n              sourceIndex = dataGet(el, INDEXKEY);\n              targetParent = dataGet(el.parentNode, LISTKEY);\n              targetIndex = ko.utils.arrayIndexOf(ui.item.parent().children(), el); //take destroyed items into consideration\n\n              if (!templateOptions.includeDestroyed) {\n                sourceIndex = updateIndexFromDestroyedItems(sourceIndex, sourceParent);\n                targetIndex = updateIndexFromDestroyedItems(targetIndex, targetParent);\n              } //build up args for the callbacks\n\n\n              if (sortable.beforeMove || sortable.afterMove) {\n                arg = {\n                  item: item,\n                  sourceParent: sourceParent,\n                  sourceParentNode: sourceParent && ui.sender || el.parentNode,\n                  sourceIndex: sourceIndex,\n                  targetParent: targetParent,\n                  targetIndex: targetIndex,\n                  cancelDrop: false\n                }; //execute the configured callback prior to actually moving items\n\n                if (sortable.beforeMove) {\n                  sortable.beforeMove.call(this, arg, event, ui);\n                }\n              } //call cancel on the correct list, so KO can take care of DOM manipulation\n\n\n              if (sourceParent) {\n                $(sourceParent === targetParent ? this : ui.sender || this).sortable(\"cancel\");\n              } //for a draggable item just remove the element\n              else {\n                $(el).remove();\n              } //if beforeMove told us to cancel, then we are done\n\n\n              if (arg && arg.cancelDrop) {\n                return;\n              } //if the strategy option is unset or false, employ the order strategy involving removal and insertion of items\n\n\n              if (!sortable.hasOwnProperty(\"strategyMove\") || sortable.strategyMove === false) {\n                //do the actual move\n                if (targetIndex >= 0) {\n                  if (sourceParent) {\n                    sourceParent.splice(sourceIndex, 1); //if using deferred updates plugin, force updates\n\n                    if (ko.processAllDeferredBindingUpdates) {\n                      ko.processAllDeferredBindingUpdates();\n                    } //if using deferred updates on knockout 3.4, force updates\n\n\n                    if (ko.options && ko.options.deferUpdates) {\n                      ko.tasks.runEarly();\n                    }\n                  }\n\n                  targetParent.splice(targetIndex, 0, item);\n                } //rendering is handled by manipulating the observableArray; ignore dropped element\n\n\n                dataSet(el, ITEMKEY, null);\n              } else {\n                //employ the strategy of moving items\n                if (targetIndex >= 0) {\n                  if (sourceParent) {\n                    if (sourceParent !== targetParent) {\n                      // moving from one list to another\n                      sourceParent.splice(sourceIndex, 1);\n                      targetParent.splice(targetIndex, 0, item); //rendering is handled by manipulating the observableArray; ignore dropped element\n\n                      dataSet(el, ITEMKEY, null);\n                      ui.item.remove();\n                    } else {\n                      // moving within same list\n                      var underlyingList = unwrap(sourceParent); // notify 'beforeChange' subscribers\n\n                      if (sourceParent.valueWillMutate) {\n                        sourceParent.valueWillMutate();\n                      } // move from source index ...\n\n\n                      underlyingList.splice(sourceIndex, 1); // ... to target index\n\n                      underlyingList.splice(targetIndex, 0, item); // notify subscribers\n\n                      if (sourceParent.valueHasMutated) {\n                        sourceParent.valueHasMutated();\n                      }\n                    }\n                  } else {\n                    // drop new element from outside\n                    targetParent.splice(targetIndex, 0, item); //rendering is handled by manipulating the observableArray; ignore dropped element\n\n                    dataSet(el, ITEMKEY, null);\n                    ui.item.remove();\n                  }\n                }\n              } //if using deferred updates plugin, force updates\n\n\n              if (ko.processAllDeferredBindingUpdates) {\n                ko.processAllDeferredBindingUpdates();\n              } //allow binding to accept a function to execute after moving the item\n\n\n              if (sortable.afterMove) {\n                sortable.afterMove.call(this, arg, event, ui);\n              }\n            }\n\n            if (updateActual) {\n              updateActual.apply(this, arguments);\n            }\n          },\n          connectWith: sortable.connectClass ? \".\" + sortable.connectClass : false\n        })); //handle enabling/disabling sorting\n\n        if (sortable.isEnabled !== undefined) {\n          ko.computed({\n            read: function read() {\n              $element.sortable(unwrap(sortable.isEnabled) ? \"enable\" : \"disable\");\n            },\n            disposeWhenNodeIsRemoved: element\n          });\n        }\n      }, 0); //handle disposal\n\n      ko.utils.domNodeDisposal.addDisposeCallback(element, function () {\n        //only call destroy if sortable has been created\n        if ($element.data(\"ui-sortable\") || $element.data(\"sortable\")) {\n          $element.sortable(\"destroy\");\n        }\n\n        ko.utils.toggleDomNodeCssClass(element, sortable.connectClass, false); //do not create the sortable if the element has been removed from DOM\n\n        clearTimeout(createTimeout);\n      });\n      return {\n        'controlsDescendantBindings': true\n      };\n    },\n    update: function update(element, valueAccessor, allBindingsAccessor, data, context) {\n      var templateOptions = prepareTemplateOptions(valueAccessor, \"foreach\"); //attach meta-data\n\n      dataSet(element, LISTKEY, templateOptions.foreach); //call template binding's update with correct options\n\n      ko.bindingHandlers.template.update(element, function () {\n        return templateOptions;\n      }, allBindingsAccessor, data, context);\n    },\n    connectClass: 'ko_container',\n    allowDrop: true,\n    afterMove: null,\n    beforeMove: null,\n    options: {}\n  }; //create a draggable that is appropriate for dropping into a sortable\n\n  ko.bindingHandlers.draggable = {\n    init: function init(element, valueAccessor, allBindingsAccessor, data, context) {\n      var value = unwrap(valueAccessor()) || {},\n          options = value.options || {},\n          draggableOptions = ko.utils.extend({}, ko.bindingHandlers.draggable.options),\n          templateOptions = prepareTemplateOptions(valueAccessor, \"data\"),\n          connectClass = value.connectClass || ko.bindingHandlers.draggable.connectClass,\n          isEnabled = value.isEnabled !== undefined ? value.isEnabled : ko.bindingHandlers.draggable.isEnabled;\n      value = \"data\" in value ? value.data : value; //set meta-data\n\n      dataSet(element, DRAGKEY, value); //override global options with override options passed in\n\n      ko.utils.extend(draggableOptions, options); //setup connection to a sortable\n\n      draggableOptions.connectToSortable = connectClass ? \".\" + connectClass : false; //initialize draggable\n\n      $(element).draggable(draggableOptions); //handle enabling/disabling sorting\n\n      if (isEnabled !== undefined) {\n        ko.computed({\n          read: function read() {\n            $(element).draggable(unwrap(isEnabled) ? \"enable\" : \"disable\");\n          },\n          disposeWhenNodeIsRemoved: element\n        });\n      } //handle disposal\n\n\n      ko.utils.domNodeDisposal.addDisposeCallback(element, function () {\n        $(element).draggable(\"destroy\");\n      });\n      return ko.bindingHandlers.template.init(element, function () {\n        return templateOptions;\n      }, allBindingsAccessor, data, context);\n    },\n    update: function update(element, valueAccessor, allBindingsAccessor, data, context) {\n      var templateOptions = prepareTemplateOptions(valueAccessor, \"data\");\n      return ko.bindingHandlers.template.update(element, function () {\n        return templateOptions;\n      }, allBindingsAccessor, data, context);\n    },\n    connectClass: ko.bindingHandlers.sortable.connectClass,\n    options: {\n      helper: \"clone\"\n    }\n  }; // Simple Droppable Implementation\n  // binding that updates (function or observable)\n\n  ko.bindingHandlers.droppable = {\n    init: function init(element, valueAccessor, allBindingsAccessor, data, context) {\n      var value = unwrap(valueAccessor()) || {},\n          options = value.options || {},\n          droppableOptions = ko.utils.extend({}, ko.bindingHandlers.droppable.options),\n          isEnabled = value.isEnabled !== undefined ? value.isEnabled : ko.bindingHandlers.droppable.isEnabled; //override global options with override options passed in\n\n      ko.utils.extend(droppableOptions, options); //get reference to drop method\n\n      value = \"data\" in value ? value.data : valueAccessor(); //set drop method\n\n      droppableOptions.drop = function (event, ui) {\n        var droppedItem = dataGet(ui.draggable[0], DRAGKEY) || dataGet(ui.draggable[0], ITEMKEY);\n        value(droppedItem);\n      }; //initialize droppable\n\n\n      $(element).droppable(droppableOptions); //handle enabling/disabling droppable\n\n      if (isEnabled !== undefined) {\n        ko.computed({\n          read: function read() {\n            $(element).droppable(unwrap(isEnabled) ? \"enable\" : \"disable\");\n          },\n          disposeWhenNodeIsRemoved: element\n        });\n      } //handle disposal\n\n\n      ko.utils.domNodeDisposal.addDisposeCallback(element, function () {\n        $(element).droppable(\"destroy\");\n      });\n    },\n    options: {\n      accept: \"*\"\n    }\n  };\n});\n\n//# sourceURL=webpack://domino/./src/scripts/vendors/knockout.sortable.js?");

/***/ }),

/***/ "./src/scripts/vendors/knockout.validation.fa-IR.js":
/*!**********************************************************!*\
  !*** ./src/scripts/vendors/knockout.validation.fa-IR.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

eval("/* provided dependency */ var ko = __webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\");\n__webpack_require__(/*! knockout.validation */ \"./node_modules/knockout.validation/dist/knockout.validation.js\");\n/**\r\n * Localization file for Farsi - Iran (fa-IR)\r\n */\n\n\n(function (factory) {\n  factory(ko.validation);\n})(function (kv) {\n  if (!kv || typeof kv.defineLocale !== 'function') {\n    throw new Error('Knockout-Validation is required, please ensure it is loaded before this localization file');\n  }\n\n  return kv.defineLocale('fa-IR', {\n    required: 'تکمیل این فیلد اجباری است.',\n    min: 'لطفاً مقداری بزرگتر یا برابر {0} وارد نمائید.',\n    max: 'لطفاً مقداری کوچکتر یا برابر {0} وارد نمائید.',\n    minLength: 'لطفاً حداقل {0} حرف وارد نمائید.',\n    maxLength: 'لطفاً حداکثر {0} حرف وارد نمائید.',\n    pattern: 'لطفاً یک مقدار معتبر وارد نمائید.',\n    step: 'مقدار باید با {0} افزایش پبدا کند.',\n    email: 'لطفاً یک آدرس ایمیل معتبر وارد نمائید.',\n    date: 'لطفاً یک تاریخ معتبر وارد نمائید.',\n    dateISO: 'لطفاً یک تاریخ معتبر وارد نمائید.',\n    number: 'لطفاً یک عدد وارد نمائید.',\n    digit: 'لطفاً یک عدد وارد نمائید.',\n    phoneUS: 'لطفاً یک شماره تماس معتبر وارد نمائید.',\n    equal: 'مقدارها باید برابر باشند.',\n    notEqual: 'لطفاً یک مقدار دیگر وارد نمائید.',\n    unique: 'لطفاً یک مقدار منحصربه فرد وارد نمائید.'\n  });\n});\n\n//# sourceURL=webpack://domino/./src/scripts/vendors/knockout.validation.fa-IR.js?");

/***/ }),

/***/ "./src/scripts/vendors/nprogress.js":
/*!******************************************!*\
  !*** ./src/scripts/vendors/nprogress.js ***!
  \******************************************/
/***/ (function(module, exports, __webpack_require__) {

eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nvar openCount = 0;\n;\n\n(function (root, factory) {\n  if (true) {\n    !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n  } else {}\n})(this, function () {\n  var NProgress = {};\n  NProgress.version = '0.2.0';\n  var Settings = NProgress.settings = {\n    minimum: 0.08,\n    easing: 'linear',\n    positionUsing: '',\n    speed: 350,\n    trickle: true,\n    trickleSpeed: 250,\n    showSpinner: true,\n    barSelector: '[role=\"bar\"]',\n    spinnerSelector: '[role=\"spinner\"]',\n    parent: 'body',\n    template: '<div class=\"bar\" role=\"bar\"><div class=\"peg\"></div></div><div class=\"spinner\" role=\"spinner\"><div class=\"spinner-icon\"></div></div>'\n  };\n  /**\r\n   * Updates configuration.\r\n   *\r\n   *     NProgress.configure({\r\n   *       minimum: 0.1\r\n   *     });\r\n   */\n\n  NProgress.configure = function (options) {\n    var key, value;\n\n    for (key in options) {\n      value = options[key];\n      if (value !== undefined && options.hasOwnProperty(key)) Settings[key] = value;\n    }\n\n    return this;\n  };\n  /**\r\n   * Last number.\r\n   */\n\n\n  NProgress.status = null;\n  /**\r\n   * Sets the progress bar status, where `n` is a number from `0.0` to `1.0`.\r\n   *\r\n   *     NProgress.set(0.4);\r\n   *     NProgress.set(1.0);\r\n   */\n\n  NProgress.set = function (n) {\n    var started = NProgress.isStarted();\n    n = clamp(n, Settings.minimum, 1);\n    NProgress.status = n === 1 ? null : n;\n    var progress = NProgress.render(!started),\n        bar = progress.querySelector(Settings.barSelector),\n        speed = Settings.speed,\n        ease = Settings.easing;\n    progress.offsetWidth;\n    /* Repaint */\n\n    queue(function (next) {\n      // Set positionUsing if it hasn't already been set\n      if (Settings.positionUsing === '') Settings.positionUsing = NProgress.getPositioningCSS(); // Add transition\n\n      css(bar, barPositionCSS(n, speed, ease));\n\n      if (n === 1) {\n        // Fade out\n        css(progress, {\n          transition: 'none',\n          opacity: 1\n        });\n        progress.offsetWidth;\n        /* Repaint */\n\n        setTimeout(function () {\n          css(progress, {\n            transition: 'all ' + speed + 'ms linear',\n            opacity: 0\n          });\n          setTimeout(function () {\n            NProgress.remove();\n            next();\n          }, speed);\n        }, speed);\n      } else {\n        setTimeout(next, speed);\n      }\n    });\n    return this;\n  };\n\n  NProgress.isStarted = function () {\n    return typeof NProgress.status === 'number';\n  };\n  /**\r\n   * Shows the progress bar.\r\n   * This is the same as setting the status to 0%, except that it doesn't go backwards.\r\n   *\r\n   *     NProgress.start();\r\n   *\r\n   */\n\n\n  NProgress.start = function () {\n    if (!NProgress.status) NProgress.set(0);\n    openCount++;\n\n    var work = function work() {\n      setTimeout(function () {\n        if (!NProgress.status) return;\n        NProgress.trickle();\n        work();\n      }, Settings.trickleSpeed);\n    };\n\n    if (Settings.trickle) work();\n    return this;\n  };\n  /**\r\n   * Hides the progress bar.\r\n   * This is the *sort of* the same as setting the status to 100%, with the\r\n   * difference being `done()` makes some placebo effect of some realistic motion.\r\n   *\r\n   *     NProgress.done();\r\n   *\r\n   * If `true` is passed, it will show the progress bar even if its hidden.\r\n   *\r\n   *     NProgress.done(true);\r\n   */\n\n\n  NProgress.done = function (force) {\n    if (!force && !NProgress.status) return this;\n\n    if (openCount === 1) {\n      openCount--;\n      return NProgress.inc(0.3 + 0.5 * Math.random()).set(1);\n    } else {\n      openCount--;\n      return NProgress.inc(0.3 + 0.5 * Math.random());\n    }\n  };\n  /**\r\n   * Increments by a random amount.\r\n   */\n\n\n  NProgress.inc = function (amount) {\n    var n = NProgress.status;\n\n    if (!n) {\n      return NProgress.start();\n    } else if (n > 1) {\n      return;\n    } else {\n      if (typeof amount !== 'number') {\n        if (n >= 0 && n < 0.25) {\n          // Start out between 3 - 6% increments\n          amount = (Math.random() * (5 - 3 + 1) + 3) / 100;\n        } else if (n >= 0.25 && n < 0.65) {\n          // increment between 0 - 3%\n          amount = Math.random() * 3 / 100;\n        } else if (n >= 0.65 && n < 0.9) {\n          // increment between 0 - 2%\n          amount = Math.random() * 2 / 100;\n        } else if (n >= 0.9 && n < 0.99) {\n          // finally, increment it .5 %\n          amount = 0.005;\n        } else {\n          // after 99%, don't increment:\n          amount = 0;\n        }\n      }\n\n      n = clamp(n + amount, 0, 0.994);\n      return NProgress.set(n);\n    }\n  };\n\n  NProgress.trickle = function () {\n    return NProgress.inc();\n  };\n  /**\r\n   * Waits for all supplied jQuery promises and\r\n   * increases the progress as the promises resolve.\r\n   *\r\n   * @param $promise jQUery Promise\r\n   */\n\n\n  (function () {\n    var initial = 0,\n        current = 0;\n\n    NProgress.promise = function ($promise) {\n      if (!$promise || $promise.state() === \"resolved\") {\n        return this;\n      }\n\n      if (current === 0) {\n        NProgress.start();\n      }\n\n      initial++;\n      current++;\n      $promise.always(function () {\n        current--;\n\n        if (current === 0) {\n          initial = 0;\n          NProgress.done();\n        } else {\n          NProgress.set((initial - current) / initial);\n        }\n      });\n      return this;\n    };\n  })();\n  /**\r\n   * (Internal) renders the progress bar markup based on the `template`\r\n   * setting.\r\n   */\n\n\n  NProgress.render = function (fromStart) {\n    if (NProgress.isRendered()) return document.getElementById('nprogress');\n    addClass(document.documentElement, 'nprogress-busy');\n    var progress = document.createElement('div');\n    progress.id = 'nprogress';\n    progress.innerHTML = Settings.template;\n    var bar = progress.querySelector(Settings.barSelector),\n        perc = fromStart ? '-100' : toBarPerc(NProgress.status || 0),\n        parent = document.querySelector(Settings.parent),\n        spinner;\n    css(bar, {\n      transition: 'all 0 linear',\n      transform: 'translate3d(' + perc + '%,0,0)'\n    });\n\n    if (!Settings.showSpinner) {\n      spinner = progress.querySelector(Settings.spinnerSelector);\n      spinner && removeElement(spinner);\n    }\n\n    if (parent != document.body) {\n      addClass(parent, 'nprogress-custom-parent');\n    }\n\n    parent.appendChild(progress);\n    return progress;\n  };\n  /**\r\n   * Removes the element. Opposite of render().\r\n   */\n\n\n  NProgress.remove = function () {\n    removeClass(document.documentElement, 'nprogress-busy');\n    removeClass(document.querySelector(Settings.parent), 'nprogress-custom-parent');\n    var progress = document.getElementById('nprogress');\n    progress && removeElement(progress);\n  };\n  /**\r\n   * Checks if the progress bar is rendered.\r\n   */\n\n\n  NProgress.isRendered = function () {\n    return !!document.getElementById('nprogress');\n  };\n  /**\r\n   * Determine which positioning CSS rule to use.\r\n   */\n\n\n  NProgress.getPositioningCSS = function () {\n    // Sniff on document.body.style\n    var bodyStyle = document.body.style; // Sniff prefixes\n\n    var vendorPrefix = 'WebkitTransform' in bodyStyle ? 'Webkit' : 'MozTransform' in bodyStyle ? 'Moz' : 'msTransform' in bodyStyle ? 'ms' : 'OTransform' in bodyStyle ? 'O' : '';\n\n    if (vendorPrefix + 'Perspective' in bodyStyle) {\n      // Modern browsers with 3D support, e.g. Webkit, IE10\n      return 'translate3d';\n    } else if (vendorPrefix + 'Transform' in bodyStyle) {\n      // Browsers without 3D support, e.g. IE9\n      return 'translate';\n    } else {\n      // Browsers without translate() support, e.g. IE7-8\n      return 'margin';\n    }\n  };\n  /**\r\n   * Helpers\r\n   */\n\n\n  function clamp(n, min, max) {\n    if (n < min) return min;\n    if (n > max) return max;\n    return n;\n  }\n  /**\r\n   * (Internal) converts a percentage (`0..1`) to a bar translateX\r\n   * percentage (`-100%..0%`).\r\n   */\n\n\n  function toBarPerc(n) {\n    return (-1 + n) * 100;\n  }\n  /**\r\n   * (Internal) returns the correct CSS for changing the bar's\r\n   * position given an n percentage, and speed and ease from Settings\r\n   */\n\n\n  function barPositionCSS(n, speed, ease) {\n    var barCSS;\n\n    if (Settings.positionUsing === 'translate3d') {\n      barCSS = {\n        transform: 'translate3d(' + toBarPerc(n) + '%,0,0)'\n      };\n    } else if (Settings.positionUsing === 'translate') {\n      barCSS = {\n        transform: 'translate(' + toBarPerc(n) + '%,0)'\n      };\n    } else {\n      barCSS = {\n        'margin-left': toBarPerc(n) + '%'\n      };\n    }\n\n    barCSS.transition = 'all ' + speed + 'ms ' + ease;\n    return barCSS;\n  }\n  /**\r\n   * (Internal) Queues a function to be executed.\r\n   */\n\n\n  var queue = function () {\n    var pending = [];\n\n    function next() {\n      var fn = pending.shift();\n\n      if (fn) {\n        fn(next);\n      }\n    }\n\n    return function (fn) {\n      pending.push(fn);\n      if (pending.length == 1) next();\n    };\n  }();\n  /**\r\n   * (Internal) Applies css properties to an element, similar to the jQuery\r\n   * css method.\r\n   *\r\n   * While this _h does assist with vendor prefixed property names, it\r\n   * does not perform any manipulation of values prior to setting styles.\r\n   */\n\n\n  var css = function () {\n    var cssPrefixes = ['Webkit', 'O', 'Moz', 'ms'],\n        cssProps = {};\n\n    function camelCase(string) {\n      return string.replace(/^-ms-/, 'ms-').replace(/-([\\da-z])/gi, function (match, letter) {\n        return letter.toUpperCase();\n      });\n    }\n\n    function getVendorProp(name) {\n      var style = document.body.style;\n      if (name in style) return name;\n      var i = cssPrefixes.length,\n          capName = name.charAt(0).toUpperCase() + name.slice(1),\n          vendorName;\n\n      while (i--) {\n        vendorName = cssPrefixes[i] + capName;\n        if (vendorName in style) return vendorName;\n      }\n\n      return name;\n    }\n\n    function getStyleProp(name) {\n      name = camelCase(name);\n      return cssProps[name] || (cssProps[name] = getVendorProp(name));\n    }\n\n    function applyCss(element, prop, value) {\n      prop = getStyleProp(prop);\n      element.style[prop] = value;\n    }\n\n    return function (element, properties) {\n      var args = arguments,\n          prop,\n          value;\n\n      if (args.length == 2) {\n        for (prop in properties) {\n          value = properties[prop];\n          if (value !== undefined && properties.hasOwnProperty(prop)) applyCss(element, prop, value);\n        }\n      } else {\n        applyCss(element, args[1], args[2]);\n      }\n    };\n  }();\n  /**\r\n   * (Internal) Determines if an element or space separated list of class names contains a class name.\r\n   */\n\n\n  function hasClass(element, name) {\n    var list = typeof element == 'string' ? element : classList(element);\n    return list.indexOf(' ' + name + ' ') >= 0;\n  }\n  /**\r\n   * (Internal) Adds a class to an element.\r\n   */\n\n\n  function addClass(element, name) {\n    var oldList = classList(element),\n        newList = oldList + name;\n    if (hasClass(oldList, name)) return; // Trim the opening space.\n\n    element.className = newList.substring(1);\n  }\n  /**\r\n   * (Internal) Removes a class from an element.\r\n   */\n\n\n  function removeClass(element, name) {\n    var oldList = classList(element),\n        newList;\n    if (!hasClass(element, name)) return; // Replace the class name.\n\n    newList = oldList.replace(' ' + name + ' ', ' '); // Trim the opening and closing spaces.\n\n    element.className = newList.substring(1, newList.length - 1);\n  }\n  /**\r\n   * (Internal) Gets a space separated list of the class names on the element.\r\n   * The list is wrapped with a single space on each end to facilitate finding\r\n   * matches within the list.\r\n   */\n\n\n  function classList(element) {\n    return (' ' + (element && element.className || '') + ' ').replace(/\\s+/gi, ' ');\n  }\n  /**\r\n   * (Internal) Removes an element from the DOM.\r\n   */\n\n\n  function removeElement(element) {\n    element && element.parentNode && element.parentNode.removeChild(element);\n  }\n\n  return NProgress;\n});\n\n//# sourceURL=webpack://domino/./src/scripts/vendors/nprogress.js?");

/***/ }),

/***/ "./src/scripts/vendors/rangy.js":
/*!**************************************!*\
  !*** ./src/scripts/vendors/rangy.js ***!
  \**************************************/
/***/ (function(module, exports, __webpack_require__) {

eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n/**\r\n * Rangy, a cross-browser JavaScript range and selection library\r\n * https://github.com/timdown/rangy\r\n *\r\n * Copyright %%build:year%%, Tim Down\r\n * Licensed under the MIT license.\r\n * Version: %%build:version%%\r\n * Build date: %%build:date%%\r\n */\n(function (factory, root) {\n  if (true) {\n    // AMD. Register as an anonymous module.\n    !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n  } else {}\n})(function () {\n  var OBJECT = \"object\",\n      FUNCTION = \"function\",\n      UNDEFINED = \"undefined\"; // Minimal set of properties required for DOM Level 2 Range compliance. Comparison constants such as START_TO_START\n  // are omitted because ranges in KHTML do not have them but otherwise work perfectly well. See issue 113.\n\n  var domRangeProperties = [\"startContainer\", \"startOffset\", \"endContainer\", \"endOffset\", \"collapsed\", \"commonAncestorContainer\"]; // Minimal set of methods required for DOM Level 2 Range compliance\n\n  var domRangeMethods = [\"setStart\", \"setStartBefore\", \"setStartAfter\", \"setEnd\", \"setEndBefore\", \"setEndAfter\", \"collapse\", \"selectNode\", \"selectNodeContents\", \"compareBoundaryPoints\", \"deleteContents\", \"extractContents\", \"cloneContents\", \"insertNode\", \"surroundContents\", \"cloneRange\", \"toString\", \"detach\"];\n  var textRangeProperties = [\"boundingHeight\", \"boundingLeft\", \"boundingTop\", \"boundingWidth\", \"htmlText\", \"text\"]; // Subset of TextRange's full set of methods that we're interested in\n\n  var textRangeMethods = [\"collapse\", \"compareEndPoints\", \"duplicate\", \"moveToElementText\", \"parentElement\", \"select\", \"setEndPoint\", \"getBoundingClientRect\"];\n  /*----------------------------------------------------------------------------------------------------------------*/\n  // Trio of functions taken from Peter Michaux's article:\n  // http://peter.michaux.ca/articles/feature-detection-state-of-the-art-browser-scripting\n\n  function isHostMethod(o, p) {\n    var t = _typeof(o[p]);\n\n    return t == FUNCTION || !!(t == OBJECT && o[p]) || t == \"unknown\";\n  }\n\n  function isHostObject(o, p) {\n    return !!(_typeof(o[p]) == OBJECT && o[p]);\n  }\n\n  function isHostProperty(o, p) {\n    return _typeof(o[p]) != UNDEFINED;\n  } // Creates a convenience function to save verbose repeated calls to tests functions\n\n\n  function createMultiplePropertyTest(testFunc) {\n    return function (o, props) {\n      var i = props.length;\n\n      while (i--) {\n        if (!testFunc(o, props[i])) {\n          return false;\n        }\n      }\n\n      return true;\n    };\n  } // Next trio of functions are a convenience to save verbose repeated calls to previous two functions\n\n\n  var areHostMethods = createMultiplePropertyTest(isHostMethod);\n  var areHostObjects = createMultiplePropertyTest(isHostObject);\n  var areHostProperties = createMultiplePropertyTest(isHostProperty);\n\n  function isTextRange(range) {\n    return range && areHostMethods(range, textRangeMethods) && areHostProperties(range, textRangeProperties);\n  }\n\n  function getBody(doc) {\n    return isHostObject(doc, \"body\") ? doc.body : doc.getElementsByTagName(\"body\")[0];\n  }\n\n  var forEach = [].forEach ? function (arr, func) {\n    arr.forEach(func);\n  } : function (arr, func) {\n    for (var i = 0, len = arr.length; i < len; ++i) {\n      func(arr[i], i);\n    }\n  };\n  var modules = {};\n  var isBrowser = (typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) != UNDEFINED && (typeof document === \"undefined\" ? \"undefined\" : _typeof(document)) != UNDEFINED;\n  var util = {\n    isHostMethod: isHostMethod,\n    isHostObject: isHostObject,\n    isHostProperty: isHostProperty,\n    areHostMethods: areHostMethods,\n    areHostObjects: areHostObjects,\n    areHostProperties: areHostProperties,\n    isTextRange: isTextRange,\n    getBody: getBody,\n    forEach: forEach\n  };\n  var api = {\n    version: \"%%build:version%%\",\n    initialized: false,\n    isBrowser: isBrowser,\n    supported: true,\n    util: util,\n    features: {},\n    modules: modules,\n    config: {\n      alertOnFail: false,\n      alertOnWarn: false,\n      preferTextRange: false,\n      autoInitialize: (typeof rangyAutoInitialize === \"undefined\" ? \"undefined\" : _typeof(rangyAutoInitialize)) == UNDEFINED ? true : rangyAutoInitialize\n    }\n  };\n\n  function consoleLog(msg) {\n    if ((typeof console === \"undefined\" ? \"undefined\" : _typeof(console)) != UNDEFINED && isHostMethod(console, \"log\")) {\n      console.log(msg);\n    }\n  }\n\n  function alertOrLog(msg, shouldAlert) {\n    if (isBrowser && shouldAlert) {\n      alert(msg);\n    } else {\n      consoleLog(msg);\n    }\n  }\n\n  function fail(reason) {\n    api.initialized = true;\n    api.supported = false;\n  }\n\n  api.fail = fail;\n\n  function warn(msg) {}\n\n  api.warn = warn; // Add utility extend() method\n\n  var _extend;\n\n  if ({}.hasOwnProperty) {\n    util.extend = _extend = function extend(obj, props, deep) {\n      var o, p;\n\n      for (var i in props) {\n        if (props.hasOwnProperty(i)) {\n          o = obj[i];\n          p = props[i];\n\n          if (deep && o !== null && _typeof(o) == \"object\" && p !== null && _typeof(p) == \"object\") {\n            _extend(o, p, true);\n          }\n\n          obj[i] = p;\n        }\n      } // Special case for toString, which does not show up in for...in loops in IE <= 8\n\n\n      if (props.hasOwnProperty(\"toString\")) {\n        obj.toString = props.toString;\n      }\n\n      return obj;\n    };\n\n    util.createOptions = function (optionsParam, defaults) {\n      var options = {};\n\n      _extend(options, defaults);\n\n      if (optionsParam) {\n        _extend(options, optionsParam);\n      }\n\n      return options;\n    };\n  } else {\n    fail(\"hasOwnProperty not supported\");\n  } // Test whether we're in a browser and bail out if not\n\n\n  if (!isBrowser) {\n    fail(\"Rangy can only run in a browser\");\n  } // Test whether Array.prototype.slice can be relied on for NodeLists and use an alternative toArray() if not\n\n\n  (function () {\n    var toArray;\n\n    if (isBrowser) {\n      var el = document.createElement(\"div\");\n      el.appendChild(document.createElement(\"span\"));\n      var slice = [].slice;\n\n      try {\n        if (slice.call(el.childNodes, 0)[0].nodeType == 1) {\n          toArray = function toArray(arrayLike) {\n            return slice.call(arrayLike, 0);\n          };\n        }\n      } catch (e) {}\n    }\n\n    if (!toArray) {\n      toArray = function toArray(arrayLike) {\n        var arr = [];\n\n        for (var i = 0, len = arrayLike.length; i < len; ++i) {\n          arr[i] = arrayLike[i];\n        }\n\n        return arr;\n      };\n    }\n\n    util.toArray = toArray;\n  })(); // Very simple event handler wrapper function that doesn't attempt to solve issues such as \"this\" handling or\n  // normalization of event properties because we don't need this.\n\n\n  var addListener;\n\n  if (isBrowser) {\n    if (isHostMethod(document, \"addEventListener\")) {\n      addListener = function addListener(obj, eventType, listener) {\n        obj.addEventListener(eventType, listener, false);\n      };\n    } else if (isHostMethod(document, \"attachEvent\")) {\n      addListener = function addListener(obj, eventType, listener) {\n        obj.attachEvent(\"on\" + eventType, listener);\n      };\n    } else {\n      fail(\"Document does not have required addEventListener or attachEvent method\");\n    }\n\n    util.addListener = addListener;\n  }\n\n  var initListeners = [];\n\n  function getErrorDesc(ex) {\n    return ex.message || ex.description || String(ex);\n  } // Initialization\n\n\n  function init() {\n    if (!isBrowser || api.initialized) {\n      return;\n    }\n\n    var testRange;\n    var implementsDomRange = false,\n        implementsTextRange = false; // First, perform basic feature tests\n\n    if (isHostMethod(document, \"createRange\")) {\n      testRange = document.createRange();\n\n      if (areHostMethods(testRange, domRangeMethods) && areHostProperties(testRange, domRangeProperties)) {\n        implementsDomRange = true;\n      }\n    }\n\n    var body = getBody(document);\n\n    if (!body || body.nodeName.toLowerCase() != \"body\") {\n      fail(\"No body element found\");\n      return;\n    }\n\n    if (body && isHostMethod(body, \"createTextRange\")) {\n      testRange = body.createTextRange();\n\n      if (isTextRange(testRange)) {\n        implementsTextRange = true;\n      }\n    }\n\n    if (!implementsDomRange && !implementsTextRange) {\n      fail(\"Neither Range nor TextRange are available\");\n      return;\n    }\n\n    api.initialized = true;\n    api.features = {\n      implementsDomRange: implementsDomRange,\n      implementsTextRange: implementsTextRange\n    }; // Initialize modules\n\n    var module, errorMessage;\n\n    for (var moduleName in modules) {\n      if ((module = modules[moduleName]) instanceof Module) {\n        module.init(module, api);\n      }\n    } // Call init listeners\n\n\n    for (var i = 0, len = initListeners.length; i < len; ++i) {\n      try {\n        initListeners[i](api);\n      } catch (ex) {\n        errorMessage = \"Rangy init listener threw an exception. Continuing. Detail: \" + getErrorDesc(ex);\n        consoleLog(errorMessage);\n      }\n    }\n  }\n\n  function deprecationNotice(deprecated, replacement, module) {\n    if (module) {\n      deprecated += \" in module \" + module.name;\n    }\n\n    api.warn(\"DEPRECATED: \" + deprecated + \" is deprecated. Please use \" + replacement + \" instead.\");\n  }\n\n  function createAliasForDeprecatedMethod(owner, deprecated, replacement, module) {\n    owner[deprecated] = function () {\n      deprecationNotice(deprecated, replacement, module);\n      return owner[replacement].apply(owner, util.toArray(arguments));\n    };\n  }\n\n  util.deprecationNotice = deprecationNotice;\n  util.createAliasForDeprecatedMethod = createAliasForDeprecatedMethod; // Allow external scripts to initialize this library in case it's loaded after the document has loaded\n\n  api.init = init; // Execute listener immediately if already initialized\n\n  api.addInitListener = function (listener) {\n    if (api.initialized) {\n      listener(api);\n    } else {\n      initListeners.push(listener);\n    }\n  };\n\n  var shimListeners = [];\n\n  api.addShimListener = function (listener) {\n    shimListeners.push(listener);\n  };\n\n  function shim(win) {\n    win = win || window;\n    init(); // Notify listeners\n\n    for (var i = 0, len = shimListeners.length; i < len; ++i) {\n      shimListeners[i](win);\n    }\n  }\n\n  if (isBrowser) {\n    api.shim = api.createMissingNativeApi = shim;\n    createAliasForDeprecatedMethod(api, \"createMissingNativeApi\", \"shim\");\n  }\n\n  function Module(name, dependencies, initializer) {\n    this.name = name;\n    this.dependencies = dependencies;\n    this.initialized = false;\n    this.supported = false;\n    this.initializer = initializer;\n  }\n\n  Module.prototype = {\n    init: function init() {\n      var requiredModuleNames = this.dependencies || [];\n\n      for (var i = 0, len = requiredModuleNames.length, requiredModule, moduleName; i < len; ++i) {\n        moduleName = requiredModuleNames[i];\n        requiredModule = modules[moduleName];\n\n        if (!requiredModule || !(requiredModule instanceof Module)) {\n          throw new Error(\"required module '\" + moduleName + \"' not found\");\n        }\n\n        requiredModule.init();\n\n        if (!requiredModule.supported) {\n          throw new Error(\"required module '\" + moduleName + \"' not supported\");\n        }\n      } // Now run initializer\n\n\n      this.initializer(this);\n    },\n    fail: function fail(reason) {\n      this.initialized = true;\n      this.supported = false;\n      throw new Error(reason);\n    },\n    warn: function warn(msg) {\n      api.warn(\"Module \" + this.name + \": \" + msg);\n    },\n    deprecationNotice: function deprecationNotice(deprecated, replacement) {\n      api.warn(\"DEPRECATED: \" + deprecated + \" in module \" + this.name + \" is deprecated. Please use \" + replacement + \" instead\");\n    },\n    createError: function createError(msg) {\n      return new Error(\"Error in Rangy \" + this.name + \" module: \" + msg);\n    }\n  };\n\n  function createModule(name, dependencies, initFunc) {\n    var newModule = new Module(name, dependencies, function (module) {\n      if (!module.initialized) {\n        module.initialized = true;\n\n        try {\n          initFunc(api, module);\n          module.supported = true;\n        } catch (ex) {\n          var errorMessage = \"Module '\" + name + \"' failed to load: \" + getErrorDesc(ex);\n          consoleLog(errorMessage);\n\n          if (ex.stack) {\n            consoleLog(ex.stack);\n          }\n        }\n      }\n    });\n    modules[name] = newModule;\n    return newModule;\n  }\n\n  api.createModule = function (name) {\n    // Allow 2 or 3 arguments (second argument is an optional array of dependencies)\n    var initFunc, dependencies;\n\n    if (arguments.length == 2) {\n      initFunc = arguments[1];\n      dependencies = [];\n    } else {\n      initFunc = arguments[2];\n      dependencies = arguments[1];\n    }\n\n    var module = createModule(name, dependencies, initFunc); // Initialize the module immediately if the core is already initialized\n\n    if (api.initialized && api.supported) {\n      module.init();\n    }\n  };\n\n  api.createCoreModule = function (name, dependencies, initFunc) {\n    createModule(name, dependencies, initFunc);\n  };\n\n  api.requireModules = function (modules) {\n    for (var i = 0, len = modules.length, module, moduleName; i < len; ++i) {\n      moduleName = modules[i];\n      module = api.modules[moduleName];\n\n      if (!module || !(module instanceof Module)) {\n        throw new Error(\"Module '\" + moduleName + \"' not found\");\n      }\n\n      if (!module.supported) {\n        throw new Error(\"Module '\" + moduleName + \"' not supported\");\n      }\n    }\n  };\n  /*----------------------------------------------------------------------------------------------------------------*/\n  // Ensure rangy.rangePrototype and rangy.selectionPrototype are available immediately\n\n\n  function RangePrototype() {}\n\n  api.RangePrototype = RangePrototype;\n  api.rangePrototype = new RangePrototype();\n\n  function SelectionPrototype() {}\n\n  api.selectionPrototype = new SelectionPrototype();\n  /*----------------------------------------------------------------------------------------------------------------*/\n\n  api.createCoreModule(\"DomUtil\", [], function (api, module) {\n    var UNDEF = \"undefined\";\n    var util = api.util;\n    var getBody = util.getBody; // Perform feature tests\n\n    if (!util.areHostMethods(document, [\"createDocumentFragment\", \"createElement\", \"createTextNode\"])) {\n      module.fail(\"document missing a Node creation method\");\n    }\n\n    if (!util.isHostMethod(document, \"getElementsByTagName\")) {\n      module.fail(\"document missing getElementsByTagName method\");\n    }\n\n    var el = document.createElement(\"div\");\n\n    if (!util.areHostMethods(el, [\"insertBefore\", \"appendChild\", \"cloneNode\"] || 0)) {\n      module.fail(\"Incomplete Element implementation\");\n    } // innerHTML is required for Range's createContextualFragment method\n\n\n    if (!util.isHostProperty(el, \"innerHTML\")) {\n      module.fail(\"Element is missing innerHTML property\");\n    }\n\n    var textNode = document.createTextNode(\"test\");\n\n    if (!util.areHostMethods(textNode, [\"splitText\", \"deleteData\", \"insertData\", \"appendData\", \"cloneNode\"] || 0 || 0)) {\n      module.fail(\"Incomplete Text Node implementation\");\n    }\n    /*----------------------------------------------------------------------------------------------------------------*/\n    // Removed use of indexOf because of a bizarre bug in Opera that is thrown in one of the Acid3 tests. I haven't been\n    // able to replicate it outside of the test. The bug is that indexOf returns -1 when called on an Array that\n    // contains just the document as a single element and the value searched for is the document.\n\n\n    var arrayContains =\n    /*Array.prototype.indexOf ?\r\n    function(arr, val) {\r\n    return arr.indexOf(val) > -1;\r\n    }:*/\n    function arrayContains(arr, val) {\n      var i = arr.length;\n\n      while (i--) {\n        if (arr[i] === val) {\n          return true;\n        }\n      }\n\n      return false;\n    }; // Opera 11 puts HTML elements in the null namespace, it seems, and IE 7 has undefined namespaceURI\n\n\n    function isHtmlNamespace(node) {\n      var ns;\n      return _typeof(node.namespaceURI) == UNDEF || (ns = node.namespaceURI) === null || ns == \"http://www.w3.org/1999/xhtml\";\n    }\n\n    function parentElement(node) {\n      var parent = node.parentNode;\n      return parent.nodeType == 1 ? parent : null;\n    }\n\n    function getNodeIndex(node) {\n      var i = 0;\n\n      while (node = node.previousSibling) {\n        ++i;\n      }\n\n      return i;\n    }\n\n    function getNodeLength(node) {\n      switch (node.nodeType) {\n        case 7:\n        case 10:\n          return 0;\n\n        case 3:\n        case 8:\n          return node.length;\n\n        default:\n          return node.childNodes.length;\n      }\n    }\n\n    function getCommonAncestor(node1, node2) {\n      var ancestors = [],\n          n;\n\n      for (n = node1; n; n = n.parentNode) {\n        ancestors.push(n);\n      }\n\n      for (n = node2; n; n = n.parentNode) {\n        if (arrayContains(ancestors, n)) {\n          return n;\n        }\n      }\n\n      return null;\n    }\n\n    function isAncestorOf(ancestor, descendant, selfIsAncestor) {\n      var n = selfIsAncestor ? descendant : descendant.parentNode;\n\n      while (n) {\n        if (n === ancestor) {\n          return true;\n        } else {\n          n = n.parentNode;\n        }\n      }\n\n      return false;\n    }\n\n    function isOrIsAncestorOf(ancestor, descendant) {\n      return isAncestorOf(ancestor, descendant, true);\n    }\n\n    function getClosestAncestorIn(node, ancestor, selfIsAncestor) {\n      var p,\n          n = selfIsAncestor ? node : node.parentNode;\n\n      while (n) {\n        p = n.parentNode;\n\n        if (p === ancestor) {\n          return n;\n        }\n\n        n = p;\n      }\n\n      return null;\n    }\n\n    function isCharacterDataNode(node) {\n      var t = node.nodeType;\n      return t == 3 || t == 4 || t == 8; // Text, CDataSection or Comment\n    }\n\n    function isTextOrCommentNode(node) {\n      if (!node) {\n        return false;\n      }\n\n      var t = node.nodeType;\n      return t == 3 || t == 8; // Text or Comment\n    }\n\n    function insertAfter(node, precedingNode) {\n      var nextNode = precedingNode.nextSibling,\n          parent = precedingNode.parentNode;\n\n      if (nextNode) {\n        parent.insertBefore(node, nextNode);\n      } else {\n        parent.appendChild(node);\n      }\n\n      return node;\n    } // Note that we cannot use splitText() because it is bugridden in IE 9.\n\n\n    function splitDataNode(node, index, positionsToPreserve) {\n      var newNode = node.cloneNode(false);\n      newNode.deleteData(0, index);\n      node.deleteData(index, node.length - index);\n      insertAfter(newNode, node); // Preserve positions\n\n      if (positionsToPreserve) {\n        for (var i = 0, position; position = positionsToPreserve[i++];) {\n          // Handle case where position was inside the portion of node after the split point\n          if (position.node == node && position.offset > index) {\n            position.node = newNode;\n            position.offset -= index;\n          } // Handle the case where the position is a node offset within node's parent\n          else if (position.node == node.parentNode && position.offset > getNodeIndex(node)) {\n            ++position.offset;\n          }\n        }\n      }\n\n      return newNode;\n    }\n\n    function getDocument(node) {\n      if (node.nodeType == 9) {\n        return node;\n      } else if (_typeof(node.ownerDocument) != UNDEF) {\n        return node.ownerDocument;\n      } else if (_typeof(node.document) != UNDEF) {\n        return node.document;\n      } else if (node.parentNode) {\n        return getDocument(node.parentNode);\n      } else {\n        throw module.createError(\"getDocument: no document found for node\");\n      }\n    }\n\n    function getWindow(node) {\n      var doc = getDocument(node);\n\n      if (_typeof(doc.defaultView) != UNDEF) {\n        return doc.defaultView;\n      } else if (_typeof(doc.parentWindow) != UNDEF) {\n        return doc.parentWindow;\n      } else {\n        throw module.createError(\"Cannot get a window object for node\");\n      }\n    }\n\n    function getIframeDocument(iframeEl) {\n      if (_typeof(iframeEl.contentDocument) != UNDEF) {\n        return iframeEl.contentDocument;\n      } else if (_typeof(iframeEl.contentWindow) != UNDEF) {\n        return iframeEl.contentWindow.document;\n      } else {\n        throw module.createError(\"getIframeDocument: No Document object found for iframe element\");\n      }\n    }\n\n    function getIframeWindow(iframeEl) {\n      if (_typeof(iframeEl.contentWindow) != UNDEF) {\n        return iframeEl.contentWindow;\n      } else if (_typeof(iframeEl.contentDocument) != UNDEF) {\n        return iframeEl.contentDocument.defaultView;\n      } else {\n        throw module.createError(\"getIframeWindow: No Window object found for iframe element\");\n      }\n    } // This looks bad. Is it worth it?\n\n\n    function isWindow(obj) {\n      return obj && util.isHostMethod(obj, \"setTimeout\") && util.isHostObject(obj, \"document\");\n    }\n\n    function getContentDocument(obj, module, methodName) {\n      var doc;\n\n      if (!obj) {\n        doc = document;\n      } // Test if a DOM node has been passed and obtain a document object for it if so\n      else if (util.isHostProperty(obj, \"nodeType\")) {\n        doc = obj.nodeType == 1 && obj.tagName.toLowerCase() == \"iframe\" ? getIframeDocument(obj) : getDocument(obj);\n      } // Test if the doc parameter appears to be a Window object\n      else if (isWindow(obj)) {\n        doc = obj.document;\n      }\n\n      if (!doc) {\n        throw module.createError(methodName + \"(): Parameter must be a Window object or DOM node\");\n      }\n\n      return doc;\n    }\n\n    function getRootContainer(node) {\n      var parent;\n\n      while (parent = node.parentNode) {\n        node = parent;\n      }\n\n      return node;\n    }\n\n    function comparePoints(nodeA, offsetA, nodeB, offsetB) {\n      // See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Comparing\n      var nodeC, root, childA, childB, n;\n\n      if (nodeA == nodeB) {\n        // Case 1: nodes are the same\n        return offsetA === offsetB ? 0 : offsetA < offsetB ? -1 : 1;\n      } else if (nodeC = getClosestAncestorIn(nodeB, nodeA, true)) {\n        // Case 2: node C (container B or an ancestor) is a child node of A\n        return offsetA <= getNodeIndex(nodeC) ? -1 : 1;\n      } else if (nodeC = getClosestAncestorIn(nodeA, nodeB, true)) {\n        // Case 3: node C (container A or an ancestor) is a child node of B\n        return getNodeIndex(nodeC) < offsetB ? -1 : 1;\n      } else {\n        root = getCommonAncestor(nodeA, nodeB);\n\n        if (!root) {\n          throw new Error(\"comparePoints error: nodes have no common ancestor\");\n        } // Case 4: containers are siblings or descendants of siblings\n\n\n        childA = nodeA === root ? root : getClosestAncestorIn(nodeA, root, true);\n        childB = nodeB === root ? root : getClosestAncestorIn(nodeB, root, true);\n\n        if (childA === childB) {\n          // This shouldn't be possible\n          throw module.createError(\"comparePoints got to case 4 and childA and childB are the same!\");\n        } else {\n          n = root.firstChild;\n\n          while (n) {\n            if (n === childA) {\n              return -1;\n            } else if (n === childB) {\n              return 1;\n            }\n\n            n = n.nextSibling;\n          }\n        }\n      }\n    }\n    /*----------------------------------------------------------------------------------------------------------------*/\n    // Test for IE's crash (IE 6/7) or exception (IE >= 8) when a reference to garbage-collected text node is queried\n\n\n    var crashyTextNodes = false;\n\n    function isBrokenNode(node) {\n      var n;\n\n      try {\n        n = node.parentNode;\n        return false;\n      } catch (e) {\n        return true;\n      }\n    }\n\n    (function () {\n      var el = document.createElement(\"b\");\n      el.innerHTML = \"1\";\n      var textNode = el.firstChild;\n      el.innerHTML = \"<br />\";\n      crashyTextNodes = isBrokenNode(textNode);\n      api.features.crashyTextNodes = crashyTextNodes;\n    })();\n    /*----------------------------------------------------------------------------------------------------------------*/\n\n\n    function inspectNode(node) {\n      if (!node) {\n        return \"[No node]\";\n      }\n\n      if (crashyTextNodes && isBrokenNode(node)) {\n        return \"[Broken node]\";\n      }\n\n      if (isCharacterDataNode(node)) {\n        return '\"' + node.data + '\"';\n      }\n\n      if (node.nodeType == 1) {\n        var idAttr = node.id ? ' id=\"' + node.id + '\"' : \"\";\n        return \"<\" + node.nodeName + idAttr + \">[index:\" + getNodeIndex(node) + \",length:\" + node.childNodes.length + \"][\" + (node.innerHTML || \"[innerHTML not supported]\").slice(0, 25) + \"]\";\n      }\n\n      return node.nodeName;\n    }\n\n    function fragmentFromNodeChildren(node) {\n      var fragment = getDocument(node).createDocumentFragment(),\n          child;\n\n      while (child = node.firstChild) {\n        fragment.appendChild(child);\n      }\n\n      return fragment;\n    }\n\n    var getComputedStyleProperty;\n\n    if (_typeof(window.getComputedStyle) != UNDEF) {\n      getComputedStyleProperty = function getComputedStyleProperty(el, propName) {\n        return getWindow(el).getComputedStyle(el, null)[propName];\n      };\n    } else if (_typeof(document.documentElement.currentStyle) != UNDEF) {\n      getComputedStyleProperty = function getComputedStyleProperty(el, propName) {\n        return el.currentStyle ? el.currentStyle[propName] : \"\";\n      };\n    } else {\n      module.fail(\"No means of obtaining computed style properties found\");\n    }\n\n    function createTestElement(doc, html, contentEditable) {\n      var body = getBody(doc);\n      var el = doc.createElement(\"div\");\n      el.contentEditable = \"\" + !!contentEditable;\n\n      if (html) {\n        el.innerHTML = html;\n      } // Insert the test element at the start of the body to prevent scrolling to the bottom in iOS (issue #292)\n\n\n      var bodyFirstChild = body.firstChild;\n\n      if (bodyFirstChild) {\n        body.insertBefore(el, bodyFirstChild);\n      } else {\n        body.appendChild(el);\n      }\n\n      return el;\n    }\n\n    function removeNode(node) {\n      return node.parentNode.removeChild(node);\n    }\n\n    function NodeIterator(root) {\n      this.root = root;\n      this._next = root;\n    }\n\n    NodeIterator.prototype = {\n      _current: null,\n      hasNext: function hasNext() {\n        return !!this._next;\n      },\n      next: function next() {\n        var n = this._current = this._next;\n        var child, next;\n\n        if (this._current) {\n          child = n.firstChild;\n\n          if (child) {\n            this._next = child;\n          } else {\n            next = null;\n\n            while (n !== this.root && !(next = n.nextSibling)) {\n              n = n.parentNode;\n            }\n\n            this._next = next;\n          }\n        }\n\n        return this._current;\n      },\n      detach: function detach() {\n        this._current = this._next = this.root = null;\n      }\n    };\n\n    function createIterator(root) {\n      return new NodeIterator(root);\n    }\n\n    function DomPosition(node, offset) {\n      this.node = node;\n      this.offset = offset;\n    }\n\n    DomPosition.prototype = {\n      equals: function equals(pos) {\n        return !!pos && this.node === pos.node && this.offset == pos.offset;\n      },\n      inspect: function inspect() {\n        return \"[DomPosition(\" + inspectNode(this.node) + \":\" + this.offset + \")]\";\n      },\n      toString: function toString() {\n        return this.inspect();\n      }\n    };\n\n    function DOMException(codeName) {\n      this.code = this[codeName];\n      this.codeName = codeName;\n      this.message = \"DOMException: \" + this.codeName;\n    }\n\n    DOMException.prototype = {\n      INDEX_SIZE_ERR: 1,\n      HIERARCHY_REQUEST_ERR: 3,\n      WRONG_DOCUMENT_ERR: 4,\n      NO_MODIFICATION_ALLOWED_ERR: 7,\n      NOT_FOUND_ERR: 8,\n      NOT_SUPPORTED_ERR: 9,\n      INVALID_STATE_ERR: 11,\n      INVALID_NODE_TYPE_ERR: 24\n    };\n\n    DOMException.prototype.toString = function () {\n      return this.message;\n    };\n\n    api.dom = {\n      arrayContains: arrayContains,\n      isHtmlNamespace: isHtmlNamespace,\n      parentElement: parentElement,\n      getNodeIndex: getNodeIndex,\n      getNodeLength: getNodeLength,\n      getCommonAncestor: getCommonAncestor,\n      isAncestorOf: isAncestorOf,\n      isOrIsAncestorOf: isOrIsAncestorOf,\n      getClosestAncestorIn: getClosestAncestorIn,\n      isCharacterDataNode: isCharacterDataNode,\n      isTextOrCommentNode: isTextOrCommentNode,\n      insertAfter: insertAfter,\n      splitDataNode: splitDataNode,\n      getDocument: getDocument,\n      getWindow: getWindow,\n      getIframeWindow: getIframeWindow,\n      getIframeDocument: getIframeDocument,\n      getBody: getBody,\n      isWindow: isWindow,\n      getContentDocument: getContentDocument,\n      getRootContainer: getRootContainer,\n      comparePoints: comparePoints,\n      isBrokenNode: isBrokenNode,\n      inspectNode: inspectNode,\n      getComputedStyleProperty: getComputedStyleProperty,\n      createTestElement: createTestElement,\n      removeNode: removeNode,\n      fragmentFromNodeChildren: fragmentFromNodeChildren,\n      createIterator: createIterator,\n      DomPosition: DomPosition\n    };\n    api.DOMException = DOMException;\n  });\n  /*----------------------------------------------------------------------------------------------------------------*/\n\n  api.createCoreModule(\"DomRange\", [\"DomUtil\"], function (api, module) {\n    var dom = api.dom;\n    var util = api.util;\n    var DomPosition = dom.DomPosition;\n    var DOMException = api.DOMException;\n    var isCharacterDataNode = dom.isCharacterDataNode;\n    var getNodeIndex = dom.getNodeIndex;\n    var isOrIsAncestorOf = dom.isOrIsAncestorOf;\n    var getDocument = dom.getDocument;\n    var comparePoints = dom.comparePoints;\n    var splitDataNode = dom.splitDataNode;\n    var getClosestAncestorIn = dom.getClosestAncestorIn;\n    var getNodeLength = dom.getNodeLength;\n    var arrayContains = dom.arrayContains;\n    var getRootContainer = dom.getRootContainer;\n    var crashyTextNodes = api.features.crashyTextNodes;\n    var removeNode = dom.removeNode;\n    /*----------------------------------------------------------------------------------------------------------------*/\n    // Utility functions\n\n    function isNonTextPartiallySelected(node, range) {\n      return node.nodeType != 3 && (isOrIsAncestorOf(node, range.startContainer) || isOrIsAncestorOf(node, range.endContainer));\n    }\n\n    function getRangeDocument(range) {\n      return range.document || getDocument(range.startContainer);\n    }\n\n    function getRangeRoot(range) {\n      return getRootContainer(range.startContainer);\n    }\n\n    function getBoundaryBeforeNode(node) {\n      return new DomPosition(node.parentNode, getNodeIndex(node));\n    }\n\n    function getBoundaryAfterNode(node) {\n      return new DomPosition(node.parentNode, getNodeIndex(node) + 1);\n    }\n\n    function insertNodeAtPosition(node, n, o) {\n      var firstNodeInserted = node.nodeType == 11 ? node.firstChild : node;\n\n      if (isCharacterDataNode(n)) {\n        if (o == n.length) {\n          dom.insertAfter(node, n);\n        } else {\n          n.parentNode.insertBefore(node, o == 0 ? n : splitDataNode(n, o));\n        }\n      } else if (o >= n.childNodes.length) {\n        n.appendChild(node);\n      } else {\n        n.insertBefore(node, n.childNodes[o]);\n      }\n\n      return firstNodeInserted;\n    }\n\n    function rangesIntersect(rangeA, rangeB, touchingIsIntersecting) {\n      assertRangeValid(rangeA);\n      assertRangeValid(rangeB);\n\n      if (getRangeDocument(rangeB) != getRangeDocument(rangeA)) {\n        throw new DOMException(\"WRONG_DOCUMENT_ERR\");\n      }\n\n      var startComparison = comparePoints(rangeA.startContainer, rangeA.startOffset, rangeB.endContainer, rangeB.endOffset),\n          endComparison = comparePoints(rangeA.endContainer, rangeA.endOffset, rangeB.startContainer, rangeB.startOffset);\n      return touchingIsIntersecting ? startComparison <= 0 && endComparison >= 0 : startComparison < 0 && endComparison > 0;\n    }\n\n    function cloneSubtree(iterator) {\n      var partiallySelected;\n\n      for (var node, frag = getRangeDocument(iterator.range).createDocumentFragment(), subIterator; node = iterator.next();) {\n        partiallySelected = iterator.isPartiallySelectedSubtree();\n        node = node.cloneNode(!partiallySelected);\n\n        if (partiallySelected) {\n          subIterator = iterator.getSubtreeIterator();\n          node.appendChild(cloneSubtree(subIterator));\n          subIterator.detach();\n        }\n\n        if (node.nodeType == 10) {\n          // DocumentType\n          throw new DOMException(\"HIERARCHY_REQUEST_ERR\");\n        }\n\n        frag.appendChild(node);\n      }\n\n      return frag;\n    }\n\n    function iterateSubtree(rangeIterator, func, iteratorState) {\n      var it, n;\n      iteratorState = iteratorState || {\n        stop: false\n      };\n\n      for (var node, subRangeIterator; node = rangeIterator.next();) {\n        if (rangeIterator.isPartiallySelectedSubtree()) {\n          if (func(node) === false) {\n            iteratorState.stop = true;\n            return;\n          } else {\n            // The node is partially selected by the Range, so we can use a new RangeIterator on the portion of\n            // the node selected by the Range.\n            subRangeIterator = rangeIterator.getSubtreeIterator();\n            iterateSubtree(subRangeIterator, func, iteratorState);\n            subRangeIterator.detach();\n\n            if (iteratorState.stop) {\n              return;\n            }\n          }\n        } else {\n          // The whole node is selected, so we can use efficient DOM iteration to iterate over the node and its\n          // descendants\n          it = dom.createIterator(node);\n\n          while (n = it.next()) {\n            if (func(n) === false) {\n              iteratorState.stop = true;\n              return;\n            }\n          }\n        }\n      }\n    }\n\n    function deleteSubtree(iterator) {\n      var subIterator;\n\n      while (iterator.next()) {\n        if (iterator.isPartiallySelectedSubtree()) {\n          subIterator = iterator.getSubtreeIterator();\n          deleteSubtree(subIterator);\n          subIterator.detach();\n        } else {\n          iterator.remove();\n        }\n      }\n    }\n\n    function extractSubtree(iterator) {\n      for (var node, frag = getRangeDocument(iterator.range).createDocumentFragment(), subIterator; node = iterator.next();) {\n        if (iterator.isPartiallySelectedSubtree()) {\n          node = node.cloneNode(false);\n          subIterator = iterator.getSubtreeIterator();\n          node.appendChild(extractSubtree(subIterator));\n          subIterator.detach();\n        } else {\n          iterator.remove();\n        }\n\n        if (node.nodeType == 10) {\n          // DocumentType\n          throw new DOMException(\"HIERARCHY_REQUEST_ERR\");\n        }\n\n        frag.appendChild(node);\n      }\n\n      return frag;\n    }\n\n    function getNodesInRange(range, nodeTypes, filter) {\n      var filterNodeTypes = !!(nodeTypes && nodeTypes.length),\n          regex;\n      var filterExists = !!filter;\n\n      if (filterNodeTypes) {\n        regex = new RegExp(\"^(\" + nodeTypes.join(\"|\") + \")$\");\n      }\n\n      var nodes = [];\n      iterateSubtree(new RangeIterator(range, false), function (node) {\n        if (filterNodeTypes && !regex.test(node.nodeType)) {\n          return;\n        }\n\n        if (filterExists && !filter(node)) {\n          return;\n        } // Don't include a boundary container if it is a character data node and the range does not contain any\n        // of its character data. See issue 190.\n\n\n        var sc = range.startContainer;\n\n        if (node == sc && isCharacterDataNode(sc) && range.startOffset == sc.length) {\n          return;\n        }\n\n        var ec = range.endContainer;\n\n        if (node == ec && isCharacterDataNode(ec) && range.endOffset == 0) {\n          return;\n        }\n\n        nodes.push(node);\n      });\n      return nodes;\n    }\n\n    function _inspect(range) {\n      var name = typeof range.getName == \"undefined\" ? \"Range\" : range.getName();\n      return \"[\" + name + \"(\" + dom.inspectNode(range.startContainer) + \":\" + range.startOffset + \", \" + dom.inspectNode(range.endContainer) + \":\" + range.endOffset + \")]\";\n    }\n    /*----------------------------------------------------------------------------------------------------------------*/\n    // RangeIterator code partially borrows from IERange by Tim Ryan (http://github.com/timcameronryan/IERange)\n\n\n    function RangeIterator(range, clonePartiallySelectedTextNodes) {\n      this.range = range;\n      this.clonePartiallySelectedTextNodes = clonePartiallySelectedTextNodes;\n\n      if (!range.collapsed) {\n        this.sc = range.startContainer;\n        this.so = range.startOffset;\n        this.ec = range.endContainer;\n        this.eo = range.endOffset;\n        var root = range.commonAncestorContainer;\n\n        if (this.sc === this.ec && isCharacterDataNode(this.sc)) {\n          this.isSingleCharacterDataNode = true;\n          this._first = this._last = this._next = this.sc;\n        } else {\n          this._first = this._next = this.sc === root && !isCharacterDataNode(this.sc) ? this.sc.childNodes[this.so] : getClosestAncestorIn(this.sc, root, true);\n          this._last = this.ec === root && !isCharacterDataNode(this.ec) ? this.ec.childNodes[this.eo - 1] : getClosestAncestorIn(this.ec, root, true);\n        }\n      }\n    }\n\n    RangeIterator.prototype = {\n      _current: null,\n      _next: null,\n      _first: null,\n      _last: null,\n      isSingleCharacterDataNode: false,\n      reset: function reset() {\n        this._current = null;\n        this._next = this._first;\n      },\n      hasNext: function hasNext() {\n        return !!this._next;\n      },\n      next: function next() {\n        // Move to next node\n        var current = this._current = this._next;\n\n        if (current) {\n          this._next = current !== this._last ? current.nextSibling : null; // Check for partially selected text nodes\n\n          if (isCharacterDataNode(current) && this.clonePartiallySelectedTextNodes) {\n            if (current === this.ec) {\n              (current = current.cloneNode(true)).deleteData(this.eo, current.length - this.eo);\n            }\n\n            if (this._current === this.sc) {\n              (current = current.cloneNode(true)).deleteData(0, this.so);\n            }\n          }\n        }\n\n        return current;\n      },\n      remove: function remove() {\n        var current = this._current,\n            start,\n            end;\n\n        if (isCharacterDataNode(current) && (current === this.sc || current === this.ec)) {\n          start = current === this.sc ? this.so : 0;\n          end = current === this.ec ? this.eo : current.length;\n\n          if (start != end) {\n            current.deleteData(start, end - start);\n          }\n        } else {\n          if (current.parentNode) {\n            removeNode(current);\n          } else {}\n        }\n      },\n      // Checks if the current node is partially selected\n      isPartiallySelectedSubtree: function isPartiallySelectedSubtree() {\n        var current = this._current;\n        return isNonTextPartiallySelected(current, this.range);\n      },\n      getSubtreeIterator: function getSubtreeIterator() {\n        var subRange;\n\n        if (this.isSingleCharacterDataNode) {\n          subRange = this.range.cloneRange();\n          subRange.collapse(false);\n        } else {\n          subRange = new Range(getRangeDocument(this.range));\n          var current = this._current;\n          var startContainer = current,\n              startOffset = 0,\n              endContainer = current,\n              endOffset = getNodeLength(current);\n\n          if (isOrIsAncestorOf(current, this.sc)) {\n            startContainer = this.sc;\n            startOffset = this.so;\n          }\n\n          if (isOrIsAncestorOf(current, this.ec)) {\n            endContainer = this.ec;\n            endOffset = this.eo;\n          }\n\n          updateBoundaries(subRange, startContainer, startOffset, endContainer, endOffset);\n        }\n\n        return new RangeIterator(subRange, this.clonePartiallySelectedTextNodes);\n      },\n      detach: function detach() {\n        this.range = this._current = this._next = this._first = this._last = this.sc = this.so = this.ec = this.eo = null;\n      }\n    };\n    /*----------------------------------------------------------------------------------------------------------------*/\n\n    var beforeAfterNodeTypes = [1, 3, 4, 5, 7, 8, 10];\n    var rootContainerNodeTypes = [2, 9, 11];\n    var readonlyNodeTypes = [5, 6, 10, 12];\n    var insertableNodeTypes = [1, 3, 4, 5, 7, 8, 10, 11];\n    var surroundNodeTypes = [1, 3, 4, 5, 7, 8];\n\n    function createAncestorFinder(nodeTypes) {\n      return function (node, selfIsAncestor) {\n        var t,\n            n = selfIsAncestor ? node : node.parentNode;\n\n        while (n) {\n          t = n.nodeType;\n\n          if (arrayContains(nodeTypes, t)) {\n            return n;\n          }\n\n          n = n.parentNode;\n        }\n\n        return null;\n      };\n    }\n\n    var getDocumentOrFragmentContainer = createAncestorFinder([9, 11]);\n    var getReadonlyAncestor = createAncestorFinder(readonlyNodeTypes);\n    var getDocTypeNotationEntityAncestor = createAncestorFinder([6, 10, 12]);\n    var getElementAncestor = createAncestorFinder([1]);\n\n    function assertNoDocTypeNotationEntityAncestor(node, allowSelf) {\n      if (getDocTypeNotationEntityAncestor(node, allowSelf)) {\n        throw new DOMException(\"INVALID_NODE_TYPE_ERR\");\n      }\n    }\n\n    function assertValidNodeType(node, invalidTypes) {\n      if (!arrayContains(invalidTypes, node.nodeType)) {\n        throw new DOMException(\"INVALID_NODE_TYPE_ERR\");\n      }\n    }\n\n    function assertValidOffset(node, offset) {\n      if (offset < 0 || offset > (isCharacterDataNode(node) ? node.length : node.childNodes.length)) {\n        throw new DOMException(\"INDEX_SIZE_ERR\");\n      }\n    }\n\n    function assertSameDocumentOrFragment(node1, node2) {\n      if (getDocumentOrFragmentContainer(node1, true) !== getDocumentOrFragmentContainer(node2, true)) {\n        throw new DOMException(\"WRONG_DOCUMENT_ERR\");\n      }\n    }\n\n    function assertNodeNotReadOnly(node) {\n      if (getReadonlyAncestor(node, true)) {\n        throw new DOMException(\"NO_MODIFICATION_ALLOWED_ERR\");\n      }\n    }\n\n    function assertNode(node, codeName) {\n      if (!node) {\n        throw new DOMException(codeName);\n      }\n    }\n\n    function isValidOffset(node, offset) {\n      return offset <= (isCharacterDataNode(node) ? node.length : node.childNodes.length);\n    }\n\n    function isRangeValid(range) {\n      return !!range.startContainer && !!range.endContainer && !(crashyTextNodes && (dom.isBrokenNode(range.startContainer) || dom.isBrokenNode(range.endContainer))) && getRootContainer(range.startContainer) == getRootContainer(range.endContainer) && isValidOffset(range.startContainer, range.startOffset) && isValidOffset(range.endContainer, range.endOffset);\n    }\n\n    function assertRangeValid(range) {\n      if (!isRangeValid(range)) {\n        throw new Error(\"Range error: Range is not valid. This usually happens after DOM mutation. Range: (\" + range.inspect() + \")\");\n      }\n    }\n    /*----------------------------------------------------------------------------------------------------------------*/\n    // Test the browser's innerHTML support to decide how to implement createContextualFragment\n\n\n    var styleEl = document.createElement(\"style\");\n    var htmlParsingConforms = false;\n\n    try {\n      styleEl.innerHTML = \"<b>x</b>\";\n      htmlParsingConforms = styleEl.firstChild.nodeType == 3; // Pre-Blink Opera incorrectly creates an element node\n    } catch (e) {// IE 6 and 7 throw\n    }\n\n    api.features.htmlParsingConforms = htmlParsingConforms;\n    var createContextualFragment = htmlParsingConforms ? // Implementation as per HTML parsing spec, trusting in the browser's implementation of innerHTML. See\n    // discussion and base code for this implementation at issue 67.\n    // Spec: http://html5.org/specs/dom-parsing.html#extensions-to-the-range-interface\n    // Thanks to Aleks Williams.\n    function (fragmentStr) {\n      // \"Let node the context object's start's node.\"\n      var node = this.startContainer;\n      var doc = getDocument(node); // \"If the context object's start's node is null, raise an INVALID_STATE_ERR\n      // exception and abort these steps.\"\n\n      if (!node) {\n        throw new DOMException(\"INVALID_STATE_ERR\");\n      } // \"Let element be as follows, depending on node's interface:\"\n      // Document, Document Fragment: null\n\n\n      var el = null; // \"Element: node\"\n\n      if (node.nodeType == 1) {\n        el = node; // \"Text, Comment: node's parentElement\"\n      } else if (isCharacterDataNode(node)) {\n        el = dom.parentElement(node);\n      } // \"If either element is null or element's ownerDocument is an HTML document\n      // and element's local name is \"html\" and element's namespace is the HTML\n      // namespace\"\n\n\n      if (el === null || el.nodeName == \"HTML\" && dom.isHtmlNamespace(getDocument(el).documentElement) && dom.isHtmlNamespace(el)) {\n        // \"let element be a new Element with \"body\" as its local name and the HTML\n        // namespace as its namespace.\"\"\n        el = doc.createElement(\"body\");\n      } else {\n        el = el.cloneNode(false);\n      } // \"If the node's document is an HTML document: Invoke the HTML fragment parsing algorithm.\"\n      // \"If the node's document is an XML document: Invoke the XML fragment parsing algorithm.\"\n      // \"In either case, the algorithm must be invoked with fragment as the input\n      // and element as the context element.\"\n\n\n      el.innerHTML = fragmentStr; // \"If this raises an exception, then abort these steps. Otherwise, let new\n      // children be the nodes returned.\"\n      // \"Let fragment be a new DocumentFragment.\"\n      // \"Append all new children to fragment.\"\n      // \"Return fragment.\"\n\n      return dom.fragmentFromNodeChildren(el);\n    } : // In this case, innerHTML cannot be trusted, so fall back to a simpler, non-conformant implementation that\n    // previous versions of Rangy used (with the exception of using a body element rather than a div)\n    function (fragmentStr) {\n      var doc = getRangeDocument(this);\n      var el = doc.createElement(\"body\");\n      el.innerHTML = fragmentStr;\n      return dom.fragmentFromNodeChildren(el);\n    };\n\n    function splitRangeBoundaries(range, positionsToPreserve) {\n      assertRangeValid(range);\n      var sc = range.startContainer,\n          so = range.startOffset,\n          ec = range.endContainer,\n          eo = range.endOffset;\n      var startEndSame = sc === ec;\n\n      if (isCharacterDataNode(ec) && eo > 0 && eo < ec.length) {\n        splitDataNode(ec, eo, positionsToPreserve);\n      }\n\n      if (isCharacterDataNode(sc) && so > 0 && so < sc.length) {\n        sc = splitDataNode(sc, so, positionsToPreserve);\n\n        if (startEndSame) {\n          eo -= so;\n          ec = sc;\n        } else if (ec == sc.parentNode && eo >= getNodeIndex(sc)) {\n          eo++;\n        }\n\n        so = 0;\n      }\n\n      range.setStartAndEnd(sc, so, ec, eo);\n    }\n\n    function rangeToHtml(range) {\n      assertRangeValid(range);\n      var container = range.commonAncestorContainer.parentNode.cloneNode(false);\n      container.appendChild(range.cloneContents());\n      return container.innerHTML;\n    }\n    /*----------------------------------------------------------------------------------------------------------------*/\n\n\n    var rangeProperties = [\"startContainer\", \"startOffset\", \"endContainer\", \"endOffset\", \"collapsed\", \"commonAncestorContainer\"];\n    var s2s = 0,\n        s2e = 1,\n        e2e = 2,\n        e2s = 3;\n    var n_b = 0,\n        n_a = 1,\n        n_b_a = 2,\n        n_i = 3;\n    util.extend(api.rangePrototype, {\n      compareBoundaryPoints: function compareBoundaryPoints(how, range) {\n        assertRangeValid(this);\n        assertSameDocumentOrFragment(this.startContainer, range.startContainer);\n        var nodeA, offsetA, nodeB, offsetB;\n        var prefixA = how == e2s || how == s2s ? \"start\" : \"end\";\n        var prefixB = how == s2e || how == s2s ? \"start\" : \"end\";\n        nodeA = this[prefixA + \"Container\"];\n        offsetA = this[prefixA + \"Offset\"];\n        nodeB = range[prefixB + \"Container\"];\n        offsetB = range[prefixB + \"Offset\"];\n        return comparePoints(nodeA, offsetA, nodeB, offsetB);\n      },\n      insertNode: function insertNode(node) {\n        assertRangeValid(this);\n        assertValidNodeType(node, insertableNodeTypes);\n        assertNodeNotReadOnly(this.startContainer);\n\n        if (isOrIsAncestorOf(node, this.startContainer)) {\n          throw new DOMException(\"HIERARCHY_REQUEST_ERR\");\n        } // No check for whether the container of the start of the Range is of a type that does not allow\n        // children of the type of node: the browser's DOM implementation should do this for us when we attempt\n        // to add the node\n\n\n        var firstNodeInserted = insertNodeAtPosition(node, this.startContainer, this.startOffset);\n        this.setStartBefore(firstNodeInserted);\n      },\n      cloneContents: function cloneContents() {\n        assertRangeValid(this);\n        var clone, frag;\n\n        if (this.collapsed) {\n          return getRangeDocument(this).createDocumentFragment();\n        } else {\n          if (this.startContainer === this.endContainer && isCharacterDataNode(this.startContainer)) {\n            clone = this.startContainer.cloneNode(true);\n            clone.data = clone.data.slice(this.startOffset, this.endOffset);\n            frag = getRangeDocument(this).createDocumentFragment();\n            frag.appendChild(clone);\n            return frag;\n          } else {\n            var iterator = new RangeIterator(this, true);\n            clone = cloneSubtree(iterator);\n            iterator.detach();\n          }\n\n          return clone;\n        }\n      },\n      canSurroundContents: function canSurroundContents() {\n        assertRangeValid(this);\n        assertNodeNotReadOnly(this.startContainer);\n        assertNodeNotReadOnly(this.endContainer); // Check if the contents can be surrounded. Specifically, this means whether the range partially selects\n        // no non-text nodes.\n\n        var iterator = new RangeIterator(this, true);\n        var boundariesInvalid = iterator._first && isNonTextPartiallySelected(iterator._first, this) || iterator._last && isNonTextPartiallySelected(iterator._last, this);\n        iterator.detach();\n        return !boundariesInvalid;\n      },\n      surroundContents: function surroundContents(node) {\n        assertValidNodeType(node, surroundNodeTypes);\n\n        if (!this.canSurroundContents()) {\n          throw new DOMException(\"INVALID_STATE_ERR\");\n        } // Extract the contents\n\n\n        var content = this.extractContents(); // Clear the children of the node\n\n        if (node.hasChildNodes()) {\n          while (node.lastChild) {\n            node.removeChild(node.lastChild);\n          }\n        } // Insert the new node and add the extracted contents\n\n\n        insertNodeAtPosition(node, this.startContainer, this.startOffset);\n        node.appendChild(content);\n        this.selectNode(node);\n      },\n      cloneRange: function cloneRange() {\n        assertRangeValid(this);\n        var range = new Range(getRangeDocument(this));\n        var i = rangeProperties.length,\n            prop;\n\n        while (i--) {\n          prop = rangeProperties[i];\n          range[prop] = this[prop];\n        }\n\n        return range;\n      },\n      toString: function toString() {\n        assertRangeValid(this);\n        var sc = this.startContainer;\n\n        if (sc === this.endContainer && isCharacterDataNode(sc)) {\n          return sc.nodeType == 3 || sc.nodeType == 4 ? sc.data.slice(this.startOffset, this.endOffset) : \"\";\n        } else {\n          var textParts = [],\n              iterator = new RangeIterator(this, true);\n          iterateSubtree(iterator, function (node) {\n            // Accept only text or CDATA nodes, not comments\n            if (node.nodeType == 3 || node.nodeType == 4) {\n              textParts.push(node.data);\n            }\n          });\n          iterator.detach();\n          return textParts.join(\"\");\n        }\n      },\n      // The methods below are all non-standard. The following batch were introduced by Mozilla but have since\n      // been removed from Mozilla.\n      compareNode: function compareNode(node) {\n        assertRangeValid(this);\n        var parent = node.parentNode;\n        var nodeIndex = getNodeIndex(node);\n\n        if (!parent) {\n          throw new DOMException(\"NOT_FOUND_ERR\");\n        }\n\n        var startComparison = this.comparePoint(parent, nodeIndex),\n            endComparison = this.comparePoint(parent, nodeIndex + 1);\n\n        if (startComparison < 0) {\n          // Node starts before\n          return endComparison > 0 ? n_b_a : n_b;\n        } else {\n          return endComparison > 0 ? n_a : n_i;\n        }\n      },\n      comparePoint: function comparePoint(node, offset) {\n        assertRangeValid(this);\n        assertNode(node, \"HIERARCHY_REQUEST_ERR\");\n        assertSameDocumentOrFragment(node, this.startContainer);\n\n        if (comparePoints(node, offset, this.startContainer, this.startOffset) < 0) {\n          return -1;\n        } else if (comparePoints(node, offset, this.endContainer, this.endOffset) > 0) {\n          return 1;\n        }\n\n        return 0;\n      },\n      createContextualFragment: createContextualFragment,\n      toHtml: function toHtml() {\n        return rangeToHtml(this);\n      },\n      // touchingIsIntersecting determines whether this method considers a node that borders a range intersects\n      // with it (as in WebKit) or not (as in Gecko pre-1.9, and the default)\n      intersectsNode: function intersectsNode(node, touchingIsIntersecting) {\n        assertRangeValid(this);\n\n        if (getRootContainer(node) != getRangeRoot(this)) {\n          return false;\n        }\n\n        var parent = node.parentNode,\n            offset = getNodeIndex(node);\n\n        if (!parent) {\n          return true;\n        }\n\n        var startComparison = comparePoints(parent, offset, this.endContainer, this.endOffset),\n            endComparison = comparePoints(parent, offset + 1, this.startContainer, this.startOffset);\n        return touchingIsIntersecting ? startComparison <= 0 && endComparison >= 0 : startComparison < 0 && endComparison > 0;\n      },\n      isPointInRange: function isPointInRange(node, offset) {\n        assertRangeValid(this);\n        assertNode(node, \"HIERARCHY_REQUEST_ERR\");\n        assertSameDocumentOrFragment(node, this.startContainer);\n        return comparePoints(node, offset, this.startContainer, this.startOffset) >= 0 && comparePoints(node, offset, this.endContainer, this.endOffset) <= 0;\n      },\n      // The methods below are non-standard and invented by me.\n      // Sharing a boundary start-to-end or end-to-start does not count as intersection.\n      intersectsRange: function intersectsRange(range) {\n        return rangesIntersect(this, range, false);\n      },\n      // Sharing a boundary start-to-end or end-to-start does count as intersection.\n      intersectsOrTouchesRange: function intersectsOrTouchesRange(range) {\n        return rangesIntersect(this, range, true);\n      },\n      intersection: function intersection(range) {\n        if (this.intersectsRange(range)) {\n          var startComparison = comparePoints(this.startContainer, this.startOffset, range.startContainer, range.startOffset),\n              endComparison = comparePoints(this.endContainer, this.endOffset, range.endContainer, range.endOffset);\n          var intersectionRange = this.cloneRange();\n\n          if (startComparison == -1) {\n            intersectionRange.setStart(range.startContainer, range.startOffset);\n          }\n\n          if (endComparison == 1) {\n            intersectionRange.setEnd(range.endContainer, range.endOffset);\n          }\n\n          return intersectionRange;\n        }\n\n        return null;\n      },\n      union: function union(range) {\n        if (this.intersectsOrTouchesRange(range)) {\n          var unionRange = this.cloneRange();\n\n          if (comparePoints(range.startContainer, range.startOffset, this.startContainer, this.startOffset) == -1) {\n            unionRange.setStart(range.startContainer, range.startOffset);\n          }\n\n          if (comparePoints(range.endContainer, range.endOffset, this.endContainer, this.endOffset) == 1) {\n            unionRange.setEnd(range.endContainer, range.endOffset);\n          }\n\n          return unionRange;\n        } else {\n          throw new DOMException(\"Ranges do not intersect\");\n        }\n      },\n      containsNode: function containsNode(node, allowPartial) {\n        if (allowPartial) {\n          return this.intersectsNode(node, false);\n        } else {\n          return this.compareNode(node) == n_i;\n        }\n      },\n      containsNodeContents: function containsNodeContents(node) {\n        return this.comparePoint(node, 0) >= 0 && this.comparePoint(node, getNodeLength(node)) <= 0;\n      },\n      containsRange: function containsRange(range) {\n        var intersection = this.intersection(range);\n        return intersection !== null && range.equals(intersection);\n      },\n      containsNodeText: function containsNodeText(node) {\n        var nodeRange = this.cloneRange();\n        nodeRange.selectNode(node);\n        var textNodes = nodeRange.getNodes([3]);\n\n        if (textNodes.length > 0) {\n          nodeRange.setStart(textNodes[0], 0);\n          var lastTextNode = textNodes.pop();\n          nodeRange.setEnd(lastTextNode, lastTextNode.length);\n          return this.containsRange(nodeRange);\n        } else {\n          return this.containsNodeContents(node);\n        }\n      },\n      getNodes: function getNodes(nodeTypes, filter) {\n        assertRangeValid(this);\n        return getNodesInRange(this, nodeTypes, filter);\n      },\n      getDocument: function getDocument() {\n        return getRangeDocument(this);\n      },\n      collapseBefore: function collapseBefore(node) {\n        this.setEndBefore(node);\n        this.collapse(false);\n      },\n      collapseAfter: function collapseAfter(node) {\n        this.setStartAfter(node);\n        this.collapse(true);\n      },\n      getBookmark: function getBookmark(containerNode) {\n        var doc = getRangeDocument(this);\n        var preSelectionRange = api.createRange(doc);\n        containerNode = containerNode || dom.getBody(doc);\n        preSelectionRange.selectNodeContents(containerNode);\n        var range = this.intersection(preSelectionRange);\n        var start = 0,\n            end = 0;\n\n        if (range) {\n          preSelectionRange.setEnd(range.startContainer, range.startOffset);\n          start = preSelectionRange.toString().length;\n          end = start + range.toString().length;\n        }\n\n        return {\n          start: start,\n          end: end,\n          containerNode: containerNode\n        };\n      },\n      moveToBookmark: function moveToBookmark(bookmark) {\n        var containerNode = bookmark.containerNode;\n        var charIndex = 0;\n        this.setStart(containerNode, 0);\n        this.collapse(true);\n        var nodeStack = [containerNode],\n            node,\n            foundStart = false,\n            stop = false;\n        var nextCharIndex, i, childNodes;\n\n        while (!stop && (node = nodeStack.pop())) {\n          if (node.nodeType == 3) {\n            nextCharIndex = charIndex + node.length;\n\n            if (!foundStart && bookmark.start >= charIndex && bookmark.start <= nextCharIndex) {\n              this.setStart(node, bookmark.start - charIndex);\n              foundStart = true;\n            }\n\n            if (foundStart && bookmark.end >= charIndex && bookmark.end <= nextCharIndex) {\n              this.setEnd(node, bookmark.end - charIndex);\n              stop = true;\n            }\n\n            charIndex = nextCharIndex;\n          } else {\n            childNodes = node.childNodes;\n            i = childNodes.length;\n\n            while (i--) {\n              nodeStack.push(childNodes[i]);\n            }\n          }\n        }\n      },\n      getName: function getName() {\n        return \"DomRange\";\n      },\n      equals: function equals(range) {\n        return Range.rangesEqual(this, range);\n      },\n      isValid: function isValid() {\n        return isRangeValid(this);\n      },\n      inspect: function inspect() {\n        return _inspect(this);\n      },\n      detach: function detach() {// In DOM4, detach() is now a no-op.\n      }\n    });\n\n    function copyComparisonConstantsToObject(obj) {\n      obj.START_TO_START = s2s;\n      obj.START_TO_END = s2e;\n      obj.END_TO_END = e2e;\n      obj.END_TO_START = e2s;\n      obj.NODE_BEFORE = n_b;\n      obj.NODE_AFTER = n_a;\n      obj.NODE_BEFORE_AND_AFTER = n_b_a;\n      obj.NODE_INSIDE = n_i;\n    }\n\n    function copyComparisonConstants(constructor) {\n      copyComparisonConstantsToObject(constructor);\n      copyComparisonConstantsToObject(constructor.prototype);\n    }\n\n    function createRangeContentRemover(remover, boundaryUpdater) {\n      return function () {\n        assertRangeValid(this);\n        var sc = this.startContainer,\n            so = this.startOffset,\n            root = this.commonAncestorContainer;\n        var iterator = new RangeIterator(this, true); // Work out where to position the range after content removal\n\n        var node, boundary;\n\n        if (sc !== root) {\n          node = getClosestAncestorIn(sc, root, true);\n          boundary = getBoundaryAfterNode(node);\n          sc = boundary.node;\n          so = boundary.offset;\n        } // Check none of the range is read-only\n\n\n        iterateSubtree(iterator, assertNodeNotReadOnly);\n        iterator.reset(); // Remove the content\n\n        var returnValue = remover(iterator);\n        iterator.detach(); // Move to the new position\n\n        boundaryUpdater(this, sc, so, sc, so);\n        return returnValue;\n      };\n    }\n\n    function createPrototypeRange(constructor, boundaryUpdater) {\n      function createBeforeAfterNodeSetter(isBefore, isStart) {\n        return function (node) {\n          assertValidNodeType(node, beforeAfterNodeTypes);\n          assertValidNodeType(getRootContainer(node), rootContainerNodeTypes);\n          var boundary = (isBefore ? getBoundaryBeforeNode : getBoundaryAfterNode)(node);\n          (isStart ? setRangeStart : setRangeEnd)(this, boundary.node, boundary.offset);\n        };\n      }\n\n      function setRangeStart(range, node, offset) {\n        var ec = range.endContainer,\n            eo = range.endOffset;\n\n        if (node !== range.startContainer || offset !== range.startOffset) {\n          // Check the root containers of the range and the new boundary, and also check whether the new boundary\n          // is after the current end. In either case, collapse the range to the new position\n          if (getRootContainer(node) != getRootContainer(ec) || comparePoints(node, offset, ec, eo) == 1) {\n            ec = node;\n            eo = offset;\n          }\n\n          boundaryUpdater(range, node, offset, ec, eo);\n        }\n      }\n\n      function setRangeEnd(range, node, offset) {\n        var sc = range.startContainer,\n            so = range.startOffset;\n\n        if (node !== range.endContainer || offset !== range.endOffset) {\n          // Check the root containers of the range and the new boundary, and also check whether the new boundary\n          // is after the current end. In either case, collapse the range to the new position\n          if (getRootContainer(node) != getRootContainer(sc) || comparePoints(node, offset, sc, so) == -1) {\n            sc = node;\n            so = offset;\n          }\n\n          boundaryUpdater(range, sc, so, node, offset);\n        }\n      } // Set up inheritance\n\n\n      var F = function F() {};\n\n      F.prototype = api.rangePrototype;\n      constructor.prototype = new F();\n      util.extend(constructor.prototype, {\n        setStart: function setStart(node, offset) {\n          assertNoDocTypeNotationEntityAncestor(node, true);\n          assertValidOffset(node, offset);\n          setRangeStart(this, node, offset);\n        },\n        setEnd: function setEnd(node, offset) {\n          assertNoDocTypeNotationEntityAncestor(node, true);\n          assertValidOffset(node, offset);\n          setRangeEnd(this, node, offset);\n        },\n\n        /**\r\n         * Convenience method to set a range's start and end boundaries. Overloaded as follows:\r\n         * - Two parameters (node, offset) creates a collapsed range at that position\r\n         * - Three parameters (node, startOffset, endOffset) creates a range contained with node starting at\r\n         *   startOffset and ending at endOffset\r\n         * - Four parameters (startNode, startOffset, endNode, endOffset) creates a range starting at startOffset in\r\n         *   startNode and ending at endOffset in endNode\r\n         */\n        setStartAndEnd: function setStartAndEnd() {\n          var args = arguments;\n          var sc = args[0],\n              so = args[1],\n              ec = sc,\n              eo = so;\n\n          switch (args.length) {\n            case 3:\n              eo = args[2];\n              break;\n\n            case 4:\n              ec = args[2];\n              eo = args[3];\n              break;\n          }\n\n          assertNoDocTypeNotationEntityAncestor(sc, true);\n          assertValidOffset(sc, so);\n          assertNoDocTypeNotationEntityAncestor(ec, true);\n          assertValidOffset(ec, eo);\n          boundaryUpdater(this, sc, so, ec, eo);\n        },\n        setBoundary: function setBoundary(node, offset, isStart) {\n          this[\"set\" + (isStart ? \"Start\" : \"End\")](node, offset);\n        },\n        setStartBefore: createBeforeAfterNodeSetter(true, true),\n        setStartAfter: createBeforeAfterNodeSetter(false, true),\n        setEndBefore: createBeforeAfterNodeSetter(true, false),\n        setEndAfter: createBeforeAfterNodeSetter(false, false),\n        collapse: function collapse(isStart) {\n          assertRangeValid(this);\n\n          if (isStart) {\n            boundaryUpdater(this, this.startContainer, this.startOffset, this.startContainer, this.startOffset);\n          } else {\n            boundaryUpdater(this, this.endContainer, this.endOffset, this.endContainer, this.endOffset);\n          }\n        },\n        selectNodeContents: function selectNodeContents(node) {\n          assertNoDocTypeNotationEntityAncestor(node, true);\n          boundaryUpdater(this, node, 0, node, getNodeLength(node));\n        },\n        selectNode: function selectNode(node) {\n          assertNoDocTypeNotationEntityAncestor(node, false);\n          assertValidNodeType(node, beforeAfterNodeTypes);\n          var start = getBoundaryBeforeNode(node),\n              end = getBoundaryAfterNode(node);\n          boundaryUpdater(this, start.node, start.offset, end.node, end.offset);\n        },\n        extractContents: createRangeContentRemover(extractSubtree, boundaryUpdater),\n        deleteContents: createRangeContentRemover(deleteSubtree, boundaryUpdater),\n        canSurroundContents: function canSurroundContents() {\n          assertRangeValid(this);\n          assertNodeNotReadOnly(this.startContainer);\n          assertNodeNotReadOnly(this.endContainer); // Check if the contents can be surrounded. Specifically, this means whether the range partially selects\n          // no non-text nodes.\n\n          var iterator = new RangeIterator(this, true);\n          var boundariesInvalid = iterator._first && isNonTextPartiallySelected(iterator._first, this) || iterator._last && isNonTextPartiallySelected(iterator._last, this);\n          iterator.detach();\n          return !boundariesInvalid;\n        },\n        splitBoundaries: function splitBoundaries() {\n          splitRangeBoundaries(this);\n        },\n        splitBoundariesPreservingPositions: function splitBoundariesPreservingPositions(positionsToPreserve) {\n          splitRangeBoundaries(this, positionsToPreserve);\n        },\n        normalizeBoundaries: function normalizeBoundaries() {\n          assertRangeValid(this);\n          var sc = this.startContainer,\n              so = this.startOffset,\n              ec = this.endContainer,\n              eo = this.endOffset;\n\n          var mergeForward = function mergeForward(node) {\n            var sibling = node.nextSibling;\n\n            if (sibling && sibling.nodeType == node.nodeType) {\n              ec = node;\n              eo = node.length;\n              node.appendData(sibling.data);\n              removeNode(sibling);\n            }\n          };\n\n          var mergeBackward = function mergeBackward(node) {\n            var sibling = node.previousSibling;\n\n            if (sibling && sibling.nodeType == node.nodeType) {\n              sc = node;\n              var nodeLength = node.length;\n              so = sibling.length;\n              node.insertData(0, sibling.data);\n              removeNode(sibling);\n\n              if (sc == ec) {\n                eo += so;\n                ec = sc;\n              } else if (ec == node.parentNode) {\n                var nodeIndex = getNodeIndex(node);\n\n                if (eo == nodeIndex) {\n                  ec = node;\n                  eo = nodeLength;\n                } else if (eo > nodeIndex) {\n                  eo--;\n                }\n              }\n            }\n          };\n\n          var normalizeStart = true;\n          var sibling;\n\n          if (isCharacterDataNode(ec)) {\n            if (eo == ec.length) {\n              mergeForward(ec);\n            } else if (eo == 0) {\n              sibling = ec.previousSibling;\n\n              if (sibling && sibling.nodeType == ec.nodeType) {\n                eo = sibling.length;\n\n                if (sc == ec) {\n                  normalizeStart = false;\n                }\n\n                sibling.appendData(ec.data);\n                removeNode(ec);\n                ec = sibling;\n              }\n            }\n          } else {\n            if (eo > 0) {\n              var endNode = ec.childNodes[eo - 1];\n\n              if (endNode && isCharacterDataNode(endNode)) {\n                mergeForward(endNode);\n              }\n            }\n\n            normalizeStart = !this.collapsed;\n          }\n\n          if (normalizeStart) {\n            if (isCharacterDataNode(sc)) {\n              if (so == 0) {\n                mergeBackward(sc);\n              } else if (so == sc.length) {\n                sibling = sc.nextSibling;\n\n                if (sibling && sibling.nodeType == sc.nodeType) {\n                  if (ec == sibling) {\n                    ec = sc;\n                    eo += sc.length;\n                  }\n\n                  sc.appendData(sibling.data);\n                  removeNode(sibling);\n                }\n              }\n            } else {\n              if (so < sc.childNodes.length) {\n                var startNode = sc.childNodes[so];\n\n                if (startNode && isCharacterDataNode(startNode)) {\n                  mergeBackward(startNode);\n                }\n              }\n            }\n          } else {\n            sc = ec;\n            so = eo;\n          }\n\n          boundaryUpdater(this, sc, so, ec, eo);\n        },\n        collapseToPoint: function collapseToPoint(node, offset) {\n          assertNoDocTypeNotationEntityAncestor(node, true);\n          assertValidOffset(node, offset);\n          this.setStartAndEnd(node, offset);\n        },\n        parentElement: function parentElement() {\n          assertRangeValid(this);\n          var parentNode = this.commonAncestorContainer;\n          return parentNode ? getElementAncestor(this.commonAncestorContainer, true) : null;\n        }\n      });\n      copyComparisonConstants(constructor);\n    }\n    /*----------------------------------------------------------------------------------------------------------------*/\n    // Updates commonAncestorContainer and collapsed after boundary change\n\n\n    function updateCollapsedAndCommonAncestor(range) {\n      range.collapsed = range.startContainer === range.endContainer && range.startOffset === range.endOffset;\n      range.commonAncestorContainer = range.collapsed ? range.startContainer : dom.getCommonAncestor(range.startContainer, range.endContainer);\n    }\n\n    function updateBoundaries(range, startContainer, startOffset, endContainer, endOffset) {\n      range.startContainer = startContainer;\n      range.startOffset = startOffset;\n      range.endContainer = endContainer;\n      range.endOffset = endOffset;\n      range.document = dom.getDocument(startContainer);\n      updateCollapsedAndCommonAncestor(range);\n    }\n\n    function Range(doc) {\n      updateBoundaries(this, doc, 0, doc, 0);\n    }\n\n    createPrototypeRange(Range, updateBoundaries);\n    util.extend(Range, {\n      rangeProperties: rangeProperties,\n      RangeIterator: RangeIterator,\n      copyComparisonConstants: copyComparisonConstants,\n      createPrototypeRange: createPrototypeRange,\n      inspect: _inspect,\n      toHtml: rangeToHtml,\n      getRangeDocument: getRangeDocument,\n      rangesEqual: function rangesEqual(r1, r2) {\n        return r1.startContainer === r2.startContainer && r1.startOffset === r2.startOffset && r1.endContainer === r2.endContainer && r1.endOffset === r2.endOffset;\n      }\n    });\n    api.DomRange = Range;\n  });\n  /*----------------------------------------------------------------------------------------------------------------*/\n\n  api.createCoreModule(\"WrappedRange\", [\"DomRange\"], function (api, module) {\n    var WrappedRange, WrappedTextRange;\n    var dom = api.dom;\n    var util = api.util;\n    var DomPosition = dom.DomPosition;\n    var DomRange = api.DomRange;\n    var getBody = dom.getBody;\n    var getContentDocument = dom.getContentDocument;\n    var isCharacterDataNode = dom.isCharacterDataNode;\n    /*----------------------------------------------------------------------------------------------------------------*/\n\n    if (api.features.implementsDomRange) {\n      // This is a wrapper around the browser's native DOM Range. It has two aims:\n      // - Provide workarounds for specific browser bugs\n      // - provide convenient extensions, which are inherited from Rangy's DomRange\n      (function () {\n        var rangeProto;\n        var rangeProperties = DomRange.rangeProperties;\n\n        function updateRangeProperties(range) {\n          var i = rangeProperties.length,\n              prop;\n\n          while (i--) {\n            prop = rangeProperties[i];\n            range[prop] = range.nativeRange[prop];\n          } // Fix for broken collapsed property in IE 9.\n\n\n          range.collapsed = range.startContainer === range.endContainer && range.startOffset === range.endOffset;\n        }\n\n        function updateNativeRange(range, startContainer, startOffset, endContainer, endOffset) {\n          var startMoved = range.startContainer !== startContainer || range.startOffset != startOffset;\n          var endMoved = range.endContainer !== endContainer || range.endOffset != endOffset;\n          var nativeRangeDifferent = !range.equals(range.nativeRange); // Always set both boundaries for the benefit of IE9 (see issue 35)\n\n          if (startMoved || endMoved || nativeRangeDifferent) {\n            range.setEnd(endContainer, endOffset);\n            range.setStart(startContainer, startOffset);\n          }\n        }\n\n        var createBeforeAfterNodeSetter;\n\n        WrappedRange = function WrappedRange(range) {\n          if (!range) {\n            throw module.createError(\"WrappedRange: Range must be specified\");\n          }\n\n          this.nativeRange = range;\n          updateRangeProperties(this);\n        };\n\n        DomRange.createPrototypeRange(WrappedRange, updateNativeRange);\n        rangeProto = WrappedRange.prototype;\n\n        rangeProto.selectNode = function (node) {\n          this.nativeRange.selectNode(node);\n          updateRangeProperties(this);\n        };\n\n        rangeProto.cloneContents = function () {\n          return this.nativeRange.cloneContents();\n        }; // Due to a long-standing Firefox bug that I have not been able to find a reliable way to detect,\n        // insertNode() is never delegated to the native range.\n\n\n        rangeProto.surroundContents = function (node) {\n          this.nativeRange.surroundContents(node);\n          updateRangeProperties(this);\n        };\n\n        rangeProto.collapse = function (isStart) {\n          this.nativeRange.collapse(isStart);\n          updateRangeProperties(this);\n        };\n\n        rangeProto.cloneRange = function () {\n          return new WrappedRange(this.nativeRange.cloneRange());\n        };\n\n        rangeProto.refresh = function () {\n          updateRangeProperties(this);\n        };\n\n        rangeProto.toString = function () {\n          return this.nativeRange.toString();\n        }; // Create test range and node for feature detection\n\n\n        var testTextNode = document.createTextNode(\"test\");\n        getBody(document).appendChild(testTextNode);\n        var range = document.createRange();\n        /*--------------------------------------------------------------------------------------------------------*/\n        // Test for Firefox 2 bug that prevents moving the start of a Range to a point after its current end and\n        // correct for it\n\n        range.setStart(testTextNode, 0);\n        range.setEnd(testTextNode, 0);\n\n        try {\n          range.setStart(testTextNode, 1);\n\n          rangeProto.setStart = function (node, offset) {\n            this.nativeRange.setStart(node, offset);\n            updateRangeProperties(this);\n          };\n\n          rangeProto.setEnd = function (node, offset) {\n            this.nativeRange.setEnd(node, offset);\n            updateRangeProperties(this);\n          };\n\n          createBeforeAfterNodeSetter = function createBeforeAfterNodeSetter(name) {\n            return function (node) {\n              this.nativeRange[name](node);\n              updateRangeProperties(this);\n            };\n          };\n        } catch (ex) {\n          rangeProto.setStart = function (node, offset) {\n            try {\n              this.nativeRange.setStart(node, offset);\n            } catch (ex) {\n              this.nativeRange.setEnd(node, offset);\n              this.nativeRange.setStart(node, offset);\n            }\n\n            updateRangeProperties(this);\n          };\n\n          rangeProto.setEnd = function (node, offset) {\n            try {\n              this.nativeRange.setEnd(node, offset);\n            } catch (ex) {\n              this.nativeRange.setStart(node, offset);\n              this.nativeRange.setEnd(node, offset);\n            }\n\n            updateRangeProperties(this);\n          };\n\n          createBeforeAfterNodeSetter = function createBeforeAfterNodeSetter(name, oppositeName) {\n            return function (node) {\n              try {\n                this.nativeRange[name](node);\n              } catch (ex) {\n                this.nativeRange[oppositeName](node);\n                this.nativeRange[name](node);\n              }\n\n              updateRangeProperties(this);\n            };\n          };\n        }\n\n        rangeProto.setStartBefore = createBeforeAfterNodeSetter(\"setStartBefore\", \"setEndBefore\");\n        rangeProto.setStartAfter = createBeforeAfterNodeSetter(\"setStartAfter\", \"setEndAfter\");\n        rangeProto.setEndBefore = createBeforeAfterNodeSetter(\"setEndBefore\", \"setStartBefore\");\n        rangeProto.setEndAfter = createBeforeAfterNodeSetter(\"setEndAfter\", \"setStartAfter\");\n        /*--------------------------------------------------------------------------------------------------------*/\n        // Always use DOM4-compliant selectNodeContents implementation: it's simpler and less code than testing\n        // whether the native implementation can be trusted\n\n        rangeProto.selectNodeContents = function (node) {\n          this.setStartAndEnd(node, 0, dom.getNodeLength(node));\n        };\n        /*--------------------------------------------------------------------------------------------------------*/\n        // Test for and correct WebKit bug that has the behaviour of compareBoundaryPoints round the wrong way for\n        // constants START_TO_END and END_TO_START: https://bugs.webkit.org/show_bug.cgi?id=20738\n\n\n        range.selectNodeContents(testTextNode);\n        range.setEnd(testTextNode, 3);\n        var range2 = document.createRange();\n        range2.selectNodeContents(testTextNode);\n        range2.setEnd(testTextNode, 4);\n        range2.setStart(testTextNode, 2);\n\n        if (range.compareBoundaryPoints(range.START_TO_END, range2) == -1 && range.compareBoundaryPoints(range.END_TO_START, range2) == 1) {\n          // This is the wrong way round, so correct for it\n          rangeProto.compareBoundaryPoints = function (type, range) {\n            range = range.nativeRange || range;\n\n            if (type == range.START_TO_END) {\n              type = range.END_TO_START;\n            } else if (type == range.END_TO_START) {\n              type = range.START_TO_END;\n            }\n\n            return this.nativeRange.compareBoundaryPoints(type, range);\n          };\n        } else {\n          rangeProto.compareBoundaryPoints = function (type, range) {\n            return this.nativeRange.compareBoundaryPoints(type, range.nativeRange || range);\n          };\n        }\n        /*--------------------------------------------------------------------------------------------------------*/\n        // Test for IE deleteContents() and extractContents() bug and correct it. See issue 107.\n\n\n        var el = document.createElement(\"div\");\n        el.innerHTML = \"123\";\n        var textNode = el.firstChild;\n        var body = getBody(document);\n        body.appendChild(el);\n        range.setStart(textNode, 1);\n        range.setEnd(textNode, 2);\n        range.deleteContents();\n\n        if (textNode.data == \"13\") {\n          // Behaviour is correct per DOM4 Range so wrap the browser's implementation of deleteContents() and\n          // extractContents()\n          rangeProto.deleteContents = function () {\n            this.nativeRange.deleteContents();\n            updateRangeProperties(this);\n          };\n\n          rangeProto.extractContents = function () {\n            var frag = this.nativeRange.extractContents();\n            updateRangeProperties(this);\n            return frag;\n          };\n        } else {}\n\n        body.removeChild(el);\n        body = null;\n        /*--------------------------------------------------------------------------------------------------------*/\n        // Test for existence of createContextualFragment and delegate to it if it exists\n\n        if (util.isHostMethod(range, \"createContextualFragment\")) {\n          rangeProto.createContextualFragment = function (fragmentStr) {\n            return this.nativeRange.createContextualFragment(fragmentStr);\n          };\n        }\n        /*--------------------------------------------------------------------------------------------------------*/\n        // Clean up\n\n\n        getBody(document).removeChild(testTextNode);\n\n        rangeProto.getName = function () {\n          return \"WrappedRange\";\n        };\n\n        api.WrappedRange = WrappedRange;\n\n        api.createNativeRange = function (doc) {\n          doc = getContentDocument(doc, module, \"createNativeRange\");\n          return doc.createRange();\n        };\n      })();\n    }\n\n    if (api.features.implementsTextRange) {\n      /*\r\n      This is a workaround for a bug where IE returns the wrong container element from the TextRange's parentElement()\r\n      method. For example, in the following (where pipes denote the selection boundaries):\r\n            <ul id=\"ul\"><li id=\"a\">| a </li><li id=\"b\"> b |</li></ul>\r\n            var range = document.selection.createRange();\r\n      alert(range.parentElement().id); // Should alert \"ul\" but alerts \"b\"\r\n            This method returns the common ancestor node of the following:\r\n      - the parentElement() of the textRange\r\n      - the parentElement() of the textRange after calling collapse(true)\r\n      - the parentElement() of the textRange after calling collapse(false)\r\n      */\n      var getTextRangeContainerElement = function getTextRangeContainerElement(textRange) {\n        var parentEl = textRange.parentElement();\n        var range = textRange.duplicate();\n        range.collapse(true);\n        var startEl = range.parentElement();\n        range = textRange.duplicate();\n        range.collapse(false);\n        var endEl = range.parentElement();\n        var startEndContainer = startEl == endEl ? startEl : dom.getCommonAncestor(startEl, endEl);\n        return startEndContainer == parentEl ? startEndContainer : dom.getCommonAncestor(parentEl, startEndContainer);\n      };\n\n      var textRangeIsCollapsed = function textRangeIsCollapsed(textRange) {\n        return textRange.compareEndPoints(\"StartToEnd\", textRange) == 0;\n      }; // Gets the boundary of a TextRange expressed as a node and an offset within that node. This function started\n      // out as an improved version of code found in Tim Cameron Ryan's IERange (http://code.google.com/p/ierange/)\n      // but has grown, fixing problems with line breaks in preformatted text, adding workaround for IE TextRange\n      // bugs, handling for inputs and images, plus optimizations.\n\n\n      var getTextRangeBoundaryPosition = function getTextRangeBoundaryPosition(textRange, wholeRangeContainerElement, isStart, isCollapsed, startInfo) {\n        var workingRange = textRange.duplicate();\n        workingRange.collapse(isStart);\n        var containerElement = workingRange.parentElement(); // Sometimes collapsing a TextRange that's at the start of a text node can move it into the previous node, so\n        // check for that\n\n        if (!dom.isOrIsAncestorOf(wholeRangeContainerElement, containerElement)) {\n          containerElement = wholeRangeContainerElement;\n        } // Deal with nodes that cannot \"contain rich HTML markup\". In practice, this means form inputs, images and\n        // similar. See http://msdn.microsoft.com/en-us/library/aa703950%28VS.85%29.aspx\n\n\n        if (!containerElement.canHaveHTML) {\n          var pos = new DomPosition(containerElement.parentNode, dom.getNodeIndex(containerElement));\n          return {\n            boundaryPosition: pos,\n            nodeInfo: {\n              nodeIndex: pos.offset,\n              containerElement: pos.node\n            }\n          };\n        }\n\n        var workingNode = dom.getDocument(containerElement).createElement(\"span\"); // Workaround for HTML5 Shiv's insane violation of document.createElement(). See Rangy issue 104 and HTML5\n        // Shiv issue 64: https://github.com/aFarkas/html5shiv/issues/64\n\n        if (workingNode.parentNode) {\n          dom.removeNode(workingNode);\n        }\n\n        var comparison,\n            workingComparisonType = isStart ? \"StartToStart\" : \"StartToEnd\";\n        var previousNode, nextNode, boundaryPosition, boundaryNode;\n        var start = startInfo && startInfo.containerElement == containerElement ? startInfo.nodeIndex : 0;\n        var childNodeCount = containerElement.childNodes.length;\n        var end = childNodeCount; // Check end first. Code within the loop assumes that the endth child node of the container is definitely\n        // after the range boundary.\n\n        var nodeIndex = end;\n\n        while (true) {\n          if (nodeIndex == childNodeCount) {\n            containerElement.appendChild(workingNode);\n          } else {\n            containerElement.insertBefore(workingNode, containerElement.childNodes[nodeIndex]);\n          }\n\n          workingRange.moveToElementText(workingNode);\n          comparison = workingRange.compareEndPoints(workingComparisonType, textRange);\n\n          if (comparison == 0 || start == end) {\n            break;\n          } else if (comparison == -1) {\n            if (end == start + 1) {\n              // We know the endth child node is after the range boundary, so we must be done.\n              break;\n            } else {\n              start = nodeIndex;\n            }\n          } else {\n            end = end == start + 1 ? start : nodeIndex;\n          }\n\n          nodeIndex = Math.floor((start + end) / 2);\n          containerElement.removeChild(workingNode);\n        } // We've now reached or gone past the boundary of the text range we're interested in\n        // so have identified the node we want\n\n\n        boundaryNode = workingNode.nextSibling;\n\n        if (comparison == -1 && boundaryNode && isCharacterDataNode(boundaryNode)) {\n          // This is a character data node (text, comment, cdata). The working range is collapsed at the start of\n          // the node containing the text range's boundary, so we move the end of the working range to the\n          // boundary point and measure the length of its text to get the boundary's offset within the node.\n          workingRange.setEndPoint(isStart ? \"EndToStart\" : \"EndToEnd\", textRange);\n          var offset;\n\n          if (/[\\r\\n]/.test(boundaryNode.data)) {\n            /*\r\n            For the particular case of a boundary within a text node containing rendered line breaks (within a\r\n            <pre> element, for example), we need a slightly complicated approach to get the boundary's offset in\r\n            IE. The facts:\r\n                  - Each line break is represented as \\r in the text node's data/nodeValue properties\r\n            - Each line break is represented as \\r\\n in the TextRange's 'text' property\r\n            - The 'text' property of the TextRange does not contain trailing line breaks\r\n                  To get round the problem presented by the final fact above, we can use the fact that TextRange's\r\n            moveStart() and moveEnd() methods return the actual number of characters moved, which is not\r\n            necessarily the same as the number of characters it was instructed to move. The simplest approach is\r\n            to use this to store the characters moved when moving both the start and end of the range to the\r\n            start of the document body and subtracting the start offset from the end offset (the\r\n            \"move-negative-gazillion\" method). However, this is extremely slow when the document is large and\r\n            the range is near the end of it. Clearly doing the mirror image (i.e. moving the range boundaries to\r\n            the end of the document) has the same problem.\r\n                  Another approach that works is to use moveStart() to move the start boundary of the range up to the\r\n            end boundary one character at a time and incrementing a counter with the value returned by the\r\n            moveStart() call. However, the check for whether the start boundary has reached the end boundary is\r\n            expensive, so this method is slow (although unlike \"move-negative-gazillion\" is largely unaffected\r\n            by the location of the range within the document).\r\n                  The approach used below is a hybrid of the two methods above. It uses the fact that a string\r\n            containing the TextRange's 'text' property with each \\r\\n converted to a single \\r character cannot\r\n            be longer than the text of the TextRange, so the start of the range is moved that length initially\r\n            and then a character at a time to make up for any trailing line breaks not contained in the 'text'\r\n            property. This has good performance in most situations compared to the previous two methods.\r\n            */\n            var tempRange = workingRange.duplicate();\n            var rangeLength = tempRange.text.replace(/\\r\\n/g, \"\\r\").length;\n            offset = tempRange.moveStart(\"character\", rangeLength);\n\n            while ((comparison = tempRange.compareEndPoints(\"StartToEnd\", tempRange)) == -1) {\n              offset++;\n              tempRange.moveStart(\"character\", 1);\n            }\n          } else {\n            offset = workingRange.text.length;\n          }\n\n          boundaryPosition = new DomPosition(boundaryNode, offset);\n        } else {\n          // If the boundary immediately follows a character data node and this is the end boundary, we should favour\n          // a position within that, and likewise for a start boundary preceding a character data node\n          previousNode = (isCollapsed || !isStart) && workingNode.previousSibling;\n          nextNode = (isCollapsed || isStart) && workingNode.nextSibling;\n\n          if (nextNode && isCharacterDataNode(nextNode)) {\n            boundaryPosition = new DomPosition(nextNode, 0);\n          } else if (previousNode && isCharacterDataNode(previousNode)) {\n            boundaryPosition = new DomPosition(previousNode, previousNode.data.length);\n          } else {\n            boundaryPosition = new DomPosition(containerElement, dom.getNodeIndex(workingNode));\n          }\n        } // Clean up\n\n\n        dom.removeNode(workingNode);\n        return {\n          boundaryPosition: boundaryPosition,\n          nodeInfo: {\n            nodeIndex: nodeIndex,\n            containerElement: containerElement\n          }\n        };\n      }; // Returns a TextRange representing the boundary of a TextRange expressed as a node and an offset within that\n      // node. This function started out as an optimized version of code found in Tim Cameron Ryan's IERange\n      // (http://code.google.com/p/ierange/)\n\n\n      var createBoundaryTextRange = function createBoundaryTextRange(boundaryPosition, isStart) {\n        var boundaryNode,\n            boundaryParent,\n            boundaryOffset = boundaryPosition.offset;\n        var doc = dom.getDocument(boundaryPosition.node);\n        var workingNode,\n            childNodes,\n            workingRange = getBody(doc).createTextRange();\n        var nodeIsDataNode = isCharacterDataNode(boundaryPosition.node);\n\n        if (nodeIsDataNode) {\n          boundaryNode = boundaryPosition.node;\n          boundaryParent = boundaryNode.parentNode;\n        } else {\n          childNodes = boundaryPosition.node.childNodes;\n          boundaryNode = boundaryOffset < childNodes.length ? childNodes[boundaryOffset] : null;\n          boundaryParent = boundaryPosition.node;\n        } // Position the range immediately before the node containing the boundary\n\n\n        workingNode = doc.createElement(\"span\"); // Making the working element non-empty element persuades IE to consider the TextRange boundary to be within\n        // the element rather than immediately before or after it\n\n        workingNode.innerHTML = \"&#feff;\"; // insertBefore is supposed to work like appendChild if the second parameter is null. However, a bug report\n        // for IERange suggests that it can crash the browser: http://code.google.com/p/ierange/issues/detail?id=12\n\n        if (boundaryNode) {\n          boundaryParent.insertBefore(workingNode, boundaryNode);\n        } else {\n          boundaryParent.appendChild(workingNode);\n        }\n\n        workingRange.moveToElementText(workingNode);\n        workingRange.collapse(!isStart); // Clean up\n\n        boundaryParent.removeChild(workingNode); // Move the working range to the text offset, if required\n\n        if (nodeIsDataNode) {\n          workingRange[isStart ? \"moveStart\" : \"moveEnd\"](\"character\", boundaryOffset);\n        }\n\n        return workingRange;\n      };\n      /*------------------------------------------------------------------------------------------------------------*/\n      // This is a wrapper around a TextRange, providing full DOM Range functionality using rangy's DomRange as a\n      // prototype\n\n\n      WrappedTextRange = function WrappedTextRange(textRange) {\n        this.textRange = textRange;\n        this.refresh();\n      };\n\n      WrappedTextRange.prototype = new DomRange(document);\n\n      WrappedTextRange.prototype.refresh = function () {\n        var start, end, startBoundary; // TextRange's parentElement() method cannot be trusted. getTextRangeContainerElement() works around that.\n\n        var rangeContainerElement = getTextRangeContainerElement(this.textRange);\n\n        if (textRangeIsCollapsed(this.textRange)) {\n          end = start = getTextRangeBoundaryPosition(this.textRange, rangeContainerElement, true, true).boundaryPosition;\n        } else {\n          startBoundary = getTextRangeBoundaryPosition(this.textRange, rangeContainerElement, true, false);\n          start = startBoundary.boundaryPosition; // An optimization used here is that if the start and end boundaries have the same parent element, the\n          // search scope for the end boundary can be limited to exclude the portion of the element that precedes\n          // the start boundary\n\n          end = getTextRangeBoundaryPosition(this.textRange, rangeContainerElement, false, false, startBoundary.nodeInfo).boundaryPosition;\n        }\n\n        this.setStart(start.node, start.offset);\n        this.setEnd(end.node, end.offset);\n      };\n\n      WrappedTextRange.prototype.getName = function () {\n        return \"WrappedTextRange\";\n      };\n\n      DomRange.copyComparisonConstants(WrappedTextRange);\n\n      var rangeToTextRange = function rangeToTextRange(range) {\n        if (range.collapsed) {\n          return createBoundaryTextRange(new DomPosition(range.startContainer, range.startOffset), true);\n        } else {\n          var startRange = createBoundaryTextRange(new DomPosition(range.startContainer, range.startOffset), true);\n          var endRange = createBoundaryTextRange(new DomPosition(range.endContainer, range.endOffset), false);\n          var textRange = getBody(DomRange.getRangeDocument(range)).createTextRange();\n          textRange.setEndPoint(\"StartToStart\", startRange);\n          textRange.setEndPoint(\"EndToEnd\", endRange);\n          return textRange;\n        }\n      };\n\n      WrappedTextRange.rangeToTextRange = rangeToTextRange;\n\n      WrappedTextRange.prototype.toTextRange = function () {\n        return rangeToTextRange(this);\n      };\n\n      api.WrappedTextRange = WrappedTextRange; // IE 9 and above have both implementations and Rangy makes both available. The next few lines sets which\n      // implementation to use by default.\n\n      if (!api.features.implementsDomRange || api.config.preferTextRange) {\n        // Add WrappedTextRange as the Range property of the global object to allow expression like Range.END_TO_END to work\n        var globalObj = function (f) {\n          return f(\"return this;\")();\n        }(Function);\n\n        if (typeof globalObj.Range == \"undefined\") {\n          globalObj.Range = WrappedTextRange;\n        }\n\n        api.createNativeRange = function (doc) {\n          doc = getContentDocument(doc, module, \"createNativeRange\");\n          return getBody(doc).createTextRange();\n        };\n\n        api.WrappedRange = WrappedTextRange;\n      }\n    }\n\n    api.createRange = function (doc) {\n      doc = getContentDocument(doc, module, \"createRange\");\n      return new api.WrappedRange(api.createNativeRange(doc));\n    };\n\n    api.createRangyRange = function (doc) {\n      doc = getContentDocument(doc, module, \"createRangyRange\");\n      return new DomRange(doc);\n    };\n\n    util.createAliasForDeprecatedMethod(api, \"createIframeRange\", \"createRange\");\n    util.createAliasForDeprecatedMethod(api, \"createIframeRangyRange\", \"createRangyRange\");\n    api.addShimListener(function (win) {\n      var doc = win.document;\n\n      if (typeof doc.createRange == \"undefined\") {\n        doc.createRange = function () {\n          return api.createRange(doc);\n        };\n      }\n\n      doc = win = null;\n    });\n  });\n  /*----------------------------------------------------------------------------------------------------------------*/\n\n  api.createCoreModule(\"WrappedSelection\", [\"DomRange\", \"WrappedRange\"], function (api, module) {\n    api.config.checkSelectionRanges = true;\n    var BOOLEAN = \"boolean\";\n    var NUMBER = \"number\";\n    var dom = api.dom;\n    var util = api.util;\n    var isHostMethod = util.isHostMethod;\n    var DomRange = api.DomRange;\n    var WrappedRange = api.WrappedRange;\n    var DOMException = api.DOMException;\n    var DomPosition = dom.DomPosition;\n    var getNativeSelection;\n    var selectionIsCollapsed;\n    var features = api.features;\n    var CONTROL = \"Control\";\n    var getDocument = dom.getDocument;\n    var getBody = dom.getBody;\n    var rangesEqual = DomRange.rangesEqual; // Utility function to support direction parameters in the API that may be a string (\"backward\", \"backwards\",\n    // \"forward\" or \"forwards\") or a Boolean (true for backwards).\n\n    function isDirectionBackward(dir) {\n      return typeof dir == \"string\" ? /^backward(s)?$/i.test(dir) : !!dir;\n    }\n\n    function getWindow(win, methodName) {\n      if (!win) {\n        return window;\n      } else if (dom.isWindow(win)) {\n        return win;\n      } else if (win instanceof WrappedSelection) {\n        return win.win;\n      } else {\n        var doc = dom.getContentDocument(win, module, methodName);\n        return dom.getWindow(doc);\n      }\n    }\n\n    function getWinSelection(winParam) {\n      return getWindow(winParam, \"getWinSelection\").getSelection();\n    }\n\n    function getDocSelection(winParam) {\n      return getWindow(winParam, \"getDocSelection\").document.selection;\n    }\n\n    function winSelectionIsBackward(sel) {\n      var backward = false;\n\n      if (sel.anchorNode) {\n        backward = dom.comparePoints(sel.anchorNode, sel.anchorOffset, sel.focusNode, sel.focusOffset) == 1;\n      }\n\n      return backward;\n    } // Test for the Range/TextRange and Selection features required\n    // Test for ability to retrieve selection\n\n\n    var implementsWinGetSelection = isHostMethod(window, \"getSelection\"),\n        implementsDocSelection = util.isHostObject(document, \"selection\");\n    features.implementsWinGetSelection = implementsWinGetSelection;\n    features.implementsDocSelection = implementsDocSelection;\n    var useDocumentSelection = implementsDocSelection && (!implementsWinGetSelection || api.config.preferTextRange);\n\n    if (useDocumentSelection) {\n      getNativeSelection = getDocSelection;\n\n      api.isSelectionValid = function (winParam) {\n        var doc = getWindow(winParam, \"isSelectionValid\").document,\n            nativeSel = doc.selection; // Check whether the selection TextRange is actually contained within the correct document\n\n        return nativeSel.type != \"None\" || getDocument(nativeSel.createRange().parentElement()) == doc;\n      };\n    } else if (implementsWinGetSelection) {\n      getNativeSelection = getWinSelection;\n\n      api.isSelectionValid = function () {\n        return true;\n      };\n    } else {\n      module.fail(\"Neither document.selection or window.getSelection() detected.\");\n      return false;\n    }\n\n    api.getNativeSelection = getNativeSelection;\n    var testSelection = getNativeSelection(); // In Firefox, the selection is null in an iframe with display: none. See issue #138.\n\n    if (!testSelection) {\n      module.fail(\"Native selection was null (possibly issue 138?)\");\n      return false;\n    }\n\n    var testRange = api.createNativeRange(document);\n    var body = getBody(document); // Obtaining a range from a selection\n\n    var selectionHasAnchorAndFocus = util.areHostProperties(testSelection, [\"anchorNode\", \"focusNode\", \"anchorOffset\", \"focusOffset\"]);\n    features.selectionHasAnchorAndFocus = selectionHasAnchorAndFocus; // Test for existence of native selection extend() method\n\n    var selectionHasExtend = isHostMethod(testSelection, \"extend\");\n    features.selectionHasExtend = selectionHasExtend; // Test if rangeCount exists\n\n    var selectionHasRangeCount = _typeof(testSelection.rangeCount) == NUMBER;\n    features.selectionHasRangeCount = selectionHasRangeCount;\n    var selectionSupportsMultipleRanges = false;\n    var collapsedNonEditableSelectionsSupported = true;\n    var addRangeBackwardToNative = selectionHasExtend ? function (nativeSelection, range) {\n      var doc = DomRange.getRangeDocument(range);\n      var endRange = api.createRange(doc);\n      endRange.collapseToPoint(range.endContainer, range.endOffset);\n      nativeSelection.addRange(getNativeRange(endRange));\n      nativeSelection.extend(range.startContainer, range.startOffset);\n    } : null;\n\n    if (util.areHostMethods(testSelection, [\"addRange\", \"getRangeAt\", \"removeAllRanges\"]) && _typeof(testSelection.rangeCount) == NUMBER && features.implementsDomRange) {\n      (function () {\n        // Previously an iframe was used but this caused problems in some circumstances in IE, so tests are\n        // performed on the current document's selection. See issue 109.\n        // Note also that if a selection previously existed, it is wiped and later restored by these tests. This\n        // will result in the selection direction begin reversed if the original selection was backwards and the\n        // browser does not support setting backwards selections (Internet Explorer, I'm looking at you).\n        var sel = window.getSelection();\n\n        if (sel) {\n          // Store the current selection\n          var originalSelectionRangeCount = sel.rangeCount;\n          var selectionHasMultipleRanges = originalSelectionRangeCount > 1;\n          var originalSelectionRanges = [];\n          var originalSelectionBackward = winSelectionIsBackward(sel);\n\n          for (var i = 0; i < originalSelectionRangeCount; ++i) {\n            originalSelectionRanges[i] = sel.getRangeAt(i);\n          } // Create some test elements\n\n\n          var testEl = dom.createTestElement(document, \"\", false);\n          var textNode = testEl.appendChild(document.createTextNode(\"\\xA0\\xA0\\xA0\")); // Test whether the native selection will allow a collapsed selection within a non-editable element\n\n          var r1 = document.createRange();\n          r1.setStart(textNode, 1);\n          r1.collapse(true);\n          sel.removeAllRanges();\n          sel.addRange(r1);\n          collapsedNonEditableSelectionsSupported = sel.rangeCount == 1;\n          sel.removeAllRanges(); // Test whether the native selection is capable of supporting multiple ranges.\n\n          if (!selectionHasMultipleRanges) {\n            // Doing the original feature test here in Chrome 36 (and presumably later versions) prints a\n            // console error of \"Discontiguous selection is not supported.\" that cannot be suppressed. There's\n            // nothing we can do about this while retaining the feature test so we have to resort to a browser\n            // sniff. I'm not happy about it. See\n            // https://code.google.com/p/chromium/issues/detail?id=399791\n            var chromeMatch = window.navigator.appVersion.match(/Chrome\\/(.*?) /);\n\n            if (chromeMatch && parseInt(chromeMatch[1]) >= 36) {\n              selectionSupportsMultipleRanges = false;\n            } else {\n              var r2 = r1.cloneRange();\n              r1.setStart(textNode, 0);\n              r2.setEnd(textNode, 3);\n              r2.setStart(textNode, 2);\n              sel.addRange(r1);\n              sel.addRange(r2);\n              selectionSupportsMultipleRanges = sel.rangeCount == 2;\n            }\n          } // Clean up\n\n\n          dom.removeNode(testEl);\n          sel.removeAllRanges();\n\n          for (i = 0; i < originalSelectionRangeCount; ++i) {\n            if (i == 0 && originalSelectionBackward) {\n              if (addRangeBackwardToNative) {\n                addRangeBackwardToNative(sel, originalSelectionRanges[i]);\n              } else {\n                api.warn(\"Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend\");\n                sel.addRange(originalSelectionRanges[i]);\n              }\n            } else {\n              sel.addRange(originalSelectionRanges[i]);\n            }\n          }\n        }\n      })();\n    }\n\n    features.selectionSupportsMultipleRanges = selectionSupportsMultipleRanges;\n    features.collapsedNonEditableSelectionsSupported = collapsedNonEditableSelectionsSupported; // ControlRanges\n\n    var implementsControlRange = false,\n        testControlRange;\n\n    if (body && isHostMethod(body, \"createControlRange\")) {\n      testControlRange = body.createControlRange();\n\n      if (util.areHostProperties(testControlRange, [\"item\", \"add\"])) {\n        implementsControlRange = true;\n      }\n    }\n\n    features.implementsControlRange = implementsControlRange; // Selection collapsedness\n\n    if (selectionHasAnchorAndFocus) {\n      selectionIsCollapsed = function selectionIsCollapsed(sel) {\n        return sel.anchorNode === sel.focusNode && sel.anchorOffset === sel.focusOffset;\n      };\n    } else {\n      selectionIsCollapsed = function selectionIsCollapsed(sel) {\n        return sel.rangeCount ? sel.getRangeAt(sel.rangeCount - 1).collapsed : false;\n      };\n    }\n\n    function updateAnchorAndFocusFromRange(sel, range, backward) {\n      var anchorPrefix = backward ? \"end\" : \"start\",\n          focusPrefix = backward ? \"start\" : \"end\";\n      sel.anchorNode = range[anchorPrefix + \"Container\"];\n      sel.anchorOffset = range[anchorPrefix + \"Offset\"];\n      sel.focusNode = range[focusPrefix + \"Container\"];\n      sel.focusOffset = range[focusPrefix + \"Offset\"];\n    }\n\n    function updateAnchorAndFocusFromNativeSelection(sel) {\n      var nativeSel = sel.nativeSelection;\n      sel.anchorNode = nativeSel.anchorNode;\n      sel.anchorOffset = nativeSel.anchorOffset;\n      sel.focusNode = nativeSel.focusNode;\n      sel.focusOffset = nativeSel.focusOffset;\n    }\n\n    function updateEmptySelection(sel) {\n      sel.anchorNode = sel.focusNode = null;\n      sel.anchorOffset = sel.focusOffset = 0;\n      sel.rangeCount = 0;\n      sel.isCollapsed = true;\n      sel._ranges.length = 0;\n    }\n\n    function getNativeRange(range) {\n      var nativeRange;\n\n      if (range instanceof DomRange) {\n        nativeRange = api.createNativeRange(range.getDocument());\n        nativeRange.setEnd(range.endContainer, range.endOffset);\n        nativeRange.setStart(range.startContainer, range.startOffset);\n      } else if (range instanceof WrappedRange) {\n        nativeRange = range.nativeRange;\n      } else if (features.implementsDomRange && range instanceof dom.getWindow(range.startContainer).Range) {\n        nativeRange = range;\n      }\n\n      return nativeRange;\n    }\n\n    function rangeContainsSingleElement(rangeNodes) {\n      if (!rangeNodes.length || rangeNodes[0].nodeType != 1) {\n        return false;\n      }\n\n      for (var i = 1, len = rangeNodes.length; i < len; ++i) {\n        if (!dom.isAncestorOf(rangeNodes[0], rangeNodes[i])) {\n          return false;\n        }\n      }\n\n      return true;\n    }\n\n    function getSingleElementFromRange(range) {\n      var nodes = range.getNodes();\n\n      if (!rangeContainsSingleElement(nodes)) {\n        throw module.createError(\"getSingleElementFromRange: range \" + range.inspect() + \" did not consist of a single element\");\n      }\n\n      return nodes[0];\n    } // Simple, quick test which only needs to distinguish between a TextRange and a ControlRange\n\n\n    function isTextRange(range) {\n      return !!range && typeof range.text != \"undefined\";\n    }\n\n    function updateFromTextRange(sel, range) {\n      // Create a Range from the selected TextRange\n      var wrappedRange = new WrappedRange(range);\n      sel._ranges = [wrappedRange];\n      updateAnchorAndFocusFromRange(sel, wrappedRange, false);\n      sel.rangeCount = 1;\n      sel.isCollapsed = wrappedRange.collapsed;\n    }\n\n    function updateControlSelection(sel) {\n      // Update the wrapped selection based on what's now in the native selection\n      sel._ranges.length = 0;\n\n      if (sel.docSelection.type == \"None\") {\n        updateEmptySelection(sel);\n      } else {\n        var controlRange = sel.docSelection.createRange();\n\n        if (isTextRange(controlRange)) {\n          // This case (where the selection type is \"Control\" and calling createRange() on the selection returns\n          // a TextRange) can happen in IE 9. It happens, for example, when all elements in the selected\n          // ControlRange have been removed from the ControlRange and removed from the document.\n          updateFromTextRange(sel, controlRange);\n        } else {\n          sel.rangeCount = controlRange.length;\n          var range,\n              doc = getDocument(controlRange.item(0));\n\n          for (var i = 0; i < sel.rangeCount; ++i) {\n            range = api.createRange(doc);\n            range.selectNode(controlRange.item(i));\n\n            sel._ranges.push(range);\n          }\n\n          sel.isCollapsed = sel.rangeCount == 1 && sel._ranges[0].collapsed;\n          updateAnchorAndFocusFromRange(sel, sel._ranges[sel.rangeCount - 1], false);\n        }\n      }\n    }\n\n    function addRangeToControlSelection(sel, range) {\n      var controlRange = sel.docSelection.createRange();\n      var rangeElement = getSingleElementFromRange(range); // Create a new ControlRange containing all the elements in the selected ControlRange plus the element\n      // contained by the supplied range\n\n      var doc = getDocument(controlRange.item(0));\n      var newControlRange = getBody(doc).createControlRange();\n\n      for (var i = 0, len = controlRange.length; i < len; ++i) {\n        newControlRange.add(controlRange.item(i));\n      }\n\n      try {\n        newControlRange.add(rangeElement);\n      } catch (ex) {\n        throw module.createError(\"addRange(): Element within the specified Range could not be added to control selection (does it have layout?)\");\n      }\n\n      newControlRange.select(); // Update the wrapped selection based on what's now in the native selection\n\n      updateControlSelection(sel);\n    }\n\n    var getSelectionRangeAt;\n\n    if (isHostMethod(testSelection, \"getRangeAt\")) {\n      // try/catch is present because getRangeAt() must have thrown an error in some browser and some situation.\n      // Unfortunately, I didn't write a comment about the specifics and am now scared to take it out. Let that be a\n      // lesson to us all, especially me.\n      getSelectionRangeAt = function getSelectionRangeAt(sel, index) {\n        try {\n          return sel.getRangeAt(index);\n        } catch (ex) {\n          return null;\n        }\n      };\n    } else if (selectionHasAnchorAndFocus) {\n      getSelectionRangeAt = function getSelectionRangeAt(sel) {\n        var doc = getDocument(sel.anchorNode);\n        var range = api.createRange(doc);\n        range.setStartAndEnd(sel.anchorNode, sel.anchorOffset, sel.focusNode, sel.focusOffset); // Handle the case when the selection was selected backwards (from the end to the start in the\n        // document)\n\n        if (range.collapsed !== this.isCollapsed) {\n          range.setStartAndEnd(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset);\n        }\n\n        return range;\n      };\n    }\n\n    function WrappedSelection(selection, docSelection, win) {\n      this.nativeSelection = selection;\n      this.docSelection = docSelection;\n      this._ranges = [];\n      this.win = win;\n      this.refresh();\n    }\n\n    WrappedSelection.prototype = api.selectionPrototype;\n\n    function deleteProperties(sel) {\n      sel.win = sel.anchorNode = sel.focusNode = sel._ranges = null;\n      sel.rangeCount = sel.anchorOffset = sel.focusOffset = 0;\n      sel.detached = true;\n    }\n\n    var cachedRangySelections = [];\n\n    function actOnCachedSelection(win, action) {\n      var i = cachedRangySelections.length,\n          cached,\n          sel;\n\n      while (i--) {\n        cached = cachedRangySelections[i];\n        sel = cached.selection;\n\n        if (action == \"deleteAll\") {\n          deleteProperties(sel);\n        } else if (cached.win == win) {\n          if (action == \"delete\") {\n            cachedRangySelections.splice(i, 1);\n            return true;\n          } else {\n            return sel;\n          }\n        }\n      }\n\n      if (action == \"deleteAll\") {\n        cachedRangySelections.length = 0;\n      }\n\n      return null;\n    }\n\n    var getSelection = function getSelection(win) {\n      // Check if the parameter is a Rangy Selection object\n      if (win && win instanceof WrappedSelection) {\n        win.refresh();\n        return win;\n      }\n\n      win = getWindow(win, \"getNativeSelection\");\n      var sel = actOnCachedSelection(win);\n      var nativeSel = getNativeSelection(win),\n          docSel = implementsDocSelection ? getDocSelection(win) : null;\n\n      if (sel) {\n        sel.nativeSelection = nativeSel;\n        sel.docSelection = docSel;\n        sel.refresh();\n      } else {\n        sel = new WrappedSelection(nativeSel, docSel, win);\n        cachedRangySelections.push({\n          win: win,\n          selection: sel\n        });\n      }\n\n      return sel;\n    };\n\n    api.getSelection = getSelection;\n    util.createAliasForDeprecatedMethod(api, \"getIframeSelection\", \"getSelection\");\n    var selProto = WrappedSelection.prototype;\n\n    function createControlSelection(sel, ranges) {\n      // Ensure that the selection becomes of type \"Control\"\n      var doc = getDocument(ranges[0].startContainer);\n      var controlRange = getBody(doc).createControlRange();\n\n      for (var i = 0, el, len = ranges.length; i < len; ++i) {\n        el = getSingleElementFromRange(ranges[i]);\n\n        try {\n          controlRange.add(el);\n        } catch (ex) {\n          throw module.createError(\"setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)\");\n        }\n      }\n\n      controlRange.select(); // Update the wrapped selection based on what's now in the native selection\n\n      updateControlSelection(sel);\n    } // Selecting a range\n\n\n    if (!useDocumentSelection && selectionHasAnchorAndFocus && util.areHostMethods(testSelection, [\"removeAllRanges\", \"addRange\"])) {\n      selProto.removeAllRanges = function () {\n        this.nativeSelection.removeAllRanges();\n        updateEmptySelection(this);\n      };\n\n      var addRangeBackward = function addRangeBackward(sel, range) {\n        addRangeBackwardToNative(sel.nativeSelection, range);\n        sel.refresh();\n      };\n\n      if (selectionHasRangeCount) {\n        selProto.addRange = function (range, direction) {\n          if (implementsControlRange && implementsDocSelection && this.docSelection.type == CONTROL) {\n            addRangeToControlSelection(this, range);\n          } else {\n            if (isDirectionBackward(direction) && selectionHasExtend) {\n              addRangeBackward(this, range);\n            } else {\n              var previousRangeCount;\n\n              if (selectionSupportsMultipleRanges) {\n                previousRangeCount = this.rangeCount;\n              } else {\n                this.removeAllRanges();\n                previousRangeCount = 0;\n              } // Clone the native range so that changing the selected range does not affect the selection.\n              // This is contrary to the spec but is the only way to achieve consistency between browsers. See\n              // issue 80.\n\n\n              var clonedNativeRange = getNativeRange(range).cloneRange();\n\n              try {\n                this.nativeSelection.addRange(clonedNativeRange);\n              } catch (ex) {} // Check whether adding the range was successful\n\n\n              this.rangeCount = this.nativeSelection.rangeCount;\n\n              if (this.rangeCount == previousRangeCount + 1) {\n                // The range was added successfully\n                // Check whether the range that we added to the selection is reflected in the last range extracted from\n                // the selection\n                if (api.config.checkSelectionRanges) {\n                  var nativeRange = getSelectionRangeAt(this.nativeSelection, this.rangeCount - 1);\n\n                  if (nativeRange && !rangesEqual(nativeRange, range)) {\n                    // Happens in WebKit with, for example, a selection placed at the start of a text node\n                    range = new WrappedRange(nativeRange);\n                  }\n                }\n\n                this._ranges[this.rangeCount - 1] = range;\n                updateAnchorAndFocusFromRange(this, range, selectionIsBackward(this.nativeSelection));\n                this.isCollapsed = selectionIsCollapsed(this);\n              } else {\n                // The range was not added successfully. The simplest thing is to refresh\n                this.refresh();\n              }\n            }\n          }\n        };\n      } else {\n        selProto.addRange = function (range, direction) {\n          if (isDirectionBackward(direction) && selectionHasExtend) {\n            addRangeBackward(this, range);\n          } else {\n            this.nativeSelection.addRange(getNativeRange(range));\n            this.refresh();\n          }\n        };\n      }\n\n      selProto.setRanges = function (ranges) {\n        if (implementsControlRange && implementsDocSelection && ranges.length > 1) {\n          createControlSelection(this, ranges);\n        } else {\n          this.removeAllRanges();\n\n          for (var i = 0, len = ranges.length; i < len; ++i) {\n            this.addRange(ranges[i]);\n          }\n        }\n      };\n    } else if (isHostMethod(testSelection, \"empty\") && isHostMethod(testRange, \"select\") && implementsControlRange && useDocumentSelection) {\n      selProto.removeAllRanges = function () {\n        // Added try/catch as fix for issue #21\n        try {\n          this.docSelection.empty(); // Check for empty() not working (issue #24)\n\n          if (this.docSelection.type != \"None\") {\n            // Work around failure to empty a control selection by instead selecting a TextRange and then\n            // calling empty()\n            var doc;\n\n            if (this.anchorNode) {\n              doc = getDocument(this.anchorNode);\n            } else if (this.docSelection.type == CONTROL) {\n              var controlRange = this.docSelection.createRange();\n\n              if (controlRange.length) {\n                doc = getDocument(controlRange.item(0));\n              }\n            }\n\n            if (doc) {\n              var textRange = getBody(doc).createTextRange();\n              textRange.select();\n              this.docSelection.empty();\n            }\n          }\n        } catch (ex) {}\n\n        updateEmptySelection(this);\n      };\n\n      selProto.addRange = function (range) {\n        if (this.docSelection.type == CONTROL) {\n          addRangeToControlSelection(this, range);\n        } else {\n          api.WrappedTextRange.rangeToTextRange(range).select();\n          this._ranges[0] = range;\n          this.rangeCount = 1;\n          this.isCollapsed = this._ranges[0].collapsed;\n          updateAnchorAndFocusFromRange(this, range, false);\n        }\n      };\n\n      selProto.setRanges = function (ranges) {\n        this.removeAllRanges();\n        var rangeCount = ranges.length;\n\n        if (rangeCount > 1) {\n          createControlSelection(this, ranges);\n        } else if (rangeCount) {\n          this.addRange(ranges[0]);\n        }\n      };\n    } else {\n      module.fail(\"No means of selecting a Range or TextRange was found\");\n      return false;\n    }\n\n    selProto.getRangeAt = function (index) {\n      if (index < 0 || index >= this.rangeCount) {\n        throw new DOMException(\"INDEX_SIZE_ERR\");\n      } else {\n        // Clone the range to preserve selection-range independence. See issue 80.\n        return this._ranges[index].cloneRange();\n      }\n    };\n\n    var refreshSelection;\n\n    if (useDocumentSelection) {\n      refreshSelection = function refreshSelection(sel) {\n        var range;\n\n        if (api.isSelectionValid(sel.win)) {\n          range = sel.docSelection.createRange();\n        } else {\n          range = getBody(sel.win.document).createTextRange();\n          range.collapse(true);\n        }\n\n        if (sel.docSelection.type == CONTROL) {\n          updateControlSelection(sel);\n        } else if (isTextRange(range)) {\n          updateFromTextRange(sel, range);\n        } else {\n          updateEmptySelection(sel);\n        }\n      };\n    } else if (isHostMethod(testSelection, \"getRangeAt\") && _typeof(testSelection.rangeCount) == NUMBER) {\n      refreshSelection = function refreshSelection(sel) {\n        if (implementsControlRange && implementsDocSelection && sel.docSelection.type == CONTROL) {\n          updateControlSelection(sel);\n        } else {\n          sel._ranges.length = sel.rangeCount = sel.nativeSelection.rangeCount;\n\n          if (sel.rangeCount) {\n            for (var i = 0, len = sel.rangeCount; i < len; ++i) {\n              sel._ranges[i] = new api.WrappedRange(sel.nativeSelection.getRangeAt(i));\n            }\n\n            updateAnchorAndFocusFromRange(sel, sel._ranges[sel.rangeCount - 1], selectionIsBackward(sel.nativeSelection));\n            sel.isCollapsed = selectionIsCollapsed(sel);\n          } else {\n            updateEmptySelection(sel);\n          }\n        }\n      };\n    } else if (selectionHasAnchorAndFocus && _typeof(testSelection.isCollapsed) == BOOLEAN && _typeof(testRange.collapsed) == BOOLEAN && features.implementsDomRange) {\n      refreshSelection = function refreshSelection(sel) {\n        var range,\n            nativeSel = sel.nativeSelection;\n\n        if (nativeSel.anchorNode) {\n          range = getSelectionRangeAt(nativeSel, 0);\n          sel._ranges = [range];\n          sel.rangeCount = 1;\n          updateAnchorAndFocusFromNativeSelection(sel);\n          sel.isCollapsed = selectionIsCollapsed(sel);\n        } else {\n          updateEmptySelection(sel);\n        }\n      };\n    } else {\n      module.fail(\"No means of obtaining a Range or TextRange from the user's selection was found\");\n      return false;\n    }\n\n    selProto.refresh = function (checkForChanges) {\n      var oldRanges = checkForChanges ? this._ranges.slice(0) : null;\n      var oldAnchorNode = this.anchorNode,\n          oldAnchorOffset = this.anchorOffset;\n      refreshSelection(this);\n\n      if (checkForChanges) {\n        // Check the range count first\n        var i = oldRanges.length;\n\n        if (i != this._ranges.length) {\n          return true;\n        } // Now check the direction. Checking the anchor position is the same is enough since we're checking all the\n        // ranges after this\n\n\n        if (this.anchorNode != oldAnchorNode || this.anchorOffset != oldAnchorOffset) {\n          return true;\n        } // Finally, compare each range in turn\n\n\n        while (i--) {\n          if (!rangesEqual(oldRanges[i], this._ranges[i])) {\n            return true;\n          }\n        }\n\n        return false;\n      }\n    }; // Removal of a single range\n\n\n    var removeRangeManually = function removeRangeManually(sel, range) {\n      var ranges = sel.getAllRanges();\n      sel.removeAllRanges();\n\n      for (var i = 0, len = ranges.length; i < len; ++i) {\n        if (!rangesEqual(range, ranges[i])) {\n          sel.addRange(ranges[i]);\n        }\n      }\n\n      if (!sel.rangeCount) {\n        updateEmptySelection(sel);\n      }\n    };\n\n    if (implementsControlRange && implementsDocSelection) {\n      selProto.removeRange = function (range) {\n        if (this.docSelection.type == CONTROL) {\n          var controlRange = this.docSelection.createRange();\n          var rangeElement = getSingleElementFromRange(range); // Create a new ControlRange containing all the elements in the selected ControlRange minus the\n          // element contained by the supplied range\n\n          var doc = getDocument(controlRange.item(0));\n          var newControlRange = getBody(doc).createControlRange();\n          var el,\n              removed = false;\n\n          for (var i = 0, len = controlRange.length; i < len; ++i) {\n            el = controlRange.item(i);\n\n            if (el !== rangeElement || removed) {\n              newControlRange.add(controlRange.item(i));\n            } else {\n              removed = true;\n            }\n          }\n\n          newControlRange.select(); // Update the wrapped selection based on what's now in the native selection\n\n          updateControlSelection(this);\n        } else {\n          removeRangeManually(this, range);\n        }\n      };\n    } else {\n      selProto.removeRange = function (range) {\n        removeRangeManually(this, range);\n      };\n    } // Detecting if a selection is backward\n\n\n    var selectionIsBackward;\n\n    if (!useDocumentSelection && selectionHasAnchorAndFocus && features.implementsDomRange) {\n      selectionIsBackward = winSelectionIsBackward;\n\n      selProto.isBackward = function () {\n        return selectionIsBackward(this);\n      };\n    } else {\n      selectionIsBackward = selProto.isBackward = function () {\n        return false;\n      };\n    } // Create an alias for backwards compatibility. From 1.3, everything is \"backward\" rather than \"backwards\"\n\n\n    selProto.isBackwards = selProto.isBackward; // Selection stringifier\n    // This is conformant to the old HTML5 selections draft spec but differs from WebKit and Mozilla's implementation.\n    // The current spec does not yet define this method.\n\n    selProto.toString = function () {\n      var rangeTexts = [];\n\n      for (var i = 0, len = this.rangeCount; i < len; ++i) {\n        rangeTexts[i] = \"\" + this._ranges[i];\n      }\n\n      return rangeTexts.join(\"\");\n    };\n\n    function assertNodeInSameDocument(sel, node) {\n      if (sel.win.document != getDocument(node)) {\n        throw new DOMException(\"WRONG_DOCUMENT_ERR\");\n      }\n    } // No current browser conforms fully to the spec for this method, so Rangy's own method is always used\n\n\n    selProto.collapse = function (node, offset) {\n      assertNodeInSameDocument(this, node);\n      var range = api.createRange(node);\n      range.collapseToPoint(node, offset);\n      this.setSingleRange(range);\n      this.isCollapsed = true;\n    };\n\n    selProto.collapseToStart = function () {\n      if (this.rangeCount) {\n        var range = this._ranges[0];\n        this.collapse(range.startContainer, range.startOffset);\n      } else {\n        throw new DOMException(\"INVALID_STATE_ERR\");\n      }\n    };\n\n    selProto.collapseToEnd = function () {\n      if (this.rangeCount) {\n        var range = this._ranges[this.rangeCount - 1];\n        this.collapse(range.endContainer, range.endOffset);\n      } else {\n        throw new DOMException(\"INVALID_STATE_ERR\");\n      }\n    }; // The spec is very specific on how selectAllChildren should be implemented and not all browsers implement it as\n    // specified so the native implementation is never used by Rangy.\n\n\n    selProto.selectAllChildren = function (node) {\n      assertNodeInSameDocument(this, node);\n      var range = api.createRange(node);\n      range.selectNodeContents(node);\n      this.setSingleRange(range);\n    };\n\n    selProto.deleteFromDocument = function () {\n      // Sepcial behaviour required for IE's control selections\n      if (implementsControlRange && implementsDocSelection && this.docSelection.type == CONTROL) {\n        var controlRange = this.docSelection.createRange();\n        var element;\n\n        while (controlRange.length) {\n          element = controlRange.item(0);\n          controlRange.remove(element);\n          dom.removeNode(element);\n        }\n\n        this.refresh();\n      } else if (this.rangeCount) {\n        var ranges = this.getAllRanges();\n\n        if (ranges.length) {\n          this.removeAllRanges();\n\n          for (var i = 0, len = ranges.length; i < len; ++i) {\n            ranges[i].deleteContents();\n          } // The spec says nothing about what the selection should contain after calling deleteContents on each\n          // range. Firefox moves the selection to where the final selected range was, so we emulate that\n\n\n          this.addRange(ranges[len - 1]);\n        }\n      }\n    }; // The following are non-standard extensions\n\n\n    selProto.eachRange = function (func, returnValue) {\n      for (var i = 0, len = this._ranges.length; i < len; ++i) {\n        if (func(this.getRangeAt(i))) {\n          return returnValue;\n        }\n      }\n    };\n\n    selProto.getAllRanges = function () {\n      var ranges = [];\n      this.eachRange(function (range) {\n        ranges.push(range);\n      });\n      return ranges;\n    };\n\n    selProto.setSingleRange = function (range, direction) {\n      this.removeAllRanges();\n      this.addRange(range, direction);\n    };\n\n    selProto.callMethodOnEachRange = function (methodName, params) {\n      var results = [];\n      this.eachRange(function (range) {\n        results.push(range[methodName].apply(range, params || []));\n      });\n      return results;\n    };\n\n    function createStartOrEndSetter(isStart) {\n      return function (node, offset) {\n        var range;\n\n        if (this.rangeCount) {\n          range = this.getRangeAt(0);\n          range[\"set\" + (isStart ? \"Start\" : \"End\")](node, offset);\n        } else {\n          range = api.createRange(this.win.document);\n          range.setStartAndEnd(node, offset);\n        }\n\n        this.setSingleRange(range, this.isBackward());\n      };\n    }\n\n    selProto.setStart = createStartOrEndSetter(true);\n    selProto.setEnd = createStartOrEndSetter(false); // Add select() method to Range prototype. Any existing selection will be removed.\n\n    api.rangePrototype.select = function (direction) {\n      getSelection(this.getDocument()).setSingleRange(this, direction);\n    };\n\n    selProto.changeEachRange = function (func) {\n      var ranges = [];\n      var backward = this.isBackward();\n      this.eachRange(function (range) {\n        func(range);\n        ranges.push(range);\n      });\n      this.removeAllRanges();\n\n      if (backward && ranges.length == 1) {\n        this.addRange(ranges[0], \"backward\");\n      } else {\n        this.setRanges(ranges);\n      }\n    };\n\n    selProto.containsNode = function (node, allowPartial) {\n      return this.eachRange(function (range) {\n        return range.containsNode(node, allowPartial);\n      }, true) || false;\n    };\n\n    selProto.getBookmark = function (containerNode) {\n      return {\n        backward: this.isBackward(),\n        rangeBookmarks: this.callMethodOnEachRange(\"getBookmark\", [containerNode])\n      };\n    };\n\n    selProto.moveToBookmark = function (bookmark) {\n      var selRanges = [];\n\n      for (var i = 0, rangeBookmark, range; rangeBookmark = bookmark.rangeBookmarks[i++];) {\n        range = api.createRange(this.win);\n        range.moveToBookmark(rangeBookmark);\n        selRanges.push(range);\n      }\n\n      if (bookmark.backward) {\n        this.setSingleRange(selRanges[0], \"backward\");\n      } else {\n        this.setRanges(selRanges);\n      }\n    };\n\n    selProto.saveRanges = function () {\n      return {\n        backward: this.isBackward(),\n        ranges: this.callMethodOnEachRange(\"cloneRange\")\n      };\n    };\n\n    selProto.restoreRanges = function (selRanges) {\n      this.removeAllRanges();\n\n      for (var i = 0, range; range = selRanges.ranges[i]; ++i) {\n        this.addRange(range, selRanges.backward && i == 0);\n      }\n    };\n\n    selProto.toHtml = function () {\n      var rangeHtmls = [];\n      this.eachRange(function (range) {\n        rangeHtmls.push(DomRange.toHtml(range));\n      });\n      return rangeHtmls.join(\"\");\n    };\n\n    if (features.implementsTextRange) {\n      selProto.getNativeTextRange = function () {\n        var sel, textRange;\n\n        if (sel = this.docSelection) {\n          var range = sel.createRange();\n\n          if (isTextRange(range)) {\n            return range;\n          } else {\n            throw module.createError(\"getNativeTextRange: selection is a control selection\");\n          }\n        } else if (this.rangeCount > 0) {\n          return api.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));\n        } else {\n          throw module.createError(\"getNativeTextRange: selection contains no range\");\n        }\n      };\n    }\n\n    function inspect(sel) {\n      var rangeInspects = [];\n      var anchor = new DomPosition(sel.anchorNode, sel.anchorOffset);\n      var focus = new DomPosition(sel.focusNode, sel.focusOffset);\n      var name = typeof sel.getName == \"function\" ? sel.getName() : \"Selection\";\n\n      if (typeof sel.rangeCount != \"undefined\") {\n        for (var i = 0, len = sel.rangeCount; i < len; ++i) {\n          rangeInspects[i] = DomRange.inspect(sel.getRangeAt(i));\n        }\n      }\n\n      return \"[\" + name + \"(Ranges: \" + rangeInspects.join(\", \") + \")(anchor: \" + anchor.inspect() + \", focus: \" + focus.inspect() + \"]\";\n    }\n\n    selProto.getName = function () {\n      return \"WrappedSelection\";\n    };\n\n    selProto.inspect = function () {\n      return inspect(this);\n    };\n\n    selProto.detach = function () {\n      actOnCachedSelection(this.win, \"delete\");\n      deleteProperties(this);\n    };\n\n    WrappedSelection.detachAll = function () {\n      actOnCachedSelection(null, \"deleteAll\");\n    };\n\n    WrappedSelection.inspect = inspect;\n    WrappedSelection.isDirectionBackward = isDirectionBackward;\n    api.Selection = WrappedSelection;\n    api.selectionPrototype = selProto;\n    api.addShimListener(function (win) {\n      if (typeof win.getSelection == \"undefined\") {\n        win.getSelection = function () {\n          return getSelection(win);\n        };\n      }\n\n      win = null;\n    });\n  });\n  /*----------------------------------------------------------------------------------------------------------------*/\n\n  api.createModule(\"TextCommands\", [\"WrappedSelection\"], function (api, module) {\n    var dom = api.dom;\n    var tagName = \"span\",\n        COMPLEX = \"complex\",\n        COMPLEX = \"complex\",\n        BOOLEAN = \"boolean\",\n        UNDEF = \"undefined\";\n\n    function trim(str) {\n      return str.replace(/^\\s\\s*/, \"\").replace(/\\s\\s*$/, \"\");\n    }\n\n    function hasClass(el, className) {\n      return el.className && new RegExp(\"(?:^|\\\\s)\" + className + \"(?:\\\\s|$)\").test(el.className);\n    }\n\n    function addClass(el, className) {\n      if (el.className) {\n        if (!hasClass(el, className)) {\n          el.className += \" \" + className;\n        }\n      } else {\n        el.className = className;\n      }\n    }\n\n    var removeClass = function () {\n      function replacer(matched, whitespaceBefore, whitespaceAfter) {\n        return whitespaceBefore && whitespaceAfter ? \" \" : \"\";\n      }\n\n      return function (el, className) {\n        if (el.className) {\n          el.className = el.className.replace(new RegExp(\"(?:^|\\\\s)\" + className + \"(?:\\\\s|$)\"), replacer);\n        }\n      };\n    }();\n\n    function getSortedClassName(el) {\n      return el.className.split(/\\s+/).sort().join(\" \");\n    }\n\n    function hasSameClasses(el1, el2) {\n      return getSortedClassName(el1) == getSortedClassName(el2);\n    }\n\n    function replaceWithOwnChildren(el) {\n      var parent = el.parentNode;\n\n      while (el.hasChildNodes()) {\n        parent.insertBefore(el.firstChild, el);\n      }\n\n      parent.removeChild(el);\n    }\n    /*\r\n        function normalize(node) {\r\n            var child = node.firstChild, nextChild;\r\n            while (child) {\r\n                if (child.nodeType == 3) {\r\n                    while ((nextChild = child.nextSibling) && nextChild.nodeType == 3) {\r\n                        child.appendData(nextChild.data);\r\n                        node.removeChild(nextChild);\r\n                    }\r\n                } else {\r\n                    normalize(child);\r\n                }\r\n                child = child.nextSibling;\r\n            }\r\n        }\r\n    */\n\n\n    function elementsHaveSameNonClassAttributes(el1, el2) {\n      if (el1.attributes.length != el2.attributes.length) return false;\n\n      for (var i = 0, len = el1.attributes.length, attr1, attr2, name; i < len; ++i) {\n        attr1 = el1.attributes[i];\n        name = attr1.name;\n\n        if (name != \"class\") {\n          attr2 = el2.attributes.getNamedItem(name);\n          if (attr1.specified != attr2.specified) return false;\n          if (attr1.specified && attr1.nodeValue !== attr2.nodeValue) return false;\n        }\n      }\n\n      return true;\n    }\n\n    function elementHasNonClassAttributes(el) {\n      for (var i = 0, len = el.attributes.length; i < len; ++i) {\n        if (el.attributes[i].specified && el.attributes[i].name != \"class\") {\n          return true;\n        }\n      }\n\n      return false;\n    }\n\n    function isSplitPoint(node, offset) {\n      if (dom.isCharacterDataNode(node)) {\n        if (offset == 0) {\n          return !!node.previousSibling;\n        } else if (offset == node.length) {\n          return !!node.nextSibling;\n        } else {\n          return true;\n        }\n      }\n\n      return offset > 0 && offset < node.childNodes.length;\n    }\n\n    function splitNodeAt(node, descendantNode, descendantOffset) {\n      var newNode;\n\n      if (dom.isCharacterDataNode(descendantNode)) {\n        if (descendantOffset == 0) {\n          descendantOffset = dom.getNodeIndex(descendantNode);\n          descendantNode = descendantNode.parentNode;\n        } else if (descendantOffset == descendantNode.length) {\n          descendantOffset = dom.getNodeIndex(descendantNode) + 1;\n          descendantNode = descendantNode.parentNode;\n        } else {\n          newNode = dom.splitDataNode(descendantNode, descendantOffset);\n        }\n      }\n\n      if (!newNode) {\n        newNode = descendantNode.cloneNode(false);\n\n        if (newNode.id) {\n          newNode.removeAttribute(\"id\");\n        }\n\n        var child;\n\n        while (child = descendantNode.childNodes[descendantOffset]) {\n          newNode.appendChild(child);\n        }\n\n        dom.insertAfter(newNode, descendantNode);\n      }\n\n      return descendantNode == node ? newNode : splitNodeAt(node, newNode.parentNode, dom.getNodeIndex(newNode));\n    }\n\n    function areElementsMergeable(el1, el2) {\n      return el1.tagName == el2.tagName && hasSameClasses(el1, el2) && elementsHaveSameNonClassAttributes(el1, el2);\n    }\n\n    function getAdjacentMergeableTextNode(node, forward) {\n      var isTextNode = node.nodeType == 3;\n      var el = isTextNode ? node.parentNode : node;\n      var adjacentNode;\n      var propName = forward ? \"nextSibling\" : \"previousSibling\";\n\n      if (isTextNode) {\n        // Can merge if the node's previous/next sibling is a text node\n        adjacentNode = node[propName];\n\n        if (adjacentNode && adjacentNode.nodeType == 3) {\n          return adjacentNode;\n        }\n      } else {\n        // Compare element with its sibling\n        adjacentNode = el[propName];\n\n        if (adjacentNode && areElementsMergeable(node, adjacentNode)) {\n          return adjacentNode[forward ? \"firstChild\" : \"lastChild\"];\n        }\n      }\n\n      return null;\n    }\n\n    function Merge(firstNode) {\n      this.isElementMerge = firstNode.nodeType == 1;\n      this.firstTextNode = this.isElementMerge ? firstNode.lastChild : firstNode;\n\n      if (this.isElementMerge) {\n        this.sortedClasses = getSortedClassName(firstNode);\n      }\n\n      this.textNodes = [this.firstTextNode];\n    }\n\n    Merge.prototype = {\n      doMerge: function doMerge() {\n        var textParts = [],\n            textNode,\n            parent,\n            text;\n\n        for (var i = 0, len = this.textNodes.length; i < len; ++i) {\n          textNode = this.textNodes[i];\n          parent = textNode.parentNode;\n          textParts[i] = textNode.data;\n\n          if (i) {\n            parent.removeChild(textNode);\n\n            if (!parent.hasChildNodes()) {\n              parent.parentNode.removeChild(parent);\n            }\n          }\n        }\n\n        this.firstTextNode.data = text = textParts.join(\"\");\n        return text;\n      },\n      getLength: function getLength() {\n        var i = this.textNodes.length,\n            len = 0;\n\n        while (i--) {\n          len += this.textNodes[i].length;\n        }\n\n        return len;\n      },\n      toString: function toString() {\n        var textParts = [];\n\n        for (var i = 0, len = this.textNodes.length; i < len; ++i) {\n          textParts[i] = \"'\" + this.textNodes[i].data + \"'\";\n        }\n\n        return \"[Merge(\" + textParts.join(\",\") + \")]\";\n      }\n    };\n\n    function TextCommand(name, options) {\n      this.name = name;\n\n      if (_typeof(options) == \"object\") {\n        for (var i in options) {\n          if (options.hasOwnProperty(i)) {\n            this[i] = options[i];\n          }\n        }\n      }\n    }\n\n    TextCommand.prototype = {\n      type: BOOLEAN,\n      normalize: true,\n      applyToAnyTagName: true,\n      tagNames: [\"span\"],\n      // Normalizes nodes after applying a CSS class to a Range.\n      postApply: function postApply(textNodes, range) {\n        var firstNode = textNodes[0],\n            lastNode = textNodes[textNodes.length - 1];\n        var merges = [],\n            currentMerge;\n        var rangeStartNode = firstNode,\n            rangeEndNode = lastNode;\n        var rangeStartOffset = 0,\n            rangeEndOffset = lastNode.length;\n        var textNode, precedingTextNode;\n\n        for (var i = 0, len = textNodes.length; i < len; ++i) {\n          textNode = textNodes[i];\n          precedingTextNode = getAdjacentMergeableTextNode(textNode, false);\n\n          if (precedingTextNode) {\n            if (!currentMerge) {\n              currentMerge = new Merge(precedingTextNode);\n              merges.push(currentMerge);\n            }\n\n            currentMerge.textNodes.push(textNode);\n\n            if (textNode === firstNode) {\n              rangeStartNode = currentMerge.firstTextNode;\n              rangeStartOffset = rangeStartNode.length;\n            }\n\n            if (textNode === lastNode) {\n              rangeEndNode = currentMerge.firstTextNode;\n              rangeEndOffset = currentMerge.getLength();\n            }\n          } else {\n            currentMerge = null;\n          }\n        } // Test whether the first node after the range needs merging\n\n\n        var nextTextNode = getAdjacentMergeableTextNode(lastNode, true);\n\n        if (nextTextNode) {\n          if (!currentMerge) {\n            currentMerge = new Merge(lastNode);\n            merges.push(currentMerge);\n          }\n\n          currentMerge.textNodes.push(nextTextNode);\n        } // Do the merges\n\n\n        if (merges.length) {\n          for (i = 0, len = merges.length; i < len; ++i) {\n            merges[i].doMerge();\n          } // Set the range boundaries\n\n\n          range.setStart(rangeStartNode, rangeStartOffset);\n          range.setEnd(rangeEndNode, rangeEndOffset);\n        }\n      },\n      getAppliedAncestor: function getAppliedAncestor(textNode) {\n        var node = textNode.parentNode;\n\n        while (node) {\n          if (node.nodeType == 1 && dom.arrayContains(this.tagNames, node.tagName.toLowerCase()) && this.isAppliedToElement(node)) {\n            return node;\n          }\n\n          node = node.parentNode;\n        }\n\n        return false;\n      },\n      applyToElement: function applyToElement(el, value) {},\n      unapplyToElement: function unapplyToElement(el, value) {},\n      createContainer: function createContainer(doc, value) {\n        var el = doc.createElement(tagName);\n        this.applyToElement(el, value);\n        return el;\n      },\n      createComplexContainer: function createComplexContainer(doc, value) {\n        var el = doc.createElement(this.tagNames[0]);\n        this.applyToElement(el, value);\n        return el;\n      },\n      applyToTextNode: function applyToTextNode(textNode, value) {\n        var parent = textNode.parentNode;\n\n        if (this.tagNames.indexOf(\"p\") !== -1) {\n          parent = findUpTag(parent, \"p\");\n\n          if (dom.arrayContains(this.tagNames, parent.tagName.toLowerCase())) {\n            this.applyToElement(parent, value);\n          }\n        } else {\n          if (parent.childNodes.length == 1 && dom.arrayContains(this.tagNames, parent.tagName.toLowerCase())) {\n            this.applyToElement(parent, value);\n          } else {\n            var el = this.createContainer(dom.getDocument(textNode), value);\n\n            if (el) {\n              textNode.parentNode.insertBefore(el, textNode);\n              el.appendChild(textNode);\n            }\n          }\n        }\n      },\n      applyToComplexTextNode: function applyToComplexTextNode(textNodes, value, range, name) {\n        var textNode = textNodes[0];\n        var pTarget;\n\n        switch (name) {\n          case \"listBullets\":\n          case \"listNumbers\":\n            var p = dom.getDocument(textNode).createElement(\"p\");\n            var el = this.createComplexContainer(dom.getDocument(textNode), value);\n            var array = []; //todo move this lines to applyToElement\n\n            for (var i = 0; i < textNodes.length; i++) {\n              pTarget = findUpTag(textNodes[i].parentNode, \"p\");\n              var newLi = dom.getDocument(textNode).createElement(\"li\");\n              newLi.innerHTML = pTarget.innerHTML;\n              el.appendChild(newLi);\n              array.push(newLi);\n            }\n\n            p.appendChild(el);\n            range.deleteContents();\n            range.insertNode(p);\n            return array;\n\n          case \"addTemplate\":\n            //todo move this lines to applyToElement\n            for (var k = 0; k < textNodes.length; k++) {\n              if (textNodes[k].nodeName === \"P\") pTarget = textNodes[k];else pTarget = findUpTag(textNodes[k].parentNode, \"p\");\n              var childNodes = pTarget.childNodes;\n              var numTag;\n\n              for (var j = 0; j < childNodes.length; j++) {\n                if (childNodes[j].className.indexOf(\"num-tag-c\") !== -1) {\n                  numTag = childNodes[j];\n                }\n              }\n\n              if (pTarget.classList.length > 0) {\n                var res = false;\n\n                for (var l = 0; l < pTarget.classList.length; l++) {\n                  if (pTarget.classList[l].startsWith(\"num-tag\")) {\n                    pTarget.classList[l] = \"num-tag \" + value;\n                    res = true;\n                  }\n                }\n\n                if (!res) {\n                  pTarget.classList.add(\"num-tag\");\n                  pTarget.classList.add(value);\n                }\n              } else {\n                pTarget.classList.add(\"num-tag\");\n                pTarget.classList.add(value);\n              }\n\n              if (numTag) {\n                numTag.className = \"num-tag-c\";\n              } else {\n                var newNumTag = dom.getDocument(textNode).createElement(\"span\");\n                newNumTag.className = \"num-tag-c\";\n                pTarget.insertBefore(newNumTag, pTarget.childNodes[0]);\n              }\n            }\n\n            break;\n        }\n      },\n      isRemovable: function isRemovable(el) {\n        return el.tagName.toLowerCase() == tagName && trim(el.className) == this.className && !elementHasNonClassAttributes(el);\n      },\n      undoToTextNode: function undoToTextNode(textNode, range, appliedAncestor) {\n        if (!range.containsNode(appliedAncestor)) {\n          // Split out the portion of the ancestor from which we can remove the CSS class\n          var ancestorRange = range.cloneRange();\n          ancestorRange.selectNode(appliedAncestor);\n\n          if (ancestorRange.isPointInRange(range.endContainer, range.endOffset) && isSplitPoint(range.endContainer, range.endOffset)) {\n            splitNodeAt(appliedAncestor, range.endContainer, range.endOffset);\n            range.setEndAfter(appliedAncestor);\n          }\n\n          if (ancestorRange.isPointInRange(range.startContainer, range.startOffset) && isSplitPoint(range.startContainer, range.startOffset)) {\n            appliedAncestor = splitNodeAt(appliedAncestor, range.startContainer, range.startOffset);\n          }\n        }\n\n        if (this.isRemovable(appliedAncestor)) {\n          replaceWithOwnChildren(appliedAncestor);\n        } else {\n          this.unapplyToElement(appliedAncestor);\n        }\n      },\n      undoToComplexTextNode: function undoToComplexTextNode(textNodes, range, name) {\n        var childNodes;\n\n        switch (name) {\n          case \"listBullets\":\n          case \"listNumbers\":\n            var tName = this.tagNames[0];\n            var parent = findUpTag(textNodes[0].parentNode, tName);\n\n            if (parent) {\n              childNodes = parent.childNodes;\n              range.deleteContents();\n              var array = [];\n\n              for (var i = 0; i < childNodes.length; i++) {\n                var childNode = childNodes[i];\n                var newP = dom.getDocument(childNode).createElement(\"p\");\n                newP.innerHTML = childNode.innerHTML;\n                array.push(newP);\n              }\n\n              if (array.length) {\n                array.reverse();\n\n                for (var j = 0; j < array.length; j++) {\n                  range.insertNode(array[j]);\n                }\n              }\n\n              return array;\n            }\n\n            break;\n\n          case \"addTemplate\":\n            for (var k = 0; k < textNodes.length; k++) {\n              var pTarget = findUpTag(textNodes[k].parentNode, \"p\");\n              if (pTarget.className && pTarget.className.indexOf(\"num-tag-host\") !== -1) pTarget.className = pTarget.className.replace(\"num-tag-host\", \"\");\n              childNodes = pTarget.childNodes;\n\n              for (var l = 0; l < childNodes.length; l++) {\n                childNodes[l].className = \"\";\n              }\n            }\n\n            break;\n        }\n      },\n      applyToRange: function applyToRange(range, value) {\n        range.splitBoundaries();\n        var textNodes = range.getNodes([3]);\n\n        if (textNodes.length) {\n          var textNode;\n\n          for (var i = 0, len = textNodes.length; i < len; ++i) {\n            textNode = textNodes[i];\n\n            if (!this.getAppliedAncestor(textNode)) {\n              this.applyToTextNode(textNode, value);\n            }\n          }\n\n          range.setStart(textNodes[0], 0);\n          textNode = textNodes[textNodes.length - 1];\n          range.setEnd(textNode, textNode.length);\n\n          if (this.normalize) {\n            this.postApply(textNodes, range);\n          }\n        }\n      },\n      applyToComplexRange: function applyToComplexRange(range, value, name) {\n        range.splitBoundaries();\n        var parentStart,\n            textNodes = range.getNodes([3]);\n\n        switch (name) {\n          case \"addTemplate\":\n            if (range.endContainer === range.startContainer) {\n              parentStart = range.startContainer;\n              this.applyToComplexTextNode([parentStart], value, range, name);\n            }\n\n            break;\n\n          default:\n            parentStart = findUpTag(textNodes[0].parentNode, \"p\");\n            range.setStart(parentStart, 0);\n            var parentEnd = findUpTag(textNodes[textNodes.length - 1].parentNode, \"p\");\n            range.setEndAfter(parentEnd);\n            api.getSelection().setSingleRange(range);\n\n            if (textNodes.length) {\n              var newNodes = this.applyToComplexTextNode(textNodes, value, range, name);\n\n              if (newNodes && newNodes.length) {\n                range.setStart(newNodes[0], 0);\n                var newNode = newNodes[textNodes.length - 1];\n                range.setEndAfter(newNode);\n                api.getSelection().setSingleRange(range);\n              }\n            }\n\n            break;\n        }\n      },\n      applyToSelection: function applyToSelection(win, value) {\n        win = win || window;\n        var sel = api.getSelection(win);\n        var range,\n            ranges = sel.getAllRanges();\n        sel.removeAllRanges();\n        var i = ranges.length;\n\n        while (i--) {\n          range = ranges[i];\n          this.applyToRange(range, value);\n          sel.addRange(range);\n        }\n      },\n      applyToComplexSelection: function applyToComplexSelection(win, value, name) {\n        win = win || window;\n        var sel = api.getSelection(win);\n        var range,\n            ranges = sel.getAllRanges();\n        sel.removeAllRanges();\n        var i = ranges.length;\n\n        while (i--) {\n          range = ranges[i];\n          this.applyToComplexRange(range, value, name);\n        }\n      },\n      undoToRange: function undoToRange(range) {\n        range.splitBoundaries();\n        var textNodes = range.getNodes([3]),\n            textNode,\n            appliedAncestor;\n\n        if (textNodes.length) {\n          for (var i = 0, len = textNodes.length; i < len; ++i) {\n            textNode = textNodes[i];\n            appliedAncestor = this.getAppliedAncestor(textNode);\n\n            if (appliedAncestor) {\n              this.undoToTextNode(textNode, range, appliedAncestor);\n            }\n          }\n\n          range.setStart(textNodes[0], 0);\n          textNode = textNodes[textNodes.length - 1];\n          range.setEnd(textNode, textNode.length);\n\n          if (this.normalize) {\n            this.postApply(textNodes, range);\n          }\n        }\n      },\n      undoToComplexRange: function undoToComplexRange(range, name) {\n        range.splitBoundaries();\n        var textNodes = range.getNodes([3]),\n            newNode;\n        var parentStart = findUpTag(textNodes[0].parentNode, \"p\");\n        range.setStart(parentStart, 0);\n        var parentEnd = findUpTag(textNodes[textNodes.length - 1].parentNode, \"p\");\n        range.setEndAfter(parentEnd);\n        api.getSelection().setSingleRange(range);\n\n        if (textNodes.length) {\n          var newNodes = this.undoToComplexTextNode(textNodes, range, name);\n\n          if (newNodes && newNodes.length) {\n            range.setStart(newNodes[newNodes.length - 1], 0);\n            newNode = newNodes[0];\n            range.setEndAfter(newNode);\n            api.getSelection().setSingleRange(range);\n          }\n        }\n      },\n      undoToSelection: function undoToSelection(win) {\n        win = win || window;\n        var sel = api.getSelection(win);\n        var ranges = sel.getAllRanges(),\n            range;\n        sel.removeAllRanges();\n\n        for (var i = 0, len = ranges.length; i < len; ++i) {\n          range = ranges[i];\n          this.undoToRange(range);\n          sel.addRange(range);\n        }\n      },\n      undoToComplexSelection: function undoToComplexSelection(win, value, name) {\n        win = win || window;\n        var sel = api.getSelection(win);\n        var ranges = sel.getAllRanges(),\n            range;\n        sel.removeAllRanges();\n\n        for (var i = 0, len = ranges.length; i < len; ++i) {\n          range = ranges[i];\n          this.undoToComplexRange(range, name);\n        }\n      },\n      getTextSelectedByRange: function getTextSelectedByRange(textNode, range) {\n        var textRange = range.cloneRange();\n        textRange.selectNodeContents(textNode);\n        var intersectionRange = textRange.intersection(range);\n        return intersectionRange ? intersectionRange.toString() : \"\";\n      },\n      isAppliedToElement: function isAppliedToElement(el) {\n        return false;\n      },\n      isAppliedToRange: function isAppliedToRange(range, value) {\n        var textNodes = range.getNodes([3]);\n\n        for (var i = 0, len = textNodes.length, selectedText; i < len; ++i) {\n          selectedText = this.getTextSelectedByRange(textNodes[i], range);\n\n          if (selectedText != \"\" && !this.isAppliedToElement(textNodes[i].parentNode, value)) {\n            return false;\n          }\n        }\n\n        return true;\n      },\n      isAppliedToComplexRange: function isAppliedToComplexRange(range, value, name) {\n        var textNodes = range.getNodes([3]);\n\n        if (textNodes && textNodes.length > 0) {\n          if (!this.isAppliedToElement(textNodes, value)) {\n            return false;\n          }\n\n          return true;\n        } else {\n          switch (name) {\n            case \"addTemplate\":\n              var tag;\n              if (range.endContainer === range.startContainer) tag = range.startContainer;\n\n              if (!this.isAppliedToElement([tag], value)) {\n                return false;\n              }\n\n              return true;\n          }\n        }\n      },\n      isAppliedToSelection: function isAppliedToSelection(win, value) {\n        win = win || window;\n        var sel = api.getSelection(win);\n        var ranges = sel.getAllRanges();\n        var i = ranges.length;\n\n        while (i--) {\n          if (!this.isAppliedToRange(ranges[i], value)) {\n            return false;\n          }\n        }\n\n        return true;\n      },\n      isAppliedToComplexSelection: function isAppliedToComplexSelection(win, value, name) {\n        win = win || window;\n        var sel = api.getSelection(win);\n        var ranges = sel.getAllRanges();\n        var i = ranges.length;\n\n        while (i--) {\n          if (!this.isAppliedToComplexRange(ranges[i], value, name)) {\n            return false;\n          }\n        }\n\n        return true;\n      },\n      toggleRange: function toggleRange(range) {\n        if (this.isAppliedToRange(range)) {\n          this.undoToRange(range);\n        } else {\n          this.applyToRange(range);\n        }\n      },\n      toggleSelection: function toggleSelection(win, value) {\n        if (this.isAppliedToSelection(win, value)) {\n          this.undoToSelection(win);\n        } else {\n          this.applyToSelection(win, value);\n        }\n      },\n      toggleComplexSelection: function toggleComplexSelection(win, value, name) {\n        if (this.isAppliedToComplexSelection(win, value, name) && name !== \"addTemplate\") {\n          this.undoToComplexSelection(win, value, name);\n        } else {\n          this.applyToComplexSelection(win, value, name);\n        }\n      },\n      execSelection: function execSelection(win, value, options, name) {\n        if (this.type == BOOLEAN) {\n          this.toggleSelection(win, value);\n        }\n\n        if (this.type == COMPLEX) {\n          if (name !== \"addTemplate\") value = undefined;\n          return this.toggleComplexSelection(win, value, name);\n        }\n      },\n      querySelectionValue: function querySelectionValue(win) {\n        if (this.type == BOOLEAN) {\n          return this.isAppliedToSelection(win);\n        }\n\n        if (this.type == COMPLEX) {\n          return this.isAppliedToComplexSelection(win);\n        }\n      }\n    };\n    var textCommands = {};\n\n    api.registerTextCommand = function (name, options) {\n      var cmd = new TextCommand(name, options);\n      textCommands[name.toLowerCase()] = cmd;\n      return cmd;\n    };\n\n    api.execSelectionCommand = function (name, win, value, options) {\n      var cmd = textCommands[name.toLowerCase()];\n\n      if (cmd && cmd instanceof TextCommand) {\n        cmd.execSelection(win, value, options, name);\n      }\n    };\n\n    api.querySelectionCommandValue = function (name, win) {\n      var cmd = textCommands[name.toLowerCase()];\n\n      if (cmd && cmd instanceof TextCommand) {\n        return cmd.querySelectionValue(win);\n      }\n    };\n    /*----------------------------------------------------------------------------------------------------------------*/\n    // Register core commands\n\n\n    var getComputedStyleProperty;\n\n    if (_typeof(window.getComputedStyle) != UNDEF) {\n      getComputedStyleProperty = function getComputedStyleProperty(el, propName) {\n        return dom.getWindow(el).getComputedStyle(el, null)[propName];\n      };\n    } else if (_typeof(dom.getBody(document).currentStyle) != UNDEF) {\n      getComputedStyleProperty = function getComputedStyleProperty(el, propName) {\n        return el.currentStyle[propName];\n      };\n    } else {\n      module.fail(\"No means of obtaining computed style properties found\");\n    }\n\n    function findUpTag(el, tag) {\n      if (el.tagName.toLowerCase() === tag) return el;\n\n      while (el.parentNode) {\n        el = el.parentNode;\n        if (el.tagName.toLowerCase() === tag) return el;\n      }\n\n      return null;\n    }\n\n    api.registerTextCommand(\"bold\", {\n      type: BOOLEAN,\n      tagNames: [\"span\"],\n      isAppliedToElement: function isAppliedToElement(el) {\n        var fontWeight = getComputedStyleProperty(el, \"fontWeight\");\n        var isBold = false;\n\n        if (fontWeight == \"bold\" || fontWeight == \"bolder\") {\n          isBold = true;\n        } else if (fontWeight == \"normal\" || fontWeight == \"lighter\") {\n          isBold = false;\n        } else {\n          var weightNum = parseInt(\"\" + fontWeight);\n\n          if (!isNaN(weightNum)) {\n            isBold = weightNum > 400;\n          }\n        }\n\n        return isBold;\n      },\n      applyToElement: function applyToElement(el) {\n        el.style.fontWeight = \"bold\";\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el.style.fontWeight = \"normal\";\n      }\n    });\n    api.registerTextCommand(\"italic\", {\n      type: BOOLEAN,\n      tagNames: [\"span\"],\n      isAppliedToElement: function isAppliedToElement(el) {\n        var value = getComputedStyleProperty(el, \"fontStyle\");\n        return value === \"italic\";\n      },\n      applyToElement: function applyToElement(el) {\n        el.style.fontStyle = \"italic\";\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el.style.fontStyle = \"normal\";\n      }\n    });\n    api.registerTextCommand(\"underline\", {\n      type: BOOLEAN,\n      tagNames: [\"span\"],\n      isAppliedToElement: function isAppliedToElement(el) {\n        var value = getComputedStyleProperty(el, \"textDecoration\");\n        return value === \"underline solid rgb(0, 0, 0)\";\n      },\n      applyToElement: function applyToElement(el) {\n        el.style.textDecoration = \"underline\";\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el.style.textDecoration = \"none\";\n      }\n    });\n    api.registerTextCommand(\"justifyLeft\", {\n      type: BOOLEAN,\n      tagNames: [\"p\"],\n      isAppliedToElement: function isAppliedToElement(el) {\n        el = findUpTag(el, \"p\");\n        var value = getComputedStyleProperty(el, \"textAlign\");\n        return value === \"left\";\n      },\n      applyToElement: function applyToElement(el) {\n        el = findUpTag(el, \"p\");\n        el.style.textAlign = \"left\";\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el = findUpTag(el, \"p\");\n        el.style.textAlign = \"\";\n      }\n    });\n    api.registerTextCommand(\"justifyFull\", {\n      type: BOOLEAN,\n      tagNames: [\"p\"],\n      isAppliedToElement: function isAppliedToElement(el) {\n        el = findUpTag(el, \"p\");\n        var value = getComputedStyleProperty(el, \"textAlign\");\n        return value === \"justify\";\n      },\n      applyToElement: function applyToElement(el) {\n        el = findUpTag(el, \"p\");\n        el.style.textAlign = \"justify\";\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el = findUpTag(el, \"p\");\n        el.style.textAlign = \"\";\n      }\n    });\n    api.registerTextCommand(\"justifyRight\", {\n      type: BOOLEAN,\n      tagNames: [\"p\"],\n      isAppliedToElement: function isAppliedToElement(el) {\n        el = findUpTag(el, \"p\");\n        var value = getComputedStyleProperty(el, \"textAlign\");\n        return value === \"right\";\n      },\n      applyToElement: function applyToElement(el) {\n        el = findUpTag(el, \"p\");\n        el.style.textAlign = \"right\";\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el = findUpTag(el, \"p\");\n        el.style.textAlign = \"\";\n      }\n    });\n    api.registerTextCommand(\"justifyCenter\", {\n      type: BOOLEAN,\n      tagNames: [\"p\"],\n      isAppliedToElement: function isAppliedToElement(el) {\n        el = findUpTag(el, \"p\");\n        var value = getComputedStyleProperty(el, \"textAlign\");\n        return value === \"center\";\n      },\n      applyToElement: function applyToElement(el) {\n        el = findUpTag(el, \"p\");\n        el.style.textAlign = \"center\";\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el = findUpTag(el, \"p\");\n        el.style.textAlign = \"\";\n      }\n    });\n    api.registerTextCommand(\"fontSize\", {\n      type: BOOLEAN,\n      tagNames: [\"span\"],\n      isAppliedToElement: function isAppliedToElement(el, newValue) {\n        var value = getComputedStyleProperty(el, \"fontSize\");\n        return value === newValue;\n      },\n      applyToElement: function applyToElement(el, newValue) {\n        el.style.fontSize = newValue;\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el.style.fontSize = \"\";\n      }\n    });\n    api.registerTextCommand(\"fontName\", {\n      type: BOOLEAN,\n      tagNames: [\"span\"],\n      isAppliedToElement: function isAppliedToElement(el, newValue) {\n        var value = getComputedStyleProperty(el, \"fontFamily\");\n        return value === newValue;\n      },\n      applyToElement: function applyToElement(el, newValue) {\n        el.style.fontFamily = newValue;\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el.style.fontFamily = \"\";\n      }\n    });\n    api.registerTextCommand(\"textColor\", {\n      type: BOOLEAN,\n      tagNames: [\"span\"],\n      isAppliedToElement: function isAppliedToElement(el, newValue) {\n        var val = getComputedStyleProperty(el, \"color\");\n        return val !== undefined && val !== \"rgba(0, 0, 0, 0)\" && val !== \"rgb(0, 0, 0)\" && val !== \"\" && val === newValue;\n      },\n      applyToElement: function applyToElement(el, value) {\n        el.style.color = value;\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el.style.color = \"\";\n      }\n    });\n    api.registerTextCommand(\"backColor\", {\n      type: BOOLEAN,\n      tagNames: [\"span\"],\n      isAppliedToElement: function isAppliedToElement(el, newValue) {\n        var val = getComputedStyleProperty(el, \"backgroundColor\");\n        return val !== undefined && val !== \"rgba(0, 0, 0, 0)\" && val !== \"rgb(0, 0, 0)\" && val !== \"\" && val === newValue;\n      },\n      applyToElement: function applyToElement(el, value) {\n        el.style.backgroundColor = value;\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el.style.backgroundColor = \"\";\n      }\n    });\n    api.registerTextCommand(\"lineHeight\", {\n      type: BOOLEAN,\n      tagNames: [\"p\"],\n      isAppliedToElement: function isAppliedToElement(el, newValue) {\n        el = findUpTag(el, \"p\");\n        var val = el.style[\"lineHeight\"];\n        return val !== \"\" && val === newValue;\n      },\n      applyToElement: function applyToElement(el, value) {\n        el = findUpTag(el, \"p\");\n        el.style.lineHeight = value;\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el = findUpTag(el, \"p\");\n        el.style.lineHeight = \"\";\n      }\n    });\n    api.registerTextCommand(\"fontUp\", {\n      type: BOOLEAN,\n      tagNames: [\"span\"],\n      isAppliedToElement: function isAppliedToElement(el) {\n        return false;\n      },\n      applyToElement: function applyToElement(el) {\n        var val;\n\n        try {\n          val = parseInt(getComputedStyleProperty(el, \"fontSize\"));\n        } catch (e) {\n          val = 11;\n        }\n\n        el.style.fontSize = val + 1 + \"px\";\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el.style.fontStyle = \"\";\n      }\n    });\n    api.registerTextCommand(\"fontDown\", {\n      type: BOOLEAN,\n      tagNames: [\"span\"],\n      isAppliedToElement: function isAppliedToElement(el) {\n        return false;\n      },\n      applyToElement: function applyToElement(el) {\n        var val;\n\n        try {\n          val = parseInt(getComputedStyleProperty(el, \"fontSize\"));\n        } catch (e) {\n          val = 11;\n        }\n\n        el.style.fontSize = val - 1 + \"px\";\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el.style.fontSize = \"\";\n      }\n    });\n    api.registerTextCommand(\"lineHeightUp\", {\n      type: BOOLEAN,\n      tagNames: [\"p\"],\n      isAppliedToElement: function isAppliedToElement(el, newValue) {\n        return false;\n      },\n      applyToElement: function applyToElement(el, value) {\n        el = findUpTag(el, \"p\");\n        var val;\n\n        try {\n          val = parseFloat(el.style[\"lineHeight\"]);\n        } catch (e) {\n          val = 1;\n        }\n\n        el.style.lineHeight = val + .1;\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el = findUpTag(el, \"p\");\n        var val;\n\n        try {\n          val = parseFloat(el.style[\"lineHeight\"]);\n        } catch (e) {\n          val = 1;\n        }\n\n        el.style.lineHeight = val - .1;\n      }\n    });\n    api.registerTextCommand(\"lineHeightDown\", {\n      type: BOOLEAN,\n      tagNames: [\"p\"],\n      isAppliedToElement: function isAppliedToElement(el, newValue) {\n        return false;\n      },\n      applyToElement: function applyToElement(el, value) {\n        el = findUpTag(el, \"p\");\n        var val;\n\n        try {\n          val = parseFloat(el.style[\"lineHeight\"]);\n        } catch (e) {\n          val = 1;\n        }\n\n        el.style.lineHeight = val - .1;\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el = findUpTag(el, \"p\");\n        var val;\n\n        try {\n          val = parseFloat(el.style[\"lineHeight\"]);\n        } catch (e) {\n          val = 1;\n        }\n\n        el.style.lineHeight = val + .1;\n      }\n    });\n    api.registerTextCommand(\"dirRtl\", {\n      type: BOOLEAN,\n      tagNames: [\"p\"],\n      isAppliedToElement: function isAppliedToElement(el) {\n        el = findUpTag(el, \"p\");\n        var value = getComputedStyleProperty(el, \"direction\");\n        return value === \"rtl\" || value === \"\";\n      },\n      applyToElement: function applyToElement(el) {\n        el = findUpTag(el, \"p\");\n        el.style.direction = \"rtl\";\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el = findUpTag(el, \"p\");\n        el.style.direction = \"\";\n      }\n    });\n    api.registerTextCommand(\"dirLtr\", {\n      type: BOOLEAN,\n      tagNames: [\"p\"],\n      isAppliedToElement: function isAppliedToElement(el) {\n        el = findUpTag(el, \"p\");\n        var value = getComputedStyleProperty(el, \"direction\");\n        return value === \"ltr\";\n      },\n      applyToElement: function applyToElement(el) {\n        el = findUpTag(el, \"p\");\n        el.style.direction = \"ltr\";\n      },\n      unapplyToElement: function unapplyToElement(el) {\n        el = findUpTag(el, \"p\");\n        el.style.direction = \"\";\n      }\n    });\n    api.registerTextCommand(\"listNumbers\", {\n      type: COMPLEX,\n      tagNames: [\"ol\"],\n      isAppliedToElement: function isAppliedToElement(elList) {\n        var el = findUpTag(elList[0].parentNode, \"p\");\n        var childNodes = el.childNodes;\n        var hasOlOrUlTag = false;\n\n        for (var i = 0; i < childNodes.length; i++) {\n          if (childNodes[i].nodeName === \"OL\") {\n            hasOlOrUlTag = true;\n          }\n        }\n\n        return hasOlOrUlTag;\n      },\n      applyToElement: function applyToElement(elList) {},\n      unapplyToElement: function unapplyToElement(elList) {}\n    });\n    api.registerTextCommand(\"listBullets\", {\n      type: COMPLEX,\n      tagNames: [\"ul\"],\n      isAppliedToElement: function isAppliedToElement(elList) {\n        var el = findUpTag(elList[0].parentNode, \"p\");\n        var childNodes = el.childNodes;\n        var hasOlOrUlTag = false;\n\n        for (var i = 0; i < childNodes.length; i++) {\n          if (childNodes[i].nodeName === \"UL\") {\n            hasOlOrUlTag = true;\n          }\n        }\n\n        return hasOlOrUlTag;\n      },\n      applyToElement: function applyToElement(elList) {},\n      unapplyToElement: function unapplyToElement(elList) {}\n    });\n    api.registerTextCommand(\"addTemplate\", {\n      type: COMPLEX,\n      tagNames: [\"span\"],\n      isAppliedToElement: function isAppliedToElement(elList) {\n        var el = elList[0];\n        if (el.nodeName !== \"P\") el = findUpTag(elList[0].parentNode, \"p\");\n        var childNodes = el.childNodes;\n        var hasNumericalTag = false;\n        if (childNodes && childNodes.length) for (var i = 0; i < childNodes.length; i++) {\n          if (childNodes[i].nodeName === \"SPAN\" && childNodes[i].className.indexOf(\"num-tag-c\") !== -1) {\n            hasNumericalTag = true;\n          }\n        }\n        return hasNumericalTag;\n      },\n      applyToElement: function applyToElement(elList) {},\n      unapplyToElement: function unapplyToElement(elList) {}\n    });\n  });\n  /*----------------------------------------------------------------------------------------------------------------*/\n  // Wait for document to load before initializing\n\n  var docReady = false;\n\n  var loadHandler = function loadHandler(e) {\n    if (!docReady) {\n      docReady = true;\n\n      if (!api.initialized && api.config.autoInitialize) {\n        init();\n      }\n    }\n  };\n\n  if (isBrowser) {\n    // Test whether the document has already been loaded and initialize immediately if so\n    if (document.readyState == \"complete\") {\n      loadHandler();\n    } else {\n      if (isHostMethod(document, \"addEventListener\")) {\n        document.addEventListener(\"DOMContentLoaded\", loadHandler, false);\n      } // Add a fallback in case the DOMContentLoaded event isn't supported\n\n\n      addListener(window, \"load\", loadHandler);\n    }\n  }\n\n  return api;\n}, this);\n\n//# sourceURL=webpack://domino/./src/scripts/vendors/rangy.js?");

/***/ }),

/***/ "./src/scripts/vendors/toastr.js":
/*!***************************************!*\
  !*** ./src/scripts/vendors/toastr.js ***!
  \***************************************/
/***/ ((module, exports, __webpack_require__) => {

eval("var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\r\n * Toastr\r\n * Copyright 2012-2015\r\n * Authors: John Papa, Hans Fjällemark, and Tim Ferrell.\r\n * All Rights Reserved.\r\n * Use, reproduction, distribution, and modification of this code is subject to the terms and\r\n * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php\r\n *\r\n * ARIA Support: Greta Krafsig\r\n *\r\n * Project: https://github.com/CodeSeven/toastr\r\n */\n\n/* global define */\n;\n\n(function (define) {\n  !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")], __WEBPACK_AMD_DEFINE_RESULT__ = (function ($) {\n    return function () {\n      var $container;\n      var listener;\n      var toastId = 0;\n      var toastType = {\n        error: 'error',\n        info: 'info',\n        success: 'success',\n        warning: 'warning'\n      };\n      var toastr = {\n        clear: clear,\n        remove: remove,\n        error: error,\n        getContainer: getContainer,\n        info: info,\n        options: {},\n        subscribe: subscribe,\n        success: success,\n        version: '2.1.1',\n        warning: warning\n      };\n      var previousToast;\n      return toastr; ////////////////\n\n      function error(message, title, optionsOverride) {\n        return notify({\n          type: toastType.error,\n          iconClass: getOptions().iconClasses.error,\n          message: message,\n          optionsOverride: optionsOverride,\n          title: title\n        });\n      }\n\n      function getContainer(options, create) {\n        if (!options) {\n          options = getOptions();\n        }\n\n        $container = $('#' + options.containerId);\n\n        if ($container.length) {\n          return $container;\n        }\n\n        if (create) {\n          $container = createContainer(options);\n        }\n\n        return $container;\n      }\n\n      function info(message, title, optionsOverride) {\n        return notify({\n          type: toastType.info,\n          iconClass: getOptions().iconClasses.info,\n          message: message,\n          optionsOverride: optionsOverride,\n          title: title\n        });\n      }\n\n      function subscribe(callback) {\n        listener = callback;\n      }\n\n      function success(message, title, optionsOverride) {\n        return notify({\n          type: toastType.success,\n          iconClass: getOptions().iconClasses.success,\n          message: message,\n          optionsOverride: optionsOverride,\n          title: title\n        });\n      }\n\n      function warning(message, title, optionsOverride) {\n        return notify({\n          type: toastType.warning,\n          iconClass: getOptions().iconClasses.warning,\n          message: message,\n          optionsOverride: optionsOverride,\n          title: title\n        });\n      }\n\n      function clear($toastElement, clearOptions) {\n        var options = getOptions();\n\n        if (!$container) {\n          getContainer(options);\n        }\n\n        if (!clearToast($toastElement, options, clearOptions)) {\n          clearContainer(options);\n        }\n      }\n\n      function remove($toastElement) {\n        var options = getOptions();\n\n        if (!$container) {\n          getContainer(options);\n        }\n\n        if ($toastElement && $(':focus', $toastElement).length === 0) {\n          removeToast($toastElement);\n          return;\n        }\n\n        if ($container.children().length) {\n          $container.remove();\n        }\n      } // internal functions\n\n\n      function clearContainer(options) {\n        var toastsToClear = $container.children();\n\n        for (var i = toastsToClear.length - 1; i >= 0; i--) {\n          clearToast($(toastsToClear[i]), options);\n        }\n      }\n\n      function clearToast($toastElement, options, clearOptions) {\n        var force = clearOptions && clearOptions.force ? clearOptions.force : false;\n\n        if ($toastElement && (force || $(':focus', $toastElement).length === 0)) {\n          $toastElement[options.hideMethod]({\n            duration: options.hideDuration,\n            easing: options.hideEasing,\n            complete: function complete() {\n              removeToast($toastElement);\n            }\n          });\n          return true;\n        }\n\n        return false;\n      }\n\n      function createContainer(options) {\n        $container = $('<div/>').attr('id', options.containerId).addClass(options.positionClass).attr('aria-live', 'polite').attr('role', 'alert');\n        $container.appendTo($(options.target));\n        return $container;\n      }\n\n      function getDefaults() {\n        return {\n          tapToDismiss: true,\n          toastClass: 'toast',\n          containerId: 'toast-container',\n          debug: false,\n          showMethod: 'fadeIn',\n          //fadeIn, slideDown, and show are built into jQuery\n          showDuration: 300,\n          showEasing: 'swing',\n          //swing and linear are built into jQuery\n          onShown: undefined,\n          hideMethod: 'fadeOut',\n          hideDuration: 1000,\n          hideEasing: 'swing',\n          onHidden: undefined,\n          extendedTimeOut: 1000,\n          iconClasses: {\n            error: 'toast-error',\n            info: 'toast-info',\n            success: 'toast-success',\n            warning: 'toast-warning'\n          },\n          iconClass: 'toast-info',\n          positionClass: 'toast-top-right',\n          timeOut: 5000,\n          // Set timeOut and extendedTimeOut to 0 to make it sticky\n          titleClass: 'toast-title',\n          messageClass: 'toast-message',\n          target: 'body',\n          closeHtml: '<button type=\"button\">&times;</button>',\n          newestOnTop: true,\n          preventDuplicates: false,\n          progressBar: false\n        };\n      }\n\n      function publish(args) {\n        if (!listener) {\n          return;\n        }\n\n        listener(args);\n      }\n\n      function notify(map) {\n        var options = getOptions();\n        var iconClass = map.iconClass || options.iconClass;\n\n        if (typeof map.optionsOverride !== 'undefined') {\n          options = $.extend(options, map.optionsOverride);\n          iconClass = map.optionsOverride.iconClass || iconClass;\n        }\n\n        if (shouldExit(options, map)) {\n          return;\n        }\n\n        toastId++;\n        $container = getContainer(options, true);\n        var intervalId = null;\n        var $toastElement = $('<div/>');\n        var $titleElement = $('<div/>');\n        var $messageElement = $('<div/>');\n        var $progressElement = $('<div/>');\n        var $closeElement = $(options.closeHtml);\n        var progressBar = {\n          intervalId: null,\n          hideEta: null,\n          maxHideTime: null\n        };\n        var response = {\n          toastId: toastId,\n          state: 'visible',\n          startTime: new Date(),\n          options: options,\n          map: map\n        };\n        personalizeToast();\n        displayToast();\n        handleEvents();\n        publish(response);\n\n        if (options.debug && console) {\n          console.log(response);\n        }\n\n        return $toastElement;\n\n        function personalizeToast() {\n          setIcon();\n          setTitle();\n          setMessage();\n          setCloseButton();\n          setProgressBar();\n          setSequence();\n        }\n\n        function handleEvents() {\n          $toastElement.hover(stickAround, delayedHideToast);\n\n          if (!options.onclick && options.tapToDismiss) {\n            $toastElement.click(hideToast);\n          }\n\n          if (options.closeButton && $closeElement) {\n            $closeElement.click(function (event) {\n              if (event.stopPropagation) {\n                event.stopPropagation();\n              } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) {\n                event.cancelBubble = true;\n              }\n\n              hideToast(true);\n            });\n          }\n\n          if (options.onclick) {\n            $toastElement.click(function () {\n              options.onclick();\n              hideToast();\n            });\n          }\n        }\n\n        function displayToast() {\n          $toastElement.hide();\n          $toastElement[options.showMethod]({\n            duration: options.showDuration,\n            easing: options.showEasing,\n            complete: options.onShown\n          });\n\n          if (options.timeOut > 0) {\n            intervalId = setTimeout(hideToast, options.timeOut);\n            progressBar.maxHideTime = parseFloat(options.timeOut);\n            progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;\n\n            if (options.progressBar) {\n              progressBar.intervalId = setInterval(updateProgress, 10);\n            }\n          }\n        }\n\n        function setIcon() {\n          if (map.iconClass) {\n            $toastElement.addClass(options.toastClass).addClass(iconClass);\n          }\n        }\n\n        function setSequence() {\n          if (options.newestOnTop) {\n            $container.prepend($toastElement);\n          } else {\n            $container.append($toastElement);\n          }\n        }\n\n        function setTitle() {\n          if (map.title) {\n            $titleElement.append(map.title).addClass(options.titleClass);\n            $toastElement.append($titleElement);\n          }\n        }\n\n        function setMessage() {\n          if (map.message) {\n            $messageElement.append(map.message).addClass(options.messageClass);\n            $toastElement.append($messageElement);\n          }\n        }\n\n        function setCloseButton() {\n          if (options.closeButton) {\n            $closeElement.addClass('toast-close-button').attr('role', 'button');\n            $toastElement.prepend($closeElement);\n          }\n        }\n\n        function setProgressBar() {\n          if (options.progressBar) {\n            $progressElement.addClass('toast-progress');\n            $toastElement.prepend($progressElement);\n          }\n        }\n\n        function shouldExit(options, map) {\n          if (options.preventDuplicates) {\n            if (map.message === previousToast) {\n              return true;\n            } else {\n              previousToast = map.message;\n            }\n          }\n\n          return false;\n        }\n\n        function hideToast(override) {\n          if ($(':focus', $toastElement).length && !override) {\n            return;\n          }\n\n          clearTimeout(progressBar.intervalId);\n          return $toastElement[options.hideMethod]({\n            duration: options.hideDuration,\n            easing: options.hideEasing,\n            complete: function complete() {\n              removeToast($toastElement);\n\n              if (options.onHidden && response.state !== 'hidden') {\n                options.onHidden();\n              }\n\n              response.state = 'hidden';\n              response.endTime = new Date();\n              publish(response);\n            }\n          });\n        }\n\n        function delayedHideToast() {\n          if (options.timeOut > 0 || options.extendedTimeOut > 0) {\n            intervalId = setTimeout(hideToast, options.extendedTimeOut);\n            progressBar.maxHideTime = parseFloat(options.extendedTimeOut);\n            progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;\n          }\n        }\n\n        function stickAround() {\n          clearTimeout(intervalId);\n          progressBar.hideEta = 0;\n          $toastElement.stop(true, true)[options.showMethod]({\n            duration: options.showDuration,\n            easing: options.showEasing\n          });\n        }\n\n        function updateProgress() {\n          var percentage = (progressBar.hideEta - new Date().getTime()) / progressBar.maxHideTime * 100;\n          $progressElement.width(percentage + '%');\n        }\n      }\n\n      function getOptions() {\n        return $.extend({}, getDefaults(), toastr.options);\n      }\n\n      function removeToast($toastElement) {\n        if (!$container) {\n          $container = getContainer();\n        }\n\n        if ($toastElement.is(':visible')) {\n          return;\n        }\n\n        $toastElement.remove();\n        $toastElement = null;\n\n        if ($container.children().length === 0) {\n          $container.remove();\n          previousToast = undefined;\n        }\n      }\n    }();\n  }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n})(__webpack_require__.amdD);\n\n//# sourceURL=webpack://domino/./src/scripts/vendors/toastr.js?");

/***/ }),

/***/ "./src/scripts/vendors/xTimeAgo.js":
/*!*****************************************!*\
  !*** ./src/scripts/vendors/xTimeAgo.js ***!
  \*****************************************/
/***/ ((module, exports, __webpack_require__) => {

eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n/**\r\n * Timeago is a jQuery plugin that makes it easy to support automatically\r\n * updating fuzzy timestamps (e.g. \"4 minutes ago\" or \"about 1 day ago\").\r\n *jQuery.timeago(new Date());             //=> \"less than a minute ago\"\r\njQuery.timeago(\"2008-07-17\");           //=> \"9 years ago\"\r\njQuery.timeago(jQuery(\"time#some_id\")); //=> \"9 years ago\"     // [title=\"2008-07-20\"]\r\n * @name timeago\r\n * @version 1.5.4\r\n * @requires jQuery v1.2.3+\r\n * @author Ryan McGeary\r\n * @license MIT License - http://www.opensource.org/licenses/mit-license.php\r\n *\r\n * For usage and examples, visit:\r\n * http://timeago.yarp.com/\r\n *\r\n * Copyright (c) 2008-2017, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org)\r\n */\n(function (factory) {\n  if (true) {\n    // AMD. Register as an anonymous module.\n    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n  } else {}\n})(function ($) {\n  $.timeago = function (timestamp) {\n    if (timestamp instanceof Date) {\n      return inWords(timestamp);\n    } else if (typeof timestamp === \"string\") {\n      return inWords($.timeago.parse(timestamp));\n    } else if (typeof timestamp === \"number\") {\n      return inWords(new Date(timestamp));\n    } else {\n      return inWords($.timeago.datetime(timestamp));\n    }\n  };\n\n  var $t = $.timeago;\n  $.extend($.timeago, {\n    settings: {\n      refreshMillis: 60000,\n      allowPast: true,\n      allowFuture: false,\n      localeTitle: false,\n      cutoff: 0,\n      autoDispose: true,\n      strings: {\n        prefixAgo: null,\n        prefixFromNow: null,\n        suffixAgo: \"\",\n        suffixFromNow: \"اکنون\",\n        inPast: 'چند لحظه پیش',\n        seconds: \"کمتر از یک دقیقه\",\n        minute: \"یک دقیقه پیش\",\n        minutes: \"%d دقیقه پیش\",\n        hour: \"حدود یک ساعت پیش\",\n        hours: \"حدود %d ساعت پیش\",\n        day: \"روز قبل\",\n        days: \"%d روز قبل\",\n        month: \"ماه پیش\",\n        months: \"%d ماه قبل\",\n        year: \"یک سال پیش\",\n        years: \"%d سال قبل\",\n        wordSeparator: \" \",\n        numbers: []\n      }\n    },\n    inWords: function inWords(distanceMillis) {\n      if (!this.settings.allowPast && !this.settings.allowFuture) {\n        throw 'timeago allowPast and allowFuture settings can not both be set to false.';\n      }\n\n      var $l = this.settings.strings;\n      var prefix = $l.prefixAgo;\n      var suffix = $l.suffixAgo;\n\n      if (this.settings.allowFuture) {\n        if (distanceMillis < 0) {\n          prefix = $l.prefixFromNow;\n          suffix = $l.suffixFromNow;\n        }\n      }\n\n      if (!this.settings.allowPast && distanceMillis >= 0) {\n        return this.settings.strings.inPast;\n      }\n\n      var seconds = Math.abs(distanceMillis) / 1000;\n      var minutes = seconds / 60;\n      var hours = minutes / 60;\n      var days = hours / 24;\n      var years = days / 365;\n\n      function substitute(stringOrFunction, number) {\n        var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction;\n        var value = $l.numbers && $l.numbers[number] || number;\n        return string.replace(/%d/i, value);\n      }\n\n      var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) || seconds < 90 && substitute($l.minute, 1) || minutes < 45 && substitute($l.minutes, Math.round(minutes)) || minutes < 90 && substitute($l.hour, 1) || hours < 24 && substitute($l.hours, Math.round(hours)) || hours < 42 && substitute($l.day, 1) || days < 30 && substitute($l.days, Math.round(days)) || days < 45 && substitute($l.month, 1) || days < 365 && substitute($l.months, Math.round(days / 30)) || years < 1.5 && substitute($l.year, 1) || substitute($l.years, Math.round(years));\n      var separator = $l.wordSeparator || \"\";\n\n      if ($l.wordSeparator === undefined) {\n        separator = \" \";\n      }\n\n      return $.trim([prefix, words, suffix].join(separator));\n    },\n    parse: function parse(iso8601) {\n      var s = $.trim(iso8601);\n      s = s.replace(/\\.\\d+/, \"\"); // remove milliseconds\n\n      s = s.replace(/-/, \"/\").replace(/-/, \"/\");\n      s = s.replace(/T/, \" \").replace(/Z/, \" UTC\");\n      s = s.replace(/([\\+\\-]\\d\\d)\\:?(\\d\\d)/, \" $1$2\"); // -04:00 -> -0400\n\n      s = s.replace(/([\\+\\-]\\d\\d)$/, \" $100\"); // +09 -> +0900\n\n      return new Date(s);\n    },\n    datetime: function datetime(elem) {\n      var iso8601 = $t.isTime(elem) ? $(elem).attr(\"datetime\") : $(elem).attr(\"title\");\n      return $t.parse(iso8601);\n    },\n    isTime: function isTime(elem) {\n      // jQuery's `is()` doesn't play well with HTML5 in IE\n      return $(elem).get(0).tagName.toLowerCase() === \"time\"; // $(elem).is(\"time\");\n    }\n  }); // functions that can be called via $(el).timeago('action')\n  // init is default when no action is given\n  // functions are called with context of a single element\n\n  var functions = {\n    init: function init() {\n      functions.dispose.call(this);\n      var refresh_el = $.proxy(refresh, this);\n      refresh_el();\n      var $s = $t.settings;\n\n      if ($s.refreshMillis > 0) {\n        this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis);\n      }\n    },\n    update: function update(timestamp) {\n      var date = timestamp instanceof Date ? timestamp : $t.parse(timestamp);\n      $(this).data('timeago', {\n        datetime: date\n      });\n\n      if ($t.settings.localeTitle) {\n        $(this).attr(\"title\", date.toLocaleString());\n      }\n\n      refresh.apply(this);\n    },\n    updateFromDOM: function updateFromDOM() {\n      $(this).data('timeago', {\n        datetime: $t.parse($t.isTime(this) ? $(this).attr(\"datetime\") : $(this).attr(\"title\"))\n      });\n      refresh.apply(this);\n    },\n    dispose: function dispose() {\n      if (this._timeagoInterval) {\n        window.clearInterval(this._timeagoInterval);\n        this._timeagoInterval = null;\n      }\n    }\n  };\n\n  $.fn.timeago = function (action, options) {\n    var fn = action ? functions[action] : functions.init;\n\n    if (!fn) {\n      throw new Error(\"Unknown function name '\" + action + \"' for timeago\");\n    } // each over objects here and call the requested function\n\n\n    this.each(function () {\n      fn.call(this, options);\n    });\n    return this;\n  };\n\n  function refresh() {\n    var $s = $t.settings; //check if it's still visible\n\n    if ($s.autoDispose && !$.contains(document.documentElement, this)) {\n      //stop if it has been removed\n      $(this).timeago(\"dispose\");\n      return this;\n    }\n\n    var data = prepareData(this);\n\n    if (!isNaN(data.datetime)) {\n      if ($s.cutoff === 0 || Math.abs(distance(data.datetime)) < $s.cutoff) {\n        $(this).text(inWords(data.datetime));\n      } else {\n        if ($(this).attr('title').length > 0) {\n          $(this).text($(this).attr('title'));\n        }\n      }\n    }\n\n    return this;\n  }\n\n  function prepareData(element) {\n    element = $(element);\n\n    if (!element.data(\"timeago\")) {\n      element.data(\"timeago\", {\n        datetime: $t.datetime(element)\n      });\n      var text = $.trim(element.text());\n\n      if ($t.settings.localeTitle) {\n        element.attr(\"title\", element.data('timeago').datetime.toLocaleString());\n      } else if (text.length > 0 && !($t.isTime(element) && element.attr(\"title\"))) {\n        element.attr(\"title\", text);\n      }\n    }\n\n    return element.data(\"timeago\");\n  }\n\n  function inWords(date) {\n    return $t.inWords(distance(date));\n  }\n\n  function distance(date) {\n    return new Date().getTime() - date.getTime();\n  } // fix for IE6 suckage\n\n\n  document.createElement(\"abbr\");\n  document.createElement(\"time\");\n});\n\n//# sourceURL=webpack://domino/./src/scripts/vendors/xTimeAgo.js?");

/***/ }),

/***/ "./src/styleImport.js":
/*!****************************!*\
  !*** ./src/styleImport.js ***!
  \****************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

eval("__webpack_require__(/*! ./styles/bootstrap.css */ \"./src/styles/bootstrap.css\");\n\n__webpack_require__(/*! ./styles/bootstrap-rtl.css */ \"./src/styles/bootstrap-rtl.css\");\n\n__webpack_require__(/*! ./styles/awesome-bootstrap-checkbox.css */ \"./src/styles/awesome-bootstrap-checkbox.css\");\n\n__webpack_require__(/*! ./styles/jquery.bootstrap-touchspin.min.css */ \"./src/styles/jquery.bootstrap-touchspin.min.css\");\n\n__webpack_require__(/*! ./styles/main.css */ \"./src/styles/main.css\");\n\n__webpack_require__(/*! ./styles/main-rtl.css */ \"./src/styles/main-rtl.css\");\n\n__webpack_require__(/*! ./styles/fonts-icon.css */ \"./src/styles/fonts-icon.css\");\n\n__webpack_require__(/*! ./styles/fonts-fa.css */ \"./src/styles/fonts-fa.css\");\n\n__webpack_require__(/*! ./styles/toastr.min.css */ \"./src/styles/toastr.min.css\");\n\n__webpack_require__(/*! ./styles/nprogress.css */ \"./src/styles/nprogress.css\");\n\n__webpack_require__(/*! ./styles/toggleswitch.css */ \"./src/styles/toggleswitch.css\");\n\n__webpack_require__(/*! ./styles/jquery-ui.min.css */ \"./src/styles/jquery-ui.min.css\");\n\n__webpack_require__(/*! ./styles/style.css */ \"./src/styles/style.css\");\n\n__webpack_require__(/*! ./styles/mt-contextmenu.css */ \"./src/styles/mt-contextmenu.css\");\n\n__webpack_require__(/*! ./styles/knockout.contextmenu.css */ \"./src/styles/knockout.contextmenu.css\");\n\n__webpack_require__(/*! ./styles/evol-colorpicker.css */ \"./src/styles/evol-colorpicker.css\");\n\n__webpack_require__(/*! ./styles/prwreport.css */ \"./src/styles/prwreport.css\");\n\n__webpack_require__(/*! ./styles/components/autocomplete.css */ \"./src/styles/components/autocomplete.css\");\n\n__webpack_require__(/*! ./styles/components/chart.css */ \"./src/styles/components/chart.css\");\n\n__webpack_require__(/*! ./styles/components/datepicker.css */ \"./src/styles/components/datepicker.css\");\n\n__webpack_require__(/*! ./styles/components/fontSelector.css */ \"./src/styles/components/fontSelector.css\");\n\n__webpack_require__(/*! ./styles/components/formulamaker.css */ \"./src/styles/components/formulamaker.css\");\n\n__webpack_require__(/*! ./styles/components/jqtreeView.css */ \"./src/styles/components/jqtreeView.css\");\n\n__webpack_require__(/*! ./styles/components/jsRuler.css */ \"./src/styles/components/jsRuler.css\");\n\n__webpack_require__(/*! ./styles/components/rg.css */ \"./src/styles/components/rg.css\");\n\n__webpack_require__(/*! ./styles/components/richtexteditor.css */ \"./src/styles/components/richtexteditor.css\");\n\n__webpack_require__(/*! ./styles/components/select.css */ \"./src/styles/components/select.css\");\n\n__webpack_require__(/*! ./styles/components/stepbar.css */ \"./src/styles/components/stepbar.css\");\n\n__webpack_require__(/*! ./styles/components/tabletreeview.css */ \"./src/styles/components/tabletreeview.css\");\n\n__webpack_require__(/*! ./styles/apexcharts.css */ \"./src/styles/apexcharts.css\");\n\n//# sourceURL=webpack://domino/./src/styleImport.js?");

/***/ }),

/***/ "./node_modules/jquery/dist/jquery.js":
/*!********************************************!*\
  !*** ./node_modules/jquery/dist/jquery.js ***!
  \********************************************/
/***/ (function(module, exports) {

eval("var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * jQuery JavaScript Library v3.7.1\n * https://jquery.com/\n *\n * Copyright OpenJS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2023-08-28T13:37Z\n */\n( function( global, factory ) {\n\n\t\"use strict\";\n\n\tif (  true && typeof module.exports === \"object\" ) {\n\n\t\t// For CommonJS and CommonJS-like environments where a proper `window`\n\t\t// is present, execute the factory and get jQuery.\n\t\t// For environments that do not have a `window` with a `document`\n\t\t// (such as Node.js), expose a factory as module.exports.\n\t\t// This accentuates the need for the creation of a real `window`.\n\t\t// e.g. var jQuery = require(\"jquery\")(window);\n\t\t// See ticket trac-14549 for more info.\n\t\tmodule.exports = global.document ?\n\t\t\tfactory( global, true ) :\n\t\t\tfunction( w ) {\n\t\t\t\tif ( !w.document ) {\n\t\t\t\t\tthrow new Error( \"jQuery requires a window with a document\" );\n\t\t\t\t}\n\t\t\t\treturn factory( w );\n\t\t\t};\n\t} else {\n\t\tfactory( global );\n\t}\n\n// Pass this if window is not defined yet\n} )( typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n// enough that all such attempts are guarded in a try block.\n\"use strict\";\n\nvar arr = [];\n\nvar getProto = Object.getPrototypeOf;\n\nvar slice = arr.slice;\n\nvar flat = arr.flat ? function( array ) {\n\treturn arr.flat.call( array );\n} : function( array ) {\n\treturn arr.concat.apply( [], array );\n};\n\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar fnToString = hasOwn.toString;\n\nvar ObjectFunctionString = fnToString.call( Object );\n\nvar support = {};\n\nvar isFunction = function isFunction( obj ) {\n\n\t\t// Support: Chrome <=57, Firefox <=52\n\t\t// In some browsers, typeof returns \"function\" for HTML <object> elements\n\t\t// (i.e., `typeof document.createElement( \"object\" ) === \"function\"`).\n\t\t// We don't want to classify *any* DOM node as a function.\n\t\t// Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5\n\t\t// Plus for old WebKit, typeof returns \"function\" for HTML collections\n\t\t// (e.g., `typeof document.getElementsByTagName(\"div\") === \"function\"`). (gh-4756)\n\t\treturn typeof obj === \"function\" && typeof obj.nodeType !== \"number\" &&\n\t\t\ttypeof obj.item !== \"function\";\n\t};\n\n\nvar isWindow = function isWindow( obj ) {\n\t\treturn obj != null && obj === obj.window;\n\t};\n\n\nvar document = window.document;\n\n\n\n\tvar preservedScriptAttributes = {\n\t\ttype: true,\n\t\tsrc: true,\n\t\tnonce: true,\n\t\tnoModule: true\n\t};\n\n\tfunction DOMEval( code, node, doc ) {\n\t\tdoc = doc || document;\n\n\t\tvar i, val,\n\t\t\tscript = doc.createElement( \"script\" );\n\n\t\tscript.text = code;\n\t\tif ( node ) {\n\t\t\tfor ( i in preservedScriptAttributes ) {\n\n\t\t\t\t// Support: Firefox 64+, Edge 18+\n\t\t\t\t// Some browsers don't support the \"nonce\" property on scripts.\n\t\t\t\t// On the other hand, just using `getAttribute` is not enough as\n\t\t\t\t// the `nonce` attribute is reset to an empty string whenever it\n\t\t\t\t// becomes browsing-context connected.\n\t\t\t\t// See https://github.com/whatwg/html/issues/2369\n\t\t\t\t// See https://html.spec.whatwg.org/#nonce-attributes\n\t\t\t\t// The `node.getAttribute` check was added for the sake of\n\t\t\t\t// `jQuery.globalEval` so that it can fake a nonce-containing node\n\t\t\t\t// via an object.\n\t\t\t\tval = node[ i ] || node.getAttribute && node.getAttribute( i );\n\t\t\t\tif ( val ) {\n\t\t\t\t\tscript.setAttribute( i, val );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdoc.head.appendChild( script ).parentNode.removeChild( script );\n\t}\n\n\nfunction toType( obj ) {\n\tif ( obj == null ) {\n\t\treturn obj + \"\";\n\t}\n\n\t// Support: Android <=2.3 only (functionish RegExp)\n\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\tclass2type[ toString.call( obj ) ] || \"object\" :\n\t\ttypeof obj;\n}\n/* global Symbol */\n// Defining this global in .eslintrc.json would create a danger of using the global\n// unguarded in another place, it seems safer to define global only for this module\n\n\n\nvar version = \"3.7.1\",\n\n\trhtmlSuffix = /HTML$/i,\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\t// Need init if jQuery is called (just allow error to be thrown if not included)\n\t\treturn new jQuery.fn.init( selector, context );\n\t};\n\njQuery.fn = jQuery.prototype = {\n\n\t// The current version of jQuery being used\n\tjquery: version,\n\n\tconstructor: jQuery,\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\ttoArray: function() {\n\t\treturn slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\n\t\t// Return all the elements in a clean array\n\t\tif ( num == null ) {\n\t\t\treturn slice.call( this );\n\t\t}\n\n\t\t// Return just the one element from the set\n\t\treturn num < 0 ? this[ num + this.length ] : this[ num ];\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\teach: function( callback ) {\n\t\treturn jQuery.each( this, callback );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map( this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t} ) );\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teven: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn ( i + 1 ) % 2;\n\t\t} ) );\n\t},\n\n\todd: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn i % 2;\n\t\t} ) );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor();\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: push,\n\tsort: arr.sort,\n\tsplice: arr.splice\n};\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[ 0 ] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\n\t\t// Skip the boolean and the target\n\t\ttarget = arguments[ i ] || {};\n\t\ti++;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !isFunction( target ) ) {\n\t\ttarget = {};\n\t}\n\n\t// Extend jQuery itself if only one argument is passed\n\tif ( i === length ) {\n\t\ttarget = this;\n\t\ti--;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\n\t\t// Only deal with non-null/undefined values\n\t\tif ( ( options = arguments[ i ] ) != null ) {\n\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent Object.prototype pollution\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( name === \"__proto__\" || target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject( copy ) ||\n\t\t\t\t\t( copyIsArray = Array.isArray( copy ) ) ) ) {\n\t\t\t\t\tsrc = target[ name ];\n\n\t\t\t\t\t// Ensure proper type for the source value\n\t\t\t\t\tif ( copyIsArray && !Array.isArray( src ) ) {\n\t\t\t\t\t\tclone = [];\n\t\t\t\t\t} else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {\n\t\t\t\t\t\tclone = {};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src;\n\t\t\t\t\t}\n\t\t\t\t\tcopyIsArray = false;\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend( {\n\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\t// Assume jQuery is ready without the ready module\n\tisReady: true,\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\tnoop: function() {},\n\n\tisPlainObject: function( obj ) {\n\t\tvar proto, Ctor;\n\n\t\t// Detect obvious negatives\n\t\t// Use toString instead of jQuery.type to catch host objects\n\t\tif ( !obj || toString.call( obj ) !== \"[object Object]\" ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tproto = getProto( obj );\n\n\t\t// Objects with no prototype (e.g., `Object.create( null )`) are plain\n\t\tif ( !proto ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Objects with prototype are plain iff they were constructed by a global Object function\n\t\tCtor = hasOwn.call( proto, \"constructor\" ) && proto.constructor;\n\t\treturn typeof Ctor === \"function\" && fnToString.call( Ctor ) === ObjectFunctionString;\n\t},\n\n\tisEmptyObject: function( obj ) {\n\t\tvar name;\n\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\t// Evaluates a script in a provided context; falls back to the global one\n\t// if not specified.\n\tglobalEval: function( code, options, doc ) {\n\t\tDOMEval( code, { nonce: options && options.nonce }, doc );\n\t},\n\n\teach: function( obj, callback ) {\n\t\tvar length, i = 0;\n\n\t\tif ( isArrayLike( obj ) ) {\n\t\t\tlength = obj.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( i in obj ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\n\t// Retrieve the text value of an array of DOM nodes\n\ttext: function( elem ) {\n\t\tvar node,\n\t\t\tret = \"\",\n\t\t\ti = 0,\n\t\t\tnodeType = elem.nodeType;\n\n\t\tif ( !nodeType ) {\n\n\t\t\t// If no nodeType, this is expected to be an array\n\t\t\twhile ( ( node = elem[ i++ ] ) ) {\n\n\t\t\t\t// Do not traverse comment nodes\n\t\t\t\tret += jQuery.text( node );\n\t\t\t}\n\t\t}\n\t\tif ( nodeType === 1 || nodeType === 11 ) {\n\t\t\treturn elem.textContent;\n\t\t}\n\t\tif ( nodeType === 9 ) {\n\t\t\treturn elem.documentElement.textContent;\n\t\t}\n\t\tif ( nodeType === 3 || nodeType === 4 ) {\n\t\t\treturn elem.nodeValue;\n\t\t}\n\n\t\t// Do not include comment or processing instruction nodes\n\n\t\treturn ret;\n\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArrayLike( Object( arr ) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === \"string\" ?\n\t\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tpush.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\treturn arr == null ? -1 : indexOf.call( arr, elem, i );\n\t},\n\n\tisXMLDoc: function( elem ) {\n\t\tvar namespace = elem && elem.namespaceURI,\n\t\t\tdocElem = elem && ( elem.ownerDocument || elem ).documentElement;\n\n\t\t// Assume HTML when documentElement doesn't yet exist, such as inside\n\t\t// document fragments.\n\t\treturn !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || \"HTML\" );\n\t},\n\n\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t// push.apply(_, arraylike) throws on ancient WebKit\n\tmerge: function( first, second ) {\n\t\tvar len = +second.length,\n\t\t\tj = 0,\n\t\t\ti = first.length;\n\n\t\tfor ( ; j < len; j++ ) {\n\t\t\tfirst[ i++ ] = second[ j ];\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, invert ) {\n\t\tvar callbackInverse,\n\t\t\tmatches = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tcallbackExpect = !invert;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tcallbackInverse = !callback( elems[ i ], i );\n\t\t\tif ( callbackInverse !== callbackExpect ) {\n\t\t\t\tmatches.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar length, value,\n\t\t\ti = 0,\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their new values\n\t\tif ( isArrayLike( elems ) ) {\n\t\t\tlength = elems.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn flat( ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// jQuery.support is not used in Core but other projects attach their\n\t// properties to it so it needs to exist.\n\tsupport: support\n} );\n\nif ( typeof Symbol === \"function\" ) {\n\tjQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];\n}\n\n// Populate the class2type map\njQuery.each( \"Boolean Number String Function Array Date RegExp Object Error Symbol\".split( \" \" ),\n\tfunction( _i, name ) {\n\t\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n\t} );\n\nfunction isArrayLike( obj ) {\n\n\t// Support: real iOS 8.2 only (not reproducible in simulator)\n\t// `in` check used to prevent JIT error (gh-2145)\n\t// hasOwn isn't used here due to false negatives\n\t// regarding Nodelist length in IE\n\tvar length = !!obj && \"length\" in obj && obj.length,\n\t\ttype = toType( obj );\n\n\tif ( isFunction( obj ) || isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\treturn type === \"array\" || length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\n}\n\n\nfunction nodeName( elem, name ) {\n\n\treturn elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\n}\nvar pop = arr.pop;\n\n\nvar sort = arr.sort;\n\n\nvar splice = arr.splice;\n\n\nvar whitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\";\n\n\nvar rtrimCSS = new RegExp(\n\t\"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\",\n\t\"g\"\n);\n\n\n\n\n// Note: an element does not contain itself\njQuery.contains = function( a, b ) {\n\tvar bup = b && b.parentNode;\n\n\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\n\t\t// Support: IE 9 - 11+\n\t\t// IE doesn't have `contains` on SVG.\n\t\ta.contains ?\n\t\t\ta.contains( bup ) :\n\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t) );\n};\n\n\n\n\n// CSS string/identifier serialization\n// https://drafts.csswg.org/cssom/#common-serializing-idioms\nvar rcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\x80-\\uFFFF\\w-]/g;\n\nfunction fcssescape( ch, asCodePoint ) {\n\tif ( asCodePoint ) {\n\n\t\t// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n\t\tif ( ch === \"\\0\" ) {\n\t\t\treturn \"\\uFFFD\";\n\t\t}\n\n\t\t// Control characters and (dependent upon position) numbers get escaped as code points\n\t\treturn ch.slice( 0, -1 ) + \"\\\\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + \" \";\n\t}\n\n\t// Other potentially-special ASCII characters get backslash-escaped\n\treturn \"\\\\\" + ch;\n}\n\njQuery.escapeSelector = function( sel ) {\n\treturn ( sel + \"\" ).replace( rcssescape, fcssescape );\n};\n\n\n\n\nvar preferredDoc = document,\n\tpushNative = push;\n\n( function() {\n\nvar i,\n\tExpr,\n\toutermostContext,\n\tsortInput,\n\thasDuplicate,\n\tpush = pushNative,\n\n\t// Local document vars\n\tdocument,\n\tdocumentElement,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\tmatches,\n\n\t// Instance-specific data\n\texpando = jQuery.expando,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\tnonnativeSelectorCache = createCache(),\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t}\n\t\treturn 0;\n\t},\n\n\tbooleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|\" +\n\t\t\"loop|multiple|open|readonly|required|scoped\",\n\n\t// Regular expressions\n\n\t// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram\n\tidentifier = \"(?:\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace +\n\t\t\"?|\\\\\\\\[^\\\\r\\\\n\\\\f]|[\\\\w-]|[^\\0-\\\\x7f])+\",\n\n\t// Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace +\n\n\t\t// Operator (capture 2)\n\t\t\"*([*^$|!~]?=)\" + whitespace +\n\n\t\t// \"Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]\"\n\t\t\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" +\n\t\twhitespace + \"*\\\\]\",\n\n\tpseudos = \":(\" + identifier + \")(?:\\\\((\" +\n\n\t\t// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n\t\t// 1. quoted (capture 3; capture 4 or capture 5)\n\t\t\"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" +\n\n\t\t// 2. simple (capture 6)\n\t\t\"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" +\n\n\t\t// 3. anything else (capture 2)\n\t\t\".*\" +\n\t\t\")\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trwhitespace = new RegExp( whitespace + \"+\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trleadingCombinator = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" +\n\t\twhitespace + \"*\" ),\n\trdescend = new RegExp( whitespace + \"|>\" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\tID: new RegExp( \"^#(\" + identifier + \")\" ),\n\t\tCLASS: new RegExp( \"^\\\\.(\" + identifier + \")\" ),\n\t\tTAG: new RegExp( \"^(\" + identifier + \"|[*])\" ),\n\t\tATTR: new RegExp( \"^\" + attributes ),\n\t\tPSEUDO: new RegExp( \"^\" + pseudos ),\n\t\tCHILD: new RegExp(\n\t\t\t\"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" +\n\t\t\t\twhitespace + \"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" +\n\t\t\t\twhitespace + \"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\tbool: new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\tneedsContext: new RegExp( \"^\" + whitespace +\n\t\t\t\"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" + whitespace +\n\t\t\t\"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trsibling = /[+~]/,\n\n\t// CSS escapes\n\t// https://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( \"\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace +\n\t\t\"?|\\\\\\\\([^\\\\r\\\\n\\\\f])\", \"g\" ),\n\tfunescape = function( escape, nonHex ) {\n\t\tvar high = \"0x\" + escape.slice( 1 ) - 0x10000;\n\n\t\tif ( nonHex ) {\n\n\t\t\t// Strip the backslash prefix from a non-hex escape sequence\n\t\t\treturn nonHex;\n\t\t}\n\n\t\t// Replace a hexadecimal escape sequence with the encoded Unicode code point\n\t\t// Support: IE <=11+\n\t\t// For values outside the Basic Multilingual Plane (BMP), manually construct a\n\t\t// surrogate pair\n\t\treturn high < 0 ?\n\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t},\n\n\t// Used for iframes; see `setDocument`.\n\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t// Removing the function wrapper causes a \"Permission Denied\"\n\t// error in IE/Edge.\n\tunloadHandler = function() {\n\t\tsetDocument();\n\t},\n\n\tinDisabledFieldset = addCombinator(\n\t\tfunction( elem ) {\n\t\t\treturn elem.disabled === true && nodeName( elem, \"fieldset\" );\n\t\t},\n\t\t{ dir: \"parentNode\", next: \"legend\" }\n\t);\n\n// Support: IE <=9 only\n// Accessing document.activeElement can throw unexpectedly\n// https://bugs.jquery.com/ticket/13393\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t( arr = slice.call( preferredDoc.childNodes ) ),\n\t\tpreferredDoc.childNodes\n\t);\n\n\t// Support: Android <=4.0\n\t// Detect silently failing push.apply\n\t// eslint-disable-next-line no-unused-expressions\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = {\n\t\tapply: function( target, els ) {\n\t\t\tpushNative.apply( target, slice.call( els ) );\n\t\t},\n\t\tcall: function( target ) {\n\t\t\tpushNative.apply( target, slice.call( arguments, 1 ) );\n\t\t}\n\t};\n}\n\nfunction find( selector, context, results, seed ) {\n\tvar m, i, elem, nid, match, groups, newSelector,\n\t\tnewContext = context && context.ownerDocument,\n\n\t\t// nodeType defaults to 9, since context defaults to document\n\t\tnodeType = context ? context.nodeType : 9;\n\n\tresults = results || [];\n\n\t// Return early from calls with invalid selector or context\n\tif ( typeof selector !== \"string\" || !selector ||\n\t\tnodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n\t\treturn results;\n\t}\n\n\t// Try to shortcut find operations (as opposed to filters) in HTML documents\n\tif ( !seed ) {\n\t\tsetDocument( context );\n\t\tcontext = context || document;\n\n\t\tif ( documentIsHTML ) {\n\n\t\t\t// If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n\t\t\t// (excepting DocumentFragment context, where the methods don't exist)\n\t\t\tif ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {\n\n\t\t\t\t// ID selector\n\t\t\t\tif ( ( m = match[ 1 ] ) ) {\n\n\t\t\t\t\t// Document context\n\t\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\t\tif ( ( elem = context.getElementById( m ) ) ) {\n\n\t\t\t\t\t\t\t// Support: IE 9 only\n\t\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\t\tpush.call( results, elem );\n\t\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// Element context\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Support: IE 9 only\n\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\tif ( newContext && ( elem = newContext.getElementById( m ) ) &&\n\t\t\t\t\t\t\tfind.contains( context, elem ) &&\n\t\t\t\t\t\t\telem.id === m ) {\n\n\t\t\t\t\t\t\tpush.call( results, elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t// Type selector\n\t\t\t\t} else if ( match[ 2 ] ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\t\treturn results;\n\n\t\t\t\t// Class selector\n\t\t\t\t} else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Take advantage of querySelectorAll\n\t\t\tif ( !nonnativeSelectorCache[ selector + \" \" ] &&\n\t\t\t\t( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) {\n\n\t\t\t\tnewSelector = selector;\n\t\t\t\tnewContext = context;\n\n\t\t\t\t// qSA considers elements outside a scoping root when evaluating child or\n\t\t\t\t// descendant combinators, which is not what we want.\n\t\t\t\t// In such cases, we work around the behavior by prefixing every selector in the\n\t\t\t\t// list with an ID selector referencing the scope context.\n\t\t\t\t// The technique has to be used as well when a leading combinator is used\n\t\t\t\t// as such selectors are not recognized by querySelectorAll.\n\t\t\t\t// Thanks to Andrew Dupont for this technique.\n\t\t\t\tif ( nodeType === 1 &&\n\t\t\t\t\t( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) {\n\n\t\t\t\t\t// Expand context for sibling selectors\n\t\t\t\t\tnewContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext;\n\n\t\t\t\t\t// We can use :scope instead of the ID hack if the browser\n\t\t\t\t\t// supports it & if we're not changing the context.\n\t\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when\n\t\t\t\t\t// strict-comparing two documents; shallow comparisons work.\n\t\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\t\tif ( newContext != context || !support.scope ) {\n\n\t\t\t\t\t\t// Capture the context ID, setting it first if necessary\n\t\t\t\t\t\tif ( ( nid = context.getAttribute( \"id\" ) ) ) {\n\t\t\t\t\t\t\tnid = jQuery.escapeSelector( nid );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontext.setAttribute( \"id\", ( nid = expando ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prefix every selector in the list\n\t\t\t\t\tgroups = tokenize( selector );\n\t\t\t\t\ti = groups.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tgroups[ i ] = ( nid ? \"#\" + nid : \":scope\" ) + \" \" +\n\t\t\t\t\t\t\ttoSelector( groups[ i ] );\n\t\t\t\t\t}\n\t\t\t\t\tnewSelector = groups.join( \",\" );\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch ( qsaError ) {\n\t\t\t\t\tnonnativeSelectorCache( selector, true );\n\t\t\t\t} finally {\n\t\t\t\t\tif ( nid === expando ) {\n\t\t\t\t\t\tcontext.removeAttribute( \"id\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrimCSS, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\n\t\t// Use (key + \" \") to avoid collision with native prototype properties\n\t\t// (see https://github.com/jquery/sizzle/issues/157)\n\t\tif ( keys.push( key + \" \" ) > Expr.cacheLength ) {\n\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn ( cache[ key + \" \" ] = value );\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by jQuery selector module\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\nfunction assert( fn ) {\n\tvar el = document.createElement( \"fieldset\" );\n\n\ttry {\n\t\treturn !!fn( el );\n\t} catch ( e ) {\n\t\treturn false;\n\t} finally {\n\n\t\t// Remove from its parent by default\n\t\tif ( el.parentNode ) {\n\t\t\tel.parentNode.removeChild( el );\n\t\t}\n\n\t\t// release memory in IE\n\t\tel = null;\n\t}\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\treturn nodeName( elem, \"input\" ) && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\treturn ( nodeName( elem, \"input\" ) || nodeName( elem, \"button\" ) ) &&\n\t\t\telem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\nfunction createDisabledPseudo( disabled ) {\n\n\t// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n\treturn function( elem ) {\n\n\t\t// Only certain elements can match :enabled or :disabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n\t\tif ( \"form\" in elem ) {\n\n\t\t\t// Check for inherited disabledness on relevant non-disabled elements:\n\t\t\t// * listed form-associated elements in a disabled fieldset\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#category-listed\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n\t\t\t// * option elements in a disabled optgroup\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n\t\t\t// All such elements have a \"form\" property.\n\t\t\tif ( elem.parentNode && elem.disabled === false ) {\n\n\t\t\t\t// Option elements defer to a parent optgroup if present\n\t\t\t\tif ( \"label\" in elem ) {\n\t\t\t\t\tif ( \"label\" in elem.parentNode ) {\n\t\t\t\t\t\treturn elem.parentNode.disabled === disabled;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn elem.disabled === disabled;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Support: IE 6 - 11+\n\t\t\t\t// Use the isDisabled shortcut property to check for disabled fieldset ancestors\n\t\t\t\treturn elem.isDisabled === disabled ||\n\n\t\t\t\t\t// Where there is no isDisabled, check manually\n\t\t\t\t\telem.isDisabled !== !disabled &&\n\t\t\t\t\t\tinDisabledFieldset( elem ) === disabled;\n\t\t\t}\n\n\t\t\treturn elem.disabled === disabled;\n\n\t\t// Try to winnow out elements that can't be disabled before trusting the disabled property.\n\t\t// Some victims get caught in our net (label, legend, menu, track), but it shouldn't\n\t\t// even exist on them, let alone have a boolean value.\n\t\t} else if ( \"label\" in elem ) {\n\t\t\treturn elem.disabled === disabled;\n\t\t}\n\n\t\t// Remaining elements are neither :enabled nor :disabled\n\t\treturn false;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction( function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction( function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ ( j = matchIndexes[ i ] ) ] ) {\n\t\t\t\t\tseed[ j ] = !( matches[ j ] = seed[ j ] );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t} );\n}\n\n/**\n * Checks a node for validity as a jQuery selector context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n\treturn context && typeof context.getElementsByTagName !== \"undefined\" && context;\n}\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [node] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nfunction setDocument( node ) {\n\tvar subWindow,\n\t\tdoc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// Return early if doc is invalid or already selected\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Update global variables\n\tdocument = doc;\n\tdocumentElement = document.documentElement;\n\tdocumentIsHTML = !jQuery.isXMLDoc( document );\n\n\t// Support: iOS 7 only, IE 9 - 11+\n\t// Older browsers didn't support unprefixed `matches`.\n\tmatches = documentElement.matches ||\n\t\tdocumentElement.webkitMatchesSelector ||\n\t\tdocumentElement.msMatchesSelector;\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t// Accessing iframe documents after unload throws \"permission denied\" errors\n\t// (see trac-13936).\n\t// Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`,\n\t// all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well.\n\tif ( documentElement.msMatchesSelector &&\n\n\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t// two documents; shallow comparisons work.\n\t\t// eslint-disable-next-line eqeqeq\n\t\tpreferredDoc != document &&\n\t\t( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {\n\n\t\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t\tsubWindow.addEventListener( \"unload\", unloadHandler );\n\t}\n\n\t// Support: IE <10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don't pick up programmatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert( function( el ) {\n\t\tdocumentElement.appendChild( el ).id = jQuery.expando;\n\t\treturn !document.getElementsByName ||\n\t\t\t!document.getElementsByName( jQuery.expando ).length;\n\t} );\n\n\t// Support: IE 9 only\n\t// Check to see if it's possible to do matchesSelector\n\t// on a disconnected node.\n\tsupport.disconnectedMatch = assert( function( el ) {\n\t\treturn matches.call( el, \"*\" );\n\t} );\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t// IE/Edge don't support the :scope pseudo-class.\n\tsupport.scope = assert( function() {\n\t\treturn document.querySelectorAll( \":scope\" );\n\t} );\n\n\t// Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only\n\t// Make sure the `:has()` argument is parsed unforgivingly.\n\t// We include `*` in the test to detect buggy implementations that are\n\t// _selectively_ forgiving (specifically when the list includes at least\n\t// one valid selector).\n\t// Note that we treat complete lack of support for `:has()` as if it were\n\t// spec-compliant support, which is fine because use of `:has()` in such\n\t// environments will fail in the qSA path and fall back to jQuery traversal\n\t// anyway.\n\tsupport.cssHas = assert( function() {\n\t\ttry {\n\t\t\tdocument.querySelector( \":has(*,:jqfake)\" );\n\t\t\treturn false;\n\t\t} catch ( e ) {\n\t\t\treturn true;\n\t\t}\n\t} );\n\n\t// ID filter and find\n\tif ( support.getById ) {\n\t\tExpr.filter.ID = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute( \"id\" ) === attrId;\n\t\t\t};\n\t\t};\n\t\tExpr.find.ID = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar elem = context.getElementById( id );\n\t\t\t\treturn elem ? [ elem ] : [];\n\t\t\t}\n\t\t};\n\t} else {\n\t\tExpr.filter.ID =  function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== \"undefined\" &&\n\t\t\t\t\telem.getAttributeNode( \"id\" );\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\n\t\t// Support: IE 6 - 7 only\n\t\t// getElementById is not reliable as a find shortcut\n\t\tExpr.find.ID = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar node, i, elems,\n\t\t\t\t\telem = context.getElementById( id );\n\n\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t// Verify the id attribute\n\t\t\t\t\tnode = elem.getAttributeNode( \"id\" );\n\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Fall back on getElementsByName\n\t\t\t\t\telems = context.getElementsByName( id );\n\t\t\t\t\ti = 0;\n\t\t\t\t\twhile ( ( elem = elems[ i++ ] ) ) {\n\t\t\t\t\t\tnode = elem.getAttributeNode( \"id\" );\n\t\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn [];\n\t\t\t}\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find.TAG = function( tag, context ) {\n\t\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\t\treturn context.getElementsByTagName( tag );\n\n\t\t// DocumentFragment nodes don't have gEBTN\n\t\t} else {\n\t\t\treturn context.querySelectorAll( tag );\n\t\t}\n\t};\n\n\t// Class\n\tExpr.find.CLASS = function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== \"undefined\" && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\trbuggyQSA = [];\n\n\t// Build QSA regex\n\t// Regex strategy adopted from Diego Perini\n\tassert( function( el ) {\n\n\t\tvar input;\n\n\t\tdocumentElement.appendChild( el ).innerHTML =\n\t\t\t\"<a id='\" + expando + \"' href='' disabled='disabled'></a>\" +\n\t\t\t\"<select id='\" + expando + \"-\\r\\\\' disabled='disabled'>\" +\n\t\t\t\"<option selected=''></option></select>\";\n\n\t\t// Support: iOS <=7 - 8 only\n\t\t// Boolean attributes and \"value\" are not treated correctly in some XML documents\n\t\tif ( !el.querySelectorAll( \"[selected]\" ).length ) {\n\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n\t\t}\n\n\t\t// Support: iOS <=7 - 8 only\n\t\tif ( !el.querySelectorAll( \"[id~=\" + expando + \"-]\" ).length ) {\n\t\t\trbuggyQSA.push( \"~=\" );\n\t\t}\n\n\t\t// Support: iOS 8 only\n\t\t// https://bugs.webkit.org/show_bug.cgi?id=136851\n\t\t// In-page `selector#id sibling-combinator selector` fails\n\t\tif ( !el.querySelectorAll( \"a#\" + expando + \"+*\" ).length ) {\n\t\t\trbuggyQSA.push( \".#.+[+~]\" );\n\t\t}\n\n\t\t// Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+\n\t\t// In some of the document kinds, these selectors wouldn't work natively.\n\t\t// This is probably OK but for backwards compatibility we want to maintain\n\t\t// handling them through jQuery traversal in jQuery 3.x.\n\t\tif ( !el.querySelectorAll( \":checked\" ).length ) {\n\t\t\trbuggyQSA.push( \":checked\" );\n\t\t}\n\n\t\t// Support: Windows 8 Native Apps\n\t\t// The type and name attributes are restricted during .innerHTML assignment\n\t\tinput = document.createElement( \"input\" );\n\t\tinput.setAttribute( \"type\", \"hidden\" );\n\t\tel.appendChild( input ).setAttribute( \"name\", \"D\" );\n\n\t\t// Support: IE 9 - 11+\n\t\t// IE's :disabled selector does not pick up the children of disabled fieldsets\n\t\t// Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+\n\t\t// In some of the document kinds, these selectors wouldn't work natively.\n\t\t// This is probably OK but for backwards compatibility we want to maintain\n\t\t// handling them through jQuery traversal in jQuery 3.x.\n\t\tdocumentElement.appendChild( el ).disabled = true;\n\t\tif ( el.querySelectorAll( \":disabled\" ).length !== 2 ) {\n\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t}\n\n\t\t// Support: IE 11+, Edge 15 - 18+\n\t\t// IE 11/Edge don't find elements on a `[name='']` query in some cases.\n\t\t// Adding a temporary attribute to the document before the selection works\n\t\t// around the issue.\n\t\t// Interestingly, IE 10 & older don't seem to have the issue.\n\t\tinput = document.createElement( \"input\" );\n\t\tinput.setAttribute( \"name\", \"\" );\n\t\tel.appendChild( input );\n\t\tif ( !el.querySelectorAll( \"[name='']\" ).length ) {\n\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*name\" + whitespace + \"*=\" +\n\t\t\t\twhitespace + \"*(?:''|\\\"\\\")\" );\n\t\t}\n\t} );\n\n\tif ( !support.cssHas ) {\n\n\t\t// Support: Chrome 105 - 110+, Safari 15.4 - 16.3+\n\t\t// Our regular `try-catch` mechanism fails to detect natively-unsupported\n\t\t// pseudo-classes inside `:has()` (such as `:has(:contains(\"Foo\"))`)\n\t\t// in browsers that parse the `:has()` argument as a forgiving selector list.\n\t\t// https://drafts.csswg.org/selectors/#relational now requires the argument\n\t\t// to be parsed unforgivingly, but browsers have not yet fully adjusted.\n\t\trbuggyQSA.push( \":has\" );\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( \"|\" ) );\n\n\t/* Sorting\n\t---------------------------------------------------------------------- */\n\n\t// Document order sorting\n\tsortOrder = function( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Sort on method existence if only one input has compareDocumentPosition\n\t\tvar compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n\t\tif ( compare ) {\n\t\t\treturn compare;\n\t\t}\n\n\t\t// Calculate position if both inputs belong to the same document\n\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t// two documents; shallow comparisons work.\n\t\t// eslint-disable-next-line eqeqeq\n\t\tcompare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?\n\t\t\ta.compareDocumentPosition( b ) :\n\n\t\t\t// Otherwise we know they are disconnected\n\t\t\t1;\n\n\t\t// Disconnected nodes\n\t\tif ( compare & 1 ||\n\t\t\t( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {\n\n\t\t\t// Choose the first element that is related to our preferred document\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( a === document || a.ownerDocument == preferredDoc &&\n\t\t\t\tfind.contains( preferredDoc, a ) ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( b === document || b.ownerDocument == preferredDoc &&\n\t\t\t\tfind.contains( preferredDoc, b ) ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// Maintain original order\n\t\t\treturn sortInput ?\n\t\t\t\t( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :\n\t\t\t\t0;\n\t\t}\n\n\t\treturn compare & 4 ? -1 : 1;\n\t};\n\n\treturn document;\n}\n\nfind.matches = function( expr, elements ) {\n\treturn find( expr, null, null, elements );\n};\n\nfind.matchesSelector = function( elem, expr ) {\n\tsetDocument( elem );\n\n\tif ( documentIsHTML &&\n\t\t!nonnativeSelectorCache[ expr + \" \" ] &&\n\t\t( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {\n\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\n\t\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t\t// fragment in IE 9\n\t\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch ( e ) {\n\t\t\tnonnativeSelectorCache( expr, true );\n\t\t}\n\t}\n\n\treturn find( expr, document, null, [ elem ] ).length > 0;\n};\n\nfind.contains = function( context, elem ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( context.ownerDocument || context ) != document ) {\n\t\tsetDocument( context );\n\t}\n\treturn jQuery.contains( context, elem );\n};\n\n\nfind.attr = function( elem, name ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( elem.ownerDocument || elem ) != document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tvar fn = Expr.attrHandle[ name.toLowerCase() ],\n\n\t\t// Don't get fooled by Object.prototype properties (see trac-13807)\n\t\tval = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n\t\t\tfn( elem, name, !documentIsHTML ) :\n\t\t\tundefined;\n\n\tif ( val !== undefined ) {\n\t\treturn val;\n\t}\n\n\treturn elem.getAttribute( name );\n};\n\nfind.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\njQuery.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\t//\n\t// Support: Android <=4.0+\n\t// Testing for detecting duplicates is unpredictable so instead assume we can't\n\t// depend on duplicate detection in all browsers without a stable sort.\n\thasDuplicate = !support.sortStable;\n\tsortInput = !support.sortStable && slice.call( results, 0 );\n\tsort.call( results, sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( ( elem = results[ i++ ] ) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tsplice.call( results, duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\t// Clear input after sorting to release objects\n\t// See https://github.com/jquery/sizzle/pull/225\n\tsortInput = null;\n\n\treturn results;\n};\n\njQuery.fn.uniqueSort = function() {\n\treturn this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) );\n};\n\nExpr = jQuery.expr = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tattrHandle: {},\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\tATTR: function( match ) {\n\t\t\tmatch[ 1 ] = match[ 1 ].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || \"\" )\n\t\t\t\t.replace( runescape, funescape );\n\n\t\t\tif ( match[ 2 ] === \"~=\" ) {\n\t\t\t\tmatch[ 3 ] = \" \" + match[ 3 ] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\tCHILD: function( match ) {\n\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[ 1 ] = match[ 1 ].toLowerCase();\n\n\t\t\tif ( match[ 1 ].slice( 0, 3 ) === \"nth\" ) {\n\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[ 3 ] ) {\n\t\t\t\t\tfind.error( match[ 0 ] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[ 4 ] = +( match[ 4 ] ?\n\t\t\t\t\tmatch[ 5 ] + ( match[ 6 ] || 1 ) :\n\t\t\t\t\t2 * ( match[ 3 ] === \"even\" || match[ 3 ] === \"odd\" )\n\t\t\t\t);\n\t\t\t\tmatch[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === \"odd\" );\n\n\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[ 3 ] ) {\n\t\t\t\tfind.error( match[ 0 ] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\tPSEUDO: function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[ 6 ] && match[ 2 ];\n\n\t\t\tif ( matchExpr.CHILD.test( match[ 0 ] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[ 3 ] ) {\n\t\t\t\tmatch[ 2 ] = match[ 4 ] || match[ 5 ] || \"\";\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t( excess = tokenize( unquoted, true ) ) &&\n\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t( excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length ) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[ 0 ] = match[ 0 ].slice( 0, excess );\n\t\t\t\tmatch[ 2 ] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\tTAG: function( nodeNameSelector ) {\n\t\t\tvar expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn nodeNameSelector === \"*\" ?\n\t\t\t\tfunction() {\n\t\t\t\t\treturn true;\n\t\t\t\t} :\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn nodeName( elem, expectedNodeName );\n\t\t\t\t};\n\t\t},\n\n\t\tCLASS: function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t( pattern = new RegExp( \"(^|\" + whitespace + \")\" + className +\n\t\t\t\t\t\"(\" + whitespace + \"|$)\" ) ) &&\n\t\t\t\tclassCache( className, function( elem ) {\n\t\t\t\t\treturn pattern.test(\n\t\t\t\t\t\ttypeof elem.className === \"string\" && elem.className ||\n\t\t\t\t\t\t\ttypeof elem.getAttribute !== \"undefined\" &&\n\t\t\t\t\t\t\t\telem.getAttribute( \"class\" ) ||\n\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t},\n\n\t\tATTR: function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = find.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\tif ( operator === \"=\" ) {\n\t\t\t\t\treturn result === check;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"!=\" ) {\n\t\t\t\t\treturn result !== check;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"^=\" ) {\n\t\t\t\t\treturn check && result.indexOf( check ) === 0;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"*=\" ) {\n\t\t\t\t\treturn check && result.indexOf( check ) > -1;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"$=\" ) {\n\t\t\t\t\treturn check && result.slice( -check.length ) === check;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"~=\" ) {\n\t\t\t\t\treturn ( \" \" + result.replace( rwhitespace, \" \" ) + \" \" )\n\t\t\t\t\t\t.indexOf( check ) > -1;\n\t\t\t\t}\n\t\t\t\tif ( operator === \"|=\" ) {\n\t\t\t\t\treturn result === check || result.slice( 0, check.length + 1 ) === check + \"-\";\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t};\n\t\t},\n\n\t\tCHILD: function( type, what, _argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tvar cache, outerCache, node, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType,\n\t\t\t\t\t\tdiff = false;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( ( node = node[ dir ] ) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnodeName( node, name ) :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) {\n\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\t\t\t\t\t\t\touterCache = parent[ expando ] || ( parent[ expando ] = {} );\n\t\t\t\t\t\t\tcache = outerCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\tdiff = nodeIndex && cache[ 2 ];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\touterCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\touterCache = elem[ expando ] || ( elem[ expando ] = {} );\n\t\t\t\t\t\t\t\tcache = outerCache[ type ] || [];\n\t\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\t\tdiff = nodeIndex;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// xml :nth-child(...)\n\t\t\t\t\t\t\t// or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t\tif ( diff === false ) {\n\n\t\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t\tif ( ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnodeName( node, name ) :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) &&\n\t\t\t\t\t\t\t\t\t\t++diff ) {\n\n\t\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t\touterCache = node[ expando ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t( node[ expando ] = {} );\n\t\t\t\t\t\t\t\t\t\t\touterCache[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\tPSEUDO: function( pseudo, argument ) {\n\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// https://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tfind.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as jQuery does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction( function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf.call( seed, matched[ i ] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[ i ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t} ) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\n\t\t// Potentially complex pseudos\n\t\tnot: markFunction( function( selector ) {\n\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrimCSS, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction( function( seed, matches, _context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\t\t\t\t\tseed[ i ] = !( matches[ i ] = elem );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} ) :\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tinput[ 0 ] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\n\t\t\t\t\t// Don't keep the element\n\t\t\t\t\t// (see https://github.com/jquery/sizzle/issues/299)\n\t\t\t\t\tinput[ 0 ] = null;\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t} ),\n\n\t\thas: markFunction( function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn find( selector, elem ).length > 0;\n\t\t\t};\n\t\t} ),\n\n\t\tcontains: markFunction( function( text ) {\n\t\t\ttext = text.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t} ),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// https://www.w3.org/TR/selectors/#lang-pseudo\n\t\tlang: markFunction( function( lang ) {\n\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test( lang || \"\" ) ) {\n\t\t\t\tfind.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( ( elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute( \"xml:lang\" ) || elem.getAttribute( \"lang\" ) ) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t} ),\n\n\t\t// Miscellaneous\n\t\ttarget: function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\troot: function( elem ) {\n\t\t\treturn elem === documentElement;\n\t\t},\n\n\t\tfocus: function( elem ) {\n\t\t\treturn elem === safeActiveElement() &&\n\t\t\t\tdocument.hasFocus() &&\n\t\t\t\t!!( elem.type || elem.href || ~elem.tabIndex );\n\t\t},\n\n\t\t// Boolean properties\n\t\tenabled: createDisabledPseudo( false ),\n\t\tdisabled: createDisabledPseudo( true ),\n\n\t\tchecked: function( elem ) {\n\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\treturn ( nodeName( elem, \"input\" ) && !!elem.checked ) ||\n\t\t\t\t( nodeName( elem, \"option\" ) && !!elem.selected );\n\t\t},\n\n\t\tselected: function( elem ) {\n\n\t\t\t// Support: IE <=11+\n\t\t\t// Accessing the selectedIndex property\n\t\t\t// forces the browser to treat the default option as\n\t\t\t// selected when in an optgroup.\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\tempty: function( elem ) {\n\n\t\t\t// https://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n\t\t\t//   but not by others (comment: 8; processing instruction: 7; etc.)\n\t\t\t// nodeType < 6 works because attributes (2) do not appear as children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeType < 6 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\tparent: function( elem ) {\n\t\t\treturn !Expr.pseudos.empty( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\theader: function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\tinput: function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\tbutton: function( elem ) {\n\t\t\treturn nodeName( elem, \"input\" ) && elem.type === \"button\" ||\n\t\t\t\tnodeName( elem, \"button\" );\n\t\t},\n\n\t\ttext: function( elem ) {\n\t\t\tvar attr;\n\t\t\treturn nodeName( elem, \"input\" ) && elem.type === \"text\" &&\n\n\t\t\t\t// Support: IE <10 only\n\t\t\t\t// New HTML5 attribute values (e.g., \"search\") appear\n\t\t\t\t// with elem.type === \"text\"\n\t\t\t\t( ( attr = elem.getAttribute( \"type\" ) ) == null ||\n\t\t\t\t\tattr.toLowerCase() === \"text\" );\n\t\t},\n\n\t\t// Position-in-collection\n\t\tfirst: createPositionalPseudo( function() {\n\t\t\treturn [ 0 ];\n\t\t} ),\n\n\t\tlast: createPositionalPseudo( function( _matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t} ),\n\n\t\teq: createPositionalPseudo( function( _matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t} ),\n\n\t\teven: createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\todd: createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\tlt: createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i;\n\n\t\t\tif ( argument < 0 ) {\n\t\t\t\ti = argument + length;\n\t\t\t} else if ( argument > length ) {\n\t\t\t\ti = length;\n\t\t\t} else {\n\t\t\t\ti = argument;\n\t\t\t}\n\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\tgt: createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} )\n\t}\n};\n\nExpr.pseudos.nth = Expr.pseudos.eq;\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\nfunction tokenize( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || ( match = rcomma.exec( soFar ) ) ) {\n\t\t\tif ( match ) {\n\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[ 0 ].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( ( tokens = [] ) );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( ( match = rleadingCombinator.exec( soFar ) ) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push( {\n\t\t\t\tvalue: matched,\n\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[ 0 ].replace( rtrimCSS, \" \" )\n\t\t\t} );\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||\n\t\t\t\t( match = preFilters[ type ]( match ) ) ) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push( {\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t} );\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\tif ( parseOnly ) {\n\t\treturn soFar.length;\n\t}\n\n\treturn soFar ?\n\t\tfind.error( selector ) :\n\n\t\t// Cache the tokens\n\t\ttokenCache( selector, groups ).slice( 0 );\n}\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[ i ].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tskip = combinator.next,\n\t\tkey = skip || dir,\n\t\tcheckNonElements = base && key === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar oldCache, outerCache,\n\t\t\t\tnewCache = [ dirruns, doneName ];\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || ( elem[ expando ] = {} );\n\n\t\t\t\t\t\tif ( skip && nodeName( elem, skip ) ) {\n\t\t\t\t\t\t\telem = elem[ dir ] || elem;\n\t\t\t\t\t\t} else if ( ( oldCache = outerCache[ key ] ) &&\n\t\t\t\t\t\t\toldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\n\n\t\t\t\t\t\t\t// Assign to newCache so results back-propagate to previous elements\n\t\t\t\t\t\t\treturn ( newCache[ 2 ] = oldCache[ 2 ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Reuse newcache so results back-propagate to previous elements\n\t\t\t\t\t\t\touterCache[ key ] = newCache;\n\n\t\t\t\t\t\t\t// A match means we're done; a fail means we have to keep checking\n\t\t\t\t\t\t\tif ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[ i ]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[ 0 ];\n}\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tfind( selector, contexts[ i ], results );\n\t}\n\treturn results;\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction( function( seed, results, context, xml ) {\n\t\tvar temp, i, elem, matcherOut,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed ||\n\t\t\t\tmultipleContexts( selector || \"*\",\n\t\t\t\t\tcontext.nodeType ? [ context ] : context, [] ),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems;\n\n\t\tif ( matcher ) {\n\n\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter\n\t\t\t// or preexisting results,\n\t\t\tmatcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t[] :\n\n\t\t\t\t// ...otherwise use results directly\n\t\t\t\tresults;\n\n\t\t\t// Find primary matches\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t} else {\n\t\t\tmatcherOut = matcherIn;\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( ( elem = temp[ i ] ) ) {\n\t\t\t\t\tmatcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) ) {\n\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( ( matcherIn[ i ] = elem ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, ( matcherOut = [] ), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) &&\n\t\t\t\t\t\t( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) {\n\n\t\t\t\t\t\tseed[ temp ] = !( results[ temp ] = elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t} );\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[ 0 ].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[ \" \" ],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf.call( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tvar ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || (\n\t\t\t\t( checkContext = context ).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\n\t\t\t// Avoid hanging onto element\n\t\t\t// (see https://github.com/jquery/sizzle/issues/299)\n\t\t\tcheckContext = null;\n\t\t\treturn ret;\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {\n\t\t\tmatchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[ j ].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector(\n\n\t\t\t\t\t\t// If the preceding token was a descendant combinator, insert an implicit any-element `*`\n\t\t\t\t\t\ttokens.slice( 0, i - 1 )\n\t\t\t\t\t\t\t.concat( { value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" } )\n\t\t\t\t\t).replace( rtrimCSS, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\tvar bySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, outermost ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\tsetMatched = [],\n\t\t\t\tcontextBackup = outermostContext,\n\n\t\t\t\t// We must always have either seed elements or outermost context\n\t\t\t\telems = seed || byElement && Expr.find.TAG( \"*\", outermost ),\n\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),\n\t\t\t\tlen = elems.length;\n\n\t\t\tif ( outermost ) {\n\n\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\toutermostContext = context == document || context || outermost;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Support: iOS <=7 - 9 only\n\t\t\t// Tolerate NodeList properties (IE: \"length\"; Safari: <number>) matching\n\t\t\t// elements by id. (see trac-14142)\n\t\t\tfor ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\n\t\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\t\tif ( !context && elem.ownerDocument != document ) {\n\t\t\t\t\t\tsetDocument( elem );\n\t\t\t\t\t\txml = !documentIsHTML;\n\t\t\t\t\t}\n\t\t\t\t\twhile ( ( matcher = elementMatchers[ j++ ] ) ) {\n\t\t\t\t\t\tif ( matcher( elem, context || document, xml ) ) {\n\t\t\t\t\t\t\tpush.call( results, elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( ( elem = !matcher && elem ) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// `i` is now the count of elements visited above, and adding it to `matchedCount`\n\t\t\t// makes the latter nonnegative.\n\t\t\tmatchedCount += i;\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\t// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n\t\t\t// equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n\t\t\t// no element matchers and no seed.\n\t\t\t// Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n\t\t\t// case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n\t\t\t// numerically zero.\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( ( matcher = setMatchers[ j++ ] ) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !( unmatched[ i ] || setMatched[ i ] ) ) {\n\t\t\t\t\t\t\t\tsetMatched[ i ] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tjQuery.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\nfunction compile( selector, match /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !match ) {\n\t\t\tmatch = tokenize( selector );\n\t\t}\n\t\ti = match.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( match[ i ] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache( selector,\n\t\t\tmatcherFromGroupMatchers( elementMatchers, setMatchers ) );\n\n\t\t// Save selector and tokenization\n\t\tcached.selector = selector;\n\t}\n\treturn cached;\n}\n\n/**\n * A low-level selection function that works with jQuery's compiled\n *  selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n *  selector function built with jQuery selector compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\nfunction select( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tcompiled = typeof selector === \"function\" && selector,\n\t\tmatch = !seed && tokenize( ( selector = compiled.selector || selector ) );\n\n\tresults = results || [];\n\n\t// Try to minimize operations if there is only one selector in the list and no seed\n\t// (the latter of which guarantees us context)\n\tif ( match.length === 1 ) {\n\n\t\t// Reduce context if the leading compound selector is an ID\n\t\ttokens = match[ 0 ] = match[ 0 ].slice( 0 );\n\t\tif ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === \"ID\" &&\n\t\t\t\tcontext.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {\n\n\t\t\tcontext = ( Expr.find.ID(\n\t\t\t\ttoken.matches[ 0 ].replace( runescape, funescape ),\n\t\t\t\tcontext\n\t\t\t) || [] )[ 0 ];\n\t\t\tif ( !context ) {\n\t\t\t\treturn results;\n\n\t\t\t// Precompiled matchers will still verify ancestry, so step up a level\n\t\t\t} else if ( compiled ) {\n\t\t\t\tcontext = context.parentNode;\n\t\t\t}\n\n\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t}\n\n\t\t// Fetch a seed set for right-to-left matching\n\t\ti = matchExpr.needsContext.test( selector ) ? 0 : tokens.length;\n\t\twhile ( i-- ) {\n\t\t\ttoken = tokens[ i ];\n\n\t\t\t// Abort if we hit a combinator\n\t\t\tif ( Expr.relative[ ( type = token.type ) ] ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( ( find = Expr.find[ type ] ) ) {\n\n\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\tif ( ( seed = find(\n\t\t\t\t\ttoken.matches[ 0 ].replace( runescape, funescape ),\n\t\t\t\t\trsibling.test( tokens[ 0 ].type ) &&\n\t\t\t\t\t\ttestContext( context.parentNode ) || context\n\t\t\t\t) ) ) {\n\n\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function if one is not provided\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\t( compiled || compile( selector, match ) )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\t!context || rsibling.test( selector ) && testContext( context.parentNode ) || context\n\t);\n\treturn results;\n}\n\n// One-time assignments\n\n// Support: Android <=4.0 - 4.1+\n// Sort stability\nsupport.sortStable = expando.split( \"\" ).sort( sortOrder ).join( \"\" ) === expando;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Android <=4.0 - 4.1+\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert( function( el ) {\n\n\t// Should return 1, but returns 4 (following)\n\treturn el.compareDocumentPosition( document.createElement( \"fieldset\" ) ) & 1;\n} );\n\njQuery.find = find;\n\n// Deprecated\njQuery.expr[ \":\" ] = jQuery.expr.pseudos;\njQuery.unique = jQuery.uniqueSort;\n\n// These have always been private, but they used to be documented as part of\n// Sizzle so let's maintain them for now for backwards compatibility purposes.\nfind.compile = compile;\nfind.select = select;\nfind.setDocument = setDocument;\nfind.tokenize = tokenize;\n\nfind.escape = jQuery.escapeSelector;\nfind.getText = jQuery.text;\nfind.isXML = jQuery.isXMLDoc;\nfind.selectors = jQuery.expr;\nfind.support = jQuery.support;\nfind.uniqueSort = jQuery.uniqueSort;\n\n\t/* eslint-enable */\n\n} )();\n\n\nvar dir = function( elem, dir, until ) {\n\tvar matched = [],\n\t\ttruncate = until !== undefined;\n\n\twhile ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {\n\t\tif ( elem.nodeType === 1 ) {\n\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tmatched.push( elem );\n\t\t}\n\t}\n\treturn matched;\n};\n\n\nvar siblings = function( n, elem ) {\n\tvar matched = [];\n\n\tfor ( ; n; n = n.nextSibling ) {\n\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\tmatched.push( n );\n\t\t}\n\t}\n\n\treturn matched;\n};\n\n\nvar rneedsContext = jQuery.expr.match.needsContext;\n\nvar rsingleTag = ( /^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i );\n\n\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n\tif ( isFunction( qualifier ) ) {\n\t\treturn jQuery.grep( elements, function( elem, i ) {\n\t\t\treturn !!qualifier.call( elem, i, elem ) !== not;\n\t\t} );\n\t}\n\n\t// Single element\n\tif ( qualifier.nodeType ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) !== not;\n\t\t} );\n\t}\n\n\t// Arraylike of elements (jQuery, arguments, Array)\n\tif ( typeof qualifier !== \"string\" ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( indexOf.call( qualifier, elem ) > -1 ) !== not;\n\t\t} );\n\t}\n\n\t// Filtered directly for both simple and complex selectors\n\treturn jQuery.filter( qualifier, elements, not );\n}\n\njQuery.filter = function( expr, elems, not ) {\n\tvar elem = elems[ 0 ];\n\n\tif ( not ) {\n\t\texpr = \":not(\" + expr + \")\";\n\t}\n\n\tif ( elems.length === 1 && elem.nodeType === 1 ) {\n\t\treturn jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];\n\t}\n\n\treturn jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\treturn elem.nodeType === 1;\n\t} ) );\n};\n\njQuery.fn.extend( {\n\tfind: function( selector ) {\n\t\tvar i, ret,\n\t\t\tlen = this.length,\n\t\t\tself = this;\n\n\t\tif ( typeof selector !== \"string\" ) {\n\t\t\treturn this.pushStack( jQuery( selector ).filter( function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} ) );\n\t\t}\n\n\t\tret = this.pushStack( [] );\n\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, self[ i ], ret );\n\t\t}\n\n\t\treturn len > 1 ? jQuery.uniqueSort( ret ) : ret;\n\t},\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], false ) );\n\t},\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], true ) );\n\t},\n\tis: function( selector ) {\n\t\treturn !!winnow(\n\t\t\tthis,\n\n\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t// so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n\t\t\ttypeof selector === \"string\" && rneedsContext.test( selector ) ?\n\t\t\t\tjQuery( selector ) :\n\t\t\t\tselector || [],\n\t\t\tfalse\n\t\t).length;\n\t}\n} );\n\n\n// Initialize a jQuery object\n\n\n// A central reference to the root jQuery(document)\nvar rootjQuery,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)\n\t// Strict HTML recognition (trac-11290: must start with <)\n\t// Shortcut simple #id case for speed\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,\n\n\tinit = jQuery.fn.init = function( selector, context, root ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Method init() accepts an alternate rootjQuery\n\t\t// so migrate can support jQuery.sub (gh-2101)\n\t\troot = root || rootjQuery;\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector[ 0 ] === \"<\" &&\n\t\t\t\tselector[ selector.length - 1 ] === \">\" &&\n\t\t\t\tselector.length >= 3 ) {\n\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && ( match[ 1 ] || !context ) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[ 1 ] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[ 0 ] : context;\n\n\t\t\t\t\t// Option to run scripts is true for back-compat\n\t\t\t\t\t// Intentionally let the error be thrown if parseHTML is not present\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[ 1 ],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[ 2 ] );\n\n\t\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t\t// Inject the element directly into the jQuery object\n\t\t\t\t\t\tthis[ 0 ] = elem;\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || root ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis[ 0 ] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( isFunction( selector ) ) {\n\t\t\treturn root.ready !== undefined ?\n\t\t\t\troot.ready( selector ) :\n\n\t\t\t\t// Execute immediately if ready is not present\n\t\t\t\tselector( jQuery );\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t};\n\n// Give the init function the jQuery prototype for later instantiation\ninit.prototype = jQuery.fn;\n\n// Initialize central reference\nrootjQuery = jQuery( document );\n\n\nvar rparentsprev = /^(?:parents|prev(?:Until|All))/,\n\n\t// Methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.fn.extend( {\n\thas: function( target ) {\n\t\tvar targets = jQuery( target, this ),\n\t\t\tl = targets.length;\n\n\t\treturn this.filter( function() {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[ i ] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tmatched = [],\n\t\t\ttargets = typeof selectors !== \"string\" && jQuery( selectors );\n\n\t\t// Positional selectors never match, since there's no _selection_ context\n\t\tif ( !rneedsContext.test( selectors ) ) {\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tfor ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {\n\n\t\t\t\t\t// Always skip document fragments\n\t\t\t\t\tif ( cur.nodeType < 11 && ( targets ?\n\t\t\t\t\t\ttargets.index( cur ) > -1 :\n\n\t\t\t\t\t\t// Don't pass non-elements to jQuery#find\n\t\t\t\t\t\tcur.nodeType === 1 &&\n\t\t\t\t\t\t\tjQuery.find.matchesSelector( cur, selectors ) ) ) {\n\n\t\t\t\t\t\tmatched.push( cur );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within the set\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// Index in selector\n\t\tif ( typeof elem === \"string\" ) {\n\t\t\treturn indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn indexOf.call( this,\n\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[ 0 ] : elem\n\t\t);\n\t},\n\n\tadd: function( selector, context ) {\n\t\treturn this.pushStack(\n\t\t\tjQuery.uniqueSort(\n\t\t\t\tjQuery.merge( this.get(), jQuery( selector, context ) )\n\t\t\t)\n\t\t);\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter( selector )\n\t\t);\n\t}\n} );\n\nfunction sibling( cur, dir ) {\n\twhile ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}\n\treturn cur;\n}\n\njQuery.each( {\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"parentNode\", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, \"nextSibling\" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, \"previousSibling\" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn siblings( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn siblings( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n\t\tif ( elem.contentDocument != null &&\n\n\t\t\t// Support: IE 11+\n\t\t\t// <object> elements with no `data` attribute has an object\n\t\t\t// `contentDocument` with a `null` prototype.\n\t\t\tgetProto( elem.contentDocument ) ) {\n\n\t\t\treturn elem.contentDocument;\n\t\t}\n\n\t\t// Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only\n\t\t// Treat the template element as a regular one in browsers that\n\t\t// don't support it.\n\t\tif ( nodeName( elem, \"template\" ) ) {\n\t\t\telem = elem.content || elem;\n\t\t}\n\n\t\treturn jQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar matched = jQuery.map( this, fn, until );\n\n\t\tif ( name.slice( -5 ) !== \"Until\" ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === \"string\" ) {\n\t\t\tmatched = jQuery.filter( selector, matched );\n\t\t}\n\n\t\tif ( this.length > 1 ) {\n\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.uniqueSort( matched );\n\t\t\t}\n\n\t\t\t// Reverse order for parents* and prev-derivatives\n\t\t\tif ( rparentsprev.test( name ) ) {\n\t\t\t\tmatched.reverse();\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched );\n\t};\n} );\nvar rnothtmlwhite = ( /[^\\x20\\t\\r\\n\\f]+/g );\n\n\n\n// Convert String-formatted options into Object-formatted ones\nfunction createOptions( options ) {\n\tvar object = {};\n\tjQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t} );\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\tcreateOptions( options ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Flag to know if list is currently firing\n\t\tfiring,\n\n\t\t// Last fire value for non-forgettable lists\n\t\tmemory,\n\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\n\t\t// Flag to prevent firing\n\t\tlocked,\n\n\t\t// Actual callback list\n\t\tlist = [],\n\n\t\t// Queue of execution data for repeatable lists\n\t\tqueue = [],\n\n\t\t// Index of currently firing callback (modified by add/remove as needed)\n\t\tfiringIndex = -1,\n\n\t\t// Fire callbacks\n\t\tfire = function() {\n\n\t\t\t// Enforce single-firing\n\t\t\tlocked = locked || options.once;\n\n\t\t\t// Execute callbacks for all pending executions,\n\t\t\t// respecting firingIndex overrides and runtime changes\n\t\t\tfired = firing = true;\n\t\t\tfor ( ; queue.length; firingIndex = -1 ) {\n\t\t\t\tmemory = queue.shift();\n\t\t\t\twhile ( ++firingIndex < list.length ) {\n\n\t\t\t\t\t// Run callback and check for early termination\n\t\t\t\t\tif ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&\n\t\t\t\t\t\toptions.stopOnFalse ) {\n\n\t\t\t\t\t\t// Jump to end and forget the data so .add doesn't re-fire\n\t\t\t\t\t\tfiringIndex = list.length;\n\t\t\t\t\t\tmemory = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Forget the data if we're done with it\n\t\t\tif ( !options.memory ) {\n\t\t\t\tmemory = false;\n\t\t\t}\n\n\t\t\tfiring = false;\n\n\t\t\t// Clean up if we're done firing for good\n\t\t\tif ( locked ) {\n\n\t\t\t\t// Keep an empty list if we have data for future add calls\n\t\t\t\tif ( memory ) {\n\t\t\t\t\tlist = [];\n\n\t\t\t\t// Otherwise, this object is spent\n\t\t\t\t} else {\n\t\t\t\t\tlist = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Actual Callbacks object\n\t\tself = {\n\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\n\t\t\t\t\t// If we have memory from a past run, we should fire after adding\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfiringIndex = list.length - 1;\n\t\t\t\t\t\tqueue.push( memory );\n\t\t\t\t\t}\n\n\t\t\t\t\t( function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tif ( isFunction( arg ) ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && toType( arg ) !== \"string\" ) {\n\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t} )( arguments );\n\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\tvar index;\n\t\t\t\t\twhile ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\tlist.splice( index, 1 );\n\n\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ?\n\t\t\t\t\tjQuery.inArray( fn, list ) > -1 :\n\t\t\t\t\tlist.length > 0;\n\t\t\t},\n\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Disable .fire and .add\n\t\t\t// Abort any current/pending executions\n\t\t\t// Clear all callbacks and values\n\t\t\tdisable: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tlist = memory = \"\";\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\n\t\t\t// Disable .fire\n\t\t\t// Also disable .add unless we have memory (since it would have no effect)\n\t\t\t// Abort any pending executions\n\t\t\tlock: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tif ( !memory && !firing ) {\n\t\t\t\t\tlist = memory = \"\";\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tlocked: function() {\n\t\t\t\treturn !!locked;\n\t\t\t},\n\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\tif ( !locked ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tqueue.push( args );\n\t\t\t\t\tif ( !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n\nfunction Identity( v ) {\n\treturn v;\n}\nfunction Thrower( ex ) {\n\tthrow ex;\n}\n\nfunction adoptValue( value, resolve, reject, noValue ) {\n\tvar method;\n\n\ttry {\n\n\t\t// Check for promise aspect first to privilege synchronous behavior\n\t\tif ( value && isFunction( ( method = value.promise ) ) ) {\n\t\t\tmethod.call( value ).done( resolve ).fail( reject );\n\n\t\t// Other thenables\n\t\t} else if ( value && isFunction( ( method = value.then ) ) ) {\n\t\t\tmethod.call( value, resolve, reject );\n\n\t\t// Other non-thenables\n\t\t} else {\n\n\t\t\t// Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:\n\t\t\t// * false: [ value ].slice( 0 ) => resolve( value )\n\t\t\t// * true: [ value ].slice( 1 ) => resolve()\n\t\t\tresolve.apply( undefined, [ value ].slice( noValue ) );\n\t\t}\n\n\t// For Promises/A+, convert exceptions into rejections\n\t// Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in\n\t// Deferred#then to conditionally suppress rejection.\n\t} catch ( value ) {\n\n\t\t// Support: Android 4.0 only\n\t\t// Strict mode functions invoked without .call/.apply get global-object context\n\t\treject.apply( undefined, [ value ] );\n\t}\n}\n\njQuery.extend( {\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\n\t\t\t\t// action, add listener, callbacks,\n\t\t\t\t// ... .then handlers, argument index, [final state]\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks( \"memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"memory\" ), 2 ],\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 0, \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 1, \"rejected\" ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\t\"catch\": function( fn ) {\n\t\t\t\t\treturn promise.then( null, fn );\n\t\t\t\t},\n\n\t\t\t\t// Keep pipe for back-compat\n\t\t\t\tpipe: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( _i, tuple ) {\n\n\t\t\t\t\t\t\t// Map tuples (progress, done, fail) to arguments (done, fail, progress)\n\t\t\t\t\t\t\tvar fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];\n\n\t\t\t\t\t\t\t// deferred.progress(function() { bind to newDefer or newDefer.notify })\n\t\t\t\t\t\t\t// deferred.done(function() { bind to newDefer or newDefer.resolve })\n\t\t\t\t\t\t\t// deferred.fail(function() { bind to newDefer or newDefer.reject })\n\t\t\t\t\t\t\tdeferred[ tuple[ 1 ] ]( function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify )\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ tuple[ 0 ] + \"With\" ](\n\t\t\t\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t\t\t\tfn ? [ returned ] : arguments\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\t\t\t\tthen: function( onFulfilled, onRejected, onProgress ) {\n\t\t\t\t\tvar maxDepth = 0;\n\t\t\t\t\tfunction resolve( depth, deferred, handler, special ) {\n\t\t\t\t\t\treturn function() {\n\t\t\t\t\t\t\tvar that = this,\n\t\t\t\t\t\t\t\targs = arguments,\n\t\t\t\t\t\t\t\tmightThrow = function() {\n\t\t\t\t\t\t\t\t\tvar returned, then;\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.3\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-59\n\t\t\t\t\t\t\t\t\t// Ignore double-resolution attempts\n\t\t\t\t\t\t\t\t\tif ( depth < maxDepth ) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturned = handler.apply( that, args );\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.1\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-48\n\t\t\t\t\t\t\t\t\tif ( returned === deferred.promise() ) {\n\t\t\t\t\t\t\t\t\t\tthrow new TypeError( \"Thenable self-resolution\" );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ sections 2.3.3.1, 3.5\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-54\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-75\n\t\t\t\t\t\t\t\t\t// Retrieve `then` only once\n\t\t\t\t\t\t\t\t\tthen = returned &&\n\n\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.4\n\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-64\n\t\t\t\t\t\t\t\t\t\t// Only check objects and functions for thenability\n\t\t\t\t\t\t\t\t\t\t( typeof returned === \"object\" ||\n\t\t\t\t\t\t\t\t\t\t\ttypeof returned === \"function\" ) &&\n\t\t\t\t\t\t\t\t\t\treturned.then;\n\n\t\t\t\t\t\t\t\t\t// Handle a returned thenable\n\t\t\t\t\t\t\t\t\tif ( isFunction( then ) ) {\n\n\t\t\t\t\t\t\t\t\t\t// Special processors (notify) just wait for resolution\n\t\t\t\t\t\t\t\t\t\tif ( special ) {\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special )\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t// Normal processors (resolve) also hook into progress\n\t\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t\t// ...and disregard older resolution values\n\t\t\t\t\t\t\t\t\t\t\tmaxDepth++;\n\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdeferred.notifyWith )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Handle all other returned values\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\tif ( handler !== Identity ) {\n\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\targs = [ returned ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Process the value(s)\n\t\t\t\t\t\t\t\t\t\t// Default process is resolve\n\t\t\t\t\t\t\t\t\t\t( special || deferred.resolveWith )( that, args );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t// Only normal processors (resolve) catch and reject exceptions\n\t\t\t\t\t\t\t\tprocess = special ?\n\t\t\t\t\t\t\t\t\tmightThrow :\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tmightThrow();\n\t\t\t\t\t\t\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t\t\t\t\t\t\tif ( jQuery.Deferred.exceptionHook ) {\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery.Deferred.exceptionHook( e,\n\t\t\t\t\t\t\t\t\t\t\t\t\tprocess.error );\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.4.1\n\t\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-61\n\t\t\t\t\t\t\t\t\t\t\t// Ignore post-resolution exceptions\n\t\t\t\t\t\t\t\t\t\t\tif ( depth + 1 >= maxDepth ) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\t\t\tif ( handler !== Thrower ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\t\t\targs = [ e ];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tdeferred.rejectWith( that, args );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.1\n\t\t\t\t\t\t\t// https://promisesaplus.com/#point-57\n\t\t\t\t\t\t\t// Re-resolve promises immediately to dodge false rejection from\n\t\t\t\t\t\t\t// subsequent errors\n\t\t\t\t\t\t\tif ( depth ) {\n\t\t\t\t\t\t\t\tprocess();\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// Call an optional hook to record the error, in case of exception\n\t\t\t\t\t\t\t\t// since it's otherwise lost when execution goes async\n\t\t\t\t\t\t\t\tif ( jQuery.Deferred.getErrorHook ) {\n\t\t\t\t\t\t\t\t\tprocess.error = jQuery.Deferred.getErrorHook();\n\n\t\t\t\t\t\t\t\t// The deprecated alias of the above. While the name suggests\n\t\t\t\t\t\t\t\t// returning the stack, not an error instance, jQuery just passes\n\t\t\t\t\t\t\t\t// it directly to `console.warn` so both will work; an instance\n\t\t\t\t\t\t\t\t// just better cooperates with source maps.\n\t\t\t\t\t\t\t\t} else if ( jQuery.Deferred.getStackHook ) {\n\t\t\t\t\t\t\t\t\tprocess.error = jQuery.Deferred.getStackHook();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twindow.setTimeout( process );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\n\t\t\t\t\t\t// progress_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 0 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onProgress ) ?\n\t\t\t\t\t\t\t\t\tonProgress :\n\t\t\t\t\t\t\t\t\tIdentity,\n\t\t\t\t\t\t\t\tnewDefer.notifyWith\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// fulfilled_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 1 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onFulfilled ) ?\n\t\t\t\t\t\t\t\t\tonFulfilled :\n\t\t\t\t\t\t\t\t\tIdentity\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// rejected_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 2 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onRejected ) ?\n\t\t\t\t\t\t\t\t\tonRejected :\n\t\t\t\t\t\t\t\t\tThrower\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 5 ];\n\n\t\t\t// promise.progress = list.add\n\t\t\t// promise.done = list.add\n\t\t\t// promise.fail = list.add\n\t\t\tpromise[ tuple[ 1 ] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(\n\t\t\t\t\tfunction() {\n\n\t\t\t\t\t\t// state = \"resolved\" (i.e., fulfilled)\n\t\t\t\t\t\t// state = \"rejected\"\n\t\t\t\t\t\tstate = stateString;\n\t\t\t\t\t},\n\n\t\t\t\t\t// rejected_callbacks.disable\n\t\t\t\t\t// fulfilled_callbacks.disable\n\t\t\t\t\ttuples[ 3 - i ][ 2 ].disable,\n\n\t\t\t\t\t// rejected_handlers.disable\n\t\t\t\t\t// fulfilled_handlers.disable\n\t\t\t\t\ttuples[ 3 - i ][ 3 ].disable,\n\n\t\t\t\t\t// progress_callbacks.lock\n\t\t\t\t\ttuples[ 0 ][ 2 ].lock,\n\n\t\t\t\t\t// progress_handlers.lock\n\t\t\t\t\ttuples[ 0 ][ 3 ].lock\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// progress_handlers.fire\n\t\t\t// fulfilled_handlers.fire\n\t\t\t// rejected_handlers.fire\n\t\t\tlist.add( tuple[ 3 ].fire );\n\n\t\t\t// deferred.notify = function() { deferred.notifyWith(...) }\n\t\t\t// deferred.resolve = function() { deferred.resolveWith(...) }\n\t\t\t// deferred.reject = function() { deferred.rejectWith(...) }\n\t\t\tdeferred[ tuple[ 0 ] ] = function() {\n\t\t\t\tdeferred[ tuple[ 0 ] + \"With\" ]( this === deferred ? undefined : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\t// deferred.notifyWith = list.fireWith\n\t\t\t// deferred.resolveWith = list.fireWith\n\t\t\t// deferred.rejectWith = list.fireWith\n\t\t\tdeferred[ tuple[ 0 ] + \"With\" ] = list.fireWith;\n\t\t} );\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( singleValue ) {\n\t\tvar\n\n\t\t\t// count of uncompleted subordinates\n\t\t\tremaining = arguments.length,\n\n\t\t\t// count of unprocessed arguments\n\t\t\ti = remaining,\n\n\t\t\t// subordinate fulfillment data\n\t\t\tresolveContexts = Array( i ),\n\t\t\tresolveValues = slice.call( arguments ),\n\n\t\t\t// the primary Deferred\n\t\t\tprimary = jQuery.Deferred(),\n\n\t\t\t// subordinate callback factory\n\t\t\tupdateFunc = function( i ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tresolveContexts[ i ] = this;\n\t\t\t\t\tresolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\n\t\t\t\t\tif ( !( --remaining ) ) {\n\t\t\t\t\t\tprimary.resolveWith( resolveContexts, resolveValues );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t// Single- and empty arguments are adopted like Promise.resolve\n\t\tif ( remaining <= 1 ) {\n\t\t\tadoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,\n\t\t\t\t!remaining );\n\n\t\t\t// Use .then() to unwrap secondary thenables (cf. gh-3000)\n\t\t\tif ( primary.state() === \"pending\" ||\n\t\t\t\tisFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {\n\n\t\t\t\treturn primary.then();\n\t\t\t}\n\t\t}\n\n\t\t// Multiple arguments are aggregated like Promise.all array elements\n\t\twhile ( i-- ) {\n\t\t\tadoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );\n\t\t}\n\n\t\treturn primary.promise();\n\t}\n} );\n\n\n// These usually indicate a programmer mistake during development,\n// warn about them ASAP rather than swallowing them by default.\nvar rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\n\n// If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error\n// captured before the async barrier to get the original error cause\n// which may otherwise be hidden.\njQuery.Deferred.exceptionHook = function( error, asyncError ) {\n\n\t// Support: IE 8 - 9 only\n\t// Console exists when dev tools are open, which can happen at any time\n\tif ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {\n\t\twindow.console.warn( \"jQuery.Deferred exception: \" + error.message,\n\t\t\terror.stack, asyncError );\n\t}\n};\n\n\n\n\njQuery.readyException = function( error ) {\n\twindow.setTimeout( function() {\n\t\tthrow error;\n\t} );\n};\n\n\n\n\n// The deferred used on DOM ready\nvar readyList = jQuery.Deferred();\n\njQuery.fn.ready = function( fn ) {\n\n\treadyList\n\t\t.then( fn )\n\n\t\t// Wrap jQuery.readyException in a function so that the lookup\n\t\t// happens at the time of error handling instead of callback\n\t\t// registration.\n\t\t.catch( function( error ) {\n\t\t\tjQuery.readyException( error );\n\t\t} );\n\n\treturn this;\n};\n\njQuery.extend( {\n\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See trac-6781\n\treadyWait: 1,\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we're already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\t}\n} );\n\njQuery.ready.then = readyList.then;\n\n// The ready event handler and self cleanup method\nfunction completed() {\n\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\twindow.removeEventListener( \"load\", completed );\n\tjQuery.ready();\n}\n\n// Catch cases where $(document).ready() is called\n// after the browser event has already occurred.\n// Support: IE <=9 - 10 only\n// Older IE sometimes signals \"interactive\" too soon\nif ( document.readyState === \"complete\" ||\n\t( document.readyState !== \"loading\" && !document.documentElement.doScroll ) ) {\n\n\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\twindow.setTimeout( jQuery.ready );\n\n} else {\n\n\t// Use the handy event callback\n\tdocument.addEventListener( \"DOMContentLoaded\", completed );\n\n\t// A fallback to window.onload, that will always work\n\twindow.addEventListener( \"load\", completed );\n}\n\n\n\n\n// Multifunctional method to get and set values of a collection\n// The value/s can optionally be executed if it's a function\nvar access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\tvar i = 0,\n\t\tlen = elems.length,\n\t\tbulk = key == null;\n\n\t// Sets many values\n\tif ( toType( key ) === \"object\" ) {\n\t\tchainable = true;\n\t\tfor ( i in key ) {\n\t\t\taccess( elems, fn, i, key[ i ], true, emptyGet, raw );\n\t\t}\n\n\t// Sets one value\n\t} else if ( value !== undefined ) {\n\t\tchainable = true;\n\n\t\tif ( !isFunction( value ) ) {\n\t\t\traw = true;\n\t\t}\n\n\t\tif ( bulk ) {\n\n\t\t\t// Bulk operations run against the entire set\n\t\t\tif ( raw ) {\n\t\t\t\tfn.call( elems, value );\n\t\t\t\tfn = null;\n\n\t\t\t// ...except when executing function values\n\t\t\t} else {\n\t\t\t\tbulk = fn;\n\t\t\t\tfn = function( elem, _key, value ) {\n\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( fn ) {\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\tfn(\n\t\t\t\t\telems[ i ], key, raw ?\n\t\t\t\t\t\tvalue :\n\t\t\t\t\t\tvalue.call( elems[ i ], i, fn( elems[ i ], key ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( chainable ) {\n\t\treturn elems;\n\t}\n\n\t// Gets\n\tif ( bulk ) {\n\t\treturn fn.call( elems );\n\t}\n\n\treturn len ? fn( elems[ 0 ], key ) : emptyGet;\n};\n\n\n// Matches dashed string for camelizing\nvar rmsPrefix = /^-ms-/,\n\trdashAlpha = /-([a-z])/g;\n\n// Used by camelCase as callback to replace()\nfunction fcamelCase( _all, letter ) {\n\treturn letter.toUpperCase();\n}\n\n// Convert dashed to camelCase; used by the css and data modules\n// Support: IE <=9 - 11, Edge 12 - 15\n// Microsoft forgot to hump their vendor prefix (trac-9572)\nfunction camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}\nvar acceptData = function( owner ) {\n\n\t// Accepts only:\n\t//  - Node\n\t//    - Node.ELEMENT_NODE\n\t//    - Node.DOCUMENT_NODE\n\t//  - Object\n\t//    - Any\n\treturn owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\n\n\n\nfunction Data() {\n\tthis.expando = jQuery.expando + Data.uid++;\n}\n\nData.uid = 1;\n\nData.prototype = {\n\n\tcache: function( owner ) {\n\n\t\t// Check if the owner object already has a cache\n\t\tvar value = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !value ) {\n\t\t\tvalue = {};\n\n\t\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t\t// but we should not, see trac-8335.\n\t\t\t// Always return an empty object.\n\t\t\tif ( acceptData( owner ) ) {\n\n\t\t\t\t// If it is a node unlikely to be stringify-ed or looped over\n\t\t\t\t// use plain assignment\n\t\t\t\tif ( owner.nodeType ) {\n\t\t\t\t\towner[ this.expando ] = value;\n\n\t\t\t\t// Otherwise secure it in a non-enumerable property\n\t\t\t\t// configurable must be true to allow the property to be\n\t\t\t\t// deleted when data is removed\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty( owner, this.expando, {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tconfigurable: true\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn value;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\tcache = this.cache( owner );\n\n\t\t// Handle: [ owner, key, value ] args\n\t\t// Always use camelCase key (gh-2257)\n\t\tif ( typeof data === \"string\" ) {\n\t\t\tcache[ camelCase( data ) ] = value;\n\n\t\t// Handle: [ owner, { properties } ] args\n\t\t} else {\n\n\t\t\t// Copy the properties one-by-one to the cache object\n\t\t\tfor ( prop in data ) {\n\t\t\t\tcache[ camelCase( prop ) ] = data[ prop ];\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\treturn key === undefined ?\n\t\t\tthis.cache( owner ) :\n\n\t\t\t// Always use camelCase key (gh-2257)\n\t\t\towner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];\n\t},\n\taccess: function( owner, key, value ) {\n\n\t\t// In cases where either:\n\t\t//\n\t\t//   1. No key was specified\n\t\t//   2. A string key was specified, but no value provided\n\t\t//\n\t\t// Take the \"read\" path and allow the get method to determine\n\t\t// which value to return, respectively either:\n\t\t//\n\t\t//   1. The entire cache object\n\t\t//   2. The data stored at the key\n\t\t//\n\t\tif ( key === undefined ||\n\t\t\t\t( ( key && typeof key === \"string\" ) && value === undefined ) ) {\n\n\t\t\treturn this.get( owner, key );\n\t\t}\n\n\t\t// When the key is not a string, or both a key and value\n\t\t// are specified, set or extend (existing objects) with either:\n\t\t//\n\t\t//   1. An object of properties\n\t\t//   2. A key and value\n\t\t//\n\t\tthis.set( owner, key, value );\n\n\t\t// Since the \"set\" path can have two possible entry points\n\t\t// return the expected data based on which path was taken[*]\n\t\treturn value !== undefined ? value : key;\n\t},\n\tremove: function( owner, key ) {\n\t\tvar i,\n\t\t\tcache = owner[ this.expando ];\n\n\t\tif ( cache === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( key !== undefined ) {\n\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( Array.isArray( key ) ) {\n\n\t\t\t\t// If key is an array of keys...\n\t\t\t\t// We always set camelCase keys, so remove that.\n\t\t\t\tkey = key.map( camelCase );\n\t\t\t} else {\n\t\t\t\tkey = camelCase( key );\n\n\t\t\t\t// If a key with the spaces exists, use it.\n\t\t\t\t// Otherwise, create an array by matching non-whitespace\n\t\t\t\tkey = key in cache ?\n\t\t\t\t\t[ key ] :\n\t\t\t\t\t( key.match( rnothtmlwhite ) || [] );\n\t\t\t}\n\n\t\t\ti = key.length;\n\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ key[ i ] ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if there's no more data\n\t\tif ( key === undefined || jQuery.isEmptyObject( cache ) ) {\n\n\t\t\t// Support: Chrome <=35 - 45\n\t\t\t// Webkit & Blink performance suffers when deleting properties\n\t\t\t// from DOM nodes, so set to undefined instead\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\n\t\t\tif ( owner.nodeType ) {\n\t\t\t\towner[ this.expando ] = undefined;\n\t\t\t} else {\n\t\t\t\tdelete owner[ this.expando ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\tvar cache = owner[ this.expando ];\n\t\treturn cache !== undefined && !jQuery.isEmptyObject( cache );\n\t}\n};\nvar dataPriv = new Data();\n\nvar dataUser = new Data();\n\n\n\n//\tImplementation Summary\n//\n//\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n//\t2. Improve the module's maintainability by reducing the storage\n//\t\tpaths to a single mechanism.\n//\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n//\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n//\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n//\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\nvar rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n\trmultiDash = /[A-Z]/g;\n\nfunction getData( data ) {\n\tif ( data === \"true\" ) {\n\t\treturn true;\n\t}\n\n\tif ( data === \"false\" ) {\n\t\treturn false;\n\t}\n\n\tif ( data === \"null\" ) {\n\t\treturn null;\n\t}\n\n\t// Only convert to a number if it doesn't change the string\n\tif ( data === +data + \"\" ) {\n\t\treturn +data;\n\t}\n\n\tif ( rbrace.test( data ) ) {\n\t\treturn JSON.parse( data );\n\t}\n\n\treturn data;\n}\n\nfunction dataAttr( elem, key, data ) {\n\tvar name;\n\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\t\tname = \"data-\" + key.replace( rmultiDash, \"-$&\" ).toLowerCase();\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === \"string\" ) {\n\t\t\ttry {\n\t\t\t\tdata = getData( data );\n\t\t\t} catch ( e ) {}\n\n\t\t\t// Make sure we set the data so it isn't changed later\n\t\t\tdataUser.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\n\njQuery.extend( {\n\thasData: function( elem ) {\n\t\treturn dataUser.hasData( elem ) || dataPriv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn dataUser.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdataUser.remove( elem, name );\n\t},\n\n\t// TODO: Now that all calls to _data and _removeData have been replaced\n\t// with direct calls to dataPriv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn dataPriv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdataPriv.remove( elem, name );\n\t}\n} );\n\njQuery.fn.extend( {\n\tdata: function( key, value ) {\n\t\tvar i, name, data,\n\t\t\telem = this[ 0 ],\n\t\t\tattrs = elem && elem.attributes;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = dataUser.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !dataPriv.get( elem, \"hasDataAttrs\" ) ) {\n\t\t\t\t\ti = attrs.length;\n\t\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\t\t// Support: IE 11 only\n\t\t\t\t\t\t// The attrs elements can be null (trac-14894)\n\t\t\t\t\t\tif ( attrs[ i ] ) {\n\t\t\t\t\t\t\tname = attrs[ i ].name;\n\t\t\t\t\t\t\tif ( name.indexOf( \"data-\" ) === 0 ) {\n\t\t\t\t\t\t\t\tname = camelCase( name.slice( 5 ) );\n\t\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdataPriv.set( elem, \"hasDataAttrs\", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === \"object\" ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tdataUser.set( this, key );\n\t\t\t} );\n\t\t}\n\n\t\treturn access( this, function( value ) {\n\t\t\tvar data;\n\n\t\t\t// The calling jQuery object (element matches) is not empty\n\t\t\t// (and therefore has an element appears at this[ 0 ]) and the\n\t\t\t// `value` parameter was not undefined. An empty jQuery object\n\t\t\t// will result in `undefined` for elem = this[ 0 ] which will\n\t\t\t// throw an exception if an attempt to read a data cache is made.\n\t\t\tif ( elem && value === undefined ) {\n\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// The key will always be camelCased in Data\n\t\t\t\tdata = dataUser.get( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to \"discover\" the data in\n\t\t\t\t// HTML5 custom data-* attrs\n\t\t\t\tdata = dataAttr( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// We tried really hard, but the data doesn't exist.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the data...\n\t\t\tthis.each( function() {\n\n\t\t\t\t// We always store the camelCased key\n\t\t\t\tdataUser.set( this, key, value );\n\t\t\t} );\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each( function() {\n\t\t\tdataUser.remove( this, key );\n\t\t} );\n\t}\n} );\n\n\njQuery.extend( {\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || \"fx\" ) + \"queue\";\n\t\t\tqueue = dataPriv.get( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || Array.isArray( data ) ) {\n\t\t\t\t\tqueue = dataPriv.access( elem, type, jQuery.makeArray( data ) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || \"fx\";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === \"inprogress\" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === \"fx\" ) {\n\t\t\t\tqueue.unshift( \"inprogress\" );\n\t\t\t}\n\n\t\t\t// Clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// Not public - generate a queueHooks object, or return the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn dataPriv.get( elem, key ) || dataPriv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks( \"once memory\" ).add( function() {\n\t\t\t\tdataPriv.remove( elem, [ type + \"queue\", key ] );\n\t\t\t} )\n\t\t} );\n\t}\n} );\n\njQuery.fn.extend( {\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tdata = type;\n\t\t\ttype = \"fx\";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[ 0 ], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each( function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// Ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === \"fx\" && queue[ 0 ] !== \"inprogress\" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t} );\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t} );\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || \"fx\";\n\n\t\twhile ( i-- ) {\n\t\t\ttmp = dataPriv.get( elements[ i ], type + \"queueHooks\" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n} );\nvar pnum = ( /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/ ).source;\n\nvar rcssNum = new RegExp( \"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\" );\n\n\nvar cssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ];\n\nvar documentElement = document.documentElement;\n\n\n\n\tvar isAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem );\n\t\t},\n\t\tcomposed = { composed: true };\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only\n\t// Check attachment across shadow DOM boundaries when possible (gh-3504)\n\t// Support: iOS 10.0-10.2 only\n\t// Early iOS 10 versions support `attachShadow` but not `getRootNode`,\n\t// leading to errors. We need to check for `getRootNode`.\n\tif ( documentElement.getRootNode ) {\n\t\tisAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem ) ||\n\t\t\t\telem.getRootNode( composed ) === elem.ownerDocument;\n\t\t};\n\t}\nvar isHiddenWithinTree = function( elem, el ) {\n\n\t\t// isHiddenWithinTree might be called from jQuery#filter function;\n\t\t// in that case, element will be second argument\n\t\telem = el || elem;\n\n\t\t// Inline style trumps all\n\t\treturn elem.style.display === \"none\" ||\n\t\t\telem.style.display === \"\" &&\n\n\t\t\t// Otherwise, check computed style\n\t\t\t// Support: Firefox <=43 - 45\n\t\t\t// Disconnected elements can have computed display: none, so first confirm that elem is\n\t\t\t// in the document.\n\t\t\tisAttached( elem ) &&\n\n\t\t\tjQuery.css( elem, \"display\" ) === \"none\";\n\t};\n\n\n\nfunction adjustCSS( elem, prop, valueParts, tween ) {\n\tvar adjusted, scale,\n\t\tmaxIterations = 20,\n\t\tcurrentValue = tween ?\n\t\t\tfunction() {\n\t\t\t\treturn tween.cur();\n\t\t\t} :\n\t\t\tfunction() {\n\t\t\t\treturn jQuery.css( elem, prop, \"\" );\n\t\t\t},\n\t\tinitial = currentValue(),\n\t\tunit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n\t\t// Starting value computation is required for potential unit mismatches\n\t\tinitialInUnit = elem.nodeType &&\n\t\t\t( jQuery.cssNumber[ prop ] || unit !== \"px\" && +initial ) &&\n\t\t\trcssNum.exec( jQuery.css( elem, prop ) );\n\n\tif ( initialInUnit && initialInUnit[ 3 ] !== unit ) {\n\n\t\t// Support: Firefox <=54\n\t\t// Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)\n\t\tinitial = initial / 2;\n\n\t\t// Trust units reported by jQuery.css\n\t\tunit = unit || initialInUnit[ 3 ];\n\n\t\t// Iteratively approximate from a nonzero starting point\n\t\tinitialInUnit = +initial || 1;\n\n\t\twhile ( maxIterations-- ) {\n\n\t\t\t// Evaluate and update our best guess (doubling guesses that zero out).\n\t\t\t// Finish if the scale equals or crosses 1 (making the old*new product non-positive).\n\t\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\t\t\tif ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {\n\t\t\t\tmaxIterations = 0;\n\t\t\t}\n\t\t\tinitialInUnit = initialInUnit / scale;\n\n\t\t}\n\n\t\tinitialInUnit = initialInUnit * 2;\n\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\n\t\t// Make sure we update the tween properties later on\n\t\tvalueParts = valueParts || [];\n\t}\n\n\tif ( valueParts ) {\n\t\tinitialInUnit = +initialInUnit || +initial || 0;\n\n\t\t// Apply relative offset (+=/-=) if specified\n\t\tadjusted = valueParts[ 1 ] ?\n\t\t\tinitialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :\n\t\t\t+valueParts[ 2 ];\n\t\tif ( tween ) {\n\t\t\ttween.unit = unit;\n\t\t\ttween.start = initialInUnit;\n\t\t\ttween.end = adjusted;\n\t\t}\n\t}\n\treturn adjusted;\n}\n\n\nvar defaultDisplayMap = {};\n\nfunction getDefaultDisplay( elem ) {\n\tvar temp,\n\t\tdoc = elem.ownerDocument,\n\t\tnodeName = elem.nodeName,\n\t\tdisplay = defaultDisplayMap[ nodeName ];\n\n\tif ( display ) {\n\t\treturn display;\n\t}\n\n\ttemp = doc.body.appendChild( doc.createElement( nodeName ) );\n\tdisplay = jQuery.css( temp, \"display\" );\n\n\ttemp.parentNode.removeChild( temp );\n\n\tif ( display === \"none\" ) {\n\t\tdisplay = \"block\";\n\t}\n\tdefaultDisplayMap[ nodeName ] = display;\n\n\treturn display;\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\t// Determine new display value for elements that need to change\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\n\t\t\t// Since we force visibility upon cascade-hidden elements, an immediate (and slow)\n\t\t\t// check is required in this first loop unless we have a nonempty display value (either\n\t\t\t// inline or about-to-be-restored)\n\t\t\tif ( display === \"none\" ) {\n\t\t\t\tvalues[ index ] = dataPriv.get( elem, \"display\" ) || null;\n\t\t\t\tif ( !values[ index ] ) {\n\t\t\t\t\telem.style.display = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( elem.style.display === \"\" && isHiddenWithinTree( elem ) ) {\n\t\t\t\tvalues[ index ] = getDefaultDisplay( elem );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( display !== \"none\" ) {\n\t\t\t\tvalues[ index ] = \"none\";\n\n\t\t\t\t// Remember what we're overwriting\n\t\t\t\tdataPriv.set( elem, \"display\", display );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of the elements in a second loop to avoid constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\tif ( values[ index ] != null ) {\n\t\t\telements[ index ].style.display = values[ index ];\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.fn.extend( {\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tif ( typeof state === \"boolean\" ) {\n\t\t\treturn state ? this.show() : this.hide();\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tif ( isHiddenWithinTree( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t} );\n\t}\n} );\nvar rcheckableType = ( /^(?:checkbox|radio)$/i );\n\nvar rtagName = ( /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i );\n\nvar rscriptType = ( /^$|^module$|\\/(?:java|ecma)script/i );\n\n\n\n( function() {\n\tvar fragment = document.createDocumentFragment(),\n\t\tdiv = fragment.appendChild( document.createElement( \"div\" ) ),\n\t\tinput = document.createElement( \"input\" );\n\n\t// Support: Android 4.0 - 4.3 only\n\t// Check state lost if the name is set (trac-11217)\n\t// Support: Windows Web Apps (WWA)\n\t// `name` and `type` must use .setAttribute for WWA (trac-14901)\n\tinput.setAttribute( \"type\", \"radio\" );\n\tinput.setAttribute( \"checked\", \"checked\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tdiv.appendChild( input );\n\n\t// Support: Android <=4.1 only\n\t// Older WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: IE <=11 only\n\t// Make sure textarea (and checkbox) defaultValue is properly cloned\n\tdiv.innerHTML = \"<textarea>x</textarea>\";\n\tsupport.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\n\n\t// Support: IE <=9 only\n\t// IE <=9 replaces <option> tags with their contents when inserted outside of\n\t// the select element.\n\tdiv.innerHTML = \"<option></option>\";\n\tsupport.option = !!div.lastChild;\n} )();\n\n\n// We have to close these tags to support XHTML (trac-13200)\nvar wrapMap = {\n\n\t// XHTML parsers do not magically insert elements in the\n\t// same way that tag soup parsers do. So we cannot shorten\n\t// this by omitting <tbody> or other required elements.\n\tthead: [ 1, \"<table>\", \"</table>\" ],\n\tcol: [ 2, \"<table><colgroup>\", \"</colgroup></table>\" ],\n\ttr: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n\ttd: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n\n\t_default: [ 0, \"\", \"\" ]\n};\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n// Support: IE <=9 only\nif ( !support.option ) {\n\twrapMap.optgroup = wrapMap.option = [ 1, \"<select multiple='multiple'>\", \"</select>\" ];\n}\n\n\nfunction getAll( context, tag ) {\n\n\t// Support: IE <=9 - 11 only\n\t// Use typeof to avoid zero-argument method invocation on host objects (trac-15151)\n\tvar ret;\n\n\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\tret = context.getElementsByTagName( tag || \"*\" );\n\n\t} else if ( typeof context.querySelectorAll !== \"undefined\" ) {\n\t\tret = context.querySelectorAll( tag || \"*\" );\n\n\t} else {\n\t\tret = [];\n\t}\n\n\tif ( tag === undefined || tag && nodeName( context, tag ) ) {\n\t\treturn jQuery.merge( [ context ], ret );\n\t}\n\n\treturn ret;\n}\n\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar i = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdataPriv.set(\n\t\t\telems[ i ],\n\t\t\t\"globalEval\",\n\t\t\t!refElements || dataPriv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}\n\n\nvar rhtml = /<|&#?\\w+;/;\n\nfunction buildFragment( elems, context, scripts, selection, ignored ) {\n\tvar elem, tmp, tag, wrap, attached, j,\n\t\tfragment = context.createDocumentFragment(),\n\t\tnodes = [],\n\t\ti = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\telem = elems[ i ];\n\n\t\tif ( elem || elem === 0 ) {\n\n\t\t\t// Add nodes directly\n\t\t\tif ( toType( elem ) === \"object\" ) {\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t// Convert non-html into a text node\n\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t// Convert html into DOM nodes\n\t\t\t} else {\n\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement( \"div\" ) );\n\n\t\t\t\t// Deserialize a standard representation\n\t\t\t\ttag = ( rtagName.exec( elem ) || [ \"\", \"\" ] )[ 1 ].toLowerCase();\n\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\ttmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];\n\n\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\tj = wrap[ 0 ];\n\t\t\t\twhile ( j-- ) {\n\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t}\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t// Remember the top-level container\n\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t// Ensure the created nodes are orphaned (trac-12392)\n\t\t\t\ttmp.textContent = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove wrapper from fragment\n\tfragment.textContent = \"\";\n\n\ti = 0;\n\twhile ( ( elem = nodes[ i++ ] ) ) {\n\n\t\t// Skip elements already in the context collection (trac-4087)\n\t\tif ( selection && jQuery.inArray( elem, selection ) > -1 ) {\n\t\t\tif ( ignored ) {\n\t\t\t\tignored.push( elem );\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tattached = isAttached( elem );\n\n\t\t// Append to fragment\n\t\ttmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n\t\t// Preserve script evaluation history\n\t\tif ( attached ) {\n\t\t\tsetGlobalEval( tmp );\n\t\t}\n\n\t\t// Capture executables\n\t\tif ( scripts ) {\n\t\t\tj = 0;\n\t\t\twhile ( ( elem = tmp[ j++ ] ) ) {\n\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\tscripts.push( elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn fragment;\n}\n\n\nvar rtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\nfunction on( elem, types, selector, data, fn, one ) {\n\tvar origFn, type;\n\n\t// Types can be a map of types/handlers\n\tif ( typeof types === \"object\" ) {\n\n\t\t// ( types-Object, selector, data )\n\t\tif ( typeof selector !== \"string\" ) {\n\n\t\t\t// ( types-Object, data )\n\t\t\tdata = data || selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tfor ( type in types ) {\n\t\t\ton( elem, type, selector, data, types[ type ], one );\n\t\t}\n\t\treturn elem;\n\t}\n\n\tif ( data == null && fn == null ) {\n\n\t\t// ( types, fn )\n\t\tfn = selector;\n\t\tdata = selector = undefined;\n\t} else if ( fn == null ) {\n\t\tif ( typeof selector === \"string\" ) {\n\n\t\t\t// ( types, selector, fn )\n\t\t\tfn = data;\n\t\t\tdata = undefined;\n\t\t} else {\n\n\t\t\t// ( types, data, fn )\n\t\t\tfn = data;\n\t\t\tdata = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t}\n\tif ( fn === false ) {\n\t\tfn = returnFalse;\n\t} else if ( !fn ) {\n\t\treturn elem;\n\t}\n\n\tif ( one === 1 ) {\n\t\torigFn = fn;\n\t\tfn = function( event ) {\n\n\t\t\t// Can use an empty set, since event contains the info\n\t\t\tjQuery().off( event );\n\t\t\treturn origFn.apply( this, arguments );\n\t\t};\n\n\t\t// Use same guid so caller can remove using origFn\n\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t}\n\treturn elem.each( function() {\n\t\tjQuery.event.add( this, types, fn, data, selector );\n\t} );\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\n\t\tvar handleObjIn, eventHandle, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.get( elem );\n\n\t\t// Only attach events to objects that accept data\n\t\tif ( !acceptData( elem ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Ensure that invalid selectors throw exceptions at attach time\n\t\t// Evaluate against documentElement in case elem is a non-element node (e.g., document)\n\t\tif ( selector ) {\n\t\t\tjQuery.find.matchesSelector( documentElement, selector );\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element's event structure and main handler, if this is the first\n\t\tif ( !( events = elemData.events ) ) {\n\t\t\tevents = elemData.events = Object.create( null );\n\t\t}\n\t\tif ( !( eventHandle = elemData.handle ) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== \"undefined\" && jQuery.event.triggered !== e.type ?\n\t\t\t\t\tjQuery.event.dispatch.apply( elem, arguments ) : undefined;\n\t\t\t};\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// There *must* be a type, no attaching namespace-only handlers\n\t\t\tif ( !type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend( {\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join( \".\" )\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we're the first\n\t\t\tif ( !( handlers = events[ type ] ) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener if the special events handler returns false\n\t\t\t\tif ( !special.setup ||\n\t\t\t\t\tspecial.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element's handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\n\t\tvar j, origCount, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.hasData( elem ) && dataPriv.get( elem );\n\n\t\tif ( !elemData || !( events = elemData.events ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[ 2 ] &&\n\t\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector ||\n\t\t\t\t\t\tselector === \"**\" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown ||\n\t\t\t\t\tspecial.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove data and the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdataPriv.remove( elem, \"handle events\" );\n\t\t}\n\t},\n\n\tdispatch: function( nativeEvent ) {\n\n\t\tvar i, j, ret, matched, handleObj, handlerQueue,\n\t\t\targs = new Array( arguments.length ),\n\n\t\t\t// Make a writable jQuery.Event from the native event object\n\t\t\tevent = jQuery.event.fix( nativeEvent ),\n\n\t\t\thandlers = (\n\t\t\t\tdataPriv.get( this, \"events\" ) || Object.create( null )\n\t\t\t)[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[ 0 ] = event;\n\n\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( ( handleObj = matched.handlers[ j++ ] ) &&\n\t\t\t\t!event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// If the event is namespaced, then each handler is only invoked if it is\n\t\t\t\t// specially universal or its namespaces are a superset of the event's.\n\t\t\t\tif ( !event.rnamespace || handleObj.namespace === false ||\n\t\t\t\t\tevent.rnamespace.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||\n\t\t\t\t\t\thandleObj.handler ).apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( ( event.result = ret ) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar i, handleObj, sel, matchedHandlers, matchedSelectors,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\tif ( delegateCount &&\n\n\t\t\t// Support: IE <=9\n\t\t\t// Black-hole SVG <use> instance trees (trac-13180)\n\t\t\tcur.nodeType &&\n\n\t\t\t// Support: Firefox <=42\n\t\t\t// Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\n\t\t\t// https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\n\t\t\t// Support: IE 11 only\n\t\t\t// ...but not arrow key \"clicks\" of radio inputs, which can have `button` -1 (gh-2343)\n\t\t\t!( event.type === \"click\" && event.button >= 1 ) ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't check non-elements (trac-13208)\n\t\t\t\t// Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)\n\t\t\t\tif ( cur.nodeType === 1 && !( event.type === \"click\" && cur.disabled === true ) ) {\n\t\t\t\t\tmatchedHandlers = [];\n\t\t\t\t\tmatchedSelectors = {};\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don't conflict with Object.prototype properties (trac-13203)\n\t\t\t\t\t\tsel = handleObj.selector + \" \";\n\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatchedSelectors[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) > -1 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] ) {\n\t\t\t\t\t\t\tmatchedHandlers.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matchedHandlers.length ) {\n\t\t\t\t\t\thandlerQueue.push( { elem: cur, handlers: matchedHandlers } );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tcur = this;\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\taddProp: function( name, hook ) {\n\t\tObject.defineProperty( jQuery.Event.prototype, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\n\t\t\tget: isFunction( hook ) ?\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\treturn hook( this.originalEvent );\n\t\t\t\t\t}\n\t\t\t\t} :\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\treturn this.originalEvent[ name ];\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\tset: function( value ) {\n\t\t\t\tObject.defineProperty( this, name, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: value\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t},\n\n\tfix: function( originalEvent ) {\n\t\treturn originalEvent[ jQuery.expando ] ?\n\t\t\toriginalEvent :\n\t\t\tnew jQuery.Event( originalEvent );\n\t},\n\n\tspecial: {\n\t\tload: {\n\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tclick: {\n\n\t\t\t// Utilize native event to ensure correct state for checkable inputs\n\t\t\tsetup: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Claim the first handler\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\t// dataPriv.set( el, \"click\", ... )\n\t\t\t\t\tleverageNative( el, \"click\", true );\n\t\t\t\t}\n\n\t\t\t\t// Return false to allow normal processing in the caller\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\ttrigger: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Force setup before triggering a click\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\tleverageNative( el, \"click\" );\n\t\t\t\t}\n\n\t\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\t// For cross-browser consistency, suppress native .click() on links\n\t\t\t// Also prevent it if we're currently inside a leveraged native-event stack\n\t\t\t_default: function( event ) {\n\t\t\t\tvar target = event.target;\n\t\t\t\treturn rcheckableType.test( target.type ) &&\n\t\t\t\t\ttarget.click && nodeName( target, \"input\" ) &&\n\t\t\t\t\tdataPriv.get( target, \"click\" ) ||\n\t\t\t\t\tnodeName( target, \"a\" );\n\t\t\t}\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Support: Firefox 20+\n\t\t\t\t// Firefox doesn't alert if the returnValue field is not set.\n\t\t\t\tif ( event.result !== undefined && event.originalEvent ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Ensure the presence of an event listener that handles manually-triggered\n// synthetic events by interrupting progress until reinvoked in response to\n// *native* events that it fires directly, ensuring that state changes have\n// already occurred before other listeners are invoked.\nfunction leverageNative( el, type, isSetup ) {\n\n\t// Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add\n\tif ( !isSetup ) {\n\t\tif ( dataPriv.get( el, type ) === undefined ) {\n\t\t\tjQuery.event.add( el, type, returnTrue );\n\t\t}\n\t\treturn;\n\t}\n\n\t// Register the controller as a special universal handler for all event namespaces\n\tdataPriv.set( el, type, false );\n\tjQuery.event.add( el, type, {\n\t\tnamespace: false,\n\t\thandler: function( event ) {\n\t\t\tvar result,\n\t\t\t\tsaved = dataPriv.get( this, type );\n\n\t\t\tif ( ( event.isTrigger & 1 ) && this[ type ] ) {\n\n\t\t\t\t// Interrupt processing of the outer synthetic .trigger()ed event\n\t\t\t\tif ( !saved ) {\n\n\t\t\t\t\t// Store arguments for use when handling the inner native event\n\t\t\t\t\t// There will always be at least one argument (an event object), so this array\n\t\t\t\t\t// will not be confused with a leftover capture object.\n\t\t\t\t\tsaved = slice.call( arguments );\n\t\t\t\t\tdataPriv.set( this, type, saved );\n\n\t\t\t\t\t// Trigger the native event and capture its result\n\t\t\t\t\tthis[ type ]();\n\t\t\t\t\tresult = dataPriv.get( this, type );\n\t\t\t\t\tdataPriv.set( this, type, false );\n\n\t\t\t\t\tif ( saved !== result ) {\n\n\t\t\t\t\t\t// Cancel the outer synthetic event\n\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\n\t\t\t\t// If this is an inner synthetic event for an event with a bubbling surrogate\n\t\t\t\t// (focus or blur), assume that the surrogate already propagated from triggering\n\t\t\t\t// the native event and prevent that from happening again here.\n\t\t\t\t// This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the\n\t\t\t\t// bubbling surrogate propagates *after* the non-bubbling base), but that seems\n\t\t\t\t// less bad than duplication.\n\t\t\t\t} else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t}\n\n\t\t\t// If this is a native event triggered above, everything is now in order\n\t\t\t// Fire an inner synthetic event with the original arguments\n\t\t\t} else if ( saved ) {\n\n\t\t\t\t// ...and capture the result\n\t\t\t\tdataPriv.set( this, type, jQuery.event.trigger(\n\t\t\t\t\tsaved[ 0 ],\n\t\t\t\t\tsaved.slice( 1 ),\n\t\t\t\t\tthis\n\t\t\t\t) );\n\n\t\t\t\t// Abort handling of the native event by all jQuery handlers while allowing\n\t\t\t\t// native handlers on the same element to run. On target, this is achieved\n\t\t\t\t// by stopping immediate propagation just on the jQuery event. However,\n\t\t\t\t// the native event is re-wrapped by a jQuery one on each level of the\n\t\t\t\t// propagation so the only way to stop it for jQuery is to stop it for\n\t\t\t\t// everyone via native `stopPropagation()`. This is not a problem for\n\t\t\t\t// focus/blur which don't bubble, but it does also stop click on checkboxes\n\t\t\t\t// and radios. We accept this limitation.\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tevent.isImmediatePropagationStopped = returnTrue;\n\t\t\t}\n\t\t}\n\t} );\n}\n\njQuery.removeEvent = function( elem, type, handle ) {\n\n\t// This \"if\" is needed for plain objects\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\n\t// Allow instantiation without the 'new' keyword\n\tif ( !( this instanceof jQuery.Event ) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = src.defaultPrevented ||\n\t\t\t\tsrc.defaultPrevented === undefined &&\n\n\t\t\t\t// Support: Android <=2.3 only\n\t\t\t\tsrc.returnValue === false ?\n\t\t\treturnTrue :\n\t\t\treturnFalse;\n\n\t\t// Create target properties\n\t\t// Support: Safari <=6 - 7 only\n\t\t// Target should not be a text node (trac-504, trac-13143)\n\t\tthis.target = ( src.target && src.target.nodeType === 3 ) ?\n\t\t\tsrc.target.parentNode :\n\t\t\tsrc.target;\n\n\t\tthis.currentTarget = src.currentTarget;\n\t\tthis.relatedTarget = src.relatedTarget;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn't have one\n\tthis.timeStamp = src && src.timeStamp || Date.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tconstructor: jQuery.Event,\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\tisSimulated: false,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.preventDefault();\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Includes all common event props including KeyEvent and MouseEvent specific props\njQuery.each( {\n\taltKey: true,\n\tbubbles: true,\n\tcancelable: true,\n\tchangedTouches: true,\n\tctrlKey: true,\n\tdetail: true,\n\teventPhase: true,\n\tmetaKey: true,\n\tpageX: true,\n\tpageY: true,\n\tshiftKey: true,\n\tview: true,\n\t\"char\": true,\n\tcode: true,\n\tcharCode: true,\n\tkey: true,\n\tkeyCode: true,\n\tbutton: true,\n\tbuttons: true,\n\tclientX: true,\n\tclientY: true,\n\toffsetX: true,\n\toffsetY: true,\n\tpointerId: true,\n\tpointerType: true,\n\tscreenX: true,\n\tscreenY: true,\n\ttargetTouches: true,\n\ttoElement: true,\n\ttouches: true,\n\twhich: true\n}, jQuery.event.addProp );\n\njQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( type, delegateType ) {\n\n\tfunction focusMappedHandler( nativeEvent ) {\n\t\tif ( document.documentMode ) {\n\n\t\t\t// Support: IE 11+\n\t\t\t// Attach a single focusin/focusout handler on the document while someone wants\n\t\t\t// focus/blur. This is because the former are synchronous in IE while the latter\n\t\t\t// are async. In other browsers, all those handlers are invoked synchronously.\n\n\t\t\t// `handle` from private data would already wrap the event, but we need\n\t\t\t// to change the `type` here.\n\t\t\tvar handle = dataPriv.get( this, \"handle\" ),\n\t\t\t\tevent = jQuery.event.fix( nativeEvent );\n\t\t\tevent.type = nativeEvent.type === \"focusin\" ? \"focus\" : \"blur\";\n\t\t\tevent.isSimulated = true;\n\n\t\t\t// First, handle focusin/focusout\n\t\t\thandle( nativeEvent );\n\n\t\t\t// ...then, handle focus/blur\n\t\t\t//\n\t\t\t// focus/blur don't bubble while focusin/focusout do; simulate the former by only\n\t\t\t// invoking the handler at the lower level.\n\t\t\tif ( event.target === event.currentTarget ) {\n\n\t\t\t\t// The setup part calls `leverageNative`, which, in turn, calls\n\t\t\t\t// `jQuery.event.add`, so event handle will already have been set\n\t\t\t\t// by this point.\n\t\t\t\thandle( event );\n\t\t\t}\n\t\t} else {\n\n\t\t\t// For non-IE browsers, attach a single capturing handler on the document\n\t\t\t// while someone wants focusin/focusout.\n\t\t\tjQuery.event.simulate( delegateType, nativeEvent.target,\n\t\t\t\tjQuery.event.fix( nativeEvent ) );\n\t\t}\n\t}\n\n\tjQuery.event.special[ type ] = {\n\n\t\t// Utilize native event if possible so blur/focus sequence is correct\n\t\tsetup: function() {\n\n\t\t\tvar attaches;\n\n\t\t\t// Claim the first handler\n\t\t\t// dataPriv.set( this, \"focus\", ... )\n\t\t\t// dataPriv.set( this, \"blur\", ... )\n\t\t\tleverageNative( this, type, true );\n\n\t\t\tif ( document.documentMode ) {\n\n\t\t\t\t// Support: IE 9 - 11+\n\t\t\t\t// We use the same native handler for focusin & focus (and focusout & blur)\n\t\t\t\t// so we need to coordinate setup & teardown parts between those events.\n\t\t\t\t// Use `delegateType` as the key as `type` is already used by `leverageNative`.\n\t\t\t\tattaches = dataPriv.get( this, delegateType );\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tthis.addEventListener( delegateType, focusMappedHandler );\n\t\t\t\t}\n\t\t\t\tdataPriv.set( this, delegateType, ( attaches || 0 ) + 1 );\n\t\t\t} else {\n\n\t\t\t\t// Return false to allow normal processing in the caller\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\ttrigger: function() {\n\n\t\t\t// Force setup before trigger\n\t\t\tleverageNative( this, type );\n\n\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\treturn true;\n\t\t},\n\n\t\tteardown: function() {\n\t\t\tvar attaches;\n\n\t\t\tif ( document.documentMode ) {\n\t\t\t\tattaches = dataPriv.get( this, delegateType ) - 1;\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tthis.removeEventListener( delegateType, focusMappedHandler );\n\t\t\t\t\tdataPriv.remove( this, delegateType );\n\t\t\t\t} else {\n\t\t\t\t\tdataPriv.set( this, delegateType, attaches );\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Return false to indicate standard teardown should be applied\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\n\t\t// Suppress native focus or blur if we're currently inside\n\t\t// a leveraged native-event stack\n\t\t_default: function( event ) {\n\t\t\treturn dataPriv.get( event.target, type );\n\t\t},\n\n\t\tdelegateType: delegateType\n\t};\n\n\t// Support: Firefox <=44\n\t// Firefox doesn't have focus(in | out) events\n\t// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\n\t//\n\t// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\n\t// focus(in | out) events fire after focus & blur events,\n\t// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\n\t// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\n\t//\n\t// Support: IE 9 - 11+\n\t// To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch,\n\t// attach a single handler for both events in IE.\n\tjQuery.event.special[ delegateType ] = {\n\t\tsetup: function() {\n\n\t\t\t// Handle: regular nodes (via `this.ownerDocument`), window\n\t\t\t// (via `this.document`) & document (via `this`).\n\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\tdataHolder = document.documentMode ? this : doc,\n\t\t\t\tattaches = dataPriv.get( dataHolder, delegateType );\n\n\t\t\t// Support: IE 9 - 11+\n\t\t\t// We use the same native handler for focusin & focus (and focusout & blur)\n\t\t\t// so we need to coordinate setup & teardown parts between those events.\n\t\t\t// Use `delegateType` as the key as `type` is already used by `leverageNative`.\n\t\t\tif ( !attaches ) {\n\t\t\t\tif ( document.documentMode ) {\n\t\t\t\t\tthis.addEventListener( delegateType, focusMappedHandler );\n\t\t\t\t} else {\n\t\t\t\t\tdoc.addEventListener( type, focusMappedHandler, true );\n\t\t\t\t}\n\t\t\t}\n\t\t\tdataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 );\n\t\t},\n\t\tteardown: function() {\n\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\tdataHolder = document.documentMode ? this : doc,\n\t\t\t\tattaches = dataPriv.get( dataHolder, delegateType ) - 1;\n\n\t\t\tif ( !attaches ) {\n\t\t\t\tif ( document.documentMode ) {\n\t\t\t\t\tthis.removeEventListener( delegateType, focusMappedHandler );\n\t\t\t\t} else {\n\t\t\t\t\tdoc.removeEventListener( type, focusMappedHandler, true );\n\t\t\t\t}\n\t\t\t\tdataPriv.remove( dataHolder, delegateType );\n\t\t\t} else {\n\t\t\t\tdataPriv.set( dataHolder, delegateType, attaches );\n\t\t\t}\n\t\t}\n\t};\n} );\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// so that event delegation works in jQuery.\n// Do the same for pointerenter/pointerleave and pointerover/pointerout\n//\n// Support: Safari 7 only\n// Safari sends mouseenter too often; see:\n// https://bugs.chromium.org/p/chromium/issues/detail?id=470258\n// for the description of the bug (it existed in older Chrome versions as well).\njQuery.each( {\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\",\n\tpointerenter: \"pointerover\",\n\tpointerleave: \"pointerout\"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mouseenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n} );\n\njQuery.fn.extend( {\n\n\ton: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn );\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\n\t\t\t// ( event )  dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ?\n\t\t\t\t\thandleObj.origType + \".\" + handleObj.namespace :\n\t\t\t\t\thandleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === \"object\" ) {\n\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === \"function\" ) {\n\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t} );\n\t}\n} );\n\n\nvar\n\n\t// Support: IE <=10 - 11, Edge 12 - 13 only\n\t// In IE/Edge using regex groups here causes severe slowdowns.\n\t// See https://connect.microsoft.com/IE/feedback/details/1736512/\n\trnoInnerhtml = /<script|<style|<link/i,\n\n\t// checked=\"checked\" or checked\n\trchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n\n\trcleanScript = /^\\s*<!\\[CDATA\\[|\\]\\]>\\s*$/g;\n\n// Prefer a tbody over its parent table for containing new rows\nfunction manipulationTarget( elem, content ) {\n\tif ( nodeName( elem, \"table\" ) &&\n\t\tnodeName( content.nodeType !== 11 ? content : content.firstChild, \"tr\" ) ) {\n\n\t\treturn jQuery( elem ).children( \"tbody\" )[ 0 ] || elem;\n\t}\n\n\treturn elem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\telem.type = ( elem.getAttribute( \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tif ( ( elem.type || \"\" ).slice( 0, 5 ) === \"true/\" ) {\n\t\telem.type = elem.type.slice( 5 );\n\t} else {\n\t\telem.removeAttribute( \"type\" );\n\t}\n\n\treturn elem;\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\tvar i, l, type, pdataOld, udataOld, udataCur, events;\n\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\t// 1. Copy private data: events, handlers, etc.\n\tif ( dataPriv.hasData( src ) ) {\n\t\tpdataOld = dataPriv.get( src );\n\t\tevents = pdataOld.events;\n\n\t\tif ( events ) {\n\t\t\tdataPriv.remove( dest, \"handle events\" );\n\n\t\t\tfor ( type in events ) {\n\t\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Copy user data\n\tif ( dataUser.hasData( src ) ) {\n\t\tudataOld = dataUser.access( src );\n\t\tudataCur = jQuery.extend( {}, udataOld );\n\n\t\tdataUser.set( dest, udataCur );\n\t}\n}\n\n// Fix IE bugs, see support tests\nfunction fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\n\nfunction domManip( collection, args, callback, ignored ) {\n\n\t// Flatten any nested arrays\n\targs = flat( args );\n\n\tvar fragment, first, scripts, hasScripts, node, doc,\n\t\ti = 0,\n\t\tl = collection.length,\n\t\tiNoClone = l - 1,\n\t\tvalue = args[ 0 ],\n\t\tvalueIsFunction = isFunction( value );\n\n\t// We can't cloneNode fragments that contain checked, in WebKit\n\tif ( valueIsFunction ||\n\t\t\t( l > 1 && typeof value === \"string\" &&\n\t\t\t\t!support.checkClone && rchecked.test( value ) ) ) {\n\t\treturn collection.each( function( index ) {\n\t\t\tvar self = collection.eq( index );\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\targs[ 0 ] = value.call( this, index, self.html() );\n\t\t\t}\n\t\t\tdomManip( self, args, callback, ignored );\n\t\t} );\n\t}\n\n\tif ( l ) {\n\t\tfragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );\n\t\tfirst = fragment.firstChild;\n\n\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\tfragment = first;\n\t\t}\n\n\t\t// Require either new content or an interest in ignored elements to invoke the callback\n\t\tif ( first || ignored ) {\n\t\t\tscripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n\t\t\thasScripts = scripts.length;\n\n\t\t\t// Use the original fragment for the last item\n\t\t\t// instead of the first because it can end up\n\t\t\t// being emptied incorrectly in certain situations (trac-8070).\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tnode = fragment;\n\n\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\tif ( hasScripts ) {\n\n\t\t\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, \"script\" ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcallback.call( collection[ i ], node, i );\n\t\t\t}\n\n\t\t\tif ( hasScripts ) {\n\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t// Re-enable scripts\n\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\tif ( rscriptType.test( node.type || \"\" ) &&\n\t\t\t\t\t\t!dataPriv.access( node, \"globalEval\" ) &&\n\t\t\t\t\t\tjQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\tif ( node.src && ( node.type || \"\" ).toLowerCase()  !== \"module\" ) {\n\n\t\t\t\t\t\t\t// Optional AJAX dependency, but won't run scripts if not present\n\t\t\t\t\t\t\tif ( jQuery._evalUrl && !node.noModule ) {\n\t\t\t\t\t\t\t\tjQuery._evalUrl( node.src, {\n\t\t\t\t\t\t\t\t\tnonce: node.nonce || node.getAttribute( \"nonce\" )\n\t\t\t\t\t\t\t\t}, doc );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Unwrap a CDATA section containing script contents. This shouldn't be\n\t\t\t\t\t\t\t// needed as in XML documents they're already not visible when\n\t\t\t\t\t\t\t// inspecting element contents and in HTML documents they have no\n\t\t\t\t\t\t\t// meaning but we're preserving that logic for backwards compatibility.\n\t\t\t\t\t\t\t// This will be removed completely in 4.0. See gh-4904.\n\t\t\t\t\t\t\tDOMEval( node.textContent.replace( rcleanScript, \"\" ), node, doc );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn collection;\n}\n\nfunction remove( elem, selector, keepData ) {\n\tvar node,\n\t\tnodes = selector ? jQuery.filter( selector, elem ) : elem,\n\t\ti = 0;\n\n\tfor ( ; ( node = nodes[ i ] ) != null; i++ ) {\n\t\tif ( !keepData && node.nodeType === 1 ) {\n\t\t\tjQuery.cleanData( getAll( node ) );\n\t\t}\n\n\t\tif ( node.parentNode ) {\n\t\t\tif ( keepData && isAttached( node ) ) {\n\t\t\t\tsetGlobalEval( getAll( node, \"script\" ) );\n\t\t\t}\n\t\t\tnode.parentNode.removeChild( node );\n\t\t}\n\t}\n\n\treturn elem;\n}\n\njQuery.extend( {\n\thtmlPrefilter: function( html ) {\n\t\treturn html;\n\t},\n\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar i, l, srcElements, destElements,\n\t\t\tclone = elem.cloneNode( true ),\n\t\t\tinPage = isAttached( elem );\n\n\t\t// Fix IE cloning issues\n\t\tif ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&\n\t\t\t\t!jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// We eschew jQuery#find here for performance reasons:\n\t\t\t// https://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\tfixInput( srcElements[ i ], destElements[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\t\tcloneCopyEvent( srcElements[ i ], destElements[ i ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, \"script\" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n\t\t}\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tcleanData: function( elems ) {\n\t\tvar data, elem, type,\n\t\t\tspecial = jQuery.event.special,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {\n\t\t\tif ( acceptData( elem ) ) {\n\t\t\t\tif ( ( data = elem[ dataPriv.expando ] ) ) {\n\t\t\t\t\tif ( data.events ) {\n\t\t\t\t\t\tfor ( type in data.events ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove's overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataPriv.expando ] = undefined;\n\t\t\t\t}\n\t\t\t\tif ( elem[ dataUser.expando ] ) {\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataUser.expando ] = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n} );\n\njQuery.fn.extend( {\n\tdetach: function( selector ) {\n\t\treturn remove( this, selector, true );\n\t},\n\n\tremove: function( selector ) {\n\t\treturn remove( this, selector );\n\t},\n\n\ttext: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().each( function() {\n\t\t\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\t\t\tthis.textContent = value;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t}, null, value, arguments.length );\n\t},\n\n\tappend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.appendChild( elem );\n\t\t\t}\n\t\t} );\n\t},\n\n\tprepend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.insertBefore( elem, target.firstChild );\n\t\t\t}\n\t\t} );\n\t},\n\n\tbefore: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t} );\n\t},\n\n\tafter: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t} );\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = this[ i ] ) != null; i++ ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\n\t\t\t\t// Prevent memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = \"\";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function() {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t} );\n\t},\n\n\thtml: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = jQuery.htmlPrefilter( value );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar ignored = [];\n\n\t\t// Make the changes, replacing each non-ignored context element with the new content\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tvar parent = this.parentNode;\n\n\t\t\tif ( jQuery.inArray( this, ignored ) < 0 ) {\n\t\t\t\tjQuery.cleanData( getAll( this ) );\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.replaceChild( elem, this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Force callback invocation\n\t\t}, ignored );\n\t}\n} );\n\njQuery.each( {\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n\treplaceAll: \"replaceWith\"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1,\n\t\t\ti = 0;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone( true );\n\t\t\tjQuery( insert[ i ] )[ original ]( elems );\n\n\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t// .get() because push.apply(_, arraylike) throws on ancient WebKit\n\t\t\tpush.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n} );\nvar rnumnonpx = new RegExp( \"^(\" + pnum + \")(?!px)[a-z%]+$\", \"i\" );\n\nvar rcustomProp = /^--/;\n\n\nvar getStyles = function( elem ) {\n\n\t\t// Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)\n\t\t// IE throws on elements created in popups\n\t\t// FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n\t\tvar view = elem.ownerDocument.defaultView;\n\n\t\tif ( !view || !view.opener ) {\n\t\t\tview = window;\n\t\t}\n\n\t\treturn view.getComputedStyle( elem );\n\t};\n\nvar swap = function( elem, options, callback ) {\n\tvar ret, name,\n\t\told = {};\n\n\t// Remember the old values, and insert the new ones\n\tfor ( name in options ) {\n\t\told[ name ] = elem.style[ name ];\n\t\telem.style[ name ] = options[ name ];\n\t}\n\n\tret = callback.call( elem );\n\n\t// Revert the old values\n\tfor ( name in options ) {\n\t\telem.style[ name ] = old[ name ];\n\t}\n\n\treturn ret;\n};\n\n\nvar rboxStyle = new RegExp( cssExpand.join( \"|\" ), \"i\" );\n\n\n\n( function() {\n\n\t// Executing both pixelPosition & boxSizingReliable tests require only one layout\n\t// so they're executed at the same time to save the second computation.\n\tfunction computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}\n\n\tfunction roundPixelMeasures( measure ) {\n\t\treturn Math.round( parseFloat( measure ) );\n\t}\n\n\tvar pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,\n\t\treliableTrDimensionsVal, reliableMarginLeftVal,\n\t\tcontainer = document.createElement( \"div\" ),\n\t\tdiv = document.createElement( \"div\" );\n\n\t// Finish early in limited (non-browser) environments\n\tif ( !div.style ) {\n\t\treturn;\n\t}\n\n\t// Support: IE <=9 - 11 only\n\t// Style of cloned element affects source element cloned (trac-8908)\n\tdiv.style.backgroundClip = \"content-box\";\n\tdiv.cloneNode( true ).style.backgroundClip = \"\";\n\tsupport.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n\tjQuery.extend( support, {\n\t\tboxSizingReliable: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn boxSizingReliableVal;\n\t\t},\n\t\tpixelBoxStyles: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelBoxStylesVal;\n\t\t},\n\t\tpixelPosition: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelPositionVal;\n\t\t},\n\t\treliableMarginLeft: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn reliableMarginLeftVal;\n\t\t},\n\t\tscrollboxSize: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn scrollboxSizeVal;\n\t\t},\n\n\t\t// Support: IE 9 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Behavior in IE 9 is more subtle than in newer versions & it passes\n\t\t// some versions of this test; make sure not to make it pass there!\n\t\t//\n\t\t// Support: Firefox 70+\n\t\t// Only Firefox includes border widths\n\t\t// in computed dimensions. (gh-4529)\n\t\treliableTrDimensions: function() {\n\t\t\tvar table, tr, trChild, trStyle;\n\t\t\tif ( reliableTrDimensionsVal == null ) {\n\t\t\t\ttable = document.createElement( \"table\" );\n\t\t\t\ttr = document.createElement( \"tr\" );\n\t\t\t\ttrChild = document.createElement( \"div\" );\n\n\t\t\t\ttable.style.cssText = \"position:absolute;left:-11111px;border-collapse:separate\";\n\t\t\t\ttr.style.cssText = \"box-sizing:content-box;border:1px solid\";\n\n\t\t\t\t// Support: Chrome 86+\n\t\t\t\t// Height set through cssText does not get applied.\n\t\t\t\t// Computed height then comes back as 0.\n\t\t\t\ttr.style.height = \"1px\";\n\t\t\t\ttrChild.style.height = \"9px\";\n\n\t\t\t\t// Support: Android 8 Chrome 86+\n\t\t\t\t// In our bodyBackground.html iframe,\n\t\t\t\t// display for all div elements is set to \"inline\",\n\t\t\t\t// which causes a problem only in Android 8 Chrome 86.\n\t\t\t\t// Ensuring the div is `display: block`\n\t\t\t\t// gets around this issue.\n\t\t\t\ttrChild.style.display = \"block\";\n\n\t\t\t\tdocumentElement\n\t\t\t\t\t.appendChild( table )\n\t\t\t\t\t.appendChild( tr )\n\t\t\t\t\t.appendChild( trChild );\n\n\t\t\t\ttrStyle = window.getComputedStyle( tr );\n\t\t\t\treliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +\n\t\t\t\t\tparseInt( trStyle.borderTopWidth, 10 ) +\n\t\t\t\t\tparseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;\n\n\t\t\t\tdocumentElement.removeChild( table );\n\t\t\t}\n\t\t\treturn reliableTrDimensionsVal;\n\t\t}\n\t} );\n} )();\n\n\nfunction curCSS( elem, name, computed ) {\n\tvar width, minWidth, maxWidth, ret,\n\t\tisCustomProp = rcustomProp.test( name ),\n\n\t\t// Support: Firefox 51+\n\t\t// Retrieving style before computed somehow\n\t\t// fixes an issue with getting wrong values\n\t\t// on detached elements\n\t\tstyle = elem.style;\n\n\tcomputed = computed || getStyles( elem );\n\n\t// getPropertyValue is needed for:\n\t//   .css('filter') (IE 9 only, trac-12537)\n\t//   .css('--customProperty) (gh-3144)\n\tif ( computed ) {\n\n\t\t// Support: IE <=9 - 11+\n\t\t// IE only supports `\"float\"` in `getPropertyValue`; in computed styles\n\t\t// it's only available as `\"cssFloat\"`. We no longer modify properties\n\t\t// sent to `.css()` apart from camelCasing, so we need to check both.\n\t\t// Normally, this would create difference in behavior: if\n\t\t// `getPropertyValue` returns an empty string, the value returned\n\t\t// by `.css()` would be `undefined`. This is usually the case for\n\t\t// disconnected elements. However, in IE even disconnected elements\n\t\t// with no styles return `\"none\"` for `getPropertyValue( \"float\" )`\n\t\tret = computed.getPropertyValue( name ) || computed[ name ];\n\n\t\tif ( isCustomProp && ret ) {\n\n\t\t\t// Support: Firefox 105+, Chrome <=105+\n\t\t\t// Spec requires trimming whitespace for custom properties (gh-4926).\n\t\t\t// Firefox only trims leading whitespace. Chrome just collapses\n\t\t\t// both leading & trailing whitespace to a single space.\n\t\t\t//\n\t\t\t// Fall back to `undefined` if empty string returned.\n\t\t\t// This collapses a missing definition with property defined\n\t\t\t// and set to an empty string but there's no standard API\n\t\t\t// allowing us to differentiate them without a performance penalty\n\t\t\t// and returning `undefined` aligns with older jQuery.\n\t\t\t//\n\t\t\t// rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED\n\t\t\t// as whitespace while CSS does not, but this is not a problem\n\t\t\t// because CSS preprocessing replaces them with U+000A LINE FEED\n\t\t\t// (which *is* CSS whitespace)\n\t\t\t// https://www.w3.org/TR/css-syntax-3/#input-preprocessing\n\t\t\tret = ret.replace( rtrimCSS, \"$1\" ) || undefined;\n\t\t}\n\n\t\tif ( ret === \"\" && !isAttached( elem ) ) {\n\t\t\tret = jQuery.style( elem, name );\n\t\t}\n\n\t\t// A tribute to the \"awesome hack by Dean Edwards\"\n\t\t// Android Browser returns percentage for some values,\n\t\t// but width seems to be reliably pixels.\n\t\t// This is against the CSSOM draft spec:\n\t\t// https://drafts.csswg.org/cssom/#resolved-values\n\t\tif ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\twidth = style.width;\n\t\t\tminWidth = style.minWidth;\n\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\tret = computed.width;\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.width = width;\n\t\t\tstyle.minWidth = minWidth;\n\t\t\tstyle.maxWidth = maxWidth;\n\t\t}\n\t}\n\n\treturn ret !== undefined ?\n\n\t\t// Support: IE <=9 - 11 only\n\t\t// IE returns zIndex value as an integer.\n\t\tret + \"\" :\n\t\tret;\n}\n\n\nfunction addGetHookIf( conditionFn, hookFn ) {\n\n\t// Define the hook, we'll check on the first run if it's really needed.\n\treturn {\n\t\tget: function() {\n\t\t\tif ( conditionFn() ) {\n\n\t\t\t\t// Hook not needed (or it's not possible to use it due\n\t\t\t\t// to missing dependency), remove it.\n\t\t\t\tdelete this.get;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Hook needed; redefine it so that the support test is not executed again.\n\t\t\treturn ( this.get = hookFn ).apply( this, arguments );\n\t\t}\n\t};\n}\n\n\nvar cssPrefixes = [ \"Webkit\", \"Moz\", \"ms\" ],\n\temptyStyle = document.createElement( \"div\" ).style,\n\tvendorProps = {};\n\n// Return a vendor-prefixed property or undefined\nfunction vendorPropName( name ) {\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}\n\n// Return a potentially-mapped jQuery.cssProps or vendor prefixed property\nfunction finalPropName( name ) {\n\tvar final = jQuery.cssProps[ name ] || vendorProps[ name ];\n\n\tif ( final ) {\n\t\treturn final;\n\t}\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\treturn vendorProps[ name ] = vendorPropName( name ) || name;\n}\n\n\nvar\n\n\t// Swappable if display is none or starts with table\n\t// except \"table\", \"table-cell\", or \"table-caption\"\n\t// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\tcssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n\tcssNormalTransform = {\n\t\tletterSpacing: \"0\",\n\t\tfontWeight: \"400\"\n\t};\n\nfunction setPositiveNumber( _elem, value, subtract ) {\n\n\t// Any relative (+/-) values have already been\n\t// normalized at this point\n\tvar matches = rcssNum.exec( value );\n\treturn matches ?\n\n\t\t// Guard against undefined \"subtract\", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || \"px\" ) :\n\t\tvalue;\n}\n\nfunction boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {\n\tvar i = dimension === \"width\" ? 1 : 0,\n\t\textra = 0,\n\t\tdelta = 0,\n\t\tmarginDelta = 0;\n\n\t// Adjustment may not be necessary\n\tif ( box === ( isBorderBox ? \"border\" : \"content\" ) ) {\n\t\treturn 0;\n\t}\n\n\tfor ( ; i < 4; i += 2 ) {\n\n\t\t// Both box models exclude margin\n\t\t// Count margin delta separately to only add it after scroll gutter adjustment.\n\t\t// This is needed to make negative margins work with `outerHeight( true )` (gh-3982).\n\t\tif ( box === \"margin\" ) {\n\t\t\tmarginDelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\t// If we get here with a content-box, we're seeking \"padding\" or \"border\" or \"margin\"\n\t\tif ( !isBorderBox ) {\n\n\t\t\t// Add padding\n\t\t\tdelta += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n\t\t\t// For \"border\" or \"margin\", add border\n\t\t\tif ( box !== \"padding\" ) {\n\t\t\t\tdelta += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\n\t\t\t// But still keep track of it otherwise\n\t\t\t} else {\n\t\t\t\textra += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\n\t\t// If we get here with a border-box (content + padding + border), we're seeking \"content\" or\n\t\t// \"padding\" or \"margin\"\n\t\t} else {\n\n\t\t\t// For \"content\", subtract padding\n\t\t\tif ( box === \"content\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// For \"content\" or \"padding\", subtract border\n\t\t\tif ( box !== \"margin\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Account for positive content-box scroll gutter when requested by providing computedVal\n\tif ( !isBorderBox && computedVal >= 0 ) {\n\n\t\t// offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border\n\t\t// Assuming integer scroll gutter, subtract the rest and round down\n\t\tdelta += Math.max( 0, Math.ceil(\n\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\tcomputedVal -\n\t\t\tdelta -\n\t\t\textra -\n\t\t\t0.5\n\n\t\t// If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter\n\t\t// Use an explicit zero to avoid NaN (gh-3964)\n\t\t) ) || 0;\n\t}\n\n\treturn delta + marginDelta;\n}\n\nfunction getWidthOrHeight( elem, dimension, extra ) {\n\n\t// Start with computed style\n\tvar styles = getStyles( elem ),\n\n\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).\n\t\t// Fake content-box until we know it's needed to know the true value.\n\t\tboxSizingNeeded = !support.boxSizingReliable() || extra,\n\t\tisBorderBox = boxSizingNeeded &&\n\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\tvalueIsBorderBox = isBorderBox,\n\n\t\tval = curCSS( elem, dimension, styles ),\n\t\toffsetProp = \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );\n\n\t// Support: Firefox <=54\n\t// Return a confounding non-pixel value or feign ignorance, as appropriate.\n\tif ( rnumnonpx.test( val ) ) {\n\t\tif ( !extra ) {\n\t\t\treturn val;\n\t\t}\n\t\tval = \"auto\";\n\t}\n\n\n\t// Support: IE 9 - 11 only\n\t// Use offsetWidth/offsetHeight for when box sizing is unreliable.\n\t// In those cases, the computed value can be trusted to be border-box.\n\tif ( ( !support.boxSizingReliable() && isBorderBox ||\n\n\t\t// Support: IE 10 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Interestingly, in some cases IE 9 doesn't suffer from this issue.\n\t\t!support.reliableTrDimensions() && nodeName( elem, \"tr\" ) ||\n\n\t\t// Fall back to offsetWidth/offsetHeight when value is \"auto\"\n\t\t// This happens for inline elements with no explicit setting (gh-3571)\n\t\tval === \"auto\" ||\n\n\t\t// Support: Android <=4.1 - 4.3 only\n\t\t// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)\n\t\t!parseFloat( val ) && jQuery.css( elem, \"display\", false, styles ) === \"inline\" ) &&\n\n\t\t// Make sure the element is visible & connected\n\t\telem.getClientRects().length ) {\n\n\t\tisBorderBox = jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n\t\t// Where available, offsetWidth/offsetHeight approximate border box dimensions.\n\t\t// Where not available (e.g., SVG), assume unreliable box-sizing and interpret the\n\t\t// retrieved value as a content box dimension.\n\t\tvalueIsBorderBox = offsetProp in elem;\n\t\tif ( valueIsBorderBox ) {\n\t\t\tval = elem[ offsetProp ];\n\t\t}\n\t}\n\n\t// Normalize \"\" and auto\n\tval = parseFloat( val ) || 0;\n\n\t// Adjust for the element's box model\n\treturn ( val +\n\t\tboxModelAdjustment(\n\t\t\telem,\n\t\t\tdimension,\n\t\t\textra || ( isBorderBox ? \"border\" : \"content\" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles,\n\n\t\t\t// Provide the current computed size to request scroll gutter calculation (gh-3589)\n\t\t\tval\n\t\t)\n\t) + \"px\";\n}\n\njQuery.extend( {\n\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, \"opacity\" );\n\t\t\t\t\treturn ret === \"\" ? \"1\" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Don't automatically add \"px\" to these possibly-unitless properties\n\tcssNumber: {\n\t\tanimationIterationCount: true,\n\t\taspectRatio: true,\n\t\tborderImageSlice: true,\n\t\tcolumnCount: true,\n\t\tflexGrow: true,\n\t\tflexShrink: true,\n\t\tfontWeight: true,\n\t\tgridArea: true,\n\t\tgridColumn: true,\n\t\tgridColumnEnd: true,\n\t\tgridColumnStart: true,\n\t\tgridRow: true,\n\t\tgridRowEnd: true,\n\t\tgridRowStart: true,\n\t\tlineHeight: true,\n\t\topacity: true,\n\t\torder: true,\n\t\torphans: true,\n\t\tscale: true,\n\t\twidows: true,\n\t\tzIndex: true,\n\t\tzoom: true,\n\n\t\t// SVG-related\n\t\tfillOpacity: true,\n\t\tfloodOpacity: true,\n\t\tstopOpacity: true,\n\t\tstrokeMiterlimit: true,\n\t\tstrokeOpacity: true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\n\t\t// Don't set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we're working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name ),\n\t\t\tstyle = elem.style;\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to query the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Gets hook for the prefixed version, then unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we're setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// Convert \"+=\" or \"-=\" to relative numbers (trac-7345)\n\t\t\tif ( type === \"string\" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {\n\t\t\t\tvalue = adjustCSS( elem, name, ret );\n\n\t\t\t\t// Fixes bug trac-9237\n\t\t\t\ttype = \"number\";\n\t\t\t}\n\n\t\t\t// Make sure that null and NaN values aren't set (trac-7116)\n\t\t\tif ( value == null || value !== value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number was passed in, add the unit (except for certain CSS properties)\n\t\t\t// The isCustomProp check can be removed in jQuery 4.0 when we only auto-append\n\t\t\t// \"px\" to a few hardcoded values.\n\t\t\tif ( type === \"number\" && !isCustomProp ) {\n\t\t\t\tvalue += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? \"\" : \"px\" );\n\t\t\t}\n\n\t\t\t// background-* props affect original clone's values\n\t\t\tif ( !support.clearCloneStyle && value === \"\" && name.indexOf( \"background\" ) === 0 ) {\n\t\t\t\tstyle[ name ] = \"inherit\";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !( \"set\" in hooks ) ||\n\t\t\t\t( value = hooks.set( elem, value, extra ) ) !== undefined ) {\n\n\t\t\t\tif ( isCustomProp ) {\n\t\t\t\t\tstyle.setProperty( name, value );\n\t\t\t\t} else {\n\t\t\t\t\tstyle[ name ] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && \"get\" in hooks &&\n\t\t\t\t( ret = hooks.get( elem, false, extra ) ) !== undefined ) {\n\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar val, num, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name );\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to modify the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Try prefixed name followed by the unprefixed name\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && \"get\" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t// Convert \"normal\" to computed value\n\t\tif ( val === \"normal\" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Make numeric if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === \"\" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || isFinite( num ) ? num || 0 : val;\n\t\t}\n\n\t\treturn val;\n\t}\n} );\n\njQuery.each( [ \"height\", \"width\" ], function( _i, dimension ) {\n\tjQuery.cssHooks[ dimension ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\n\t\t\t\t// Certain elements can have dimension info if we invisibly show them\n\t\t\t\t// but it must have a current display style that would benefit\n\t\t\t\treturn rdisplayswap.test( jQuery.css( elem, \"display\" ) ) &&\n\n\t\t\t\t\t// Support: Safari 8+\n\t\t\t\t\t// Table columns in Safari have non-zero offsetWidth & zero\n\t\t\t\t\t// getBoundingClientRect().width unless display is changed.\n\t\t\t\t\t// Support: IE <=11 only\n\t\t\t\t\t// Running getBoundingClientRect on a disconnected node\n\t\t\t\t\t// in IE throws an error.\n\t\t\t\t\t( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?\n\t\t\t\t\tswap( elem, cssShow, function() {\n\t\t\t\t\t\treturn getWidthOrHeight( elem, dimension, extra );\n\t\t\t\t\t} ) :\n\t\t\t\t\tgetWidthOrHeight( elem, dimension, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar matches,\n\t\t\t\tstyles = getStyles( elem ),\n\n\t\t\t\t// Only read styles.position if the test has a chance to fail\n\t\t\t\t// to avoid forcing a reflow.\n\t\t\t\tscrollboxSizeBuggy = !support.scrollboxSize() &&\n\t\t\t\t\tstyles.position === \"absolute\",\n\n\t\t\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)\n\t\t\t\tboxSizingNeeded = scrollboxSizeBuggy || extra,\n\t\t\t\tisBorderBox = boxSizingNeeded &&\n\t\t\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\t\t\tsubtract = extra ?\n\t\t\t\t\tboxModelAdjustment(\n\t\t\t\t\t\telem,\n\t\t\t\t\t\tdimension,\n\t\t\t\t\t\textra,\n\t\t\t\t\t\tisBorderBox,\n\t\t\t\t\t\tstyles\n\t\t\t\t\t) :\n\t\t\t\t\t0;\n\n\t\t\t// Account for unreliable border-box dimensions by comparing offset* to computed and\n\t\t\t// faking a content-box to get border and padding (gh-3699)\n\t\t\tif ( isBorderBox && scrollboxSizeBuggy ) {\n\t\t\t\tsubtract -= Math.ceil(\n\t\t\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\t\t\tparseFloat( styles[ dimension ] ) -\n\t\t\t\t\tboxModelAdjustment( elem, dimension, \"border\", false, styles ) -\n\t\t\t\t\t0.5\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Convert to pixels if value adjustment is needed\n\t\t\tif ( subtract && ( matches = rcssNum.exec( value ) ) &&\n\t\t\t\t( matches[ 3 ] || \"px\" ) !== \"px\" ) {\n\n\t\t\t\telem.style[ dimension ] = value;\n\t\t\t\tvalue = jQuery.css( elem, dimension );\n\t\t\t}\n\n\t\t\treturn setPositiveNumber( elem, value, subtract );\n\t\t}\n\t};\n} );\n\njQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,\n\tfunction( elem, computed ) {\n\t\tif ( computed ) {\n\t\t\treturn ( parseFloat( curCSS( elem, \"marginLeft\" ) ) ||\n\t\t\t\telem.getBoundingClientRect().left -\n\t\t\t\t\tswap( elem, { marginLeft: 0 }, function() {\n\t\t\t\t\t\treturn elem.getBoundingClientRect().left;\n\t\t\t\t\t} )\n\t\t\t) + \"px\";\n\t\t}\n\t}\n);\n\n// These hooks are used by animate to expand properties\njQuery.each( {\n\tmargin: \"\",\n\tpadding: \"\",\n\tborder: \"Width\"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// Assumes a single number if not a string\n\t\t\t\tparts = typeof value === \"string\" ? value.split( \" \" ) : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( prefix !== \"margin\" ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n} );\n\njQuery.fn.extend( {\n\tcss: function( name, value ) {\n\t\treturn access( this, function( elem, name, value ) {\n\t\t\tvar styles, len,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t}\n} );\n\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || jQuery.easing._default;\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\t// Use a property on the element directly when it is not a DOM element,\n\t\t\t// or when there is no matching style property that exists.\n\t\t\tif ( tween.elem.nodeType !== 1 ||\n\t\t\t\ttween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// Passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails.\n\t\t\t// Simple values such as \"10px\" are parsed to Float;\n\t\t\t// complex values such as \"rotate(1rad)\" are returned as-is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, \"\" );\n\n\t\t\t// Empty strings, null, undefined and \"auto\" are converted to 0.\n\t\t\treturn !result || result === \"auto\" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\n\t\t\t// Use step hook for back compat.\n\t\t\t// Use cssHook if its there.\n\t\t\t// Use .style if available and use plain properties where available.\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.nodeType === 1 && (\n\t\t\t\tjQuery.cssHooks[ tween.prop ] ||\n\t\t\t\t\ttween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Support: IE <=9 only\n// Panic based approach to setting things on disconnected nodes\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p * Math.PI ) / 2;\n\t},\n\t_default: \"swing\"\n};\n\njQuery.fx = Tween.prototype.init;\n\n// Back compat <1.8 extension point\njQuery.fx.step = {};\n\n\n\n\nvar\n\tfxNow, inProgress,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trrun = /queueHooks$/;\n\nfunction schedule() {\n\tif ( inProgress ) {\n\t\tif ( document.hidden === false && window.requestAnimationFrame ) {\n\t\t\twindow.requestAnimationFrame( schedule );\n\t\t} else {\n\t\t\twindow.setTimeout( schedule, jQuery.fx.interval );\n\t\t}\n\n\t\tjQuery.fx.tick();\n\t}\n}\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\twindow.setTimeout( function() {\n\t\tfxNow = undefined;\n\t} );\n\treturn ( fxNow = Date.now() );\n}\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\ti = 0,\n\t\tattrs = { height: type };\n\n\t// If we include width, step value is 1 to do all cssExpand values,\n\t// otherwise step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth ? 1 : 0;\n\tfor ( ; i < 4; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\nfunction createTween( value, prop, animation ) {\n\tvar tween,\n\t\tcollection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ \"*\" ] ),\n\t\tindex = 0,\n\t\tlength = collection.length;\n\tfor ( ; index < length; index++ ) {\n\t\tif ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {\n\n\t\t\t// We're done with this property\n\t\t\treturn tween;\n\t\t}\n\t}\n}\n\nfunction defaultPrefilter( elem, props, opts ) {\n\tvar prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,\n\t\tisBox = \"width\" in props || \"height\" in props,\n\t\tanim = this,\n\t\torig = {},\n\t\tstyle = elem.style,\n\t\thidden = elem.nodeType && isHiddenWithinTree( elem ),\n\t\tdataShow = dataPriv.get( elem, \"fxshow\" );\n\n\t// Queue-skipping animations hijack the fx hooks\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, \"fx\" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always( function() {\n\n\t\t\t// Ensure the complete handler is called before this completes\n\t\t\tanim.always( function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, \"fx\" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// Detect show/hide animations\n\tfor ( prop in props ) {\n\t\tvalue = props[ prop ];\n\t\tif ( rfxtypes.test( value ) ) {\n\t\t\tdelete props[ prop ];\n\t\t\ttoggle = toggle || value === \"toggle\";\n\t\t\tif ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n\t\t\t\t// Pretend to be hidden if this is a \"show\" and\n\t\t\t\t// there is still data from a stopped show/hide\n\t\t\t\tif ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n\t\t\t\t\thidden = true;\n\n\t\t\t\t// Ignore all other no-op show/hide data\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\torig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n\t\t}\n\t}\n\n\t// Bail out if this is a no-op like .hide().hide()\n\tpropTween = !jQuery.isEmptyObject( props );\n\tif ( !propTween && jQuery.isEmptyObject( orig ) ) {\n\t\treturn;\n\t}\n\n\t// Restrict \"overflow\" and \"display\" styles during box animations\n\tif ( isBox && elem.nodeType === 1 ) {\n\n\t\t// Support: IE <=9 - 11, Edge 12 - 15\n\t\t// Record all 3 overflow attributes because IE does not infer the shorthand\n\t\t// from identically-valued overflowX and overflowY and Edge just mirrors\n\t\t// the overflowX value there.\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Identify a display type, preferring old show/hide data over the CSS cascade\n\t\trestoreDisplay = dataShow && dataShow.display;\n\t\tif ( restoreDisplay == null ) {\n\t\t\trestoreDisplay = dataPriv.get( elem, \"display\" );\n\t\t}\n\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\tif ( display === \"none\" ) {\n\t\t\tif ( restoreDisplay ) {\n\t\t\t\tdisplay = restoreDisplay;\n\t\t\t} else {\n\n\t\t\t\t// Get nonempty value(s) by temporarily forcing visibility\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t\trestoreDisplay = elem.style.display || restoreDisplay;\n\t\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\t\t\tshowHide( [ elem ] );\n\t\t\t}\n\t\t}\n\n\t\t// Animate inline elements as inline-block\n\t\tif ( display === \"inline\" || display === \"inline-block\" && restoreDisplay != null ) {\n\t\t\tif ( jQuery.css( elem, \"float\" ) === \"none\" ) {\n\n\t\t\t\t// Restore the original display value at the end of pure show/hide animations\n\t\t\t\tif ( !propTween ) {\n\t\t\t\t\tanim.done( function() {\n\t\t\t\t\t\tstyle.display = restoreDisplay;\n\t\t\t\t\t} );\n\t\t\t\t\tif ( restoreDisplay == null ) {\n\t\t\t\t\t\tdisplay = style.display;\n\t\t\t\t\t\trestoreDisplay = display === \"none\" ? \"\" : display;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstyle.display = \"inline-block\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = \"hidden\";\n\t\tanim.always( function() {\n\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t} );\n\t}\n\n\t// Implement show/hide animations\n\tpropTween = false;\n\tfor ( prop in orig ) {\n\n\t\t// General show/hide setup for this element animation\n\t\tif ( !propTween ) {\n\t\t\tif ( dataShow ) {\n\t\t\t\tif ( \"hidden\" in dataShow ) {\n\t\t\t\t\thidden = dataShow.hidden;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdataShow = dataPriv.access( elem, \"fxshow\", { display: restoreDisplay } );\n\t\t\t}\n\n\t\t\t// Store hidden/visible for toggle so `.stop().toggle()` \"reverses\"\n\t\t\tif ( toggle ) {\n\t\t\t\tdataShow.hidden = !hidden;\n\t\t\t}\n\n\t\t\t// Show elements before animating them\n\t\t\tif ( hidden ) {\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t}\n\n\t\t\t/* eslint-disable no-loop-func */\n\n\t\t\tanim.done( function() {\n\n\t\t\t\t/* eslint-enable no-loop-func */\n\n\t\t\t\t// The final step of a \"hide\" animation is actually hiding the element\n\t\t\t\tif ( !hidden ) {\n\t\t\t\t\tshowHide( [ elem ] );\n\t\t\t\t}\n\t\t\t\tdataPriv.remove( elem, \"fxshow\" );\n\t\t\t\tfor ( prop in orig ) {\n\t\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Per-property setup\n\t\tpropTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n\t\tif ( !( prop in dataShow ) ) {\n\t\t\tdataShow[ prop ] = propTween.start;\n\t\t\tif ( hidden ) {\n\t\t\t\tpropTween.end = propTween.start;\n\t\t\t\tpropTween.start = 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar index, name, easing, value, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( Array.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && \"expand\" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// Not quite $.extend, this won't overwrite existing keys.\n\t\t\t// Reusing 'index' because we have the correct \"name\"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = Animation.prefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\n\t\t\t// Don't match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t} ),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\n\t\t\t\t// Support: Android 2.3 only\n\t\t\t\t// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ] );\n\n\t\t\t// If there's more to do, yield\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t}\n\n\t\t\t// If this was an empty animation, synthesize a final progress notification\n\t\t\tif ( !length ) {\n\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t}\n\n\t\t\t// Resolve the animation and report its conclusion\n\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\treturn false;\n\t\t},\n\t\tanimation = deferred.promise( {\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, {\n\t\t\t\tspecialEasing: {},\n\t\t\t\teasing: jQuery.easing._default\n\t\t\t}, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\n\t\t\t\t\t// If we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// Resolve when we played the last frame; otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t} ),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length; index++ ) {\n\t\tresult = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\tif ( isFunction( result.stop ) ) {\n\t\t\t\tjQuery._queueHooks( animation.elem, animation.opts.queue ).stop =\n\t\t\t\t\tresult.stop.bind( result );\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tjQuery.map( props, createTween, animation );\n\n\tif ( isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\t// Attach callbacks from options\n\tanimation\n\t\t.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t} )\n\t);\n\n\treturn animation;\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweeners: {\n\t\t\"*\": [ function( prop, value ) {\n\t\t\tvar tween = this.createTween( prop, value );\n\t\t\tadjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );\n\t\t\treturn tween;\n\t\t} ]\n\t},\n\n\ttweener: function( props, callback ) {\n\t\tif ( isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ \"*\" ];\n\t\t} else {\n\t\t\tprops = props.match( rnothtmlwhite );\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\tAnimation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];\n\t\t\tAnimation.tweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilters: [ defaultPrefilter ],\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tAnimation.prefilters.unshift( callback );\n\t\t} else {\n\t\t\tAnimation.prefilters.push( callback );\n\t\t}\n\t}\n} );\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tisFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !isFunction( easing ) && easing\n\t};\n\n\t// Go to the end state if fx are off\n\tif ( jQuery.fx.off ) {\n\t\topt.duration = 0;\n\n\t} else {\n\t\tif ( typeof opt.duration !== \"number\" ) {\n\t\t\tif ( opt.duration in jQuery.fx.speeds ) {\n\t\t\t\topt.duration = jQuery.fx.speeds[ opt.duration ];\n\n\t\t\t} else {\n\t\t\t\topt.duration = jQuery.fx.speeds._default;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Normalize opt.queue - true/undefined/null -> \"fx\"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = \"fx\";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.fn.extend( {\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// Show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHiddenWithinTree ).css( \"opacity\", 0 ).show()\n\n\t\t\t// Animate to the value specified\n\t\t\t.end().animate( { opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\n\t\t\t\t// Operate on a copy of prop so per-property easing won't be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || dataPriv.get( this, \"finish\" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\n\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue ) {\n\t\t\tthis.queue( type || \"fx\", [] );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + \"queueHooks\",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = dataPriv.get( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this &&\n\t\t\t\t\t( type == null || timers[ index ].queue === type ) ) {\n\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Start the next in the queue if the last step wasn't forced.\n\t\t\t// Timers currently will call their complete callbacks, which\n\t\t\t// will dequeue but only if they were gotoEnd.\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t} );\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || \"fx\";\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tvar index,\n\t\t\t\tdata = dataPriv.get( this ),\n\t\t\t\tqueue = data[ type + \"queue\" ],\n\t\t\t\thooks = data[ type + \"queueHooks\" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// Enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// Empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.stop ) {\n\t\t\t\thooks.stop.call( this, true );\n\t\t\t}\n\n\t\t\t// Look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t} );\n\t}\n} );\n\njQuery.each( [ \"toggle\", \"show\", \"hide\" ], function( _i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === \"boolean\" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n} );\n\n// Generate shortcuts for custom animations\njQuery.each( {\n\tslideDown: genFx( \"show\" ),\n\tslideUp: genFx( \"hide\" ),\n\tslideToggle: genFx( \"toggle\" ),\n\tfadeIn: { opacity: \"show\" },\n\tfadeOut: { opacity: \"hide\" },\n\tfadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n} );\n\njQuery.timers = [];\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ti = 0,\n\t\ttimers = jQuery.timers;\n\n\tfxNow = Date.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\n\t\t// Run the timer and safely remove it when done (allowing for external removal)\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tjQuery.timers.push( timer );\n\tjQuery.fx.start();\n};\n\njQuery.fx.interval = 13;\njQuery.fx.start = function() {\n\tif ( inProgress ) {\n\t\treturn;\n\t}\n\n\tinProgress = true;\n\tschedule();\n};\n\njQuery.fx.stop = function() {\n\tinProgress = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\n\t// Default speed\n\t_default: 400\n};\n\n\n// Based off of the plugin by Clint Helfers, with permission.\njQuery.fn.delay = function( time, type ) {\n\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\ttype = type || \"fx\";\n\n\treturn this.queue( type, function( next, hooks ) {\n\t\tvar timeout = window.setTimeout( next, time );\n\t\thooks.stop = function() {\n\t\t\twindow.clearTimeout( timeout );\n\t\t};\n\t} );\n};\n\n\n( function() {\n\tvar input = document.createElement( \"input\" ),\n\t\tselect = document.createElement( \"select\" ),\n\t\topt = select.appendChild( document.createElement( \"option\" ) );\n\n\tinput.type = \"checkbox\";\n\n\t// Support: Android <=4.3 only\n\t// Default value for a checkbox should be \"on\"\n\tsupport.checkOn = input.value !== \"\";\n\n\t// Support: IE <=11 only\n\t// Must access selectedIndex to make default options select\n\tsupport.optSelected = opt.selected;\n\n\t// Support: IE <=11 only\n\t// An input loses its value after becoming a radio\n\tinput = document.createElement( \"input\" );\n\tinput.value = \"t\";\n\tinput.type = \"radio\";\n\tsupport.radioValue = input.value === \"t\";\n} )();\n\n\nvar boolHook,\n\tattrHandle = jQuery.expr.attrHandle;\n\njQuery.fn.extend( {\n\tattr: function( name, value ) {\n\t\treturn access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tattr: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set attributes on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === \"undefined\" ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// Attribute hooks are determined by the lowercase version\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\thooks = jQuery.attrHooks[ name.toLowerCase() ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\treturn value;\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = jQuery.find.attr( elem, name );\n\n\t\t// Non-existent attributes return null, we normalize to undefined\n\t\treturn ret == null ? undefined : ret;\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !support.radioValue && value === \"radio\" &&\n\t\t\t\t\tnodeName( elem, \"input\" ) ) {\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name,\n\t\t\ti = 0,\n\n\t\t\t// Attribute names can contain non-HTML whitespace characters\n\t\t\t// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n\t\t\tattrNames = value && value.match( rnothtmlwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( ( name = attrNames[ i++ ] ) ) {\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\n\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( _i, name ) {\n\tvar getter = attrHandle[ name ] || jQuery.find.attr;\n\n\tattrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar ret, handle,\n\t\t\tlowercaseName = name.toLowerCase();\n\n\t\tif ( !isXML ) {\n\n\t\t\t// Avoid an infinite loop by temporarily removing this function from the getter\n\t\t\thandle = attrHandle[ lowercaseName ];\n\t\t\tattrHandle[ lowercaseName ] = ret;\n\t\t\tret = getter( elem, name, isXML ) != null ?\n\t\t\t\tlowercaseName :\n\t\t\t\tnull;\n\t\t\tattrHandle[ lowercaseName ] = handle;\n\t\t}\n\t\treturn ret;\n\t};\n} );\n\n\n\n\nvar rfocusable = /^(?:input|select|textarea|button)$/i,\n\trclickable = /^(?:a|area)$/i;\n\njQuery.fn.extend( {\n\tprop: function( name, value ) {\n\t\treturn access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tdelete this[ jQuery.propFix[ name ] || name ];\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set properties on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\treturn ( elem[ name ] = value );\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\treturn elem[ name ];\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\t// Support: IE <=9 - 11 only\n\t\t\t\t// elem.tabIndex doesn't always return the\n\t\t\t\t// correct value when it hasn't been explicitly set\n\t\t\t\t// Use proper attribute retrieval (trac-12072)\n\t\t\t\tvar tabindex = jQuery.find.attr( elem, \"tabindex\" );\n\n\t\t\t\tif ( tabindex ) {\n\t\t\t\t\treturn parseInt( tabindex, 10 );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\trfocusable.test( elem.nodeName ) ||\n\t\t\t\t\trclickable.test( elem.nodeName ) &&\n\t\t\t\t\telem.href\n\t\t\t\t) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t},\n\n\tpropFix: {\n\t\t\"for\": \"htmlFor\",\n\t\t\"class\": \"className\"\n\t}\n} );\n\n// Support: IE <=11 only\n// Accessing the selectedIndex property\n// forces the browser to respect setting selected\n// on the option\n// The getter ensures a default option is selected\n// when in an optgroup\n// eslint rule \"no-unused-expressions\" is disabled for this code\n// since it considers such accessions noop\nif ( !support.optSelected ) {\n\tjQuery.propHooks.selected = {\n\t\tget: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent && parent.parentNode ) {\n\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\tset: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent ) {\n\t\t\t\tparent.selectedIndex;\n\n\t\t\t\tif ( parent.parentNode ) {\n\t\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\njQuery.each( [\n\t\"tabIndex\",\n\t\"readOnly\",\n\t\"maxLength\",\n\t\"cellSpacing\",\n\t\"cellPadding\",\n\t\"rowSpan\",\n\t\"colSpan\",\n\t\"useMap\",\n\t\"frameBorder\",\n\t\"contentEditable\"\n], function() {\n\tjQuery.propFix[ this.toLowerCase() ] = this;\n} );\n\n\n\n\n\t// Strip and collapse whitespace according to HTML spec\n\t// https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace\n\tfunction stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}\n\n\nfunction getClass( elem ) {\n\treturn elem.getAttribute && elem.getAttribute( \"class\" ) || \"\";\n}\n\nfunction classesToArray( value ) {\n\tif ( Array.isArray( value ) ) {\n\t\treturn value;\n\t}\n\tif ( typeof value === \"string\" ) {\n\t\treturn value.match( rnothtmlwhite ) || [];\n\t}\n\treturn [];\n}\n\njQuery.fn.extend( {\n\taddClass: function( value ) {\n\t\tvar classNames, cur, curValue, className, i, finalValue;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tclassNames = classesToArray( value );\n\n\t\tif ( classNames.length ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tcurValue = getClass( this );\n\t\t\t\tcur = this.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tfor ( i = 0; i < classNames.length; i++ ) {\n\t\t\t\t\t\tclassName = classNames[ i ];\n\t\t\t\t\t\tif ( cur.indexOf( \" \" + className + \" \" ) < 0 ) {\n\t\t\t\t\t\t\tcur += className + \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\tthis.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classNames, cur, curValue, className, i, finalValue;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tif ( !arguments.length ) {\n\t\t\treturn this.attr( \"class\", \"\" );\n\t\t}\n\n\t\tclassNames = classesToArray( value );\n\n\t\tif ( classNames.length ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tcurValue = getClass( this );\n\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = this.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tfor ( i = 0; i < classNames.length; i++ ) {\n\t\t\t\t\t\tclassName = classNames[ i ];\n\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( \" \" + className + \" \" ) > -1 ) {\n\t\t\t\t\t\t\tcur = cur.replace( \" \" + className + \" \", \" \" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\tthis.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar classNames, className, i, self,\n\t\t\ttype = typeof value,\n\t\t\tisValidValue = type === \"string\" || Array.isArray( value );\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).toggleClass(\n\t\t\t\t\tvalue.call( this, i, getClass( this ), stateVal ),\n\t\t\t\t\tstateVal\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\tif ( typeof stateVal === \"boolean\" && isValidValue ) {\n\t\t\treturn stateVal ? this.addClass( value ) : this.removeClass( value );\n\t\t}\n\n\t\tclassNames = classesToArray( value );\n\n\t\treturn this.each( function() {\n\t\t\tif ( isValidValue ) {\n\n\t\t\t\t// Toggle individual class names\n\t\t\t\tself = jQuery( this );\n\n\t\t\t\tfor ( i = 0; i < classNames.length; i++ ) {\n\t\t\t\t\tclassName = classNames[ i ];\n\n\t\t\t\t\t// Check each className given, space separated list\n\t\t\t\t\tif ( self.hasClass( className ) ) {\n\t\t\t\t\t\tself.removeClass( className );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.addClass( className );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( value === undefined || type === \"boolean\" ) {\n\t\t\t\tclassName = getClass( this );\n\t\t\t\tif ( className ) {\n\n\t\t\t\t\t// Store className if set\n\t\t\t\t\tdataPriv.set( this, \"__className__\", className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we're passed `false`,\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tif ( this.setAttribute ) {\n\t\t\t\t\tthis.setAttribute( \"class\",\n\t\t\t\t\t\tclassName || value === false ?\n\t\t\t\t\t\t\t\"\" :\n\t\t\t\t\t\t\tdataPriv.get( this, \"__className__\" ) || \"\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className, elem,\n\t\t\ti = 0;\n\n\t\tclassName = \" \" + selector + \" \";\n\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\tif ( elem.nodeType === 1 &&\n\t\t\t\t( \" \" + stripAndCollapse( getClass( elem ) ) + \" \" ).indexOf( className ) > -1 ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n} );\n\n\n\n\nvar rreturn = /\\r/g;\n\njQuery.fn.extend( {\n\tval: function( value ) {\n\t\tvar hooks, ret, valueIsFunction,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] ||\n\t\t\t\t\tjQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks &&\n\t\t\t\t\t\"get\" in hooks &&\n\t\t\t\t\t( ret = hooks.get( elem, \"value\" ) ) !== undefined\n\t\t\t\t) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\t// Handle most common string cases\n\t\t\t\tif ( typeof ret === \"string\" ) {\n\t\t\t\t\treturn ret.replace( rreturn, \"\" );\n\t\t\t\t}\n\n\t\t\t\t// Handle cases where value is null/undef or number\n\t\t\t\treturn ret == null ? \"\" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvalueIsFunction = isFunction( value );\n\n\t\treturn this.each( function( i ) {\n\t\t\tvar val;\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\tval = value.call( this, i, jQuery( this ).val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as \"\"; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = \"\";\n\n\t\t\t} else if ( typeof val === \"number\" ) {\n\t\t\t\tval += \"\";\n\n\t\t\t} else if ( Array.isArray( val ) ) {\n\t\t\t\tval = jQuery.map( val, function( value ) {\n\t\t\t\t\treturn value == null ? \"\" : value + \"\";\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !( \"set\" in hooks ) || hooks.set( this, val, \"value\" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\tvar val = jQuery.find.attr( elem, \"value\" );\n\t\t\t\treturn val != null ?\n\t\t\t\t\tval :\n\n\t\t\t\t\t// Support: IE <=10 - 11 only\n\t\t\t\t\t// option.text throws exceptions (trac-14686, trac-14858)\n\t\t\t\t\t// Strip and collapse whitespace\n\t\t\t\t\t// https://html.spec.whatwg.org/#strip-and-collapse-whitespace\n\t\t\t\t\tstripAndCollapse( jQuery.text( elem ) );\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option, i,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === \"select-one\",\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length;\n\n\t\t\t\tif ( index < 0 ) {\n\t\t\t\t\ti = max;\n\n\t\t\t\t} else {\n\t\t\t\t\ti = one ? index : 0;\n\t\t\t\t}\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t// IE8-9 doesn't update selected after form reset (trac-2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\n\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t!option.disabled &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled ||\n\t\t\t\t\t\t\t\t!nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don't need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar optionSet, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tvalues = jQuery.makeArray( value ),\n\t\t\t\t\ti = options.length;\n\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t/* eslint-disable no-cond-assign */\n\n\t\t\t\t\tif ( option.selected =\n\t\t\t\t\t\tjQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1\n\t\t\t\t\t) {\n\t\t\t\t\t\toptionSet = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* eslint-enable no-cond-assign */\n\t\t\t\t}\n\n\t\t\t\t// Force browsers to behave consistently when non-matching value is set\n\t\t\t\tif ( !optionSet ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Radios and checkboxes getter/setter\njQuery.each( [ \"radio\", \"checkbox\" ], function() {\n\tjQuery.valHooks[ this ] = {\n\t\tset: function( elem, value ) {\n\t\t\tif ( Array.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );\n\t\t\t}\n\t\t}\n\t};\n\tif ( !support.checkOn ) {\n\t\tjQuery.valHooks[ this ].get = function( elem ) {\n\t\t\treturn elem.getAttribute( \"value\" ) === null ? \"on\" : elem.value;\n\t\t};\n\t}\n} );\n\n\n\n\n// Return jQuery for attributes-only inclusion\nvar location = window.location;\n\nvar nonce = { guid: Date.now() };\n\nvar rquery = ( /\\?/ );\n\n\n\n// Cross-browser xml parsing\njQuery.parseXML = function( data ) {\n\tvar xml, parserErrorElem;\n\tif ( !data || typeof data !== \"string\" ) {\n\t\treturn null;\n\t}\n\n\t// Support: IE 9 - 11 only\n\t// IE throws on parseFromString with invalid input.\n\ttry {\n\t\txml = ( new window.DOMParser() ).parseFromString( data, \"text/xml\" );\n\t} catch ( e ) {}\n\n\tparserErrorElem = xml && xml.getElementsByTagName( \"parsererror\" )[ 0 ];\n\tif ( !xml || parserErrorElem ) {\n\t\tjQuery.error( \"Invalid XML: \" + (\n\t\t\tparserErrorElem ?\n\t\t\t\tjQuery.map( parserErrorElem.childNodes, function( el ) {\n\t\t\t\t\treturn el.textContent;\n\t\t\t\t} ).join( \"\\n\" ) :\n\t\t\t\tdata\n\t\t) );\n\t}\n\treturn xml;\n};\n\n\nvar rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\tstopPropagationCallback = function( e ) {\n\t\te.stopPropagation();\n\t};\n\njQuery.extend( jQuery.event, {\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\n\t\tvar i, cur, tmp, bubbleType, ontype, handle, special, lastElement,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = hasOwn.call( event, \"type\" ) ? event.type : event,\n\t\t\tnamespaces = hasOwn.call( event, \"namespace\" ) ? event.namespace.split( \".\" ) : [];\n\n\t\tcur = lastElement = tmp = elem = elem || document;\n\n\t\t// Don't do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we're not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf( \".\" ) > -1 ) {\n\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split( \".\" );\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf( \":\" ) < 0 && \"on\" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === \"object\" && event );\n\n\t\t// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\t\tevent.isTrigger = onlyHandlers ? 2 : 3;\n\t\tevent.namespace = namespaces.join( \".\" );\n\t\tevent.rnamespace = event.namespace ?\n\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (trac-9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === ( elem.ownerDocument || document ) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tlastElement = cur;\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = ( dataPriv.get( cur, \"events\" ) || Object.create( null ) )[ event.type ] &&\n\t\t\t\tdataPriv.get( cur, \"handle\" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && handle.apply && acceptData( cur ) ) {\n\t\t\t\tevent.result = handle.apply( cur, data );\n\t\t\t\tif ( event.result === false ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( ( !special._default ||\n\t\t\t\tspecial._default.apply( eventPath.pop(), data ) === false ) &&\n\t\t\t\tacceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name as the event.\n\t\t\t\t// Don't do default actions on window, that's where global variables be (trac-6170)\n\t\t\t\tif ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {\n\n\t\t\t\t\t// Don't re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.addEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\telem[ type ]();\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.removeEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\t// Piggyback on a donor event to simulate a different one\n\t// Used only for `focus(in | out)` events\n\tsimulate: function( type, elem, event ) {\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{\n\t\t\t\ttype: type,\n\t\t\t\tisSimulated: true\n\t\t\t}\n\t\t);\n\n\t\tjQuery.event.trigger( e, null, elem );\n\t}\n\n} );\n\njQuery.fn.extend( {\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t} );\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[ 0 ];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n} );\n\n\nvar\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( Array.isArray( obj ) ) {\n\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams(\n\t\t\t\t\tprefix + \"[\" + ( typeof v === \"object\" && v != null ? i : \"\" ) + \"]\",\n\t\t\t\t\tv,\n\t\t\t\t\ttraditional,\n\t\t\t\t\tadd\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t} else if ( !traditional && toType( obj ) === \"object\" ) {\n\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\n\n// Serialize an array of form elements or a set of\n// key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, valueOrFunction ) {\n\n\t\t\t// If value is a function, invoke it and use its return value\n\t\t\tvar value = isFunction( valueOrFunction ) ?\n\t\t\t\tvalueOrFunction() :\n\t\t\t\tvalueOrFunction;\n\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + \"=\" +\n\t\t\t\tencodeURIComponent( value == null ? \"\" : value );\n\t\t};\n\n\tif ( a == null ) {\n\t\treturn \"\";\n\t}\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t} );\n\n\t} else {\n\n\t\t// If traditional, encode the \"old\" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( \"&\" );\n};\n\njQuery.fn.extend( {\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map( function() {\n\n\t\t\t// Can add propHook for \"elements\" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, \"elements\" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t} ).filter( function() {\n\t\t\tvar type = this.type;\n\n\t\t\t// Use .is( \":disabled\" ) so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( \":disabled\" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !rcheckableType.test( type ) );\n\t\t} ).map( function( _i, elem ) {\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\tif ( val == null ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif ( Array.isArray( val ) ) {\n\t\t\t\treturn jQuery.map( val, function( val ) {\n\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t} ).get();\n\t}\n} );\n\n\nvar\n\tr20 = /%20/g,\n\trhash = /#.*$/,\n\trantiCache = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\n\t// trac-7653, trac-8125, trac-8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t *    - BEFORE asking for a transport\n\t *    - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol \"*\" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol \"*\" can be used\n\t * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression\n\tallTypes = \"*/\".concat( \"*\" ),\n\n\t// Anchor tag for parsing the document origin\n\toriginAnchor = document.createElement( \"a\" );\n\noriginAnchor.href = location.href;\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];\n\n\t\tif ( isFunction( func ) ) {\n\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( ( dataType = dataTypes[ i++ ] ) ) {\n\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[ 0 ] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t} );\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes trac-9887\nfunction ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}\n\njQuery.extend( {\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: location.href,\n\t\ttype: \"GET\",\n\t\tisLocal: rlocalProtocol.test( location.protocol ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t\"*\": allTypes,\n\t\t\ttext: \"text/plain\",\n\t\t\thtml: \"text/html\",\n\t\t\txml: \"application/xml, text/xml\",\n\t\t\tjson: \"application/json, text/javascript\"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /\\bxml\\b/,\n\t\t\thtml: /\\bhtml/,\n\t\t\tjson: /\\bjson\\b/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: \"responseXML\",\n\t\t\ttext: \"responseText\",\n\t\t\tjson: \"responseJSON\"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall \"*\") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t\"* text\": String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t\"text html\": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t\"text json\": JSON.parse,\n\n\t\t\t// Parse text as xml\n\t\t\t\"text xml\": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn't be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn't be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === \"object\" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar transport,\n\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\n\t\t\t// Response headers\n\t\t\tresponseHeadersString,\n\t\t\tresponseHeaders,\n\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\n\t\t\t// Url cleanup var\n\t\t\turlAnchor,\n\n\t\t\t// Request state (becomes false upon send and true upon completion)\n\t\t\tcompleted,\n\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\n\t\t\t// Loop variable\n\t\t\ti,\n\n\t\t\t// uncached part of the url\n\t\t\tuncached,\n\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context &&\n\t\t\t\t( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\tjQuery.event,\n\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks( \"once memory\" ),\n\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\n\t\t\t// Default abort message\n\t\t\tstrAbort = \"canceled\",\n\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( completed ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( ( match = rheaders.exec( responseHeadersString ) ) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[ 1 ].toLowerCase() + \" \" ] =\n\t\t\t\t\t\t\t\t\t( responseHeaders[ match[ 1 ].toLowerCase() + \" \" ] || [] )\n\t\t\t\t\t\t\t\t\t\t.concat( match[ 2 ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() + \" \" ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match.join( \", \" );\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn completed ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\tname = requestHeadersNames[ name.toLowerCase() ] =\n\t\t\t\t\t\t\trequestHeadersNames[ name.toLowerCase() ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( completed ) {\n\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Lazy-add the new callbacks in a way that preserves old ones\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR );\n\n\t\t// Add protocol if not provided (prefilters might expect it)\n\t\t// Handle falsy url in the settings object (trac-10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || location.href ) + \"\" )\n\t\t\t.replace( rprotocol, location.protocol + \"//\" );\n\n\t\t// Alias method option to type as per ticket trac-12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = ( s.dataType || \"*\" ).toLowerCase().match( rnothtmlwhite ) || [ \"\" ];\n\n\t\t// A cross-domain request is in order when the origin doesn't match the current origin.\n\t\tif ( s.crossDomain == null ) {\n\t\t\turlAnchor = document.createElement( \"a\" );\n\n\t\t\t// Support: IE <=8 - 11, Edge 12 - 15\n\t\t\t// IE throws exception on accessing the href property if url is malformed,\n\t\t\t// e.g. http://example.com:80x/\n\t\t\ttry {\n\t\t\t\turlAnchor.href = s.url;\n\n\t\t\t\t// Support: IE <=8 - 11 only\n\t\t\t\t// Anchor's host property isn't correctly set when s.url is relative\n\t\t\t\turlAnchor.href = urlAnchor.href;\n\t\t\t\ts.crossDomain = originAnchor.protocol + \"//\" + originAnchor.host !==\n\t\t\t\t\turlAnchor.protocol + \"//\" + urlAnchor.host;\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// If there is an error parsing the URL, assume it is crossDomain,\n\t\t\t\t// it can be rejected by the transport if it is invalid\n\t\t\t\ts.crossDomain = true;\n\t\t\t}\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== \"string\" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( completed ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\t// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118)\n\t\tfireGlobals = jQuery.event && s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger( \"ajaxStart\" );\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we're toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\t// Remove hash to simplify url manipulation\n\t\tcacheURL = s.url.replace( rhash, \"\" );\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// Remember the hash so we can put it back\n\t\t\tuncached = s.url.slice( cacheURL.length );\n\n\t\t\t// If data is available and should be processed, append data to url\n\t\t\tif ( s.data && ( s.processData || typeof s.data === \"string\" ) ) {\n\t\t\t\tcacheURL += ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data;\n\n\t\t\t\t// trac-9682: remove data so that it's not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add or update anti-cache param if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\tcacheURL = cacheURL.replace( rantiCache, \"$1\" );\n\t\t\t\tuncached = ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ( nonce.guid++ ) +\n\t\t\t\t\tuncached;\n\t\t\t}\n\n\t\t\t// Put hash and anti-cache on the URL that will be requested (gh-1732)\n\t\t\ts.url = cacheURL + uncached;\n\n\t\t// Change '%20' to '+' if this is encoded form body content (gh-2658)\n\t\t} else if ( s.data && s.processData &&\n\t\t\t( s.contentType || \"\" ).indexOf( \"application/x-www-form-urlencoded\" ) === 0 ) {\n\t\t\ts.data = s.data.replace( r20, \"+\" );\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t\"Accept\",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[ 0 ] ] +\n\t\t\t\t\t( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n\t\t\t\ts.accepts[ \"*\" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend &&\n\t\t\t( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {\n\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// Aborting is no longer a cancellation\n\t\tstrAbort = \"abort\";\n\n\t\t// Install callbacks on deferreds\n\t\tcompleteDeferred.add( s.complete );\n\t\tjqXHR.done( s.success );\n\t\tjqXHR.fail( s.error );\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, \"No Transport\" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n\t\t\t}\n\n\t\t\t// If request was aborted inside ajaxSend, stop there\n\t\t\tif ( completed ) {\n\t\t\t\treturn jqXHR;\n\t\t\t}\n\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = window.setTimeout( function() {\n\t\t\t\t\tjqXHR.abort( \"timeout\" );\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tcompleted = false;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// Rethrow post-completion exceptions\n\t\t\t\tif ( completed ) {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\n\t\t\t\t// Propagate others as results\n\t\t\t\tdone( -1, e );\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Ignore repeat invocations\n\t\t\tif ( completed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcompleted = true;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\twindow.clearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Use a noop converter for missing script but not if jsonp\n\t\t\tif ( !isSuccess &&\n\t\t\t\tjQuery.inArray( \"script\", s.dataTypes ) > -1 &&\n\t\t\t\tjQuery.inArray( \"json\", s.dataTypes ) < 0 ) {\n\t\t\t\ts.converters[ \"text script\" ] = function() {};\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"Last-Modified\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"etag\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Extract error from statusText and normalize for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, \"json\" );\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, \"script\" );\n\t}\n} );\n\njQuery.each( [ \"get\", \"post\" ], function( _i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\n\t\t// Shift arguments if data argument was omitted\n\t\tif ( isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\t// The url can be an options object (which then must have .url)\n\t\treturn jQuery.ajax( jQuery.extend( {\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t}, jQuery.isPlainObject( url ) && url ) );\n\t};\n} );\n\njQuery.ajaxPrefilter( function( s ) {\n\tvar i;\n\tfor ( i in s.headers ) {\n\t\tif ( i.toLowerCase() === \"content-type\" ) {\n\t\t\ts.contentType = s.headers[ i ] || \"\";\n\t\t}\n\t}\n} );\n\n\njQuery._evalUrl = function( url, options, doc ) {\n\treturn jQuery.ajax( {\n\t\turl: url,\n\n\t\t// Make this explicit, since user can override this through ajaxSetup (trac-11264)\n\t\ttype: \"GET\",\n\t\tdataType: \"script\",\n\t\tcache: true,\n\t\tasync: false,\n\t\tglobal: false,\n\n\t\t// Only evaluate the response if it is successful (gh-4126)\n\t\t// dataFilter is not invoked for failure responses, so using it instead\n\t\t// of the default converter is kludgy but it works.\n\t\tconverters: {\n\t\t\t\"text script\": function() {}\n\t\t},\n\t\tdataFilter: function( response ) {\n\t\t\tjQuery.globalEval( response, options, doc );\n\t\t}\n\t} );\n};\n\n\njQuery.fn.extend( {\n\twrapAll: function( html ) {\n\t\tvar wrap;\n\n\t\tif ( this[ 0 ] ) {\n\t\t\tif ( isFunction( html ) ) {\n\t\t\t\thtml = html.call( this[ 0 ] );\n\t\t\t}\n\n\t\t\t// The elements to wrap the target around\n\t\t\twrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n\t\t\tif ( this[ 0 ].parentNode ) {\n\t\t\t\twrap.insertBefore( this[ 0 ] );\n\t\t\t}\n\n\t\t\twrap.map( function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstElementChild ) {\n\t\t\t\t\telem = elem.firstElementChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t} ).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( isFunction( html ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).wrapInner( html.call( this, i ) );\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t} );\n\t},\n\n\twrap: function( html ) {\n\t\tvar htmlIsFunction = isFunction( html );\n\n\t\treturn this.each( function( i ) {\n\t\t\tjQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );\n\t\t} );\n\t},\n\n\tunwrap: function( selector ) {\n\t\tthis.parent( selector ).not( \"body\" ).each( function() {\n\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t} );\n\t\treturn this;\n\t}\n} );\n\n\njQuery.expr.pseudos.hidden = function( elem ) {\n\treturn !jQuery.expr.pseudos.visible( elem );\n};\njQuery.expr.pseudos.visible = function( elem ) {\n\treturn !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );\n};\n\n\n\n\njQuery.ajaxSettings.xhr = function() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n};\n\nvar xhrSuccessStatus = {\n\n\t\t// File protocol always yields status code 0, assume 200\n\t\t0: 200,\n\n\t\t// Support: IE <=9 only\n\t\t// trac-1450: sometimes IE returns 1223 when it should be 204\n\t\t1223: 204\n\t},\n\txhrSupported = jQuery.ajaxSettings.xhr();\n\nsupport.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\nsupport.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport( function( options ) {\n\tvar callback, errorCallback;\n\n\t// Cross domain only allowed if supported through XMLHttpRequest\n\tif ( support.cors || xhrSupported && !options.crossDomain ) {\n\t\treturn {\n\t\t\tsend: function( headers, complete ) {\n\t\t\t\tvar i,\n\t\t\t\t\txhr = options.xhr();\n\n\t\t\t\txhr.open(\n\t\t\t\t\toptions.type,\n\t\t\t\t\toptions.url,\n\t\t\t\t\toptions.async,\n\t\t\t\t\toptions.username,\n\t\t\t\t\toptions.password\n\t\t\t\t);\n\n\t\t\t\t// Apply custom fields if provided\n\t\t\t\tif ( options.xhrFields ) {\n\t\t\t\t\tfor ( i in options.xhrFields ) {\n\t\t\t\t\t\txhr[ i ] = options.xhrFields[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Override mime type if needed\n\t\t\t\tif ( options.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\txhr.overrideMimeType( options.mimeType );\n\t\t\t\t}\n\n\t\t\t\t// X-Requested-With header\n\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t// For same-domain requests, won't change header if already provided.\n\t\t\t\tif ( !options.crossDomain && !headers[ \"X-Requested-With\" ] ) {\n\t\t\t\t\theaders[ \"X-Requested-With\" ] = \"XMLHttpRequest\";\n\t\t\t\t}\n\n\t\t\t\t// Set headers\n\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t}\n\n\t\t\t\t// Callback\n\t\t\t\tcallback = function( type ) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tcallback = errorCallback = xhr.onload =\n\t\t\t\t\t\t\t\txhr.onerror = xhr.onabort = xhr.ontimeout =\n\t\t\t\t\t\t\t\t\txhr.onreadystatechange = null;\n\n\t\t\t\t\t\t\tif ( type === \"abort\" ) {\n\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t} else if ( type === \"error\" ) {\n\n\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t// On a manual native abort, IE9 throws\n\t\t\t\t\t\t\t\t// errors on any property access that is not readyState\n\t\t\t\t\t\t\t\tif ( typeof xhr.status !== \"number\" ) {\n\t\t\t\t\t\t\t\t\tcomplete( 0, \"error\" );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcomplete(\n\n\t\t\t\t\t\t\t\t\t\t// File: protocol always yields status 0; see trac-8605, trac-14207\n\t\t\t\t\t\t\t\t\t\txhr.status,\n\t\t\t\t\t\t\t\t\t\txhr.statusText\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\txhrSuccessStatus[ xhr.status ] || xhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText,\n\n\t\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t\t// IE9 has no XHR2 but throws on binary (trac-11426)\n\t\t\t\t\t\t\t\t\t// For XHR2 non-text, let the caller handle it (gh-2498)\n\t\t\t\t\t\t\t\t\t( xhr.responseType || \"text\" ) !== \"text\"  ||\n\t\t\t\t\t\t\t\t\ttypeof xhr.responseText !== \"string\" ?\n\t\t\t\t\t\t\t\t\t\t{ binary: xhr.response } :\n\t\t\t\t\t\t\t\t\t\t{ text: xhr.responseText },\n\t\t\t\t\t\t\t\t\txhr.getAllResponseHeaders()\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Listen to events\n\t\t\t\txhr.onload = callback();\n\t\t\t\terrorCallback = xhr.onerror = xhr.ontimeout = callback( \"error\" );\n\n\t\t\t\t// Support: IE 9 only\n\t\t\t\t// Use onreadystatechange to replace onabort\n\t\t\t\t// to handle uncaught aborts\n\t\t\t\tif ( xhr.onabort !== undefined ) {\n\t\t\t\t\txhr.onabort = errorCallback;\n\t\t\t\t} else {\n\t\t\t\t\txhr.onreadystatechange = function() {\n\n\t\t\t\t\t\t// Check readyState before timeout as it changes\n\t\t\t\t\t\tif ( xhr.readyState === 4 ) {\n\n\t\t\t\t\t\t\t// Allow onerror to be called first,\n\t\t\t\t\t\t\t// but that will not handle a native abort\n\t\t\t\t\t\t\t// Also, save errorCallback to a variable\n\t\t\t\t\t\t\t// as xhr.onerror cannot be accessed\n\t\t\t\t\t\t\twindow.setTimeout( function() {\n\t\t\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\t\t\terrorCallback();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Create the abort callback\n\t\t\t\tcallback = callback( \"abort\" );\n\n\t\t\t\ttry {\n\n\t\t\t\t\t// Do send the request (this may raise an exception)\n\t\t\t\t\txhr.send( options.hasContent && options.data || null );\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t// trac-14683: Only rethrow if this hasn't been notified as an error yet\n\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\n// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\njQuery.ajaxPrefilter( function( s ) {\n\tif ( s.crossDomain ) {\n\t\ts.contents.script = false;\n\t}\n} );\n\n// Install script dataType\njQuery.ajaxSetup( {\n\taccepts: {\n\t\tscript: \"text/javascript, application/javascript, \" +\n\t\t\t\"application/ecmascript, application/x-ecmascript\"\n\t},\n\tcontents: {\n\t\tscript: /\\b(?:java|ecma)script\\b/\n\t},\n\tconverters: {\n\t\t\"text script\": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n} );\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = \"GET\";\n\t}\n} );\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\n\t// This transport only deals with cross domain or forced-by-attrs requests\n\tif ( s.crossDomain || s.scriptAttrs ) {\n\t\tvar script, callback;\n\t\treturn {\n\t\t\tsend: function( _, complete ) {\n\t\t\t\tscript = jQuery( \"<script>\" )\n\t\t\t\t\t.attr( s.scriptAttrs || {} )\n\t\t\t\t\t.prop( { charset: s.scriptCharset, src: s.url } )\n\t\t\t\t\t.on( \"load error\", callback = function( evt ) {\n\t\t\t\t\t\tscript.remove();\n\t\t\t\t\t\tcallback = null;\n\t\t\t\t\t\tif ( evt ) {\n\t\t\t\t\t\t\tcomplete( evt.type === \"error\" ? 404 : 200, evt.type );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t// Use native DOM manipulation to avoid our domManip AJAX trickery\n\t\t\t\tdocument.head.appendChild( script[ 0 ] );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\nvar oldCallbacks = [],\n\trjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup( {\n\tjsonp: \"callback\",\n\tjsonpCallback: function() {\n\t\tvar callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( nonce.guid++ ) );\n\t\tthis[ callback ] = true;\n\t\treturn callback;\n\t}\n} );\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( \"json jsonp\", function( s, originalSettings, jqXHR ) {\n\n\tvar callbackName, overwritten, responseContainer,\n\t\tjsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n\t\t\t\"url\" :\n\t\t\ttypeof s.data === \"string\" &&\n\t\t\t\t( s.contentType || \"\" )\n\t\t\t\t\t.indexOf( \"application/x-www-form-urlencoded\" ) === 0 &&\n\t\t\t\trjsonp.test( s.data ) && \"data\"\n\t\t);\n\n\t// Handle iff the expected data type is \"jsonp\" or we have a parameter to set\n\tif ( jsonProp || s.dataTypes[ 0 ] === \"jsonp\" ) {\n\n\t\t// Get callback name, remembering preexisting value associated with it\n\t\tcallbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?\n\t\t\ts.jsonpCallback() :\n\t\t\ts.jsonpCallback;\n\n\t\t// Insert callback into url or form data\n\t\tif ( jsonProp ) {\n\t\t\ts[ jsonProp ] = s[ jsonProp ].replace( rjsonp, \"$1\" + callbackName );\n\t\t} else if ( s.jsonp !== false ) {\n\t\t\ts.url += ( rquery.test( s.url ) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\n\t\t}\n\n\t\t// Use data converter to retrieve json after script execution\n\t\ts.converters[ \"script json\" ] = function() {\n\t\t\tif ( !responseContainer ) {\n\t\t\t\tjQuery.error( callbackName + \" was not called\" );\n\t\t\t}\n\t\t\treturn responseContainer[ 0 ];\n\t\t};\n\n\t\t// Force json dataType\n\t\ts.dataTypes[ 0 ] = \"json\";\n\n\t\t// Install callback\n\t\toverwritten = window[ callbackName ];\n\t\twindow[ callbackName ] = function() {\n\t\t\tresponseContainer = arguments;\n\t\t};\n\n\t\t// Clean-up function (fires after converters)\n\t\tjqXHR.always( function() {\n\n\t\t\t// If previous value didn't exist - remove it\n\t\t\tif ( overwritten === undefined ) {\n\t\t\t\tjQuery( window ).removeProp( callbackName );\n\n\t\t\t// Otherwise restore preexisting value\n\t\t\t} else {\n\t\t\t\twindow[ callbackName ] = overwritten;\n\t\t\t}\n\n\t\t\t// Save back as free\n\t\t\tif ( s[ callbackName ] ) {\n\n\t\t\t\t// Make sure that re-using the options doesn't screw things around\n\t\t\t\ts.jsonpCallback = originalSettings.jsonpCallback;\n\n\t\t\t\t// Save the callback name for future use\n\t\t\t\toldCallbacks.push( callbackName );\n\t\t\t}\n\n\t\t\t// Call if it was a function and we have a response\n\t\t\tif ( responseContainer && isFunction( overwritten ) ) {\n\t\t\t\toverwritten( responseContainer[ 0 ] );\n\t\t\t}\n\n\t\t\tresponseContainer = overwritten = undefined;\n\t\t} );\n\n\t\t// Delegate to script\n\t\treturn \"script\";\n\t}\n} );\n\n\n\n\n// Support: Safari 8 only\n// In Safari 8 documents created via document.implementation.createHTMLDocument\n// collapse sibling forms: the second one becomes a child of the first one.\n// Because of that, this security measure has to be disabled in Safari 8.\n// https://bugs.webkit.org/show_bug.cgi?id=137337\nsupport.createHTMLDocument = ( function() {\n\tvar body = document.implementation.createHTMLDocument( \"\" ).body;\n\tbody.innerHTML = \"<form></form><form></form>\";\n\treturn body.childNodes.length === 2;\n} )();\n\n\n// Argument \"data\" should be string of html\n// context (optional): If specified, the fragment will be created in this context,\n// defaults to document\n// keepScripts (optional): If true, will include scripts passed in the html string\njQuery.parseHTML = function( data, context, keepScripts ) {\n\tif ( typeof data !== \"string\" ) {\n\t\treturn [];\n\t}\n\tif ( typeof context === \"boolean\" ) {\n\t\tkeepScripts = context;\n\t\tcontext = false;\n\t}\n\n\tvar base, parsed, scripts;\n\n\tif ( !context ) {\n\n\t\t// Stop scripts or inline event handlers from being executed immediately\n\t\t// by using document.implementation\n\t\tif ( support.createHTMLDocument ) {\n\t\t\tcontext = document.implementation.createHTMLDocument( \"\" );\n\n\t\t\t// Set the base href for the created document\n\t\t\t// so any parsed elements with URLs\n\t\t\t// are based on the document's URL (gh-2965)\n\t\t\tbase = context.createElement( \"base\" );\n\t\t\tbase.href = document.location.href;\n\t\t\tcontext.head.appendChild( base );\n\t\t} else {\n\t\t\tcontext = document;\n\t\t}\n\t}\n\n\tparsed = rsingleTag.exec( data );\n\tscripts = !keepScripts && [];\n\n\t// Single tag\n\tif ( parsed ) {\n\t\treturn [ context.createElement( parsed[ 1 ] ) ];\n\t}\n\n\tparsed = buildFragment( [ data ], context, scripts );\n\n\tif ( scripts && scripts.length ) {\n\t\tjQuery( scripts ).remove();\n\t}\n\n\treturn jQuery.merge( [], parsed.childNodes );\n};\n\n\n/**\n * Load a url into a page\n */\njQuery.fn.load = function( url, params, callback ) {\n\tvar selector, type, response,\n\t\tself = this,\n\t\toff = url.indexOf( \" \" );\n\n\tif ( off > -1 ) {\n\t\tselector = stripAndCollapse( url.slice( off ) );\n\t\turl = url.slice( 0, off );\n\t}\n\n\t// If it's a function\n\tif ( isFunction( params ) ) {\n\n\t\t// We assume that it's the callback\n\t\tcallback = params;\n\t\tparams = undefined;\n\n\t// Otherwise, build a param string\n\t} else if ( params && typeof params === \"object\" ) {\n\t\ttype = \"POST\";\n\t}\n\n\t// If we have elements to modify, make the request\n\tif ( self.length > 0 ) {\n\t\tjQuery.ajax( {\n\t\t\turl: url,\n\n\t\t\t// If \"type\" variable is undefined, then \"GET\" method will be used.\n\t\t\t// Make value of this field explicit since\n\t\t\t// user can override it through ajaxSetup method\n\t\t\ttype: type || \"GET\",\n\t\t\tdataType: \"html\",\n\t\t\tdata: params\n\t\t} ).done( function( responseText ) {\n\n\t\t\t// Save response for use in complete callback\n\t\t\tresponse = arguments;\n\n\t\t\tself.html( selector ?\n\n\t\t\t\t// If a selector was specified, locate the right elements in a dummy div\n\t\t\t\t// Exclude scripts to avoid IE 'Permission Denied' errors\n\t\t\t\tjQuery( \"<div>\" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n\t\t\t\t// Otherwise use the full result\n\t\t\t\tresponseText );\n\n\t\t// If the request succeeds, this function gets \"data\", \"status\", \"jqXHR\"\n\t\t// but they are ignored because response was set above.\n\t\t// If it fails, this function gets \"jqXHR\", \"status\", \"error\"\n\t\t} ).always( callback && function( jqXHR, status ) {\n\t\t\tself.each( function() {\n\t\t\t\tcallback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t\t} );\n\t\t} );\n\t}\n\n\treturn this;\n};\n\n\n\n\njQuery.expr.pseudos.animated = function( elem ) {\n\treturn jQuery.grep( jQuery.timers, function( fn ) {\n\t\treturn elem === fn.elem;\n\t} ).length;\n};\n\n\n\n\njQuery.offset = {\n\tsetOffset: function( elem, options, i ) {\n\t\tvar curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n\t\t\tposition = jQuery.css( elem, \"position\" ),\n\t\t\tcurElem = jQuery( elem ),\n\t\t\tprops = {};\n\n\t\t// Set position first, in-case top/left are set even on static elem\n\t\tif ( position === \"static\" ) {\n\t\t\telem.style.position = \"relative\";\n\t\t}\n\n\t\tcurOffset = curElem.offset();\n\t\tcurCSSTop = jQuery.css( elem, \"top\" );\n\t\tcurCSSLeft = jQuery.css( elem, \"left\" );\n\t\tcalculatePosition = ( position === \"absolute\" || position === \"fixed\" ) &&\n\t\t\t( curCSSTop + curCSSLeft ).indexOf( \"auto\" ) > -1;\n\n\t\t// Need to be able to calculate position if either\n\t\t// top or left is auto and position is either absolute or fixed\n\t\tif ( calculatePosition ) {\n\t\t\tcurPosition = curElem.position();\n\t\t\tcurTop = curPosition.top;\n\t\t\tcurLeft = curPosition.left;\n\n\t\t} else {\n\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t}\n\n\t\tif ( isFunction( options ) ) {\n\n\t\t\t// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)\n\t\t\toptions = options.call( elem, i, jQuery.extend( {}, curOffset ) );\n\t\t}\n\n\t\tif ( options.top != null ) {\n\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t}\n\t\tif ( options.left != null ) {\n\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t}\n\n\t\tif ( \"using\" in options ) {\n\t\t\toptions.using.call( elem, props );\n\n\t\t} else {\n\t\t\tcurElem.css( props );\n\t\t}\n\t}\n};\n\njQuery.fn.extend( {\n\n\t// offset() relates an element's border box to the document origin\n\toffset: function( options ) {\n\n\t\t// Preserve chaining for setter\n\t\tif ( arguments.length ) {\n\t\t\treturn options === undefined ?\n\t\t\t\tthis :\n\t\t\t\tthis.each( function( i ) {\n\t\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t\t} );\n\t\t}\n\n\t\tvar rect, win,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !elem ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Return zeros for disconnected and hidden (display: none) elements (gh-2310)\n\t\t// Support: IE <=11 only\n\t\t// Running getBoundingClientRect on a\n\t\t// disconnected node in IE throws an error\n\t\tif ( !elem.getClientRects().length ) {\n\t\t\treturn { top: 0, left: 0 };\n\t\t}\n\n\t\t// Get document-relative position by adding viewport scroll to viewport-relative gBCR\n\t\trect = elem.getBoundingClientRect();\n\t\twin = elem.ownerDocument.defaultView;\n\t\treturn {\n\t\t\ttop: rect.top + win.pageYOffset,\n\t\t\tleft: rect.left + win.pageXOffset\n\t\t};\n\t},\n\n\t// position() relates an element's margin box to its offset parent's padding box\n\t// This corresponds to the behavior of CSS absolute positioning\n\tposition: function() {\n\t\tif ( !this[ 0 ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar offsetParent, offset, doc,\n\t\t\telem = this[ 0 ],\n\t\t\tparentOffset = { top: 0, left: 0 };\n\n\t\t// position:fixed elements are offset from the viewport, which itself always has zero offset\n\t\tif ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\n\t\t\t// Assume position:fixed implies availability of getBoundingClientRect\n\t\t\toffset = elem.getBoundingClientRect();\n\n\t\t} else {\n\t\t\toffset = this.offset();\n\n\t\t\t// Account for the *real* offset parent, which can be the document or its root element\n\t\t\t// when a statically positioned element is identified\n\t\t\tdoc = elem.ownerDocument;\n\t\t\toffsetParent = elem.offsetParent || doc.documentElement;\n\t\t\twhile ( offsetParent &&\n\t\t\t\t( offsetParent === doc.body || offsetParent === doc.documentElement ) &&\n\t\t\t\tjQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\n\t\t\t\toffsetParent = offsetParent.parentNode;\n\t\t\t}\n\t\t\tif ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {\n\n\t\t\t\t// Incorporate borders into its offset, since they are outside its content origin\n\t\t\t\tparentOffset = jQuery( offsetParent ).offset();\n\t\t\t\tparentOffset.top += jQuery.css( offsetParent, \"borderTopWidth\", true );\n\t\t\t\tparentOffset.left += jQuery.css( offsetParent, \"borderLeftWidth\", true );\n\t\t\t}\n\t\t}\n\n\t\t// Subtract parent offsets and element margins\n\t\treturn {\n\t\t\ttop: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true )\n\t\t};\n\t},\n\n\t// This method will return documentElement in the following cases:\n\t// 1) For the element inside the iframe without offsetParent, this method will return\n\t//    documentElement of the parent window\n\t// 2) For the hidden or detached element\n\t// 3) For body or html element, i.e. in case of the html node - it will return itself\n\t//\n\t// but those exceptions were never presented as a real life use-cases\n\t// and might be considered as more preferable results.\n\t//\n\t// This logic, however, is not guaranteed and can change at any point in the future\n\toffsetParent: function() {\n\t\treturn this.map( function() {\n\t\t\tvar offsetParent = this.offsetParent;\n\n\t\t\twhile ( offsetParent && jQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\n\t\t\treturn offsetParent || documentElement;\n\t\t} );\n\t}\n} );\n\n// Create scrollLeft and scrollTop methods\njQuery.each( { scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\" }, function( method, prop ) {\n\tvar top = \"pageYOffset\" === prop;\n\n\tjQuery.fn[ method ] = function( val ) {\n\t\treturn access( this, function( elem, method, val ) {\n\n\t\t\t// Coalesce documents and windows\n\t\t\tvar win;\n\t\t\tif ( isWindow( elem ) ) {\n\t\t\t\twin = elem;\n\t\t\t} else if ( elem.nodeType === 9 ) {\n\t\t\t\twin = elem.defaultView;\n\t\t\t}\n\n\t\t\tif ( val === undefined ) {\n\t\t\t\treturn win ? win[ prop ] : elem[ method ];\n\t\t\t}\n\n\t\t\tif ( win ) {\n\t\t\t\twin.scrollTo(\n\t\t\t\t\t!top ? val : win.pageXOffset,\n\t\t\t\t\ttop ? val : win.pageYOffset\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\telem[ method ] = val;\n\t\t\t}\n\t\t}, method, val, arguments.length );\n\t};\n} );\n\n// Support: Safari <=7 - 9.1, Chrome <=37 - 49\n// Add the top/left cssHooks using jQuery.fn.position\n// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347\n// getComputedStyle returns percent when specified for top/left/bottom/right;\n// rather than make the css module depend on the offset module, just check for it here\njQuery.each( [ \"top\", \"left\" ], function( _i, prop ) {\n\tjQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\n\t\tfunction( elem, computed ) {\n\t\t\tif ( computed ) {\n\t\t\t\tcomputed = curCSS( elem, prop );\n\n\t\t\t\t// If curCSS returns percentage, fallback to offset\n\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\tjQuery( elem ).position()[ prop ] + \"px\" :\n\t\t\t\t\tcomputed;\n\t\t\t}\n\t\t}\n\t);\n} );\n\n\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n\tjQuery.each( {\n\t\tpadding: \"inner\" + name,\n\t\tcontent: type,\n\t\t\"\": \"outer\" + name\n\t}, function( defaultExtra, funcName ) {\n\n\t\t// Margin is only for outerHeight, outerWidth\n\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n\t\t\t\textra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n\t\t\treturn access( this, function( elem, type, value ) {\n\t\t\t\tvar doc;\n\n\t\t\t\tif ( isWindow( elem ) ) {\n\n\t\t\t\t\t// $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)\n\t\t\t\t\treturn funcName.indexOf( \"outer\" ) === 0 ?\n\t\t\t\t\t\telem[ \"inner\" + name ] :\n\t\t\t\t\t\telem.document.documentElement[ \"client\" + name ];\n\t\t\t\t}\n\n\t\t\t\t// Get document width or height\n\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\tdoc = elem.documentElement;\n\n\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\n\t\t\t\t\t// whichever is greatest\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\telem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n\t\t\t\t\t\telem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n\t\t\t\t\t\tdoc[ \"client\" + name ]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn value === undefined ?\n\n\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\n\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t}, type, chainable ? margin : undefined, chainable );\n\t\t};\n\t} );\n} );\n\n\njQuery.each( [\n\t\"ajaxStart\",\n\t\"ajaxStop\",\n\t\"ajaxComplete\",\n\t\"ajaxError\",\n\t\"ajaxSuccess\",\n\t\"ajaxSend\"\n], function( _i, type ) {\n\tjQuery.fn[ type ] = function( fn ) {\n\t\treturn this.on( type, fn );\n\t};\n} );\n\n\n\n\njQuery.fn.extend( {\n\n\tbind: function( types, data, fn ) {\n\t\treturn this.on( types, null, data, fn );\n\t},\n\tunbind: function( types, fn ) {\n\t\treturn this.off( types, null, fn );\n\t},\n\n\tdelegate: function( selector, types, data, fn ) {\n\t\treturn this.on( types, selector, data, fn );\n\t},\n\tundelegate: function( selector, types, fn ) {\n\n\t\t// ( namespace ) or ( selector, types [, fn] )\n\t\treturn arguments.length === 1 ?\n\t\t\tthis.off( selector, \"**\" ) :\n\t\t\tthis.off( types, selector || \"**\", fn );\n\t},\n\n\thover: function( fnOver, fnOut ) {\n\t\treturn this\n\t\t\t.on( \"mouseenter\", fnOver )\n\t\t\t.on( \"mouseleave\", fnOut || fnOver );\n\t}\n} );\n\njQuery.each(\n\t( \"blur focus focusin focusout resize scroll click dblclick \" +\n\t\"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave \" +\n\t\"change select submit keydown keypress keyup contextmenu\" ).split( \" \" ),\n\tfunction( _i, name ) {\n\n\t\t// Handle event binding\n\t\tjQuery.fn[ name ] = function( data, fn ) {\n\t\t\treturn arguments.length > 0 ?\n\t\t\t\tthis.on( name, null, data, fn ) :\n\t\t\t\tthis.trigger( name );\n\t\t};\n\t}\n);\n\n\n\n\n// Support: Android <=4.0 only\n// Make sure we trim BOM and NBSP\n// Require that the \"whitespace run\" starts from a non-whitespace\n// to avoid O(N^2) behavior when the engine would try matching \"\\s+$\" at each space position.\nvar rtrim = /^[\\s\\uFEFF\\xA0]+|([^\\s\\uFEFF\\xA0])[\\s\\uFEFF\\xA0]+$/g;\n\n// Bind a function to a context, optionally partially applying any\n// arguments.\n// jQuery.proxy is deprecated to promote standards (specifically Function#bind)\n// However, it is not slated for removal any time soon\njQuery.proxy = function( fn, context ) {\n\tvar tmp, args, proxy;\n\n\tif ( typeof context === \"string\" ) {\n\t\ttmp = fn[ context ];\n\t\tcontext = fn;\n\t\tfn = tmp;\n\t}\n\n\t// Quick check to determine if target is callable, in the spec\n\t// this throws a TypeError, but we will just return undefined.\n\tif ( !isFunction( fn ) ) {\n\t\treturn undefined;\n\t}\n\n\t// Simulated bind\n\targs = slice.call( arguments, 2 );\n\tproxy = function() {\n\t\treturn fn.apply( context || this, args.concat( slice.call( arguments ) ) );\n\t};\n\n\t// Set the guid of unique handler to the same of original handler, so it can be removed\n\tproxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n\treturn proxy;\n};\n\njQuery.holdReady = function( hold ) {\n\tif ( hold ) {\n\t\tjQuery.readyWait++;\n\t} else {\n\t\tjQuery.ready( true );\n\t}\n};\njQuery.isArray = Array.isArray;\njQuery.parseJSON = JSON.parse;\njQuery.nodeName = nodeName;\njQuery.isFunction = isFunction;\njQuery.isWindow = isWindow;\njQuery.camelCase = camelCase;\njQuery.type = toType;\n\njQuery.now = Date.now;\n\njQuery.isNumeric = function( obj ) {\n\n\t// As of jQuery 3.0, isNumeric is limited to\n\t// strings and numbers (primitives or objects)\n\t// that can be coerced to finite numbers (gh-2662)\n\tvar type = jQuery.type( obj );\n\treturn ( type === \"number\" || type === \"string\" ) &&\n\n\t\t// parseFloat NaNs numeric-cast false positives (\"\")\n\t\t// ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n\t\t// subtraction forces infinities to NaN\n\t\t!isNaN( obj - parseFloat( obj ) );\n};\n\njQuery.trim = function( text ) {\n\treturn text == null ?\n\t\t\"\" :\n\t\t( text + \"\" ).replace( rtrim, \"$1\" );\n};\n\n\n\n// Register as a named AMD module, since jQuery can be concatenated with other\n// files that may use define, but not via a proper concatenation script that\n// understands anonymous AMD modules. A named AMD is safest and most robust\n// way to register. Lowercase jquery is used because AMD module names are\n// derived from file names, and jQuery is normally delivered in a lowercase\n// file name. Do this after creating the global so that if an AMD module wants\n// to call noConflict to hide this version of jQuery, it will work.\n\n// Note that for maximum portability, libraries that are not jQuery should\n// declare themselves as anonymous modules, and avoid setting a global if an\n// AMD loader is present. jQuery is a special case. For more information, see\n// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\n\nif ( true ) {\n\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {\n\t\treturn jQuery;\n\t}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n}\n\n\n\n\nvar\n\n\t// Map over jQuery in case of overwrite\n\t_jQuery = window.jQuery,\n\n\t// Map over the $ in case of overwrite\n\t_$ = window.$;\n\njQuery.noConflict = function( deep ) {\n\tif ( window.$ === jQuery ) {\n\t\twindow.$ = _$;\n\t}\n\n\tif ( deep && window.jQuery === jQuery ) {\n\t\twindow.jQuery = _jQuery;\n\t}\n\n\treturn jQuery;\n};\n\n// Expose jQuery and $ identifiers, even in AMD\n// (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)\n// and CommonJS for browser emulators (trac-13566)\nif ( typeof noGlobal === \"undefined\" ) {\n\twindow.jQuery = window.$ = jQuery;\n}\n\n\n\n\nreturn jQuery;\n} );\n\n\n//# sourceURL=webpack://domino/./node_modules/jquery/dist/jquery.js?");

/***/ }),

/***/ "./node_modules/knockout.validation/dist/knockout.validation.js":
/*!**********************************************************************!*\
  !*** ./node_modules/knockout.validation/dist/knockout.validation.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

eval("/*=============================================================================\n\tAuthor:\t\t\tEric M. Barnard - @ericmbarnard\t\t\t\t\t\t\t\t\n\tLicense:\t\tMIT (http://opensource.org/licenses/mit-license.php)\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\tDescription:\tValidation Library for KnockoutJS\t\t\t\t\t\t\t\n\tVersion:\t\t2.0.3\t\t\t\t\t\t\t\t\t\t\t\n===============================================================================\n*/\n/*globals require: false, exports: false, define: false, ko: false */\n\n(function (factory) {\n\t// Module systems magic dance.\n\n\tif (true) {\n\t\t// CommonJS or Node: hard-coded dependency on \"knockout\"\n\t\tfactory(__webpack_require__(/*! knockout */ \"./node_modules/knockout/build/output/knockout-latest.js\"), exports);\n\t} else {}\n}(function ( ko, exports ) {\n\n\tif (typeof (ko) === 'undefined') {\n\t\tthrow new Error('Knockout is required, please ensure it is loaded before loading this validation plug-in');\n\t}\n\n\t// create our namespace object\n\tko.validation = exports;\n\n\tvar kv = ko.validation,\n\t\tkoUtils = ko.utils,\n\t\tunwrap = koUtils.unwrapObservable,\n\t\tforEach = koUtils.arrayForEach,\n\t\textend = koUtils.extend;\n;/*global ko: false*/\n\nvar defaults = {\n\tregisterExtenders: true,\n\tmessagesOnModified: true,\n\terrorsAsTitle: true,            // enables/disables showing of errors as title attribute of the target element.\n\terrorsAsTitleOnModified: false, // shows the error when hovering the input field (decorateElement must be true)\n\tmessageTemplate: null,\n\tinsertMessages: true,           // automatically inserts validation messages as <span></span>\n\tparseInputAttributes: false,    // parses the HTML5 validation attribute from a form element and adds that to the object\n\twriteInputAttributes: false,    // adds HTML5 input validation attributes to form elements that ko observable's are bound to\n\tdecorateInputElement: false,         // false to keep backward compatibility\n\tdecorateElementOnModified: true,// true to keep backward compatibility\n\terrorClass: null,               // single class for error message and element\n\terrorElementClass: 'validationElement',  // class to decorate error element\n\terrorMessageClass: 'validationMessage',  // class to decorate error message\n\tallowHtmlMessages: false,\t\t// allows HTML in validation messages\n\tgrouping: {\n\t\tdeep: false,        //by default grouping is shallow\n\t\tobservable: true,   //and using observables\n\t\tlive: false\t\t    //react to changes to observableArrays if observable === true\n\t},\n\tvalidate: {\n\t\t// throttle: 10\n\t}\n};\n\n// make a copy  so we can use 'reset' later\nvar configuration = extend({}, defaults);\n\nconfiguration.html5Attributes = ['required', 'pattern', 'min', 'max', 'step'];\nconfiguration.html5InputTypes = ['email', 'number', 'date'];\n\nconfiguration.reset = function () {\n\textend(configuration, defaults);\n};\n\nkv.configuration = configuration;\n;kv.utils = (function () {\n\tvar seedId = new Date().getTime();\n\n\tvar domData = {}; //hash of data objects that we reference from dom elements\n\tvar domDataKey = '__ko_validation__';\n\n\treturn {\n\t\tisArray: function (o) {\n\t\t\treturn o.isArray || Object.prototype.toString.call(o) === '[object Array]';\n\t\t},\n\t\tisObject: function (o) {\n\t\t\treturn o !== null && typeof o === 'object';\n\t\t},\n\t\tisNumber: function(o) {\n\t\t\treturn !isNaN(o);\t\n\t\t},\n\t\tisObservableArray: function(instance) {\n\t\t\treturn !!instance &&\n\t\t\t\t\ttypeof instance[\"remove\"] === \"function\" &&\n\t\t\t\t\ttypeof instance[\"removeAll\"] === \"function\" &&\n\t\t\t\t\ttypeof instance[\"destroy\"] === \"function\" &&\n\t\t\t\t\ttypeof instance[\"destroyAll\"] === \"function\" &&\n\t\t\t\t\ttypeof instance[\"indexOf\"] === \"function\" &&\n\t\t\t\t\ttypeof instance[\"replace\"] === \"function\";\n\t\t},\n\t\tvalues: function (o) {\n\t\t\tvar r = [];\n\t\t\tfor (var i in o) {\n\t\t\t\tif (o.hasOwnProperty(i)) {\n\t\t\t\t\tr.push(o[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn r;\n\t\t},\n\t\tgetValue: function (o) {\n\t\t\treturn (typeof o === 'function' ? o() : o);\n\t\t},\n\t\thasAttribute: function (node, attr) {\n\t\t\treturn node.getAttribute(attr) !== null;\n\t\t},\n\t\tgetAttribute: function (element, attr) {\n\t\t\treturn element.getAttribute(attr);\n\t\t},\n\t\tsetAttribute: function (element, attr, value) {\n\t\t\treturn element.setAttribute(attr, value);\n\t\t},\n\t\tisValidatable: function (o) {\n\t\t\treturn !!(o && o.rules && o.isValid && o.isModified);\n\t\t},\n\t\tinsertAfter: function (node, newNode) {\n\t\t\tnode.parentNode.insertBefore(newNode, node.nextSibling);\n\t\t},\n\t\tnewId: function () {\n\t\t\treturn seedId += 1;\n\t\t},\n\t\tgetConfigOptions: function (element) {\n\t\t\tvar options = kv.utils.contextFor(element);\n\n\t\t\treturn options || kv.configuration;\n\t\t},\n\t\tsetDomData: function (node, data) {\n\t\t\tvar key = node[domDataKey];\n\n\t\t\tif (!key) {\n\t\t\t\tnode[domDataKey] = key = kv.utils.newId();\n\t\t\t}\n\n\t\t\tdomData[key] = data;\n\t\t},\n\t\tgetDomData: function (node) {\n\t\t\tvar key = node[domDataKey];\n\n\t\t\tif (!key) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn domData[key];\n\t\t},\n\t\tcontextFor: function (node) {\n\t\t\tswitch (node.nodeType) {\n\t\t\t\tcase 1:\n\t\t\t\tcase 8:\n\t\t\t\t\tvar context = kv.utils.getDomData(node);\n\t\t\t\t\tif (context) { return context; }\n\t\t\t\t\tif (node.parentNode) { return kv.utils.contextFor(node.parentNode); }\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\t\tisEmptyVal: function (val) {\n\t\t\tif (val === undefined) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (val === null) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (val === \"\") {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t},\n\t\tgetOriginalElementTitle: function (element) {\n\t\t\tvar savedOriginalTitle = kv.utils.getAttribute(element, 'data-orig-title'),\n\t\t\t\tcurrentTitle = element.title,\n\t\t\t\thasSavedOriginalTitle = kv.utils.hasAttribute(element, 'data-orig-title');\n\n\t\t\treturn hasSavedOriginalTitle ?\n\t\t\t\tsavedOriginalTitle : currentTitle;\n\t\t},\n\t\tasync: function (expr) {\n\t\t\tif (window.setImmediate) { window.setImmediate(expr); }\n\t\t\telse { window.setTimeout(expr, 0); }\n\t\t},\n\t\tforEach: function (object, callback) {\n\t\t\tif (kv.utils.isArray(object)) {\n\t\t\t\treturn forEach(object, callback);\n\t\t\t}\n\t\t\tfor (var prop in object) {\n\t\t\t\tif (object.hasOwnProperty(prop)) {\n\t\t\t\t\tcallback(object[prop], prop);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}());;var api = (function () {\n\n\tvar isInitialized = 0,\n\t\tconfiguration = kv.configuration,\n\t\tutils = kv.utils;\n\n\tfunction cleanUpSubscriptions(context) {\n\t\tforEach(context.subscriptions, function (subscription) {\n\t\t\tsubscription.dispose();\n\t\t});\n\t\tcontext.subscriptions = [];\n\t}\n\n\tfunction dispose(context) {\n\t\tif (context.options.deep) {\n\t\t\tforEach(context.flagged, function (obj) {\n\t\t\t\tdelete obj.__kv_traversed;\n\t\t\t});\n\t\t\tcontext.flagged.length = 0;\n\t\t}\n\n\t\tif (!context.options.live) {\n\t\t\tcleanUpSubscriptions(context);\n\t\t}\n\t}\n\n\tfunction runTraversal(obj, context) {\n\t\tcontext.validatables = [];\n\t\tcleanUpSubscriptions(context);\n\t\ttraverseGraph(obj, context);\n\t\tdispose(context);\n\t}\n\n\tfunction traverseGraph(obj, context, level) {\n\t\tvar objValues = [],\n\t\t\tval = obj.peek ? obj.peek() : obj;\n\n\t\tif (obj.__kv_traversed === true) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (context.options.deep) {\n\t\t\tobj.__kv_traversed = true;\n\t\t\tcontext.flagged.push(obj);\n\t\t}\n\n\t\t//default level value depends on deep option.\n\t\tlevel = (level !== undefined ? level : context.options.deep ? 1 : -1);\n\n\t\t// if object is observable then add it to the list\n\t\tif (ko.isObservable(obj)) {\n\t\t\t// ensure it's validatable but don't extend validatedObservable because it\n\t\t\t// would overwrite isValid property.\n\t\t\tif (!obj.errors && !utils.isValidatable(obj)) {\n\t\t\t\tobj.extend({ validatable: true });\n\t\t\t}\n\t\t\tcontext.validatables.push(obj);\n\n\t\t\tif (context.options.live && utils.isObservableArray(obj)) {\n\t\t\t\tcontext.subscriptions.push(obj.subscribe(function () {\n\t\t\t\t\tcontext.graphMonitor.valueHasMutated();\n\t\t\t\t}));\n\t\t\t}\n\t\t}\n\n\t\t//get list of values either from array or object but ignore non-objects\n\t\t// and destroyed objects\n\t\tif (val && !val._destroy) {\n\t\t\tif (utils.isArray(val)) {\n\t\t\t\tobjValues = val;\n\t\t\t}\n\t\t\telse if (utils.isObject(val)) {\n\t\t\t\tobjValues = utils.values(val);\n\t\t\t}\n\t\t}\n\n\t\t//process recursively if it is deep grouping\n\t\tif (level !== 0) {\n\t\t\tutils.forEach(objValues, function (observable) {\n\t\t\t\t//but not falsy things and not HTML Elements\n\t\t\t\tif (observable && !observable.nodeType && (!ko.isComputed(observable) || observable.rules)) {\n\t\t\t\t\ttraverseGraph(observable, context, level + 1);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tfunction collectErrors(array) {\n\t\tvar errors = [];\n\t\tforEach(array, function (observable) {\n\t\t\t// Do not collect validatedObservable errors\n\t\t\tif (utils.isValidatable(observable) && !observable.isValid()) {\n\t\t\t\t// Use peek because we don't want a dependency for 'error' property because it\n\t\t\t\t// changes before 'isValid' does. (Issue #99)\n\t\t\t\terrors.push(observable.error.peek());\n\t\t\t}\n\t\t});\n\t\treturn errors;\n\t}\n\n\treturn {\n\t\t//Call this on startup\n\t\t//any config can be overridden with the passed in options\n\t\tinit: function (options, force) {\n\t\t\t//done run this multiple times if we don't really want to\n\t\t\tif (isInitialized > 0 && !force) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//because we will be accessing options properties it has to be an object at least\n\t\t\toptions = options || {};\n\t\t\t//if specific error classes are not provided then apply generic errorClass\n\t\t\t//it has to be done on option so that options.errorClass can override default\n\t\t\t//errorElementClass and errorMessage class but not those provided in options\n\t\t\toptions.errorElementClass = options.errorElementClass || options.errorClass || configuration.errorElementClass;\n\t\t\toptions.errorMessageClass = options.errorMessageClass || options.errorClass || configuration.errorMessageClass;\n\n\t\t\textend(configuration, options);\n\n\t\t\tif (configuration.registerExtenders) {\n\t\t\t\tkv.registerExtenders();\n\t\t\t}\n\n\t\t\tisInitialized = 1;\n\t\t},\n\n\t\t// resets the config back to its original state\n\t\treset: kv.configuration.reset,\n\n\t\t// recursively walks a viewModel and creates an object that\n\t\t// provides validation information for the entire viewModel\n\t\t// obj -> the viewModel to walk\n\t\t// options -> {\n\t\t//\t  deep: false, // if true, will walk past the first level of viewModel properties\n\t\t//\t  observable: false // if true, returns a computed observable indicating if the viewModel is valid\n\t\t// }\n\t\tgroup: function group(obj, options) { // array of observables or viewModel\n\t\t\toptions = extend(extend({}, configuration.grouping), options);\n\n\t\t\tvar context = {\n\t\t\t\toptions: options,\n\t\t\t\tgraphMonitor: ko.observable(),\n\t\t\t\tflagged: [],\n\t\t\t\tsubscriptions: [],\n\t\t\t\tvalidatables: []\n\t\t\t};\n\n\t\t\tvar result = null;\n\n\t\t\t//if using observables then traverse structure once and add observables\n\t\t\tif (options.observable) {\n\t\t\t\tresult = ko.computed(function () {\n\t\t\t\t\tcontext.graphMonitor(); //register dependency\n\t\t\t\t\trunTraversal(obj, context);\n\t\t\t\t\treturn collectErrors(context.validatables);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse { //if not using observables then every call to error() should traverse the structure\n\t\t\t\tresult = function () {\n\t\t\t\t\trunTraversal(obj, context);\n\t\t\t\t\treturn collectErrors(context.validatables);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tresult.showAllMessages = function (show) { // thanks @heliosPortal\n\t\t\t\tif (show === undefined) {//default to true\n\t\t\t\t\tshow = true;\n\t\t\t\t}\n\n\t\t\t\tresult.forEach(function (observable) {\n\t\t\t\t\tif (utils.isValidatable(observable)) {\n\t\t\t\t\t\tobservable.isModified(show);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tresult.isAnyMessageShown = function () {\n\t\t\t\tvar invalidAndModifiedPresent;\n\n\t\t\t\tinvalidAndModifiedPresent = !!result.find(function (observable) {\n\t\t\t\t\treturn utils.isValidatable(observable) && !observable.isValid() && observable.isModified();\n\t\t\t\t});\n\t\t\t\treturn invalidAndModifiedPresent;\n\t\t\t};\n\n\t\t\tresult.filter = function(predicate) {\n\t\t\t\tpredicate = predicate || function () { return true; };\n\t\t\t\t// ensure we have latest changes\n\t\t\t\tresult();\n\n\t\t\t\treturn koUtils.arrayFilter(context.validatables, predicate);\n\t\t\t};\n\n\t\t\tresult.find = function(predicate) {\n\t\t\t\tpredicate = predicate || function () { return true; };\n\t\t\t\t// ensure we have latest changes\n\t\t\t\tresult();\n\n\t\t\t\treturn koUtils.arrayFirst(context.validatables, predicate);\n\t\t\t};\n\n\t\t\tresult.forEach = function(callback) {\n\t\t\t\tcallback = callback || function () { };\n\t\t\t\t// ensure we have latest changes\n\t\t\t\tresult();\n\n\t\t\t\tforEach(context.validatables, callback);\n\t\t\t};\n\n\t\t\tresult.map = function(mapping) {\n\t\t\t\tmapping = mapping || function (item) { return item; };\n\t\t\t\t// ensure we have latest changes\n\t\t\t\tresult();\n\n\t\t\t\treturn koUtils.arrayMap(context.validatables, mapping);\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * @private You should not rely on this method being here.\n\t\t\t * It's a private method and it may change in the future.\n\t\t\t *\n\t\t\t * @description Updates the validated object and collects errors from it.\n\t\t\t */\n\t\t\tresult._updateState = function(newValue) {\n\t\t\t\tif (!utils.isObject(newValue)) {\n\t\t\t\t\tthrow new Error('An object is required.');\n\t\t\t\t}\n\t\t\t\tobj = newValue;\n\t\t\t\tif (options.observable) {\n\t\t\t\t\tcontext.graphMonitor.valueHasMutated();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\trunTraversal(newValue, context);\n\t\t\t\t\treturn collectErrors(context.validatables);\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn result;\n\t\t},\n\n\t\tformatMessage: function (message, params, observable) {\n\t\t\tif (utils.isObject(params) && params.typeAttr) {\n\t\t\t\tparams = params.value;\n\t\t\t}\n\t\t\tif (typeof message === 'function') {\n\t\t\t\treturn message(params, observable);\n\t\t\t}\n\t\t\tvar replacements = unwrap(params);\n            if (replacements == null) {\n                replacements = [];\n            }\n\t\t\tif (!utils.isArray(replacements)) {\n\t\t\t\treplacements = [replacements];\n\t\t\t}\n\t\t\treturn message.replace(/{(\\d+)}/gi, function(match, index) {\n\t\t\t\tif (typeof replacements[index] !== 'undefined') {\n\t\t\t\t\treturn replacements[index];\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\t\t},\n\n\t\t// addRule:\n\t\t// This takes in a ko.observable and a Rule Context - which is just a rule name and params to supply to the validator\n\t\t// ie: kv.addRule(myObservable, {\n\t\t//\t\t  rule: 'required',\n\t\t//\t\t  params: true\n\t\t//\t  });\n\t\t//\n\t\taddRule: function (observable, rule) {\n\t\t\tobservable.extend({ validatable: true });\n\n\t\t\tvar hasRule = !!koUtils.arrayFirst(observable.rules(), function(item) {\n\t\t\t\treturn item.rule && item.rule === rule.rule;\n\t\t\t});\n\n\t\t\tif (!hasRule) {\n\t\t\t\t//push a Rule Context to the observables local array of Rule Contexts\n\t\t\t\tobservable.rules.push(rule);\n\t\t\t}\n\t\t\treturn observable;\n\t\t},\n\n\t\t// addAnonymousRule:\n\t\t// Anonymous Rules essentially have all the properties of a Rule, but are only specific for a certain property\n\t\t// and developers typically are wanting to add them on the fly or not register a rule with the 'kv.rules' object\n\t\t//\n\t\t// Example:\n\t\t// var test = ko.observable('something').extend{(\n\t\t//\t  validation: {\n\t\t//\t\t  validator: function(val, someOtherVal){\n\t\t//\t\t\t  return true;\n\t\t//\t\t  },\n\t\t//\t\t  message: \"Something must be really wrong!',\n\t\t//\t\t  params: true\n\t\t//\t  }\n\t\t//  )};\n\t\taddAnonymousRule: function (observable, ruleObj) {\n\t\t\tif (ruleObj['message'] === undefined) {\n\t\t\t\truleObj['message'] = 'Error';\n\t\t\t}\n\n\t\t\t//make sure onlyIf is honoured\n\t\t\tif (ruleObj.onlyIf) {\n\t\t\t\truleObj.condition = ruleObj.onlyIf;\n\t\t\t}\n\n\t\t\t//add the anonymous rule to the observable\n\t\t\tkv.addRule(observable, ruleObj);\n\t\t},\n\n\t\taddExtender: function (ruleName) {\n\t\t\tko.extenders[ruleName] = function (observable, params) {\n\t\t\t\t//params can come in a few flavors\n\t\t\t\t// 1. Just the params to be passed to the validator\n\t\t\t\t// 2. An object containing the Message to be used and the Params to pass to the validator\n\t\t\t\t// 3. A condition when the validation rule to be applied\n\t\t\t\t//\n\t\t\t\t// Example:\n\t\t\t\t// var test = ko.observable(3).extend({\n\t\t\t\t//\t  max: {\n\t\t\t\t//\t\t  message: 'This special field has a Max of {0}',\n\t\t\t\t//\t\t  params: 2,\n\t\t\t\t//\t\t  onlyIf: function() {\n\t\t\t\t//\t\t\t\t\t  return specialField.IsVisible();\n\t\t\t\t//\t\t\t\t  }\n\t\t\t\t//\t  }\n\t\t\t\t//  )};\n\t\t\t\t//\n\t\t\t\tif (params && (params.message || params.onlyIf)) { //if it has a message or condition object, then its an object literal to use\n\t\t\t\t\treturn kv.addRule(observable, {\n\t\t\t\t\t\trule: ruleName,\n\t\t\t\t\t\tmessage: params.message,\n\t\t\t\t\t\tparams: utils.isEmptyVal(params.params) ? true : params.params,\n\t\t\t\t\t\tcondition: params.onlyIf\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\treturn kv.addRule(observable, {\n\t\t\t\t\t\trule: ruleName,\n\t\t\t\t\t\tparams: params\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\n\t\t// loops through all kv.rules and adds them as extenders to\n\t\t// ko.extenders\n\t\tregisterExtenders: function () { // root extenders optional, use 'validation' extender if would cause conflicts\n\t\t\tif (configuration.registerExtenders) {\n\t\t\t\tfor (var ruleName in kv.rules) {\n\t\t\t\t\tif (kv.rules.hasOwnProperty(ruleName)) {\n\t\t\t\t\t\tif (!ko.extenders[ruleName]) {\n\t\t\t\t\t\t\tkv.addExtender(ruleName);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t//creates a span next to the @element with the specified error class\n\t\tinsertValidationMessage: function (element) {\n\t\t\tvar span = document.createElement('SPAN');\n\t\t\tspan.className = utils.getConfigOptions(element).errorMessageClass;\n\t\t\tutils.insertAfter(element, span);\n\t\t\treturn span;\n\t\t},\n\n\t\t// if html-5 validation attributes have been specified, this parses\n\t\t// the attributes on @element\n\t\tparseInputValidationAttributes: function (element, valueAccessor) {\n\t\t\tforEach(kv.configuration.html5Attributes, function (attr) {\n\t\t\t\tif (utils.hasAttribute(element, attr)) {\n\n\t\t\t\t\tvar params = element.getAttribute(attr) || true;\n\n\t\t\t\t\tif (attr === 'min' || attr === 'max')\n\t\t\t\t\t{\n\t\t\t\t\t\t// If we're validating based on the min and max attributes, we'll\n\t\t\t\t\t\t// need to know what the 'type' attribute is set to\n\t\t\t\t\t\tvar typeAttr = element.getAttribute('type');\n\t\t\t\t\t\tif (typeof typeAttr === \"undefined\" || !typeAttr)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// From http://www.w3.org/TR/html-markup/input:\n\t\t\t\t\t\t\t//   An input element with no type attribute specified represents the\n\t\t\t\t\t\t\t//   same thing as an input element with its type attribute set to \"text\".\n\t\t\t\t\t\t\ttypeAttr = \"text\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparams = {typeAttr: typeAttr, value: params};\n\t\t\t\t\t}\n\n\t\t\t\t\tkv.addRule(valueAccessor(), {\n\t\t\t\t\t\trule: attr,\n\t\t\t\t\t\tparams: params\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tvar currentType = element.getAttribute('type');\n\t\t\tforEach(kv.configuration.html5InputTypes, function (type) {\n\t\t\t\tif (type === currentType) {\n\t\t\t\t\tkv.addRule(valueAccessor(), {\n\t\t\t\t\t\trule: (type === 'date') ? 'dateISO' : type,\n\t\t\t\t\t\tparams: true\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t// writes html5 validation attributes on the element passed in\n\t\twriteInputValidationAttributes: function (element, valueAccessor) {\n\t\t\tvar observable = valueAccessor();\n\n\t\t\tif (!observable || !observable.rules) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar contexts = observable.rules(); // observable array\n\n\t\t\t// loop through the attributes and add the information needed\n\t\t\tforEach(kv.configuration.html5Attributes, function (attr) {\n\t\t\t\tvar ctx = koUtils.arrayFirst(contexts, function (ctx) {\n\t\t\t\t\treturn ctx.rule && ctx.rule.toLowerCase() === attr.toLowerCase();\n\t\t\t\t});\n\n\t\t\t\tif (!ctx) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// we have a rule matching a validation attribute at this point\n\t\t\t\t// so lets add it to the element along with the params\n\t\t\t\tko.computed({\n\t\t\t\t\tread: function() {\n\t\t\t\t\t\tvar params = ko.unwrap(ctx.params);\n\n\t\t\t\t\t\t// we have to do some special things for the pattern validation\n\t\t\t\t\t\tif (ctx.rule === \"pattern\" && params instanceof RegExp) {\n\t\t\t\t\t\t\t// we need the pure string representation of the RegExpr without the //gi stuff\n\t\t\t\t\t\t\tparams = params.source;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telement.setAttribute(attr, params);\n\t\t\t\t\t},\n\t\t\t\t\tdisposeWhenNodeIsRemoved: element\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tcontexts = null;\n\t\t},\n\n\t\t//take an existing binding handler and make it cause automatic validations\n\t\tmakeBindingHandlerValidatable: function (handlerName) {\n\t\t\tvar init = ko.bindingHandlers[handlerName].init;\n\n\t\t\tko.bindingHandlers[handlerName].init = function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n\n\t\t\t\tinit(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext);\n\n\t\t\t\treturn ko.bindingHandlers['validationCore'].init(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext);\n\t\t\t};\n\t\t},\n\n\t\t// visit an objects properties and apply validation rules from a definition\n\t\tsetRules: function (target, definition) {\n\t\t\tvar setRules = function (target, definition) {\n\t\t\t\tif (!target || !definition) { return; }\n\n\t\t\t\tfor (var prop in definition) {\n\t\t\t\t\tif (!definition.hasOwnProperty(prop)) { continue; }\n\t\t\t\t\tvar ruleDefinitions = definition[prop];\n\n\t\t\t\t\t//check the target property exists and has a value\n\t\t\t\t\tif (!target[prop]) { continue; }\n\t\t\t\t\tvar targetValue = target[prop],\n\t\t\t\t\t\tunwrappedTargetValue = unwrap(targetValue),\n\t\t\t\t\t\trules = {},\n\t\t\t\t\t\tnonRules = {};\n\n\t\t\t\t\tfor (var rule in ruleDefinitions) {\n\t\t\t\t\t\tif (!ruleDefinitions.hasOwnProperty(rule)) { continue; }\n\t\t\t\t\t\tif (kv.rules[rule]) {\n\t\t\t\t\t\t\trules[rule] = ruleDefinitions[rule];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnonRules[rule] = ruleDefinitions[rule];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//apply rules\n\t\t\t\t\tif (ko.isObservable(targetValue)) {\n\t\t\t\t\t\ttargetValue.extend(rules);\n\t\t\t\t\t}\n\n\t\t\t\t\t//then apply child rules\n\t\t\t\t\t//if it's an array, apply rules to all children\n\t\t\t\t\tif (unwrappedTargetValue && utils.isArray(unwrappedTargetValue)) {\n\t\t\t\t\t\tfor (var i = 0; i < unwrappedTargetValue.length; i++) {\n\t\t\t\t\t\t\tsetRules(unwrappedTargetValue[i], nonRules);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//otherwise, just apply to this property\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetRules(unwrappedTargetValue, nonRules);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tsetRules(target, definition);\n\t\t}\n\t};\n\n}());\n\n// expose api publicly\nextend(ko.validation, api);\n;//Validation Rules:\n// You can view and override messages or rules via:\n// kv.rules[ruleName]\n//\n// To implement a custom Rule, simply use this template:\n// kv.rules['<custom rule name>'] = {\n//      validator: function (val, param) {\n//          <custom logic>\n//          return <true or false>;\n//      },\n//      message: '<custom validation message>' //optionally you can also use a '{0}' to denote a placeholder that will be replaced with your 'param'\n// };\n//\n// Example:\n// kv.rules['mustEqual'] = {\n//      validator: function( val, mustEqualVal ){\n//          return val === mustEqualVal;\n//      },\n//      message: 'This field must equal {0}'\n// };\n//\nkv.rules = {};\nkv.rules['required'] = {\n\tvalidator: function (val, required) {\n\t\tvar testVal;\n\n\t\tif (val === undefined || val === null) {\n\t\t\treturn !required;\n\t\t}\n\n\t\ttestVal = val;\n\t\tif (typeof (val) === 'string') {\n\t\t\tif (String.prototype.trim) {\n\t\t\t\ttestVal = val.trim();\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttestVal = val.replace(/^\\s+|\\s+$/g, '');\n\t\t\t}\n\t\t}\n\n\t\tif (!required) {// if they passed: { required: false }, then don't require this\n\t\t\treturn true;\n\t\t}\n\n\t\treturn ((testVal + '').length > 0);\n\t},\n\tmessage: 'This field is required.'\n};\n\nfunction minMaxValidatorFactory(validatorName) {\n    var isMaxValidation = validatorName === \"max\";\n\n    return function (val, options) {\n        if (kv.utils.isEmptyVal(val)) {\n            return true;\n        }\n\n        var comparisonValue, type;\n        if (options.typeAttr === undefined) {\n            // This validator is being called from javascript rather than\n            // being bound from markup\n            type = \"text\";\n            comparisonValue = options;\n        } else {\n            type = options.typeAttr;\n            comparisonValue = options.value;\n        }\n\n        // From http://www.w3.org/TR/2012/WD-html5-20121025/common-input-element-attributes.html#attr-input-min,\n        // if the value is parseable to a number, then the minimum should be numeric\n        if (!isNaN(comparisonValue) && !(comparisonValue instanceof Date)) {\n            type = \"number\";\n        }\n\n        var regex, valMatches, comparisonValueMatches;\n        switch (type.toLowerCase()) {\n            case \"week\":\n                regex = /^(\\d{4})-W(\\d{2})$/;\n                valMatches = val.match(regex);\n                if (valMatches === null) {\n                    throw new Error(\"Invalid value for \" + validatorName + \" attribute for week input.  Should look like \" +\n                        \"'2000-W33' http://www.w3.org/TR/html-markup/input.week.html#input.week.attrs.min\");\n                }\n                comparisonValueMatches = comparisonValue.match(regex);\n                // If no regex matches were found, validation fails\n                if (!comparisonValueMatches) {\n                    return false;\n                }\n\n                if (isMaxValidation) {\n                    return (valMatches[1] < comparisonValueMatches[1]) || // older year\n                        // same year, older week\n                        ((valMatches[1] === comparisonValueMatches[1]) && (valMatches[2] <= comparisonValueMatches[2]));\n                } else {\n                    return (valMatches[1] > comparisonValueMatches[1]) || // newer year\n                        // same year, newer week\n                        ((valMatches[1] === comparisonValueMatches[1]) && (valMatches[2] >= comparisonValueMatches[2]));\n                }\n                break;\n\n            case \"month\":\n                regex = /^(\\d{4})-(\\d{2})$/;\n                valMatches = val.match(regex);\n                if (valMatches === null) {\n                    throw new Error(\"Invalid value for \" + validatorName + \" attribute for month input.  Should look like \" +\n                        \"'2000-03' http://www.w3.org/TR/html-markup/input.month.html#input.month.attrs.min\");\n                }\n                comparisonValueMatches = comparisonValue.match(regex);\n                // If no regex matches were found, validation fails\n                if (!comparisonValueMatches) {\n                    return false;\n                }\n\n                if (isMaxValidation) {\n                    return ((valMatches[1] < comparisonValueMatches[1]) || // older year\n                        // same year, older month\n                        ((valMatches[1] === comparisonValueMatches[1]) && (valMatches[2] <= comparisonValueMatches[2])));\n                } else {\n                    return (valMatches[1] > comparisonValueMatches[1]) || // newer year\n                        // same year, newer month\n                        ((valMatches[1] === comparisonValueMatches[1]) && (valMatches[2] >= comparisonValueMatches[2]));\n                }\n                break;\n\n            case \"number\":\n            case \"range\":\n                if (isMaxValidation) {\n                    return (!isNaN(val) && parseFloat(val) <= parseFloat(comparisonValue));\n                } else {\n                    return (!isNaN(val) && parseFloat(val) >= parseFloat(comparisonValue));\n                }\n                break;\n\n            default:\n                if (isMaxValidation) {\n                    return val <= comparisonValue;\n                } else {\n                    return val >= comparisonValue;\n                }\n        }\n    };\n}\n\nkv.rules['min'] = {\n\tvalidator: minMaxValidatorFactory(\"min\"),\n\tmessage: 'Please enter a value greater than or equal to {0}.'\n};\n\nkv.rules['max'] = {\n\tvalidator: minMaxValidatorFactory(\"max\"),\n\tmessage: 'Please enter a value less than or equal to {0}.'\n};\n\nkv.rules['minLength'] = {\n\tvalidator: function (val, minLength) {\n\t\tif(kv.utils.isEmptyVal(val)) { return true; }\n\t\tvar normalizedVal = kv.utils.isNumber(val) ? ('' + val) : val;\n\t\treturn normalizedVal.length >= minLength;\n\t},\n\tmessage: 'Please enter at least {0} characters.'\n};\n\nkv.rules['maxLength'] = {\n\tvalidator: function (val, maxLength) {\n\t\tif(kv.utils.isEmptyVal(val)) { return true; }\n\t\tvar normalizedVal = kv.utils.isNumber(val) ? ('' + val) : val;\n\t\treturn normalizedVal.length <= maxLength;\n\t},\n\tmessage: 'Please enter no more than {0} characters.'\n};\n\nkv.rules['pattern'] = {\n\tvalidator: function (val, regex) {\n\t\treturn kv.utils.isEmptyVal(val) || val.toString().match(regex) !== null;\n\t},\n\tmessage: 'Please check this value.'\n};\n\nkv.rules['step'] = {\n\tvalidator: function (val, step) {\n\n\t\t// in order to handle steps of .1 & .01 etc.. Modulus won't work\n\t\t// if the value is a decimal, so we have to correct for that\n\t\tif (kv.utils.isEmptyVal(val) || step === 'any') { return true; }\n\t\tvar dif = (val * 100) % (step * 100);\n\t\treturn Math.abs(dif) < 0.00001 || Math.abs(1 - dif) < 0.00001;\n\t},\n\tmessage: 'The value must increment by {0}.'\n};\n\nkv.rules['email'] = {\n\tvalidator: function (val, validate) {\n\t\tif (!validate) { return true; }\n\n\t\t//I think an empty email address is also a valid entry\n\t\t//if one want's to enforce entry it should be done with 'required: true'\n\t\treturn kv.utils.isEmptyVal(val) || (\n\t\t\t// jquery validate regex - thanks Scott Gonzalez\n\t\t\tvalidate && /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i.test(val)\n\t\t);\n\t},\n\tmessage: 'Please enter a proper email address.'\n};\n\nkv.rules['date'] = {\n\tvalidator: function (value, validate) {\n\t\tif (!validate) { return true; }\n\t\treturn kv.utils.isEmptyVal(value) || (validate && !/Invalid|NaN/.test(new Date(value)));\n\t},\n\tmessage: 'Please enter a proper date.'\n};\n\nkv.rules['dateISO'] = {\n\tvalidator: function (value, validate) {\n\t\tif (!validate) { return true; }\n\t\treturn kv.utils.isEmptyVal(value) || (validate && /^\\d{4}[-/](?:0?[1-9]|1[012])[-/](?:0?[1-9]|[12][0-9]|3[01])$/.test(value));\n\t},\n\tmessage: 'Please enter a proper date.'\n};\n\nkv.rules['number'] = {\n\tvalidator: function (value, validate) {\n\t\tif (!validate) { return true; }\n\t\treturn kv.utils.isEmptyVal(value) || (validate && /^-?(?:\\d+|\\d{1,3}(?:,\\d{3})+)?(?:\\.\\d+)?$/.test(value));\n\t},\n\tmessage: 'Please enter a number.'\n};\n\nkv.rules['digit'] = {\n\tvalidator: function (value, validate) {\n\t\tif (!validate) { return true; }\n\t\treturn kv.utils.isEmptyVal(value) || (validate && /^\\d+$/.test(value));\n\t},\n\tmessage: 'Please enter a digit.'\n};\n\nkv.rules['phoneUS'] = {\n\tvalidator: function (phoneNumber, validate) {\n\t\tif (!validate) { return true; }\n\t\tif (kv.utils.isEmptyVal(phoneNumber)) { return true; } // makes it optional, use 'required' rule if it should be required\n\t\tif (typeof (phoneNumber) !== 'string') { return false; }\n\t\tphoneNumber = phoneNumber.replace(/\\s+/g, \"\");\n\t\treturn validate && phoneNumber.length > 9 && phoneNumber.match(/^(1-?)?(\\([2-9]\\d{2}\\)|[2-9]\\d{2})-?[2-9]\\d{2}-?\\d{4}$/);\n\t},\n\tmessage: 'Please specify a valid phone number.'\n};\n\nkv.rules['equal'] = {\n\tvalidator: function (val, params) {\n\t\tvar otherValue = params;\n\t\treturn val === kv.utils.getValue(otherValue);\n\t},\n\tmessage: 'Values must equal.'\n};\n\nkv.rules['notEqual'] = {\n\tvalidator: function (val, params) {\n\t\tvar otherValue = params;\n\t\treturn val !== kv.utils.getValue(otherValue);\n\t},\n\tmessage: 'Please choose another value.'\n};\n\n//unique in collection\n// options are:\n//    collection: array or function returning (observable) array\n//              in which the value has to be unique\n//    valueAccessor: function that returns value from an object stored in collection\n//              if it is null the value is compared directly\n//    external: set to true when object you are validating is automatically updating collection\nkv.rules['unique'] = {\n\tvalidator: function (val, options) {\n\t\tvar c = kv.utils.getValue(options.collection),\n\t\t\texternal = kv.utils.getValue(options.externalValue),\n\t\t\tcounter = 0;\n\n\t\tif (!val || !c) { return true; }\n\n\t\tkoUtils.arrayFilter(c, function (item) {\n\t\t\tif (val === (options.valueAccessor ? options.valueAccessor(item) : item)) { counter++; }\n\t\t});\n\t\t// if value is external even 1 same value in collection means the value is not unique\n\t\treturn counter < (!!external ? 1 : 2);\n\t},\n\tmessage: 'Please make sure the value is unique.'\n};\n\n\n//now register all of these!\n(function () {\n\tkv.registerExtenders();\n}());\n;// The core binding handler\n// this allows us to setup any value binding that internally always\n// performs the same functionality\nko.bindingHandlers['validationCore'] = (function () {\n\n\treturn {\n\t\tinit: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n\t\t\tvar config = kv.utils.getConfigOptions(element);\n\t\t\tvar observable = valueAccessor();\n\n\t\t\t// parse html5 input validation attributes, optional feature\n\t\t\tif (config.parseInputAttributes) {\n\t\t\t\tkv.utils.async(function () { kv.parseInputValidationAttributes(element, valueAccessor); });\n\t\t\t}\n\n\t\t\t// if requested insert message element and apply bindings\n\t\t\tif (config.insertMessages && kv.utils.isValidatable(observable)) {\n\n\t\t\t\t// insert the <span></span>\n\t\t\t\tvar validationMessageElement = kv.insertValidationMessage(element);\n\n\t\t\t\t// if we're told to use a template, make sure that gets rendered\n\t\t\t\tif (config.messageTemplate) {\n\t\t\t\t\tko.renderTemplate(config.messageTemplate, { field: observable }, null, validationMessageElement, 'replaceNode');\n\t\t\t\t} else {\n\t\t\t\t\tko.applyBindingsToNode(validationMessageElement, { validationMessage: observable });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// write the html5 attributes if indicated by the config\n\t\t\tif (config.writeInputAttributes && kv.utils.isValidatable(observable)) {\n\n\t\t\t\tkv.writeInputValidationAttributes(element, valueAccessor);\n\t\t\t}\n\n\t\t\t// if requested, add binding to decorate element\n\t\t\tif (config.decorateInputElement && kv.utils.isValidatable(observable)) {\n\t\t\t\tko.applyBindingsToNode(element, { validationElement: observable });\n\t\t\t}\n\t\t}\n\t};\n\n}());\n\n// override for KO's default 'value', 'checked', 'textInput' and selectedOptions bindings\nkv.makeBindingHandlerValidatable(\"value\");\nkv.makeBindingHandlerValidatable(\"checked\");\nif (ko.bindingHandlers.textInput) {\n\tkv.makeBindingHandlerValidatable(\"textInput\");\n}\nkv.makeBindingHandlerValidatable(\"selectedOptions\");\n\n\nko.bindingHandlers['validationMessage'] = { // individual error message, if modified or post binding\n\tupdate: function (element, valueAccessor) {\n\t\tvar obsv = valueAccessor(),\n\t\t\tconfig = kv.utils.getConfigOptions(element),\n\t\t\tval = unwrap(obsv),\n\t\t\tmsg = null,\n\t\t\tisModified = false,\n\t\t\tisValid = false;\n\n\t\tif (obsv === null || typeof obsv === 'undefined') {\n\t\t\tthrow new Error('Cannot bind validationMessage to undefined value. data-bind expression: ' +\n\t\t\t\telement.getAttribute('data-bind'));\n\t\t}\n\n\t\tisModified = obsv.isModified && obsv.isModified();\n\t\tisValid = obsv.isValid && obsv.isValid();\n\n\t\tvar error = null;\n\t\tif (!config.messagesOnModified || isModified) {\n\t\t\terror = isValid ? null : obsv.error;\n\t\t}\n\n\t\tvar isVisible = !config.messagesOnModified || isModified ? !isValid : false;\n\t\tvar isCurrentlyVisible = element.style.display !== \"none\";\n\n\t\tif (config.allowHtmlMessages) {\n\t\t\tkoUtils.setHtml(element, error);\n\t\t} else {\n\t\t\tko.bindingHandlers.text.update(element, function () { return error; });\n\t\t}\n\n\t\tif (isCurrentlyVisible && !isVisible) {\n\t\t\telement.style.display = 'none';\n\t\t} else if (!isCurrentlyVisible && isVisible) {\n\t\t\telement.style.display = '';\n\t\t}\n\t}\n};\n\nko.bindingHandlers['validationElement'] = {\n\tupdate: function (element, valueAccessor, allBindingsAccessor) {\n\t\tvar obsv = valueAccessor(),\n\t\t\tconfig = kv.utils.getConfigOptions(element),\n\t\t\tval = unwrap(obsv),\n\t\t\tmsg = null,\n\t\t\tisModified = false,\n\t\t\tisValid = false;\n\n\t\tif (obsv === null || typeof obsv === 'undefined') {\n\t\t\tthrow new Error('Cannot bind validationElement to undefined value. data-bind expression: ' +\n\t\t\t\telement.getAttribute('data-bind'));\n\t\t}\n\n\t\tisModified = obsv.isModified && obsv.isModified();\n\t\tisValid = obsv.isValid && obsv.isValid();\n\n\t\t// create an evaluator function that will return something like:\n\t\t// css: { validationElement: true }\n\t\tvar cssSettingsAccessor = function () {\n\t\t\tvar css = {};\n\n\t\t\tvar shouldShow = ((!config.decorateElementOnModified || isModified) ? !isValid : false);\n\n\t\t\t// css: { validationElement: false }\n\t\t\tcss[config.errorElementClass] = shouldShow;\n\n\t\t\treturn css;\n\t\t};\n\n\t\t//add or remove class on the element;\n\t\tko.bindingHandlers.css.update(element, cssSettingsAccessor, allBindingsAccessor);\n\t\tif (!config.errorsAsTitle) { return; }\n\n\t\tko.bindingHandlers.attr.update(element, function () {\n\t\t\tvar\n\t\t\t\thasModification = !config.errorsAsTitleOnModified || isModified,\n\t\t\t\ttitle = kv.utils.getOriginalElementTitle(element);\n\n\t\t\tif (hasModification && !isValid) {\n\t\t\t\treturn { title: obsv.error, 'data-orig-title': title };\n\t\t\t} else if (!hasModification || isValid) {\n\t\t\t\treturn { title: title, 'data-orig-title': null };\n\t\t\t}\n\t\t});\n\t}\n};\n\n// ValidationOptions:\n// This binding handler allows you to override the initial config by setting any of the options for a specific element or context of elements\n//\n// Example:\n// <div data-bind=\"validationOptions: { insertMessages: true, messageTemplate: 'customTemplate', errorMessageClass: 'mySpecialClass'}\">\n//      <input type=\"text\" data-bind=\"value: someValue\"/>\n//      <input type=\"text\" data-bind=\"value: someValue2\"/>\n// </div>\nko.bindingHandlers['validationOptions'] = (function () {\n\treturn {\n\t\tinit: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n\t\t\tvar options = unwrap(valueAccessor());\n\t\t\tif (options) {\n\t\t\t\tvar newConfig = extend({}, kv.configuration);\n\t\t\t\textend(newConfig, options);\n\n\t\t\t\t//store the validation options on the node so we can retrieve it later\n\t\t\t\tkv.utils.setDomData(element, newConfig);\n\t\t\t}\n\t\t}\n\t};\n}());\n;// Validation Extender:\n// This is for creating custom validation logic on the fly\n// Example:\n// var test = ko.observable('something').extend{(\n//      validation: {\n//          validator: function(val, someOtherVal){\n//              return true;\n//          },\n//          message: \"Something must be really wrong!',\n//          params: true\n//      }\n//  )};\nko.extenders['validation'] = function (observable, rules) { // allow single rule or array\n\tforEach(kv.utils.isArray(rules) ? rules : [rules], function (rule) {\n\t\t// the 'rule' being passed in here has no name to identify a core Rule,\n\t\t// so we add it as an anonymous rule\n\t\t// If the developer is wanting to use a core Rule, but use a different message see the 'addExtender' logic for examples\n\t\tkv.addAnonymousRule(observable, rule);\n\t});\n\treturn observable;\n};\n\n//This is the extender that makes a Knockout Observable also 'Validatable'\n//examples include:\n// 1. var test = ko.observable('something').extend({validatable: true});\n// this will ensure that the Observable object is setup properly to respond to rules\n//\n// 2. test.extend({validatable: false});\n// this will remove the validation properties from the Observable object should you need to do that.\nko.extenders['validatable'] = function (observable, options) {\n\tif (!kv.utils.isObject(options)) {\n\t\toptions = { enable: options };\n\t}\n\n\tif (!('enable' in options)) {\n\t\toptions.enable = true;\n\t}\n\n\tif (options.enable && !kv.utils.isValidatable(observable)) {\n\t\tvar config = kv.configuration.validate || {};\n\t\tvar validationOptions = {\n\t\t\tthrottleEvaluation : options.throttle || config.throttle\n\t\t};\n\n\t\tobservable.error = ko.observable(null); // holds the error message, we only need one since we stop processing validators when one is invalid\n\n\t\t// observable.rules:\n\t\t// ObservableArray of Rule Contexts, where a Rule Context is simply the name of a rule and the params to supply to it\n\t\t//\n\t\t// Rule Context = { rule: '<rule name>', params: '<passed in params>', message: '<Override of default Message>' }\n\t\tobservable.rules = ko.observableArray(); //holds the rule Contexts to use as part of validation\n\n\t\t//in case async validation is occurring\n\t\tobservable.isValidating = ko.observable(false);\n\n\t\t//the true holder of whether the observable is valid or not\n\t\tobservable.__valid__ = ko.observable(true);\n\n\t\tobservable.isModified = ko.observable(false);\n\n\t\t// a semi-protected observable\n\t\tobservable.isValid = ko.computed(observable.__valid__);\n\n\t\t//manually set error state\n\t\tobservable.setError = function (error) {\n\t\t\tvar previousError = observable.error.peek();\n\t\t\tvar previousIsValid = observable.__valid__.peek();\n\n\t\t\tobservable.error(error);\n\t\t\tobservable.__valid__(false);\n\n\t\t\tif (previousError !== error && !previousIsValid) {\n\t\t\t\t// if the observable was not valid before then isValid will not mutate,\n\t\t\t\t// hence causing any grouping to not display the latest error.\n\t\t\t\tobservable.isValid.notifySubscribers();\n\t\t\t}\n\t\t};\n\n\t\t//manually clear error state\n\t\tobservable.clearError = function () {\n\t\t\tobservable.error(null);\n\t\t\tobservable.__valid__(true);\n\t\t\treturn observable;\n\t\t};\n\n\t\t//subscribe to changes in the observable\n\t\tvar h_change = observable.subscribe(function () {\n\t\t\tobservable.isModified(true);\n\t\t});\n\n\t\t// we use a computed here to ensure that anytime a dependency changes, the\n\t\t// validation logic evaluates\n\t\tvar h_obsValidationTrigger = ko.computed(extend({\n\t\t\tread: function () {\n\t\t\t\tvar obs = observable(),\n\t\t\t\t\truleContexts = observable.rules();\n\n\t\t\t\tkv.validateObservable(observable);\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}, validationOptions));\n\n\t\textend(h_obsValidationTrigger, validationOptions);\n\n\t\tobservable._disposeValidation = function () {\n\t\t\t//first dispose of the subscriptions\n\t\t\tobservable.isValid.dispose();\n\t\t\tobservable.rules.removeAll();\n\t\t\th_change.dispose();\n\t\t\th_obsValidationTrigger.dispose();\n\n\t\t\tdelete observable['rules'];\n\t\t\tdelete observable['error'];\n\t\t\tdelete observable['isValid'];\n\t\t\tdelete observable['isValidating'];\n\t\t\tdelete observable['__valid__'];\n\t\t\tdelete observable['isModified'];\n            delete observable['setError'];\n            delete observable['clearError'];\n            delete observable['_disposeValidation'];\n\t\t};\n\t} else if (options.enable === false && observable._disposeValidation) {\n\t\tobservable._disposeValidation();\n\t}\n\treturn observable;\n};\n\nfunction validateSync(observable, rule, ctx) {\n\t//Execute the validator and see if its valid\n\tif (!rule.validator(observable(), (ctx.params === undefined ? true : unwrap(ctx.params)))) { // default param is true, eg. required = true\n\n\t\t//not valid, so format the error message and stick it in the 'error' variable\n\t\tobservable.setError(kv.formatMessage(\n\t\t\t\t\tctx.message || rule.message,\n\t\t\t\t\tunwrap(ctx.params),\n\t\t\t\t\tobservable));\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}\n\nfunction validateAsync(observable, rule, ctx) {\n\tobservable.isValidating(true);\n\n\tvar callBack = function (valObj) {\n\t\tvar isValid = false,\n\t\t\tmsg = '';\n\n\t\tif (!observable.__valid__()) {\n\n\t\t\t// since we're returning early, make sure we turn this off\n\t\t\tobservable.isValidating(false);\n\n\t\t\treturn; //if its already NOT valid, don't add to that\n\t\t}\n\n\t\t//we were handed back a complex object\n\t\tif (valObj['message']) {\n\t\t\tisValid = valObj.isValid;\n\t\t\tmsg = valObj.message;\n\t\t} else {\n\t\t\tisValid = valObj;\n\t\t}\n\n\t\tif (!isValid) {\n\t\t\t//not valid, so format the error message and stick it in the 'error' variable\n\t\t\tobservable.error(kv.formatMessage(\n\t\t\t\tmsg || ctx.message || rule.message,\n\t\t\t\tunwrap(ctx.params),\n\t\t\t\tobservable));\n\t\t\tobservable.__valid__(isValid);\n\t\t}\n\n\t\t// tell it that we're done\n\t\tobservable.isValidating(false);\n\t};\n\n\tkv.utils.async(function() {\n\t    //fire the validator and hand it the callback\n        rule.validator(observable(), ctx.params === undefined ? true : unwrap(ctx.params), callBack);\n\t});\n}\n\nkv.validateObservable = function (observable) {\n\tvar i = 0,\n\t\trule, // the rule validator to execute\n\t\tctx, // the current Rule Context for the loop\n\t\truleContexts = observable.rules(), //cache for iterator\n\t\tlen = ruleContexts.length; //cache for iterator\n\n\tfor (; i < len; i++) {\n\n\t\t//get the Rule Context info to give to the core Rule\n\t\tctx = ruleContexts[i];\n\n\t\t// checks an 'onlyIf' condition\n\t\tif (ctx.condition && !ctx.condition()) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t//get the core Rule to use for validation\n\t\trule = ctx.rule ? kv.rules[ctx.rule] : ctx;\n\n\t\tif (rule['async'] || ctx['async']) {\n\t\t\t//run async validation\n\t\t\tvalidateAsync(observable, rule, ctx);\n\n\t\t} else {\n\t\t\t//run normal sync validation\n\t\t\tif (!validateSync(observable, rule, ctx)) {\n\t\t\t\treturn false; //break out of the loop\n\t\t\t}\n\t\t}\n\t}\n\t//finally if we got this far, make the observable valid again!\n\tobservable.clearError();\n\treturn true;\n};\n;\nvar _locales = {};\nvar _currentLocale;\n\nkv.defineLocale = function(name, values) {\n\tif (name && values) {\n\t\t_locales[name.toLowerCase()] = values;\n\t\treturn values;\n\t}\n\treturn null;\n};\n\nkv.locale = function(name) {\n\tif (name) {\n\t\tname = name.toLowerCase();\n\n\t\tif (_locales.hasOwnProperty(name)) {\n\t\t\tkv.localize(_locales[name]);\n\t\t\t_currentLocale = name;\n\t\t}\n\t\telse {\n\t\t\tthrow new Error('Localization ' + name + ' has not been loaded.');\n\t\t}\n\t}\n\treturn _currentLocale;\n};\n\n//quick function to override rule messages\nkv.localize = function (msgTranslations) {\n\tvar rules = kv.rules;\n\n\t//loop the properties in the object and assign the msg to the rule\n\tfor (var ruleName in msgTranslations) {\n\t\tif (rules.hasOwnProperty(ruleName)) {\n\t\t\trules[ruleName].message = msgTranslations[ruleName];\n\t\t}\n\t}\n};\n\n// Populate default locale (this will make en-US.js somewhat redundant)\n(function() {\n\tvar localeData = {};\n\tvar rules = kv.rules;\n\n\tfor (var ruleName in rules) {\n\t\tif (rules.hasOwnProperty(ruleName)) {\n\t\t\tlocaleData[ruleName] = rules[ruleName].message;\n\t\t}\n\t}\n\tkv.defineLocale('en-us', localeData);\n})();\n\n// No need to invoke locale because the messages are already defined along with the rules for en-US\n_currentLocale = 'en-us';\n;/**\n * Possible invocations:\n * \t\tapplyBindingsWithValidation(viewModel)\n * \t\tapplyBindingsWithValidation(viewModel, options)\n * \t\tapplyBindingsWithValidation(viewModel, rootNode)\n *\t\tapplyBindingsWithValidation(viewModel, rootNode, options)\n */\nko.applyBindingsWithValidation = function (viewModel, rootNode, options) {\n\tvar node = document.body,\n\t\tconfig;\n\n\tif (rootNode && rootNode.nodeType) {\n\t\tnode = rootNode;\n\t\tconfig = options;\n\t}\n\telse {\n\t\tconfig = rootNode;\n\t}\n\n\tkv.init();\n\n\tif (config) {\n\t\tconfig = extend(extend({}, kv.configuration), config);\n\t\tkv.utils.setDomData(node, config);\n\t}\n\n\tko.applyBindings(viewModel, node);\n};\n\n//override the original applyBindings so that we can ensure all new rules and what not are correctly registered\nvar origApplyBindings = ko.applyBindings;\nko.applyBindings = function (viewModel, rootNode) {\n\n\tkv.init();\n\n\torigApplyBindings(viewModel, rootNode);\n};\n\nko.validatedObservable = function (initialValue, options) {\n\tif (!options && !kv.utils.isObject(initialValue)) {\n\t\treturn ko.observable(initialValue).extend({ validatable: true });\n\t}\n\n\tvar obsv = ko.observable(initialValue);\n\tobsv.errors = kv.group(kv.utils.isObject(initialValue) ? initialValue : {}, options);\n\tobsv.isValid = ko.observable(obsv.errors().length === 0);\n\n\tif (ko.isObservable(obsv.errors)) {\n\t\tobsv.errors.subscribe(function(errors) {\n\t\t\tobsv.isValid(errors.length === 0);\n\t\t});\n\t}\n\telse {\n\t\tko.computed(obsv.errors).subscribe(function (errors) {\n\t\t\tobsv.isValid(errors.length === 0);\n\t\t});\n\t}\n\n\tobsv.subscribe(function(newValue) {\n\t\tif (!kv.utils.isObject(newValue)) {\n\t\t\t/*\n\t\t\t * The validation group works on objects.\n\t\t\t * Since the new value is a primitive (scalar, null or undefined) we need\n\t\t\t * to create an empty object to pass along.\n\t\t\t */\n\t\t\tnewValue = {};\n\t\t}\n\t\t// Force the group to refresh\n\t\tobsv.errors._updateState(newValue);\n\t\tobsv.isValid(obsv.errors().length === 0);\n\t});\n\n\treturn obsv;\n};\n;}));\n\n//# sourceURL=webpack://domino/./node_modules/knockout.validation/dist/knockout.validation.js?");

/***/ }),

/***/ "./node_modules/knockout/build/output/knockout-latest.js":
/*!***************************************************************!*\
  !*** ./node_modules/knockout/build/output/knockout-latest.js ***!
  \***************************************************************/
/***/ ((module, exports, __webpack_require__) => {

eval("/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * Knockout JavaScript library v3.5.1\n * (c) The Knockout.js team - http://knockoutjs.com/\n * License: MIT (http://www.opensource.org/licenses/mit-license.php)\n */\n\n(function() {(function(n){var A=this||(0,eval)(\"this\"),w=A.document,R=A.navigator,v=A.jQuery,H=A.JSON;v||\"undefined\"===typeof jQuery||(v=jQuery);(function(n){ true?!(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports,__webpack_require__], __WEBPACK_AMD_DEFINE_FACTORY__ = (n),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)):0})(function(S,T){function K(a,c){return null===a||typeof a in W?a===c:!1}function X(b,c){var d;return function(){d||(d=a.a.setTimeout(function(){d=n;b()},c))}}function Y(b,c){var d;return function(){clearTimeout(d);\nd=a.a.setTimeout(b,c)}}function Z(a,c){c&&\"change\"!==c?\"beforeChange\"===c?this.pc(a):this.gb(a,c):this.qc(a)}function aa(a,c){null!==c&&c.s&&c.s()}function ba(a,c){var d=this.qd,e=d[r];e.ra||(this.Qb&&this.mb[c]?(d.uc(c,a,this.mb[c]),this.mb[c]=null,--this.Qb):e.I[c]||d.uc(c,a,e.J?{da:a}:d.$c(a)),a.Ja&&a.gd())}var a=\"undefined\"!==typeof S?S:{};a.b=function(b,c){for(var d=b.split(\".\"),e=a,f=0;f<d.length-1;f++)e=e[d[f]];e[d[d.length-1]]=c};a.L=function(a,c,d){a[c]=d};a.version=\"3.5.1\";a.b(\"version\",\na.version);a.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1};a.a=function(){function b(a,b){for(var c in a)f.call(a,c)&&b(c,a[c])}function c(a,b){if(b)for(var c in b)f.call(b,c)&&(a[c]=b[c]);return a}function d(a,b){a.__proto__=b;return a}function e(b,c,d,e){var l=b[c].match(q)||[];a.a.D(d.match(q),function(b){a.a.Na(l,b,e)});b[c]=l.join(\" \")}var f=Object.prototype.hasOwnProperty,g={__proto__:[]}instanceof Array,h=\"function\"===typeof Symbol,m={},k={};m[R&&/Firefox\\/2/i.test(R.userAgent)?\n\"KeyboardEvent\":\"UIEvents\"]=[\"keyup\",\"keydown\",\"keypress\"];m.MouseEvents=\"click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave\".split(\" \");b(m,function(a,b){if(b.length)for(var c=0,d=b.length;c<d;c++)k[b[c]]=a});var l={propertychange:!0},p=w&&function(){for(var a=3,b=w.createElement(\"div\"),c=b.getElementsByTagName(\"i\");b.innerHTML=\"\\x3c!--[if gt IE \"+ ++a+\"]><i></i><![endif]--\\x3e\",c[0];);return 4<a?a:n}(),q=/\\S+/g,t;return{Jc:[\"authenticity_token\",/^__RequestVerificationToken(_.*)?$/],\nD:function(a,b,c){for(var d=0,e=a.length;d<e;d++)b.call(c,a[d],d,a)},A:\"function\"==typeof Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b)}:function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},Lb:function(a,b,c){for(var d=0,e=a.length;d<e;d++)if(b.call(c,a[d],d,a))return a[d];return n},Pa:function(b,c){var d=a.a.A(b,c);0<d?b.splice(d,1):0===d&&b.shift()},wc:function(b){var c=[];b&&a.a.D(b,function(b){0>a.a.A(c,b)&&c.push(b)});return c},Mb:function(a,\nb,c){var d=[];if(a)for(var e=0,l=a.length;e<l;e++)d.push(b.call(c,a[e],e));return d},jb:function(a,b,c){var d=[];if(a)for(var e=0,l=a.length;e<l;e++)b.call(c,a[e],e)&&d.push(a[e]);return d},Nb:function(a,b){if(b instanceof Array)a.push.apply(a,b);else for(var c=0,d=b.length;c<d;c++)a.push(b[c]);return a},Na:function(b,c,d){var e=a.a.A(a.a.bc(b),c);0>e?d&&b.push(c):d||b.splice(e,1)},Ba:g,extend:c,setPrototypeOf:d,Ab:g?d:c,P:b,Ga:function(a,b,c){if(!a)return a;var d={},e;for(e in a)f.call(a,e)&&(d[e]=\nb.call(c,a[e],e,a));return d},Tb:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},Yb:function(b){b=a.a.la(b);for(var c=(b[0]&&b[0].ownerDocument||w).createElement(\"div\"),d=0,e=b.length;d<e;d++)c.appendChild(a.oa(b[d]));return c},Ca:function(b,c){for(var d=0,e=b.length,l=[];d<e;d++){var k=b[d].cloneNode(!0);l.push(c?a.oa(k):k)}return l},va:function(b,c){a.a.Tb(b);if(c)for(var d=0,e=c.length;d<e;d++)b.appendChild(c[d])},Xc:function(b,c){var d=b.nodeType?[b]:b;if(0<d.length){for(var e=d[0],\nl=e.parentNode,k=0,f=c.length;k<f;k++)l.insertBefore(c[k],e);k=0;for(f=d.length;k<f;k++)a.removeNode(d[k])}},Ua:function(a,b){if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.splice(0,1);for(;1<a.length&&a[a.length-1].parentNode!==b;)a.length--;if(1<a.length){var c=a[0],d=a[a.length-1];for(a.length=0;c!==d;)a.push(c),c=c.nextSibling;a.push(d)}}return a},Zc:function(a,b){7>p?a.setAttribute(\"selected\",b):a.selected=b},Db:function(a){return null===a||a===n?\"\":a.trim?\na.trim():a.toString().replace(/^[\\s\\xa0]+|[\\s\\xa0]+$/g,\"\")},Ud:function(a,b){a=a||\"\";return b.length>a.length?!1:a.substring(0,b.length)===b},vd:function(a,b){if(a===b)return!0;if(11===a.nodeType)return!1;if(b.contains)return b.contains(1!==a.nodeType?a.parentNode:a);if(b.compareDocumentPosition)return 16==(b.compareDocumentPosition(a)&16);for(;a&&a!=b;)a=a.parentNode;return!!a},Sb:function(b){return a.a.vd(b,b.ownerDocument.documentElement)},kd:function(b){return!!a.a.Lb(b,a.a.Sb)},R:function(a){return a&&\na.tagName&&a.tagName.toLowerCase()},Ac:function(b){return a.onError?function(){try{return b.apply(this,arguments)}catch(c){throw a.onError&&a.onError(c),c;}}:b},setTimeout:function(b,c){return setTimeout(a.a.Ac(b),c)},Gc:function(b){setTimeout(function(){a.onError&&a.onError(b);throw b;},0)},B:function(b,c,d){var e=a.a.Ac(d);d=l[c];if(a.options.useOnlyNativeEvents||d||!v)if(d||\"function\"!=typeof b.addEventListener)if(\"undefined\"!=typeof b.attachEvent){var k=function(a){e.call(b,a)},f=\"on\"+c;b.attachEvent(f,\nk);a.a.K.za(b,function(){b.detachEvent(f,k)})}else throw Error(\"Browser doesn't support addEventListener or attachEvent\");else b.addEventListener(c,e,!1);else t||(t=\"function\"==typeof v(b).on?\"on\":\"bind\"),v(b)[t](c,e)},Fb:function(b,c){if(!b||!b.nodeType)throw Error(\"element must be a DOM node when calling triggerEvent\");var d;\"input\"===a.a.R(b)&&b.type&&\"click\"==c.toLowerCase()?(d=b.type,d=\"checkbox\"==d||\"radio\"==d):d=!1;if(a.options.useOnlyNativeEvents||!v||d)if(\"function\"==typeof w.createEvent)if(\"function\"==\ntypeof b.dispatchEvent)d=w.createEvent(k[c]||\"HTMLEvents\"),d.initEvent(c,!0,!0,A,0,0,0,0,0,!1,!1,!1,!1,0,b),b.dispatchEvent(d);else throw Error(\"The supplied element doesn't support dispatchEvent\");else if(d&&b.click)b.click();else if(\"undefined\"!=typeof b.fireEvent)b.fireEvent(\"on\"+c);else throw Error(\"Browser doesn't support triggering events\");else v(b).trigger(c)},f:function(b){return a.O(b)?b():b},bc:function(b){return a.O(b)?b.v():b},Eb:function(b,c,d){var l;c&&(\"object\"===typeof b.classList?\n(l=b.classList[d?\"add\":\"remove\"],a.a.D(c.match(q),function(a){l.call(b.classList,a)})):\"string\"===typeof b.className.baseVal?e(b.className,\"baseVal\",c,d):e(b,\"className\",c,d))},Bb:function(b,c){var d=a.a.f(c);if(null===d||d===n)d=\"\";var e=a.h.firstChild(b);!e||3!=e.nodeType||a.h.nextSibling(e)?a.h.va(b,[b.ownerDocument.createTextNode(d)]):e.data=d;a.a.Ad(b)},Yc:function(a,b){a.name=b;if(7>=p)try{var c=a.name.replace(/[&<>'\"]/g,function(a){return\"&#\"+a.charCodeAt(0)+\";\"});a.mergeAttributes(w.createElement(\"<input name='\"+\nc+\"'/>\"),!1)}catch(d){}},Ad:function(a){9<=p&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},wd:function(a){if(p){var b=a.style.width;a.style.width=0;a.style.width=b}},Pd:function(b,c){b=a.a.f(b);c=a.a.f(c);for(var d=[],e=b;e<=c;e++)d.push(e);return d},la:function(a){for(var b=[],c=0,d=a.length;c<d;c++)b.push(a[c]);return b},Da:function(a){return h?Symbol(a):a},Zd:6===p,$d:7===p,W:p,Lc:function(b,c){for(var d=a.a.la(b.getElementsByTagName(\"input\")).concat(a.a.la(b.getElementsByTagName(\"textarea\"))),\ne=\"string\"==typeof c?function(a){return a.name===c}:function(a){return c.test(a.name)},l=[],k=d.length-1;0<=k;k--)e(d[k])&&l.push(d[k]);return l},Nd:function(b){return\"string\"==typeof b&&(b=a.a.Db(b))?H&&H.parse?H.parse(b):(new Function(\"return \"+b))():null},hc:function(b,c,d){if(!H||!H.stringify)throw Error(\"Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js\");\nreturn H.stringify(a.a.f(b),c,d)},Od:function(c,d,e){e=e||{};var l=e.params||{},k=e.includeFields||this.Jc,f=c;if(\"object\"==typeof c&&\"form\"===a.a.R(c))for(var f=c.action,h=k.length-1;0<=h;h--)for(var g=a.a.Lc(c,k[h]),m=g.length-1;0<=m;m--)l[g[m].name]=g[m].value;d=a.a.f(d);var p=w.createElement(\"form\");p.style.display=\"none\";p.action=f;p.method=\"post\";for(var q in d)c=w.createElement(\"input\"),c.type=\"hidden\",c.name=q,c.value=a.a.hc(a.a.f(d[q])),p.appendChild(c);b(l,function(a,b){var c=w.createElement(\"input\");\nc.type=\"hidden\";c.name=a;c.value=b;p.appendChild(c)});w.body.appendChild(p);e.submitter?e.submitter(p):p.submit();setTimeout(function(){p.parentNode.removeChild(p)},0)}}}();a.b(\"utils\",a.a);a.b(\"utils.arrayForEach\",a.a.D);a.b(\"utils.arrayFirst\",a.a.Lb);a.b(\"utils.arrayFilter\",a.a.jb);a.b(\"utils.arrayGetDistinctValues\",a.a.wc);a.b(\"utils.arrayIndexOf\",a.a.A);a.b(\"utils.arrayMap\",a.a.Mb);a.b(\"utils.arrayPushAll\",a.a.Nb);a.b(\"utils.arrayRemoveItem\",a.a.Pa);a.b(\"utils.cloneNodes\",a.a.Ca);a.b(\"utils.createSymbolOrString\",\na.a.Da);a.b(\"utils.extend\",a.a.extend);a.b(\"utils.fieldsIncludedWithJsonPost\",a.a.Jc);a.b(\"utils.getFormFields\",a.a.Lc);a.b(\"utils.objectMap\",a.a.Ga);a.b(\"utils.peekObservable\",a.a.bc);a.b(\"utils.postJson\",a.a.Od);a.b(\"utils.parseJson\",a.a.Nd);a.b(\"utils.registerEventHandler\",a.a.B);a.b(\"utils.stringifyJson\",a.a.hc);a.b(\"utils.range\",a.a.Pd);a.b(\"utils.toggleDomNodeCssClass\",a.a.Eb);a.b(\"utils.triggerEvent\",a.a.Fb);a.b(\"utils.unwrapObservable\",a.a.f);a.b(\"utils.objectForEach\",a.a.P);a.b(\"utils.addOrRemoveItem\",\na.a.Na);a.b(\"utils.setTextContent\",a.a.Bb);a.b(\"unwrap\",a.a.f);Function.prototype.bind||(Function.prototype.bind=function(a){var c=this;if(1===arguments.length)return function(){return c.apply(a,arguments)};var d=Array.prototype.slice.call(arguments,1);return function(){var e=d.slice(0);e.push.apply(e,arguments);return c.apply(a,e)}});a.a.g=new function(){var b=0,c=\"__ko__\"+(new Date).getTime(),d={},e,f;a.a.W?(e=function(a,e){var f=a[c];if(!f||\"null\"===f||!d[f]){if(!e)return n;f=a[c]=\"ko\"+b++;d[f]=\n{}}return d[f]},f=function(a){var b=a[c];return b?(delete d[b],a[c]=null,!0):!1}):(e=function(a,b){var d=a[c];!d&&b&&(d=a[c]={});return d},f=function(a){return a[c]?(delete a[c],!0):!1});return{get:function(a,b){var c=e(a,!1);return c&&c[b]},set:function(a,b,c){(a=e(a,c!==n))&&(a[b]=c)},Ub:function(a,b,c){a=e(a,!0);return a[b]||(a[b]=c)},clear:f,Z:function(){return b++ +c}}};a.b(\"utils.domData\",a.a.g);a.b(\"utils.domData.clear\",a.a.g.clear);a.a.K=new function(){function b(b,c){var d=a.a.g.get(b,e);\nd===n&&c&&(d=[],a.a.g.set(b,e,d));return d}function c(c){var e=b(c,!1);if(e)for(var e=e.slice(0),k=0;k<e.length;k++)e[k](c);a.a.g.clear(c);a.a.K.cleanExternalData(c);g[c.nodeType]&&d(c.childNodes,!0)}function d(b,d){for(var e=[],l,f=0;f<b.length;f++)if(!d||8===b[f].nodeType)if(c(e[e.length]=l=b[f]),b[f]!==l)for(;f--&&-1==a.a.A(e,b[f]););}var e=a.a.g.Z(),f={1:!0,8:!0,9:!0},g={1:!0,9:!0};return{za:function(a,c){if(\"function\"!=typeof c)throw Error(\"Callback must be a function\");b(a,!0).push(c)},yb:function(c,\nd){var f=b(c,!1);f&&(a.a.Pa(f,d),0==f.length&&a.a.g.set(c,e,n))},oa:function(b){a.u.G(function(){f[b.nodeType]&&(c(b),g[b.nodeType]&&d(b.getElementsByTagName(\"*\")))});return b},removeNode:function(b){a.oa(b);b.parentNode&&b.parentNode.removeChild(b)},cleanExternalData:function(a){v&&\"function\"==typeof v.cleanData&&v.cleanData([a])}}};a.oa=a.a.K.oa;a.removeNode=a.a.K.removeNode;a.b(\"cleanNode\",a.oa);a.b(\"removeNode\",a.removeNode);a.b(\"utils.domNodeDisposal\",a.a.K);a.b(\"utils.domNodeDisposal.addDisposeCallback\",\na.a.K.za);a.b(\"utils.domNodeDisposal.removeDisposeCallback\",a.a.K.yb);(function(){var b=[0,\"\",\"\"],c=[1,\"<table>\",\"</table>\"],d=[3,\"<table><tbody><tr>\",\"</tr></tbody></table>\"],e=[1,\"<select multiple='multiple'>\",\"</select>\"],f={thead:c,tbody:c,tfoot:c,tr:[2,\"<table><tbody>\",\"</tbody></table>\"],td:d,th:d,option:e,optgroup:e},g=8>=a.a.W;a.a.ua=function(c,d){var e;if(v)if(v.parseHTML)e=v.parseHTML(c,d)||[];else{if((e=v.clean([c],d))&&e[0]){for(var l=e[0];l.parentNode&&11!==l.parentNode.nodeType;)l=l.parentNode;\nl.parentNode&&l.parentNode.removeChild(l)}}else{(e=d)||(e=w);var l=e.parentWindow||e.defaultView||A,p=a.a.Db(c).toLowerCase(),q=e.createElement(\"div\"),t;t=(p=p.match(/^(?:\\x3c!--.*?--\\x3e\\s*?)*?<([a-z]+)[\\s>]/))&&f[p[1]]||b;p=t[0];t=\"ignored<div>\"+t[1]+c+t[2]+\"</div>\";\"function\"==typeof l.innerShiv?q.appendChild(l.innerShiv(t)):(g&&e.body.appendChild(q),q.innerHTML=t,g&&q.parentNode.removeChild(q));for(;p--;)q=q.lastChild;e=a.a.la(q.lastChild.childNodes)}return e};a.a.Md=function(b,c){var d=a.a.ua(b,\nc);return d.length&&d[0].parentElement||a.a.Yb(d)};a.a.fc=function(b,c){a.a.Tb(b);c=a.a.f(c);if(null!==c&&c!==n)if(\"string\"!=typeof c&&(c=c.toString()),v)v(b).html(c);else for(var d=a.a.ua(c,b.ownerDocument),e=0;e<d.length;e++)b.appendChild(d[e])}})();a.b(\"utils.parseHtmlFragment\",a.a.ua);a.b(\"utils.setHtml\",a.a.fc);a.aa=function(){function b(c,e){if(c)if(8==c.nodeType){var f=a.aa.Uc(c.nodeValue);null!=f&&e.push({ud:c,Kd:f})}else if(1==c.nodeType)for(var f=0,g=c.childNodes,h=g.length;f<h;f++)b(g[f],\ne)}var c={};return{Xb:function(a){if(\"function\"!=typeof a)throw Error(\"You can only pass a function to ko.memoization.memoize()\");var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);c[b]=a;return\"\\x3c!--[ko_memo:\"+b+\"]--\\x3e\"},bd:function(a,b){var f=c[a];if(f===n)throw Error(\"Couldn't find any memo with ID \"+a+\". Perhaps it's already been unmemoized.\");try{return f.apply(null,b||[]),!0}finally{delete c[a]}},cd:function(c,e){var f=\n[];b(c,f);for(var g=0,h=f.length;g<h;g++){var m=f[g].ud,k=[m];e&&a.a.Nb(k,e);a.aa.bd(f[g].Kd,k);m.nodeValue=\"\";m.parentNode&&m.parentNode.removeChild(m)}},Uc:function(a){return(a=a.match(/^\\[ko_memo\\:(.*?)\\]$/))?a[1]:null}}}();a.b(\"memoization\",a.aa);a.b(\"memoization.memoize\",a.aa.Xb);a.b(\"memoization.unmemoize\",a.aa.bd);a.b(\"memoization.parseMemoText\",a.aa.Uc);a.b(\"memoization.unmemoizeDomNodeAndDescendants\",a.aa.cd);a.na=function(){function b(){if(f)for(var b=f,c=0,d;h<f;)if(d=e[h++]){if(h>b){if(5E3<=\n++c){h=f;a.a.Gc(Error(\"'Too much recursion' after processing \"+c+\" task groups.\"));break}b=f}try{d()}catch(p){a.a.Gc(p)}}}function c(){b();h=f=e.length=0}var d,e=[],f=0,g=1,h=0;A.MutationObserver?d=function(a){var b=w.createElement(\"div\");(new MutationObserver(a)).observe(b,{attributes:!0});return function(){b.classList.toggle(\"foo\")}}(c):d=w&&\"onreadystatechange\"in w.createElement(\"script\")?function(a){var b=w.createElement(\"script\");b.onreadystatechange=function(){b.onreadystatechange=null;w.documentElement.removeChild(b);\nb=null;a()};w.documentElement.appendChild(b)}:function(a){setTimeout(a,0)};return{scheduler:d,zb:function(b){f||a.na.scheduler(c);e[f++]=b;return g++},cancel:function(a){a=a-(g-f);a>=h&&a<f&&(e[a]=null)},resetForTesting:function(){var a=f-h;h=f=e.length=0;return a},Sd:b}}();a.b(\"tasks\",a.na);a.b(\"tasks.schedule\",a.na.zb);a.b(\"tasks.runEarly\",a.na.Sd);a.Ta={throttle:function(b,c){b.throttleEvaluation=c;var d=null;return a.$({read:b,write:function(e){clearTimeout(d);d=a.a.setTimeout(function(){b(e)},\nc)}})},rateLimit:function(a,c){var d,e,f;\"number\"==typeof c?d=c:(d=c.timeout,e=c.method);a.Hb=!1;f=\"function\"==typeof e?e:\"notifyWhenChangesStop\"==e?Y:X;a.ub(function(a){return f(a,d,c)})},deferred:function(b,c){if(!0!==c)throw Error(\"The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.\");b.Hb||(b.Hb=!0,b.ub(function(c){var e,f=!1;return function(){if(!f){a.na.cancel(e);e=a.na.zb(c);try{f=!0,b.notifySubscribers(n,\"dirty\")}finally{f=\n!1}}}}))},notify:function(a,c){a.equalityComparer=\"always\"==c?null:K}};var W={undefined:1,\"boolean\":1,number:1,string:1};a.b(\"extenders\",a.Ta);a.ic=function(b,c,d){this.da=b;this.lc=c;this.mc=d;this.Ib=!1;this.fb=this.Jb=null;a.L(this,\"dispose\",this.s);a.L(this,\"disposeWhenNodeIsRemoved\",this.l)};a.ic.prototype.s=function(){this.Ib||(this.fb&&a.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)};a.ic.prototype.l=function(b){this.Jb=b;a.a.K.za(b,this.fb=this.s.bind(this))};\na.T=function(){a.a.Ab(this,D);D.qb(this)};var D={qb:function(a){a.U={change:[]};a.sc=1},subscribe:function(b,c,d){var e=this;d=d||\"change\";var f=new a.ic(e,c?b.bind(c):b,function(){a.a.Pa(e.U[d],f);e.hb&&e.hb(d)});e.Qa&&e.Qa(d);e.U[d]||(e.U[d]=[]);e.U[d].push(f);return f},notifySubscribers:function(b,c){c=c||\"change\";\"change\"===c&&this.Gb();if(this.Wa(c)){var d=\"change\"===c&&this.ed||this.U[c].slice(0);try{a.u.xc();for(var e=0,f;f=d[e];++e)f.Ib||f.lc(b)}finally{a.u.end()}}},ob:function(){return this.sc},\nDd:function(a){return this.ob()!==a},Gb:function(){++this.sc},ub:function(b){var c=this,d=a.O(c),e,f,g,h,m;c.gb||(c.gb=c.notifySubscribers,c.notifySubscribers=Z);var k=b(function(){c.Ja=!1;d&&h===c&&(h=c.nc?c.nc():c());var a=f||m&&c.sb(g,h);m=f=e=!1;a&&c.gb(g=h)});c.qc=function(a,b){b&&c.Ja||(m=!b);c.ed=c.U.change.slice(0);c.Ja=e=!0;h=a;k()};c.pc=function(a){e||(g=a,c.gb(a,\"beforeChange\"))};c.rc=function(){m=!0};c.gd=function(){c.sb(g,c.v(!0))&&(f=!0)}},Wa:function(a){return this.U[a]&&this.U[a].length},\nBd:function(b){if(b)return this.U[b]&&this.U[b].length||0;var c=0;a.a.P(this.U,function(a,b){\"dirty\"!==a&&(c+=b.length)});return c},sb:function(a,c){return!this.equalityComparer||!this.equalityComparer(a,c)},toString:function(){return\"[object Object]\"},extend:function(b){var c=this;b&&a.a.P(b,function(b,e){var f=a.Ta[b];\"function\"==typeof f&&(c=f(c,e)||c)});return c}};a.L(D,\"init\",D.qb);a.L(D,\"subscribe\",D.subscribe);a.L(D,\"extend\",D.extend);a.L(D,\"getSubscriptionsCount\",D.Bd);a.a.Ba&&a.a.setPrototypeOf(D,\nFunction.prototype);a.T.fn=D;a.Qc=function(a){return null!=a&&\"function\"==typeof a.subscribe&&\"function\"==typeof a.notifySubscribers};a.b(\"subscribable\",a.T);a.b(\"isSubscribable\",a.Qc);a.S=a.u=function(){function b(a){d.push(e);e=a}function c(){e=d.pop()}var d=[],e,f=0;return{xc:b,end:c,cc:function(b){if(e){if(!a.Qc(b))throw Error(\"Only subscribable things can act as dependencies\");e.od.call(e.pd,b,b.fd||(b.fd=++f))}},G:function(a,d,e){try{return b(),a.apply(d,e||[])}finally{c()}},qa:function(){if(e)return e.o.qa()},\nVa:function(){if(e)return e.o.Va()},Ya:function(){if(e)return e.Ya},o:function(){if(e)return e.o}}}();a.b(\"computedContext\",a.S);a.b(\"computedContext.getDependenciesCount\",a.S.qa);a.b(\"computedContext.getDependencies\",a.S.Va);a.b(\"computedContext.isInitial\",a.S.Ya);a.b(\"computedContext.registerDependency\",a.S.cc);a.b(\"ignoreDependencies\",a.Yd=a.u.G);var I=a.a.Da(\"_latestValue\");a.ta=function(b){function c(){if(0<arguments.length)return c.sb(c[I],arguments[0])&&(c.ya(),c[I]=arguments[0],c.xa()),this;\na.u.cc(c);return c[I]}c[I]=b;a.a.Ba||a.a.extend(c,a.T.fn);a.T.fn.qb(c);a.a.Ab(c,F);a.options.deferUpdates&&a.Ta.deferred(c,!0);return c};var F={equalityComparer:K,v:function(){return this[I]},xa:function(){this.notifySubscribers(this[I],\"spectate\");this.notifySubscribers(this[I])},ya:function(){this.notifySubscribers(this[I],\"beforeChange\")}};a.a.Ba&&a.a.setPrototypeOf(F,a.T.fn);var G=a.ta.Ma=\"__ko_proto__\";F[G]=a.ta;a.O=function(b){if((b=\"function\"==typeof b&&b[G])&&b!==F[G]&&b!==a.o.fn[G])throw Error(\"Invalid object that looks like an observable; possibly from another Knockout instance\");\nreturn!!b};a.Za=function(b){return\"function\"==typeof b&&(b[G]===F[G]||b[G]===a.o.fn[G]&&b.Nc)};a.b(\"observable\",a.ta);a.b(\"isObservable\",a.O);a.b(\"isWriteableObservable\",a.Za);a.b(\"isWritableObservable\",a.Za);a.b(\"observable.fn\",F);a.L(F,\"peek\",F.v);a.L(F,\"valueHasMutated\",F.xa);a.L(F,\"valueWillMutate\",F.ya);a.Ha=function(b){b=b||[];if(\"object\"!=typeof b||!(\"length\"in b))throw Error(\"The argument passed when initializing an observable array must be an array, or null, or undefined.\");b=a.ta(b);a.a.Ab(b,\na.Ha.fn);return b.extend({trackArrayChanges:!0})};a.Ha.fn={remove:function(b){for(var c=this.v(),d=[],e=\"function\"!=typeof b||a.O(b)?function(a){return a===b}:b,f=0;f<c.length;f++){var g=c[f];if(e(g)){0===d.length&&this.ya();if(c[f]!==g)throw Error(\"Array modified during remove; cannot remove item\");d.push(g);c.splice(f,1);f--}}d.length&&this.xa();return d},removeAll:function(b){if(b===n){var c=this.v(),d=c.slice(0);this.ya();c.splice(0,c.length);this.xa();return d}return b?this.remove(function(c){return 0<=\na.a.A(b,c)}):[]},destroy:function(b){var c=this.v(),d=\"function\"!=typeof b||a.O(b)?function(a){return a===b}:b;this.ya();for(var e=c.length-1;0<=e;e--){var f=c[e];d(f)&&(f._destroy=!0)}this.xa()},destroyAll:function(b){return b===n?this.destroy(function(){return!0}):b?this.destroy(function(c){return 0<=a.a.A(b,c)}):[]},indexOf:function(b){var c=this();return a.a.A(c,b)},replace:function(a,c){var d=this.indexOf(a);0<=d&&(this.ya(),this.v()[d]=c,this.xa())},sorted:function(a){var c=this().slice(0);\nreturn a?c.sort(a):c.sort()},reversed:function(){return this().slice(0).reverse()}};a.a.Ba&&a.a.setPrototypeOf(a.Ha.fn,a.ta.fn);a.a.D(\"pop push reverse shift sort splice unshift\".split(\" \"),function(b){a.Ha.fn[b]=function(){var a=this.v();this.ya();this.zc(a,b,arguments);var d=a[b].apply(a,arguments);this.xa();return d===a?this:d}});a.a.D([\"slice\"],function(b){a.Ha.fn[b]=function(){var a=this();return a[b].apply(a,arguments)}});a.Pc=function(b){return a.O(b)&&\"function\"==typeof b.remove&&\"function\"==\ntypeof b.push};a.b(\"observableArray\",a.Ha);a.b(\"isObservableArray\",a.Pc);a.Ta.trackArrayChanges=function(b,c){function d(){function c(){if(m){var d=[].concat(b.v()||[]),e;if(b.Wa(\"arrayChange\")){if(!f||1<m)f=a.a.Pb(k,d,b.Ob);e=f}k=d;f=null;m=0;e&&e.length&&b.notifySubscribers(e,\"arrayChange\")}}e?c():(e=!0,h=b.subscribe(function(){++m},null,\"spectate\"),k=[].concat(b.v()||[]),f=null,g=b.subscribe(c))}b.Ob={};c&&\"object\"==typeof c&&a.a.extend(b.Ob,c);b.Ob.sparse=!0;if(!b.zc){var e=!1,f=null,g,h,m=0,\nk,l=b.Qa,p=b.hb;b.Qa=function(a){l&&l.call(b,a);\"arrayChange\"===a&&d()};b.hb=function(a){p&&p.call(b,a);\"arrayChange\"!==a||b.Wa(\"arrayChange\")||(g&&g.s(),h&&h.s(),h=g=null,e=!1,k=n)};b.zc=function(b,c,d){function l(a,b,c){return k[k.length]={status:a,value:b,index:c}}if(e&&!m){var k=[],p=b.length,g=d.length,h=0;switch(c){case \"push\":h=p;case \"unshift\":for(c=0;c<g;c++)l(\"added\",d[c],h+c);break;case \"pop\":h=p-1;case \"shift\":p&&l(\"deleted\",b[h],h);break;case \"splice\":c=Math.min(Math.max(0,0>d[0]?p+d[0]:\nd[0]),p);for(var p=1===g?p:Math.min(c+(d[1]||0),p),g=c+g-2,h=Math.max(p,g),U=[],L=[],n=2;c<h;++c,++n)c<p&&L.push(l(\"deleted\",b[c],c)),c<g&&U.push(l(\"added\",d[n],c));a.a.Kc(L,U);break;default:return}f=k}}}};var r=a.a.Da(\"_state\");a.o=a.$=function(b,c,d){function e(){if(0<arguments.length){if(\"function\"===typeof f)f.apply(g.nb,arguments);else throw Error(\"Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.\");return this}g.ra||\na.u.cc(e);(g.ka||g.J&&e.Xa())&&e.ha();return g.X}\"object\"===typeof b?d=b:(d=d||{},b&&(d.read=b));if(\"function\"!=typeof d.read)throw Error(\"Pass a function that returns the value of the ko.computed\");var f=d.write,g={X:n,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:d.read,nb:c||d.owner,l:d.disposeWhenNodeIsRemoved||d.l||null,Sa:d.disposeWhen||d.Sa,Rb:null,I:{},V:0,Ic:null};e[r]=g;e.Nc=\"function\"===typeof f;a.a.Ba||a.a.extend(e,a.T.fn);a.T.fn.qb(e);a.a.Ab(e,C);d.pure?(g.wb=!0,g.J=!0,a.a.extend(e,da)):\nd.deferEvaluation&&a.a.extend(e,ea);a.options.deferUpdates&&a.Ta.deferred(e,!0);g.l&&(g.jc=!0,g.l.nodeType||(g.l=null));g.J||d.deferEvaluation||e.ha();g.l&&e.ja()&&a.a.K.za(g.l,g.Rb=function(){e.s()});return e};var C={equalityComparer:K,qa:function(){return this[r].V},Va:function(){var b=[];a.a.P(this[r].I,function(a,d){b[d.Ka]=d.da});return b},Vb:function(b){if(!this[r].V)return!1;var c=this.Va();return-1!==a.a.A(c,b)?!0:!!a.a.Lb(c,function(a){return a.Vb&&a.Vb(b)})},uc:function(a,c,d){if(this[r].wb&&\nc===this)throw Error(\"A 'pure' computed must not be called recursively\");this[r].I[a]=d;d.Ka=this[r].V++;d.La=c.ob()},Xa:function(){var a,c,d=this[r].I;for(a in d)if(Object.prototype.hasOwnProperty.call(d,a)&&(c=d[a],this.Ia&&c.da.Ja||c.da.Dd(c.La)))return!0},Jd:function(){this.Ia&&!this[r].rb&&this.Ia(!1)},ja:function(){var a=this[r];return a.ka||0<a.V},Rd:function(){this.Ja?this[r].ka&&(this[r].sa=!0):this.Hc()},$c:function(a){if(a.Hb){var c=a.subscribe(this.Jd,this,\"dirty\"),d=a.subscribe(this.Rd,\nthis);return{da:a,s:function(){c.s();d.s()}}}return a.subscribe(this.Hc,this)},Hc:function(){var b=this,c=b.throttleEvaluation;c&&0<=c?(clearTimeout(this[r].Ic),this[r].Ic=a.a.setTimeout(function(){b.ha(!0)},c)):b.Ia?b.Ia(!0):b.ha(!0)},ha:function(b){var c=this[r],d=c.Sa,e=!1;if(!c.rb&&!c.ra){if(c.l&&!a.a.Sb(c.l)||d&&d()){if(!c.jc){this.s();return}}else c.jc=!1;c.rb=!0;try{e=this.zd(b)}finally{c.rb=!1}return e}},zd:function(b){var c=this[r],d=!1,e=c.wb?n:!c.V,d={qd:this,mb:c.I,Qb:c.V};a.u.xc({pd:d,\nod:ba,o:this,Ya:e});c.I={};c.V=0;var f=this.yd(c,d);c.V?d=this.sb(c.X,f):(this.s(),d=!0);d&&(c.J?this.Gb():this.notifySubscribers(c.X,\"beforeChange\"),c.X=f,this.notifySubscribers(c.X,\"spectate\"),!c.J&&b&&this.notifySubscribers(c.X),this.rc&&this.rc());e&&this.notifySubscribers(c.X,\"awake\");return d},yd:function(b,c){try{var d=b.Wc;return b.nb?d.call(b.nb):d()}finally{a.u.end(),c.Qb&&!b.J&&a.a.P(c.mb,aa),b.sa=b.ka=!1}},v:function(a){var c=this[r];(c.ka&&(a||!c.V)||c.J&&this.Xa())&&this.ha();return c.X},\nub:function(b){a.T.fn.ub.call(this,b);this.nc=function(){this[r].J||(this[r].sa?this.ha():this[r].ka=!1);return this[r].X};this.Ia=function(a){this.pc(this[r].X);this[r].ka=!0;a&&(this[r].sa=!0);this.qc(this,!a)}},s:function(){var b=this[r];!b.J&&b.I&&a.a.P(b.I,function(a,b){b.s&&b.s()});b.l&&b.Rb&&a.a.K.yb(b.l,b.Rb);b.I=n;b.V=0;b.ra=!0;b.sa=!1;b.ka=!1;b.J=!1;b.l=n;b.Sa=n;b.Wc=n;this.Nc||(b.nb=n)}},da={Qa:function(b){var c=this,d=c[r];if(!d.ra&&d.J&&\"change\"==b){d.J=!1;if(d.sa||c.Xa())d.I=null,d.V=\n0,c.ha()&&c.Gb();else{var e=[];a.a.P(d.I,function(a,b){e[b.Ka]=a});a.a.D(e,function(a,b){var e=d.I[a],m=c.$c(e.da);m.Ka=b;m.La=e.La;d.I[a]=m});c.Xa()&&c.ha()&&c.Gb()}d.ra||c.notifySubscribers(d.X,\"awake\")}},hb:function(b){var c=this[r];c.ra||\"change\"!=b||this.Wa(\"change\")||(a.a.P(c.I,function(a,b){b.s&&(c.I[a]={da:b.da,Ka:b.Ka,La:b.La},b.s())}),c.J=!0,this.notifySubscribers(n,\"asleep\"))},ob:function(){var b=this[r];b.J&&(b.sa||this.Xa())&&this.ha();return a.T.fn.ob.call(this)}},ea={Qa:function(a){\"change\"!=\na&&\"beforeChange\"!=a||this.v()}};a.a.Ba&&a.a.setPrototypeOf(C,a.T.fn);var N=a.ta.Ma;C[N]=a.o;a.Oc=function(a){return\"function\"==typeof a&&a[N]===C[N]};a.Fd=function(b){return a.Oc(b)&&b[r]&&b[r].wb};a.b(\"computed\",a.o);a.b(\"dependentObservable\",a.o);a.b(\"isComputed\",a.Oc);a.b(\"isPureComputed\",a.Fd);a.b(\"computed.fn\",C);a.L(C,\"peek\",C.v);a.L(C,\"dispose\",C.s);a.L(C,\"isActive\",C.ja);a.L(C,\"getDependenciesCount\",C.qa);a.L(C,\"getDependencies\",C.Va);a.xb=function(b,c){if(\"function\"===typeof b)return a.o(b,\nc,{pure:!0});b=a.a.extend({},b);b.pure=!0;return a.o(b,c)};a.b(\"pureComputed\",a.xb);(function(){function b(a,f,g){g=g||new d;a=f(a);if(\"object\"!=typeof a||null===a||a===n||a instanceof RegExp||a instanceof Date||a instanceof String||a instanceof Number||a instanceof Boolean)return a;var h=a instanceof Array?[]:{};g.save(a,h);c(a,function(c){var d=f(a[c]);switch(typeof d){case \"boolean\":case \"number\":case \"string\":case \"function\":h[c]=d;break;case \"object\":case \"undefined\":var l=g.get(d);h[c]=l!==\nn?l:b(d,f,g)}});return h}function c(a,b){if(a instanceof Array){for(var c=0;c<a.length;c++)b(c);\"function\"==typeof a.toJSON&&b(\"toJSON\")}else for(c in a)b(c)}function d(){this.keys=[];this.values=[]}a.ad=function(c){if(0==arguments.length)throw Error(\"When calling ko.toJS, pass the object you want to convert.\");return b(c,function(b){for(var c=0;a.O(b)&&10>c;c++)b=b();return b})};a.toJSON=function(b,c,d){b=a.ad(b);return a.a.hc(b,c,d)};d.prototype={constructor:d,save:function(b,c){var d=a.a.A(this.keys,\nb);0<=d?this.values[d]=c:(this.keys.push(b),this.values.push(c))},get:function(b){b=a.a.A(this.keys,b);return 0<=b?this.values[b]:n}}})();a.b(\"toJS\",a.ad);a.b(\"toJSON\",a.toJSON);a.Wd=function(b,c,d){function e(c){var e=a.xb(b,d).extend({ma:\"always\"}),h=e.subscribe(function(a){a&&(h.s(),c(a))});e.notifySubscribers(e.v());return h}return\"function\"!==typeof Promise||c?e(c.bind(d)):new Promise(e)};a.b(\"when\",a.Wd);(function(){a.w={M:function(b){switch(a.a.R(b)){case \"option\":return!0===b.__ko__hasDomDataOptionValue__?\na.a.g.get(b,a.c.options.$b):7>=a.a.W?b.getAttributeNode(\"value\")&&b.getAttributeNode(\"value\").specified?b.value:b.text:b.value;case \"select\":return 0<=b.selectedIndex?a.w.M(b.options[b.selectedIndex]):n;default:return b.value}},cb:function(b,c,d){switch(a.a.R(b)){case \"option\":\"string\"===typeof c?(a.a.g.set(b,a.c.options.$b,n),\"__ko__hasDomDataOptionValue__\"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=c):(a.a.g.set(b,a.c.options.$b,c),b.__ko__hasDomDataOptionValue__=!0,b.value=\"number\"===\ntypeof c?c:\"\");break;case \"select\":if(\"\"===c||null===c)c=n;for(var e=-1,f=0,g=b.options.length,h;f<g;++f)if(h=a.w.M(b.options[f]),h==c||\"\"===h&&c===n){e=f;break}if(d||0<=e||c===n&&1<b.size)b.selectedIndex=e,6===a.a.W&&a.a.setTimeout(function(){b.selectedIndex=e},0);break;default:if(null===c||c===n)c=\"\";b.value=c}}}})();a.b(\"selectExtensions\",a.w);a.b(\"selectExtensions.readValue\",a.w.M);a.b(\"selectExtensions.writeValue\",a.w.cb);a.m=function(){function b(b){b=a.a.Db(b);123===b.charCodeAt(0)&&(b=b.slice(1,\n-1));b+=\"\\n,\";var c=[],d=b.match(e),p,q=[],h=0;if(1<d.length){for(var x=0,B;B=d[x];++x){var u=B.charCodeAt(0);if(44===u){if(0>=h){c.push(p&&q.length?{key:p,value:q.join(\"\")}:{unknown:p||q.join(\"\")});p=h=0;q=[];continue}}else if(58===u){if(!h&&!p&&1===q.length){p=q.pop();continue}}else if(47===u&&1<B.length&&(47===B.charCodeAt(1)||42===B.charCodeAt(1)))continue;else 47===u&&x&&1<B.length?(u=d[x-1].match(f))&&!g[u[0]]&&(b=b.substr(b.indexOf(B)+1),d=b.match(e),x=-1,B=\"/\"):40===u||123===u||91===u?++h:\n41===u||125===u||93===u?--h:p||q.length||34!==u&&39!==u||(B=B.slice(1,-1));q.push(B)}if(0<h)throw Error(\"Unbalanced parentheses, braces, or brackets\");}return c}var c=[\"true\",\"false\",\"null\",\"undefined\"],d=/^(?:[$_a-z][$\\w]*|(.+)(\\.\\s*[$_a-z][$\\w]*|\\[.+\\]))$/i,e=RegExp(\"\\\"(?:\\\\\\\\.|[^\\\"])*\\\"|'(?:\\\\\\\\.|[^'])*'|`(?:\\\\\\\\.|[^`])*`|/\\\\*(?:[^*]|\\\\*+[^*/])*\\\\*+/|//.*\\n|/(?:\\\\\\\\.|[^/])+/w*|[^\\\\s:,/][^,\\\"'`{}()/:[\\\\]]*[^\\\\s,\\\"'`{}()/:[\\\\]]|[^\\\\s]\",\"g\"),f=/[\\])\"'A-Za-z0-9_$]+$/,g={\"in\":1,\"return\":1,\"typeof\":1},\nh={};return{Ra:[],wa:h,ac:b,vb:function(e,f){function l(b,e){var f;if(!x){var k=a.getBindingHandler(b);if(k&&k.preprocess&&!(e=k.preprocess(e,b,l)))return;if(k=h[b])f=e,0<=a.a.A(c,f)?f=!1:(k=f.match(d),f=null===k?!1:k[1]?\"Object(\"+k[1]+\")\"+k[2]:f),k=f;k&&q.push(\"'\"+(\"string\"==typeof h[b]?h[b]:b)+\"':function(_z){\"+f+\"=_z}\")}g&&(e=\"function(){return \"+e+\" }\");p.push(\"'\"+b+\"':\"+e)}f=f||{};var p=[],q=[],g=f.valueAccessors,x=f.bindingParams,B=\"string\"===typeof e?b(e):e;a.a.D(B,function(a){l(a.key||a.unknown,\na.value)});q.length&&l(\"_ko_property_writers\",\"{\"+q.join(\",\")+\" }\");return p.join(\",\")},Id:function(a,b){for(var c=0;c<a.length;c++)if(a[c].key==b)return!0;return!1},eb:function(b,c,d,e,f){if(b&&a.O(b))!a.Za(b)||f&&b.v()===e||b(e);else if((b=c.get(\"_ko_property_writers\"))&&b[d])b[d](e)}}}();a.b(\"expressionRewriting\",a.m);a.b(\"expressionRewriting.bindingRewriteValidators\",a.m.Ra);a.b(\"expressionRewriting.parseObjectLiteral\",a.m.ac);a.b(\"expressionRewriting.preProcessBindings\",a.m.vb);a.b(\"expressionRewriting._twoWayBindings\",\na.m.wa);a.b(\"jsonExpressionRewriting\",a.m);a.b(\"jsonExpressionRewriting.insertPropertyAccessorsIntoJson\",a.m.vb);(function(){function b(a){return 8==a.nodeType&&g.test(f?a.text:a.nodeValue)}function c(a){return 8==a.nodeType&&h.test(f?a.text:a.nodeValue)}function d(d,e){for(var f=d,h=1,g=[];f=f.nextSibling;){if(c(f)&&(a.a.g.set(f,k,!0),h--,0===h))return g;g.push(f);b(f)&&h++}if(!e)throw Error(\"Cannot find closing comment tag to match: \"+d.nodeValue);return null}function e(a,b){var c=d(a,b);return c?\n0<c.length?c[c.length-1].nextSibling:a.nextSibling:null}var f=w&&\"\\x3c!--test--\\x3e\"===w.createComment(\"test\").text,g=f?/^\\x3c!--\\s*ko(?:\\s+([\\s\\S]+))?\\s*--\\x3e$/:/^\\s*ko(?:\\s+([\\s\\S]+))?\\s*$/,h=f?/^\\x3c!--\\s*\\/ko\\s*--\\x3e$/:/^\\s*\\/ko\\s*$/,m={ul:!0,ol:!0},k=\"__ko_matchedEndComment__\";a.h={ea:{},childNodes:function(a){return b(a)?d(a):a.childNodes},Ea:function(c){if(b(c)){c=a.h.childNodes(c);for(var d=0,e=c.length;d<e;d++)a.removeNode(c[d])}else a.a.Tb(c)},va:function(c,d){if(b(c)){a.h.Ea(c);for(var e=\nc.nextSibling,f=0,k=d.length;f<k;f++)e.parentNode.insertBefore(d[f],e)}else a.a.va(c,d)},Vc:function(a,c){var d;b(a)?(d=a.nextSibling,a=a.parentNode):d=a.firstChild;d?c!==d&&a.insertBefore(c,d):a.appendChild(c)},Wb:function(c,d,e){e?(e=e.nextSibling,b(c)&&(c=c.parentNode),e?d!==e&&c.insertBefore(d,e):c.appendChild(d)):a.h.Vc(c,d)},firstChild:function(a){if(b(a))return!a.nextSibling||c(a.nextSibling)?null:a.nextSibling;if(a.firstChild&&c(a.firstChild))throw Error(\"Found invalid end comment, as the first child of \"+\na);return a.firstChild},nextSibling:function(d){b(d)&&(d=e(d));if(d.nextSibling&&c(d.nextSibling)){var f=d.nextSibling;if(c(f)&&!a.a.g.get(f,k))throw Error(\"Found end comment without a matching opening comment, as child of \"+d);return null}return d.nextSibling},Cd:b,Vd:function(a){return(a=(f?a.text:a.nodeValue).match(g))?a[1]:null},Sc:function(d){if(m[a.a.R(d)]){var f=d.firstChild;if(f){do if(1===f.nodeType){var k;k=f.firstChild;var h=null;if(k){do if(h)h.push(k);else if(b(k)){var g=e(k,!0);g?k=\ng:h=[k]}else c(k)&&(h=[k]);while(k=k.nextSibling)}if(k=h)for(h=f.nextSibling,g=0;g<k.length;g++)h?d.insertBefore(k[g],h):d.appendChild(k[g])}while(f=f.nextSibling)}}}}})();a.b(\"virtualElements\",a.h);a.b(\"virtualElements.allowedBindings\",a.h.ea);a.b(\"virtualElements.emptyNode\",a.h.Ea);a.b(\"virtualElements.insertAfter\",a.h.Wb);a.b(\"virtualElements.prepend\",a.h.Vc);a.b(\"virtualElements.setDomNodeChildren\",a.h.va);(function(){a.ga=function(){this.nd={}};a.a.extend(a.ga.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return null!=\nb.getAttribute(\"data-bind\")||a.j.getComponentNameForNode(b);case 8:return a.h.Cd(b);default:return!1}},getBindings:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b):null;return a.j.tc(d,b,c,!1)},getBindingAccessors:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b,{valueAccessors:!0}):null;return a.j.tc(d,b,c,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute(\"data-bind\");case 8:return a.h.Vd(b);default:return null}},\nparseBindingsString:function(b,c,d,e){try{var f=this.nd,g=b+(e&&e.valueAccessors||\"\"),h;if(!(h=f[g])){var m,k=\"with($context){with($data||{}){return{\"+a.m.vb(b,e)+\"}}}\";m=new Function(\"$context\",\"$element\",k);h=f[g]=m}return h(c,d)}catch(l){throw l.message=\"Unable to parse bindings.\\nBindings value: \"+b+\"\\nMessage: \"+l.message,l;}}});a.ga.instance=new a.ga})();a.b(\"bindingProvider\",a.ga);(function(){function b(b){var c=(b=a.a.g.get(b,z))&&b.N;c&&(b.N=null,c.Tc())}function c(c,d,e){this.node=c;this.yc=\nd;this.kb=[];this.H=!1;d.N||a.a.K.za(c,b);e&&e.N&&(e.N.kb.push(c),this.Kb=e)}function d(a){return function(){return a}}function e(a){return a()}function f(b){return a.a.Ga(a.u.G(b),function(a,c){return function(){return b()[c]}})}function g(b,c,e){return\"function\"===typeof b?f(b.bind(null,c,e)):a.a.Ga(b,d)}function h(a,b){return f(this.getBindings.bind(this,a,b))}function m(b,c){var d=a.h.firstChild(c);if(d){var e,f=a.ga.instance,l=f.preprocessNode;if(l){for(;e=d;)d=a.h.nextSibling(e),l.call(f,e);\nd=a.h.firstChild(c)}for(;e=d;)d=a.h.nextSibling(e),k(b,e)}a.i.ma(c,a.i.H)}function k(b,c){var d=b,e=1===c.nodeType;e&&a.h.Sc(c);if(e||a.ga.instance.nodeHasBindings(c))d=p(c,null,b).bindingContextForDescendants;d&&!u[a.a.R(c)]&&m(d,c)}function l(b){var c=[],d={},e=[];a.a.P(b,function ca(f){if(!d[f]){var k=a.getBindingHandler(f);k&&(k.after&&(e.push(f),a.a.D(k.after,function(c){if(b[c]){if(-1!==a.a.A(e,c))throw Error(\"Cannot combine the following bindings, because they have a cyclic dependency: \"+e.join(\", \"));\nca(c)}}),e.length--),c.push({key:f,Mc:k}));d[f]=!0}});return c}function p(b,c,d){var f=a.a.g.Ub(b,z,{}),k=f.hd;if(!c){if(k)throw Error(\"You cannot apply bindings multiple times to the same element.\");f.hd=!0}k||(f.context=d);f.Zb||(f.Zb={});var g;if(c&&\"function\"!==typeof c)g=c;else{var p=a.ga.instance,q=p.getBindingAccessors||h,m=a.$(function(){if(g=c?c(d,b):q.call(p,b,d)){if(d[t])d[t]();if(d[B])d[B]()}return g},null,{l:b});g&&m.ja()||(m=null)}var x=d,u;if(g){var J=function(){return a.a.Ga(m?m():\ng,e)},r=m?function(a){return function(){return e(m()[a])}}:function(a){return g[a]};J.get=function(a){return g[a]&&e(r(a))};J.has=function(a){return a in g};a.i.H in g&&a.i.subscribe(b,a.i.H,function(){var c=(0,g[a.i.H])();if(c){var d=a.h.childNodes(b);d.length&&c(d,a.Ec(d[0]))}});a.i.pa in g&&(x=a.i.Cb(b,d),a.i.subscribe(b,a.i.pa,function(){var c=(0,g[a.i.pa])();c&&a.h.firstChild(b)&&c(b)}));f=l(g);a.a.D(f,function(c){var d=c.Mc.init,e=c.Mc.update,f=c.key;if(8===b.nodeType&&!a.h.ea[f])throw Error(\"The binding '\"+\nf+\"' cannot be used with virtual elements\");try{\"function\"==typeof d&&a.u.G(function(){var a=d(b,r(f),J,x.$data,x);if(a&&a.controlsDescendantBindings){if(u!==n)throw Error(\"Multiple bindings (\"+u+\" and \"+f+\") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.\");u=f}}),\"function\"==typeof e&&a.$(function(){e(b,r(f),J,x.$data,x)},null,{l:b})}catch(k){throw k.message='Unable to process binding \"'+f+\": \"+g[f]+'\"\\nMessage: '+k.message,\nk;}})}f=u===n;return{shouldBindDescendants:f,bindingContextForDescendants:f&&x}}function q(b,c){return b&&b instanceof a.fa?b:new a.fa(b,n,n,c)}var t=a.a.Da(\"_subscribable\"),x=a.a.Da(\"_ancestorBindingInfo\"),B=a.a.Da(\"_dataDependency\");a.c={};var u={script:!0,textarea:!0,template:!0};a.getBindingHandler=function(b){return a.c[b]};var J={};a.fa=function(b,c,d,e,f){function k(){var b=p?h():h,f=a.a.f(b);c?(a.a.extend(l,c),x in c&&(l[x]=c[x])):(l.$parents=[],l.$root=f,l.ko=a);l[t]=q;g?f=l.$data:(l.$rawData=\nb,l.$data=f);d&&(l[d]=f);e&&e(l,c,f);if(c&&c[t]&&!a.S.o().Vb(c[t]))c[t]();m&&(l[B]=m);return l.$data}var l=this,g=b===J,h=g?n:b,p=\"function\"==typeof h&&!a.O(h),q,m=f&&f.dataDependency;f&&f.exportDependencies?k():(q=a.xb(k),q.v(),q.ja()?q.equalityComparer=null:l[t]=n)};a.fa.prototype.createChildContext=function(b,c,d,e){!e&&c&&\"object\"==typeof c&&(e=c,c=e.as,d=e.extend);if(c&&e&&e.noChildContext){var f=\"function\"==typeof b&&!a.O(b);return new a.fa(J,this,null,function(a){d&&d(a);a[c]=f?b():b},e)}return new a.fa(b,\nthis,c,function(a,b){a.$parentContext=b;a.$parent=b.$data;a.$parents=(b.$parents||[]).slice(0);a.$parents.unshift(a.$parent);d&&d(a)},e)};a.fa.prototype.extend=function(b,c){return new a.fa(J,this,null,function(c){a.a.extend(c,\"function\"==typeof b?b(c):b)},c)};var z=a.a.g.Z();c.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)};c.prototype.sd=function(b){a.a.Pa(this.kb,b);!this.kb.length&&this.H&&this.Cc()};c.prototype.Cc=function(){this.H=!0;this.yc.N&&!this.kb.length&&(this.yc.N=\nnull,a.a.K.yb(this.node,b),a.i.ma(this.node,a.i.pa),this.Tc())};a.i={H:\"childrenComplete\",pa:\"descendantsComplete\",subscribe:function(b,c,d,e,f){var k=a.a.g.Ub(b,z,{});k.Fa||(k.Fa=new a.T);f&&f.notifyImmediately&&k.Zb[c]&&a.u.G(d,e,[b]);return k.Fa.subscribe(d,e,c)},ma:function(b,c){var d=a.a.g.get(b,z);if(d&&(d.Zb[c]=!0,d.Fa&&d.Fa.notifySubscribers(b,c),c==a.i.H))if(d.N)d.N.Cc();else if(d.N===n&&d.Fa&&d.Fa.Wa(a.i.pa))throw Error(\"descendantsComplete event not supported for bindings on this node\");\n},Cb:function(b,d){var e=a.a.g.Ub(b,z,{});e.N||(e.N=new c(b,e,d[x]));return d[x]==e?d:d.extend(function(a){a[x]=e})}};a.Td=function(b){return(b=a.a.g.get(b,z))&&b.context};a.ib=function(b,c,d){1===b.nodeType&&a.h.Sc(b);return p(b,c,q(d))};a.ld=function(b,c,d){d=q(d);return a.ib(b,g(c,d,b),d)};a.Oa=function(a,b){1!==b.nodeType&&8!==b.nodeType||m(q(a),b)};a.vc=function(a,b,c){!v&&A.jQuery&&(v=A.jQuery);if(2>arguments.length){if(b=w.body,!b)throw Error(\"ko.applyBindings: could not find document.body; has the document been loaded?\");\n}else if(!b||1!==b.nodeType&&8!==b.nodeType)throw Error(\"ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node\");k(q(a,c),b)};a.Dc=function(b){return!b||1!==b.nodeType&&8!==b.nodeType?n:a.Td(b)};a.Ec=function(b){return(b=a.Dc(b))?b.$data:n};a.b(\"bindingHandlers\",a.c);a.b(\"bindingEvent\",a.i);a.b(\"bindingEvent.subscribe\",a.i.subscribe);a.b(\"bindingEvent.startPossiblyAsyncContentBinding\",a.i.Cb);a.b(\"applyBindings\",a.vc);a.b(\"applyBindingsToDescendants\",a.Oa);\na.b(\"applyBindingAccessorsToNode\",a.ib);a.b(\"applyBindingsToNode\",a.ld);a.b(\"contextFor\",a.Dc);a.b(\"dataFor\",a.Ec)})();(function(b){function c(c,e){var k=Object.prototype.hasOwnProperty.call(f,c)?f[c]:b,l;k?k.subscribe(e):(k=f[c]=new a.T,k.subscribe(e),d(c,function(b,d){var e=!(!d||!d.synchronous);g[c]={definition:b,Gd:e};delete f[c];l||e?k.notifySubscribers(b):a.na.zb(function(){k.notifySubscribers(b)})}),l=!0)}function d(a,b){e(\"getConfig\",[a],function(c){c?e(\"loadComponent\",[a,c],function(a){b(a,\nc)}):b(null,null)})}function e(c,d,f,l){l||(l=a.j.loaders.slice(0));var g=l.shift();if(g){var q=g[c];if(q){var t=!1;if(q.apply(g,d.concat(function(a){t?f(null):null!==a?f(a):e(c,d,f,l)}))!==b&&(t=!0,!g.suppressLoaderExceptions))throw Error(\"Component loaders must supply values by invoking the callback, not by returning values synchronously.\");}else e(c,d,f,l)}else f(null)}var f={},g={};a.j={get:function(d,e){var f=Object.prototype.hasOwnProperty.call(g,d)?g[d]:b;f?f.Gd?a.u.G(function(){e(f.definition)}):\na.na.zb(function(){e(f.definition)}):c(d,e)},Bc:function(a){delete g[a]},oc:e};a.j.loaders=[];a.b(\"components\",a.j);a.b(\"components.get\",a.j.get);a.b(\"components.clearCachedDefinition\",a.j.Bc)})();(function(){function b(b,c,d,e){function g(){0===--B&&e(h)}var h={},B=2,u=d.template;d=d.viewModel;u?f(c,u,function(c){a.j.oc(\"loadTemplate\",[b,c],function(a){h.template=a;g()})}):g();d?f(c,d,function(c){a.j.oc(\"loadViewModel\",[b,c],function(a){h[m]=a;g()})}):g()}function c(a,b,d){if(\"function\"===typeof b)d(function(a){return new b(a)});\nelse if(\"function\"===typeof b[m])d(b[m]);else if(\"instance\"in b){var e=b.instance;d(function(){return e})}else\"viewModel\"in b?c(a,b.viewModel,d):a(\"Unknown viewModel value: \"+b)}function d(b){switch(a.a.R(b)){case \"script\":return a.a.ua(b.text);case \"textarea\":return a.a.ua(b.value);case \"template\":if(e(b.content))return a.a.Ca(b.content.childNodes)}return a.a.Ca(b.childNodes)}function e(a){return A.DocumentFragment?a instanceof DocumentFragment:a&&11===a.nodeType}function f(a,b,c){\"string\"===typeof b.require?\nT||A.require?(T||A.require)([b.require],function(a){a&&\"object\"===typeof a&&a.Xd&&a[\"default\"]&&(a=a[\"default\"]);c(a)}):a(\"Uses require, but no AMD loader is present\"):c(b)}function g(a){return function(b){throw Error(\"Component '\"+a+\"': \"+b);}}var h={};a.j.register=function(b,c){if(!c)throw Error(\"Invalid configuration for \"+b);if(a.j.tb(b))throw Error(\"Component \"+b+\" is already registered\");h[b]=c};a.j.tb=function(a){return Object.prototype.hasOwnProperty.call(h,a)};a.j.unregister=function(b){delete h[b];\na.j.Bc(b)};a.j.Fc={getConfig:function(b,c){c(a.j.tb(b)?h[b]:null)},loadComponent:function(a,c,d){var e=g(a);f(e,c,function(c){b(a,e,c,d)})},loadTemplate:function(b,c,f){b=g(b);if(\"string\"===typeof c)f(a.a.ua(c));else if(c instanceof Array)f(c);else if(e(c))f(a.a.la(c.childNodes));else if(c.element)if(c=c.element,A.HTMLElement?c instanceof HTMLElement:c&&c.tagName&&1===c.nodeType)f(d(c));else if(\"string\"===typeof c){var h=w.getElementById(c);h?f(d(h)):b(\"Cannot find element with ID \"+c)}else b(\"Unknown element type: \"+\nc);else b(\"Unknown template value: \"+c)},loadViewModel:function(a,b,d){c(g(a),b,d)}};var m=\"createViewModel\";a.b(\"components.register\",a.j.register);a.b(\"components.isRegistered\",a.j.tb);a.b(\"components.unregister\",a.j.unregister);a.b(\"components.defaultLoader\",a.j.Fc);a.j.loaders.push(a.j.Fc);a.j.dd=h})();(function(){function b(b,e){var f=b.getAttribute(\"params\");if(f){var f=c.parseBindingsString(f,e,b,{valueAccessors:!0,bindingParams:!0}),f=a.a.Ga(f,function(c){return a.o(c,null,{l:b})}),g=a.a.Ga(f,\nfunction(c){var e=c.v();return c.ja()?a.o({read:function(){return a.a.f(c())},write:a.Za(e)&&function(a){c()(a)},l:b}):e});Object.prototype.hasOwnProperty.call(g,\"$raw\")||(g.$raw=f);return g}return{$raw:{}}}a.j.getComponentNameForNode=function(b){var c=a.a.R(b);if(a.j.tb(c)&&(-1!=c.indexOf(\"-\")||\"[object HTMLUnknownElement]\"==\"\"+b||8>=a.a.W&&b.tagName===c))return c};a.j.tc=function(c,e,f,g){if(1===e.nodeType){var h=a.j.getComponentNameForNode(e);if(h){c=c||{};if(c.component)throw Error('Cannot use the \"component\" binding on a custom element matching a component');\nvar m={name:h,params:b(e,f)};c.component=g?function(){return m}:m}}return c};var c=new a.ga;9>a.a.W&&(a.j.register=function(a){return function(b){return a.apply(this,arguments)}}(a.j.register),w.createDocumentFragment=function(b){return function(){var c=b(),f=a.j.dd,g;for(g in f);return c}}(w.createDocumentFragment))})();(function(){function b(b,c,d){c=c.template;if(!c)throw Error(\"Component '\"+b+\"' has no template\");b=a.a.Ca(c);a.h.va(d,b)}function c(a,b,c){var d=a.createViewModel;return d?d.call(a,\nb,c):b}var d=0;a.c.component={init:function(e,f,g,h,m){function k(){var a=l&&l.dispose;\"function\"===typeof a&&a.call(l);q&&q.s();p=l=q=null}var l,p,q,t=a.a.la(a.h.childNodes(e));a.h.Ea(e);a.a.K.za(e,k);a.o(function(){var g=a.a.f(f()),h,u;\"string\"===typeof g?h=g:(h=a.a.f(g.name),u=a.a.f(g.params));if(!h)throw Error(\"No component name specified\");var n=a.i.Cb(e,m),z=p=++d;a.j.get(h,function(d){if(p===z){k();if(!d)throw Error(\"Unknown component '\"+h+\"'\");b(h,d,e);var f=c(d,u,{element:e,templateNodes:t});\nd=n.createChildContext(f,{extend:function(a){a.$component=f;a.$componentTemplateNodes=t}});f&&f.koDescendantsComplete&&(q=a.i.subscribe(e,a.i.pa,f.koDescendantsComplete,f));l=f;a.Oa(d,e)}})},null,{l:e});return{controlsDescendantBindings:!0}}};a.h.ea.component=!0})();var V={\"class\":\"className\",\"for\":\"htmlFor\"};a.c.attr={update:function(b,c){var d=a.a.f(c())||{};a.a.P(d,function(c,d){d=a.a.f(d);var g=c.indexOf(\":\"),g=\"lookupNamespaceURI\"in b&&0<g&&b.lookupNamespaceURI(c.substr(0,g)),h=!1===d||null===\nd||d===n;h?g?b.removeAttributeNS(g,c):b.removeAttribute(c):d=d.toString();8>=a.a.W&&c in V?(c=V[c],h?b.removeAttribute(c):b[c]=d):h||(g?b.setAttributeNS(g,c,d):b.setAttribute(c,d));\"name\"===c&&a.a.Yc(b,h?\"\":d)})}};(function(){a.c.checked={after:[\"value\",\"attr\"],init:function(b,c,d){function e(){var e=b.checked,f=g();if(!a.S.Ya()&&(e||!m&&!a.S.qa())){var k=a.u.G(c);if(l){var q=p?k.v():k,z=t;t=f;z!==f?e&&(a.a.Na(q,f,!0),a.a.Na(q,z,!1)):a.a.Na(q,f,e);p&&a.Za(k)&&k(q)}else h&&(f===n?f=e:e||(f=n)),a.m.eb(k,\nd,\"checked\",f,!0)}}function f(){var d=a.a.f(c()),e=g();l?(b.checked=0<=a.a.A(d,e),t=e):b.checked=h&&e===n?!!d:g()===d}var g=a.xb(function(){if(d.has(\"checkedValue\"))return a.a.f(d.get(\"checkedValue\"));if(q)return d.has(\"value\")?a.a.f(d.get(\"value\")):b.value}),h=\"checkbox\"==b.type,m=\"radio\"==b.type;if(h||m){var k=c(),l=h&&a.a.f(k)instanceof Array,p=!(l&&k.push&&k.splice),q=m||l,t=l?g():n;m&&!b.name&&a.c.uniqueName.init(b,function(){return!0});a.o(e,null,{l:b});a.a.B(b,\"click\",e);a.o(f,null,{l:b});\nk=n}}};a.m.wa.checked=!0;a.c.checkedValue={update:function(b,c){b.value=a.a.f(c())}}})();a.c[\"class\"]={update:function(b,c){var d=a.a.Db(a.a.f(c()));a.a.Eb(b,b.__ko__cssValue,!1);b.__ko__cssValue=d;a.a.Eb(b,d,!0)}};a.c.css={update:function(b,c){var d=a.a.f(c());null!==d&&\"object\"==typeof d?a.a.P(d,function(c,d){d=a.a.f(d);a.a.Eb(b,c,d)}):a.c[\"class\"].update(b,c)}};a.c.enable={update:function(b,c){var d=a.a.f(c());d&&b.disabled?b.removeAttribute(\"disabled\"):d||b.disabled||(b.disabled=!0)}};a.c.disable=\n{update:function(b,c){a.c.enable.update(b,function(){return!a.a.f(c())})}};a.c.event={init:function(b,c,d,e,f){var g=c()||{};a.a.P(g,function(g){\"string\"==typeof g&&a.a.B(b,g,function(b){var k,l=c()[g];if(l){try{var p=a.a.la(arguments);e=f.$data;p.unshift(e);k=l.apply(e,p)}finally{!0!==k&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}!1===d.get(g+\"Bubble\")&&(b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation())}})})}};a.c.foreach={Rc:function(b){return function(){var c=b(),d=a.a.bc(c);\nif(!d||\"number\"==typeof d.length)return{foreach:c,templateEngine:a.ba.Ma};a.a.f(c);return{foreach:d.data,as:d.as,noChildContext:d.noChildContext,includeDestroyed:d.includeDestroyed,afterAdd:d.afterAdd,beforeRemove:d.beforeRemove,afterRender:d.afterRender,beforeMove:d.beforeMove,afterMove:d.afterMove,templateEngine:a.ba.Ma}}},init:function(b,c){return a.c.template.init(b,a.c.foreach.Rc(c))},update:function(b,c,d,e,f){return a.c.template.update(b,a.c.foreach.Rc(c),d,e,f)}};a.m.Ra.foreach=!1;a.h.ea.foreach=\n!0;a.c.hasfocus={init:function(b,c,d){function e(e){b.__ko_hasfocusUpdating=!0;var f=b.ownerDocument;if(\"activeElement\"in f){var g;try{g=f.activeElement}catch(l){g=f.body}e=g===b}f=c();a.m.eb(f,d,\"hasfocus\",e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var f=e.bind(null,!0),g=e.bind(null,!1);a.a.B(b,\"focus\",f);a.a.B(b,\"focusin\",f);a.a.B(b,\"blur\",g);a.a.B(b,\"focusout\",g);b.__ko_hasfocusLastValue=!1},update:function(b,c){var d=!!a.a.f(c());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===\nd||(d?b.focus():b.blur(),!d&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),a.u.G(a.a.Fb,null,[b,d?\"focusin\":\"focusout\"]))}};a.m.wa.hasfocus=!0;a.c.hasFocus=a.c.hasfocus;a.m.wa.hasFocus=\"hasfocus\";a.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.fc(b,c())}};(function(){function b(b,d,e){a.c[b]={init:function(b,c,h,m,k){var l,p,q={},t,x,n;if(d){m=h.get(\"as\");var u=h.get(\"noChildContext\");n=!(m&&u);q={as:m,noChildContext:u,exportDependencies:n}}x=(t=\n\"render\"==h.get(\"completeOn\"))||h.has(a.i.pa);a.o(function(){var h=a.a.f(c()),m=!e!==!h,u=!p,r;if(n||m!==l){x&&(k=a.i.Cb(b,k));if(m){if(!d||n)q.dataDependency=a.S.o();r=d?k.createChildContext(\"function\"==typeof h?h:c,q):a.S.qa()?k.extend(null,q):k}u&&a.S.qa()&&(p=a.a.Ca(a.h.childNodes(b),!0));m?(u||a.h.va(b,a.a.Ca(p)),a.Oa(r,b)):(a.h.Ea(b),t||a.i.ma(b,a.i.H));l=m}},null,{l:b});return{controlsDescendantBindings:!0}}};a.m.Ra[b]=!1;a.h.ea[b]=!0}b(\"if\");b(\"ifnot\",!1,!0);b(\"with\",!0)})();a.c.let={init:function(b,\nc,d,e,f){c=f.extend(c);a.Oa(c,b);return{controlsDescendantBindings:!0}}};a.h.ea.let=!0;var Q={};a.c.options={init:function(b){if(\"select\"!==a.a.R(b))throw Error(\"options binding applies only to SELECT elements\");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,c,d){function e(){return a.a.jb(b.options,function(a){return a.selected})}function f(a,b,c){var d=typeof b;return\"function\"==d?b(a):\"string\"==d?a[b]:c}function g(c,d){if(x&&l)a.i.ma(b,a.i.H);else if(t.length){var e=\n0<=a.a.A(t,a.w.M(d[0]));a.a.Zc(d[0],e);x&&!e&&a.u.G(a.a.Fb,null,[b,\"change\"])}}var h=b.multiple,m=0!=b.length&&h?b.scrollTop:null,k=a.a.f(c()),l=d.get(\"valueAllowUnset\")&&d.has(\"value\"),p=d.get(\"optionsIncludeDestroyed\");c={};var q,t=[];l||(h?t=a.a.Mb(e(),a.w.M):0<=b.selectedIndex&&t.push(a.w.M(b.options[b.selectedIndex])));k&&(\"undefined\"==typeof k.length&&(k=[k]),q=a.a.jb(k,function(b){return p||b===n||null===b||!a.a.f(b._destroy)}),d.has(\"optionsCaption\")&&(k=a.a.f(d.get(\"optionsCaption\")),null!==\nk&&k!==n&&q.unshift(Q)));var x=!1;c.beforeRemove=function(a){b.removeChild(a)};k=g;d.has(\"optionsAfterRender\")&&\"function\"==typeof d.get(\"optionsAfterRender\")&&(k=function(b,c){g(0,c);a.u.G(d.get(\"optionsAfterRender\"),null,[c[0],b!==Q?b:n])});a.a.ec(b,q,function(c,e,g){g.length&&(t=!l&&g[0].selected?[a.w.M(g[0])]:[],x=!0);e=b.ownerDocument.createElement(\"option\");c===Q?(a.a.Bb(e,d.get(\"optionsCaption\")),a.w.cb(e,n)):(g=f(c,d.get(\"optionsValue\"),c),a.w.cb(e,a.a.f(g)),c=f(c,d.get(\"optionsText\"),g),\na.a.Bb(e,c));return[e]},c,k);if(!l){var B;h?B=t.length&&e().length<t.length:B=t.length&&0<=b.selectedIndex?a.w.M(b.options[b.selectedIndex])!==t[0]:t.length||0<=b.selectedIndex;B&&a.u.G(a.a.Fb,null,[b,\"change\"])}(l||a.S.Ya())&&a.i.ma(b,a.i.H);a.a.wd(b);m&&20<Math.abs(m-b.scrollTop)&&(b.scrollTop=m)}};a.c.options.$b=a.a.g.Z();a.c.selectedOptions={init:function(b,c,d){function e(){var e=c(),f=[];a.a.D(b.getElementsByTagName(\"option\"),function(b){b.selected&&f.push(a.w.M(b))});a.m.eb(e,d,\"selectedOptions\",\nf)}function f(){var d=a.a.f(c()),e=b.scrollTop;d&&\"number\"==typeof d.length&&a.a.D(b.getElementsByTagName(\"option\"),function(b){var c=0<=a.a.A(d,a.w.M(b));b.selected!=c&&a.a.Zc(b,c)});b.scrollTop=e}if(\"select\"!=a.a.R(b))throw Error(\"selectedOptions binding applies only to SELECT elements\");var g;a.i.subscribe(b,a.i.H,function(){g?e():(a.a.B(b,\"change\",e),g=a.o(f,null,{l:b}))},null,{notifyImmediately:!0})},update:function(){}};a.m.wa.selectedOptions=!0;a.c.style={update:function(b,c){var d=a.a.f(c()||\n{});a.a.P(d,function(c,d){d=a.a.f(d);if(null===d||d===n||!1===d)d=\"\";if(v)v(b).css(c,d);else if(/^--/.test(c))b.style.setProperty(c,d);else{c=c.replace(/-(\\w)/g,function(a,b){return b.toUpperCase()});var g=b.style[c];b.style[c]=d;d===g||b.style[c]!=g||isNaN(d)||(b.style[c]=d+\"px\")}})}};a.c.submit={init:function(b,c,d,e,f){if(\"function\"!=typeof c())throw Error(\"The value for a submit binding must be a function\");a.a.B(b,\"submit\",function(a){var d,e=c();try{d=e.call(f.$data,b)}finally{!0!==d&&(a.preventDefault?\na.preventDefault():a.returnValue=!1)}})}};a.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Bb(b,c())}};a.h.ea.text=!0;(function(){if(A&&A.navigator){var b=function(a){if(a)return parseFloat(a[1])},c=A.navigator.userAgent,d,e,f,g,h;(d=A.opera&&A.opera.version&&parseInt(A.opera.version()))||(h=b(c.match(/Edge\\/([^ ]+)$/)))||b(c.match(/Chrome\\/([^ ]+)/))||(e=b(c.match(/Version\\/([^ ]+) Safari/)))||(f=b(c.match(/Firefox\\/([^ ]+)/)))||(g=a.a.W||b(c.match(/MSIE ([^ ]+)/)))||\n(g=b(c.match(/rv:([^ )]+)/)))}if(8<=g&&10>g)var m=a.a.g.Z(),k=a.a.g.Z(),l=function(b){var c=this.activeElement;(c=c&&a.a.g.get(c,k))&&c(b)},p=function(b,c){var d=b.ownerDocument;a.a.g.get(d,m)||(a.a.g.set(d,m,!0),a.a.B(d,\"selectionchange\",l));a.a.g.set(b,k,c)};a.c.textInput={init:function(b,c,k){function l(c,d){a.a.B(b,c,d)}function m(){var d=a.a.f(c());if(null===d||d===n)d=\"\";L!==n&&d===L?a.a.setTimeout(m,4):b.value!==d&&(y=!0,b.value=d,y=!1,v=b.value)}function r(){w||(L=b.value,w=a.a.setTimeout(z,\n4))}function z(){clearTimeout(w);L=w=n;var d=b.value;v!==d&&(v=d,a.m.eb(c(),k,\"textInput\",d))}var v=b.value,w,L,A=9==a.a.W?r:z,y=!1;g&&l(\"keypress\",z);11>g&&l(\"propertychange\",function(a){y||\"value\"!==a.propertyName||A(a)});8==g&&(l(\"keyup\",z),l(\"keydown\",z));p&&(p(b,A),l(\"dragend\",r));(!g||9<=g)&&l(\"input\",A);5>e&&\"textarea\"===a.a.R(b)?(l(\"keydown\",r),l(\"paste\",r),l(\"cut\",r)):11>d?l(\"keydown\",r):4>f?(l(\"DOMAutoComplete\",z),l(\"dragdrop\",z),l(\"drop\",z)):h&&\"number\"===b.type&&l(\"keydown\",r);l(\"change\",\nz);l(\"blur\",z);a.o(m,null,{l:b})}};a.m.wa.textInput=!0;a.c.textinput={preprocess:function(a,b,c){c(\"textInput\",a)}}})();a.c.uniqueName={init:function(b,c){if(c()){var d=\"ko_unique_\"+ ++a.c.uniqueName.rd;a.a.Yc(b,d)}}};a.c.uniqueName.rd=0;a.c.using={init:function(b,c,d,e,f){var g;d.has(\"as\")&&(g={as:d.get(\"as\"),noChildContext:d.get(\"noChildContext\")});c=f.createChildContext(c,g);a.Oa(c,b);return{controlsDescendantBindings:!0}}};a.h.ea.using=!0;a.c.value={init:function(b,c,d){var e=a.a.R(b),f=\"input\"==\ne;if(!f||\"checkbox\"!=b.type&&\"radio\"!=b.type){var g=[],h=d.get(\"valueUpdate\"),m=!1,k=null;h&&(\"string\"==typeof h?g=[h]:g=a.a.wc(h),a.a.Pa(g,\"change\"));var l=function(){k=null;m=!1;var e=c(),f=a.w.M(b);a.m.eb(e,d,\"value\",f)};!a.a.W||!f||\"text\"!=b.type||\"off\"==b.autocomplete||b.form&&\"off\"==b.form.autocomplete||-1!=a.a.A(g,\"propertychange\")||(a.a.B(b,\"propertychange\",function(){m=!0}),a.a.B(b,\"focus\",function(){m=!1}),a.a.B(b,\"blur\",function(){m&&l()}));a.a.D(g,function(c){var d=l;a.a.Ud(c,\"after\")&&\n(d=function(){k=a.w.M(b);a.a.setTimeout(l,0)},c=c.substring(5));a.a.B(b,c,d)});var p;p=f&&\"file\"==b.type?function(){var d=a.a.f(c());null===d||d===n||\"\"===d?b.value=\"\":a.u.G(l)}:function(){var f=a.a.f(c()),g=a.w.M(b);if(null!==k&&f===k)a.a.setTimeout(p,0);else if(f!==g||g===n)\"select\"===e?(g=d.get(\"valueAllowUnset\"),a.w.cb(b,f,g),g||f===a.w.M(b)||a.u.G(l)):a.w.cb(b,f)};if(\"select\"===e){var q;a.i.subscribe(b,a.i.H,function(){q?d.get(\"valueAllowUnset\")?p():l():(a.a.B(b,\"change\",l),q=a.o(p,null,{l:b}))},\nnull,{notifyImmediately:!0})}else a.a.B(b,\"change\",l),a.o(p,null,{l:b})}else a.ib(b,{checkedValue:c})},update:function(){}};a.m.wa.value=!0;a.c.visible={update:function(b,c){var d=a.a.f(c()),e=\"none\"!=b.style.display;d&&!e?b.style.display=\"\":!d&&e&&(b.style.display=\"none\")}};a.c.hidden={update:function(b,c){a.c.visible.update(b,function(){return!a.a.f(c())})}};(function(b){a.c[b]={init:function(c,d,e,f,g){return a.c.event.init.call(this,c,function(){var a={};a[b]=d();return a},e,f,g)}}})(\"click\");\na.ca=function(){};a.ca.prototype.renderTemplateSource=function(){throw Error(\"Override renderTemplateSource\");};a.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error(\"Override createJavaScriptEvaluatorBlock\");};a.ca.prototype.makeTemplateSource=function(b,c){if(\"string\"==typeof b){c=c||w;var d=c.getElementById(b);if(!d)throw Error(\"Cannot find template with ID \"+b);return new a.C.F(d)}if(1==b.nodeType||8==b.nodeType)return new a.C.ia(b);throw Error(\"Unknown template type: \"+b);};a.ca.prototype.renderTemplate=\nfunction(a,c,d,e){a=this.makeTemplateSource(a,e);return this.renderTemplateSource(a,c,d,e)};a.ca.prototype.isTemplateRewritten=function(a,c){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,c).data(\"isRewritten\")};a.ca.prototype.rewriteTemplate=function(a,c,d){a=this.makeTemplateSource(a,d);c=c(a.text());a.text(c);a.data(\"isRewritten\",!0)};a.b(\"templateEngine\",a.ca);a.kc=function(){function b(b,c,d,h){b=a.m.ac(b);for(var m=a.m.Ra,k=0;k<b.length;k++){var l=b[k].key;if(Object.prototype.hasOwnProperty.call(m,\nl)){var p=m[l];if(\"function\"===typeof p){if(l=p(b[k].value))throw Error(l);}else if(!p)throw Error(\"This template engine does not support the '\"+l+\"' binding within its templates\");}}d=\"ko.__tr_ambtns(function($context,$element){return(function(){return{ \"+a.m.vb(b,{valueAccessors:!0})+\" } })()},'\"+d.toLowerCase()+\"')\";return h.createJavaScriptEvaluatorBlock(d)+c}var c=/(<([a-z]+\\d*)(?:\\s+(?!data-bind\\s*=\\s*)[a-z0-9\\-]+(?:=(?:\\\"[^\\\"]*\\\"|\\'[^\\']*\\'|[^>]*))?)*\\s+)data-bind\\s*=\\s*([\"'])([\\s\\S]*?)\\3/gi,\nd=/\\x3c!--\\s*ko\\b\\s*([\\s\\S]*?)\\s*--\\x3e/g;return{xd:function(b,c,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.kc.Ld(b,c)},d)},Ld:function(a,f){return a.replace(c,function(a,c,d,e,l){return b(l,c,d,f)}).replace(d,function(a,c){return b(c,\"\\x3c!-- ko --\\x3e\",\"#comment\",f)})},md:function(b,c){return a.aa.Xb(function(d,h){var m=d.nextSibling;m&&m.nodeName.toLowerCase()===c&&a.ib(m,b,h)})}}}();a.b(\"__tr_ambtns\",a.kc.md);(function(){a.C={};a.C.F=function(b){if(this.F=b){var c=\na.a.R(b);this.ab=\"script\"===c?1:\"textarea\"===c?2:\"template\"==c&&b.content&&11===b.content.nodeType?3:4}};a.C.F.prototype.text=function(){var b=1===this.ab?\"text\":2===this.ab?\"value\":\"innerHTML\";if(0==arguments.length)return this.F[b];var c=arguments[0];\"innerHTML\"===b?a.a.fc(this.F,c):this.F[b]=c};var b=a.a.g.Z()+\"_\";a.C.F.prototype.data=function(c){if(1===arguments.length)return a.a.g.get(this.F,b+c);a.a.g.set(this.F,b+c,arguments[1])};var c=a.a.g.Z();a.C.F.prototype.nodes=function(){var b=this.F;\nif(0==arguments.length){var e=a.a.g.get(b,c)||{},f=e.lb||(3===this.ab?b.content:4===this.ab?b:n);if(!f||e.jd){var g=this.text();g&&g!==e.bb&&(f=a.a.Md(g,b.ownerDocument),a.a.g.set(b,c,{lb:f,bb:g,jd:!0}))}return f}e=arguments[0];this.ab!==n&&this.text(\"\");a.a.g.set(b,c,{lb:e})};a.C.ia=function(a){this.F=a};a.C.ia.prototype=new a.C.F;a.C.ia.prototype.constructor=a.C.ia;a.C.ia.prototype.text=function(){if(0==arguments.length){var b=a.a.g.get(this.F,c)||{};b.bb===n&&b.lb&&(b.bb=b.lb.innerHTML);return b.bb}a.a.g.set(this.F,\nc,{bb:arguments[0]})};a.b(\"templateSources\",a.C);a.b(\"templateSources.domElement\",a.C.F);a.b(\"templateSources.anonymousTemplate\",a.C.ia)})();(function(){function b(b,c,d){var e;for(c=a.h.nextSibling(c);b&&(e=b)!==c;)b=a.h.nextSibling(e),d(e,b)}function c(c,d){if(c.length){var e=c[0],f=c[c.length-1],g=e.parentNode,h=a.ga.instance,m=h.preprocessNode;if(m){b(e,f,function(a,b){var c=a.previousSibling,d=m.call(h,a);d&&(a===e&&(e=d[0]||b),a===f&&(f=d[d.length-1]||c))});c.length=0;if(!e)return;e===f?c.push(e):\n(c.push(e,f),a.a.Ua(c,g))}b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.vc(d,b)});b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.aa.cd(b,[d])});a.a.Ua(c,g)}}function d(a){return a.nodeType?a:0<a.length?a[0]:null}function e(b,e,f,h,m){m=m||{};var n=(b&&d(b)||f||{}).ownerDocument,B=m.templateEngine||g;a.kc.xd(f,B,n);f=B.renderTemplate(f,h,m,n);if(\"number\"!=typeof f.length||0<f.length&&\"number\"!=typeof f[0].nodeType)throw Error(\"Template engine must return an array of DOM nodes\");n=!1;switch(e){case \"replaceChildren\":a.h.va(b,\nf);n=!0;break;case \"replaceNode\":a.a.Xc(b,f);n=!0;break;case \"ignoreTargetNode\":break;default:throw Error(\"Unknown renderMode: \"+e);}n&&(c(f,h),m.afterRender&&a.u.G(m.afterRender,null,[f,h[m.as||\"$data\"]]),\"replaceChildren\"==e&&a.i.ma(b,a.i.H));return f}function f(b,c,d){return a.O(b)?b():\"function\"===typeof b?b(c,d):b}var g;a.gc=function(b){if(b!=n&&!(b instanceof a.ca))throw Error(\"templateEngine must inherit from ko.templateEngine\");g=b};a.dc=function(b,c,h,m,t){h=h||{};if((h.templateEngine||g)==\nn)throw Error(\"Set a template engine before calling renderTemplate\");t=t||\"replaceChildren\";if(m){var x=d(m);return a.$(function(){var g=c&&c instanceof a.fa?c:new a.fa(c,null,null,null,{exportDependencies:!0}),n=f(b,g.$data,g),g=e(m,t,n,g,h);\"replaceNode\"==t&&(m=g,x=d(m))},null,{Sa:function(){return!x||!a.a.Sb(x)},l:x&&\"replaceNode\"==t?x.parentNode:x})}return a.aa.Xb(function(d){a.dc(b,c,h,d,\"replaceNode\")})};a.Qd=function(b,d,g,h,m){function x(b,c){a.u.G(a.a.ec,null,[h,b,u,g,r,c]);a.i.ma(h,a.i.H)}\nfunction r(a,b){c(b,v);g.afterRender&&g.afterRender(b,a);v=null}function u(a,c){v=m.createChildContext(a,{as:z,noChildContext:g.noChildContext,extend:function(a){a.$index=c;z&&(a[z+\"Index\"]=c)}});var d=f(b,a,v);return e(h,\"ignoreTargetNode\",d,v,g)}var v,z=g.as,w=!1===g.includeDestroyed||a.options.foreachHidesDestroyed&&!g.includeDestroyed;if(w||g.beforeRemove||!a.Pc(d))return a.$(function(){var b=a.a.f(d)||[];\"undefined\"==typeof b.length&&(b=[b]);w&&(b=a.a.jb(b,function(b){return b===n||null===b||\n!a.a.f(b._destroy)}));x(b)},null,{l:h});x(d.v());var A=d.subscribe(function(a){x(d(),a)},null,\"arrayChange\");A.l(h);return A};var h=a.a.g.Z(),m=a.a.g.Z();a.c.template={init:function(b,c){var d=a.a.f(c());if(\"string\"==typeof d||\"name\"in d)a.h.Ea(b);else if(\"nodes\"in d){d=d.nodes||[];if(a.O(d))throw Error('The \"nodes\" option must be a plain, non-observable array.');var e=d[0]&&d[0].parentNode;e&&a.a.g.get(e,m)||(e=a.a.Yb(d),a.a.g.set(e,m,!0));(new a.C.ia(b)).nodes(e)}else if(d=a.h.childNodes(b),0<d.length)e=\na.a.Yb(d),(new a.C.ia(b)).nodes(e);else throw Error(\"Anonymous template defined, but no template content was provided\");return{controlsDescendantBindings:!0}},update:function(b,c,d,e,f){var g=c();c=a.a.f(g);d=!0;e=null;\"string\"==typeof c?c={}:(g=\"name\"in c?c.name:b,\"if\"in c&&(d=a.a.f(c[\"if\"])),d&&\"ifnot\"in c&&(d=!a.a.f(c.ifnot)),d&&!g&&(d=!1));\"foreach\"in c?e=a.Qd(g,d&&c.foreach||[],c,b,f):d?(d=f,\"data\"in c&&(d=f.createChildContext(c.data,{as:c.as,noChildContext:c.noChildContext,exportDependencies:!0})),\ne=a.dc(g,d,c,b)):a.h.Ea(b);f=e;(c=a.a.g.get(b,h))&&\"function\"==typeof c.s&&c.s();a.a.g.set(b,h,!f||f.ja&&!f.ja()?n:f)}};a.m.Ra.template=function(b){b=a.m.ac(b);return 1==b.length&&b[0].unknown||a.m.Id(b,\"name\")?null:\"This template engine does not support anonymous templates nested within its templates\"};a.h.ea.template=!0})();a.b(\"setTemplateEngine\",a.gc);a.b(\"renderTemplate\",a.dc);a.a.Kc=function(a,c,d){if(a.length&&c.length){var e,f,g,h,m;for(e=f=0;(!d||e<d)&&(h=a[f]);++f){for(g=0;m=c[g];++g)if(h.value===\nm.value){h.moved=m.index;m.moved=h.index;c.splice(g,1);e=g=0;break}e+=g}}};a.a.Pb=function(){function b(b,d,e,f,g){var h=Math.min,m=Math.max,k=[],l,p=b.length,q,n=d.length,r=n-p||1,v=p+n+1,u,w,z;for(l=0;l<=p;l++)for(w=u,k.push(u=[]),z=h(n,l+r),q=m(0,l-1);q<=z;q++)u[q]=q?l?b[l-1]===d[q-1]?w[q-1]:h(w[q]||v,u[q-1]||v)+1:q+1:l+1;h=[];m=[];r=[];l=p;for(q=n;l||q;)n=k[l][q]-1,q&&n===k[l][q-1]?m.push(h[h.length]={status:e,value:d[--q],index:q}):l&&n===k[l-1][q]?r.push(h[h.length]={status:f,value:b[--l],index:l}):\n(--q,--l,g.sparse||h.push({status:\"retained\",value:d[q]}));a.a.Kc(r,m,!g.dontLimitMoves&&10*p);return h.reverse()}return function(a,d,e){e=\"boolean\"===typeof e?{dontLimitMoves:e}:e||{};a=a||[];d=d||[];return a.length<d.length?b(a,d,\"added\",\"deleted\",e):b(d,a,\"deleted\",\"added\",e)}}();a.b(\"utils.compareArrays\",a.a.Pb);(function(){function b(b,c,d,h,m){var k=[],l=a.$(function(){var l=c(d,m,a.a.Ua(k,b))||[];0<k.length&&(a.a.Xc(k,l),h&&a.u.G(h,null,[d,l,m]));k.length=0;a.a.Nb(k,l)},null,{l:b,Sa:function(){return!a.a.kd(k)}});\nreturn{Y:k,$:l.ja()?l:n}}var c=a.a.g.Z(),d=a.a.g.Z();a.a.ec=function(e,f,g,h,m,k){function l(b){y={Aa:b,pb:a.ta(w++)};v.push(y);r||F.push(y)}function p(b){y=t[b];w!==y.pb.v()&&D.push(y);y.pb(w++);a.a.Ua(y.Y,e);v.push(y)}function q(b,c){if(b)for(var d=0,e=c.length;d<e;d++)a.a.D(c[d].Y,function(a){b(a,d,c[d].Aa)})}f=f||[];\"undefined\"==typeof f.length&&(f=[f]);h=h||{};var t=a.a.g.get(e,c),r=!t,v=[],u=0,w=0,z=[],A=[],C=[],D=[],F=[],y,I=0;if(r)a.a.D(f,l);else{if(!k||t&&t._countWaitingForRemove){var E=\na.a.Mb(t,function(a){return a.Aa});k=a.a.Pb(E,f,{dontLimitMoves:h.dontLimitMoves,sparse:!0})}for(var E=0,G,H,K;G=k[E];E++)switch(H=G.moved,K=G.index,G.status){case \"deleted\":for(;u<K;)p(u++);H===n&&(y=t[u],y.$&&(y.$.s(),y.$=n),a.a.Ua(y.Y,e).length&&(h.beforeRemove&&(v.push(y),I++,y.Aa===d?y=null:C.push(y)),y&&z.push.apply(z,y.Y)));u++;break;case \"added\":for(;w<K;)p(u++);H!==n?(A.push(v.length),p(H)):l(G.value)}for(;w<f.length;)p(u++);v._countWaitingForRemove=I}a.a.g.set(e,c,v);q(h.beforeMove,D);a.a.D(z,\nh.beforeRemove?a.oa:a.removeNode);var M,O,P;try{P=e.ownerDocument.activeElement}catch(N){}if(A.length)for(;(E=A.shift())!=n;){y=v[E];for(M=n;E;)if((O=v[--E].Y)&&O.length){M=O[O.length-1];break}for(f=0;u=y.Y[f];M=u,f++)a.h.Wb(e,u,M)}for(E=0;y=v[E];E++){y.Y||a.a.extend(y,b(e,g,y.Aa,m,y.pb));for(f=0;u=y.Y[f];M=u,f++)a.h.Wb(e,u,M);!y.Ed&&m&&(m(y.Aa,y.Y,y.pb),y.Ed=!0,M=y.Y[y.Y.length-1])}P&&e.ownerDocument.activeElement!=P&&P.focus();q(h.beforeRemove,C);for(E=0;E<C.length;++E)C[E].Aa=d;q(h.afterMove,D);\nq(h.afterAdd,F)}})();a.b(\"utils.setDomNodeChildrenFromArrayMapping\",a.a.ec);a.ba=function(){this.allowTemplateRewriting=!1};a.ba.prototype=new a.ca;a.ba.prototype.constructor=a.ba;a.ba.prototype.renderTemplateSource=function(b,c,d,e){if(c=(9>a.a.W?0:b.nodes)?b.nodes():null)return a.a.la(c.cloneNode(!0).childNodes);b=b.text();return a.a.ua(b,e)};a.ba.Ma=new a.ba;a.gc(a.ba.Ma);a.b(\"nativeTemplateEngine\",a.ba);(function(){a.$a=function(){var a=this.Hd=function(){if(!v||!v.tmpl)return 0;try{if(0<=v.tmpl.tag.tmpl.open.toString().indexOf(\"__\"))return 2}catch(a){}return 1}();\nthis.renderTemplateSource=function(b,e,f,g){g=g||w;f=f||{};if(2>a)throw Error(\"Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.\");var h=b.data(\"precompiled\");h||(h=b.text()||\"\",h=v.template(null,\"{{ko_with $item.koBindingContext}}\"+h+\"{{/ko_with}}\"),b.data(\"precompiled\",h));b=[e.$data];e=v.extend({koBindingContext:e},f.templateOptions);e=v.tmpl(h,b,e);e.appendTo(g.createElement(\"div\"));v.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return\"{{ko_code ((function() { return \"+\na+\" })()) }}\"};this.addTemplate=function(a,b){w.write(\"<script type='text/html' id='\"+a+\"'>\"+b+\"\\x3c/script>\")};0<a&&(v.tmpl.tag.ko_code={open:\"__.push($1 || '');\"},v.tmpl.tag.ko_with={open:\"with($1) {\",close:\"} \"})};a.$a.prototype=new a.ca;a.$a.prototype.constructor=a.$a;var b=new a.$a;0<b.Hd&&a.gc(b);a.b(\"jqueryTmplTemplateEngine\",a.$a)})()})})();})();\n\n\n//# sourceURL=webpack://domino/./node_modules/knockout/build/output/knockout-latest.js?");

/***/ }),

/***/ "./src/styles/apexcharts.css":
/*!***********************************!*\
  !*** ./src/styles/apexcharts.css ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/apexcharts.css?");

/***/ }),

/***/ "./src/styles/awesome-bootstrap-checkbox.css":
/*!***************************************************!*\
  !*** ./src/styles/awesome-bootstrap-checkbox.css ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/awesome-bootstrap-checkbox.css?");

/***/ }),

/***/ "./src/styles/bootstrap-rtl.css":
/*!**************************************!*\
  !*** ./src/styles/bootstrap-rtl.css ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/bootstrap-rtl.css?");

/***/ }),

/***/ "./src/styles/bootstrap.css":
/*!**********************************!*\
  !*** ./src/styles/bootstrap.css ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/bootstrap.css?");

/***/ }),

/***/ "./src/styles/components/autocomplete.css":
/*!************************************************!*\
  !*** ./src/styles/components/autocomplete.css ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/components/autocomplete.css?");

/***/ }),

/***/ "./src/styles/components/chart.css":
/*!*****************************************!*\
  !*** ./src/styles/components/chart.css ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/components/chart.css?");

/***/ }),

/***/ "./src/styles/components/datepicker.css":
/*!**********************************************!*\
  !*** ./src/styles/components/datepicker.css ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/components/datepicker.css?");

/***/ }),

/***/ "./src/styles/components/fontSelector.css":
/*!************************************************!*\
  !*** ./src/styles/components/fontSelector.css ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/components/fontSelector.css?");

/***/ }),

/***/ "./src/styles/components/formulamaker.css":
/*!************************************************!*\
  !*** ./src/styles/components/formulamaker.css ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/components/formulamaker.css?");

/***/ }),

/***/ "./src/styles/components/jqtreeView.css":
/*!**********************************************!*\
  !*** ./src/styles/components/jqtreeView.css ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/components/jqtreeView.css?");

/***/ }),

/***/ "./src/styles/components/jsRuler.css":
/*!*******************************************!*\
  !*** ./src/styles/components/jsRuler.css ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/components/jsRuler.css?");

/***/ }),

/***/ "./src/styles/components/rg.css":
/*!**************************************!*\
  !*** ./src/styles/components/rg.css ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/components/rg.css?");

/***/ }),

/***/ "./src/styles/components/richtexteditor.css":
/*!**************************************************!*\
  !*** ./src/styles/components/richtexteditor.css ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/components/richtexteditor.css?");

/***/ }),

/***/ "./src/styles/components/select.css":
/*!******************************************!*\
  !*** ./src/styles/components/select.css ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/components/select.css?");

/***/ }),

/***/ "./src/styles/components/stepbar.css":
/*!*******************************************!*\
  !*** ./src/styles/components/stepbar.css ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/components/stepbar.css?");

/***/ }),

/***/ "./src/styles/components/tabletreeview.css":
/*!*************************************************!*\
  !*** ./src/styles/components/tabletreeview.css ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/components/tabletreeview.css?");

/***/ }),

/***/ "./src/styles/evol-colorpicker.css":
/*!*****************************************!*\
  !*** ./src/styles/evol-colorpicker.css ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/evol-colorpicker.css?");

/***/ }),

/***/ "./src/styles/fonts-fa.css":
/*!*********************************!*\
  !*** ./src/styles/fonts-fa.css ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/fonts-fa.css?");

/***/ }),

/***/ "./src/styles/fonts-icon.css":
/*!***********************************!*\
  !*** ./src/styles/fonts-icon.css ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/fonts-icon.css?");

/***/ }),

/***/ "./src/styles/jquery-ui.min.css":
/*!**************************************!*\
  !*** ./src/styles/jquery-ui.min.css ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/jquery-ui.min.css?");

/***/ }),

/***/ "./src/styles/jquery.bootstrap-touchspin.min.css":
/*!*******************************************************!*\
  !*** ./src/styles/jquery.bootstrap-touchspin.min.css ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/jquery.bootstrap-touchspin.min.css?");

/***/ }),

/***/ "./src/styles/knockout.contextmenu.css":
/*!*********************************************!*\
  !*** ./src/styles/knockout.contextmenu.css ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/knockout.contextmenu.css?");

/***/ }),

/***/ "./src/styles/main-rtl.css":
/*!*********************************!*\
  !*** ./src/styles/main-rtl.css ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/main-rtl.css?");

/***/ }),

/***/ "./src/styles/main.css":
/*!*****************************!*\
  !*** ./src/styles/main.css ***!
  \*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/main.css?");

/***/ }),

/***/ "./src/styles/mt-contextmenu.css":
/*!***************************************!*\
  !*** ./src/styles/mt-contextmenu.css ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/mt-contextmenu.css?");

/***/ }),

/***/ "./src/styles/nprogress.css":
/*!**********************************!*\
  !*** ./src/styles/nprogress.css ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/nprogress.css?");

/***/ }),

/***/ "./src/styles/prwreport.css":
/*!**********************************!*\
  !*** ./src/styles/prwreport.css ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/prwreport.css?");

/***/ }),

/***/ "./src/styles/style.css":
/*!******************************!*\
  !*** ./src/styles/style.css ***!
  \******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/style.css?");

/***/ }),

/***/ "./src/styles/toastr.min.css":
/*!***********************************!*\
  !*** ./src/styles/toastr.min.css ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/toastr.min.css?");

/***/ }),

/***/ "./src/styles/toggleswitch.css":
/*!*************************************!*\
  !*** ./src/styles/toggleswitch.css ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://domino/./src/styles/toggleswitch.css?");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/amd define */
/******/ 	(() => {
/******/ 		__webpack_require__.amdD = function () {
/******/ 			throw new Error('define cannot be used indirect');
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module is referenced by other modules so it can't be inlined
/******/ 	__webpack_require__("./src/scripts/vendors/jquery-ui.min.js");
/******/ 	__webpack_require__("./src/scripts/vendors/json2.js");
/******/ 	__webpack_require__("./src/scripts/util/bindingHandlers.js");
/******/ 	__webpack_require__("./src/scripts/util/validationRules.js");
/******/ 	__webpack_require__("./src/scripts/vendors/knockout.sortable.js");
/******/ 	__webpack_require__("./src/scripts/vendors/knockout.contextmenu.js");
/******/ 	__webpack_require__("./src/scripts/vendors/jquery.bootstrap-touchspin.min.js");
/******/ 	__webpack_require__("./src/scripts/vendors/jquery.maskedinput.min.js");
/******/ 	__webpack_require__("./src/scripts/vendors/big.js");
/******/ 	__webpack_require__("./src/scripts/vendors/nprogress.js");
/******/ 	__webpack_require__("./src/scripts/vendors/toastr.js");
/******/ 	__webpack_require__("./src/scripts/vendors/xTimeAgo.js");
/******/ 	__webpack_require__("./src/scripts/util/helper.js");
/******/ 	__webpack_require__("./src/scripts/util/htmlHelper.js");
/******/ 	__webpack_require__("./src/scripts/util/keyboardHandler.js");
/******/ 	__webpack_require__("./src/scripts/util/toast.js");
/******/ 	__webpack_require__("./src/scripts/util/pasteDataFormatter.js");
/******/ 	__webpack_require__("./src/scripts/util/comparator.js");
/******/ 	__webpack_require__("./src/scripts/util/commonResources.js");
/******/ 	__webpack_require__("./src/scripts/pages/master/apiMessages.js");
/******/ 	__webpack_require__("./src/scripts/pages/master/cmdMessages.js");
/******/ 	__webpack_require__("./src/scripts/pages/master/phraseTranslator.js");
/******/ 	var __webpack_exports__ = __webpack_require__("./src/scripts/appConfig.js");
/******/ 	
/******/ })()
;