"undefined"==typeofgj&&(gj={}),gj.widget=function(){vara=this;a.xhr=null,a.generateGUID=function(){functiona(){returnMath.floor(65536*(1+Math.random())).toString(16).substring(1)}returna()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}},gj.widget.prototype.init=function(a,b){varc,d,e;d=$.extend(!0,{},this.getHTMLConfig()||{}),$.extend(!0,d,a||{}),e=this.getConfig(d,b),this.attr("data-guid",e.guid),this.data(e);for(cine)gj[b].events.hasOwnProperty(c)&&(this.on(c,e[c]),deletee[c]);for(pluginingj[b].plugins)gj[b].plugins.hasOwnProperty(plugin)&&gj[b].plugins[plugin].configure(this,e,d);returnthis},gj.widget.prototype.getConfig=function(a,b){varc,d,e;c=$.extend(!0,{},gj[b].config.base),d=a.uiLibrary||c.uiLibrary,gj[b].config[d]&&$.extend(!0,c,gj[b].config[d]);for(eingj[b].plugins)gj[b].plugins.hasOwnProperty(e)&&($.extend(!0,c,gj[b].plugins[e].config.base),gj[b].plugins[e].config[d]&&$.extend(!0,c,gj[b].plugins[e].config[d]));return$.extend(!0,c,a),c.guid||(c.guid=this.generateGUID()),c},gj.widget.prototype.getHTMLConfig=function(){vara=this.data(),b=this[0].attributes;returnb.width&&(a.width=b.width.nodeValue),b.height&&(a.height=b.height.nodeValue),b.align&&(a.align=b.align.nodeValue),a&&a.source&&(a.dataSource=a.source,deletea.source),a},gj.widget.prototype.createDoneHandler=function(){vara=this;returnfunction(b){"string"==typeofb&&JSON&&(b=JSON.parse(b)),gj[a.data("type")].methods.render(a,b)}},gj.widget.prototype.createErrorHandler=function(){returnfunction(a){a&&a.statusText&&"abort"!==a.statusText&&alert(a)}},gj.widget.prototype.reload=function(a){varb,c,d=this.data();returnvoid0===d.dataSource&&gj[this.data("type")].methods.useHtmlDataSource(this,d),$.extend(d.params,a),$.isArray(d.dataSource)?(c=gj[this.data("type")].methods.filter(this),gj[this.data("type")].methods.render(this,c)):"string"==typeofd.dataSource?(b={url:d.dataSource,data:d.params},this.xhr&&this.xhr.abort(),this.xhr=$.ajax(b).done(this.createDoneHandler()).fail(this.createErrorHandler())):"object"==typeofd.dataSource&&(d.dataSource.data||(d.dataSource.data={}),$.extend(d.dataSource.data,d.params),b=$.extend(!0,{},d.dataSource),"json"===b.dataType&&"object"==typeofb.data&&(b.data=JSON.stringify(b.data)),b.success||(b.success=this.createDoneHandler()),b.error||(b.error=this.createErrorHandler()),this.xhr&&this.xhr.abort(),this.xhr=$.ajax(b)),this},gj.documentManager={events:{},subscribeForEvent:function(a,b,c){if(gj.documentManager.events[a]&&0!==gj.documentManager.events[a].length){if(gj.documentManager.events[a][b])throw"Event "+a+" for widget with guid='"+b+"' is already attached.";gj.documentManager.events[a].push({widgetId:b,callback:c})}elsegj.documentManager.events[a]=[{widgetId:b,callback:c}],$(document).on(a,gj.documentManager.executeCallbacks)},executeCallbacks:function(a){varb=gj.documentManager.events[a.type];if(b)for(varc=0;c<b.length;c++)b[c].callback(a)},unsubscribeForEvent:function(a,b){varc=!1,d=gj.documentManager.events[a];if(d)for(vare=0;e<d.length;e++)d[e].widgetId===b&&(d.splice(e,1),c=!0,0===d.length&&($(document).off(a),deletegj.documentManager.events[a]));if(!c)throw'The "'+a+'" for widget with guid="'+b+"\" can't be removed."}},"undefined"==typeofgj.draggable&&(gj.draggable={}),gj.draggable.config={base:{handle:void0,vertical:!0,horizontal:!0}},gj.draggable.methods={init:function(a){varb,c=this;returngj.widget.prototype.init.call(this,a,"draggable"),c.attr("data-draggable","true"),b=gj.draggable.methods.getHandleElement(c),b.on("mousedown",function(a){c.attr("data-draggable-dragging",!0),c.removeAttr("data-draggable-x"),c.removeAttr("data-draggable-y"),"aboslute"!==c.css("position")&&c.css("position","absolute"),gj.documentManager.subscribeForEvent("mousemove",c.data("guid"),gj.draggable.methods.createMouseMoveHandler(c))}),gj.documentManager.subscribeForEvent("mouseup",c.data("guid"),gj.draggable.methods.createMouseUpHandler(c)),c},getHandleElement:function(a){varb=a.data("handle");returnb&&b.length?b:a},createMouseUpHandler:function(a){returnfunction(b){"true"===a.attr("data-draggable-