/* * Gijgo JavaScript Library v1.9.13 * http://gijgo.com/ * * Copyright 2014, 2019 gijgo.com * Released under the MIT license */ var gj={widget:function(){this.xhr=null,this.generateGUID=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},this.mouseX=function(e){if(e){if(e.pageX)return e.pageX;if(e.clientX)return e.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);if(e.touches&&e.touches.length)return e.touches[0].pageX;if(e.changedTouches&&e.changedTouches.length)return e.changedTouches[0].pageX;if(e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length)return e.originalEvent.touches[0].pageX;if(e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches.length)return e.originalEvent.touches[0].pageX}return null},this.mouseY=function(e){if(e){if(e.pageY)return e.pageY;if(e.clientY)return e.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);if(e.touches&&e.touches.length)return e.touches[0].pageY;if(e.changedTouches&&e.changedTouches.length)return e.changedTouches[0].pageY;if(e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length)return e.originalEvent.touches[0].pageY;if(e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches.length)return e.originalEvent.touches[0].pageY}return null}}};gj.widget.prototype.init=function(e,t){var r,a,i;for(r in this.attr("data-type",t),a=$.extend(!0,{},this.getHTMLConfig()||{}),$.extend(!0,a,e||{}),i=this.getConfig(a,t),this.attr("data-guid",i.guid),this.data(i),i)gj[t].events.hasOwnProperty(r)&&(this.on(r,i[r]),delete i[r]);for(plugin in gj[t].plugins)gj[t].plugins.hasOwnProperty(plugin)&&gj[t].plugins[plugin].configure(this,i,a);return this},gj.widget.prototype.getConfig=function(e,t){var r,a,i,o;for(o in r=$.extend(!0,{},gj[t].config.base),a=e.hasOwnProperty("uiLibrary")?e.uiLibrary:r.uiLibrary,gj[t].config[a]&&$.extend(!0,r,gj[t].config[a]),i=e.hasOwnProperty("iconsLibrary")?e.iconsLibrary:r.iconsLibrary,gj[t].config[i]&&$.extend(!0,r,gj[t].config[i]),gj[t].plugins)gj[t].plugins.hasOwnProperty(o)&&($.extend(!0,r,gj[t].plugins[o].config.base),gj[t].plugins[o].config[a]&&$.extend(!0,r,gj[t].plugins[o].config[a]),gj[t].plugins[o].config[i]&&$.extend(!0,r,gj[t].plugins[o].config[i]));return $.extend(!0,r,e),r.guid||(r.guid=this.generateGUID()),r},gj.widget.prototype.getHTMLConfig=function(){var e=this.data(),t=this[0].attributes;return t.width&&(e.width=t.width.value),t.height&&(e.height=t.height.value),t.value&&(e.value=t.value.value),t.align&&(e.align=t.align.value),e&&e.source&&(e.dataSource=e.source,delete e.source),e},gj.widget.prototype.createDoneHandler=function(){var e=this;return function(t){"string"==typeof t&&JSON&&(t=JSON.parse(t)),gj[e.data("type")].methods.render(e,t)}},gj.widget.prototype.createErrorHandler=function(){return function(e){e&&e.statusText&&"abort"!==e.statusText&&alert(e.statusText)}},gj.widget.prototype.reload=function(e){var t,r,a=this.data(),i=this.data("type");return void 0===a.dataSource&&gj[i].methods.useHtmlDataSource(this,a),$.extend(a.params,e),$.isArray(a.dataSource)?(r=gj[i].methods.filter(this),gj[i].methods.render(this,r)):"string"==typeof a.dataSource?(t={url:a.dataSource,data:a.params},this.xhr&&this.xhr.abort(),this.xhr=$.ajax(t).done(this.createDoneHandler()).fail(this.createErrorHandler())):"object"==typeof a.dataSource&&(a.dataSource.data||(a.dataSource.data={}),$.extend(a.dataSource.data,a.params),"json"===(t=$.extend(!0,{},a.dataSource)).dataType&&"object"==typeof t.data&&(t.data=JSON.stringify(t.data)),t.success||(t.success=this.createDoneHandler()),t.error||(t.error=this.createErrorHandler()),this.xhr&&this.xhr.abort(),this.xhr=$.ajax(t)),this},gj.documentManager={events:{},subscribeForEvent:function(e,t,r){if(gj.documentManager.events[e]&&0!==gj.documentManager.events[e].length){if(gj.documentManager.events[e][t])throw"Event "+e+' for widget with guid="'+t+'" is already attached.';gj.documentManager.events[e].push({widgetId:t,callback:r})}else gj.documentManager.events[e]=[{widgetId:t,callback:r}],$(document).on(e,gj.documentManager.executeCallbacks)},executeCallbacks:function(e){var t=gj.documentManager.events[e.type];if(t)for(var r=0;r-1)n=new Date(parseInt(e.substr(6),10));else if(e){for(o=t.split(/[\s,-\.\/\/\:]+/),(i=e.split(/[\s]+/)).length!=o.length&&(i=e.split(/[\s,-\.\/\/\:]+/)),a=0;a-1?l=parseInt(i[a],10):["m","mm"].indexOf(o[a])>-1?s=parseInt(i[a],10)-1:"mmm"===o[a]?s=gj.core.messages[r||"en-us"].monthShortNames.indexOf(i[a]):"mmmm"===o[a]?s=gj.core.messages[r||"en-us"].monthNames.indexOf(i[a]):["yy","yyyy"].indexOf(o[a])>-1?(d=parseInt(i[a],10),"yy"===o[a]&&(d+=2e3)):["h","hh","H","HH"].indexOf(o[a])>-1?c=parseInt(i[a],10):["M","MM"].indexOf(o[a])>-1&&(g=parseInt(i[a],10));n=new Date(d,s,l,c,g)}}else"number"==typeof e?n=new Date(e):e instanceof Date&&(n=e);return n},formatDate:function(e,t,r){var a,o,n="",d=t.split(/[\s,-\.\/\/\:]+/),s=t.split(/s+|M+|H+|h+|t+|T+|d+|m+|y+/);for(s=s.splice(1,s.length-2),i=0;i12?e.getHours()%12:e.getHours())+a;break;case"hh":o=e.getHours()>12?e.getHours()%12:e.getHours(),n+=gj.core.pad(o)+a;break;case"tt":n+=(e.getHours()>=12?"pm":"am")+a;break;case"TT":n+=(e.getHours()>=12?"PM":"AM")+a;break;case"d":n+=e.getDate()+a;break;case"dd":n+=gj.core.pad(e.getDate())+a;break;case"ddd":n+=gj.core.messages[r||"en-us"].weekDaysShort[e.getDay()]+a;break;case"dddd":n+=gj.core.messages[r||"en-us"].weekDays[e.getDay()]+a;break;case"m":n+=e.getMonth()+1+a;break;case"mm":n+=gj.core.pad(e.getMonth()+1)+a;break;case"mmm":n+=gj.core.messages[r||"en-us"].monthShortNames[e.getMonth()]+a;break;case"mmmm":n+=gj.core.messages[r||"en-us"].monthNames[e.getMonth()]+a;break;case"yy":n+=e.getFullYear().toString().substr(2)+a;break;case"yyyy":n+=e.getFullYear()+a}return n},pad:function(e,t){for(e=String(e),t=t||2;e.length0?t:0),e.css("top",r>0?r:0)},isIE:function(){return!!navigator.userAgent.match(/Trident/g)||!!navigator.userAgent.match(/MSIE/g)},setChildPosition:function(e,t){var r=e.getBoundingClientRect(),a=gj.core.height(e,!0),i=gj.core.height(t,!0),o=gj.core.width(e,!0),n=gj.core.width(t,!0),d=window.scrollY||window.pageYOffset||0,s=window.scrollX||window.pageXOffset||0;r.top+a+i>window.innerHeight&&r.top>i?t.style.top=Math.round(r.top+d-i-3)+"px":t.style.top=Math.round(r.top+d+a+3)+"px",r.left+n>document.body.clientWidth?t.style.left=Math.round(r.left+s+o-n)+"px":t.style.left=Math.round(r.left+s)+"px"},height:function(e,t){var r,a=window.getComputedStyle(e);return"border-box"===a.boxSizing?(r=parseInt(a.height,10),gj.core.isIE()&&(r+=parseInt(a.paddingTop||0,10)+parseInt(a.paddingBottom||0,10),r+=parseInt(a.borderTopWidth||0,10)+parseInt(a.borderBottomWidth||0,10))):(r=parseInt(a.height,10),r+=parseInt(a.paddingTop||0,10)+parseInt(a.paddingBottom||0,10),r+=parseInt(a.borderTopWidth||0,10)+parseInt(a.borderBottomWidth||0,10)),t&&(r+=parseInt(a.marginTop||0,10)+parseInt(a.marginBottom||0,10)),r},width:function(e,t){var r,a=window.getComputedStyle(e);return"border-box"===a.boxSizing?r=parseInt(a.width,10):(r=parseInt(a.width,10),r+=parseInt(a.paddingLeft||0,10)+parseInt(a.paddingRight||0,10),r+=parseInt(a.borderLeftWidth||0,10)+parseInt(a.borderRightWidth||0,10)),t&&(r+=parseInt(a.marginLeft||0,10)+parseInt(a.marginRight||0,10)),r},addClasses:function(e,t){var r,a;if(t)for(a=t.split(" "),r=0;re.clientHeight?e:gj.core.getScrollParent(e.parentNode)}},gj.picker={messages:{"en-us":{}}},gj.picker.methods={initialize:function(e,t,r){var a,i=r.createPicker(e,t),o=e.parent('div[role="wrapper"]');(a="bootstrap"===t.uiLibrary?$(''+t.icons.rightIcon+""):"bootstrap4"===t.uiLibrary?$('"):$(t.icons.rightIcon)).attr("role","right-icon"),0===o.length?(o=$('
').addClass(t.style.wrapper),e.wrap(o)):o.addClass(t.style.wrapper),o=e.parent('div[role="wrapper"]'),t.width&&o.css("width",t.width),e.val(t.value).addClass(t.style.input).attr("role","input"),t.fontSize&&e.css("font-size",t.fontSize),"bootstrap"===t.uiLibrary||"bootstrap4"===t.uiLibrary?"small"===t.size?(o.addClass("input-group-sm"),e.addClass("form-control-sm")):"large"===t.size&&(o.addClass("input-group-lg"),e.addClass("form-control-lg")):"small"===t.size?o.addClass("small"):"large"===t.size&&o.addClass("large"),a.on("click",function(t){i.is(":visible")?e.close():e.open()}),o.append(a),!0!==t.footer&&(e.on("blur",function(){e.timeout=setTimeout(function(){e.close()},500)}),i.mousedown(function(){return clearTimeout(e.timeout),e.focus(),!1}),i.on("click",function(){clearTimeout(e.timeout),e.focus()}))}},gj.picker.widget=function(e,t){var r=gj.picker.methods;return this.destroy=function(){return r.destroy(this)},e},gj.picker.widget.prototype=new gj.widget,gj.picker.widget.constructor=gj.picker.widget,gj.picker.widget.prototype.init=function(e,t,r){return gj.widget.prototype.init.call(this,e,t),this.attr("data-"+t,"true"),gj.picker.methods.initialize(this,this.data(),gj[t].methods),this},gj.picker.widget.prototype.open=function(e){var t=this.data(),r=$("body").find('[role="picker"][guid="'+this.attr("data-guid")+'"]');return r.show(),r.closest('div[role="modal"]').show(),t.modal?gj.core.center(r):(gj.core.setChildPosition(this[0],r[0]),this.focus()),clearTimeout(this.timeout),gj[e].events.open(this),this},gj.picker.widget.prototype.close=function(e){var t=$("body").find('[role="picker"][guid="'+this.attr("data-guid")+'"]');return t.hide(),t.closest('div[role="modal"]').hide(),gj[e].events.close(this),this},gj.picker.widget.prototype.destroy=function(e){var t=this.data(),r=this.parent(),a=$("body").find('[role="picker"][guid="'+this.attr("data-guid")+'"]');return t&&(this.off(),a.parent('[role="modal"]').length>0&&a.unwrap(),a.remove(),this.removeData(),this.removeAttr("data-type").removeAttr("data-guid").removeAttr("data-"+e),this.removeClass(),r.children('[role="right-icon"]').remove(),this.unwrap()),this},gj.dialog={plugins:{},messages:{}},gj.dialog.config={base:{autoOpen:!0,closeButtonInHeader:!0,closeOnEscape:!0,draggable:!0,height:"auto",locale:"en-us",maxHeight:void 0,maxWidth:void 0,minHeight:void 0,minWidth:void 0,modal:!1,resizable:!1,scrollable:!1,title:void 0,uiLibrary:void 0,width:300,style:{modal:"gj-modal",content:"gj-dialog-md",header:"gj-dialog-md-header gj-unselectable",headerTitle:"gj-dialog-md-title",headerCloseButton:"gj-dialog-md-close",body:"gj-dialog-md-body",footer:"gj-dialog-footer gj-dialog-md-footer"}},bootstrap:{style:{modal:"modal",content:"modal-content gj-dialog-bootstrap",header:"modal-header",headerTitle:"modal-title",headerCloseButton:"close",body:"modal-body",footer:"gj-dialog-footer modal-footer"}},bootstrap4:{style:{modal:"modal",content:"modal-content gj-dialog-bootstrap4",header:"modal-header",headerTitle:"modal-title",headerCloseButton:"close",body:"modal-body",footer:"gj-dialog-footer modal-footer"}}},gj.dialog.events={initialized:function(e){e.trigger("initialized")},opening:function(e){e.trigger("opening")},opened:function(e){e.trigger("opened")},closing:function(e){e.trigger("closing")},closed:function(e){e.trigger("closed")},drag:function(e){e.trigger("drag")},dragStart:function(e){e.trigger("dragStart")},dragStop:function(e){e.trigger("dragStop")},resize:function(e){e.trigger("resize")},resizeStart:function(e){e.trigger("resizeStart")},resizeStop:function(e){e.trigger("resizeStop")}},gj.dialog.methods={init:function(e){return gj.widget.prototype.init.call(this,e,"dialog"),gj.dialog.methods.localization(this),gj.dialog.methods.initialize(this),gj.dialog.events.initialized(this),this},localization:function(e){var t=e.data();void 0===t.title&&(t.title=gj.dialog.messages[t.locale].DefaultTitle)},getHTMLConfig:function(){var e=gj.widget.prototype.getHTMLConfig.call(this),t=this[0].attributes;return t.title&&(e.title=t.title.value),e},initialize:function(e){var t,r,a,i=e.data();e.addClass(i.style.content),gj.dialog.methods.setSize(e),i.closeOnEscape&&$(document).keyup(function(t){27===t.keyCode&&e.close()}),0===(r=e.children('div[data-role="body"]')).length?(r=$('
').addClass(i.style.body),e.wrapInner(r)):r.addClass(i.style.body),t=gj.dialog.methods.renderHeader(e),a=e.children('div[data-role="footer"]').addClass(i.style.footer),e.find('[data-role="close"]').on("click",function(){e.close()}),gj.draggable&&(i.draggable&&gj.dialog.methods.draggable(e,t),i.resizable&&gj.dialog.methods.resizable(e)),i.scrollable&&i.height&&(e.addClass("gj-dialog-scrollable"),e.on("opened",function(){e.children('div[data-role="body"]').css("height",i.height-t.outerHeight()-(a.length?a.outerHeight():0))})),gj.core.center(e),i.modal&&e.wrapAll('
'),i.autoOpen&&e.open()},setSize:function(e){var t=e.data();t.width&&e.css("width",t.width),t.height&&e.css("height",t.height)},renderHeader:function(e){var t,r,a,i=e.data();return 0===(t=e.children('div[data-role="header"]')).length&&(t=$('
'),e.prepend(t)),t.addClass(i.style.header),0===(r=t.find('[data-role="title"]')).length&&(r=$('

'+i.title+"

"),t.append(r)),r.addClass(i.style.headerTitle),0===(a=t.find('[data-role="close"]')).length&&i.closeButtonInHeader?((a=$('')).addClass(i.style.headerCloseButton),t.append(a)):a.length>0&&!1===i.closeButtonInHeader?a.hide():a.addClass(i.style.headerCloseButton),t},draggable:function(e,t){e.appendTo("body"),t.addClass("gj-draggable"),e.draggable({handle:t,start:function(){e.addClass("gj-unselectable"),gj.dialog.events.dragStart(e)},stop:function(){e.removeClass("gj-unselectable"),gj.dialog.events.dragStop(e)}})},resizable:function(e){var t={drag:gj.dialog.methods.resize,start:function(){e.addClass("gj-unselectable"),gj.dialog.events.resizeStart(e)},stop:function(){this.removeAttribute("style"),e.removeClass("gj-unselectable"),gj.dialog.events.resizeStop(e)}};e.append($('
').draggable($.extend(!0,{horizontal:!1},t))),e.append($('
').draggable($.extend(!0,{vertical:!1},t))),e.append($('
').draggable($.extend(!0,{horizontal:!1},t))),e.append($('
').draggable($.extend(!0,{vertical:!1},t))),e.append($('
').draggable($.extend(!0,{},t))),e.append($('
').draggable($.extend(!0,{},t))),e.append($('
').draggable($.extend(!0,{},t))),e.append($('
').draggable($.extend(!0,{},t)))},resize:function(e,t){var r,a,i,o,n,d,s,l,c=!1;return a=(r=$(this)).parent(),i=gj.core.position(this),offset={top:t.top-i.top,left:t.left-i.left},o=a.data(),r.hasClass("gj-resizable-n")?(n=a.height()-offset.top,s=a.offset().top+offset.top):r.hasClass("gj-resizable-e")?d=a.width()+offset.left:r.hasClass("gj-resizable-s")?n=a.height()+offset.top:r.hasClass("gj-resizable-w")?(d=a.width()-offset.left,l=a.offset().left+offset.left):r.hasClass("gj-resizable-ne")?(n=a.height()-offset.top,s=a.offset().top+offset.top,d=a.width()+offset.left):r.hasClass("gj-resizable-nw")?(n=a.height()-offset.top,s=a.offset().top+offset.top,d=a.width()-offset.left,l=a.offset().left+offset.left):r.hasClass("gj-resizable-se")?(n=a.height()+offset.top,d=a.width()+offset.left):r.hasClass("gj-resizable-sw")&&(n=a.height()+offset.top,d=a.width()-offset.left,l=a.offset().left+offset.left),n&&(!o.minHeight||n>=o.minHeight)&&(!o.maxHeight||n<=o.maxHeight)&&(a.height(n),s&&a.css("top",s),c=!0),d&&(!o.minWidth||d>=o.minWidth)&&(!o.maxWidth||d<=o.maxWidth)&&(a.width(d),l&&a.css("left",l),c=!0),c&&gj.dialog.events.resize(a),c},open:function(e,t){var r;return gj.dialog.events.opening(e),e.css("display","block"),e.closest('div[data-role="modal"]').css("display","block"),(r=e.children('div[data-role="footer"]')).length&&r.outerHeight()&&e.children('div[data-role="body"]').css("margin-bottom",r.outerHeight()),void 0!==t&&e.find('[data-role="title"]').html(t),gj.dialog.events.opened(e),e},close:function(e){return e.is(":visible")&&(gj.dialog.events.closing(e),e.css("display","none"),e.closest('div[data-role="modal"]').css("display","none"),gj.dialog.events.closed(e)),e},isOpen:function(e){return e.is(":visible")},content:function(e,t){var r=e.children('div[data-role="body"]');return void 0===t?r.html():r.html(t)},destroy:function(e,t){var r=e.data();return r&&(!1===t?e.remove():(e.close(),e.off(),e.removeData(),e.removeAttr("data-type"),e.removeClass(r.style.content),e.find('[data-role="header"]').removeClass(r.style.header),e.find('[data-role="title"]').removeClass(r.style.headerTitle),e.find('[data-role="close"]').remove(),e.find('[data-role="body"]').removeClass(r.style.body),e.find('[data-role="footer"]').removeClass(r.style.footer))),e}},gj.dialog.widget=function(e,t){var r=gj.dialog.methods;return this.open=function(e){return r.open(this,e)},this.close=function(){return r.close(this)},this.isOpen=function(){return r.isOpen(this)},this.content=function(e){return r.content(this,e)},this.destroy=function(e){return r.destroy(this,e)},$.extend(e,this),"dialog"!==e.attr("data-type")&&r.init.call(e,t),e},gj.dialog.widget.prototype=new gj.widget,gj.dialog.widget.constructor=gj.dialog.widget,gj.dialog.widget.prototype.getHTMLConfig=gj.dialog.methods.getHTMLConfig,jQuery.fn.dialog=function(e){var t;if(this&&this.length){if("object"!=typeof e&&e){if((t=new gj.dialog.widget(this,null))[e])return t[e].apply(this,Array.prototype.slice.call(arguments,1));throw"Method "+e+" does not exist."}return new gj.dialog.widget(this,e)}},gj.dialog.messages["en-us"]={Close:"Close",DefaultTitle:"Dialog"},gj.draggable={plugins:{}},gj.draggable.config={base:{handle:void 0,vertical:!0,horizontal:!0,containment:void 0}},gj.draggable.methods={init:function(e){var t,r,a=this;return gj.widget.prototype.init.call(this,e,"draggable"),r=this.data(),a.attr("data-draggable","true"),(t=gj.draggable.methods.getHandleElement(a)).on("touchstart mousedown",function(e){var i=gj.core.position(a[0]);a[0].style.top=i.top+"px",a[0].style.left=i.left+"px",a[0].style.position="fixed",a.attr("draggable-dragging",!0),a.removeAttr("draggable-x").removeAttr("draggable-y"),gj.documentManager.subscribeForEvent("touchmove",a.data("guid"),gj.draggable.methods.createMoveHandler(a,t,r)),gj.documentManager.subscribeForEvent("mousemove",a.data("guid"),gj.draggable.methods.createMoveHandler(a,t,r))}),gj.documentManager.subscribeForEvent("mouseup",a.data("guid"),gj.draggable.methods.createUpHandler(a)),gj.documentManager.subscribeForEvent("touchend",a.data("guid"),gj.draggable.methods.createUpHandler(a)),gj.documentManager.subscribeForEvent("touchcancel",a.data("guid"),gj.draggable.methods.createUpHandler(a)),a},getHandleElement:function(e){var t=e.data("handle");return t&&t.length?t:e},createUpHandler:function(e){return function(t){"true"===e.attr("draggable-dragging")&&(e.attr("draggable-dragging",!1),gj.documentManager.unsubscribeForEvent("mousemove",e.data("guid")),gj.documentManager.unsubscribeForEvent("touchmove",e.data("guid")),gj.draggable.events.stop(e,{x:e.mouseX(t),y:e.mouseY(t)}))}},createMoveHandler:function(e,t,r){return function(t){var a,i,o,n,d,s;"true"===e.attr("draggable-dragging")&&(a=Math.round(e.mouseX(t)),i=Math.round(e.mouseY(t)),d=e.attr("draggable-x"),s=e.attr("draggable-y"),d&&s?(o=r.horizontal?a-parseInt(d,10):0,n=r.vertical?i-parseInt(s,10):0,gj.draggable.methods.move(e[0],r,o,n,a,i)):gj.draggable.events.start(e,a,i),e.attr("draggable-x",a),e.attr("draggable-y",i))}},move:function(e,t,r,a,i,o){var n,d,s,l=gj.core.position(e),c=l.top+a,g=l.left+r;t.containment&&(d=(n=gj.core.position(t.containment)).top+gj.core.height(t.containment)-gj.core.height(e),s=n.left+gj.core.width(t.containment)-gj.core.width(e),c>n.top&&c=o||n.bottom<=o)&&(c=l.top):c=c<=n.top?n.top+1:d-1,g>n.left&&g=i||n.right<=i)&&(g=l.left):g=g<=n.left?n.left+1:s-1),!1!==gj.draggable.events.drag($(e),g,c,i,o)&&(e.style.top=c+"px",e.style.left=g+"px")},destroy:function(e){return"true"===e.attr("data-draggable")&&(gj.documentManager.unsubscribeForEvent("mouseup",e.data("guid")),e.removeData(),e.removeAttr("data-guid").removeAttr("data-type").removeAttr("data-draggable"),e.removeAttr("draggable-x").removeAttr("draggable-y").removeAttr("draggable-dragging"),e[0].style.top="",e[0].style.left="",e[0].style.position="",e.off("drag").off("start").off("stop"),gj.draggable.methods.getHandleElement(e).off("mousedown")),e}},gj.draggable.events={drag:function(e,t,r,a,i){return e.triggerHandler("drag",[{left:t,top:r},{x:a,y:i}])},start:function(e,t,r){e.triggerHandler("start",[{x:t,y:r}])},stop:function(e,t){e.triggerHandler("stop",[t])}},gj.draggable.widget=function(e,t){var r=gj.draggable.methods;return e.destroy||(this.destroy=function(){return r.destroy(this)}),$.extend(e,this),"true"!==e.attr("data-draggable")&&r.init.call(e,t),e},gj.draggable.widget.prototype=new gj.widget,gj.draggable.widget.constructor=gj.draggable.widget,jQuery.fn.draggable=function(e){var t;if(this&&this.length){if("object"!=typeof e&&e){if((t=new gj.draggable.widget(this,null))[e])return t[e].apply(this,Array.prototype.slice.call(arguments,1));throw"Method "+e+" does not exist."}return new gj.draggable.widget(this,e)}},gj.droppable={plugins:{}},gj.droppable.config={hoverClass:void 0},gj.droppable.methods={init:function(e){return gj.widget.prototype.init.call(this,e,"droppable"),this.attr("data-droppable","true"),gj.documentManager.subscribeForEvent("mousedown",this.data("guid"),gj.droppable.methods.createMouseDownHandler(this)),gj.documentManager.subscribeForEvent("mousemove",this.data("guid"),gj.droppable.methods.createMouseMoveHandler(this)),gj.documentManager.subscribeForEvent("mouseup",this.data("guid"),gj.droppable.methods.createMouseUpHandler(this)),this},createMouseDownHandler:function(e){return function(t){e.isDragging=!0}},createMouseMoveHandler:function(e){return function(t){if(e.isDragging){var r=e.data("hoverClass"),a={x:e.mouseX(t),y:e.mouseY(t)},i=gj.droppable.methods.isOver(e,a);i!=e.isOver&&(i?(r&&e.addClass(r),gj.droppable.events.over(e,a)):(r&&e.removeClass(r),gj.droppable.events.out(e))),e.isOver=i}}},createMouseUpHandler:function(e){return function(t){var r={left:e.mouseX(t),top:e.mouseY(t)};e.isDragging=!1,gj.droppable.methods.isOver(e,r)&&gj.droppable.events.drop(e)}},isOver:function(e,t){var r=e.offset().top,a=e.offset().left;return t.x>a&&t.xr&&t.y',desc:''}},fontawesome:{icons:{asc:'',desc:''}},glyphicons:{icons:{asc:'',desc:''}}},gj.grid.events={beforeEmptyRowInsert:function(e,t){return e.triggerHandler("beforeEmptyRowInsert",[t])},dataBinding:function(e,t){return e.triggerHandler("dataBinding",[t])},dataBound:function(e,t,r){return e.triggerHandler("dataBound",[t,r])},rowDataBound:function(e,t,r,a){return e.triggerHandler("rowDataBound",[t,r,a])},cellDataBound:function(e,t,r,a,i){return e.triggerHandler("cellDataBound",[t,r,a,i])},rowSelect:function(e,t,r,a){return e.triggerHandler("rowSelect",[t,r,a])},rowUnselect:function(e,t,r,a){return e.triggerHandler("rowUnselect",[t,r,a])},rowRemoving:function(e,t,r,a){return e.triggerHandler("rowRemoving",[t,r,a])},destroying:function(e){return e.triggerHandler("destroying")},columnHide:function(e,t){return e.triggerHandler("columnHide",[t])},columnShow:function(e,t){return e.triggerHandler("columnShow",[t])},initialized:function(e){return e.triggerHandler("initialized")},dataFiltered:function(e,t){return e.triggerHandler("dataFiltered",[t])}},gj.grid.methods={init:function(e){return gj.widget.prototype.init.call(this,e,"grid"),gj.grid.methods.initialize(this),this.data("autoLoad")&&this.reload(),this},getConfig:function(e,t){var r=gj.widget.prototype.getConfig.call(this,e,t);return gj.grid.methods.setDefaultColumnConfig(r.columns,r.defaultColumnSettings),r},setDefaultColumnConfig:function(e,t){var r,a;if(e&&e.length)for(a=0;a tr > th").each(function(){var t=$(this),r=t.text(),a=gj.widget.prototype.getHTMLConfig.call(t);a.title=r,a.field||(a.field=r),a.events&&(a.events=gj.grid.methods.eventsParser(a.events)),e.columns.push(a)}),e},eventsParser:function(events){var result={},list,i,key,func,position;for(list=events.split(","),i=0;i0&&(key=$.trim(list[i].substr(0,position)),func=$.trim(list[i].substr(position+1,list[i].length)),result[key]=eval("window."+func));return result},initialize:function(e){var t=e.data(),r=e.parent('div[data-role="wrapper"]');gj.grid.methods.localization(t),0===r.length?(r=$('
').addClass(t.style.wrapper),e.wrap(r)):r.addClass(t.style.wrapper),t.width&&e.parent().css("width",t.width),t.minWidth&&e.css("min-width",t.minWidth),t.fontSize&&e.css("font-size",t.fontSize),"autogrow"===t.headerRowHeight&&e.addClass("autogrow-header-row"),"fixed"===t.bodyRowHeight&&e.addClass("fixed-body-rows"),e.addClass(t.style.table),"checkbox"===t.selectionMethod&&t.columns.splice(gj.grid.methods.getColumnPositionNotInRole(e),0,{title:"",width:t.defaultCheckBoxColumnWidth,align:"center",type:"checkbox",role:"selectRow",events:{click:function(t){gj.grid.methods.setSelected(e,t.data.id,$(this).closest("tr"))}},headerCssClass:"gj-grid-select-all",stopPropagation:!0}),0===e.children("tbody").length&&e.append($("")),gj.grid.methods.renderHeader(e),gj.grid.methods.appendEmptyRow(e," "),gj.grid.events.initialized(e)},localization:function(e){e.notFoundText||(e.notFoundText=gj.grid.messages[e.locale].NoRecordsFound)},renderHeader:function(e){var t,r,a,i,o,n,d,s,l;for(r=(t=e.data()).columns,a=t.style.header,0===(i=e.children("thead")).length&&(i=$(""),e.prepend(i)),o=$(''),s=0;s'),r[s].width?n.attr("width",r[s].width):"checkbox"===r[s].type&&n.attr("width",t.defaultIconColumnWidth),n.addClass(a.cell),r[s].headerCssClass&&n.addClass(r[s].headerCssClass),n.css("text-align",r[s].align||"left"),"checkbox"===t.selectionMethod&&"multiple"===t.selectionType&&"checkbox"===r[s].type&&"selectRow"===r[s].role?(0===(l=n.find('input[data-role="selectAll"]')).length&&(l=$(''),n.append(l),l.checkbox({uiLibrary:t.uiLibrary})),l.off("click").on("click",function(){this.checked?e.selectAll():e.unSelectAll()})):(d=$('
').html(void 0===r[s].title?r[s].field:r[s].title),n.append(d),r[s].sortable&&(d.addClass(a.sortable),d.on("click",gj.grid.methods.createSortHandler(e,r[s])))),r[s].hidden&&n.hide(),o.append(n);i.empty().append(o)},createSortHandler:function(e,t){return function(){var r,a={};e.count()>0&&(a[(r=e.data()).paramNames.sortBy]=t.field,t.direction="asc"===t.direction?"desc":"asc",a[r.paramNames.direction]=t.direction,e.reload(a))}},updateHeader:function(e){var t,r,a=e.data(),i=a.params[a.paramNames.sortBy],o=a.params[a.paramNames.direction];e.find('thead tr th [data-role="sorticon"]').remove(),i&&(position=gj.grid.methods.getColumnPosition(e.data("columns"),i),position>-1&&(r=e.find("thead tr th:eq("+position+') div[data-role="title"]'),t=$('
').append("desc"===o?a.icons.desc:a.icons.asc),r.after(t)))},useHtmlDataSource:function(e,t){var r,a,i,o,n=[],d=e.find('tbody tr[data-role != "empty"]');for(r=0;r').addClass(d.style.loadingCover).css({width:i,height:o,top:n}),(a=$('
'+gj.grid.messages[d.locale].Loading+"
").addClass(d.style.loadingText)).insertAfter(e),r.insertAfter(e),a.css({top:n+o/2-a.outerHeight(!1)/2,left:i/2-a.outerWidth(!1)/2}))},stopLoading:function(e){e.parent().find('div[data-role="loading-cover"]').remove(),e.parent().find('div[data-role="loading-text"]').remove()},appendEmptyRow:function(e,t){var r,a,i,o;r=e.data(),a=$(''),(i=$("").css({width:"100%","text-align":"center"})).attr("colspan",gj.grid.methods.countVisibleColumns(e)),o=$("
").html(t||r.notFoundText),i.append(o),a.append(i),gj.grid.events.beforeEmptyRowInsert(e,a),e.append(a)},autoGenerateColumns:function(e,t){var r,a,i,o,n=e.data();if(n.columns=[],t.length>0){for(r=Object.getOwnPropertyNames(t[0]),o=0;o-1&&(i="date")),n.columns.push({field:r[o],type:i});gj.grid.methods.setDefaultColumnConfig(n.columns,n.defaultColumnSettings)}gj.grid.methods.renderHeader(e)},loadData:function(e){var t,r,a,i,o,n,d,s;for(t=e.data(),r=e.getAll(),gj.grid.events.dataBinding(e,r),i=r.length,gj.grid.methods.stopLoading(e),t.autoGenerateColumns&&gj.grid.methods.autoGenerateColumns(e,r),n=e.children("tbody"),"checkbox"===t.selectionMethod&&"multiple"===t.selectionType&&e.find('thead input[data-role="selectAll"]').prop("checked",!1),n.children("tr").not('[data-role="row"]').remove(),0===i&&(n.empty(),gj.grid.methods.appendEmptyRow(e)),o=(d=n.children("tr")).length,a=0;a'),e.children("tbody").append(t)),i=gj.grid.methods.getId(r,d.primaryKey,a+1),t.attr("data-position",a+1),"checkbox"!==d.selectionMethod&&t.on("click",gj.grid.methods.createRowClickHandler(e,i)),n=0;n"),n=$('
'),r.align&&t.css("text-align",r.align),r.cssClass&&t.addClass(r.cssClass),t.append(n),o="create"),gj.grid.methods.renderDisplayElement(e,n,r,a,i,o),"update"===o&&(t.off(),n.off()),r.events)for(d in r.events)r.events.hasOwnProperty(d)&&t.on(d,{id:i,field:r.field,record:a},gj.grid.methods.createCellEventHandler(r,r.events[d]));return r.hidden&&t.hide(),gj.grid.events.cellDataBound(e,n,i,r,a),t},createCellEventHandler:function(e,t){return function(r){e.stopPropagation&&r.stopPropagation(),t.call(this,r)}},renderDisplayElement:function(e,t,r,a,i,o){var n,d;"checkbox"===r.type&&gj.checkbox?"create"===o?(d=$('').val(i).prop("checked",!!a[r.field]),r.role&&d.attr("data-role",r.role),t.append(d),d.checkbox({uiLibrary:e.data("uiLibrary")}),"selectRow"===r.role?d.on("click",function(){return!1}):d.prop("disabled",!0)):t.find('input[type="checkbox"]').val(i).prop("checked",!!a[r.field]):"icon"===r.type?"create"===o&&(t.append($("").addClass(r.icon).css({cursor:"pointer"})),"bootstrap"===e.data().uiLibrary&&t.children("span").addClass("glyphicon"),r.stopPropagation=!0):r.tmpl?(n=r.tmpl,r.tmpl.replace(/\{(.+?)\}/g,function(e,t){n=n.replace(e,gj.grid.methods.formatText(a[t],r))}),t.html(n)):r.renderer&&"function"==typeof r.renderer?(n=r.renderer(a[r.field],a,t.parent(),t,i,e))&&t.html(n):(a[r.field]=gj.grid.methods.formatText(a[r.field],r),!r.tooltip&&a[r.field]&&t.attr("title",a[r.field]),t.html(a[r.field])),r.tooltip&&"create"===o&&t.attr("title",r.tooltip)},formatText:function(e,t){return e=e&&["date","time","datetime"].indexOf(t.type)>-1?gj.core.formatDate(gj.core.parseDate(e,t.format),t.format):null==e?"":e.toString(),t.decimalDigits&&e&&(e=parseFloat(e).toFixed(t.decimalDigits)),e},setRecordsData:function(e,t){var r=[],a=0,i=e.data();return $.isArray(t)?(r=t,a=t.length):i&&i.mapping&&$.isArray(t[i.mapping.dataField])&&(r=t[i.mapping.dataField],(a=t[i.mapping.totalRecordsField])&&!isNaN(a)||(a=0)),e.data("records",r),e.data("totalRecords",a),r},createRowClickHandler:function(e,t){return function(){gj.grid.methods.setSelected(e,t,$(this))}},selectRow:function(e,t,r,a){var i;return r.addClass(t.style.content.rowSelected),r.attr("data-selected","true"),"checkbox"===t.selectionMethod&&((i=r.find('input[type="checkbox"][data-role="selectRow"]')).length&&!i.prop("checked")&&i.prop("checked",!0),"multiple"===t.selectionType&&e.getSelections().length===e.count(!1)&&e.find('thead input[data-role="selectAll"]').prop("checked",!0)),gj.grid.events.rowSelect(e,r,a,e.getById(a))},unselectRow:function(e,t,r,a){var i;if("true"===r.attr("data-selected"))return r.removeClass(t.style.content.rowSelected),"checkbox"===t.selectionMethod&&((i=r.find('td input[type="checkbox"][data-role="selectRow"]')).length&&i.prop("checked")&&i.prop("checked",!1),"multiple"===t.selectionType&&e.find('thead input[data-role="selectAll"]').prop("checked",!1)),r.removeAttr("data-selected"),gj.grid.events.rowUnselect(e,r,a,e.getById(a))},setSelected:function(e,t,r){var a=e.data();return r&&r.length||(r=gj.grid.methods.getRowById(e,t)),r&&("true"===r.attr("data-selected")?gj.grid.methods.unselectRow(e,a,r,t):("single"===a.selectionType&&r.siblings('[data-selected="true"]').each(function(){var t=$(this),r=gj.grid.methods.getId(t,a.primaryKey,t.data("position"));gj.grid.methods.unselectRow(e,a,t,r)}),gj.grid.methods.selectRow(e,a,r,t))),e},selectAll:function(e){var t=e.data();return e.find('tbody tr[data-role="row"]').each(function(){var r=$(this),a=r.data("position"),i=e.get(a),o=gj.grid.methods.getId(i,t.primaryKey,a);gj.grid.methods.selectRow(e,t,r,o)}),e.find('thead input[data-role="selectAll"]').prop("checked",!0),e},unSelectAll:function(e){var t=e.data();return e.find("tbody tr").each(function(){var r=$(this),a=r.data("position"),i=e.get(a),o=gj.grid.methods.getId(i,t.primaryKey,a);gj.grid.methods.unselectRow(e,t,r,o),r.find('input[type="checkbox"][data-role="selectRow"]').prop("checked",!1)}),e.find('thead input[data-role="selectAll"]').prop("checked",!1),e},getSelected:function(e){var t,r,a,i=null;return(t=e.find('tbody>tr[data-selected="true"]')).length>0&&(a=$(t[0]).data("position"),r=e.get(a),i=gj.grid.methods.getId(r,e.data().primaryKey,a)),i},getSelectedRows:function(e){e.data();return e.find('tbody>tr[data-selected="true"]')},getSelections:function(e){var t,r,a=[],i=e.data(),o=gj.grid.methods.getSelectedRows(e);return 0-1&&(i=gj.grid.methods.getRowById(e,t).find("td:eq("+a+') div[data-role="display"]')),i},setCellContent:function(e,t,r,a){var i,o=gj.grid.methods.getCell(e,t,r);o&&(o.empty(),"object"==typeof a?o.append(a):(i=gj.grid.methods.getColumnInfo(e,r),gj.grid.methods.renderDisplayElement(e,o,i,e.getById(t),t,"update")))},clone:function(e){var t=[];return $.each(e,function(){t.push(this.clone())}),t},getAll:function(e){return e.data("records")},countVisibleColumns:function(e){var t,r,a;for(t=e.data().columns,r=0,a=0;a-1}));return gj.grid.events.dataFiltered(e,i),i},createDefaultSorter:function(e,t){return function(r,a){var i=(r[t]||"").toString(),o=(a[t]||"").toString();return"asc"===e?i.localeCompare(o):o.localeCompare(i)}},destroy:function(e,t,r){return e.data()&&(gj.grid.events.destroying(e),gj.grid.methods.stopLoading(e),e.xhr&&e.xhr.abort(),e.off(),!1===r&&e.parent('div[data-role="wrapper"]').length>0&&e.unwrap(),e.removeData(),!1===t?e.remove():e.removeClass().empty(),e.removeAttr("data-type")),e},showColumn:function(e,t){var r,a=e.data(),i=gj.grid.methods.getColumnPosition(a.columns,t);return i>-1&&(e.find("thead>tr").each(function(){$(this).children("th").eq(i).show()}),$.each(e.find("tbody>tr"),function(){$(this).children("td").eq(i).show()}),a.columns[i].hidden=!1,(r=e.find('tbody > tr[data-role="empty"] > td'))&&r.length&&r.attr("colspan",gj.grid.methods.countVisibleColumns(e)),gj.grid.events.columnShow(e,a.columns[i])),e},hideColumn:function(e,t){var r,a=e.data(),i=gj.grid.methods.getColumnPosition(a.columns,t);return i>-1&&(e.find("thead>tr").each(function(){$(this).children("th").eq(i).hide()}),$.each(e.find("tbody>tr"),function(){$(this).children("td").eq(i).hide()}),a.columns[i].hidden=!0,(r=e.find('tbody > tr[data-role="empty"] > td'))&&r.length&&r.attr("colspan",gj.grid.methods.countVisibleColumns(e)),gj.grid.events.columnHide(e,a.columns[i])),e},isLastRecordVisible:function(){return!0},addRow:function(e,t){var r=e.data();return r.totalRecords=e.data("totalRecords")+1,gj.grid.events.dataBinding(e,[t]),r.records.push(t),$.isArray(r.dataSource)&&r.dataSource.push(t),1===r.totalRecords&&e.children("tbody").empty(),gj.grid.methods.isLastRecordVisible(e)&&gj.grid.methods.renderRow(e,null,t,e.count()-1),gj.grid.events.dataBound(e,[t],r.totalRecords),e},updateRow:function(e,t,r){var a,i=gj.grid.methods.getRowById(e,t),o=e.data();return o.records[i.data("position")-1]=r,$.isArray(o.dataSource)&&(a=gj.grid.methods.getRecVPosById(e,t),o.dataSource[a]=r),gj.grid.methods.renderRow(e,i,r,i.index()),e},removeRow:function(e,t){var r,a=e.data(),i=gj.grid.methods.getRowById(e,t);return gj.grid.events.rowRemoving(e,i,t,e.getById(t)),$.isArray(a.dataSource)&&(r=gj.grid.methods.getRecVPosById(e,t),a.dataSource.splice(r,1)),e.reload(),e},count:function(e,t){return t?e.data().totalRecords:e.getAll().length},getColumnPositionByRole:function(e,t){var r,a,i=e.data("columns");for(r=0;r-1?1:0)):a.css("width",i.outerWidth()),t=0;t',collapseRow:''}},fontawesome:{icons:{expandRow:'',collapseRow:''}},glyphicons:{icons:{expandRow:'',collapseRow:''}}},private:{expandDetail:function(e,t,r){var a=t.closest("tr"),i=$(''),o=$(''),n=$('
'),d=e.data(),s=a.data("position"),l=e.get(s),c=gj.grid.plugins.expandCollapseRows;void 0===typeof r&&(r=gj.grid.methods.getId(l,d.primaryKey,l)),i.append(o.append(n.append(a.data("details")))),i.insertAfter(a),t.children('div[data-role="display"]').empty().append(d.icons.collapseRow),e.updateDetails(a),c.private.keepSelection(e,r),c.events.detailExpand(e,i.find("td>div"),r)},collapseDetail:function(e,t,r){var a=t.closest("tr").next('tr[data-role="details"]'),i=e.data(),o=gj.grid.plugins.expandCollapseRows;void 0===typeof r&&(r=gj.grid.methods.getId(record,i.primaryKey,record)),a.remove(),t.children('div[data-role="display"]').empty().append(i.icons.expandRow),o.private.removeSelection(e,r),o.events.detailCollapse(e,a.find("td>div"),r)},keepSelection:function(e,t){var r=e.data();r.keepExpandedRows&&($.isArray(r.expandedRows)?-1==r.expandedRows.indexOf(t)&&r.expandedRows.push(t):r.expandedRows=[t])},removeSelection:function(e,t){var r=e.data();r.keepExpandedRows&&$.isArray(r.expandedRows)&&r.expandedRows.indexOf(t)>-1&&r.expandedRows.splice(r.expandedRows.indexOf(t),1)},updateDetailsColSpan:function(e){var t=e.find('tbody > tr[data-role="details"] > td');t&&t.length&&t.attr("colspan",gj.grid.methods.countVisibleColumns(e))}},public:{collapseAll:function(){var e,t=this,r=t.data();return void 0!==r.detailTemplate&&(e=gj.grid.methods.getColumnPositionByRole(t,"expander"),t.find('tbody tr[data-role="row"]').each(function(){gj.grid.plugins.expandCollapseRows.private.collapseDetail(t,$(this).find("td:eq("+e+")"))})),void 0!==r.grouping&&t.find('tbody tr[role="group"]').each(function(){gj.grid.plugins.grouping.private.collapseGroup(r,$(this).find("td:eq(0)"))}),t},expandAll:function(){var e,t=this,r=t.data();return void 0!==r.detailTemplate&&(e=gj.grid.methods.getColumnPositionByRole(t,"expander"),t.find('tbody tr[data-role="row"]').each(function(){gj.grid.plugins.expandCollapseRows.private.expandDetail(t,$(this).find("td:eq("+e+")"))})),void 0!==r.grouping&&t.find('tbody tr[role="group"]').each(function(){gj.grid.plugins.grouping.private.expandGroup(r,$(this).find("td:eq(0)"))}),t},updateDetails:function(e){var t=this,r=e.data("details"),a=r.html(),i=t.get(e.data("position"));return i&&a&&(r.html().replace(/\{(.+?)\}/g,function(e,r){var o=gj.grid.methods.getColumnInfo(t,r);a=a.replace(e,gj.grid.methods.formatText(i[r],o))}),r.html(a)),t}},events:{detailExpand:function(e,t,r){e.triggerHandler("detailExpand",[t,r])},detailCollapse:function(e,t,r){e.triggerHandler("detailCollapse",[t,r])}},configure:function(e){var t,r=e.data();$.extend(!0,e,gj.grid.plugins.expandCollapseRows.public),void 0!==r.detailTemplate&&(t={title:"",width:r.defaultIconColumnWidth,align:"center",stopPropagation:!0,cssClass:"gj-cursor-pointer gj-unselectable",tmpl:r.icons.expandRow,role:"expander",events:{click:function(t){var r=$(this),a=gj.grid.plugins.expandCollapseRows.private;"details"===r.closest("tr").next().attr("data-role")?a.collapseDetail(e,r,t.data.id):a.expandDetail(e,$(this),t.data.id)}}},r.columns=[t].concat(r.columns),e.on("rowDataBound",function(e,t,a,i){t.data("details",$(r.detailTemplate))}),e.on("columnShow",function(t,r){gj.grid.plugins.expandCollapseRows.private.updateDetailsColSpan(e)}),e.on("columnHide",function(t,r){gj.grid.plugins.expandCollapseRows.private.updateDetailsColSpan(e)}),e.on("rowRemoving",function(t,r,a,i){gj.grid.plugins.expandCollapseRows.private.collapseDetail(e,r.children("td").first(),a)}),e.on("dataBinding",function(){e.collapseAll()}),e.on("pageChanging",function(){e.collapseAll()}),e.on("dataBound",function(){var t,r,a,i,o=e.data();if(o.keepExpandedRows&&$.isArray(o.expandedRows))for(t=0;t '+gj.grid.messages[e.locale].Edit+"",e.inlineEditing.deleteButton='",e.inlineEditing.updateButton='",e.inlineEditing.cancelButton='"):(e.inlineEditing.editButton='",e.inlineEditing.deleteButton='",e.inlineEditing.updateButton='",e.inlineEditing.cancelButton='")},editMode:function(e,t,r,a){var i,o,n,d,s,l=e.data();if("edit"!==t.attr("data-mode"))if(r.editor){if(gj.grid.plugins.inlineEditing.private.updateOtherCells(e,r.mode),i=t.find('div[data-role="display"]').hide(),0===(o=t.find('div[data-role="edit"]').show()).length&&(o=$('
'),t.append(o)),d=a[r.editField||r.field],(n=o.find("input, select, textarea").first()).length)switch(r.type){case"checkbox":n.prop("checked",d);break;case"dropdown":n=n.dropdown("value",d);break;default:n.val(d)}else{if("function"==typeof r.editor)r.editor(o,d,a),n=o.find("input, select, textarea").first();else if((s="object"==typeof r.editor?r.editor:{}).uiLibrary=l.uiLibrary,s.iconsLibrary=l.iconsLibrary,s.fontSize=e.css("font-size"),s.showOnFocus=!1,"checkbox"===r.type&&gj.checkbox)n=$('').prop("checked",d),o.append(n),n.checkbox(s);else if("date"===r.type&&gj.datepicker||"time"===r.type&&gj.timepicker||"datetime"===r.type&&gj.datetimepicker){switch(n=$(''),o.append(n),r.format&&(s.format=r.format),r.type){case"date":n=n.datepicker(s);break;case"time":n=n.timepicker(s);break;case"datetime":n=n.datetimepicker(s)}n.value&&n.value(i.html())}else"dropdown"===r.type&&gj.dropdown?(n=$(''),"materialdesign"===l.uiLibrary&&n.addClass("gj-textbox-md").css("font-size",e.css("font-size")),o.append(n));"command"!==l.inlineEditing.mode&&"editOnly"!==r.mode&&(n=o.find("input, select, textarea").first()).on("keyup",function(a){13!==a.keyCode&&27!==a.keyCode||gj.grid.plugins.inlineEditing.private.displayMode(e,t,r)})}"INPUT"===n.prop("tagName").toUpperCase()&&"TEXT"===n.prop("type").toUpperCase()?gj.core.setCaretAtEnd(n[0]):n.focus(),t.attr("data-mode","edit")}else"managementColumn"===r.role&&(t.find('[role="edit"]').hide(),t.find('[role="delete"]').hide(),t.find('[role="update"]').show(),t.find('[role="cancel"]').show())},displayMode:function(e,t,r,a){var i,o,n,d,s,l,c;"editOnly"!==r.mode&&("edit"===t.attr("data-mode")&&(i=t.find('div[data-role="edit"]'),o=t.find('div[data-role="display"]'),"SELECT"===(n=i.find("input, select, textarea").first())[0].tagName.toUpperCase()&&n[0].selectedIndex>-1?(d=n[0].options[n[0].selectedIndex].innerHTML,s=n[0].value):d="INPUT"===n[0].tagName.toUpperCase()&&"CHECKBOX"===n[0].type.toUpperCase()?n[0].checked:n.val(),c=t.parent().data("position"),l=e.get(c),!0!==a&&d!==l[r.field]&&(l[r.field]="date"===r.type?gj.core.parseDate(d,r.format):d,r.editField&&(l[r.editField]=s||d),"editOnly"!==r.mode&&(gj.grid.methods.renderDisplayElement(e,o,r,l,gj.grid.methods.getId(l,e.data("primaryKey"),c),"update"),0===t.find("span.gj-dirty").length&&t.prepend($(''))),gj.grid.plugins.inlineEditing.events.cellDataChanged(e,t,r,l,d),gj.grid.plugins.inlineEditing.private.updateChanges(e,r,l,d)),i.hide(),o.show(),t.attr("data-mode","display")),"managementColumn"===r.role&&(t.find('[role="update"]').hide(),t.find('[role="cancel"]').hide(),t.find('[role="edit"]').show(),t.find('[role="delete"]').show()))},updateOtherCells:function(e,t){var r=e.data();"command"!==r.inlineEditing.mode&&"editOnly"!==t&&e.find('div[data-role="edit"]:visible').parent("td").each(function(){var t=$(this),a=r.columns[t.index()];gj.grid.plugins.inlineEditing.private.displayMode(e,t,a)})},updateChanges:function(e,t,r,a){var i,o,n,d=e.data();d.guid||(d.guid=gj.grid.plugins.inlineEditing.private.generateGUID()),d.primaryKey&&((i=JSON.parse(sessionStorage.getItem("gj.grid."+d.guid)))?o=i.filter(function(e){return e[d.primaryKey]===r[d.primaryKey]}):i=[],o&&1===o.length?o[0][t.field]=a:((n={})[d.primaryKey]=r[d.primaryKey],d.primaryKey!==t.field&&(n[t.field]=a),i.push(n)),sessionStorage.setItem("gj.grid."+d.guid,JSON.stringify(i)))},generateGUID:function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}},gj.grid.plugins.inlineEditing.public={getChanges:function(){return JSON.parse(sessionStorage.getItem("gj.grid."+this.data().guid))},edit:function(e){var t,r=this.getById(e),a=gj.grid.methods.getRowById(this,e).children("td"),i=this.data("columns");for(t=0;t',previous:'',next:'',last:'',refresh:''}},materialicons:{icons:{first:'',previous:'',next:'',last:'',refresh:''}},fontawesome:{icons:{first:'',previous:'',next:'',last:'',refresh:''}}},private:{init:function(e){var t,r,a,i,o,n,d,s,l,c;if((a=e.data()).pager)for(a.params[a.paramNames.page]||(a.params[a.paramNames.page]=1),a.params[a.paramNames.limit]||(a.params[a.paramNames.limit]=a.pager.limit),gj.grid.plugins.pagination.private.localization(a),t=$(''),r=$(""),t.append(r),o=$('
').addClass(a.style.pager.panel).css({float:"left"}),n=$('
').addClass(a.style.pager.panel).css({float:"right"}),r.append(o).append(n),d=$("").append(t),e.append(d),gj.grid.plugins.pagination.private.updatePagerColSpan(e),s=gj.grid.methods.clone(a.pager.leftControls),$.each(s,function(){o.append(this)}),l=gj.grid.methods.clone(a.pager.rightControls),$.each(l,function(){n.append(this)}),i=e.find("tfoot [data-role]"),c=0;c'+(e.icons.first||t.First)+"").attr("title",t.FirstPageTooltip).attr("data-role","page-first"),$('").attr("title",t.PreviousPageTooltip).attr("data-role","page-previous"),$("
"+t.Page+"
"),$(''),$("
"+t.Of+"
"),$('
0
'),$('").attr("title",t.NextPageTooltip).attr("data-role","page-next"),$('").attr("title",t.LastPageTooltip).attr("data-role","page-last"),$('").attr("title",t.Refresh).attr("data-role","page-refresh"),$('')]),void 0===e.pager.rightControls&&(e.pager.rightControls=[$("
"+t.DisplayingRecords+"
"),$('
0
'),$("
-
"),$('
0
'),$("
"+t.Of+"
"),$('
0
')])},localizationBootstrap4:function(e){var t=gj.grid.messages[e.locale];void 0===e.pager.leftControls&&(e.pager.leftControls=[$('").attr("title",t.FirstPageTooltip).attr("data-role","page-first"),$('").attr("title",t.PreviousPageTooltip).attr("data-role","page-previous"),$("
"+t.Page+"
"),$('
'),$("
"+t.Of+"
"),$('
0
'),$('").attr("title",t.NextPageTooltip).attr("data-role","page-next"),$('").attr("title",t.LastPageTooltip).attr("data-role","page-last"),$('").attr("title",t.Refresh).attr("data-role","page-refresh"),$('')]),void 0===e.pager.rightControls&&(e.pager.rightControls=[$("
"+t.DisplayingRecords+" 
"),$('
0
'),$("
-
"),$('
0
'),$("
"+t.Of+"
"),$('
0
')])},localizationMaterialDesign:function(e){var t=gj.grid.messages[e.locale];void 0===e.pager.leftControls&&(e.pager.leftControls=[]),void 0===e.pager.rightControls&&(e.pager.rightControls=[$(''+t.RowsPerPage+""),$('
'),$(' '),$('0'),$('-'),$('0'),$(''+t.Of+""),$('0'),$(' '),$('").attr("title",t.PreviousPageTooltip).attr("data-role","page-previous").addClass(e.icons.first?"gj-button-md-icon":""),$(' '),$('").attr("title",t.NextPageTooltip).attr("data-role","page-next").addClass(e.icons.first?"gj-button-md-icon":"")])},initPagerControl:function(e,t){var r=t.data();switch(e.data("role")){case"page-size":r.pager.sizes&&0").attr("value",this.toString()).text(this.toString()))}),e.change(function(){var e=parseInt(this.value,10);r.params[r.paramNames.limit]=e,gj.grid.plugins.pagination.private.changePage(t,1),gj.grid.plugins.pagination.events.pageSizeChange(t,e)}),e.val(r.params[r.paramNames.limit]),gj.dropdown&&e.dropdown({uiLibrary:r.uiLibrary,iconsLibrary:r.iconsLibrary,fontSize:e.css("font-size"),style:{presenter:"btn btn-default btn-sm"}})):e.hide();break;case"page-refresh":e.on("click",function(){t.reload()})}},reloadPager:function(e,t){var r,a,i,o,n,d,s,l;if((d=e.data()).pager){for(r=0===t?0:parseInt(d.params[d.paramNames.page],10),a=parseInt(d.params[d.paramNames.limit],10),i=Math.ceil(t/a),n=(o=0===r?0:a*(r-1)+1)+a>t?t:o+a-1,s=e.find("TFOOT [data-role]"),l=0;li?t.hide():(t.show().off("click").text(a),a===r?t.addClass(o.activeButton):t.removeClass(o.activeButton).on("click",function(){gj.grid.plugins.pagination.private.changePage(e,a)}))},createChangePageHandler:function(e,t){return function(){e.data();var t=parseInt(this.value,10);gj.grid.plugins.pagination.private.changePage(e,t)}},changePage:function(e,t){var r=e.data();!1===gj.grid.plugins.pagination.events.pageChanging(e,t)||isNaN(t)||(e.find('TFOOT [data-role="page-number"]').val(t),r.params[r.paramNames.page]=t),e.reload()},updatePagerColSpan:function(e){var t=e.find('tfoot > tr[data-role="pager"] > th');t&&t.length&&t.attr("colspan",gj.grid.methods.countVisibleColumns(e))},isLastRecordVisible:function(e){var t=!0,r=e.data(),a=parseInt(r.params[r.paramNames.limit],10),i=parseInt(r.params[r.paramNames.page],10),o=e.count();return a&&i&&(t=(i-1)*a+o===r.totalRecords),t}},public:{getAll:function(e){var t,r,a=this.data();return $.isArray(a.dataSource)?e?a.dataSource:a.params[a.paramNames.limit]&&a.params[a.paramNames.page]?(t=parseInt(a.params[a.paramNames.limit],10),r=(parseInt(a.params[a.paramNames.page],10)-1)*t,a.records.slice(r,r+t)):a.records:a.records}},events:{pageSizeChange:function(e,t){e.triggerHandler("pageSizeChange",[t])},pageChanging:function(e,t){e.triggerHandler("pageChanging",[t])}},configure:function(e,t,r){$.extend(!0,e,gj.grid.plugins.pagination.public);e.data();r.pager&&(gj.grid.methods.isLastRecordVisible=gj.grid.plugins.pagination.private.isLastRecordVisible,e.on("initialized",function(){gj.grid.plugins.pagination.private.init(e)}),e.on("dataBound",function(t,r,a){gj.grid.plugins.pagination.private.reloadPager(e,a)}),e.on("columnShow",function(){gj.grid.plugins.pagination.private.updatePagerColSpan(e)}),e.on("columnHide",function(){gj.grid.plugins.pagination.private.updatePagerColSpan(e)}))}},gj.grid.plugins.responsiveDesign={config:{base:{resizeCheckInterval:500,responsive:!1,showHiddenColumnsAsDetails:!1,defaultColumn:{priority:void 0,minWidth:250},style:{rowDetailItem:""}},bootstrap:{style:{rowDetailItem:"col-lg-4"}}},private:{orderColumns:function(e){var t=[];if(e.columns&&e.columns.length){for(i=0;it.priority&&(r=1),r})}return t},updateDetails:function(e){var t,r,a,i,o,n,d,s,l;for(t=e.find('tbody > tr[data-role="row"]'),r=e.data(),a=0;a"+(s.title||s.field)+": {"+s.field+"}",d&&d.length?d.empty().html(l):((d=$('
').html(l)).addClass(r.style.rowDetailItem),n&&n.length||(n=$('
')),n.append(d))):d&&d.length&&d.remove();e.updateDetails(o)}}},public:{oldWidth:void 0,resizeCheckIntervalId:void 0,makeResponsive:function(){var e,t,r=0,a=this.data(),i=gj.grid.plugins.responsiveDesign.private.orderColumns(a);for(e=0;etr>th:eq("+i[e].position+")")).is(":visible")&&i[e].minWidthtr>th:eq("+i[e].position+")")).is(":visible")&&i[e].minWidth<=r&&(this.showColumn(i[e].field),r-=t.width());for(e=i.length-1;e>=0;e--)(t=this.find("thead>tr>th:eq("+i[e].position+")")).is(":visible")&&i[e].priority&&i[e].minWidth>t.outerWidth()&&this.hideColumn(i[e].field);return this}},events:{resize:function(e,t,r){e.triggerHandler("resize",[t,r])}},configure:function(e,t,r){$.extend(!0,e,gj.grid.plugins.responsiveDesign.public),t.responsive&&(e.on("initialized",function(){e.makeResponsive(),e.oldWidth=e.width(),e.resizeCheckIntervalId=setInterval(function(){var t=e.width();t!==e.oldWidth&&gj.grid.plugins.responsiveDesign.events.resize(e,t,e.oldWidth),e.oldWidth=t},t.resizeCheckInterval)}),e.on("destroy",function(){e.resizeCheckIntervalId&&clearInterval(e.resizeCheckIntervalId)}),e.on("resize",function(){e.makeResponsive()})),t.showHiddenColumnsAsDetails&&gj.grid.plugins.expandCollapseRows&&(e.on("dataBound",function(){gj.grid.plugins.responsiveDesign.private.updateDetails(e)}),e.on("columnHide",function(){gj.grid.plugins.responsiveDesign.private.updateDetails(e)}),e.on("columnShow",function(){gj.grid.plugins.responsiveDesign.private.updateDetails(e)}),e.on("rowDataBound",function(){gj.grid.plugins.responsiveDesign.private.updateDetails(e)}))}},gj.grid.plugins.toolbar={config:{base:{toolbarTemplate:void 0,title:void 0,style:{toolbar:"gj-grid-md-toolbar"}},bootstrap:{style:{toolbar:"gj-grid-bootstrap-toolbar"}},bootstrap4:{style:{toolbar:"gj-grid-bootstrap-4-toolbar"}}},private:{init:function(e){var t,r,a;t=e.data(),r=e.prev('div[data-role="toolbar"]'),(void 0!==t.toolbarTemplate||void 0!==t.title||r.length>0)&&(0===r.length&&(r=$('
'),e.before(r)),r.addClass(t.style.toolbar),0===r.children().length&&t.toolbarTemplate&&r.append(t.toolbarTemplate),0===(a=r.find('[data-role="title"]')).length&&(a=$('
'),r.prepend(a)),t.title&&a.text(t.title),t.minWidth&&r.css("min-width",t.minWidth))}},public:{title:function(e){var t=this.parent().find('div[data-role="toolbar"] [data-role="title"]');return void 0!==e?(t.text(e),this):t.text()}},configure:function(e){$.extend(!0,e,gj.grid.plugins.toolbar.public),e.on("initialized",function(){gj.grid.plugins.toolbar.private.init(e)}),e.on("destroying",function(){e.prev('[data-role="toolbar"]').remove()})}},gj.grid.plugins.resizableColumns={config:{base:{resizableColumns:!1}},private:{init:function(e,t){var r,a,i,o,n,d;if((r=e.find('thead tr[data-role="caption"] th')).length){for(i=0;i'),d=parseInt(a.css("padding-right"),10)+3,(n=$('').css("margin-right","-"+d+"px")).draggable({start:function(){e.addClass("gj-unselectable"),e.addClass("gj-grid-resize-cursor")},stop:function(){e.removeClass("gj-unselectable"),e.removeClass("gj-grid-resize-cursor"),this.style.removeProperty("top"),this.style.removeProperty("left"),this.style.removeProperty("position")},drag:gj.grid.plugins.resizableColumns.private.createResizeHandle(e,a,t.columns[i])}),a.append(o.append(n));for(i=0;i]+>/g," ")+'",');for(i+=a.slice(0,a.length-1)+"\r\n",t=0;t-1?r.href=URL.createObjectURL(new Blob([this.getCSV(t)],{type:"text/csv;charset=utf-8;"})):r.href="data:text/csv;charset=utf-8,"+escape(this.getCSV(t)),r.click(),document.body.removeChild(r),this},isColumnApplicable:function(e){return!0!==e.hidden&&!e.role}},configure:function(e){$.extend(!0,e,gj.grid.plugins.export.public)}},gj.grid.plugins.columnReorder={config:{base:{columnReorder:!1,dragReady:!1,style:{targetRowIndicatorTop:"gj-grid-row-reorder-indicator-top",targetRowIndicatorBottom:"gj-grid-row-reorder-indicator-bottom"}}},private:{init:function(e){var t,r,a=e.find("thead tr th");for(t=0;t');for(t=0;t"),i.columns[t].filterable&&(a=$(''),"onchange"===i.headerFilter.type?a.on("input propertychange",function(t){gj.grid.plugins.headerFilter.private.reload(e,$(this))}):(a.on("keypress",function(t){13==t.which&&gj.grid.plugins.headerFilter.private.reload(e,$(this))}),a.on("blur",function(t){gj.grid.plugins.headerFilter.private.reload(e,$(this))})),r.append(a)),i.columns[t].hidden&&r.hide(),o.append(r);e.children("thead").append(o)},reload:function(e,t){var r={};r[t.data("field")]=t.val(),e.reload(r)}},public:{},events:{},configure:function(e,t,r){$.extend(!0,e,gj.grid.plugins.headerFilter.public);e.data();r.headerFilter&&e.on("initialized",function(){gj.grid.plugins.headerFilter.private.init(e)})}},gj.grid.plugins.grouping={config:{base:{paramNames:{groupBy:"groupBy",groupByDirection:"groupByDirection"},grouping:{groupBy:void 0,direction:"asc"},icons:{expandGroup:'',collapseGroup:''}},fontawesome:{icons:{expandGroup:'',collapseGroup:''}},glyphicons:{icons:{expandGroup:'',collapseGroup:''}}},private:{init:function(e){var t,r=e.data();t=void 0,e.on("rowDataBound",function(a,i,o,n){if(t!==n[r.grouping.groupBy]||1===i[0].rowIndex){var d=gj.grid.methods.countVisibleColumns(e)-1,s=$(''),l=$('');l.append('
'+r.icons.collapseGroup+"
"),l.on("click",gj.grid.plugins.grouping.private.createExpandCollapseHandler(r)),s.append(l),s.append('
'+r.grouping.groupBy+": "+n[r.grouping.groupBy]+"
"),s.insertBefore(i),t=n[r.grouping.groupBy]}i.show()}),r.params[r.paramNames.groupBy]=r.grouping.groupBy,r.params[r.paramNames.groupByDirection]=r.grouping.direction},grouping:function(e,t){var r=e.data();t.sort(gj.grid.methods.createDefaultSorter(r.grouping.direction,r.grouping.groupBy))},createExpandCollapseHandler:function(e){return function(t){var r=$(this),a=gj.grid.plugins.grouping.private;"row"===r.closest("tr").next(":visible").data("role")?a.collapseGroup(e,r):a.expandGroup(e,r)}},collapseGroup:function(e,t){var r=t.children('div[data-role="display"]');t.closest("tr").nextUntil('[role="group"]').hide(),r.empty().append(e.icons.expandGroup)},expandGroup:function(e,t){var r=t.children('div[data-role="display"]');t.closest("tr").nextUntil('[role="group"]').show(),r.empty().append(e.icons.collapseGroup)}},public:{},configure:function(e){var t,r=e.data();$.extend(!0,e,gj.grid.plugins.grouping.public),r.grouping&&r.grouping.groupBy&&(t={title:"",width:r.defaultIconColumnWidth,align:"center",stopPropagation:!0,cssClass:"gj-cursor-pointer gj-unselectable"},r.columns=[t].concat(r.columns),e.on("initialized",function(){gj.grid.plugins.grouping.private.init(e)}),e.on("dataFiltered",function(t,r){gj.grid.plugins.grouping.private.grouping(e,r)}))}},gj.grid.messages["en-us"]={First:"First",Previous:"Previous",Next:"Next",Last:"Last",Page:"Page",FirstPageTooltip:"First Page",PreviousPageTooltip:"Previous Page",NextPageTooltip:"Next Page",LastPageTooltip:"Last Page",Refresh:"Refresh",Of:"of",DisplayingRecords:"Displaying records",RowsPerPage:"Rows per page:",Edit:"Edit",Delete:"Delete",Update:"Update",Cancel:"Cancel",NoRecordsFound:"No records found.",Loading:"Loading..."},gj.tree={plugins:{}},gj.tree.config={base:{params:{},autoLoad:!0,selectionType:"single",cascadeSelection:!1,dataSource:void 0,primaryKey:void 0,textField:"text",childrenField:"children",hasChildrenField:"hasChildren",imageCssClassField:"imageCssClass",imageUrlField:"imageUrl",imageHtmlField:"imageHtml",disabledField:"disabled",width:void 0,border:!1,uiLibrary:"materialdesign",iconsLibrary:"materialicons",autoGenId:1,autoGenFieldName:"autoId_b5497cc5-7ef3-49f5-a7dc-4a932e1aee4a",indentation:24,style:{wrapper:"gj-unselectable",list:"gj-list gj-list-md",item:void 0,active:"gj-list-md-active",leafIcon:void 0,border:"gj-tree-md-border"},icons:{expand:'',collapse:''}},bootstrap:{style:{wrapper:"gj-unselectable gj-tree-bootstrap-3",list:"gj-list gj-list-bootstrap list-group",item:"list-group-item",active:"active",border:"gj-tree-bootstrap-border"},iconsLibrary:"glyphicons"},bootstrap4:{style:{wrapper:"gj-unselectable gj-tree-bootstrap-4",list:"gj-list gj-list-bootstrap",item:"list-group-item",active:"active",border:"gj-tree-bootstrap-border"},icons:{expand:'',collapse:''}},materialicons:{style:{expander:"gj-tree-material-icons-expander"}},fontawesome:{style:{expander:"gj-tree-font-awesome-expander"},icons:{expand:'',collapse:''}},glyphicons:{style:{expander:"gj-tree-glyphicons-expander"},icons:{expand:'',collapse:''}}},gj.tree.events={initialized:function(e){e.triggerHandler("initialized")},dataBinding:function(e){e.triggerHandler("dataBinding")},dataBound:function(e){e.triggerHandler("dataBound")},select:function(e,t,r){return e.triggerHandler("select",[t,r])},unselect:function(e,t,r){return e.triggerHandler("unselect",[t,r])},expand:function(e,t,r){return e.triggerHandler("expand",[t,r])},collapse:function(e,t,r){return e.triggerHandler("collapse",[t,r])},enable:function(e,t){return e.triggerHandler("enable",[t])},disable:function(e,t){return e.triggerHandler("disable",[t])},destroying:function(e){return e.triggerHandler("destroying")},nodeDataBound:function(e,t,r,a){return e.triggerHandler("nodeDataBound",[t,r,a])}},gj.tree.methods={init:function(e){return gj.widget.prototype.init.call(this,e,"tree"),gj.tree.methods.initialize.call(this),this.data("autoLoad")&&this.reload(),this},initialize:function(){var e=this.data(),t=$('
    ');this.empty().addClass(e.style.wrapper).append(t),e.width&&this.width(e.width),e.border&&this.addClass(e.style.border),gj.tree.events.initialized(this)},useHtmlDataSource:function(e,t){t.dataSource=[]},render:function(e,t){var r;return t&&("string"==typeof t&&JSON&&(t=JSON.parse(t)),(r=e.data()).records=t,r.primaryKey||gj.tree.methods.genAutoId(r,r.records),gj.tree.methods.loadData(e)),e},filter:function(e){return e.data().dataSource},genAutoId:function(e,t){var r;for(r=0;r').addClass(c.style.item),$wrapper=$('
    '),$expander=$('').addClass(c.style.expander),$display=$(''+r[c.textField]+""),hasChildren=void 0!==r[c.hasChildrenField]&&"true"===r[c.hasChildrenField].toString().toLowerCase(),disabled=void 0!==r[c.disabledField]&&"true"===r[c.disabledField].toString().toLowerCase(),c.indentation&&$wrapper.append(''),disabled?gj.tree.methods.disableNode(e,n):($expander.on("click",gj.tree.methods.expanderClickHandler(e)),$display.on("click",gj.tree.methods.displayClickHandler(e))),$wrapper.append($expander),$wrapper.append($display),n.append($wrapper),i?t.find("li:eq("+(i-1)+")").before(n):t.append(n),c.imageCssClassField&&r[c.imageCssClassField]?(s=$('')).insertBefore($display):c.imageUrlField&&r[c.imageUrlField]?((s=$('')).insertBefore($display),(l=$('')).attr("width",s.width()).attr("height",s.height()),s.append(l)):c.imageHtmlField&&r[c.imageHtmlField]&&(s=$(''+r[c.imageHtmlField]+"")).insertBefore($display),r[c.childrenField]&&r[c.childrenField].length||hasChildren){if($expander.empty().append(c.icons.expand),d=$("
      ").addClass(c.style.list).addClass("gj-hidden"),n.append(d),r[c.childrenField]&&r[c.childrenField].length)for(o=0;o[data-role="wrapper"]>[data-role="expander"]'),n=e.data(),d=t.attr("data-id"),s=t.children("ul");if(!1!==gj.tree.events.expand(e,t,d)&&s&&s.length&&(s.show(),o.attr("data-mode","open"),o.empty().append(n.icons.collapse),r))for(a=t.find("ul>li"),i=0;i[data-role="wrapper"]>[data-role="expander"]'),n=e.data(),d=t.attr("data-id"),s=t.children("ul");if(!1!==gj.tree.events.collapse(e,t,d)&&s&&s.length&&(s.hide(),o.attr("data-mode","close"),o.empty().append(n.icons.expand),r))for(a=t.find("ul>li"),i=0;ili");for(t=0;tli");for(t=0;tli");for(t=0;tli"),a=0;ali");for(t=0;tli"),a=0;a[data-role="wrapper"]>[data-role="display"]').text()){i=a;break}if(a.has("ul")&&(i=gj.tree.methods.getNodeByText(a.children("ul"),t)))break}return i},addNode:function(e,t,r,a){var i,o,n=e.data();return r&&r.length?("li"===r[0].tagName.toLowerCase()&&(0===r.children("ul").length&&(r.find('[data-role="expander"]').empty().append(n.icons.collapse),r.append($("
        ").addClass(n.style.list))),r=r.children("ul")),(o=e.getDataById(r.parent().data("id")))[n.childrenField]||(o[n.childrenField]=[]),o[n.childrenField].push(t)):(r=e.children("ul"),e.data("records").push(t)),i=r.parentsUntil('[data-type="tree"]',"ul").length+1,n.primaryKey||gj.tree.methods.genAutoId(n,[t]),gj.tree.methods.appendNode(e,r,t,i,a),e},remove:function(e,t){return gj.tree.methods.removeDataById(e,t.attr("data-id"),e.data("records")),t.remove(),e},removeDataById:function(e,t,r){var a,i=e.data();for(a=0;a[data-role="wrapper"]>[data-role="display"]').html(r[a.textField]),gj.tree.events.nodeDataBound(e,i,t,r),e},getChildren:function(e,t,r){var a,i,o=[];for(i=(r=void 0===r||r)?t.find("ul li"):t.find(">ul>li"),a=0;ali");for(t=0;t[data-role="wrapper"]>[data-role="expander"]'),n=t.find('>[data-role="wrapper"]>[data-role="display"]');r=void 0===r||r;if(t.removeClass("disabled"),o.on("click",gj.tree.methods.expanderClickHandler(e)),n.on("click",gj.tree.methods.displayClickHandler(e)),gj.tree.events.enable(e,t),r)for(i=t.find("ul>li"),a=0;ali");for(t=0;t[data-role="wrapper"]>[data-role="expander"]'),n=t.find('>[data-role="wrapper"]>[data-role="display"]');r=void 0===r||r;if(t.addClass("disabled"),o.off("click"),n.off("click"),gj.tree.events.disable(e,t),r)for(i=t.find("ul>li"),a=0;a [data-role="wrapper"] > [data-role="checkbox"]').length&&(i=e.data(),o=t.find('> [data-role="wrapper"] > [data-role="expander"]'),n=$(''),d=$('').append(n),s=void 0!==a[i.disabledField]&&"true"===a[i.disabledField].toString().toLowerCase(),n=n.checkbox({uiLibrary:i.uiLibrary,iconsLibrary:i.iconsLibrary,change:function(r,i){gj.tree.plugins.checkboxes.events.checkboxChange(e,t,a,n.state())}}),s&&n.prop("disabled",!0),a[i.checkedField]&&n.state("checked"),n.on("click",function(e){var t=n.closest("li"),r=n.state();i.cascadeCheck&&(gj.tree.plugins.checkboxes.private.updateChildrenState(t,r),gj.tree.plugins.checkboxes.private.updateParentState(t,r))}),o.after(d))},updateParentState:function(e,t){var r,a,i,o,n,d;1===(r=e.parent("ul").parent("li")).length&&(a=e.parent("ul").parent("li").find('> [data-role="wrapper"] > [data-role="checkbox"] input[type="checkbox"]'),i=e.siblings().find('> [data-role="wrapper"] > span[data-role="checkbox"] input[type="checkbox"]'),o="checked"===t,n="unchecked"===t,d="indeterminate",$.each(i,function(){var e=$(this).checkbox("state");o&&"checked"!==e&&(o=!1),n&&"unchecked"!==e&&(n=!1)}),o&&!n&&(d="checked"),!o&&n&&(d="unchecked"),a.checkbox("state",d),gj.tree.plugins.checkboxes.private.updateParentState(r,a.checkbox("state")))},updateChildrenState:function(e,t){var r=e.find('ul li [data-role="wrapper"] [data-role="checkbox"] input[type="checkbox"]');r.length>0&&$.each(r,function(){$(this).checkbox("state",t)})},update:function(e,t,r){var a=t.find('[data-role="checkbox"] input[type="checkbox"]').first();$(a).checkbox("state",r),e.data().cascadeCheck&&(gj.tree.plugins.checkboxes.private.updateChildrenState(t,r),gj.tree.plugins.checkboxes.private.updateParentState(t,r))}},public:{getCheckedNodes:function(){var e=[],t=this.find('li [data-role="checkbox"] input[type="checkbox"]');return $.each(t,function(){var t=$(this);"checked"===t.checkbox("state")&&e.push(t.closest("li").data("id"))}),e},checkAll:function(){var e=this.find('li [data-role="checkbox"] input[type="checkbox"]');return $.each(e,function(){$(this).checkbox("state","checked")}),this},uncheckAll:function(){var e=this.find('li [data-role="checkbox"] input[type="checkbox"]');return $.each(e,function(){$(this).checkbox("state","unchecked")}),this},check:function(e){return gj.tree.plugins.checkboxes.private.update(this,e,"checked"),this},uncheck:function(e){return gj.tree.plugins.checkboxes.private.update(this,e,"unchecked"),this}},events:{checkboxChange:function(e,t,r,a){return e.triggerHandler("checkboxChange",[t,r,a])}},configure:function(e){e.data("checkboxes")&&gj.checkbox&&($.extend(!0,e,gj.tree.plugins.checkboxes.public),e.on("nodeDataBound",function(t,r,a,i){gj.tree.plugins.checkboxes.private.nodeDataBound(e,r,a,i)}),e.on("dataBound",function(){gj.tree.plugins.checkboxes.private.dataBound(e)}),e.on("enable",function(e,t){t.find('>[data-role="wrapper"]>[data-role="checkbox"] input[type="checkbox"]').prop("disabled",!1)}),e.on("disable",function(e,t){t.find('>[data-role="wrapper"]>[data-role="checkbox"] input[type="checkbox"]').prop("disabled",!0)}))}},gj.tree.plugins.dragAndDrop={config:{base:{dragAndDrop:void 0,style:{dragEl:"gj-tree-drag-el gj-tree-md-drag-el",dropAsChildIcon:"gj-cursor-pointer gj-icon plus",dropAbove:"gj-tree-drop-above",dropBelow:"gj-tree-drop-below"}},bootstrap:{style:{dragEl:"gj-tree-drag-el gj-tree-bootstrap-drag-el",dropAsChildIcon:"glyphicon glyphicon-plus",dropAbove:"drop-above",dropBelow:"drop-below"}},bootstrap4:{style:{dragEl:"gj-tree-drag-el gj-tree-bootstrap-drag-el",dropAsChildIcon:"gj-cursor-pointer gj-icon plus",dropAbove:"drop-above",dropBelow:"drop-below"}}},private:{nodeDataBound:function(e,t){var r=t.children('[data-role="wrapper"]'),a=t.find('>[data-role="wrapper"]>[data-role="display"]');r.length&&a.length&&(a.on("mousedown",gj.tree.plugins.dragAndDrop.private.createNodeMouseDownHandler(e)),a.on("mousemove",gj.tree.plugins.dragAndDrop.private.createNodeMouseMoveHandler(e,t,a)),a.on("mouseup",gj.tree.plugins.dragAndDrop.private.createNodeMouseUpHandler(e)))},createNodeMouseDownHandler:function(e){return function(t){e.data("dragReady",!0)}},createNodeMouseUpHandler:function(e){return function(t){e.data("dragReady",!1)}},createNodeMouseMoveHandler:function(e,t,r){return function(a){if(e.data("dragReady")){var i,o,n,d,s=e.data();e.data("dragReady",!1),i=r.clone().wrap('
        ').closest("div").wrap('
      • ').closest("li").wrap('
          ').closest("ul"),$("body").append(i),i.attr("data-role","draggable-clone").addClass("gj-unselectable").addClass(s.style.dragEl),i.find('[data-role="wrapper"]').prepend(''),i.draggable({drag:gj.tree.plugins.dragAndDrop.private.createDragHandler(e,t,r),stop:gj.tree.plugins.dragAndDrop.private.createDragStopHandler(e,t,r)}),o=r.parent(),n=r.offset().top,n-=parseInt(o.css("border-top-width"))+parseInt(o.css("margin-top"))+parseInt(o.css("padding-top")),d=r.offset().left,d-=parseInt(o.css("border-left-width"))+parseInt(o.css("margin-left"))+parseInt(o.css("padding-left")),d-=i.find('[data-role="indicator"]').outerWidth(!0),i.css({position:"absolute",top:n,left:d,width:r.outerWidth(!0)}),"true"===r.attr("data-droppable")&&r.droppable("destroy"),gj.tree.plugins.dragAndDrop.private.getTargetDisplays(e,t,r).each(function(){var e=$(this);"true"===e.attr("data-droppable")&&e.droppable("destroy"),e.droppable()}),gj.tree.plugins.dragAndDrop.private.getTargetDisplays(e,t).each(function(){var e=$(this);"true"===e.attr("data-droppable")&&e.droppable("destroy"),e.droppable()}),i.trigger("mousedown")}}},getTargetDisplays:function(e,t,r){return e.find('[data-role="display"]').not(r).not(t.find('[data-role="display"]'))},getTargetWrappers:function(e,t){return e.find('[data-role="wrapper"]').not(t.find('[data-role="wrapper"]'))},createDragHandler:function(e,t,r){var a=gj.tree.plugins.dragAndDrop.private.getTargetDisplays(e,t,r),i=gj.tree.plugins.dragAndDrop.private.getTargetWrappers(e,t),o=e.data();return function(e,t,r){var n=$(this),d=!1;a.each(function(){var e;if($(this).droppable("isOver",r))return e=n.find('[data-role="indicator"]'),o.style.dropAsChildIcon?e.addClass(o.style.dropAsChildIcon):e.text("+"),d=!0,!1;n.find('[data-role="indicator"]').removeClass(o.style.dropAsChildIcon).empty()}),i.each(function(){var e,t=$(this);!d&&t.droppable("isOver",r)?(e=t.position().top+t.outerHeight()/2,r.y").addClass(o.style.list),s.append(r)),!1!==gj.tree.plugins.dragAndDrop.events.nodeDrop(e,t.data("id"),s.data("id"),r.children("li").length+1)&&(r.append(t),d=e.getDataById(t.data("id")),gj.tree.methods.removeDataById(e,t.data("id"),o.records),void 0===(c=e.getDataById(r.parent().data("id")))[o.childrenField]&&(c[o.childrenField]=[]),c[o.childrenField].push(d),gj.tree.plugins.dragAndDrop.private.refresh(e,t,s,l)),g=!0,!1;a.droppable("destroy")}),g||i.each(function(){var r,a,i,c=$(this);if(c.droppable("isOver",n))return s=c.closest("li"),l=t.parent("ul").parent("li"),r=n.y [data-role="wrapper"] > [data-role="expander"]');a.hasChildren&&o.empty().append(i.icons.expand)},createDoneHandler:function(e,t){return function(r){var a,i,o,n=e.data();if("string"==typeof r&&JSON&&(r=JSON.parse(r)),r&&r.length){for(0===(o=t.children("ul")).length&&(o=$("
            ").addClass(n.style.list),t.append(o)),a=0;a[data-role="wrapper"]>[data-role="expander"]')).attr("data-mode","open"),i.empty().append(n.icons.collapse),gj.tree.events.dataBound(e)}}},expand:function(e,t,r){var a,i=e.data(),o={},n=t.find(">ul>li");n&&n.length||"string"==typeof i.dataSource&&(o[i.paramNames.parentId]=r,a={url:i.dataSource,data:o},e.xhr&&e.xhr.abort(),e.xhr=$.ajax(a).done(gj.tree.plugins.lazyLoading.private.createDoneHandler(e,t)).fail(e.createErrorHandler()))}},public:{},events:{},configure:function(e,t,r){r.lazyLoading&&(e.on("nodeDataBound",function(t,r,a,i){gj.tree.plugins.lazyLoading.private.nodeDataBound(e,r,a,i)}),e.on("expand",function(t,r,a){gj.tree.plugins.lazyLoading.private.expand(e,r,a)}))}},gj.checkbox={plugins:{}},gj.checkbox.config={base:{uiLibrary:"materialdesign",iconsLibrary:"materialicons",style:{wrapperCssClass:"gj-checkbox-md",spanCssClass:void 0}},bootstrap:{style:{wrapperCssClass:"gj-checkbox-bootstrap"},iconsLibrary:"glyphicons"},bootstrap4:{style:{wrapperCssClass:"gj-checkbox-bootstrap gj-checkbox-bootstrap-4"},iconsLibrary:"materialicons"},materialicons:{style:{iconsCssClass:"gj-checkbox-material-icons",spanCssClass:"gj-icon"}},glyphicons:{style:{iconsCssClass:"gj-checkbox-glyphicons",spanCssClass:""}},fontawesome:{style:{iconsCssClass:"gj-checkbox-fontawesome",spanCssClass:"fa"}}},gj.checkbox.methods={init:function(e){return gj.widget.prototype.init.call(this,e,"checkbox"),this.attr("data-checkbox","true"),gj.checkbox.methods.initialize(this),this},initialize:function(e){var t,r,a=e.data();a.style.wrapperCssClass&&(t=$(''),e.attr("id")&&t.attr("for",e.attr("id")),e.wrap(t),r=$(""),a.style.spanCssClass&&r.addClass(a.style.spanCssClass),e.parent().append(r))},state:function(e,t){return t?("checked"===t?(e.prop("indeterminate",!1),e.prop("checked",!0)):"unchecked"===t?(e.prop("indeterminate",!1),e.prop("checked",!1)):"indeterminate"===t&&(e.prop("checked",!0),e.prop("indeterminate",!0)),gj.checkbox.events.change(e,t),e):t=e.prop("indeterminate")?"indeterminate":e.prop("checked")?"checked":"unchecked"},toggle:function(e){return"checked"==e.state()?e.state("unchecked"):e.state("checked"),e},destroy:function(e){return"true"===e.attr("data-checkbox")&&(e.removeData(),e.removeAttr("data-guid"),e.removeAttr("data-checkbox"),e.off(),e.next("span").remove(),e.unwrap()),e}},gj.checkbox.events={change:function(e,t){return e.triggerHandler("change",[t])}},gj.checkbox.widget=function(e,t){var r=gj.checkbox.methods;return this.toggle=function(){return r.toggle(this)},this.state=function(e){return r.state(this,e)},this.destroy=function(){return r.destroy(this)},$.extend(e,this),"true"!==e.attr("data-checkbox")&&r.init.call(e,t),e},gj.checkbox.widget.prototype=new gj.widget,gj.checkbox.widget.constructor=gj.checkbox.widget,jQuery.fn.checkbox=function(e){var t;if(this&&this.length){if("object"!=typeof e&&e){if((t=new gj.checkbox.widget(this,null))[e])return t[e].apply(this,Array.prototype.slice.call(arguments,1));throw"Method "+e+" does not exist."}return new gj.checkbox.widget(this,e)}},gj.editor={plugins:{},messages:{}},gj.editor.config={base:{height:300,width:void 0,uiLibrary:"materialdesign",iconsLibrary:"materialicons",locale:"en-us",buttons:void 0,style:{wrapper:"gj-editor gj-editor-md",buttonsGroup:"gj-button-md-group",button:"gj-button-md",buttonActive:"active"}},bootstrap:{style:{wrapper:"gj-editor gj-editor-bootstrap",buttonsGroup:"btn-group",button:"btn btn-default gj-cursor-pointer",buttonActive:"active"}},bootstrap4:{style:{wrapper:"gj-editor gj-editor-bootstrap",buttonsGroup:"btn-group",button:"btn btn-outline-secondary gj-cursor-pointer",buttonActive:"active"}},materialicons:{icons:{bold:'',italic:'',strikethrough:'',underline:'',listBulleted:'',listNumbered:'',indentDecrease:'',indentIncrease:'',alignLeft:'',alignCenter:'',alignRight:'',alignJustify:'',undo:'',redo:''}},fontawesome:{icons:{bold:'',italic:'',strikethrough:'',underline:'',listBulleted:'',listNumbered:'',indentDecrease:'',indentIncrease:'',alignLeft:'',alignCenter:'',alignRight:'',alignJustify:'',undo:'',redo:''}}},gj.editor.methods={init:function(e){return gj.widget.prototype.init.call(this,e,"editor"),this.attr("data-editor","true"),gj.editor.methods.initialize(this),this},initialize:function(e){var t,r,a,i,o,n=this,d=e.data();if(e.hide(),"wrapper"!==e[0].parentElement.attributes.role&&((a=document.createElement("div")).setAttribute("role","wrapper"),e[0].parentNode.insertBefore(a,e[0]),a.appendChild(e[0])),gj.editor.methods.localization(d),$(a).addClass(d.style.wrapper),d.width&&$(a).width(d.width),0===(i=$(a).children('div[role="body"]')).length&&(i=$('
            '),$(a).append(i),e[0].innerText&&(i[0].innerHTML=e[0].innerText)),i.attr("contenteditable",!0),i.on("keydown",function(t){var r=event.keyCode||event.charCode;!1===gj.editor.events.changing(e)&&8!==r&&46!==r&&t.preventDefault()}),i.on("mouseup keyup mouseout cut paste",function(t){n.updateToolbar(e,o),gj.editor.events.changed(e),e.html(i.html())}),0===(o=$(a).children('div[role="toolbar"]')).length)for(var s in o=$('
            '),i.before(o),d.buttons){for(var l in t=$("
            ").addClass(d.style.buttonsGroup),d.buttons[s])(r=$(d.buttons[s][l])).on("click",function(){gj.editor.methods.executeCmd(e,i,o,$(this))}),t.append(r);o.append(t)}i.height(d.height-gj.core.height(o[0],!0))},localization:function(e){var t=gj.editor.messages[e.locale];void 0===e.buttons&&(e.buttons=[['",'",'",'"],['",'",'",'"],['",'",'",'"],['",'"]])},updateToolbar:function(e,t){var r=e.data();$buttons=t.find("[role]").each(function(){var e=$(this),t=e.attr("role");t&&document.queryCommandEnabled(t)&&"true"===document.queryCommandValue(t)?e.addClass(r.style.buttonActive):e.removeClass(r.style.buttonActive)})},executeCmd:function(e,t,r,a){t.focus(),document.execCommand(a.attr("role"),!1),gj.editor.methods.updateToolbar(e,r)},content:function(e,t){var r=e.parent().children('div[role="body"]');return void 0===t?r.html():r.html(t)},destroy:function(e){var t;return"true"===e.attr("data-editor")&&((t=e.parent()).children('div[role="body"]').remove(),t.children('div[role="toolbar"]').remove(),e.unwrap(),e.removeData(),e.removeAttr("data-guid"),e.removeAttr("data-editor"),e.off(),e.show()),e}},gj.editor.events={changing:function(e){return e.triggerHandler("changing")},changed:function(e){return e.triggerHandler("changed")}},gj.editor.widget=function(e,t){var r=gj.editor.methods;return this.content=function(e){return r.content(this,e)},this.destroy=function(){return r.destroy(this)},$.extend(e,this),"true"!==e.attr("data-editor")&&r.init.call(e,t),e},gj.editor.widget.prototype=new gj.widget,gj.editor.widget.constructor=gj.editor.widget,jQuery.fn.editor=function(e){var t;if(this&&this.length){if("object"!=typeof e&&e){if((t=new gj.editor.widget(this,null))[e])return t[e].apply(this,Array.prototype.slice.call(arguments,1));throw"Method "+e+" does not exist."}return new gj.editor.widget(this,e)}},gj.editor.messages["en-us"]={bold:"Bold",italic:"Italic",strikethrough:"Strikethrough",underline:"Underline",listBulleted:"List Bulleted",listNumbered:"List Numbered",indentDecrease:"Indent Decrease",indentIncrease:"Indent Increase",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",undo:"Undo",redo:"Redo"},gj.dropdown={plugins:{}},gj.dropdown.config={base:{dataSource:void 0,textField:"text",valueField:"value",selectedField:"selected",width:void 0,maxHeight:"auto",placeholder:void 0,fontSize:void 0,uiLibrary:"materialdesign",iconsLibrary:"materialicons",icons:{dropdown:'',dropup:''},style:{wrapper:"gj-dropdown gj-dropdown-md gj-unselectable",list:"gj-list gj-list-md gj-dropdown-list-md",active:"gj-list-md-active"}},bootstrap:{style:{wrapper:"gj-dropdown gj-dropdown-bootstrap gj-dropdown-bootstrap-3 gj-unselectable",presenter:"btn btn-default",list:"gj-list gj-list-bootstrap gj-dropdown-list-bootstrap list-group",item:"list-group-item",active:"active"},iconsLibrary:"glyphicons"},bootstrap4:{style:{wrapper:"gj-dropdown gj-dropdown-bootstrap gj-dropdown-bootstrap-4 gj-unselectable",presenter:"btn btn-outline-secondary",list:"gj-list gj-list-bootstrap gj-dropdown-list-bootstrap list-group",item:"list-group-item",active:"active"}},materialicons:{style:{expander:"gj-dropdown-expander-mi"}},fontawesome:{icons:{dropdown:'',dropup:''},style:{expander:"gj-dropdown-expander-fa"}},glyphicons:{icons:{dropdown:'',dropup:''},style:{expander:"gj-dropdown-expander-glyphicons"}}},gj.dropdown.methods={init:function(e){return gj.widget.prototype.init.call(this,e,"dropdown"),this.attr("data-dropdown","true"),gj.dropdown.methods.initialize(this),this},getHTMLConfig:function(){var e=gj.widget.prototype.getHTMLConfig.call(this),t=this[0].attributes;return t.placeholder&&(e.placeholder=t.placeholder.value),e},initialize:function(e){var t=e.data(),r=e.parent('div[role="wrapper"]'),a=$(''),i=$(''+t.icons.dropdown+"").addClass(t.style.expander),o=$('').addClass(t.style.presenter),n=$('
              ').attr("guid",e.attr("data-guid"));0===r.length?(r=$('
              ').addClass(t.style.wrapper),e.wrap(r)):r.addClass(t.style.wrapper),t.fontSize&&o.css("font-size",t.fontSize),o.on("click",function(t){n.is(":visible")?gj.dropdown.methods.close(e,n):gj.dropdown.methods.open(e,n)}),o.on("blur",function(t){setTimeout(function(){gj.dropdown.methods.close(e,n)},500)}),o.append(a).append(i),e.hide(),e.after(o),$("body").append(n),n.hide(),e.reload()},setListPosition:function(e,t,r){var a,i,o,n,d=e.getBoundingClientRect(),s=window.scrollY||window.pageYOffset||0;window.scrollX||window.pageXOffset;t.style.overflow="",t.style.overflowX="",t.style.height="",gj.core.setChildPosition(e,t),a=gj.core.height(t,!0),n=t.getBoundingClientRect(),i=gj.core.height(e,!0),"auto"===r.maxHeight?d.topwindow.innerHeight&&(o=window.innerHeight-d.top-i-3):d.top-a-3>0?t.style.top=Math.round(d.top+s-a-3)+"px":(t.style.top=s+"px",o=d.top-3):!isNaN(r.maxHeight)&&r.maxHeight
              '+o+"
              ")).addClass(a.style.item),t.on("click",function(t){gj.dropdown.methods.select(e,i)}),n.append(t),e.append('"),d&&r.push(i)}),0===r.length)e.prepend(''),e[0].selectedIndex=0,a.placeholder&&(s[0].innerHTML=''+a.placeholder+"");else for(i=0;i'+r.placeholder+""),e[0].value=""),gj.dropdown.events.change(e),gj.dropdown.methods.close(e,a),e},getRecordByValue:function(e,t){var r,a=e.data(),i=void 0;for(r=0;r0&&(r.children('[role="presenter"]').remove(),r.children('[role="list"]').remove(),e.unwrap()),e.show()),e}},gj.dropdown.events={change:function(e){return e.triggerHandler("change")},dataBound:function(e){return e.triggerHandler("dataBound")}},gj.dropdown.widget=function(e,t){var r=gj.dropdown.methods;return this.value=function(e){return r.value(this,e)},this.enable=function(){return r.enable(this)},this.disable=function(){return r.disable(this)},this.destroy=function(){return r.destroy(this)},$.extend(e,this),"true"!==e.attr("data-dropdown")&&r.init.call(e,t),e},gj.dropdown.widget.prototype=new gj.widget,gj.dropdown.widget.constructor=gj.dropdown.widget,gj.dropdown.widget.prototype.getHTMLConfig=gj.dropdown.methods.getHTMLConfig,jQuery.fn.dropdown=function(e){var t;if(this&&this.length){if("object"!=typeof e&&e){if((t=new gj.dropdown.widget(this,null))[e])return t[e].apply(this,Array.prototype.slice.call(arguments,1));throw"Method "+e+" does not exist."}return new gj.dropdown.widget(this,e)}},gj.datepicker={plugins:{}},gj.datepicker.config={base:{showOtherMonths:!1,selectOtherMonths:!0,width:void 0,minDate:void 0,maxDate:void 0,format:"mm/dd/yyyy",uiLibrary:"materialdesign",iconsLibrary:"materialicons",value:void 0,weekStartDay:0,disableDates:void 0,disableDaysOfWeek:void 0,calendarWeeks:!1,keyboardNavigation:!0,locale:"en-us",icons:{rightIcon:'event',previousMonth:'',nextMonth:''},fontSize:void 0,size:"default",modal:!1,header:!1,footer:!1,showOnFocus:!0,showRightIcon:!0,style:{modal:"gj-modal",wrapper:"gj-datepicker gj-datepicker-md gj-unselectable",input:"gj-textbox-md",calendar:"gj-picker gj-picker-md datepicker gj-unselectable",footer:"",button:"gj-button-md"}},bootstrap:{style:{wrapper:"gj-datepicker gj-datepicker-bootstrap gj-unselectable input-group",input:"form-control",calendar:"gj-picker gj-picker-bootstrap datepicker gj-unselectable",footer:"modal-footer",button:"btn btn-default"},iconsLibrary:"glyphicons",showOtherMonths:!0},bootstrap4:{style:{wrapper:"gj-datepicker gj-datepicker-bootstrap gj-unselectable input-group",input:"form-control",calendar:"gj-picker gj-picker-bootstrap datepicker gj-unselectable",footer:"modal-footer",button:"btn btn-default"},showOtherMonths:!0},fontawesome:{icons:{rightIcon:'',previousMonth:'',nextMonth:''}},glyphicons:{icons:{rightIcon:'',previousMonth:'',nextMonth:''}}},gj.datepicker.methods={init:function(e){return gj.widget.prototype.init.call(this,e,"datepicker"),this.attr("data-datepicker","true"),gj.datepicker.methods.initialize(this,this.data()),this},initialize:function(e,t){var r,a,i=e.parent('div[role="wrapper"]');0===i.length?(i=$('
              ').addClass(t.style.wrapper),e.wrap(i)):i.addClass(t.style.wrapper),i=e.parent('div[role="wrapper"]'),t.width&&i.css("width",t.width),e.val(t.value).addClass(t.style.input).attr("role","input"),t.fontSize&&e.css("font-size",t.fontSize),"bootstrap"===t.uiLibrary||"bootstrap4"===t.uiLibrary?"small"===t.size?(i.addClass("input-group-sm"),e.addClass("form-control-sm")):"large"===t.size&&(i.addClass("input-group-lg"),e.addClass("form-control-lg")):"small"===t.size?i.addClass("small"):"large"===t.size&&i.addClass("large"),t.showRightIcon&&((a="bootstrap"===t.uiLibrary?$(''+t.icons.rightIcon+""):"bootstrap4"===t.uiLibrary?$('"):$(t.icons.rightIcon)).attr("role","right-icon"),a.on("click",function(r){$("body").find('[role="calendar"][guid="'+e.attr("data-guid")+'"]').is(":visible")?gj.datepicker.methods.close(e):gj.datepicker.methods.open(e,t)}),i.append(a)),t.showOnFocus&&e.on("focus",function(){gj.datepicker.methods.open(e,t)}),r=gj.datepicker.methods.createCalendar(e,t),!0!==t.footer&&(e.on("blur",function(){e.timeout=setTimeout(function(){gj.datepicker.methods.close(e)},500)}),r.mousedown(function(){return clearTimeout(e.timeout),document.activeElement!==e[0]&&e.focus(),!1}),r.on("click",function(){clearTimeout(e.timeout),document.activeElement!==e[0]&&e.focus()})),t.keyboardNavigation&&$(document).on("keydown",gj.datepicker.methods.createKeyDownHandler(e,r,t))},createCalendar:function(e,t){var r,a,i,o,n,d=$('
              ').addClass(t.style.calendar).attr("guid",e.attr("data-guid"));return t.fontSize&&d.css("font-size",t.fontSize),!(r=gj.core.parseDate(t.value,t.format,t.locale))||isNaN(r.getTime())?r=new Date:e.attr("day",r.getFullYear()+"-"+r.getMonth()+"-"+r.getDate()),d.attr("month",r.getMonth()),d.attr("year",r.getFullYear()),gj.datepicker.methods.renderHeader(e,d,t,r),a=$('
              '),d.append(a),t.footer&&(i=$('
              '),(o=$('")).on("click",function(){e.close()}),i.append(o),(n=$('")).on("click",function(){var r,a,i=d.attr("selectedDay");i?(a=i.split("-"),r=new Date(a[0],a[1],a[2],d.attr("hour")||0,d.attr("minute")||0),gj.datepicker.methods.change(e,d,t,r)):e.close()}),i.append(n),d.append(i)),d.hide(),$("body").append(d),t.modal&&(d.wrapAll('
              '),gj.core.center(d)),d},renderHeader:function(e,t,r,a){var i,o,n;r.header&&(i=$('
              '),(n=$('
              ').on("click",function(){gj.datepicker.methods.renderDecade(e,t,r),n.addClass("selected"),o.removeClass("selected")})).html(gj.core.formatDate(a,"yyyy",r.locale)),i.append(n),(o=$('
              ').on("click",function(){gj.datepicker.methods.renderMonth(e,t,r),o.addClass("selected"),n.removeClass("selected")})).html(gj.core.formatDate(a,"ddd, mmm dd",r.locale)),i.append(o),t.append(i))},updateHeader:function(e,t,r){e.find('[role="header"] [role="year"]').removeClass("selected").html(gj.core.formatDate(r,"yyyy",t.locale)),e.find('[role="header"] [role="date"]').addClass("selected").html(gj.core.formatDate(r,"ddd, mmm dd",t.locale)),e.find('[role="header"] [role="hour"]').removeClass("selected").html(gj.core.formatDate(r,"HH",t.locale)),e.find('[role="header"] [role="minute"]').removeClass("selected").html(gj.core.formatDate(r,"MM",t.locale))},createNavigation:function(e,t,r,a){var o,n,d=$("");for((n=$('
              ')).append($("
              "+a.icons.previousMonth+"
              ").on("click",gj.datepicker.methods.prev(e,a))),n.append($('
              ').on("click",gj.datepicker.methods.changePeriod(e,a))),n.append($("
              "+a.icons.nextMonth+"
              ").on("click",gj.datepicker.methods.next(e,a))),t.append(n),o=$(''),a.calendarWeeks&&o.append("
               
              "),i=a.weekStartDay;i
              "+gj.core.messages[a.locale].weekDaysMin[i]+"
              ");for(i=0;i
              "+gj.core.messages[a.locale].weekDaysMin[i]+"
              ");d.append(o),r.append(d)},renderMonth:function(e,t,r){var a,i,o,n,d,s,l,c,g,p,u,h,f,m,v,b=t.children('[role="body"]'),y=$(""),j=$(""),w=gj.core.messages[r.locale].titleFormat;for(b.off().empty(),gj.datepicker.methods.createNavigation(e,b,y,r),n=parseInt(t.attr("month"),10),d=parseInt(t.attr("year"),10),t.attr("type","month"),w=w.replace("mmmm",gj.core.messages[r.locale].monthNames[n]).replace("yyyy",d),t.find('div[role="period"]').text(w),s=new Array(31,28,31,30,31,30,31,31,30,31,30,31),d%4==0&&1900!=d&&(s[1]=29),l=s[n],c=(new Date(d,n,1).getDay()+7-r.weekStartDay)%7,a=0,$row=$(""),u=gj.datepicker.methods.getPrevMonth(n,d),g=1;g<=c;g++)o=s[u.month]-c+g,v=new Date(u.year,u.month,o),r.calendarWeeks&&1===g&&$row.append('"),f=$('"),r.calendarWeeks&&$row.append('")),f=$('"),o=4*i;o<=4*i+3;o++)(n=$("
              "+gj.core.messages[r.locale].monthShortNames[o]+"
              ")).on("click",gj.datepicker.methods.selectMonth(e,t,r,o)),$cell=$("").append(n),$row.append($cell);s.append($row)}},renderDecade:function(e,t,r){var a,i,o,n,d,s=t.find('>[role="body"]>table'),l=s.children("tbody");for(s.children("thead").hide(),i=(a=parseInt(t.attr("year"),10))-a%10,t.attr("type","decade"),t.find('div[role="period"]').text(i+" - "+(i+9)),l.empty(),o=i-1;o<=i+10;o+=4){for($row=$(""),n=o;n<=o+3;n++)(d=$("
              "+n+"
              ")).on("click",gj.datepicker.methods.selectYear(e,t,r,n)),$cell=$("").append(d),$row.append($cell);l.append($row)}},renderCentury:function(e,t,r){var a,i,o,n,d,s=t.find('>[role="body"]>table'),l=s.children("tbody");for(s.children("thead").hide(),i=(a=parseInt(t.attr("year"),10))-a%100,t.attr("type","century"),t.find('div[role="period"]').text(i+" - "+(i+99)),l.empty(),o=i-10;o"),n=o;n<=o+30;n+=10)(d=$("
              "+n+"
              ")).on("click",gj.datepicker.methods.selectDecade(e,t,r,n)),$cell=$("
              ").append(d),$row.append($cell);l.append($row)}},getWeekNumber:function(e){var t=new Date(e.valueOf());t.setDate(t.getDate()+6),(t=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))).setUTCDate(t.getUTCDate()+4-(t.getUTCDay()||7));var r=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t-r)/864e5+1)/7)},getMinDate:function(e){var t;return e.minDate&&("string"==typeof e.minDate?t=gj.core.parseDate(e.minDate,e.format,e.locale):"function"==typeof e.minDate?"string"==typeof(t=e.minDate())&&(t=gj.core.parseDate(t,e.format,e.locale)):"function"==typeof e.minDate.getMonth&&(t=e.minDate)),t},getMaxDate:function(e){var t;return e.maxDate&&("string"==typeof e.maxDate?t=gj.core.parseDate(e.maxDate,e.format,e.locale):"function"==typeof e.maxDate?"string"==typeof(t=e.maxDate())&&(t=gj.core.parseDate(t,e.format,e.locale)):"function"==typeof e.maxDate.getMonth&&(t=e.maxDate)),t},isSelectable:function(e,t){var r,a=!0,i=gj.datepicker.methods.getMinDate(e),o=gj.datepicker.methods.getMaxDate(e);if(i&&to&&(a=!1),a){if(e.disableDates)if($.isArray(e.disableDates))for(r=0;r-1&&(a=!1)}return a},getPrevMonth:function(e,t){return date=new Date(t,e,1),date.setMonth(date.getMonth()-1),{month:date.getMonth(),year:date.getFullYear()}},getNextMonth:function(e,t){return date=new Date(t,e,1),date.setMonth(date.getMonth()+1),{month:date.getMonth(),year:date.getFullYear()}},prev:function(e,t){return function(){var r,a,i,o,n,d=$("body").find('[role="calendar"][guid="'+e.attr("data-guid")+'"]');switch(i=parseInt(d.attr("year"),10),d.attr("type")){case"month":a=parseInt(d.attr("month"),10),r=gj.datepicker.methods.getPrevMonth(a,i),d.attr("month",r.month),d.attr("year",r.year),gj.datepicker.methods.renderMonth(e,d,t);break;case"year":d.attr("year",i-1),gj.datepicker.methods.renderYear(e,d,t);break;case"decade":o=i-i%10,d.attr("year",o-10),gj.datepicker.methods.renderDecade(e,d,t);break;case"century":n=i-i%100,d.attr("year",n-100),gj.datepicker.methods.renderCentury(e,d,t)}}},next:function(e,t){return function(){var r,a,i,o,n,d=$("body").find('[role="calendar"][guid="'+e.attr("data-guid")+'"]');switch(i=parseInt(d.attr("year"),10),d.attr("type")){case"month":a=parseInt(d.attr("month"),10),r=gj.datepicker.methods.getNextMonth(a,i),d.attr("month",r.month),d.attr("year",r.year),gj.datepicker.methods.renderMonth(e,d,t);break;case"year":d.attr("year",i+1),gj.datepicker.methods.renderYear(e,d,t);break;case"decade":o=i-i%10,d.attr("year",o+10),gj.datepicker.methods.renderDecade(e,d,t);break;case"century":n=i-i%100,d.attr("year",n+100),gj.datepicker.methods.renderCentury(e,d,t)}}},changePeriod:function(e,t){return function(r){var a=$("body").find('[role="calendar"][guid="'+e.attr("data-guid")+'"]');switch(a.attr("type")){case"month":gj.datepicker.methods.renderYear(e,a,t);break;case"year":gj.datepicker.methods.renderDecade(e,a,t);break;case"decade":gj.datepicker.methods.renderCentury(e,a,t)}}},dayClickHandler:function(e,t,r,a){return function(i){return i&&i.stopPropagation(),gj.datepicker.methods.selectDay(e,t,r,a),!0!==r.footer&&!1!==r.autoClose&&gj.datepicker.methods.change(e,t,r,a),e}},change:function(e,t,r,a){a.getDate();var i=a.getMonth(),o=a.getFullYear(),n=gj.core.formatDate(a,r.format,r.locale);t.attr("month",i),t.attr("year",o),e.val(n),gj.datepicker.events.change(e),"none"!==window.getComputedStyle(t[0]).display&&gj.datepicker.methods.close(e)},selectDay:function(e,t,r,a){var i=a.getDate(),o=a.getMonth(),n=a.getFullYear();t.attr("selectedDay",n+"-"+o+"-"+i),t.find("tbody td").removeClass("selected"),t.find('tbody td[day="'+i+'"][month="'+o+'"]').addClass("selected"),gj.datepicker.methods.updateHeader(t,r,a),gj.datepicker.events.select(e,"day")},selectMonth:function(e,t,r,a){return function(i){t.attr("month",a),gj.datepicker.methods.renderMonth(e,t,r),gj.datepicker.events.select(e,"month")}},selectYear:function(e,t,r,a){return function(i){t.attr("year",a),gj.datepicker.methods.renderYear(e,t,r),gj.datepicker.events.select(e,"year")}},selectDecade:function(e,t,r,a){return function(i){t.attr("year",a),gj.datepicker.methods.renderDecade(e,t,r),gj.datepicker.events.select(e,"decade")}},open:function(e,t){var r,a=$("body").find('[role="calendar"][guid="'+e.attr("data-guid")+'"]');switch(e.val()?e.value(e.val()):(r=new Date,a.attr("month",r.getMonth()),a.attr("year",r.getFullYear())),a.attr("type")){case"month":gj.datepicker.methods.renderMonth(e,a,t);break;case"year":gj.datepicker.methods.renderYear(e,a,t);break;case"decade":gj.datepicker.methods.renderDecade(e,a,t);break;case"century":gj.datepicker.methods.renderCentury(e,a,t)}a.show(),a.closest('div[role="modal"]').show(),t.modal?gj.core.center(a):(gj.core.setChildPosition(e[0],a[0]),document.activeElement!==e[0]&&e.focus()),clearTimeout(e.timeout),gj.datepicker.events.open(e)},close:function(e){var t=$("body").find('[role="calendar"][guid="'+e.attr("data-guid")+'"]');t.hide(),t.closest('div[role="modal"]').hide(),gj.datepicker.events.close(e)},createKeyDownHandler:function(e,t,r){return function(a){var i,o,n,d,s,l;a=a||window.event;"none"!==window.getComputedStyle(t[0]).display&&(l=gj.datepicker.methods.getActiveCell(t),"38"==a.keyCode?(d=l.index(),(s=l.closest("tr").prev("tr").find("td:eq("+d+")")).is("[day]")||(gj.datepicker.methods.prev(e,r)(),(s=t.find("tbody tr").last().find("td:eq("+d+")")).is(":empty")&&(s=t.find("tbody tr").last().prev().find("td:eq("+d+")"))),s.is("[day]")&&(s.addClass("focused"),l.removeClass("focused"))):"40"==a.keyCode?(d=l.index(),(s=l.closest("tr").next("tr").find("td:eq("+d+")")).is("[day]")||(gj.datepicker.methods.next(e,r)(),(s=t.find("tbody tr").first().find("td:eq("+d+")")).is("[day]")||(s=t.find("tbody tr:eq(1)").find("td:eq("+d+")"))),s.is("[day]")&&(s.addClass("focused"),l.removeClass("focused"))):"37"==a.keyCode?(0===(s=l.prev("td[day]:not(.disabled)")).length&&(s=l.closest("tr").prev("tr").find("td[day]").last()),0===s.length&&(gj.datepicker.methods.prev(e,r)(),s=t.find("tbody tr").last().find("td[day]").last()),s.length>0&&(s.addClass("focused"),l.removeClass("focused"))):"39"==a.keyCode?(0===(s=l.next("[day]:not(.disabled)")).length&&(s=l.closest("tr").next("tr").find("td[day]").first()),0===s.length&&(gj.datepicker.methods.next(e,r)(),s=t.find("tbody tr").first().find("td[day]").first()),s.length>0&&(s.addClass("focused"),l.removeClass("focused"))):"13"==a.keyCode?(n=parseInt(l.attr("day"),10),i=parseInt(l.attr("month"),10),o=parseInt(l.attr("year"),10),gj.datepicker.methods.dayClickHandler(e,t,r,new Date(o,i,n))()):"27"==a.keyCode&&e.close())}},getActiveCell:function(e){var t=e.find("td[day].focused");return 0===t.length&&0===(t=e.find("td[day].selected")).length&&0===(t=e.find("td[day].today")).length&&(t=e.find("td[day]:not(.disabled)").first()),t},value:function(e,t){var r,a,i=e.data();return void 0===t?e.val():((a=gj.core.parseDate(t,i.format,i.locale))&&a.getTime()?(r=$("body").find('[role="calendar"][guid="'+e.attr("data-guid")+'"]'),gj.datepicker.methods.dayClickHandler(e,r,i,a)()):e.val(""),e)},destroy:function(e){var t=e.data(),r=e.parent(),a=$("body").find('[role="calendar"][guid="'+e.attr("data-guid")+'"]');return t&&(e.off(),a.parent('[role="modal"]').length>0&&a.unwrap(),a.remove(),e.removeData(),e.removeAttr("data-type").removeAttr("data-guid").removeAttr("data-datepicker"),e.removeClass(),r.children('[role="right-icon"]').remove(),e.unwrap()),e}},gj.datepicker.events={change:function(e){return e.triggerHandler("change")},select:function(e,t){return e.triggerHandler("select",[t])},open:function(e){return e.triggerHandler("open")},close:function(e){return e.triggerHandler("close")}},gj.datepicker.widget=function(e,t){var r=gj.datepicker.methods;return this.value=function(e){return r.value(this,e)},this.destroy=function(){return r.destroy(this)},this.open=function(){return r.open(this,this.data())},this.close=function(){return r.close(this)},$.extend(e,this),"true"!==e.attr("data-datepicker")&&r.init.call(e,t),e},gj.datepicker.widget.prototype=new gj.widget,gj.datepicker.widget.constructor=gj.datepicker.widget,jQuery.fn.datepicker=function(e){var t;if(this&&this.length){if("object"!=typeof e&&e){if((t=new gj.datepicker.widget(this,null))[e])return t[e].apply(this,Array.prototype.slice.call(arguments,1));throw"Method "+e+" does not exist."}return new gj.datepicker.widget(this,e)}},gj.timepicker={plugins:{}},gj.timepicker.config={base:{width:void 0,modal:!0,header:!0,footer:!0,format:"HH:MM",uiLibrary:"materialdesign",value:void 0,mode:"ampm",locale:"en-us",size:"default",icons:{rightIcon:''},style:{modal:"gj-modal",wrapper:"gj-timepicker gj-timepicker-md gj-unselectable",input:"gj-textbox-md",clock:"gj-picker gj-picker-md timepicker",footer:"",button:"gj-button-md"}},bootstrap:{style:{wrapper:"gj-timepicker gj-timepicker-bootstrap gj-unselectable input-group",input:"form-control",clock:"gj-picker gj-picker-bootstrap timepicker",footer:"modal-footer",button:"btn btn-default"},iconsLibrary:"glyphicons"},bootstrap4:{style:{wrapper:"gj-timepicker gj-timepicker-bootstrap gj-unselectable input-group",input:"form-control border",clock:"gj-picker gj-picker-bootstrap timepicker",footer:"modal-footer",button:"btn btn-default"}}},gj.timepicker.methods={init:function(e){return gj.picker.widget.prototype.init.call(this,e,"timepicker"),this},initialize:function(){},initMouse:function(e,t,r,a){e.off(),e.on("mousedown",gj.timepicker.methods.mouseDownHandler(t,r)),e.on("mousemove",gj.timepicker.methods.mouseMoveHandler(t,r,a)),e.on("mouseup",gj.timepicker.methods.mouseUpHandler(t,r,a))},createPicker:function(e){var t,r=e.data(),a=$('
              ').addClass(r.style.clock).attr("guid",e.attr("data-guid")),i=$('
              '),o=$('
              '),n=$('
              '),d=$('
              '),s=$('
              '),l=$('"),c=$('"),g=$('
              ');return!(t=gj.core.parseDate(r.value,r.format,r.locale))||isNaN(t.getTime())?t=new Date:e.attr("hours",t.getHours()),gj.timepicker.methods.initMouse(s,e,a,r),r.header&&(i.on("click",function(){gj.timepicker.methods.renderHours(e,a,r)}),o.on("click",function(){gj.timepicker.methods.renderMinutes(e,a,r)}),n.append(i).append(":").append(o),"ampm"===r.mode&&(d.append($(''+gj.core.messages[r.locale].am+"").on("click",function(){var t=gj.timepicker.methods.getHour(a);a.attr("mode","am"),$(this).addClass("selected"),$(this).parent().children('[role="pm"]').removeClass("selected"),t>=12&&a.attr("hour",t-12),r.modal||(clearTimeout(e.timeout),e.focus())})),d.append("
              "),d.append($(''+gj.core.messages[r.locale].pm+"").on("click",function(){var t=gj.timepicker.methods.getHour(a);a.attr("mode","pm"),$(this).addClass("selected"),$(this).parent().children('[role="am"]').removeClass("selected"),t<12&&a.attr("hour",t+12),r.modal||(clearTimeout(e.timeout),e.focus())})),n.append(d)),a.append(n)),a.append(s),r.footer&&(c.on("click",function(){e.close()}),g.append(c),l.on("click",gj.timepicker.methods.setTime(e,a)),g.append(l),a.append(g)),a.hide(),$("body").append(a),r.modal&&(a.wrapAll('
              '),gj.core.center(a)),a},getHour:function(e){return parseInt(e.attr("hour"),10)||0},getMinute:function(e){return parseInt(e.attr("minute"),10)||0},setTime:function(e,t){return function(){var r=gj.timepicker.methods.getHour(t),a=gj.timepicker.methods.getMinute(t),i=t.attr("mode"),o=new Date(0,0,0,12===r&&"am"===i?0:r,a),n=e.data(),d=gj.core.formatDate(o,n.format,n.locale);e.value(d),e.close()}},getPointerValue:function(e,t,r){var a,i,o=Math.atan2(128-e,128-t)/Math.PI*180;switch(o<0&&(o=360+o),r){case"ampm":return 0===(a=12-Math.round(12*o/360))?12:a;case"24hr":return i=Math.sqrt(Math.pow(128-e,2)+Math.pow(128-t,2)),0===(a=12-Math.round(12*o/360))&&(a=12),i<96&&(a=12===a?0:a+12),a;case"minutes":return 60===(a=Math.round(60-60*o/360))?0:a}},updateArrow:function(e,t,r,a){var i,o,n=t.mouseX(e),d=t.mouseY(e),s=window.scrollY||window.pageYOffset||0,l=window.scrollX||window.pageXOffset||0;i=e.target.getBoundingClientRect(),"hours"==a.dialMode?(o=gj.timepicker.methods.getPointerValue(n-l-i.left,d-s-i.top,a.mode),r.attr("hour","ampm"===a.mode&&"pm"===r.attr("mode")&&o<12?o+12:o)):"minutes"==a.dialMode&&(o=gj.timepicker.methods.getPointerValue(n-l-i.left,d-s-i.top,"minutes"),r.attr("minute",o)),gj.timepicker.methods.update(t,r,a)},update:function(e,t,r){var a,i,o,n,d,s;a=gj.timepicker.methods.getHour(t),i=gj.timepicker.methods.getMinute(t),o=t.find('[role="arrow"]'),"hours"==r.dialMode&&(0==a||a>12)&&"24hr"===r.mode?o.css("width","calc(50% - 52px)"):o.css("width","calc(50% - 20px)"),"hours"==r.dialMode?o.css("transform","rotate("+(30*a-90).toString()+"deg)"):o.css("transform","rotate("+(6*i-90).toString()+"deg)"),o.show(),n="ampm"===r.mode&&a>12?a-12:0==a?12:a,(s=t.find('[role="body"] span')).removeClass("selected"),s.filter(function(e){return"hours"==r.dialMode?parseInt($(this).text(),10)==n:parseInt($(this).text(),10)==i}).addClass("selected"),r.header&&((d=t.find('[role="header"]')).find('[role="hour"]').text(n),d.find('[role="minute"]').text(gj.core.pad(i)),"ampm"===r.mode&&(a>=12?(d.find('[role="pm"]').addClass("selected"),d.find('[role="am"]').removeClass("selected")):(d.find('[role="am"]').addClass("selected"),d.find('[role="pm"]').removeClass("selected"))))},mouseDownHandler:function(e,t){return function(t){e.mouseMove=!0}},mouseMoveHandler:function(e,t,r){return function(a){e.mouseMove&&gj.timepicker.methods.updateArrow(a,e,t,r)}},mouseUpHandler:function(e,t,r){return function(a){gj.timepicker.methods.updateArrow(a,e,t,r),e.mouseMove=!1,r.modal||(clearTimeout(e.timeout),e.focus()),"hours"==r.dialMode?setTimeout(function(){gj.timepicker.events.select(e,"hour"),gj.timepicker.methods.renderMinutes(e,t,r)},1e3):"minutes"==r.dialMode&&(!0!==r.footer&&!1!==r.autoClose&&gj.timepicker.methods.setTime(e,t)(),gj.timepicker.events.select(e,"minute"))}},renderHours:function(e,t,r){var a,i=t.find('[role="body"]');clearTimeout(e.timeout),i.empty(),(a=$('
              ')).append('
              '),a.append('1'),a.append('2'),a.append('3'),a.append('4'),a.append('5'),a.append('6'),a.append('7'),a.append('8'),a.append('9'),a.append('10'),a.append('11'),a.append('12'),"24hr"===r.mode&&(a.append('13'),a.append('14'),a.append('15'),a.append('16'),a.append('17'),a.append('18'),a.append('19'),a.append('20'),a.append('21'),a.append('22'),a.append('23'),a.append('00')),i.append(a),t.find('[role="header"] [role="hour"]').addClass("selected"),t.find('[role="header"] [role="minute"]').removeClass("selected"),r.dialMode="hours",gj.timepicker.methods.update(e,t,r)},renderMinutes:function(e,t,r){var a=t.find('[role="body"]');clearTimeout(e.timeout),a.empty(),$dial=$('
              '),$dial.append('
              '),$dial.append('5'),$dial.append('10'),$dial.append('15'),$dial.append('20'),$dial.append('25'),$dial.append('30'),$dial.append('35'),$dial.append('40'),$dial.append('45'),$dial.append('50'),$dial.append('55'),$dial.append('00'),a.append($dial),t.find('[role="header"] [role="hour"]').removeClass("selected"),t.find('[role="header"] [role="minute"]').addClass("selected"),r.dialMode="minutes",gj.timepicker.methods.update(e,t,r)},open:function(e){var t,r,a=e.data(),i=$("body").find('[role="picker"][guid="'+e.attr("data-guid")+'"]');return r=(t=e.value()?gj.core.parseDate(e.value(),a.format,a.locale):new Date).getHours(),"ampm"===a.mode&&i.attr("mode",r>12?"pm":"am"),i.attr("hour",r),i.attr("minute",t.getMinutes()),gj.timepicker.methods.renderHours(e,i,a),gj.picker.widget.prototype.open.call(e,"timepicker"),e},value:function(e,t){e.data();return void 0===t?e.val():(e.val(t),gj.timepicker.events.change(e),e)}},gj.timepicker.events={change:function(e){return e.triggerHandler("change")},select:function(e,t){return e.triggerHandler("select",[t])},open:function(e){return e.triggerHandler("open")},close:function(e){return e.triggerHandler("close")}},gj.timepicker.widget=function(e,t){var r=gj.timepicker.methods;return this.mouseMove=!1,this.value=function(e){return r.value(this,e)},this.destroy=function(){return gj.picker.widget.prototype.destroy.call(this,"timepicker")},this.open=function(){return gj.timepicker.methods.open(this)},this.close=function(){return gj.picker.widget.prototype.close.call(this,"timepicker")},$.extend(e,this),"true"!==e.attr("data-timepicker")&&r.init.call(e,t),e},gj.timepicker.widget.prototype=new gj.picker.widget,gj.timepicker.widget.constructor=gj.timepicker.widget,jQuery.fn.timepicker=function(e){var t;if(this&&this.length){if("object"!=typeof e&&e){if((t=new gj.timepicker.widget(this,null))[e])return t[e].apply(this,Array.prototype.slice.call(arguments,1));throw"Method "+e+" does not exist."}return new gj.timepicker.widget(this,e)}},gj.datetimepicker={plugins:{},messages:{"en-us":{}}},gj.datetimepicker.config={base:{datepicker:gj.datepicker.config.base,timepicker:gj.timepicker.config.base,uiLibrary:"materialdesign",value:void 0,format:"HH:MM mm/dd/yyyy",width:void 0,modal:!1,footer:!1,size:"default",locale:"en-us",icons:{},style:{calendar:"gj-picker gj-picker-md datetimepicker gj-unselectable"}},bootstrap:{style:{calendar:"gj-picker gj-picker-bootstrap datetimepicker gj-unselectable"},iconsLibrary:"glyphicons"},bootstrap4:{style:{calendar:"gj-picker gj-picker-bootstrap datetimepicker gj-unselectable"}}},gj.datetimepicker.methods={init:function(e){return gj.widget.prototype.init.call(this,e,"datetimepicker"),this.attr("data-datetimepicker","true"),gj.datetimepicker.methods.initialize(this),this},getConfig:function(e,t){var r=gj.widget.prototype.getConfig.call(this,e,t);return uiLibrary=e.hasOwnProperty("uiLibrary")?e.uiLibrary:r.uiLibrary,gj.datepicker.config[uiLibrary]&&$.extend(!0,r.datepicker,gj.datepicker.config[uiLibrary]),gj.timepicker.config[uiLibrary]&&$.extend(!0,r.timepicker,gj.timepicker.config[uiLibrary]),iconsLibrary=e.hasOwnProperty("iconsLibrary")?e.iconsLibrary:r.iconsLibrary,gj.datepicker.config[iconsLibrary]&&$.extend(!0,r.datepicker,gj.datepicker.config[iconsLibrary]),gj.timepicker.config[iconsLibrary]&&$.extend(!0,r.timepicker,gj.timepicker.config[iconsLibrary]),r},initialize:function(e){var t,r,a,i,o,n,d,s,l=e.data();l.datepicker.uiLibrary=l.uiLibrary,l.datepicker.iconsLibrary=l.iconsLibrary,l.datepicker.width=l.width,l.datepicker.format=l.format,l.datepicker.locale=l.locale,l.datepicker.modal=l.modal,l.datepicker.footer=l.footer,l.datepicker.style.calendar=l.style.calendar,l.datepicker.value=l.value,l.datepicker.size=l.size,l.datepicker.autoClose=!1,gj.datepicker.methods.initialize(e,l.datepicker),e.on("select",function(r,a){var i,o;"day"===a?gj.datetimepicker.methods.createShowHourHandler(e,t,l)():"minute"===a&&t.attr("selectedDay")&&!0!==l.footer&&(selectedDay=t.attr("selectedDay").split("-"),i=new Date(selectedDay[0],selectedDay[1],selectedDay[2],t.attr("hour")||0,t.attr("minute")||0),o=gj.core.formatDate(i,l.format,l.locale),e.val(o),gj.datetimepicker.events.change(e),gj.datetimepicker.methods.close(e))}),e.on("open",function(){var e=t.children('[role="header"]');e.find('[role="calendarMode"]').addClass("selected"),e.find('[role="clockMode"]').removeClass("selected")}),t=$("body").find('[role="calendar"][guid="'+e.attr("data-guid")+'"]'),o=l.value?gj.core.parseDate(l.value,l.format,l.locale):new Date,t.attr("hour",o.getHours()),t.attr("minute",o.getMinutes()),l.timepicker.uiLibrary=l.uiLibrary,l.timepicker.iconsLibrary=l.iconsLibrary,l.timepicker.format=l.format,l.timepicker.locale=l.locale,l.timepicker.header=!0,l.timepicker.footer=l.footer,l.timepicker.size=l.size,l.timepicker.mode="24hr",l.timepicker.autoClose=!1,r=$('
              '),(a=$('
              ')).on("click",gj.datetimepicker.methods.createShowDateHandler(e,t,l)),a.html(gj.core.formatDate(new Date,"ddd, mmm dd",l.locale)),r.append(a),n=$('
              '),(d=$('event')).on("click",gj.datetimepicker.methods.createShowDateHandler(e,t,l)),n.append(d),(i=$('
              ')).append($('
              ').on("click",gj.datetimepicker.methods.createShowHourHandler(e,t,l)).html(gj.core.formatDate(new Date,"HH",l.locale))),i.append(":"),i.append($('
              ').on("click",gj.datetimepicker.methods.createShowMinuteHandler(e,t,l)).html(gj.core.formatDate(new Date,"MM",l.locale))),n.append(i),(s=$('clock')).on("click",gj.datetimepicker.methods.createShowHourHandler(e,t,l)),n.append(s),r.append(n),t.prepend(r)},createShowDateHandler:function(e,t,r){return function(a){var i=t.children('[role="header"]');i.find('[role="calendarMode"]').addClass("selected"),i.find('[role="date"]').addClass("selected"),i.find('[role="clockMode"]').removeClass("selected"),i.find('[role="hour"]').removeClass("selected"),i.find('[role="minute"]').removeClass("selected"),gj.datepicker.methods.renderMonth(e,t,r.datepicker)}},createShowHourHandler:function(e,t,r){return function(){var a=t.children('[role="header"]');a.find('[role="calendarMode"]').removeClass("selected"),a.find('[role="date"]').removeClass("selected"),a.find('[role="clockMode"]').addClass("selected"),a.find('[role="hour"]').addClass("selected"),a.find('[role="minute"]').removeClass("selected"),gj.timepicker.methods.initMouse(t.children('[role="body"]'),e,t,r.timepicker),gj.timepicker.methods.renderHours(e,t,r.timepicker)}},createShowMinuteHandler:function(e,t,r){return function(){var a=t.children('[role="header"]');a.find('[role="calendarMode"]').removeClass("selected"),a.find('[role="date"]').removeClass("selected"),a.find('[role="clockMode"]').addClass("selected"),a.find('[role="hour"]').removeClass("selected"),a.find('[role="minute"]').addClass("selected"),gj.timepicker.methods.initMouse(t.children('[role="body"]'),e,t,r.timepicker),gj.timepicker.methods.renderMinutes(e,t,r.timepicker)}},close:function(e){var t=$("body").find('[role="calendar"][guid="'+e.attr("data-guid")+'"]');t.hide(),t.closest('div[role="modal"]').hide()},value:function(e,t){var r,a,i,o=e.data();return void 0===t?e.val():((a=gj.core.parseDate(t,o.format,o.locale))?(r=$("body").find('[role="calendar"][guid="'+e.attr("data-guid")+'"]'),gj.datepicker.methods.dayClickHandler(e,r,o,a)(),i=a.getHours(),"ampm"===o.mode&&r.attr("mode",i>12?"pm":"am"),r.attr("hour",i),r.attr("minute",a.getMinutes()),e.val(t)):e.val(""),e)},destroy:function(e){var t=e.data(),r=e.parent(),a=$("body").find('[role="calendar"][guid="'+e.attr("data-guid")+'"]');return t&&(e.off(),a.parent('[role="modal"]').length>0&&a.unwrap(),a.remove(),e.removeData(),e.removeAttr("data-type").removeAttr("data-guid").removeAttr("data-datetimepicker"),e.removeClass(),r.children('[role="right-icon"]').remove(),e.unwrap()),e}},gj.datetimepicker.events={change:function(e){return e.triggerHandler("change")}},gj.datetimepicker.widget=function(e,t){var r=gj.datetimepicker.methods;return this.mouseMove=!1,this.value=function(e){return r.value(this,e)},this.open=function(){gj.datepicker.methods.open(this,this.data().datepicker)},this.close=function(){gj.datepicker.methods.close(this)},this.destroy=function(){return r.destroy(this)},$.extend(e,this),"true"!==e.attr("data-datetimepicker")&&r.init.call(e,t),e},gj.datetimepicker.widget.prototype=new gj.widget,gj.datetimepicker.widget.constructor=gj.datetimepicker.widget,gj.datetimepicker.widget.prototype.getConfig=gj.datetimepicker.methods.getConfig,jQuery.fn.datetimepicker=function(e){var t;if(this&&this.length){if("object"!=typeof e&&e){if((t=new gj.datetimepicker.widget(this,null))[e])return t[e].apply(this,Array.prototype.slice.call(arguments,1));throw"Method "+e+" does not exist."}return new gj.datetimepicker.widget(this,e)}},gj.slider={plugins:{},messages:{"en-us":{}}},gj.slider.config={base:{min:0,max:100,width:void 0,uiLibrary:"materialdesign",value:void 0,icons:{},style:{wrapper:"gj-slider gj-slider-md",progress:void 0,track:void 0}},bootstrap:{style:{wrapper:"gj-slider gj-slider-bootstrap gj-slider-bootstrap-3",progress:"progress-bar",track:"progress"}},bootstrap4:{style:{wrapper:"gj-slider gj-slider-bootstrap gj-slider-bootstrap-4",progress:"progress-bar",track:"progress"}}},gj.slider.methods={init:function(e){return gj.widget.prototype.init.call(this,e,"slider"),this.attr("data-slider","true"),gj.slider.methods.initialize(this,this.data()),this},initialize:function(e,t){var r,a,i,o;e[0].style.display="none","wrapper"!==e[0].parentElement.attributes.role?((r=document.createElement("div")).setAttribute("role","wrapper"),e[0].parentNode.insertBefore(r,e[0]),r.appendChild(e[0])):r=e[0].parentElement,t.width&&(r.style.width=t.width+"px"),gj.core.addClasses(r,t.style.wrapper),null==(a=e[0].querySelector('[role="track"]'))&&((a=document.createElement("div")).setAttribute("role","track"),r.appendChild(a)),gj.core.addClasses(a,t.style.track),null==(i=e[0].querySelector('[role="handle"]'))&&((i=document.createElement("div")).setAttribute("role","handle"),r.appendChild(i)),null==(o=e[0].querySelector('[role="progress"]'))&&((o=document.createElement("div")).setAttribute("role","progress"),r.appendChild(o)),gj.core.addClasses(o,t.style.progress),t.value||(t.value=t.min),gj.slider.methods.value(e,t,t.value),gj.documentManager.subscribeForEvent("mouseup",e.data("guid"),gj.slider.methods.createMouseUpHandler(e,i,t)),i.addEventListener("mousedown",gj.slider.methods.createMouseDownHandler(i,t)),gj.documentManager.subscribeForEvent("mousemove",e.data("guid"),gj.slider.methods.createMouseMoveHandler(e,a,i,o,t)),i.addEventListener("click",function(e){e.stopPropagation()}),r.addEventListener("click",gj.slider.methods.createClickHandler(e,a,i,t))},createClickHandler:function(e,t,r,a){return function(i){var o,n,d,s,l;"true"!==r.getAttribute("drag")&&(o=gj.core.position(e[0].parentElement),n=(new gj.widget).mouseX(i)-o.left,d=gj.core.width(r)/2,s=gj.core.width(t)/(a.max-a.min),l=Math.round((n-d)/s)+a.min,gj.slider.methods.value(e,a,l))}},createMouseUpHandler:function(e,t,r){return function(r){"true"===t.getAttribute("drag")&&(t.setAttribute("drag","false"),gj.slider.events.change(e))}},createMouseDownHandler:function(e,t){return function(t){e.setAttribute("drag","true")}},createMouseMoveHandler:function(e,t,r,a,i){return function(a){var o,n,d,s,l,c,g;"true"===r.getAttribute("drag")&&(o=gj.core.position(e[0].parentElement),n=(new gj.widget).mouseX(a)-o.left,d=gj.core.width(t),s=gj.core.width(r)/2,l=d/(i.max-i.min),c=(i.value-i.min)*l,n>=s&&n<=d+s&&(n>c+l/2||nevent'},style:{modal:"gj-modal",wrapper:"gj-colorpicker gj-colorpicker-md gj-unselectable",input:"gj-textbox-md",picker:"gj-picker gj-picker-md colorpicker gj-unselectable",footer:"",button:"gj-button-md"}},bootstrap:{style:{}},bootstrap4:{style:{}}},gj.colorpicker.methods={init:function(e){return gj.picker.widget.prototype.init.call(this,e,"colorpicker"),gj.colorpicker.methods.initialize(this),this},initialize:function(e){},createPicker:function(e,t){var r=$('
              ').addClass(t.style.picker).attr("guid",e.attr("data-guid"));return r.html("test"),r.hide(),$("body").append(r),r},open:function(e){return e.val()&&e.value(e.val()),gj.picker.widget.prototype.open.call(e,"colorpicker")}},gj.colorpicker.events={change:function(e){return e.triggerHandler("change")},select:function(e){return e.triggerHandler("select")},open:function(e){return e.triggerHandler("open")},close:function(e){return e.triggerHandler("close")}},gj.colorpicker.widget=function(e,t){var r=gj.colorpicker.methods;return this.value=function(e){return r.value(this,e)},this.destroy=function(){return gj.picker.widget.prototype.destroy.call(this,"colorpicker")},this.open=function(){return r.open(this)},this.close=function(){return gj.picker.widget.prototype.close.call(this,"colorpicker")},$.extend(e,this),"true"!==e.attr("data-colorpicker")&&r.init.call(e,t),e},gj.colorpicker.widget.prototype=new gj.picker.widget,gj.colorpicker.widget.constructor=gj.colorpicker.widget,jQuery.fn.colorpicker=function(e){var t;if(this&&this.length){if("object"!=typeof e&&e){if((t=new gj.colorpicker.widget(this,null))[e])return t[e].apply(this,Array.prototype.slice.call(arguments,1));throw"Method "+e+" does not exist."}return new gj.colorpicker.widget(this,e)}};
              '+gj.datepicker.methods.getWeekNumber(v)+"
              '),r.showOtherMonths&&(m=$("
              "+o+"
              "),f.append(m),r.selectOtherMonths&&gj.datepicker.methods.isSelectable(r,v)?(f.addClass("gj-cursor-pointer").attr("day",o).attr("month",u.month).attr("year",u.year),m.on("click",gj.datepicker.methods.dayClickHandler(e,t,r,v)),m.on("mousedown",function(e){e.stopPropagation()})):f.addClass("disabled")),$row.append(f),a++;for(g>1&&j.append($row),p=new Date,g=1;g<=l;g++)v=new Date(d,n,g),0==a&&($row=$("
              '+gj.datepicker.methods.getWeekNumber(v)+"
              '),d===p.getFullYear()&&n===p.getMonth()&&g===p.getDate()?f.addClass("today"):f.addClass("current-month"),m=$("
              "+g+"
              "),gj.datepicker.methods.isSelectable(r,v)?(f.addClass("gj-cursor-pointer"),m.on("click",gj.datepicker.methods.dayClickHandler(e,t,r,v)),m.on("mousedown",function(e){e.stopPropagation()})):f.addClass("disabled"),f.append(m),$row.append(f),7==++a&&(j.append($row),a=0);for(h=gj.datepicker.methods.getNextMonth(n,d),g=1;0!=a;g++)v=new Date(h.year,h.month,g),f=$('
              '),r.showOtherMonths&&(m=$("
              "+g+"
              "),r.selectOtherMonths&&gj.datepicker.methods.isSelectable(r,v)?(f.addClass("gj-cursor-pointer").attr("day",g).attr("month",h.month).attr("year",h.year),m.on("click",gj.datepicker.methods.dayClickHandler(e,t,r,v)),m.on("mousedown",function(e){e.stopPropagation()})):f.addClass("disabled"),f.append(m)),$row.append(f),7==++a&&(j.append($row),a=0);y.append(j),b.append(y),t.attr("selectedDay")&&(i=t.attr("selectedDay").split("-"),v=new Date(i[0],i[1],i[2],t.attr("hour")||0,t.attr("minute")||0),t.find('tbody td[day="'+i[2]+'"][month="'+i[1]+'"]').addClass("selected"),gj.datepicker.methods.updateHeader(t,r,v))},renderYear:function(e,t,r){var a,i,o,n,d=t.find('>[role="body"]>table'),s=d.children("tbody");for(d.children("thead").hide(),a=parseInt(t.attr("year"),10),t.attr("type","year"),t.find('div[role="period"]').text(a),s.empty(),i=0;i<3;i++){for($row=$("