/** * WebDataRocks Reporting v1.3.3 (http://www.webdatarocks.com/) * Copyright 2020 WebDataRocks. All rights reserved. */ (function(a,b){"function"===typeof define&&define.amd&&define("webdatarocks",[],b);a.WebDataRocks=b()})(window,function(){return function(a){var __extends=this&&this.__extends||function(){var d=function(e,h){d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var a in b)b.hasOwnProperty(a)&&(d[a]=b[a])};return d(e,h)};return function(e,h){function f(){this.constructor=e}d(e,h);e.prototype=null===h?Object.create(h):(f.prototype=h.prototype,new f)}}(),events; (function(d){var e=function(){function d(f,b,a){void 0===b&&(b=null);void 0===a&&(a=null);this.type=f;this.target=b;this.data=a}d.isNativeType=function(d){return-1<"fullscreenchange mozfullscreenchange webkitfullscreenchange MSFullscreenChange focusin focusout touchstart touchmove touchend touchenter touchleave touchcancel".split(" ").indexOf(d)};d.COMPLETE="event_complete";d.CONNECTED="event_connected";d.PROGRESS="event_progress";d.SELECT="event_select";d.CHANGE="event_change";d.ERROR="event_error"; d.OPENED="event_opened";d.CLOSED="event_closed";d.CANCEL="event_cancel";d.OPEN="event_open";d.CLOSE="event_close";d.RESIZE="event_resize";return d}();d._Event=e;e=function(){function e(){this.dispatchActive=!1;this._listeners=[];this._addedListeners=[];this._deletedListeners=[]}e.prototype.areListenersEqual=function(d,b){return d.type==b.type&&d.handler==b.handler};e.prototype.hasEventListener=function(d,b){if(utils.nullOrUndefined(this._listeners[d]))return!1;for(var a=0;a=a&&this._listeners[d].push(b); for(var c=0;cthis.distance||Math.abs(this.startY-a)>this.distance?!0:!1};e.prototype.setHelperPosition=function(b, a,c){void 0===c&&(c=!1);if(null!=this.dragHelper){var g=pivot._view.PivotView.stage.container.getOffset();this.dragHelper.position({top:a-g.top,left:b-g.left});this.isDistanceOK(b,a)&&(this.dragHelper.css("opacity",1),this.dragElement.addClass("wdr-dragging-move"));c&&null!=this.dragElement&&(g=this.dragElement.getOffset(),a=Math.max(0,Math.min(this.dragElement.height,a-g.top)),b=Math.max(0,Math.min(this.dragElement.width,this.dragHelper.width,b-g.left)),this.dragHelper.css("margin-top",-a+"px"), this.dragHelper.css("margin-left",-b+"px"))}};e.prototype.onTouchMove=function(b){if(this.dragElement){var a=b.touches[0];if(this.dragHelper&&this.dragElement.hasClass("wdr-dragging")){this.setHelperPosition(a.clientX,a.clientY);if(this.dragOptions.onDrag)this.dragOptions.onDrag(this.dragElement,b);b.preventDefault();a=b.changedTouches[0];if(a=d.UIElement.convert(document.elementFromPoint(a.clientX,a.clientY))){var c=a.closest(".wdr-droppable");c&&c.droppableOptions&&c.droppableOptions.onDragOver&& (c.droppableOptions.onDragOver(this.dragElement,this.dragHelper,c,b),this._lastDraggable=c)}if((null==a||null==c)&&null!=this._lastDraggable&&this._lastDraggable.droppableOptions&&this._lastDraggable.droppableOptions.onDragLeave)this._lastDraggable.droppableOptions.onDragLeave(this.dragElement,this.dragHelper,this._lastDraggable,b)}else utils.nullOrUndefined(this.dragOptions.onDragStart)||this.dragOptions.onDragStart(this.dragElement,b)?(this.dragHelper=this.dragOptions.createHelper(this.dragElement), this.dragHelper.css("opacity",0),pivot._view.PivotView.stage.container.addChild(this.dragHelper),this.setHelperPosition(a.clientX,a.clientY,!0),this.dragElement.addClass("wdr-dragging")):(this.dragElement=null,this.dragHelper.removeFromParent(!0),this.dragHelper=null)}};e.prototype.onMouseUp=function(b){this.stopDrag(this.dragOptions,b)};e.prototype.onTouchEnd=function(b){for(var a=b.changedTouches[0],c=a=d.UIElement.convert(document.elementFromPoint(a.clientX,a.clientY));a;){if(a.hasClass("wdr-droppable")){utils.nullOrEmpty(a.droppableOptions.itemSelector)|| (c=c.closest(a.droppableOptions.itemSelector));a.droppableOptions.onDrop(this.dragElement,a,c,b);break}a=a.parent}this.stopDrag(this.dragOptions,b)};e.prototype.stopDrag=function(b,a){null!=this.dragHelper&&(this.dragHelper.removeFromParent(!0),this.dragHelper=null);if(null!=this.dragElement){this.dragElement.removeClass("wdr-dragging");this.dragElement.removeClass("wdr-dragging-move");if(b.onDragEnd&&this.isDistanceOK(this.getX(a),this.getY(a)))b.onDragEnd(this.dragElement,a);this.dragElement=null}this._lastDraggable= null;this.startY=this.startX=NaN};e.prototype.makeDroppable=function(b,a,c){var g=this;b.hasClass("wdr-droppable")||(b.addClass("wdr-droppable"),b.addEventListener("mouseenter",function(b){if(null!=g.dragElement&&1==b.which&&c.onDragEnter)c.onDragEnter(g.dragElement,g.dragHelper,a,b)}),b.addEventListener("mouseleave",function(b){if(null!=g.dragElement&&1==b.which&&c.onDragLeave)c.onDragLeave(g.dragElement,g.dragHelper,a,b)}),b.addEventListener("mouseover",function(b){if(null!=g.dragElement&&1==b.which&& c.onDragOver)c.onDragOver(g.dragElement,g.dragHelper,a,b)}),b.addEventListener("mouseup",function(a){if(null!=g.dragElement&&1==a.which){var k=d.UIElement.convert(a.target);utils.nullOrEmpty(c.itemSelector)||(k=k.closest(c.itemSelector));c.onDrop(g.dragElement,b,k,a)}}))};return e}();e.DragManager=h})(d.dragndrop||(d.dragndrop={}))})(uicontrols||(uicontrols={})); (function(d){var e=function(e){function f(b,a){void 0===b&&(b="div");void 0===a&&(a="");var c=e.call(this)||this;c.container=new d.UIElement(b);c.container.addClass("wdr-ui "+a);utils.browserVersion().isMobile&&c.container.addClass("wdr-ui-mobile");c.validate();return c}__extends(f,e);f.prototype.validate=function(){this.invalidHash={}};f.prototype.invalidate=function(b){void 0===b&&(b="all");this.invalidHash[b]=!0;this.draw()};f.prototype.isInvalid=function(){for(var b=[],a=0;a= this.getX()&&b<=this.getX()+this.getWidth()&&a>=this.getY()&&a<=this.getY()+this.getHeight()};f.prototype.addEventListener=function(b,a){this.container.addEventListener(b,a)};f.prototype.removeEventListener=function(b,a){this.container.removeEventListener(b,a)};f.prototype.dispatch=function(b){this.container.dispatch(b)};f.prototype.dispatchWith=function(b,a,c){this.container.dispatchWith(b,a,c)};f.prototype.addLayoutClasses=function(b){void 0===b&&(b=!1);b=b?this.getWidth(!0):pivot._view.PivotView.stageWidth; this.container.toggleClass("wdr-layout-tablet",768>b);this.container.toggleClass("wdr-layout-mobile",580>b);this.container.toggleClass("wdr-layout-mobile-small",460>b)};return f}(events.EventDispatcher);d.UIComponentBase=e})(uicontrols||(uicontrols={})); (function(d){var e=function(e){function f(b,a){void 0===b&&(b="div");void 0===a&&(a="");var c=e.call(this)||this;c.display="block";c.frames=[];c.__handlers=[];c.element="string"==typeof b?document.createElement(b):b;c.addClass("wdr-ui-element");c.addClass(a);return c}__extends(f,e);Object.defineProperty(f.prototype,"element",{get:function(){return this._element},set:function(b){(this._element=b)&&(this._element.uielement=this)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"id", {get:function(){return this.element.id},set:function(b){this.element.id=b},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"parent",{get:function(){return f.convert(this.element.parentElement)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"nodeName",{get:function(){return this._element.nodeName.toLowerCase()},enumerable:!0,configurable:!0});f.prototype.addChild=function(b){this.element.appendChild(b.element)};f.prototype.children=function(){for(var b=this.element.firstElementChild, a=[];b;)a.push(f.convert(b)),b=b.nextElementSibling;return a};f.prototype.contains=function(b){return this.element.contains(b.element)};f.prototype.append=function(b){b&&this.addChild(b);return this};f.prototype.prepend=function(b){this.element.insertBefore(b.element,this.element.firstChild);return this};f.prototype.before=function(b){this.element.parentNode&&this.element.parentNode.insertBefore(b.element,this.element);return this};f.prototype.after=function(b){this.element.parentNode&&this.element.nextElementSibling? this.element.parentNode.insertBefore(b.element,this.element.nextElementSibling):this.append(b);return this};f.prototype.addComponent=function(b){this.element.appendChild(b.container.element)};f.prototype.removeFromParent=function(b){void 0===b&&(b=!0);b?this.remove():this.detach()};f.prototype.remove=function(){null!=this.element&&(this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.dispose())};f.prototype.detach=function(){if(null!=this.element&&this.element.parentNode){var b= this.element.cloneNode(!0);this.element.parentNode.removeChild(this.element);this.element=b}};f.prototype.removeAllChildren=function(){for(;this.element&&this.element.firstChild;){var b=f.convert(this.element.firstChild);b&&b.dispose&&b.dispose();this.element.removeChild(this.element.firstChild)}};f.prototype.clone=function(){return f.convert(this.element.cloneNode(!0))};f.convert=function(b){return b&&b.nodeType==Node.ELEMENT_NODE?utils.nullOrUndefined(b.uielement)?new f(b):b.uielement:null};f.prototype.get= function(b){var a=this.children();return 0this.element.clientHeight-b?0:this.element.clientHeight-b};f.prototype.setHeight= function(b){"number"===typeof b?this.element.style.height=b+"px":"string"===typeof b&&(this.element.style.height=b);return this};Object.defineProperty(f.prototype,"height",{get:function(){return this.getHeight()},set:function(b){this.setHeight(b)},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"left",{get:function(){return this.element.getBoundingClientRect().left},set:function(b){this.element.style.left=b+"px"},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype, "top",{get:function(){return this.element.getBoundingClientRect().top},set:function(b){this.element.style.top=b+"px"},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"right",{get:function(){return this.element.getBoundingClientRect().right},set:function(b){this.element.style.right=b+"px"},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"bottom",{get:function(){return this.element.getBoundingClientRect().bottom},set:function(b){this.element.style.bottom=b+"px"}, enumerable:!0,configurable:!0});f.prototype.outerHtml=function(){return this.element.outerHTML};f.prototype.html=function(b){if(void 0===b)return this.element.innerHTML;this.element.innerHTML=b;return this};f.prototype.empty=function(){this.html("")};f.prototype.clear=function(){this.empty()};f.prototype.text=function(b){if(void 0===b)return this.element.textContent;"input"==this.element.tagName.toLowerCase()?this.element.value=b:this.element.textContent=b;return this};f.prototype.focus=function(){this.element.focus(); return this};f.prototype.blur=function(){this.element.blur();return this};f.prototype.show=function(){this.element.style.display=this.display};f.prototype.hide=function(){this.element.style.display="none"};Object.defineProperty(f.prototype,"x",{get:function(){return this.element.offsetLeft},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"y",{get:function(){return this.element.offsetTop},enumerable:!0,configurable:!0});f.prototype.offset=function(b){if(void 0===b)return this.getOffset(); this.css("left",b.left+"px");this.css("top",b.top+"px")};f.prototype.getBoundingClientRect=function(){return this.element.getBoundingClientRect()};f.prototype.position=function(b){if(void 0===b)return{top:this.y,left:this.x};this.offset(b)};f.prototype.attr=function(b,a){if(void 0===a)return this.element.getAttribute(b);try{this.element.setAttribute(b,a)}catch(c){this.element.attributes[b]=a}return this};f.prototype.removeAttr=function(b){this.element.removeAttribute(b);return this};f.prototype.css= function(b,a){if(void 0===a)return window.getComputedStyle(this.element)[f.toCamelCase(b)];this.element.style[f.toCamelCase(b)]=a;return this};f.toCamelCase=function(b){var a=b.split("-");if(1a?b:a)};f.prototype.getSelectionBeginIndex=function(){return this.container.element.selectionStart};f.prototype.getSelectionEndIndex=function(){return this.container.element.selectionEnd};f.prototype.selectAll=function(){this.setSelection(0,this.getText().length)};f.prototype.onKeyPressed=function(b){b.ctrlKey?(this.dispatchWith(f.EVENT_CTRL_ENTER),b.preventDefault()):13==b.keyCode&&(this.dispatchWith(f.EVENT_ENTER),b.preventDefault())};f.EVENT_ENTER="ntr"; f.EVENT_CTRL_ENTER="ntl";return f}(d.UIComponentBase);d.UITextArea=e})(uicontrols||(uicontrols={})); (function(d){var e=function(d){function e(){var b=d.call(this,"input","wdr-ui-text-input")||this;b.text="";b.prompt="";b.changeDelay=0;b.changeDispatched=!0;b.container.display="inline-block";b.container.attr("type","text");b.container.attr("data-placeholder","");b.container.addEventListener("focusin",function(a){return b.onFocusIn()});b.container.addEventListener("focusout",function(a){return b.onFocusOut()});b.container.addEventListener("keyup",function(a){return b.onKeyUp(a)});b.container.addEventListener("keypress", function(a){return b.onKeyPressed(a)});b.container.addEventListener("paste",function(a){return b.onInputPaste(a)});return b}__extends(e,d);e.getChar=function(b){return null==b.which?32>b.keyCode?null:String.fromCharCode(b.keyCode):0!=b.which&&0!=b.charCode?32>b.which?null:String.fromCharCode(b.which):null};e.prototype.onKeyPressed=function(b){13==b.keyCode&&this.dispatchWith(e.EVENT_ENTER);if(!(utils.nullOrUndefined(this.restrictRule)||b.ctrlKey||b.altKey||b.metaKey)){var a=e.getChar(b);null!=a&& !1===this.restrictRule.test(a)&&b.preventDefault()}};e.prototype.onKeyUp=function(b){this.container.val()!==this.text&&(this.text=this.container.val(),this.dispatchChange())};e.prototype.onInputPaste=function(b){this.container.val()!==this.text&&(this.text=this.container.val(),this.dispatchChange())};e.prototype.dispatchChange=function(){var b=this;0b||(this.selected=b,this.container.toggleClass("wdr-selected",1==this.selected))};f.prototype.getSelection=function(){return this.selected};return f}(d.UIButton);d.UIToggleButton=e})(uicontrols||(uicontrols={})); (function(d){var e=function(e){function f(){var b=e.call(this)||this;b.container.display="inline-block";b.container.hasClass("wdr-ui-toggle-btn")&&b.container.removeClass("wdr-ui-toggle-btn");b.container.addClass("wdr-ui-checkbox");b.labelHolder=new d.UILabel("Label");b.container.append(b.labelHolder.container);return b}__extends(f,e);f.prototype.toggle=function(){e.prototype.toggle.call(this);this.container.toggleClass("wdr-ui-semi-selected",-1==this.getSelection())};f.prototype.setLabel=function(b, a){void 0===a&&(a=!1);null!=this.labelHolder&&this.labelHolder.setLabel(b,a)};f.prototype.getLabel=function(){return null!=this.labelHolder?this.labelHolder.getLabel():""};f.prototype.setSelection=function(b){this.getSelection()==b||1b||(e.prototype.setSelection.call(this,b),this.container.toggleClass("wdr-ui-semi-selected",-1==this.getSelection()))};Object.defineProperty(f.prototype,"checked",{get:function(){return 1==this.getSelection()},set:function(b){this.setSelection(b?1:0)},enumerable:!0, configurable:!0});f.SELECTED=1;f.UNSELECTED=0;f.SEMI_SELECTED=-1;return f}(d.UIToggleButton);d.UICheckBox=e})(uicontrols||(uicontrols={})); (function(d){var e=function(d){function e(){var b=d.call(this,"div","wdr-ui-divider")||this;b.mouseMoveHandler=function(a){return b.onMouseMove(a)};b.mouseDownHandler=function(a){return b.onMouseDown(a)};b.mouseUpHandler=function(a){return b.onMouseUp(a)};b.direction=e.HORIZONTAL;b.addEventListener("mousedown",b.mouseDownHandler);utils.fmdocument.addEventListener("mouseup",b.mouseUpHandler);b.container.disableSelection();return b}__extends(e,d);e.prototype.onMouseDown=function(b){this._height=this.direction== e.HORIZONTAL?this.getHeight():this.getWidth();this._baseOffset=this.container.parent.getOffset();utils.fmdocument.addEventListener("mousemove",this.mouseMoveHandler);b.preventDefault();b.stopImmediatePropagation()};e.prototype.onMouseMove=function(b){if(this.direction==e.HORIZONTAL){var a=b.clientY-this._baseOffset.top;if(this._containment&&(athis._containment[3]))return;this.container.css("top",a-this._height/2+"px");this.dispatchWith(e.EVENT_MOVED,this,{top:a})}this.direction== e.VERTICAL&&(b=b.clientX-this._baseOffset.left,this._containment&&(bthis._containment[2])||(this.container.css("left",b-this._height/2+"px"),this.dispatchWith(e.EVENT_MOVED,this,{left:b})))};e.prototype.onMouseUp=function(b){utils.fmdocument.removeEventListener("mousemove",this.mouseMoveHandler)};Object.defineProperty(e.prototype,"direction",{get:function(){return this._direction},set:function(b){this._direction=b;this.container.toggleClass("wdr-ui-horizontal",this._direction== e.HORIZONTAL);this.container.toggleClass("wdr-ui-vertical",this._direction==e.VERTICAL);this.container.css("position","absolute")},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"containment",{set:function(b){this._containment=b},enumerable:!0,configurable:!0});e.HORIZONTAL=0;e.VERTICAL=1;e.EVENT_MOVED="divider_moved_event";return e}(d.UIComponentBase);d.UIDivider=e})(uicontrols||(uicontrols={})); (function(d){var e=function(d){function e(){return d.call(this,"div","wdr-ui-modal-overlay")||this}__extends(e,d);e.prototype.setTransparent=function(b){this.container.toggleClass("wdr-ui-opaque",!1);this.container.toggleClass("wdr-ui-transparent",b)};e.prototype.setOpaque=function(b){this.container.toggleClass("wdr-ui-transparent",!1);this.container.toggleClass("wdr-ui-opaque",b)};return e}(d.UIComponentBase);d.UIModalOverlay=e})(uicontrols||(uicontrols={})); (function(d){(function(e){var h=function(d){function b(a){void 0===a&&(a="wdr-ui-container");return d.call(this,"div",a)||this}__extends(b,d);b.prototype.removeChild=function(a){this.contains(a)&&a.container.detach()};b.prototype.contains=function(a){return utils.nullOrUndefined(a)?!1:this.container.contains(a.container)};b.prototype.getWidth=function(){return this.container.width};b.prototype.getHeight=function(){return this.container.height};b.prototype.removeAllChildren=function(){for(var a=this.container.children(), c=a.length-1;0<=c;c--)a[c].removeFromParent()};return b}(d.UIComponentBase);e.UIContainer=h})(d.containers||(d.containers={}))})(uicontrols||(uicontrols={}));(function(d){(function(d){var h=function(d){function b(){return d.call(this,"wdr-ui-border-container")||this}__extends(b,d);return b}(d.UIContainer);d.UIBorderContainer=h})(d.containers||(d.containers={}))})(uicontrols||(uicontrols={})); (function(d){(function(d){var h=function(d){function b(){var a=d.call(this)||this;a.container.addClass("wdr-ui-window");a.hide();return a}__extends(b,d);b.prototype.setPosition=function(a,c){this.container.offset({left:Math.floor(a),top:Math.floor(c)});this.container.css("position","absolute")};b.prototype.getPosition=function(){return this.container.offset()};return b}(d.UIContainer);d.UIWindow=h})(d.containers||(d.containers={}))})(uicontrols||(uicontrols={})); (function(d){(function(d){var h=function(d){function b(){return d.call(this,"wdr-ui-hgroup")||this}__extends(b,d);return b}(d.UIContainer);d.UIHGroup=h})(d.containers||(d.containers={}))})(uicontrols||(uicontrols={}));(function(d){(function(d){var h=function(d){function b(){return d.call(this,"wdr-ui-vgroup")||this}__extends(b,d);return b}(d.UIContainer);d.UIVGroup=h})(d.containers||(d.containers={}))})(uicontrols||(uicontrols={})); (function(d){(function(d){var h=function(d){function b(){return d.call(this,"wdr-ui-panel")||this}__extends(b,d);return b}(d.UIContainer);d.UIPanel=h})(d.containers||(d.containers={}))})(uicontrols||(uicontrols={})); (function(d){(function(e){var h=function(e){function b(a){var c=e.call(this)||this;c._overlayClickHandler=function(){return c.onOverlayClick()};c.resizeHandler=function(a){return c.onWindowResize(a)};c.isOpaque=!1;c._modalParent=a;c.container.addClass("wdr-ui-popup");c.hide();c._overlay=new d.UIModalOverlay;c._overlay.addEventListener("click",c._overlayClickHandler);c._overlay.hide();c._modalParent&&c._modalParent.addChild(c._overlay.container);return c}__extends(b,e);b.prototype.onWindowResize=function(a){var c= this;a.target===window&&(this.container.requestAnimationFrame(function(){return c.centerPosition()}),this.addLayoutClasses())};b.prototype.onOverlayClick=function(){this.close()};b.prototype.open=function(){utils.fmwindow.addEventListener("resize",this.resizeHandler);this._overlay.show();this._overlay.container.toggleClass("wdr-ui-opaque",this.isOpaque);this.show();this.centerPosition();this.dispatchWith(events._Event.OPENED);this.addLayoutClasses()};b.prototype.close=function(){utils.fmwindow.removeEventListener("resize", this.resizeHandler);this._overlay.hide();this.hide();this.dispatchWith(events._Event.CLOSED)};b.prototype.centerPosition=function(){var a=this._modalParent;if(a){var c=Math.max(0,(a.getWidth(!0)-this.container.getWidth(!0)-2)/2),a=Math.max(0,(a.getHeight(!0)-this.container.getHeight(!0)-2)/2);this.setPosition(c,a)}};Object.defineProperty(b.prototype,"overlay",{get:function(){return this._overlay},enumerable:!0,configurable:!0});return b}(e.UIWindow);e.UIPopup=h})(d.containers||(d.containers={}))})(uicontrols|| (uicontrols={}));(function(d){(function(d){var h=function(d){function b(){return d.call(this,"wdr-ui-toolbar")||this}__extends(b,d);return b}(d.UIContainer);d.UIToolbar=h})(d.containers||(d.containers={}))})(uicontrols||(uicontrols={})); (function(d){(function(e){var h=function(e){function b(){var a=e.call(this,"wdr-ui-toolbar-mobile")||this;a.headerDisplay=new d.UILabel;a.headerDisplay.addClass("wdr-ui-header-display");a.addChild(a.headerDisplay);return a}__extends(b,e);b.prototype.setHeader=function(a){this.header!=a&&(this.header=a,this.headerDisplay.setLabel(a))};b.prototype.getHeader=function(){return this.header};b.prototype.setLeftItem=function(a){this.leftItem!=a&&(null!=this.leftItem&&this.leftItem.removeFromParent(),this.leftItem= a,null!=this.leftItem&&(this.leftItem.addClass("wdr-ui-left"),this.addChild(this.leftItem)))};b.prototype.setRightItem=function(a){this.rightItem!=a&&(null!=this.rightItem&&this.rightItem.removeFromParent(),this.rightItem=a,null!=this.rightItem&&(this.rightItem.addClass("wdr-ui-right"),this.addChild(this.rightItem)))};return b}(e.UIContainer);e.UIToolbarMobile=h})(d.containers||(d.containers={}))})(uicontrols||(uicontrols={})); (function(d){(function(d){var h=function(){function d(){this.items=[];this.allItems=[]}d.prototype.setItems=function(b){this.allItems=b};d.prototype.getItems=function(b,a){if(0>b||a>this.allItems.length+1)return[];this.items.length=0;for(var c=b;cthis.selectedIndices.length||(g?(this.selectedIndices.push(c),this.selectedItems.push(a)):(this.selectedIndices.splice(this.selectedIndices.indexOf(c),1),this.selectedItems.splice(this.selectedItems.indexOf(a),1)),this.markSelected&&(a.isSelected=g,this.validateItemAt(c)))}else this.markSelected&&null!=this.selectedItem&& (this.selectedItem.isSelected=!1,this.validateItemAt(this.selectedIndex)),this.selectedItem=a,this.selectedIndex=c,this.markSelected&&null!=this.selectedItem&&(this.selectedItem.isSelected=!0,this.validateItemAt(this.selectedIndex))};b.prototype.defaultItemRendererFactory=function(a,c){var g=new d.renderers.UIItemRenderer;g.setData(a);g.setIndex(c);return g};b.prototype.getMinHeight=function(){return this.getRowHeight()};b.prototype.getMaxHeight=function(){return this.getRowHeight()*this.getDataProvider().length}; Object.defineProperty(b.prototype,"allowMultipleSelection",{get:function(){return this._allowMultipleSelection},set:function(a){this._allowMultipleSelection=a},enumerable:!0,configurable:!0});b.prototype.getSelectedIndices=function(){return this.selectedIndices};b.prototype.setSelectedIndices=function(a){this.selectedIndices=a;this.selectedItems.length=0;a=this.getDataProvider();for(var c=0;cb.MAX_HEIGHT?b.MAX_HEIGHT/this.getMaxHeight():1};b.prototype.getStartIdx=function(){return 1!=this.getScale()?Math.floor((this.getScrollPosition()+this.getScaleFix())/this.getScale()/this.getRowHeight()):Math.floor(this.getScrollPosition()/this.getRowHeight())}; b.prototype.getScaleFix=function(){return 1!=this.getScale()?(this.getHeight()/this.getScale()-this.getHeight())*(this.getScrollPosition()/b.MAX_HEIGHT)*this.getScale():0};Object.defineProperty(b.prototype,"allowMultipleSelection",{get:function(){return this._list.allowMultipleSelection},set:function(a){this._list.allowMultipleSelection=a},enumerable:!0,configurable:!0});b.prototype.getLabelField=function(){return this._list.getLabelField()};b.prototype.setLabelField=function(a){this._list.setLabelField(a)}; b.prototype.setItemRendererFactory=function(a){this._list.setItemRendererFactory(a)};b.prototype.validateItemAt=function(a){this._list.validateItemAt(a)};b.prototype.validateItem=function(a,c){void 0===c&&(c="");this._list.validateItem(a,c)};b.prototype.getRowHeight=function(){return 37};b.prototype.getRowCount=function(){return 0this._boundingRect.right|| b.clientYthis._boundingRect.bottom))this.onMouseUp(b);else this.onResize(b.clientX,b.clientY)};e.prototype.onResize=function(b,a){var c={left:this._originalPosition.left,top:this._originalPosition.top},g={width:this._originalSize.width,height:this._originalSize.height};"left"==this._currentSide&&(c.left=b,g.width+=this._originalPosition.left-c.left);"right"==this._currentSide&&(g.width=b-this._originalPosition.left);this.options.resize&&this.options.resize({side:this._currentSide, originalPosition:this._originalPosition,originalSize:this._originalSize,position:c,size:g})};e.prototype.startResizing=function(){document.addEventListener("mousemove",this._mouseMoveHandler);document.addEventListener("mouseup",this._mouseUpHandler);this._originalSize={width:this.target.getWidth(!0),height:this.target.getHeight(!0)};this._originalPosition={left:this.target.getOffset().left,top:this.target.getOffset().top};this._boundingRect=this.options.containtment?this.options.containtment.getBoundingClientRect(): null};e.prototype.stopResizing=function(){document.removeEventListener("mousemove",this._mouseMoveHandler);document.removeEventListener("mouseup",this._mouseUpHandler)};e.prototype.dispose=function(){document.removeEventListener("mousemove",this._mouseMoveHandler);document.removeEventListener("mouseup",this._mouseUpHandler)};return e}();e.ResizableHelper=h})(d.resizable||(d.resizable={}))})(uicontrols||(uicontrols={})); (function(d){(function(d){var h=function(){function d(b,a){void 0===a&&(a=1E3);var c=this;this.touchStartHandler=function(a){return c.onTouchStart(a)};this.touchEndHandler=function(a){return c.onTouchEnd(a)};this.target=b;this.delay=a}d.prototype.listen=function(b){this.handler=b;this.target.addEventListener("touchstart",this.touchStartHandler);this.target.addEventListener("touchend",this.touchEndHandler)};d.prototype.stop=function(){this.target.removeEventListener("touchstart",this.touchStartHandler); this.target.removeEventListener("touchend",this.touchEndHandler)};d.prototype.onTouchStart=function(b){var a=this;this.timer=utils.fmSetTimeout(function(){return a.callHandler(b)},this.delay)};d.prototype.onTouchEnd=function(b){this.timer&&utils.fmClearTimeout(this.timer)};d.prototype.callHandler=function(b){this.handler(b,b&&0c?this.byteLength-this.position:c;var a=new Uint8Array(c);this.memcpy(a.buffer,0,this.buffer,this.byteOffset+this.position,c*a.BYTES_PER_ELEMENT);this.position+=a.byteLength;return a};c.prototype.mapUint8Array=function(c){this._realloc(1* c);var a=new Uint8Array(this._buffer,this.byteOffset+this.position,c);this.position+=1*c;return a};c.prototype._realloc=function(c){if(this._dynamicSize){c=this._byteOffset+this.position+c;var a=this._buffer.byteLength;if(c<=a)c>this._byteLength&&(this._byteLength=c);else{for(1>a&&(a=1);c>a;)a*=2;var a=new ArrayBuffer(a),g=new Uint8Array(this._buffer);(new Uint8Array(a,0,g.length)).set(g);this.buffer=a;this._byteLength=c}}};c.prototype._trimAlloc=function(){if(this._byteLength!=this._buffer.byteLength){var c= new ArrayBuffer(this._byteLength),a=new Uint8Array(c),g=new Uint8Array(this._buffer,0,a.length);a.set(g);this.buffer=c}};c.prototype.memcpy=function(c,a,g,b,m){c=new Uint8Array(c,a,m);g=new Uint8Array(g,b,m);c.set(g)};c.BIG_ENDIAN=!1;c.LITTLE_ENDIAN=!0;return c}();d.DataStream=e;var h=function(){function c(){}c.encode=function(b){b=b?String(b):"";var k=[],d=new g(k);b=new m(b);null==c.encoder&&(c.encoder=new a);for(;b.get()!==c.EOF_code_point;)c.encoder.encode(d,b);var e;do e=c.encoder.encode(d,b); while(e!==c.EOF_byte);return new Uint8Array(k)};c.EOF_byte=-1;c.EOF_code_point=-1;return c}();d.TextEncoder=h;var f=function(){function a(){}a.decode=function(g){g||(g=new Uint8Array(0));g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength);g=new c(g);var m=new k,d;null==a.decoder&&(a.decoder=new b);for(;g.get()!==a.EOF_byte;)d=a.decoder.decode(g),null!==d&&d!==a.EOF_code_point&&m.emit(d);do d=a.decoder.decode(g),null!==d&&d!==a.EOF_code_point&&m.emit(d);while(d!==a.EOF_code_point);return m.str()}; a.EOF_byte=-1;a.EOF_code_point=-1;return a}();d.TextDecoder=f;var b=function(){function c(){this.EOF_code_point=this.EOF_byte=-1;this.utf8_lower_boundary=this.utf8_bytes_seen=this.utf8_bytes_needed=this.utf8_code_point=0}c.prototype.decode=function(c){var a=c.get();if(a===this.EOF_byte)return this.EOF_code_point;c.offset(1);if(0===this.utf8_bytes_needed){if(this.inRange(a,0,127))return a;if(this.inRange(a,194,223))this.utf8_bytes_needed=1,this.utf8_lower_boundary=128,this.utf8_code_point=a-192;else if(this.inRange(a, 224,239))this.utf8_bytes_needed=2,this.utf8_lower_boundary=2048,this.utf8_code_point=a-224;else if(this.inRange(a,240,244))this.utf8_bytes_needed=3,this.utf8_lower_boundary=65536,this.utf8_code_point=a-240;else return this.EOF_code_point;this.utf8_code_point*=Math.pow(64,this.utf8_bytes_needed);return null}if(!this.inRange(a,128,191))return this.utf8_lower_boundary=this.utf8_bytes_seen=this.utf8_bytes_needed=this.utf8_code_point=0,c.offset(-1),this.EOF_code_point;this.utf8_bytes_seen+=1;this.utf8_code_point+= (a-128)*Math.pow(64,this.utf8_bytes_needed-this.utf8_bytes_seen);if(this.utf8_bytes_seen!==this.utf8_bytes_needed)return null;c=this.utf8_code_point;a=this.utf8_lower_boundary;this.utf8_lower_boundary=this.utf8_bytes_seen=this.utf8_bytes_needed=this.utf8_code_point=0;return this.inRange(c,a,1114111)&&!this.inRange(c,55296,57343)?c:this.EOF_code_point};c.prototype.inRange=function(c,a,g){return a<=c&&c<=g};return c}();d.UTF8Decoder=b;var a=function(){function c(){this.EOF_code_point=this.EOF_byte= -1}c.prototype.inRange=function(c,a,g){return a<=c&&c<=g};c.prototype.div=function(c,a){return Math.floor(c/a)};c.prototype.encode=function(c,a){var g=a.get();if(g===this.EOF_code_point)return this.EOF_byte;a.offset(1);if(this.inRange(g,55296,57343))return this.EOF_code_point;if(this.inRange(g,0,127))return c.emit(g);var b,m;this.inRange(g,128,2047)?(b=1,m=192):this.inRange(g,2048,65535)?(b=2,m=224):this.inRange(g,65536,1114111)&&(b=3,m=240);for(m=c.emit(this.div(g,Math.pow(64,b))+m);0=this.bytes.length?this.EOF_byte:Number(this.bytes[this.pos])};c.prototype.offset=function(c){this.pos+=c;if(0>this.pos)throw Error("Seeking past start of the buffer");if(this.pos>this.bytes.length)throw Error("Seeking past EOF");};c.prototype.match=function(c){if(c.length>this.pos+this.bytes.length)return!1; var a;for(a=0;athis.pos)throw Error("Seeking past start of the buffer");if(this.pos>this.cps.length)throw Error("Seeking past EOF"); };c.prototype.get=function(){return this.pos>=this.cps.length?this.EOF_code_point:this.cps[this.pos]};return c}();d.CodePointInputStream=m;var k=function(){function c(){this._str=""}c.prototype.str=function(){return this._str};c.prototype.emit=function(c){65535>=c?this._str+=String.fromCharCode(c):(c-=65536,this._str+=String.fromCharCode(55296+(c>>10&1023)),this._str+=String.fromCharCode(56320+(c&1023)))};return c}();d.CodePointOutputStream=k})(pivot||(pivot={}));var misc; (function(d){var e=function(d){function e(){var b=d.call(this)||this;b.connected=!1;return b}__extends(e,d);e.prototype.load=function(b){var a=this;this.url=b;this.connected=!1;this.close();this.xhr=new XMLHttpRequest;this.xhr.open("GET",b,!0);this.xhr.responseType="arraybuffer";this.xhr.onload=function(c){return a.onComplete(c)};this.xhr.onprogress=function(c){return a.onProgress(c)};this.xhr.onerror=function(c){return a.onError(c)};this.xhr.onreadystatechange=function(c){return a.onReadyStateChange(c)}; this.xhr.send()};e.prototype.onComplete=function(b){this.response=this.xhr.response;this.dispatch(new events._Event(events._Event.COMPLETE,this))};e.prototype.onProgress=function(b){this.dispatch(b)};e.prototype.onError=function(b){this.dispatch(b)};e.prototype.onReadyStateChange=function(b){null!=this.xhr&&4===this.xhr.readyState&&200!==this.xhr.status&&this.dispatch(new events._Event(events._Event.ERROR,this,this.xhr.statusText));null!=this.xhr&&3>this.xhr.readyState&&!this.connected&&(this.connected= !0,this.dispatch(new events._Event(events._Event.CONNECTED)))};e.prototype.close=function(){null!=this.xhr&&this.xhr.abort()};e.prototype.dispose=function(){this.response=null;null!=this.xhr&&(this.xhr.onload=null,this.xhr.onprogress=null,this.xhr.onerror=null,this.xhr.onreadystatechange=null);this.xhr=null};return e}(events.EventDispatcher);d.URLBinaryLoader=e})(misc||(misc={})); (function(d){var e=function(c){function g(){var a=c.call(this)||this;a.dataType=h.TEXT;a.contentType=f.TEXT_PLAIN;a.requestMethod=b.GET;a.connected=!1;a.withCredentials=!1;a._lastProgressTriggered=0;a._lastEvent=null;a.progressInterval=0;a.requestHeaders=[];a.data={};a._bytesLoaded=0;return a}__extends(g,c);g.prototype.load=function(c,a){var g=this;void 0===a&&(a=null);this.url=c;this._bytesLoaded=0;this.connected=!1;this.processRequestHeader(a);this.close();this.xhr=new XMLHttpRequest;this.xhr.open(this.requestMethod, this.url,!0);this.xhr.onerror=function(c){return g.onError(c)};this.xhr.onreadystatechange=function(c){return g.onReadyStateChange(c)};this.xhr.onprogress=function(c){return g.onProgress(c)};this.xhr.setRequestHeader("Content-type",this.contentType);for(var b=0;bthis.xhr.readyState&&!this.connected&&(this.connected=!0,this.dispatch(new events._Event(events._Event.CONNECTED)))};g.prototype.onProgress=function(c){utils.getTimer()-this._lastProgressTriggered>this.progressInterval?(this.response=this.xhr.response||this.xhr.responseText,this._bytesLoaded=c.loaded,this.dispatch(c),this._lastProgressTriggered=utils.getTimer(),this._lastEvent=null):this._lastEvent=c};g.prototype.onError=function(c){this.dispatch(new events._Event(events._Event.ERROR, this))};g.prototype.close=function(){null!=this.xhr&&(this.xhr.onprogress=null,this.xhr.onreadystatechange=null,this.xhr.abort())};g.prototype.dispose=function(){this.data=this.response=null;this.requestHeaders=[];null!=this.xhr&&(this.xhr.onprogress=null,this.xhr.onreadystatechange=null);this._lastProgressTriggered=this._lastEvent=this.xhr=null};return g}(events.EventDispatcher);d.URLStream=e;var h=function(){function c(){}c.TEXT="text";c.XML="xml";c.HTML="html";c.JSON="json";return c}();d.DataType= h;var f=function(){function c(){}c.TEXT_PLAIN="text/plain";c.TEXT_XML="text/xml";c.APPLICATION_JSON="application/json";c.APPLICATION_URLENCODED="application/x-www-form-urlencoded";return c}();d.ContentType=f;var b=function(){function c(){}c.POST="POST";c.GET="GET";return c}();d.URLRequestMethod=b;var a=function(){return function(c,a){this.header=c;this.value=a}}();d.URLRequestHeader=a;e=function(){function c(){this.data={}}c.prototype.toString=function(){var c=[],a;for(a in this.data)c.push(a+"="+ this.data[a]);return c.join("&")};return c}();d.URLVariables=e})(misc||(misc={})); (function(d){var e=function(d){function b(){var a=d.call(this)||this;a.dialogOpened=!1;document.body.onfocus=function(){return a.onFocus()};return a}__extends(b,d);b.prototype.browse=function(a){var c=this;void 0===a&&(a=[]);this.input=document.createElement("input");this.input.setAttribute("type","file");this.input.style.display="none";document.body.appendChild(this.input);this.input.setAttribute("accept",a.join(","));this.input.addEventListener("change",function(){return c.onChange()});this.dialogOpened= !0;this.input.click()};b.prototype.onChange=function(){this.dialogOpened=!1;utils.nullOrUndefined(this.input.files)||utils.nullOrUndefined(this.input.files[0])||(this.file=this.input.files[0],this.dispatchWith(events._Event.SELECT))};b.prototype.onFocus=function(){var a=this;this.dialogOpened&&utils.fmSetTimeout(function(){(utils.nullOrUndefined(a.input.files)||utils.nullOrUndefined(a.input.files[0]))&&a.dispatchWith(events._Event.CANCEL);a.dialogOpened=!1},500)};b.prototype.load=function(a){var c= this;void 0===a&&(a=h.TEXT);null!=this.file&&(this.reader=new FileReader,this.reader.onload=function(a){return c.onLoad(a)},this.reader.onprogress=function(a){return c.onProgress(a)},this.reader.onerror=function(a){return c.onError(a)},a==h.ARRAY_BUFFER?this.reader.readAsArrayBuffer(this.file):this.reader.readAsText(this.file))};b.prototype.onLoad=function(a){this.response=this.reader.result;this.dispatch(new events._Event(events._Event.COMPLETE,this))};b.prototype.onProgress=function(a){this.dispatch(a)}; b.prototype.onError=function(a){this.dispatch(a)};b.prototype.dispose=function(){this.reader=this.file=this.response=null};return b}(events.EventDispatcher);d.FileReference=e;var h=function(){function d(){}d.TEXT="TEXT";d.ARRAY_BUFFER="ARRAY_BUFFER";return d}();d.ReadMethod=h})(misc||(misc={})); (function(d){var e=function(){function b(){}Object.defineProperty(b.prototype,"item",{get:function(){return this[0]},enumerable:!0,configurable:!0});b.prototype.find=function(a){return void 0===this.item?this:this.item.find(a)};b.prototype.text=function(){return void 0===this.item?"":this.item.text()};b.prototype.attr=function(a,c){return void 0===this.item?void 0:c?this.item.attr(a,c):this.item.attr(a)};b.prototype.children=function(){for(var a=new b,c=0;void 0!==this[c];)a[c++]=h.convert(this[c]); return a};b.prototype.push=function(a){this[this.length]=a;return this};Object.defineProperty(b.prototype,"length",{get:function(){for(var a=0;void 0!==this[a];)a++;return a},enumerable:!0,configurable:!0});return b}();d.XMLNodeList=e;var h=function(b){function a(){return null!==b&&b.apply(this,arguments)||this}__extends(a,b);a.prototype.text=function(c){return c||!1===c?(this.textContent=c.toString(),this):c=utils.nullOrUndefined(this.textContent)?"":this.textContent};a.prototype.append=function(c){if(utils.nullOrUndefined(c)|| "string"==typeof c&&utils.nullOrEmpty(c))return this;(c instanceof CDATASection||""!=c.textContent)&&this.appendChild(c);return this};a.prototype.isEmpty=function(){return""==this.text()};a.prototype.find=function(c){c=this.querySelectorAll(c);for(var g=new e,b=0;b\s{0,}<").replace(/d;d++)e.push(e[d]+" ");for(d=0;d/)|| -1/)?(k+=a[d],g=!1):/^<\w/.exec(a[d-1])&&/^<\/\w/.exec(a[d])&&/^<[\w:\-\.\,]+/.exec(a[d-1])[0]==/^<\/[\w:\-\.\,]+/.exec(a[d])[0].replace("/","")?(k+=a[d],g||b--):k=-1/)?g?k+=a[d]:k+=e[b++]+a[d]:-1/)?g?k+=a[d]:k+=e[b]+a[d]:-1< a[d].search(/<\?/)?k+(e[b]+a[d]):-1","text/xml");return b}();d.XML=f})(misc||(misc={})); (function(d){var e=function(){function d(){}d.print=function(d,b,a){void 0===b&&(b="");void 0===a&&(a="");var c="printer-"+(new Date).getTime(),g=(new uicontrols.UIElement("iframe")).attr("name",c);g.css("width","1px").css("height","1px").css("position","absolute").css("left","-9999px");uicontrols.UIElement.convert(document.body).append(g);var c=window.frames[c],m=c.document;m.open();m.write("");m.write("");m.write("");m.write("");m.write(a);m.write("");m.write("");m.write("");m.write("");m.write(d);m.write("");m.write("");m.close();c.focus();c.print();utils.fmSetTimeout(function(){g.remove()},2E3)};return d}();d.PrintJob=e})(misc||(misc={}));var utils; (function(d){var e=function(){function b(){this.listeners={}}Object.defineProperty(b.prototype,"target",{get:function(){return null},enumerable:!0,configurable:!0});b.prototype.areListenersEqual=function(a,c){return a.type===c.type&&a.handler===c.handler&&a.useCapture===c.useCapture};b.prototype.hasEventListener=function(a,c){if(d.nullOrUndefined(this.listeners[a]))return!1;for(var g=0;g
', b.appendChild(b.__resizeTriggers__),this.resetTriggers(b),b.addEventListener("scroll",this._scrollListener,!0))};e.prototype.stopListener=function(b){b.detachEvent?b.detachEvent("onresize",this._dispatchResize):(b.removeEventListener("scroll",this._scrollListener),b.__resizeTriggers__=!b.removeChild(b.__resizeTriggers__))};e.prototype.dispose=function(){this._target&&this._target.element&&this.stopListener(this._target.element);this._dispatchResize=this._scrollListener=this._target=null};return e}(events.EventDispatcher); d.ResizeListener=e})(utils||(utils={})); (function(d){var e=function(){function d(){}d.isHttpURL=function(d){return null!=d&&(0==d.indexOf("http://")||0==d.indexOf("https://"))};d.isBlobURL=function(d){return null!=d&&0==d.indexOf("blob:http")};d.getUrl=function(e,b){void 0===b&&(b=!1);if(!e)return"()";e=e.trim();if(0==e.length)return"()";if(d.isBlobURL(e))return e;if(b){var a=-1s?"a":"p",tt:12>s?"am":"pm",T:12>s?"A":"P",TT:12>s?"AM":"PM",Z:a?"UTC":(String(e).match(d.timezone)||[""]).pop().replace(d.timezoneClip,""),o:(0g&&!(191g))return m=a.charCodeAt(0),m=String.fromCharCode((g&15)<<12|(c&63)<<6|m&63),b.substr(0, b.length-2)+m+a.substr(1);if(!(128>c||256c)return g=a.charCodeAt(0),m=String.fromCharCode((c&31)<<6|g&63),b.substr(0,b.length-1)+m+a.substr(1);if(256>c)return g=a.charCodeAt(0),m=a.charCodeAt(1),m=String.fromCharCode((c&15)<<12|(g&63)<<6|m&63),b.substr(0,b.length-1)+m+a.substr(2)}return b+a};f.toTime=function(b){if(isNaN(b))return pivot.model._labels.Labels.INVALID_DATE;var a="",c=0>b;0>b&&(b*=-1);b=Math.round(b);var g=b%60,a=10>g?"0"+g:g.toString();b=(b-g)/60;g=b%60;a=(10>g?"0"+ g:g.toString())+":"+a;b=(b-g)/60;g=b%24;a=(10>g?"0"+g:g.toString())+":"+a;b=(b-g)/24;0>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(m);break;case 12:case 13:k=b[c++];a+=String.fromCharCode((m&31)<<6|k&63);break;case 14:k=b[c++],d=b[c++], a+=String.fromCharCode((m&15)<<12|(k&63)<<6|(d&63)<<0)}return a};f.decode=function(b){for(var a="",c=0;c=c?b.slice(c,g+1):""};f.trimLeft=function(b,a){void 0===a&&(a=null);if(null==b)return"";for(var c=0;f.isWhitespace(b.charAt(c),a);)++c;var g=b.length-1;return g>=c?b.slice(c,g+1):""};f.isWhitespace=function(b,a){void 0=== a&&(a=null);if(null!=a&&b==a)return!1;switch(b){case " ":case "\t":case "\r":case "\n":case "\f":return!0}return!1};f.isEntity=function(b){for(var a in f.entityMap)if(f.entityMap[a]==b)return!0;return!1};f.escapeHtml=function(b,a){void 0===a&&(a=!1);return a?b.replace(/[<>"'\/]/g,function(c){return f.entityMap[c]}):b.replace(/[&<>"'\/]/g,function(c){return f.entityMap[c]})};f.lastGeneratedIDSuffix=0;f.entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return f}(); d.StringUtils=h;d.nullOrUndefined=e;d.nullOrEmpty=function(d){if(e(d)||"string"!=typeof d||0==d.trim().length)return!0;d=d.trim();for(var b=0;b>=1;var g=1==a%2;a=a>>1>>1;var m=1==a%2;a>>=1;a=1==a%2;if(m)return e=d.sortIndices(e,b,c),g&&e.reverse(),e;a?d.sortNumeric(e,b):""==b?e.sort():e.sort(function(c,a){return c[b]==a[b]?0:c[b]>a[b]?1:-1});g&&e.reverse();return e};d.sort=function(e,b,a){void 0===b&&(b=0);return d.sortOn(e,"",b,a)};d.sortNumeric=function(d,b){""==b?d.sort(function(a,c){return isNaN(a)?1:isNaN(c)?-1:a-c}):d.sort(function(a,c){return isNaN(a[b])?1:isNaN(c[b])? -1:a[b]-c[b]})};d.sortIndices=function(d,b,a){var c=[],g;for(g in d)c.push([d[g],parseInt(g)]);""==b?a?c.sort(function(c,g){return a(c[0],g[0])}):c.sort(function(c,a){return c[0]==a[0]?0:c[0]>a[0]?1:-1}):a?c.sort(function(c,g){return a(c[0][b],g[0][b])}):c.sort(function(c,a){return c[0][b]==a[0][b]?0:c[0][b]>a[0][b]?1:-1});d=[];for(var m in c)d.push(c[m][1]);return d};d.find=function(d,b,a){void 0===a&&(a=null);for(var c=d.length-1;-1c+f&&(d.nullOrUndefined(this.getItemAt(c+f))||a.addItem(this.getKeyAt(c+f),this.getItemAt(c+f)));return a};e.prototype.concat= function(d,b){void 0===b&&(b=!0);if(!b)return this._concat(d),null;var a,c=new e;for(a=0;athis.length&&(b=this.length-d);1>b&&(b=this.length);for(var c=0;c=d+b)&&a.addItem(this.getKeyAt(c), this.getItemAt(c));return a};e.prototype.reverse=function(){var d,b=new e;for(d=this.length-1;-1= <= = > <".split(" "),["-","+"],["/","*"],["^"]],c=0;c=g&&(m=a[c][k],g=e+m.length)}g=d.split(m);2b-50&&(a=Math.floor(1.05*a));return Math.max(5,a)};d.queue=[];return d}();d.ThreadManager=e;var h=function(){function e(b,a){void 0===a&&(a= null);this.delay=1;this.isComplete=!1;this.task=b;this.completeCallback=a}e.prototype.run=function(){var b=this;this.currentTimeout=d.fmSetTimeout(function(){return b.doTask()},this.delay)};e.prototype.stop=function(){d.fmClearTimeout(this.currentTimeout)};e.prototype.doTask=function(){var b=this;this.isComplete=this.task.taskFunction.call(this.task.context,this.task.args);if(!0==this.isComplete)this.onComplete();else this.currentTimeout=d.fmSetTimeout(function(){return b.doTask()},this.delay)};e.prototype.onComplete= function(){null!=this.completeCallback&&this.completeCallback();null!=this.task.completeCallback&&this.task.completeCallback()};e.prototype.dispose=function(){this.stop();this.completeCallback=this.task=null};return e}()})(utils||(utils={})); (function(d){function e(){var d=navigator.userAgent.toLowerCase(),e={};e.isFirefox=/mozilla/.test(d)&&/firefox/.test(d);e.isChrome=/webkit/.test(d)&&/chrome/.test(d)&&!/edge/.test(d);e.isEdge=/edge/.test(d);e.isSafari=/applewebkit/.test(d)&&/safari/.test(d)&&!/chrome/.test(d);e.isOpera=/opera/.test(d);e.isMsie=/msie/.test(d);e.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i.test(d)||/iPad|iPhone|iPod|BlackBerry/i.test(navigator.platform);e.version=NaN;e.isMsie||e.isFirefox||e.isChrome|| e.isSafari||e.isOpera||!/trident/.test(d)||(e.isMsie=!0,e.version=11);if(isNaN(e.version))for(var b=["chrome","firefox","msie","safari","opera"],a=0;a=this._repeatCount&&(this.stop(),this.dispatch(new events._Event(h.TIMER_COMPLETE)))};b.prototype.start=function(){var a=this;this._running||(this._intervalId=d.fmSetInterval(function(){return a.onTimer()}, this._delay),this._running=!0)};b.prototype.stop=function(){this._running&&!d.nullOrUndefined(this._intervalId)&&(d.fmClearInterval(this._intervalId),this._running=!1)};b.prototype.reset=function(){this._currentCount=0;this.stop()};Object.defineProperty(b.prototype,"currentCount",{get:function(){return this._currentCount},set:function(a){},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"running",{get:function(){return this._running},set:function(a){},enumerable:!0,configurable:!0}); Object.defineProperty(b.prototype,"repeatCount",{get:function(){return this._repeatCount},set:function(a){this._repeatCount=a;this._currentCount>=this._repeatCount&&this.stop()},enumerable:!0,configurable:!0});return b}(events.EventDispatcher);d.Timer=e;var h=function(){function d(){}d.TIMER="timer";d.TIMER_COMPLETE="complete";return d}();d.TimerEvent=h;d.getTimer=function(){return"undefined"!==typeof performance&&"function"===typeof window.performance.now?performance.now():(new Date).getTime()}})(utils|| (utils={})); (function(d){var e=function(e){function b(a){var c=e.call(this)||this;c._isFocused=!1;c._keydownHandler=function(a){return c.onKeyDown(a)};c.inputKeyUpHandler=function(a){return c.onInputKeyUp(a)};if(null!=b._instance)throw Error("KeyboardListener is singleton");c.target=a;d.browserVersion().isMobile||(d.fmdocument.addEventListener("keydown",c._keydownHandler),c._inputContainer=new uicontrols.UIElement("div"),c._inputContainer.attr("id","pivot-hiddenInputContainer"),c._inputContainer.css("position","fixed").css("left", "0px").css("top","0px").css("opacity","0").css("width","0px").css("height","0px"),c._inputContainer.hide(),c._input=new uicontrols.UITextArea,c._input.setId("pivot-hiddenInput"),c._input.container.css("width","1px").css("height","1px").css("padding","0px"),c._input.addEventListener("focusin",function(){c._isFocused=!0}),c._input.addEventListener("focusout",function(){c._isFocused=!1}),c._inputContainer.append(c._input.container),a.append(c._inputContainer));return c}__extends(b,e);b.getInstance=function(){null== b._instance&&(b._instance=new b(pivot._view.PivotView.stage.container));return b._instance};Object.defineProperty(b.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!0,configurable:!0});b.prototype.onKeyDown=function(a){var c=new h(h.KEY_DOWN);c.keyCode=a.keyCode;c.altKey=a.altKey;c.ctrlKey=a.ctrlKey;c.metaKey=a.metaKey;c.shiftKey=a.shiftKey;this.dispatch(c)};b.prototype.onInputKeyUp=function(a){this._inputContainer.hide();this._input.setText("");this._input.container.blur(); this._input.removeEventListener("keyup",this.inputKeyUpHandler)};b.prototype.copy=function(a){this._inputContainer.show();this._input.setText(a);this._input.container.focus();this._input.selectAll();this._input.container.focus();this._input.addEventListener("keyup",this.inputKeyUpHandler)};return b}(events.EventDispatcher);d.KeyboardListener=e;var h=function(d){function b(a){return d.call(this,a)||this}__extends(b,d);b.KEY_DOWN="event_keydown";return b}(events._Event);d.KeyboardEvent=h})(utils||(utils= {}));(function(d){d.debug=function(){for(var d=[],h=0;h{0})',c),e._labels.Labels.ERROR,d.AlertType.ERROR)};return a}(events.EventDispatcher);h.ReportManager=f})(e.report||(e.report={}))})(d.model||(d.model={}))})(pivot||(pivot={})); (function(d){(function(e){(function(h){var f=function(){function b(){this.withDefaults=!1;this.connectionInfo=new d.data_.vo.ConnectionInfo;this.slice=new h.SliceValueObject;this.options=new e._options.vo.OptionsValueObject;this.formats=[];this.conditions=[];this.columnSizes={};this.rowSizes={};this.columnHeaderSizes=[];this.rowHeaderSizes=[];this.rowFilterSizes=[];this.columnSizesByIdx={};this.rowSizesByIdx={};this.customFields=[];this.labels={};this.localization=null}b.fromObject=function(a){if(null== a)return null;a instanceof b||(a=b.toPlainObject(a));var c=new b;c.connectionInfo=d.data_.vo.ConnectionInfo.fromObject(null!=a.connectionInfo?a.connectionInfo:a);c.options=e._options.vo.OptionsValueObject.fromObject(null!=a.options?a.options:a);c.slice=h.SliceValueObject.fromObject(null!=a.slice?a.slice:a,c.connectionInfo,c.options.gridType==d._view.grid.GridType.FLAT);null!=a.formats&&a.formats.length&&(c.formats=a.formats);null!=a.conditions&&a.conditions.length&&(c.conditions=a.conditions);null!= a.columnSizes&&"string"!=typeof a.columnSizes&&(c.columnSizes=a.columnSizes);null!=a.rowSizes&&"string"!=typeof a.rowSizes&&(c.rowSizes=a.rowSizes);null!=a.columnHeaderSizes&&"string"!=typeof a.columnHeaderSizes&&(c.columnHeaderSizes=a.columnHeaderSizes);null!=a.rowHeaderSizes&&"string"!=typeof a.rowHeaderSizes&&(c.rowHeaderSizes=a.rowHeaderSizes);null!=a.rowFilterSizes&&"string"!=typeof a.rowFilterSizes&&(c.rowFilterSizes=a.rowFilterSizes);null!=a.columnSizesByIdx&&(c.columnSizesByIdx=a.columnSizesByIdx); null!=a.rowSizesByIdx&&(c.rowSizesByIdx=a.rowSizesByIdx);null!=a.customFields&&(c.customFields=a.customFields);null!=a.localization&&(c.localization=a.localization);return c};b.prototype.toObject=function(){var a={},c=this.connectionInfo.toObject(this.withDefaults);utils.ObjectUtils.isEmptyObject(c)||(a.dataSource=c);c=this.slice.toObject(this.withDefaults);utils.ObjectUtils.isEmptyObject(c)||(a.slice=c);c=this.options.toObject();utils.ObjectUtils.isEmptyObject(c)||(a.options=c);c=this.composeConditionsObject(); 0"))&&c+this.embeddedDataJSONStartSign.length+1")+9)+"\n");this.loader.response.indexOf(this.embeddedStartDataSign);c.connectionInfo=a}}else utils.nullOrUndefined(c)||utils.nullOrUndefined(c.dataSource)||!0!=c.dataSource.embedded||(c.dataSource.filename=this.loader.url,c.dataSource.embeddedDataOffset=this.getStringByteLength(this.loader.response.substring(0, this.loader.response.indexOf(this.embeddedDataJSONStartSign))));this.dispatchReportLoaded(c);this.dispose()}};a.prototype.onError=function(){this.loader.removeAllEventListeners(events._Event.PROGRESS);this.loader.removeAllEventListeners(events._Event.COMPLETE);this.loader.removeAllEventListeners(events._Event.ERROR);var c=e.XSSCheck.valid(this.url)?this.url:e.XSSCheck.validate(this.url),c=utils.StringUtils.bind(e._labels.Labels.MESSAGE_UNABLE_TO_OPEN_FILE,c);this.dispatch(new h.ReportFileFailedEvent(c)); this.dispose()};a.prototype.dispose=function(){null!=this.loader&&(this.loader.removeAllEventListeners(),this.loader.dispose(),this.loader=null)};return a}(h.ReportLoader);h.UrlReportLoader=f})(e.report||(e.report={}))})(d.model||(d.model={}))})(pivot||(pivot={})); (function(d){(function(e){(function(h){var f=function(b){function a(){return b.call(this)||this}__extends(a,b);a.prototype.load=function(){var c=this;this.file=new misc.FileReference;this.file.addEventListener(events._Event.SELECT,function(){return c.onSelected()});this.file.addEventListener(events._Event.COMPLETE,function(){return c.onLoaded()});this.file.addEventListener(events._Event.CANCEL,function(){return c.onCancel()});this.file.addEventListener(events._Event.ERROR,function(){return c.onError()}); this.file.browse([".json",".js"])};a.prototype.onSelected=function(){null!=this.file&&this.file.load(misc.ReadMethod.ARRAY_BUFFER)};a.prototype.onLoaded=function(){try{var c=new d.DataStream(this.file.response,0,d.DataStream.BIG_ENDIAN),a=c.readString(c.byteLength),b=this.parseReport(a);if(b instanceof h.ReportValueObject){if(b.connectionInfo instanceof d.data_.vo.CSVConnectionInfo&&!0==b.connectionInfo.embedded){var k=b.connectionInfo;k.embeddedDataToLoad=this.file.response;k.embeddedDataOffset= this.getStringByteLength(a.substring(0,a.indexOf("")+9)+"\n");b.connectionInfo=k}}else utils.nullOrUndefined(b)||utils.nullOrUndefined(b.dataSource)||!0!=b.dataSource.embedded||(b.dataSource.embeddedDataToLoad=this.file.response,b.dataSource.embeddedDataOffset=this.getStringByteLength(a.substring(0,a.indexOf("/**----**"))));this.dispatchReportLoaded(b);this.dispose()}catch(e){console.error(e),this.onError()}};a.prototype.onError=function(){var c=utils.StringUtils.bind(e._labels.Labels.MESSAGE_UNABLE_TO_OPEN_FILE, "");this.dispatch(new h.ReportFileFailedEvent(c));this.dispose()};a.prototype.onCancel=function(){this.dispatchWith(h.ReportEvent.REPORT_FILE_CANCELLED);this.dispose()};a.prototype.dispose=function(){null!=this.file&&(this.file.removeAllEventListeners(),this.file.dispose(),this.file=null)};return a}(h.ReportLoader);h.LocalReportLoader=f})(e.report||(e.report={}))})(d.model||(d.model={}))})(pivot||(pivot={})); (function(d){(function(d){(function(d){var e=function(){function b(){}b.validType=function(a){return a==b.FILE||a==b.SERVER||a==b.BINARY||a==b.PLAIN};b.FILE="file";b.SERVER="server";b.BINARY="binary";b.PLAIN="plain";return b}();d.DestinationType=e})(d.report||(d.report={}))})(d.model||(d.model={}))})(pivot||(pivot={})); (function(d){(function(d){(function(d){var e=function(){function b(){}b.customFields=[];return b}();d.CustomFieldsManager=e})(d.report||(d.report={}))})(d.model||(d.model={}))})(pivot||(pivot={})); (function(d){(function(e){(function(h){var f=function(){function b(){this.rows=[];this.columns=[];this.pages=[];this.measures=[];this.rowSorting={};this.columnSorting={};this.expandedRows=[];this.expandedColumns=[];this.drilledRows=[];this.drilledColumns=[];this.drillAll=this.expandAll=!1;this.flatOrder=[];this.formatsInUse={}}b.prototype.normalizeSlice=function(a){if(0<=b.findMeasure(a.rows)){var c=b.findMeasure(a.columns);0<=c&&(a.columns[c]=a.columns[0],a.columns.shift())}};b.findMeasure=function(a){for(var c= d.data_.Cube.MEASURES_NAME,g=0;gthis._pageWidth&&(this.columnsShift--,this.printSprite.find("td:last-child").remove()),this.addPageToPJ(),this.printSprite=this.createPage(),this.printTable=this.printSprite.find("table"),!1==this.grid.isFlatTable)){var a=this.columnsShift;0!=this.columnsShift&&(this.columnsShift=0,this.addColumnOnPage(),this.columnsShift= a,this.columnsShift+1<=this.dataProvider.extendedDataWidth-(this.grid.isFlatTable?1:0)&&(this.columnsShift+=1))}this.addColumnOnPage();if(!0==this.shift())this.addPageToPJ();else return!1;return!0};b.prototype.createPage=function(){var a=(new uicontrols.UIElement("div")).addClass("page");a.css("position","absolute").css("left","-9999px");if(null!=this._options.header){var c=this.createHeaderFooter(this._options.header);a.append(c)}var g=new uicontrols.UIElement("table");0==this.pageNumber&&0this._pageHeight&&(this._rowIdx--,this.printSprite.find("tr:last-child").remove());this.printSprite.detach();this.printSprite.css("position","").css("left","");this.pages.append(this.printSprite);return!1};b.prototype.shift=function(){++this.columnsShift;this.columnsShift>this.dataProvider.extendedDataWidth- (this.grid.isFlatTable?1:0)&&(this.columnsShift=0,this.rowsShift+=this._rowIdx-this.grid.FIRST_DATA_ROW);return 1E3<=this.pageNumber||this.rowsShift>=this.dataProvider.extendedDataHeight?!0:!1};b.prototype.addColumnOnPage=function(){this.rowHeightSum=0;var a=this.grid.START_HEADERS_COLUMN+this.columnsShift,c=this._pageHeight-this.headerHeight-this.footerHeight;for(this._rowIdx=this.grid.START_TABLE_ROW;this.rowHeightSum<=c&&this._rowIdx=c)break}};b.prototype.addCell=function(a,c,g){c=this.printTable.find("tr",!0);for(c=0"+(g?g.getLabel():"")+ "";if(null==g)a=utils.StringUtils.bind(a,"class='cell'");else{var b="",d="";g.isCustomized&&(d=g.style.getStyleString(),b=g.style.getCustomClassString(),this.appendStylesList(g.style.customStyleNames));b=g.isRowHeader?b+(" rowHeaderCell level"+g.level):g.isColumnHeader?b+" columnHeaderCell":g.isFilterHeader?b+" filterHeaderCell":g.isTotal&&""!=g.getLabel()?b+" totalCell":b+" cell";""!=b.trim()&&(b="class='"+b.trim()+"'");""!=d.trim()&&(d="style='"+d.trim()+"maxWidth:400px'");a=utils.StringUtils.bind(a, b+" "+d)}c.element.innerHTML+=a;return c.getHeight(!0)+4};b.prototype.appendStylesList=function(a){for(var c=0;cthis.stylesList.indexOf(a[c])&&this.stylesList.push(a[c])};b.prototype.finish=function(){d.preloader(!0,e._labels.Labels.MESSAGE_PLEASE_WAIT,"Sending pages to printer...",!1,!0);misc.PrintJob.print(this.pages.html(),this.generateStyle(),e._options.OptionsManager.gridTitle);d.preloader(!1);e.PivotModel.getInstance().dispatchWith(d.PivotEvent.PRINT_COMPLETE);this.clear()}; b.prototype.generateStyle=function(){for(var a="",c=uicontrols.UIElement.convert(this.gridLayout.element),g=c.find("#wdr-data-sheet"),a=a+utils.StringUtils.bind("table{width:100%;border-collapse:collapse;{0}}\n",d._view.grid.vo.StyleValueObject.fromItemToString(c,["font-family","font-size"])),a=a+utils.StringUtils.bind("caption{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.TITLE,c)),a=a+utils.StringUtils.bind("td{white-space:nowrap;{0}}\n",utils.browserVersion().isChrome? "":"border: 1px solid #eee;"),a=a+utils.StringUtils.bind(".cell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL,g)),a=a+utils.StringUtils.bind(".totalCell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.TOTAL,g)),a=a+utils.StringUtils.bind(".rowHeaderCell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+ " "+d._view.grid.vo.GridStyleName.HEADER_ROW,c)),a=a+utils.StringUtils.bind(".columnHeaderCell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.HEADER_COLUMN,c)),a=a+utils.StringUtils.bind(".filterHeaderCell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.FILTER_HEADER, c)),g=1;20>=g;g++)a+=utils.StringUtils.bind(".level{0}{{1}}\n",g,d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.HEADER_ROW+" "+d._view.grid.vo.GridStyleName.LEVEL+g,c,["padding-left"]));for(g=0;gc.indexOf("px")?c.trim()+"px":c};return c}();e.CSSValueObject=a})(e.vo||(e.vo={}))})(e.condition||(e.condition={}))})(d.model||(d.model={}))})(pivot||(pivot={})); (function(d){(function(e){(function(h){var f=function(b){function a(){var c=b.call(this)||this;if(null!=a.instance)throw Error("Singleton");return c}__extends(a,b);a.getInstance=function(){null==a.instance&&(a.instance=new a);return a.instance};a.dispose=function(){a.rowFilterSizes=null;a.rowHeaderSizes=null;a.rowSizes=null;a.rowSizesByIdx=null;a._rowSizesNamed=null;a._rowSizesNamedToApply=null;a.columnHeaderSizes=null;a.columnSizes=null;a.columnSizesByIdx=null;a._columnSizesNamed=null;a._columnSizesNamedToApply= null;a.instance=null};Object.defineProperty(a,"rowSizesNamed",{get:function(){return this._rowSizesNamed=a.toNamedSizes(d.data_.consts.AxisName.ROWS_AXIS)},enumerable:!0,configurable:!0});Object.defineProperty(a,"columnSizesNamed",{get:function(){return this._columnSizesNamed=a.toNamedSizes(d.data_.consts.AxisName.COLUMNS_AXIS)},enumerable:!0,configurable:!0});a.clear=function(){a.rowSizes={};a.columnSizes={};a._rowSizesNamedToApply={};a._rowSizesNamed={};a._columnSizesNamedToApply={};a._columnSizesNamed= {};a.rowSizesByIdx={};a.columnSizesByIdx={};a.rowHeaderSizes={};a.columnHeaderSizes={};a.rowFilterSizes={}};a.applySizes=function(c,g,b,d,e,f,h){if(a.basedOnNamesArray(c)||a.basedOnNamesArray(g))a._rowSizesNamedToApply=a.convertSizes(c),a._columnSizesNamedToApply=a.convertSizes(g),a.processSizes();else if(a.basedOnNamesObject(c)||a.basedOnNamesObject(g))a._rowSizesNamedToApply=c,a._columnSizesNamedToApply=g,a.processSizes();a.rowSizesByIdx=b;a.columnSizesByIdx=d;a.rowHeaderSizes=e;a.columnHeaderSizes= f;a.rowFilterSizes=h};a.processSizes=function(){if(e.PivotModel.getInstance().state_.reportState==e._state.StateEvent.REPORT_COMPLETE)this.onDataLoaded();else d.data_.Cube.getInstance().addEventListener(d.data_.DataEvent.QUERY_COMPLETE,a.onDataLoaded,1)};a.basedOnNamesArray=function(c){var a=/[A-Za-z]+/,b;for(b in c)if(-1=d.data_.Cube.getInstance().slice_.measures_.length)continue;-1==n&&1==d.data_.Cube.getInstance().slice_.measures_.length&&(n=0);q.push(d.data_.Cube.getInstance().slice_.measures_.getKeyAt(n))}g[q.toString()]=f}}return g};a.rowSizes={};a.columnSizes={};a._rowSizesNamedToApply={};a._rowSizesNamed= {};a._columnSizesNamedToApply={};a._columnSizesNamed={};a.startTableRow=0;a.rowSizesByIdx={};a.columnSizesByIdx={};a.rowHeaderSizes={};a.columnHeaderSizes={};a.rowFilterSizes={};return a}(events.EventDispatcher);h.SizesManager=f})(e.sizes||(e.sizes={}))})(d.model||(d.model={}))})(pivot||(pivot={})); (function(d){(function(e){(function(h){var f=function(){function b(){}b.run=function(a,c,g,m){var k=this;d.preloader(!0,e._labels.Labels.MESSAGE_PLEASE_WAIT,"...",!0,!0);b.clear();b.grid=a;b.dataHeight=m;b.dataWidth=g;b.coords=a.gridLayout.coords;b.exportOptions=c;b.pdf=new jsPDF(c.pageOrientation,"mm","a4",!utils.browserVersion().isMsie);b.pageHeight=b.fullPageHeight-2*b.PAGE_MARGIN;b.pageWidth=b.fullPageWidth-2*b.PAGE_MARGIN;b.totalColumnCount=b.grid.FIRST_DATA_COLUMN+g;b.totalRowCount=b.grid.FIRST_DATA_ROW+ m;b.widthSize={};b.currentYPos=b.PAGE_MARGIN;try{b.calculateColumnCount(),b.getStyles(),b.createHeaderAndFooter(b.exportOptions.header,b.exportOptions.footer,function(){return k.onHeaderAndFooterCreated()})}catch(l){console.error("Export PDF error:",l),d.uialert(e._labels.Labels.MESSAGE_EXPORT_ERROR,e._labels.Labels.ERROR,d.AlertType.ERROR),d.preloader(!1),e.PivotModel.getInstance().dispatch(new events._Event(d.PivotEvent.EXPORT_COMPLETE)),b.clear()}};b.createHeaderAndFooter=function(a,c,g){try{b.headerHeight= 0;b.footerHeight=0;var m=null==a,k=null==c;if(m&&k)g();else{if(!m){a=a.replace(/##PAGE-NUMBER##/gi,(b.pageNumber+1).toString());a=a.replace(/##CURRENT-DATE##/gi,(new Date).toLocaleString());var e=new uicontrols.UIElement("div");e.css("position","absolute");e.css("background","white");e.setWidth(b.mm2px(b.fullPageWidth-2*b.HEADER_FOOTER_MARGIN));e.html(a);d._view.PivotView.stage.container.prepend(e);html2canvas(e.element).then(function(c){e.remove();b.headerImage=c;b.headerHeight=b.px2mm(c.height); m=!0;k&&g()})}if(!k){c=c.replace(/##PAGE-NUMBER##/gi,(b.pageNumber+1).toString());c=c.replace(/##CURRENT-DATE##/gi,(new Date).toLocaleString());var f=new uicontrols.UIElement("div");f.css("position","absolute");f.css("background","white");f.setWidth(b.mm2px(b.fullPageWidth-2*b.HEADER_FOOTER_MARGIN));f.html(c);d._view.PivotView.stage.container.prepend(f);html2canvas(f.element).then(function(c){f.remove();b.footerImage=c;b.footerHeight=b.px2mm(c.height);k=!0;m&&g()})}}}catch(h){b.headerImage=null,b.headerHeight= 0,b.footerImage=null,b.footerHeight=0,g()}};b.addHeader=function(a,c){a.addImage(c,"JPEG",b.HEADER_FOOTER_MARGIN,b.HEADER_FOOTER_MARGIN)};b.addFooter=function(a,c){a.addImage(c,"JPEG",b.HEADER_FOOTER_MARGIN,b.fullPageHeight-b.footerHeight-b.HEADER_FOOTER_MARGIN)};b.addHeaderAndFooter=function(){null!=b.headerImage&&b.addHeader(b.pdf,b.headerImage);null!=b.footerImage&&b.addFooter(b.pdf,b.footerImage);b.pageHeight=b.fullPageHeight;b.pageHeight-=0==b.headerHeight?b.PAGE_MARGIN:b.headerHeight+2*b.HEADER_FOOTER_MARGIN; b.pageHeight-=0==b.footerHeight?b.PAGE_MARGIN:b.footerHeight+2*b.HEADER_FOOTER_MARGIN;b.currentYPos=0==b.headerHeight?b.PAGE_MARGIN:b.headerHeight+2*b.HEADER_FOOTER_MARGIN};Object.defineProperty(b,"fullPageHeight",{get:function(){return"portrait"===b.exportOptions.pageOrientation?297:210},enumerable:!0,configurable:!0});Object.defineProperty(b,"fullPageWidth",{get:function(){return"portrait"===b.exportOptions.pageOrientation?210:297},enumerable:!0,configurable:!0});b.onHeaderAndFooterCreated=function(){b.addHeaderAndFooter(); b.addTitle(e._options.OptionsManager.gridTitle,b.pdf);utils.nullOrEmpty(e._options.OptionsManager.gridTitle)||0!=b.pageNumber||(b.currentYPos+=5);b.preprocessData();utils.ThreadManager.addTask(b.generateRow,null,null,function(){return b.onPdfGenerated()})};b.addTitle=function(a,c){if(!utils.nullOrEmpty(a)){c.setTextColor(0,0,0);c.setFontStyle("bold");c.setFontSize(12);var g=12*c.getStringUnitWidth(a)/c.internal.scaleFactor;c.text(a,(c.internal.pageSize.width-g)/2,b.currentYPos)}};b.getStyles=function(){var a= b.grid.gridLayout,c=a.find("#wdr-data-sheet");b.cellStyle=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL,c);b.totalCellStyle=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.TOTAL,c);b.rowHeaderCellStyle=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.HEADER_ROW,uicontrols.UIElement.convert(a.element)); b.columnHeaderCellStyle=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.HEADER_COLUMN,uicontrols.UIElement.convert(a.element));b.filterHeaderCellStyle=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.FILTER_HEADER,uicontrols.UIElement.convert(a.element))};b.getColumnWidth=function(a){a=b.pixel2mm(b.grid.gridLayout.coords.getColWidth(a)); a=a/gi,"");m=null!=b.widthSize&&null!=b.widthSize[a]?b.widthSize[a]:b.getColumnWidth(a);e=b.pdf.splitTextToSize(f,m,b.getOptionsForCell(e));e=(1e?k:(e+1)*k;e=e>b.pageHeight/2?(b.pageHeight-1)/2:e;g=e>g?e:g}a++}b.heigthSize[c]=g;c++}};b.generateRow=function(){if(b._addingHeaderFooter)return!1; for(var a=utils.getTimer(),c=0;cb.grid.START_HEADERS_COLUMN?b.currentRowIdx-b.currentStartRowIdx:b.currentRowIdx,h=b.heigthSize[f];for(b.currentColIdx=b.currentStartColIdx;b.currentColIdxb.grid.START_HEADERS_COLUMN)?b.grid.START_HEADERS_COLUMN:b.currentColIdx,!b.allRowsGenerated()&&b.rowsHeightSum+h<=b.pageHeight){g=null!=b.widthSize&&null!=b.widthSize[k]?b.widthSize[k]:b.getColumnWidth(k);if(0.9*(m+g)>b.pageWidth)break;k=b.grid.gridLayout.getCell(f,k,!0,!0);l=utils.nullOrUndefined(k)?"":k.getLabel();"number"===typeof l&&(k.value=l,l+="",k.numeric=!0);var l=l.replace(/<(?:.|\n)*?>/gi,""),n=l.match(/&#(\d{3,4});/gi);if(n)for(var p,q=0;qb.pageHeight/2&&(t=(b.pageHeight-20)/2,p=Math.floor(b.mm2px(t)/(q.fontSize+2*b.PADDING)));q.fontSize*=0.7;var u=d._view.grid.vo.StyleValueObject.parseRGB(q.backgroundColor);b.pdf.setFillColor(u[0],u[1],u[2],0!=u[3]?void 0: 0);u=d._view.grid.vo.StyleValueObject.parseRGB(q.borderColor);b.pdf.setDrawColor(u[0],u[1],u[2],0!=u[3]?void 0:0);u=d._view.grid.vo.StyleValueObject.parseRGB(q.color);b.pdf.setTextColor(u[0],u[1],u[2]);b.pdf.setFontStyle("bold"==q.fontWeight?"bold":"normal");b.pdf.setFontSize(q.fontSize);b.pdf.rect(m,b.currentYPos,g,h,"FD");t=b.currentYPos+(h-t)/2+b.PADDING;if("right"==q.textAlign)if(1=b.dataWidth+b.grid.FIRST_DATA_COLUMN};b.allRowsGenerated=function(){return b.currentRowIdx>=b.dataHeight+b.grid.FIRST_DATA_ROW};b.addNewPage=function(){b.pdf.addPage();b.pageNumber++;b.pageIsFilled=!1;b._addingHeaderFooter=!0;b.createHeaderAndFooter(b.exportOptions.header,b.exportOptions.footer, function(){b._addingHeaderFooter=!1;b.addHeaderAndFooter()});b.rowsHeightSum=0;1=b.grid.FIRST_DATA_COLUMN)c=b.getColumnWidth(b.grid.START_HEADERS_COLUMN),g+=c,b.currentColumnCount++,b.currentStartColIdx--,b.currentColIdx--;for(;a b.pageWidth/2-b.PAGE_MARGIN&&(c=(b.pageWidth+b.PAGE_MARGIN)/2,b.widthSize[a]=c),g+=c,g<=b.pageWidth)b.currentColumnCount++,a++;else{0==b.currentColumnCount&&(b.currentColumnCount=1);break}};b.onPdfGenerated=function(){0==b.exportOptions.filename.length&&(b.exportOptions.filename="pivot.pdf");var a=b.pdf.output(),a=utils.StringUtils.strToUint8Arr(a);h.ExportManager.save(a,b.exportOptions);b.clear();e.PivotModel.getInstance().dispatch(new events._Event(d.PivotEvent.EXPORT_COMPLETE))};b.clear=function(){b.grid= null;b.exportOptions=null;b.pdf=null;b.dataWidth=0;b.dataHeight=0;b.totalColumnCount=0;b.totalRowCount=0;b.currentColumnCount=0;b.currentColIdx=0;b.currentStartColIdx=0;b.currentRowIdx=0;b.currentStartRowIdx=0;b.rowsHeightSum=0;b.currentYPos=0;b.pageIsFilled=!1;b.pageNumber=0;b.pageHeight=0;b.pageWidth=0;b.headerHeight=0;b.headerImage=null;b.footerHeight=0;b.footerImage=null};b.pixel2mm=function(a){return 0.264*a};b.mm2px=function(a){return 3.779*a};b.px2mm=function(a){return a/3.779};b.FONT_NAME= "Helvetica";b.PAGE_MARGIN=15;b.pageIsFilled=!1;b.pageNumber=0;b.HEADER_FOOTER_MARGIN=5;b.headerHeight=0;b.footerHeight=0;b._addingHeaderFooter=!1;b.BLOCK_SIZE=20;b.PADDING=b.pixel2mm(8);return b}();h.ExportPDF=f})(e._export||(e._export={}))})(d.model||(d.model={}))})(pivot||(pivot={})); (function(d){(function(e){(function(h){var f=function(){function b(){throw Error("Singleton");}b.run=function(a,c,g,m){b.grid=a;b.dataWidth=g;b.dataHeight=m;b.exportOptions=c;try{b.exportToHTML()}catch(k){console.error("Export HTML error:",k),d.uialert(e._labels.Labels.MESSAGE_EXPORT_ERROR,e._labels.Labels.ERROR,d.AlertType.ERROR),d.preloader(!1),e.PivotModel.getInstance().dispatch(new events._Event(d.PivotEvent.EXPORT_COMPLETE)),b.clear()}};b.exportToHTML=function(){d.preloader(!0,e._labels.Labels.MESSAGE_EXPORT_PROGRESS); b.htmlString="";b.rowIdx=b.grid.START_TABLE_ROW;b.stylesList=[];utils.ThreadManager.addTask(b.generateRow,null,null,b.onHTMLExportComplete)};b.generateStyle=function(){for(var a="",c=b.grid.gridLayout,g=c.find("#wdr-data-sheet"),a=a+utils.StringUtils.bind("body{{0}}\n",d._view.grid.vo.StyleValueObject.fromItemToString(uicontrols.UIElement.convert(c.element),["font-family"])),a=a+utils.StringUtils.bind(".grid{border-collapse:collapse;{0}border-top:1px solid #e9e9e9;border-left:1px solid #e9e9e9;}\n", d._view.grid.vo.StyleValueObject.fromItemToString(uicontrols.UIElement.convert(c.element),["font-family","font-size","color"])),a=a+utils.StringUtils.bind(".title{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.TITLE,uicontrols.UIElement.convert(c.element))),a=a+utils.StringUtils.bind(".cell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL,g)),a=a+utils.StringUtils.bind(".totalCell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL+ " "+d._view.grid.vo.GridStyleName.TOTAL,g)),a=a+utils.StringUtils.bind(".rowHeaderCell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.HEADER_ROW,uicontrols.UIElement.convert(c.element))),a=a+utils.StringUtils.bind(".columnHeaderCell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.HEADER_COLUMN, uicontrols.UIElement.convert(c.element))),a=a+utils.StringUtils.bind(".filterHeaderCell{{0}}\n",d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.FILTER_HEADER,uicontrols.UIElement.convert(c.element))),g=1;20>=g;g++)a+=utils.StringUtils.bind(".level{0}{{1}}\n",g,d._view.grid.vo.StyleValueObject.fromClassToString(d._view.grid.vo.GridStyleName.HEADER_ROW+" "+d._view.grid.vo.GridStyleName.LEVEL+ g,uicontrols.UIElement.convert(c.element),["padding-left"]));for(g=0;gb.stylesList.indexOf(a[c])&&b.stylesList.push(a[c])};b.generateRow=function(){for(var a=utils.getTimer(),c=Math.min(b.rowIdx+b.BLOCK_SIZE,b.dataHeight+b.grid.FIRST_DATA_ROW), g,m="";b.rowIdx"+(g?g.getLabel():"")+"",null==g)m=utils.StringUtils.bind(m,"class='cell'");else{var e="",f="";g.isCustomized&&(f=g.style.getStyleString(),e=g.style.getCustomClassString(),b.appendStylesList(g.style.customStyleNames));e=g.isRowHeader?e+(" rowHeaderCell level"+g.level):g.isColumnHeader?e+" columnHeaderCell":g.isFilterHeader? e+" filterHeaderCell":g.isTotal&&""!=g.getLabel()?e+" totalCell":e+" cell";null!=g&&g.isFilterHeader&&(e+=" level"+g.level);""!=e.trim()&&(e="class='"+e.trim()+"'");f+="width:"+b.grid.gridLayout.coords.getColWidth(d)+"px;";""!=f.trim()&&(f="style='"+f.trim()+"'");m=utils.StringUtils.bind(m,e+" "+f)}b.rowsString+=""+m+""}b.BLOCK_SIZE=utils.ThreadManager.adjustTaskSize(utils.getTimer()-a,b.BLOCK_SIZE);b.showProgress(b.rowIdx);return b.rowIdx>=b.dataHeight+b.grid.FIRST_DATA_ROW};b.showProgress= function(a){d.preloader(!0,e._labels.Labels.MESSAGE_EXPORT_PROGRESS,utils.StringUtils.bind("{0}%",(a/(b.dataHeight+b.grid.FIRST_DATA_ROW)*100).toFixed(0)))};b.onHTMLExportComplete=function(){d.preloader(!1);b.saveHTMLExport();b.clear()};b.saveHTMLExport=function(){0==b.exportOptions.filename.length&&(b.exportOptions.filename="pivotgrid.html");var a="";if(!utils.nullOrEmpty(b.exportOptions.header))var c=b.exportOptions.header,c=c.replace(/##PAGE-NUMBER##/gi,""),c=c.replace(/##CURRENT-DATE##/gi,(new Date).toLocaleString()), a=a+c;a+="
"+e._options.OptionsManager.gridTitle+"
";a+=""+b.rowsString+"
";utils.nullOrEmpty(b.exportOptions.footer)||(c=b.exportOptions.footer,c=c.replace(/##PAGE-NUMBER##/gi,""),c=c.replace(/##CURRENT-DATE##/gi,(new Date).toLocaleString()),a+=c);b.htmlString="";b.htmlString+=""+(utils.nullOrEmpty(e._options.OptionsManager.gridTitle)?e._labels.Labels.DEFAULT_EXPORT_TITLE:e._options.OptionsManager.gridTitle)+ "";b.htmlString+="";b.htmlString+=""+a+"";h.ExportManager.save(b.htmlString,b.exportOptions);e.PivotModel.getInstance().dispatch(new events._Event(d.PivotEvent.EXPORT_COMPLETE))};b.clear=function(){b.rowIdx=0;b.htmlString="";b.rowsString="";b.dataWidth=0;b.dataHeight=0;b.grid=null;b.exportOptions=null};b.rowIdx=0;b.htmlString="";b.rowsString="";b.BLOCK_SIZE=20;return b}();h.ExportHTML=f})(e._export||(e._export={}))})(d.model|| (d.model={}))})(pivot||(pivot={})); (function(d){(function(e){(function(h){var f=function(){function b(){throw Error("Singleton");}b.run=function(a,c,g,m){b.grid=a;b.dataWidth=g;b.dataHeight=m;b.exportOptions=c;try{b.exportToXLS()}catch(k){console.error("Export XLS error:",k),d.uialert(e._labels.Labels.MESSAGE_EXPORT_ERROR,e._labels.Labels.ERROR,d.AlertType.ERROR),d.preloader(!1),e.PivotModel.getInstance().dispatch(new events._Event(d.PivotEvent.EXPORT_COMPLETE))}};b.exportToXLS=function(){d.preloader(!0,e._labels.Labels.MESSAGE_EXPORT_PROGRESS); b.rowIdx=b.grid.START_TABLE_ROW;b.xlsPadding=0;b.xlsDocument=new xls.XLS;var a=utils.nullOrEmpty(e._options.OptionsManager.gridTitle)?e._labels.Labels.DEFAULT_EXPORT_TITLE:e._options.OptionsManager.gridTitle.replace(/[^a-zA-Z\d\s\-|+@#$^&()_,.!]/g,""),a=0=c;c++)b.rowHeaderLevelsCellStyle[c]=d._view.grid.vo.StyleValueObject.fromClass(d._view.grid.vo.GridStyleName.CELL+" "+d._view.grid.vo.GridStyleName.HEADER+" "+d._view.grid.vo.GridStyleName.HEADER_ROW+" "+d._view.grid.vo.GridStyleName.LEVEL+c,uicontrols.UIElement.convert(a))};b.onXLSExportComplete=function(){b.mergeTitleCells();d.preloader(!1);b.saveXLSExport()};b.saveXLSExport=function(){b.rowIdx=b.grid.START_TABLE_ROW;0==b.exportOptions.filename.length&& (b.exportOptions.filename="pivot.xlsx");h.ExportManager.save(b.xlsDocument.toUint8Array(),b.exportOptions);b.xlsDocument=null;b.exportOptions=null;e.PivotModel.getInstance().dispatch(new events._Event(d.PivotEvent.EXPORT_COMPLETE))};b.generateXLSRow=function(){for(var a=utils.getTimer(),c=b.dataHeight+b.grid.FIRST_DATA_ROW;b.rowIdxf.width&&b.xlsDocument.sheets[0].setColumnWidth(g,b.convertPixelsToPoints(k.length+b.cellPadding)>b.convertPixelsToPoints(b.DEFAULT_CELL_WIDTH)?b.convertPixelsToPoints(b.DEFAULT_CELL_WIDTH): b.convertPixelsToPoints(k.length+b.cellPadding)))}}}return b.rowIdx>=c};b.convertToExcelDate=function(a){if(!utils.DateFormat.isUTCFormat(e._options.OptionsManager.datePattern)){var c=(new Date(a)).getTimezoneOffset();a-=6E4*c}a=-Date.parse("1899-12-30")+a;return Math.floor(a/864E5)};b.convertToExcelDateTime=function(a){if(!utils.DateFormat.isUTCFormat(e._options.OptionsManager.dateTimePattern)){var c=(new Date(a)).getTimezoneOffset();a-=6E4*c}return(-Date.parse("1899-12-30")+a)/864E5};b.px2pt=function(a){return 0.75* a};b.convertPixelsToPoints=function(a){return 0>=a?0:b.defaultExcelCellHeightPoints/b.defaultExcelCellHeightPixels*a*(b.defaultExcelCellHeightPixels/d._view.grid.sheet.GridCoords.CELL_HEIGHT)};b.convertPixelsToWidth=function(a){return 0>=a?0:((a-5)/7*100+0.5)/100};b.addXLSCustomFields=function(){var a=e.report.CustomFieldsManager.customFields;if(0k)return l="0",!a&&0f?b.maxSymbols-1:b.maxSymbols;1r)r=0;else{n=p+1;break}else r++;4<=r&&(s=Math.pow(10,n),f=Math.round(f*s)/s)}s=4s?(g=Math.round(Math.log(f)/Math.LN10),g=Math.round(Math.log(g)/Math.LN10+1),l=0>f?b.maxSymbols-g-5:b.maxSymbols-g-4,20l&&(l=1),l=f.toExponential(l)):Math.abs(f)k?(g=Math.round(Math.log(f)/ Math.LN10),g=Math.round(Math.log(-g)/Math.LN10+1),l=l-4-g,20l&&(l=1),l=f.toExponential(l)):0>k?(g=1,1f&&(l="-"+l)):l=0==k?Math.round(f).toString():f.toFixed(k);-1==l.indexOf("e")&&(l=l.split("."),g=e.formatThousands(l[0],b),s=1b.maxDecimalPlaces&&(s= s.substr(0,b.maxDecimalPlaces)),l=g+b.decimalSeparator+s):l=g);!a&&0parseFloat(d);a&&(d=d.substr(1));var c=d;if(3this.rowSortTuple.length)return!0; var c=!1;try{c=this.isRowExpanded(this.rowSortTuple.slice(0,this.rowSortTuple.length-1))}catch(a){}return c},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnSortType",{get:function(){var c=e.consts.SortType.UNSORTED;this._columnAxis&&(c=this._columnAxis.sortType,c==e.consts.SortType.UNSORTED&&this._columnAxis.totalSortMeasure&&this._columnAxis.totalSortType!=e.consts.SortType.UNSORTED&&(c=this._columnAxis.totalSortType));return c},set:function(c){this._columnAxis&& (this._columnAxis.sortType=c)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnSortTuple",{get:function(){var c;this._columnAxis&&(c=this._columnAxis.sortTuple,this._columnAxis.sortType==e.consts.SortType.UNSORTED&&this._columnAxis.totalSortMeasure&&this._columnAxis.totalSortType!=e.consts.SortType.UNSORTED&&(c=[]));return c},set:function(c){this._columnAxis&&(this._columnAxis.sortTuple=c)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"columnSortMeasure", {get:function(){var c;this._columnAxis&&(c=this._columnAxis.sortMeasure,this._columnAxis.sortType==e.consts.SortType.UNSORTED&&this._columnAxis.totalSortMeasure&&this._columnAxis.totalSortType!=e.consts.SortType.UNSORTED&&(c=this._columnAxis.totalSortMeasure));return c},set:function(c){this._columnAxis&&(this._columnAxis.sortMeasure=c)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hasColumnSorting",{get:function(){if(this.columnSortType==e.consts.SortType.UNSORTED||null==this.columnSortTuple)return!1; if(1>this.columnSortTuple.length)return!0;var c=!1;try{c=this.isColumnExpanded(this.columnSortTuple.slice(0,this.columnSortTuple.length-1))}catch(a){}return c},set:function(c){},enumerable:!0,configurable:!0});a.prototype.reset=function(c){void 0===c&&(c=!0);this.dataLoaded=!1;this._measures=new utils.AssociativeArray;this._rows=new utils.AssociativeArray;this._columns=new utils.AssociativeArray;this._pages=new utils.AssociativeArray;this._rowLevels=[];this._columnLevels=[];this._rowTuples=[];this._columnTuples= [];this.rowTuples=[];this.columnTuples=[];this.rowDepths=[];this.columnDepths=[];this._columnMaxDepth=this._rowMaxDepth=0;this.rowType=[];c&&(this._columnAxis&&(this._columnAxis.expandedTuples=[]),this._rowAxis&&(this._rowAxis.expandedTuples=[]),this._columnAxis&&(this._columnAxis.drilledTuples=[]),this._rowAxis&&(this._rowAxis.drilledTuples=[]))};a.prototype.onBeforeQuery=function(c){this.queryType=c.queryType;this.dataLoaded=!1;c.queryType==e.consts.QueryType.SELECT&&this.reset();c.queryType!=e.consts.QueryType.DRILL_UP&& c.queryType!=e.consts.QueryType.DRILL_DOWN||this.reset(!1)};a.prototype.onQueryComplete=function(){this.load()};a.prototype.onStructureLoaded=function(){this.dataLoaded=!1;this.reset()};a.prototype.load=function(){if(null==this.dataStorage&&(this.dataStorage=this.cube_.localDataStorage,null==this.dataStorage))return;if(this.slice){this._columnAxis=this.slice.findAxis(e.consts.AxisName.COLUMNS_AXIS);this._rowAxis=this.slice.findAxis(e.consts.AxisName.ROWS_AXIS);if(0==this.columnTuples.length&&0==this.rowTuples.length|| this.queryType==e.consts.QueryType.FILTER){this.isAllExpanded()?this.dataStorage.expandAll(this.slice.drillAll):(this.dataStorage.expand([],e.consts.AxisName.ROWS_AXIS,null),this.dataStorage.expand([],e.consts.AxisName.COLUMNS_AXIS,null));var c,a,b;(0this._rowMaxDepth&&(this._rowMaxDepth=this.rowDepths[c]);this._rowMaxDepth++;for(c=0;c this._columnMaxDepth&&(this._columnMaxDepth=this.columnDepths[c]);this._columnMaxDepth++;0=this._measuresPosition? this._rows.getItemAt(d+1):this._rows.getItemAt(d))0==b&&(this._fillRowTuplesStart=Date.now()),this.isClassic?this._fillRowChildren(d.allMember,c,a,b):this.fillRowChildren(d.allMember,c,a,b)};a.prototype.isEmptyOnRows=function(c){for(var a=0;a=this._measuresPosition?this._rows.getItemAt(e+1):this._rows.getItemAt(e))&&this.fillRowChildren1(e.allMember,c,a,b,d)}};a.prototype.fillRowChildren1=function(c,a,b,d,e){if(null!=c){var f=b.length;c=c.hierarchy_.sortChildren(c,!1,"");c= this.sortRowsByValue(c,a,b);for(var h,n=0;nh.length&&(this.rowType[q]=1,void 0==this.rowDepths[q]&&(this.rowDepths[q]=k));if(Date.now()- this._fillRowTuplesStartk&&(this.rowDepths[q]=k,this.rowType[q]=0)}else this.rowTuples.push(h),void 0==this.rowType[this.rowTuples.length- 1]&&(this.rowType[this.rowTuples.length-1]=0,this.rowDepths[this.rowTuples.length-1]=k)}}}}};a.prototype.fillRowLevels=function(c){this.fillLevels(this._rowLevels,c)};a.prototype.fillColumnLevels=function(c){this.fillLevels(this._columnLevels,c)};a.prototype.fillLevels=function(c,a){if(-1==c.indexOf(a.level.uniqueName))if(1>=a.level.num)c.push(a.level.uniqueName);else{var b=c.indexOf(a.parent.level.uniqueName);c.splice(b+1,0,a.level.uniqueName)}};a.prototype.isValidSortTuple=function(c,a){for(var b= 0;b=this._measuresPosition?this._columns.getItemAt(d+1):this._columns.getItemAt(d))&&this.fillColumnChildren(d.allMember, c,a,b)};a.prototype.fillColumnChildren=function(c,a,b,d){c=c.hierarchy_.sortChildren(c,!1,"");c=this.sortColumnsByValue(c,a,b);for(var e=0;e=this._measuresPosition?this._columns.getItemAt(e+1):this._columns.getItemAt(e))&&this.fillColumnChildren1(e.allMember,c,a,b,d)};a.prototype.fillColumnChildren1=function(c,a,b,d,e){var f=b.length;c=c.hierarchy_.sortChildren(c,!1,"");c=this.sortColumnsByValue(c,a,b);for(var h,n=0;nthis._measuresPosition||0==this._measuresPosition)?c.length:c.length-1};a.prototype.getRowHierarchy=function(c){c=this.getRowHierarchyIdx(c);return this._rows.getItemAt(c)};a.prototype.getColumnHierarchyIdx=function(c){return this._columnAxis.hasMeasures&&(c.length>this._measuresPosition||0==this._measuresPosition)?c.length:c.length-1};a.prototype.getColumnHierarchy=function(c){c= this.getColumnHierarchyIdx(c);return this._columns.getItemAt(c)};Object.defineProperty(a.prototype,"dataWidth",{get:function(){return this.columnTuples.length},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"dataHeight",{get:function(){return this.rowTuples.length},set:function(c){},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"extendedDataWidth",{get:function(){return this._columnTuples.length},set:function(c){},enumerable:!0,configurable:!0}); Object.defineProperty(a.prototype,"extendedDataHeight",{get:function(){return this.isClassic?(this.rowAxis&&this.rowAxis.hasMeasures?this._measures.length:1)*this.rowTuples.length:this._rowTuples.length},set:function(c){},enumerable:!0,configurable:!0});a.prototype.isRowExpanded=function(c,a){void 0===a&&(a=null);return this.dataStorage.isRowExpanded(c,a)};a.prototype.isColumnExpanded=function(c,a){void 0===a&&(a=null);return this.dataStorage.isColumnExpanded(c,a)};a.prototype.isRowDrilledDown=function(c, a,b){void 0===b&&(b=null);return this.dataStorage.isRowDrilledDown(c,a,b)};a.prototype.isColumnDrilledDown=function(c,a,b){void 0===b&&(b=null);return this.dataStorage.isColumnDrilledDown(c,a,b)};a.prototype.isAggregated=function(c,a){return this.dataStorage.isAggregated(c,a)};a.prototype.getColumnTupleIndex=function(c){c=c.slice(0);for(var a=this._columnAxis.hasMeasures,b=a?c.pop():-1,d=this._columnTuples,e=0;ec||null==this._rowAxis||null==this._measures)return null;if(a&&this._rowAxis.hasMeasures&&this.multiMeasures){if(this.isClassic){var b=Math.floor(c/this._measures.length);return null==this.rowTuples[b]?null:this.rowTuples[b].slice(0)}return null==this._rowTuples[c]?null:this._rowTuples[c][0].slice(0)}return null==this.rowTuples[c]?null:this.rowTuples[c].slice(0)};a.prototype.getColumnTuple=function(c,a){void 0===a&&(a=!1);return 0>c||null==this._columnAxis||null==this._measures?null: a&&this._columnAxis.hasMeasures&&this.multiMeasures?null==this._columnTuples[c]?null:this._columnTuples[c][0].slice():null==this.columnTuples[c]?null:this.columnTuples[c].slice()};a.prototype.getColumnTupleByName=function(c,a){return null};a.prototype.getColumnTupleForExport=function(c){return this._columnAxis.hasMeasures&&this.multiMeasures?this._columnTuples[c]:this.columnTuples[c]};a.prototype.getRowMeasure=function(c){return null==this._rowTuples[c]?null:this._rowAxis.hasMeasures&&this.multiMeasures? this._measures.getItemAt(this._rowTuples[c][1]):null};a.prototype.getRowMeasureIndex=function(c){return null==this._rowTuples[c]?-1:this._rowAxis.hasMeasures&&this.multiMeasures?this._rowTuples[c][1]:-1};a.prototype.getColumnMeasure=function(c){return null==this._columnTuples[c]?null:this._columnAxis.hasMeasures&&this.multiMeasures?this._measures.getItemAt(this._columnTuples[c][1]):null};a.prototype.getColumnMeasureIndex=function(c){return null==this._columnTuples[c]?-1:this._columnAxis.hasMeasures&& this.multiMeasures?this._columnTuples[c][1]:-1};a.prototype.getMeasure=function(c,a){if(null==this._measures||null==this._rowAxis||null==this._columnAxis)return null;if(this.multiMeasures){if(this._rowAxis.hasMeasures){if(this.isClassic){var b=c%this._measures.length;return null==this.rowTuples[Math.floor(c/this.measures.length)]?this._measures.getItemAt(0):this._measures.getItemAt(b)}return null==this._rowTuples[c]?this._measures.getItemAt(0):this._measures.getItemAt(this._rowTuples[c][1])}return null== this._columnTuples[a]?this._measures.getItemAt(0):this._measures.getItemAt(this._columnTuples[a][1])}return this._measures.getItemAt(0)};a.prototype.drillThrough=function(c,a,b){return this.dataStorage.drillThrough(c,a,b)};a.prototype.save=function(c,a,b,d,e){this.dataStorage.save(c,a,b,d,e)};a.prototype.getUpdatedValue=function(c,a,b){return this.dataStorage.getUpdatedValue(c,a,b)};a.prototype.getRecordId=function(c,a,b){return null};a.prototype.getValue=function(c,a,b){var d;if(b.aggregation==e.consts.AggregationName.PERCENT)return d= this.dataStorage.getValue([],[],b),c=this.dataStorage.getValue(c,a,b),Math.abs(100*c/d);if(b.aggregation==e.consts.AggregationName.PERCENT_COLUMN)return d=this.dataStorage.getValue([],a,b),c=this.dataStorage.getValue(c,a,b),100*c/d;if(b.aggregation==e.consts.AggregationName.PERCENT_ROW)return d=this.dataStorage.getValue(c,[],b),c=this.dataStorage.getValue(c,a,b),100*c/d;if(b.aggregation==e.consts.AggregationName.INDEX){d=this.dataStorage.getValue([],[],b);var l=this.dataStorage.getValue(c,[],b),f= this.dataStorage.getValue([],a,b);c=this.dataStorage.getValue(c,a,b);return Math.abs(d*c/(f*l))}return b.aggregation==e.consts.AggregationName.DIFFERENCE?this.getDifference(c,a,b,!1):b.aggregation==e.consts.AggregationName.PERCENT_DIFFERENCE?this.getDifference(c,a,b,!0):b.aggregation==e.consts.AggregationName.RUNNING_TOTALS?this.dataStorage.getRunningTotals(c,a,b,this.rowAxis.hasMeasures?e.consts.AxisName.ROWS_AXIS:e.consts.AxisName.COLUMNS_AXIS):this.dataStorage.getValue(c,a,b)};a.prototype.getDifference= function(c,a,b,d){return this.rowAxis.hasMeasures?this.getDifferenceColumn(c,a,b,d):this.getDifferenceRow(c,a,b,d)};a.prototype.getDifferenceColumn=function(c,a,b,d){var e;if(0e)return 0;if(0==e||0==a.length)return NaN;e=this.getColumnTuple(e-1);if(a.length!=e.length)return NaN;e=this.dataStorage.getValue(c,e,b)}else{c.slice(0);c.push(-1);e=this.getRowTupleIndex(c);c.pop();if(0==e||0==c.length)return NaN;if(0>e)return 0;e=this.getRowTuple(e- 1,!0);if(c.length!=e.length)return NaN;e=this.dataStorage.getValue(e,a,b)}c=this.dataStorage.getValue(c,a,b);return d?(c-e)/e*100:c-e};a.prototype.getDifferenceRow=function(c,a,b,d){var e;if(0e)return 0;e=this.getRowTuple(e-1);if(c.length!=e.length)return NaN;e=this.dataStorage.getValue(e,a,b)}else{a=a.slice(0);a.push(0);e=this.getColumnTupleIndex(a);a.pop();if(0==e||0==a.length)return NaN;if(0>e)return 0;e=this.getColumnTuple(e- 1,!0);if(a.length!=e.length)return NaN;e=this.dataStorage.getValue(c,e,b)}c=this.dataStorage.getValue(c,a,b);return d?(c-e)/e*100:c-e};a.prototype.calculate=function(c,a,b,d){return this.dataStorage.calculate(c,a,b,d)};a.prototype.expandData=function(c){this.dataLoaded&&(c=this.slice.allHierarchies().getItem(c),null!=c&&this.expandHierarchy(c))};a.prototype.expandHierarchy=function(c){var a=this.slice.rows.keyExists(c.uniqueName)?e.consts.AxisName.ROWS_AXIS:e.consts.AxisName.COLUMNS_AXIS,b=a==e.consts.AxisName.ROWS_AXIS? this.slice.rowsOnly.length:this.slice.columnsOnly.length;c=a==e.consts.AxisName.ROWS_AXIS?this.slice.rowsOnly.indexOf(c.uniqueName):this.slice.columnsOnly.indexOf(c.uniqueName);if(c+1!=b){var b=[],d=(a==e.consts.AxisName.ROWS_AXIS?this.slice.rowsOnly:this.slice.columnsOnly).slice(0,c+1);this.getTuples([],d,b);for(var d=a==this.slice.axisWithMeasures.uniqueName?this.slice.axisWithMeasures.measuresPosition:-1,l=0;ld?this.expand(b[l],a,h,!1):this.expand(b[l],a,null,!1)}else this.expand(b[l],a,null,!1);this.cube_.dispatch(new e.QueryCompleteEvent(e.consts.QueryType.EXPAND))}};a.prototype.getTuples=function(c,a,b,d){void 0===d&&(d=!0);if(0!=a.length)for(var e=a.getItemAt(0),e=e.hasFilter()?e.filter:e.members,f=0;fd?this.collapse(b[l],a,h,!1):this.collapse(b[l],a,null,!1)}else this.collapse(b[l],a,null,!1);this.cube_.dispatch(new e.QueryCompleteEvent(e.consts.QueryType.COLLAPSE))}}; a.prototype.expandAll=function(){this.dataLoaded&&(this.reset(),this.slice.expandAll?this.dataStorage.expandAll(this.slice.drillAll):this.cube_.select())};a.prototype.sort=function(){this.prepare();this.cube_.dispatchWith(d.model._state.StateEvent.REPORT_CHANGED)};Object.defineProperty(a.prototype,"lastRowsTupleInteracted",{get:function(){return this._lastRowsTupleInteracted},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"lastColsTupleInteracted",{get:function(){return this._lastColsTupleInteracted}, enumerable:!0,configurable:!0});a.prototype.expand=function(c,a,b,k){void 0===b&&(b=null);void 0===k&&(k=!0);a==e.consts.AxisName.ROWS_AXIS&&(this._lastRowsTupleInteracted=c);a==e.consts.AxisName.COLUMNS_AXIS&&(this._lastColsTupleInteracted=c);var l=this.slice.findAxis(a),f=c.slice(0),l=b&&l.hasMeasures?this._measures.indexOf(b.uniqueName):-1;f.unshift(l);var h=[];if(this.isAllExpanded())if(a==e.consts.AxisName.ROWS_AXIS){for(var h=[],n=this.getCollapsedRows(),l=0;lc?null:0 c?null:0d?1:bk?1: bk?1:bd?1:bc?(this._filterQuantity=-1,this._filterType=e.consts.FilterType.NONE): this._filterQuantity=c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"filterMeasureName",{get:function(){return this._filterMeasureName},set:function(c){this._filterMeasureName=c},enumerable:!0,configurable:!0});a.prototype.clearFilter=function(){this.clearMembersFilter();this.clearValuesFilter()};a.prototype.clearMembersFilter=function(){this._filter=new utils.AssociativeArray;this._filterMembers=new utils.AssociativeArray;this._filterMembersNegated=new utils.AssociativeArray}; a.prototype.clearValuesFilter=function(){this._filter=new utils.AssociativeArray;this._filterQuantity=-1;this._filterType=e.consts.FilterType.NONE;this._filterMeasureName=""};a.prototype.hasFilter=function(){return this.hasMembersFilter()||this.hasValuesFilter()};a.prototype.hasMembersFilter=function(){return 0this._level.num)return this;var c=this;do c=c.parent;while(1d.model.license.Limitations.MAX_CSV)d.uialert(d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.betaversion), d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.tooLarge)),d.preloader(!1),null!=this.errorHandler&&(this.errorHandler(),this.errorHandler=null),this.stopTimer();else{this.isFileLoaded=c.loaded==c.total;void 0!==a&&this.parseChunk(a.substring(this.lastPosition,a.length));this.lastPosition=a.length;var b=utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_LOADING_PROGRESS,utils.NumberFormatter.formatThousands(c.loaded.toFixed(0)),utils.NumberFormatter.formatThousands(c.total.toFixed(0))); d.preloader(!0,d.model._labels.Labels.MESSAGE_LOADING_DATA,b)}}catch(k){console.error(k.stack),this.onFileError()}};a.prototype.onFileConnected=function(){this.connected=!0;d.preloader(!0,d.model._labels.Labels.MESSAGE_LOADING_DATA,"")};a.prototype.setConnected=function(){null!=this.connectedHandler&&(this.connectedHandler(),this.connectedHandler=null)};a.prototype.onFileComplete=function(){if(!utils.nullOrUndefined(this.loader))try{if(0==this.lastPosition||!this.hasSizeHeader){var c=this.loader.response; this.connected=!0;c.length>d.model.license.Limitations.MAX_CSV?(d.uialert(d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.betaversion),d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.tooLarge)),d.preloader(!1),null!=this.errorHandler&&(this.errorHandler(),this.errorHandler=null),this.clear()):(this.isFileLoaded=!0,this.isStarted?this.hasSizeHeader||(this.lastPosition")||-1!=c.indexOf("")||0==c.trim().length||-1!=c.indexOf("utils.getTimer()-c&&this.rowIdx!=a;)this.parseDataRow(this.data[this.rowIdx++]);500=this.data.length};a.prototype.parseAllDataRows=function(){for(d.preloader(!0,d.model._labels.Labels.MESSAGE_ANALYZING_DATA, utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_ANALYZING_RECORDS,utils.NumberFormatter.formatThousands(this.data.length.toFixed(0))));this.rowIdx"+c[b],c.splice(b,1),b--):this.isQuoteOpen(c[b])&&(a=!0);return c};a.prototype.isQuoteOpen=function(c){return 1==this.countChar(c,this.fieldEnclosureToken)%2};a.prototype.countChar=function(c,a){var b=0;if(c)for(var d=0;dc?",":";"}};a.splitRow=function(c,a,b){void 0=== b&&(b='"');if(null==c)return[];for(var d="",e=!1,f=!1,h=[],n=0;nthis.BLOCK_SIZE?this.BLOCK_SIZE:b.byteLength,k=b.readString(m);this.defineCurrentDataSigns(k);this._dataStrFromBytes="";this._dataStrFromBytes+=k.substring(this._currentDataStartSign.length);this._bytesLoaded+=m;this._bytesToLoad=b.byteLength;if(this._bytesLoadedthis.BLOCK_SIZE?this.BLOCK_SIZE:this._bytesToLoad-this._bytesLoaded;a=a.readString(c);this._bytesLoaded+=c;this._dataStrFromBytes+=a;this.showLoadingProgress(this._bytesLoaded,this._bytesToLoad);return this._bytesLoaded>=this._bytesToLoad};b.prototype.showLoadingProgress=function(a,c){var b=utils.StringUtils.bind(d.model._labels.Labels.MESSAGE_ANALYZING_RECORDS,(a/c*100).toFixed(0)+"%");d.preloader(!0,d.model._labels.Labels.MESSAGE_LOADING,b)}; b.prototype.onComplete=function(){d.preloader(!1);this._isFileLoaded=!0;this.processStringFromBytes(this._dataStrFromBytes)};b.prototype.setConnected=function(){null!=this.connectedHandler&&(this.connectedHandler(),this.connectedHandler=null)};b.prototype.processStringFromBytes=function(a){a=utils.StringUtils.trimLeft(a);this.parseChunk(a)};b.prototype.onTick=function(){this._timerCount++;if(0this._data.length&&(c=this._data.length);this._rowIdx=this._data.length};b.prototype.parseDataRow=function(a){if(!utils.nullOrEmpty(a)&&void 0!==this._columnNames&&a!=this._currentDataStopSign){if(a.split(this.FIELD_DELIMITER).length=this._tuples.length};a.prototype.composeMember=function(){var c=this._columnsList[this._colIdx].type,a;c!=e.types.DataFieldType.DATE&&c!=e.types.DataFieldType.DATE_STRING&&c!=e.types.DataFieldType.LEVEL&&c!=e.types.DataFieldType.HIERARCHICAL_DATE&&c!=e.types.DataFieldType.HIERARCHICAL_DATE_WITH_QUARTERS&&c!=e.types.DataFieldType.TIME&&c!=e.types.DataFieldType.DATETIME&&(a=this._allHierarchies.getItem(this._columnsList[this._colIdx].uniqueName).members.getItemAt(this._tuples[this._rowIdx][this._colIdx+ this._colIdxDifference]).caption);if(c==e.types.DataFieldType.NUMBER)return null!=a?a.toString():"";if(c!=e.types.DataFieldType.STRING&&c!=e.types.DataFieldType.WEEKDAY&&c!=e.types.DataFieldType.MONTH){if(c==e.types.DataFieldType.LEVEL){c=this._allHierarchies.getItem(this._columnsList[this._colIdx].hierarchy);a=c.members.getItemAt(this._tuples[this._rowIdx][this._colIdx+this._colIdxDifference]).caption;for(var b=this._colIdx,d=0;dd.model.license.Limitations.MAX_JSON?(d.uialert(d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.betaversion),d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.tooLarge)),d.preloader(!1),null!=this.errorHandler&&(this.errorHandler(),this.errorHandler=null),this.clear()):(this.isFileLoaded=!0,this.parseChunk(c))}};a.prototype.parseChunk=function(c){try{var a=JSON.parse(c);utils.nullOrUndefined(a.items)||(a=a.items); if(utils.nullOrUndefined(a.length)){this.invalidFormat();return}}catch(b){this.invalidFormat();return}d.preloader(!1);this.addData(a)};a.prototype.addData=function(c){utils.nullOrUndefined(c.items)||(c=c.items);if(!(utils.nullOrUndefined(c)||1>c.length))if(JSON.stringify(c).length>d.model.license.Limitations.MAX_JSON&&15649632E5d.model.license.Limitations.MAX_JSON)d.uialert(d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.betaversion),d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.tooLarge)); else{this.setConnected();var a=!1,b=c[0]&&c[0]instanceof Array;b?this.parseHeader(c[0].toString(),c[1].toString()):a=this.cube_.structure_.addDataStructure(c[0]);this.data=c.slice();this.factsCounter=0;(a||b)&&this.data.shift();this.parseAllDataRows();this.onParseComplete()}};a.prototype.updateData=function(c){if(!(utils.nullOrUndefined(c)||1>c.length))if(JSON.stringify(c).length>d.model.license.Limitations.MAX_JSON&&15649632E5d.model.license.Limitations.MAX_JSON)d.uialert(d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.betaversion), d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.tooLarge));else{this.cube_.localDataStorage.clearUpdates();for(var a=c[1]&&c[1]instanceof Array,b=0;bthis.notReadyCount++?this.notReadyTimeout=utils.fmSetTimeout(function(){c.draw(a)},10):this.parentContainer.visible&&(console.error("WebDataRocks:\nPivot cannot be drawn."),console.error("document.visibilityState:",document.visibilityState),"hidden"!=document.visibilityState&&alert("WebDataRocks:\nPivot cannot be drawn."))};b.prototype.clearDelays=function(){for(;0WebDataRocks.com');c.addClass("wdr-credits");this.addChild(c); utils.fmdocument.addEventListener("keydown",function(c){return a.onKeyDown(c)});this.container.attr("tabindex",0);this.container.addEventListener("focusin",function(c){a.isFocused=!0});this.container.addEventListener("focusout",function(c){a.isFocused=!1});this._resizeListener=new utils.ResizeListener(this.parentContainer.parent);this._resizeListener.addEventListener(events._Event.RESIZE,function(c){return a.onWindowResize(c)});this.isUIReady=!0};b.prototype._draw=function(a){void 0===a&&(a=!1);null!= this.model_&&(this.drawn=!0,this.updateContainerSize(),null!=this.filterView&&this.filterView.draw(),utils.nullOrUndefined(this.model_.state_.connectionInfo_)||this.model_.state_.connectionInfo_.isEmpty||!d.model._options.OptionsManager.configuratorButton?this.fieldsView.hide():this.fieldsView.show(),a||d.model._options.OptionsManager.configuratorActive||e.calculated.CalculatedView.addingMeasureFlag||(d.model._options.OptionsManager.configuratorOpened=!1),null!=this.model_.cube_.slice_&&this.model_.cube_.slice_.isEmpty&& (d.model._options.OptionsManager.configuratorOpened=!0),d.model._options.OptionsManager.configuratorOpened&&null!=this.model_.state_.connectionInfo_&&!this.model_.state_.connectionInfo_.isEmpty?this.fieldsView.open(this.model_.cube_.structure_,this.model_.cube_.slice_,this.model_.state_.connectionInfo_.dataSourceType):this.fieldsView.close(),this.drawGrid(a),null!=this.drillThroughView&&this.drillThroughView.isVisible()&&(d.model._options.OptionsManager.flatView?this.drillThroughView.close():this.drillThroughView.redraw()), this.lastWidth=this.getWidth(),this.lastHeight=this.getHeight())};b.prototype.drawEmptyView=function(){this.drawGrid(!1,!0);utils.nullOrUndefined(this.fieldsView)||this.fieldsView.close()};b.prototype.drawGrid=function(a,c){void 0===a&&(a=!1);void 0===c&&(c=!1);null!=this.gridView&&(a||null==this.filterView||this.filterView.close(),this.gridView.dataProvider=c?null:this.model_.dataProvider_=d.data_.dataprovider_.DataProviderFactory.getDataProvider(),this.gridView.container.css("top","").css("left", "").css("right","").css("bottom",""),this.gridView.container.css("position","absolute"),this.gridView.show(),this.gridView.container.css("height",b.gridHeight+"px"),this.gridView.container.css("width",b.stageWidth+"px"),a||this.model_.cube_.connectionInfo_&&this.model_.cube_.connectionInfo_.isUpdateData||this.gridView.clearSizes(),this.gridView.draw(),d.model._options.OptionsManager.flatView&&this.fieldsView.isOpen&&this.fieldsView.open(this.model_.cube_.structure_,this.model_.cube_.slice_,this.model_.state_.connectionInfo_.dataSourceType))}; b.prototype.onDrillThroughOpen=function(a){null==this.drillThroughView&&this.addDrillThroughView();this.drillThroughView.addEventListener(e.grid.GridEvent.DRILLTHROUGH_CLOSED,this.drillthroughClosedHandler);var c=this.model_.cube_.structure_.findMeasure(a.data.measure);this.drillThroughView.openView(this.model_.dataProvider_,this.model_.cube_.slice_,a.data.columnTuple,a.data.rowTuple,c)};b.prototype.onDrillThroughClosed=function(){this.drillThroughView.removeEventListener(e.grid.GridEvent.DRILLTHROUGH_CLOSED, this.drillthroughClosedHandler);this.model_.cube_.refresh()};b.prototype.openFieldsList=function(){null!=this.model_.state_.connectionInfo_&&this.fieldsView.open(this.model_.cube_.structure_,this.model_.cube_.slice_,this.model_.state_.connectionInfo_.dataSourceType)};b.prototype.onFieldsViewApplySlice=function(a){d.Pivot.instance.runQuery(a.data)};b.prototype.onFilterOpenGrid=function(a){null==this.filterView&&this.addFilterView();this.onFilterOpen(a)};b.prototype.onFilterOpen=function(a){var c={hierarchy:d.data_._structure.GenericHierarchy.toObject(a.hierarchy)}; d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.FILTER_OPEN,c));this.openFilter(a.hierarchy)};b.prototype.openFilter=function(a){null==this.filterView&&this.addFilterView();this.filterView.openView(a)};b.prototype.closeFieldsList=function(){this.fieldsView.close()};b.prototype.onFieldsViewOpen=function(a){this.openFieldsList()};b.prototype.onWindowOpenClose=function(a){};b.prototype.onKeyDown=function(a){this.isFocused&&(73===a.keyCode&&a.ctrlKey&& a.altKey&&this.showLicenseInfo(),27===a.keyCode&&(null!=this.filterView&&this.filterView.close(),null!=this.drillThroughView&&this.drillThroughView.close(),null!=this.calculatedView&&this.calculatedView.isVisible()?this.calculatedView.close():this.fieldsView.close()))};b.prototype.onExport=function(a){this.drillThroughView&&this.drillThroughView.isVisible()?this.drillThroughView.exportTo(a.exportType,a.exportOptions,a.callbackHandler):this.gridView.exportTo(a.exportType,a.exportOptions,a.callbackHandler)}; b.prototype.onPrint=function(){this.gridView.print()};b.prototype.showLicenseInfo=function(){var a=new Date(parseFloat(d.Pivot.BUILD_DATE)/61),a=d.Pivot.BUILD_VERSION+" (build "+utils.StringUtils.toDateTime(a.getTime())+")

",a=a+d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.info);d.uialert(a,d.model.license.LicenseLabels.getLabel(d.model.license.LicenseLabels.componentInfo),d.AlertType.INFO)};b.prototype.getCell=function(a,c){return this.gridView.getCell(a,c)};b.prototype.getSelectedCell= function(){return this.gridView.getSelectedCell()};b.prototype.setSelectedCell=function(a,c){this.gridView.setSelectedCell(a,c)};b.prototype.removeSelection=function(){this.gridView.removeSelection()};b.prototype.onOpenCalculatedView=function(a){null==this.calculatedView&&this.addCalculatedView();this.calculatedView.openView(a.data?a.data.measureName:"")};b.prototype.onOpenContextMenu=function(a){null==this.contextMenu&&this.addContextMenu();this.contextMenu.showWith(this.container,a.data.menuItems, a.data.coords)};b.prototype.onAfterGridDraw=function(){var a=this;0==this.delayedDraws.length&&(this.renderCompleteTimeout=utils.fmSetTimeout(function(){a.dispatchWith(e.ViewEvent.RENDER_COMPLETE)},1))};b.prototype.addCalculatedView=function(){this.calculatedView=new e.calculated.CalculatedView;this.addChild(this.calculatedView)};b.prototype.addDrillThroughView=function(){this.drillThroughView=new e.grid.DrillThroughView;this.addChild(this.drillThroughView)};b.prototype.addFilterView=function(){var a= this;this.filterView=new e.filter.FilterView;this.filterView.addEventListener(events._Event.OPENED,function(c){return a.onWindowOpenClose(c)});this.filterView.addEventListener(events._Event.CLOSED,function(c){return a.onWindowOpenClose(c)});this.addChild(this.filterView)};b.prototype.getToolbar=function(){return this.toolbar};b.prototype.addContextMenu=function(){this.contextMenu=new e.ContextMenuView;this.contextMenu.hide();this.addChild(this.contextMenu)};b.prototype.dispose=function(){this.model_= null;this.gridView.dispose();this.container.dispose();this.parentContainer.dispose();e.AlertView.dispose();e.filter.FilterModel.dispose();e.PreloaderView.dispose();uicontrols.dragndrop.DragManager.dispose();b.stage=null;this._resizeListener&&(this._resizeListener.dispose(),this._resizeListener=null)};return b}(uicontrols.containers.UIContainer);e.PivotView=h})(d._view||(d._view={}))})(pivot||(pivot={})); (function(d){(function(d){var h=function(){function f(){this._timer=0;this._show=!1;this._details=this._message="";this._transparent=!1}f.prototype.show=function(b,a,c,g,d){var k=this;void 0===g&&(g=!0);void 0===d&&(d=!1);b?(d&&this.showImmediately(b,a,c,g),!1==this._show?(this._show=b,this._message=a,this._details=c,this._transparent=g,this._timer=utils.fmSetTimeout(function(){return k.timerHandler()},f.DELAY)):0==this._timer?this.showImmediately(b,a,c,g):(this._show=b,this._message=a,this._details= c,this._transparent=g)):(d&&this.showImmediately(b,a,c,g),!0==this._show&&(this._show=b,this._timer=utils.fmSetTimeout(function(){return k.timerHandler()},f.DELAY)))};f.prototype.showImmediately=function(b,a,c,g){this.resetTimer();this.preloaderFunction(b,a,c,g)};f.prototype.timerHandler=function(){this.resetTimer();this.preloaderFunction(this._show,this._message,this._details,this._transparent)};f.prototype.resetTimer=function(){utils.fmClearTimeout(this._timer);this._timer=0};f.prototype.preloaderFunction= function(b,a,c,g){d.PreloaderView.getInstance()&&d.PreloaderView.getInstance().openView(b,a,c,g)};f.getInstance=function(){null==f._instance&&(f._instance=new f);return f._instance};f.dispose=function(){f._instance=null};f.DELAY=250;return f}();d.Preloader=h})(d._view||(d._view={}))})(pivot||(pivot={})); (function(d){(function(d){var h=function(f){function b(){var a=this;if(null!=b._instance)throw Error("Singleton");a=f.call(this,d.PivotView.stage.container)||this;a.setId("wdr-preloader-view");a.setControls();return a}__extends(b,f);b.prototype.openView=function(a,c,b,d){void 0===a&&(a=!0);void 0===c&&(c="");void 0===b&&(b="");void 0===d&&(d=!0);this._message=c;this._details=b;this._transparent=d;a?this.open():this.close()};b.prototype.open=function(){f.prototype.open.call(this);this.draw()};b.prototype.setControls= function(){this.overlay.addClass("wdr-overlay-preloader");this.overlay.removeEventListener("click",this._overlayClickHandler);this._imgSpinner=new uicontrols.UIComponentBase("div");this._imgSpinner.setId("wdr-spinner");this.addChild(this._imgSpinner);this._txtMessage=new uicontrols.UILabel;this._txtMessage.setId("wdr-message-label");this.addChild(this._txtMessage);this._txtDetails=new uicontrols.UILabel;this._txtDetails.setId("wdr-details-label");this.addChild(this._txtDetails);this.hide();d.PivotView.stage.addChild(this)}; b.prototype.draw=function(){this.overlay.setOpaque(!this._transparent);this.setMessage(this._message);this.setDetails(this._details);this.validate()};b.prototype.setMessage=function(a){this._txtMessage.setLabel(a)};b.prototype.setDetails=function(a){this._txtDetails.setLabel(a)};b.prototype.close=function(){f.prototype.close.call(this);this.clear()};b.prototype.clear=function(){this.setMessage("");this.setMessage("")};b.getInstance=function(){if(null==d.PivotView.stage)return null;null==b._instance&& (b._instance=new b);return b._instance};b.dispose=function(){b._instance=null};return b}(uicontrols.containers.UIPopup);d.PreloaderView=h})(d._view||(d._view={}))})(pivot||(pivot={})); (function(d){(function(d){var h=function(f){function b(){var a=f.call(this)||this;a.setId("wdr-context-menu");a.list=new uicontrols.lists.UIList;a.list.setItemRendererFactory(a.itemRendererFactory);a.list.setLabelField("caption");a.list.addEventListener(events._Event.CHANGE,function(c){return a.onListChange(c)});a.addChild(a.list);a.container.disableSelection();return a}__extends(b,f);b.prototype.showWith=function(a,c,b){var m=this;0!=c.length&&(this.setData(c),this.show(),a=a.getOffset(),b.top-= a.top+5,b.left-=a.left+5,this.container.offset(b),this.container.addEventListener("mouseleave",function(){return m.hide()}),utils.browserVersion().isMobile?d.PivotView.stage.container.addEventListener("touchstart",function(c){return m.onStageMouseDown(c)}):d.PivotView.stage.container.addEventListener("mousedown",function(c){return m.onStageMouseDown(c)}))};b.prototype.onStageMouseDown=function(a){null==uicontrols.UIElement.convert(a.target).closest("#wdr-context-menu")&&this.hide()};b.prototype.setData= function(a){for(var c=[],b=0;b=l+1?(c=0,a=c+f,b=c+(f-l)-1):(b=0,c=0this.dataProvider.extendedDataHeight-1||e>this.dataProvider.extendedDataWidth-1)&&!(this.isFlatTable&&"on"==d.model._options.OptionsManager.showGrandTotals&&"bottom"==d.model._options.OptionsManager.grandTotalsPosition&&k==this.dataProvider.extendedDataHeight&&e<=this.dataProvider.extendedDataWidth-1))return null;var f=this.dataProvider.getRowTuple(k,!0),h=this.dataProvider.getColumnTuple(e,!0);if(null==f&&null==h)return null;var n=this.dataProvider.getMeasure(k, e);if(this.isFlatTable&&"on"==d.model._options.OptionsManager.showGrandTotals&&"top"==d.model._options.OptionsManager.grandTotalsPosition&&(d.model._options.OptionsManager.showHierarchyCaptions&&1==c||!d.model._options.OptionsManager.showHierarchyCaptions&&0==c)||this.isFlatTable&&"on"==d.model._options.OptionsManager.showGrandTotals&&"bottom"==d.model._options.OptionsManager.grandTotalsPosition&&(d.model._options.OptionsManager.showHierarchyCaptions&&c==this.dataProvider.extendedDataHeight+1||!d.model._options.OptionsManager.showHierarchyCaptions&& c==this.dataProvider.extendedDataHeight))return this.getFlatGrandTotal(f,h,n);if(null==f)return b=1==(d.model._options.OptionsManager.classicView?1:this.dataProvider.rowsOnly.length)&&0==this.dataProvider.columnCount?c-this.START_HEADERS_ROW:c-this.START_HEADERS_ROW-1,0==this.dataProvider.rowsOnly.length&&0==this.dataProvider.columnsOnly.length&&(b=c-this.START_HEADERS_ROW),c=this.dataProvider.getColumnDepth(e),this.getColumnCell(h,n,c,b,a);e=this.dataProvider.getRowDepth(k);k=this.dataProvider.getRowType(k); return null==h?d.model._options.OptionsManager.classicView?this._getRowCell(f,n,e,a,k):this.getRowCell(f,n,e):this.getDataCell(f,h,n,c,a,b,e,k)};a.prototype.getDataCell=function(c,a,b,k,e,f,r,n){void 0===f&&(f=!1);void 0===r&&(r=NaN);void 0===n&&(n=-1);if(null==b)return null;var p=b.getFormat().clone();if(b.aggregation==d.data_.consts.AggregationName.PERCENT||b.aggregation==d.data_.consts.AggregationName.PERCENT_COLUMN||b.aggregation==d.data_.consts.AggregationName.PERCENT_ROW||b.aggregation==d.data_.consts.AggregationName.PERCENT_DIFFERENCE)p.currencySymbol= "%",p.currencySymbolAlign="right";var q=new h.vo.GridCell;q.isValue=!0;q.columnTuple=a;q.measure=b;q.hierarchy=this._model.cube_.structure_.measureToHierarchy(b.uniqueName);q.rowTuple=c;d.model._options.OptionsManager.classicView?0==c.length?q.level=0:(r=this.getLevelIdxByTuple(c),-1c.length||this.dataProvider.columnCount>a.length){f= !0;q.isTotalRow=this.dataProvider.rowCount>c.length;q.isTotalColumn=this.dataProvider.columnCount>a.length;if("on"!=d.model._options.OptionsManager.showTotals){t=this.dataProvider.measureDepth;if(0!=c.length&&(this.dataProvider.isRowExpanded(c)||this.dataProvider.isRowExpanded(c,b))&&("off"==d.model._options.OptionsManager.showTotals||"columns"==d.model._options.OptionsManager.showTotals)||0!=a.length&&(this.dataProvider.isColumnExpanded(a)||this.dataProvider.isColumnExpanded(a,b))&&("off"==d.model._options.OptionsManager.showTotals|| "rows"==d.model._options.OptionsManager.showTotals))return null;if(0==t&&1=c&&1==this.dataProvider.measures.length)return this.getGrandTotalCell(a,d.data_.consts.AxisName.COLUMNS_AXIS);c="on"==d.model._options.OptionsManager.showGrandTotals||"rows"==d.model._options.OptionsManager.showGrandTotals?this.FIRST_DATA_COLUMN+ this.dataProvider.extendedDataWidth-this.dataProvider.measures.length:this.FIRST_DATA_COLUMN+this.dataProvider.extendedDataWidth;return this.dataProvider.columnAxis.hasMeasures&&0==k&&e>=c&&1=c||1==this.dataProvider.columnAxis.hierarchies.length?this.getGrandTotalCell(a,d.data_.consts.AxisName.COLUMNS_AXIS):this.getHeaderCell():this.dataProvider.columnAxis.hasMeasures&&0this.dataProvider.measuresPosition||0==this.dataProvider.measuresPosition)?c.length:c.length-1,r=this.dataProvider.columns.getItemAt(f);this.dataProvider.columnAxis.hasMeasures&& f>this.dataProvider.measuresPosition&&(1==this.dataProvider.measures.length?f--:b++);if(b>k)return 0<=k?this.getEmptyHeaderCell():null;e=new h.vo.GridCell;e.isColumnHeader=!0;e.measure=this.dataProvider.columnAxis.hasMeasures&&(1this.dataProvider.measures.length)e.label=a.caption,e.isMeasureHeader=!0,p=null;else{if(this.dataProvider.columnAxis.hasMeasures&&0c.length;e.tuple=c;e.url=void 0;e.hierarchy=r;e.member=p;return e};a.prototype._getFlatTableColumnCell=function(c,a,b,e){e=this.dataProvider.getColumnHierarchy(c);if(null==e){if(null==a)return null;b=new h.vo.GridCell;b.isColumnHeader=!0;b.label=a.caption;return b}b=new h.vo.GridCell;b.isColumnHeader= !0;b.isFilterHeader=!0;b.hasHierarchyName=e.filterEnabled;b.filtered=e.hasFilter();b.label=e.caption;b.tuple=c;b.hierarchy=e;b.member=null;b.measure=a;b.draggable=!0;if("on"==d.model._options.OptionsManager.sorting||"columns"==d.model._options.OptionsManager.sorting)b.sortable=!0,!this.dataProvider.columnSortTuple||this.dataProvider.columnSortTuple.toString()!=c.toString()||this.dataProvider.columnSortMeasure!=a&&null!=a||(c=this.dataProvider.columnSortType,c==d.data_.consts.SortType.DESC?b.sortedDesc= !0:c==d.data_.consts.SortType.ASC&&(b.sortedAsc=!0));return b};a.prototype.getHeaderCell=function(){var c=new h.vo.GridCell;c.isColumnHeader=!0;return c};a.prototype.getEmptyHeaderCell=function(){var c=this.getHeaderCell();c.isEmpty=!0;return c};a.prototype.getGrandTotalCell=function(c,a){var b=new h.vo.GridCell;b.label=null==c?d.model._labels.Labels.GRID_GRAND_TOTAL:c.grandTotalCaption;b.isMeasureHeader=null!=c;if(a==d.data_.consts.AxisName.COLUMNS_AXIS){b.isColumnHeader=!0;b.isTotalColumn=b.isGrandTotalColumn= !0;if("on"==d.model._options.OptionsManager.sorting||"columns"==d.model._options.OptionsManager.sorting)b.sortable=!0,!this.dataProvider.columnSortTuple||""!=this.dataProvider.columnSortTuple.toString()||this.dataProvider.columnSortMeasure!=c&&null!=c||(this.dataProvider.columnSortType==d.data_.consts.SortType.DESC?b.sortedDesc=!0:this.dataProvider.columnSortType==d.data_.consts.SortType.ASC&&(b.sortedAsc=!0));this.dataProvider.columnAxis.hasMeasures?b.measure=c:b.label=d.model._labels.Labels.GRID_GRAND_TOTAL}else{b.isRowHeader= !0;b.isTotalRow=b.isGrandTotalRow=!0;if("on"==d.model._options.OptionsManager.sorting||"rows"==d.model._options.OptionsManager.sorting)b.sortable=!0,!this.dataProvider.rowSortTuple||""!=this.dataProvider.rowSortTuple.toString()||this.dataProvider.rowSortMeasure!=c&&null!=c||(this.dataProvider.rowSortType==d.data_.consts.SortType.DESC?b.sortedDesc=!0:this.dataProvider.rowSortType==d.data_.consts.SortType.ASC&&(b.sortedAsc=!0));this.dataProvider.rowAxis.hasMeasures?b.measure=c:b.label=d.model._labels.Labels.GRID_GRAND_TOTAL; b.level=0}b.tuple=[];return b};a.prototype.getRowCell=function(c,a,b){if(0==c.length)return this.getGrandTotalCell(a,d.data_.consts.AxisName.ROWS_AXIS);var e=this.dataProvider.rowAxis.hasMeasures&&c.length>this.dataProvider.measuresPosition?c.length:c.length-1,l=c[c.length-1],f=this.dataProvider.rows.getItemAt(e),r=new h.vo.GridCell;r.isRowHeader=!0;var n=!1,l=f.members.getItemAt(l);r.level=b;null!=a&&this.dataProvider.rowAxis.hasMeasures&&this.dataProvider.multiMeasures&&e<=this.dataProvider.measuresPosition? (r.label=a.caption,l=null):l&&(r.label=l.caption,n=c.length!=this.dataProvider.rowCount&&!l.isAll);b=null==l?!1:this.dataProvider.isRowDrilledDown(c,l,a);l&&!l.isAll&&l.hierarchy_.isHierarchy&&!l.isLeaf&&(1!=l.children.length||l.children.getItemAt(0).caption!=d.model._labels.Labels.MEMBER_BLANK&&l.children.getItemAt(0).caption!=d.model._labels.Labels.INVALID_DATE)&&(d.model._options.OptionsManager.showHierarchies?b?r.drilledDown=!0:r.drilledUp=!0:b?r.expanded=!0:r.collapsed=!0);n&&!b&&(this.dataProvider.isRowExpanded(c, a)?r.expanded=!0:r.collapsed=!0);if("on"==d.model._options.OptionsManager.sorting||"rows"==d.model._options.OptionsManager.sorting)r.sortable=!0,this.dataProvider.rowSortTuple&&this.dataProvider.rowSortTuple.toString()==c.toString()&&this.dataProvider.rowSortMeasure==a&&(this.dataProvider.rowSortType==d.data_.consts.SortType.DESC?r.sortedDesc=!0:this.dataProvider.rowSortType==d.data_.consts.SortType.ASC&&(r.sortedAsc=!0));r.isTotalRow=this.dataProvider.rowCount>c.length;r.tuple=c;r.url=void 0;r.hierarchy= f;r.member=l;r.measure=this.dataProvider.rowAxis.hasMeasures&&1c.length;f.isClassicTotalRow=f.isTotalRow&&2==l;p=!1;b>e&&(p=!0);b>e&&2==l&&(p=!0);b+1q)if(w.isAll)u=!0;else return f;else if(0q)return utils.nullOrEmpty(f.label)&&(f.isEmpty=!0),t=this.getLevelIdxByTuple(c),-1b?!1:!0);return f};a.prototype.getLevelIdxByTuple=function(c){return(c=this.dataProvider.getRowHierarchy(c).members.getItemAt(c[c.length-1]))?this.dataProvider.rowLevels.indexOf(c.level.uniqueName):-1};a.prototype.onGridClick=function(c){utils.nullOrUndefined(c.cell)||!c.cell.isColumnHeader&&!c.cell.isRowHeader||(c.cell.activeElementType== h.vo.GridCellElementType.DRILL?this.drill(c.cell):c.cell.activeElementType==h.vo.GridCellElementType.LINK&&c.cell.isLink||(utils.nullOrUndefined(c.cell.member)||c.cell.activeElementType==h.vo.GridCellElementType.RIGHT_ICON?c.cell.activeElementType==h.vo.GridCellElementType.RIGHT_ICON&&(c.cell.isColumnHeader&&this.sortColumn(c.cell),c.cell.isRowHeader&&this.sortRow(c.cell)):d.model._options.OptionsManager.showHierarchies||c.cell.member.isLeaf?this.expandCollapse(c.cell):this.drill(c.cell)))};a.prototype.onFilterClick= function(c){d.model._options.OptionsManager.showFilter&&this.dispatch(new e.FilterOpenEvent(c.hierarchy))};a.prototype.drill=function(c){if(c.drilledUp||c.drilledDown||c.expanded||c.collapsed){var a=c.tuple,b=d.model._options.OptionsManager.classicView?null:c.measure,e=c.member;if(null!=e&&!e.isAll&&!e.isLeaf){var f;c.isRowHeader?(c=d.data_.consts.AxisName.ROWS_AXIS,f=this.dataProvider.isRowDrilledDown(a,e,b)):(c=d.data_.consts.AxisName.COLUMNS_AXIS,f=this.dataProvider.isColumnDrilledDown(a,e,b)); f?this.dataProvider.drillUp(a,e,c,b):this.dataProvider.drillDown(a,e,c,b)}}};a.prototype.expandCollapse=function(c){if(c.expanded||c.collapsed){var a=c.tuple,b=c.isColumnHeader?d.data_.consts.AxisName.COLUMNS_AXIS:d.data_.consts.AxisName.ROWS_AXIS,e=d.model._options.OptionsManager.classicView&&b==d.data_.consts.AxisName.ROWS_AXIS?null:c.measure;c.expanded?(this.gridLayout.clearData(),this.dataProvider.collapse(a,b,e)):c.collapsed&&(this.gridLayout.clearData(),this.dataProvider.expand(a,b,e));c.isColumnHeader? this.gridLayout.clearColSizes(c.colIdx+1):this.gridLayout.clearRowSizes(c.rowIdx+1)}};a.prototype.onGridSingleDoubleClick=function(c){c.isSingleClick?this.singleClick(c.cell):(this.isDrillThroughAvailable&&d.model._options.OptionsManager.drillThrough&&!this.isFlatTable&&this.drillThrough(c.cell),this.doubleClick(c.cell))};a.prototype.drillThrough=function(c){c.isValue&&!c.measure.calculated&&this.dispatchWith(e.ViewEvent.DRILL_THROUGH_OPEN,this,{measure:c.measure.uniqueName,columnTuple:c.columnTuple, rowTuple:c.rowTuple})};a.prototype.singleClick=function(c){var a=c.toObject();this.setCoordsToCell(a,c.colIdx,c.rowIdx);d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.CELL_CLICK,a))};a.prototype.doubleClick=function(c){var a=c.toObject();this.setCoordsToCell(a,c.colIdx,c.rowIdx);d.model.JavaScriptHandlers.getInstance().dispatch(new d.model.APIEvent(d.model.JavaScriptHandlers.CELL_DOUBLE_CLICK,a))};a.prototype.setCoordsToCell=function(c,a,b){c.x=this.gridLayout.coords.getRelativeColX(a, this.gridLayout.isSmooth);c.y=this.gridLayout.coords.getRelativeRowY(b,this.gridLayout.isSmooth);c.width=this.gridLayout.coords.getColWidth(a);c.height=this.gridLayout.coords.getRowHeight(b)};a.prototype.sortRow=function(c,a){void 0===a&&(a="");var b=c.tuple,e=c.measure;null==e&&(e=this.dataProvider.measures.getItemAt(0));this.dataProvider.rowSortTuple&&this.dataProvider.rowSortTuple.toString()==b.toString()&&this.dataProvider.rowSortMeasure==e?this.dataProvider.rowSortType=this.dataProvider.rowSortType== d.data_.consts.SortType.DESC?d.data_.consts.SortType.ASC:d.data_.consts.SortType.DESC:(this.dataProvider.rowSortType=d.data_.consts.SortType.DESC,this.dataProvider.rowSortTuple=b,this.dataProvider.rowSortMeasure=e);""!=a&&(this.dataProvider.rowSortType=a);this.dataProvider.sort();this.gridLayout.clearColSizes(0);this.draw()};a.prototype.sortColumn=function(c,a){void 0===a&&(a="");var b=c.tuple,e=c.measure;null==e&&(e=this.dataProvider.measures.getItemAt(0));b&&this.dataProvider.columnSortTuple&&this.dataProvider.columnSortTuple.toString()== b.toString()&&this.dataProvider.columnSortMeasure==e?this.dataProvider.columnSortType=this.dataProvider.columnSortType==d.data_.consts.SortType.DESC?d.data_.consts.SortType.ASC:d.data_.consts.SortType.DESC:(this.dataProvider.columnSortType=e.type==d.data_.types.MeasureType.COUNT?d.data_.consts.SortType.ASC:d.data_.consts.SortType.DESC,this.dataProvider.columnSortTuple=b,this.dataProvider.columnSortMeasure=e);""!=a&&(this.dataProvider.columnSortType=a);this.dataProvider.sort();this.gridLayout.clearRowSizes(0); this.draw()};a.prototype.clearColumnSorting=function(){this.dataProvider.columnSortType=d.data_.consts.SortType.UNSORTED;this.dataProvider.columnSortTuple=null;this.dataProvider.columnSortMeasure=null;this._model.cube_.clearSortValues(this.dataProvider.rowAxis);this.dataProvider.sort();this.gridLayout.clearRowSizes(0);this.draw()};a.prototype.clearRowSorting=function(){this.dataProvider.rowSortType=d.data_.consts.SortType.UNSORTED;this.dataProvider.rowSortTuple=null;this.dataProvider.rowSortMeasure= null;this._model.cube_.clearSortValues(this.dataProvider.columnAxis);this.dataProvider.sort();this.gridLayout.clearColSizes(0);this.draw()};a.prototype.onLongPress=function(c,a){var b=this.gridLayout.getCellByElement(c.target);null==b||utils.nullOrEmpty(b.label)&&isNaN(b.value)||(this.showContextMenu(b,{left:a.clientX,top:a.clientY}),this.gridLayout.deselect())};a.prototype.onContextMenu=function(c){var a=this.gridLayout.selectedCells[0]||this.gridLayout.getCellByElement(c.target);null==a||utils.nullOrEmpty(a.label)&& isNaN(a.value)||(c.preventDefault(),this.showContextMenu(a,{left:c.clientX,top:c.clientY}),this.gridLayout.deselect())};a.prototype.showContextMenu=function(c,a){var b=this;if(null!=c){var k=[];!c.isValue||isNaN(c.value)||this.isFlatTable||c.measure.calculated||!d.model._options.OptionsManager.drillThrough||k.push({caption:d.model._labels.Labels.CONTEXT_MENU_DRILL_THROUGH,handler:function(){b.drillThrough(c)}});c.isFilterHeader&&d.model._options.OptionsManager.showFilter&&k.push({caption:d.model._labels.Labels.CONTEXT_MENU_OPEN_FILTER, handler:function(){b.dispatch(new e.FilterOpenEvent(c.hierarchy))}});if(c.isRowHeader||c.isColumnHeader)c.expanded&&k.push({caption:d.model._labels.Labels.CONTEXT_MENU_COLLAPSE,handler:function(){b.expandCollapse(c)}}),c.collapsed&&k.push({caption:d.model._labels.Labels.CONTEXT_MENU_EXPAND,handler:function(){b.expandCollapse(c)}});c.isRowHeader&&!c.isFilterHeader&&(c.sortedDesc||k.push({caption:d.model._labels.Labels.CONTEXT_MENU_SORT_ROW_DESC,handler:function(){b.sortRow(c,d.data_.consts.SortType.DESC)}}), c.sortedAsc||k.push({caption:d.model._labels.Labels.CONTEXT_MENU_SORT_ROW_ASC,handler:function(){b.sortRow(c,d.data_.consts.SortType.ASC)}}),(c.sortedAsc||c.sortedDesc)&&k.push({caption:d.model._labels.Labels.CONTEXT_MENU_CLEAR_SORTING,handler:function(){b.clearRowSorting()}}));c.isColumnHeader&&!c.isFilterHeader&&(c.sortedDesc||k.push({caption:d.model._labels.Labels.CONTEXT_MENU_SORT_COLUMN_DESC,handler:function(){b.sortColumn(c,d.data_.consts.SortType.DESC)}}),c.sortedAsc||k.push({caption:d.model._labels.Labels.CONTEXT_MENU_SORT_COLUMN_ASC, handler:function(){b.sortColumn(c,d.data_.consts.SortType.ASC)}}),(c.sortedAsc||c.sortedDesc)&&k.push({caption:d.model._labels.Labels.CONTEXT_MENU_CLEAR_SORTING,handler:function(){b.clearColumnSorting()}}));0=f);q++);if(e>=f)break}};Object.defineProperty(a.prototype,"isFlatTable",{get:function(){return d.model._options.OptionsManager.flatView},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isDrillThroughAvailable",{get:function(){return!d.model._options.OptionsManager.flatView},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"gridLayout",{get:function(){return this._gridLayout},enumerable:!0,configurable:!0});a.prototype.exportTo=function(c,a,b){c== d.model._export.ExportType.HTML&&d.model._export.ExportHTML.run(this,a,this.dataProvider.extendedDataWidth,this.dataProvider.extendedDataHeight);c==d.model._export.ExportType.PDF&&d.model._export.ExportPDF.run(this,a,this.dataProvider.extendedDataWidth,this.dataProvider.extendedDataHeight);c==d.model._export.ExportType.EXCEL&&d.model._export.ExportXLS.run(this,a,this.dataProvider.extendedDataWidth,this.dataProvider.extendedDataHeight)};a.prototype.print=function(){d.model.printing.PrintingManager.getInstance().run(this, this.dataProvider)};a.prototype.getCell=function(c,a){var b=this.gridLayout.getCell(c,a,!0,!0);if(null==b){b=new h.vo.GridCell;b.rowIdx=c;b.colIdx=a;var d=this.getData(c,a,!0);b.value=d?d.value:NaN;isNaN(b.value)||(b.label=utils.NumberFormatter.format(b.value))}-1==b.rowIdx&&(b.rowIdx=c);-1==b.colIdx&&(b.colIdx=a);d=b.toObject();this.setCoordsToCell(d,b.colIdx,b.rowIdx);return d};a.prototype.getSelectedCell=function(){if(utils.nullOrUndefined(this.gridLayout))return null;var c=this.gridLayout.selectedCells.map(function(c){return c.toObject()}); if(0==c.length)return null;if(1c)&&(this.close(),null!=this._handlers&&null!=this._handlers[c]))this._handlers[c]()};b.prototype.setIcon=function(a){this._icon.container.removeAllChildren();a==d.AlertType.ALERT?this._icon.container.addChild(this.createIconAlert()):a==d.AlertType.CONFIRMATION?this._icon.container.addChild(this.createIconConfirmation()):a==d.AlertType.ERROR?this._icon.container.addChild(this.createIconError()):a==d.AlertType.INFO&&this._icon.container.addChild(this.createIconInfo())}; b.prototype.createIconConfirmation=function(){var a=new uicontrols.UIElement("span","wdr-circle");a.addChild(new uicontrols.UIElement("span","wdr-ui-icon wdr-icon-notif_confirm"));return a};b.prototype.createIconInfo=function(){var a=new uicontrols.UIElement("span","wdr-circle");a.addChild(new uicontrols.UIElement("span","wdr-ui-icon wdr-icon-notif_info"));return a};b.prototype.createIconAlert=function(){var a=new uicontrols.UIElement("span","wdr-triangle-wrap");a.addChild(new uicontrols.UIElement("span", "wdr-triangle"));a.addChild(new uicontrols.UIElement("span","wdr-ui-icon wdr-icon-notif_warning"));return a};b.prototype.createIconError=function(){var a=new uicontrols.UIElement("span","wdr-hexagon");a.addChild(new uicontrols.UIElement("span","wdr-ui-icon wdr-icon-notif_arrow"));return a};b.prototype.close=function(){f.prototype.close.call(this);this.clear()};b.prototype.onOverlayClick=function(){this.isOpaque||f.prototype.onOverlayClick.call(this)};return b}(uicontrols.containers.UIPopup);e.AlertView= h})(d._view||(d._view={}))})(pivot||(pivot={})); (function(d){(function(e){(function(h){var f=function(b){function a(){var c=b.call(this,e.PivotView.stage.container)||this;c.slice=null;c.originalSlice=null;c.columnTuple=null;c.rowTuple=null;c.measure=null;c.START_TABLE_ROW=0;c.START_HEADERS_ROW=0;c.START_HEADERS_COLUMN=0;c.FIRST_DATA_ROW=0;c.FIRST_DATA_COLUMN=0;c.setId("wdr-drillthrough-view");c.setControls();return c}__extends(a,b);a.prototype.setControls=function(){var c=this;this.headerGroup=new uicontrols.containers.UIContainer("wdr-header-container");this.addChild(this.headerGroup); this._txtTitle=new uicontrols.UILabel;this._txtTitle.addClass("wdr-popup-title");this._txtTitle.setSelectable(!1);this.headerGroup.addChild(this._txtTitle);this._btnClose=new uicontrols.UIButton;this._btnClose.addClass("wdr-ui-btn-close");this._btnClose.addEventListener(uicontrols.UIButton.CLICK_EVENT,function(){return c.close()});this.headerGroup.addChild(this._btnClose);this.detailsGroup=new uicontrols.containers.UIContainer("wdr-details-container");this.addChild(this.detailsGroup);this._txtRowDetails= new uicontrols.UILabel;this._txtRowDetails.addClass("wdr-ui-label-light");this.detailsGroup.addChild(this._txtRowDetails);this._txtColDetails=new uicontrols.UILabel;this._txtColDetails.addClass("wdr-ui-label-light");this.detailsGroup.addChild(this._txtColDetails);this._txtMeasureDetails=new uicontrols.UILabel;this._txtMeasureDetails.addClass("wdr-ui-label-light");this.detailsGroup.addChild(this._txtMeasureDetails);this.sheetGroup=new uicontrols.containers.UIContainer("wdr-grid-container");this.addChild(this.sheetGroup); this.gridLayout=new h.sheet.flat.FlatGridLayout;this.gridLayout.isDrillThrough=!0;this.gridLayout.getDataFunction=function(a,b){return c.getData(a,b)};this.sheetGroup.container.addChild(this.gridLayout)};a.prototype.openView=function(c,a,b,k,f){var h=this;void 0===c&&(c=null);void 0===a&&(a=null);void 0===b&&(b=null);void 0===k&&(k=null);void 0===f&&(f=null);this.dataProvider=c;this.setSlice(a.clone());this.originalSlice=a;this.rowTuple=k;this.columnTuple=b;this.measure=f;this.tmpShowHeaders=d.model._options.OptionsManager.showHeaders; d.model._options.OptionsManager.showHeaders=!0;this.data=this.dataProvider.drillThrough(this.rowTuple,this.columnTuple,this.measure);this.keys=this.data.shift();d.model._options.OptionsManager.showDrillThroughConfigurator&&null==this._fieldsView&&(this._fieldsView=new e.config.FieldsView,this._fieldsView.modalParent=e.PivotView.stage.container,this._fieldsView.isForDillThrough=!0,this._fieldsView.containtment=this.gridLayout.element,this._fieldsView.addEventListener(e.config.FieldsView.EVENT_OPEN, function(){return h.onFieldsViewOpen()}),this._fieldsView.addEventListener(e.config.FieldsView.EVENT_APPLY_SLICE,function(c){return h.onFieldsViewApplySlice(c)}),this.sheetGroup.addChild(this._fieldsView));this.gridLayout.addEventListener(e.config.FieldsView.EVENT_APPLY_SLICE,function(c){return h.onFieldsViewApplySlice(c)});this.open();this.redraw()};a.prototype.onDataLoaded=function(c){this.data=c;d.preloader(!1);null!=this.data&&(this.open(),this.redraw())};a.prototype.setSlice=function(c){this.slice= c};a.prototype.redraw=function(){this._txtTitle.setLabel(d.model._labels.Labels.DRILL_THROUGH_TITLE);this._txtRowDetails.setLabel(this.getRowDetails(),!0);this._txtColDetails.setLabel(this.getColDetails(),!0);this._txtMeasureDetails.setLabel(this.getMeasureDetails(),!0);this.setWidth(e.PivotView.stageWidth-80);var c=e.PivotView.stage.container.getHeight(!0)-this.detailsGroup.container.getHeight(!0)-this.headerGroup.container.getHeight(!0)-30-this.container.padding.top-this.container.padding.bottom- 40,a=this.getWidth()-2;this.gridLayout.clearAll();this.gridLayout.resize(a,c);this.gridLayout.width=a;this.gridLayout.height=c;this.gridLayout.freezeRows(1);this.gridLayout.setDataSize(this.data.length,this.slice.flatten().length);this.gridLayout.draw();this.centerPosition()};a.prototype.close=function(){b.prototype.close.call(this);!1==utils.nullOrUndefined(this.tmpShowHeaders)&&(d.model._options.OptionsManager.showHeaders=this.tmpShowHeaders);this.dispatchWith(h.GridEvent.DRILLTHROUGH_CLOSED)}; a.prototype.getData=function(c,a){if(0==c)return this.getHeaderCell(a);var b=new h.vo.GridCell;b.isDrillThrough=!0;b.isValue=!0;var e;if(null==this.data||null==this.data[c-1])return null;e=this.slice.flatten();if(a/gi," ")};a.prototype.getColDetails=function(){for(var c,a=[],b=0;b/gi, " ")};a.prototype.getMeasureDetails=function(){var c=this.measure.getFormat().clone(),a=this.dataProvider.getValue(this.rowTuple,this.columnTuple,this.measure),c=utils.NumberFormatter.format(a,c),c=utils.StringUtils.bind(d.model._labels.Labels.DRILL_THROUGH_VALUE,this.measure.caption,c),c=c.replace(//gi," ");this.value=a;return c};a.prototype.onFieldsViewOpen=function(){this._fieldsView&&this._fieldsView.open(d.data_.Cube.getInstance().structure_,this.slice)};a.prototype.onFieldsViewApplySlice= function(c){c=c.data instanceof d.data_._structure.Slice?c.data:d.data_._structure.Slice.fromObject(d.model.report.SliceValueObject.fromObject(c.data),d.data_.Cube.getInstance().structure_);this.setSlice(c);this.redraw()};a.prototype.exportTo=function(c,a,b){b=this.slice?this.slice.flatten().length:this.data[0]?this.data[0].length:0;var e=this.data?this.data.length+1:0;c==d.model._export.ExportType.HTML&&d.model._export.ExportHTML.run(this,a,b,e);c==d.model._export.ExportType.PDF&&d.model._export.ExportPDF.run(this, a,b,e);c==d.model._export.ExportType.EXCEL&&d.model._export.ExportXLS.run(this,a,b,e)};a.prototype.saveData=function(c,a,b){var d=this;this.timer&&this.timer.running&&this.timer.stop();null==this.timer&&(this.timer=new utils.Timer(1E3,1));this.timer.addEventListener(utils.TimerEvent.TIMER_COMPLETE,function(){return d.onTimeComplete()});this.timer.start();(a=this.getData(c,a))&&a.label!=b&&a.value!=b&&this.dataProvider.save(this.rowTuple,this.columnTuple,a.hierarchy,b,c-1);this.draw()};a.prototype.onTimeComplete= function(){this._txtRowDetails.setLabel(this.getRowDetails(),!0);this._txtColDetails.setLabel(this.getColDetails(),!0);this._txtMeasureDetails.setLabel(this.getMeasureDetails(),!0);this.timer.stop()};return a}(uicontrols.containers.UIPopup);h.DrillThroughView=f})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={})); (function(d){(function(e){(function(e){(function(e){var b=function(){function a(){this.value=NaN;this.label="";this.level=NaN;this.sortedDesc=this.sortedAsc=this.sortable=this.drilledDown=this.drilledUp=this.draggable=this.collapsed=this.expanded=this.filtered=this.hasHierarchyName=this.showTooltip=this.isLink=this.isValue=this.isClassicTotalRow=this.isGrandTotalColumn=this.isGrandTotalRow=this.isTotalColumn=this.isTotalRow=this.isMeasureHeader=this.isColumnHeader=this.isRowHeader=this.isFrozen=this.isFilterHeader= this.isCustomized=this.numeric=!1;this.colIdx=this.rowIdx=-1;this.recordId=null;this.isDrillThrough=this.isExpandedArea=this.isEmpty=!1;this.conditions=[];this.url="";this.isKPIStatus=this.isKPITrend=!1;this.activeElementType=e.GridCellElementType.BACKGROUND}Object.defineProperty(a.prototype,"isTotal",{get:function(){return this.isTotalRow||this.isTotalColumn},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isGrandTotal",{get:function(){return this.isGrandTotalRow||this.isGrandTotalColumn}, enumerable:!0,configurable:!0});a.prototype.getDrillLabel=function(){return this.drilledDown||this.drilledUp?this.hierarchy.levels_.getItemAt(this.member.level.num+1).caption:""};a.prototype.getLabel=function(){if(null!=a.customizeCellFunction){var c=new HtmlNodeWrapper;c.clear();c.tag="div";c.text+=this.label;a.customizeCellFunction(c.node,this.toObject());var b=c.text,b=d.model.XSSCheck.valid(b)?b:d.model.XSSCheck.validate(b);c.clear();c=document.createElement("div");c.innerHTML=b;return c.textContent? c.textContent.trim():b}return this.label};a.prototype.customize=function(c){this.isCustomized=!0;null==this.style&&(this.style=new e.CellStyle);this.style.addCSS(c)};a.prototype.customizeWithClass=function(c){this.isCustomized=!0;null==this.style&&(this.style=new e.CellStyle);this.style.addStyle(c);this.style.addCustomStyle(c)};a.prototype.toObject=function(){if(this.obj)return this.obj;var c,a=d.model.PivotModel.getInstance(),b,e=[];if(!d.model._options.OptionsManager.flatView&&(b=this.isColumnHeader&& this.tuple?this.tuple:this.columnTuple))for(var f=a.cube_.slice_?a.cube_.slice_.columnsOnly:new utils.AssociativeArray,h=0;ha&&(this._colsWidth.length=a);this._colsWidthPending.length>a&&(this._colsWidthPending.length=a);this._colsWidthExplicit.length>a&&(this._colsWidthExplicit.length=a);this._dataContentWidth=-1};a.prototype.clearRowSizes=function(a){this._rowsHeight.length>a&&(this._rowsHeight.length= a);this._rowsHeightPending.length>a&&(this._rowsHeightPending.length=a);this._rowsHeightExplicit.length>a&&(this._rowsHeightExplicit.length=a);this._dataContentHeight=-1};a.prototype.reset=function(){this._colsWidth.length=0;this._rowsHeight.length=0;this._colsWidthPending.length=0;this._rowsHeightPending.length=0;this._colsWidthExplicit.length=0;this._rowsHeightExplicit.length=0;this._dataContentHeight=this._dataContentWidth=-1;this.filtersHeight=this.titleHeight=this.scrollLeft=this.scrollTop=this.firstDataColIdx= this.firstDataRowIdx=this.frozenRowsCount=this.frozenColsCount=this.dataRowsCount=this.dataColsCount=0;this._sheetHeaderWidth=a.SHEET_HEADER_WIDTH;this._sheetHeaderHeight=a.SHEET_HEADER_HEIGHT;this._scaleY=this._scaleX=1;this._cellMaxHeight=this._cellMaxWidth=-1;this.setDefaults()};a.prototype.setDefaults=function(){var c=e.grid.vo.StyleValueObject.fromClass(utils.browserVersion().isMobile?"wdr-grid-column-mobile":"wdr-grid-column");a.CELL_WIDTH=isNaN(c.width)?100:Math.max(a.CELL_MIN_WIDTH,c.width); isNaN(c.maxWidth)||(this._cellMaxWidth=Math.max(a.CELL_MIN_WIDTH,c.maxWidth));c=e.grid.vo.StyleValueObject.fromClass(utils.browserVersion().isMobile?"wdr-grid-row-mobile":"wdr-grid-row");a.CELL_HEIGHT=isNaN(c.height)?30:Math.max(a.CELL_MIN_HEIGHT,c.height);isNaN(c.maxHeight)||(this._cellMaxHeight=Math.max(a.CELL_MIN_HEIGHT,c.maxHeight))};Object.defineProperty(a.prototype,"cellMaxWidth",{get:function(){return this._cellMaxWidth},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"cellMaxHeight", {get:function(){return this._cellMaxHeight},enumerable:!0,configurable:!0});a.prototype.setScale=function(){var a=this.calcRangeHeight(this.frozenRowsCount,this.frozenRowsCount+this.dataRowsCount);this._scaleY=a>this._scaleTreshold?this._scaleTreshold/a:1;a=this.calcRangeWidth(this.frozenColsCount,this.frozenColsCount+this.dataColsCount);this._scaleX=a>this._scaleTreshold?this._scaleTreshold/a:1};a.prototype.resize=function(a,b,d){void 0===d&&(d=!1);this._layoutWidth=a;this._layoutHeight=b;d&&(this._originalWidth= a,this._originalHeight=b)};Object.defineProperty(a.prototype,"scrollBarWidth",{get:function(){return this.hasVerticalScroll?this._scrollBarSize:0},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"scrollBarHeight",{get:function(){return this.hasHorizontalScroll?this._scrollBarSize:0},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"scrollBarSize",{get:function(){return this._scrollBarSize},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"originalWidth", {get:function(){return this._originalWidth},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"originalHeight",{get:function(){return this._originalHeight},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"layoutWidth",{get:function(){return this._layoutWidth},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"layoutHeight",{get:function(){return this._layoutHeight},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"availableHeight", {get:function(){return this._layoutHeight-this.scrollBarHeight-this.gridStartY},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"availableWidth",{get:function(){return this._layoutWidth-this.scrollBarWidth},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"dataWidth",{get:function(){return this._layoutWidth-this.rowHeadersWidth},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"dataHeight",{get:function(){return this._layoutHeight-this.colHeadersHeight- this.gridStartY},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"maxColsCount",{get:function(){return this.frozenColsCount+this.dataColsCount},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"maxRowsCount",{get:function(){return this.frozenRowsCount+this.dataRowsCount},enumerable:!0,configurable:!0});a.prototype.getRowHeight=function(c){var b=isNaN(this._rowsHeight[c])?a.CELL_HEIGHT:this._rowsHeight[c];return 0this._rowsHeightPending[c])this._rowsHeightPending[c]=b}else this._rowsHeight[c]=b,this._dataContentHeight=-1;e&&(this._rowsHeightExplicit[c]=!0)};a.prototype.resetRowHeight=function(a){this.isRowHeightExplicit(a)&&(delete this._rowsHeight[a],delete this._rowsHeightPending[a],delete this._rowsHeightExplicit[a], this._dataContentHeight=-1)};a.prototype.getColWidth=function(c){if(-1==c)return this.getSheetHeaderWidth();if(c>=this.maxColsCount)return Math.max(100,a.CELL_WIDTH);var b=isNaN(this._colsWidth[c])?a.CELL_WIDTH:this._colsWidth[c];return 0this._colsWidthPending[c])this._colsWidthPending[c]= b}else-1==c?this._sheetHeaderWidth=b:this._colsWidth[c]=b,this._dataContentWidth=-1;e&&(this._colsWidthExplicit[c]=!0)};a.prototype.resetColWidth=function(a){this.isColWidthExplicit(a)&&(delete this._colsWidth[a],delete this._colsWidthPending[a],delete this._colsWidthExplicit[a],this._dataContentWidth=-1)};a.prototype.isColWidthExplicit=function(a){return!0===this._colsWidthExplicit[a]};a.prototype.isRowHeightExplicit=function(a){return!0===this._rowsHeightExplicit[a]};a.prototype.applyPendingSizes= function(){for(var a=0;athis.getRowHeight(a)&&this.setRowHeight(a,b)}this._rowsHeightPending.length=0;for(a=-1;athis.getColWidth(a)&&this.setColWidth(a,b));this._colsWidthPending.length=0};a.prototype.getRowIndexAtPosition=function(a,b){void 0===b&&(b=!1);var d=a/this.dataContentHeight* (this.layoutHeight/this._scaleY-this.layoutHeight)*this._scaleY;if(1!=this._scaleY&&a+d>=this.dataContentHeight-this.layoutHeight){for(var e=this.maxRowsCount,d=this.dataContentHeight;d>a;)d-=this.getRowHeight(e),e--;return e+1}for(var e=b?0:this.frozenRowsCount,f=0;f=this.dataContentWidth-this.layoutWidth){for(var e=this.maxColsCount,d=this.dataContentWidth;d>a;)d-=this.getColWidth(e),e--;return e+1}for(var e=b?0:this.frozenColsCount,f=0;fthis._scaleX?this._scaleTreshold:this.calcRangeWidth(this.frozenColsCount,this.frozenColsCount+this.dataColsCount)},enumerable:!0,configurable:!0});a.prototype.calcRangeWidth=function(c,b){if(c>=b)return 0;var d=0,e=0,f=0,h;for(h in this._colsWidth)f=parseInt(h),!isNaN(f)&&!isNaN(this._colsWidth[f])&&f>=c&&f=this.maxColsCount&&(d+=(b-this.maxColsCount)*this.getColWidth(b));return d};Object.defineProperty(a.prototype,"dataContentHeight",{get:function(){return 0<=this._dataContentHeight?this._dataContentHeight:this._dataContentHeight=1>this._scaleY?this._scaleTreshold:this.calcRangeHeight(this.frozenRowsCount,this.frozenRowsCount+this.dataRowsCount)},enumerable:!0,configurable:!0});a.prototype.calcRangeHeight=function(c,b){if(c>= b)return 0;var d=0,e=0,f=0,h;for(h in this._rowsHeight)f=parseInt(h),!isNaN(f)&&!isNaN(this._rowsHeight[f])&&f>=c&&fa.MIN_DATA_WIDTH)return a.MIN_DATA_WIDTH;return c},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rowHeadersWidth",{get:function(){for(var a=this.getSheetHeaderWidth(),b=0;b=a)));d++);return b};a.prototype.isColWidthDefined=function(a,b){void 0===b&&(b=!0);return!isNaN(this._colsWidth[a])||(b?!isNaN(this._colsWidthPending[a]):!1)};Object.defineProperty(a.prototype,"hasHorizontalScroll",{get:function(){return this.dataContentWidth+(this.dataContentHeight>this.dataHeight?this.scrollBarSize:0)>this.dataWidth},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"hasVerticalScroll",{get:function(){return this.dataContentHeight+(this.dataContentWidth> this.dataWidth?this.scrollBarSize:0)>this.dataHeight},enumerable:!0,configurable:!0});a.prototype.getRowY=function(a,b){void 0===b&&(b=!1);var m=d.model._options.OptionsManager.showHeaders&&b?this.getSheetHeaderHeight():0;return m+=this.calcRangeHeight(b?0:this.frozenRowsCount,a)};a.prototype.getColX=function(a,b){void 0===b&&(b=!1);var m=d.model._options.OptionsManager.showHeaders&&b?this.getSheetHeaderWidth():0;return m+=this.calcRangeWidth(b?0:this.frozenColsCount,a)};Object.defineProperty(a.prototype, "canDrawAll",{get:function(){return utils.browserVersion().isEdge||utils.browserVersion().isMsie?!1:500>this.maxColsCount*this.maxRowsCount},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"canDrawSmooth",{get:function(){return utils.browserVersion().isEdge||utils.browserVersion().isMsie?!1:(this.hasVerticalScroll||this.hasHorizontalScroll)&&1E5>this.maxColsCount*this.maxRowsCount},enumerable:!0,configurable:!0});a.prototype.getBoundTop=function(c){void 0===c&&(c=!1);return this.canDrawAll? this.frozenRowsCount:c?Math.max(this.frozenRowsCount,this.firstDataRowIdx-a.ROWS_OFFSET):Math.max(this.frozenRowsCount,this.firstDataRowIdx)};a.prototype.getBoundLeft=function(c){void 0===c&&(c=!1);return this.canDrawAll?this.frozenColsCount:c?Math.max(this.frozenColsCount,this.firstDataColIdx-a.COLS_OFFSET):Math.max(this.frozenColsCount,this.firstDataColIdx)};a.prototype.getBoundBottom=function(c){void 0===c&&(c=!1);var b=this.getVisibleRowsCount(this.firstDataRowIdx);return this.canDrawAll?this.hasVerticalScroll? this.maxRowsCount:this.firstDataRowIdx+b:c?Math.min(this.firstDataRowIdx+b+(this.hasVerticalScroll?a.ROWS_OFFSET:0),this.hasVerticalScroll?this.maxRowsCount:Number.MAX_VALUE):this.firstDataRowIdx+b};a.prototype.getBoundRight=function(c){void 0===c&&(c=!1);var b=this.getVisibleColsCount(this.firstDataColIdx);return this.canDrawAll?this.hasHorizontalScroll?this.maxColsCount:this.firstDataColIdx+b:c?Math.min(this.firstDataColIdx+b+(this.hasHorizontalScroll?a.COLS_OFFSET:0),this.hasHorizontalScroll?this.maxColsCount: Number.MAX_VALUE):this.firstDataColIdx+b};a.prototype.isOnColEdge=function(a){void 0===a&&(a=NaN);isNaN(a)&&(a=this.getBoundRight());return 0=this.maxColsCount};a.prototype.isOnRowEdge=function(a){void 0===a&&(a=NaN);isNaN(a)&&(a=this.getBoundBottom());return 0=this.maxRowsCount};a.prototype.getColEdgeOffset=function(a){void 0===a&&(a=NaN);isNaN(a)&&(a=this.firstDataColIdx);return this.isOnColEdge()?this.dataContentWidth-this.scrollLeft-this.calcRangeWidth(a, this.maxColsCount):0};a.prototype.getRowEdgeOffset=function(a){void 0===a&&(a=NaN);isNaN(a)&&(a=this.firstDataRowIdx);return this.isOnRowEdge()?this.dataContentHeight-this.scrollTop-this.calcRangeHeight(a,this.maxRowsCount):0};a.prototype.getRowIdxByRelativePosition=function(a,b){if(athis.colHeadersHeight)if(m= this.firstDataRowIdx,e=this.gridStartY+this.colHeadersHeight,b&&m>this.frozenRowsCount){var f=this.scrollTop-this.getRowY(m-1);0this.rowHeadersWidth)if(m=this.firstDataColIdx,e=this.rowHeadersWidth,b&&m>this.frozenColsCount){var f= this.scrollLeft-this.getColX(m-1);0this.frozenRowsCount&&(e=this.firstDataRowIdx,f=(d?this.gridStartY:0)+this.colHeadersHeight,e<=a&&(f+=b?this.getRowY(this.firstDataRowIdx)-this.scrollTop:this.getRowEdgeOffset()));return f+=this.calcRangeHeight(e,a)};a.prototype.getRelativeColX= function(a,b){var d=0,e=this.getSheetHeaderWidth();a>this.frozenColsCount&&(d=this.firstDataColIdx,e=this.rowHeadersWidth,d<=a&&(e+=b?this.getColX(this.firstDataColIdx)-this.scrollLeft:this.getColEdgeOffset()));return e+=this.calcRangeWidth(d,a)};a.prototype.isRowHeightDefault=function(a){return isNaN(this._rowsHeight[a])};Object.defineProperty(a.prototype,"freeSpaceRight",{get:function(){return this.scrollLeft+this.dataWidth-this.dataContentWidth-this.scrollBarWidth},enumerable:!0,configurable:!0}); Object.defineProperty(a.prototype,"freeSpaceTop",{get:function(){return this.scrollTop+this.dataHeight-this.dataContentHeight-this.scrollBarHeight},enumerable:!0,configurable:!0});a.ROWS_OFFSET=5;a.COLS_OFFSET=5;a.CELL_WIDTH=100;a.CELL_HEIGHT=30;a.CELL_MIN_WIDTH=50;a.CELL_MIN_HEIGHT=30;a.SHEET_HEADER_HEIGHT=25;a.SHEET_HEADER_WIDTH=25;a.MIN_DATA_WIDTH=200;return a}();f.GridCoords=b})(h.sheet||(h.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={})); (function(d){(function(e){(function(e){(function(f){var b=function(a){function c(c,b){var d=a.call(this,"div")||this;d._isDirty=!1;d.cell=new HtmlNodeWrapper;d._coords=c;d._getDataFunc=b;d.element.addEventListener("click",function(a){return d.onMouseEvent(a)});return d}__extends(c,a);c.prototype.calculateSizes=function(a){void 0===a&&(a=!1);for(var c=!1,b=this.element.children,d=0;d=this._coords.maxRowsCount||c>=this._coords.maxColsCount;!f&&s&&this.cell.addClass(e.vo.GridStyleName.CELL_EMPTY);f&&f.isRowHeader&&(this.cell.addClass(e.vo.GridStyleName.HEADER),this.cell.addClass(e.vo.GridStyleName.HEADER_ROW),this.cell.addClass(e.vo.GridStyleName.LEVEL+f.level));f&&f.isColumnHeader&&(this.cell.addClass(e.vo.GridStyleName.HEADER), this.cell.addClass(e.vo.GridStyleName.HEADER_COLUMN));f&&f.isMeasureHeader&&this.cell.addClass(e.vo.GridStyleName.MEASURE_HEADER);f&&f.isTotal&&this.cell.addClass(e.vo.GridStyleName.TOTAL);f&&f.isGrandTotal&&this.cell.addClass(e.vo.GridStyleName.GRAND_TOTAL);f&&f.expanded&&(this.cell.addClass(e.vo.GridStyleName.EXPANDED),this.cell.text+=this.createIcon(e.vo.GridStyleName.EXPANDED_ICON,d.model._labels.Labels.TOOLTIPS_COLLAPSE_ICON));f&&f.collapsed&&(this.cell.addClass(e.vo.GridStyleName.COLLAPSED), this.cell.text+=this.createIcon(e.vo.GridStyleName.COLLAPSED_ICON,d.model._labels.Labels.TOOLTIPS_EXPAND_ICON));this.cell.text+=f?f.label:"";f&&(f.drilledUp||f.drilledDown)&&(this.cell.text+=''+f.getDrillLabel()+"",f.drilledUp&&this.cell.addClass(e.vo.GridStyleName.DRILLED_UP),f.drilledDown&&this.cell.addClass(e.vo.GridStyleName.DRILLED_DOWN)); f&&f.isColumnHeader&&(f.sortable&&!f.isEmpty&&(this.cell.text=f.sortedAsc?this.cell.text+this.createIcon([e.vo.GridStyleName.SORT_ICON,e.vo.GridStyleName.V_SORT_ASC],d.model._labels.Labels.TOOLTIPS_SORTED_ASC):f.sortedDesc?this.cell.text+this.createIcon([e.vo.GridStyleName.SORT_ICON,e.vo.GridStyleName.V_SORT_DESC],d.model._labels.Labels.TOOLTIPS_SORTED_DESC):this.cell.text+this.createIcon([e.vo.GridStyleName.SORT_ICON,e.vo.GridStyleName.V_SORT_ICON],d.model._labels.Labels.TOOLTIPS_SORT_ICON)),f.isEmpty&& this.cell.addClass(e.vo.GridStyleName.CELL_EMPTY),f.isEmpty||this.cell.addClass(e.vo.GridStyleName.V_SORT));f&&f.isRowHeader&&(f.sortable&&!f.isEmpty&&(this.cell.text=f.sortedAsc?this.cell.text+this.createIcon([e.vo.GridStyleName.SORT_ICON,e.vo.GridStyleName.H_SORT_ASC],d.model._labels.Labels.TOOLTIPS_SORTED_ASC):f.sortedDesc?this.cell.text+this.createIcon([e.vo.GridStyleName.SORT_ICON,e.vo.GridStyleName.H_SORT_DESC],d.model._labels.Labels.TOOLTIPS_SORTED_DESC):this.cell.text+this.createIcon([e.vo.GridStyleName.SORT_ICON, e.vo.GridStyleName.H_SORT_ICON],d.model._labels.Labels.TOOLTIPS_SORT_ICON)),this.cell.addClass(e.vo.GridStyleName.H_SORT));this.cell.attr["data-c"]=c;this.cell.attr["data-r"]=a;0!=c||d.model._options.OptionsManager.showHeaders||(this.cell.style.height=this._coords.getRowHeight(a)+"px");if(f&&f.style){for(var r=0;r"};c.prototype.createSheetHeaderCell=function(){this.cell.clear();this.cell.tag="div";this.cell.addClass(e.vo.GridStyleName.CELL);this.cell.addClass(e.vo.GridStyleName.SHEET_HEADER);this.cell.style.width=this._coords.getSheetHeaderWidth()+"px";this.cell.style.height= this._coords.getSheetHeaderHeight()+"px";return this.cell};c.prototype.createColumnSheetHeaderCell=function(a,c){void 0===c&&(c=!1);this.cell.clear();this.cell.tag="div";this.cell.addClass(e.vo.GridStyleName.CELL);this.cell.addClass(e.vo.GridStyleName.SHEET_HEADER);this.cell.text+=a+1;this.cell.style.width=this._coords.getColWidth(a)+"px";0=a.right&&this.bottom>=a.bottom}; a.prototype.clone=function(){return new a(this.left,this.top,this.right,this.bottom)};return a}();d.Bounds=b})(d.sheet||(d.sheet={}))})(d.grid||(d.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={})); (function(d){(function(e){(function(e){(function(e){var b=function(c){function b(a){void 0===a&&(a=null);var d=c.call(this,"div","wdr-auto-calculation-bar")||this;d._listOfAggregations=["average","count","sum"];d.aggregationLables={};d._coordinates={right:-1E3,bottom:1E3};d._aggregationsElements=new utils.AssociativeArray;d._listOfAggregations=null==a?d._listOfAggregations:a;d.initAggregationLabels();d.setControls();return d}__extends(b,c);b.prototype.initAggregationLabels=function(){this.aggregationLables.average= d.model._labels.Labels.AVERAGE_CAPTION;this.aggregationLables.sum=d.model._labels.Labels.SUM_CAPTION;this.aggregationLables.count=d.model._labels.Labels.COUNT_CAPTION};Object.defineProperty(b.prototype,"aggregationsElements",{get:function(){return this._aggregationsElements},enumerable:!0,configurable:!0});b.prototype.setControls=function(){this._relativeContainer=new uicontrols.UIElement("div");this._relativeContainer.css("position","relative");this.addChild(this.relativeContainer);this._absoluteContainer= new uicontrols.UIElement("div","wdr-auto-calculation-bar-conainer");this.absoluteContainer.css("position","absolute");this._relativeContainer.addChild(this.absoluteContainer);for(var c=null,b=0;ba.x*a.y||0>c.x*c.y?!1:!0};c.prototype.selectAll=function(){this.select(new a(0,0),new a(this.coords.getBoundRight(),this.coords.getBoundBottom()))};c.prototype.selectTo=function(a){if(null!=this._from&&!this._from.equals(a)){var c=this._from;this.deselect(); this._from=c;this._to=a;this.preDraw(c,a)}};c.prototype.selectRow=function(a){this.deselect();this.preDrawHeader(a,-1)};c.prototype.selectColumn=function(a){this.deselect();this.preDrawHeader(-1,a)};c.prototype.deselect=function(){!this.selectionCanvas.isCtrlPressed&&0=this.coords.getVisibleColsCount(this.coords.firstDataColIdx)+this.coords.firstDataColIdx-1&&(n=this.coords.firstDataColIdx+(d-h),this.gridLayout.scrollToColumn(n+ 1));f=b?f.y:e.y;h=d;this.select(new a(b?e.x:d,e.y),new a(h,f))}};c.prototype.moveVertical=function(c,b){void 0===b&&(b=!1);if(1==this.listOfSelectedCells.length){var d=this.decomposeCellKey(this.listOfSelectedCells.getItemAt(0).cellKey),e=d.from,f=d.to,d=b?f.y:e.y,h=b?f.y:e.y,d=Math.max(0,Math.min(d+c,this.coords.maxRowsCount-1)),n=0;d=this.coords.getVisibleRowsCount(this.coords.firstDataRowIdx)+ this.coords.firstDataRowIdx-1&&(n=this.coords.firstDataRowIdx+(d-h),this.gridLayout.scrollToRow(n+1));h=d;f=b?f.x:e.x;this.select(new a(e.x,b?e.y:d),new a(f,h))}};Object.defineProperty(c.prototype,"autoCalculationManager",{get:function(){return this.selectedCellsCalculator},enumerable:!0,configurable:!0});c.prototype.onKeyDown=function(a){if(null!=this.keyboardListener&&(this._isFocused||this.keyboardListener.isFocused)){var c=a.ctrlKey||a.metaKey;switch(a.keyCode){case 32:c||this.gridLayout.triggerCellAction(this.gridLayout.selectedCells[0]); break;case 65:c&&this.selectAll();break;case 37:case 38:case 39:case 40:this.move(a.keyCode,a.ctrlKey,a.shiftKey),a.originalEvent.preventDefault()}!c||a.altKey||a.shiftKey||this.keyboardListener.isFocused||this.copy()}};c.prototype.copy=function(){var a="";if(0e&&(b+="\t");d=this.gridLayout.getCell(p,q,!0,!0);if(null==d&&(d=p=this.coords.firstDataColIdx?this.gridLayout.getCell(p,q-this.coords.firstDataColIdx+this.coords.frozenColsCount,!0,!0):null,null==d))continue; b+=null==d?"":d.label}pthis.coords.availableWidth|| b>this.coords.gridStartY+this.coords.availableHeight||(b=this.coords.getRowIdxByRelativePosition(b,this.gridLayout.isSmooth),c=this.coords.getColIdxByRelativePosition(c,this.gridLayout.isSmooth),isNaN(b)||isNaN(c))))switch(this.isCtrlPressed=utils.OSUtil.isWin&&a.ctrlKey||utils.OSUtil.isMac&&a.metaKey,a.type){case "mousedown":this.onMouseDown(b,c);break;case "mousemove":this.onMouseMove(b,c);break;case "mouseup":this.onMouseUp(b,c)}}}};c.prototype.onMouseLeave=function(a){var c=uicontrols.UIElement.convert(this.gridLayout.element), b=a.clientX;a=a.clientY;(bc.left+this.gridLayout.width||a>c.top+this.gridLayout.height)&&this.stopSelection()};c.prototype.select=function(a,c,b,d){this.started=!1;this.manager.select(new f.Point(c,a),new f.Point(d,b))};c.prototype.stopSelection=function(){this.started=!1};c.prototype.onMouseDown=function(a,c){this.started=!0;this.manager.select(new f.Point(c,a),new f.Point(c,a));this.gridLayout.element.addEventListener("mousemove",this.mouseEventHandler);utils.fmdocument.addEventListener("mousemove", this.mouseLeaveHandler)};c.prototype.onMouseUp=function(a,c){this.started&&(this.started=!1,-1==a?this.manager.selectColumn(c):-1==c?this.manager.selectRow(a):this.manager.selectTo(new f.Point(c,a)))};c.prototype.onMouseMove=function(a,c){this.started&&(!this.manager.to||this.manager.to.x==c&&this.manager.to.y==a||this.manager.selectTo(new f.Point(c,a)))};c.prototype.dispose=function(){this.gridLayout.element&&this.gridLayout.element.removeEventListener("mousedown",this.mouseEventHandler);this.gridLayout.element&& this.gridLayout.element.removeEventListener("mouseup",this.mouseEventHandler);this._calculatedArea.dispose();this.coords=this.gridLayout=this.manager=null;null!=this.selectedHeader&&(this.selectedHeader.remove(),this.selectedHeader=null)};c.prototype.redraw=function(){var a=null,c=null;this._calculatedArea.resetCoordinates();for(var b=0;bthis.coords.scrollLeft?a.coordinates.right=a.coordinates.left+b:c>a.coordinates.right-b?(a.absoluteContainer.css("left","auto"),a.absoluteContainer.right=0,b=a.coordinates.right-c):a.coordinates.rightRaw>=this.coords.availableWidth&&(a.absoluteContainer.css("left","right"),a.absoluteContainer.left=0,b=b-(a.coordinates.rightRaw-this.coords.availableWidth)-1,b=0>b?0:b);this.coords.gridStartY+this.coords.availableHeight<=a.coordinates.bottom+a.height&&(a.top=a.coordinates.bottom-this.scrollbarSize); a.left=a.coordinates.right-b;a.relativeContainer.width=b;a.width=b}};c.prototype.updateAutoCalculationBar=function(a){this.manager.isAutoCalculationBarAvailable()&&this.manager.autoCalculationManager.recalculateAutoCalculationBar(a,this.gridLayout.selectedCells)};c.prototype._redraw=function(a,c,b){a.hide();var e=Math.min(c.x,b.x),f=Math.min(c.y,b.y),h=Math.max(c.x,b.x);c=Math.max(c.y,b.y);d.model._options.OptionsManager.showHeaders&&this.drawHeaderSelection(e,h,f,c,a);b=this.coords.availableWidth; var n=this.coords.gridStartY+this.coords.availableHeight,p=Math.max(this.coords.gridStartY,this.coords.getRelativeRowY(f,this.gridLayout.isSmooth)-1),q=this.coords.getRelativeRowY(c+1,this.gridLayout.isSmooth),t=Math.min(n,q),u=Math.max(0,this.coords.getRelativeColX(e,this.gridLayout.isSmooth)-1),v=this.coords.getRelativeColX(h+1,this.gridLayout.isSmooth),x=Math.min(b,v),w=t-p,y=x-u;2>=y||2>=w?null!=a.cellElement&&a.cellElement.hide():ux&&(a.createColFix(),a.colFix.top=p,a.colFix.left=x,a.colFix.width=Math.min(v,this.coords.layoutWidth)-x,a.colFix.height=Math.min(t,this.coords.gridStartY+ this.coords.colHeadersHeight)-p,a.colFix.toggleClass("wdr-clear-border-bottom",c>this.coords.frozenRowsCount),a.colFix.toggleClass("wdr-clear-border-right",v>this.coords.layoutWidth),a.colFix.removeClass("wdr-clear-border"),a.colFix.show()),et&&(a.createRowFix(),a.rowFix.top=t,a.rowFix.left=u,a.rowFix.width=Math.min(x,this.coords.rowHeadersWidth)-u,a.rowFix.height=Math.min(q,this.coords.layoutHeight)-t,a.rowFix.toggleClass("wdr-clear-border-bottom",q>this.coords.layoutHeight), a.rowFix.toggleClass("wdr-clear-border-right",h>this.coords.frozenColsCount),a.rowFix.removeClass("wdr-clear-border"),a.rowFix.show()),null!=a.cellElement&&(a.cellElement.toggleClass("wdr-clear-border-right",v>x),a.cellElement.toggleClass("wdr-clear-border-bottom",q>t))):null!=a.cellElement&&a.cellElement.hide()};c.prototype.drawSelectedRow=function(a,c){if(!isNaN(a)){null==c.rowOverlay&&c.createRowOverlay();var b=this.coords.getRelativeRowY(a,this.gridLayout.isSmooth),d=this.coords.getRelativeRowY(a+ 1,this.gridLayout.isSmooth),e=Math.min(this.coords.gridStartY+this.coords.availableHeight,d);be&&(c.createRowFix(),c.rowFix.top=e,c.rowFix.left=0,c.rowFix.width=this.coords.rowHeadersWidth,c.rowFix.height=Math.min(d,this.coords.layoutHeight)-e,c.rowFix.addClass("wdr-clear-border"),c.rowFix.show())):c.rowOverlay.hide()}}; c.prototype.drawSelectedColumn=function(a,c){if(!isNaN(a)){null==c.colOverlay&&c.createColOverlay();var b=this.coords.getRelativeColX(a,this.gridLayout.isSmooth),d=this.coords.getRelativeColX(a+1,this.gridLayout.isSmooth),e=Math.min(this.coords.availableWidth,d);be&&(c.createColFix(),c.colFix.top=this.coords.gridStartY, c.colFix.left=e,c.colFix.width=Math.min(d,this.coords.layoutWidth)-e,c.colFix.height=this.coords.colHeadersHeight,c.colFix.addClass("wdr-clear-border"),c.colFix.show())):c.colOverlay.hide()}};c.prototype.drawHeaderSelection=function(a,c,b,d,e){this.processHeaders(a,c,b,d,e);this.drawHeaderColumn(e.colOverlay,a,c);this.drawHeaderRow(e.rowOverlay,b,d)};c.prototype.processHeaders=function(c,b,d,e,f){if(!this.manager.rowsSelectedSet.hasOwnProperty(d.toString())){f.createRowOverlay();for(var h=d;h<=e;h++)this.manager.rowsSelectedSet[h.toString()]= d==e&&c==b?a.ONE_CELL:a.AREA}if(!this.manager.columnsSelectedSet.hasOwnProperty(c.toString()))for(f.createColOverlay(),h=c;h<=b;h++)this.manager.columnsSelectedSet[h.toString()]=d==e&&c==b?a.ONE_CELL:a.AREA};c.prototype.drawHeaderColumn=function(a,c,b){null!=a&&(c=this.coords.getRelativeColX(c,this.gridLayout.isSmooth),b=Math.min(this.coords.layoutWidth,this.coords.getRelativeColX(b+1,this.gridLayout.isSmooth)),cthis.classes.indexOf(d)&&this.classes.push(d)};d.prototype.toHtml=function(){var d="<"+this.tag,h=[],f;for(f in this.style)h.push(f+":"+this.style[f]);0"};return d}(),HtmlNodeWrapper=function(){function d(d){void 0===d&&(d="div");this._node=new HtmlNode;this.clear();this.tag=d}Object.defineProperty(d.prototype,"node",{get:function(){return this._node},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"tag",{get:function(){return this.node.tag},set:function(d){this.node.tag=d},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"text",{get:function(){return this.node.text},set:function(d){this.node.text= d},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"style",{get:function(){return this.node.style},set:function(d){this.node.style=d},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"attr",{get:function(){return this.node.attr},set:function(d){this.node.attr=d},enumerable:!0,configurable:!0});d.prototype.addClass=function(d){this.node.addClass(d)};d.prototype.clear=function(){this.tag="div";this.text="";this.style={};this.attr={};this.node.classes=[]};d.prototype.toHtml= function(d){void 0===d&&(d=!0);var h=this.node.toHtml();d&&this.clear();null!=pivot._view.grid.vo.GridCell.customizeCellFunction&&(h=pivot.model.XSSCheck.valid(h)?h:pivot.model.XSSCheck.validate(h));return h};return d}(); (function(d){(function(d){(function(d){(function(d){var b=function(a){function c(){return null!==a&&a.apply(this,arguments)||this}__extends(c,a);c.prototype.draw=function(){this.setContentSize();var a=this.getBounds();if(this.isSmooth||this._coords.isOnRowEdge(a.bottom)||this._coords.isOnColEdge(a.right)||!this._bounds.contains(a)){var c=a.clone();0!=this._coords.maxColsCount&&(c.right=Math.min(c.right,this._coords.maxColsCount));0!=this._coords.maxRowsCount&&(c.bottom=Math.min(c.bottom,this._coords.maxRowsCount)); if(!this.isSmooth||!this._boundsSmooth.contains(c)||!this._coords.canDrawAll&&(a.left>this._coords.frozenColsCount&&a.left<=this._boundsSmooth.left||a.top>this._coords.frozenRowsCount&&a.top<=this._boundsSmooth.top)){this._coords.isOnColEdge(a.right)&&(a.left=Math.max(a.left-1,this._coords.frozenColsCount));this._coords.isOnRowEdge(a.bottom)&&(a.top=Math.max(a.top-1,this._coords.frozenRowsCount));for(var c=[],b=new HtmlNodeWrapper,d=a.top;dthis.coords.getSheetHeaderWidth()&&a>this.coords.gridStartY+this.coords.getSheetHeaderHeight()||(a=this.coords.getRowIdxByRelativePosition(a,this.isSmooth),b=this.coords.getColIdxByRelativePosition(b, this.isSmooth),-1!=a||isNaN(b)||this._colResizeHandles.dispatchWith(h.GridEvent.RESIZE_COLUMN,this,{width:-1,colIdx:b}),-1!=b||isNaN(a)||this._rowResizeHandles.dispatchWith(h.GridEvent.RESIZE_ROW,this,{height:-1,rowIdx:a}))}};c.prototype.drawAfterResize=function(){this._colsSheet.clearAllBounds();this._rowsSheet.clearAllBounds();this._dataSheet.clearAllBounds();this.adjustScrollPosition()||this.draw()};c.prototype.adjustScrollPosition=function(){var a=!1;0 this._coords.scrollLeft&&(this._dataSheet.scrollPane.scrollLeft=0,a=!0);0this._coords.scrollTop&&(this._dataSheet.scrollPane.scrollTop=0,a=!0);return a};c.prototype.getCellByElement=function(a){var c=uicontrols.UIElement.convert(a).closest(".wdr-cell");return null!=c?(a=parseInt(c.attr("data-r")),c=parseInt(c.attr("data-c")),this.getCell(a,c,!0,!0)):null};Object.defineProperty(c.prototype,"isSmooth",{get:function(){return this._dataSheet.isSmooth}, enumerable:!0,configurable:!0});c.prototype.scrollToRow=function(a){this._dataSheet.scrollPane.scrollTop=this.coords.getRowY(a)};c.prototype.scrollToColumn=function(a){this._dataSheet.scrollPane.scrollLeft=this.coords.getColX(a)};Object.defineProperty(c.prototype,"dataProvider",{get:function(){return this._dataProvider},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"selectionManager",{get:function(){return this._selectionManager},enumerable:!0,configurable:!0});c.prototype.resizeColumn= function(a,c){this.coords.setColWidth(a,c,!1,!0)};c.prototype.resizeRow=function(a,c){this.coords.setRowHeight(a,c,!1,!0)};c.prototype.makeFieldsDraggable=function(){var a=this;this.droppable({onDrop:function(c,b,d,e){return a.onDrop(c,b,d,e)},onDragOver:function(c,b,d,e){return a.onDragOver(c,b,d,e)},onDragLeave:function(c,b,d,e){return a.onDragLeave(c,b,d,e)}})};c.prototype.createHeaderDragHelper=function(a){var c=new uicontrols.UIElement("span");c.addClass("wdr-helper");c.addClass("wdr-draggable"); c.addClass("wdr-header-helper");c.css("position","absolute");c.css("z-index",100);c.text(a.element.firstChild.textContent);return c};c.prototype.onDragOver=function(a,c,b,d){a=uicontrols.UIElement.convert(d.target);a.hasClass("wdr-header-drop-indicator")||this.showIndicator(a,a)};c.prototype.onDragLeave=function(a,c,b,d){this.removeDropIndicator()};c.prototype.onDrop=function(a,c,b,d){};c.prototype.showIndicator=function(a,c){};c.prototype.createDropIndicator=function(){return this._dropIndicator? this._dropIndicator:new uicontrols.UIElement("div","wdr-header-drop-indicator")};c.prototype.removeDropIndicator=function(){this._dropIndicator&&(this._dropIndicator.removeFromParent(!0),this._dropIndicator=null)};return c}(uicontrols.UIElement);f.BaseGridLayout=b})(h.sheet||(h.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={})); (function(d){(function(e){(function(e){(function(f){var b=function(a){function c(c){var b=a.call(this,c,null)||this;b._coords=c;b._hierarchies=[];b.addClass("wdr-filters");b.addEventListener(e.GridEvent.MOUSE_CLICK,function(a){return b.onClick(a)});return b}__extends(c,a);c.prototype.draw=function(){for(var a=[],c=new HtmlNodeWrapper,b=0;bc.columns.length)return c.columns.length;c=c.columns.indexOf("[Measures]");0<=c&&c<=a&&0!=a&&a++;return a}return NaN};c.prototype.getRowDropPosition=function(a){var c=d.data_.Cube.getInstance().slice_;if(null!=a){a=a.parent.hasClass("wdr-filters")?c.rows.length:(a=a.parent.find(".wdr-header"))?parseInt(a.attr("data-h")):0;if(a>c.rows.length)return c.rows.length; c=c.rows.indexOf("[Measures]");0<=c&&c<=a&&0!=a&&a++;return a}return NaN};c.prototype.getPageDropPosition=function(a){var c=d.data_.Cube.getInstance().slice_;return null!=a?(a=a.index(),a>c.columns.length?c.columns.length:a):NaN};c.prototype.getDropTargetFilter=function(a){var c=a.closest(".wdr-filters");if(null==c){var b=a.closest(".wdr-cell");null!=b?(a=parseInt(b.attr("data-r")),b=parseInt(b.attr("data-c")),this.isOverColumns(a,b)?c=this._colsFilter:this.isOverRows(a,b)&&(c=this._rowsFilter)): (b=a.closest(".wdr-resize-handles"),null!=b&&("wdr-cols-resize"==b.id?c=this._colsFilter:"wdr-rows-resize"==b.id&&(c=this._rowsFilter)))}return c};c.prototype.isOverColumns=function(a,c){return c>=this.coords.frozenColsCount};c.prototype.isOverRows=function(a,c){return c<=this.coords.frozenColsCount};c.prototype.showIndicator=function(a,c){a=this.getDropTargetFilter(a);if(null==a)this.removeDropIndicator();else{var b=c.closest(".wdr-header:not(.wdr-empty)");null!=c.closest(".wdr-filters")&&null!= b?(this._dropIndicator=this.createDropIndicator(),a==this._pageFilter?b.before(this._dropIndicator):c.before(this._dropIndicator)):(this._dropIndicator=this.createDropIndicator(),a==this._colsFilter?this._colsFilter.find(".wdr-row").append(this._dropIndicator):a==this._rowsFilter?null!=c.closest(".wdr-filters")?this._rowsFilter.find(".wdr-header").before(this._dropIndicator):this._type==f.classic.ClassicGridLayout.TYPE?this._rowsFilter.find(".wdr-header").parent.append(this._dropIndicator):this._rowsFilter.append(this._dropIndicator): a==this._pageFilter&&this._pageFilter.append(this._dropIndicator))}};c.prototype.clearAll=function(){a.prototype.clearAll.call(this);this._colsFilter.clear();this._pageFilter.clear();this._rowsFilter.clear()};Object.defineProperty(c.prototype,"colsFilter",{get:function(){return this._colsFilter},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"rowsFilter",{get:function(){return this._rowsFilter},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"pageFilter",{get:function(){return this._pageFilter}, enumerable:!0,configurable:!0});c.prototype.dispose=function(){this._colsFilter.removeAllEventListeners();this._colsFilter.dispose();this._rowsFilter.removeAllEventListeners();this._rowsFilter.dispose();this._pageFilter.removeAllEventListeners();a.prototype.dispose.call(this)};c.TYPE="compact";return c}(f.BaseGridLayout);f.CompactGridLayout=b})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={})); (function(d){(function(e){(function(e){(function(e){var b=function(a){function c(c){var b=a.call(this,"div","wdr-resize-handles")||this;b._mouseDownHandler=function(a){return b.onMouseDown(a)};b._mouseUpHandler=function(a){return b.onMouseUp(a)};b._mouseMoveHandler=function(a){return b.onMouseMove(a)};b._handle=new HtmlNodeWrapper;b._gridLayout=c;b._coords=c.coords;b.element.addEventListener("mousedown",b._mouseDownHandler);document.body.addEventListener("mouseup",b._mouseUpHandler);b._indicator= new uicontrols.UIElement("div","wdr-indicator");b._indicator.hide();b.addChild(b._indicator);b._wrapper=new uicontrols.UIElement("div","wdr-wrapper");b._wrapper.attr("title",d.model._labels.Labels.TOOLTIPS_HEADER_FIT);b.addChild(b._wrapper);return b}__extends(c,a);c.prototype.draw=function(){this._wrapper.attr("title",d.model._labels.Labels.TOOLTIPS_HEADER_FIT)};c.prototype.createHandle=function(a){this._handle.tag="div";this._handle.addClass("wdr-handle");this._handle.attr["data-idx"]=a;this._handle.attr.title= d.model._labels.Labels.TOOLTIPS_HEADER_RESIZE;return this._handle};c.prototype.onMouseDown=function(a){if(a.target.classList.contains("wdr-handle")){this._currentHandle=a.target;this._currentHandle.classList.add("wdr-active");this._baseOffset=this.getOffset();document.body.addEventListener("mousemove",this._mouseMoveHandler);a.stopImmediatePropagation();var c=parseInt(this._currentHandle.getAttribute("data-idx"));this.startResizing(this._currentHandle,c);a.preventDefault();a.stopImmediatePropagation()}}; c.prototype.startResizing=function(a,c){};c.prototype.onMouseUp=function(a){document.body.removeEventListener("mousemove",this._mouseMoveHandler);this._currentHandle&&(this._currentHandle.classList.remove("wdr-active"),a=parseInt(this._currentHandle.getAttribute("data-idx")),this.stopResizing(this._currentHandle,a),this._currentHandle=null,this._indicator.hide())};c.prototype.stopResizing=function(a,c){};c.prototype.onMouseMove=function(a){var c=a.clientX-this._baseOffset.left,b=a.clientY-this._baseOffset.top; if(0>c||0>b||c>this._coords.layoutWidth||b>this._coords.layoutHeight)this.onMouseUp(a);else this.positionHandle(this._currentHandle,c,b),this._indicator.show()};c.prototype.positionHandle=function(a,c,b){};c.prototype.dispose=function(){this.element&&this.element.removeEventListener("mousedown",this._mouseDownHandler);document.body.removeEventListener("mousemove",this._mouseMoveHandler);document.body.removeEventListener("mouseup",this._mouseUpHandler);a.prototype.dispose.call(this)};return c}(uicontrols.UIElement); e.ResizeHandles=b})(e.sheet||(e.sheet={}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={})); (function(d){(function(d){(function(d){(function(e){var b=function(a){function c(){return null!==a&&a.apply(this,arguments)||this}__extends(c,a);c.prototype.draw=function(){a.prototype.draw.call(this);this._wrapper.removeAllChildren();for(var c="",b=0;b this._coords.minDataWidth},enumerable:!0,configurable:!0});g.prototype.clearDrawings=function(){a.prototype.clearDrawings.call(this);this._rowsFilter.clearDrawings()};g.prototype.getRowDropPosition=function(a){var c=d.data_.Cube.getInstance().slice_;if(null!=a){a=a.index();if(a>c.rows.length)return c.rows.length;c=c.rows.indexOf("[Measures]");0<=c&&c<=a&&0!=a&&a++;return a}return NaN};g.TYPE="classic";return g}(f.CompactGridLayout);b.ClassicGridLayout=a})(f.classic||(f.classic={}))})(e.sheet||(e.sheet= {}))})(e.grid||(e.grid={}))})(d._view||(d._view={}))})(pivot||(pivot={})); (function(d){(function(e){(function(e){(function(e){(function(b){var a=function(a){function b(d){return a.call(this,d)||this}__extends(b,a);b.prototype.dispose=function(){utils.fmClearTimeout(this._timeout);a.prototype.dispose.call(this)};b.prototype.draw=function(){for(var a=this,c=[],b=new HtmlNodeWrapper,e=0;er.children.indexOf(b[l])&& r.children.push(b[l]);null!=h.root&&0>a.indexOf(h.root)&&a.push(h.root);b[l].level=h.folder.level+1;b[l].parent=r}else b[l].level=0,a.push(b[l]);this.allHierarchies.push(b[l])}};a.prototype.addMeasureFolders=function(a,b,d,e){void 0===e&&(e=!1);d.unshift(b);b="";for(var f=0,h,r,n,p=0;ph.children.indexOf(r)&&h.children.push(r),null==n&&(n=r),b+="/"+d[p],a=a[b],h=r,f++)}return{folder:r,root:n}};a.prototype.removeSingleDimensions=function(a){for(var b,d=0;db.indexOf(a.parent)){for(var d=[];null!=a.parent;)d.push(a.parent),a=a.parent;for(var d=d.reverse(),e= 0;eb.indexOf(d[e])&&b.push(d[e])}};a.prototype.clearSearch=function(){this.searchPhrase="";this.searchedHierarchies=null};Object.defineProperty(a.prototype,"isSearch",{get:function(){return!utils.nullOrEmpty(this.searchPhrase)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"isSearchNeeded",{get:function(){return this.allHierarchies&&50b;b++)this.container.toggleClass("wdr-level-"+b,a.level===b);this.container.toggleClass("wdr-selected", !0===c);this.container.toggleClass("wdr-checked",!0!==a.isFolder&&!0!==a.isLevel&&!0===c);this.container.toggleClass("wdr-unchecked",!0!==a.isFolder&&!0!==a.isLevel&&!0!==c);this.container.toggleClass("wdr-measure",!0===a.isMeasure);this.container.toggleClass("wdr-folder",!0===a.isFolder||!0===a.isLevelFolder);this.container.toggleClass("wdr-level-folder",!0===a.isLevelFolder);this.container.toggleClass("wdr-level",!0===a.isLevel);this.container.toggleClass("wdr-measures-folder",!0===a.isMeasuresFolder); this.container.toggleClass("wdr-measures-calculated-folder",!0===a.isMeasuresFolder&&!0===a.isCalculatedMeasuresFolder);this.container.toggleClass("wdr-calculated",!0===a.calculated);this.container.toggleClass(d.grid.vo.GridStyleName.COLLAPSED,(!0===a.isFolder||!0===a.isLevelFolder)&&!0!==a.isExpanded);this.container.toggleClass(d.grid.vo.GridStyleName.EXPANDED,(!0===a.isFolder||!0===a.isLevelFolder)&&!0===a.isExpanded)};return c}(uicontrols.renderers.UIItemRenderer);f.SelectableItemRenderer=b})(h.renderers|| (h.renderers={}))})(d.config||(d.config={}))})(d._view||(d._view={}))})(pivot||(pivot={})); (function(d){(function(e){(function(e){(function(e){var b=function(){function a(){this.newCalculated=[]}a.prototype.update=function(a,b){this._structure=a;this._slice=b;this.hierarchies=[];var e,f=null,h=this._structure.calculatedMeasures;if(null!=this._slice)for(var f=this._slice.flatten(!0),s=0;sc.caption?1:0});for(s=0;s< r.length;s++)e=r[s],this.hierarchies.push(e)};a.prototype.isValidSlice=function(){return!0};a.prototype.toPlainArray=function(a,b){for(var d=[],e=0;e",func:d.data_.consts.FunctionName.GREATER},{name:"_lessOrEqualBtn",label:"\u2264",func:d.data_.consts.FunctionName.LESS_OR_EQUAL},{name:"_greaterOrEqualBtn",label:"\u2265",func:d.data_.consts.FunctionName.GREATER_OR_EQUAL},{name:"_equalBtn2",label:"==",func:d.data_.consts.FunctionName.EQUAL_2},{name:"_notEqualBtn",label:"!=",func:d.data_.consts.FunctionName.NOT_EQUAL}, {name:"_orBtn",label:"OR",func:d.data_.consts.FunctionName.OR},{name:"_andBtn",label:"AND",func:d.data_.consts.FunctionName.AND},{name:"_ifBtn",label:"IF",func:d.data_.consts.FunctionName.IF},{name:"_absBtn",label:"ABS",func:d.data_.consts.FunctionName.ABS},{name:"_minBtn",label:"MIN",func:d.data_.consts.FunctionName.MIN},{name:"_maxBtn",label:"MAX",func:d.data_.consts.FunctionName.MAX}]}b.prototype.update=function(a){utils.nullOrEmpty(a)||(this.currentMeasure=this.model_.cube_.structure_.findMeasure(a))}; Object.defineProperty(b.prototype,"showAggregations",{get:function(){return!0},enumerable:!0,configurable:!0});b.prototype.getAllMeasures=function(){return this.model_.getAllMeasures()};b.prototype.removeMeasure=function(a){h.CalculatedView.addingMeasureFlag=!0;this.model_.removeCalculatedMeasure(a.uniqueName);this.model_.dispatchWith(h.CalculatedView.EVENT_CALCULATED_VALUE_REMOVED,null,a.uniqueName);utils.fmSetTimeout(function(){h.CalculatedView.addingMeasureFlag=!1},1E3)};b.prototype.addMeasure= function(a,c,b){void 0===c&&(c="");void 0===b&&(b=!1);c=0b.name?1:-1};a.prototype.onRemoveBtnClick=function(a){if(utils.browserVersion().isMobile)this.onRemoveMeasure();else this.showRemoveAlert()}; a.prototype.showRemoveAlert=function(){var a=this,b,e;utils.OSUtil.isIOS||utils.OSUtil.isMac?(b=[d.model._labels.Labels.BUTTON_NO,d.model._labels.Labels.BUTTON_YES],e=[null,function(){return a.onRemoveMeasure()}]):(b=[d.model._labels.Labels.BUTTON_YES,d.model._labels.Labels.BUTTON_NO],e=[function(){return a.onRemoveMeasure()},null]);var f=d.model.XSSCheck.valid(this.model_.currentMeasure.caption)?this.model_.currentMeasure.caption:d.model.XSSCheck.validate(this.model_.currentMeasure.caption);d.uialert(d.model._labels.Labels.CALCULATED_VIEW_REMOVE_VALUE_MESSAGE, utils.StringUtils.bind(d.model._labels.Labels.CALCULATED_VIEW_REMOVE_VALUE_TITLE,f),d.AlertType.ALERT,b,e)};a.prototype.onRemoveMeasure=function(){this.model_.removeMeasure(this.model_.currentMeasure);this.close()};a.prototype.onAggrClick=function(a){if("wdr-aggr-display"==a.target.id){var b=parseInt(uicontrols.UIElement.convert(a.target).closest("li").attr("data-index")),b=this.view.measuresDragList.getDataProvider()[b];this.view.aggrView.showWith(b,uicontrols.UIElement.convert(a.target))}};a.prototype.onItemDblClick= function(a){a=parseInt(uicontrols.UIElement.convert(a.target).closest("li").attr("data-index"));a=this.view.measuresDragList.getDataProvider()[a];this.addNewFieldToFormula(a)};a.prototype.addNewFieldToFormula=function(a){null!=a&&(a.aggregation==d.data_.consts.AggregationName.NONE?this.insertText(utils.StringUtils.bind('"{0}"',a.uniqueName)):this.insertText(utils.StringUtils.bind('{0}("{1}")',a.aggregation,a.uniqueName)))};a.prototype.onAggrChange=function(a){var b=a.data.fieldData;a=a.data.aggrData; b.aggregation=a.aggregation;b.caption=a.caption+" of "+b.name;this.view.measuresDragList.validateItem(b)};a.prototype.onFuncBtnClick=function(a){a=parseInt(a.target.container.attr("data-index"));a=this.funcButtonsDataProvider[a].func;a==d.data_.consts.FunctionName.IF||a==d.data_.consts.FunctionName.ABS||a==d.data_.consts.FunctionName.MIN||a==d.data_.consts.FunctionName.MAX||a==d.data_.consts.FunctionName.VALUE?this.addSpecialOperation(a):this.addOperation(a)};a.prototype.onCancelClick=function(){this.close()}; a.prototype.onOkClick=function(){var a=this.view.formulaInput.getText();0==a.length?this.close():!1==this.model_.isValidFormula(a)?d.uialert(d.model._labels.Labels.MESSAGE_WRONG_FORMULA_FORMAT):(this.model_.addMeasure(a,this.view.nameInput.getText(),this.view.cbxIndiValues.checked),this.close())};a.prototype.close=function(){this.dispatchWith(events._Event.CLOSE)};a.prototype.insertText=function(a,b){void 0===b&&(b=0);var d=this.view.formulaInput.getSelectionBeginIndex();this.view.formulaInput.getSelectionEndIndex(); var e=this.view.formulaInput.getText();-1==d&&(d=this.lastPosition);0==d||" "==e.charAt(d-1)?(this.view.formulaInput.insertText(a+" "),this.lastPosition=d+a.length+1):(this.view.formulaInput.insertText(" "+a+" "),this.lastPosition=d+a.length+2);this.lastPosition-=b;this.view.formulaInput.setSelection(this.lastPosition)};a.prototype.addOperation=function(a){this.insertText(a)};a.prototype.addSpecialOperation=function(a){var b=this.view.formulaInput.getSelectionBeginIndex(),d=this.view.formulaInput.getSelectionEndIndex(), e=this.view.formulaInput.getText();"if"==a?this.insertText(a+"("+e.slice(b,d)+", , )",6):this.insertText(a+"("+e.slice(b,d)+")",2)};return a}(events.EventDispatcher);h.CalculatedController=f})(e.calculated||(e.calculated={}))})(d._view||(d._view={}))})(pivot||(pivot={})); (function(d){(function(e){(function(h){var f=function(b){function a(a){var d=b.call(this)||this;d.controller=a;d.setControls();return d}__extends(a,b);a.prototype.setControls=function(){var a=this,b=new uicontrols.UIComponentBase("div","wdr-popup-header wdr-ui-row");this.addChild(b);var f=new uicontrols.UIComponentBase("div","wdr-ui-col wdr-vam");b.addChild(f);this.titleLabel=new uicontrols.UILabel(d.model._labels.Labels.CALCULATED_VIEW_TITLE);this.titleLabel.addClass("wdr-popup-title");f.addChild(this.titleLabel); this.subtitleLabel=new uicontrols.UILabel(d.model._labels.Labels.CALCULATED_VIEW_MEASURE_BOX);this.subtitleLabel.addClass("wdr-popup-subtitle");f.addChild(this.subtitleLabel);f=new uicontrols.UIComponentBase("div","wdr-ui-col wdr-vam wdr-tar wdr-ui-btns-row");b.addChild(f);this.removeButton=new uicontrols.UIButton("wdr-ui-btn-light wdr-icon-act_trash");this.removeButton.setId("wdr-remove-btn");this.removeButton.container.attr("title",d.model._labels.Labels.CALCULATED_VIEW_REMOVE_VALUE);f.addChild(this.removeButton); this.btnCancel=new uicontrols.UIButton("wdr-ui-btn");this.btnCancel.setLabel(d.model._labels.Labels.BUTTON_CANCEL);this.btnOk=new uicontrols.UIButton("wdr-ui-btn-dark");this.btnOk.setLabel(d.model._labels.Labels.BUTTON_APPLY);utils.OSUtil.isIOS||utils.OSUtil.isMac?(f.addChild(this.btnCancel),f.addChild(this.btnOk)):(f.addChild(this.btnOk),f.addChild(this.btnCancel));b=new uicontrols.UIComponentBase("div","wdr-popup-content");this.addChild(b);this.nameInput=new uicontrols.UITextInput;this.nameInput.setId("wdr-name-input"); this.nameInput.setPrompt(d.model._labels.Labels.CALCULATED_VIEW_MEASURE_NAME);b.addChild(this.nameInput);this.measuresDragList=new uicontrols.lists.UIList;this.measuresDragList.setId("wdr-lst-measures");this.measuresDragList.useCache=!1;this.measuresDragList.setLabelField("caption");b.addChild(this.measuresDragList);this.cbxIndiValues=new uicontrols.UICheckBox;this.cbxIndiValues.setLabel(d.model._labels.Labels.CALCULATED_VIEW_CALCULATE_INDI_VALUES);b.addChild(this.cbxIndiValues);this.funcBtnsContainer= new uicontrols.UIComponentBase("div","wdr-ui-row");this.funcBtnsContainer.setId("wdr-func-btn-group");b.addChild(this.funcBtnsContainer);this.funcBtns=[];for(var f=this.controller.funcButtonsDataProvider,k=0;kutils.ArrayUtils.findIndex(this.selectedMembers,this.searchedMembers[b].uniqueName,"uniqueName")==this.isAllSelected&&a++;return a}return this.getTotalSelectedLength()};b.prototype.setFilterItems=function(a){this.selectedMembers.length=0;var b=a.length;this.isAllSelected= 0==b;if(!this.isAllSelected)for(var d=0;ds.length-1);f++)d=s[f],d={member:d,label:this.isSearched()?d.caption.replace(h,"$1"):d.caption,isSelected:(-1== this.selectedMembers.indexOf(d)?this.isAllSelected:!this.isAllSelected)?1:0,levelNum:0,rightMargin:b-as.length-1);d++)f=s[d],f={member:f,levelNum:f.level.num,label:this.isSearched()?f.caption.replace(h,"$1"):f.caption,isSelected:this.isSelected(f),isSearched:this.isSearched(),isExpanded:this.isExpanded(f),rightMargin:b-autils.ArrayUtils.findIndex(this.selectedMembers,this.searchedMembers[d].uniqueName,"uniqueName")==this.isAllSelected&&a++;return a}return this.getTotalSelectedLength()};b.prototype.getTotalSelectedLength=function(){var a=this.isAllSelected?this.currentHierarchy.members.length-this.selectedMembers.length-this.partlySelectedMembers.length- 1:this.selectedMembers.length;return 0>a?0:a};b.prototype.setFilterItems=function(a){var b=a.length;this.selectedMembers.length=0;this.partlySelectedMembers.length=0;if(0==b)this.isAllSelected=!0;else{this.isAllSelected=!1;for(var d,e,f=0;f/gi,"");this.selectedCheckBox.setLabel(b,!0);this.selectedCheckBox.setSelection(a.isSelected)}}};return a}(uicontrols.renderers.UIItemRenderer);d.FilterListItemRenderer=e})(d.filter||(d.filter={}))})(d._view||(d._view={}))})(pivot||(pivot={})); (function(d){(function(e){(function(e){var f=function(b){function a(){var a=b.call(this)||this;a.setItemRendererFactory(function(b,d){return a.getItemRendererFactory(b,d)});return a}__extends(a,b);a.prototype.getItemRendererFactory=function(b,d){var f=this,k=new e.FilterListItemRenderer;k.setData(b);k.setIndex(d);k.addEventListener(a.SELECT_EVENT,function(a){return f.onSelect(a)});k.addEventListener(a.EXPAND_EVENT,function(a){return f.onExpand(a)});return k};a.prototype.onSelect=function(b){b=b.data; this.setSelected(b,1===b.isSelected);this.dispatch(new events._Event(a.SELECT_EVENT,this))};a.prototype.onExpand=function(b){var e=this,f=b.data;if(1===f.isExpanded)if(0===f.member.children.length)d.model.PivotModel.getInstance().cube_.loadMemberChildren(f.member.hierarchy_,f.member,function(a){return e.onChildrenLoaded(f.member)});else this.onChildrenLoaded(f.member);else this.getSmartDataProvider().collapse(f.member),this.invalidate("data"),this.dispatch(new events._Event(a.EXPAND_EVENT,this))}; a.prototype.onChildrenLoaded=function(b){d.preloader(!1);this.getSmartDataProvider().selectDescendants(b);this.getSmartDataProvider().expand(b);this.invalidate("data");this.dispatch(new events._Event(a.EXPAND_EVENT,this))};a.prototype.getSmartDataProvider=function(){return this.filterDataProvider};a.prototype.setSmartDataProvider=function(a){this.filterDataProvider=a};a.prototype.getFilterItems=function(){return this.getSmartDataProvider().getFilterItems()};a.prototype.setFilterItems=function(a){this.getSmartDataProvider().setFilterItems(a); this.invalidate("data")};a.prototype.getSelectedLength=function(){return this.getSmartDataProvider().getSelectedLength()};a.prototype.getTotalSelectedLength=function(){return this.getSmartDataProvider().getTotalSelectedLength()};a.prototype.getTotalLength=function(){return this.getSmartDataProvider().getLength()};a.prototype.getTotalItemsCount=function(){return this.getSmartDataProvider().getTotalLength()};a.prototype.setSelected=function(a,b){this.getSmartDataProvider().select(a.member,b);this.invalidate("data")}; a.prototype.selectAll=function(a){this.getSmartDataProvider().selectAll(a);this.invalidate("data")};a.prototype.search=function(a,b){var d=this;this.getSmartDataProvider().search(a,function(a){d.getSmartDataProvider().setSearchedMembers(a);d.invalidate("data");b()})};a.prototype.isSearched=function(){return this.getSmartDataProvider().isSearched()};a.prototype.setHierarchy=function(a){this.getSmartDataProvider().setHierarchy(a)};a.prototype.sort=function(a){a!==this.getSmartDataProvider().getSortType()&& (this.getSmartDataProvider().setSortType(a),this.invalidate("data"))};a.SELECT_EVENT="_";a.EXPAND_EVENT="__";return a}(uicontrols.lists.UIVirtualList);e.FilterList=f})(e.filter||(e.filter={}))})(d._view||(d._view={}))})(pivot||(pivot={})); (function(d){(function(e){(function(e){var f=function(b){function a(){var a=b.call(this,"div")||this;a._isEmpty=!0;a.addClass("wdr-filters-subview");a.quantityInput=new uicontrols.UITextInput;a.quantityInput.setId("wdr-top-amount-input");a.quantityInput.setRestriction(/^\d+$/);a.quantityInput.setType("number");a.quantityInput.addEventListener(uicontrols.UITextInput.CHANGE_EVENT,function(){return a.onQuantityChange()});a.addChild(a.quantityInput);var e=new uicontrols.UIComponentBase("div");e.setId("wdr-topx-btns"); a.addChild(e);a.btnTop=new uicontrols.UIToggleButton;a.btnTop.setId("wdr-btn-top");a.btnTop.addClass("wdr-topx-btn");a.btnTop.setLabel(d.model._labels.Labels.FILTER_TOP);a.btnTop.addEventListener(events._Event.CHANGE,function(){return a.onBtnTopChange()});e.addChild(a.btnTop);a.btnBottom=new uicontrols.UIToggleButton;a.btnBottom.setId("wdr-btn-bottom");a.btnBottom.addClass("wdr-topx-btn");a.btnBottom.setLabel(d.model._labels.Labels.FILTER_BOTTOM);a.btnBottom.addEventListener(events._Event.CHANGE, function(){return a.onBtnBottomChange()});e.addChild(a.btnBottom);a.measuresDropDown=new uicontrols.lists.UIDropDownList;a.measuresDropDown.setId("wdr-top-measures-dropdown");a.measuresDropDown.setLabelField("caption");a.measuresDropDown.setPrompt("");a.measuresDropDown.addEventListener(events._Event.CHANGE,function(b){return a.onMeasuresChange(b)});a.addChild(a.measuresDropDown);return a}__extends(a,b);a.prototype.onBtnTopChange=function(){this._isEmpty=!1;this.btnBottom.setSelection(1-this.btnTop.getSelection()); this.dispatch(new events._Event(a.CHANGE_EVENT,this))};a.prototype.onBtnBottomChange=function(){this._isEmpty=!1;this.btnTop.setSelection(1-this.btnBottom.getSelection());this.dispatch(new events._Event(a.CHANGE_EVENT,this))};a.prototype.onMeasuresChange=function(b){this._isEmpty=!1;this.dispatch(new events._Event(a.CHANGE_EVENT,this))};a.prototype.onQuantityChange=function(){this._isEmpty=!1;""==this.getFilterType()&&this.setFilterType(d.data_.consts.FilterType.TOP);this.dispatch(new events._Event(a.CHANGE_EVENT, this))};a.prototype.setMeasures=function(a){this.measuresDropDown.setDataProvider(a);this.measuresDropDown.setSelectedIndex(0)};a.prototype.getSelectedMeasure=function(){return this.measuresDropDown.getSelectedItem()};a.prototype.setSelectedMeasure=function(a){this._isEmpty=!1;this.measuresDropDown.setSelectedItem(a,"uniqueName")};a.prototype.reset=function(){this._isEmpty=!0;var a=d.model._options.OptionsManager.flatView;this.btnTop.setSelection(a?0:1);this.btnBottom.setSelection(0);this.measuresDropDown.setSelectedIndex(0); this.measuresDropDown.isVisible(!a);this.quantityInput.setText("10")};a.prototype.setLabels=function(){this.btnTop.setLabel(d.model._labels.Labels.FILTER_TOP);this.btnBottom.setLabel(d.model._labels.Labels.FILTER_BOTTOM);this.measuresDropDown.setPrompt("")};a.prototype.getFilterType=function(){return 1===this.btnTop.getSelection()?d.data_.consts.FilterType.TOP:1===this.btnBottom.getSelection()?d.data_.consts.FilterType.BOTTOM:""};a.prototype.setFilterType=function(a){a==d.data_.consts.FilterType.TOP? (this._isEmpty=!1,this.btnTop.setSelection(1),this.btnBottom.setSelection(0)):a==d.data_.consts.FilterType.BOTTOM&&(this._isEmpty=!1,this.btnTop.setSelection(0),this.btnBottom.setSelection(1))};a.prototype.getFilterQuantity=function(){return parseInt(this.quantityInput.getText())};a.prototype.setFilterQuantity=function(a){this._isEmpty=!1;this.quantityInput.setText(a.toString())};Object.defineProperty(a.prototype,"isEmpty",{get:function(){return this._isEmpty},enumerable:!0,configurable:!0});a.CHANGE_EVENT= "_";return a}(uicontrols.UIComponentBase);e.TopBottomView=f})(e.filter||(e.filter={}))})(d._view||(d._view={}))})(pivot||(pivot={})); (function(d){(function(e){(function(h){var f=function(){function b(){this.sortTypeChanged=!1;if(null!=b.instance)throw"FilterModel is singleton!";this.pivotInstance=d.Pivot.instance;this.modelLocator=d.model.PivotModel.getInstance();this.zeroCoord=e.PivotView.stage.position()}b.getInstance=function(){null==b.instance&&(b.instance=new b);return b.instance};b.dispose=function(){b.instance=null};b.prototype.getHierarchies=function(){return this.hierarchies};b.prototype.setHierarchies=function(a){this.hierarchies= a};b.prototype.update=function(a){this.currentCoord={top:this.zeroCoord.top,left:this.zeroCoord.left};var b=this.modelLocator.cube_.slice_.allHierarchies(!1,!0,this.isFlatTable).toArray();this.setHierarchies(b);this.setCurrentHierarchy(a);this.measures=this.modelLocator.cube_.slice_.measures_.toArray()};b.prototype.clearValuesFilter=function(){this.filterType=d.data_.consts.FilterType.NONE;this.filterQuantity=-1;this.filterMeasureName=""};b.prototype.setCurrentHierarchy=function(a){if(this.currentHierarchy= a)this.sortType=this.currentHierarchy.sortName,this.sortTypeChanged=!1,this.filterMeasureName=this.currentHierarchy.filterMeasureName,this.filterQuantity=this.currentHierarchy.filterQuantity,this.filterType=this.currentHierarchy.filterType,this.members=this.sortType!==d.data_.consts.SortType.UNSORTED?this.currentHierarchy.sortChildren(this.currentHierarchy.allMember,!1,this.sortType).toArray():this.currentHierarchy.allMember.children.toArray()};b.prototype.getTopBottomMeasures=function(){return this.isFlatTable? [this.modelLocator.cube_.structure_.hierarchyToMeasure(this.currentHierarchy.uniqueName)]:this.measures};b.prototype.getSortType=function(){return this.sortType};b.prototype.setSortType=function(a){this.sortType=a;this.sortTypeChanged=!0};b.prototype.applyChanges=function(){this.currentHierarchy.hasValuesFilter()&&this.isValuesFilterEmpty&&this.modelLocator.clearFilter(this.currentHierarchy.uniqueName);this.applyMembersFilter();this.applyValuesFilter();this.applySort()};Object.defineProperty(b.prototype, "isValuesFilterEmpty",{get:function(){return!this.filterMeasureName||0===this.filterMeasureName.length||isNaN(this.filterQuantity)||1>this.filterQuantity||!this.filterType||0===this.filterType.length||this.filterType===d.data_.consts.FilterType.NONE},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"isValuesFilterChanged",{get:function(){return this.currentHierarchy.filterMeasureName!==this.filterMeasureName||this.currentHierarchy.filterQuantity!==this.filterQuantity||this.currentHierarchy.filterType!== this.filterType?!0:!1},enumerable:!0,configurable:!0});b.prototype.applyValuesFilter=function(){!this.isValuesFilterEmpty&&this.isValuesFilterChanged&&("top"===this.filterType?this.modelLocator.setTopX(this.currentHierarchy.uniqueName,this.filterQuantity,this.filterMeasureName):"bottom"===this.filterType&&this.modelLocator.setBottomX(this.currentHierarchy.uniqueName,this.filterQuantity,this.filterMeasureName))};b.prototype.isMembersFilterChanged=function(){if(this.filteredMembers.length!==this.currentHierarchy.filterMembers.length&& !this.filterNegation)return!0;for(var a=0,b=this.filteredMembers.length;athis.view.membersFilterList.getSelectedLength()?this.view.selectAllCbx.setSelection(-1): this.view.membersFilterList.getTotalItemsCount()==this.view.membersFilterList.getSelectedLength()&&this.view.selectAllCbx.setSelection(1)};a.prototype.update=function(a){var b=this;!1!=this.view.isVisible()&&(1E4").attr("name","rows");for(var b=0;b"+a+"");return utils.StringUtils.bind(d.XLSTemplates.SHARED_STRING_XML,e)};e.prototype.composeWorkbookXMLString= function(){for(var e="",b=0;b',this.sheets[b].name,b+1,"rId"+(b+4));return utils.StringUtils.bind(d.XLSTemplates.WORKBOOK_XML,e)};e.prototype.composeWorkbookRelsXMLString=function(){for(var e="",b=0;b","gmi"),"\n");e=e.replace("/&/gmi", "");e=e.replace(RegExp("<[^<]+?>","gmi"),"");var b=d.XLSSharedStrings.strings.indexOf(e);-1==b?(this._value=d.XLSSharedStrings.strings.length,d.XLSSharedStrings.strings.push(e)):this._value=b;this._type=d.XLSType.STRING}else this._value=e,this._type="number"===typeof e?d.XLSType.NUMBER:null===e?d.XLSType.NULL:!1===e?d.XLSType.MERGED:d.XLSType.UNKNOWN},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"id",{get:function(){for(var d="",b=this.column+1,a=0;26'):c+('"+h.value+""))}e=isNaN(this.rows[b])?e+utils.StringUtils.bind('{1}',b+1,c):e+utils.StringUtils.bind('{2}', b+1,this.rows[b],c)}}b="";for(a=0;a',a+1,a+1,this.columns[a]));c="";for(a=0;a',this.mergedCells[a]);a=0{1}',this.mergeCells.length,c):"";return utils.StringUtils.bind(d.XLSTemplates.SHEET_XML,this.getCell(0, 0).id+":"+this.maxCell.id,b,e,a)};return e}();d.XLSSheet=e})(xls||(xls={}));(function(d){var e=function(){function d(){}d.NULL=0;d.NUMBER=1;d.STRING=2;d.MERGED=98;d.UNKNOWN=99;return d}();d.XLSType=e})(xls||(xls={})); (function(d){(function(d){var h=function(){function f(b,a,c,f){void 0===c&&(c=null);void 0===f&&(f=null);this.index=0;a instanceof d.fills.XLSStyleFill?this.fill=a:!isNaN(a)&&-1',utils.nullOrUndefined(this.textAlign)?"left":this.textAlign,utils.nullOrUndefined(this.textIndent)?"":' indent="'+this.textIndent+'"'):'';return utils.StringUtils.bind('{5}', this.format.numFmtId,0'+h+"")}for(f=0;f b.length;)b="0"+b;return a+(' rgb="FF'+b+'"/>')};return b}();d.XLSStyleColor=e})(d.color||(d.color={}))})(d.styles||(d.styles={}))})(xls||(xls={}));(function(d){(function(d){(function(d){var e=function(b){function a(a){return b.call(this,a)||this}__extends(a,b);a.prototype.toXMLString=function(a){return b.prototype.toXMLString.call(this,"bgColor")};return a}(d.XLSStyleColor);d.XLSStyleBgColor=e})(d.color||(d.color={}))})(d.styles||(d.styles={}))})(xls||(xls={})); (function(d){(function(d){(function(d){var e=function(b){function a(a){return b.call(this,a)||this}__extends(a,b);a.prototype.toXMLString=function(a){return b.prototype.toXMLString.call(this,"fgColor")};return a}(d.XLSStyleColor);d.XLSStyleFgColor=e})(d.color||(d.color={}))})(d.styles||(d.styles={}))})(xls||(xls={})); (function(d){(function(d){(function(d){var e=function(){function b(a){void 0===a&&(a=-1);this.fillIndex=0;this.patternFill=new d.XLSStylePatternFill(a)}b.prototype.toXMLString=function(){return""+this.patternFill.toXMLString()+""};Object.defineProperty(b.prototype,"id",{get:function(){return this.patternFill.id},set:function(a){},enumerable:!0,configurable:!0});return b}();d.XLSStyleFill=e})(d.fills||(d.fills={}))})(d.styles||(d.styles={}))})(xls||(xls={})); (function(d){(function(d){(function(h){var f=function(){function b(a){void 0===a&&(a=-1);this.patternType="solid";-1{1}{2}', this.patternType,utils.nullOrUndefined(this.fgColor)?"":this.fgColor.toXMLString(),utils.nullOrUndefined(this.bgColor)?"":this.bgColor.toXMLString())};return b}();h.XLSStylePatternFill=f})(d.fills||(d.fills={}))})(d.styles||(d.styles={}))})(xls||(xls={})); (function(d){(function(d){(function(h){var f=function(){function b(a,b,f){this.fontIndex=0;utils.nullOrUndefined(a)||(this.name=a);utils.nullOrUndefined(b)||(this.size=b);utils.nullOrUndefined(f)||(this.hexColor=new d.color.XLSStyleColor(f))}Object.defineProperty(b.prototype,"id",{get:function(){return this.name+","+this.size+","+(utils.nullOrUndefined(this.hexColor)?"":this.hexColor.id)+","+this.bold+","+this.italic},set:function(a){},enumerable:!0,configurable:!0});b.prototype.toXMLString=function(){var a= "";this.bold&&(a+="");this.size&&(a+='');this.hexColor&&(a+=this.hexColor.toXMLString());if(this.name){var b=this.name;this.name.indexOf(",")&&(b=this.name.split(",")[0].trim());a+=''}return a+""};return b}();h.XLSStyleFont=f})(d.fonts||(d.fonts={}))})(d.styles||(d.styles={}))})(xls||(xls={})); (function(d){(function(d){(function(d){var e=function(){function b(a,b){this.formatCode="";this.numFmtId=a;this.formatCode=b}b.prototype.toXMLString=function(){return''};Object.defineProperty(b.prototype,"id",{get:function(){return""!=this.formatCode?this.formatCode:this.numFmtId.toString()},set:function(a){},enumerable:!0,configurable:!0});b.getNextAvailableCustomNumFmtId=function(){return b.lastNumFmtId++};b.defaultNumFmtId= 1;b.lastNumFmtId=b.defaultNumFmtId;return b}();d.XLSStyleFormat=e})(d.format||(d.format={}))})(d.styles||(d.styles={}))})(xls||(xls={})); (function(d){(function(e){var h=function(){function f(b){this.tuples=[];this.facts=[];this.allIndices=[];this.filtered=[];this.rowResult=[];this.columnResult=[];this.keys=[];this.levels=[];this.drilled=[];this.factKeys=[];this.calculatedKeys=[];this.individualKeys=[];this.ids=[];this.pageFields=[];this.columnFields=[];this.rowFields=[];this.sizes=[];this.filters=[];this.subfilters=[];this.factIndices=[];this.values=[];this.updates=[];this.updatesCache=[];this.datePattern="dd/MM/yyyy";this.dateTimePattern= "dd/MM/yyyy HH:mm:ss";this._grandTotals=[];this.productIdx=0;this.cube_=b}f.prototype.clearData=function(){this.clearValues();this.rowResult=[];this.columnResult=[];this.allMeasures=this.allHierarchies=null};f.prototype.clearValues=function(){this.ids=[];this.tuples=[];this.facts=[];this.drilled=[];this.levels=[];this.values=[];this.updates=[];this.updatesCache=[];this.allIndices=[];this.filtered=[];this.filters=[]};f.prototype.clearAll=function(){this.clearData();this.sizes=[];this.keys=[];this.factKeys= [];this.allIndices=[]};f.prototype.clearUpdates=function(){this.updates=[];this.updatesCache=[];this.values=[]};Object.defineProperty(f.prototype,"slice_",{get:function(){return null!=this._slice?this._slice:this.cube_.slice_},set:function(b){this._slice=b},enumerable:!0,configurable:!0});f.clone=function(b){var a=new f(b.cube_);a.allIndices=b.allIndices.slice(0);a.ids=b.ids.slice(0);a.tuples=b.tuples.slice(0);a.facts=b.facts.slice(0);a.levels=b.levels.slice(0);a.keys=b.keys.slice(0);a.factKeys=b.factKeys.slice(0); return a};f.prototype.addKey=function(b,a){void 0===a&&(a="");if(-1!=this.keys.indexOf(b))return this.keys.indexOf(b);if(""==a)this.levels[this.keys.length]=[-1,this.keys.length];else{var c=this.keys.indexOf(a);this.levels[c]&&this.levels[c].push(this.keys.length)}this.keys.push(b);return this.keys.length-1};f.prototype._addKey=function(b,a){void 0===a&&(a=-1);if(-1!=this.keys.indexOf(b))return this.keys.indexOf(b);-1==a?this.levels[this.keys.length]=[-1,this.keys.length]:this.levels[a].push(this.keys.length); this.keys.push(b);return this.keys.length-1};f.prototype.addFactKey=function(b,a,c){void 0===a&&(a=null);void 0===c&&(c=!1);this.calculatedKeys[this.factKeys.length]=a;this.individualKeys[this.factKeys.length]=c;this.factKeys.push(b)};f.prototype.updateFactKey=function(b,a,c){void 0===a&&(a=null);void 0===c&&(c=!1);b=this.factKeys.indexOf(b);0<=b&&(this.calculatedKeys[b]=a,this.individualKeys[b]=c)};f.prototype.removeFactKey=function(b){b=this.factKeys.indexOf(b);this.factKeys.splice(b,1)};f.prototype.delete_= function(b){var a=this.ids.indexOf(b);if(!utils.nullOrUndefined(b)&&-1c&&(c=f),d=!1)}return d?NaN:c};f.prototype.getProduct=function(b,a){for(var c=1,d=!0,e=0;e=c.count?0:Math.sqrt(c.diffs/(c.count-1))};f.prototype.getPercent=function(b,a){null==this._grandTotals[a]&&(this._grandTotals[a]=this.getSum(this.filtered,a));return Math.abs(100*this.getSum(b,a)/this._grandTotals[a])};f.prototype.getPercentColumn=function(b,a,c){c=this.getNode(c,this.columnResult);return 100*this.getSum(b,a)/this.getSum(c[0][0],a)};f.prototype.getPercentRow=function(b,a,c){c=this.getNode(c,this.rowResult); return 100*this.getSum(b,a)/this.getSum(c[0][0],a)};f.prototype.getIndex=function(b,a,c,d){null==this._grandTotals[a]&&(this._grandTotals[a]=this.getSum(this.filtered,a));c=this.getNode(c,this.rowResult);d=this.getNode(d,this.columnResult);return Math.abs(this._grandTotals[a]*this.getSum(b,a)/(this.getSum(c[0][0],a)*this.getSum(d[0][0],a)))};f.prototype.getDifference=function(b,a,c){return e.dataprovider_.DataProviderFactory.getDataProvider().getValue(b,a,c)};f.prototype.getRunningTotals=function(b, a,c,d){var f=c.calculated?this._slice.measuresAll.indexOf(c.uniqueName)+this.factKeys.length:this.factKeys.indexOf(c.uniqueName);null==this.values[f]&&(this.values[f]=[]);var h=this.calculateIndex(b,a);if(null==this.values[f][h]){c.aggregation=e.consts.AggregationName.SUM;if(d==e.consts.AxisName.ROWS_AXIS)if(0==a.length)this.values[f][h]=this.getValue(b,a,c);else{d=this.slice_.columnsOnly.getItemAt(a.length-1);var l=d.members.getItemAt(a[a.length-1]);if(null==l||null==l.parent)return null;d=d.sortChildren(l.parent, !0);var l=a.slice(0,-1),s=this.getNode(l,this.columnResult);if(s[0]&&s[0][1])for(var r=0,n=0;nb[1]};f.prototype.fxEqual=function(b){return b[0]==b[1]};f.prototype.fxNotEqual=function(b){return b[0]!=b[1]};f.prototype.fxLessOrEqual=function(b){return b[0]<=b[1]};f.prototype.fxGreaterOrEqual=function(b){return b[0]>= b[1]};f.prototype.fxOr=function(b){return b[0]||b[1]};f.prototype.fxAnd=function(b){return b[0]&&b[1]};f.prototype.fxIf=function(b){return b[0]?b[1]:b[2]};f.prototype.fxAbs=function(b){return Math.abs(b[0])};f.prototype.fxMin=function(b){return Math.min(b[0],b[1])};f.prototype.fxMax=function(b){return Math.max(b[0],b[1])};f.prototype.calculateIndex=function(b,a){for(var c=1,d=0,e,f,h=this.columnFields.length-1;0<=h;h--)f=this.sizes[this.rowFields.length+h],09007199254740991/f&&(c=-1,d=9007199254740990-d),c*=f);return d};f.prototype.getTuples=function(){return this.tuples};f.prototype.getFacts=function(){return this.facts};f.prototype.getRowCount=function(){return this.filtered.length};f.prototype.generate=function(b){var a=this,c="2010 2011 2012 2013 2014 2015 2016 2017".split(" "),d,f;this.generateHandler=b;b=this.cube_.structure_.getDataField("Year");for(var h= 0;h>2,a=(a&3)<<4|c>>4,k=(c&15)<<2|g>>6,l=g&63,isNaN(c)?k=l=64:isNaN(g)&&(l=64),b=b+this._keyStr.charAt(m)+this._keyStr.charAt(a)+this._keyStr.charAt(k)+this._keyStr.charAt(l);return b};d.decode=function(e){var b="",a,c,g,m,k,l=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");l>4,c=(c&15)<<4|m>>2,g=(m&3)<<6|k,b+=String.fromCharCode(a),64!=m&&(b+=String.fromCharCode(c)),64!=k&&(b+=String.fromCharCode(g));return b=d._utf8_decode(b)};d._utf8_encode=function(d){d=d.replace(/\r\n/g,"\n");for(var b="",a=0;ac?b+=String.fromCharCode(c):(127c?b+=String.fromCharCode(c>>6|192):(b+=String.fromCharCode(c>>12|224), b+=String.fromCharCode(c>>6&63|128)),b+=String.fromCharCode(c&63|128))}return b};d._utf8_decode=function(d){for(var b="",a=0,c=0,e=0,h=0;ac?(b+=String.fromCharCode(c),a++):191c?(e=d.charCodeAt(a+1),b+=String.fromCharCode((c&31)<<6|e&63),a+=2):(e=d.charCodeAt(a+1),h=d.charCodeAt(a+2),b+=String.fromCharCode((c&15)<<12|(e&63)<<6|h&63),a+=3);return b};d._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return d}();d.Base64=e})(utils|| (utils={}));(function(d){(function(d){(function(d){var e=function(){function b(){}b.MAX_CSV=104857600;b.MAX_JSON=104857600;return b}();d.Limitations=e})(d.license||(d.license={}))})(d.model||(d.model={}))})(pivot||(pivot={})); (function(d){(function(e){(function(h){var f=function(){function a(){}a.UNDEFINED="UNDEFINED";a.START_REPORT="START_REPORT";a.OPENING_REPORT_FILE="OPENING_REPORT_FILE";a.LOADING_REPORT_FILE="LOADING_REPORT_FILE";a.REPORT_FILE_LOADED="REPORT_FILE_LOADED";a.REPORT_FILE_ERROR="REPORT_FILE_ERROR";a.REPORT_FILE_CANCELLED="REPORT_FILE_CANCELLED";a.REPORT_CHANGED="REPORT_CHANGED";a.REPORT_DEFINED="REPORT_DEFINED";a.LOADING_DATA="LOADING_DATA";a.DATA_LOADED="DATA_LOADED";a.DATA_ERROR="DATA_ERROR";a.DATA_FILE_CANCELLED= "DATA_FILE_CANCELLED";a.CONNECTED_TO_DATA_SOURCE="CONNECTED_TO_DATA_SOURCE";a.EMPTY_SLICE="EMPTY_SLICE";a.REBASE_CONNECTION="REBASE_CONNECTION";a.RUNNING_QUERY="RUNNING_QUERY";a.QUERY_COMPLETE="QUERY_COMPLETE";a.QUERY_ERROR="QUERY_ERROR";a.LOADING_LOCALIZATION="LOADING_LOCALIZATION";a.LOCALIZATION_LOADED="LOCALIZATION_LOADED";a.LOCALIZATION_ERROR="LOCALIZATION_ERROR";a.REPORT_COMPLETE="REPORT_COMPLETE";return a}();h.StateEvent=f;var b=function(){function a(){}a.UNDEFINED="UNDEFINED";a.INIT="INIT"; a.CLEAR="CLEAR";a.SET_REPORT="SET_REPORT";a.RUN_QUERY="RUN_QUERY";a.UPDATE_DATA="UPDATE_DATA";a.UPDATE_DATA_PARTIAL="UPDATE_DATA_PARTIAL";a.CONNECT_TO="CONNECT_TO";a.LOAD="LOAD";a.OPEN="OPEN";a.COMPLETE="COMPLETE";return a}();h.ReportType=b;var a=function(a){function g(){var g=a.call(this)||this;g.cube_=d.data_.Cube.getInstance();g._globalLocalization=null;g.reportType=b.UNDEFINED;g.reportState=f.UNDEFINED;g._isReportComplete=!1;g._isReportDefined=!1;g.updateActive=!1;g.connectedToDataSourceHandler= function(){return g.onConnectedToDataSource()};g.structureLoadedHandler=function(){return g.onStructureLoaded()};g.dataFileCancelledHandler=function(){return g.onDataFileCancelled()};g.structureLoadingFailedHandler=function(){return g.onStructureLoadingFailed()};g.beforeQueryHandler=function(){return g.onBeforeQuery()};g.queryCompleteHandler=function(){return g.onQueryComplete()};g.queryErrorHandler=function(){return g.onQueryError()};g.reportManager=new e.report.ReportManager;e._options.OptionsManager.getInstance(); return g}__extends(g,a);Object.defineProperty(g.prototype,"connectionInfo_",{get:function(){return utils.nullOrUndefined(this._connectionInfo)||this._connectionInfo.isEmpty?this._globalConnectionInfo:this._connectionInfo},set:function(a){this._connectionInfo=a},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"isReportComplete",{get:function(){return this._isReportComplete},enumerable:!0,configurable:!0});Object.defineProperty(g.prototype,"isReportDefined",{get:function(){return this._isReportDefined}, enumerable:!0,configurable:!0});g.prototype.init=function(a){var c=this;utils.nullOrUndefined(a)&&(a={});this.reportType=b.INIT;this.globalReport=utils.nullOrUndefined(a.global)?{}:utils.ObjectUtils.deepCopy(a.global);this.setReportState(f.START_REPORT);e._options.OptionsManager.getInstance().addEventListener(f.REPORT_CHANGED,function(){return c.dispatchReportChange()});e.sizes.SizesManager.getInstance().addEventListener(f.REPORT_CHANGED,function(){return c.dispatchReportChange()});e.condition.ConditionManager.getInstance().addEventListener(f.REPORT_CHANGED, function(){return c.dispatchReportChange()});null!=d._view.PivotView.stage.getToolbar()&&utils.fmSetTimeout(function(){d._view.PivotView.stage.getToolbar().updateDataSourceType()},1);this.globalReportVO=e.report.ReportValueObject.fromObject(this.globalReport);this.spreadGlobal(this.globalReportVO);this.applyEmptyState();if("string"==typeof a.report)this._load(a.report);else{var g=a.report||{};e._options.OptionsManager.setOptions(e._options.vo.OptionsValueObject.fromObject(null!=g.options?g.options: g));utils.fmSetTimeout(function(){c.reportType==b.INIT&&c._setReport(a.report||{})},1)}};g.prototype.setReportState=function(a){this.reportState=a;if(a==f.START_REPORT||a==f.OPENING_REPORT_FILE||a==f.LOADING_REPORT_FILE)this._isReportDefined=this._isReportComplete=!1;a==f.REPORT_COMPLETE&&(this._isReportDefined=this._isReportComplete=!0);a==f.REPORT_DEFINED&&(this._isReportDefined=!0);this.dispatchWith(a)};g.prototype.setReport=function(a){utils.nullOrUndefined(a)&&(a={});this.reportType=b.SET_REPORT; this.cancel();this.setReportState(f.START_REPORT);this._setReport(a.report||{})};g.prototype.runQuery=function(a){this.reportType=b.RUN_QUERY;a=a instanceof d.data_._structure.Slice?a:d.data_._structure.Slice.fromObject(e.report.SliceValueObject.fromObject(a),this.cube_.structure_);var c=d.data_._structure.Slice.areRowsDiffer(a,this.cube_.slice_,!1),g=d.data_._structure.Slice.areColumnsDiffer(a,this.cube_.slice_,!1);!d.data_._structure.Slice.areMeasuresDiffer(a,this.cube_.slice_)||c||g||e.sizes.SizesManager.applySizes(e.sizes.SizesManager.rowSizesNamed, e.sizes.SizesManager.columnSizesNamed,e.sizes.SizesManager.rowSizesByIdx,e.sizes.SizesManager.columnSizesByIdx,e.sizes.SizesManager.rowHeaderSizes,e.sizes.SizesManager.columnHeaderSizes,e.sizes.SizesManager.rowFilterSizes);c&&(e.sizes.SizesManager.rowSizes={});g&&(e.sizes.SizesManager.columnSizes={});a.mergeExpandsAndDrills(this.cube_.slice_);e.JavaScriptHandlers.getInstance().dispatch(new e.APIEvent(e.JavaScriptHandlers.REPORT_CHANGE));this.setReportState(f.RUNNING_QUERY);this.cube_.setSlice(a); this.cube_.filter()};g.prototype.updateData=function(a,c){this.reportType=b.UPDATE_DATA;this.cancel();this.setReportState(f.START_REPORT);var g=this.getReport();c.ignoreSorting&&(g.slice.columnSorting={},g.slice.rowSorting={});if(c.ignoreScroll){var h=this.cube_.slice_;this.cube_.setSlice(d.data_._structure.Slice.fromObject(e.report.SliceValueObject.fromObject({}),this.cube_.structure_));this.cube_.setSlice(h)}g.connectionInfo=d.data_.vo.ConnectionInfo.fromObject(a);this._setReport(g,!0)};g.prototype.updateDataPartial= function(a,c){var g=this;this.reportType=b.UPDATE_DATA_PARTIAL;this.cancel();this.setReportState(f.START_REPORT);c.ignoreSorting&&(this.reportVO.slice.columnSorting={},this.reportVO.slice.rowSorting={});if(c.ignoreScroll){var h=this.cube_.slice_;this.cube_.setSlice(d.data_._structure.Slice.fromObject(e.report.SliceValueObject.fromObject({}),this.cube_.structure_));this.cube_.setSlice(h)}this.reportVO.connectionInfo.data=a;this.cube_.updateData(a);this.addDataListeners();d.data_.dataprovider_.DataProviderFactory.getDataProvider().reset(!1); this.updateActive=!0;utils.fmSetTimeout(function(){g.updateActive=!1},500);this.cube_.filter()};g.prototype.connectTo=function(a){this.reportType=b.CONNECT_TO;this.cancel();this.setReportState(f.START_REPORT);this._setReport(a)};g.prototype.load=function(a){this.reportType=b.LOAD;this.cancel();this._load(a)};g.prototype._load=function(a){var b=this;this.setReportState(f.LOADING_REPORT_FILE);this.reportManager.addEventListener(e.report.ReportEvent.REPORT_FILE_LOADED,function(a){return b.onReportFileLoaded(a)}); this.reportManager.addEventListener(e.report.ReportEvent.REPORT_FILE_FAILED,function(){return b.onReportFileFailed()});this.reportManager.load(a)};g.prototype.open=function(){var a=this;this.reportType=b.OPEN;this.setReportState(f.OPENING_REPORT_FILE);this.reportManager.addEventListener(e.report.ReportEvent.REPORT_FILE_LOADED,function(b){return a.onReportFileLoaded(b)});this.reportManager.addEventListener(e.report.ReportEvent.REPORT_FILE_FAILED,function(){return a.onReportFileFailed()});this.reportManager.addEventListener(e.report.ReportEvent.REPORT_FILE_CANCELLED, function(){return a.onReportFileCancelled()});this.reportManager.open()};g.prototype.onReportFileLoaded=function(a){d.preloader(!1);this.setReportState(f.REPORT_FILE_LOADED);this._setReport(a.report)};g.prototype.onReportFileFailed=function(){d.preloader(!1);this.setReportState(f.REPORT_FILE_ERROR);this.setReportState(f.REPORT_DEFINED);this.setReportState(f.REPORT_COMPLETE)};g.prototype.onReportFileCancelled=function(){this.setReportState(f.REPORT_FILE_CANCELLED);this.setReportState(f.REPORT_DEFINED); this.setReportState(f.REPORT_COMPLETE)};g.prototype.dispatchReportChange=function(){this.reportState!=f.REPORT_COMPLETE&&this.reportState!=f.QUERY_COMPLETE||e.JavaScriptHandlers.getInstance().dispatch(new e.APIEvent(e.JavaScriptHandlers.REPORT_CHANGE))};g.prototype._setReport=function(a,b){void 0===b&&(b=!1);this.reportVO=e.report.ReportValueObject.fromObject(a);this.reportVO.connectionInfo.isUpdateData=b;this.loadLocalization()};g.prototype.onReportComplete=function(){this.reportType=b.COMPLETE}; g.prototype.getReport=function(a){void 0===a&&(a={});return h.vo.StateValueObject.toReport(this.getCurrentState(a))};g.prototype.clear=function(){this.cancel();this.reportType=b.CLEAR;this.applyEmptyState();this.cube_.cancel();this.setReportState(f.REPORT_COMPLETE)};g.prototype.cancel=function(){this.reportManager.cancel();this.removeDataListeners();this.updateActive=!1;d.preloader(!1)};g.prototype.loadLocalization=function(){var a=this;if(null!=this.globalReport.localization&&""!=this.globalReport.localization)this.setReportState(f.LOADING_LOCALIZATION), e._labels.LabelsManager.getInstance().load(this.globalReport.localization,function(b){return a.onGlobalLocalizationLoaded(b)},!0),this.globalReport.localization=null;else this.onGlobalLocalizationLoaded(!0)};g.prototype.onGlobalLocalizationLoaded=function(a){var b=this;null==this.reportVO.localization||""==this.reportVO.localization?(e._labels.LabelsManager.getInstance().reset(),this.onLocalizationLoaded(a)):(this.setReportState(f.LOADING_LOCALIZATION),e._labels.LabelsManager.getInstance().load(this.reportVO.localization, function(a){return b.onLocalizationLoaded(a)}))};g.prototype.onLocalizationLoaded=function(a){a?this.setReportState(f.LOCALIZATION_LOADED):this.setReportState(f.LOCALIZATION_ERROR);this.loadStructureAndData()};g.prototype.loadStructureAndData=function(){this.reportType!=b.CONNECT_TO&&this.reportType!=b.OPEN&&(this.applyEmptyState(),e._options.OptionsManager.setOptions(this.reportVO.options),e._options.OptionsManager.configuratorOpened=e._options.OptionsManager.configuratorActive);var a=this.reportType; this.setReportState(f.REPORT_DEFINED);a==this.reportType&&(a=this.reportVO.connectionInfo,!utils.nullOrUndefined(this.connectionInfo_)&&!this.connectionInfo_.isEmpty&&this.connectionInfo_.isEqual(a)&&this.cube_.connectionInfo_&&this.cube_.structure_&&this.cube_.structure_.isComplete?(d.data_.dataprovider_.DataProviderFactory.getDataProvider(),this.addDataListeners(),this.cube_.rebaseConnection()):(a.isEmpty&&this._globalConnectionInfo&&!this._globalConnectionInfo.isEmpty&&(a=this._globalConnectionInfo), a.isEmpty?(this.connectionInfo_=a,this.cube_.cancel(),this.setReportState(f.REPORT_COMPLETE),d.preloader(!1)):(a.isInlineData||this.setReportState(f.LOADING_DATA),d.data_.dataprovider_.DataProviderFactory.getDataProvider(),this.addDataListeners(),this.cube_.connect(a))))};g.prototype.onConnectedToDataSource=function(a){this.reportType==b.CONNECT_TO&&(this.applyEmptyState(),this.cube_.slice_&&this.cube_.slice_.clear(),this.cube_.structure_&&this.cube_.structure_.clear());this.setReportState(f.CONNECTED_TO_DATA_SOURCE); this.connectionInfo_=this.reportVO.connectionInfo};g.prototype.onStructureLoaded=function(a){a=d.data_._structure.Slice.fromObject(this.reportVO.slice,this.cube_.structure_);this.applyReport();this.cube_.setSlice(a);this.setReportState(f.DATA_LOADED);this.cube_.filter()};g.prototype.onDataFileCancelled=function(){this.setReportState(f.DATA_FILE_CANCELLED);this.setReportState(f.REPORT_COMPLETE)};g.prototype.onStructureLoadingFailed=function(){e._options.OptionsManager.setOptions(this.reportVO.options); this.cube_.cancel();d.preloader(!1);this.setReportState(f.DATA_ERROR);this.setReportState(f.REPORT_COMPLETE)};g.prototype.onBeforeQuery=function(){this.setReportState(f.RUNNING_QUERY)};g.prototype.onQueryComplete=function(){this.setReportState(f.QUERY_COMPLETE);this.reportState!=f.REPORT_COMPLETE&&this.setReportState(f.REPORT_COMPLETE)};g.prototype.onQueryError=function(){this.setReportState(f.QUERY_ERROR);this.reportState!=f.REPORT_COMPLETE&&this.setReportState(f.REPORT_COMPLETE)};g.prototype.addDataListeners= function(){var a=this;this.cube_.addEventListener(d.data_.DataEvent.STRUCTURE_CONNECTED,this.connectedToDataSourceHandler);this.cube_.addEventListener(d.data_.DataEvent.STRUCTURE_LOADED,this.structureLoadedHandler);this.cube_.addEventListener(d.data_.DataEvent.STRUCTURE_CANCELLED,this.dataFileCancelledHandler);this.cube_.addEventListener(d.data_.DataEvent.STRUCTURE_LOADING_FAILED,this.structureLoadingFailedHandler);this.cube_.addEventListener(d.data_.DataEvent.BEFORE_QUERY,this.beforeQueryHandler); this.cube_.addEventListener(d.data_.DataEvent.QUERY_COMPLETE,this.queryCompleteHandler);this.cube_.addEventListener(d.data_.DataEvent.QUERY_ERROR,this.queryErrorHandler);this.cube_.addEventListener(f.REPORT_CHANGED,function(){return a.dispatchReportChange()})};g.prototype.removeDataListeners=function(){this.cube_.removeEventListener(d.data_.DataEvent.STRUCTURE_CONNECTED,this.connectedToDataSourceHandler);this.cube_.removeEventListener(d.data_.DataEvent.STRUCTURE_LOADED,this.structureLoadedHandler); this.cube_.removeEventListener(d.data_.DataEvent.STRUCTURE_CANCELLED,this.dataFileCancelledHandler);this.cube_.removeEventListener(d.data_.DataEvent.STRUCTURE_LOADING_FAILED,this.structureLoadingFailedHandler);this.cube_.removeEventListener(d.data_.DataEvent.BEFORE_QUERY,this.beforeQueryHandler);this.cube_.removeEventListener(d.data_.DataEvent.QUERY_COMPLETE,this.queryCompleteHandler);this.cube_.removeEventListener(d.data_.DataEvent.QUERY_ERROR,this.queryErrorHandler)};g.prototype.save=function(a, b,c,d,e){void 0===e&&(e=!1);return this.reportManager.save(a,b,c,d,e,this.getReport(a instanceof Object?a:{}))};g.prototype.getCurrentState=function(a){var b=a.hasOwnProperty("withDefaults")?!0==a.withDefaults:!1;a=a.hasOwnProperty("withGlobals")?!0==a.withGlobals:!1;var c=new h.vo.StateValueObject;c.withDefaults=b;c.withGlobals=a;c._connectionInfo=a&&this._connectionInfo.isEmpty&&!this._globalConnectionInfo.isEmpty?this._globalConnectionInfo:this._connectionInfo;c._structure=this.cube_.structure_; c._slice=this.cube_.slice_;c._options=e._options.OptionsManager.getOptions(b,a);c.formats=e.format.FormatManager.getAllFormats();c.conditions=e.condition.ConditionManager.conditions;c.customFields=e.report.CustomFieldsManager.customFields;c.rowSizes=e.sizes.SizesManager.rowSizesNamed;c.columnSizes=e.sizes.SizesManager.columnSizesNamed;c.startTableRow=e.sizes.SizesManager.startTableRow;c.rowHeaderSizes=e.sizes.SizesManager.rowHeaderSizes;c.columnHeaderSizes=e.sizes.SizesManager.columnHeaderSizes;c.rowFilterSizes= e.sizes.SizesManager.rowFilterSizes;c.expandedRows=this.cube_.slice_?this.cube_.slice_.axes.getItem(d.data_.consts.AxisName.ROWS_AXIS).expandedTuplesBasedOnUniqueNames:[];c.expandedColumns=this.cube_.slice_?this.cube_.slice_.axes.getItem(d.data_.consts.AxisName.COLUMNS_AXIS).expandedTuplesBasedOnUniqueNames:[];c.drilledRows=this.cube_.slice_?this.cube_.slice_.axes.getItem(d.data_.consts.AxisName.ROWS_AXIS).drilledTuplesBasedOnUniqueNames:[];c.drilledColumns=this.cube_.slice_?this.cube_.slice_.axes.getItem(d.data_.consts.AxisName.COLUMNS_AXIS).drilledTuplesBasedOnUniqueNames: [];this.reportVO&&(c.localization=a&&null==this.reportVO.localization&&null!=this._globalLocalization?this._globalLocalization:this.reportVO.localization);return c};g.prototype.spreadGlobal=function(a){this._globalConnectionInfo=a.connectionInfo;e._options.OptionsManager.setGlobalOptions(a.options);this._globalLocalization=a.localization};g.prototype.applyEmptyState=function(){d.data_.dataprovider_.DataProviderFactory.dispose();e.sizes.SizesManager.clear();e.condition.ConditionManager.removeAll(); e.format.FormatManager.clear();e.report.CustomFieldsManager.customFields=[];e._options.OptionsManager.clear()};g.prototype.applyReport=function(){e._options.OptionsManager.setOptions(this.reportVO.options);e.sizes.SizesManager.clear();e.sizes.SizesManager.applySizes(this.reportVO.rowSizes,this.reportVO.columnSizes,this.reportVO.rowSizesByIdx,this.reportVO.columnSizesByIdx,this.reportVO.rowHeaderSizes,this.reportVO.columnHeaderSizes,this.reportVO.rowFilterSizes);var a;e.condition.ConditionManager.removeAll(); for(a=0;athis.localDataStorage.factKeys.length&&this.addCalculatedMeasuresToDataStorage();this.localDataStorage.filter();this.localDataStorage.select();this.dispatchQueryComplete()};b.prototype.addCalculatedMeasuresToDataStorage=function(){for(var a=0;af.indexOf("px")&&0>f.indexOf("%")?f+"px":f;this.Labels=m}; WebDataRocksToolbar.prototype.getTabs=function(){var a=[],b=this.Labels;a.push({title:b.connect,id:"wdr-tab-connect",icon:this.icons.connect,menu:[{title:b.connect_local_csv,id:"wdr-tab-connect-local-csv",handler:this.connectLocalCSVHandler,mobile:!1,icon:this.icons.connect_csv},{title:b.connect_local_json,id:"wdr-tab-connect-local-json",handler:this.connectLocalJSONHandler,mobile:!1,icon:this.icons.connect_json},{title:this.osUtils.isMobile?b.connect_remote_csv_mobile:b.connect_remote_csv,id:"wdr-tab-connect-remote-csv", handler:this.connectRemoteCSV,icon:this.icons.connect_csv},{title:this.osUtils.isMobile?b.connect_remote_json_mobile:b.connect_remote_json,id:"wdr-tab-connect-remote-json",handler:this.connectRemoteJSON,icon:this.icons.connect_json}]});a.push({title:b.open,id:"wdr-tab-open",icon:this.icons.open,menu:[{title:b.local_report,id:"wdr-tab-open-local-report",handler:this.openLocalReport,mobile:!1,icon:this.icons.open_local},{title:this.osUtils.isMobile?b.remote_report_mobile:b.remote_report,id:"wdr-tab-open-remote-report", handler:this.openRemoteReport,icon:this.icons.open_remote}]});a.push({title:b.save,id:"wdr-tab-save",handler:this.saveHandler,mobile:!1,icon:this.icons.save});a.push({title:b.export,id:"wdr-tab-export",mobile:!1,icon:this.icons.export,menu:[{title:b.export_print,id:"wdr-tab-export-print",handler:this.printHandler,icon:this.icons.export_print},{title:b.export_html,id:"wdr-tab-export-html",handler:this.exportHandler,args:"html",icon:this.icons.export_html},{title:b.export_excel,id:"wdr-tab-export-excel", handler:this.exportHandler,args:"excel",icon:this.icons.export_excel},{title:b.export_pdf,id:"wdr-tab-export-pdf",handler:this.exportHandler,args:"pdf",icon:this.icons.export_pdf}]});a.push({title:b.format,id:"wdr-tab-format",icon:this.icons.format,rightGroup:!0,menu:[{title:this.osUtils.isMobile?b.format_cells_mobile:b.format_cells,id:"wdr-tab-format-cells",handler:this.formatCellsHandler,icon:this.icons.format_number},{title:this.osUtils.isMobile?b.conditional_formatting_mobile:b.conditional_formatting, id:"wdr-tab-format-conditional",handler:this.conditionalFormattingHandler,icon:this.icons.format_conditional}]});a.push({title:b.options,id:"wdr-tab-options",handler:this.optionsHandler,icon:this.icons.options,rightGroup:!0});a.push({title:b.fields,id:"wdr-tab-fields",handler:this.fieldsHandler,icon:this.icons.fields,rightGroup:!0});void 0!=document.addEventListener&&a.push({title:b.fullscreen,id:"wdr-tab-fullscreen",handler:this.fullscreenHandler,mobile:!1,icon:this.icons.fullscreen,rightGroup:!0}); return a};WebDataRocksToolbar.prototype.create=function(){this.popupManager=new WebDataRocksToolbar.PopupManager(this);this.dataProvider=this.getTabs();this.init()}; WebDataRocksToolbar.prototype.applyToolbarLayoutClasses=function(){if(!this.osUtils.isMobile){var a=this,b=function(){if(a.toolbarWrapper){var b=a.toolbarWrapper.getBoundingClientRect().width;a.toolbarWrapper.classList.remove("wdr-layout-500");a.toolbarWrapper.classList.remove("wdr-layout-360");a.toolbarWrapper.classList.remove("wdr-layout-300");500>b&&a.toolbarWrapper.classList.add("wdr-layout-500");360>b&&a.toolbarWrapper.classList.add("wdr-layout-360");300>b&&a.toolbarWrapper.classList.add("wdr-layout-300")}}; b();window.addEventListener("resize",b)}}; WebDataRocksToolbar.prototype.init=function(){this.container=this.pivotContainer;this.container.style.position=""==this.container.style.position?"relative":this.container.style.position;this.toolbarWrapper=document.createElement("div");this.toolbarWrapper.id="wdr-toolbar-wrapper";this.toolbarWrapper.style.width=this.width;this.osUtils.isMobile&&this.addClass(this.toolbarWrapper,"wdr-mobile");this.addClass(this.toolbarWrapper,"wdr-toolbar-ui");this.toolbarWrapper.style.width=this.width;var a=document.createElement("ul"); a.id="wdr-toolbar";var b=document.createElement("div");b.classList.add("wdr-toolbar-group-right");a.appendChild(b);for(var d=0;d a > span"),a.connect);this.setText(document.querySelector("#wdr-tab-connect-local-csv > a > span"),a.connect_local_csv);this.setText(document.querySelector("#wdr-tab-connect-local-json > a > span"),a.connect_local_json);this.setText(document.querySelector("#wdr-tab-connect-remote-csv > a > span"),this.osUtils.isMobile?a.connect_remote_csv_mobile:a.connect_remote_csv);this.setText(document.querySelector("#wdr-tab-open > a > span"), a.open);this.setText(document.querySelector("#wdr-tab-open-local-report > a > span"),a.local_report);this.setText(document.querySelector("#wdr-tab-open-remote-report > a > span"),this.osUtils.isMobile?a.remote_report_mobile:a.remote_report);this.setText(document.querySelector("#wdr-tab-save > a > span"),a.save);this.setText(document.querySelector("#wdr-tab-format > a > span"),a.format);this.setText(document.querySelector("#wdr-tab-format-cells > a > span"),this.osUtils.isMobile?a.format_cells_mobile: a.format_cells);this.setText(document.querySelector("#wdr-tab-format-conditional > a > span"),this.osUtils.isMobile?a.conditional_formatting_mobile:a.conditional_formatting);this.setText(document.querySelector("#wdr-tab-options > a > span"),a.options);this.setText(document.querySelector("#wdr-tab-fullscreen > a > span"),a.fullscreen);this.setText(document.querySelector("#wdr-tab-export > a > span"),a.export);this.setText(document.querySelector("#wdr-tab-export-print > a > span"),a.export_print);this.setText(document.querySelector("#wdr-tab-export-html > a > span"), a.export_html);this.setText(document.querySelector("#wdr-tab-export-excel > a > span"),a.export_excel);this.setText(document.querySelector("#wdr-tab-export-pdf > a > span"),a.export_pdf);this.setText(document.querySelector("#wdr-tab-fields > a > span"),a.fields)}; WebDataRocksToolbar.prototype.icons={connect:'menu_connect',connect_csv:'', connect_json:'', open:'menu_open', open_local:'', open_remote:'', save:'menu_save', export:'menu_export', export_print:'dd_save_print',export_excel:'', export_html:'', export_pdf:'', format:'menu_format', format_number:'', format_conditional:'', options:'menu_options', fields:'menu_fields', fullscreen:'menu_fullscreen_open'}; WebDataRocksToolbar.prototype.connectLocalCSVHandler=function(){this.pivot.connectTo({dataSourceType:"csv",browseForFile:!0})};WebDataRocksToolbar.prototype.connectLocalJSONHandler=function(){this.pivot.connectTo({dataSourceType:"json",browseForFile:!0})};WebDataRocksToolbar.prototype.connectRemoteCSV=function(){this.showConnectToRemoteCSVDialog()};WebDataRocksToolbar.prototype.connectRemoteJSON=function(){this.showConnectToRemoteJSONDialog()};WebDataRocksToolbar.prototype.openLocalReport=function(){this.pivot.open()}; WebDataRocksToolbar.prototype.openRemoteReport=function(){this.showOpenRemoteReportDialog()};WebDataRocksToolbar.prototype.saveHandler=function(){this.pivot.save("report.json","file")};WebDataRocksToolbar.prototype.formatCellsHandler=function(){this.showFormatCellsDialog()};WebDataRocksToolbar.prototype.conditionalFormattingHandler=function(){this.showConditionalFormattingDialog()};WebDataRocksToolbar.prototype.optionsHandler=function(){this.showOptionsDialog()}; WebDataRocksToolbar.prototype.fieldsHandler=function(){this.pivot.openFieldsList()};WebDataRocksToolbar.prototype.printHandler=function(){this.pivot.print()};WebDataRocksToolbar.prototype.exportHandler=function(a){"pdf"==a?this.showExportPdfDialog():this.pivot.exportTo(a)};WebDataRocksToolbar.prototype.fullscreenHandler=function(){this.toggleFullscreen()};WebDataRocksToolbar.prototype.defaults={}; WebDataRocksToolbar.prototype.showConnectToRemoteCSVDialog=function(){var a=this,b=this.Labels,d=this.popupManager.createPopup();d.content.classList.add("wdr-popup-w500");d.setTitle(b.open_remote_csv);d.setToolbar([{id:"wdr-btn-open",label:b.open,handler:function(){0k;k++)p.options[k]= new Option(0===k?b.none:k-1,k-1);c.appendChild(l);c=document.createElement("div");c.classList.add("wdr-inp-row");c.classList.add("wdr-ir-horizontal");g.appendChild(c);k=document.createElement("label");a.setText(k,b.currency_symbol);c.appendChild(k);var q=document.createElement("input");q.classList.add("wdr-inp");q.type="text";c.appendChild(q);c=document.createElement("div");c.classList.add("wdr-inp-row");c.classList.add("wdr-ir-horizontal");g.appendChild(c);k=document.createElement("label");a.setText(k, b.currency_align);c.appendChild(k);var l=a.createSelect(),r=l.select;r.options[0]=new Option(b.align_left,"left");r.options[1]=new Option(b.align_right,"right");c.appendChild(l);c=document.createElement("div");c.classList.add("wdr-inp-row");c.classList.add("wdr-ir-horizontal");g.appendChild(c);k=document.createElement("label");a.setText(k,b.null_value);c.appendChild(k);var s=document.createElement("input");s.classList.add("wdr-inp");s.type="text";c.appendChild(s);c=document.createElement("div");c.classList.add("wdr-inp-row"); c.classList.add("wdr-ir-horizontal");g.appendChild(c);k=document.createElement("label");a.setText(k,b.is_percent);c.appendChild(k);var l=a.createSelect(),t=l.select;t.options[0]=new Option(b.true_value,!0);t.options[1]=new Option(b.false_value,!1);c.appendChild(l);f.setContent(m);this.popupManager.addPopup(f.content);b=a.pivot.getMeasures();for(k=0;k=|<|>|=|=|!=|isNaN/g);return null==b&&null==c?{}:{value1:null!=b?b[0].replace(/\s/,""):c[0],value2:null!=b&&1<"===c,q="isNaN"===c;(null==e||0==e.length)&&!q||p&&m||(p&&!m?g="AND(#value > "+e+", #value < "+f+")":q?g="isNaN(#value)":(isNaN(parseFloat(e))&&(e="'"+e+"'"),g="#value "+c+" "+e));c=g;if(null==c)return;d[b].formula=c;a.pivot.addCondition(d[b])}a.pivot.refresh()}, isPositive:!0},{id:"wdr-btn-cancel",label:b.cancel}],!0);var g=document.createElement("a");g.id="wdr-add-btn";g.setAttribute("href","javascript:void(0)");g.classList.add("wdr-ui-btn");g.classList.add("wdr-ui-btn-light");g.classList.add("wdr-button-add");g.onclick=function(){var b={sign:"<",value1:"0",measures:a.pivot.getMeasures(),format:{fontFamily:"Arial",fontSize:"12px",color:"#000000",backgroundColor:"#FFFFFF"}};d.push(b);c.appendChild(a.createConditionalFormattingItem(b,d));a.popupManager.centerPopup(m.content)}; g.setAttribute("title",b.add_condition);b=document.createElement("span");b.classList.add("wdr-icon");b.classList.add("wdr-icon-act_add");g.appendChild(b);m.toolbar.insertBefore(g,m.toolbar.firstChild);var c=document.createElement("div");c.classList.add("wdr-popup-content");c.onclick=function(b){b.target.classList.contains("wdr-cr-delete")&&a.popupManager.centerPopup(m.content)};for(g=0;g"},{label:"greater_than_or_equal",sign:">="},{label:"equal_to",sign:"="},{label:"not_equal_to",sign:"!="},{label:"between",sign:"><"},{label:"is_empty",sign:"isNaN"}]; WebDataRocksToolbar.prototype.createConditionalFormattingItem=function(a,b){var d=this,f=this.Labels,m=function(a,b){h[0]=new Option(f.all_values,"");for(var c=d.pivot.getOptions()||{},c=c.grid&&"flat"==c.grid.type,e=0;e<"===a.sign?(p.classList.remove("wdr-width120"),p.classList.add("wdr-width50"),p.style.display="inline-block",r.value="value2"in a?a.value2:"0",r.style.display="inline-block",q.style.display="inline-block"):("sign"in a&&"isNaN"===a.sign?p.style.display="none":(p.classList.add("wdr-width120"),p.classList.remove("wdr-width50"),p.style.display="inline-block"),r.style.display="none",q.style.display="none")},c=function(){var b=a.format;null!=b&&(v.style.backgroundColor=b.backgroundColor||"#fff",v.style.color=b.color||"#000",v.style.fontFamily=b.fontFamily||"Arial",v.style.fontSize=b.fontSize||"12px")},k=document.createElement("div"); k.classList.add("wdr-condition-row");var l=document.createElement("div");l.classList.add("wdr-wrap-relative");k.appendChild(l);var e=document.createElement("span");e.classList.add("wdr-cr-delete");e.classList.add("wdr-icon");e.classList.add("wdr-icon-act_trash");e.onclick=function(){var c=b.indexOf(a);-1<"===a.sign?a.value2=0:("sign"in a&&"isNaN"===a.sign&&delete a.value1,delete a.value2);g()};e.appendChild(n);var p=document.createElement("input");p.classList.add("wdr-number-inp");p.classList.add("wdr-width50");p.type="number";p.value="value1"in a?a.value1:"0";p.onchange=function(){a.value1=0==p.value.length?"0":p.value};e.appendChild(p);var q=document.createElement("span");q.id="wdr-and-label";q.classList.add("wdr-width20"); d.setText(q,f.and_symbole);e.appendChild(q);var r=document.createElement("input");r.classList.add("wdr-number-inp");r.classList.add("wdr-width50");r.type="number";r.value="value2"in a?a.value2:"0";r.onchange=function(){a.value2=0==r.value.length?"0":r.value};e.appendChild(r);g();e=document.createElement("div");e.classList.add("wdr-cr-inner");l.appendChild(e);n=document.createElement("div");n.classList.add("wdr-cr-lbl");n.classList.add("wdr-width50");d.setText(n,f.format+":");e.appendChild(n);n=d.createSelect(); n.id="wdr-font-family";var s=n.select;(function(a){for(var b=0;bthis.toolbarWrapper.getBoundingClientRect().right&&(b.style.right=0,this.addClass(a,"wdr-align-rigth")))};WebDataRocksToolbar.prototype.hideDropdown=function(a){var b=a.querySelectorAll(".wdr-dropdown")[0];b&&(b.style.display="none",b.style.right=null,this.removeClass(a,"wdr-align-rigth"))}; WebDataRocksToolbar.prototype.createTabMenu=function(a){var b=document.createElement("div");b.className="wdr-dropdown wdr-shadow-container";var d=document.createElement("ul");d.className="wdr-dropdown-content";for(var f=0;fb.width&&a.classList.add("wdr-layout-tablet");580>b.width&&a.classList.add("wdr-layout-mobile");460>b.width&&a.classList.add("wdr-layout-mobile-small")}; WebDataRocksToolbar.PopupManager.prototype.centerPopup=function(a){var b=this.getBoundingRect(this.toolbar.container),d=this.getBoundingRect(a),f=this.getBoundingRect(this.toolbar.toolbarWrapper);a.style.zIndex=parseInt(this.modalOverlay.style.zIndex)+1;this.modalOverlay.style.height=b.height+"px";a.style.left=Math.max(0,(f.width-d.width)/2)+"px";a.style.top=Math.max(0,(b.height-d.height)/2)+"px"}; WebDataRocksToolbar.PopupManager.prototype.removePopup=function(a){a=a||this.activePopup;null!=this.modalOverlay&&(this.toolbar.toolbarWrapper.removeChild(this.modalOverlay),this.modalOverlay=null);null!=a&&(this.toolbar.toolbarWrapper.removeChild(a),this.activePopup=null,window.removeEventListener("resize",a.resizeHandler))}; WebDataRocksToolbar.PopupManager.prototype.getBoundingRect=function(a){var b=a.getBoundingClientRect();return{left:b.left,right:b.right,top:b.top,bottom:b.bottom,width:b.width||a.clientWidth,height:b.height||a.clientHeight}};WebDataRocksToolbar.PopupManager.prototype.createModalOverlay=function(){var a=document.createElement("div");a.className="wdr-modal-overlay";a.id="wdr-popUp-modal-overlay";var b=this;a.addEventListener("click",function(a){b.removePopup(b.activePopup)});return a}; WebDataRocksToolbar.PopupManager.PopupWindow=function(a){this.popupManager=a;var b=document.createElement("div");b.className="wdr-panel-content";var d=document.createElement("div");d.className="wdr-title-bar";var f=document.createElement("div");f.className="wdr-title-text";var m=document.createElement("div");m.className="wdr-toolbox";m.style.clear="both";this.content=document.createElement("div");this.content.className="wdr-popup wdr-panel wdr-toolbar-ui wdr-ui";this.content.appendChild(b);b.appendChild(d); d.appendChild(f);this.setTitle=function(a){WebDataRocksToolbar.prototype.setText(f,a)};this.setContent=function(a){b.insertBefore(a,d.nextSibling)};var g=this;this.setToolbar=function(a,k){m.innerHTML="";for(var l=a.length-1;0<=l;l--){var e=document.createElement("a");e.setAttribute("href","javascript:void(0)");e.className="wdr-ui-btn"+(a[l].isPositive?" wdr-ui-btn-dark":"");a[l].id&&(e.id=a[l].id);WebDataRocksToolbar.prototype.setText(e,a[l].label);e.onclick=function(a){return function(){null!=a&& a.call();g.popupManager.removePopup()}}(a[l].handler);!0===a[l].disabled?WebDataRocksToolbar.prototype.addClass(e,"wdr-ui-disabled"):WebDataRocksToolbar.prototype.removeClass(e,"wdr-ui-disabled");a[l].isPositive&&(WebDataRocksToolbar.prototype.osUtils.isMac||WebDataRocksToolbar.prototype.osUtils.isIOS)?m.appendChild(e):m.insertBefore(e,m.firstChild)}k?(m.classList.add("wdr-ui-col"),d.appendChild(m),d.classList.add("wdr-ui-row"),f.classList.add("wdr-ui-col")):b.appendChild(m)};this.toolbar=m;this.titleBar= d;this.title=f;return this}; WebDataRocksToolbar.ColorPicker=function(a,b){function d(a){a=a.target.getAttribute("data-c");h.drawShades(h.colors[a]);h.setColor(a,h.currentType,!0)}function f(a){a=a.target.getAttribute("data-c");h.setColor(a,h.currentType,!0)}function m(a){h.currentType=a;k.classList.remove("wdr-current");l.classList.remove("wdr-current");"bg"==a?(l.classList.add("wdr-current"),h.setColor(h.backgroundColor,a,!1)):(k.classList.add("wdr-current"),h.setColor(h.fontColor,a,!1))}function g(){h.closePopup();h.cancelHandler&& h.cancelHandler()}this.toolbar=a;this.element=document.createElement("div");this.element.classList.add("wdr-colorpick-wrap");this.element.classList.add("wdr-width40");this.colorPickerButton=document.createElement("div");this.colorPickerButton.classList.add("wdr-colorpick-btn");this.element.appendChild(this.colorPickerButton);this.colorPickerIcon=document.createElement("span");this.colorPickerIcon.classList.add("wdr-icon");this.colorPickerIcon.classList.add("wdr-icon-act_font");this.colorPickerButton.appendChild(this.colorPickerIcon); this.popup=document.createElement("div");this.popup.classList.add("wdr-colorpick-popup");this.popup.onclick=function(a){a.stopPropagation()};b.appendChild(this.popup);var c=document.createElement("div");c.classList.add("wdr-color-targ-switch");this.popup.appendChild(c);var k=document.createElement("a");k.classList.add("wdr-cts-item");k.classList.add("wdr-current");k.href="javascript:void(0);";k.innerHTML=a.Labels.cp_text;k.onclick=function(){m("font")};c.appendChild(k);var l=document.createElement("a"); l.classList.add("wdr-cts-item");l.innerHTML=a.Labels.cp_highlight;l.href="javascript:void(0);";l.onclick=function(){m("bg")};c.appendChild(l);c=document.createElement("div");c.classList.add("wdr-cp-sett-row");this.popup.appendChild(c);this.colorInput=document.createElement("input");this.colorInput.type="text";this.colorInput.classList.add("wdr-inp");this.colorInput.classList.add("wdr-width140");this.colorInput.classList.add("wdr-tac");this.colorInput.onchange=function(){var a=h.colorInput.value;h.isColor(a)&& h.setColor(a,h.currentType,!0)};c.appendChild(this.colorInput);this.colorPreview=document.createElement("div");this.colorPreview.classList.add("wdr-cp-curr-color");this.colorPreview.classList.add("wdr-width140");c.appendChild(this.colorPreview);this.mainColors=document.createElement("div");this.mainColors.classList.add("wdr-row-9colors");this.popup.appendChild(this.mainColors);for(var e in this.colors){c=document.createElement("div");c.classList.add("wdr-r9c-item");c.style.backgroundColor=e;c.setAttribute("data-c", e);c.addEventListener("click",d);this.mainColors.appendChild(c);var n=document.createElement("span");n.classList.add("wdr-cp-currentmark");n.classList.add("wdr-icon");n.classList.add("wdr-icon-act_check");c.appendChild(n);n=document.createElement("span");n.classList.add("wdr-r9c-arrow");n.style.borderTopColor=e;c.appendChild(n)}this.shadeColors=document.createElement("div");this.shadeColors.classList.add("wdr-row-4colors");this.popup.appendChild(this.shadeColors);for(e=0;8>e;e++)c=document.createElement("div"), c.classList.add("wdr-r4c-item"),c.addEventListener("click",f),this.shadeColors.appendChild(c),n=document.createElement("span"),n.classList.add("wdr-cp-currentmark"),n.classList.add("wdr-icon"),n.classList.add("wdr-icon-act_check"),c.appendChild(n);this.drawShades(this.colors["#000000"]);c=document.createElement("div");c.classList.add("wdr-cp-btns-row");this.popup.appendChild(c);e=document.createElement("a");e.innerHTML=a.Labels.apply;e.classList.add("wdr-ui-btn");e.classList.add("wdr-ui-btn-dark"); e.addEventListener("click",function(){h.closePopup();h.applyHandler&&h.applyHandler()});n=document.createElement("a");n.innerHTML=a.Labels.cancel;n.classList.add("wdr-ui-btn");n.addEventListener("click",g);WebDataRocksToolbar.prototype.osUtils.isMac||WebDataRocksToolbar.prototype.osUtils.isIOS?(c.appendChild(n),c.appendChild(e)):(c.appendChild(e),c.appendChild(n));this.currentType="font";this.colorPickerButton.addEventListener("click",function(a){a.stopPropagation();h.isOpened()?h.closePopup():h.openPopup()}); document.body.addEventListener("click",function(a){g()});var h=this}; WebDataRocksToolbar.ColorPicker.prototype.colors={"#000000":"#000000 #212121 #424242 #616161 #757575 #9E9E9E #BDBDBD #FFFFFF".split(" "),"#F44336":"#D32F2F #E53935 #F44336 #EF5350 #E57373 #EF9A9A #FFCDD2 #FFEBEE".split(" "),"#FF9800":"#F57C00 #FB8C00 #FF9800 #FFA726 #FFB74D #FFCC80 #FFE0B2 #FFF3E0".split(" "),"#FFEB3B":"#FBC02D #FDD835 #FFEB3B #FFEE58 #FFF176 #FFF59D #FFF9C4 #FFFDE7".split(" "),"#8BC34A":"#689F38 #7CB342 #8BC34A #9CCC65 #AED581 #C5E1A5 #DCEDC8 #F1F8E9".split(" "),"#009688":"#00796B #00897B #009688 #26A69A #4DB6AC #80CBC4 #B2DFDB #E0F2F1".split(" "), "#03A9F4":"#0288D1 #039BE5 #03A9F4 #29B6F6 #4FC3F7 #81D4FA #B3E5FC #E1F5FE".split(" "),"#3F51B5":"#303F9F #3949AB #3F51B5 #5C6BC0 #7986CB #9FA8DA #C5CAE9 #E8EAF6".split(" "),"#9C27B0":"#7B1FA2 #8E24AA #9C27B0 #AB47BC #BA68C8 #CE93D8 #E1BEE7 #F3E5F5".split(" ")};WebDataRocksToolbar.ColorPicker.prototype.isOpened=function(){return this.popup.parentElement&&this.popup.parentElement.classList.contains("wdr-popup-opened")}; WebDataRocksToolbar.ColorPicker.prototype.drawShades=function(a){if(a)for(var b=this.shadeColors.children,d=0;dthis.getWhere(this.colorPickerButton,document.body).top-this.popup.clientHeight?(this.popup.classList.remove("wdr-arrow-down"), this.popup.classList.add("wdr-arrow-up"),this.popup.style.top=this.colorPickerButton.clientHeight+b.top+11+"px",this.popup.style.bottom=""):(this.popup.classList.add("wdr-arrow-down"),this.popup.classList.remove("wdr-arrow-up"),this.popup.style.bottom=a.clientHeight-b.top+5+"px",this.popup.style.top=""),this.popup.style.left=b.left+this.colorPickerButton.clientWidth/2+2+"px",this.popup.parentElement.classList.add("wdr-popup-opened"))}; WebDataRocksToolbar.ColorPicker.prototype.getWhere=function(a,b){var d=0,f=0,m=0,g=0;if(a.offsetParent){for(var d=a.offsetLeft,f=a.offsetTop,c=a;(c=c.parentNode)&&c!=b;)m=c.scrollTop?c.scrollTop:0,g=0,d-=g,f-=m;for(;(a=a.offsetParent)&&a!=b;)d+=a.offsetLeft,f+=a.offsetTop}return{top:f+0,left:d+0}}; /** @license FileSaver.js | Copyright (c) 2016 Eli Grey [https://github.com/eligrey/FileSaver.js] | MIT License [https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md] */ var savingAs=savingAs||"undefined"!==typeof navigator&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(a){"use strict";if("undefined"===typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var k=a.document,n=k.createElementNS("http://www.w3.org/1999/xhtml","a"),w="download"in n,x=function(c){var e=k.createEvent("MouseEvents");e.initMouseEvent("click",!0,!1,a,0,0,0,0,0,!1,!1,!1,!1,0,null);c.dispatchEvent(e)},q=a.webkitRequestFileSystem,u=a.requestFileSystem||q||a.mozRequestFileSystem, y=function(c){(a.setImmediate||a.setTimeout)(function(){throw c;},0)},r=0,s=function(c){var e=function(){"string"===typeof c?(a.URL||a.webkitURL||a).revokeObjectURL(c):c.remove()};a.chrome?e():setTimeout(e,500)},t=function(c,a,d){a=[].concat(a);for(var b=a.length;b--;){var l=c["on"+a[b]];if("function"===typeof l)try{l.call(c,d||c)}catch(f){y(f)}}},m=function(c,e){var d=this,b=c.type,l=!1,f,p,k=function(){t(d,["writestart","progress","write","writeend"])},g=function(){if(l||!f)f=(a.URL||a.webkitURL|| a).createObjectURL(c);p?p.location.href=f:void 0==a.open(f,"_blank")&&"undefined"!==typeof safari&&(a.location.href=f);d.readyState=d.DONE;k();s(f)},h=function(a){return function(){if(d.readyState!==d.DONE)return a.apply(this,arguments)}},m={create:!0,exclusive:!1},v;d.readyState=d.INIT;e||(e="download");if(w)f=(a.URL||a.webkitURL||a).createObjectURL(c),n.href=f,n.download=e,x(n),d.readyState=d.DONE,k(),s(f);else{a.chrome&&b&&"application/octet-stream"!==b&&(v=c.slice||c.webkitSlice,c=v.call(c,0, c.size,"application/octet-stream"),l=!0);q&&"download"!==e&&(e+=".download");if("application/octet-stream"===b||q)p=a;u?(r+=c.size,u(a.TEMPORARY,r,h(function(a){a.root.getDirectory("saved",m,h(function(a){var b=function(){a.getFile(e,m,h(function(a){a.createWriter(h(function(b){b.onwriteend=function(b){p.location.href=a.toURL();d.readyState=d.DONE;t(d,"writeend",b);s(a)};b.onerror=function(){var a=b.error;a.code!==a.ABORT_ERR&&g()};["writestart","progress","write","abort"].forEach(function(a){b["on"+ a]=d["on"+a]});b.write(c);d.abort=function(){b.abort();d.readyState=d.DONE};d.readyState=d.WRITING}),g)}),g)};a.getFile(e,{create:!1},h(function(a){a.remove();b()}),h(function(a){a.code===a.NOT_FOUND_ERR?b():g()}))}),g)}),g)):g()}},b=m.prototype;b.abort=function(){this.readyState=this.DONE;t(this,"abort")};b.readyState=b.INIT=0;b.WRITING=1;b.DONE=2;b.error=b.onwritestart=b.onprogress=b.onwrite=b.onabort=b.onerror=b.onwriteend=null;return function(a,b){return new m(a,b)}}}("undefined"!==typeof self&& self||"undefined"!==typeof window&&window||this.content);"undefined"!==typeof module&&null!==module?module.exports=savingAs:"undefined"!==typeof define&&null!==define&&null!=define.amd&&define("savingAs",function(){return savingAs}); /** @license jsPDF v1.5.3 | Copyright (c) 2010-2016 James Hall [https://github.com/MrRio/jsPDF] | MIT License [https://github.com/MrRio/jsPDF/blob/master/MIT-LICENSE.txt] */ !function(t){"function"==typeof define&&define.amd?t():t()}(function(){"use strict";function se(t){return(se="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(t){if("object"!==se(t.console)){t.console={};for(var e,n,r=t.console,i=function(){},o=["memory"],a="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=o.pop();)r[e]||(r[e]={});for(;n=a.pop();)r[n]||(r[n]=i)}var s,l,h,u,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";void 0===t.btoa&&(t.btoa=function(t){var e,n,r,i,o,a=0,s=0,l="",h=[];if(!t)return t;for(;e=(o=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,h[s++]=c.charAt(e)+c.charAt(n)+c.charAt(r)+c.charAt(i),a>16&255,n=a>>8&255,r=255&a,h[l++]=64==i?String.fromCharCode(e):64==o?String.fromCharCode(e,n):String.fromCharCode(e,n,r),s>>0,r=new Array(n),i=1>>0,i=0;i>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i>16&255,r=l>>8&255,i=255&l}if(void 0===r||void 0===o&&n===r&&r===i)if("string"==typeof n)e=n+" "+a[0];else switch(t.precision){case 2:e=Z(n/255)+" "+a[0];break;case 3:default:e=Q(n/255)+" "+a[0]}else if(void 0===o||"object"===se(o)){if(o&&!isNaN(o.a)&&0===o.a)return e=["1.000","1.000","1.000",a[1]].join(" ");if("string"==typeof n)e=[n,r,i,a[1]].join(" ");else switch(t.precision){case 2:e=[Z(n/255),Z(r/255),Z(i/255),a[1]].join(" ");break;default:case 3:e=[Q(n/255),Q(r/255),Q(i/255),a[1]].join(" ")}}else if("string"==typeof n)e=[n,r,i,o,a[2]].join(" ");else switch(t.precision){case 2:e=[Z(n/255),Z(r/255),Z(i/255),Z(o/255),a[2]].join(" ");break;case 3:default:e=[Q(n/255),Q(r/255),Q(i/255),Q(o/255),a[2]].join(" ")}return e},ct=l.__private__.getFilters=function(){return o},ft=l.__private__.putStream=function(t){var e=(t=t||{}).data||"",n=t.filters||ct(),r=t.alreadyAppliedFilters||[],i=t.addLength1||!1,o=e.length,a={};!0===n&&(n=["FlateEncode"]);var s=t.additionalKeyValues||[],l=(a=void 0!==ae.API.processDataByFilters?ae.API.processDataByFilters(e,n):{data:e,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());0!==a.data.length&&(s.push({key:"Length",value:a.data.length}),!0===i&&s.push({key:"Length1",value:o})),0!=l.length&&(l.split("/").length-1==1?s.push({key:"Filter",value:l}):s.push({key:"Filter",value:"["+l+"]"})),tt("<<");for(var h=0;h>"),0!==a.data.length&&(tt("stream"),tt(a.data),tt("endstream"))},pt=l.__private__.putPage=function(t){t.mediaBox;var e=t.number,n=t.data,r=t.objId,i=t.contentsObjId;ot(r,!0);V[x].mediaBox.topRightX,V[x].mediaBox.bottomLeftX,V[x].mediaBox.topRightY,V[x].mediaBox.bottomLeftY;tt("<>"),tt("endobj");var o=n.join("\n");return ot(i,!0),ft({data:o,filters:ct()}),tt("endobj"),r},dt=l.__private__.putPages=function(){var t,e,n=[];for(t=1;t<=W;t++)V[t].objId=X(),V[t].contentsObjId=X();for(t=1;t<=W;t++)n.push(pt({number:t,data:I[t],objId:V[t].objId,contentsObjId:V[t].contentsObjId,mediaBox:V[t].mediaBox,cropBox:V[t].cropBox,bleedBox:V[t].bleedBox,trimBox:V[t].trimBox,artBox:V[t].artBox,userUnit:V[t].userUnit,rootDictionaryObjId:st,resourceDictionaryObjId:lt}));ot(st,!0),tt("<>"),tt("endobj"),it.publish("postPutPages")},gt=function(){!function(){for(var t in rt)rt.hasOwnProperty(t)&&(!1===s||!0===s&&K.hasOwnProperty(t))&&(e=rt[t],it.publish("putFont",{font:e,out:tt,newObject:J,putStream:ft}),!0!==e.isAlreadyPutted&&(e.objectNumber=J(),tt("<<"),tt("/Type /Font"),tt("/BaseFont /"+e.postScriptName),tt("/Subtype /Type1"),"string"==typeof e.encoding&&tt("/Encoding /"+e.encoding),tt("/FirstChar 32"),tt("/LastChar 255"),tt(">>"),tt("endobj")));var e}(),it.publish("putResources"),ot(lt,!0),tt("<<"),function(){for(var t in tt("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),tt("/Font <<"),rt)rt.hasOwnProperty(t)&&(!1===s||!0===s&&K.hasOwnProperty(t))&&tt("/"+t+" "+rt[t].objectNumber+" 0 R");tt(">>"),tt("/XObject <<"),it.publish("putXobjectDict"),tt(">>")}(),tt(">>"),tt("endobj"),it.publish("postPutResources")},mt=function(t,e,n){H.hasOwnProperty(e)||(H[e]={}),H[e][n]=t},yt=function(t,e,n,r,i){i=i||!1;var o="F"+(Object.keys(rt).length+1).toString(10),a={id:o,postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i,metadata:{}};return it.publish("addFont",{font:a,instance:this}),void 0!==o&&(rt[o]=a,mt(o,e,n)),o},vt=l.__private__.pdfEscape=l.pdfEscape=function(t,e){return function(t,e){var n,r,i,o,a,s,l,h,u;if(i=(e=e||{}).sourceEncoding||"Unicode",a=e.outputEncoding,(e.autoencode||a)&&rt[$].metadata&&rt[$].metadata[i]&&rt[$].metadata[i].encoding&&(o=rt[$].metadata[i].encoding,!a&&rt[$].encoding&&(a=rt[$].encoding),!a&&o.codePages&&(a=o.codePages[0]),"string"==typeof a&&(a=o[a]),a)){for(l=!1,s=[],n=0,r=t.length;n>8&&(l=!0);t=s.join("")}for(n=t.length;void 0===l&&0!==n;)t.charCodeAt(n-1)>>8&&(l=!0),n--;if(!l)return t;for(s=e.noBOM?[]:[254,255],n=0,r=t.length;n>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(u),s.push(h-(u<<8))}return String.fromCharCode.apply(void 0,s)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},wt=l.__private__.beginPage=function(t,e){var n,r="string"==typeof e&&e.toLowerCase();if("string"==typeof t&&(n=f(t.toLowerCase()))&&(t=n[0],e=n[1]),Array.isArray(t)&&(e=t[1],t=t[0]),(isNaN(t)||isNaN(e))&&(t=i[0],e=i[1]),r){switch(r.substr(0,1)){case"l":t>"),tt("endobj")},St=l.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||st;switch(J(),tt("<<"),tt("/Type /Catalog"),tt("/Pages "+e+" 0 R"),L||(L="fullwidth"),L){case"fullwidth":tt("/OpenAction [3 0 R /FitH null]");break;case"fullheight":tt("/OpenAction [3 0 R /FitV null]");break;case"fullpage":tt("/OpenAction [3 0 R /Fit]");break;case"original":tt("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+L;"%"===n.substr(n.length-1)&&(L=parseInt(L)/100),"number"==typeof L&&tt("/OpenAction [3 0 R /XYZ null null "+Z(L)+"]")}switch(S||(S="continuous"),S){case"continuous":tt("/PageLayout /OneColumn");break;case"single":tt("/PageLayout /SinglePage");break;case"two":case"twoleft":tt("/PageLayout /TwoColumnLeft");break;case"tworight":tt("/PageLayout /TwoColumnRight")}A&&tt("/PageMode /"+A),it.publish("putCatalog"),tt(">>"),tt("endobj")},_t=l.__private__.putTrailer=function(){tt("trailer"),tt("<<"),tt("/Size "+(U+1)),tt("/Root "+U+" 0 R"),tt("/Info "+(U-1)+" 0 R"),tt("/ID [ <"+d+"> <"+d+"> ]"),tt(">>")},Ft=l.__private__.putHeader=function(){tt("%PDF-"+h),tt("%ºß¬à")},Pt=l.__private__.putXRef=function(){var t=1,e="0000000000";for(tt("xref"),tt("0 "+(U+1)),tt("0000000000 65535 f "),t=1;t<=U;t++){"function"==typeof z[t]?tt((e+z[t]()).slice(-10)+" 00000 n "):void 0!==z[t]?tt((e+z[t]).slice(-10)+" 00000 n "):tt("0000000000 00000 n ")}},kt=l.__private__.buildDocument=function(){k=!1,B=U=0,C=[],z=[],G=[],st=X(),lt=X(),it.publish("buildDocument"),Ft(),dt(),function(){it.publish("putAdditionalObjects");for(var t=0;t',i=ie.open();if(null!==i&&i.document.write(r),i||"undefined"==typeof safari)return i;case"datauri":case"dataurl":return ie.document.location.href="data:application/pdf;filename="+e.filename+";base64,"+btoa(n);default:return null}}).foo=function(){try{return F.apply(this,arguments)}catch(t){var e=t.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var n="Error in function "+e.split("\n")[0].split("<")[0]+": "+t.message;if(!ie.console)throw new Error(n);ie.console.error(n,t),ie.alert&&alert(n)}},(F.foo.bar=F).foo),Bt=function(t){return!0===Array.isArray(Y)&&-1":")"),Y=1):(W=Wt(e),V=Vt(n),G=(l?"<":"(")+v[H]+(l?">":")")),void 0!==q&&void 0!==q[H]&&(J=q[H]+" Tw\n"),0!==S.length&&0===H?t.push(J+S.join(" ")+" "+W.toFixed(2)+" "+V.toFixed(2)+" Tm\n"+G):1===Y||0===Y&&0===H?t.push(J+W.toFixed(2)+" "+V.toFixed(2)+" Td\n"+G):t.push(J+G);t=0===Y?t.join(" Tj\nT* "):t.join(" Tj\n"),t+=" Tj\n";var X="BT\n/"+$+" "+et+" Tf\n"+(et*u).toFixed(2)+" TL\n"+Kt+"\n";return X+=h,X+=t,tt(X+="ET"),K[$]=!0,c},l.__private__.lstext=l.lstext=function(t,e,n,r){return console.warn("jsPDF.lstext is deprecated"),this.text(t,e,n,{charSpace:r})},l.__private__.clip=l.clip=function(t){tt("evenodd"===t?"W*":"W"),tt("n")},l.__private__.clip_fixed=l.clip_fixed=function(t){console.log("clip_fixed is deprecated"),l.clip(t)};var Ot=l.__private__.isValidStyle=function(t){var e=!1;return-1!==[void 0,null,"S","F","DF","FD","f","f*","B","B*"].indexOf(t)&&(e=!0),e},qt=l.__private__.getStyle=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t),e};l.__private__.line=l.line=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.line");return this.lines([[n-t,r-e]],t,e)},l.__private__.lines=l.lines=function(t,e,n,r,i,o){var a,s,l,h,u,c,f,p,d,g,m,y;if("number"==typeof t&&(y=n,n=e,e=t,t=y),r=r||[1,1],o=o||!1,isNaN(e)||isNaN(n)||!Array.isArray(t)||!Array.isArray(r)||!Ot(i)||"boolean"!=typeof o)throw new Error("Invalid arguments passed to jsPDF.lines");for(tt(Q(Wt(e))+" "+Q(Vt(n))+" m "),a=r[0],s=r[1],h=t.length,g=e,m=n,l=0;l=o.length-1;if(b&&!x){m+=" ";continue}if(b||x){if(x)d=w;else if(i.multiline&&a<(h+2)*(y+2)+2)continue t}else{if(!i.multiline)continue t;if(a<(h+2)*(y+2)+2)continue t;d=w}for(var N="",L=p;L<=d;L++)N+=o[L]+" ";switch(N=" "==N.substr(N.length-1)?N.substr(0,N.length-1):N,g=F(N,i,r).width,i.textAlign){case"right":c=s-g-2;break;case"center":c=(s-g)/2;break;case"left":default:c=2}t+=_(c)+" "+_(f)+" Td\n",t+="("+S(N)+") Tj\n",t+=-_(c)+" 0 Td\n",f=-(r+2),g=0,p=d+1,y++,m=""}else;break}return n.text=t,n.fontSize=r,n},F=function(t,e,n){var r=A.internal.getFont(e.fontName,e.fontStyle),i=A.getStringUnitWidth(t,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:A.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},u={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},p=function(){A.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=A.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];n.objId=void 0,n.hasAnnotation&&d.call(A,n)}},d=function(t){var e={type:"reference",object:t};void 0===A.internal.getPageInfo(t.page).pageContext.annotations.find(function(t){return t.type===e.type&&t.object===e.object})&&A.internal.getPageInfo(t.page).pageContext.annotations.push(e)},g=function(){if(void 0===A.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");A.internal.write("/AcroForm "+A.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")},m=function(){A.internal.events.unsubscribe(A.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete A.internal.acroformPlugin.acroFormDictionaryRoot._eventID,A.internal.acroformPlugin.printedOut=!0},L=function(t){var e=!t;t||(A.internal.newObjectDeferredBegin(A.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),A.internal.acroformPlugin.acroFormDictionaryRoot.putStream());t=t||A.internal.acroformPlugin.acroFormDictionaryRoot.Kids;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n],i=[],o=r.Rect;if(r.Rect&&(r.Rect=c.call(this,r.Rect)),A.internal.newObjectDeferredBegin(r.objId,!0),r.DA=Y.createDefaultAppearanceStream(r),"object"===se(r)&&"function"==typeof r.getKeyValueListForStream&&(i=r.getKeyValueListForStream()),r.Rect=o,r.hasAppearanceStream&&!r.appearanceStreamContent){var a=f.call(this,r);i.push({key:"AP",value:"<>"}),A.internal.acroformPlugin.xForms.push(a)}if(r.appearanceStreamContent){var s="";for(var l in r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(l)){var h=r.appearanceStreamContent[l];if(s+="/"+l+" ",s+="<<",1<=Object.keys(h).length||Array.isArray(h))for(var n in h){var u;if(h.hasOwnProperty(n))"function"==typeof(u=h[n])&&(u=u.call(this,r)),s+="/"+n+" "+u+" ",0<=A.internal.acroformPlugin.xForms.indexOf(u)||A.internal.acroformPlugin.xForms.push(u)}else"function"==typeof(u=h)&&(u=u.call(this,r)),s+="/"+n+" "+u,0<=A.internal.acroformPlugin.xForms.indexOf(u)||A.internal.acroformPlugin.xForms.push(u);s+=">>"}i.push({key:"AP",value:"<<\n"+s+">>"})}A.internal.putStream({additionalKeyValues:i}),A.internal.out("endobj")}e&&P.call(this,A.internal.acroformPlugin.xForms)},P=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=e,r=t[e];A.internal.newObjectDeferredBegin(r&&r.objId,!0),"object"===se(r)&&"function"==typeof r.putStream&&r.putStream(),delete t[n]}},k=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(A=this,M.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(u)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");n=A.internal.scaleFactor,A.internal.acroformPlugin.acroFormDictionaryRoot=new E,A.internal.acroformPlugin.acroFormDictionaryRoot._eventID=A.internal.events.subscribe("postPutResources",m),A.internal.events.subscribe("buildDocument",p),A.internal.events.subscribe("putCatalog",g),A.internal.events.subscribe("postPutPages",L),A.internal.acroformPlugin.isInitialized=!0}},I=t.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e="[",n=0;n>"),e.join("\n")}},set:function(t){"object"===se(t)&&(n=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(t){"string"==typeof t&&(n.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e="/"+t}})};r(D,M);var U=function(){D.call(this),this.pushButton=!0};r(U,D);var z=function(){D.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=void 0!==t?t:[]}})};r(z,D);var H=function(){var e,n;M.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t}});var r,i={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t,e=[];for(t in e.push("<<"),i)e.push("/"+t+" ("+i[t]+")");return e.push(">>"),e.join("\n")},set:function(t){"object"===se(t)&&(i=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return i.CA||""},set:function(t){"string"==typeof t&&(i.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return r},set:function(t){r=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(t){r="/"+t}}),this.optionName=name,this.caption="l",this.appearanceState="Off",this._AppearanceType=Y.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(name)};r(H,M),z.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t&&"getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},z.prototype.createOption=function(t){this.Kids.length;var e=new H;return e.Parent=this,e.optionName=t,this.Kids.push(e),J.call(this,e),e};var W=function(){D.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Y.CheckBox.createAppearanceStream()};r(W,D);var V=function(){M.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,13):this.Ff=N(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,21):this.Ff=N(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,23):this.Ff=N(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,24):this.Ff=N(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,25):this.Ff=N(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,26):this.Ff=N(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};r(V,M);var G=function(){V.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,14):this.Ff=N(this.Ff,14)}}),this.password=!0};r(G,V);var Y={CheckBox:{createAppearanceStream:function(){return{N:{On:Y.CheckBox.YesNormal},D:{On:Y.CheckBox.YesPushDown,Off:Y.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=l(t),n=[],r=A.internal.getFont(t.fontName,t.fontStyle).id,i=A.__private__.encodeColorString(t.color),o=h(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+_(o.fontSize)+" Tf "+i),n.push("BT"),n.push(o.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join("\n"),e},YesNormal:function(t){var e=l(t),n=A.internal.getFont(t.fontName,t.fontStyle).id,r=A.__private__.encodeColorString(t.color),i=[],o=Y.internal.getHeight(t),a=Y.internal.getWidth(t),s=h(t,t.caption);return i.push("1 g"),i.push("0 0 "+_(a)+" "+_(o)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+_(a-1)+" "+_(o-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+_(s.fontSize)+" Tf "+r),i.push(s.text),i.push("ET"),i.push("Q"),e.stream=i.join("\n"),e},OffPushDown:function(t){var e=l(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Circle.YesNormal,e.D[t]=Y.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Y.internal.Bezier_C,o=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5)),a=Number((r*Y.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Cross.YesNormal,e.D[t]=Y.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=l(t),n=[],r=Y.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+_(Y.internal.getWidth(t)-2)+" "+_(Y.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(_(r.x1.x)+" "+_(r.x1.y)+" m"),n.push(_(r.x2.x)+" "+_(r.x2.y)+" l"),n.push(_(r.x4.x)+" "+_(r.x4.y)+" m"),n.push(_(r.x3.x)+" "+_(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=l(t),n=Y.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+_(Y.internal.getWidth(t)-2)+" "+_(Y.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(_(n.x1.x)+" "+_(n.x1.y)+" m"),r.push(_(n.x2.x)+" "+_(n.x2.y)+" l"),r.push(_(n.x4.x)+" "+_(n.x4.y)+" m"),r.push(_(n.x3.x)+" "+_(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=l(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=A.internal.getFont(t.fontName,t.fontStyle).id,n=A.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+n}};Y.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=Y.internal.getWidth(t),n=Y.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},Y.internal.getWidth=function(t){var e=0;return"object"===se(t)&&(e=v(t.Rect[2])),e},Y.internal.getHeight=function(t){var e=0;return"object"===se(t)&&(e=v(t.Rect[3])),e};var J=t.addField=function(t){if(k.call(this),!(t instanceof M))throw new Error("Invalid argument passed to jsPDF.addField.");return function(t){A.internal.acroformPlugin.printedOut&&(A.internal.acroformPlugin.printedOut=!1,A.internal.acroformPlugin.acroFormDictionaryRoot=null),A.internal.acroformPlugin.acroFormDictionaryRoot||k.call(A),A.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)}.call(this,t),t.page=A.internal.getCurrentPageInfo().pageNumber,this};t.addButton=function(t){if(t instanceof D==!1)throw new Error("Invalid argument passed to jsPDF.addButton.");return J.call(this,t)},t.addTextField=function(t){if(t instanceof V==!1)throw new Error("Invalid argument passed to jsPDF.addTextField.");return J.call(this,t)},t.addChoiceField=function(t){if(t instanceof O==!1)throw new Error("Invalid argument passed to jsPDF.addChoiceField.");return J.call(this,t)};"object"==se(e)&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField?(e.ChoiceField=O,e.ListBox=q,e.ComboBox=T,e.EditBox=R,e.Button=D,e.PushButton=U,e.RadioButton=z,e.CheckBox=W,e.TextField=V,e.PasswordField=G,e.AcroForm={Appearance:Y}):console.warn("AcroForm-Classes are not populated into global-namespace, because the class-Names exist already."),t.AcroFormChoiceField=O,t.AcroFormListBox=q,t.AcroFormComboBox=T,t.AcroFormEditBox=R,t.AcroFormButton=D,t.AcroFormPushButton=U,t.AcroFormRadioButton=z,t.AcroFormCheckBox=W,t.AcroFormTextField=V,t.AcroFormPasswordField=G,t.AcroFormAppearance=Y,t.AcroForm={ChoiceField:O,ListBox:q,ComboBox:T,EditBox:R,Button:D,PushButton:U,RadioButton:z,CheckBox:W,TextField:V,PasswordField:G,Appearance:Y}})((window.tmp=lt).API,"undefined"!=typeof window&&window||"undefined"!=typeof global&&global), /** @license * jsPDF addImage plugin * Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/ * 2013 Chris Dowling, https://github.com/gingerchris * 2013 Trinh Ho, https://github.com/ineedfat * 2013 Edwin Alejandro Perez, https://github.com/eaparango * 2013 Norah Smith, https://github.com/burnburnrocket * 2014 Diego Casorran, https://github.com/diegocr * 2014 James Robb, https://github.com/jamesbrobb * * */ function(x){var N="addImage_",l={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},h=x.getImageFileTypeByImageData=function(t,e){var n,r;e=e||"UNKNOWN";var i,o,a,s="UNKNOWN";for(a in x.isArrayBufferView(t)&&(t=x.arrayBufferToBinaryString(t)),l)for(i=l[a],n=0;n>"}),"trns"in e&&e.trns.constructor==Array){for(var s="",l=0,h=e.trns.length;l>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==a?n+=r[(252&(e=i[s]))>>2]+r[(3&e)<<4]+"==":2==a&&(n+=r[(64512&(e=i[s]<<8|i[s+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="),n},x.createImageInfo=function(t,e,n,r,i,o,a,s,l,h,u,c,f){var p={alias:s,w:e,h:n,cs:r,bpc:i,i:a,data:t};return o&&(p.f=o),l&&(p.dp=l),h&&(p.trns=h),u&&(p.pal=u),c&&(p.smask=c),f&&(p.p=f),p},x.addImage=function(t,e,n,r,i,o,a,s,l){var h="";if("string"!=typeof e){var u=o;o=i,i=r,r=n,n=e,e=u}if("object"===se(t)&&!_(t)&&"imageData"in t){var c=t;t=c.imageData,e=c.format||e||"UNKNOWN",n=c.x||n||0,r=c.y||r||0,i=c.w||i,o=c.h||o,a=c.alias||a,s=c.compression||s,l=c.rotation||c.angle||l}var f=this.internal.getFilters();if(void 0===s&&-1!==f.indexOf("FlateEncode")&&(s="SLOW"),"string"==typeof t&&(t=unescape(t)),isNaN(n)||isNaN(r))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var p,d,g,m,y,v,w,b=function(){var t=this.internal.collections[N+"images"];return t||(this.internal.collections[N+"images"]=t={},this.internal.events.subscribe("putResources",L),this.internal.events.subscribe("putXobjectDict",A)),t}.call(this);if(!((p=P(t,b))||(_(t)&&(t=F(t,e)),(null==(w=a)||0===w.length)&&(a="string"==typeof(v=t)?x.sHashCode(v):x.isArrayBufferView(v)?x.sHashCode(x.arrayBufferToBinaryString(v)):null),p=P(a,b)))){if(this.isString(t)&&(""!==(h=this.convertStringToImageData(t))?t=h:void 0!==(h=x.loadFile(t))&&(t=h)),e=this.getImageFileTypeByImageData(t,e),!S(e))throw new Error("addImage does not support files of type '"+e+"', please ensure that a plugin for '"+e+"' support is added.");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(d=t,t=this.binaryStringToUint8Array(t))),!(p=this["process"+e.toUpperCase()](t,(y=0,(m=b)&&(y=Object.keys?Object.keys(m).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(m)),y),a,((g=s)&&"string"==typeof g&&(g=g.toUpperCase()),g in x.image_compression?g:x.image_compression.NONE),d)))throw new Error("An unknown error occurred whilst processing the image")}return function(t,e,n,r,i,o,a,s){var l=function(t,e,n){return t||e||(e=t=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]}.call(this,n,r,i),h=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;if(n=l[0],r=l[1],a[o]=i,s){s*=Math.PI/180;var c=Math.cos(s),f=Math.sin(s),p=function(t){return t.toFixed(4)},d=[p(c),p(f),p(-1*f),p(c),0,0,"cm"]}this.internal.write("q"),s?(this.internal.write([1,"0","0",1,h(t),u(e+r),"cm"].join(" ")),this.internal.write(d.join(" ")),this.internal.write([h(n),"0","0",h(r),"0","0","cm"].join(" "))):this.internal.write([h(n),"0","0",h(r),h(t),u(e+r),"cm"].join(" ")),this.internal.write("/I"+i.i+" Do"),this.internal.write("Q")}.call(this,n,r,i,o,p,p.i,b,l),this},x.convertStringToImageData=function(t){var e,n="";if(this.isString(t)){var r;e=null!==(r=this.extractImageFromDataUrl(t))?r.data:t;try{n=atob(e)}catch(t){throw x.validateStringAsBase64(e)?new Error("atob-Error in jsPDF.convertStringToImageData "+t.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertStringToImageData ")}}return n};var u=function(t,e){return t.subarray(e,e+5)};x.processJPEG=function(t,e,n,r,i,o){var a,s=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(a=function(t){var e;if("JPEG"!==h(t))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),r=4,i=t.length;r>",h.content=m;var f=h.objId+" 0 R";m="<>";else if(l.options.pageNumber)switch(m="<>",this.internal.write(m))}}this.internal.write("]")}}]),t.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":e.pageContext.annotations.push(t)}},t.link=function(t,e,n,r,i){this.internal.getCurrentPageInfo().pageContext.annotations.push({x:t,y:e,w:n,h:r,options:i,type:"link"})},t.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},t.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor}, /** * @license * Copyright (c) 2017 Aras Abbasi * * Licensed under the MIT License. * http://opensource.org/licenses/mit-license */ function(t){var h={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},a={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},e={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},n=[1570,1571,1573,1575];t.__arabicParser__={};var r=t.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==h[t.charCodeAt(0)]},u=t.__arabicParser__.isArabicLetter=function(t){return"string"==typeof t&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(t)},i=t.__arabicParser__.isArabicEndLetter=function(t){return u(t)&&r(t)&&h[t.charCodeAt(0)].length<=2},o=t.__arabicParser__.isArabicAlfLetter=function(t){return u(t)&&0<=n.indexOf(t.charCodeAt(0))},s=(t.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return u(t)&&r(t)&&1<=h[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasFinalForm=function(t){return u(t)&&r(t)&&2<=h[t.charCodeAt(0)].length}),l=(t.__arabicParser__.arabicLetterHasInitialForm=function(t){return u(t)&&r(t)&&3<=h[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasMedialForm=function(t){return u(t)&&r(t)&&4==h[t.charCodeAt(0)].length}),c=t.__arabicParser__.resolveLigatures=function(t){var e=0,n=a,r=0,i="",o=0;for(e=0;e>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})}return this}, /** * @license * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv * * Licensed under the MIT License. * http://opensource.org/licenses/mit-license */ e=lt.API,(n=function(){var e=void 0;Object.defineProperty(this,"pdf",{get:function(){return e},set:function(t){e=t}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(t){n=isNaN(t)||!1===Number.isInteger(t)||t<0?150:t,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var r=300;Object.defineProperty(this,"height",{get:function(){return r},set:function(t){r=isNaN(t)||!1===Number.isInteger(t)||t<0?300:t,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=r+1)}});var i=[];Object.defineProperty(this,"childNodes",{get:function(){return i},set:function(t){i=t}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(t){o=t}}),Object.defineProperty(this,"parentNode",{get:function(){return!1}})}).prototype.getContext=function(t,e){var n;if("2d"!==(t=t||"2d"))return null;for(n in e)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=e[n]);return(this.pdf.context2d._canvas=this).pdf.context2d},n.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new n,this.canvas.pdf=this}]), /** * @license * ==================================================================== * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com * 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br * 2013 Lee Driscoll, https://github.com/lsdriscoll * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria * 2014 James Hall, james@parall.ax * 2014 Diego Casorran, https://github.com/diegocr * * * ==================================================================== */ _=lt.API,F={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},P=1,p=function(t,e,n,r,i){F={x:t,y:e,w:n,h:r,ln:i}},d=function(){return F},k={left:0,top:0,bottom:0},_.setHeaderFunction=function(t){l=t},_.getTextDimensions=function(t,e){var n=this.table_font_size||this.internal.getFontSize(),r=(this.internal.getFont().fontStyle,(e=e||{}).scaleFactor||this.internal.scaleFactor),i=0,o=0,a=0;if("string"==typeof t)0!=(i=this.getStringUnitWidth(t)*n)&&(o=1);else{if("[object Array]"!==Object.prototype.toString.call(t))throw new Error("getTextDimensions expects text-parameter to be of type String or an Array of Strings.");for(var s=0;s=this.internal.pageSize.getHeight()-h.bottom&&(this.cellAddPage(),l=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)),e=d().y+d().h,l&&(e=23)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===a){i instanceof Array||(i=[i]);for(var u=0;u=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,counterclockwise:o})},n.prototype.arcTo=function(t,e,n,r,i){throw new Error("arcTo not implemented.")},n.prototype.rect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.lineTo(t+n,e),this.lineTo(t,e)},n.prototype.fillRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!N.call(this)){var i={};"butt"!==this.lineCap&&(i.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(i.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(t,e,n,r),this.fill(),i.hasOwnProperty("lineCap")&&(this.lineCap=i.lineCap),i.hasOwnProperty("lineJoin")&&(this.lineJoin=i.lineJoin)}},n.prototype.strokeRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");L.call(this)||(this.beginPath(),this.rect(t,e,n,r),this.stroke())},n.prototype.clearRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(t,e,n,r))},n.prototype.save=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n"},s=function(t){var r,e,n,i,o,a=String,s="length",l="charCodeAt",h="slice",u="replace";for(t[h](-2),t=t[h](0,-2)[u](/\s/g,"")[u]("z","!!!!!"),n=[],i=0,o=(t+=r="uuuuu"[h](t[s]%5||5))[s];i>24,255&e>>16,255&e>>8,255&e);return function(t,e){for(var n=r[s];0")&&(t=t.substr(0,t.indexOf(">"))),t.length%2&&(t+="0"),!1===e.test(t))return"";for(var n="",r=0;r>8&255,n>>16&255,n>>24&255]),t.length+2),t=String.fromCharCode.apply(null,i)},a.processDataByFilters=function(t,e){var n=0,r=t||"",i=[];for("string"==typeof(e=e||[])&&(e=[e]),n=0;n>"),this.internal.out("endobj"),w=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+b+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){void 0!==v&&void 0!==w&&this.internal.out("/Names <>")}),this},( /** * @license * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv * * Licensed under the MIT License. * http://opensource.org/licenses/mit-license */ x=lt.API).events.push(["postPutResources",function(){var t=this,e=/^(\d+) 0 obj$/;if(0> endobj")}var c=t.internal.newObject();for(t.internal.write("<< /Names [ "),r=0;r>","endobj"),t.internal.newObject(),t.internal.write("<< /Dests "+c+" 0 R"),t.internal.write(">>","endobj")}}]),x.events.push(["putCatalog",function(){0> \r\nendobj\r\n"},a.outline.count_r=function(t,e){for(var n=0;n>>24&255,f[c++]=s>>>16&255,f[c++]=s>>>8&255,f[c++]=255&s,I.arrayBufferToBinaryString(f)},N=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6,r|=0,[n,255&(r+=31-r%31)]},L=function(t,e){for(var n,r=1,i=0,o=t.length,a=0;0>>0},A=function(t,e,n,r){for(var i,o,a,s=t.length/e,l=new Uint8Array(t.length+s),h=T(),u=0;u>>1)&255;return o},O=function(t,e,n){var r,i,o,a,s=[],l=0,h=t.length;for(s[0]=4;l>>d&255,d+=o.bits;y[w]=x>>>d&255}if(16===o.bits){g=(_=new Uint32Array(o.decodePixels().buffer)).length,m=new Uint8Array(g*(32/o.pixelBitlength)*o.colors),y=new Uint8Array(g*(32/o.pixelBitlength));for(var x,N=1>>0&255,N&&(m[b++]=x>>>16&255,x=_[w++],m[b++]=x>>>0&255),y[L++]=x>>>16&255;p=8}r!==I.image_compression.NONE&&C()?(t=B(m,o.width*o.colors,o.colors,r),u=B(y,o.width,1,r)):(t=m,u=y,f=null)}if(3===o.colorType&&(c=this.color_spaces.INDEXED,h=o.palette,o.transparency.indexed)){var A=o.transparency.indexed,S=0;for(w=0,g=A.length;wr&&(i.push(t.slice(l,o)),s=0,l=o),s+=e[o],o++;return l!==o&&i.push(t.slice(l,o)),i},J=function(t,e,n){n||(n={});var r,i,o,a,s,l,h=[],u=[h],c=n.textIndent||0,f=0,p=0,d=t.split(" "),g=W.apply(this,[" ",n])[0];if(l=-1===n.lineIndent?d[0].length+2:n.lineIndent||0){var m=Array(l).join(" "),y=[];d.map(function(t){1<(t=t.split(/\s*\n/)).length?y=y.concat(t.map(function(t,e){return(e&&t.length?"\n":"")+t})):y.push(t[0])}),d=y,l=G.apply(this,[m,n])}for(o=0,a=d.length;o>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this}, /** ==================================================================== * jsPDF XMP metadata plugin * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi * * * ==================================================================== */ nt=lt.API,ot=it=rt="",nt.addMetadata=function(t,e){return it=e||"http://jspdf.default.namespaceuri/",rt=t,this.internal.events.subscribe("postPutResources",function(){if(rt){var t='',e=unescape(encodeURIComponent('')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(rt)),i=unescape(encodeURIComponent("")),o=unescape(encodeURIComponent("")),a=n.length+r.length+i.length+e.length+o.length;ot=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+a+" >>"),this.internal.write("stream"),this.internal.write(e+n+r+i+o),this.internal.write("endstream"),this.internal.write("endobj")}else ot=""}),this.internal.events.subscribe("putCatalog",function(){ot&&this.internal.write("/Metadata "+ot+" 0 R")}),this},function(f,t){var e=f.API;var m=e.pdfEscape16=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=["","0","00","000","0000"],o=[""],a=0,s=t.length;a<"+i+">");return r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),o+="endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};e.events.push(["putFont",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&"Identity-H"===t.encoding){for(var i=t.metadata.Unicode.widths,o=t.metadata.subset.encode(t.metadata.glyIdsUsed,1),a="",s=0;s>"),e("endobj");var c=n();e("<<"),e("/Type /Font"),e("/BaseFont /"+t.fontName),e("/FontDescriptor "+u+" 0 R"),e("/W "+f.API.PDFObject.convert(i)),e("/CIDToGIDMap /Identity"),e("/DW 1000"),e("/Subtype /CIDFontType2"),e("/CIDSystemInfo"),e("<<"),e("/Supplement 0"),e("/Registry (Adobe)"),e("/Ordering ("+t.encoding+")"),e(">>"),e(">>"),e("endobj"),t.objectNumber=n(),e("<<"),e("/Type /Font"),e("/Subtype /Type0"),e("/ToUnicode "+h+" 0 R"),e("/BaseFont /"+t.fontName),e("/Encoding /"+t.encoding),e("/DescendantFonts ["+c+" 0 R]"),e(">>"),e("endobj"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);e.events.push(["putFont",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&"WinAnsiEncoding"===t.encoding){t.metadata.Unicode.widths;for(var i=t.metadata.rawData,o="",a=0;a>"),e("endobj"),t.objectNumber=n(),a=0;a>"),e("endobj"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);var h=function(t){var e,n,r=t.text||"",i=t.x,o=t.y,a=t.options||{},s=t.mutex||{},l=s.pdfEscape,h=s.activeFontKey,u=s.fonts,c=(s.activeFontSize,""),f=0,p="",d=u[n=h].encoding;if("Identity-H"!==u[n].encoding)return{text:r,x:i,y:o,options:a,mutex:s};for(p=r,n=h,"[object Array]"===Object.prototype.toString.call(r)&&(p=r[0]),f=0;fw-h.top-h.bottom&&s.pagesplit){var p=function(t,e,n,r,i){var o=document.createElement("canvas");o.height=i,o.width=r;var a=o.getContext("2d");return a.mozImageSmoothingEnabled=!1,a.webkitImageSmoothingEnabled=!1,a.msImageSmoothingEnabled=!1,a.imageSmoothingEnabled=!1,a.fillStyle=s.backgroundColor||"#ffffff",a.fillRect(0,0,r,i),a.drawImage(t,e,n,r,i,0,0,r,i),o},n=function(){for(var t,e,n=0,r=0,i={},o=!1;;){var a;if(r=0,i.top=0!==n?h.top:g,i.left=0!==n?h.left:d,o=(v-h.left-h.right)*y=l.width)break;this.addPage()}else s=[a=p(l,0,n,t,e),i.left,i.top,a.width/y,a.height/y,c,null,f],this.addImage.apply(this,s);if((n+=e)>=l.height)break;this.addPage()}m(u,n,null,s)}.bind(this);if("CANVAS"===l.nodeName){var r=new Image;r.onload=n,r.src=l.toDataURL("image/png"),l=r}else n()}else{var i=Math.random().toString(35),o=[l,d,g,u,e,c,i,f];this.addImage.apply(this,o),m(u,e,i,o)}}.bind(this),"undefined"!=typeof html2canvas&&!s.rstz)return html2canvas(t,s);if("undefined"==typeof rasterizeHTML)return null;var n="drawDocument";return"string"==typeof t&&(n=/^http/.test(t)?"drawURL":"drawHTML"),s.width=s.width||v*y,rasterizeHTML[n](t,void 0,s).then(function(t){s.onrendered(t.image)},function(t){m(null,t)})}, /** * jsPDF fromHTML plugin. BETA stage. API subject to change. Needs browser * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria * 2014 Diego Casorran, https://github.com/diegocr * 2014 Daniel Husar, https://github.com/danielhusar * 2014 Wolfgang Gassler, https://github.com/woolfg * 2014 Steven Spungin, https://github.com/flamenco * * @license * * ==================================================================== */ function(t){var P,k,i,a,s,l,h,u,I,w,f,c,p,n,C,B,d,g,m,j;P=function(){return function(t){return e.prototype=t,new e};function e(){}}(),w=function(t){var e,n,r,i,o,a,s;for(n=0,r=t.length,e=void 0,a=i=!1;!i&&n!==r;)(e=t[n]=t[n].trimLeft())&&(i=!0),n++;for(n=r-1;r&&!a&&-1!==n;)(e=t[n]=t[n].trimRight())&&(a=!0),n--;for(o=/\s+$/g,s=!0,n=0;n!==r;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "),s&&(e=e.trimLeft()),e&&(s=o.test(e)),t[n]=e),n++;return t},c=function(t){var e,n,r;for(e=void 0,n=(r=t.split(",")).shift();!e&&n;)e=i[n.trim().toLowerCase()],n=r.shift();return e},p=function(t){var e;return-1<(t="auto"===t?"0px":t).indexOf("em")&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),-1i.pdf.margins_doc.top&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top,i.executeWatchFunctions(n));var b=I(n),x=i.x,N=12/i.pdf.internal.scaleFactor,L=(b["margin-left"]+b["padding-left"])*N,A=(b["margin-right"]+b["padding-right"])*N,S=(b["margin-top"]+b["padding-top"])*N,_=(b["margin-bottom"]+b["padding-bottom"])*N;void 0!==b.float&&"right"===b.float?x+=i.settings.width-n.width-A:x+=L,i.pdf.addImage(v,x,i.y+S,n.width,n.height),v=void 0,"right"===b.float||"left"===b.float?(i.watchFunctions.push(function(t,e,n,r){return i.y>=e?(i.x+=t,i.settings.width+=n,!0):!!(r&&1===r.nodeType&&!E[r.nodeName]&&i.x+r.width>i.pdf.margins_doc.left+i.pdf.margins_doc.width)&&(i.x+=t,i.y=e,i.settings.width+=n,!0)}.bind(this,"left"===b.float?-n.width-L-A:0,i.y+n.height+S+_,n.width)),i.watchFunctions.push(function(t,e,n){return!(i.y]*?>/gi,""),h="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(l=document.createElement("div")).style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",l.innerHTML='