/*! * ParamQuery Pro v3.5.1 * * Copyright (c) 2012-2021 Paramvir Dhindsa (http://paramquery.com) * Released under GNU General Public License v3 * http://paramquery.com/license * */ if("function"==typeof require){var jQuery=require("jquery-ui-pack"),pq={},JSZip=require("jszip");module.exports=pq}else var jQuery=window.jQuery,pq=window.pq=window.pq||{},JSZip=window.JSZip;!function(e){var t=e.ui.autocomplete.prototype,r=t._renderMenu,i=t._renderItem;t._renderMenu=function(t,i){r.call(this,t,i);var o=this.options,n=o.selectItem;if(n&&n.on){var a=n.cls,a=void 0===a?"ui-state-highlight":a,l=this.element.val();l&&a&&e("a",t).filter(function(){return e(this).text()===l}).addClass(a)}},t._renderItem=function(e,t){var r=i.call(this,e,t),o=this.options,n=o.highlightText;if(n&&n.on){var a=this.element.val();if(a){var l=new RegExp("("+a+")","i"),s=t.label;if(l.test(s)){var d=n.style,d=void 0===d?"font-weight:bold;":d,c=n.cls,c=void 0===c?"":c;s=s.replace(l,"$1"),r.find("a").html(s)}}}return r};var o=e.paramquery=e.paramquery||{},n=function(e,t,r,i){for(var o=t.slice(),n=[],a=0,l=o.length;l>a;a++){var s=o[a],d=s.cb,c=s.one;if(c){if(s._oncerun)continue;s._oncerun=!0}var h=d.call(e,r,i);if(h===!1&&(r.preventDefault(),r.stopPropagation()),c&&n.push(a),r.isImmediatePropagationStopped())break}if(n.length)for(var a=n.length-1;a>=0;a--)o.splice(n[a],1)};o._trigger=function(t,r,i){var o,a,l=this,s=l.listeners,d=s[t],c=l.options,h=c.allEvents,u=c.bubble,f=l.element,p=c[t];if(i=i||{},r=e.Event(r),r.type=l.widgetName+":"+t,r.target=f[0],a=r.originalEvent)for(o in a)o in r||(r[o]=a[o]);if(h&&"function"==typeof h&&h.call(l,r,i),d&&d.length&&(n(l,d,r,i),r.isImmediatePropagationStopped()))return!r.isDefaultPrevented();if(c.trigger&&(f[u?"trigger":"triggerHandler"](r,i),r.isImmediatePropagationStopped()))return!r.isDefaultPrevented();if(p){var g=p.call(l,r,i);g===!1&&(r.preventDefault(),r.stopPropagation())}return d=s[t+"Done"],d&&d.length&&n(l,d,r,i),!r.isDefaultPrevented()};var a=function(e,t,r,i,o){var n=e.listeners[t];n||(n=e.listeners[t]=[]),n[o?"unshift":"push"]({cb:r,one:i})};o.on=function(){var e=arguments;if("boolean"==typeof e[0])var t=e[0],r=e[1],i=e[2],o=e[3];else var r=e[0],i=e[1],o=e[2];for(var n=r.split(" "),l=0;lr;r++)t[r]=arguments[r];return t[e]=!0,this.on.apply(this,t)};var l=function(e,t,r){if(r){var i=e.listeners[t];if(i){for(var o=[],n=0,a=i.length;a>n;n++){var l=i[n],s=l.cb;r==s&&o.push(n)}if(o.length)for(var n=o.length-1;n>=0;n--)i.splice(o[n],1)}}else delete e.listeners[t]};o.off=function(e,t){for(var r=e.split(" "),i=0;i";return c+d}return t.attr("title")}}};s._create=function(){this._super();var t=this.element,r=this.eventNamespace;t.on("pqtooltipopen"+r,function(t,r){var i=e(t.target),o=e(t.originalEvent.target);if(o.on("remove",function(e){i.pqTooltip("close",e,!0)}),i.is(".pq-grid")){var n,a=i.pqGrid("getCellIndices",{$td:o}),l=a.rowIndx,s=a.dataIndx,d=i.pqGrid("getRowData",{rowIndx:l});if((n=d)&&(n=n.pq_celldata)&&(n=n[s])&&(n=n.pq_valid)){var c=n,h=c.style,u=c.cls;r.tooltip.addClass(u);var f=r.tooltip.attr("style");r.tooltip.attr("style",f+";"+h)}i.find("div.pq-sb-horiz,div.pq-sb-vert").on("pqscrollbardrag",function(e,t){e.currentTarget=o[0],i.pqTooltip("close",e,!0)})}}),t.on("pqtooltipclose"+r,function(t,r){var i=e(t.target),o=e(t.originalEvent.target);o.off("remove"),i.is(".pq-grid")&&i.find("div.pq-sb-horiz,div.pq-sb-vert").off("pqscrollbardrag")})},e.widget("paramquery.pqTooltip",e.ui.tooltip,s)}(jQuery),function(e){function t(e,t){var r,i,n,a;if(e){if(i=e.split(":"),e=t&&i.length>1?i[1]:i[0],r=o[e])return r;n=/^([^#]*|&#[^#]*)?[\,\.#0]*?([\,\s\.]?)([#0]*)([\,\s\.]?)([0]*?)(\s*[^#^0]*|&#[^#]*)?$/,a=e.match(n),a&&a.length&&(r={symbol:a[1]||"",thouSep:a[2],thousand:a[3].length,decSep:a[4],decimal:a[5].length,symbolEnd:a[6]||""},o[e]=r)}return r=r||{symbol:"",symbolEnd:"",thouSep:",",thousand:3,decSep:".",decimal:2}}var r=e.paramquery,i=Array.prototype;i.find||(i.find=function(e,t){for(var r,i=0,o=this.length;o>i;i++)if(r=this[i],e.call(t,r,i,this))return r}),i.findIndex||(i.findIndex=function(e,t){for(var r,i=0,o=this.length;o>i;i++)if(r=this[i],e.call(t,r,i,this))return i;return-1}),i.map||(i.map=function(e,t){for(var r=0,i=this.length,o=[];i>r;r++)o.push(e.call(t,this[r],r,this));return o}),i.forEach||(i.forEach=function(e,t){for(var r=0,i=this.length;i>r;r++)e.call(t,this[r],r,this)}),pq.getFn=function(){var e={};return function(t){var r=t;return"string"==typeof t&&((r=e[t])||(r=window,t.split(".").forEach(function(e){r=r[e]}),e[t]=r)),r}}(),pq.searchSeqArray=function(e,t){for(var r,i=e.length,o=t,n=t,a=0,n=n>i-1?i-1:n;;){if(r=e[n],a++,t>r){if(n==i-1){n=-1;break}n=Math.ceil((n+o)/2),n=n>i-1?i-1:n}else{if(!(r>t))break;o=n,n=Math.floor(n/2)}if(a>100)throw"too many iterations"}return n},pq.arrayUnique=function(e,t){var r,i,o,n=[],a=e.length,l={};for(r=0;a>r;r++)i=e[r],o=t?i[t]:i,l.hasOwnProperty(o)||(l[o]=1,n.push(i));return n},r.select=function(e){var t,r,i,o=e.attr,n=e.options,a=e.groupIndx,l=e.labelIndx,s=e.valueIndx,d=null!=l&&null!=s,c=null!=a,h=e.prepend,u=e.dataMap,f=function(){for(var e={},t=0;t"];if(h)for(var g in h)p.push('");if(n&&n.length){for(var v=0,w=n.length;w>v;v++){var m=n[v];if(d){var x=m[s],_=m.pq_disabled?'disabled="disabled" ':"",I=m.pq_selected?'selected="selected" ':"";if(null==x)continue;if(i=u?f():"",c){var y=m.pq_disabled_group?'disabled="disabled" ':"";t=m[a],r!=t&&(null!=r&&p.push(""),p.push('"),r=t)}if(l==s)p.push("");else{var b=m[l];p.push("")}}else if("object"==typeof m)for(var g in m)p.push('");else p.push("")}c&&p.push("")}return p.push(""),p.join("")},e.fn.pqval=function(e){if(e){if(e.incr){var t=this.data("pq_value");return this.prop("indeterminate",!1),t?(t=!1,this.prop("checked",!1)):t===!1?(t=null,this.prop("indeterminate",!0),this.prop("checked",!1)):(t=!0,this.prop("checked",!0)),this.data("pq_value",t),t}var t=e.val;return this.data("pq_value",t),this.prop("indeterminate",!1),null==t?(this.prop("indeterminate",!0),this.prop("checked",!1)):t?this.prop("checked",!0):this.prop("checked",!1),this}return this.data("pq_value")},r.xmlToArray=function(t,r){var i=r.itemParent,o=r.itemNames,n=[],a=e(t).find(i);return a.each(function(t,r){var i=e(r),a=[];e(o).each(function(e,t){a.push(i.find(t).text().replace(/\r|\n|\t/g,""))}),n.push(a)}),n},r.xmlToJson=function(t,r){var i=r.itemParent,o=r.itemNames,n=[],a=e(t).find(i);return a.each(function(t,r){for(var i=e(r),a={},l=0,s=o.length;s>l;l++){var d=o[l];a[d]=i.find(d).text().replace(/\r|\n|\t/g,"")}n.push(a)}),n},r.tableToArray=function(t){var r=e(t),i=[],o=[],n=r.children("tbody").children("tr"),a=n.length?e(n[0]):e(),l=n.length>1?e(n[1]):e();return a.children("th,td").each(function(t,r){var o=e(r),n=o.html(),a=o.width(),s="left",d="string";if(l.length)var c=l.find("td:eq("+t+")"),h=c.attr("align"),s=h?h:s;var u={title:n,width:a,dataType:d,align:s,dataIndx:t};i.push(u)}),n.each(function(t,r){if(0!=t){var i=e(r),n=[];i.children("td").each(function(t,r){n.push(e.trim(e(r).html()))}),o.push(n)}}),{data:o,colModel:i}};var o={};r.formatCurrency=function(e,r){var i=parseFloat(e);if(!isNaN(i)){var o=0>i,n=t(r,o),a=n.symbol,l=n.symbolEnd,s=n.thousand,d=n.thouSep,c=n.decSep,h=n.decimal;i=i.toFixed(h);for(var u=i.length,f=h+c.length,p=i.substring(0,u-f),g=i.substring(u-f+c.length,u),v=p.match(/\d/g).reverse(),w=[],m=0;m0&&m%s==0&&w.push(d),w.push(v[m]);return w=w.reverse(),p=w.join(""),(o?"-":"")+a+p+c+g+l}},pq.formatNumber=r.formatCurrency,pq.validation={is:function(e,t){return"string"!=e&&e?(e=e.substring(0,1).toUpperCase()+e.substring(1,e.length),this["is"+e](t)):!0},isFloat:function(e){var t=parseFloat(e);return!isNaN(t)&&t==e},isInteger:function(e){var t=parseInt(e);return!isNaN(t)&&t==e},isDate:function(e){var t=Date.parse(e);return!isNaN(t)}};var n=[],a={},l=r.toLetter=function(e){var t=n[e];if(!t){e++;var r=e%26,i=e/26|0,o=r?String.fromCharCode(64+r):(--i,"Z");t=i?l(i-1)+o:o,e--,n[e]=t,a[t]=e}return t};r.generateData=function(e,t){for(var r=[],i=0;t>i;i++)r[i]=l(i);for(var o=[],i=0;e>i;i++)for(var n=o[i]=[],a=0;t>a;a++)n[a]=r[a]+(i+1);return o}}(jQuery),function(e){function t(t,r,i){return e(t?"":"")}function r(t,r){t.bind("click keydown",function(t){return"keydown"!=t.type||t.keyCode==e.ui.keyCode.ENTER?r.call(this,t):void 0})}function i(e,t,r){t[r?"addClass":"removeClass"]("disabled").css("pointer-events",r?"none":"").attr("tabindex",r?"":"0")}var o={};o.options={bootstrap:{on:!1,pager:"",nextIcon:"glyphicon glyphicon-forward",prevIcon:"glyphicon glyphicon-backward",firstIcon:"glyphicon glyphicon-step-backward",lastIcon:"glyphicon glyphicon-step-forward",refreshIcon:"glyphicon glyphicon-refresh"},curPage:0,totalPages:0,totalRecords:0,msg:"",rPPOptions:[10,20,30,40,50,100],rPP:20},o._regional={strDisplay:"Displaying {0} to {1} of {2} items.",strFirstPage:"First Page",strLastPage:"Last Page",strNextPage:"Next Page",strPage:"Page {0} of {1}",strPrevPage:"Previous Page",strRefresh:"Refresh",strRpp:"Records per page:{0}"},e.extend(o.options,o._regional),o._create=function(){var i=this,o=this.options,n=this.element,a=o.bootstrap,l=a.on;this.listeners={},n.addClass("pq-pager "+(l?a.pager:"")),this.first=t(l,o.strFirstPage,l?a.firstIcon:"seek-first").appendTo(n),r(this.first,function(e){o.curPage>1&&i._onChange(e,1)}),this.prev=t(l,o.strPrevPage,l?a.prevIcon:"seek-prev").appendTo(n),r(this.prev,function(e){if(o.curPage>1){var t=o.curPage-1;i._onChange(e,t)}}),e("").appendTo(n),this.pageHolder=e("").appendTo(n),e("").appendTo(n),this.next=t(l,o.strNextPage,l?a.nextIcon:"seek-next").appendTo(n),r(this.next,function(e){if(o.curPage").appendTo(n),this.rPPHolder=e("").appendTo(n),this.$refresh=t(l,o.strRefresh,l?a.refreshIcon:"refresh").appendTo(n),r(this.$refresh,function(e){return i._trigger("beforeRefresh",e)===!1?!1:void i._trigger("refresh",e)}),e("").appendTo(n),this.$msg=e("").appendTo(n),this._refresh()},o._destroy=function(){this.element.empty().removeClass("pq-pager").enableSelection()},o._setOption=function(e,t){"curPage"!=e&&"totalPages"!=e||(t=1*t),this._super(e,t)},o._setOptions=function(t){var r,i=!1,o=this.options;for(r in t){var n=t[r],a=typeof n;"string"==a||"number"==a?n!=o[r]&&(this._setOption(r,n),i=!0):"function"==typeof n.splice||e.isPlainObject(n)?JSON.stringify(n)!=JSON.stringify(o[r])&&(this._setOption(r,n),i=!0):n!=o[r]&&(this._setOption(r,n),i=!0)}return i&&this._refresh(),this},e.widget("paramquery.pqPager",o),pq.pager=function(t,r){var i=e(t).pqPager(r),o=i.data("paramqueryPqPager")||i.data("paramquery-pqPager");return o};var n=e.paramquery;n.pqPager.regional={},n.pqPager.regional.en=o._regional,o=n.pqPager.prototype,n.pqPager.defaults=o.options,o._refreshPage=function(){var t=this;this.pageHolder.empty();for(var r=this.options,i=r.bootstrap,o=r.strPage,n=o.split(/\s/),a=[],l=0,s=n.length;s>l;l++){var d=n[l];"{0}"==d?a.push(""):"{1}"==d?a.push(""):a.push("",d,"")}var c=a.join(""),h=e(c).appendTo(this.pageHolder);this.page=h.filter("input").bind("keydown",function(t){t.keyCode===e.ui.keyCode.ENTER&&e(this).trigger("change")}).bind("change",function(i){var o=e(this),n=o.val();return isNaN(n)||1>n?(o.val(r.curPage),!1):(n=parseInt(n),n!==r.curPage?n>r.totalPages?(o.val(r.curPage),!1):t._onChange(i,n)===!1?(o.val(r.curPage),!1):void 0:void 0)}),this.$total=h.filter("span.total")},o._onChange=function(e,t){return this._trigger("beforeChange",e,{curPage:t})===!1?!1:this._trigger("change",e,{curPage:t})===!1?!1:void this.option({curPage:t})},o._refresh=function(){this._refreshPage();var t=(this.$rPP,this),r=this.options,o=r.bootstrap;if(this.rPPHolder.empty(),r.strRpp){var n=r.rPPOptions,a=r.strRpp;if(-1!=a.indexOf("{0}")){for(var l=["");var h=l.join("");a=a.replace("{0}",""+h),a=""+a+""}else a=""+a+"";this.$rPP=e(a).appendTo(this.rPPHolder).filter("select").val(r.rPP).change(function(r){var i=e(this),o=i.val();return t._trigger("beforeChange",r,{rPP:o})===!1?(i.val(t.options.rPP),!1):void(t._trigger("change",r,{rPP:o})!==!1&&(t.options.rPP=o))})}var u=r.bootstrap.on,f=r.curPage>=r.totalPages;i(u,this.next,f),i(u,this.last,f);var f=r.curPage<=1;if(i(u,this.first,f),i(u,this.prev,f),this.page.val(r.curPage),this.$total.text(r.totalPages),this.options.totalRecords>0){var p=r.rPP,g=r.curPage,v=r.totalRecords,w=(g-1)*p,m=g*p;m>v&&(m=v);var x=r.strDisplay;x=x.replace("{0}",w+1),x=x.replace("{1}",m),x=x.replace("{2}",v),this.$msg.html(x)}else this.$msg.html("")},o.getInstance=function(){return{pager:this}},o._trigger=n._trigger,o.on=n.on,o.one=n.one,o.off=n.off}(jQuery),function(e){function t(e,t){return e?"
":"
"}var r=e.paramquery,i={};i.options={length:200,num_eles:3,trigger:!1,cur_pos:0,ratio:0,timeout:350,pace:"optimum",direction:"vertical",bootstrap:{on:!1,slider:"btn btn-default",up:"glyphicon glyphicon-chevron-up",down:"glyphicon glyphicon-chevron-down",left:"glyphicon glyphicon-chevron-left",right:"glyphicon glyphicon-chevron-right"},theme:!1},i._destroy=function(){e(document).off("."+this.eventNamespace),this.element.removeClass("pq-sb pq-sb-vert pq-sb-vert-t pq-sb-vert-wt").enableSelection().removeClass("pq-sb-horiz pq-sb-horiz-t pq-sb-horiz-wt").unbind("click.pq-scrollbar").empty(),this.element.removeData()},i._create=function(){this.listeners={},this._createLayout()},i._setOption=function(e,t){var r=this.options;"disabled"==e?(this._super(e,t),1==t?this.$slider.draggable("disable"):this.$slider.draggable("enable")):"theme"==e?(r[e]=t,this._createLayout()):"ratio"==e?t>=0&&1>=t&&(r[e]=t):r[e]=t},i._setOptions=function(){this._super.apply(this,arguments),this.refresh()},e.widget("paramquery.pqScrollBar",i),pq.scrollbar=function(t,r){var i=e(t).pqScrollBar(r),o=i.data("paramqueryPqScrollBar")||i.data("paramquery-pqScrollBar");return o};var i=r.pqScrollBar.prototype;r.pqScrollBar.defaults=i.options,i._createLayout=function(){var r=this,i=this.options,o=i.bootstrap,n=o.on,a=i.direction,l=this.eventNamespace,s=i.theme,d=this.element.empty();"vertical"==a?(d.removeClass("pq-sb-vert-t pq-sb-vert-wt").addClass("pq-sb pq-sb-vert"),s?(d.addClass("pq-sb-vert-t"),d[0].innerHTML=["
",t(n,n?o.up:"triangle-1-n"),"
","
","
","
",t(n,n?o.down:"triangle-1-s"),"
"].join("")):(d.addClass("pq-sb-vert-wt"),d[0].innerHTML=["
","
","
","
","
","
","
","
","
"].join(""))):(d.removeClass("pq-sb-horiz-t pq-sb-horiz-wt").addClass("pq-sb pq-sb-horiz"),s?(d.addClass("pq-sb-horiz-t"),d[0].innerHTML=["
",t(n,n?o.left:"triangle-1-w"),"
","
","
","
",t(n,n?o.right:"triangle-1-e"),"
"].join("")):(d.addClass("pq-sb-horiz-wt"),d.width(this.width),d[0].innerHTML=["
","
","","","","","","
","
"].join(""))),d.disableSelection().unbind(".pq-scrollbar").on("mousedown.pq-scrollbar",function(t){if(!i.disabled&&!r.$slider.is(":hidden"))if(e(document).off("."+l).on("mouseup."+l,function(e){r._mouseup(e)}),"vertical"==a){var o=t.pageY,n=r.element.offset().top,s=n+i.length,d=r.$slider,c=d.offset().top,h=d.height(),u=c+h;c>o&&o>n+17?r._setTimerPageLeft(o,h,t,0):o>u&&s-17>o&&r._setTimerPageRight(o,h,t,0)}else{var f=t.pageX,n=r.element.offset().left,s=n+i.length,c=r.$slider.offset().left,u=c+r.$slider.width();c>f&&f>n+17?(r.$slider.css("left",f-r.element.offset().left),r._updateCurPosAndTrigger(t)):f>u&&s-17>f&&(r.$slider.css("left",f-r.element.offset().left-r.$slider.width()),r._updateCurPosAndTrigger(t))}});var c=this.$slider=e("div.pq-sb-slider",this.element);c.attr("tabindex","0"),this._bindSliderEvents(c),this.$top_btn=e("div.top-btn,div.left-btn",this.element).click(function(e){return r.options.disabled?void 0:(r.decr_cur_pos(e),!1)}).mousedown(function(e){return r.options.disabled?void 0:(r.mousedownTimeout=setTimeout(function(){r.mousedownInterval=setInterval(function(){r.decr_cur_pos(e)},0)},r.options.timeout),!1)}).bind("mouseup mouseout",function(e){r._mouseup(e)}),this.$bottom_btn=e("div.bottom-btn,div.right-btn",this.element).click(function(e){return r.options.disabled?void 0:(r.incr_cur_pos(e),!1)}).mousedown(function(e){return r.options.disabled?void 0:(r.mousedownTimeout=setTimeout(function(){r.mousedownInterval=setInterval(function(){r.incr_cur_pos(e)},0)},r.options.timeout),!1)}).bind("mouseup mouseout",function(e){r._mouseup(e)}),this.refresh()};var o=0;i._setTimerPageLeft=function(e,t,r,i){var n=this,a=n.options;this.mousedownTimeout=window.setTimeout(function(){if(e>=n.$slider.offset().top)n._mouseup();else{n._pageLeft(r);var i=o?0:a.timeout;o++,n._setTimerPageLeft(e,t,r,i)}},i)},i._setTimerPageRight=function(e,t,r,i){var n=this;this.mousedownTimeout=window.setTimeout(function(){if(e<=n.$slider.offset().top+t)n._mouseup();else{n._pageRight(r);var i=o?0:n.options.timeout;o++,n._setTimerPageRight(e,t,r,i)}},i)},i._bindSliderEvents=function(t){var r=this,i=this.options.direction,o="x";"vertical"==i&&(o="y"),t.draggable({axis:o,helper:function(e,t){return r._setDragLimits(),this},start:function(e){r.topWhileDrag=null,r.dragging=!0},drag:function(e){r.dragging=!0;var t=r.options.pace;"optimum"==t?r._setNormalPace(e):"fast"==t&&r._updateCurPosAndTrigger(e)},stop:function(e){"fast"!=r.options.pace&&r._updateCurPosAndTrigger(e),r.dragging=!1,r.refresh()}}).on("keydown.pq-scrollbar",function(t){var i=t.keyCode,o=r.options,n=o.cur_pos,a=o.ratio,l=o.num_eles,s=e.ui.keyCode;return null==r.keydownTimeout&&(r.keydownTimeout=window.setTimeout(function(){i==s.DOWN||i==s.RIGHT?r.incr_cur_pos(t):i==s.UP||i==s.LEFT?r.decr_cur_pos(t):i==s.HOME?o.steps?n>0&&(o.cur_pos=0,r.updateSliderPos(),r.scroll(t)):a>0&&(o.ratio=0,r.updateSliderPos(),r.drag(t)):i==s.END?o.steps?l>n&&(o.cur_pos=l,r.updateSliderPos(),r.scroll(t)):1>a&&(o.ratio=1,r.updateSliderPos(),r.drag(t)):"vertical"==o.direction&&(i==s.PAGE_DOWN?r._pageRight(t):i==s.PAGE_UP&&r._pageLeft(t)),r.keydownTimeout=null},0)),i==s.DOWN||i==s.RIGHT||i==s.UP||i==s.LEFT||i==s.PAGE_DOWN||i==s.PAGE_UP||i==s.HOME||i==s.END?(t.preventDefault(),!1):void 0})},i.decr_cur_pos=function(e){var t=this,r=t.options,i=r.steps;if(i)r.cur_pos>0&&(r.cur_pos--,t.updateSliderPos(),t.scroll(e));else if(r.ratio>0){var o=r.ratio-1/(r.num_eles-1);0>o&&(o=0),r.ratio=o,t.updateSliderPos(),t.drag(e)}},i.incr_cur_pos=function(e){var t=this,r=t.options,i=r.steps;if(i)r.cur_pos1&&(o=1),r.ratio=o}t.updateSliderPos(),t.drag(e)}},i._mouseup=function(e){if(!this.options.disabled){o=0;var t=this;window.clearTimeout(t.mousedownTimeout),t.mousedownTimeout=null,window.clearInterval(t.mousedownInterval),t.mousedownInterval=null}},i._setDragLimits=function(){var e=this.options;if("vertical"==e.direction){var t=this.element.offset().top+17,r=t+e.length-34-this.slider_length;this.$slider.draggable("option","containment",[0,t,0,r])}else t=this.element.offset().left+17,r=t+e.length-34-this.slider_length,this.$slider.draggable("option","containment",[t,0,r,0])},i._validateCurPos=function(){var e=this.options;e.cur_pos>=e.num_eles&&(e.cur_pos=e.num_eles-1),e.cur_pos<0&&(e.cur_pos=0)},i._updateSliderPosRatio=function(){var e=this,t=this.options,r=t.direction,i=t.ratio,o=e.$slider[0],n=t.length-34-this.slider_length;if(null==i)throw"updateSliderPosRatio ratio N/A";var a=i*n+17;"vertical"==r?o.style.top=a+"px":o.style.left=a+"px"},i._updateSliderPosCurPos=function(){var e=this.options,t=this.$slider[0],r=this.scroll_space*e.cur_pos/(e.num_eles-1);"vertical"==e.direction?t.style.top=17+r+"px":t.style.left=17+r+"px"},i.updateSliderPos=function(){var e=this.options;if(void 0===e.steps)throw"updateSliderPos. steps N/A";e.steps?this._updateSliderPosCurPos():this._updateSliderPosRatio()},i.scroll=function(e){var t=this.options;this._trigger("scroll",e,{cur_pos:t.cur_pos,num_eles:t.num_eles})},i.drag=function(e){var t=this,r=t.options;this._trigger("drag",e,{ratio:r.ratio})},i._pageRight=function(e){this._trigger("pageRight",e,null)},i._pageLeft=function(e){this._trigger("pageLeft",e,null)},i._setSliderBgLength=function(){var t=this.options,r=t.theme,i=this.$slider,o=t.length,n=40*t.num_eles+o,a=o-34,l=a*o/n,s=Math.round((l-14)/2);1>s&&(s=1);var d=14+2*s;if(this.scroll_space=t.length-34-d,d!==this.slider_length){this.slider_length=d;var c="vertical"===t.direction?{dim:"height",cls:".vert-slider-bg"}:{dim:"width",cls:".horiz-slider-bg"};r?i[c.dim](d-2):(e(c.cls,this.element)[c.dim](s),i[c.dim](d))}},i._updateCurPosAndTrigger=function(e,t){var r=this,i=this.options,o=i.direction,n=r.$slider;null==t&&(t=parseInt(n[0].style["vertical"===o?"top":"left"]));var a=i.length-34-this.slider_length,l=(t-17)/a;if(i.steps){var s=l*(i.num_eles-1);if(s=Math.round(s),i.cur_pos!=s){if(this.dragging){if(null!=this.topWhileDrag){if(this.topWhileDrags)return;if(this.topWhileDrag>t&&i.cur_pos').appendTo(o);n[0].data="about:blank",n.css("opacity","0")}for(var a=0;a
"}function r(e){return""}var i=function(){};i.prototype.belongs=function(e){return e.target==this.that.element[0]?!0:void 0};var o=e.paramquery;o.cClass=i;var n=function(e){this.that=e;var t=this.options=e.options,r=this;null!=t.postRenderInterval&&e.on("refresh",function(){r.prColDef.length&&r.postRenderAll()}).on("refreshRow",function(e,t){r.prColDef.length&&r.postRenderRow(t)}).on("refreshCell",function(e,t){t.column.postRender&&r.postRenderRow(t)}).on("refreshColumn",function(e,t){t.column.postRender&&r.setTimerPostRender(0,t.colIndx,t.column)}),t.mergeModel.flex||e.on("refresh refreshCell refreshRow refreshColumn",r.onRefreshMerge(e))};o.cGenerateView=n;var a=n.prototype=new i;a.onRefreshMerge=function(t){return function(){for(var r,i,o,n,a,l,s,d=t.$cont.find(".pq-merge-cell-div"),c=d.length,h=[],u=[];c--;)r=d[c],i=r.parentNode,o||(o=2*parseInt(e(i).css("paddingTop")),n=2*parseInt(e(i).css("paddingLeft"))),a=Math.max(i.offsetHeight,28),l=a-o,s=i.offsetWidth-n,h[c]=l-1+"px",u[c]=s+"px";for(c=d.length;c--;)r=d[c],r.style.height=h[c],r.style.width=u[c]}},a.generateView=function(e){e=e||{};var t,r,i=this,n=this.that,a=n.options,l="flex"===a.width,s="flex"===a.height,d=a.cls,c=d.cont_inner,h=d.cont_inner_b,u=n.initH,f=n.finalH,p=n.pqpanes;if(e.$cont){var g=this._generateTables(null,null,e),v=e.$cont;v.empty(),p.v?v[0].innerHTML=["
",g,"
","
",g,"
"].join(""):v[0].innerHTML=["
",g,"
"].join("");var w=v.children("div"),m=w.children("table");n.tables[0]={$tbl:m,$cont:v}}else{t=n.initV,r=n.finalV;var x=n.pdata,v=n.$cont;null!=a.editModel.indices&&n.blurEditor({force:!0});var _={pageData:x,initV:t,finalV:r,initH:u,finalH:f,source:e.source};n._trigger("beforeTableView",null,_);var g=i._generateTables(t,r,e);if(v.empty(),0===n.totalVisibleRows)v.append("
"+a.strNoRows+"
");else{var I=s||l?"style='position:relative;'":"";p.h&&p.v?v[0].innerHTML=["
",g,"
","
",g,"
","
",g,"
","
",g,"
"].join(""):p.v?v[0].innerHTML=["
",g,"
","
",g,"
"].join(""):p.h?v[0].innerHTML=["
",g,"
","
",g,"
"].join(""):v[0].innerHTML=["
",g,"
"].join("")}n.$tbl=v.children("div").children("table"),a.scrollModel.flexContent&&n.$tbl[0]&&o.onResize(n.$tbl[0],function(){var e=n.iRefresh;e.ignoreTResize||e.softRefresh()}),this.setPaneEvents(),n._trigger("refresh",null,_)}this.setPanes()},a.postRenderRow=function(e){var t,r=this.that,i=this.prColDef,o=r.iMerge,n=e.rowIndx,a=r;null!=e.colIndx&&(i=[{colIndx:e.colIndx,column:e.column}]);for(var l=0,s=i.length;s>l;l++){var d=i[l],t=d.column.postRender,c=d.colIndx;o.ismergedCell(n,c)?o.isRootCell(n,c,"a")&&(e=o.getRootCell(n,c),t.call(a,e)):(e=r.normalize({rowIndx:n,colIndx:c}),t.call(a,e))}},a.setTimerPostRender=function(e,t,r){var i=this.that,o=this,n=i.pdata,a=function(e){return-1==i.options.postRenderInterval?e():setTimeout(e,0)};n&&n.length&&(o.postRenderTimeoutID=a(function(){var a=i.initV,l=i.options.freezeRows;a>e&&e>=l&&(e=a);var s=n[e];s.pq_hidden||o.postRenderRow({column:r,colIndx:t,rowIndx:e+i.rowIndxOffset}),e++,e<=i.finalV&&o.setTimerPostRender(e)}))},a.postRenderAll=function(){var e=this.that,t=this,r=e.pdata,i=e.options.postRenderInterval,o=function(e){return-1==i?e():setTimeout(e,i)};r&&r.length&&(clearTimeout(t.postRenderTimeoutID),t.postRenderTimeoutID=o(function(){t.setTimerPostRender(0)}))},a.scrollView=function(){var e=this.that,t=this.options,r=t.virtualX,i=t.virtualY;r||e.hscroll.drag(),i||e.vscroll.drag()},a.setPaneEvents=function(){var t=this.that,r=t.$cont,i=t.pqpanes,o=r.children("div"),n=t.iMouseSelection,a=t.$tbl;if(a&&a.length)if(i.h&&i.v){var l=e(o[0]),s=e(o[1]),d=e(o[2]),c=e(o[3]);l.on("scroll",function(e){this.scrollTop=0,this.scrollLeft=0}),s.on("scroll",function(e){this.scrollTop=0,this.scrollLeft=n.getScrollLeft(!0)}),d.on("scroll",function(e){this.scrollTop=n.getScrollTop(!0),this.scrollLeft=0}),c.on("scroll",function(e){this.scrollTop=n.getScrollTop(!0),this.scrollLeft=n.getScrollLeft(!0)})}else if(i.v){var h=e(o[0]),u=e(o[1]);h.on("scroll",function(e){this.scrollTop=n.getScrollTop(!0),this.scrollLeft=0}),u.on("scroll",function(e){this.scrollTop=n.getScrollTop(!0),this.scrollLeft=n.getScrollLeft(!0)})}else if(i.h){var f=e(o[0]),p=e(o[1]);f.on("scroll",function(e){this.scrollTop=0,this.scrollLeft=n.getScrollLeft(!0)}),p.on("scroll",function(e){this.scrollTop=n.getScrollTop(!0),this.scrollLeft=n.getScrollLeft(!0)})}else o.on("scroll",function(e){this.scrollTop=n.getScrollTop(!0),this.scrollLeft=n.getScrollLeft(!0)})},a.setPanes=function(){var t,r=this.that,i=r.$cont,o=r.pqpanes,n=i.children("div"),a=r.iRefresh,l=r.$tbl,s=r.options,d=1*s.freezeCols,c=(r.initH,1),h=r.calcWidthCols(-1,d)+c,u="flex"===s.width,f=u&&!s.maxWidth?"":a.getEContWd();if(r.tables.length){var p=r.tables[0].$tbl,g=r.tables[0].$cont,v=p.parent("div");o.v?(e(v[0]).css({width:h}),e(v[1]).css({left:h,width:f-h}),e(p[1]).css({left:-1*h})):e(v[0]).css({width:f}),g.height(p[0].scrollHeight-1),a.setContHeight()}if(l&&l.length){var w="flex"===s.height,m=w&&!s.maxHeight?"":a.getEContHt();if(o.h&&o.v){var x=e(n[0]),_=e(n[1]),I=e(l[1]),y=e(n[2]),b=e(l[2]),C=e(n[3]),q=e(l[3]),t=r.calcHeightFrozenRows(),M=t;x.css({width:h,height:M}),_.css({left:h,width:f-h,height:M}),I.css({left:-1*h}),y.css({width:h,top:M,height:m-M}),b.css({marginTop:-(M+1)}),C.css({left:h,width:f-h,top:M,height:m-M}),q.css({marginTop:-(M+1),left:-1*h})}else if(o.v){var D=e(n[0]),R=e(n[1]),P=e(l[1]);D.css({width:h,height:m}),R.css({left:h,width:f-h,height:m}),P.css({left:-1*h})}else if(o.h){var T=e(n[0]),k=e(n[1]),S=e(l[1]),t=r.calcHeightFrozenRows(),M=t;T.css({height:M,width:f}),k.css({width:f,top:M,height:m-M}),S.css({marginTop:-(M+1)})}else n.css({width:f,height:m})}s.showHeader&&(o.vH?(r.$header_left.css({width:h}),r.$header_right.css({left:h,width:f-h}),r.$header_right_inner.css({left:-h})):r.$header_left.css({width:f}))},a.createColDefs=function(){for(var e=this.that,t=e.colModel,r=e.initH,i=e.finalH,o=e.options,n=o.freezeCols,a=[],l=[],s=0;i>=s;s++){if(r>s&&s>=n&&(s=r,s>i))throw"initH>finalH";var d=t[s];d.hidden||(a.push({column:d,colIndx:s}),d.postRender&&"function"==typeof d.postRender&&l.push({column:d,colIndx:s}))}this.colDef=a,this.prColDef=l},a._generateTables=function(e,t,r){r=r||{};var i,o=this.that,n=o.options,a=n.bootstrap,l=n.numberCell,s=o.iRefresh,d=1*n.freezeRows,c=0,h=r.other,u=h?r.data.length-1:t;if(h?i=r.data:(i=o.pdata, this.setFrozenRip(i,d)),h||null!=e&&null!=u){this.vrows=s.vrows,this.vfrows=s.vfrows;var f=["pq-grid-table"];a.on&&f.push(a.tbody),n.columnBorders&&f.push("pq-td-border-right"),n.rowBorders&&f.push("pq-td-border-top"),f.push(n.wrap?"pq-wrap":"pq-no-wrap");var p=[""];if(p.push(""),l.show){var g=l.width;p.push("")}for(var v=this.colDef,w=0,m=v.length;m>w;w++){var x=v[w],_=x.colIndx,I=x.column,g=I.outerWidth;p.push("")}p.push("");for(var c=0;u>=c;c++){e>c&&c>=d&&(c=e);var y=i[c],b=c,C=y?y.pq_hidden:!1;if(!C){var q=y.pq_detail&&y.pq_detail.show;this._generateRow(y,b,p,h,q),q&&this._generateDetailRow(y,b,p)}}return p.push("
"),p.join("")}},a.appendRow=function(e){var t=this.that,r=t.pdata,i=t.colModel,o=t.finalV;if(o+e>r.length&&(e=r.length-o),e){if(e>1)throw"noRows > 1";t._trigger("beforeTableView",null,{pageData:r,initV:o,finalV:o,initH:t.initH,finalH:t.finalH,colModel:i}),t.refreshRow({rowIndxPage:o,refresh:!1})}return e},a.prependRow=function(e){var t=this.that,r=t.options.freezeRows,i=t.calcVisibleRows(t.pdata,0,r),o=t.pdata,n=t.initV,a=t.colModel;if(t._mergeCells){if(i)for(var l=0;r>l;l++)t.refreshRow({rowIndxPage:l,refresh:!1});t.refreshRow({rowIndxPage:n+1,refresh:!1})}return t._trigger("beforeTableView",null,{pageData:o,initV:n,finalV:n,initH:t.initH,finalH:t.finalH,colModel:a}),t.refreshRow({rowIndxPage:n,refresh:!1}),e},a.removeTopRow=function(t){for(var r=this.that,i=r.options.freezeRows,o=r.calcVisibleRows(r.pdata,0,i),n=r.$tbl,a=e([]),l=0;ll;l++)r.refreshRow({rowIndxPage:l,refresh:!1});r.refreshRow({rowIndxPage:r.initV,refresh:!1})}},a.removeBottomRow=function(t){var r=this.that,i=r.$tbl;if(t)for(var o=0;o",n?"
":"",w,n?"
":"",""].join("");return k}},a.setFrozenRip=function(e,t){if(e){for(var r;t--&&(r=e[t])&&r.pq_hidden;);this.frozenRip=t}},a.refreshRow=function(e,t){var r=this.that,i=r.pdata[e],o=i.pq_detail&&i.pq_detail.show;this._generateRow(i,e,t,null,o)},a._generateRow=function(e,t,r,i,o){var n=["pq-grid-row"];this.frozenRip===t&&n.push("pq-last-frozen-row"),o&&n.push("pq-detail-master");var a=this.that,l=this.options,s=l.rowInit,d=l.numberCell,c="",h="",f=a.rowIndxOffset,p=t+f;if(s){var g=s.call(a,{rowData:e,rowIndxPage:t,rowIndx:p});g&&(g.cls&&n.push(g.cls),c+=g.attr?" "+g.attr:"",h+=g.style?g.style:"")}!i&&l.stripeRows&&this.isOdd(t,l.freezeRows)&&n.push("pq-grid-oddRow"),e.pq_rowselect&&n.push(a.iRows.hclass);var v=e.pq_rowcls;null!=v&&n.push(v);var w=e.pq_rowattr;if(w){var m=u(w);for(var x in m){var _=m[x];c+=" "+x+'="'+_+'"'}}h=h?"style='"+h+"'":"",r.push(""),d.show&&r.push(["",i?" ":p+1,""].join(""));for(var I={rowIndx:t+f,rowIndxPage:t,other:i,rowData:e},y=this.colDef,b=0,C=y.length;C>b;b++){var q=y[b],M=q.colIndx,D=q.column;I.column=D,I.colIndx=M,r.push(this.renderCell(I))}return r.push(""),r},a.isOdd=function(e,t){var r=pq.searchSeqArray(t>e?this.vfrows:this.vrows,e);return r/2==parseInt(r/2)},a._generateDetailRow=function(e,t,r){var i=["pq-grid-row pq-detail-child"],o=this.that,n=o.options,a=n.numberCell,l="pq-grid-cell";n.stripeRows&&this.isOdd(t,n.freezeRows)&&i.push("pq-grid-oddRow"),e.pq_rowselect&&i.push(o.iRows.hclass);var s=e.pq_rowcls;return null!=s&&i.push(s),r.push(""),a.show&&r.push([""," "].join("")),r.push(""),r.push(""),r};var l={widgetEventPrefix:"pqgrid"};l._create=function(){var t=this,r=this.options,i=r.dataModel,a=r.bootstrap,l=a.on,s=r.roundCorners&&!l,d=r.ui,h=r.sortModel;if(e(document).triggerHandler("pqGrid:bootup",{instance:this}),this.BS_on=l,r.collapsible||(r.collapsible={on:!1,collapsed:!1}),r.flexHeight&&(r.height="flex"),r.flexWidth&&(r.width="flex"),i.sortIndx){h.on=r.sortable,h.type=i.sorting;var u=[],p=i.sortIndx,g=i.sortDir;if(e.isArray(p)){for(var v=0;v","
 
","","
","
","
","
","
","
","
","
","","
"].join("")),this.$bottom=e("div.pq-grid-bottom",m),this._trigger("render",null,{dataModel:this.options.dataModel,colModel:this.colModel}),this.$top=e("div.pq-grid-top",m),r.showTop||this.$top.css("display","none"),this.$title=e("div.pq-grid-title",m),r.showTitle||this.$title.css("display","none");var b=this.$grid_center=e("div.pq-grid-center",m).on("scroll",function(){this.scrollTop=0});this.$header_o=e("div.pq-header-outer",this.$grid_center).on("scroll",function(){this.scrollTop=0,this.scrollLeft=0}),this.$footer=e("div.pq-grid-footer",m),this.$cont_o=e(".pq-grid-cont-outer",b);var C=this.$cont=e("div.pq-grid-cont",b);e(window).bind("resize"+t.eventNamespace+" orientationchange"+t.eventNamespace,function(e,r){t.onWindowResize(e,r)}),C.on("click",".pq-grid-cell,.pq-grid-number-cell",function(r){return e.data(r.target,t.widgetName+".preventClickEvent")!==!0&&e(r.target).closest(".pq-grid")[0]==t.element[0]?t._onClickCell(r):void 0}),C.on("click","tr.pq-grid-row",function(r){return e.data(r.target,t.widgetName+".preventClickEvent")!==!0&&e(r.target).closest(".pq-grid")[0]==t.element[0]?t._onClickRow(r):void 0}),C.on("contextmenu","td.pq-grid-cell",function(r){return e(r.target).closest(".pq-grid")[0]==t.element[0]?t._onRightClickCell(r):void 0}),C.on("contextmenu","tr.pq-grid-row",function(r){return e(r.target).closest(".pq-grid")[0]==t.element[0]?t._onRightClickRow(r):void 0}),C.on("dblclick","td.pq-grid-cell",function(r){return e(r.target).closest(".pq-grid")[0]==t.element[0]?t._onDblClickCell(r):void 0}),C.on("dblclick","tr.pq-grid-row",function(r){return e(r.target).closest(".pq-grid")[0]==t.element[0]?t._onDblClickRow(r):void 0}),C.on("blur",function(){t.onblur()}),C.on("focus",function(){t.onfocus()}),C.on("mousedown",function(r){if(1===r.which){var i=e(r.target);if(i.closest(".pq-grid")[0]==t.element[0]){var o,n=i.closest(".pq-grid-cell:not(.pq-detail-child)");if(n.length&&(r.currentTarget=n[0],o=t._onCellMouseDown(r),o===!1))return!1;if(r.isPropagationStopped())return;var a=i.closest(".pq-grid-row");if(a.length&&(r.currentTarget=a[0],o=t._onRowMouseDown(r),o===!1))return!1;if(r.isPropagationStopped())return;return t._onContMouseDown(r)}}}),C.on("mouseenter","td.pq-grid-cell",function(r){return e(r.target).closest(".pq-grid")[0]==t.element[0]?t._onCellMouseEnter(r,e(this)):void 0}),C.on("mouseenter","tr.pq-grid-row",function(r){return e(r.target).closest(".pq-grid")[0]==t.element[0]?t._onRowMouseEnter(r,e(this)):void 0}),C.on("mouseleave","td.pq-grid-cell",function(r){return e(r.target).closest(".pq-grid")[0]==t.element[0]?t._onCellMouseLeave(r,e(this)):void 0}),C.on("mouseleave","tr.pq-grid-row",function(r){return e(r.target).closest(".pq-grid")[0]==t.element[0]?t._onRowMouseLeave(r,e(this)):void 0}),C.on("keyup",function(r){e(r.target).closest(".pq-grid")[0]==t.element[0]&&t._trigger("keyUp",r,null)}),b.bind("mousewheel DOMMouseScroll",function(e){return t._onMouseWheel(e)});this.$hvscroll=e("
").appendTo(b);var q=e("
").appendTo(b);this.prevVScroll=0;var M=r.scrollModel;void 0===M.lastColumn&&r.virtualX&&(M.lastColumn="auto"),this.vscroll=pq.scrollbar(q,{pace:M.pace,theme:M.theme,bootstrap:r.bootstrap,steps:r.virtualY&&!M.smooth,direction:"vertical",cur_pos:0,pageRight:function(){t.iKeyNav.pageDown()},pageLeft:function(){t.iKeyNav.pageUp()},drag:function(e,r){t.iMouseSelection.syncViewWithScrollBarVert(r.ratio)},scroll:function(e,r){t.iRefresh.refreshVscroll(r)}});var D=e("
").appendTo(b);"flex"===r.height&&D.css("position","relative"),this.hscroll=pq.scrollbar(D,{direction:"horizontal",pace:M.pace,bootstrap:r.bootstrap,theme:M.theme,steps:r.virtualX&&!M.smooth,cur_pos:0,drag:function(e,r){t.iMouseSelection.syncViewWithScrollBarHor(r.ratio)},scroll:function(){r.virtualX&&!r.scrollModel.smooth&&t.refresh()}}),r.selectionModel["native"]||this.disableSelection(),b.bind("keydown.pq-grid",function(r){e(r.target).closest(".pq-grid")[0]==t.element[0]&&t._onKeyPressDown(r)}),this._refreshTitle(),this.iRows=new o.cRows(this),this.iCells=new o.cCells(this),this.generateLoading(),this._initPager(),this._refreshResizable(),this._refreshDraggable(),this.iResizeColumns=new o.cResizeColumns(this),this._mouseInit()},l._mouseDown=function(t){var r=this;return e(t.target).closest(".pq-editor-focus").length?(this._blurEditMode=!0,void window.setTimeout(function(){r._blurEditMode=!1},0)):(this._saveDims(),this._mousePQUpDelegate=function(e){return r._mousePQUp(e)},e(document).bind("mouseup"+this.eventNamespace,this._mousePQUpDelegate),this._super(t))},l.destroy=function(){this._trigger("destroy"),this._super(),window.clearInterval(this._refreshEditorPosTimer),this.autoResizeTimeout&&clearTimeout(this.autoResizeTimeout);for(var t in this)delete this[t];this.options=void 0,e.fragments={}},l._setOption=function(e,t){var r=this.options,i=r.dataModel;if("height"===e){if("flex"===t){var o=this.vscroll;t&&o&&o.widget().hasClass("pq-sb-vert")&&(r.virtualY?o.option("cur_pos",0):o.option("ratio",0)),this.hscroll.widget().css("position","relative")}else"flex"===r.height&&this.hscroll.widget().css("position","");r[e]=t}else if("width"===e&&"flex"==t){r[e]=t;var n=this.hscroll;t&&n&&n.widget().hasClass("pq-sb-horiz")&&(r.virtualX?n.option("cur_pos",0):n.option("ratio",0))}else if("title"==e)r[e]=t,this._refreshTitle();else if("roundCorners"==e)r[e]=t,t?(this.element.addClass("ui-corner-all"),this.$top.addClass("ui-corner-top"),this.$bottom.addClass("ui-corner-bottom")):(this.element.removeClass("ui-corner-all"),this.$top.removeClass("ui-corner-top"),this.$bottom.removeClass("ui-corner-bottom"));else if("virtualX"==e)r[e]=t,this.hscroll.option("steps",t);else if("virtualY"==e)r[e]=t,this.vscroll.option("steps",t);else if("freezeCols"==e)t=parseInt(t),!isNaN(t)&&t>=0&&t<=this.colModel.length-2&&(r[e]=t);else if("freezeRows"==e)t=parseInt(t),!isNaN(t)&&t>=0&&(r[e]=t);else if("resizable"==e)r[e]=t,this._refreshResizable();else if("draggable"==e)r[e]=t,this._refreshDraggable();else if("scrollModel"==e)r[e]=t;else if("dataModel"==e)t.data!==i.data&&i.dataUF&&(i.dataUF.length=0),r[e]=t;else{if("groupModel"==e)throw"use groupOption() to set groupModel options.";if("pageModel"==e)r[e]=t;else if("selectionModel"===e)r[e]=t;else if("colModel"===e||"columnTemplate"==e)r[e]=t,this.iColModel.init();else if("disabled"===e)this._super(e,t),t===!0?this._disable():this._enable();else if("numberCell"===e)r[e]=t,this.iRefresh.decidePanes();else if("strLoading"===e)r[e]=t,this._refreshLoadingString();else if("showTop"===e)r[e]=t,this.$top.css("display",t?"":"none");else if("showTitle"===e)r[e]=t,this.$title.css("display",t?"":"none");else if("showToolbar"===e){r[e]=t;var a=this._toolbar.widget();a.css("display",t?"":"none")}else"toolbar"==e?r[e]=t:"collapsible"===e?(r[e]=t,this._createCollapse()):"showBottom"===e?(r[e]=t,this.$bottom.css("display",t?"":"none")):r[e]=t}return this},l.options={cancel:"input,textarea,button,select,option,.pq-no-capture,.ui-resizable-handle",trigger:!1,bootstrap:{on:!1,thead:"table table-striped table-condensed table-bordered",tbody:"table table-condensed",grid:"panel panel-default",top:"",btn:"btn btn-default",groupModel:{icon:["glyphicon-triangle-bottom","glyphicon-triangle-right"]},header_active:"active"},ui:{on:!0,grid:"ui-widget ui-widget-content",top:"ui-widget-header",bottom:"ui-widget-header",header_o:"ui-widget-header",header:"ui-state-default",header_active:"ui-state-active"},cls:{cont_inner:"pq-grid-cont-inner",cont_inner_b:"pq-grid-cont-inner-b"},distance:3,collapsible:{on:!0,toggle:!0,collapsed:!1,_collapsed:!1,refreshAfterExpand:!0,css:{zIndex:1e3}},colModel:null,columnBorders:!0,dataModel:{data:[],dataUF:[],cache:!1,dataType:"JSON",location:"local",sorting:"local",sortDir:"up",method:"GET"},direction:"",draggable:!1,editable:!0,editModel:{cellBorderWidth:0,pressToEdit:!0,clicksToEdit:2,filterKeys:!0,keyUpDown:!0,reInt:/^([\-]?[1-9][0-9]*|[\-]?[0-9]?)$/,reFloat:/^[\-]?[0-9]*\.?[0-9]*$/,onBlur:"validate",saveKey:e.ui.keyCode.ENTER,onSave:"nextFocus",onTab:"nextFocus",allowInvalid:!1,invalidClass:"pq-cell-red-tr pq-has-tooltip",warnClass:"pq-cell-blue-tr pq-has-tooltip",validate:!0},editor:{select:!1,type:"textbox"},summaryOptions:{number:"avg,sum,max,min",date:"count,max,min",string:"count"},summaryTitle:{avg:"Avg: {0}",count:"Count: {0}",max:"Max: {0}",min:"Min: {0}",sum:"Sum: {0}"},validation:{icon:"ui-icon-alert",cls:"ui-state-error",style:"padding:3px 10px;"},warning:{icon:"ui-icon-info",cls:"",style:"padding:3px 10px;"},freezeCols:0,freezeRows:0,freezeBorders:!0,calcDataIndxFromColIndx:!0,height:400,hoverMode:"null",_maxColWidth:"99%",_minColWidth:50,minWidth:100,numberCell:{width:30,title:"",resizable:!0,minWidth:30,maxWidth:100,show:!0},pageModel:{curPage:1,totalPages:0,rPP:10,rPPOptions:[10,20,50,100]},resizable:!1,roundCorners:!0,rowBorders:!0,rowHeight:25,scrollModel:{pace:"fast",smooth:!1,horizontal:!0,lastColumn:"auto",autoFit:!1,theme:!0},selectionModel:{type:"cell",onTab:"nextFocus",row:!0,mode:"block"},swipeModel:{on:!0,speed:20,ratio:.15,repeat:20},showBottom:!0,showHeader:!0,showTitle:!0,showToolbar:!0,showTop:!0,sortable:!0,sql:!1,stripeRows:!0,title:" ",treeModel:null,virtualX:!1,virtualY:!1,width:"auto",wrap:!0,hwrap:!0};var s={strAdd:"Add",strDelete:"Delete",strEdit:"Edit",strGroup_header:"Drag a column here to group by that column",strGroup_merge:"Merge cells",strGroup_fixCols:"Fix columns",strGroup_grandSummary:"Grand summary",strLoading:"Loading",strNoRows:"No rows to display."};e.extend(!0,l.options,s),e.widget("paramquery._pqGrid",e.ui.mouse,l);var d=o._pqGrid.prototype;d.refreshCM=function(e){e?this.option("colModel",e):this.iColModel.init()},d.readCell=function(e,t,r,i,o){var n=t.dataIndx;if(!r||r.isRootCell(i,o,"o")!==!1)return e[n]},d.saveCell=function(e,t,r){var i=t.dataIndx;e[i]=r},d._destroyResizable=function(){var e=this.element,t=e.data();(t.resizable||t.uiResizable||t["ui-resizable"])&&e.resizable("destroy")},d._disable=function(){null==this.$disable&&(this.$disable=e("
").css("opacity",.2).appendTo(this.element))},d._enable=function(){this.$disable&&(this.element[0].removeChild(this.$disable[0]),this.$disable=null)},d._destroy=function(){this.loading&&this.xhr.abort(),this._destroyResizable(),this._destroyDraggable(),this._mouseDestroy(),this.element.off(this.eventNamespace),e(window).unbind(this.eventNamespace),e(document).unbind(this.eventNamespace),this.element.empty().css("height","").css("width","").removeClass("pq-grid ui-widget ui-widget-content ui-corner-all").removeData()},d.collapse=function(e){var t=this,r=this.element,i=this.options,o=i.collapsible,n=o.$collapse.children("span"),a=function(){r.css("overflow","hidden"),n.addClass("ui-icon-circle-triangle-s").removeClass("ui-icon-circle-triangle-n"),r.hasClass("ui-resizable")&&r.resizable("destroy"),t._toolbar&&t._toolbar.disable(),o.collapsed=!0,o._collapsed=!0,o.animating=!1,t._trigger("collapse")};return e=e?e:{},o._collapsed?!1:(o.htCapture=r.height(),void(e.animate===!1?(r.height(23),a()):(o.animating=!0,r.animate({height:"23px"},function(){a()}))))},d.expand=function(e){var t=this,r=this.element,i=this.options,o=i.collapsible,n=o.htCapture,a=o.$collapse.children("span"),l=function(){r.css("overflow",""),o._collapsed=!1,o.collapsed=!1,t._refreshResizable(),o.refreshAfterExpand&&t.refresh(),a.addClass("ui-icon-circle-triangle-n").removeClass("ui-icon-circle-triangle-s"),t._toolbar&&t._toolbar.enable(),o.animating=!1,t._trigger("expand")};return e=e?e:{},o._collapsed===!1?!1:void(e.animate===!1?(r.height(n),l()):(o.animating=!0,r.animate({height:n},function(){l()})))},d._createCollapse=function(){var i=this,o=this.$top,n=this.options,a=this.BS_on,l=n.collapsible;if(!l.$stripe){var s=e(["
","
"].join("")).appendTo(o);l.$stripe=s}l.on?l.$collapse||(l.$collapse=e(a?t("collapse-down"):r("circle-triangle-n")).appendTo(l.$stripe).click(function(e){l.collapsed?i.expand():i.collapse()})):l.$collapse&&(l.$collapse.remove(),delete l.$collapse),l.collapsed&&!l._collapsed?i.collapse({animate:!1}):!l.collapsed&&l._collapsed&&i.expand({animate:!1}),l.toggle?l.$toggle||(l.$toggle=e(a?t("fullscreen"):r("arrow-4-diag")).prependTo(l.$stripe).click(function(e){i.toggle()})):l.$toggle&&(l.$toggle.remove(),delete l.$toggle)},d.toggle=function(){var t,r=this.options,i=r.collapsible,o=this.element,n=this._maxim,t=n?"min":"max",a=e(document.body);if(this._trigger("beforeToggle",null,{state:t})===!1)return!1;if("min"==t){var l=n.eleObj,s=n.docObj;this.option({height:l.height,width:l.width,maxHeight:l.maxHeight,maxWidth:l.maxWidth}),o[0].style.cssText=l.cssText,a[0].style.cssText=s.cssText,e("html").css({overflow:"visible"}),window.scrollTo(s.scrollLeft,s.scrollTop),this._maxim=null}else{var l={height:r.height,width:r.width,cssText:o[0].style.cssText,maxHeight:r.maxHeight,maxWidth:r.maxWidth};this.option({height:"100%",width:"100%",maxHeight:null,maxWidth:null}),o.css(e.extend({position:"fixed",left:0,top:0,margin:0},i.css));var s={scrollLeft:e(window).scrollLeft(),scrollTop:e(window).scrollTop(),cssText:a[0].style.cssText};a.css({height:0,width:0,overflow:"hidden",position:"static"}),e("html").css({overflow:"hidden"}),window.scrollTo(0,0),this._maxim={eleObj:l,docObj:s}}this._trigger("toggle",null,{state:t}),this._refreshResizable(),this.refresh(),e(window).trigger("resize",{$grid:o,state:t})},d._mouseCapture=function(t){var r=this.options;if(r.virtualX&&r.virtualY&&!r.scrollModel.smooth)return!1;if(!t.target)return!1;if(e(t.target).closest(".pq-grid")[0]==this.element[0]){var i=r.swipeModel;return 0!=i.on&&("touch"!=i.on||e.support.touch)}return!1},d._saveDims=function(){var t=(this.$cont,this.$tbl),r=this.$tbl_header;if(t)for(var i=0;iMath.abs(a)){if("flex"==t.width)return!0;o=!0,i=n/120}else if(l){if(!this.iRefresh.vscroll)return!0;i=l/120}else if(e.detail){if(!this.iRefresh.vscroll)return!0;i=-1*e.detail/3}i*=3;var s=o?r.hscroll:r.vscroll,d=parseInt(s.option("cur_pos")),c=parseInt(s.option("num_eles"));if(!t.scrollModel.smooth&&(o&&t.virtualX||!o&&t.virtualY)){i=i>0?Math[1>i?"ceil":"floor"](i):Math[-1>i?"ceil":"floor"](i);var h=d-i;if(0>h?h=0:h>c-1&&(h=c-1),h==d)return!0;s.option("cur_pos",d-i),s.scroll()}else{var u=s.option("ratio"),f=u-i/(c-1);if(f>1?f=1:0>f&&(f=0),u==f)return!0;s.option("ratio",f),s.drag()}return!1},d._onDblClickCell=function(t){var r=this,i=e(t.currentTarget),o=r.getCellIndices({$td:i}),n=o.rowIndxPage,a=r.rowIndxOffset,l=n+a,s=o.colIndx;return null!=s?0==r._trigger("cellDblClick",t,{$td:i,rowIndxPage:n,rowIndx:l,colIndx:s,column:r.colModel[s],rowData:r.pdata[n]})?!1:void(r.options.editModel.clicksToEdit>1&&this.isEditableRow({rowIndx:l})&&this.isEditableCell({colIndx:s,rowIndx:l})&&r.editCell({rowIndxPage:n,colIndx:s})):void 0},d._onClickCont=function(e){},d._onClickRow=function(t){var r=this,i=e(t.currentTarget),o=parseInt(i.attr("pq-row-indx")),n=r.rowIndxOffset,a=o+n;if(!isNaN(o)){this.options;return 0==r._trigger("rowClick",t,{$tr:i,rowIndxPage:o,rowIndx:a,rowData:r.pdata[o]})?!1:void 0}},d._onRightClickRow=function(t){var r=this,i=e(t.currentTarget),o=parseInt(i.attr("pq-row-indx")),n=r.rowIndxOffset,a=o+n;if(!isNaN(o)){this.options;return 0==r._trigger("rowRightClick",t,{$tr:i,rowIndxPage:o,rowIndx:a,rowData:r.pdata[o]})?!1:void 0}},d._onDblClickRow=function(t){var r=this,i=e(t.currentTarget),o=parseInt(i.attr("pq-row-indx")),n=r.getRowIndxOffset(),a=o+n;return 0==r._trigger("rowDblClick",t,{$tr:i,rowIndxPage:o,rowIndx:a,rowData:r.pdata[o]})?!1:void 0},d.getValueFromDataType=function(t,r,i){var o;if("date"==r)return o=Date.parse(t),isNaN(o)?"":i?o:t;if("object"==r)return t;if("integer"==r)o=parseInt(t);else{if("float"!=r)return"bool"==r?(o=e.trim(t).toLowerCase(),0==o.length?null:"true"==o||"yes"==o||"1"==o?!0:"false"==o||"no"==o||"0"==o?!1:Boolean(o)):e.trim(t);o=parseFloat(t)}return isNaN(o)||null==o?null==t?t:null:o};var c=function(e){this.that=e},h=c.prototype;h._isValidCell=function(e){var t=this.that,r=e.column,i=r.validations;if(!i||!i.length)return{valid:!0};var o=e.value,n=r.dataType,a=function(e){return t.getValueFromDataType(e,n,!0)},l=e.rowData;if(!l)throw"rowData required.";for(var s=0;s=p&&(u=!0);else if("nonEmpty"==h)null!=o&&""!==o&&(u=!0);else if("maxLen"==h)o=a(o),p=a(p),o.length<=p&&(u=!0);else if("gt"==h)o=a(o),p=a(p),o>p&&(u=!0);else if("gte"==h)o=a(o),p=a(p),o>=p&&(u=!0);else if("lt"==h)o=a(o),p=a(p),p>o&&(u=!0);else if("lte"==h)o=a(o),p=a(p),p>=o&&(u=!0);else if("neq"==h)o=a(o),p=a(p),o!==p&&(u=!0);else if("regexp"==h)new RegExp(p).test(o)&&(u=!0);else if("function"==typeof h){var g={column:r,value:o,rowData:l,msg:f},v=h.call(t,g);0==v?(u=!1,g.msg!=f&&(f=g.msg)):u=!0}else u=!0;if(!u)return{valid:!1,msg:f,column:r,warn:d.warn,dataIndx:r.dataIndx,validation:d}}}return{valid:!0}},h.isValidCell=function(t){var r=this.that,i=t.rowData,o=t.rowIndx,n=t.value,a=t.valueDef,l=t.column,s=t.focusInvalid,d=r.options,c=d.bootstrap,h=t.allowInvalid,u=l.dataIndx,f=d.validation,p=d.warning,g=d.editModel,v=g.invalidClass,w=g.warnClass,m=document.activeElement;if(t.checkEditable&&0==r.isEditableCell({rowIndx:o,dataIndx:u}))return{valid:!0};var x=this._isValidCell({column:l,value:n,rowData:i}),_=x.valid,I=x.warn,y=x.msg;if(_)r.data({rowData:i,dataIndx:u,data:"pq_valid"})&&(r.removeClass({rowData:i,rowIndx:o,dataIndx:u,cls:w+" "+v}),r.removeData({rowData:i,dataIndx:u,data:"pq_valid"}));else var b=e.extend({},I?p:f,x.validation),C=b.css,q=b.cls,M=b.icon,D=b.style;if(h||I)return _?{valid:!0}:(r.addClass({rowData:i,rowIndx:o,dataIndx:u,cls:I?w:v}),r.data({rowData:i,dataIndx:u,data:{pq_valid:{css:C,icon:M,style:D,msg:y,cls:q}}}),x);if(!_){if(null==o){var R=r.getRowIndx({rowData:i,dataUF:!0}),o=R.rowIndx;if(null==o||R.uf)return x.uf=R.uf,x}if(s){var P;if(a){if(e(m).hasClass("pq-editor-focus")){var T=d.editModel.indices;if(T){var k=T.rowIndx,S=T.dataIndx;if(null!=o&&o!=k)throw"incorrect usage of isValid rowIndx: "+o;if(u!=S)throw"incorrect usage of isValid dataIndx: "+u;r.editCell({rowIndx:k,dataIndx:u})}}}else{r.goToPage({rowIndx:o});var H={rowIndx:o,dataIndx:u},H=r.normalize(H);P=r.getCell(H),r["cell"==d.selectionModel.type?"setSelection":"scrollCell"](H),r.focus(H)}var E;if(P||(E=r.getEditCell())&&E.$cell){var $=P||E.$cell;$.attr("title",y);var V="tooltip",z="open";c.on&&c.tooltip&&(V=c.tooltip,z="show");try{$[V]("destroy")}catch(W){}$[V]({trigger:"manual",position:{my:"left center+5",at:"right center"},content:function(){var e=""==M?"":"";return e+y},open:function(e,t){var r=t.tooltip;if(q&&r.addClass(q),D){var i=r.attr("style");r.attr("style",i+";"+D)}C&&r.tooltip.css(C)}})[V](z)}}return x}if(a){var E=r.getEditCell();if(E&&E.$cell){var $=E.$cell;$.removeAttr("title");try{$.tooltip("destroy")}catch(W){}}}return{valid:!0}},d.isValid=function(e){return this.iIsValid.isValid(e)},h.isValid=function(e){e=e||{};var t=this.that,r=e.allowInvalid,i=e.focusInvalid,o=e.checkEditable,r=null==r?!1:r,n=e.dataIndx;if(null!=n){var a=t.columns[n],l=e.rowData||t.getRowData(e),s=e.hasOwnProperty("value"),d=s?e.value:l[n],c=this.isValidCell({rowData:l,checkEditable:o,rowIndx:e.rowIndx,value:d,valueDef:s,column:a,allowInvalid:r,focusInvalid:i});return c.valid||c.warn?{valid:!0}:c}if(null!=e.rowIndx||null!=e.rowIndxPage||null!=e.rowData){for(var l=e.rowData||t.getRowData(e),h=t.colModel,u=[],f=0,p=h.length;p>f;f++){var a=h[f],g=a.hidden;if(!g){var n=a.dataIndx,d=l[n],c=this.isValidCell({rowData:l,value:d,column:a,rowIndx:e.rowIndx,checkEditable:o,allowInvalid:r,focusInvalid:i});if(!c.valid&&!c.warn){if(!r)return c;u.push({rowData:l,dataIndx:n,column:a})}}}return r&&u.length?{cells:u,valid:!1}:{valid:!0}}var v=e.data?e.data:t.options.dataModel.data,u=[];if(!v)return null;for(var f=0,p=v.length;p>f;f++){var w,l=v[f];if(!o||(w=this.getRowIndx({rowData:l}).rowIndx,null!=w&&0!=t.isEditableRow({rowData:l,rowIndx:w}))){var m=this.isValid({rowData:l,rowIndx:w,checkEditable:o,allowInvalid:r,focusInvalid:i}),x=m.cells;if(r===!1){if(!m.valid)return m}else x&&x.length&&(u=u.concat(x))}}return r&&u.length?{cells:u,valid:!1}:{valid:!0}},d.isValidChange=function(e){e=e||{};var t=this.getChanges(),r=t.addList,i=t.updateList,o=i.concat(r);return e.data=o,this.isValid(e)},d.isEditableRow=function(e){var t=this.options,r=t.editable;return null!=r?"function"==typeof r?r.call(this,this.normalize(e)):r:!0},d.isEditableCell=function(e){var t=this.normalize(e),r=(t.rowIndx,t.colIndx,this.iMerge,t.column),i=r.editable;return t.checkVisible&&r.hidden?!1:null!=i?"function"==typeof i?i.call(this,t):i:!0},d._onContMouseDown=function(t){this.blurEditor({blurIfFocus:!0});var r=this;if(r._trigger("contMouseDown",t,null)===!1)return!1;var i=e(t.target),o=i.closest(".pq-grid-cell,.pq-grid-number-cell"),n=i.closest(".pq-grid-row");if(!o.length&&!n.length){var a=this.$cont[0];a.setAttribute("tabindex",0),a.focus()}return!0},d._onCellMouseDown=function(t){var r,i=this,o=e(t.currentTarget),n=i.getCellIndices({$td:o});if(null!=n.rowIndx)return n=this.iMerge.getRootCell(n.rowIndx,n.colIndx,"o"),r=i.normalize(n),r.$td=o,0!=i._trigger("cellMouseDown",t,r)},d._onRowMouseDown=function(t){var r=this,i=e(t.currentTarget),o=r.getRowIndx({$tr:i});return o.$tr=i,0!=r._trigger("rowMouseDown",t,o)},d._onCellMouseEnter=function(e,t){var r=t,i=this.options,o=this.getCellIndices({$td:r}),n=this;if(null!=o.rowIndx&&null!=o.colIndx)return n._trigger("cellMouseEnter",e,o)===!1?!1:("cell"==i.hoverMode&&n.highlightCell(r),!0)},d._onRowMouseEnter=function(e,t){var r=t,i=this.options,o=this,n=o.getRowIndx({$tr:r}),a=n.rowIndxPage;return o._trigger("rowMouseEnter",e,n)===!1?!1:("row"==i.hoverMode&&o.highlightRow(a),!0)},d._onCellMouseLeave=function(e,t){var r=t,i=this;return"cell"==i.options.hoverMode&&i.unHighlightCell(r),!0},d._onRowMouseLeave=function(e,t){var r=t,i=this,o=i.getRowIndx({$tr:r}),n=o.rowIndxPage;return"row"==i.options.hoverMode&&i.unHighlightRow(n),!0},d.enableSelection=function(){this.element.removeClass("pq-disable-select").off("selectstart"+this.eventNamespace)},d.disableSelection=function(){this.element.addClass("pq-disable-select").on("selectstart"+this.eventNamespace,function(t){var r=t.target;if(r){var i=e(t.target);return i.is("input,textarea,select")?!0:i.closest(".pq-native-select").length?!0:void t.preventDefault()}})},d._onClickCell=function(t){var r=this,i=this.options,o=i.editModel,n=e(t.currentTarget),a=r.getCellIndices({$td:n}),l=this.iMerge.getRootCell(a.rowIndx,a.colIndx,"o"),s=this.normalize(l),d=s.rowIndx,c=s.colIndx;return s.$td=n,s.evt=t,0==r._trigger("cellClick",t,s)?!1:void(null==c||0>c||1==o.clicksToEdit&&this.isEditableRow({rowIndx:d})&&this.isEditableCell({colIndx:c,rowIndx:d})&&r.editCell(s))},d._onRightClickCell=function(t){var r=e(t.currentTarget),i=this.getCellIndices({$td:r}),o=this,n=i.rowIndxPage,a=this.rowIndxOffset,l=n+a,s=i.colIndx,d=this.colModel,c=this.options;c.DM;if(null!=s){var h=d[s],u=h.dataIndx;return 0==this._trigger("cellRightClick",t,{$td:r,rowIndxPage:n,rowIndx:l,colIndx:s,dataIndx:u,column:h,rowData:o.pdata[n]})?!1:void 0}},d.highlightCell=function(e){ e.addClass("pq-grid-cell-hover ui-state-hover")},d.unHighlightCell=function(e){e.removeClass("pq-grid-cell-hover ui-state-hover")},d.highlightRow=function(e){if(isNaN(e));else{var t=this.getRow({rowIndxPage:e});t&&t.addClass("pq-grid-row-hover ui-state-hover")}},d.unHighlightRow=function(e){if(isNaN(e));else{var t=this.getRow({rowIndxPage:e});t&&t.removeClass("pq-grid-row-hover ui-state-hover")}},d._getCreateEventData=function(){return{dataModel:this.options.dataModel,data:this.pdata,colModel:this.options.colModel}},d._findCellFromEvt=function(t){var r=e(t.target),i=r.closest(".pq-grid-cell");if(null==i||0==i.length)return{rowIndxPage:null,colIndx:null,$td:null};var o=this.getCellIndices({$td:i});return o.$td=i,o},d._initPager=function(){var t=this,r=t.options,i=r.pageModel;if(i.type){var o={bootstrap:r.bootstrap,change:function(e,r){t.blurEditor({force:!0});var i=t.options.pageModel;void 0!=r.curPage&&(i.prevPage=i.curPage,i.curPage=r.curPage),void 0!=r.rPP&&(i.rPP=r.rPP),"remote"==i.type?t.remoteRequest({callback:function(){t._onDataAvailable({apply:!0,header:!1})}}):t.refreshView({header:!1,source:"pager"})},refresh:function(e){t.refreshDataAndView()}};o=e.extend(o,i),this.pagerW=pq.pager(i.appendTo?i.appendTo:this.$footer,o)}},d.generateLoading=function(){this.$loading&&this.$loading.remove(),this.$loading=e("
").appendTo(this.element),e(["
",this.options.strLoading,"...
"].join("")).appendTo(this.$loading),this.$loading.find("div.pq-loading-bg").css("opacity",.2)},d._refreshLoadingString=function(){this.$loading.find("div.pq-loading-mask").children("div").html(this.options.strLoading)},d.showLoading=function(){null==this.showLoadingCounter&&(this.showLoadingCounter=0),this.showLoadingCounter++,this.$loading.show()},d.hideLoading=function(){this.showLoadingCounter>0&&this.showLoadingCounter--,this.showLoadingCounter||this.$loading.hide()},d.refreshDataFromDataModel=function(e){e=e||{};var t,r,i,o,n,a=this,l=a.options,s=l.dataModel,d=l.pageModel,c=s.data,h=d.type,u=a._queueATriggers;for(var f in u){var p=u[f];delete u[f],a._trigger(f,p.evt,p.ui)}if(a._trigger("beforeRefreshData",null,{}),"local"==h)o=d.totalRecords=c.length,d.totalPages=i=Math.ceil(o/d.rPP),d.curPage>i&&(d.curPage=i),i&&!d.curPage&&(d.curPage=1),t=(d.curPage-1)*d.rPP,t=t>=0?t:0,r=d.curPage*d.rPP,r>c.length&&(r=c.length),a.pdata=c.slice(t,r),n=t;else if("remote"==h){d.totalPages=i=Math.ceil(d.totalRecords/d.rPP),d.curPage>i&&(d.curPage=i),i&&!d.curPage&&(d.curPage=1);var r=d.rPP;r>c.length&&(r=c.length),a.pdata=c.slice(0,r),n=d.rPP*(d.curPage-1)}else l.backwardCompat?a.pdata=c.slice(0):a.pdata=c;a.rowIndxOffset=n>=0?n:0,a._trigger("dataReady",null,{source:e.source})},d.getQueryStringCRUD=function(){return""},d.remoteRequest=function(t){this.loading&&this.xhr.abort(),t=t||{};var r=this,i="",o="",n=this.options,a=!1,l=this.colModel,s=n.dataModel,d=n.sortModel,c=n.filterModel,h=n.pageModel;if("function"==typeof s.getUrl){var u={colModel:l,dataModel:s,sortModel:d,groupModel:n.groupModel,pageModel:h,filterModel:c},f=s.getUrl.call(this,u);f&&f.url&&(i=f.url),f&&f.data&&(o=f.data)}else if("string"==typeof s.url){i=s.url;var p={},g={},v={};if("remote"==d.type){t.initBySort||this.sort({initByRemote:!0});var w=this.iSort.getQueryStringSort();w&&(p={pq_sort:w})}"remote"==h.type&&(v={pq_curpage:h.curPage,pq_rpp:h.rPP});var m;"local"!=c.type&&(m=this.iFilterData.getQueryStringFilter(),m&&(a=!0,g={pq_filter:m}));var x=s.postData,_=s.postDataOnce;x&&"function"==typeof x&&(x=x.call(this,{colModel:l,dataModel:s})),o=e.extend({pq_datatype:s.dataType},g,v,p,x,_)}i&&(this.loading=!0,this.showLoading(),this.xhr=e.ajax({url:i,dataType:s.dataType,async:null==s.async?!0:s.async,cache:s.cache,contentType:s.contentType,type:s.method,data:o,beforeSend:function(e,t){return"function"==typeof s.beforeSend?s.beforeSend.call(r,e,t):void 0},success:function(e,i,o){r.onRemoteSuccess(e,i,o,a,t)},error:function(e,t,i){if(r.hideLoading(),r.loading=!1,"function"==typeof s.error)s.error.call(r,e,t,i);else if("abort"!=i)throw"Error : "+i}}))},d.onRemoteSuccess=function(e,t,r,i,o){var n,a=this,l=a.options,s=a.colModel,d=l.pageModel,c=l.dataModel;n="function"==typeof c.getData?c.getData.call(a,e,t,r):e,c.data=n.data,"remote"==d.type&&(null!=n.curPage&&(d.curPage=n.curPage),null!=n.totalRecords&&(d.totalRecords=n.totalRecords)),a.hideLoading(),a.loading=!1,a._trigger("load",null,{dataModel:c,colModel:s}),i&&(a._queueATriggers.filter={ui:{}}),o.callback&&o.callback()},d._refreshTitle=function(){this.$title.html(this.options.title)},d._destroyDraggable=function(){var e=this.element,t=e.parent(".pq-wrapper");t.length&&t.data("draggable")&&(t.draggable("destroy"),this.$title.removeClass("pq-draggable pq-no-capture"),e.unwrap(".pq-wrapper"))},d._refreshDraggable=function(){var e=this.options,t=this.element,r=this.$title;if(e.draggable){r.addClass("pq-draggable pq-no-capture");var i=t.parent(".pq-wrapper");i.length||t.wrap("
"),t.parent(".pq-wrapper").draggable({handle:r})}else this._destroyDraggable()},d._refreshResizable=function(){var t=this,r=this.element,i=this.options,o=(i.width+"").indexOf("%")>-1,n=(i.height+"").indexOf("%")>-1,a="auto"==i.width,l="flex"==i.width,s="flex"==i.height;if(!i.resizable||(s||n)&&(l||o||a))this._destroyResizable();else{var d="e,s,se";s||n?d="e":(l||o||a)&&(d="s");var c=!0;if(r.hasClass("ui-resizable")){var h=r.resizable("option","handles");d==h?c=!1:this._destroyResizable()}c&&r.resizable({helper:"ui-state-default",handles:d,minWidth:i.minWidth,minHeight:i.minHeight?i.minHeight:100,delay:0,start:function(t,r){e(r.helper).css({opacity:.5,background:"#ccc",border:"1px solid steelblue"})},resize:function(e,t){},stop:function(r,o){var n=t.element,a=n[0],l=i.width,s=i.height,d=(l+"").indexOf("%")>-1,c=(s+"").indexOf("%")>-1,h="auto"==l,u="flex"==l,f="flex"==s,p=!1;a.style.width=a.offsetWidth+3+"px",a.style.height=a.offsetHeight+3+"px",c||f||(p=!0,i.height=a.offsetHeight),d||h||u||(p=!0,i.width=a.offsetWidth),t.refresh(),n.css("position","relative"),p&&e(window).trigger("resize")}})}},d._refreshAfterResize=function(){var e=this.options,t=e.width,r=e.height,i=-1!=(t+"").indexOf("%"),o="auto"===t,n=-1!=(r+"").indexOf("%");(i||o||n)&&this.refresh()},d.refresh=function(e){this.iRefresh.refresh(e)},d.refreshView=function(e){null!=this.options.editModel.indices&&this.blurEditor({force:!0}),this.refreshDataFromDataModel(e),this.refresh(e)},d._refreshPager=function(){var e=this.options,t=e.pageModel,r=!!t.type,i=t.rPP,o=t.totalRecords;if(r){var n=e.pageModel;this.pagerW||this._initPager(),this.pagerW.option(n),o>i?this.$bottom.css("display",""):e.showBottom||this.$bottom.css("display","none")}else this.pagerW&&(this.pagerW.destroy(),this.pagerW=null),e.showBottom?this.$bottom.css("display",""):this.$bottom.css("display","none")},d.getInstance=function(){return{grid:this}},d.refreshDataAndView=function(e){var t=this.options.dataModel;if("remote"==t.location){var r=this;this.remoteRequest({callback:function(){r._onDataAvailable(e)}})}else this._onDataAvailable(e)},d.getColIndx=function(e){var t,r,i,o=e.dataIndx,n=e.column;if(n)r=!0;else{if(void 0===o)throw"dataIndx / column NA";i=!0}var a=this.colModel,l=a.length;if(r){for(var s=0;l>s;s++)if(a[s]==n)return s}else if(t=this.colIndxs[o],null!=t)return t;return-1},d.getColumn=function(e){if(null==e.dataIndx)throw"dataIndx N/A";return this.columns[e.dataIndx]},d._generateCellRowOutline=function(){var t=this.options,r=t.editModel;if(this.$div_focus){if(t.debug)throw"this.$div_focus already present assert failed"}else{var i=this.element;r.inline&&(i=this.getCell(r.indices),i.css("padding",0).empty()),this.$div_focus=e(["
","
","
","
"].join("")).appendTo(i);var o=e.extend({all:!0},r.indices),n=this.getCell(o);n.css("height",n[0].offsetHeight),n.empty(),this.refreshEditorPos()}},d._removeEditOutline=function(t){function r(e){e.hasClass("hasDatepicker")&&e.datepicker("hide").datepicker("destroy")}if(this.$div_focus){var i=this.$div_focus.find(".pq-editor-focus");if(r(i),i[0]==document.activeElement){var o=this._blurEditMode;this._blurEditMode=!0,i.blur(),this._blurEditMode=o}this.$div_focus.remove(),delete this.$div_focus;var n=this.options.editModel,a=e.extend({},n.indices);n.indices=null,a.rowData=void 0,this.refreshCell(a)}},d.refreshEditorPos=function(){var e=this.options,t=e.editModel,r=t.cellBorderWidth,i=this.$div_focus,o=this.getCell(t.indices);if(!o||!o.length)return!1;var n=o[0].offsetWidth,a=o[0].offsetHeight,l=this.element.offset(),s=o.offset(),d=s.left-l.left-1,c=s.top-l.top-1;i.css({height:a,width:n-1,borderWidth:r,left:d,top:c})},d.setEditorPosTimer=function(){var e=this,t=this.options;this._refreshEditorPosTimer&&(window.clearInterval(this._refreshEditorPosTimer),this._refreshEditorPosTimer=null),this._refreshEditorPosTimer=window.setInterval(function(){var r=t.editModel;r.indices&&e.refreshEditorPos()},200)},d.get$Tbl=function(t,r){var i=this.$tbl,o=[];if(i&&i.length){var n=this.pqpanes,a=this.options,l=a.freezeRows,s=a.freezeCols;return n.h&&n.v?null==r?t>=l?o.push(i[2],i[3]):o.push(i[0],i[1]):o=r>=s&&t>=l?i[3]:s>r&&t>=l?i[2]:r>=s&&l>t?i[1]:i[0]:o=n.v?null==r?i:r>=s?i[1]:i[0]:n.h&&t>=l?i[1]:i[0],o?e(o):void 0}},d.scrollCell=function(e){this.scrollRow(e),this.scrollColumn(e)},d.scrollY=function(e){this.vscroll.option("cur_pos",e),this.vscroll.scroll()},d.scrollRow=function(e){var t=this.options,e=this.normalize(e),r=e.rowIndxPage,i=e.rowData;return!this.pdata||r>=this.pdata.length?!1:!i||i.pq_hidden?!1:void(t.virtualY?this._scrollRowVirtual(e):this.iMouseSelection.scrollRowNonVirtual(e))},d._scrollRowVirtual=function(e){var t=this.options,r=e.rowIndxPage,i=!!this.iHierarchy,o=e.rowIndx,n=this.vscroll,a=this.scrollCurPos,r=null==r?o-this.rowIndxOffset:r,l=parseInt(t.freezeRows);if(!(l>r)){var s=this._calcCurPosFromRowIndxPage(r);if(null!=s){a>s&&(n.option("cur_pos",s),n.scroll());var d=this.get$Tbl(r);if(!d||!d.length)return null;var c=d.children("tbody").children("tr[pq-row-indx="+r+"]"),h=c.last(),u=h;c.length>1&&(u=c.first());var f=h[0],p=parseInt(d.css("marginTop"));if(void 0==f)n.option("cur_pos",s),n.scroll();else{var g=f.offsetTop+f.offsetHeight,v=this.iRefresh.getEContHt(),w=p,m=this._getSBHeight(),x=u.prev("tr");if(x.hasClass("pq-row-hidden")||x.hasClass("pq-last-frozen-row"))return;if(g>v-w){var _,I=g-(v-m-w),c=d.children().children("tr"),y=0,b=0;for(l?(_=c.filter("tr.pq-last-frozen-row").last().next(),0==_.length&&(_=c.filter("tr.pq-row-hidden").next())):_=c.filter("tr.pq-row-hidden").next();;){if(!_.length)break;if(y+=_[0].offsetHeight,_[0]==h[0])break;if(i&&0!=_.hasClass("pq-detail-child")){if(y>=I)break}else if(b++,y>=I)break;_=_.next()}var C=a+b;C>s&&(C=s);var q=n.option("num_eles");C+1>q&&(q=C+1),n.option({num_eles:q,cur_pos:C}),n.scroll()}}}}},d.blurEditor=function(e){if(this.$div_focus){var t=this.$div_focus.find(".pq-editor-focus");if(!e||!e.blurIfFocus)return t.triggerHandler("blur",e);document.activeElement==t[0]&&t.blur()}},d._scrollColumnVirtual=function(e){var t=e.colIndx,r=this.hscroll,t=null==t?this.colIndxs[e.dataIndx]:t,i=this.options.freezeCols,o=this._calcRightEdgeCol(t).width,n=this.iRefresh.getEContWd();if(o>n){for(var a=this.calcWidthCols(-1,t+1)-n,l=this.colModel,s=l.length,d=0,c=0,h=i;s>h;h++){var u=l[h];if(u.hidden||(d+=u.outerWidth),h==t){c=h-i-this._calcNumHiddenUnFrozens(h);break}if(d>=a){c=h-i-this._calcNumHiddenUnFrozens(h)+1;break}}return r.option("cur_pos",c),r.scroll(),!0}if(t>=i&&tr||0>o||o>=this.colModel.length?!1:(this.goToPage(e),i=r-this.rowIndxOffset,this.scrollRow({rowIndxPage:i}),null==o?this.range({r1:r}).select():(this.scrollColumn({colIndx:o}),this.range({r1:r,c1:o}).select()),void(e.focus!==!1&&this.focus({rowIndxPage:i,colIndx:null==o?this.getFirstVisibleCI():o})))},d.getColModel=function(){return this.colModel},d.saveEditCell=function(t){var r=this.options,i=r.editModel;if(!i.indices)return null;var o,n=e.extend({},i.indices),a=t?t.evt:null,l=this.rowIndxOffset,s=n.colIndx,d=n.rowIndxPage,c=d+l,h=this.colModel,u=h[s],f=u.dataIndx,p=this.pdata,g=p[d],v=r.dataModel;if(null==g)return null;if(null!=d){var w=this.getEditCellData();if(e.isPlainObject(w)){o={};for(var m in w)o[m]=g[m]}else o=this.readCell(g,u);"
"==w&&(w=""),null==o&&""===w&&(w=null);var x={rowIndx:c,rowIndxPage:d,dataIndx:f,column:u,newVal:w,value:w,oldVal:o,rowData:g,dataModel:v};if(this._trigger("cellBeforeSave",a,x)===!1)return!1;var _={},I=!1;e.isPlainObject(w)?(_=w,I=!0):_[f]=w;var y=this.updateRow({row:_,rowIndx:c,refresh:I,silent:!0,source:"edit",checkEditable:!1});return y===!1?!1:(this._trigger("cellSave",a,x),!0)}},d._addInvalid=function(e){},d._digestData=function(e){if(this._trigger("beforeValidate",null,e)===!1)return!1;var t=this,r=t.options,i=r.editModel,o=r.dataModel,n=o.data,a=r.colModel,l=r.pageModel,s=r.historyModel,d=e.validate,d=null==d?i.validate:d,c="remote"==l.type,h=e.allowInvalid,h=null==h?i.allowInvalid:h,u=r.trackModel,f=e.track,f=null==f?null==r.track?u.on:r.track:f,p=e.history,p=null==p?s.on:p,g=this.iHistory,v=this.iUCData,w=e.checkEditable,w=null==w?!0:w,m=e.checkEditableAdd,m=null==m?w:m,x=this.saveCell,_=this.columns,I=this.colIndxs,y=e.source,b=this.rowIndxOffset,C=t.getValueFromDataType,q=e.rowList,M=q.length;n||(n=r.dataModel.data=[]);for(var D=[],R=0;M>R;R++){var P=q[R],T=P.newRow,k=P.rowData,S=P.type,H=P.checkEditable,E=P.rowIndx,$=P.oldRow;if(null==H&&("update"==S?H=w:"add"==S&&(H=m)),"update"==S){if(!$)throw"oldRow required while update";if(H&&r.editable!==!0&&t.isEditableRow({rowIndx:E,rowData:k})===!1)continue}else if("delete"==S){D.push(P);continue}if("add"==S)for(var V=0,z=a.length;z>V;V++){var W=a[V],L=W.dataIndx;T[L]=T[L]}for(var L in T){var W=_[L],A=I[L];if(W){if(H&&null!=W.editable&&t.isEditableCell({rowIndx:E,colIndx:A,dataIndx:L})===!1){delete T[L],$&&delete $[L];continue}var F=W.dataType,O=C(T[L],F),N=$?$[L]:void 0,N=void 0!==N?C(N,F):void 0;if(T[L]=O,d&&W.validations)if("edit"==y&&h===!1){var j=this.isValid({focusInvalid:!0,dataIndx:L,rowIndx:E,value:O});if(0==j.valid&&!j.warn)return!1}else{var B="add"==S?T:k,j=this.iIsValid.isValidCell({column:W,rowData:B,allowInvalid:h,value:O});j.valid===!1&&(h!==!1||j.warn||delete T[L])}if("update"==S&&O===N){delete T[L],$&&delete $[L];continue}}}if(T)if("update"==S)for(var L in T){D.push(P);break}else D.push(P)}if(q=e.rowList=D,M=q.length,!M)return"edit"==y?null:!1;p&&(g.increment(),g.push({rowList:q}));for(var R=0;M>R;R++){var P=q[R],S=P.type,T=P.newRow,E=P.rowIndx,G=P.rowIndxPage,k=P.rowData;if("update"==S){f&&v.update({rowData:k,row:T,refresh:!1});for(var L in T){var W=_[L],O=T[L];x(k,W,O)}}else if("add"==S){if(f&&v.add({rowData:T}),null==E&&null==G)n.push(T);else{var G=E-b,U=c?G:E;n.splice(U,0,T)}c&&l.totalRecords++}else if("delete"==S){var K=t.getRowIndx({rowData:k,dataUF:!0}),Q=K.uf,E=K.rowIndx;f&&v["delete"]({rowIndx:E,rowData:k});var G=E-b,U=c?G:E;if(Q)o.dataUF.splice(E,1);else{var X=n.splice(U,1);X&&X.length&&c&&l.totalRecords--}}}return t._trigger("change",null,e),!0},d.refreshColumn=function(e){var t=this.normalize(e),r=this.initV,i=this.finalV,o=this.options.freezeRows,n=t.colIndx,a=t.dataIndx,l=t.column;t.skip=!0;for(var s=0;i>=s;s++)r>s&&s>=o&&(s=r),t.rowIndxPage=s,this.refreshCell(t);this._trigger("refreshColumn",null,{column:l,colIndx:n,dataIndx:a}),this.iRefresh.softRefresh()},d.refreshCell=function(e){var t=this.normalize(e);if(this.pdata){var r=t.skip,i=t.rowIndx,o=t.rowIndxPage,n=t.colIndx,a=this.iMerge,l=t.rowData;if(l){var s=this.getCell({all:!0,rowIndxPage:o,colIndx:n});if(s&&s.length>0){var d=t;a.ismergedCell(i,n)&&(d=a.getRootCell(i,n,"a"));var c,h=this.iGenerateView.renderCell(d);if(!h)return;s.replaceWith(h),(c=this._focusElement)&&c.rowIndxPage==o&&this.focus(),r||(this._trigger("refreshCell",null,t),this.iRefresh.softRefresh())}}}},d.refreshRow=function(t){var r=this.normalize(t);if(this.pdata){var i=this,o=r.rowIndx,n=r.rowIndxPage,a=i.options,l=a.freezeRows,s=r.rowData;if(!s||s.pq_hidden||n>i.finalV||n=l)return null;var d,c=this.getRow({all:!0,rowIndxPage:n}),h=[];i.iGenerateView.refreshRow(n,h);var u=h.join("");if(c&&c.length)c.replaceWith(u);else{if(!a.virtualY)return!1;if(n==i.finalV)i.$tbl.append(u);else{if(n!=i.initV)throw"refreshRow > rip not found";for(var f=i.$tbl,p=0;p=s.length)return!1;var d=this.options,c=d.editModel,h=s[a],u=r.rowIndx,f=this.colModel,p=f[l],g=p.dataIndx,v=i.readCell(h,p),w={rowIndx:u,rowIndxPage:a,cellData:v,rowData:h,dataIndx:g,colIndx:l,column:p},m=p.editor,x=this,m="function"==typeof m?m.call(x,w):m;if(void 0===m&&"function"==typeof d.geditor&&(m=d.geditor.call(x,w)),m!==!1){m&&m.getData&&(c._getData=m.getData);var _=d.editor,I=m?e.extend({},_,m):_,y=!1;if(c.indices){var b=c.indices;if(b.rowIndxPage==a&&b.colIndx==l){this.refreshEditorPos();var C=this.$div_focus.find(".pq-editor-focus");return window.setTimeout(function(){C.focus()},0),!1}if(this.blurEditor({evt:n})===!1)return!1;this.quitEditMode({evt:n})}c.indices={rowIndxPage:a,rowIndx:u,colIndx:l,column:p,dataIndx:g},this._generateCellRowOutline();var q=this.$div_focus,M=q.children(".pq-editor-inner");"right"==p.align?M.addClass("pq-align-right"):"center"==p.align?M.addClass("pq-align-center"):M.addClass("pq-align-left"),w.$cell=M;var D,R=I.type,P=null==r.select?I.select:r.select,T=I.init,k=I.valueIndx,S=I.dataMap,H=I.mapIndices,H=H?H:{},E=I.cls||"",E="function"==typeof E?E.call(x,w):E,$="pq-editor-focus "+E,V=$+" pq-cell-editor ",z=I.attr||"",z="function"==typeof z?z.call(x,w):z,W=I.style||"",W="function"==typeof W?W.call(x,w):W,L=W?"style='"+W+"'":"",A=L,F=L;if(w.cls=$,w.attr=z,"function"==typeof R&&(D=R.call(x,w),D&&(R=D)),_._type=R,"checkbox"==R){var O=I.subtype,N=v?"checked='checked'":"";D="",M.html(D);var j=M.children("input");"triple"==O&&(j.pqval({val:v}),M.click(function(t){e(this).children("input").pqval({incr:!0})}))}else if("textarea"==R||"select"==R||"textbox"==R){if("textarea"==R)D="";else if("select"==R){var B=I.options||[];"function"==typeof B&&(B=B.call(x,w));var G=[z," class='",V,"' ",A," name='",g,"'"].join("");D=o.select({options:B,attr:G,prepend:I.prepend,labelIndx:I.labelIndx,valueIndx:k,groupIndx:I.groupIndx,dataMap:S})}else D="";e(D).appendTo(M).val("select"==R&&null!=k&&(H[k]||this.columns[k])?H[k]?h[H[k]]:h[k]:v)}else R&&"contenteditable"!=R||(D="
",M.html(D),M.children().html(v),y=!0);"function"==typeof T&&T.call(x,w);var i=this,C=M.children(".pq-editor-focus"),U=c.filterKeys,K=p.editModel;K&&void 0!==K.filterKeys&&(U=K.filterKeys);var Q={$cell:M,$editor:C,dataIndx:g,column:p,colIndx:l,rowIndx:u,rowIndxPage:a,rowData:h};if(c.indices=Q,C.data({FK:U}).on("click",function(t){e(this).focus()}).on("keydown",function(e){i.iKeyNav._keyDownInEdit(e)}).on("keypress",function(e){return i.iKeyNav._keyPressInEdit(e,{FK:U})}).on("keyup",function(e){return i.iKeyNav._keyUpInEdit(e,{FK:U})}).on("blur",function(t,r){var o=i.options,n=o.editModel,a=n.onBlur,l="save"==a,s="validate"==a,d=n.cancelBlurCls,c=r?r.force:!1;if(!i._quitEditMode&&!i._blurEditMode&&n.indices){var h=e(t.target);if(!c){if(i._trigger("editorBlur",t,Q)===!1)return;if(!a)return;if(d&&h.hasClass(d))return;if(h.hasClass("hasDatepicker")){var u=h.datepicker("widget");if(u.is(":visible"))return!1}else if(h.hasClass("ui-autocomplete-input")){if(h.autocomplete("widget").is(":visible"))return}else if(h.hasClass("ui-multiselect")){if(e(".ui-multiselect-menu").is(":visible")||e(document.activeElement).closest(".ui-multiselect-menu").length)return}else if(h.hasClass("pq-select-button")&&(e(".pq-select-menu").is(":visible")||e(document.activeElement).closest(".pq-select-menu").length))return}i._blurEditMode=!0;var f=c||l||!s;if(!i.saveEditCell({evt:t,silent:f})&&!c&&s)return i._deleteBlurEditMode(),!1;i.quitEditMode({evt:t}),i._deleteBlurEditMode()}}).on("focus",function(e){i._trigger("editorFocus",e,Q)}),i._trigger("editorBegin",n,Q),C.focus(),window.setTimeout(function(){var t=e(document.activeElement);if(t.hasClass("pq-editor-focus")===!1){var r=i.element?i.element.find(".pq-editor-focus"):e();r.focus()}},0),P)if(y)try{var X=C[0],Y=document.createRange();Y.selectNodeContents(X);var J=window.getSelection();J.removeAllRanges(),J.addRange(Y)}catch(Z){}else C.select()}},d._deleteBlurEditMode=function(e){var t=this,e=e?e:{};t._blurEditMode&&(e.timer?window.setTimeout(function(){delete t._blurEditMode},0):delete t._blurEditMode)},d.getRow=function(t){var r=this.normalize(t),i=r.rowIndxPage,o=r.all?this.$tbl:this.get$Tbl(i),n=e();if(o&&o.length){var a=o.children("tbody");null!=i&&(n=a.children("tr[pq-row-indx="+i+"]"),n.length>o.length&&(n=n.filter(".pq-detail-master")))}return n},d.getCell=function(t){var r=t.all,i=this.options,o=this.normalize(t),n=o.rowIndxPage,a=o.rowIndx,l=o.colIndx,s=this.iMerge,d=s.ismergedCell(a,l);if(d){var c=s.getRootCell(a,l,"a"),h=s.getRootCell(a,l,"o");if(!(n===h.rowIndxPage&&l===h.colIndx||n===c.rowIndxPage&&l===c.colIndx))return e();n=c.rowIndxPage,l=h.colIndx}else{if(n>=i.freezeRows&&(nthis.finalV)||l>=i.freezeCols&&(lthis.finalH))return e();if(!o.rowData||!o.column||o.rowData.pq_hidden||o.column.hidden)return e()}var u,f=r?this.$tbl:this.get$Tbl(n,l);return u=f&&f.length?f.children().children("tr[pq-row-indx="+n+"]").children("[pq-col-indx="+l+"]"):e()},d.getCellHeader=function(t){var r,i=t.colIndx,o=t.dataIndx,i=null==i?this.colIndxs[o]:i,n=this.$tbl_header,a=this.options,l=a.freezeCols;if(n){n.length>1&&(n=e(i>=l?n[1]:n[0]));var r=n.find("[pq-col-indx="+i+"].pq-grid-col-leaf");return r}return e()},d.getEditorIndices=function(){var t=this.options.editModel.indices;return t?e.extend({},t):null},d.getEditCellData=function(){var t=this.options,r=t.editModel,i=r.indices;if(!i)return null;var o,n=i.colIndx,a=i.rowIndxPage,l=i.rowIndx,s=this.colModel[n],d=s.editor,c=t.editor,h=d?e.extend({},c,d):c,u=h.valueIndx,f=h.labelIndx,p=h.mapIndices,p=p?p:{},g=s.dataIndx,v=this.$div_focus,w=v.children(".pq-editor-inner"),m=r._getData||h.getData;if(r._getData=void 0,"function"==typeof m)o=m.call(this,{$cell:w,rowData:i.rowData,dataIndx:g,rowIndx:l,rowIndxPage:a,column:s,colIndx:n});else{var x=c._type;if("checkbox"==x){var _=w.children();o="triple"==h.subtype?_.pqval():!!_.is(":checked")}else if("contenteditable"==x)o=w.children().html();else{var I=w.find('*[name="'+g+'"]');if(I&&I.length)if("select"==x&&null!=u)if(p[u]||this.columns[u]){o={},o[p[u]?p[u]:u]=I.val(),o[p[f]?p[f]:f]=I.find("option:selected").text();var y=h.dataMap;if(y){var b=I.find("option:selected").data("map");if(b)for(var C=0;C=0&&(n=this.colModel[a].dataIndx)),this.iMerge.getRootCell(r,a,"o")},d.getRowsByClass=function(e){var t=this.options,r=t.dataModel,i=t.pageModel,o="remote"==i.type,n=this.rowIndxOffset,a=r.data,l=[];if(null==a)return l;for(var s=0,d=a.length;d>s;s++){var c=a[s];if(c.pq_rowcls&&(e.rowData=c,this.hasClass(e))){var h={rowData:c},u=o?s+n:s,f=u-n;h.rowIndx=u,h.rowIndxPage=f,l.push(h)}}return l},d.getCellsByClass=function(e){var t=this,r=this.options,i=r.dataModel,o=r.pageModel,n="remote"==o.type,a=this.rowIndxOffset,l=i.data,s=[];if(null==l)return s;for(var d=0,c=l.length;c>d;d++){var h=l[d],u=n?d+a:d,f=h.pq_cellcls;if(f)for(var p in f){var g={rowData:h,rowIndx:u,dataIndx:p,cls:e.cls};if(t.hasClass(g)){var v=t.normalize(g);s.push(v)}}}return s},d.data=function(t){var r=t.dataIndx,i=t.colIndx,r=null!=i?this.colModel[i].dataIndx:r,o=t.data,n=null==o||"string"==typeof o,a=t.rowData||this.getRowData(t);if(!a)return{data:null};if(null==r){var l=a.pq_rowdata;if(n){var s;return null!=l&&(s=null==o?l:l[o]),{data:s}}var d=e.extend(!0,a.pq_rowdata,o);a.pq_rowdata=d}else{var c=a.pq_celldata;if(n){var s;if(null!=c){var h=c[r];s=null==o||null==h?h:h[o]}return{data:s}}c||(a.pq_celldata={});var d=e.extend(!0,a.pq_celldata[r],o);a.pq_celldata[r]=d}},d.attr=function(t){var r=t.rowIndx,i=t.dataIndx,o=t.colIndx,i=null!=o?this.colModel[o].dataIndx:i,n=t.attr,a=null==n||"string"==typeof n,l=this.rowIndxOffset,s=t.refresh,d=t.rowData||this.getRowData(t);if(!d)return{attr:null};if(a||s===!1||null!=r||(r=this.getRowIndx({rowData:d}).rowIndx),null==i){var c=d.pq_rowattr;if(a){var h;return null!=c&&(h=null==n?c:c[n]),{attr:h}}var f=e.extend(!0,d.pq_rowattr,n);if(d.pq_rowattr=f,s!==!1&&null!=r){var p=this.getRow({rowIndxPage:r-l});if(p){var g=u(f);p.attr(g)}}}else{var v=d.pq_cellattr;if(a){var h;if(null!=v){var w=v[i];h=null==n||null==w?w:w[n]}return{attr:h}}v||(d.pq_cellattr={});var f=e.extend(!0,d.pq_cellattr[i],n);if(d.pq_cellattr[i]=f,s!==!1&&null!=r){var m=this.getCell({rowIndxPage:r-l,dataIndx:i});if(m){var g=u(f);m.attr(g)}}}};var u=function(e){var t={};for(var r in e){var i=e[r];if(i)if("title"==r)i=i.replace(/\"/g,"""),t[r]=i;else if("style"==r&&"object"==typeof i){var o,n=[];for(var a in i)o=i[a],o&&n.push(a+":"+o);i=n.join(";")+(n.length?";":""),i&&(t[r]=i)}else"object"==typeof i&&(i=JSON.stringify(i)),t[r]=i}return t};d.removeData=function(t){var r=t.dataIndx,i=t.colIndx,r=null!=i?this.colModel[i].dataIndx:r,o=t.data,o=null==o?[]:o,n="string"==typeof o?o.split(" "):o,a=n.length,l=t.rowData||this.getRowData(t);if(l)if(null==r){var s=l.pq_rowdata;if(s){if(a)for(var d=0;a>d;d++){var c=n[d];delete s[c]}a&&!e.isEmptyObject(s)||delete l.pq_rowdata}}else{var h=l.pq_celldata;if(h&&h[r]){var u=h[r];if(a)for(var d=0;a>d;d++){var c=n[d];delete u[c]}a&&!e.isEmptyObject(u)||delete h[r]}}},d.removeAttr=function(t){var r=t.rowIndx,i=t.dataIndx,o=t.colIndx,i=null!=o?this.colModel[o].dataIndx:i,n=t.attr,n=null==n?[]:n,a="string"==typeof n?n.split(" "):n,l=a.length,s=r-this.rowIndxOffset,d=t.refresh,c=t.rowData||this.getRowData(t);if(c)if(d!==!1&&null==r&&(r=this.getRowIndx({rowData:c}).rowIndx),null==i){var h=c.pq_rowattr;if(h){if(l)for(var u=0;l>u;u++){var f=a[u];delete h[f]}else for(var f in h)a.push(f);l&&!e.isEmptyObject(h)||delete c.pq_rowattr}if(d!==!1&&null!=r&&a.length){n=a.join(" ");var p=this.getRow({rowIndxPage:s});p&&p.removeAttr(n)}}else{var g=c.pq_cellattr;if(g&&g[i]){var v=g[i];if(l)for(var u=0;l>u;u++){var f=a[u];delete v[f]}else for(var f in v)a.push(f);l&&!e.isEmptyObject(v)||delete g[i]}if(d!==!1&&null!=r&&a.length){n=a.join(" ");var w=this.getCell({rowIndxPage:s,dataIndx:i});w&&w.removeAttr(n)}}},d.normalize=function(e){var t={};for(var r in e)t[r]=e[r];var i=t.rowIndx,o=t.rowIndxPage,n=t.dataIndx,a=t.colIndx;if(null!=o||null!=i){var l=this.rowIndxOffset;i=null==i?parseInt(o,10)+l:i,o=null==o?parseInt(i,10)-l:o,t.rowIndx=i,t.rowIndxPage=o,t.rowData=t.rowData||this.getRowData(t)}if(null!=a||null!=n){var s=this.colModel;n=null==n?s[a]?s[a].dataIndx:void 0:n,a=null==a?this.colIndxs[n]:a,t.column=s[a],t.colIndx=a,t.dataIndx=n}return t},d.addClass=function(e){var t=this.normalize(e),r=t.rowIndxPage,i=t.dataIndx,o=pq.arrayUnique,n=t.cls,a=t.refresh,l=t.rowData;if(l)if(a!==!1&&null==r&&(r=this.getRowIndx({rowData:l}).rowIndxPage),null==i){var s,d=l.pq_rowcls;if(s=d?d+" "+n:n,s=o(s.split(/\s+/)).join(" "),l.pq_rowcls=s,a!==!1&&null!=r){var c=this.getRow({rowIndxPage:r});c&&c.addClass(n)}}else{var h=[];"function"!=typeof i.push?h.push(i):h=i;var u=l.pq_cellcls;u||(u=l.pq_cellcls={});for(var f=0,p=h.length;p>f;f++){var s,i=h[f],g=u[i];if(s=g?g+" "+n:n,s=o(s.split(/\s+/)).join(" "),u[i]=s,a!==!1&&null!=r){var v=this.getCell({rowIndxPage:r,dataIndx:i});v&&v.addClass(n)}}}},d.removeClass=function(e){var t=this.normalize(e),r=t.rowIndx,i=t.rowData,o=t.dataIndx,n=t.cls,a=t.refresh;if(i){var l=i.pq_cellcls,s=i.pq_rowcls;if(a!==!1&&null==r&&(r=this.getRowIndx({rowData:i}).rowIndx),null==o){if(s&&(i.pq_rowcls=this._removeClass(s,n),null!=r&&a!==!1)){var d=this.getRow({rowIndx:r});d&&d.removeClass(n)}}else if(l){var c=[];"function"!=typeof o.push?c.push(o):c=o;for(var h=0,u=c.length;u>h;h++){var o=c[h],f=l[o];if(f&&(i.pq_cellcls[o]=this._removeClass(f,n),null!=r&&a!==!1)){var p=this.getCell({rowIndx:r,dataIndx:o});p&&p.removeClass(n)}}}}},d.hasClass=function(e){var t,r=e.dataIndx,i=e.cls,o=this.getRowData(e),n=new RegExp("\\b"+i+"\\b");if(o){if(null==r)return t=o.pq_rowcls,!(!t||!n.test(t));var a=o.pq_cellcls;return!!(a&&a[r]&&n.test(a[r]))}return null},d._removeClass=function(e,t){if(e&&t){for(var r=e.split(/\s+/),i=t.split(/\s+/),o=[],n=0,a=r.length;a>n;n++){ for(var l=r[n],s=!1,d=0,c=i.length;c>d;d++){var h=i[d];if(l===h){s=!0;break}}s||o.push(l)}return o.length>1?o.join(" "):1===o.length?o[0]:null}},d.getRowIndx=function(e){var t,r,i=e.$tr,o=e.rowData,n=this.rowIndxOffset;if(o){var a=this.options,l=a.dataModel,s=this.get_p_data(),d=!1,c=e.dataUF?l.dataUF:null,h=!1;if(s)for(var u=0,f=s.length;f>u;u++)if(s[u]==o){h=!0;break}if(!h&&c){d=!0;for(var u=0,f=c.length;f>u;u++)if(c[u]==o){h=!0;break}}return h?(t=u-n,r=u,{rowIndxPage:d?void 0:t,uf:d,rowIndx:r,rowData:o}):{}}return null==i||0==i.length?{}:(t=i.attr("pq-row-indx"),null==t?{}:(t=parseInt(t),{rowIndxPage:t,rowIndx:t+n}))},d.search=function(e){for(var t=this.options,r=e.row,i=e.first,o=t.dataModel,n=t.pageModel,a=n.type,l=[],s=this.rowIndxOffset,d="remote"==a,c=o.data,h=0,u=c.length;u>h;h++){var f=c[h],p=!0;for(var g in r)r[g]!==f[g]&&(p=!1);if(p){var v=d?h+s:h,w=this.normalize({rowIndx:v});if(l.push(w),i)break}}return l};var f=function(e){this.options=e.options,this.that=e},p=f.prototype;p._incrRowIndx=function(e,t){for(var r=this.that,i=e,t=1,o=r.pdata,n=0,a=e+1,l=o.length;l>a;a++){var s=o[a].pq_hidden;if(!s&&(n++,i=a,n==t))return i}return i},p._decrRowIndx=function(e,t){for(var r=this.that,i=e,o=r.pdata,t=1,n=0,a=e-1;a>=0;a--){var l=o[a].pq_hidden;if(!l&&(n++,i=a,n==t))return i}return i},p._decrRowIndx2=function(e,t){var r,i,o=this.that,n=o.rowIndxOffset,a=e+n,l=o.iMerge,s=o.pdata;if(r=l.ismergedCell(a,t)){var d=l.getRootCell(a,t,"a"),i=l.getData(a,t,"proxy_cell"),t=d.colIndx;t=i?i.colIndx:t}for(var c=e-1;c>=0;c--){var h=s[c].pq_hidden;if(!h){e=c;break}}return{rowIndxPage:e,colIndx:t}},p._incrRowIndx2=function(e,t){var r,i,o=this.that,n=o.rowIndxOffset,a=e+n,l=o.iMerge,s=o.pdata;if(r=l.ismergedCell(a,t)){var d=l.getRootCell(a,t,"a"),i=l.getData(a,t,"proxy_cell"),t=d.colIndx;e=r.rowspan?e+r.rowspan-1:0,t=i?i.colIndx:t}for(var c=e+1,h=s.length;h>c;c++){var u=s[c].pq_hidden;if(!u){e=c;break}}return{rowIndxPage:e,colIndx:t}},d.addColumn=function(e){for(var t=e.colList||[{colIndx:e.colIndx,column:e.column}],r=e.history!==!1,i=this.options,o=i.colModel,n=0;n=0;n--){var a=t[n],l=a.colIndx,s=o.splice(l,1)[0];a.column=s}this.iColModel.init(),r&&(this.iHistory.increment(),t.type="delete",this.iHistory.push({colList:t})),this._trigger("deleteColumn",null,{colList:t}),e.refresh!==!1&&this.refreshView()},p._incrIndx=function(e,t,r){var i,o,n,a,l,s=this.that,d=s.iMerge,c=s.pdata,h=s.rowIndxOffset,u=s[r?"getLastVisibleRIP":"getFirstVisibleRIP"](),f=s.colModel,p=f.length;if(null==t)return e==u?null:(e=this[r?"_incrRowIndx":"_decrRowIndx"](e),{rowIndxPage:e});do{if(n=e+h,(i=d.ismergedCell(n,t))&&(!l&&(o=d.getData(n,t,"proxy_cell"))&&(a=o.rowIndx-h,c[a].pq_hidden||(e=a)),c[e].pq_hidden&&(e=d.getRootCell(n,t).rowIndxPage),!l&&r&&(t+=i&&i.colspan?i.colspan-1:0)),t=r?t+1:t-1,r&&t>=p||!r&&0>t){if(e==u)return null;e=this[r?"_incrRowIndx":"_decrRowIndx"](e),t=r?0:p-1}l=f[t]}while(l&&l.hidden);return{rowIndxPage:e,colIndx:t}},p._incrEditIndx=function(e,t,r){var i,o=this.that,n=o.colModel,a=n.length,l=o.iMerge,s=o.rowIndxOffset,d=o[r?"getLastVisibleRIP":"getFirstVisibleRIP"]();do{var c=e+s,h=l.ismergedCell(c,t);if(h){var u=l.getData(c,t,"proxy_edit_cell");u&&(c=u.rowIndx,e=c-s),t=r?t+h.colspan:t-1}else t=r?t+1:t-1;if(r&&t>=a||!r&&0>t){if(e==d)return null;do{e=this[r?"_incrRowIndx":"_decrRowIndx"](e);var f=o.isEditableRow({rowIndxPage:e});if(e==d&&0==f)return null}while(0==f);t=r?0:a-1}if(c=e+s,h=l.ismergedCell(c,t)){var p=l.getRootCell(c,t,"o");l.setData(p.rowIndx,p.colIndx,{proxy_edit_cell:{rowIndx:c,colIndx:t}}),c=p.rowIndx,t=p.colIndx}i=n[t];var g=o.isEditableCell({rowIndx:c,colIndx:t,checkVisible:!0}),v=i.editor,v="function"==typeof v?v.call(o,o.normalize({rowIndx:c,colIndx:t})):v;e=c-s}while(i&&(i.hidden||0==g||v===!1));return{rowIndxPage:e,colIndx:t}},p.getMergeCell=function(e,t){var r,i,o=this.that,n=o.options,a=o.iMerge;return a.ismergedCell(e,t)&&(i=a.getRootCell(e,t,"o"),a.setData(i.rowIndx,i.colIndx,{proxy_cell:{rowIndx:e,colIndx:t}}),n.virtualY&&(r=a.getRootCell(e,t,"a"))),r||(e=this.getVisibleRowIndx(e),t=this.getVisibleColIndx(t),r=o.normalize({rowIndx:e,colIndx:t})),r},p.getVisibleRowIndx=function(e){for(var t=this.that,r=t.pdata,i=r.length,o=t.rowIndxOffset,n=e-o,a=t.getRowData({rowIndx:e});a.pq_hidden&&i-1>n;)n++,e++,a=t.getRowData({rowIndx:e});return e},p.getVisibleColIndx=function(e){for(var t=this.that,r=t.colModel,i=r.length,o=r[e];o.hidden&&i-1>e;)e++,o=r[e];return e},d._onKeyPressDown=function(t){var r=e(t.target).closest(".pq-grid-header");if(r.length>0)return 0!=this._trigger("headerKeyDown",t,null);var i=this.iKeyNav._bodyKeyPressDown(t);return i===!1?!1:0==this._trigger("keyDown",t,null)?!1:void 0},p._saveAndMove=function(e,t){if(null==e)return t.preventDefault(),!1;var r=this.that,i=e.rowIndxPage,o=e.colIndx;if(r._blurEditMode=!0,r.saveEditCell({evt:t})===!1||!r.pdata)return r.pdata||r.quitEditMode(t),r._deleteBlurEditMode({timer:!0,msg:"_saveAndMove saveEditCell"}),t.preventDefault(),!1;if(r.quitEditMode(t),e.incr){var n=this[e.edit?"_incrEditIndx":"_incrIndx"](i,o,!t.shiftKey);i=n?n.rowIndxPage:i,o=n?n.colIndx:o}r.scrollRow({rowIndxPage:i}),r.scrollColumn({colIndx:o});var a=i+r.rowIndxOffset;return this.select({rowIndx:a,colIndx:o,evt:t}),e.edit&&r._editCell({rowIndxPage:i,colIndx:o}),r._deleteBlurEditMode({timer:!0,msg:"_saveAndMove"}),t.preventDefault(),!1},p._keyPressInEdit=function(t,r){var i=this.that,o=i.options,n=o.editModel.indices,a=r||{},l=a.FK,s=n.column,d=e.ui.keyCode,c=["BACKSPACE","LEFT","RIGHT","UP","DOWN","DELETE","HOME","END"].map(function(e){return d[e]}),h=s.dataType;if(e.inArray(t.keyCode,c)>=0)return!0;if(i._trigger("editorKeyPress",t,e.extend({},n))===!1)return!1;if(l&&("float"==h||"integer"==h)){var u="float"==h?"0123456789.-":"0123456789-",f=t.charCode||t.keyCode,p=String.fromCharCode(f);if(p&&-1==u.indexOf(p))return!1}return!0},p.getValText=function(t){var r=t[0].nodeName.toLowerCase(),i=["input","textarea","select"],o="text";return-1!=e.inArray(r,i)&&(o="val"),o},p._keyUpInEdit=function(t,r){var i=this.that,o=i.options,r=r?r:{},n=r.FK,a=o.editModel,l=a.indices;i._trigger("editorKeyUp",t,e.extend({},l));var s=l.column,d=s.dataType;if(n&&("float"==d||"integer"==d)){var c=e(t.target),h="integer"==d?a.reInt:a.reFloat,u=this.getValText(c),f=c.data("oldVal"),p=c[u]();if(0==h.test(p))if(h.test(f))c[u](f);else{var g="float"==d?parseFloat(f):parseInt(f);isNaN(g)?c[u](0):c[u](g)}}},p._keyDownInEdit=function(t){var r=this.that,i=r.options,o=i.editModel.indices;if(o){var n=e(t.target),a=e.ui.keyCode,l=i.editModel,s=e.extend({},o),d=s.rowIndxPage,c=s.colIndx,h=s.column,u=h.editModel,f=u?e.extend({},l,u):l,p=this.getValText(n);if(n.data("oldVal",n[p]()),0==r._trigger("editorKeyDown",t,s))return!1;if(t.keyCode==a.TAB||t.keyCode==f.saveKey){var g=t.keyCode==a.TAB?f.onTab:f.onSave,s={rowIndxPage:d,colIndx:c,incr:!!g,edit:"nextEdit"==g};return this._saveAndMove(s,t)}if(t.keyCode==a.ESCAPE)return r.quitEditMode({evt:t}),r.focus({rowIndxPage:d,colIndx:c}),t.preventDefault(),!1;if(t.keyCode==a.PAGE_UP||t.keyCode==a.PAGE_DOWN)return t.preventDefault(),!1;if(f.keyUpDown&&!t.altKey){if(t.keyCode==a.DOWN){var s=this._incrRowIndx2(d,c);return this._saveAndMove(s,t)}if(t.keyCode==a.UP){var s=this._decrRowIndx2(d,c);return this._saveAndMove(s,t)}}}},p.select=function(t){var r=this.that,i=this,o=t.rowIndx,n=t.colIndx,a=t.evt,t=this.getMergeCell(o,n),o=t.rowIndx,n=t.colIndx,l=t.rowIndxPage,s=r.options,d=r.iSelection,c=s.selectionModel,h=c.type,u="row"==h,f="cell"==h,p=s.realFocus?function(e){clearTimeout(i.timeoutID),i.timeoutID=setTimeout(function(){e()},0)}:function(e){e()};p(function(){r.scrollCell({rowIndx:o,colIndx:n});var t=d.address();if(a.shiftKey&&a.keyCode!==e.ui.keyCode.TAB&&c.type&&"single"!=c.mode&&t.length){var i=t[t.length-1],s=i.firstR,h=i.firstC,p=i.type,g=!1;"column"==p?(i.c1=h,i.c2=n,i.r1=i.r2=i.type=void 0):"row"==p?(i.r1=s,i.r2=o,i.c1=i.c2=i.type=void 0):(t={r1:s,r2:o,c1:h,c2:n,firstR:s,firstC:h},g=!0),r.range(t,g).select()}else u?r.range({r1:o,firstR:o},!1).select():f&&r.range({r1:o,c1:n,firstR:o,firstC:n}).select();r.focus({rowIndxPage:l,colIndx:n})})},p._bodyKeyPressDown=function(t){var r,i,o,r,o,n=this.that,a=n.rowIndxOffset,l=this.options,s=n.iMerge,d=n._focusElement,c=(n.colModel,l.selectionModel),h=l.editModel,u=t.ctrlKey||t.metaKey,f=e.ui.keyCode,p=t.keyCode;if(h.indices)return void n.$div_focus.find(".pq-cell-focus").focus();if(d){var g=document.activeElement;if("pq-grid-cont"!=g.className&&"TD"!=g.nodeName.toUpperCase()&&"pq-grid-excel"!=g.id)return}else{var v=e(t.target);if(!v.hasClass("pq-grid-cell"))return;d=n.getCellIndices({$td:v})}var w,m,x=n.normalize(d),i=x.rowIndxPage,r=x.rowIndx,o=x.colIndx,_=n.pdata,I=x,y=!0;if(null!=r&&null!=o&&null!=x.rowData){if(s.ismergedCell(r,o)&&(I=s.getRootCell(r,o,"o"),x=I,i=x.rowIndxPage,r=x.rowIndx,o=x.colIndx,p!=f.PAGE_UP&&p!=f.PAGE_DOWN&&p!=f.SPACE&&p!=f.HOME&&p!=f.END||(w=s.getData(r,o,"proxy_cell"))&&(m=w.rowIndx-a,_[m].pq_hidden||(i=m,r=i+a))),0==n._trigger("cellKeyDown",t,I))return!1;if(p==f.LEFT||p==f.RIGHT||p==f.UP||p==f.DOWN||c.onTab&&p==f.TAB){var b=null;p==f.LEFT||p==f.TAB&&t.shiftKey?b=this._incrIndx(i,o,!1):p==f.RIGHT||p==f.TAB&&!t.shiftKey?b=this._incrIndx(i,o,!0):p==f.UP?b=this._decrRowIndx2(i,o):p==f.DOWN&&(b=this._incrRowIndx2(i,o)),b&&(r=b.rowIndxPage+a,this.select({rowIndx:r,colIndx:b.colIndx,evt:t}))}else if(p==f.PAGE_DOWN||p==f.SPACE||p==f.PAGE_UP){var C=p==f.PAGE_UP?"pageUp":"pageDown",q=this[C](i);q&&(i=q.rowIndxPage,null!=i&&(r=i+a,this.select({rowIndx:r,colIndx:o,evt:t})))}else if(p==f.HOME)u?r=n.getFirstVisibleRIP()+a:o=n.getFirstVisibleCI(),this.select({rowIndx:r,colIndx:o,evt:t});else if(p==f.END)u?r=n.getLastVisibleRIP()+a:o=n.getLastVisibleCI(),this.select({rowIndx:r,colIndx:o,evt:t});else if(p==f.ENTER){i=I.rowIndxPage,o=I.colIndx;var M=n.getCell({rowIndxPage:i,colIndx:o});if(M&&M.length>0){var r=i+a,D=n.isEditableRow({rowIndx:r}),R=n.isEditableCell({rowIndx:r,colIndx:o});if(D&&R)n.editCell({rowIndxPage:i,colIndx:o});else{var P=M.find("button");P.length&&e(P[0]).click()}}}else if(u&&"65"==p){var T=n.iSelection;"row"==c.type&&"single"!=c.mode?T.selectAll({type:"row",all:c.all}):"cell"==c.type&&"single"!=c.mode&&T.selectAll({type:"cell",all:c.all})}else if(h.pressToEdit&&(p>=32&&127>=p||189==p)&&!u)if(46==p)n.clear();else{i=I.rowIndxPage,o=I.colIndx;var M=n.getCell({rowIndxPage:i,colIndx:o});if(M&&M.length>0){var r=i+a,D=n.isEditableRow({rowIndx:r}),R=n.isEditableCell({rowIndx:r,colIndx:o});D&&R&&n.editCell({rowIndxPage:i,colIndx:o,select:!0})}y=!1}else y=!1;y&&t.preventDefault()}},p.incrPageSize=function(){for(var t=this.that,r=t.$tbl,i=r.children("tbody").children(".pq-grid-row"),o=parseInt(r.css("marginTop")),n=t.iRefresh.getEContHt()-o,a=i.length-1;a>=0;a--){var l=i[a];if(l.offsetTop0){do{i=d[s];var h=i.offsetHeight;if(l+=h,l>=n)break;s++}while(c>s);s=s>0?s-1:s;do{var a=e(d[s]);if(t=o.getRowIndx({$tr:a}).rowIndxPage,null!=t)break;s--}while(s>=0)}return t},p.pageDown=function(e){var t=this.that,r=t.options,i=t.vscroll,o=i.option("cur_pos"),n=i.option("num_eles"),a=i.option("ratio");if(r.virtualY){if(n-1>o){var e=this.incrPageSize().rowIndxPage,l=t._calcCurPosFromRowIndxPage(e);if(null==l)return;i.option("cur_pos",l),i.scroll()}}else if(null!=e)e=this.pageNonVirtual(e,"nextAll");else if(1>a){var s=t.iRefresh.getEContHt(),d=t.iMouseSelection;d.updateTableY(-1*s),d.syncScrollBarVert()}return{rowIndxPage:e,curPos:l}},p.pageUp=function(e){var t=this.that,r=t.options,i=t.vscroll;if(r.virtualY){var o=i.option("cur_pos");if(o>0){var e=this.decrPageSize().rowIndxPage,n=t._calcCurPosFromRowIndxPage(e);if(null==n)return;i.option("cur_pos",n),i.scroll()}}else{var a=i.option("ratio");if(null!=e)e=this.pageNonVirtual(e,"prevAll");else if(a>0){var l=t.iRefresh.getEContHt(),s=t.iMouseSelection;s.updateTableY(l),s.syncScrollBarVert()}}return{rowIndxPage:e,curPos:n}},p.decrPageSize=function(){var t,r=this.that,i=r.$tbl,o=i.children("tbody").children(".pq-grid-row"),n=r.options.freezeRows,a=r.pdata,l=0;if(o.length){var s;if(n?(s=o.filter("tr.pq-last-frozen-row"),s.length&&(s=s.next())):o.length>=2&&(s=e(o[1])),s&&s.length)for(var l=r.getRowIndx({$tr:s}).rowIndxPage,t=l,d=0,c=r.pageSize-3,h=l;h>=0;h--){var u=a[h];if(!u.pq_hidden&&(d++,t=h,d>=c))break}}return{rowIndxPage:t}},d._calcNumHiddenFrozens=function(){for(var e=0,t=this.options.freezeCols,r=0;t>r;r++)this.colModel[r].hidden&&e++;return e},d._calcNumHiddenUnFrozens=function(e){for(var t=0,r=this.options.freezeCols,i=null!=e?e:this.colModel.length,o=r;i>o;o++)this.colModel[o].hidden&&t++;return t},d._getSBHeight=function(){return this.iRefresh.getSBHeight()},d._getSBWidth=function(){return this.iRefresh.getSBWidth()},d.getFirstVisibleRIP=function(e){for(var t=this.pdata,r=e?this.initV:0,i=t.length;i>r;r++)if(!t[r].pq_hidden)return r},d.getLastVisibleRIP=function(){for(var e=this.pdata,t=e.length-1;t>=0;t--)if(!e[t].pq_hidden)return t;return null},d.getFirstVisibleCI=function(e){for(var t=this.colModel,r=t.length,i=e?this.initH:0;r>i;i++){var o=t[i].hidden;if(!o)return i}return null},d.getLastVisibleCI=function(){for(var e=this.colModel,t=e.length,r=t-1;r>=0;r--){var i=e[r].hidden;if(!i)return r}return null},d.getTotalVisibleColumns=function(){for(var e=this.colModel,t=e.length,r=0,i=0;t>i;i++){var o=e[i],n=o.hidden;n||r++}return r},d._calcCurPosFromRowIndxPage=function(e){var t=this.options,r=this.pdata,i=t.freezeRows;if(i>e)return 0;for(var o=0,n=i,a=i,l=r.length;l>a;a++){var s=r[a];if(n==e)break;n++;var d=s.pq_hidden;d||o++}return o>=l?null:o},d._calcCurPosFromColIndx=function(e){var t=this.options,r=this.colModel,i=t.freezeCols;if(i>e)return 0;for(var o=0,n=i,a=i,l=r.length;l>a;a++){var s=r[a];if(n==e)break;n++;var d=s.hidden;d||o++}return o>=l?null:o},d.calcWidthCols=function(e,t,r){var i=0,o=this.options,n=0,a=o.numberCell,l=this.colModel;if(-1==e&&(a.show&&(i+=r?1*a.width:a.outerWidth),e=0),r)for(var s=e;t>s;s++){var d=l[s];if(d&&!d.hidden){if(!d._width)throw"assert failed";i+=d._width+n}}else for(var s=e;t>s;s++){var d=l[s];d&&!d.hidden&&(i+=d.outerWidth)}return i},d.calcHeightFrozenRows=function(){var t=this.$tbl,r=0;if(t&&t.length){var i=e(t[0]).find("tr.pq-last-frozen-row");if(i&&i.length){var o=i[0];r=o.offsetTop+o.offsetHeight}}return r},d._calcRightEdgeCol=function(e){var t=0,r=0,i=this.colModel,o=this.initH,n=this.options,a=n.freezeCols,l=n.numberCell;l.show&&(t+=l.outerWidth,r++);for(var s=0;e>=s;s++){o>s&&s>=a&&(s=o);var d=i[s];d.hidden||(t+=d.outerWidth,r++)}return{width:t,cols:r}},d._createHeader=function(){this.iHeader.createHeader(),this.options.showHeader&&this._trigger("createHeader")},d.createTable=function(e){e.other=!0;var t=this.iGenerateView;t.generateView(e),t.scrollView()}}(jQuery),function(e){function t(e){this.that=e}function r(e,t,r){for(var i=e[t],o=0;oo;o++){var n=e[o];n.hidden!==!0&&i++}return i}function o(e,t,r){for(var i,o;r&&(i=e[r][t],o=e[r-1][t],i==o);)r--;return r}var n=e.paramquery,a=n._pqGrid.prototype;a.getHeadCell=function(e){var t,r,i,o,n=e.attr("pq-col-indx"),a=e.attr("pq-row-indx");return null!=n&&null!=a&&(n=1*n,a=1*a,r=this.headerCells[a][n],r&&(o=r.colModel,i=r.leftPos)),o&&o.length&&(t=!0),{col:r,ci:n,o_ci:i,ri:a,isParent:t}},a.flex=function(e){this.iResizeColumns.flex(e)},n.cHeader=t;var l=t.prototype;l.createHeader=function(){var t=this.that,r=this,i=t.options,o=i.bootstrap,n=(o.on?o.thead:"")+" pq-grid-header-table ",a=i.ui,l=o.on?"":a.header,s=i.hwrap,d=t.pqpanes,c=parseInt(i.freezeCols),h=i.numberCell,u=t.colModel,f=i.sortModel,p=t.depth,g=i.virtualX,v=t.iGenerateView.colDef,w=t.initH,m=t.finalH,x=t.headerCells,_=t.$header_o;if(_.empty(),null!=m){if(i.showHeader===!1)return void _.css("display","none");_.css("display",""),n+=s?"pq-wrap ":"pq-no-wrap ";var I=[""];if(p>=1){I.push(""),h.show&&I.push("");for(var y=0,b=v.length;b>y;y++){var C=v[y],q=C.colIndx,M=C.column,D=M.outerWidth;I.push("")}I.push("")}for(var R="pq-grid-col ",P=0;p>P;P++){I.push(""),0==P&&h.show&&I.push([""].join(""));for(var q=0;m>=q;q++){if(w>q&&q>=c&&g&&(q=w,q>m))throw"initH>finalH";r.createHeaderCell(P,q,x,I,R,c,w,p,f)}I.push("")}t.ovCreateHeader(I,R),I.push("
","
",h.title?h.title:" ","
");var T=I.join("");d.vH?_[0].innerHTML=["","
",T,"
","
","","
",T,"
","
"].join(""):_[0].innerHTML=["","
",T,"
","
"].join("");var k=t.$header=_.children(".pq-grid-header"),S=k.children(".pq-grid-header-inner");t.$tbl_header=S.children("table"),t.$header_left=e(k[0]),t.$header_left_inner=e(S[0]),d.vH&&(t.$header_right=e(k[1]),t.$header_right_inner=e(S[1])),k.click(function(e){return r._onHeaderClick(e)}),r._refreshResizeColumn(w,m,u),t._trigger("refreshHeader",null,null)}},l._onHeaderClick=function(t){var r,i,o,n=this,a=this.that,l=a.iDragColumns;if(!l||"stop"==l.status){var s=e(t.target);return s.is("input,label")?!0:(r=s.closest(".pq-grid-col"),r.length&&(o=a.getHeadCell(r),i=o.col,i&&!o.isParent)?n._onHeaderCellClick(i,o.ci,t):void 0)}},l.createHeaderCell=function(e,t,o,a,l,s,d,c,h){var u=this.that,f=u.options.sheet,p=o[e][t],g=u.colModel,v=p.colSpan;if(!(p.hidden||0===v||e>0&&p==o[e-1][t])){if(t>0&&p==o[e][t-1]){if(t>d)return;var w=r(o,e,p);if(s>w)return;v-=i(g,w,t)}else if(s&&s>t&&t+v>s){var m=v-i(g,s,d),x=i(g,t,s);v=Math.max(m,x)}var _=p.halign||p.align,I=p.cls,y=[l],b=p.title,C=p.type,b="function"==typeof b?b.call(u,{column:p,colIndx:t,dataIndx:p.dataIndx}):b,b=f?n.toLetter(t):b,b=null!=b?b:"checkbox"==C&&p.cb.header?"":p.dataIndx;p.pqtitle=b,_&&y.push("pq-align-"+_),t==s-1&&1==c&&y.push("pq-last-frozen-col"),s-1>=t?y.push("pq-left-col"):t>=d&&y.push("pq-right-col"),I&&y.push(I);var q="";null!=p.colModel&&0!=p.colModel.length||y.push("pq-grid-col-leaf");var M="pq-row-indx="+e,D="pq-col-indx="+t,R=h.space?"pq-space":"";a.push(["","
",b,"",h.number?"":"","
"].join(""))}},l._onHeaderCellClick=function(e,t,r){var i=this.that,o=i.options,n=o.sortModel,a=e.dataIndx;if(i._trigger("headerCellClick",r,{column:e,colIndx:t,dataIndx:a})!==!1){if(o.selectionModel.column&&-1==r.target.className.indexOf("pq-td-div")){var l={c1:t,firstC:t},s=i.iSelection.address();if(r.shiftKey){var d=s.length;if(d&&"column"==s[d-1].type){var c=s[d-1];c.c1=c.firstC,c.c2=t,c.r1=c.r2=c.type=void 0}l=s}return i.range(l,!1).select(),void i.focus({rowIndxPage:i.getFirstVisibleRIP(!0),colIndx:t})}n.on&&0!=e.sortable&&i.sort({sorter:[{dataIndx:a}],addon:!0,tempMultiple:n.multiKey&&r[n.multiKey],evt:r})}},l._refreshResizeColumn=function(e,t,r){var i=this.that,o=i.options,n=!!o.filterModel.ficon,a=o.numberCell,l=parseInt(o.freezeCols),s=[],d=[],c=i.pqpanes.vH,h=0,u=0;a.show&&(h=a.outerWidth,a.resizable&&(u=h-5,s.push("
 
")));for(var f=i.iGenerateView.colDef,p=0,g=f.length;g>p;p++){var v=f[p],w=v.colIndx,m=v.column,x=m.ficon,_=x||null==x&&n,I=s;h+=m.outerWidth,(m.resizable!==!1||_)&&(c&&w>=l&&(I=d),u=h-5,I.push("
 
"))}d.length&&i.$header_right_inner.append(d.join("")),i.$header_left_inner.append(s.join(""))},l.refreshHeaderSortIcons=function(){var e=this.that,t=e.options,r=t.bootstrap,i=(t.ui,e.$header);if(i){var o=e.iSort.getSorter(),n=o.length,a=!1,l=e.options.sortModel;l.number&&n>1&&(a=!0);for(var s=0;n>s;s++){var d=o[s],c=d.dataIndx,h=e.getColIndx({dataIndx:c}),u=d.dir,f=" pq-col-sort-"+("up"==u?"asc":"desc"),p=r.on?" glyphicon glyphicon-arrow-"+u:"ui-icon ui-icon-triangle-1-"+("up"==u?"n":"s"),g=i.find(".pq-grid-col-leaf[pq-col-indx="+h+"]");g.addClass(f),g.find(".pq-col-sort-icon").addClass(p),a&&g.find(".pq-col-sort-count").html(s+1)}}};var s=function(t){this.that=t;var r=this;t.$header_o.on({mousedown:function(t){if(!t.pq_composed){var i=e(t.target);r.setDraggables(t),t.pq_composed=!0;var o=e.Event("mousedown",t);i.trigger(o)}},dblclick:function(e){r.doubleClick(e)}},".pq-grid-col-resize-handle");var i=t.options,o=i.flex;o.on&&o.one&&t.one("ready",function(){r.flex()})};n.cResizeColumns=s;var d=s.prototype=new n.cClass;d.doubleClick=function(t){var r=this.that,i=r.options,o=i.flex,n=e(t.target),a=parseInt(n.attr("pq-col-indx"));isNaN(a)||o.on&&this.flex(o.all&&!i.scrollModel.autoFit?{}:{colIndx:[a]})},d._initFlexTable=function(t,r){if(t.length){var i,o=t.css({tableLayout:"auto",width:""}).addClass("pq-no-wrap").removeClass("pq-wrap").children("tbody").children(".pq-row-hidden"),n=o.children("td").css("width","");if(r){var a,l=o.next().children("td"),s=0,d=[],c=[];l.each(function(e,t){if(a=1*t.getAttribute("colspan"),a>1&&(s+=a-1,d[s]=t.offsetWidth,i=n[s],!i||!i.offsetWidth))for(var r=s-(a-1);s>r;r++)c[r]=!0;s++})}}return[n||e(),c||[],d]},d.flex=function(t){t=t||{};var r,i=this.that,o=i.options,n=i.element,a=o.numberCell,l=t.colIndx,s=t.dataIndx,d=null==t.refresh?!0:t.refresh,c=!1,h=0,u=i.$tbl,f=i.$tbl_header,p=u&&u.length?e(u[0]).clone():e(),g=i.tables&&i.tables.length?i.tables[0].$tbl:null,g=g?e(g[0]).clone():e(),v=f&&f.length?e(f[0]).clone():e(),w=p.find(".pq-merge-cell");if(w.each(function(t,r){r.innerHTML=e(r).find(".pq-merge-inner")[0].innerHTML,r.style.whiteSpace="noWrap"}),null!=s){l=[];for(var m=0,x=s.length;x>m;m++){var _=i.colIndxs[s[m]];null!=_&&l.push(_)}}null!=l&&(l.sort(function(e,t){return e-t}),r=l.length),v.find("tr.pq-grid-header-search-row").remove();var I=e("
").append(v).append(g).append(p);I.addClass(n.attr("class")),n.parent().append(I);for(var y=this._initFlexTable(p,!0),b=y[0],C=y[1],q=y[2],M=0,D=this._initFlexTable(g)[0],R=this._initFlexTable(v)[0],P=a.show?0:-1,T=i.iGenerateView.colDef,m=0,x=T.length;x>m;m++){var k=T[m],S=k.colIndx,H=k.column;if(P++,l){if(!l.length)break;if(l[0]!==S)continue;l.splice(0,1)}var E=b[P],$=R[P],V=D[P],z=C[P],W=E?E.offsetWidth:0,L=V?V.offsetWidth:0,A=$?$.offsetWidth:0;z?W=0:M&&(W=q[P]-M,M=0);var F=Math.max(W,L,A)-h+1;z&&(M+=F),H._width!==F&&(c=!0,H.width=F,1===r&&(H._resized=!0))}I.remove(),c&&d&&i.refresh({source:"flex",colModel:!0})},d.setDraggables=function(t){var r,i,o,n=e(t.target),a=(this.that,this);n.draggable({axis:"x",helper:function(t,r){var i=e(t.target),o=parseInt(i.attr("pq-col-indx"));return a._setDragLimits(o),a._getDragHelper(t,r),i},start:function(e,t){r=t.position.left,o=parseInt(a.$cl[0].style.left)},drag:function(e,t){i=t.position.left;var n=i-r;a.$cl[0].style.left=o+n+"px"},stop:function(e,t){return a.resizeStop(e,t,r)}})},d._getDragHelper=function(t){var r=this.that,i=r.options,o=parseInt(i.freezeCols),n=e(t.target),a=r.$grid_center,l=parseInt(n.attr("pq-col-indx")),s=a.outerHeight();this.$cl=e("
").appendTo(a),this.$clleft=e("
").appendTo(a),this.$cl.height(s),this.$clleft.height(s);var d=e("[pq-col-indx="+l+"]",r.$header)[0],c=d.offsetLeft;r.pqpanes.vH?l>=o&&(c-=r.$header[1].scrollLeft):(c+=r.$header[0].offsetLeft,c-=r.$header[0].scrollLeft),this.$clleft.css({left:c}),c+=d.offsetWidth,this.$cl.css({left:c})},d._setDragLimits=function(e){if(!(0>e)){var t=this.that,r=t.colModel,i=r[e],o=t.options,n=(o.numberCell,t.$header_left);e>=o.freezeCols&&t.pqpanes.vH&&(n=t.$header_right);var a=n.find("th[pq-col-indx='"+e+"']"),l=a.offset().left+i._minWidth,s=l+i._maxWidth-i._minWidth,d=n.find("div.pq-grid-col-resize-handle[pq-col-indx="+e+"]");d.draggable("option","containment",[l,0,s,0])}},d.resizeStop=function(t,r,i){var o=this.that,n=o.colModel,a=o.options,l=this,s=a.numberCell;l.$clleft.remove(),l.$cl.remove();var d,c=r.position.left,h=c-i,u=e(r.helper),f=parseInt(u.attr("pq-col-indx"));if(-1==f){d=null;var p=parseInt(s.width),g=p+h;s.width=g}else{d=n[f];var p=parseInt(d.width),g=p+h;d.width=g,d._resized=!0}o.refresh(),o._trigger("columnResize",t,{colIndx:f,column:d,dataIndx:d?d.dataIndx:null,oldWidth:p,newWidth:d?d.width:s.width})};var c=function(t){var r=this;r.that=t,r.$drag_helper=null;var i=t.options.dragColumns,o=i.topIcon,n=i.bottomIcon;r.status="stop",r.$arrowTop=e("
").appendTo(t.element),r.$arrowBottom=e("
").appendTo(t.element),r.hideArrows(),i&&i.enabled&&t.$header_o.on("mousedown",".pq-grid-col",r.onColMouseDown(r,t))};n.cDragColumns=c;var h=c.prototype;h.onColMouseDown=function(t,r){return function(i){var o,n,a,l,s=e(this);if(!i.pq_composed){if(e(i.target).is("input,select,textarea"))return;if(o=r.getHeadCell(s),n=o.col,a=n?n.parent:null,!n||n.nodrag||n._nodrag||a&&1==a.colSpan)return;t.setDraggable(i,n,o)&&(i.pq_composed=!0,l=e.Event("mousedown",i),e(i.target).trigger(l))}}},h.showFeedback=function(e,t){var r=this.that,i=e[0],o=i.offsetParent.offsetParent,n=r.$grid_center[0].offsetTop,a=i.offsetLeft-o.offsetParent.scrollLeft+(t?0:i.offsetWidth)-8,l=n+i.offsetTop-16,s=n+r.$header[0].offsetHeight;this.$arrowTop.css({left:a,top:l,display:""}),this.$arrowBottom.css({left:a,top:s,display:""})},h.showArrows=function(){this.$arrowTop.show(),this.$arrowBottom.show()},h.hideArrows=function(){this.$arrowTop.hide(),this.$arrowBottom.hide()},h.updateDragHelper=function(e){var t=this.that,r=t.options.dragColumns,i=r.acceptIcon,o=r.rejectIcon,n=this.$drag_helper;n&&(e?(n.children("span.pq-drag-icon").addClass(i).removeClass(o),n.removeClass("ui-state-error")):(n.children("span.pq-drag-icon").removeClass(i).addClass(o),n.addClass("ui-state-error")))},h.setDraggable=function(t,r,i){var o=e(t.currentTarget),n=this,a=n.that;return o.hasClass("ui-draggable")?void 0:(o.draggable({distance:10,cursorAt:{top:-18,left:-10},zIndex:"1000",appendTo:a.element,revert:"invalid",helper:n.dragHelper(n,a,r),start:n.onStart(n,a,r,i),drag:n.onDrag(n,a),stop:function(){a.element&&(n.status="stop",a.$header.find(".pq-grid-col-resize-handle").show(),n.hideArrows())}}),!0)},h.onStart=function(e,t,r,i){return function(o){return t._trigger("columnDrag",o.originalEvent,{column:r})===!1?!1:void e.setDroppables(i)}},h.onDrag=function(t,r){return function(i,o){t.status="drag";var n=e(".pq-drop-hover",r.$header);if(n.length>0){t.showArrows(),t.updateDragHelper(!0);var a=n.width(),l=i.clientX-n.offset().left+e(document).scrollLeft();a/2>l?(t.leftDrop=!0,t.showFeedback(n,!0)):(t.leftDrop=!1,t.showFeedback(n,!1))}else{t.hideArrows();var s=e(".pq-drop-hover",r.$top);s.length?t.updateDragHelper(!0):t.updateDragHelper()}}},h.dragHelper=function(t,r,i){var o=r.options.dragColumns.rejectIcon;return function(){t.status="helper",r.$header.find(".pq-grid-col-resize-handle").hide();var n=e("
"+i.pqtitle+"
");return t.$drag_helper=n,n[0]}},h._columnIndexOf=function(e,t){for(var r=0,i=e.length;i>r;r++)if(e[r]==t)return r;return-1},h.setDroppables=function(t){var r,i,o,n,a,l,s,d=this,c=d.that,h=t.col,u=t.ri,f=t.o_ci,p=f+h.o_colspan,g=c.$header_left,v=d.onDrop(),w={hoverClass:"pq-drop-hover ui-state-highlight",accept:".pq-grid-col",tolerance:"pointer",drop:v},m=g.find(".pq-left-col"),x=c.pqpanes.v||c.pqpanes.vH?c.$header_right.find(".pq-right-col"):g.find(".pq-right-col");for(m=m.add(x),s=m.length;s--;)a=e(m[s]),l=a.hasClass("ui-droppable"),r=c.getHeadCell(a),n=r.col,i=r.ri,o=r.ci,n==h||n.nodrop||n._nodrop||i>u&&o>=f&&p>o?l&&a.droppable("destroy"):l||a.droppable(w)},h.onDrop=function(){var t=this,r=this.that;return function(i,o){if(!t.dropPending){var n=1*o.draggable.attr("pq-col-indx"),a=1*o.draggable.attr("pq-row-indx"),l=e(this),s=1*l.attr("pq-col-indx"),d=1*l.attr("pq-row-indx"),c=t.leftDrop,h=t.moveColumn(n,s,c,a,d);t.dropPending=!0,window.setTimeout(function(){r.iColModel.init();var e=r._trigger("columnOrder",null,{dataIndx:h.dataIndx,column:h,oldcolIndx:n,colIndx:r.getColIndx({column:h})});e!==!1&&r.refresh(),t.dropPending=!1},0)}}},h.moveColumn=function(e,t,r,i,n){var a=this.that,l=this,s=a.options.colModel,d=a.headerCells,c=a.depth-1,i=null==i?o(d,e,c):i,n=null==n?o(d,t,c):n,h=d[i][e],u=d[n][t],f=i?d[i-1][e].colModel:s,p=n?d[n-1][t].colModel:s,g=l._columnIndexOf(f,h),v=r?1:0,w=f.splice(g,1)[0],m=l._columnIndexOf(p,u)+1-v;return p.splice(m,0,w),w}}(jQuery),function(e){function t(t,r){this.that=t;var i=this,o=t.options;this.type="detail",this.refreshComplete=!0,this.detachView=!1,t.on("cellClick",function(e,t){return i.toggle(e,t)}).on("cellKeyDown",function(t,r){return t.keyCode==e.ui.keyCode.ENTER?i.toggle(t,r):void 0}).on("refresh",function(e,t){return i.aftertable()}).on("beforeTableView",function(e,t){return i.beforeTableView(e,t)}).on("tableWidthChange",function(e,t){return i.tableWidthChange(e,t)}),r._render=function(e){var t,r=o.detailModel,i=e.cellData,n=e.rowData;if(!n.pq_gsummary&&!n.pq_gtitle)return t=i&&i.show?r.expandIcon:r.collapseIcon,"
"}}e.paramquery.cHierarchy=t;var r=t.prototype=new e.paramquery.cClass;r.tableWidthChange=function(){if(this.refreshComplete){this.refreshComplete=!1;for(var t=this.that,r=t.$tbl.children("tbody").children("tr.pq-detail-child").children("td.pq-detail-child"),i=0,o=r.length;o>i;i++)for(var n=r[i],a=e(n),l=a.find(".pq-grid"),s=0,d=l.length;d>s;s++){var c=e(l[s]);c.is(":visible")&&c.pqGrid("onWindowResize")}this.refreshComplete=!0}},r.aftertable=function(t){var r=this.that,i=r.options.detailModel.init,o=r.pdata;if(this.refreshComplete){this.refreshComplete=!1,t=t?t:r.$tbl.children("tbody").children("tr.pq-detail-child");for(var n=0,a=t.length;a>n;n++){var l=t[n],s=e(l),d=s.attr("pq-row-indx"),c=o[d],h=!1,u=c.pq_detail.child;u||"function"==typeof i&&(h=!0,u=i.call(r.element[0],{rowData:c}),c.pq_detail.child=u,c.pq_detail.height=25);var f=s.children("td.pq-detail-child");f.append(u);for(var p=f.find(".pq-grid"),g=0,v=p.length;v>g;g++){var w=e(p[g]);h?w.hasClass("pq-pending-refresh")&&w.is(":visible")&&(w.removeClass("pq-pending-refresh"),w.pqGrid("refresh")):w.is(":visible")&&w.pqGrid("onWindowResize")}}this.refreshComplete=!0,this.detachView=!1}},r.beforeTableView=function(e,t){this.detachView||(this.detachInitView(),this.detachView=!0)},r.detachInitView=function(t){var r=this.that,i=r.$tbl;if(i&&i.length){t=t?t:i.children("tbody").children("tr.pq-detail-child");for(var o=0;oa;a++){var l=o[a];l.outerWidth=l._width+r}i.show&&(i.outerWidth=i.width)},i.autoFit=function(){var e=this.that,t=e.colModel,r=t.length,i=e.calcWidthCols(-1,r,!0),o=this.contWd-this.getSBWidth();if(i!==o){for(var n,a=i-o,l=[],s=0;r>s;s++){var d=t[s],c=d._percent,h=(d.resizable!==!1,d._resized),u=d.hidden;if(!u&&!c&&!h){var f;0>a?(f=d._maxWidth-d._width,f&&l.push({availWd:-1*f,colIndx:s})):(f=d._width-d._minWidth,f&&l.push({availWd:f,colIndx:s}))}h&&(n=d,delete d._resized)}l.sort(function(e,t){return e.availWd>t.availWd?1:e.availWds;s++){var g,v=l[s],f=v.availWd,w=v.colIndx,m=Math.round(a/(p-s)),d=t[w],x=d._width;Math.abs(f)>Math.abs(m)?(g=x-m,a-=m):(g=x-f,a-=f),d.width=d._width=g}if(0!=a&&n){var g=n._width-a;g>n._maxWidth?g=n._maxWidth:g=n;v--){var w=i[v];if(!w.hidden){var m=w._width+r;if(s-=m,0>s){d=!0,u=f+s>=p?f+s:f+m+s;break}}}d||(u=f+s),u>g?u=g:p>u&&(u=p),h.width=h._width=u}}},i.numericVal=function(e,t){var r;return r=(e+"").indexOf("%")>-1?parseInt(e)*t/100:parseInt(e),Math.round(r)},i.refreshColumnWidths=function(e){e=e||{};var t=this.that,r=t.options,i=r.numberCell,o="flex"===r.width,n=0,a=t.colModel,l=r.scrollModel,s=l.lastColumn,d=l.autoFit,c=this.contWd,h=a.length,u=this.getSBWidth(),f=r._minColWidth,p=r._maxColWidth,g=0;i.show&&(i.widthv||isNaN(v)){if(r.debug)throw"availWidth N/A"}else{delete t.percentColumn;for(var m=0;h>m;m++){var x=a[m],_=x.hidden;if(!_){var I=x.width,y=(I+"").indexOf("%")>-1?!0:null,b=x.minWidth,C=x.maxWidth,b=b?this.numericVal(b,v):f,C=C?this.numericVal(C,v):p;if(b>C&&(C=b),void 0!=I){var q,M=0;!o&&y?(t.percentColumn=!0,x.resizable=!1,x._percent=!0,q=this.numericVal(I,v)-n,M=Math.floor(q),w+=q-M,w>=1&&(M+=1,w-=1)):I&&(M=parseInt(I)),b>M?M=b:!o&&M>C&&(M=C),x._width=M}else x._width=b;y||(x.width=x._width),x._minWidth=b,x._maxWidth=o?1e3:C}}o===!1&&e.refreshWidth!==!1&&(d&&this.autoFit(),"auto"===s&&r.virtualX&&this.autoLastColumn()),this._computeOuterWidths()}},i.estRowsInViewPort=function(){var e=Math.ceil(this.contHt/this.rowHt);return this.that.pageSize=e,e},i._refreshFrozenLine=function(){var t=this.that,r=t.options,i=r.numberCell,o=t.$cont_o,n=r.freezeBorders,a=r.freezeCols,l=r.freezeRows;if(this.$freezeLine&&this.$freezeLine.remove(),this.$freezeLineH&&this.$freezeLineH.remove(),n){if(a){var s=t.calcWidthCols(-1,a);isNaN(s)||0===s||s>0&&i.show&&s===i.width||(this.$freezeLine=e(["
","
"].join("")).appendTo(o))}if(l){var d=t.$tbl;if(d){var c=d.children("tbody").children(".pq-last-frozen-row")[0];if(c){var h=c.offsetTop+c.offsetHeight-1;this.$freezeLineH=e("
").appendTo(o)}}}}},i.setScrollVNumEles=function(t){t=t||{};var r=this.that,i=r.vscroll,o=r.options;if(!o.maxHeight&&"flex"===o.height)return i.option("num_eles",0),0;var n,a,l=!!r.iHierarchy,s=parseInt(i.option("num_eles")),d=parseInt(i.option("cur_pos")),c=this.getEContHt(),h=r.pdata,u=h?r.totalVisibleRows:0,f=0;if(r.$tbl&&r.$tbl.length>0&&(n=r.$tbl[r.$tbl.length-1],f=n.scrollHeight,a=e(n)),f>0){for(var p=a.children().children("tr"),g=0,v=0,w=1;w=c){l&&e(m).hasClass("pq-detail-child")&&(v=v>1?v-1:1);break}l?e(m).hasClass("pq-detail-child")===!1&&v++:v++}s=u-v+1}else s=d+1;return s>u&&(s=u),g>c&&l&&s++,i.option("num_eles",s),s},i._setScrollVLength=function(e){e=e||{};var t=this.that,r=t.options;if("flex"!==r.height||r.maxHeight){var i=this.getSBHeight(),o=this.contHt-i+this.headerHt-2;t.vscroll.widget().css("bottom",i),t.vscroll.option("length",o)}},i.setHeaderHeight=function(){var t,r,i,o=this.that,n=o.$header,a="scrollHeight",l=".pq-grid-header-search-row";if(n&&n.length){if(n.length>1){if(t=n[0][a],r=n[1][a],i=Math.max(t,r),t!==r){var s=e(n[0]).find(l),d=e(n[1]).find(l);s.length&&(s.css("height",""),d.css("height",""),t=n[0][a],r=n[1][a],i=Math.max(t,r),i>t?s.height(d[0][a]):d.height(s[0][a]))}}else t=n[0][a],i=t;o.$header_o.height(i-3),this.headerHt=i-1}else o.$header_o.height(0),this.headerHt=0},i.initContHeight=function(){var e=this.that,t=e.options,r="flex"==t.height;r&&!t.maxHeight||(this.contHt=this.height-(t.showHeader?this.rowHt:0)-(t.showTop?e.$top[0].offsetHeight:0)-(t.showBottom?e.$bottom[0].offsetHeight:0))},i.initContWidth=function(){var e=this.that;e.options;this.contWd=this.width},i.setContHeight=function(e){e=e||{};var r=this.that,i=r.$top,o=r.options,n=this.height-r.$header_o[0].offsetHeight-(o.showTop?i[0].offsetHeight+parseInt(t(i[0],"marginTop")):0)-r.$bottom[0].offsetHeight+1;n=n>=0?n:"",r.$cont.height(n),this.contHt=n},i.setContAndGridHeightForFlex=function(){var e=this.that,t=e.hscroll.widget();if(this.vscroll)t.css("position","");else{t.css("position","relative");var r=e.$cont,i=e.options.cls,o=r.children("."+i.cont_inner_b);r.height(""),o.length||(o=r.children("."+i.cont_inner)),o.height(""),e.element.height(""),e.$grid_center.height("")}},i.setContAndGridWidthForFlex=function(){var e=this.that,t=e.options,r=t.maxWidth,i=this.maxWidthPixel,o=e.calcWidthCols(-1,e.colModel.length),n=e.element,a=this.getSBWidth(),l=o+a;r&&l>=i&&(l=i),this.contWd=l,n.width(l+"px")},i.getTotalVisibleRows=function(e,t,r){var i=this.that,o=this.vrows,n=this.estRowsInViewPort(),a=0,l=r?r.length:0,s=t,d=0,c=0,h=null,u=!!i.iHierarchy,f=i.options,p=f.detailModel.offset,g=0,v=this.rowHt,w=u?this.contHt:void 0;if(null==r||0==l)return{initV:null,finalV:null,tvRows:a,lastFrozenRow:null};for(var m=0,x=l>t?t:l;x>m;m++){var _=r[m],I=_.pq_hidden;if(!I&&(h=m,a++,u)){var y=_.pq_detail;if(y&&y.show){var b=y.height||0;b>p&&(b=p),g+=b+v}else g+=v}}if(t>l)return{initV:h,finalV:h,tvRows:a,lastFrozenRow:h};n-=a,s=d=o[e],c=0;for(var m=s,x=l;x>m;m++){var _=r[m],I=_.pq_hidden;if(I)d++;else{if(c===n)break;d++,c++}if(u&&!I){var y=_.pq_detail;if(y&&y.show){var b=y.height||0;b>p&&(b=p),g+=b+v}else g+=v;if(g>w)break}}return a+=o.length,s=s>=l?l-1:s,d=d>=l?l-1:d,d=s>d?s:d,{initV:s,finalV:d,tvRows:a,lastFrozenRow:h}},i.setInitH=function(e,t){var r=this.that;r.initH=e,r.finalH=t},i.setInitV=function(e,t){var r,i=this.that;null!=e&&null!=t||(r=this.vrows,r&&r.length&&(e=t=r[r.length-1])),i.initV=e,i.finalV=t},i.calcVisibleV=function(){var e,t=this.that,r=t.options,i=r.freezeRows,o=t.pdata||[],n=o.length,a=[],l=0;for(e=0;i>e;e++)o[e].pq_hidden||(a[l++]=e);for(this.vfrows=a,l=0,a=[],e=i;n>e;e++)o[e].pq_hidden||(a[l++]=e);this.vrows=a},i.calcVisibleH=function(){for(var e,t=this.that,r=t.options,i=r.freezeCols,o=[],n=0,a=t.colModel,e=i,l=a.length;l>e;e++)a[e].hidden||(o[n++]=e);this.vcols=o},i.calcInitFinal=function(){var e,t,r=this.that,i=r.options,o=i.virtualY,n=i.freezeRows,a="flex"===i.height,l=r.pdata;if(null==l||0===l.length){var s=this.getTotalVisibleRows(d,n,l);r.totalVisibleRows=s.tvRows,e=s.initV,t=s.finalV,r.lastFrozenRow=s.lastFrozenRow}else if(o){var d=parseInt(r.vscroll.option("cur_pos"));if(isNaN(d)||0>d)throw"cur_pos NA";r.scrollCurPos=d;var s=this.getTotalVisibleRows(d,n,l);r.totalVisibleRows=s.tvRows,e=s.initV,r.lastFrozenRow=s.lastFrozenRow,t=a&&!i.maxHeight?l.length-1:s.finalV}else{var s=this.getTotalVisibleRows(0,n,l);r.lastFrozenRow=s.lastFrozenRow,r.totalVisibleRows=s.tvRows,e=0,t=l.length-1}this.setInitV(e,t)},i.calcInitFinalH=function(){var e,t,r=this.that,i=r.options,o=i.virtualX,n=r.colModel,a=n.length;if(o){var e,l=parseInt(r.hscroll.option("cur_pos")),s=parseInt(i.freezeCols),d="flex"===i.width,c=this.vcols;if(c||(this.calcVisibleH(),c=this.vcols),l>=c.length&&(l=c.length-1),e=c[l],e>a-1&&(e=a-1),(0>e||null==e)&&(e=0),d&&!i.maxWidth)t=a-1;else{for(var h=r.calcWidthCols(-1,s),u=this.getEContWd(),f=e;a>f;f++){var p=n[f];if(!p.hidden){var g=p.outerWidth;if(!g&&i.debug)throw"outerwidth N/A";if(h+=g,h>u)break}}t=f,t>a-1&&(t=a-1),s-1>t&&(t=s-1)}}else e=0,t=a-1;this.setInitH(e,t)},i._calcOffset=function(e){var t=/(-|\+)([0-9]+)/,r=t.exec(e);return r&&3===r.length?parseInt(r[1]+r[2]):0},i.setMax=function(e){var t=this.that,r=t.element,i=t.options,o=i[e];o?(o==parseInt(o)&&(o+="px"),r.css(e,o)):r.css(e,"")},i.refreshGridWidthAndHeight=function(){var t,r,i=this.that,o=i.options,n=(o.width+"").indexOf("%")>-1,a=(o.height+"").indexOf("%")>-1,l=(o.maxHeight+"").indexOf("%")>-1,s="flex"==o.height,d=l&&s,c=(o.maxWidth+"").indexOf("%")>-1,h="flex"==o.width,u=c&&h,f=i.element;if(n||a||d||u){var p=f.parent();if(!p.length)return;var g,v;p[0]==document.body||"fixed"==f.css("position")?(g=e(window).width(),v=window.innerHeight?window.innerHeight:e(window).height()):(g=p.width(),v=p.height());var w=this._calcOffset,m=n?w(o.width):0,x=a?w(o.height):0;u?t=parseInt(o.maxWidth)*g/100:n&&(t=parseInt(o.width)*g/100+m),d?r=parseInt(o.maxHeight)*v/100:a&&(r=parseInt(o.height)*v/100+x)}t||(h&&o.maxWidth?c||(t=o.maxWidth):n||(t=o.width)),o.maxWidth&&(this.maxWidthPixel=t),r||(s&&o.maxHeight?l||(r=o.maxHeight):a||(r=o.height)),parseFloat(t)==t?(t=t=d;d++)!e&&o&&a>d&&d>=n&&(d=a),s[d]={outerWidth:i[d].outerWidth};return s},i._isColumnWidthChanged=function(e){for(var t=this.that,r=t.colModel,i=t.iGenerateView.colDef,o=0,n=i.length;n>o;o++){var a=i[o],l=a.colIndx;if(r[l].outerWidth!==e[l].outerWidth)return!0}return!1},i.softRefresh=function(){var e=this.that,t=e.options;this.refreshScrollbars(),e.iGenerateView.setPanes(),e._saveDims(),e.iMouseSelection.syncScrollBarVert(),"flex"==t.height&&this.setContAndGridHeightForFlex(),"flex"==t.width&&this.setContAndGridWidthForFlex(),this._refreshFrozenLine()},i.refreshScrollbars=function(e){e=e||{};var t,r,i,o,n=this,a=n.that,l=a.options,s=a.iGenerateView,d="flex"===l.height,c="flex"===l.width;(d||n.contHt)&&(c||n.contWd)&&null!==a.totalVisibleRows&&(r=n.setScrollVNumEles(e),o=r>1,d&&!l.maxHeight||o===n.vscroll||(n.vscroll=o,l.scrollModel.autoFit||l.virtualX||c?(t=n._storeColumnWidths(),n.refreshColumnWidths(),(n._isColumnWidthChanged(t)||c)&&(n.ignoreTResize=!0,n._refreshTableWidths(t,{table:!0,header:!0}),delete n.ignoreTResize,n.setHeaderHeight(),n.setContHeight(),s.setPanes(),r=n.setScrollVNumEles(!0),o=r>1,n.vscroll=o),t=null):s.setPanes()),r=n.setScrollHNumEles(),i=r>1,n.hscroll!=i&&(n.hscroll=i,s.setPanes()),n._setScrollHLength(),n._setScrollVLength(e),n._setScrollHVLength())},i._setScrollHVLength=function(){var e=this.that;this.vscroll&&this.hscroll||e.$hvscroll.css("visibility","hidden")},i._setScrollHLength=function(){var e=this.that,t=e.hscroll.widget(),r=e.$hvscroll,i=e.options;if(!i.scrollModel.horizontal)return t.css("visibility","hidden"),void r.css("visibility","hidden");t.css("visibility",""),r.css("visibility","");var o=this.contWd,n=this.getSBWidth();t.css("right",0===n?0:""),e.hscroll.option("length",o-n)},i.estVscroll=function(){var e=this.that,t=!0;null==e.totalVisibleRows||null==this.contHt?t=!1:e.totalVisibleRows*this.rowHt1&&(t=!0),this.hscroll=t},i.getSBHeight=function(){return null==this.hscroll&&this.estHscroll(),this.hscroll?17:0},i.getEContHt=function(){if(null==this.contHt)throw"contHt N/A";return this.contHt-this.getSBHeight()},i.getEContWd=function(){if(null==this.contWd)throw"contWd N/A";return this.contWd-this.getSBWidth()},i.calcColsOutsideCont=function(e){var t=this.that,r=t.options,i=r.numberCell,o=r.freezeCols,n=this.contWd-this.getSBWidth(),a=0;i.show&&(a+=i.outerWidth);for(var l=0;ln&&c++,l=o;ln))break;c++}return c},i.setScrollHNumEles=function(){var e=this.that,t=e.options,r=e.colModel,i=t.scrollModel,o=e.hscroll,n=1*o.option("cur_pos"),a=0;return("flex"!==t.width||t.maxWidth)&&(a="fullScroll"===i.lastColumn?r.length-t.freezeCols-e._calcNumHiddenUnFrozens():this.calcColsOutsideCont(r)+1),n&&n>=a&&(a=n+1),e.hscroll.option("num_eles",a),a},i.init=function(){var e=this.that,t=e.options;this.hscroll=this.vscroll=this.contHt=this.contWd=null,e.initH=e.initV=e.finalH=e.finalV=null,e.totalVisibleRows=e.lastFrozenRow=null,this.rowHt=t.rowHeight,this.headerHt=0,this.height=null},i.refresh=function(e){e=e||{};var t,r=this,i=r.that,o=e.header,n=e.table,a=e.pager,l=i.iGenerateView,s=i.element;if(!s[0].offsetWidth)return void s.addClass("pq-pending-refresh");if(e.toolbar&&i.refreshToolbar(),i.iMouseSelection.resetMargins(),r.init(),t=i.options,r.decidePanes(),t.collapsible._collapsed=!1,r.setMax("maxHeight"),r.setMax("maxWidth"),r.refreshGridWidthAndHeight(),r.initContHeight(),r.initContWidth(),r.calcInitFinal(),o===!1||n===!1)var d=r._storeColumnWidths(!0);r.refreshColumnWidths(),r.calcInitFinalH(),l.createColDefs(),o!==!1?i._createHeader():r._isColumnWidthChanged(d)&&r._refreshTableWidths(d,{header:!0}),i._refreshHeaderSortIcons(),a!==!1&&i._refreshPager(),r.setHeaderHeight(),r.setContHeight(),n!==!1?l.generateView({source:e.source}):(r._refreshTableWidths(d,{table:!0}),l.setPanes()),i._saveDims(),l.scrollView(),r.refreshScrollbars(),"flex"==t.height&&r.setContAndGridHeightForFlex(),"flex"==t.width&&r.setContAndGridWidthForFlex(),r._refreshFrozenLine(),i._createCollapse(),t.dataModel.postDataOnce=void 0},i.summaryTable=function(){var t,r=this,i=r.$summary,o=r.that,n=o.options.summaryData;n?(i||(i=r.$summary=e("
").prependTo(o.$bottom)),t={data:n,$cont:i},o.createTable(t)):i&&i[0].innerHTML&&i.empty()},i.refreshVscroll=function(e){var t=this.that,r=t.iGenerateView,i=t.options;if(i.virtualY&&!i.scrollModel.smooth){var o=t.initV,n=t.finalV;this.calcInitFinal();var a=o-t.initV,l=n-t.finalV;i.fullrefreshOnScroll||i.detailModel.init||t._mergeCells||1!=Math.abs(a)||1!=Math.abs(l)?o==t.initV&&n==t.finalV||r.generateView():-1==a?(r.removeTopRow(1),r.appendRow(t.finalV-n)):1==a&&(r.prependRow(),r.removeBottomRow(n-t.finalV)),t._saveDims();var s;r.scrollView(),s=this.setScrollVNumEles(),1>=s&&this.refreshScrollbars()}},i._refreshTableWidths=function(e,t){var r,i,o=this.that,n=o.$tbl_header,a=t.header&&n,l=o.$tbl,s=t.table&&l,d=a?n.children().children(".pq-row-hidden"):null,c=a?o.$header.find(".pq-grid-col-resize-handle"):null,h=s&&l?l.children().children(".pq-row-hidden"):null,u=!1,f=0;if(s&&o.tables.length){var p=o.tables[0].$tbl.children().children(".pq-row-hidden");h=h?h.add(p):p}for(var g=o.iGenerateView.colDef,v=0,w=g.length;w>v;v++){var m=g[v],x=m.colIndx,_=m.column,I=e[x],y=I.outerWidth,b=_.outerWidth;if(b!==y&&(a&&(r=d.find("td[pq-col-indx="+x+"]"),r.width(b)),h&&(i=h.find("td[pq-col-indx="+x+"]"),i.length&&(u=!0,i.width(b)))),f+=b-y,a&&0!==f){var C=c.filter("[pq-col-indx="+x+"]"),q=parseInt(C.css("left"));C.css("left",q+f)}}u&&o._trigger("tableWidthChange"),o._saveDims()}}(jQuery),function(e){function t(e,t,r){for(var i=0,o=e.length;o>i;i++){for(var n=e[i],a={},l=0,s=t.length;s>l;l++){var d=t[l];a[d]=n[d]}r.push(a)}}function r(e){var t=this;t.that=e,t.findformulas(),e.on("columnChange",function(){t.findformulas()}).on("dataAvailable",function(){t._onDA()}).on(!0,"change",function(e,r){t._onchange(r)})}var i=e.paramquery,o=i.cClass,n={};n.options={flex:{on:!0,one:!1,all:!0},detailModel:{cache:!0,offset:100,expandIcon:"ui-icon-triangle-1-se glyphicon glyphicon-minus",collapseIcon:"ui-icon-triangle-1-e glyphicon glyphicon-plus"},dragColumns:{enabled:!0,acceptIcon:"ui-icon-check glyphicon-ok",rejectIcon:"ui-icon-closethick glyphicon-remove",topIcon:"ui-icon-circle-arrow-s glyphicon glyphicon-circle-arrow-down",bottomIcon:"ui-icon-circle-arrow-n glyphicon glyphicon-circle-arrow-up"},track:null,mergeModel:{flex:!1},realFocus:!0,sortModel:{on:!0,type:"local",multiKey:"shiftKey",number:!0,single:!0,cancel:!0,sorter:[],useCache:!0,ignoreCase:!1},filterModel:{on:!0,type:"local",mode:"AND",header:!1}},n._create=function(){var e=this,t=e.options;e.listeners={},e._queueATriggers={},e.iHistory=new i.cHistory(e),e.iGroup=new i.cGroup(e),i.cMerge&&(e.iMerge=new i.cMerge(e)),e.iFilterData=new i.cFilterData(e),e.iSelection=new pq.Selection(e),e.iHeaderSearch=new l(e),e.iUCData=new i.cUCData(e),e.iMouseSelection=new i.cMouseSelection(e),e._super(),new r(e),e.iDragColumns=new i.cDragColumns(e),e.refreshToolbar(),"remote"===t.dataModel.location&&e.refresh({table:!0}),e.on("dataAvailable",function(){e.one("refreshDone",function(){e._trigger("ready"),setTimeout(function(){e.element&&e._trigger("complete")},0)})}),e.refreshDataAndView({header:!0})},e.widget("paramquery.pqGrid",i._pqGrid,n),e.widget.extend=function(){var t,r,i=Array.prototype.shift,o=e.isPlainObject,n=e.isArray,a=e.widget.extend,l=i.apply(arguments);"boolean"==typeof l&&(t=l,l=i.apply(arguments));var s,d,c,h=arguments,u=0,f=h.length;for(null==t&&(t=f>1);f>u;u++){s=h[u];for(d in s)c=s[d],void 0!==c&&(r=!(u>0),o(c)?(l[d]=l[d]||{},a(r,l[d],c)):n(c)?l[d]=t&&r?c.slice():c:l[d]=c)}return l},pq.grid=function(t,r){var i=e(t).pqGrid(r),o=i.data("paramqueryPqGrid")||i.data("paramquery-pqGrid");return o},i.pqGrid.regional={};var a=i.pqGrid.prototype;i.pqGrid.defaults=a.options,a.focus=function(t){t=t||{};var r,i=this,o=t.$td,n=t.rowIndxPage,a=t.colIndx,l=document.activeElement;if(o){if(null==n||null==a){var s=this.getCellIndices({$td:o});n=s.rowIndxPage,a=s.colIndx}}else{if(null==n||null==a){if(l&&l!=document.body&&"pq-grid-excel"!=l.id&&"pq-grid-cont"!=l.className)return;var d=this._focusElement;if(!d)return;n=d.rowIndxPage,a=d.colIndx}var c=this.iMerge,h=n+this.rowIndxOffset;if(c.ismergedCell(h,a)){var u=c.getRootCell(h,a,"o");n=u.rowIndxPage,a=u.colIndx}o=i.getCell({rowIndxPage:n,colIndx:a})}if(this.options.realFocus){if(this._focusElement={$ele:o,rowIndxPage:n,colIndx:a},!(r=o[0])||"TD"!=r.nodeName.toUpperCase()){var f=this.options.dataModel.data;return void(f&&f.length||this.$cont.focus())}e(l).hasClass("pq-editor-focus")===!1&&(r.setAttribute("tabindex",0),r.focus())}else{var p=this._focusElement;p&&(this.removeClass({rowIndxPage:p.rowIndxPage,colIndx:p.colIndx,cls:"pq-focus",refresh:!1}),this.element.find(".pq-focus").removeClass("pq-focus")),o&&(this.addClass({rowIndxPage:n,colIndx:a,cls:"pq-focus"}),this._focusElement={$ele:o,rowIndxPage:n,colIndx:a});var g=this.$cont;document.activeElement!=g[0]&&g[0].focus()}},a.onfocus=function(){if(!this.options.realFocus){var e=this._focusElement;if(e){var t=e.rowIndxPage,r=e.colIndx;this.addClass({rowIndxPage:t,colIndx:r,cls:"pq-focus"})}}},a.onblur=function(){if(!this.options.realFocus){var e=this._focusElement;if(e){var t=e.rowIndxPage,r=e.colIndx;this.removeClass({rowIndxPage:t,colIndx:r,cls:"pq-focus"})}}},a.range=function(e,t){return new pq.Range(this,e,"range",t)},a.rowExpand=function(e){this.iHierarchy.rowExpand(e)},a.rowInvalidate=function(e){this.iHierarchy.rowInvalidate(e)},a.rowCollapse=function(e){this.iHierarchy.rowCollapse(e)},a.saveState=function(t){t=t||{};for(var r,i,o,n=this,a=n.element,l=e.extend,s=n.options,d=s.sortModel,c=l(!0,{},{sorter:d.sorter}),h=s.pageModel,u={rPP:h.rPP,curPage:h.curPage},f=n.colModel,p=[],g=0,v=f.length,w=s.groupModel,m=l(!0,{},{dataIndx:w.dataIndx,dir:w.dir,collapsed:w.collapsed,merge:w.merge,grandSummary:w.grandSummary}),x=a[0].id;v>g;g++)r=f[g],o={width:r.width,dataIndx:r.dataIndx,hidden:r.hidden},(i=r.filter)&&(o.filter={value:i.value,value2:i.value2,on:i.on}),p[g]=o;var _={colModel:p,height:s.height,datestamp:Date.now(),width:s.width,groupModel:m,pageModel:u,sortModel:c,freezeRows:s.freezeRows,freezeCols:s.freezeCols};return t.stringify!==!1&&(_=JSON.stringify(_),t.save!==!1&&"undefined"!=typeof Storage&&localStorage.setItem("pq-grid"+(x?x:""),_)),_},a.loadState=function(t){t=t||{};var r,i=this,o=i.element,n=e.widget.extend,a=e.extend,l=o[0].id,s=t.state||("undefined"==typeof Storage?void 0:localStorage.getItem("pq-grid"+(l||"")));if(!s)return!1;"string"==typeof s&&(s=JSON.parse(s));for(var d,c,h,u=s.colModel,f=[],p=[],g=[],v=[],w=[],m=i.options,x=i.depth>1,_=x?i.colModel:m.colModel,I=0,y=u.length;y>I;I++)d=u[I],h=d.dataIndx,p[h]=!0,g[h]=I,f[h]=d.width,v[h]=d.filter,w[h]=d.hidden;x||_.sort(function(e,t){return g[e.dataIndx]-g[t.dataIndx]});for(var I=0,y=_.length;y>I;I++)c=_[I],h=c.dataIndx,p[h]&&(c.width=f[h]||c.width,c.filter=a(c.filter,v[h]),c.hidden=w[h]);i.iColModel.init(),n(m.sortModel,s.sortModel),n(m.pageModel,s.pageModel);var b=s.groupModel;return i.groupOption(b,!1),r={freezeRows:s.freezeRows,freezeCols:s.freezeCols},isNaN(1*m.height)||isNaN(1*s.height)||(r.height=s.height),isNaN(1*m.width)||isNaN(1*s.width)||(r.width=s.width),i.option(r),t.refresh!==!1&&i.refreshDataAndView(),!0};var l=function(t){function r(e,r,i){t.filter({data:[{dataIndx:e,value:r,value2:i}]})}this.that=t;var i=this;this.dataHS={},t.on("headerKeyDown",function(t,r){var o=e(t.originalEvent.target);return o.hasClass("pq-grid-hd-search-field")?i.onKeyDown(t,r,o):!0}),t.on("createHeader",function(e,t){return i._onCreateHeader()}),this.changeListener={change:function(e,t){r(t.dataIndx,t.value,t.value2)}},this.keyupListener={keyup:function(e,t){r(t.dataIndx,t.value,t.value2)}},this.clickListener={click:function(e,t){r(t.dataIndx,t.value)}}},s=l.prototype=new o;s.get$Ele=function(t,r){var i,o=this.that,n=o.options.freezeCols,a=e(o.$tbl_header[0]),l=".pq-grid-hd-search-field[name='"+r+"']",s=e(o.$tbl_header[2==o.$tbl_header.length?1:0]);return i=t>=n?s.find(l):a.find(l)},s.onKeyDown=function(t,r,i){var o=this.that,n=t.keyCode,a=e.ui.keyCode;if(n!==a.TAB)return!0;var l,s=i.attr("name"),d=o.getColIndx({dataIndx:s}),c=o.colModel,h=t.shiftKey,u=c[d];if("between"==u.filter.condition){o.scrollColumn({colIndx:d});var f=this.get$Ele(d,s);if(f[0]==i[0]?h||(l=f[1]):h&&(l=f[0]),l)return l.focus(),t.preventDefault(),!1}for(;;){if(h?d--:d++,0>d||d>=c.length)break;var u=c[d],p=u.filter;if(!u.hidden&&p){o.scrollColumn({colIndx:d});var l,s=u.dataIndx,l=this.get$Ele(d,s);if("between"==p.condition&&(l=e(h?l[1]:l[0])),l)return l.focus(),t.preventDefault(),!1;break}}},s._bindFocus=function(){function t(t){var o=e(t.target),n=o.closest(".pq-grid-hd-search-field"),a=n.attr("name");if(r.scrollColumn({dataIndx:a})){var l=r.getColIndx({dataIndx:a}),s=i.get$Ele(l,a);s.focus()}}for(var r=this.that,i=this,o=r.$header.find(".pq-grid-header-search-row"),n=0;n1){s.find(c).css("visibility","hidden");for(var h=0;a>h;h++){var u=n[h],f=u.dataIndx,c="*[name='"+f+"']";s.find(c).css("visibility","visible"),d.find(c).css("visibility","hidden")}}for(var p=r.iGenerateView.colDef,h=0,g=p.length;g>h;h++){var v=p[h],w=v.colIndx,u=v.column,m=u.filter;if(m){var x=u.dataIndx,_=s;w>=a&&l.length>1&&(_=d);var I=_.find("*[name='"+x+"']");if(0!=I.length){var y=m.type,b=m.value,C=m.value2;"checkbox"==y&&"triple"==m.subtype?I.pqval({val:b}):"select"==y&&null!=b&&I.val(b);var q=m.init;q&&q.call(I,{dataIndx:x,column:u});var M=m.listeners;if(M)for(var D=0;D",e,"
","-","
",t,"
"].join("");return r};s.createDOM=function(e,t){var r=this.that,o=r.options,n=o.bootstrap.on,a=n?" ":" ui-corner-all",l=(this.dataHS,o.numberCell),s=d;e.push(""),l.show&&e.push(["","
 
"].join(""));for(var c=r.iGenerateView.colDef,h=0,u=c.length;u>h;h++){var f=c[h],p=f.column,g=t,v=p.halign;v||(v=p.align),"right"==v?g+=" pq-align-right":"center"==v&&(g+=" pq-align-center");var w=p.cls;w&&(g=g+" "+w);var m=p.filter;if(m){var x=p.dataIndx,_=m.type,I=m.value,y=m.condition,b=m.cls,b="pq-grid-hd-search-field "+(b?b:""),C=m.style,C=C?C:"",q=m.attr,q=q?q:"",M="";if("between"==y)var D=m.value2,D=null!=D?D:"";if("textbox"===_)I=I?I:"",b=b+" pq-search-txt"+a,M="between"==y?s(this._input(x,I,b+" pq-from",C,q),this._input(x,D,b+" pq-to",C,q)):this._input(x,I,b,C,q);else if("textarea"===_)I=I?I:"",b=b+" pq-search-txt"+a,M="between"==y?s(this._textarea(x,I,b+" pq-from",C,q),this._textarea(x,D,b+" pq-to",C,q)):this._textarea(x,I,b,C,q);else if("select"===_)if(m.cache)M=m.cache;else{var R=m.options;"function"==typeof R&&(R=R.call(r,{column:p,value:I,dataIndx:x,cls:b,style:C,attr:q})),b+=a;var P=["name='",x,"' class='",b,"' style='",C,"' ",q].join("");M=i.select({options:R,attr:P,prepend:m.prepend,valueIndx:m.valueIndx,labelIndx:m.labelIndx,groupIndx:m.groupIndx}),m.cache=M}else if("checkbox"==_){var T=null==I||0==I?"":"checked=checked";M=[""].join("")}else"string"==typeof _?M=_:"function"==typeof _&&(M=_.call(r,{width:p.outerWidth,value:I,value2:D,column:p,dataIndx:x,cls:b,attr:q,style:C}));e.push(["
","",M,"
"].join(""))}else e.push(["
"," ","
"].join(""))}e.push("")},s._input=function(e,t,r,i,o){return['"].join("")},s._textarea=function(e,t,r,i,o){return[""].join("")},a.refreshToolbar=function(){var t,r=this,i=r.options,o=i.toolbar;if(r._toolbar&&(t=r._toolbar,t.destroy()),o){var n=o.cls,n=n?n:"",a=o.style,a=a?a:"",l=o.attr,l=l?l:"",s=o.items,d=e("
");t?t.widget().replaceWith(d):r.$top.append(d),t=pq.toolbar(d,{items:s,gridInstance:r,bootstrap:i.bootstrap}),i.showToolbar||d.css("display","none"),r._toolbar=t}},a.isLeftOrRight=function(e){var t=(this.options,this.freezeCols);return e>t?"right":"left"},a.ovCreateHeader=function(e,t){this.options.filterModel.header&&this.iHeaderSearch.createDOM(e,t)},a.filter=function(t){var r=this,i=this.options,o=void 0===t.apply?!0:t.apply,n=void 0===t.sort?!0:t.sort,a=i.dataModel,l=i.filterModel;if(void 0!=t)for(var s="replace"==t.oper,d=t.data,c=this.colModel,c=o?c:e.extend(!0,[],c),h=0,u=c.length,f=d.length,p=0;u>p;p++){for(var g=c[p],v=!1,w=0;f>w&&h!=f;w++){var m=d[w];if(m.dataIndx==g.dataIndx){v=!0,h++;var x=g.filter,_=m.condition,I=m.value;if(x?x.on=!0:x=g.filter={on:!0},_&&(x.condition=_),_=x.condition,x.value=I,"between"==_)x.value2=m.value2;else if("range"==_){var y=[];if(I)if("string"==typeof I){var b=x.options,C=I.indexOf('"'),q=I.lastIndexOf('"');if(I=I.substr(C,q+1),I=JSON.parse("["+I+"]"),b)for(var M=0,D=b.length;D>M;M++){var R=b[M];-1!=e.inArray(R,I)&&y.push(R)}else y=I.split(",s*")}else"function"==typeof I.push&&(y=I);x.value=y}break}}s&&!v&&g.filter&&(g.filter.on=!1)}var P={header:!1,apply:o,sort:n,CM:c};return"remote"!=a.location||"local"==l.type?(P.source="filter",P.trigger=!1,r._onDataAvailable(P)):void this.remoteRequest({apply:o,CM:c,callback:function(){return r._onDataAvailable(P)}})},a._initTypeColumns=function(){for(var e=this.colModel,t=0,r=e.length;r>t;t++){var o=e[t],n=o.type;"checkBoxSelection"===n||"checkbox"==n?(o.type="checkbox",new i.cCheckBoxColumn(this,o)):"detail"===n&&(o.dataIndx="pq_detail",this.iHierarchy=new i.cHierarchy(this,o))}},a.refreshHeader=function(){this._createHeader(),this.iGenerateView.setPanes(),this._refreshHeaderSortIcons()},a._refreshHeaderSortIcons=function(){this.iHeader.refreshHeaderSortIcons()},a.getLargestRowCol=function(e){for(var t,r=0;rt&&(t=o),t=i.rowIndx}},a.bringCellToView=function(e){this._bringCellToView(e)},a._setUrl=function(e){this.options.dataModel.getUrl=function(){return{url:this.url+(null!=e?e:"")}}},a.pageData=function(){return this.pdata},a.getData=function(e){e=e||{};var r=e.dataIndx,i=r?r.length:0,o=e.data,n=this.options.dataModel,a=n.data,l=n.dataUF,s=[];if(!i)return a.concat(l?l:[]);o?t(o,r,s):(a&&t(a,r,s),l&&t(l,r,s));for(var d=[],c=0;i>c;c++){var h=r[c],u=this.getColumn({dataIndx:h});d.push({dataIndx:h,dir:"up",dataType:u.dataType,sortType:u.sortType})}s=this.iSort._sortLocalData(d,s);for(var f=[],p=void 0,g=0,v=s.length;v>g;g++){var w=s[g],m=JSON.stringify(w);m!==p&&(f.push(w),p=m)}return f},a.get_p_data=function(){var e=this.options,t="remote"==e.pageModel.type,r=e.dataModel.data,i=this.pdata,o=this.rowIndxOffset,n=e.groupModel,a=o&&t?new Array(o):[],l=n.on&&n.dataIndx.length;return l?o?(t||(a=r.slice(0,o)),a.concat(i)):i:o&&t?a.concat(i):r},a._onDataAvailable=function(e){e=e||{};var t=this.options,r=null==e.apply?!0:e.apply,i=e.source,o=e.sort,n=[],a=t.filterModel,l=t.dataModel,s=t.sortModel,d=l.location; return r!==!1&&e.trigger!==!1&&this._trigger("dataAvailable",e.evt,{source:i}),n=a&&a.on&&("local"==d&&"remote"!=a.type||"remote"==d&&"local"==a.type)?this.iFilterData.filterLocalData(e).data:l.data,"local"==s.type&&o!==!1&&(r?this.sort({refresh:!1}):n=this.iSort.sortLocalData(n)),r===!1?n:(l.data=n,void this.refreshView(e))},a.reset=function(t){t=t||{};var r,i,o,n,a,l=this,s=t.sort,d=0,c=l.options,h=e.extend,u=t.filter,f=t.group;if(s||u||f){if(s&&(o=s===!0?{sorter:[]}:s,h(c.sortModel,o)),u)for(r=l.getColModel(),i=r.length;i>d;d++)a=r[d].filter,a&&(a.value=null,a.value2=null,a.cache=null);f&&(n=f===!0?{dataIndx:[]}:f,l.groupOption(n,!1)),t.refresh!==!1&&(u?(l.filter({oper:"replace",data:[]}),l.refreshHeader()):s?l.sort():l.refreshView())}},a._trigger=i._trigger,a.on=i.on,a.one=i.one,a.off=i.off,a.pager=function(){return this.pagerW},a.vscrollbar=function(){return this.vscroll},a.hscrollbar=function(){return this.hscroll},a.toolbar=function(){return this._toolbar.element},i.cCompute=r;var c=r.prototype;c.callRow=function(e,t,r){if(e)for(;r--;){var i=t[r],o=i.formula,n=i.column;e[n.dataIndx]=o.call(this.that,{rowData:e,column:n})}},c._onDA=function(){var e=this.formulas.length;if(e)for(var t=this.that.options,r=t.dataModel.data,i=r.length,o=this.formulas;i--;)this.callRow(r[i],o,e)},c._onchange=function(e){var t=this.formulas.length;if(t)for(var r=e.rowList,i=this.formulas,o=r.length;o--;)this.callRow(r[o].rowData,i,t)},c.findformulas=function(){for(var e,t,r=this.that,i=r.colModel,o=[],n=i.length;n--;)e=i[n],t=e.formula,t&&o.push({formula:t,column:e});this.formulas=o};var h=i.cColModel=h=function(e){this.that=e,this.init()},u=h.prototype;u.extend=function(t,r){for(var i,o,n=e.extend,a=t.length;a--;){var l=t[a];for(i in r)void 0===l[i]&&(o=r[i],o&&"object"==typeof o?l[i]=n(!0,{},o):l[i]=o)}},u.init=function(){var e,t,r,i=this.that,o=i.options,n=o.columnTemplate,a=o.colModel;a||(this._autoGenColumns(),a=o.colModel),e=this.nestedCols(a),i.depth=e.depth,t=i.colModel=e.colModel,r=t.length,n&&this.extend(t,n),this.getHeadersCells(),this.alignColumns(t,r),this.assignRowSpan(),this._refreshDataIndices(),i._trigger("CMInit")},u.alignColumns=function(e,t){for(var r=0;t>r;r++){var i=e[r];if(!i.align){var o=i.dataType;!o||"integer"!=o&&"float"!=o||(i.align="right")}}},u.nestedCols=function(e,t,r,i){var o=e.length,n=[];null==t&&(t=1);for(var a=t,l=0,s=0,d=0,c=0,h=0;o>h;h++){var u=e[h];u.parent=i?i:void 0,r===!0&&(u.hidden=r);var f=u.colModel;if(f&&f.length){var p=this.nestedCols(f,t+1,u.hidden,u);n=n.concat(p.colModel),p.colSpan>0?(p.depth>a&&(a=p.depth),u.colSpan=p.colSpan,l+=p.colSpan):u.colSpan=0,c+=p.o_colspan,u.o_colspan=p.o_colspan,u.childCount=p.childCount,d+=p.childCount}else u.hidden?u.colSpan=0:(u.colSpan=1,l++),c++,u.o_colspan=1,u.childCount=0,d++,n.push(u)}return{depth:a,colModel:n,colSpan:l,width:s,childCount:d,o_colspan:c}},u.getHeadersCells=function(){for(var e=this.that,t=e.options.colModel,r=e.colModel.length,i=e.depth,o=[],n=0;i>n;n++){o[n]=[];for(var a=0,l=0,s=0;r>s;s++){var d;if(0==n)d=t[a];else{var c=o[n-1][s],h=c.colModel;if(h&&0!=h.length){for(var u=s-c.leftPos,f=0,p=0,g=0;g0?h[g].childCount:1,f>u){p=g;break}d=h[p]}else d=c}var v=d.childCount?d.childCount:1;s==l?(d.leftPos=s,o[n][s]=d,l+=v,t[a+1]&&a++):o[n][s]=o[n][s-1]}}return e.headerCells=o,o},u.getDataType=function(){var e=this.colModel;if(e&&e[0]){var t=e[0].dataIndx;return"string"==typeof t?"JSON":"ARRAY"}},u.assignRowSpan=function(){for(var e=this.that,t=e.colModel.length,r=e.headerCells,i=e.depth,o=0;t>o;o++)for(var n=0;i>n;n++){var a=r[n][o];if(!(o>0&&a==r[n][o-1]||n>0&&a==r[n-1][o])){for(var l=1,s=n+1;i>s;s++){var d=r[s][o];a==d&&l++}a.rowSpan=l}}return r},u._autoGenColumns=function(){var t=this.that,r=t.options,i=r.columnTemplate||{},o=i.dataType,n=i.title,a=i.width,l=r.dataModel.data,s=pq.validation,d=[];if(l&&l.length){var c=l[0];e.each(c,function(e,t){var r="string";s.isInteger(t)?r=t+"".indexOf(".")>-1?"float":"integer":s.isDate(t)?r="date":s.isFloat(t)&&(r="float"),d.push({dataType:o?o:r,dataIndx:e,title:n?n:e,width:a?a:100})})}r.colModel=d},u._refreshDataIndices=function(){for(var e=this.that,t="JSON"==this.getDataType(),r={},i={},o={},n=e.colModel,a=n.length,l=0;a>l;l++){var s=n[l],d=s.dataIndx;null==d&&(d="detail"==s.type?"pq_detail":t?"dataIndx_"+l:l,"pq_detail"==d&&(s.dataType="object"),s.dataIndx=d),r[d]=s,i[d]=l;var c=s.validations;c&&(o[d]=o)}e.columns=r,e.colIndxs=i,e.validations=o}}(jQuery),function(e){var t=e.paramquery,r=t._pqGrid.prototype;r.exportExcel=function(e){return e=e||{},e.format="xlsx",this.exportData(e)},r.exportCsv=function(e){return e=e||{},e.format="csv",this.exportData(e)},r.exportData=function(e){var t=new i(this,e);return t.Export(e)};var i=t.cExport=function(e,t){var r=this,i="ParamQuery Pro";r.that=e,r.templates={content_types:'',workbook:[''].join(""),worksheet:'<%=content%>',rels:'',workbook_rels:''}},o=i.prototype;o.getTitle=function(e,t){var r=e.title;return r?"function"==typeof r&&(r=r.call(this.that,{colIndx:t,column:e,dataIndx:e.dataIndx,Export:!0})):r="",r},o.getRenderVal=function(e,t,r){var i=e.column,o=i.exportRender;return(t&&o!==!1||o)&&(i.render||i._render||i.format)?r.renderCell(e):e.rowData[e.dataIndx]},o.getXlsMergeCells=function(e,r,i,o){e=e.concat(i.getMergeCells(r,this.curPage,o));var n=[],a=t.toLetter,l=e.length;n.push('');for(var s=0;l>s;s++){var d=e[s];d=a(d.c1)+(d.r1+1)+":"+a(d.c2)+(d.r2+1),n.push('')}return n.push(""),l?n.join(""):""},o.getXlsCols=function(e,t){var r,i,o,n,a=[],l=0,s=function(e,t,r,i,o){e.push('')};a.push("");for(var d=0;t>d;d++){var c=e[d],h=c.hidden?"1":"0",u=c._width;c.copy!==!1&&(l++,u||(u=parseInt(c.width),u||(u=100)),o===u&&n===h?i=l:(null!=o&&(s(a,r,i,n,o),r=null),i=l,null==r&&(r=l)),o=u,n=h)}return s(a,r,i,n,o),a.push(""),a.join("")},o.getXlsHeader=function(e,t,r){for(var i=this,o=[],n=0;t>n;n++){var a=e[n];o.push("");for(var l=0,s=a.length;s>l;l++){var d=a[l];if(d.copy!==!1){var c=d.o_colspan,h=d.rowSpan,u=i.getTitle(d,l);n>0&&d==e[n-1][l]?u="":l>0&&d==e[n][l-1]?u="":(c>1||h>1)&&r.push({r1:n,c1:l,r2:n+h-1,c2:l+c-1}),o.push('")}}o.push("")}return o.join("")},o.getXlsBody=function(e,t,r,i,o,n,a,l,s){var d,c,h,u,f,p,g,v,w,m,x=this,_=[],I={integer:"Number","float":"Number",bool:"bool"};for(d=0;i>d;d++){for(p=r[d],w=p.pq_hidden?'hidden="1"':"",g=o?d+n:d,v=g-n,f={rowIndx:g,rowIndxPage:v,rowData:p,Export:!0},_.push(""),c=0;t>c;c++)u=e[c],u.copy!==!1&&(h=void 0,a.ismergedCell(g,c)&&(a.isRootCell(g,c,"o")||(h=null)),void 0===h&&(f.colIndx=c,f.column=u,f.dataIndx=u.dataIndx,h=x.getRenderVal(f,l,s)),m=null==h?null:I[u.dataType],"string"==typeof h&&(m="String"),m=m||"String",h=null==h?"":h,"String"==m?_.push('"):"Number"==m?_.push(""+h+""):"bool"==m?(h=h?"1":"0",_.push(''+h+"")):_.push(""+h+""));_.push("")}return _.join("\n")},o.getXlsContent=function(e,t,r,i,o,n,a,l,s,d,c,h){var u=this,f='',p=u.getXlsCols(e,t),g=[],v=h?i:0,f=f.replace("<%=a%>",v),f=f.replace("<%=b%>",v+1),w=h?u.getXlsHeader(r,i,g):"",m=u.getXlsBody(e,t,o,n,a,l,s,d,c),x=[f,p,"",w,m,"",u.getXlsMergeCells(g,h?i:0,s,n)].join("");return x},o.getHtmlHeader=function(e,t){for(var r,i,o,n,a,l=this,s=[],d=0;t>d;d++){var c=e[d],h=null;s.push("");for(var u=0,f=c.length;f>u;u++)r=c[u],i=r.colSpan,!r.hidden&&i&&r.copy!==!1&&(o=r.rowSpan,d>0&&r==e[d-1][u]||h&&u>0&&r==h||(n=l.getTitle(r,u),h=r,a=r.halign||r.align,a=a?"align="+a:"",s.push("",n,"")));s.push("")}return s.join("")},o.getHtmlBody=function(e,t,r,i,o,n,a,l,s){var d,c,h,u,f,p,g,v,w,m,x,_,I=this,y=[];for(d=0;i>d;d++)if(g=r[d],!g.pq_hidden){for(v=o?d+n:d,w=v-n,p={rowIndx:v,rowIndxPage:w,rowData:g,Export:!0},y.push(""),c=0;t>c;c++)if(h=e[c],!h.hidden&&h.copy!==!1){if(u=null,f=null,x="",a.ismergedCell(v,c)){if(!(f=a.isRootCell(v,c)))continue;u=a.getRootCell(v,c,"o"),u.Export=!0,m=I.getRenderVal(u,l,s),x="rowspan="+f.rowspan+" colspan="+f.colspan+" "}else p.colIndx=c,p.column=h,p.dataIndx=h.dataIndx,m=I.getRenderVal(p,l,s);_=h.align,x+=_?"align="+_:"",m=null==m?"":m,y.push("",m,"")}y.push("")}return y.join("")},o.getHtmlContent=function(e,t,r,i,o,n,a,l,s,d,c,h,u){var f=this,p=f.that,g=e.cssRules||"",v=p.element.find(".pq-grid-table"),w=v.css("font-family"),m=v.css("font-size"),x="table{empty-cells:show;font-family:"+w+";font-size:"+m+";border-collapse:collapse;}",_=[];return _.push("",'',"",e.title?e.title:"ParamQuery Pro","","","",""),_.push(u?f.getHtmlHeader(i,o,t):""),_.push(f.getHtmlBody(t,r,n,a,l,s,d,c,h)),_.push("
"),_.join("")},o.getCsvHeader=function(e,t,r,i){for(var o,n,a,l=this,s=[],d=[],c=0;t>c;c++){for(var h=e[c],u=null,f=0,p=h.length;p>f;f++)o=r[f],o.hidden||o.copy===!1||(n=h[f],c>0&&n==e[c-1][f]?s.push(""):u&&f>0&&n==u?s.push(""):(a=l.getTitle(n,f),a=a?a.replace(/\"/g,'""'):"",u=n,s.push('"'+a+'"')));d.push(s.join(i)),s=[]}return d},o.getCSVContent=function(e,t,r,i,o,n,a,l,s,d,c,h,u){var f,p,g,v,w,m,x,_,I,y,b,C=this,q=e.separator||",",M=[];for(b=u?C.getCsvHeader(i,o,t,q):[],v=0;a>v;v++)if(x=n[v],!x.pq_hidden){_=l?v+s:v,I=_-s,m={rowIndx:_,rowIndxPage:I,rowData:x,Export:!0};for(var w=0;r>w;w++)if(y=t[w],!y.hidden&&y.copy!==!1){p=null,f=null,d.ismergedCell(_,w)?(f=d.isRootCell(_,w))?(p=d.getRootCell(_,w,"o"),p.Export=!0,g=C.getRenderVal(p,c,h)):g="":(m.colIndx=w,m.column=y,m.dataIndx=y.dataIndx,g=C.getRenderVal(m,c,h));var D=(null==g?"":g)+"";D=D.replace(/\"/g,'""'),M.push('"'+D+'"')}b.push(M.join(q)),M=[]}return b.join("\n")},o.getJsonContent=function(e,t){function r(e,t){return 0!==(e+"").indexOf("pq_")?t:void 0}return e.nostringify?t:JSON.stringify(t,e.nopqdata?r:null,e.nopretty?null:2)},o.postRequest=function(t){var r,i,o=t.format,n=t.url,a=t.filename||"pqGrid";if(t.zip&&"xlsx"!=o){var l=new JSZip;l.file(a+"."+t.format,t.data),r=l.generate({type:"base64",compression:"DEFLATE"}),i=!0,o="zip"}else i=!!t.decodeBase,r=t.data;return n&&e.ajax({url:n,type:"POST",cache:!1,data:{pq_ext:o,pq_data:r,pq_decode:i,pq_filename:a},success:function(t){n+=(n.indexOf("?")>0?"&":"?")+"pq_filename="+t,e(document.body).append("')}}),r},o.Export=function(e){var t,r,i,o,n=this,a=n.that,l=a.options,s=n.templates,d=l.groupModel,c="remote"==l.pageModel.type,h=a.rowIndxOffset,u=a.iGenerateView,f=a.iMerge,p=a.colModel,g=p.length,v=a.headerCells,w=v.length,m=n.curPage=d.on&&d.dataIndx.length||c,x=m?a.pdata:l.dataModel.data,x=l.summaryData?x.concat(l.summaryData):x,_=x.length,I=e.url,y=e.render,b=!e.noheader,C=e.format;return a._trigger("beforeExport",null,e),"xlsx"==C?(t=n.getXlsContent(p,g,v,w,x,_,c,h,f,y,u,b),r=new JSZip,r.file("[Content_Types].xml",s.content_types),r.file("workbook.xml",s.workbook),r.file("worksheet.xml",s.worksheet.replace("<%=content%>",t)),o=r.folder("_rels"),o.file(".rels",s.rels),o.file("workbook.xml.rels",s.workbook_rels),I?(e.data=r.generate({type:"base64",compression:"DEFLATE"}),e.decodeBase=!0):i=r.generate({type:"blob",compression:"DEFLATE"})):"json"==C?e.data=n.getJsonContent(e,x):"csv"==C?e.data=n.getCSVContent(e,p,g,v,w,x,_,c,h,f,y,u,b):e.data=n.getHtmlContent(e,p,g,v,w,x,_,c,h,f,y,u,b),i=i?i:n.postRequest(e),a._trigger("exportData",null,e),i}}(jQuery),function(e){var t=e.paramquery,r={};r.options={items:[],gridInstance:null},e.widget("paramquery.pqToolbar",r),r=t.pqToolbar.prototype,r.refresh=function(){this.element.empty(),this._create()},r._create=function(){var r,i,o=this.options,n=o.gridInstance,a={button:"click",select:"change",checkbox:"change",textbox:"change"},l=o.bootstrap,s=l.on,d=n.colModel,c=o.items,h=this.element;h.addClass("pq-toolbar");for(var u=0,f=c.length;f>u;u++){var p,g,v=c[u],w=v.type,m=v.value,x=v.icon,_=v.options||{},I=v.label,i=v.listener,y=i?[i]:v.listeners,y=y||[function(){}],b=v.cls,C=b?b:"",C=s&&"button"==w?l.btn+" "+C:C,C=C?"class='"+C+"'":"",q=v.style,M=q?"style='"+q+"'":"",D=v.attr,R=D?D:"",P=I&&"button"!=w?[C,R]:[C,R,M],P=P.join(" ");if(v.options=_,"textbox"==w)g=e([I?"":""].join(""));else if("textarea"==w)g=e([I?"":""].join(""));else if("checkbox"==w)g=e([I?"":""].join(""));else if("separator"==w)g=e("");else if("button"==w){var T="";s&&(T=x?"":""),g=e(""),e.extend(_,{label:I?I:!1,icons:{primary:s?"":x}}),g.button(_)}else"select"==w?("function"==typeof _&&(_=_.call(n,{colModel:d})),_=_||[],p=t.select({options:_,attr:P,prepend:v.prepend,groupIndx:v.groupIndx,valueIndx:v.valueIndx,labelIndx:v.labelIndx}),g=e([I?"":""].join(""))):"string"==typeof w?g=e(w):"function"==typeof w&&(p=w.call(n,{colModel:d,cls:C}),g=e(p));g.appendTo(h),"checkbox"!==w&&void 0!==m&&(I?e(g[0].children[0]).val(m):g.val(m));for(var k=0,S=y.length;S>k;k++){i=y[k];var H={};"function"==typeof i?H[a[w]]=i:H=i;for(r in H)g.on(r,this._onEvent(n,H[r],v))}}},r._onEvent=function(t,r,i){return function(o){"checkbox"==i.type?i.value=e(o.target).prop("checked"):i.value=e(o.target).val(),r.call(t,o)}},r._destroy=function(){this.element.empty().removeClass("pq-toolbar").enableSelection()},r._disable=function(){null==this.$disable&&(this.$disable=e("
").css("opacity",.2).appendTo(this.element))},r._enable=function(){this.$disable&&(this.element[0].removeChild(this.$disable[0]),this.$disable=null)},r._setOption=function(e,t){"disabled"==e&&(1==t?this._disable():this._enable())},pq.toolbar=function(t,r){var i=e(t).pqToolbar(r),o=i.data("paramqueryPqToolbar")||i.data("paramquery-pqToolbar");return o}}(jQuery),function(e){var t=e.paramquery,r=t.pqGrid.prototype.options,i={on:!1,dirtyClass:"pq-cell-dirty"};r.trackModel=r.trackModel||i;var o=t.cUCData=function(e){this.that=e,this.udata=[],this.ddata=[],this.adata=[],this.options=e.options;var t=this;e.on("dataAvailable",function(e,r){"filter"!=r.source&&(t.udata=[],t.ddata=[],t.adata=[])})},n=o.prototype=new t.cClass;n.add=function(e){for(var t=this.that,r=this.adata,i=this.ddata,o=e.rowData,n=this.options.trackModel,a=n.dirtyClass,l=t.getRecId({rowData:o}),s=0,d=r.length;d>s;s++){var c=r[s];if(null!=l&&c.recId==l)throw"primary key violation";if(c.rowData==o)throw"same data can't be added twice."}for(var s=0,d=i.length;d>s;s++)if(o==i[s].rowData)return void i.splice(s,1);var h=[];for(var u in o)h.push(u);t.removeClass({rowData:o,dataIndx:h,cls:a});var e={recId:l,rowData:o};r.push(e)},n.update=function(t){var r=this.that,i=this.options.trackModel,o=i.dirtyClass,n=t.rowData||r.getRowData(t),a=r.getRecId({rowData:n}),l=t.dataIndx,s=t.refresh,d=r.columns,c=r.getValueFromDataType,h=t.row,u=this.udata,f=u.slice(0),p=!1;if(null!=a){for(var g=0,v=u.length;v>g;g++){var w=u[g],m=w.oldRow;if(w.rowData==n){p=!0;for(var l in h){var x=d[l],_=x.dataType,I=h[l],I=c(I,_),y=m[l],y=c(y,_);if(m.hasOwnProperty(l)&&y===I){var b={rowData:n,dataIndx:l,refresh:s,cls:o};r.removeClass(b),delete m[l]}else{var b={rowData:n,dataIndx:l,refresh:s,cls:o};r.addClass(b),m.hasOwnProperty(l)||(m[l]=n[l])}}e.isEmptyObject(m)&&f.splice(g,1);break}}if(!p){var m={};for(var l in h){m[l]=n[l];var b={rowData:n,dataIndx:l,refresh:s,cls:o};r.addClass(b)}var b={rowData:n,recId:a,oldRow:m};f.push(b)}this.udata=f}},n["delete"]=function(e){for(var t=this.that,r=e.rowIndx,i=e.rowIndxPage,o=t.rowIndxOffset,r=null==r?i+o:r,i=null==i?r-o:i,n=t.options.pageModel.type,a="remote"==n?i:r,l=this.adata,s=this.ddata,d=t.getRowData(e),c=0,h=l.length;h>c;c++)if(l[c].rowData==d)return void l.splice(c,1);s.push({indx:a,rowData:d,rowIndx:r})},n.isDirty=function(e){var t=this.that,r=this.udata,i=this.adata,o=this.ddata,n=!1,a=t.getRowData(e);if(a)for(var l=0;lf;f++){var g=a[f],v=g.rowData,w={};h.push(v);for(var m in v)0!=m.indexOf("pq_")&&(w[m]=v[m]);u.push(w)}for(var f=0,p=o.length;p>f;f++){var g=o[f],x=g.oldRow,v=g.rowData;if(-1==e.inArray(v,h)&&-1==e.inArray(v,l)){var w={};if(i!==!1)for(var m in v)0!=m.indexOf("pq_")&&(w[m]=v[m]);else{for(var m in x)w[m]=v[m];w[r.options.dataModel.recIndx]=g.recId}l.push(v),s.push(w),d.push(x)}}for(var f=0,p=n.length;p>f;f++){var g=n[f],v=g.rowData,w={};for(var m in v)0!=m.indexOf("pq_")&&(w[m]=v[m]);c.push(w)}return{updateList:s,addList:c,deleteList:u,oldList:d}},n.getChanges=function(){for(var t=(this.that,this.udata),r=this.adata,i=this.ddata,o=e.inArray,n=[],a=[],l=[],s=[],d=0,c=i.length;c>d;d++){var h=i[d],u=h.rowData;s.push(u)}for(var d=0,c=t.length;c>d;d++){var h=t[d],f=h.oldRow,u=h.rowData;-1==o(u,s)&&-1==o(u,n)&&(n.push(u),a.push(f))}for(var d=0,c=r.length;c>d;d++){var h=r[d],u=h.rowData;l.push(u)}return{updateList:n,addList:l,deleteList:s,oldList:a}},n.getChangesRaw=function(){var e=(this.that,this.udata),t=this.adata,r=this.ddata,i={updateList:[],addList:[],deleteList:[]};return i.updateList=e,i.addList=t,i.deleteList=r,i},n.commitAdd=function(t,r){for(var i=this.that,o=i.colModel,n=o.length,a=this.adata,l=e.inArray,s=a.length,d=i.getValueFromDataType,c=[],h=t.length,u=[],f=0;h>f;f++)for(var p=t[f],g=0;s>g;g++){var v=a[g].rowData,w=!0;if(-1==l(v,u)){for(var m=0;n>m;m++){var x=o[m],_=x.hidden,I=x.dataType,y=x.dataIndx;if(!_&&y!=r){var b=v[y],b=d(b,I),C=p[y],C=d(C,I);if(b!==C){w=!1;break}}}if(w){var q={},M={};q[r]=p[r],M[r]=v[r],c.push({type:"update",rowData:v,oldRow:M,newRow:q}),u.push(v);break}}}for(var D=[],g=0;s>g;g++){var v=a[g].rowData;-1==l(v,u)&&D.push(a[g])}return this.adata=D,c},n.commitUpdate=function(t,r){for(var i=this.that,o=this.options.trackModel.dirtyClass,n=i.colModel,a=(n.length,this.udata),l=a.length,s=t.length,d=[],c=[],h=0;l>h;h++){var u=a[h],f=u.rowData,p=u.oldRow;if(-1==e.inArray(f,c))for(var g=0;s>g;g++){var v=t[g];if(f[r]==v[r]){c.push(f);for(var w in p)i.removeClass({rowData:f,dataIndx:w,cls:o})}}}for(var m=[],h=0;l>h;h++){var f=a[h].rowData;-1==e.inArray(f,c)&&m.push(a[h])}return this.udata=m,d},n.commitDelete=function(e,t){for(var r,i,o,n,a=this.ddata,l=a.length,s=this.udata;l--&&(r=a[l].rowData,i=r[t],o=e.length);)for(;o--;)if(i==e[o][t]){for(e.splice(o,1),a.splice(l,1),n=s.length;n--;)s[n].rowData==r&&s.splice(n,1);break}},n.commitUpdateAll=function(){for(var e=this.that,t=this.options.trackModel.dirtyClass,r=this.udata,i=0,o=r.length;o>i;i++){var n=r[i],a=n.oldRow,l=n.rowData;for(var s in a)e.removeClass({rowData:l,dataIndx:s,cls:t})}this.udata=[]},n.commitAddAll=function(){this.adata=[]},n.commitDeleteAll=function(){for(var e,t=this.ddata,r=this.udata,i=r.length,o=t.length,n=0;i>0&&o>n;n++){for(e=t[n].rowData;i--;)r[i].rowData==e&&r.splice(i,1);i=r.length}t.length=0},n.commit=function(e){var t=this.that,r=e?e.history:null,r=null==r?!1:r,i=t.options.dataModel,o=[],n=[],a=[],l=i.recIndx;if(null==e)this.commitAddAll(),this.commitUpdateAll(),this.commitDeleteAll();else{var s=e.type,d=e.rows;"add"==s?d?n=this.commitAdd(d,l):this.commitAddAll():"update"==s?d?a=this.commitUpdate(d,l):this.commitUpdateAll():"delete"==s&&(d?this.commitDelete(d,l):this.commitDeleteAll())}o=n.concat(a),o.length&&(t._digestData({source:"commit",checkEditable:!1,track:!1,history:r,rowList:o}),t.refreshView())},n.rollbackAdd=function(e,t){for(var r=this.adata,i=[],o=(e.type,0),n=r.length;n>o;o++){var a=r[o],l=a.rowData;i.push({type:"delete",rowData:l})}return this.adata=[],i},n.rollbackDelete=function(e,t){for(var r=this.ddata,i=[],o=(e.type,r.length-1);o>=0;o--){var n=r[o],a=(n.indx,n.rowIndx),l=n.rowData;i.push({type:"add",rowIndx:a,newRow:l})}return this.ddata=[],i},n.rollbackUpdate=function(e,t){for(var r=this.that,i=this.options.trackModel.dirtyClass,o=this.udata,n=[],a=0,l=o.length;l>a;a++){var s=o[a],d=s.recId,c=s.rowData,h={},u=s.oldRow;if(null!=d){var f=[];for(var p in u)h[p]=c[p],f.push(p);r.removeClass({rowData:c,dataIndx:f,cls:i,refresh:!1}),n.push({type:"update",rowData:c,newRow:u,oldRow:h})}}return this.udata=[],n},n.rollback=function(e){var t=this.that,r=t.options.dataModel,i=t.options.pageModel,o=e&&null!=e.refresh?e.refresh:!0,n=e&&null!=e.type?e.type:null,a=[],l=[],s=[],d=[],c=r.data;null!=n&&"update"!=n||(s=this.rollbackUpdate(i,c)),null!=n&&"delete"!=n||(l=this.rollbackDelete(i,c)),null!=n&&"add"!=n||(d=this.rollbackAdd(i,c)),a=l.concat(d,s),t._digestData({history:!1,allowInvalid:!0,checkEditable:!1,source:"rollback",track:!1,rowList:a}),o&&t.refreshView()};var a=t.pqGrid.prototype;a.getChanges=function(e){if(this.blurEditor({force:!0}),e){var t=e.format;if(t){if("byVal"==t)return this.iUCData.getChangesValue(e);if("raw"==t)return this.iUCData.getChangesRaw()}}return this.iUCData.getChanges()},a.rollback=function(e){this.blurEditor({force:!0}),this.iUCData.rollback(e)},a.isDirty=function(e){return this.iUCData.isDirty(e)},a.commit=function(e){this.iUCData.commit(e)},a.updateRow=function(e){for(var t=this,r=e.rowList||[{rowIndx:e.rowIndx,newRow:e.newRow||e.row,rowData:e.rowData,rowIndxPage:e.rowIndxPage}],i=[],o=0,n=r.length;n>o;o++){var a=t.normalize(r[o]),l=a.newRow,s=a.rowData,d={};if(s){for(var c in l)d[c]=s[c];a.oldRow=d,a.type="update",i.push(a)}}if(!i.length)return!1;var h=this._digestData({source:e.source||"update",history:e.history,checkEditable:e.checkEditable,track:e.track,allowInvalid:e.allowInvalid,rowList:i});return h===!1?!1:void(e.refresh!==!1&&(i.length>1?t.refresh():t.refreshRow({rowIndx:i[0].rowIndx})))},a.getRecId=function(e){var t=this,r=t.options.dataModel;e.dataIndx=r.recIndx;var i=t.getCellData(e);return null==i?null:i},a.getCellData=function(e){var t=e.rowData||this.getRowData(e),r=e.dataIndx;return t?t[r]:null},a.getRowData=function(e){if(!e)return null;var t,r=e.rowData;if(null!=r)return r;if(t=e.recId,null==t){var i=e.rowIndx,i=null!=i?i:e.rowIndxPage+this.rowIndxOffset,o=this.get_p_data(),n=o[i];return n}for(var a=this.options,l=a.dataModel,s=l.recIndx,d=l.data,c=0,h=d.length;h>c;c++){var n=d[c];if(n[s]==t)return n}return null},a.deleteRow=function(e){for(var t=this,r=e.rowList||[{rowIndx:e.rowIndx,rowIndxPage:e.rowIndxPage}],i=[],o=0,n=r.length;n>o;o++){var a=t.normalize(r[o]),l=a.rowData;a.oldRow=l,a.type="delete",i.push(a)}return i.length?(this._digestData({source:e.source||"delete",history:e.history,track:e.track,rowList:i}),void(e.refresh!==!1&&t.refreshView())):!1},a.addRow=function(e){var t=this,r=e.rowList||[{rowIndx:e.rowIndx,rowIndxPage:e.rowIndxPage,newRow:e.newRow||e.rowData}],i=[],o=t.options,n=o.dataModel,a=n.data;null==a&&(n.data=[],a=n.data);for(var l=0,s=r.length;s>l;l++){var d=t.normalize(r[l]);d.type="add",i.push(d)}if(!i.length)return!1;var c=this._digestData({source:e.source||"add",history:e.history,track:e.track,checkEditable:e.checkEditable,rowList:i});if(c===!1)return!1;e.refresh!==!1&&this.refreshView();var h=i[0].rowIndx;return null==h?a.length-1:h}}(jQuery),function(e){var t=function(e){this.focusSelection=null},r=t.prototype;r.inViewRow=function(e){var t=this.that,r=t.options,i=r.freezeRows,o=t.finalV;return i>e?!0:e>=t.initV&&o>=e};var i=function(e){this.that=e;var t=e.options;this.options=t,this.selection=[],this.hclass=" pq-state-select "+(t.bootstrap.on?"":"ui-state-highlight")};e.paramquery.cRows=i;var o=function(e){var t=e.options;this.that=e,this.selection=[],this.hclass="pq-state-select "+(t.bootstrap.on?"":"ui-state-highlight")};e.paramquery.cCells=o;var n=o.prototype=new t,a=i.prototype=new t;a.isSelected=function(e){var t=e.rowData||this.that.getRowData(e);return t?t.pq_rowselect===!0:null},a.selectRange=function(e){var t=(this.that,e.range),r=t.r1,i=t.r2,o=e.evt,n=[];if(r>i){var a=r;r=i,i=a}for(var l=r;i>=l;l++)n.push({rowIndx:l});this.add({rows:n,evt:o})},n.removeAll=function(e){e=e||{};var t=this.that,r=t.get_p_data(),i=this.hclass;if(r&&r.length){t.$tbl&&t.$tbl.children().children().children().removeClass(i);for(var o=0,n=r.length;n>o;o++){var a=r[o];a&&delete a.pq_cellselect}}},a.removeAll=function(e){e=e||{};var t=this.that,r=e.all,i=this.hclass,o=t.get_p_data();if(o&&o.length){e.refresh&&t.$tbl&&t.$tbl.children().children().removeClass(i),o=r?o:t.pdata;for(var n=0,a=o.length;a>n;n++){var l=o[n];l&&delete l.pq_rowselect}}},n.isSelected=function(e){var t=this.that,r=e.rowData||t.getRowData(e),i=e.dataIndx,o=e.colIndx;return null==o&&null==i?null:null==r?null:(i=null==i?t.colModel[o].dataIndx:i,1==(r.pq_cellselect&&r.pq_cellselect[i]))},a.getSelection=function(){for(var e=this.that,t=e.selection(),r=t.address(),i=[],o=0,n=r.length;n>o;o++){var a=r[o],l=a.type;if("row"==l)for(var s=a.r1,d=a.r2,c=s;d>=c;c++){var h=e.getRowData({rowIndx:c});i.push({rowIndx:c,rowData:h})}}return i},n.getSelection=function(){for(var e=this.that,t=e.selection(),r=e.colModel,i=t.address(),o=[],n=0,a=i.length;a>n;n++){var l=i[n],s=l.type;if("block"==s||"cell"==s||"column"==s)for(var d=l.r1,c=l.r2,h=l.c1,u=l.c2,f=d;c>=f;f++)for(var p=e.getRowData({rowIndx:f}),g=h;u>=g;g++)o.push({rowIndx:f,rowData:p,colIndx:g,dataIndx:r[g].dataIndx})}return o},n.inViewCell=function(e,t){var r=this.that,i=r.options,o=i.freezeCols;return this.inViewRow(e)?o>t||t>=r.initH&&t<=r.finalH:!1},n._add=function(e){var t,r=this.that,i=r.normalize(e),o=i.rowIndxPage,n=i.rowData,a=i.colIndx,l=i.dataIndx,s=this.isSelected({rowData:n,dataIndx:l});if(null==s)return!1;var d=r.iMerge.ismergedCell(i.rowIndx,a)||this.inViewCell(o,a);if(s===!1){if(d){var c=r.getCell({rowIndxPage:o,colIndx:a});c&&c.addClass(this.hclass)}var h=n.pq_cellselect=n.pq_cellselect||{};h[l]=!0,t=!0}return t?i:void 0},a._add=function(e){var t=this.that,r=t.normalize(e),i=r.rowIndxPage,o=r.rowData,n=this.isSelected({rowData:o});if(r.rowIndxPage=i,null==n)return!1;var a=this.inViewRow(i);if(n===!1){if(!o.pq_hidden&&a){var l=t.getRow({rowIndxPage:i});l.length&&l.addClass(this.hclass)}o.pq_rowselect=!0}},n.add=function(e){var t=(this.that,!1);t=this._add(e)},a.add=function(e){var t=(this.that,e.rows);if(t&&"function"==typeof t.push)for(var r=0,i=t.length;i>r;r++){var o=t[r];o.trigger=!1,this._add(o)}else this._add(e)},a._remove=function(e){var t=this.that,r=t.normalize(e),i=r.rowIndx,o=r.rowIndxPage,n=r.rowData,a=r.$tr,l=(r.evt,this.isSelected({rowData:n}));if(l){if(this.inViewRow(o)){var a=t.getRow({rowIndxPage:o});a&&(a.removeClass(this.hclass),a.removeAttr("tabindex"))}return n.pq_rowselect=!1,{rowIndx:i,rowData:n}}},a.remove=function(e){var t=e.rows,r=!1;if(t&&"function"==typeof t.push)for(var i=0,o=t.length;o>i;i++){var n=t[i];n.trigger=!1,r=this._remove(n)}else r=this._remove(e)},n.selectBlock=function(t){for(var r=this.that,i=this,o=i.hclass,n=t.range,a=n.r1,l=n.c1,s=n.r2,d=n.c2,c=r.initH,h=r.finalH,u=r.options,f=u.freezeCols,p=[],g=r.colModel,v=[],w=!!t.remove,m=l;d>=m;m++)p[m]=g[m].dataIndx;for(var x=a;s>=x;x++){var _=r.normalize({rowIndx:x}),I=_.rowData,y=_.rowIndxPage;if(I){var b=I.pq_cellselect=I.pq_cellselect||{};if(i.inViewRow(y))for(var m=l;d>=m;m++){var C=p[m];if(w&&b[C]||!w&&!b[C]){if(f>m||m>=c&&h>=m){var q=r.getCell({rowIndxPage:y,colIndx:m});q.length&&v.push(q[0])}b[C]=w?void 0:!0}}else for(var m=l;d>=m;m++){var C=p[m];b[C]=w?void 0:!0}}}v.length&&e(v)[w?"removeClass":"addClass"](o)}}(jQuery),function(e){var t=!0;e(function(){var r=e("").appendTo(document.body);r[0].indeterminate=!0,r.on("change",function(){t=!1}),r.click(),r.remove()});var r=e.paramquery.cCheckBoxColumn=function(t,r){var i=this;this.that=t,this.options=t.options,this.column=r;var o={all:!1,header:!1,select:!1,check:!0,uncheck:!1};r.cb=e.extend({},o,r.cb),r._render=function(e){var t=e.rowData;if(!t.pq_gtitle&&!t.pq_gsummary){var i=r.cb.check===e.cellData?"checked":"";return""}},this.dataIndx=r.dataIndx;var n=t.element,a=t.eventNamespace;t.on("dataAvailable",function(){t.one("dataReady",function(){return i._onDataReady()})}).on("dataReady",function(){i.setValCBox()}),n.on("change"+a,function(t){var r=t.target;return"checkbox"==r.type&&e(r).closest(".pq-grid")[0]==this?i.onCheckBoxChange(t):void 0}),t.on("cellKeyDown",function(e,t){return i.onCellKeyDown(e,t)}),t.on("refreshHeader",function(e,t){return i.refreshHeader(e,t)})},i=r.prototype=new e.paramquery.cClass;i.hasHeaderChkBox=function(){return this.column.cb.header},i.setValCBox=function(){if(this.hasHeaderChkBox()){var e=this.that,t=this.options,r=this.dataIndx,i=this.column.cb,o=i.all,n="remote"==t.pageModel.type,a=e.rowIndxOffset,a=n||!o?a:0,l=o?t.dataModel.data:e.pdata,s=null,d=0,c=0;if(l){for(var h=0,u=0,f=l.length;f>u;u++){var p=l[u],g=u+a;e.isEditableRow({rowIndx:g})&&e.isEditableCell({rowIndx:g,dataIndx:r})&&(h++,p[r]===i.check?d++:c++)}d==h&&h?s=!0:c==h&&(s=!1),this.$inp&&this.$inp.pqval({val:s})}}},i.onHeaderChange=function(t){for(var r=e(t.target),i=this.that,o=this.column,n=o.dataIndx,a=i.options,l=o.cb,s=l.all,d=s?a.dataModel.data:i.pdata,c="remote"==a.pageModel.type,h=i.rowIndxOffset,h=c||!s?h:0,u=[],f={column:o,dataIndx:n,source:"header"},p=r[0].checked,g=0,v=d.length;v>g;g++){var w=g+h,m=d[g],x={},_={};x[n]=p?l.check:l.uncheck,_[n]=m[n],u.push({rowIndx:w,rowData:m,newRow:x,oldRow:_,type:"update"})}var I={rowList:u,source:"checkbox"};return I.history=I.track=l.select?!1:null,f.check=p,f.rows=u,i._trigger("beforeCheck",t,f)===!1?(i.refreshHeader(),!1):i._digestData(I)===!1?(i.refreshHeader(),!1):(i.refresh({header:!1}),u=f.rows=I.rowList,i._trigger("check",t,f),void(l.select&&i.selection({type:"row",method:p?"add":"remove",rows:u})))},i.refreshHeader=function(e,r){var i=this; if(this.hasHeaderChkBox()){var o=this.that,n=o.pdata;if(n){var a=o.getCellHeader({dataIndx:this.dataIndx});if(a){var l=this.$inp=a.find("input");this.setValCBox(),t&&l.on("click",function(e){null==l.data("pq_value")&&(l[0].checked=!0,l.data("pq_value",!0),i.onHeaderChange(e))}),l.on("change",function(e){i.onHeaderChange(e)})}}}},i._onDataReady=function(){var e=this.that,t=this.options,r=t.dataModel.data,i="remote"==t.pageModel.type,o=i?e.rowIndxOffset:0,n=this.column,a=n.cb,l=n.dataIndx;if(null!=l&&r){for(var s=[],d=0,c=r.length;c>d;d++){var h=r[d];h[l]===a.check&&s.push({rowIndx:d+o,rowData:h})}if(e._trigger("check",null,{rows:s,column:n,dataIndx:l,source:"dataAvailable"})!==!1&&a.select){for(var d=0;c>d;d++){var h=r[d];h[l]===a.check&&(h.pq_rowselect=!0)}e.selection().refresh()}}this.setValCBox()},i.rowSelect=function(e,t){var r=this.that,i=t.rows,o=t.rowData,n=this.dataIndx;if(i)for(var a=0,l=i.length;l>a;a++){var s=i[a],d=s.rowIndx,o=s.rowData;o[n]=!0,r.refreshCell({rowIndx:d,dataIndx:n})}else o&&(o[n]=!0,d=t.rowIndx,r.refreshCell({rowIndx:d,dataIndx:n}));this.setValCBox()},i.rowUnSelect=function(e,t){var r=this.that,i=t.rows,o=t.rowData,n=this.dataIndx;if(i)for(var a=0,l=i.length;l>a;a++){var s=i[a],d=s.rowIndx,o=s.rowData;o[n]=!1,r.refreshCell({rowIndx:d,dataIndx:n})}else o&&(o[n]=!1,d=t.rowIndx,r.refreshCell({rowIndx:d,dataIndx:n}));this.setValCBox()},i.onCheckBoxChange=function(t){var r=this.that,i=this.column.cb,o=e(t.target),n=o.closest(".pq-grid-cell");if(n.length){var a=r.getCellIndices({$td:n}),a=r.normalize(a),l=a.rowData,s=a.rowIndx,d=a.dataIndx;if(d==this.dataIndx){var c=o[0].checked,h={},u={};h[d]=c?i.check:i.uncheck,u[d]=l[d];var f=[{rowData:l,rowIndx:s,oldRow:u,newRow:h,type:"update"}];if(a.check=c,a.rows=f,r._trigger("beforeCheck",t,a)===!1)return r.refreshCell({rowIndx:s,dataIndx:d}),!1;var p={source:"checkbox",rowList:f};if(p.history=p.track=i.select?!1:null,r._digestData(p)===!1)return r.refreshCell({rowIndx:s,dataIndx:d}),!1;r.refreshRow({rowIndx:s}),f=a.rows=p.rowList,r._trigger("check",t,a),i.select&&r.selection({type:"row",method:c?"add":"remove",rows:f}),this.setValCBox()}}},i.onCellKeyDown=function(t,r){if(r.dataIndx==this.dataIndx&&(13==t.keyCode||32==t.keyCode)){var i=e(t.originalEvent.target).find("input");return i.click(),!1}}}(jQuery),function(){for(var e=0,t=["moz","webkit"],r=0;!window.requestAnimationFrame&&r=n.offsetTop+n.offsetHeight+l){if("TD"!=n.nodeName.toUpperCase())return!0;if(o>=n.offsetLeft+n.offsetWidth+s)return!0}},r._onCellMouseDown=function(e,t){var r=this.that,i=t.rowIndx,o=(t.rowIndxPage,r.iSelection),n=t.colIndx,a=r.options.selectionModel,l=a.type,s=a.mode;if("cell"!=l)return void r.focus(t);if(null!=n){var d=o.address()[0];if(e.shiftKey&&"single"!=s&&d){var c=d.firstR,h=d.firstC;r.range({r1:c,c1:h,r2:i,c2:n,firstR:c,firstC:h}).select()}else this.mousedown={r1:i,c1:n},r.range({r1:i,c1:n,firstR:i,firstC:n}).select();return r.focus(t),!0}},r._onCellMouseEnter=function(e,t){var r=this.that,i=r.options.selectionModel,o=i.type,n=i.mode;if(this.mousedown&&"single"!=n){if("cell"==o){var a=this.mousedown,l=a.r1,s=a.c1,d=t.rowIndx,c=t.colIndx;if(l==d&&s==c)return;if(a.r2==d&&a.c2==c)return;this.mousedown.r2=d,this.mousedown.c2=c,r.scrollCell({rowIndx:d,colIndx:c}),r.range({r1:l,c1:s,r2:d,c2:c,firstR:l,firstC:s}).select()}r.focus(t)}},r._onRowMouseEnter=function(e,t){var r=this.that,i=r.options.selectionModel,o=i.type,n=i.mode;if("row"==o&&this.mousedown&&"single"!=n){var a=this.mousedown,l=a.r1,s=t.rowIndx;if(l==s)return void r.range({r1:l,firstR:l},!1).select();if(this.mousedown.r2==s)return;this.mousedown.r2=s,r.scrollRow({rowIndx:s}),r.range({r1:l,r2:s,firstR:l},!1).select()}},r._onRowMouseDown=function(t,r){var i,o=this.that,n=r.rowIndx,a=o.iSelection,l=o.options.selectionModel,s=e(t.originalEvent.target).hasClass("pq-grid-number-cell"),d=l.mode,c=l.type;if(("row"==c||l.row&&s)&&null!=n){var h=o.iSelection.address();if(t.shiftKey&&"single"!=d){var u=h.length;if(u&&"row"==h[u-1].type){var f=h[u-1];f.r1=f.firstR,f.r2=n,f.c1=f.c2=f.type=void 0}o.range(h).select()}else(t.ctrlKey||t.metaKey)&&"single"!=d?(i=o.iRows.isSelected({rowIndx:n}),a[i?"removeRow":"add"]({r1:n,firstR:n})):(this.mousedown={r1:n,y1:t.pageY,x1:t.pageX},o.range({r1:n,firstR:n},!1).select());return s&&setTimeout(function(){o.focus({rowIndxPage:r.rowIndxPage,colIndx:o.getFirstVisibleCI(!0)})},0),!0}},r._onContMouseDown=function(e,t){var r=this.that,i=r.options.swipeModel,o=i.on;return o&&(this._stopSwipe(!0),this.swipedown={x:e.pageX,y:e.pageY}),!0},r._onMousePQUp=function(e,t){this.that;this.mousedown=null},r._stopSwipe=function(e){var t=this;e&&(t.swipedown=null,t.swipedownPrev=null),window.clearInterval(t.intID),window.cancelAnimationFrame(t.intID),t.intID=null},r._onMouseStop=function(e,t){var r=this,i=this.that;if(this.swipedownPrev){var o=i.options.swipeModel,n=this.swipedownPrev,a=n.ts,l=(new Date).getTime(),s=l-a,d=n.x,c=n.y,h=e.pageX,u=e.pageY,f=h-d,p=u-c,g=Math.sqrt(f*f+p*p),v=g/s;if(v>o.ratio){var w=0,m=o.repeat;r._stopSwipe();var x=function(){w+=o.speed,m--;var e=h+w*f/s,t=u+w*p/s;r._onMouseDrag({pageX:e,pageY:t}),m>0?r.intID=window.requestAnimationFrame(x):r._stopSwipe(!0)};x()}else r.swipedown=null,r.swipedownPrev=null}},r._onMouseDrag=function(e,t){var r=this.that,i=r.options;if(this.swipedown){var o=this.swipedown,n=o.x,a=o.y,l=e.pageX,s=e.pageY;this.swipedownPrev={x:n,y:a,ts:(new Date).getTime()};var d=i.scrollModel.smooth;i.virtualY&&!d||(this.scrollVertSmooth(a,s),this.syncScrollBarVert()),i.virtualX&&!d||(this.scrollHorSmooth(n,l),this.syncScrollBarHor()),o.x=l,o.y=s}return!0},r.updateTableY=function(e){if(0==e)return!1;var t=this.that,r=this.getTableForVertScroll(),i=t.iRefresh.getEContHt();if(!r||!r.length)return!1;var o,n=r.data("offsetHeight")-1,a=this.scrollTop-e;return o=0>a?0:0>e&&i-n+a>0?n-i:a,this.setScrollTop(o,r,i),!0},r.setScrollTop=function(e,t,r){e>=0&&(e=Math.round(e),this.scrollTop=e,t.parent("div").scrollTop(e))},r.getScrollLeft=function(e){return this.scrollLeft},r.getScrollTop=function(e){return this.scrollTop},r.setScrollLeft=function(t,r,i,o){if(t>=0){t=Math.round(t),this.scrollLeft=t;var n=i?i.parent():e();n=n.add(r?r.parent("div"):e()),n.scrollLeft(t)}},r.scrollVertSmooth=function(e,t){e!=t&&this.updateTableY(t-e)},r.scrollHorSmooth=function(e,t){if(e!=t){var r=this.that,i=r.options,o=t-e,n=this.getTableForHorScroll(),a=this.getTableHeaderForHorScroll(),l=r.iRefresh.getEContWd();if(n||a){var s,d=n?n:a,c=i.virtualX?this.getScrollWidth(d):d.data("scrollWidth"),h=this.scrollLeft-o;s=0>h?0:0>c-l-h?c-l:h,this.setScrollLeft(s,n,a,l)}}},r.syncViewWithScrollBarVert=function(e){if(null!=e){var t=this.that,r=this.getTableForVertScroll();if(r&&r.length){var i=t.options;i.editModel.indices&&t.blurEditor({force:!0});var o=r.data("offsetHeight"),n=t.iRefresh.getEContHt(),a=o-n,l=a*e;(l||0===l)&&(0>l&&(l=0),this.setScrollTop(l,r,n))}}},r.syncViewWithScrollBarHor=function(e){if(null!=e){var t=this.that,r=this.getTableForHorScroll(),i=this.getTableHeaderForHorScroll();if(r||i){var o=t.options;o.editModel.indices&&t.blurEditor({force:!0});var n=r?r:i,a=o.virtualX?this.getScrollWidth(n):n.data("scrollWidth"),l=t.iRefresh.getEContWd(),s=a-l,d=s*e;a&&l&&(0>d&&(d=0),this.setScrollLeft(d,r,i,l))}}},r.resetMargins=function(){this.scrollLeft=0,this.scrollTop=0},r.syncHeaderViewWithScrollBarHor=function(e){if(null!=e){var t=this.that,r=this.getTableHeaderForHorScroll();if(r){var i=t.options,o=i.freezeCols;i.editModel.indices&&t.blurEditor({force:!0});var n=r,a=n.data("scrollWidth"),l=t.iRefresh.getEContWd(),s=t.calcWidthCols(o,e+o);a&&l&&(0>s&&(s=0),r.css("marginLeft",-s))}}},r.syncScrollBarVert=function(){var e=this.that,t=this.getTableForVertScroll();if(t&&t.length){var r=t.data("offsetHeight"),i=e.iRefresh.getEContHt(),o=r-i,n=this.scrollTop,a=n/o;a>=0&&1>=a&&e.vscroll.widget().hasClass("pq-sb-vert")&&e.vscroll.option("ratio",a)}},r.syncScrollBarHor=function(){var e=this.that,t=e.options,r=this.getTableForHorScroll(),i=this.getTableHeaderForHorScroll();if(r||i){var o=r?r:i,n=t.virtualX?this.getScrollWidth(o):o.data("scrollWidth"),a=e.iRefresh.getEContWd(),l=n-a,s=this.scrollLeft,d=s/l;d>=0&&1>=d&&e.hscroll.widget().hasClass("pq-sb-horiz")&&e.hscroll.option("ratio",d)}},r.getTableForVertScroll=function(){var t=this.that,r=t.pqpanes,i=t.$tbl;if(i&&i.length)return r.h&&r.v?i=e([i[2],i[3]]):r.v?i=e([i[0],i[1]]):r.h&&(i=e(i[1])),i},r.getTableForHorScroll=function(){var t=this.that,r=t.pqpanes,i=[],o=t.$tbl;if(o&&o.length){if(r.h&&r.v?i.push(o[1],o[3]):r.v?i.push(o[1]):r.h?i.push(o[0],o[1]):i.push(o[0]),t.tables.length){var n=t.tables[0].$tbl;r.v?i.push(n[1]):i.push(n[0])}return e(i)}},r.getTableHeaderForHorScroll=function(){var t=this.that,r=t.pqpanes,i=t.$tbl_header;if(i&&i.length)return i=e(r.vH?i[1]:i[0]),i.parent()},r.scrollRowNonVirtual=function(e){var t=this.that,r=t.options,i=e.rowIndxPage,o=(!!t.iHierarchy,e.rowIndx),n=t.iRefresh.getEContHt(),i=null==i?o-t.rowIndxOffset:i,a=parseInt(r.freezeRows);if(!(a>i)){var l=t.get$Tbl(i),s=t.getRow({rowIndxPage:i}),d=s[0];if(d){var c=l[0].offsetTop+1,h=d.offsetHeight,u=this.getScrollTop(),f=d.offsetTop-1,p=-1;if(0>c+f-u){var g=c+f+p;g=0>g?0:g,this.setScrollTop(g,l,n),this.syncScrollBarVert()}else if(f+h-u>n){var g=h+f-n;this.setScrollTop(g,l,n),this.syncScrollBarVert()}}}},r.scrollColumnNonVirtual=function(e){var t=this.that,r=e.colIndx,r=null==r?t.getColIndx({dataIndx:e.dataIndx}):r,i=t.options.freezeCols;if(!(i>r)){var o=t._calcRightEdgeCol(r).width,n=t._calcRightEdgeCol(r-1).width,a=t._calcRightEdgeCol(i-1).width,l=this.getTableForHorScroll(),s=this.getTableHeaderForHorScroll(),d=t.iRefresh.getEContWd(),c=this.scrollLeft;if(o-c>d){var h=o-d;this.setScrollLeft(h,l,s,d),this.syncScrollBarHor()}else if(c>n-a){var h=n-a;this.setScrollLeft(h,l,s,d),this.syncScrollBarHor()}}}}(jQuery),function(e){var t=null,r=!1,i="pq-grid-excel",o="",n=e.paramquery.pqGrid.prototype,a=n.options,l={on:!0,header:!0,zIndex:1e4},s={on:!0},d={on:!0,compare:"byVal",select:!0,validate:!0,allowInvalid:!0,type:"replace"};a.pasteModel=a.pasteModel||d,a.copyModel=a.copyModel||l,a.cutModel=a.cutModel||s,n._setGlobalStr=function(e){o=e},n.canPaste=function(){return!!o},n.copy=function(){t=new c(this),t.copy(),t=null},n.paste=function(e){t=new c(this),t.paste(e),t=null},n.cut=function(){t=new c(this),t.copy({cut:!0,source:"cut"}),t=null},n.clear=function(){this.iSelection.clear()};var c=function(e,t){this.that=e},h=c.prototype;h.createClipBoard=function(){var t=e("#pq-grid-excel-div"),r=this.that.options.copyModel,o=e("#"+i);0==o.length&&(t=e("
").appendTo(document.body),o=e("