UNPKG

nest-parrot

Version:
12 lines 260 kB
/** nest-parrot.V0.6.26 2019-05-16 */

!function(a){var b={console:function(){for(var b=function(){},c=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],d=c.length,e=a.console=a.console||{};d--;){var f=c[d];e[f]||(e[f]=b)}a.console=a.console?a.console:e},string:function(){void 0===String.prototype.upperFirst&&(String.prototype.upperFirst=function(){return 1==this.length?this.toUpperCase():this.substring(0,1).toUpperCase()+this.substring(1)}),String.prototype.endsWith||(String.prototype.endsWith=function(a,b){var c=this.toString();(void 0===b||b>c.length)&&(b=c.length),b-=a.length;var d=c.indexOf(a,b);return-1!==d&&d===b}),String.prototype.startsWith||(String.prototype.startsWith=function(a){return this.slice(0,a.length)===a}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}),void 0===String.prototype.isEmpty&&(String.prototype.isEmpty=function(){return 0===this.length}),void 0===String.prototype.isBlank&&(String.prototype.isBlank=function(){return 0===this.trim().length}),void 0===String.prototype.format&&(String.prototype.format=function(a){return this.replace(/%(\d+)/g,function(b,c){return a[--c]})}),void 0===String.prototype.currencyFormat&&(String.prototype.currencyFormat=function(a){return a=a||0,(1*this).toFixed(a).replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")}),void 0===String.prototype.padLeft&&(String.prototype.padLeft=function(a,b){var c=0,d=this?this:"";for(b=b||"0",c=d.length;c<a;)d=b+d,c++;return d}),void 0===String.prototype.padRight&&(String.prototype.padRight=function(a,b){var c=0,d=this?this:"";for(b=b||"0",c=d.length;c<a;)d+=b,c++;return d}),void 0===String.prototype.movePointLeft&&(String.prototype.movePointLeft=function(a){var b,c,d,e,f,g;return e=".",g="",b=this?this:"",a<=0?b:(f=b.split("."),c=f[0]?f[0]:"",d=f[1]?f[1]:"","-"==c.slice(0,1)&&(c=c.slice(1),g="-"),c.length<=a&&(e="0.",c=c.padLeft(a)),g+c.slice(0,-a)+e+c.slice(-a)+d)}),void 0===String.prototype.movePointRight&&(String.prototype.movePointRight=function(a){var b,c,d,e,f,g;if(e=".",b=this?this:"",a<=0)return b;f=b.split("."),c=f[0]?f[0]:"",d=f[1]?f[1]:"",d.length<=a&&(e="",d=d.padRight(a)),"-"==c.slice(0,1)?(c=c.slice(1),g="-"):g="",0==c&&(c="");var h=(c+d.slice(0,a)).replace(/^0+/,"");return h.isEmpty()&&(h="0"),g+h+e+d.slice(a,d.length)})},number:function(){},array:function(){Array.prototype.find||(Array.prototype.find=function(a){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof a)throw new TypeError("predicate must be a function");for(var b,c=Object(this),d=c.length>>>0,e=arguments[1],f=0;f<d;f++)if(b=c[f],a.call(e,b,f,c))return b}),Array.prototype.findIndex||(Array.prototype.findIndex=function(a){if(null===this)throw new TypeError("Array.prototype.findIndex called on null or undefined");if("function"!=typeof a)throw new TypeError("predicate must be a function");for(var b,c=Object(this),d=c.length>>>0,e=arguments[1],f=0;f<d;f++)if(b=c[f],a.call(e,b,f,c))return f;return-1})}};b.console(),b.string(),b.number(),b.array()}(window),function(a,b){function c(a){document.activeElement&&document.activeElement===a||a.focus()}a.fn.caret=function(a){var d,e,f,g,h=this[0],i="true"===h.contentEditable;if(0==arguments.length){if(b.getSelection){if(i){c(h);var j=b.getSelection();return j.rangeCount?(e=j.getRangeAt(0),f=e.cloneRange(),f.selectNodeContents(h),f.setEnd(e.endContainer,e.endOffset),f.toString().length):0}return h.selectionStart}if(document.selection){if(c(h),i)return e=document.selection.createRange(),f=document.body.createTextRange(),f.moveToElementText(h),f.setEndPoint("EndToEnd",e),f.text.length;for(a=0,d=h.createTextRange(),f=document.selection.createRange().duplicate(),g=f.getBookmark(),d.moveToBookmark(g);0!==d.moveStart("character",-1);)a++;return a}return 0}return-1==a&&(a=this[i?"text":"val"]().length),b.getSelection?i?(c(h),b.getSelection().collapse(h.firstChild,a)):h.setSelectionRange(a,a):document.body.createTextRange&&(d=document.body.createTextRange(),d.moveToElementText(h),d.moveStart("character",a),d.collapse(!0),d.select()),i||c(h),a}}(jQuery,window),function(a){var b=a.$pt;null==b&&(b={},a.$pt=b);var c=function(a,b){this.value=a,this.message=b,this.toString=function(){return this.value+": "+this.message}};b.createComponentException=function(a,b){return new c(a,b)};var d={};b.messages=d,b.defineMessage=function(a,c){return d[a]=c,b},b.getMessage=function(a){var b=d[a];return null==b?null:b},b.__messagesDomain={};var e=function(a,c,d){var e=b.createComponentException(b.ComponentConstants.Err_Incorrect_Messages_Format,"Message [%1] has conflict type in source and target.".format([a]));throw e.source=c,e.target=d,e},f=function(a,b,c){Object.keys(a).forEach(function(d){var g=a[d],h=b[d];"object"!=typeof g||Array.isArray(g)?"object"!=typeof h||Array.isArray(h)?(h&&(console.error("Message [%1] exists in target.".format([c?c+"."+d:d])),console.log("source message: ",a),console.log("target message: ",b)),b[d]=g):e(c?c+"."+d:d,g,h):h?"object"!=typeof h||Array.isArray(h)?e(c?c+"."+d:d,g,h):f(g,h,c?c+"."+d:d):(b[d]={},f(g,b[d],c?c+"."+d:d))})};b.installMessages=function(a,c,d){if("object"!=typeof c)throw b.createComponentException(b.ComponentConstants.Err_Incorrect_Messages_Format,"Messages must be an JSON object.");if(null==a||"string"!=typeof a||a.isBlank())throw b.createComponentException(b.ComponentConstants.Err_Incorrect_Messages_Format,"Domain of messages must be a string.");console.log("Start to install messages on domain ["+a+"].");var e=d||b.messages;f(c,e),b.__messagesDomain[a]||(b.__messagesDomain[a]={domain:a,messages:[]}),b.__messagesDomain[a].messages.push({target:e,json:c}),console.log("End of install messages on domain ["+a+"].")};var g=function(a,b,c){Object.keys(a).forEach(function(d){var f=a[d],h=b[d];"object"!=typeof f||Array.isArray(f)?"object"!=typeof h||Array.isArray(h)?delete b[d]:e(c?c+"."+d:d,f,h):h&&("object"!=typeof h||Array.isArray(h)?e(c?c+"."+d:d,f,h):(g(f,h,c?c+"."+d:d),0==Object.keys(h).length&&delete b[d]))})};b.uninstallMessages=function(a,c){if(null==a||"string"!=typeof a||a.isBlank())throw b.createComponentException(b.ComponentConstants.Err_Incorrect_Messages_Format,"Domain of messages must be a string.");console.log("Start to uninstall messages on domain ["+a+"].");var d=c||b.messages,e=b.__messagesDomain[a];e&&(e.messages=e.messages.map(function(a){return a.target===d?(g(a.json,d),null):a}).filter(function(a){return null!=a}),0==e.messages.length&&delete b.__messagesDomain[a]),console.log("End of uninstall messages on domain ["+a+"].")},b.Components={},b.exposeComponents=function(a){Object.keys(b.Components).forEach(function(c){a[c]=b.Components[c]})},b.ComponentConstants={Text:"text",TextInJSON:{type:"text",label:!0,popover:!0,renderError:!0,delay:1e3},TextArea:"textarea",Select:"select",Check:"check",ArrayCheck:"acheck",Toggle:"toggle",Radio:"radio",Table:{type:"table",label:!1,popover:!1,renderError:!1},Tree:{type:"tree",label:!1,popover:!1,renderError:!1},SelectTree:"seltree",Date:"date",Search:"search",Button:{type:"button",label:!1,popover:!1,renderError:!1},Tab:{type:"tab",label:!1,popover:!1,renderError:!1},ArrayTab:{type:"atab",label:!1,popover:!1,renderError:!1},Panel:{type:"panel",label:!1,popover:!1,renderError:!1},ArrayPanel:{type:"apanel",label:!1,popover:!1,renderError:!1},Label:{type:"label",label:!1},Form:{type:"form",label:!1,popover:!1,renderError:!1},ButtonFooter:{type:"buttonfooter",label:!1,popover:!1,renderError:!1},File:"file",Nothing:{type:"nothing",label:!1},Default_Date_Format:"YYYY/MM/DD HH:mm:ss.SSS",CODETABLE_PARENT_VALUE_KEY:"value",CODETABLE_SENDER_PROXY:null,CODETABLE_RECEIVER_PROXY:null,CODETABLE_REMOTE_PROXY:null,ERROR_POPOVER:!0,Err_Unsupported_Component:"PT-00001",Err_Unuspported_Column_Sort:"PT-00002",Err_Search_Text_Trigger_Digits_Not_Defined:"PT-00003",Err_Tab_Index_Out_Of_Bound:"PT-00004",Err_Incorrect_Messages_Format:"PT-00005",Http_Status:{0:"Browser Error",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Application Exception"}},b.parseJSON=function(a){return null==a?null:"string"==typeof a?JSON.parse(a):a},b.isVisibleOnAuth=function(a){return!0},b.markFuncAsWrap=function(a){return a&&(a.wrap=!0),a},function(){"use strict";function c(b){void 0===b&&(b=a.navigator.userAgent),b=b.toLowerCase();var c=/(edge)\/([\w.]+)/.exec(b)||/(opr)[\/]([\w.]+)/.exec(b)||/(chrome)[ \/]([\w.]+)/.exec(b)||/(iemobile)[\/]([\w.]+)/.exec(b)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(b)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(b)||/(webkit)[ \/]([\w.]+)/.exec(b)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(b)||/(msie) ([\w.]+)/.exec(b)||b.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(b)||b.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(b)||[],d=/(ipad)/.exec(b)||/(ipod)/.exec(b)||/(windows phone)/.exec(b)||/(iphone)/.exec(b)||/(kindle)/.exec(b)||/(silk)/.exec(b)||/(android)/.exec(b)||/(win)/.exec(b)||/(mac)/.exec(b)||/(linux)/.exec(b)||/(cros)/.exec(b)||/(playbook)/.exec(b)||/(bb)/.exec(b)||/(blackberry)/.exec(b)||[],e={},f={browser:c[5]||c[3]||c[1]||"",version:c[2]||c[4]||"0",versionNumber:c[4]||c[2]||"0",platform:d[0]||""};if(f.browser&&(e[f.browser]=!0,e.version=f.version,e.versionNumber=parseInt(f.versionNumber,10)),f.platform&&(e[f.platform]=!0),(e.android||e.bb||e.blackberry||e.ipad||e.iphone||e.ipod||e.kindle||e.playbook||e.silk||e["windows phone"])&&(e.mobile=!0),(e.cros||e.mac||e.linux||e.win)&&(e.desktop=!0),(e.chrome||e.opr||e.safari)&&(e.webkit=!0),e.rv||e.iemobile){var g="msie";f.browser=g,e[g]=!0}if(e.edge){delete e.edge;var h="msedge";f.browser=h,e[h]=!0}if(e.safari&&e.blackberry){var i="blackberry";f.browser=i,e[i]=!0}if(e.safari&&e.playbook){var j="playbook";f.browser=j,e[j]=!0}if(e.bb){var k="blackberry";f.browser=k,e[k]=!0}if(e.opr){var l="opera";f.browser=l,e[l]=!0}if(e.safari&&e.android){var m="android";f.browser=m,e[m]=!0}if(e.safari&&e.kindle){var n="kindle";f.browser=n,e[n]=!0}if(e.safari&&e.silk){var o="silk";f.browser=o,e[o]=!0}return e.name=f.browser,e.platform=f.platform,e}a.jQBrowser=c(a.navigator.userAgent),a.jQBrowser.uaMatch=c,b.browser=a.jQBrowser}();var h=a;b.getService=function(a,b){var c=a||h,d=b||"$service";return c[d]||(c[d]={}),c[d]}}(window),function(a,b,c){var d=a.$pt;null==d&&(d={},a.$pt=d),d.AjaxConstants={ContentType:{POST:"application/json; charset=UTF-8",GET:"application/json; charset=UTF-8",DELETE:"application/json; charset=UTF-8",PUT:"application/json; charset=UTF-8"},Stringify:{POST:!0,GET:!1,DELETE:!1,PUT:!0}};var e=function(a){var c=a.url,e=a.done,f=a.fail,g=a.quiet;delete a.url,delete a.done,delete a.fail,!0===g||d.Components.NOnRequestModal.getOnRequestModal().show();var h=function(){!0===g||d.Components.NOnRequestModal.getOnRequestModal().hide()};return b.ajax(c,a).done(function(a,b,c){if(void 0!==e&&null!==e)try{e(a,b,c)}catch(g){console.error(g),console.error(a),console.error(b),console.error(c);var f="Unknown error occurred, see console for more information.";f=g?g.stack?g.stack:g.toString?g.toString():f:f,d.Components.NExceptionModal.getExceptionModal().show("Javascript Error",f)}}).fail(function(a,b,c){if(void 0!==f&&null!==f){var e=null;if(null!=(e="function"==typeof f?f:f[""+a.status]))try{e(a,b,c)}catch(h){console.error(h),console.error(data),console.error(b),console.error(a);var g="Unknown error occurred, see console for more information.";g=h?h.stack?h.stack:h.toString?h.toString():g:g,d.Components.NExceptionModal.getExceptionModal().show("Javascript Error",g)}else d.Components.NExceptionModal.getExceptionModal().show(""+a.status,a.responseText)}else d.Components.NExceptionModal.getExceptionModal().show(""+a.status,a.responseText)}).always(function(){h()})},f=function(a,b){return!0===b||!1!==b&&!0===a};d.internalDoPost=d.doPost=function(a,c,g){return g=g||{},f(d.AjaxConstants.Stringify.POST,g.stringify)&&(c="string"==typeof c?c:JSON.stringify(c)),e(b.extend({method:"POST",dataType:"json",contentType:d.AjaxConstants.ContentType.POST},g,{url:a,data:c}))},d.doPut=function(a,c,g){return g=g||{},f(d.AjaxConstants.Stringify.PUT,g.stringify)&&(c="string"==typeof c?c:JSON.stringify(c)),e(b.extend({method:"PUT",dataType:"json",contentType:d.AjaxConstants.ContentType.PUT},g,{url:a,data:c}))},d.doGet=function(a,c,g){return g=g||{},f(d.AjaxConstants.Stringify.GET,g.stringify)&&(c="string"==typeof c?c:JSON.stringify(c)),e(b.extend({method:"GET",dataType:"json",contentType:d.AjaxConstants.ContentType.GET},g,{url:a,data:c}))},d.doDelete=function(a,c,g){return g=g||{},f(d.AjaxConstants.Stringify.DELETE,g.stringify)&&(c="string"==typeof c?c:JSON.stringify(c)),e(b.extend({method:"DELETE",dataType:"json",contentType:d.AjaxConstants.ContentType.DELETE},g,{url:a,data:c}))},d.relocatePage=function(c,d){var e=c;d&&(-1!=e.indexOf("?")?e+="&"+b.param(d):e+="?"+b.param(d)),a.location=e},d.getUrlData=function(c){var d="";if(void 0!==c){if(null==c||c.isBlank())return{};d=c}else{if(null==(d=a.location.search)||d.isBlank()||"?"==d.trim())return{};d=d.substring(1)}return b.deparam(d)},d.mock=function(){b.mockjax&&b.mockjax.apply(b,arguments)};var g={context:"",urls:{}};d.routes=g,d.defineWebContext=function(a){return g.context=a,d},d.defineURL=function(b,c){return null!=g.urls[b]&&a.console.warn("URL["+b+"="+g.urls[b]+"] was replaced by ["+g.context+c+"]"),g.urls[b]=c,d},d.getURL=function(a){var b=g.urls[a];return null==b?null:g.context+b}}(window,jQuery,jQuery.deparam),function(a,b,c){var d=a.$pt;null==d&&(d={},a.$pt=d);var e=c.Class({constructor:function(a){this._otherId=a},sort:function(a){var b=this;a.sort(function(a,c){if(b._otherId){if(a.id==b._otherId)return 1;if(c.id==b._otherId)return-1}return a.text<c.text?-1:a.text>c.text?1:0})}}),f=c.Class({constructor:function(a,b,c){null==a||Array.isArray(a)?(this._local=!0,this._initArray=a):(this._local=!1,this._url=a.url,this._postData=a.data,this._sendProxy=a.proxy,this._receiveProxy=a.receiver),this._renderer=b,this._sorter=c},isInitialized:function(){return!0===this._initialized},isRemote:function(){return!1===this._local},isRemoteButNotInitialized:function(){return this.isRemote()&&!this.isInitialized()},initializeRemote:function(){return this.isRemoteButNotInitialized()?(this._loading||(this._loading=this.__loadRemoteCodes(!0).always(function(){delete this._loading,this._allLoaded=!0}.bind(this))),this._loading):b.Deferred(function(a){a.resolve()}).promise()},setAsRemoteInitialized:function(){return this._codes=this._codes?this._codes:[],this._map=this._map?this._map:{},this._initialized=!0,this},getRenderer:function(){return this._renderer},__initCodesArray:function(a,b,c){this._codes=a,null==this._codes&&(this._codes=[]);var d={},e=function(a){b&&(a.text=b(a),a.children&&a.children.forEach(e))};if(this._codes.forEach(function(a){d[a.id]=a,e(a)}),this._map=d,c){var f=function(a){c.sort(a),a.forEach(function(a){a.children&&f(a.children)})};f(this._codes)}return this},__loadRemoteCodes:function(b){var c=this,e=this.__getSendProxy();return(e?e.call(this,{url:this._url,data:this._postData,quiet:!0,async:null!=b&&b}):d.doPost(this._url,this._postData,{quiet:!0,async:null!=b&&b})).done(function(a){var b=a,d=c.__getReceiveProxy();d&&(b=d.call(c,b)),c.__initCodesArray(b,c._renderer,c._sorter)}).fail(function(b,d,e){c.__initCodesArray(null,c._renderer,c._sorter),a.console.error("Status:"+d+", error:"+e)}).always(function(){c._initialized=!0})},__getSendProxy:function(){return this._sendProxy||d.ComponentConstants.CODETABLE_SENDER_PROXY||d.ComponentConstants.CODETABLE_REMOTE_PROXY},__getReceiveProxy:function(){return this._receiveProxy||d.ComponentConstants.CODETABLE_RECEIVER_PROXY},__getCodes:function(){return void 0!==this._codes&&!0===this._initialized||(this._local?(this.__initCodesArray(this._initArray,this._renderer,this._sorter),delete this._initArray,this._initialized=!0):this.__loadRemoteCodes()),this._codes},__getMap:function(){return this.__getCodes(),this._map},filter:function(a){if("function"==typeof a)return this.__getCodes().filter(a);var b=a.value;return this.__loadRemoteCodeSegment(b),this.__getCodes().filter(function(c){return this.__setParentValueAsLoaded(c[a.name]),c[a.name]==b}.bind(this))},isSegmentLoaded:function(a){return!this.__needLoadFromRemote(a)},loadRemoteCodeSegment:function(a){if(this.__needLoadFromRemote(a)){this.__rebuildPostData(a);var c=this.__holdExistedCodes();return this.__loadRemoteCodes(!0).done(function(){this.__setParentValueAsLoaded(a)}.bind(this)).always(function(){this.__mergeAll(c)}.bind(this))}return b.Deferred(function(a){a.resolve()}).promise()},__needLoadFromRemote:function(a){return!(this._local||this._allLoaded||this._loadedKeys&&!0===this._loadedKeys[a+""])},__rebuildPostData:function(a){var c={};return c[this.parentValueKey()]=a,this._postData?this._postData=b.extend({},this._postData,c):this._postData=c,this},__holdExistedCodes:function(){return{codes:null!=this._codes?this._codes:[],map:null!=this._map?this._map:{}}},__mergeAll:function(a){return this._codes.push.apply(this._codes,a.codes),this._map=b.extend(a.map,this._map),this},__setParentValueAsLoaded:function(a){return this._loadedKeys||(this._loadedKeys={}),this._loadedKeys[a+""]=!0,this},__loadRemoteCodeSegment:function(a){if(this.__needLoadFromRemote(a)){this.__rebuildPostData(a);var b=this.__holdExistedCodes();this.__loadRemoteCodes(),this.__setParentValueAsLoaded(a),this.__mergeAll(b)}return this},get:function(a){var b=this.__getMap()[a];return null==b?null:b},getText:function(a){var b=this.get(a);return null==b?null:b.text},list:function(){return this.__getCodes()},listAllChildren:function(){var a={},b=function(c){a[c.id]=c,c.children&&c.children.forEach(function(a){b(a)})};return this.list().forEach(function(a){b(a)}),a},listWithHierarchyKeys:function(a){var b=a&&a.separator?a.separator:"|",c=a&&null!=a.rootId?a.rootId:"0",d={},e=function(a,c){d[c+b+a.id]=a,a.children&&a.children.forEach(function(d){e(d,c+b+a.id)})};return this.list().forEach(function(a){e(a,c)}),d},some:function(a){return this.__getCodes().some(a)},map:function(a){return this.__getCodes().map(a)},name:function(a){return a?(this.__name=a,this):this.__name},parentValueKey:function(a){return a?(this.__parentValueKey=a,this):this.__parentValueKey?this.__parentValueKey:d.ComponentConstants.CODETABLE_PARENT_VALUE_KEY}});d.createDefaultCodeTableSorter=function(a){return new e(a)},d.createCodeTable=function(a,b,c){return new f(a,b,c)},d.extendCodeTable=function(a){return c.Class(f,a)}}(window,jQuery,jsface),function(a,b,c,d){var e=a.$pt;null==e&&(e={},a.$pt=e),e.BUILD_PROPERTY_VISITOR=!0,e.PROPERTY_SEPARATOR="_",e.cloneJSON=function(a){return b.extend(!0,{},a)},e.mergeObject=function(a){var c,d,f,g,h,i,j=a.deep,k=a.target?a.target:{},l=Array.isArray(a.sources)?a.sources:[a.sources],m=0,n=l.length;for("object"==typeof k||b.isFunction(k)||(k={});m<n;m++)if(null!=(c=l[m]))for(d in c)f=k[d],g=c[d],k!==g&&(j&&g&&(b.isPlainObject(g)||(h=b.isArray(g)))?(h?(h=!1,i=[]):i=f&&b.isPlainObject(f)?f:{},k[d]=e.mergeObject({deep:j,target:i,sources:[g]})):void 0!==g&&(k[d]=g));return k},e.getValueFromJSON=function(a,b){if(-1!=b.indexOf(e.PROPERTY_SEPARATOR)){var c=b.split(e.PROPERTY_SEPARATOR),d=a,f=null,g=c.map(function(a){return null==d?null:(f=d[a],d=f,f)});return g[g.length-1]}return a[b]},e.setValueIntoJSON=function(a,b,c){if(-1==b.indexOf(e.PROPERTY_SEPARATOR))a[b]=c;else{for(var d=b.split(e.PROPERTY_SEPARATOR),f=a,g=0,h=d.length-1;g<h;g++)null==f[d[g]]&&(f[d[g]]={}),f=f[d[g]];f[d[d.length-1]]=c}return e};var f=d.Class({constructor:function(){this.__errors={},this.__models={},this.__startKeyIndex=1},push:function(a,b){return this.__errors[this.__startKeyIndex]=b,this.__models[this.__startKeyIndex]=a,this.__startKeyIndex++,this},remove:function(a){var b=this;return Object.keys(this.__models).forEach(function(c){b.__models[c]==a&&(delete b.__models[c],delete b.__errors[c])}),this},hasError:function(){return 0!==Object.keys(this.__models).length},getError:function(a){var b=Object.keys(this.__models).map(function(b){return this.__models[b]==a?this.__errors[b]:null}.bind(this)).filter(function(a){return null!=a});return 0===b.length?null:b[0]}});e.createTableValidationResult=function(){return new f},e.defineMessage("validate.required",'"%1" is Required.'),e.defineMessage("validate.length",'Length of "%1" should be %2.'),e.defineMessage("validate.length.max",'Length of "%1" cannot be more than %2.'),e.defineMessage("validate.length.min",'Length of "%1" cannot be less than %2.'),e.defineMessage("validate.size.max",'Size of "%1" cannot be more than %2.'),e.defineMessage("validate.size.min",'Size of "%1" cannot be less than %2.'),e.defineMessage("validate.date.before",'Value of "%1" must be before than %2.'),e.defineMessage("validate.date.after",'Value of "%1" must be after than %2.'),e.ValidateRules={required:function(a,b,c){return!1===c||(null!=b&&!(b+"").toString().isEmpty()||e.getMessage("validate.required"))},length:function(a,b,c){return null==b||0==(b+"").length||((b+"").length!=c?e.getMessage("validate.length").format(["%1",""+c]):void 0)},maxlength:function(a,b,c){return null==b||0==(b+"").length||((b+"").length>c?e.getMessage("validate.length.max").format(["%1",""+c]):void 0)},minlength:function(a,b,c){return null==b||0==(b+"").length||((b+"").length<c?e.getMessage("validate.length.min").format(["%1",""+c]):void 0)},maxsize:function(a,b,c){return null==b||0==b.length||(b.length>c?e.getMessage("validate.size.max").format(["%1",""+c]):void 0)},minsize:function(a,b,c){return!(null==b||b.length<c)||e.getMessage("validate.size.min").format(["%1",""+c])},before:function(a,b,c){return e.ValidateRules.__dateCompare(b,a,c,e.ValidateRules.__beforeSpecial)},__beforeSpecial:function(a,b,c,d,f){var g=e.ValidateRules.__convertToMomentValue(c,b,d);return!(null!==g&&a.unix()>g.unix())||("string"==typeof c?e.getMessage("validate.date.before").format(["%1",f||c]):e.getMessage("validate.date.before").format(["%1",g.format(d)]))},after:function(a,b,c){return e.ValidateRules.__dateCompare(b,a,c,e.ValidateRules.__afterSpecial)},__afterSpecial:function(a,b,c,d,f){var g=e.ValidateRules.__convertToMomentValue(c,b,d);return!(null!==g&&a.unix()<g.unix())||("string"==typeof c?e.getMessage("validate.date.after").format(["%1",f||c]):e.getMessage("validate.date.after").format(["%1",g.format(d)]))},__convertToMomentValue:function(a,b,d){var e=null;return"now"===a?e=c():void 0!==a.unix?e=a:"function"==typeof a?e=a():void 0!==b.get(a)?null!==b.get(a)&&(e=c(b.get(a),d)):e=c(a,d),e},__dateCompare:function(a,b,d,f){if(null==a)return!0;var g="string"==typeof d.format?d.format:e.ComponentConstants.Default_Date_Format,h=d.rule?d.rule:d,i=d.rule?d.label:null,j=c(a,g),k=[];if(Array.isArray(h))for(var l=0,m=h.length;l<m;l++){var n=h[l],o=i?i[l]:null;k.push(f(j,b,n,g,o))}else k.push(f(j,b,h,g,i));var p=k.filter(function(a){return!0!==a});return 0===p.length||(1==p.length?p[0]:p)},table:function(a,b,c,d){if(null==b||0==b.length)return!0;var f=e.createTableValidationResult(),g=e.createModelValidator(c);return b.forEach(function(b){var c=e.createModel(b,g);c.useBaseAsCurrent(),c.parent(a),d?c.validateByPhase(d):c.validate();var h=c.getError();0!==Object.keys(h).length?f.push(b,h):f.remove(b)}),!f.hasError()||f}};var g=d.Class({constructor:function(a,c){Array.isArray(a)?(this.__validator={},b.extend.apply(b,[!0,this.__validator].concat(a))):this.__validator=a,this.__rules=c,void 0===this.__rules?this.__rules=e.ValidateRules:this.__rules=b.extend(!0,e.ValidateRules,c)},getConfig:function(a){return a?this.__validator[a]:this.__validator},getRule:function(a){return this.__rules[a]},_validateByPhase:function(a,b,c,d,e,f){var g=null;if("function"==typeof e)g=e.call(this,a,b,d,f);else{if(Array.isArray(e)){var h=this,i=e.map(function(e){return h._validateByPhase(a,b,c,d,e,f)}),j=[];return i.forEach(function(a){null!=a&&(Array.isArray(a)?a.forEach(function(a){j.push(a)}):j.push(a))}),j}var k=e,l=!0;if(null!=d&&e._phase)if(k=e.rule,Array.isArray(e._phase)){var m=e._phase.some(function(a){return a==d});m||(l=!1)}else e._phase!=d&&(l=!1);else e._phase&&(k=e.rule);if(l&&e._when){k=e.rule;e._when.call(this,a)||(l=!1)}l&&(g="function"==typeof k?k.call(this,a,b,d,f):this.getRule(c).call(this,a,b,k,d,f))}return g},validateByPhase:function(a,b,c){var d=this,e=null;if(c){var f=this.getConfig(c);if(null==f)return!0;e=Object.keys(f).map(function(e){var g=f[e],h=a.get(c),i=d._validateByPhase(a,h,e,b,g,c);return null!=i&&!0!==i?i:null});var g=[];return e.forEach(function(a){null!=a&&(Array.isArray(a)?a.forEach(function(a){g.push(a)}):g.push(a))}),0===g.length||g}return e={},Object.keys(this.getConfig()).forEach(function(c){var f=d.validateByPhase(a,b,c);!0!==f&&(e[c]=f)}),e},validate:function(a,b){return this.validateByPhase(a,null,b)},isRequired:function(a,b){var c=this.getConfig(a);if(null==c||null==c.required)return!1;if(!0===c.required)return!0;if(null==b)return!1;var d=Array.isArray(b)?b:[b],e=Array.isArray(c.required)?c.required:[c.required];return d.some(function(a){return e.some(function(b){return-1!=(Array.isArray(b._phase)?b._phase:[b._phase]).indexOf(a)&&!0===b.rule})})}});e.createModelValidator=function(a,b){return new g(a,b)};var h={constructor:function(a,b){this.__base=a,this.__model=e.mergeObject({deep:!0,sources:a}),this.__validator=b,this.__validateResults={},this.__changed=!1},name:function(a){return a?(this.__name=a,this):this.__name},parent:function(a){return void 0!==a?(this.__parent=a,this):this.__parent},isChanged:function(){return this.__changed},getOriginalModel:function(){return this.__base},getCurrentModel:function(){return this.__model},useBaseAsCurrent:function(){return this.__model=this.__base,this},mergeCurrentModel:function(a){return this.__model=e.mergeObject({deep:!0,target:this.__model,sources:a}),this},applyCurrentToBase:function(){return this.__base=e.mergeObject({deep:!0,target:{},sources:this.__model}),this.__changed=!1,this},getValidator:function(){return this.__validator},setValidator:function(a,b){return this.__validator=a,b&&(this.__validateResults={}),this},get:function(a){return e.getValueFromJSON(this.__model,a)},set:function(a,b){var c=this.get(a);if(typeof c!=typeof b||c!=b)return e.setValueIntoJSON(this.__model,a,b),this.__changed=!0,this.fireEvent({model:this,id:a,old:c,new:b,time:"post",type:"change"}),this},addListener:function(a,b,c,d){return a||(a="--all"),a instanceof RegExp?this.__addRegExpListener(a,b,c,d):this.__addListener(a,b,c,d)},__addRegExpListener:function(a,b,c,d){void 0===this.__regExpListeners&&(this.__regExpListeners={});var e=b+"-"+c,f=this.__regExpListeners[e];return void 0===f&&(f=[],this.__regExpListeners[e]=f),-1==f.findIndex(function(b){return b.listener===d&&b.regexp.toString()==a.toString()})&&f.push({regexp:a,listener:d}),this},__addListener:function(a,b,c,d){void 0===this.__listeners&&(this.__listeners={});var e=a+"-"+b+"-"+c,f=this.__listeners[e];return void 0===f&&(f=[],this.__listeners[e]=f),-1==f.findIndex(function(a){return a===d})&&f.push(d),this},addPostChangeListener:function(a,b){return this.addListener(a,"post","change",b)},addPostAddListener:function(a,b){return this.addListener(a,"post","add",b)},addPostRemoveListener:function(a,b){return this.addListener(a,"post","remove",b)},addPostValidateListener:function(a,b){return this.addListener(a,"post","validate",b)},removeListener:function(a,b,c,d){return a||(a="--all"),a instanceof RegExp?this.__removeRegExpListener(a,b,c,d):this.__removeListener(a,b,c,d)},__removeRegExpListener:function(a,b,c,d){if(void 0!==this.__regExpListeners){var e=this.__regExpListeners[b+"-"+c];if(null!=e){var f=e.findIndex(function(b){return b.listener===d&&b.regexp.toString()==a.toString()});-1!=f&&e.splice(f,1)}}return this},__removeListener:function(a,b,c,d){if(void 0!==this.__listeners){var e=this.__listeners[a+"-"+b+"-"+c];if(null!=e){var f=e.findIndex(function(a){return a===d});-1!=f&&e.splice(f,1)}}return this},removePostChangeListener:function(a,b){return this.removeListener(a,"post","change",b)},removePostAddListener:function(a,b){return this.removeListener(a,"post","add",b)},removePostRemoveListener:function(a,b){return this.removeListener(a,"post","remove",b)},removePostValidateListener:function(a,b){return this.removeListener(a,"post","validate",b)},fireEvent:function(a){var b=[],c=a.id+"-"+a.time+"-"+a.type,d=this.__listeners?this.__listeners[c]:null;null!=d&&0!=d.length&&b.push.apply(b,d),c="--all-"+a.time+"-"+a.type,d=this.__listeners?this.__listeners[c]:null,null!=d&&0!=d.length&&b.push.apply(b,d),c=a.time+"-"+a.type,null!=(d=this.__regExpListeners?this.__regExpListeners[c]:null)&&0!=d.length&&d.forEach(function(c){a.id.match(c.regexp)&&b.push.apply(b,[c.listener])});var e=this;return b.forEach(function(b){b.call(e,a)}),this},firePostChangeEvent:function(a,b,c){return this.fireEvent({model:this,id:a,old:b,new:c||this.get(a),time:"post",type:"change"})},firePostAddEvent:function(a,b){var c=this.get(a);return this.fireEvent({model:this,id:a,array:c,index:b,old:null,new:c[b],type:"add",time:"post"})},firePostRemoveEvent:function(a,b,c){return this.fireEvent({model:this,id:a,array:this.get(a),index:c,old:b,new:null,type:"remove",time:"post"})},firePostValidateEvent:function(a){return this.fireEvent({model:this,id:a,time:"post",type:"validate"})},reset:function(){return this.__model=e.mergeObject({deep:!0,sources:this.__base}),this.__validateResults={},this.__changed=!1,this},clearValidateResults:function(a){return a?delete this.__validateResults[a]:this.__validateResults={},this},validateByPhase:function(a,b){var c=this.getValidator();if(void 0===c||null===c)return this;if(b){var d=c.validateByPhase(this,a,b);!0!==d?this.__validateResults[b]=d:delete this.__validateResults[b],this.__mergeErrorToParent().fireEvent({model:this,id:b,time:"post",type:"validate"})}else{this.__validateResults=c.validateByPhase(this,a),this.__mergeErrorToParent();var e=this;Object.keys(this.__validateResults?this.__validateResults:{}).forEach(function(a){e.fireEvent({model:e,id:a,time:"post",type:"validate"})})}return this},__mergeErrorToParent:function(){if(null==this.__parent)return this;var a=this.__parent.getCurrentModel();return Object.keys(a).forEach(function(b){var c=a[b];c==this.__model?this.__parent.mergeError(this.hasError()?this.getError():null,b):Array.isArray(c)&&c.forEach(function(a){if(a==this.__model){var c=this.__parent.getError(b),d=c?c.findIndex(function(a){return"string"!=typeof a}):-1;if(this.hasError()){var f=null;-1==d?(f=e.createTableValidationResult(),c||(c=[]),c.push(f)):(f=c[d],f.remove(a)),f.push(a,this.__validateResults),this.__parent.mergeError(c,b)}else-1!=d&&c[d].remove(a)}}.bind(this))}.bind(this)),this.__parent.__mergeErrorToParent(),this},validate:function(a){return this.validateByPhase(null,a)},isRequired:function(a,b){var c=this.getValidator();return null!=c&&c.isRequired(a,b)},getError:function(a){return a?this.__validateResults[a]:this.__validateResults},hasError:function(a){return a?null!=this.__validateResults[a]:0!=Object.keys(this.__validateResults).length},mergeError:function(a,b){return b?a?this.__validateResults[b]=a:delete this.__validateResults[b]:this.__validateResults=a||{},this},remove:function(a,b){var c=this.get(a);if(null==c||0==c.length)return this
;var d=c.findIndex(function(a){return a===b});return-1!=d&&(c.splice(d,1),this.__changed=!0,this.fireEvent({model:this,id:a,array:c,index:d,old:b,new:null,type:"remove",time:"post"})),this},add:function(a,b,c){var d=this.get(a);return null==d&&(d=[],this.__model[a]=d),-1==d.findIndex(function(a){return a===b})&&(null==c?(d.push(b),c=d.length-1):(c>=d.length&&(c=d.length),d.splice(c,0,b)),this.__changed=!0,this.fireEvent({model:this,id:a,array:d,index:c,old:null,new:b,type:"add",time:"post"})),this},update:function(a,b,c){var d=this.get(a);if(null==d)return this;var e=d.findIndex(function(a){return a===b});return-1!=e&&(d.splice(e,1,c),this.__changed=!0,this.fireEvent({model:this,id:a,array:d,index:e,old:b,new:c,type:"change",time:"post"})),this}};e.createModel=function(a,c){var f=null;Array.isArray(a)?(f={},b.extend.apply(b,[!0,f].concat(a))):f=null==a?{}:a;var g={};return e.BUILD_PROPERTY_VISITOR&&Object.keys(f).forEach(function(a){var b=a.upperFirst();g["get"+b]=function(){return this.get(a)},g["set"+b]=function(b){this.set(a,b)}}),new(d.Class(b.extend(g,h)))(f,c)}}(window,jQuery,moment,jsface),function(a,b,c,d){var e=a.$pt;null==e&&(e={},a.$pt=e);var f=c.Class({$static:{DEFAULT_POSITION:{},DEFAULT_ROW:9999,DEFAULT_COLUMN:9999,DEFAULT_WIDTH:3,DEFAULT_COMPONENT:{type:e.ComponentConstants.Text}},constructor:function(a,b){this.__id=a,b.base&&(b=Array.isArray(b.base)?e.mergeObject({deep:!0,target:{},sources:b.base.concat(b)}):e.mergeObject({deep:!0,target:{},sources:[b.base,b]})),this.__dataId=b.dataId?b.dataId:this.__id,this.__cell=b},unwrapValueWhenIsAFunc:function(a,b,c){return"function"==typeof a&&(b||!0===a.wrap)?a.call(c||this):a},getDefinition:function(){return this.__cell},getId:function(){return this.__id},getDataId:function(){return this.__dataId},getPosition:function(){return this.__cell.pos?this.__cell.pos:f.DEFAULT_POSITION},getRowIndex:function(){var a=this.getPosition().row;return null==a?f.DEFAULT_ROW:a},getColumnIndex:function(){var a=this.getPosition().col;return null==a?f.DEFAULT_COLUMN:a},getWidth:function(){var a=this.getPosition().width;return null==a?f.DEFAULT_WIDTH:a},getSection:function(){var a=this.getPosition().section;return null!=a?a:h.DEFAULT_KEY},getCard:function(){var a=this.getPosition().card;return null!=a?a:i.DEFAULT_KEY},getComponentType:function(){var a=this.getComponentOption("type");return a=null==a?e.ComponentConstants.TextInJSON:a,"string"==typeof a?{type:a,label:!0,popover:!0}:a},getComponentOption:function(a,b,c){if(a){if(void 0===b&&(b=null),this.__cell.comp){var d=this.__cell.comp[a];return d=this.unwrapValueWhenIsAFunc(d,!1,c),void 0===d?b:d}return b}return this.__cell.comp?this.__cell.comp:{}},getLabel:function(a){return this.unwrapValueWhenIsAFunc(this.__cell.label,!0,a)},getLabelCSS:function(a){return this.getAdditionalCSS("label",a)},getCellCSS:function(a){return this.getAdditionalCSS("cell",a)},getComponentCSS:function(a){return this.getAdditionalCSS("comp",a)},isAdditionalCSSDefined:function(a){return a?null!=this.__cell.css&&null!=this.__cell.css[a]:null!=this.__cell.css},getAdditionalCSS:function(a,b){if(a){var c=this.isAdditionalCSSDefined(a)?this.__cell.css[a]:"",d=c?c.split(" "):[],f={};return d.forEach(function(a){a&&!a.isBlank()&&(f[a.trim()]=!0)}),null==b||b.isBlank()||(f[b.trim()]=!0),e.LayoutHelper.classSet(f)}return this.isAdditionalCSSDefined()?this.__cell.css:{}},getEventMonitor:function(a){if(!a)return this.__cell.evt?this.__cell.evt:{};if(!this.__cell||!this.__cell.evt)return null;var b=this.__cell.evt[a];if(b)return b;var c=Object.keys(this.__cell.evt).find(function(b){return b.toLowerCase()===a.toLowerCase()});return c?this.__cell.evt[c]:void 0},getValidationPhase:function(){return this.__cell&&this.__cell.validate?this.transformValidationPhase(this.__cell.validate):null},transformValidationPhase:function(a){return null==a||"string"==typeof a||"function"==typeof a?a:a.phase?this.transformValidationPhase(a.phase):null},getValidationOption:function(a,b){if("phase"===a)return this.getValidationPhase();if(this.__cell&&this.__cell.validate){var c=this.__cell.validate;return"string"==typeof c||"function"==typeof c?b:void 0===c[a]?b:c[a]}return b}});e.createCellLayout=function(a,b){return new f(a,b)};var g=c.Class({constructor:function(a){this.__rowIndex=a},getRowIndex:function(){return this.__rowIndex},addCell:function(a){void 0===this.__cells&&(this.__cells=[]);var b=this.__cells.findIndex(function(b){return b.getId()==a.getId()});return-1==b?this.__cells.push(a):this.__cells.splice(b,1,a),this.__cells.sort(function(a,b){return a.getColumnIndex()-b.getColumnIndex()}),this},getCells:function(){return this.__cells}});e.createRowLayout=function(a,b){var c=new g(a);return b&&(Array.isArray(b)?b.forEach(function(a){c.addCell(a)}):c.addCell(b)),c};var h=c.Class({$static:{DEFAULT_KEY:"_defaultSection",DEFAULT_ROW_INDEX:9999,DEFAULT_COLUMN_INDEX:9999,DEFAULT_WIDTH:12},constructor:function(a,b,c){this.__layout={};var d=this;null==a&&(a={}),Object.keys(a).forEach(function(b){"layout"!=b&&(d.__layout[b]=a[b])}),this.__id=b,this.__parent=c,this.__all={},this.__rows={};var e=a.layout;e&&Object.keys(e).forEach(function(a){e[a].getCellCSS?d.addCell(e[a]):d.addCell(new f(a,e[a]))})},hasCell:function(){return 0!=Object.keys(this.__all).length},addCell:function(a){this.__all[a.getId()]=a;var b=a.getRowIndex(),c=this.__rows[b];return void 0===c&&(c=e.createRowLayout(b),this.__rows[b]=c),c.addCell(a),this.__sortRows(),this},__sortRows:function(){this.__rowsArray=[];var a=this.__rowsArray,b=this.__rows;Object.keys(b).forEach(function(c){a.push(b[c])}),a.sort(function(a,b){return a.getRowIndex()-b.getRowIndex()})},getRowIndex:function(){return null==this.__layout||null==this.__layout.row?h.DEFAULT_ROW_INDEX:this.__layout.row},getColumnIndex:function(){return null==this.__layout||null==this.__layout.col?h.DEFAULT_COLUMN_INDEX:this.__layout.col},getWidth:function(){return null==this.__layout||null==this.__layout.width?h.DEFAULT_WIDTH:this.__layout.width},getStyle:function(){return null==this.__layout||null==this.__layout.style?"default":this.__layout.style},getCSS:function(){return null==this.__layout||null==this.__layout.css?null:this.__layout.css},getLabel:function(){return null==this.__layout||null==this.__layout.label?null:this.__layout.label},isCollapsible:function(){return null!=this.__layout&&null!=this.__layout.collapsible&&!0===this.__layout.collapsible},getCollapsedLabel:function(){return null!=this.__layout&&null!=this.__layout.collapsedLabel&&this.__layout.collapsedLabel},isExpanded:function(){return null==this.__layout||null==this.__layout.expanded||!1!==this.__layout.expanded},getExpandedLabel:function(){return null==this.__layout||null==this.__layout.expandedLabel?null:this.__layout.expandedLabel},hasCheckInTitle:function(){return this.__layout&&null!=this.__layout.checkInTitle},getCheckInTitleValue:function(a){var b=this.getCheckInTitleDataId();return b?a.get(b):null},getCheckInTitleDataId:function(){if(!this.hasCheckInTitle())return null;var a=this.__layout.checkInTitle;return a?a.data:null},getCheckInTitleLabel:function(){if(!this.hasCheckInTitle())return null;var a=this.__layout.checkInTitle;return a?a.label:null},getCheckInTitleCollapsible:function(){if(!this.hasCheckInTitle())return null;var a=this.__layout.checkInTitle;return a?a.collapsible:null},getCheckInTitleOption:function(){if(!this.hasCheckInTitle())return null;var a=b.extend({},this.__layout.checkInTitle);return delete a.collapsible,delete a.label,delete a.data,a},getVisible:function(){return this.__layout.visible},getId:function(){return this.__id},getRows:function(){return this.__rowsArray},getCell:function(a){return this.__all[a]},getCells:function(){return this.__all},getParentCard:function(){return this.__parent}});e.createSectionLayout=function(a,b,c){return new h(a,b,c)};var i=c.Class({$static:{DEFAULT_KEY:"_defaultCard",DEFAULT_CARD_INDEX:9999},constructor:function(a,c){var d=this;this.__layout=b.extend({},a),this.__id=c,this.__all={},this.__sections={},this.__layout._sections&&Object.keys(this.__layout._sections).forEach(function(a){var c=e.createSectionLayout(d.__layout._sections[a],a,d);c.hasCell()&&(d.__sections[a]=c,b.extend(d.__all,c.getCells()),d.__sortSections())})},hasCell:function(){return 0!=Object.keys(this.__all).length},addCell:function(a){this.__all[a.getId()]=a;var b=a.getSection(),c=this.__sections[b];if(null==c){var d=this.__layout._sections?this.__layout._sections[b]:null;c=e.createSectionLayout(d,b,this),this.__sections[b]=c}return c.addCell(a),this.__sortSections(),this},__sortSections:function(){this.__sectionsArray=[];var a=this.__sectionsArray,b=this.__sections;Object.keys(b).forEach(function(c){a.push(b[c])}),a.sort(function(a,b){var c=a.getRowIndex(),d=b.getRowIndex();return c==d?a.getColumnIndex()-b.getColumnIndex():c-d})},getIndex:function(){return null==this.__layout.index?i.DEFAULT_CARD_INDEX:this.__layout.index},getLabel:function(){return this.__layout.label},getIcon:function(){return this.__layout.icon},hasBadge:function(){return null!=this.__layout.badge},getBadgeId:function(){return this.__layout.badge},getBadgeRender:function(){return this.__layout.badgeRender},getId:function(){return this.__id},isActive:function(){return!0===this.__layout.active},setActive:function(a){return this.__layout.active=a,this},isBackable:function(){return!1!==this.__layout.backable},getRightButtons:function(){return this.__layout.rightButtons?this.__layout.rightButtons:[]},getLeftButtons:function(){return this.__layout.leftButtons?this.__layout.leftButtons:[]},getFinishButton:function(){return this.__layout.finishButton},getSections:function(){return this.__sectionsArray},getCells:function(){return this.__all},getCell:function(a){return this.__all[a]}});e.createCardLayout=function(a,b){return new i(a,b)};var j=c.Class({constructor:function(a){this.__all={};var b=this.__mergeLayouts(a),c=this.__createDefaultCard(b);delete b._cards,delete b._freeCard,delete b._cardButtonShown,delete b._sections;var d=this.__readCells(b,c,this.__all);this.__sortCards(d)},__mergeLayouts:function(a){return 1==a.length?b.extend(!0,{},a[0]):b.extend.apply(b,[].concat(!0,{},a))},__createDefaultCard:function(a){var b=a._cards;return this.__freeCard=a._freeCard,this.__cardButtonShown=a._cardButtonShown,null==b&&(b={},b[i.DEFAULT_KEY]={_sections:{}},null==a._sections?b[i.DEFAULT_KEY]._sections[h.DEFAULT_KEY]={}:b[i.DEFAULT_KEY]._sections=a._sections),b},__readCells:function(a,c,d){var e={};return Object.keys(c).forEach(function(a){var f=new i(c[a],a);f.hasCell()&&(e[a]=f,b.extend(d,f.getCells()))}),Object.keys(a).forEach(function(b){var g=new f(b,a[b]);d[g.getId()]=g;var h=g.getCard(),j=e[h];if(null==j){var k=c[h];j=new i(k,h),e[h]=j}j.addCell(g)}),e},__sortCards:function(a){this.__cardsArray=[];var b=this.__cardsArray;Object.keys(a).forEach(function(c){b.push(a[c])}),this.__cardsArray.sort(function(a,b){return a.getIndex()-b.getIndex()})},getCards:function(){return this.__cardsArray},isFreeCard:function(){return!0===this.__freeCard},isCardButtonShown:function(){return!1!==this.__cardButtonShown},getCell:function(a){return this.__all[a]},getCells:function(){return this.__all}});e.createFormLayout=function(a){return new j(Array.prototype.slice.call(arguments))};var k=c.Class({constructor:function(a){this.__columns=a.slice(0)},columns:function(){return this.__columns},get:function(a){return this.__columns[a]},push:function(a){this.__columns.push(a)},splice:function(a,b,c){this.__columns.splice(a,b,c)},map:function(a){return this.__columns.map(a)},forEach:function(a){this.__columns.forEach(a)},length:function(){return this.__columns.length},some:function(a){return this.__columns.some(a)}});e.createTableColumnLayout=function(a){return new k(a)};var l={getInitialState:function(){return{}},executePointcutBefore:function(a){a&&a.before&&a.before.apply(this,Array.prototype.slice.call(arguments,1))},executePointcutAfter:function(a){a&&a.after&&a.after.apply(this,Array.prototype.slice.call(arguments,1))},installBaseMonitors:function(){if(this.executePointcutBefore.apply(this,arguments),this.addPostChangeListener(this.onModelChanged),this.isArrayData&&this.isArrayData()&&(this.addPostAddListener(this.onModelChanged),this.addPostRemoveListener(this.onModelChanged)),this.addPostValidateListener(this.onModelValidateChanged),this.getDependencyOptions){var a=this.getDependencyOptions();a&&this.addDependencyMonitor(this.getDependencies(a))}this.addEnableDependencyMonitor(),this.addVisibleDependencyMonitor(),this.registerToComponentCentral(),this.executePointcutAfter.apply(this,arguments)},uninstallBaseMonitors:function(){if(this.executePointcutBefore.apply(this,arguments),this.removePostChangeListener(this.onModelChanged),this.isArrayData&&this.isArrayData()&&(this.removePostAddListener(this.onModelChanged),this.removePostRemoveListener(this.onModelChanged)),this.removePostValidateListener(this.onModelValidateChanged),this.getDependencyOptions){var a=this.getDependencyOptions();a&&this.removeDependencyMonitor(this.getDependencies(a))}this.removeEnableDependencyMonitor(),this.removeVisibleDependencyMonitor(),this.unregisterFromComponentCentral(),this.executePointcutAfter.apply(this,arguments)},componentWillUpdate:function(a,b){this.uninstallBaseMonitors({before:this.beforeWillUpdate,after:this.afterWillUpdate},a,b)},componentDidUpdate:function(a,b){this.installBaseMonitors({before:this.beforeDidUpdate,after:this.afterDidUpdate},a,b)},componentDidMount:function(){this.installBaseMonitors({before:this.beforeDidMount,after:this.afterDidMount})},componentWillUnmount:function(){this.uninstallBaseMonitors({before:this.beforeWillUnmount,after:this.afterWillUnmount})},onModelChanged:function(){this.forceUpdate()},onModelValidateChanged:function(a){this.forceUpdate()},getModel:function(){return this.useFormModel()?this.getFormModel():this.getInnerModel()},useFormModel:function(){return!0===this.getComponentOption("useFormModel")},getFormModel:function(){return this.props.model},getInnerModel:function(){var a=this.getComponentOption("model");return a||this.getFormModel()},getValueFromModel:function(){return this.getModel().get(this.getDataId())},setValueToModel:function(a){this.getModel().set(this.getDataId(),a)},getLayout:function(){return this.props.layout},isViewMode:function(){var a=this.state?this.state.isViewMode:null;return null==a?!0===this.props.view||!0===this.getComponentOption("view"):a},setViewMode:function(a){this.setState({isViewMode:a})},renderInViewMode:function(){var a=e.LayoutHelper.getComponentViewModeRenderer(this.getLayout().getComponentType());if(a)return a.call(this,this.getModel(),this.getLayout(),this.props.direction,!0);var c=null;c=this.getTextInViewMode?this.getTextInViewMode():this.getValueFromModel();var f=e.createCellLayout(this.getId(),b.extend(!0,{},{comp:this.getComponentOption(),css:this.getAdditionalCSS("view")},{label:c,dataId:this.getDataId(),comp:{type:e.ComponentConstants.Label,textFromModel:!1}})),g=e.LayoutHelper.transformParameters(this.getModel(),f,this.props.direction,!0);return g.ref="viewLabel",d.createElement(e.Components.NLabel,g)},getId:function(){return this.getLayout().getId()},getDataId:function(){return this.getLayout().getDataId()},getComponentCSS:function(a){return this.getLayout().getComponentCSS(a)},getAdditionalCSS:function(a,b){return this.getLayout().getAdditionalCSS(a,b)},getComponentOption:function(a,b){var c=this.getLayout().getComponentOption(a,b,this);return null==c&&null!=this.props.defaultOptions&&(c=this.props.defaultOptions[a]),void 0===c?null:c},getComponentCentralId:function(){return this.getComponentOption("centralId")},registerToComponentCentral:function(){var a=this.getComponentCentralId();a&&e.LayoutHelper.registerComponent(a,this)},unregisterFromComponentCentral:function(){var a=this.getComponentCentralId();a&&e.LayoutHelper.unregisterComponent(a,this)},getEventMonitor:function(a){return this.getLayout().getEventMonitor(a)},notifyEvent:function(a){var b=a.type,c=this.getEventMonitor(b);c&&c.call(this,a)},getComponentRuleValue:function(a,b){return this.getRuleValue(this.getComponentOption(a),b)},getRuleValue:function(a,b,c){return null===a?b:!0===a||!1===a?a:a.when.call(this,c||this.getModel(),this.getValueFromModel())},getComponentRuleDependencies:function(a){return this.getRuleDependencies(this.getComponentOption(a))},getRuleDependencies:function(a){return null===a||void 0===a.depends||null===a.depends?[]:Array.isArray(a.depends)?a.depends:[a.depends]},isEnabled:function(){return!!this.isViewMode()||this.getComponentRuleValue("enabled",!0)},isVisible:function(){var a=e.isVisibleOnAuth(this);if(!1===a)return!1;if(a=this.getComponentRuleValue("visible",!0)){var b=this.getComponentOption("view");this.isViewMode()?a="edit"==b!=1:this.isViewMode()||(a="view"==b!=1)}return a},isMobile:function(){return!0===e.browser.mobile},isMobilePhone:function(){return this.isMobile()&&b("body").width()<768},isRequiredSignNeeded:function(){return this.getComponentRuleValue("required",!1)},getDependencies:function(a){var b=[];Array.isArray(a)||(a=[a]);var c=this;return a.forEach(function(a){b.push.apply(b,c.getComponentRuleDependencies(a))}),b},addVisibleDependencyMonitor:function(){this.addDependencyMonitor(this.getDependencies("visible"))},addEnableDependencyMonitor:function(){this.addDependencyMonitor(this.getDependencies("enabled"))},removeVisibleDependencyMonitor:function(){this.removeDependencyMonitor(this.getDependencies("visible"))},removeEnableDependencyMonitor:function(){this.removeDependencyMonitor(this.getDependencies("enabled"))},addRequiredDependencyMonitor:function(){this.addDependencyMonitor(this.getDependencies("required"))},removeRequiredDependencyMonitor:function(){this.removeDependencyMonitor(this.getDependencies("required"))},addValidateDependencyMonitor:function(){this.addDependencyMonitor(this.getDependencies("validation"),this.validate)},removeValidateDependencyMonitor:function(){this.removeDependencyMonitor(this.getDependencies("validation"),this.validate)},validate:function(){var a=this.getLayout().getValidationPhase();"function"==typeof a&&(a=a.call(this,this.getModel(),this.getDataId())),a?this.getModel().validateByPhase(a,this.getDataId()):this.getModel().validate(this.getDataId())},getValidationOption:function(a,b){return this.getLayout().getValidationOption(a,b)},__forceUpdate:function(){this.forceUpdate()},renderNormalLine:function(){var a={disabled:!this.isEnabled()};return a[this.getAdditionalCSS("normal-line","normal-line")]=!0,d.createElement("hr",{className:e.LayoutHelper.classSet(a),ref:"normalLine"})},renderFocusLine:function(){return d.createElement("hr",{className:this.getAdditionalCSS("focus-line","focus-line"),ref:"focusLine"})},addDependencyMonitor:function(a,b,c){b=null==b?this.__forceUpdate:b;var d=this;return c?a.forEach(function(a){c.addPostChangeListener(a,b)}):a.forEach(function(a){if("object"==typeof a){var c=a.id;"form"===a.on?d.getFormModel().addPostChangeListener(c,b):"inner"===a.on?d.getInnerModel().addPostChangeListener(c,b):d.getModel().addPostChangeListener(c,b)}else d.getModel().addPostChangeListener(a,b)}),this},removeDependencyMonitor:function(a,b,c){b=null==b?this.__forceUpdate:b;var d=this;return c?a.forEach(function(a){c.removePostChangeListener(a,b)}):a.forEach(function(a){if("object"==typeof a){var c=a.id;"form"===a.on?d.getFormModel().removePostChangeListener(c,b):"inner"===a.on?d.getInnerModel().removePostChangeListener(c,b):d.getModel().removePostChangeListener(c,b)}else d.getModel().removePostChangeListener(a,b)}),this},addPostChangeListener:function(a){this.getModel().addPostChangeListener(this.getDataId(),a)},removePostChangeListener:function(a){this.getModel().removePostChangeListener(this.getDataId(),a)},addPostAddListener:function(a){this.getModel().addPostAddListener(this.getDataId(),a)},removePostAddListener:function(a){this.getModel().removePostAddListener(this.getDataId(),a)},addPostRemoveListener:function(a){this.getModel().addPostRemoveListener(this.getDataId(),a)},removePostRemoveListener:function(a){this.getModel().removePostRemoveListener(this.getDataId(),a)},addPostValidateListener:function(a){this.getModel().addPostValidateListener(this.getDataId(),a)},removePostValidateListener:function(a){this.getModel().removePostValidateListener(this.getDataId(),a)}};e.mixins={ArrayComponentMixin:{isArrayData:function(){return!0},addRowListener:function(a){this.getRowListeners().forEach(function(b){a.addListener(b.id,b.time?b.time:"post",b.type?b.type:"change",b.listener)}),a.addPostChangeListener(null,this.onRowModelChanged),a.addPostAddListener(null,this.onRowModelChanged),a.addPostRemoveListener(null,this.onRowModelChanged)},onRowModelChanged:function(a){var b=this.getComponentOption("hierarchyPublisher");if(b){var c=a.model.getCurrentModel(),d=this.getModel().get(this.getDataId()),e=d.indexOf(c);b.call(this,this.getModel(),this.getDataId(),a,e)}else!1===b||this.getModel().update(this.getDataId(),a.model.getCurrentModel(),a.model.getCurrentModel())},getRowListeners:function(){var a=this.getComponentOption(this.getRowListenerKey());return a?Array.isArray(a)?a:[a]:[]},getRowListenerKey:function(){return"rowListener"},createRowModel:function(a,b){var c=this.getModel(),d=c.getValidator(),f=null;if(d){var g=d.getConfig()[this.getDataId()];g&&g.table&&(f=e.createModelValidator(g.table))}var h=f?e.createModel(a,f):e.createModel(a);h.parent(c);var i=this.getModel().getError(this.getDataId());return i&&i.forEach(function(b){"string"!=typeof b&&h.mergeError(b.getError(a))}),b&&h.useBaseAsCurrent(),h}},PopoverMixin:{renderPopoverContainer:function(){null==this.state.popoverDiv&&(this.state.popoverDiv=b("<div>"),this.state.popoverDiv.appendTo(b("body")),this.isMobile()?b("body").on("touchmove mousewheel",this.onDocumentMouseWheelWhenPopoverShown):(b(document).on("mousedown",this.onDocumentMouseDownWhenPopoverShown).on("keyup",this.onDocumentKeyUpWhenPopoverShown).on("keydown",this.onDocumentKeyDownWhenPopoverShown).on("mousewheel",this.onDocumentMouseWheelWhenPopoverShown),b(a).on("resize",this.onWindowResizeWhenPopoverShown)))},renderPopover:function(){this.beforeRenderPopover&&this.beforeRenderPopover.apply(this,arguments);var a={display:"block"};if(!this.isPopoverMatchComponentWidth||!1!==this.isPopoverMatchComponentWidth()){var b=this.getComponent();a.width=b.outerWidth()}a.top=-1e4,a.left=0;var c={"popover bottom in":!0};this.getPopoverContainerCSS&&(c[this.getPopoverContainerCSS()]=!0);var f=this.getAdditionalCSS("popover");f&&(c[f]=!0),this.isMobilePhone()&&(c["mobile-phone"]=!0,c["fix-bottom"]=this.isPopoverFixOnBottom(),a={display:"block"});var g=this.renderPopoverContent.apply(this,arguments);this.hasPopoverContentWrapper&&!1===this.hasPopoverContentWrapper()||(g=d.createElement("div",{className:"popover-content"},g));var h=d.createElement("div",{role:"tooltip",className:e.LayoutHelper.classSet(c),style:a},d.createElement("div",{className:"arrow"}),g);ReactDOM.render(h,this.state.popoverDiv.get(0),this.onPopoverRenderComplete)},onPopoverRenderComplete:function(){if(this.beforePopoverRenderComplete&&this.beforePopoverRenderComplete.apply(this,arguments),this.state.popoverDiv.show(),this.isMobilePhone())b("html").addClass("on-mobile-popover-shown");else{var a=this.state.popoverDiv.children(".popover"),c=this.getComponent();this.recalcPopoverPosition(a,c)}this.afterPopoverRenderComplete&&this.afterPopoverRenderComplete.apply(this,arguments)},recalcPopoverPosition:function(c,d){var e={};e.width=d.outerWidth();var f=d.offset();e.top=f.top+d.outerHeight(),e.left=f.left;var g=!1,h=!1,i=c.outerHeight(),j=c.outerWidth();if(e.top=f.top+d.outerHeight(),e.top+i>b(a).height()+b(a).scrollTop()?f.top-b(a).scrollTop()>=i?(e.top=f.top-i,g=!0):e.top+i<=b(document).height()?g=!1:f.top<i?g=!1:(e.top=f.top-i,g=!0):g=!1,j>e.width){var k=b(document).width();e.left+j<=k||e.left+e.width>=j&&(e.left=e.left+e.width-j,h=!0)}g?(c.addClass("top"),c.removeClass("bottom")):(c.removeClass("top"),c.addClass("bottom")),h&&c.addClass("right-to-left"),c.css({top:e.top,left:e.left})},showPopover:function(){this.beforeShowPopover&&this.beforeShowPopover.apply(this,arguments),this.renderPopoverContainer(),this.renderPopover.apply(this,arguments)},hidePopover:function(){this.destroyPopover()},destroyPopover:function(){this.beforeDestoryPopover&&this.beforeDestoryPopover.apply(this,arguments),b("html").removeClass("on-mobile-popover-shown"),this.state.popoverDiv&&(b(document).off("mousedown",this.onDocumentMouseDownWhenPopoverShown).off("keyup",this.onDocumentKeyUpWhenPopoverShown).off("keydown",this.onDocumentKeyDownWhenPopoverShown).off("mousewheel",this.onDocumentMouseWheelWhenPopoverShown),b(a).off("resize",this.onWindowResizeWhenPopoverShown),this.isMobilePhone()&&b("body").off("touchmove mousewheel",this.onDocumentMouseWheelWhenPopoverShown),this.state.popoverDiv.remove(),delete this.state.popoverDiv),this.afterDestoryPopover&&this.afterDestoryPopover.apply(this,arguments)},onDocumentMouseDownWhenPopoverShown:function(a){var c=b(a.target);0==c.closest(this.getComponent()).length&&0==c.closest(this.state.popoverDiv).length&&this.hidePopover()},onDocumentKeyUpWhenPopoverShown:function(a){27!==a.keyCode&&9!==a.keyCode||this.hidePopover()},onDocumentKeyDownWhenPopoverShown:function(a){38!==a.keyCode&&40!==a.keyCode||a.preventDefault()},onDocumentMouseWheelWhenPopoverShown:function(a){if(this.isMobilePhone())return void a.preventDefault();0==b(a.target).closest(this.state.popoverDiv).length&&this.hidePopover()},onWindowResizeWhenPopoverShown:function(){this.hidePopover()},isPopoverFixOnBottom:function(){return this.isMobilePhone()&&!0===this.POP_FIX_ON_BOTTOM}}},e.defineCellComponent=function(a){var c={};return!0!==a.keepRender&&(c={render:function(){return this.isVisible()?a.render.call(this):null}}),b.extend({},l,a,c)};var m=c.Class({constructor:function(){this.__comp={},this.__components={}},classSet:function(a){return"object"==typeof a?Object.keys(a).filter(function(b){return a[b]}).join(" "):Array.prototype.join.call(arguments," ")},setDefaultCellWidth:function(a){f.DEFAULT_WIDTH=1*a},setDefaultSectionWidth:function(a){h.DEFAULT_WIDTH=1*a},registerComponent:function(a,b){if(this.__comp[a]){var c=this.__comp[a];if(Array.isArray(c)){c.find(function(a){return a===b})||c.push(b)}else c!==b&&(this.__comp[a]=[c,b])}else this.__comp[a]=b;return this},unregisterComponent:function(a,b){if(b)delete this.__comp[a];else{var c=this.__comp[a];if(c)if(Array.isArray(c)){var d=c.findIndex(function(a){return a===b});-1!=d&&c.splice(d,1)}else c===b&&delete this.__comp[a]}return this},getComponent:function(a){return this.__comp[a]},__forceUpdate:function(a){return a.forceUpdate&&a.forceUpdate(),this},forceUpdate:function(a){var b=this.getComponent(a);return b&&(Array.isArray(b)?b.forEach(this.__forceUpdate):this.__forceUpdate(b)),this},registerComponentRenderer:function(b,c){"string"!=typeof b&&(b=b.type),this.__components[b]&&a.console.warn("Component ["+b+"] is replaced."),this.__components[b]=c},getComponentRenderer:function(a){if("string"!=typeof a&&(a=a.type),this.__components[a])return this.__components[a];throw e.createComponentException(e.ComponentConstants.Err_Unsupported_Component,"Component type ["+a+"] is not supported yet.")},registerComponentViewModeRenderer:function(b,c){"string"!=typeof b&&(b=b.type),b+="@view",this.__components[b]&&a.console.warn("Component ["+b+"] is replaced."),this.__components[b]=c},getComponentViewModeRenderer:function(a){return"string"!=typeof a&&(a=a.type),a+="@view",this.__components[a]?this.__components[a]:null},transformParameters:function(a,b,c,d){return{model:a,layout:b,direction:c,view:d,ref:b.getId()}}});e.LayoutHelper=new m,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.Nothing,function(){return null})}(window,jQuery,jsface,React),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NArrayCheck",getDefaultProps:function(){return{defaultOptions:{direction:"horizontal",labelAttached:"right"}}},renderItem:function(a,b,d){var f=e.createModel({id:b.id,checked:this.isCodeChecked(b)}),g=e.createCellLayout("checked",{label:b.text,comp:{labelAttached:this.getComponentOption("labelAttached"),enabled:null!=b.enabled?b.enabled:a}});return f.addPostChangeListener("checked",this.onCodeItemCheckedChanged.bind(this,b)),c.createElement(e.Components.NCheck,{model:f,layout:g,key:d,view:this.isViewMode()})},render:function(){var a=this.isEnabled(),b={"n-disabled":!a,vertical:"vertical"===this.getComponentOption("direction")};return b[this.getComponentCSS("n-array-check")]=!0,c.createElement(e.Components.NCodeTableWrapper,{codetable:this.getCodeTable(),className:e.LayoutHelper.classSet(b),model:this.getModel(),layout:this.getLayout(),renderer:this.getRealRenderer})},getRealRenderer:function(){var a=this.isEnabled(),b={"n-disabled":!a,vertical:"vertical"===this.getComponentOption("direction")};return b[this.getComponentCSS("n-array-check")]=!0,c.createElement("div",{className:e.LayoutHelper.classSet(b)},this.getCodeTable().list().map(this.renderItem.bind(this,a)))},onCodeItemCheckedChanged:function(a,b){b.new?this.onCodeItemChecked(a):this.onCodeTableUnchecked(a)},onCodeTableUnchecked:function(a){var b=this.getValueFromModel();null!=b&&this.setValueToModel(b.filter(function(b){return b!=a.id}).slice(0))},onCodeItemChecked:function(a){var b=this.getValueFromModel();if(null==b)b=[a.id];else{-1==b.findIndex(function(b){return b==a.id})&&b.push(a.id)}this.setValueToModel(b.slice(0))},getCodeTable:function(){return this.getComponentOption("data")},isCodeChecked:function(a){var b=this.getValueFromModel();return null!=b&&b.some(function(b){return b==a.id})}}));e.Components.NArrayCheck=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.ArrayCheck,function(a,b,d,f){return c.createElement(e.Components.NArrayCheck,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NArrayPanel",mixins:[e.mixins.ArrayComponentMixin],statics:{UNTITLED:"Untitled Item"},getDefaultProps:function(){return{defaultOptions:{collapsible:!0,expanded:!0}}},renderItem:function(a,b){var d=this.createRowModel(a,!0);this.addRowListener(d);var f=this;this.getDependencies("itemTitle").forEach(function(a){d.addListener(a,"post","change",function(){f.forceUpdate()})});var g={label:this.getPanelTitle(d,b),comp:{type:e.ComponentConstants.Panel,collapsible:this.getComponentOption("collapsible"),expanded:this.getExpanded(d,b),editLayout:this.getEditLayout(d,b),style:this.getComponentOption("style"),checkInTitle:this.getCheckInTitle(d,b),expandedLabel:this.getComponentOption("expandedLabel"),collapsedLabel:this.getComponentOption("collapsedLabel"),headerButtons:this.getHeaderButtons(d,b),customHeader:this.getCustomerHeader(d,b),centralId:this.getComponentCentralId()+"-"+b}};if(this.getComponentOption("itemCss")){var h=this.getComponentOption("itemCss");g.css="string"==typeof h?{comp:h}:h}return c.createElement("div",{className:"row",key:b},c.createElement("div",{className:"col-sm-12 col-md-12 col-lg-12"},c.createElement(e.Components.NPanel,{model:d,layout:e.createCellLayout("pseudo-panel",g),direction:this.props.direction,view:this.isViewMode()})))},render:function(){return c.createElement("div",{className:this.getComponentCSS("n-array-panel")},this.getValueFromModel().map(this.renderItem))},getValueFromModel:function(){var a=this.getModel().get(this.getDataId());return null==a?[]:a},getEditLayout:function(a,b){var c=this.getComponentOption("editLayout");return"function"==typeof c?c.call(this,a,b):c},getHeaderButtons:function(a,b){var c=this.getComponentOption("headerButtons");return"function"==typeof c?c.call(this,a,b):c},getExpanded:function(a,b){var c=this.getComponentOption("expanded");return"function"==typeof c?c.call(this,a,b):c},getCustomerHeader:function(a,b){
var c=this.getComponentOption("customHeader");return"function"==typeof c?c.call(this,a,b):c},getCheckInTitle:function(a,b){var c=this.getComponentOption("checkInTitle");return"function"==typeof c?c.call(this,a,b):c},getPanelTitle:function(a,b){var c=this.getComponentOption("itemTitle");if(null==c)return f.UNTITLED;if("string"==typeof c)return c;var d=c.when.call(this,a,b);return null==d||d.isBlank()?f.UNTITLED:d}}));e.Components.NArrayPanel=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.ArrayPanel,function(a,b,d,f){return c.createElement(e.Components.NArrayPanel,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NArrayTab",mixins:[e.mixins.ArrayComponentMixin],statics:{UNTITLED:"Untitled Item",ADD_ICON:"plus-circle",ADD_LABEL:"Add"},getDefaultProps:function(){return{defaultOptions:{tabType:"tab",justified:!1,titleDirection:"horizontal"}}},renderTabContent:function(a,b){var d=this.getActiveTabIndex(),f={"n-array-tab-card":!0,show:b==d,hide:b!=d},g=this;this.getDependencies(["itemTitle","itemIcon"]).forEach(function(b){a.data.addListener(b,"post","change",function(){g.forceUpdate()})});var h=this.getComponentOption("badge");return null!=h&&("string"==typeof h?a.data.addListener(h,"post","change",function(){g.forceUpdate()}):this.getDependencies(h).forEach(function(b){a.data.addListener(b,"post","change",function(){g.forceUpdate()})})),c.createElement(e.Components.NForm,{model:a.data,layout:e.createFormLayout(a.layout),direction:this.props.direction,view:this.isViewMode(),className:e.LayoutHelper.classSet(f),key:b})},render:function(){var a=this.getTabs(),b=function(b,c,d,e){if(this.isAddable()&&c==a.length-1){return this.getComponentOption("onAdd").call(this,this.getModel(),this.getValueFromModel()),!1}var f=this.getComponentOption("canActive");if(f)return f.call(this,b,c,d,e)}.bind(this),d=null;return!0!==this.state.clear?d=c.createElement(e.Components.NTab,{type:this.getComponentOption("tabType"),justified:this.getComponentOption("justified"),direction:this.getComponentOption("titleDirection"),size:this.getComponentOption("titleIconSize"),tabClassName:this.getAdditionalCSS("tabs"),tabs:a,canActive:b,onActive:this.onTabClicked,ref:"tabs"}):delete this.state.clear,c.createElement("div",{className:this.getComponentCSS("n-array-tab")},d,c.createElement("div",{className:"n-array-tab-content",ref:"content"},a.map(this.renderTabContent)))},getTabs:function(){var a=0;return null!=this.state.transientActiveTabIndex?(a=this.state.transientActiveTabIndex,delete this.state.transientActiveTabIndex):a=this.getActiveTabIndex(),this.state.tabs=this.getValueFromModel().map(function(b,c){var d=this.createRowModel(b,!0);return this.addRowListener(d),{label:this.getTabTitle(d),icon:this.getTabIcon(d),layout:this.getEditLayout(d),badge:this.getTabBadge(d),data:d,active:c==a}}.bind(this)),this.isAddable()&&this.state.tabs.push({icon:f.ADD_ICON,label:f.ADD_LABEL,layout:{nothing:{comp:{type:e.ComponentConstants.Nothing}}},data:e.createModel({}),css:"add-tab"}),this.state.tabs},clearTabs:function(a){a?this.setState({tabs:null},a.bind(this)):this.setState({tabs:null})},getValueFromModel:function(){var a=this.getModel().get(this.getDataId());return null==a?[]:a},onModelChanged:function(a){if("add"===a.type)this.state.transientActiveTabIndex=a.index;else if("remove"===a.type){var b=a.index,c=this.getValueFromModel();b==c.length&&(b-=1),this.state.transientActiveTabIndex=b}else this.state.transientActiveTabIndex=null!=a.index?a.index:null;this.setState({clear:!0},this.forceUpdate)},getEditLayout:function(a){var b=this.getComponentOption("editLayout");return"function"==typeof b?b.call(this,a):b},getTabTitle:function(a){var b=this.getComponentOption("itemTitle");if(null==b)return f.UNTITLED;if("string"==typeof b)return b;var c=b.when.call(this,a);return null==c||c.isBlank()?f.UNTITLED:c},getTabBadge:function(a){var b=this.getComponentOption("badge");if(null==b)return null;if("string"==typeof b){var c=a.get(b),d=this.getComponentOption("badgeRender");return d&&(c=d.call(this,c,a,this.getModel())),c}return b.when.call(this,a)},getTabIcon:function(a){var b=this.getComponentOption("itemIcon");return null==b?null:"string"==typeof b?b:b.when.call(this,a)},isAddable:function(){return!this.isViewMode()&&null!=this.getComponentOption("onAdd")},onTabClicked:function(a,b){this.setActiveTabIndex(b);var c=this.getComponentOption("onActive");c&&c.call(this,a,b)},getActiveTabIndex:function(){var a=this.state.tabs;if(null==a)return-1;var b=a.findIndex(function(a,b){return!0===a.active});return-1==b&&(b=a.findIndex(function(a,b){if(!1!==a.visible)return a.active=!0,!0})),b},setActiveTabIndex:function(a){this.refs.tabs.setActiveTabIndex(a),this.forceUpdate()}}));e.Components.NArrayTab=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.ArrayTab,function(a,b,d,f){return c.createElement(e.Components.NArrayTab,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NFormButton",getDefaultProps:function(){return{defaultOptions:{style:"default",labelFromModel:!1}}},renderIcon:function(a){if(null==a)return null;var b={fa:!0,"fa-fw":!0};return b["fa-"+a]=!0,c.createElement("span",{className:e.LayoutHelper.classSet(b),key:"icon"})},renderButtonIcon:function(){return this.renderIcon(this.getIcon())},renderMoreButtons:function(a){var b=this.getComponentOption("more");if(b){var d=c.createElement("a",{href:"javascript:void(0);",className:e.LayoutHelper.classSet(a)+" dropdown-toggle",disabled:!this.isEnabled(),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",key:"a"},this.getComponentOption("click")?null:this.getButtonContext(),c.createElement("span",{className:"caret"})),f=function(){},g=this;return[d,c.createElement("ul",{className:"dropdown-menu",key:"ul"},b.map(function(a,b){if(a.divider)return c.createElement("li",{role:"separator",className:"divider",key:b});var d=a.click?a.click:f,e=a.text,h=g.renderIcon(a.icon);return e&&h&&(e=" "+e),c.createElement("li",{key:b},c.createElement("a",{href:"javascript:void(0);",onClick:d.bind(g,g.getModel())},h,e))}))]}return null},getButtonContext:function(){var a=this.getLabel(),b=this.renderButtonIcon(),d=null;return"left"===this.getLabelPosition()?(a&&b&&(a=c.createElement("span",{key:"lbl"},a+" ")),d=[a,b]):(a&&b&&(a=c.createElement("span",{key:"lbl"}," "+a)),d=[b,a]),d},render:function(){if(!this.isVisible())return null;var a={};a[this.getComponentCSS("n-button")]=!0,a["n-disabled"]=!this.isEnabled();var b={btn:!0,disabled:!this.isEnabled()};b["btn-"+this.getStyle()]=!0;var d=this.getComponentOption("click"),f=this.getComponentOption("more"),g=null;return!d&&f||(g=c.createElement("a",{href:"javascript:void(0);",className:e.LayoutHelper.classSet(b),onMouseUp:this.onClicked,disabled:!this.isEnabled(),title:this.getComponentOption("tooltip"),ref:"a"},this.getButtonContext())),c.createElement("div",{className:e.LayoutHelper.classSet(a)},c.createElement("div",{className:"btn-group"},g,this.renderMoreButtons(b)))},onClicked:function(a){if(0==a.button&&this.isEnabled()){b(d.findDOMNode(this.refs.a)).toggleClass("effect");var c=this.getComponentOption("click");c&&c.call(this,this.getModel(),a.target)}},getIcon:function(){return this.getComponentOption("icon")},getStyle:function(){var a=this.getComponentOption("style");return"function"==typeof a?a.call(this):a},getLabelPosition:function(){return this.getComponentOption("labelPosition")},getLabel:function(){return this.getComponentOption("labelFromModel")?this.getValueFromModel():this.getLayout().getLabel(this)},setValueToModel:function(a){}}));e.Components.NFormButton=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.Button,function(a,b,d,f){return c.createElement(e.Components.NFormButton,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NCheck",renderLabel:function(a){if(this.isLabelAttached()){var b=this.getLayout().getLabel(this);if(null==b||b.isEmpty())return null;var d=this.isEnabled(),f={"check-label":!0,disabled:!this.isEnabled(),"check-label-left":a};return c.createElement("span",{className:e.LayoutHelper.classSet(f),onClick:d&&!this.isViewMode()?this.onButtonClicked:null},this.getLayout().getLabel(this))}return null},renderCheckbox:function(){var a=this.isChecked(),b=this.isEnabled(),d={disabled:!b,checked:a,"check-container":!0};return c.createElement("div",{className:"check-container"},c.createElement("span",{className:e.LayoutHelper.classSet(d),onClick:b&&!this.isViewMode()?this.onButtonClicked:null,onKeyUp:b&&!this.isViewMode()?this.onKeyUp:null,tabIndex:"0",ref:"out"},c.createElement("span",{className:"check",onClick:this.onInnerClicked})))},render:function(){var a={"n-disabled":!this.isEnabled(),"n-view-mode":this.isViewMode()};a[this.getComponentCSS("n-checkbox")]=!0;var b=this.isLabelAtLeft();return c.createElement("div",{className:e.LayoutHelper.classSet(a)},b?this.renderLabel(!0):null,this.renderCheckbox(),b?null:this.renderLabel(!1))},onInnerClicked:function(){b(d.findDOMNode(this.refs.out)).focus()},onButtonClicked:function(){this.setValueToModel(!this.isChecked())},onKeyUp:function(a){"32"==a.keyCode&&this.onButtonClicked()},isChecked:function(){return!0===this.getValueFromModel()},isLabelAttached:function(){return null!==this.getComponentOption("labelAttached")},isLabelAtLeft:function(){return"left"===this.getComponentOption("labelAttached")}}));e.Components.NCheck=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.Check,function(a,b,d,f){return c.createElement(e.Components.NCheck,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"CodeTableWrapper",statics:{ON_LOADING_ICON:"fa fa-fw fa-spinner fa-spin",ON_LOADING:"On Loading..."},getDefaultProps:function(){return{}},componentWillUpdate:function(){},componentDidUpdate:function(){},componentDidMount:function(){var a=this.getCodeTable();if(this.state.paintWrapper)if(this.hasParent()){var b=this.getParentValue();null==b?this.loadWhenNoParentValue()?a.initializeRemote().done(this.repaint):(a.setAsRemoteInitialized(),this.repaint()):a.loadRemoteCodeSegment(b).done(this.repaint)}else a.initializeRemote().done(this.repaint);else{var c=this.props.onMounted;c&&c.call(this)}},componentWillUnmount:function(){},repaint:function(){var a=this.props.onMounted;this.setState({paintWrapper:!1},a||void 0)},needWrapper:function(){var a=this.getCodeTable(),b=!0;return Array.isArray(a)?b=!1:this.hasParent()&&null==this.getParentValue()&&!this.loadWhenNoParentValue()?b=!1:a.isRemoteButNotInitialized()||(b=!1),b},render:function(){if(this.needWrapper()){this.state.paintWrapper=!0;var a=this.props.className?this.props.className+" n-codetable-wrapper form-control":"n-codetable-wrapper form-control";return c.createElement("div",{className:a},c.createElement("span",{className:"n-ctol-icon "+f.ON_LOADING_ICON}),c.createElement("span",{className:"n-ctol-label"},f.ON_LOADING))}return this.state.paintWrapper=!1,this.getWrappedRenderer().call(this)},getCodeTable:function(){return this.props.codetable},getWrappedRenderer:function(){return this.props.renderer},hasParent:function(){return this.props.hasParent},loadWhenNoParentValue:function(){return!this.props.hasParent||this.props.loadWhenNoParentValue},getParentValue:function(){return this.props.parentValue}}));e.Components.NCodeTableWrapper=f}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e,f){var g=d.createClass(f.defineCellComponent({displayName:"NDateTime",mixins:[f.mixins.PopoverMixin],statics:{POP_FIX_ON_BOTTOM:!1,FORMAT:"YYYY/MM/DD",HEADER_MONTH_FORMAT:"MMMM",HEADER_YEAR_FORMAT:"YYYY",VALUE_FORMAT:f.ComponentConstants.Default_Date_Format,FORMAT_TYPES:{ALL:126,YMD:112,YM:96,HM:12,HMS:14,YEAR:64,MONTH:32,DAY:16,HOUR:8,MINUTE:4,SECOND:2,MILLSECOND:1},CLOCK_RADIUS:100,CLOCK_HOUR_PERCENTAGE:.6,CLOCK_BIG_ENGRAVE_LENGTH:8,CLOCK_SMALL_ENGRAVE_LENGTH:4,CLOCK_CHAR_POS:{TOP:{X:100,Y:-2},LEFT:{X:-1,Y:99},RIGHT:{X:201,Y:99},BOTTOM:{X:100,Y:203}},CLOCK_HAND_OFFSET:10,CLOSE_TEXT:"Close",TODAY_TEXT:"Now",CLEAR_TEXT:"Clear",DATE_SWITCH_TEXT:"Date",TIME_SWITCH_TEXT:"Time",FIXED_WEEKDS:!1},getDefaultProps:function(){return{defaultOptions:{locale:"en",headerMonthFirst:!0,bodyYearFormat:"YYYY",icons:{calendar:"calendar",today:"crosshairs",clear:"trash-o",close:"close"}}}},beforeDidUpdate:function(){this.setValueToTextInput(this.getValueFromModel())},beforeDidMount:function(){this.setValueToTextInput(this.getValueFromModel())},beforeWillUnmount:function(){this.destroyPopover()},renderIcon:function(a){var b={fa:!0,"fa-fw":!0};return b["fa-"+a.icon]=!0,a.className&&(b[a.className]=!0),d.createElement("span",{className:f.LayoutHelper.classSet(b),onClick:a.click})},renderInputArea:function(){var a={"input-group-addon":!0,link:!0,disabled:!this.isEnabled()};return d.createElement("div",{className:"input-group",onClick:this.onCalendarButtonClicked,ref:"comp"},d.createElement("input",{type:"text",className:"form-control",disabled:!this.isEnabled(),onChange:this.onTextInputChange,onFocus:this.onTextInputFocused,onBlur:this.onTextInputBlurred,"aria-readonly":!!this.isMobile(),readOnly:!!this.isMobile(),ref:"text"}),d.createElement("span",{className:f.LayoutHelper.classSet(a)},this.renderIcon({icon:this.getIcon("calendar"),click:this.onCalendarButtonClicked})))},render:function(){if(this.isViewMode())return this.renderInViewMode();var a={"n-disabled":!this.isEnabled()};return a[this.getComponentCSS("n-datetime")]=!0,d.createElement("div",{className:f.LayoutHelper.classSet(a)},this.renderInputArea(),this.renderNormalLine(),this.renderFocusLine())},renderHeaderMonth:function(a){return d.createElement("span",{onClick:this.renderPopover.bind(this,{date:a,type:g.FORMAT_TYPES.MONTH}),className:"header-date-btn",key:"header-month"},this.convertValueToString(a,this.getHeaderMonthFormat()))},renderHeaderYear:function(a){return d.createElement("span",{onClick:this.renderPopover.bind(this,{date:a,type:g.FORMAT_TYPES.YEAR}),className:"header-date-btn",key:"header-year"},this.convertValueToString(a,this.getHeaderYearFormat()))},renderDayHeader:function(a){var b=[this.renderHeaderMonth(a)," ",this.renderHeaderYear(a)],c=this.getComponentOption("headerMonthFirst");return d.createElement("div",{className:"calendar-header day-view"},this.renderIcon({icon:"angle-double-left",className:"header-btn left",click:this.renderPopover.bind(this,{date:a.clone().subtract(1,"y"),type:g.FORMAT_TYPES.DAY})}),this.renderIcon({icon:"angle-left",className:"header-btn left",click:this.renderPopover.bind(this,{date:a.clone().subtract(1,"M"),type:g.FORMAT_TYPES.DAY})}),c?b:b.reverse(),this.renderIcon({icon:"angle-double-right",className:"header-btn right",click:this.renderPopover.bind(this,{date:a.clone().add(1,"y"),type:g.FORMAT_TYPES.DAY})}),this.renderIcon({icon:"angle-right",className:"header-btn right",click:this.renderPopover.bind(this,{date:a.clone().add(1,"M"),type:g.FORMAT_TYPES.DAY})}))},getWeekdayHeader:function(a){var b=c.locale();c.locale(this.getLocale());var d=c.weekdaysMin();c.locale(b);var e=this.getFirstDayOfWeek(),f=d.splice(0,e);return d=d.concat.apply(d,f)},getDaysOfDayBody:function(a){var b=this.getDaysOfMonth(a),c=a.clone();c.date(1);var d=this.getDayOfWeek(c),e=this.getFirstDayOfWeek(),f=0;f=d>=e?d-e:d+7-e;var h=0,i=[],j=null;for(h=1;h<=f;h++)j=c.clone(),j.subtract(h,"d"),i.splice(0,0,j);for(h=0;h<b;h++)j=c.clone(),j.add(h,"d"),i.push(j);var k=7-i.length%7;k=7==k?0:k;var l=i[i.length-1];for(h=1;h<=k;h++)j=l.clone(),j.add(h,"d"),i.push(j);if(g.FIXED_WEEKDS){l=i[i.length-1];var m=i.length;if(m<42)for(h=1;h<=42-m;h++)j=l.clone(),j.add(h,"d"),i.push(j)}return i},renderDayBody:function(a){var b=this,c=this.getWeekdayHeader(),e=this.getDaysOfDayBody(a),g=a.month(),h=this.getValueFromModel(),i=this.getToday(),j=this.getMinDate(),k=this.getMaxDate();return d.createElement("div",{className:"calendar-body day-view"},d.createElement("div",{className:"day-view-body-header row"},c.map(function(a,b){return d.createElement("div",{className:"cell-7-1",key:"weekday-"+b},a)})),d.createElement("div",{className:"day-view-body-body row"},e.map(function(a,c){var e={"cell-7-1":!0,"gap-day":a.month()!=g,"disable-day":a.isBefore(j)||a.isAfter(k),today:a.isSame(i,"day"),"current-value":null!=h&&a.isSame(h,"day")},l=b.onDaySelected.bind(b,a);return!0===e["disable-day"]&&(l=null),d.createElement("div",{className:f.LayoutHelper.classSet(e),onClick:l,key:"day-"+c},d.createElement("span",null,a.date()))})))},renderMonthHeader:function(a){return d.createElement("div",{className:"calendar-header month-view"},this.renderIcon({icon:"angle-double-left",className:"header-btn left",click:this.renderPopover.bind(this,{date:a.clone().subtract(10,"y"),type:g.FORMAT_TYPES.MONTH})}),this.renderIcon({icon:"angle-left",className:"header-btn left",click:this.renderPopover.bind(this,{date:a.clone().subtract(1,"y"),type:g.FORMAT_TYPES.MONTH})}),this.renderHeaderYear(a),this.renderIcon({icon:"angle-double-right",className:"header-btn right",click:this.renderPopover.bind(this,{date:a.clone().add(10,"y"),type:g.FORMAT_TYPES.MONTH})}),this.renderIcon({icon:"angle-right",className:"header-btn right",click:this.renderPopover.bind(this,{date:a.clone().add(1,"y"),type:g.FORMAT_TYPES.MONTH})}))},renderMonthBody:function(a){var b=this,e=c.locale();c.locale(this.getLocale());var g=c.monthsShort("-MMM-");c.locale(e);var h=this.getValueFromModel();null==h&&(h=this.getToday());var i=this.getValueFromModel(),j=this.getToday();return d.createElement("div",{className:"calendar-body month-view"},d.createElement("div",{className:"month-view-body-body row"},g.map(function(c,e){var g=h.clone();g.year(a.year()),g.month(e);var k={"cell-4-1":!0,today:e==j.month(),"current-value":null!=i&&e==i.month()};return d.createElement("div",{className:f.LayoutHelper.classSet(k),onClick:b.onMonthSelected.bind(b,g),key:e},c)})))},renderYearHeader:function(a){var b=[this.convertValueToString(a.clone().subtract(10,"y"),this.getHeaderYearFormat())," - ",this.convertValueToString(a.clone().add(9,"y"),this.getHeaderYearFormat())];return d.createElement("div",{className:"calendar-header year-view"},this.renderIcon({icon:"angle-double-left",className:"header-btn left",click:this.renderPopover.bind(this,{date:a.clone().subtract(40,"y"),type:g.FORMAT_TYPES.YEAR})}),this.renderIcon({icon:"angle-left",className:"header-btn left",click:this.renderPopover.bind(this,{date:a.clone().subtract(20,"y"),type:g.FORMAT_TYPES.YEAR})}),b,this.renderIcon({icon:"angle-double-right",className:"header-btn right",click:this.renderPopover.bind(this,{date:a.clone().add(40,"y"),type:g.FORMAT_TYPES.YEAR})}),this.renderIcon({icon:"angle-right",className:"header-btn right",click:this.renderPopover.bind(this,{date:a.clone().add(20,"y"),type:g.FORMAT_TYPES.YEAR})}))},renderYearBody:function(a){var b=this,c=this.getValueFromModel();null==c&&(c=this.getToday());for(var e=this.getValueFromModel(),g=this.getToday(),h=[],i=-10;i<=9;i++){var j=a.clone().set({month:c.month(),date:c.date(),hour:c.hour(),minute:c.minute(),second:c.second(),millisecond:c.millisecond()});j.add(i,"y"),h.push(j)}return d.createElement("div",{className:"calendar-body month-view"},d.createElement("div",{className:"year-view-body-body row"},h.map(function(a,c){var h={"cell-4-1":!0,today:a.year()==g.year(),"current-value":null!=e&&a.year()==e.year()};return d.createElement("div",{className:f.LayoutHelper.classSet(h),onClick:b.onYearSelected.bind(b,a),key:c},a.format(b.getBodyYearFormat()))})))},renderPopoverContentFooterButton:function(a){return d.createElement("div",{className:"cell-3-1",onClick:a.click},this.renderIcon({icon:this.getIcon(a.icon)}))},renderPopoverContentFooterForMobile:function(a,b){var c=null;return this.hasDateToDisplay()&&this.hasTimeToDisplay()&&(c=[],c.push(d.createElement("a",{href:"javascript:void(0);",onClick:this.switchToTimeViewOnMobile,className:"time-switch"+(this.state.dateViewWhenMobilePhone?"":" hidden"),key:"date"},d.createElement("span",null,g.TIME_SWITCH_TEXT))),c.push(d.createElement("a",{href:"javascript:void(0);",onClick:this.switchToDateViewOnMobile,className:"date-switch"+(this.state.dateViewWhenMobilePhone?" hidden":""),key:"time"},d.createElement("span",null,g.DATE_SWITCH_TEXT)))),d.createElement("div",{className:"calendar-footer row"},d.createElement("div",null,d.createElement("a",{href:"javascript:void(0);",onClick:this.hidePopover},d.createElement("span",null,g.CLOSE_TEXT)),d.createElement("a",{href:"javascript:void(0);",onClick:this.renderPopover.bind(this,{date:null,type:b,set:!0})},d.createElement("span",null,g.CLEAR_TEXT)),d.createElement("a",{href:"javascript:void(0);",onClick:this.renderPopover.bind(this,{date:a,type:b,set:!0})},d.createElement("span",null,g.TODAY_TEXT)),c))},renderPopoverContentFooterForDesk:function(a,b){return d.createElement("div",{className:"calendar-footer row"},this.renderPopoverContentFooterButton({icon:"today",click:this.renderPopover.bind(this,{date:a,type:b,set:!0})}),this.renderPopoverContentFooterButton({icon:"clear",click:this.renderPopover.bind(this,{date:null,type:b,set:!0})}),this.renderPopoverContentFooterButton({icon:"close",click:this.hidePopover}))},renderPopoverContentFooter:function(a,b){return this.isMobilePhone()?this.renderPopoverContentFooterForMobile(a,b):this.renderPopoverContentFooterForDesk(a,b)},renderEngrave:function(a,b,c,e,f){var g=b-c;return d.createElement("line",{className:e,x1:g*Math.cos(2*Math.PI*a/360)+f,y1:f-g*Math.sin(2*Math.PI*a/360),x2:b*Math.cos(2*Math.PI*a/360)+f,y2:f-b*Math.sin(2*Math.PI*a/360),key:a})},render12HourDial:function(a,b){var c=this,e=a.hour()<=11,f=this.getHourRadius();return d.createElement("g",{key:"hour-12-dial"},d.createElement("text",{className:"text hour-12 am"+(e?" yes":""),onClick:this.onAMPMSelected.bind(this,!0,b),x:0,y:0},"AM"),d.createElement("text",{className:"text hour-12 pm"+(e?"":" yes"),onClick:this.onAMPMSelected.bind(this,!1,b),x:2*g.CLOCK_RADIUS,y:0},"PM"),d.createElement("text",{className:"text hour-12 top-num",x:g.CLOCK_CHAR_POS.TOP.X,y:g.CLOCK_CHAR_POS.TOP.Y+g.CLOCK_RADIUS-f},"0"),d.createElement("text",{className:"text hour-12 left-num",x:g.CLOCK_CHAR_POS.LEFT.X+g.CLOCK_RADIUS-f,y:g.CLOCK_CHAR_POS.LEFT.Y},"9"),d.createElement("text",{className:"text hour-12 right-num",x:g.CLOCK_CHAR_POS.RIGHT.X-g.CLOCK_RADIUS+f,y:g.CLOCK_CHAR_POS.RIGHT.Y},"3"),d.createElement("text",{className:"text hour-12 bottom-num",x:g.CLOCK_CHAR_POS.BOTTOM.X,y:g.CLOCK_CHAR_POS.BOTTOM.Y-g.CLOCK_RADIUS+f},"6"),[30,60,120,150,210,240,300,330].map(function(a){return c.renderEngrave(a,f,g.CLOCK_SMALL_ENGRAVE_LENGTH,"big",g.CLOCK_RADIUS)}))},render24HourDial:function(){var a=this,b=this.getHourRadius();return d.createElement("g",{key:"hour-24-dial"},d.createElement("text",{className:"text hour-24 top-num",x:g.CLOCK_CHAR_POS.TOP.X,y:g.CLOCK_CHAR_POS.TOP.Y+g.CLOCK_RADIUS-b},"0"),d.createElement("text",{className:"text hour-24 left-num",x:g.CLOCK_CHAR_POS.LEFT.X+g.CLOCK_RADIUS-b,y:g.CLOCK_CHAR_POS.LEFT.Y},"18"),d.createElement("text",{className:"text hour-24 right-num",x:g.CLOCK_CHAR_POS.RIGHT.X-g.CLOCK_RADIUS+b,y:g.CLOCK_CHAR_POS.RIGHT.Y},"6"),d.createElement("text",{className:"text hour-24 bottom-num",x:g.CLOCK_CHAR_POS.BOTTOM.X,y:g.CLOCK_CHAR_POS.BOTTOM.Y-g.CLOCK_RADIUS+b},"12"),[45,135,225,315].map(function(c){return a.renderEngrave(c,b,g.CLOCK_BIG_ENGRAVE_LENGTH,"big",g.CLOCK_RADIUS)}),[15,30,60,75,105,120,150,165,195,210,240,255,285,300,330,345].map(function(c){return a.renderEngrave(c,b,g.CLOCK_SMALL_ENGRAVE_LENGTH,"small",g.CLOCK_RADIUS)}))},renderMinuteDial:function(){if(!this.hasMinute())return null;var a=this;return d.createElement("g",{key:"minute-dial"},d.createElement("text",{className:"text minute top-num",x:g.CLOCK_CHAR_POS.TOP.X,y:g.CLOCK_CHAR_POS.TOP.Y},"0"),d.createElement("text",{className:"text minute left-num",x:g.CLOCK_CHAR_POS.LEFT.X,y:g.CLOCK_CHAR_POS.LEFT.Y},"45"),d.createElement("text",{className:"text minute right-num",x:g.CLOCK_CHAR_POS.RIGHT.X,y:g.CLOCK_CHAR_POS.RIGHT.Y},"15"),d.createElement("text",{className:"text minute bottom-num",x:g.CLOCK_CHAR_POS.BOTTOM.X,y:g.CLOCK_CHAR_POS.BOTTOM.Y},"30"),[30,60,120,150,210,240,300,330].map(function(b){return a.renderEngrave(b,g.CLOCK_RADIUS,g.CLOCK_BIG_ENGRAVE_LENGTH,"big",g.CLOCK_RADIUS)}),[6,12,18,24,36,42,48,54,66,72,78,84,96,102,108,114,126,132,138,144,156,162,168,174,186,192,198,204,216,222,228,234,246,252,258,264,276,282,288,294,306,312,318,324,336,342,348,354].map(function(b){return a.renderEngrave(b,g.CLOCK_RADIUS,g.CLOCK_SMALL_ENGRAVE_LENGTH,"small",g.CLOCK_RADIUS)}))},renderHourHand:function(a,b){var c=a.hour(),e=null;e=this.is12Hour()?450-30*c:450-15*c;var f=this.getHourRadius();return d.createElement("line",{x1:b+g.CLOCK_HAND_OFFSET*Math.cos(2*Math.PI*(e-180)/360),y1:b-g.CLOCK_HAND_OFFSET*Math.sin(2*Math.PI*(e-180)/360),x2:b+(f-g.CLOCK_HAND_OFFSET)*Math.cos(2*Math.PI*e/360),y2:b-(f-g.CLOCK_HAND_OFFSET)*Math.sin(2*Math.PI*e/360),className:"hour-hand"})},renderMinuteHand:function(a,b,c){if(!this.hasMinute())return null;var e=a.minute(),f=450-6*e;return d.createElement("line",{x1:c+g.CLOCK_HAND_OFFSET*Math.cos(2*Math.PI*(f-180)/360),y1:c-g.CLOCK_HAND_OFFSET*Math.sin(2*Math.PI*(f-180)/360),x2:c+(b-g.CLOCK_HAND_OFFSET)*Math.cos(2*Math.PI*f/360),y2:c-(b-g.CLOCK_HAND_OFFSET)*Math.sin(2*Math.PI*f/360),className:"minute-hand"})},renderSecondHand:function(a,b,c){this.guessDisplayFormatType();if(!this.hasSecond())return null;var e=a.second(),f=450-6*e;return d.createElement("line",{x1:c+g.CLOCK_HAND_OFFSET*Math.cos(2*Math.PI*(f-180)/360),y1:c-g.CLOCK_HAND_OFFSET*Math.sin(2*Math.PI*(f-180)/360),x2:c+b*Math.cos(2*Math.PI*f/360),y2:c-b*Math.sin(2*Math.PI*f/360),className:"second-hand"})},renderTime:function(a,b){var c=this.guessDisplayFormatType();if(!this.hasTimeToDisplay(c))return null;var e={float:"left",width:this.hasDateToDisplay(c)?"50%":"100%"},f="HH";this.hasSecond()?f="HH:mm:ss":this.hasMinute()&&(f="HH:mm");var h=this.state.dateViewWhenMobilePhone?" hidden":"";return d.createElement("div",{className:"time-view"+h,style:e},d.createElement("div",{className:"calendar-header"},a.format(f)),d.createElement("div",{className:"calendar-body"},d.createElement("div",{className:"time-view-body-body"},d.createElement("div",{style:{height:2*g.CLOCK_RADIUS,width:2*g.CLOCK_RADIUS,position:"relative"}},d.createElement("svg",{className:"clock",height:2*g.CLOCK_RADIUS,width:2*g.CLOCK_RADIUS},this.renderMinuteDial(),this.is12Hour()?this.render12HourDial(a,b):this.render24HourDial(),this.renderHourHand(a,g.CLOCK_RADIUS),this.renderMinuteHand(a,g.CLOCK_RADIUS,g.CLOCK_RADIUS),this.renderSecondHand(a,g.CLOCK_RADIUS,g.CLOCK_RADIUS)),d.createElement("div",{style:{position:"absolute",backgroundColor:"transparent",top:0,left:0,height:2*g.CLOCK_RADIUS,width:2*g.CLOCK_RADIUS},onClick:this.onClockClicked.bind(this,b)})))))},renderPopoverContent:function(a){var b=a?a.date:null,c=a?a.type:null;b=b||this.getValueFromModel(),b=b||this.getToday(),null==c&&(c=this.getInitialPopoverType()||this.guessDisplayFormatType(),this.isMobilePhone()&&this.hasDateToDisplay(c)&&(this.state.dateViewWhenMobilePhone=!0));var e={float:"left",width:this.hasTimeToDisplay(this.guessDisplayFormatType())?"50%":"100%"};return 0!=(c&g.FORMAT_TYPES.DAY)?(this.startClockInterval(g.FORMAT_TYPES.DAY,b),d.createElement("div",{className:"popover-content row"},d.createElement("div",{className:"date-view",style:e},this.renderDayHeader(b),this.renderDayBody(b)),this.renderTime(b,g.FORMAT_TYPES.DAY),this.renderPopoverContentFooter(this.getToday(),g.FORMAT_TYPES.DAY))):0!=(c&g.FORMAT_TYPES.MONTH)?(this.startClockInterval(g.FORMAT_TYPES.MONTH,b),d.createElement("div",{className:"popover-content row"},d.createElement("div",{className:"date-view",style:e},this.renderMonthHeader(b),this.renderMonthBody(b)),this.renderTime(b,g.FORMAT_TYPES.MONTH),this.renderPopoverContentFooter(this.getToday(),g.FORMAT_TYPES.MONTH))):0!=(c&g.FORMAT_TYPES.YEAR)?(this.startClockInterval(g.FORMAT_TYPES.YEAR,b),d.createElement("div",{className:"popover-content row"},d.createElement("div",{className:"date-view",style:e},this.renderYearHeader(b),this.renderYearBody(b)),this.renderTime(b,g.FORMAT_TYPES.YEAR),this.renderPopoverContentFooter(this.getToday(),g.FORMAT_TYPES.YEAR))):(this.startClockInterval(c,b),d.createElement("div",{className:"popover-content row"},this.renderTime(b,this.guessDisplayFormatType()),this.renderPopoverContentFooter(this.getToday(),c)))},isPopoverMatchComponentWidth:function(){return!1},hasPopoverContentWrapper:function(){return!1},getPopoverContainerCSS:function(){var a=this.guessDisplayFormatType();return f.LayoutHelper.classSet({"n-datetime":!0,"time-only":!this.hasDateToDisplay(a)&&this.hasTimeToDisplay(a),"date-only":this.hasDateToDisplay(a)&&!this.hasTimeToDisplay(a),"date-and-time":this.hasDateToDisplay(a)&&this.hasTimeToDisplay(a)})},beforeRenderPopover:function(a){a||(a={}),a.set&&this.setValueToModel(a.date)},beforeDestoryPopover:function(){this.stopClockInterval()},stopClockInterval:function(){this.state.clockInterval&&(clearTimeout(this.state.clockInterval.handler),this.state.clockInterval=null)},startClockInterval:function(a,b){if(this.getComponentOption("runClock",!0)){null==this.getValueFromModel()?(this.stopClockInterval(),this.state.clockInterval={handler:setTimeout(function(){this.renderPopover({date:b.add(1,"s"),type:a})}.bind(this),1e3),type:a}):this.stopClockInterval()}},hasTimeToDisplay:function(a){return void 0===a&&(a=this.guessDisplayFormatType()),0!=(a&(g.FORMAT_TYPES.HOUR|g.FORMAT_TYPES.MINUTE|g.FORMAT_TYPES.SECOND|g.FORMAT_TYPES.MILLSECOND))},hasDateToDisplay:function(a){return void 0===a&&(a=this.guessDisplayFormatType()),0!=(a&g.FORMAT_TYPES.YMD)},guessDisplayFormatType:function(){var a=this.getPrimaryDisplayFormat(),b=-1!=a.indexOf("Y"),c=-1!=a.indexOf("M"),d=-1!=a.indexOf("D"),e=-1!=a.indexOf("H"),f=-1!=a.indexOf("m"),h=-1!=a.indexOf("s"),i=-1!=a.indexOf("S");return(b?g.FORMAT_TYPES.YEAR:0)+(c?g.FORMAT_TYPES.MONTH:0)+(d?g.FORMAT_TYPES.DAY:0)+(e?g.FORMAT_TYPES.HOUR:0)+(f?g.FORMAT_TYPES.MINUTE:0)+(h?g.FORMAT_TYPES.SECOND:0)+(i?g.FORMAT_TYPES.MILLSECOND:0)},onCalendarButtonClicked:function(){this.isEnabled()&&!this.isViewMode()&&(this.showPopover(),this.isMobilePhone()?this.getTextInput().blur():this.getTextInput().focus())},onTextInputFocused:function(){b(e.findDOMNode(this.refs.focusLine)).toggleClass("focus"),b(e.findDOMNode(this.refs.normalLine)).toggleClass("focus")},onTextInputBlurred:function(){b(e.findDOMNode(this.refs.focusLine)).toggleClass("focus"),b(e.findDOMNode(this.refs.normalLine)).toggleClass("focus");var a=this.getTextInput().val();if(0==a.length||a.isBlank())this.setValueToModel(null);else{var c=this.convertValueFromString(a,this.getDisplayFormat());null==c&&0!=a.length?(this.setValueToModel(null),this.setValueToTextInput(null)):(this.setValueToModel(c),this.setValueToTextInput(this.getValueFromModel()))}},onYearSelected:function(a){this.setValueToModel(a);var b=this.guessDisplayFormatType();this.hasTimeToDisplay(b)||0!=(b&g.FORMAT_TYPES.MONTH)?this.renderPopover({date:a,type:g.FORMAT_TYPES.MONTH}):this.hidePopover()},onMonthSelected:function(a){this.setValueToModel(a);var b=this.guessDisplayFormatType();this.hasTimeToDisplay(b)||0!=(b&g.FORMAT_TYPES.DAY)?this.renderPopover({date:a,type:g.FORMAT_TYPES.DAY}):this.hidePopover()},onDaySelected:function(a){this.setValueToModel(a);var b=this.guessDisplayFormatType();this.hasTimeToDisplay(b)?this.renderPopover({date:a,type:g.FORMAT_TYPES.DAY}):this.hidePopover()},onClockClicked:function(a,c){var d=b(c.target).offset(),e={x:c.pageX-d.left-g.CLOCK_RADIUS,y:g.CLOCK_RADIUS-(c.pageY-d.top)},f=Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2));if(!(f>101)){
var h=g.FORMAT_TYPES.SECOND;h=f>g.CLOCK_RADIUS-g.CLOCK_HAND_OFFSET?this.hasSecond()?g.FORMAT_TYPES.SECOND:this.hasMinute()?g.FORMAT_TYPES.MINUTE:g.FORMAT_TYPES.HOUR:f>g.CLOCK_RADIUS*g.CLOCK_HOUR_PERCENTAGE&&this.hasMinute()?g.FORMAT_TYPES.MINUTE:g.FORMAT_TYPES.HOUR;var i=0;0==e.x?i=e.y>=0?90:270:(i=180*Math.atan(e.y/e.x)/Math.PI,e.x>0&&e.y>=0||(e.x<0?i+=180:i+=360)),i=i<=90?90-i:450-i;var j,k,l,m,n=this.getValueFromModel();n=null==n?this.getToday():n,j=n.hour(),h==g.FORMAT_TYPES.SECOND?(m=Math.floor(i/6)+(i%6<3?0:1),n.second(m)):h==g.FORMAT_TYPES.MINUTE?(l=Math.floor(i/6)+(i%6<3?0:1),n.minute(l)):this.is12Hour()?(k=Math.floor(i/30)+(i%30<15?0:1),n.hour(j<=11?k:k+12)):(k=Math.floor(i/15)+(i%15<7.5?0:1),n.hour(k)),this.renderPopover({date:n,type:a,set:!0})}},onAMPMSelected:function(a,b){var c=this.getValueFromModel();c=null==c?this.getToday():c;var d=c.hour();d=a?d>11?d-12:d:d<=11?d+12:d,c.hour(d),this.setValueToModel(c),this.renderPopover({date:c,type:b})},switchToTimeViewOnMobile:function(a){var c=b(a.target);"SPAN"===c[0].tagName&&(c=c.closest("a")),c.addClass("hidden").siblings(".date-switch").removeClass("hidden"),this.state.dateViewWhenMobilePhone=!1;var d=c.closest(".popover-content");d.children(".time-view").removeClass("hidden"),d.children(".date-view").addClass("hidden")},switchToDateViewOnMobile:function(a){var c=b(a.target);"SPAN"===c[0].tagName&&(c=c.closest("a")),c.addClass("hidden").siblings(".time-switch").removeClass("hidden"),this.state.dateViewWhenMobilePhone=!0;var d=c.closest(".popover-content");d.children(".time-view").addClass("hidden"),d.children(".date-view").removeClass("hidden")},onTextInputChange:function(){var a=this.getTextInput().val();if(0==a.length||a.isBlank())this.setValueToModel(null);else{var b=this.convertValueFromString(a,this.getDisplayFormat(),!0);null==b&&0!=a.length||this.setValueToModel(b)}},onModelChanged:function(a){var b=a.new,c=this.getTextInput().val();if(null==b||(b+"").isBlank())null==c||c.isBlank()||this.forceUpdate();else{var d=this.getValueFromModel(),e=this.convertValueFromString(c,this.getDisplayFormat(),!0);d.isSame(e)||this.forceUpdate()}},getValueFromModel:function(){return this.convertValueFromString(this.getModel().get(this.getDataId()))},setValueToModel:function(a){var b=a;null!=a&&("string"==typeof a?b=a.isBlank()?null:c(a,this.getPrimaryDisplayFormat()).format(this.getValueFormat()):(b=a.format(this.getPrimaryDisplayFormat()),b=c(b,this.getPrimaryDisplayFormat()).format(this.getValueFormat()))),this.getModel().set(this.getDataId(),b)},setValueToTextInput:function(a){this.getTextInput().val(this.convertValueToString(a,this.getPrimaryDisplayFormat()))},convertValueFromString:function(a,b,d){var e=null==a||a.isBlank()?null:c(a,b||this.getValueFormat(),this.getLocale(),!0===d||void 0);return null!=e&&e.isValid()?e:null},convertValueToString:function(a,b){return null==a?null:a.format(b||this.getValueFormat())},getFirstDayOfWeek:function(){return this.getMomentLocaleData().firstDayOfWeek()},getDayOfWeek:function(a){return a.day()},getDaysOfMonth:function(b){switch(b.month()+1){case 1:case 3:case 5:case 7:case 8:case 10:case 12:return 31;case 4:case 6:case 9:case 11:return 30;case 2:return b.isLeapYear()?29:28;default:return a.console.warn("Something wrong with momentjs."),a.console.warn(b),31}},getComponent:function(){return b(e.findDOMNode(this.refs.comp))},getTextInput:function(){return b(e.findDOMNode(this.refs.text))},getDisplayFormat:function(){var a=this.getComponentOption("format");return a||g.FORMAT},getPrimaryDisplayFormat:function(){var a=this.getDisplayFormat();return Array.isArray(a)?a[0]:a},getHeaderMonthFormat:function(){var a=this.getComponentOption("headerMonthFormat");return a||g.HEADER_MONTH_FORMAT},getHeaderYearFormat:function(){var a=this.getComponentOption("headerYearFormat");return a||g.HEADER_YEAR_FORMAT},getBodyYearFormat:function(){return this.getComponentOption("bodyYearFormat")},getMinDate:function(){var a=this.getComponentOption("min");return null==a?a=c("0001-01-01"):"function"==typeof a&&(a=a.call(this)),a},getMaxDate:function(){var a=this.getComponentOption("max");return null==a?a=c("9999-12-31"):"function"==typeof a&&(a=a.call(this)),a},getValueFormat:function(){var a=this.getComponentOption("valueFormat");return a||g.VALUE_FORMAT},is12Hour:function(){return 12==this.getComponentOption("hour")&&!this.isMobile()},getHourRadius:function(){var a=g.CLOCK_RADIUS;return this.hasMinute()&&(a*=g.CLOCK_HOUR_PERCENTAGE),a},hasYear:function(){return 0!=(this.guessDisplayFormatType()&g.FORMAT_TYPES.YEAR)},hasMonth:function(){return 0!=(this.guessDisplayFormatType()&g.FORMAT_TYPES.MONTH)},hasDay:function(){return 0!=(this.guessDisplayFormatType()&g.FORMAT_TYPES.DAY)},hasHour:function(){return 0!=(this.guessDisplayFormatType()&g.FORMAT_TYPES.HOUR)},hasMinute:function(){return 0!=(this.guessDisplayFormatType()&g.FORMAT_TYPES.MINUTE)},hasSecond:function(){return 0!=(this.guessDisplayFormatType()&g.FORMAT_TYPES.SECOND)},getIcon:function(a){return this.getComponentOption("icons")[a]},getTextInViewMode:function(){return this.convertValueToString(this.getValueFromModel(),this.getPrimaryDisplayFormat())},getLocale:function(){return this.getComponentOption("locale")},getMomentLocaleData:function(){return c.localeData(this.getLocale())},getToday:function(){var a=c().locale(this.getLocale()),b=this.getComponentOption("defaultTime");return b&&(a="function"==typeof b?b.call(this,a):b),a},getInitialPopoverType:function(){return this.getComponentOption("popoverType")}}));f.Components.NDateTime=g,f.LayoutHelper.registerComponentRenderer(f.ComponentConstants.Date,function(a,b,c,e){return d.createElement(f.Components.NDateTime,f.LayoutHelper.transformParameters(a,b,c,e))})}(window,jQuery,moment,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass({displayName:"NExceptionModal",statics:{getExceptionModal:function(a){if(void 0===e.exceptionDialog||null===e.exceptionDialog){0==b("#exception_modal_container").length&&b("<div id='exception_modal_container' />").appendTo(b(document.body)),e.exceptionDialog=d.render(c.createElement(e.Components.NExceptionModal,{className:a}),document.getElementById("exception_modal_container"))}return e.exceptionDialog},TITLE:"Exception Raised...",Z_INDEX:9998},propTypes:{className:c.PropTypes.string},getDefaultProps:function(){return{}},getInitialState:function(){return{visible:!1}},fixDocumentPadding:function(){document.body.style.paddingRight=0},componentDidUpdate:function(a,c){this.fixDocumentPadding(),this.state.visible?b(document).on("keyup",this.onDocumentKeyUp):b(document).off("keyup",this.onDocumentKeyUp)},componentDidMount:function(){this.fixDocumentPadding(),this.state.visible?b(document).on("keyup",this.onDocumentKeyUp):b(document).off("keyup",this.onDocumentKeyUp)},componentWillUpdate:function(){b(document).off("keyup",this.onDocumentKeyUp)},componentWillUnmount:function(){b(document).off("keyup",this.onDocumentKeyUp)},renderContent:function(){var a=this.state.status,b=e.ComponentConstants.Http_Status[a],d=this.state.message;return c.createElement("div",null,c.createElement("h6",null,a,": ",b),null!=d?c.createElement("pre",null,d):null)},render:function(){if(!this.state.visible)return null;var a={"n-exception-modal":!0,modal:!0,fade:!0,in:!0};return this.props.className&&(a[this.props.className]=!0),c.createElement("div",null,c.createElement("div",{className:"modal-backdrop fade in",style:{zIndex:f.Z_INDEX}}),c.createElement("div",{className:e.LayoutHelper.classSet(a),tabIndex:"-1",role:"dialog",ref:"container",style:{display:"block",zIndex:f.Z_INDEX+1}},c.createElement("div",{className:"modal-danger modal-dialog",tabIndex:"0"},c.createElement("div",{className:"modal-content",role:"document"},c.createElement("div",{className:"modal-header"},c.createElement("button",{className:"close",onClick:this.hide,"aria-label":"Close",style:{marginTop:"-2px"}},c.createElement("span",{"aria-hidden":"true"},"×")),c.createElement("h4",{className:"modal-title"},f.TITLE)),c.createElement("div",{className:"modal-body"},this.renderContent())))))},onDocumentKeyUp:function(a){if(27===a.keyCode)this.hide();else if(9===a.keyCode){var c=b(a.target),d=b(this.refs.container);0==c.closest(d).length&&d.focus()}},hide:function(){this.setState({visible:!1,status:null,message:null})},show:function(a,c){b(":focus").blur(),this.setState({visible:!0,status:a,message:c})}});e.Components.NExceptionModal=f}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NFile",statics:{DEFAULT_PROPERTY_VALUES:{browseLabel:"",browseIcon:'<i class="fa fa-fw fa-folder-open-o"></i>',browseClass:"btn btn-link",uploadLabel:"",uploadIcon:'<i class="fa fa-fw fa-upload"></i>',uploadClass:"btn btn-link",removeLabel:"",removeIcon:'<i class="fa fa-fw fa-trash-o"></i>',removeClass:"btn btn-link",showClose:!1,showPreview:!0},MOBILE_SETTINGS:{previewSettings:{image:{width:"80px",height:"80px"},html:{width:"80px",height:"80px"},text:{width:"80px",height:"80px"},video:{width:"80px",height:"80px"},audio:{width:"80px",height:"80px"},flash:{width:"80px",height:"80px"},object:{width:"80px",height:"80px"},other:{width:"80px",height:"80px"}},browseIcon:'<i class="fa fa-fw fa-plus-square"></i>',showCaption:!0,layoutTemplates:{caption:"<span />",progress:"<span />"},showCancel:!1,dropZoneEnabled:!1}},getDefaultProps:function(){return{defaultOptions:{mobileEnabled:!0,multiple:!0,inputName:"fileData"}}},getInitialState:function(){return{monitors:{}}},beforeDidMount:function(){var a=b(d.findDOMNode(this.refs.file));a.fileinput(this.createDisplayOptions());var c=this,e=this.getEventMonitor();Object.keys(e).forEach(function(b){c.state.monitors[b]=function(){var a=Array.prototype.slice.call(arguments);a[0].reactComponent=c,e[b].apply(this,a)},a.on(b,c.state.monitors[b])});var f=b(d.findDOMNode(this.refs.comp));f.find(".kv-fileinput-caption").focus(this.onComponentFocused).blur(this.onComponentBlurred),f.find(".input-group-btn>.btn").focus(this.onComponentFocused).blur(this.onComponentBlurred)},beforeWillUnmount:function(){var a=b(d.findDOMNode(this.refs.file));this.getEventMonitor();Object.keys(this.state.monitors).forEach(function(b){a.off(b,this.state.monitors[b])}.bind(this)),a.fileinput("destroy")},render:function(){var a={"n-disabled":!this.isEnabled()};a[this.getComponentCSS("n-file")]=!0,a.mobile=this.isMobileEnabled();var b={file:!0};return c.createElement("div",{className:e.LayoutHelper.classSet(a),ref:"comp"},c.createElement("input",{type:"file",className:e.LayoutHelper.classSet(b),multiple:this.allowMultipleFiles(),disabled:!this.isEnabled(),name:this.getComponentOption("inputName"),ref:"file"}),this.renderNormalLine(),this.renderFocusLine())},createDisplayOptions:function(){var a=this,b=this.getLayout().getComponentOption();return Object.keys(b).filter(function(a){return-1==["type","multiple","inputName","mobileEnabled"].indexOf(a)}).forEach(function(c){if(b[c]=a.getComponentOption(c),null==b[c]){var d=f.DEFAULT_PROPERTY_VALUES[c];d?b[c]=d:delete b[c]}}),Object.keys(f.DEFAULT_PROPERTY_VALUES).forEach(function(a){null==b[a]&&(b[a]=f.DEFAULT_PROPERTY_VALUES[a])}),this.isMobileEnabled()&&Object.keys(f.MOBILE_SETTINGS).forEach(function(a){var c=f.MOBILE_SETTINGS[a];c&&(b[a]=c)}),b},allowMultipleFiles:function(){return this.getComponentOption("multiple")},onComponentFocused:function(){b(d.findDOMNode(this.refs.focusLine)).toggleClass("focus"),b(d.findDOMNode(this.refs.normalLine)).toggleClass("focus")},onComponentBlurred:function(){b(d.findDOMNode(this.refs.focusLine)).toggleClass("focus"),b(d.findDOMNode(this.refs.normalLine)).toggleClass("focus")},isMobileEnabled:function(){return this.isMobile()&&this.getComponentOption("mobileEnabled")}}));e.Components.NFile=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.File,function(a,b,d,f){return c.createElement(e.Components.NFile,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass({displayName:"NForm",statics:{LABEL_DIRECTION:"vertical"},getDefaultProps:function(){return{next:{icon:"angle-double-right",text:"Next",style:"primary",labelPosition:"left"},previous:{icon:"angle-double-left",text:"Previous",style:"primary"}}},getInitialState:function(){return{activeCard:null,next:b.extend({},this.props.next,{click:this.onNextClicked}),previous:b.extend({},this.props.previous,{click:this.onPreviousClicked}),expanded:{}}},componentWillUpdate:function(a){var b=this;this.getLayout().getCards().forEach(function(a){a.hasBadge()&&b.getModel().removeListener(a.getBadgeId(),"post","change",b.onModelChanged)})},componentDidUpdate:function(a,b){var c=this;this.getLayout().getCards().forEach(function(a){a.hasBadge()&&c.getModel().addListener(a.getBadgeId(),"post","change",c.onModelChanged)})},componentDidMount:function(){var a=this;this.getLayout().getCards().forEach(function(b){b.hasBadge()&&a.getModel().addListener(b.getBadgeId(),"post","change",a.onModelChanged)})},componentWillUnmount:function(){var a=this;this.getLayout().getCards().forEach(function(b){b.hasBadge()&&a.getModel().removeListener(b.getBadgeId(),"post","change",a.onModelChanged)})},renderSections:function(a){var b={},d=this;a.forEach(function(a){var c={label:a.getLabel(),comp:{type:e.ComponentConstants.Panel,style:a.getStyle(),expanded:a.isExpanded(),collapsible:a.isCollapsible(),visible:a.getVisible(),expandedLabel:a.getExpandedLabel(),collapsedLabel:a.getCollapsedLabel()},pos:{width:a.getWidth(),col:a.getColumnIndex(),row:a.getRowIndex()}};if(a.hasCheckInTitle()){c.comp.checkInTitle={data:a.getCheckInTitleDataId(),collapsible:a.getCheckInTitleCollapsible(),label:a.getCheckInTitleLabel()};var f=a.getCheckInTitleOption();Object.keys(f).forEach(function(a){c.comp.checkInTitle[a]=f[a]})}c.comp.editLayout=a.getCells(),b[d.getSectionKey(a)]=c});var f={comp:{type:e.ComponentConstants.Panel,editLayout:b},pos:{width:12}};return c.createElement(e.Components.NPanel,{model:this.getModel(),layout:e.createCellLayout(a[0].getParentCard().getId()+"-body",f),direction:this.getLabelDirection(),view:this.isViewMode()})},attachPreviousButton:function(a,c){this.getLayout().isCardButtonShown()&&(this.isPreviousCardBackable(c.getId())?a.splice(0,0,this.state.previous):a.splice(0,0,b.extend({enabled:!1},this.state.previous)))},attachNextButton:function(a){this.getLayout().isCardButtonShown()&&a.push(this.state.next)},wrapCustomButton:function(a){var c=this,d=b.extend({},a);return"next"===a.successCallback?d.click=function(b){a.click.call(c,b)&&c.onNextClicked()}:"prev"===a.successCallback?d.click=function(b){a.click.call(c,b)&&c.onPreviousClicked()}:"return"===a.successCallback&&(d.click=function(b){var d=a.click.call(c,b);"string"==typeof d&&c.jumpToCard(d)}),d},wrapCustomButtons:function(a){if(null==a)return null;if(Array.isArray(a)){var b=this;return a.map(function(a){return b.wrapCustomButton(a)})}return[this.wrapCustomButton(a)]},renderCard:function(a,b,d){var f={"n-card":!0},g=[];g.push.apply(g,this.wrapCustomButtons(a.getRightButtons()));var h=[];h.push.apply(h,this.wrapCustomButtons(a.getLeftButtons()));var i=null;if(b)if(f["n-card-active"]=a.getId()==this.state.activeCard,0==d)this.attachNextButton(g);else if(d==this.props.layout.getCards().length-1){this.attachPreviousButton(h,a);var j=a.getFinishButton();j&&g.push(j)}else this.attachPreviousButton(h,a),this.attachNextButton(g);else f["n-card-active"]=!0;return 0==g.length&&0==h.length||(g=g.reverse(),i=c.createElement(e.Components.NPanelFooter,{right:g,left:h,model:this.getModel(),view:this.isViewMode()})),c.createElement("div",{className:e.LayoutHelper.classSet(f),key:d},this.renderSections(a.getSections()),i)},renderBadge:function(a){if(a.hasBadge()){var b=a.getBadgeRender(),d=b?b.call(this,this.getModel().get(a.getBadgeId()),this.getModel()):this.getModel().get(a.getBadgeId());return c.createElement("span",{className:"badge"}," ",d)}return null},renderWizards:function(){var a=e.LayoutHelper.classSet({nav:!0,"nav-justified":!0,"nav-pills":!0,"nav-direction-vertical":!1,"n-cards-nav":!0,"n-cards-free":this.isFreeCard()}),b=this;return c.createElement("ul",{className:a,key:"wizards"},this.getLayout().getCards().map(function(a,d){var f={active:a.getId()==b.state.activeCard,before:b.isBeforeActiveCard(a.getId()),after:b.isAfterActiveCard(a.getId())},g=null;b.isFreeCard()&&(g=function(){b.jumpToCard(a.getId())});var h=null;if(null!=a.getIcon()){var i={fa:!0,"fa-fw":!0};i["fa-"+a.getIcon()]=!0,h=c.createElement("span",{className:e.LayoutHelper.classSet(i)})}return c.createElement("li",{className:e.LayoutHelper.classSet(f),key:d},c.createElement("a",{href:"javascript:void(0);",onClick:g},h," ",a.getLabel(),b.renderBadge(a)))}))},renderCards:function(){var a=this.getLayout().getCards();if(1==a.length)return this.renderCard(a[0],!1);var b=this;this.initActiveCard();var c=[];c.push(this.renderWizards());var d=0;return a.forEach(function(a){c.push(b.renderCard(a,!0,d)),d++}),c},initActiveCard:function(){if(null==this.state.activeCard){var a=this,b=this.getLayout().getCards();b.forEach(function(b){b.isActive()&&(a.state.activeCard=b.getId())}),this.state.activeCard||(this.state.activeCard=b[0].getId())}},render:function(){var a={"n-form":!0};return this.props.className&&(a[this.props.className]=!0),c.createElement("div",{className:e.LayoutHelper.classSet(a)},this.renderCards())},onModelChanged:function(a){this.forceUpdate()},onPreviousClicked:function(){var a=this.getActiveCardIndex(),b=this.getLayout().getCards()[a-1];(this.isFreeCard()||b.isBackable())&&this.setState({activeCard:b.getId()})},onNextClicked:function(){var a=this.getActiveCardIndex(),b=this.getLayout().getCards()[a+1];this.setState({activeCard:b.getId()})},jumpToCard:function(a){this.setState({activeCard:a})},getActiveCardIndex:function(a){for(var b=a||this.state.activeCard,c=this.getLayout().getCards(),d=0,e=0,f=c.length;e<f;e++)if(c[e].getId()==b){d=e;break}return d},getSectionKey:function(a){return a.getParentCard().getId()+"-"+a.getId()},isViewMode:function(){var a=this.state?this.state.isViewMode:null;return null==a?!0===this.props.view:a},isFreeCard:function(){return this.isViewMode()||this.getLayout().isFreeCard()},isPreviousCardBackable:function(a){if(this.isFreeCard())return!0;var b=this.getActiveCardIndex(a);return this.getLayout().getCards()[b-1].isBackable()},isAfterActiveCard:function(a){return this.getActiveCardIndex(a)-this.getActiveCardIndex()>0},isBeforeActiveCard:function(a){return this.getActiveCardIndex(a)-this.getActiveCardIndex()<0},getModel:function(){return this.props.model},getLabelDirection:function(){return this.props.direction?this.props.direction:f.LABEL_DIRECTION},getLayout:function(){return this.props.layout},getCellComponent:function(a){var b=this.refs[a];return b?b.refs[a]:null}});e.Components.NForm=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.Form,function(a,b,d,f){var g=e.createFormLayout(b.getComponentOption("editLayout"));return c.createElement(e.Components.NForm,e.LayoutHelper.transformParameters(a,g,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NFormButtonFooter",render:function(){var a=this.getButtonLayout();return c.createElement(e.Components.NPanelFooter,{model:this.props.model,view:this.isViewMode(),save:a.save,validate:a.validate,cancel:a.cancel,reset:a.reset,left:a.left,right:a.right})},getButtonLayout:function(){return this.getComponentOption("buttonLayout")}}));e.Components.NFormButtonFooter=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.ButtonFooter,function(a,b,d,f){return c.createElement(e.Components.NFormButtonFooter,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NFormCell",keepRender:!0,statics:{REQUIRED_ICON:"asterisk",TOOLTIP_ICON:"question-circle",LABEL_WIDTH:4,__componentRenderer:{},registerComponentRenderer:function(a,b){e.LayoutHelper.registerComponentRenderer(a,b)},getComponentRenderer:function(a){return e.LayoutHelper.getComponentRenderer(a)}},getDefaultProps:function(){return{defaultOptions:{},direction:"vertical"}},beforeWillUpdate:function(a){this.destroyPopover(),this.removeRequiredDependencyMonitor()},beforeDidUpdate:function(a,b){this.renderPopover(),this.addRequiredDependencyMonitor()},beforeDidMount:function(){this.renderPopover(),this.addRequiredDependencyMonitor()},beforeWillUnmount:function(){this.destroyPopover(),this.removeRequiredDependencyMonitor()},destroyPopover:function(){var a=this.refs.comp;null!=a&&b(d.findDOMNode(a)).popover("destroy");var c=this.refs.tooltip;null!=c&&b(d.findDOMNode(c)).popover("destroy")},renderPopover:function(){var a=this.getComponentOption("tooltip");if(null!=a){"string"==typeof a&&(a={text:a});var c={title:a.title,content:a.text,placement:a.position?a.position:"top",trigger:"hover",container:"body",html:!0,animation:!1};b(d.findDOMNode(this.refs.tooltip)).popover(c)}if(e.ComponentConstants.ERROR_POPOVER&&!1!==this.getLayout().getComponentType().popover&&this.getModel().hasError(this.getDataId())){var f=this.getModel().getError(this.getDataId()),g=this,h={placement:"top",trigger:"hover",html:!0,content:f.map(function(a){return"<span style='display:block'>"+a.format([g.getLayout().getLabel(g)])+"</span>"}),container:"body",animation:!1,template:'<div class="popover form-cell-error" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'},i=this.refs.comp;if(null!=i){var j=b(d.findDOMNode(i));j.popover(h),0!=j.has(b(":focus")).length&&j.popover("show")}}},renderInputComponent:function(a){var b=this.props.direction?this.props.direction:"vertical";if(a.render)return a.render.call(this,this.getFormModel(),this.getLayout(),b,this.isViewMode());var d=a.type;d||(d="text");var f=e.LayoutHelper.getComponentRenderer(d).call(this,this.getFormModel(),this.getLayout(),b,this.isViewMode());return c.createElement("div",{ref:"comp"},f)},isRequiredSignPaint:function(){if(this.isViewMode())return!1;var a=this.getComponentOption("paintRequired");return null==a?!!(a=this.getModel().isRequired(this.getDataId()))||this.isRequiredSignNeeded():"boolean"==typeof a?a:"function"==typeof a&&"boolean"==typeof(a=a.call(this))?a:this.getModel().isRequired(this.getDataId(),a)},renderLabel:function(){var a=this.getComponentOption("labelIcon"),b=a?c.createElement("span",{className:"label-icon fa fa-fw fa-"+a}):null,d={fa:!0,"fa-fw":!0,required:!0};d["fa-"+f.REQUIRED_ICON]=!0;var g=this.isRequiredSignPaint()?c.createElement("span",{className:e.LayoutHelper.classSet(d)}):null,h=this.getComponentOption("tooltip"),i=null,j={fa:!0,"fa-fw":!0,"n-form-cell-tooltip":!0};return null!=h&&(j["fa-"+f.TOOLTIP_ICON]=!0,i=c.createElement("span",{className:e.LayoutHelper.classSet(j),ref:"tooltip"})),c.createElement("span",{className:this.getLayout().getLabelCSS(),onClick:this.onLabelClicked,ref:"label"},b,this.getLayout().getLabel(this),i,g,this.getComponentOption("customLabelAddon"))},render:function(){if(this.isVisible()){var a=this.getCSSClassName();this.getModel().hasError(this.getDataId())&&!1!==this.getLayout().getComponentType().renderError&&(a+=" has-error"),this.isEnabled()||(a+=" n-form-cell-disabled");var b=this.getLayout().getComponentType();if(!1===b.label)return c.createElement("div",{className:a,ref:"div"},this.renderInputComponent(b));var d=this.getComponentOption("labelDirection");return null==d&&(d=this.props.direction?this.props.direction:"vertical"),"vertical"!=d?c.createElement("div",{className:a+" horizontal-label",ref:"div"},c.createElement("div",{className:"row"},c.createElement("div",{className:this.getHorizontalLabelCSS()},this.renderLabel()),c.createElement("div",{className:this.getHorizontalComponentCSS()},this.renderInputComponent(b)))):c.createElement("div",{className:a+" vertical-label",ref:"div"},this.renderLabel(),this.renderInputComponent(b))}return c.createElement("div",{className:this.getCSSClassName()+" n-form-cell-invisible"})},onModelChanged:function(b){var c=this.getValidationOption("delay",this.getLayout().getComponentType().delay);null!=c&&c>0?(this.state.delayedValidation&&a.clearTimeout(this.state.delayedValidation),this.state.delayedValidation=a.setTimeout(function(){this.validate()}.bind(this),c)):this.validate()},onLabelClicked:function(){b(d.findDOMNode(this.refs.comp)).focus()},getCSSClassName:function(){var a=this.getLayout().getWidth(),b={"n-form-cell":!0};return"number"==typeof a||"string"==typeof a?(b["col-sm-"+a]=!0,b["col-md-"+a]=!0,b["col-lg-"+a]=!0):(Object.keys(a).forEach(function(c){b["col-"+c+"-"+a[c]]=!0}),void 0===a.sm&&(b["col-sm-"+a.width]=!0),void 0===a.md&&(b["col-md-"+a.width]=!0),void 0===a.lg&&(b["col-lg-"+a.width]=!0)),this.getLayout().getCellCSS(e.LayoutHelper.classSet(b))},getHorizontalLabelCSS:function(){var a=this.getHorizontalLabelWidth();return"col-sm-"+a+" col-md-"+a+" col-lg-"+a},getHorizontalComponentCSS:function(){var a=12-this.getHorizontalLabelWidth();return"col-sm-"+a+" col-md-"+a+" col-lg-"+a},getHorizontalLabelWidth:function(){var a=this.getComponentOption("labelWidth");return a||f.LABEL_WIDTH},registerToComponentCentral:function(){var a=this.getComponentCentralId();a&&e.LayoutHelper.registerComponent(a+"@cell",this)},unregisterFromComponentCentral:function(){var a=this.getComponentCentralId();a&&e.LayoutHelper.unregisterComponent(a+"@cell",this)}}));e.Components.NFormCell=f}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NFormTab",getDefaultProps:function(){return{defaultOptions:{tabType:"tab",justified:!1,titleDirection:"horizontal"}}},beforeWillUpdate:function(a){this.uninstallBadgeMonitor()},beforeDidUpdate:function(a,b){this.installBadgeMonitor()},beforeDidMount:function(){this.installBadgeMonitor()},beforeWillUnmount:function(){this.uninstallBadgeMonitor()},installBadgeMonitor:function(){this.getTabs().forEach(function(a){a.badgeId&&this.addDependencyMonitor([a.badgeId])}.bind(this))},uninstallBadgeMonitor:function(){this.getTabs().forEach(function(a){a.badgeId&&this.removeDependencyMonitor([a.badgeId])}.bind(this))},renderTabContent:function(a,b){var d=this.getActiveTabIndex(),f={"n-form-tab-card":!0,show:b==d,hide:b!=d};return c.createElement(e.Components.NForm,{model:this.getModel(),layout:a,direction:this.props.direction,view:this.isViewMode(),className:e.LayoutHelper.classSet(f),key:"form-"+b})},render:function(){var a=this.initializeTabs(),b=this.getComponentOption("canActive");return b&&b.bind(this),c.createElement("div",{className:this.getComponentCSS("n-form-tab")},c.createElement(e.Components.NTab,{type:this.getComponentOption("tabType"),justified:this.getComponentOption("justified"),direction:this.getComponentOption("titleDirection"),size:this.getComponentOption("titleIconSize"),tabClassName:this.getAdditionalCSS("tabs"),tabs:a,canActive:b,onActive:this.onTabClicked,ref:"tabs"}),c.createElement("div",{className:"n-form-tab-content",ref:"content"},this.getTabLayouts().map(this.renderTabContent)))},getTabs:function(){return this.getComponentOption("tabs")},initializeTabs:function(){var a=this,b=this.getTabs();return b.forEach(function(b){b.badgeId&&(b.badge=a.getModel().get(b.badgeId),b.badgeRender&&(b.badge=b.badgeRender.call(a,b.badge,a.getModel())))}),b},getTabLayouts:function(){return this.getTabs().map(function(a){return e.createFormLayout(a.layout||a.editLayout)})},onTabClicked:function(a,b){this.setActiveTabIndex(b);var c=this.getComponentOption("onActive");c&&c.call(this,a,b)},getActiveTabIndex:function(){var a=this.getComponentOption("tabs"),b=a.findIndex(function(a,b){return!0===a.active});return-1==b&&(b=a.findIndex(function(a,b){if(!1!==a.visible)return a.active=!0,!0})),b},setActiveTabIndex:function(a){this.refs.tabs.setActiveTabIndex(a),this.forceUpdate()}}));e.Components.NFormTab=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.Tab,function(a,b,d,f){return c.createElement(e.Components.NFormTab,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass({displayName:"NIcon",getDefaultProps:function(){return{fixWidth:!1,spin:!1}},getSize:function(){var a={"fa-lg":"lg"===this.props.size,"fa-2x":"2x"===this.props.size,"fa-3x":"3x"===this.props.size,"fa-4x":"4x"===this.props.size,"fa-5x":"5x"===this.props.size,"fa-fw":this.props.fixWidth};return this.props.size&&(a["fa-"+this.props.size]=!0),a},getIcon:function(){var a={fa:!0,"fa-spin":this.props.spin,"fa-pulse":this.props.pulse,"fa-rotate-90":90==this.props.rotate,"fa-rotate-180":180==this.props.rotate,"fa-rotate-270":270==this.props.rotate,"fa-flip-horizontal":"h"===this.props.flip,"fa-flip-vertical":"v"===this.props.flip};return a["fa-"+this.props.icon]=!0,this.props.iconClassName&&(a[this.props.iconClassName]=!0),a},getBackIcon:function(){var a={fa:!0,"fa-spin":this.props.backSpin,"fa-pulse":this.props.backPulse,"fa-rotate-90":90==this.props.backRotate,"fa-rotate-180":180==this.props.backRotate,"fa-rotate-270":270==this.props.backRotate,"fa-flip-horizontal":"h"===this.props.backFlip,"fa-flip-vertical":"v"===this.props.backFlip};return a["fa-"+this.props.backIcon]=!0,this.props.backClassName&&(a[this.props.backClassName]=!0),a},render:function(){var a=this.getSize(),d=this.getIcon();if(this.props.backIcon){a["fa-stack"]=!0,d["fa-stack-1x"]=!0;var f=this.getBackIcon();return f["fa-stack-2x"]=!0,c.createElement("span",{className:e.LayoutHelper.classSet(a),title:this.props.tooltip},c.createElement("i",{className:e.LayoutHelper.classSet(d)}),c.createElement("i",{className:e.LayoutHelper.classSet(f)}))}return c.createElement("span",{className:e.LayoutHelper.classSet(b.extend(d,a)),title:this.props.tooltip})}});e.Components.NIcon=f}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass({displayName:"NJumbortron",renderText:function(){return Array.isArray(this.props.highlightText)?this.props.highlightText.map(function(a,b){return c.createElement("h4",{key:b},a)}):c.createElement("h4",null,this.props.highlightText)},render:function(){return c.createElement("div",{className:"n-jumbotron jumbotron"},this.renderText())}});e.Components.NJumbortron=f}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NLabel",getDefaultProps:function(){return{defaultOptions:{textFromModel:!0}}},render:function(){var a=this.getText();if(!Array.isArray(a)){var b=this.getComponentOption("convertor");if(b&&"function"==typeof b)a=[b.call(this,a)];else if(b&&b.view)a=[b.view.call(this,a)];else{var d=this.getComponentOption("currency");if(d&&null!=a&&!(a+"").isBlank()){var f=this.getComponentOption("fraction");f=f?1*f:0,a=(a+"").currencyFormat(f)}(null==a||(a+"").isBlank())&&(a=this.getComponentOption("replaceBlank")||this.getComponentOption("placeholder"));var g=this.getComponentOption("left"),h=this.getComponentOption("right");a=g?g+a:a,a=h?a+h:a,a=[a]}}var i={"n-disabled":!this.isEnabled()};i[this.getComponentCSS("n-label")]=!0;var j=this.getComponentOption("style");return j&&(i["n-label-"+j]=!0),c.createElement("div",{className:e.LayoutHelper.classSet(i)},a.map(function(a,b){return c.createElement("span",{key:b},a)}))},getText:function(){return this.isTextFromModel()?this.getValueFromModel():this.getLayout().getLabel(this)},isTextFromModel:function(){return!1!==this.getComponentOption("textFromModel")}}));e.Components.NLabel=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.Label,function(a,b,d,f){return c.createElement(e.Components.NLabel,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass({displayName:"NConfirm",statics:{getConfirmModal:function(a){if(void 0===e.confirmDialog||null===e.confirmDialog){
0==b("#confirm_modal_container").length&&b("<div id='confirm_modal_container' />").appendTo(b(document.body)),e.confirmDialog=d.render(c.createElement(e.Components.NConfirm,{className:a}),document.getElementById("confirm_modal_container"))}return e.confirmDialog},OK_TEXT:"OK",OK_ICON:"check",CLOSE_TEXT:"Close",CLOSE_ICON:"ban",CANCEL_TEXT:"Cancel",CANCEL_ICON:"ban",Z_INDEX:9698},getDefaultProps:function(){return{}},getInitialState:function(){return{visible:!1}},fixDocumentPadding:function(){document.body.style.paddingRight=0},componentDidUpdate:function(a,c){this.fixDocumentPadding(),this.state.visible?b(document).on("keyup",this.onDocumentKeyUp):b(document).off("keyup",this.onDocumentKeyUp)},componentDidMount:function(){this.fixDocumentPadding(),this.state.visible?b(document).on("keyup",this.onDocumentKeyUp):b(document).off("keyup",this.onDocumentKeyUp)},componentWillUpdate:function(){b(document).off("keyup",this.onDocumentKeyUp)},componentWillUnmount:function(){b(document).off("keyup",this.onDocumentKeyUp)},renderConfirmButton:function(){if(this.state.options&&this.state.options.disableConfirm)return null;var a=e.createCellLayout("pseudo-button",{label:this.state.options&&this.state.options.confirmText?this.state.options.confirmText:f.OK_TEXT,comp:{type:e.ComponentConstants.Button,icon:f.OK_ICON,style:"primary",click:this.onConfirmClicked}});return c.createElement(e.Components.NFormButton,{layout:a,model:e.createModel({})})},renderCloseButton:function(){if(this.state.options&&this.state.options.disableClose)return null;var a=e.createCellLayout("pseudo-button",{label:this.state.options&&this.state.options.close?f.CLOSE_TEXT:f.CANCEL_TEXT,comp:{type:e.ComponentConstants.Button,icon:this.state.options&&this.state.options.close?f.CLOSE_ICON:f.CANCEL_ICON,style:"danger",click:this.onCancelClicked}});return c.createElement(e.Components.NFormButton,{layout:a,model:e.createModel({})})},renderDialogCloseButton:function(){return this.isDialogCloseShown()?c.createElement("button",{className:"close",onClick:this.onCancelClicked,"aria-label":"Close",style:{marginTop:"-2px"}},c.createElement("span",{"aria-hidden":"true"},"×")):null},renderFooter:function(){return this.state.options&&this.state.options.disableButtons?c.createElement("div",{className:"modal-footer-empty"}):c.createElement("div",{className:"modal-footer"},this.renderCloseButton(),this.renderConfirmButton())},renderContent:function(){var a=this.state.options;return"string"==typeof a&&(a=[a]),Array.isArray(a)||"string"==typeof(a=a.messages)&&(a=[a]),a.map(function(a,b){return c.createElement("h6",{key:b},a)})},render:function(){if(!this.state.visible)return null;var a={"n-confirm":!0,modal:!0,fade:!0,in:!0};return this.props.className&&(a[this.props.className]=!0),c.createElement("div",null,c.createElement("div",{className:"modal-backdrop fade in",style:{zIndex:f.Z_INDEX}}),c.createElement("div",{className:e.LayoutHelper.classSet(a),tabIndex:"-1",role:"dialog",ref:"container",style:{display:"block",zIndex:f.Z_INDEX+1}},c.createElement("div",{className:"modal-dialog",tabIndex:"0"},c.createElement("div",{className:"modal-content",role:"document"},c.createElement("div",{className:"modal-header"},this.renderDialogCloseButton(),c.createElement("h4",{className:"modal-title"},this.state.title)),c.createElement("div",{className:"modal-body"},this.renderContent()),this.renderFooter()))))},onDocumentKeyUp:function(a){if(27===a.keyCode)this.onCancelClicked();else if(9===a.keyCode){var c=b(a.target),d=b(this.refs.container);0==c.closest(d).length&&d.focus()}},hide:function(){this.setState({visible:!1,title:null,options:null,onConfirm:null,onCancel:null})},onConfirmClicked:function(){this.state.onConfirm&&this.state.onConfirm.call(this),this.hide(),this.state.afterClose&&this.state.afterClose.call(this,"confirm")},onCancelClicked:function(){this.state.onCancel&&this.state.onCancel.call(this),this.hide(),this.state.afterClose&&this.state.afterClose.call(this,"cancel")},isDialogCloseShown:function(){return this.state&&this.state.buttons&&!0===this.state.buttons.disableDialogClose},show:function(a,c,d,e){b(":focus").blur();var f;"string"==typeof a?f={visible:!0,title:a,options:c,onConfirm:d,onCancel:e,afterClose:c.afterClose}:(c=a,f={visible:!0,title:c.title,options:{disableButtons:c.disableButtons,disableConfirm:c.disableConfirm,disableClose:c.disableClose,disableDialogClose:c.disableDialogClose,confirmText:c.confirmText,close:c.close,messages:c.messages},onConfirm:c.onConfirm,onCancel:c.onCancel,afterClose:c.afterClose}),this.setState(f)}});e.Components.NConfirm=f}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass({displayName:"NModalForm",statics:{createFormModal:function(a,f){void 0===e.formModalIndex||null===e.formModalIndex?e.formModalIndex=1500:e.formModalIndex+=1;var g="form_modal_container_"+e.formModalIndex;0==b("#"+g).length&&b("<div id='"+g+"' />").appendTo(b(document.body));var h={"n-modal-form":!0};return f&&(h[f]=!0),d.render(c.createElement(e.Components.NModalForm,{title:a,className:e.LayoutHelper.classSet(h),zIndex:e.formModalIndex}),document.getElementById(g))},RESET_CONFIRM_TITLE:"Reset Data",RESET_CONFIRM_MESSAGE:["Are you sure to reset data?","All data will be lost and cannot be recovered."],CANCEL_CONFIRM_TITLE:"Cancel Editing",CANCEL_CONFIRM_MESSAGE:["Are you sure to cancel current operating?","All data will be lost and cannot be recovered."]},getInitialState:function(){return{visible:!1,expanded:!0,collapsible:!1,draggable:!0}},fixDocumentPadding:function(){document.body.style.paddingRight=0},setDraggable:function(){if(this.isDraggable()&&this.refs.top){var c=b(d.findDOMNode(this.refs.top)),e=c.children(".modal");e.drags({handle:".modal-header"}),e.css({overflow:"visible",height:0});var f=e.children(".modal-dialog");if(f.css({height:0}),this.state.modal||c.find(".modal-backdrop").hide(),this.state.pos){var g={top:parseInt(f.css("margin-top")),left:parseInt(f.css("margin-left")),bottom:parseInt(f.css("margin-bottom")),right:parseInt(f.css("margin-right"))},h=f.children(".modal-content"),i={},j=parseInt(h.css("top"));isNaN(j)?null!=this.state.pos.bottom?i.bottom=g.bottom+h.height()-b(a).height():null!=this.state.pos.top&&(i.top=this.state.pos.top-g.top):i.top=j;var k=parseInt(h.css("left"));isNaN(k)?null!=this.state.pos.right?i.right=this.state.pos.right-g.right:null!=this.state.pos.left&&(i.left=this.state.pos.left-g.left):i.left=k,Object.keys(i).length>0&&h.css(i)}}},stopDraggable:function(){if(this.refs.top){b(d.findDOMNode(this.refs.top)).children(".modal").stopDrags({handle:".modal-header"})}},componentDidUpdate:function(a,c){this.fixDocumentPadding(),this.setDraggable(),this.isDialogCloseShown()&&b(document).on("keyup",this.onDocumentKeyUp),this.state.visible?b(document).on("keydown",this.onDocumentKeyDown):b(document).off("keydown",this.onDocumentKeyDown)},componentWillUpdate:function(){this.stopDraggable(),this.isDialogCloseShown()&&b(document).off("keyup",this.onDocumentKeyUp),b(document).off("keydown",this.onDocumentKeyDown)},componentDidMount:function(){this.fixDocumentPadding(),this.setDraggable(),this.isDialogCloseShown()&&b(document).on("keyup",this.onDocumentKeyUp),this.state.visible?b(document).on("keydown",this.onDocumentKeyDown):b(document).off("keydown",this.onDocumentKeyDown)},componentWillUnmount:function(){this.stopDraggable(),this.isDialogCloseShown()&&b(document).off("keyup",this.onDocumentKeyUp),b(document).off("keydown",this.onDocumentKeyDown)},renderFooter:function(){return!1!==this.state.footer&&this.state.expanded?c.createElement("div",{className:"n-modal-form-footer modal-footer",ref:"footer"},c.createElement(e.Components.NPanelFooter,{reset:this.getResetButton(),validate:this.getValidationButton(),save:this.getSaveButton(),cancel:this.getCancelButton(),left:this.getLeftButton(),right:this.getRightButton(),model:this.getModel(),view:this.isViewMode()})):c.createElement("div",{ref:"footer"})},renderBody:function(){var a={"modal-body":!0,hide:!this.state.expanded};return c.createElement("div",{className:e.LayoutHelper.classSet(a)},c.createElement(e.Components.NForm,{model:this.getModel(),layout:this.getLayout(),direction:this.getDirection(),view:this.isViewMode(),ref:"form"}))},renderCloseButton:function(){return this.isDialogCloseShown()?c.createElement("button",{className:"close",onClick:this.hide,"aria-label":"Close",style:{marginTop:"-2px"}},c.createElement("span",{"aria-hidden":"true"},"×")):null},render:function(){if(!this.state.visible)return null;var a=this.state.title?this.state.title:this.props.title;this.isCollapsible()&&(a=c.createElement("a",{href:"javascript:void(0);",onClick:this.onTitleClicked},a));var b={"n-confirm":!0,modal:!0,fade:!0,in:!0};return this.props.className&&(b[this.props.className]=!0),c.createElement("div",{ref:"top"},c.createElement("div",{className:"modal-backdrop fade in",style:{zIndex:1*this.props.zIndex}}),c.createElement("div",{className:e.LayoutHelper.classSet(b),role:"dialog",ref:"container",tabIndex:"0",style:{display:"block",zIndex:1*this.props.zIndex+1}},c.createElement("div",{className:"modal-dialog"},c.createElement("div",{className:"modal-content",role:"document"},c.createElement("div",{className:"modal-header"},this.renderCloseButton(),c.createElement("h4",{className:"modal-title"},a)),this.renderBody(),this.renderFooter()))))},onDocumentKeyUp:function(a){27===a.keyCode&&this.hide()},onDocumentKeyDown:function(a){if(9===a.keyCode){var c=b(a.target),d=b(this.refs.container);console.log(0==c.closest(d).length),0==c.closest(d).length&&d.focus()}},onTitleClicked:function(){this.setState({expanded:!this.state.expanded})},onResetClicked:function(){var a=function(){this.getModel().reset(),this.refs.form.forceUpdate()};e.Components.NConfirm.getConfirmModal().show(f.RESET_CONFIRM_TITLE,f.RESET_CONFIRM_MESSAGE,a.bind(this))},onValidateClicked:function(){this.getModel().validate(),this.forceUpdate()},onCancelClicked:function(){this.state.buttons&&"function"==typeof this.state.buttons.cancel?this.hide():e.Components.NConfirm.getConfirmModal().show(f.CANCEL_CONFIRM_TITLE,f.CANCEL_CONFIRM_MESSAGE,this.hide)},getModel:function(){return this.state.model},getLayout:function(){return this.state.layout},getDirection:function(){return this.state.direction},getLeftButton:function(){return this.state.buttons?this.state.buttons.left:null},getRightButton:function(){return this.state.buttons?this.state.buttons.right:null},getValidationButton:function(){return this.state.buttons&&!1===this.state.buttons.validate?null:this.isViewMode()?null:this.onValidateClicked},getCancelButton:function(){return this.state.buttons&&!1===this.state.buttons.cancel?null:this.onCancelClicked},getResetButton:function(){return this.state.buttons&&!1===this.state.buttons.reset?null:this.isViewMode()?null:this.onResetClicked},getSaveButton:function(){return this.state.buttons?this.state.buttons.save:null},isDialogCloseShown:function(){return!this.state.buttons||!1!==this.state.buttons.dialogCloseShown},isDraggable:function(){return this.state.draggable||!this.state.modal},isCollapsible:function(){return this.state.collapsible},isExpanded:function(){return this.state.expanded},isViewMode:function(){return this.state.view},validate:function(){return this.getModel().validate(),this.forceUpdate(),this.getModel().hasError()},hide:function(){var a=this.state.model;return this.state.buttons&&"function"==typeof this.state.buttons.cancel?this.state.buttons.cancel.call(this,a,function(){this.setState({visible:!1,model:null,layout:null,buttons:null})}.bind(this)):this.setState({visible:!1,model:null,layout:null,buttons:null}),a},show:function(b,c,d,e,f,g){b.getCurrentModel?(a.console.warn("Properties [draggable, expanded, collapsible, pos] are not supported in parameters, use JSON parameter instead."),this.setState({visible:!0,model:b,layout:c,buttons:d,direction:e,footer:f,title:g,draggable:!1,modal:!0,expanded:!0,collapsible:!1,view:!1})):this.setState({visible:!0,model:b.model,layout:b.layout,buttons:b.buttons,direction:b.direction,footer:b.footer,title:b.title,draggable:b.draggable,modal:null!=b.modal||!b.draggable,collapsible:b.collapsible,expanded:null==b.expanded||b.expanded,pos:b.pos,view:!0===b.view})}});e.Components.NModalForm=f,b.fn.drags=function(a){a=b.extend({handle:"",cursor:"move"},a);var c=null;return c=""===a.handle?this:this.find(a.handle),c.css("cursor",a.cursor).on("mousedown",function(c){var d=null;d=""===a.handle?b(this).addClass("draggable"):b(this).addClass("active-handle").parent().addClass("draggable");var e=d.css("z-index"),f=d.outerHeight(),g=d.outerWidth(),h=d.offset().top+f-c.pageY,i=d.offset().left+g-c.pageX;d.parents().on("mousemove",function(a){b(".draggable").offset({top:a.pageY+h-f,left:a.pageX+i-g}).on("mouseup",function(){b(this).removeClass("draggable").css("z-index",e)})}),c.preventDefault()}).on("mouseup",function(){""===a.handle?b(this).removeClass("draggable"):b(this).removeClass("active-handle").parent().removeClass("draggable")})},b.fn.stopDrags=function(a){a=b.extend({handle:"",cursor:"move"},a);var c=null;c=""===a.handle?this:this.find(a.handle);var d=null;return d=""===a.handle?b(c):b(c).parent(),d.parents().off("mousemove"),c.off("mousedown mouseup")}}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass({displayName:"NNormalLabel",propTypes:{text:c.PropTypes.oneOfType([c.PropTypes.string,c.PropTypes.arrayOf(c.PropTypes.string)]),style:c.PropTypes.string,className:c.PropTypes.string},getDefaultProps:function(){return{}},render:function(){var a=this.getText();Array.isArray(a)||(a=[a]);var b={"n-normal-label":!0};return this.props.className&&(b[this.props.className]=!0),this.props.style&&(b["n-label-"+this.props.style]=!0),this.props.size&&(b["n-label-"+this.props.size]=!0),c.createElement("span",{className:e.LayoutHelper.classSet(b)},a.map(function(a,b){return c.createElement("span",{key:b},a)}))},getText:function(){return this.props.text}});e.Components.NNormalLabel=f}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass({displayName:"NOnRequestModal",statics:{getOnRequestModal:function(a){if(void 0===e.onRequestDialog||null===e.onRequestDialog){0==b("#onrequest_modal_container").length&&b("<div id='onrequest_modal_container' />").appendTo(b(document.body)),e.onRequestDialog=d.render(c.createElement(e.Components.NOnRequestModal,{className:a}),document.getElementById("onrequest_modal_container"))}return e.onRequestDialog},WAITING_MESSAGE:"Send request to server and waiting for response...",Z_INDEX:9898},getInitialState:function(){return{visible:!1}},fixDocumentPadding:function(){document.body.style.paddingRight=0},componentDidUpdate:function(a,c){this.fixDocumentPadding(),this.state.visible?b(document).on("keydown",this.onDocumentKeyDown):b(document).off("keydown",this.onDocumentKeyDown)},componentWillUpdate:function(){b(document).off("keydown",this.onDocumentKeyDown)},componentDidMount:function(){this.fixDocumentPadding(),this.state.visible?b(document).on("keydown",this.onDocumentKeyDown):b(document).off("keydown",this.onDocumentKeyDown)},componentWillUnmount:function(){b(document).off("keydown",this.onDocumentKeyDown)},render:function(){if(!this.state.visible)return null;var a={"n-on-request":!0,modal:!0,fade:!0,in:!0};return this.props.className&&(a[this.props.className]=!0),c.createElement("div",null,c.createElement("div",{className:"modal-backdrop fade in",style:{zIndex:f.Z_INDEX}}),c.createElement("div",{className:e.LayoutHelper.classSet(a),tabIndex:"-1",role:"dialog",ref:"container",style:{display:"block",zIndex:f.Z_INDEX+1}},c.createElement("div",{className:"modal-danger modal-dialog",tabIndex:"0"},c.createElement("div",{className:"modal-content",role:"document"},c.createElement("div",{className:"modal-body",ref:"body"},c.createElement("span",{className:"fa fa-fw fa-lg fa-spin fa-spinner"})," ",f.WAITING_MESSAGE)))))},hide:function(){this.setState({visible:!1})},show:function(){this.setState({visible:!0})},onDocumentKeyDown:function(a){if(9===a.keyCode){var c=b(a.target),d=b(this.refs.container);0==c.closest(d).length&&d.focus()}}});e.Components.NOnRequestModal=f}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass({displayName:"NPageFooter",statics:{TECH_BASE:"Parrot",TECH_URL:"https://github.com/bradwoo8621/parrot",COMPANY:"NEST",COMPANY_URL:"https://github.com/bradwoo8621/nest",LEFT_TEXT:"For best viewing, we recommend using the latest Chrome version."},getDefaultProps:function(){return{}},renderTech:function(){return null==f.TECH_BASE||f.TECH_BASE.isBlank()?null:c.createElement("span",null,", on ",c.createElement("a",{href:f.TECH_URL,target:"_blank",tabIndex:"-1"},f.TECH_BASE))},renderCompany:function(){return null==f.COMPANY||f.COMPANY.isBlank()?null:c.createElement("span",null,", by ",c.createElement("a",{href:f.COMPANY_URL,target:"_blank",tabIndex:"-1"},f.COMPANY))},render:function(){return c.createElement("footer",{className:"footer"},c.createElement("div",{className:"container"},c.createElement("p",{className:"text-muted",style:{display:"inline-block"}},c.createElement("span",null,f.LEFT_TEXT)),c.createElement("p",{className:"text-muted pull-right",style:{display:"inline-block"}},this.props.name,this.renderTech(),this.renderCompany(),".")))}});e.Components.NPageFooter=f}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass({displayName:"NPageHeader",statics:{SEARCH_PLACEHOLDER:"Search..."},getDefaultProps:function(){return{side:!1}},getInitialState:function(){return{model:e.createModel({text:null})}},componentDidMount:function(){this.props.side&&this.props.menus&&(this.state.sideMenu=NSideMenu.getSideMenu(this.props.menus,null,null,!0))},renderSearchBox:function(){var a=e.createCellLayout("text",{comp:{placeholder:f.SEARCH_PLACEHOLDER,rightAddon:{icon:"search",click:this.onSearchClicked}}});return c.createElement("div",{className:"navbar-form navbar-right",role:"search"},c.createElement(e.Components.NText,{model:this.state.model,layout:a}))},renderMenuItem:function(a,b,d,e){if(void 0!==a.children){var f=this;return c.createElement("li",{className:e?"dropdown":"dropdown-submenu",key:b},c.createElement("a",{href:"#",className:"dropdown-toggle","data-toggle":"dropdown",role:"button","aria-expanded":"false"},a.text," ",e?c.createElement("span",{className:"caret"}):null),c.createElement("ul",{className:"dropdown-menu",role:"menu"},a.children.map(function(a,b,c){return f.renderMenuItem(a,b,c,!1)})))}return!0===a.divider?c.createElement("li",{className:"divider",key:b}):void 0!==a.func?c.createElement("li",null,c.createElement("a",{href:"javascript:void(0);",onClick:this.onMenuClicked.bind(this,a.func),key:b},a.text)):c.createElement("li",{key:b},c.createElement("a",{href:a.url},a.text))},renderMenus:function(){var a=this,b={"nav navbar-nav":!0};return this.props.side&&(b["nav-side"]=!0),c.createElement("ul",{className:e.LayoutHelper.classSet(b)},this.props.menus.map(function(b,c,d){return a.renderMenuItem(b,c,d,!0)}))},renderBrand:function(){return this.props.brandUrl?c.createElement("a",{href:this.props.brandUrl},c.createElement("span",{className:"navbar-brand"},this.props.brand)):this.props.brandFunc||this.props.side?c.createElement("a",{href:"javascript:void(0);",onMouseEnter:this.onBrandMouseEnter,onMouseLeave:this.onBrandMouseLeave,onClick:this.onBrandClicked},c.createElement("span",{className:"navbar-brand"},this.props.brand)):c.createElement("span",{className:"navbar-brand"},this.props.brand)},onBrandMouseEnter:function(){this.props.side&&this.state.sideMenu&&this.state.sideMenu.show()},onBrandMouseLeave:function(){this.props.side&&this.state.sideMenu&&this.state.sideMenu.willHide()},onBrandClicked:function(){this.props.brandFunc&&this.props.brandFunc.call(this)},onMenuClicked:function(a){a.call(this)},onSearchClicked:function(){this.props.search.call(this,this.state.model.get("text"))},render:function(){return c.createElement("nav",{className:"navbar navbar-default navbar-fixed-top"},c.createElement("div",{className:"container-fluid"},c.createElement("div",{className:"navbar-header"},c.createElement("button",{type:"button",className:"navbar-toggle collapsed","data-toggle":"collapse","data-target":"#navbar-1"},c.createElement("span",{className:"sr-only"},"Toggle navigation"),c.createElement("span",{className:"icon-bar"}),c.createElement("span",{className:"icon-bar"}),c.createElement("span",{className:"icon-bar"})),this.renderBrand()),c.createElement("div",{className:"collapse navbar-collapse",id:"navbar-1"},this.props.menus?this.renderMenus():null,this.props.search?this.renderSearchBox():null,this.props.custom?this.props.custom.call(this):null)))}});e.Components.NPageHeader=f}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass({displayName:"NPagination",statics:{PAGE_TEXT:"Page: "},getDefaultProps:function(){return{maxPageButtons:5,pageCount:1,currentPageIndex:1,showStatus:!0}},getMaxPageButtons:function(){var a=1*this.props.maxPageButtons;return a%2==0&&(a-=1),a<3&&(a=3),a},getPageButtonsRange:function(){var a=this.getCurrentPageIndex(),b=this.getMaxPageButtons(),c=0,d=this.getPageCount()-a,e=Math.floor(b/2);d>=e?c=a+e:(c=a+d,e+=e-d);var f=0;return f=a-1>=e?a-e:1,c-f<b&&(c=f+b-1,c=c>this.getPageCount()?this.getPageCount():c),{min:f,max:c}},renderFirst:function(a){return c.createElement("li",null,c.createElement("a",{href:"javascript:void(0);","aria-label":"First",onClick:this.toFirst},c.createElement("span",{className:"fa fa-fw fa-fast-backward"})))},renderPreviousSection:function(a){return c.createElement("li",null,c.createElement("a",{href:"javascript:void(0);","aria-label":"PreviousSection",onClick:this.toPreviousSection},c.createElement("span",{className:"fa fa-fw fa-backward"})))},renderPrevious:function(a){return c.createElement("li",null,c.createElement("a",{href:"javascript:void(0);","aria-label":"Previous",onClick:this.toPrevious},c.createElement("span",{className:"fa fa-fw fa-chevron-left"})))},renderButtons:function(a){for(var b=[],d=a.min;d<=a.max;d++)b.push(d);var f=this;return b.map(function(a){var b={active:a==f.getCurrentPageIndex()};return c.createElement("li",{key:a},c.createElement("a",{href:"javascript:void(0);",onClick:f.toPage,"data-index":a,className:e.LayoutHelper.classSet(b)},a))})},renderNext:function(a){return c.createElement("li",null,c.createElement("a",{href:"javascript:void(0);","aria-label":"Next",onClick:this.toNext},c.createElement("span",{className:"fa fa-fw fa-chevron-right"})))},renderNextSection:function(a){return c.createElement("li",null,c.createElement("a",{href:"javascript:void(0);","aria-label":"NextSection",onClick:this.toNextSection},c.createElement("span",{className:"fa fa-fw fa-forward"})))},renderLast:function(a){return c.createElement("li",null,c.createElement("a",{href:"javascript:void(0);","aria-label":"Last",onClick:this.toLast},c.createElement("span",{className:"fa fa-fw fa-fast-forward"})))},renderStatus:function(){return this.props.showStatus?c.createElement("div",{className:"n-pagination-status col-sm-2 col-md-2 col-lg-2"},c.createElement("div",null,f.PAGE_TEXT,this.getCurrentPageIndex()," / ",this.getPageCount())):null},render:function(){var a=this.getPageButtonsRange(),b={row:!0,"n-pagination":!0};this.props.className&&(b[this.props.className]=!0);var d={"n-pagination-buttons":!0,"col-sm-10 col-md-10 col-lg-10":this.props.showStatus,"col-sm-12 col-md-12 col-lg-12":!this.props.showStatus};return c.createElement("div",{className:e.LayoutHelper.classSet(b)},this.renderStatus(),c.createElement("div",{className:e.LayoutHelper.classSet(d)},c.createElement("ul",{className:"pagination"},this.renderFirst(a),this.renderPreviousSection(a),this.renderPrevious(a),this.renderButtons(a),this.renderNext(a),this.renderNextSection(a),this.renderLast(a))))},getCurrentPageIndex:function(a){return a?b(a).attr("data-index"):1*this.props.currentPageIndex},getPageCount:function(){return 1*this.props.pageCount},toFirst:function(){this.jumpTo(1)},toPreviousSection:function(){var a=this.getCurrentPageIndex()-this.getMaxPageButtons();a=a<1?1:a,this.jumpTo(a)},toPrevious:function(){var a=this.getCurrentPageIndex()-1;this.jumpTo(a<1?1:a)},toPage:function(a){this.jumpTo(this.getCurrentPageIndex(a.target))},toNext:function(){var a=this.getCurrentPageIndex()+1;this.jumpTo(a>this.getPageCount()?this.getPageCount():a)},toNextSection:function(){var a=this.getCurrentPageIndex()+this.getMaxPageButtons();a=a>this.getPageCount()?this.getPageCount():a,this.jumpTo(a)},toLast:function(){this.jumpTo(this.getPageCount())},jumpTo:function(a){a*=1,b(":focus").blur(),a-this.getCurrentPageIndex()!=0&&this.props.toPage&&this.props.toPage.call(this,a)}});e.Components.NPagination=f}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NPanel",getDefaultProps:function(){return{defaultOptions:{collapsible:!1,expanded:!0,style:"default"}}},installMonitors:function(){this.hasCheckInTitle()&&this.getModel().addPostChangeListener(this.getCheckInTitleDataId(),this.onTitleCheckChanged)},uninstallMonitors:function(){this.hasCheckInTitle()&&this.getModel().removePostChangeListener(this.getCheckInTitleDataId(),this.onTitleCheckChanged)},beforeWillUpdate:function(a){this.uninstallMonitors()},beforeDidUpdate:function(a,b){this.installMonitors()},beforeDidMount:function(){this.installMonitors()},beforeWillUnmount:function(){this.uninstallMonitors()},getDependencyOptions:function(){return["collapsedLabel","expandedLabel"]},renderCheckInTitle:function(){if(!this.hasCheckInTitle())return null;var a={label:this.getCheckInTitleLabel(),dataId:this.getCheckInTitleDataId(),comp:b.extend({labelAttached:"left"},this.getCheckInTitleOption(),{type:e.ComponentConstants.Check,labelDirection:"horizontal"})};return c.createElement("div",null,"(",c.createElement(e.Components.NCheck,{model:this.getModel(),layout:e.createCellLayout("check",a),view:this.isViewMode()}),")")},renderHeadingButtons:function(){var a=this.getComponentOption("headerButtons");if(a){a=Array.isArray(a)?a:[a];var b=this;return c.createElement("div",{className:"btn-toolbar pull-right",role:"toolbar"},a.map(function(a,d){if(b.isViewMode()&&"edit"==a.view)return null;if(!b.isViewMode()&&"view"==a.view)return null;var f={label:a.text,comp:a};return c.createElement(e.Components.NFormButton,{model:b.getModel(),layout:e.createCellLayout("pseudo-button",f),key:d})}).filter(function(a){return null!=a}))}return null},renderCustomHeader:function(){var a=this.getComponentOption("customHeader");return"function"==typeof a?a.call(this):a},renderHeading:function(){var a=this.getTitle(),b={"panel-title":!0};return this.isCollapsible()?(b["n-collapsible-title-check"]=this.hasCheckInTitle(),c.createElement("div",{className:"panel-heading"},c.createElement("h4",{className:e.LayoutHelper.classSet(b)},c.createElement("a",{href:"javascript:void(0);",onClick:this.onTitleClicked,ref:"head"},a),this.renderCheckInTitle()),this.renderCustomHeader(),this.renderHeadingButtons())):this.hasCheckInTitle()?(b["n-normal-title-check"]=this.hasCheckInTitle(),c.createElement("div",{className:"panel-heading"},c.createElement("h4",{className:e.LayoutHelper.classSet(b)},c.createElement("span",{ref:"head"},a),this.renderCheckInTitle()),this.renderCustomHeader(),this.renderHeadingButtons())):c.createElement("div",{className:"panel-heading",ref:"head"},a,this.renderCustomHeader(),this.renderHeadingButtons())},renderRow:function(a,b){var d=this,f=a.getCells().map(function(a,f){return c.createElement(e.Components.NFormCell,{layout:a,model:d.getModel(),ref:a.getId(),direction:d.props.direction,view:d.isViewMode(),key:b+"-"+f})});return c.createElement("div",{className:"row",key:b},f)},render:function(){if(null==this.getLayout().getLabel(this))return c.createElement("div",{ref:"panel"},this.getInnerLayout().getRows().map(this.renderRow));var a=this.canExpanded()&&this.isExpanded(),b={panel:!0,"panel-collapsible":this.isCollapsible(),"panel-expanded":a};b["panel-"+this.getStyle()]=!0,b[this.getComponentCSS("n-panel")]=!0;var d={display:a?"block":"none"};return c.createElement("div",{className:e.LayoutHelper.classSet(b),ref:"panel"},this.renderHeading(),c.createElement("div",{className:"panel-body",style:d,ref:"body"},this.getInnerLayout().getRows().map(this.renderRow)))},getInnerLayout:function(){return e.createSectionLayout({layout:this.getComponentOption("editLayout")})},isCollapsible:function(){return this.getComponentOption("collapsible")},isExpanded:function(){if(null==this.state.expanded&&(this.state.expanded=this.getComponentOption("expanded"),this.hasCheckInTitle())){var a=this.getCheckInTitleValue(),b=this.getCheckInTitleCollapsible();"same"===b?this.state.expanded=this.state.expanded&&!0===a:"reverse"===b&&(this.state.expanded=this.state.expanded&&!0!==a)}return this.state.expanded},getStyle:function(){return this.getComponentOption("style")},getTitle:function(){var a=this.getLayout().getLabel(this);if(this.state.expanded){var b=this.getExpandedLabelRenderer();b&&(a="string"==typeof b?b:b.when.call(this,this.getModel()))}else{var c=this.getCollapsedLabelRenderer();c&&(a="string"==typeof c?c:c.when.call(this,this.getModel()))}return a},getExpandedLabelRenderer:function(){return this.getComponentOption("expandedLabel")},getCollapsedLabelRenderer:function(){return this.getComponentOption("collapsedLabel")},hasCheckInTitle:function(){return null!=this.getComponentOption("checkInTitle")},getCheckInTitleValue:function(){var a=this.getCheckInTitleDataId();return a?this.getModel().get(a):null},getCheckInTitleDataId:function(){var a=this.getComponentOption("checkInTitle");return a?a.data:null},getCheckInTitleLabel:function(){var a=this.getComponentOption("checkInTitle");return a?a.label:null},getCheckInTitleCollapsible:function(){var a=this.getComponentOption("checkInTitle");return a?a.collapsible:null},getCheckInTitleOption:function(){var a=this.getComponentOption("checkInTitle");if(a){var c=b.extend({},a);return delete c.data,delete c.label,delete c.collapsible,c}return null},onTitleClicked:function(a){a.selected=!1,a.preventDefault(),this.toggleExpanded(!this.state.expanded)},onTitleCheckChanged:function(a){var b=a.new,c=this.getCheckInTitleCollapsible();"same"===c?this.toggleExpanded(b):"reverse"===c&&this.toggleExpanded(!b)},toggleExpanded:function(a){a?this.canExpanded()&&b(d.findDOMNode(this.refs.body)).slideDown(300,function(){this.setState({expanded:!0})}.bind(this)):b(d.findDOMNode(this.refs.body)).slideUp(300,function(){this.setState({expanded:!1})}.bind(this))},canExpanded:function(){if(this.hasCheckInTitle()){var a=this.getCheckInTitleValue(),b=this.getCheckInTitleCollapsible();if("same"===b)return!0===a;if("reverse"===b)return!0!==a}return!0}}));e.Components.NPanel=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.Panel,function(a,b,d,f){return c.createElement(e.Components.NPanel,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass({displayName:"NPanelFooter",statics:{RESET_TEXT:"Reset",RESET_ICON:"reply-all",RESET_STYLE:"warning",VALIDATE_TEXT:"Validate",VALIDATE_ICON:"bug",VALIDATE_STYLE:"default",SAVE_TEXT:"Save",SAVE_ICON:"floppy-o",SAVE_STYLE:"primary",CANCEL_TEXT:"Cancel",CANCEL_ICON:"ban",CANCEL_STYLE:"danger"},renderLeftButtons:function(){return this.props.left?Array.isArray(this.props.left)?this.props.left.map(function(a,b){return this.renderButton(a,b,!0)}.bind(this)):this.renderButton(this.props.left,"left",!0):null},renderRightButtons:function(){return this.props.right?Array.isArray(this.props.right)?this.props.right.map(function(a,b){return this.renderButton(a,b,!1)}.bind(this)):this.renderButton(this.props.right,"right",!1):null},renderButton:function(a,d,f){if(this.isViewMode()&&"edit"==a.view)return null;if(!this.isViewMode()&&"view"==a.view)return null;var g=b.extend(!0,{label:a.text,comp:{type:e.ComponentConstants.Button},css:{
comp:f?"on-left":"on-right"}},{comp:a});delete g.comp.label;this.getModel();return c.createElement(e.Components.NFormButton,{model:this.getModel(),layout:e.createCellLayout("pseudo-button",g),key:d})},render:function(){return c.createElement("div",{className:"row n-panel-footer"},c.createElement("div",{className:"col-sm-12 col-md-12 col-lg-12"},c.createElement("div",{className:"btn-toolbar",role:"toolbar"},this.props.reset?this.renderButton({icon:f.RESET_ICON,text:f.RESET_TEXT,style:f.RESET_STYLE,click:this.props.reset.click?this.props.reset.click:this.props.reset,enabled:!this.props.reset.enabled||this.props.reset.enabled,visible:!this.props.reset.visible||this.props.reset.visible},"reset",!0):null,this.props.validate?this.renderButton({icon:f.VALIDATE_ICON,text:f.VALIDATE_TEXT,style:f.VALIDATE_STYLE,click:this.props.validate.click?this.props.validate.click:this.props.validate,enabled:!this.props.validate.enabled||this.props.validate.enabled,visible:!this.props.validate.visible||this.props.validate.visible},"validate",!0):null,this.renderLeftButtons(),this.props.cancel?this.renderButton({icon:f.CANCEL_ICON,text:f.CANCEL_TEXT,style:f.CANCEL_STYLE,click:this.props.cancel.click?this.props.cancel.click:this.props.cancel,enabled:!this.props.cancel.enabled||this.props.cancel.enabled,visible:!this.props.cancel.visible||this.props.cancel.visible},"cancel",!1):null,this.props.save?this.renderButton({icon:f.SAVE_ICON,text:f.SAVE_TEXT,style:f.SAVE_STYLE,click:this.props.save.click?this.props.save.click:this.props.save,enabled:!this.props.save.enabled||this.props.save.enabled,visible:!this.props.save.visible||this.props.save.visible},"save",!1):null,this.renderRightButtons())))},getModel:function(){return null==this.props.model?e.createModel({}):this.props.model},isViewMode:function(){return this.props.view}});e.Components.NPanelFooter=f}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NRadio",getDefaultProps:function(){return{defaultOptions:{direction:"horizontal",labelAtLeft:!1}}},renderLabel:function(a,b){var d={"radio-label":!0,disabled:!this.isEnabled(),"radio-label-left":b};return c.createElement("span",{className:e.LayoutHelper.classSet(d),onClick:this.isEnabled()&&!this.isViewMode()?this.onButtonClicked.bind(this,a):null},a.text)},renderRadio:function(a,b){var d=this.getValueFromModel()==a.id,f=this.isEnabled(),g={disabled:!f,checked:d,"radio-container":!0},h=this.isLabelAtLeft();return c.createElement("div",{className:"n-radio-option",key:b},h?this.renderLabel(a,!0):null,c.createElement("div",{className:"radio-container"},c.createElement("span",{className:e.LayoutHelper.classSet(g),onClick:f&&!this.isViewMode()?this.onButtonClicked.bind(this,a):null,onKeyUp:f&&!this.isViewMode()?this.onKeyUp.bind(this,a):null,tabIndex:"0",ref:"out-"+a.id},c.createElement("span",{className:"check",onClick:this.onInnerClicked.bind(this,a)}))),h?null:this.renderLabel(a,!1))},render:function(){var a={"n-radio":!0,vertical:"vertical"===this.getComponentOption("direction"),"n-disabled":!this.isEnabled(),"n-view-mode":this.isViewMode()};return c.createElement(e.Components.NCodeTableWrapper,{codetable:this.getCodeTable(),className:e.LayoutHelper.classSet(a),model:this.getModel(),layout:this.getLayout(),renderer:this.getRealRenderer})},getRealRenderer:function(){var a={"n-radio":!0,vertical:"vertical"===this.getComponentOption("direction"),"n-disabled":!this.isEnabled(),"n-view-mode":this.isViewMode()};return c.createElement("div",{className:this.getComponentCSS(e.LayoutHelper.classSet(a))},this.getCodeTable().map(this.renderRadio))},getCodeTable:function(){return this.getComponentOption("data")},onInnerClicked:function(a){b(d.findDOMNode(this.refs["out-"+a.id])).focus()},onButtonClicked:function(a){this.setValueToModel(a.id)},onKeyUp:function(a,b){"32"==b.keyCode&&this.onButtonClicked(a)},isLabelAtLeft:function(){return this.getComponentOption("labelAtLeft")}}));e.Components.NRadio=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.Radio,function(a,b,d,f){return c.createElement(e.Components.NRadio,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NSearchText",statics:{ADVANCED_SEARCH_BUTTON_ICON:"search",ADVANCED_SEARCH_DIALOG_NAME_LABEL:"Name",ADVANCED_SEARCH_DIALOG_BUTTON_TEXT:"Search",ADVANCED_SEARCH_DIALOG_CODE_LABEL:"Code",ADVANCED_SEARCH_DIALOG_RESULT_TITLE:"Search Result",NOT_FOUND:"Not Found",SEARCH_PROXY:null,SEARCH_PROXY_CALLBACK:null,ADVANCED_SEARCH_PROXY:null,ADVANCED_SEARCH_PROXY_CALLBACK:null},getDefaultProps:function(){return{defaultOptions:{}}},getInitialState:function(){return{stopRetrieveLabelFromRemote:!1}},beforeDidUpdate:function(a,b){this.initSetValues()},beforeDidMount:function(){this.initSetValues()},render:function(){if(this.isViewMode())return this.renderInViewMode();var a=this.isEnabled(),b={"n-search-text":!0};a||(b["n-disabled"]=!0);var d={width:"0"};return c.createElement("div",{className:this.getComponentCSS(e.LayoutHelper.classSet(b))},c.createElement("div",{className:"input-group"},c.createElement("input",{type:"text",className:"form-control search-code",onKeyUp:this.onComponentChange,ref:"code",disabled:!a,onFocus:this.onComponentFocused,onBlur:this.onComponentBlurred}),c.createElement("span",{className:"input-group-btn",style:d}),c.createElement("input",{type:"text",className:"form-control search-label",onFocus:this.onLabelFocused,ref:"label",disabled:!a,tabIndex:-1}),c.createElement("span",{className:"input-group-addon advanced-search-btn",onClick:a?this.showAdvancedSearchDialog:null},c.createElement("span",{className:"fa fa-fw fa-"+f.ADVANCED_SEARCH_BUTTON_ICON})),this.renderNormalLine(),this.renderFocusLine()))},onLabelFocused:function(){this.getComponent().focus()},onComponentFocused:function(){b(d.findDOMNode(this.refs.focusLine)).toggleClass("focus"),b(d.findDOMNode(this.refs.normalLine)).toggleClass("focus")},onComponentBlurred:function(){b(d.findDOMNode(this.refs.focusLine)).toggleClass("focus"),b(d.findDOMNode(this.refs.normalLine)).toggleClass("focus")},onComponentChange:function(a){a.target.value;this.setValueToModel(a.target.value)},onModelChanged:function(a){var b=a.new;this.getComponent().val(b),this.retrieveAndSetLabelTextFromRemote(b)},showAdvancedSearchDialog:function(){this.state.searchDialog||(this.state.searchDialog=e.Components.NModalForm.createFormModal(this.getLayout().getLabel(this),"advanced-search-dialog")),this.state.searchDialog.show({model:this.getAdvancedSearchDialogModel(),layout:this.getAdvancedSearchDialogLayout(),buttons:{reset:!1,validate:!1,cancel:!1}})},pickupAdvancedResultItem:function(a){this.state.stopRetrieveLabelFromRemote=!0,this.getModel().set(this.getDataId(),a.code),this.setLabelText(a.name),this.state.stopRetrieveLabelFromRemote=!1},initSetValues:function(){var a=this.getValueFromModel();this.isViewMode()||this.getComponent().val(a);var b=this.getComponentOption("labelPropId");b?this.setLabelText(this.getModel().get(b)):this.retrieveAndSetLabelTextFromRemote(a)},setLabelText:function(a){if(this.isViewMode()){var c=this.getValueFromModel();if(null==c);else{var e=c;e+=null==a?" - "+f.NOT_FOUND:" - "+a;this.refs.viewLabel.getLayout().getDefinition().label=e,this.refs.viewLabel.forceUpdate()}}else b(d.findDOMNode(this.refs.label)).val(a);var g=this.getComponentOption("labelPropId");if(g){var h=this.getModel().get(g);h!=a&&this.getModel().set(g,h)}},retrieveAndSetLabelTextFromRemote:function(b){if(null!=this.state.search&&clearTimeout(this.state.search),!this.state.stopRetrieveLabelFromRemote){var c=this.getSearchTriggerDigits();if(null==c)throw new e.createComponentException(e.ComponentConstants.Err_Search_Text_Trigger_Digits_Not_Defined,"Trigger digits cannot be null in search text.");if(null==b&&(b=""),"string"!=typeof b&&(b+=""),b.isBlank()||b.length!=c&&-1!=c)return void this.setLabelText(null);var d=this;this.state.search=setTimeout(function(){var c={code:b};f.SEARCH_PROXY&&(c=f.SEARCH_PROXY.call(d,c)),e.internalDoPost(d.getSearchUrl(),c,{quiet:!0}).done(function(a){"string"==typeof a&&(a=JSON.parse(a));var b=a.name;f.SEARCH_PROXY_CALLBACK&&(b=f.SEARCH_PROXY_CALLBACK.call(d,a)),d.setLabelText(b)}).fail(function(){a.console.error("Error occured when retrieve label from remote in NSearch.")})},300)}},getSearchUrl:function(){return this.getComponentOption("searchUrl")},getAdvancedSearchUrl:function(){return this.getComponentOption("advancedUrl")},getSearchTriggerDigits:function(){return this.getComponentOption("searchTriggerDigits")},getComponent:function(){return b(d.findDOMNode(this.refs.code))},getAdvancedSearchDialogModel:function(){var a=this.getComponentOption("searchDialogModel");return null==a&&(a={name:null,countPerPage:10,pageIndex:1,items:null,criteria:{pageIndex:1,pageCount:1,countPerPage:10}}),e.createModel(a)},getAdvancedSearchDialogLayout:function(){var c=this,d=this.getComponentOption("searchDialogLayout");if(null==d){var g=this.props.direction;g||(g=NForm.LABEL_DIRECTION);var h={"pull-right":!0,"pull-down":"vertical"==g};d={name:{label:f.ADVANCED_SEARCH_DIALOG_NAME_LABEL,comp:{type:e.ComponentConstants.Text},pos:{row:10,col:10,width:6}},button:{label:f.ADVANCED_SEARCH_DIALOG_BUTTON_TEXT,comp:{type:e.ComponentConstants.Button,style:"primary",click:function(d){var g=b.extend({},d.getCurrentModel());delete g.items,delete g.criteria,f.ADVANCED_SEARCH_PROXY&&(g=f.ADVANCED_SEARCH_PROXY.call(this,g)),e.internalDoPost(c.getAdvancedSearchUrl(),g,{done:function(b){"string"==typeof b&&(b=JSON.parse(b)),f.ADVANCED_SEARCH_PROXY_CALLBACK&&(b=f.ADVANCED_SEARCH_PROXY_CALLBACK.call(this,b,this.getDataId())),d.mergeCurrentModel(b),d.set("criteria"+e.PROPERTY_SEPARATOR+"url",this.getAdvancedSearchUrl()),a.console.debug(d.getCurrentModel()),this.state.searchDialog.forceUpdate()}.bind(c)})}},css:{comp:e.LayoutHelper.classSet(h)},pos:{row:10,col:20,width:6}},items:{label:f.ADVANCED_SEARCH_DIALOG_RESULT_TITLE,comp:{type:e.ComponentConstants.Table,indexable:!0,searchable:!1,rowOperations:{icon:"check",click:function(a){c.pickupAdvancedResultItem(a),c.state.searchDialog.hide()}},pageable:!0,criteria:"criteria",columns:[{title:f.ADVANCED_SEARCH_DIALOG_CODE_LABEL,width:200,data:"code"},{title:f.ADVANCED_SEARCH_DIALOG_NAME_LABEL,width:400,data:"name"}]},pos:{row:20,col:10,width:12}}}}else d=d.call(this);return e.createFormLayout(d)},getTextInViewMode:function(){var a=this.getValueFromModel();return a}}));e.Components.NSearchText=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.Search,function(a,b,d,f){return c.createElement(e.Components.NSearchText,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NSelect",mixins:[e.mixins.PopoverMixin],statics:{POP_FIX_ON_BOTTOM:!1,PLACEHOLDER:"Please Select...",NO_OPTION_FOUND:"No Option Found",FILTER_PLACEHOLDER:"Search...",CLOSE_TEXT:"Close",CLEAR_TEXT:"Clear"},getDefaultProps:function(){return{defaultOptions:{allowClear:!0,minimumResultsForSearch:1,data:[],availableWhenNoParentValue:!1}}},afterWillUpdate:function(a){this.hasParent()&&this.getParentModel().removePostChangeListener(this.getParentPropertyId(),this.onParentModelChanged)},afterDidUpdate:function(a,b){this.checkLoadingState()},afterDidMount:function(){this.checkLoadingState()},checkLoadingState:function(){if(this.hasParent()&&this.getParentModel().addPostChangeListener(this.getParentPropertyId(),this.onParentModelChanged),this.state.onloading&&!this.state.alreadySendRequest)if(this.hasParent()){var a=this.getParentPropertyValue();null==a?this.isAvailableWhenNoParentValue()?this.getCodeTable().initializeRemote().done(function(){this.setState({onloading:!1})}.bind(this)):(this.getCodeTable().setAsRemoteInitialized(),this.setState({onloading:!1})):this.getCodeTable().loadRemoteCodeSegment(a).done(function(){this.setState({onloading:!1})}.bind(this))}else this.getCodeTable().initializeRemote().done(function(){this.setState({onloading:!1})}.bind(this))},afterWillUnmount:function(){this.hasParent()&&this.getParentModel().removePostChangeListener(this.getParentPropertyId(),this.onParentModelChanged)},renderClear:function(){return this.isClearAllowed()?c.createElement("span",{className:"fa fa-fw fa-close clear",onClick:this.onClearClick}):null},getCurrentDisplayText:function(){var a=this.getValueFromModel(),b=null;if(this.hasParent()&&this.isOnLoadingWhenHasParent()&&null!=a)this.state.onloading=!0;else if(this.isOnLoadingWhenNoParent())this.state.onloading=!0;else if(null!=a){var c=this.getAvailableOptions().find(function(b){return b.id==a});c&&(b=c.text)}return null==b&&(b=this.state.onloading?e.Components.NCodeTableWrapper.ON_LOADING:this.isViewMode()?"":this.getPlaceholder()),b},renderText:function(){var a={"input-group":!0,"form-control":!0,"no-clear":!this.isClearAllowed()};return c.createElement("div",{className:e.LayoutHelper.classSet(a),onClick:this.onComponentClicked},c.createElement("span",{className:"text"},this.getCurrentDisplayText()),this.renderClear(),c.createElement("span",{className:"fa fa-fw fa-sort-down drop"}))},render:function(){var a={"n-disabled":!this.isEnabled(),"n-view-mode":this.isViewMode()};return a[this.getComponentCSS("n-select")]=!0,c.createElement("div",{className:e.LayoutHelper.classSet(a),tabIndex:this.isEnabled()?"0":null,onKeyUp:this.onComponentKeyUp,"aria-readonly":"true",readOnly:"true",ref:"comp"},this.renderText(),this.renderNormalLine(),this.renderFocusLine())},renderOptions:function(a,b){if(null==a||0==a.length)return null;null==b||b.isBlank()||(a=null==a?null:a.filter(function(a){return-1!=a.text.toLowerCase().indexOf(b.toLowerCase())}));var d=this,f=this.getValueFromModel();return c.createElement("ul",{className:"options",onTouchStart:this.isMobilePhone()?this.onOptionTouchStart:null,onTouchMove:this.isMobilePhone()?this.onOptionTouchMove:null,onTouchEnd:this.isMobilePhone()?this.onOptionTouchEnd:null},a.map(function(a,b){var g={chosen:f==a.id};return c.createElement("li",{onClick:d.onOptionClick.bind(d,a),onMouseEnter:d.onOptionMouseEnter,onMouseLeave:d.onOptionMouseLeave,onMouseMove:d.onOptionMouseMove,className:e.LayoutHelper.classSet(g),key:b,"data-id":a.id},c.createElement("span",null,a.text))}))},renderNoOption:function(a){return null==a||0==a.length?c.createElement("div",{className:"no-option"},c.createElement("span",null,f.NO_OPTION_FOUND)):null},renderFilterText:function(a,b){if(null!=a&&0!=a.length){if(this.hasFilterText()){var d=e.createModel({text:b,disabled:!!this.isMobilePhone()}),g=e.createCellLayout("text",{comp:{placeholder:f.FILTER_PLACEHOLDER,enabled:{depends:"disabled",when:function(a){return!0!==a.get("disabled")}}},evt:{keyUp:this.onComponentKeyUp}});return d.addPostChangeListener("text",this.onFilterTextChange),this.state.filterModel=d,c.createElement(e.Components.NText,{model:d,layout:g})}return null}},renderPopoverOperations:function(){return this.isMobilePhone()?c.createElement("div",{className:"operations row"},c.createElement("div",null,c.createElement("a",{href:"javascript:void(0);",onClick:this.hidePopover},c.createElement("span",null,f.CLOSE_TEXT)),this.getComponentOption("allowClear")?c.createElement("a",{href:"javascript:void(0);",onClick:this.onClearClick},c.createElement("span",null,f.CLEAR_TEXT)):null)):null},renderPopoverContent:function(a){var b=this.getAvailableOptions();return c.createElement("div",{className:this.hasFilterText()?"has-filter":""},this.renderFilterText(b,a),this.renderNoOption(b),this.renderOptions(b,a),this.renderPopoverOperations())},getPopoverContainerCSS:function(){return"n-select-popover"},beforeShowPopover:function(){if(this.state.popoverDiv){var a=this.state.popoverDiv.find("ul.options > li.active");this.state.lastActiveOptionId=a.attr("data-id")}else delete this.state.lastActiveOptionId},afterPopoverRenderComplete:function(){if(!this.isMobilePhone()){var a=this.state.popoverDiv.find("ul.options > li");0!=a.length&&(this.state.lastActiveOptionId&&a.removeClass("active").filter(function(a,c){return b(c).attr("data-id")==this.state.lastActiveOptionId}.bind(this)).addClass("active"),0==this.state.popoverDiv.find("ul.options > li.active").length&&this.state.popoverDiv.find("ul.options > li").first().addClass("active"))}var c=this.state.popoverDiv.find("div.n-text input[type=text]");c.length>0&&!c.is(":focus")&&(null!=this.state.filteTextCaret?c.caret(this.state.filteTextCaret):c.val().length>0&&c.caret(c.val().length),this.isMobile()||c.focus()),this.state.filterModel&&this.state.filterModel.set("disabled",!1)},isOnLoadingWhenHasParent:function(){var a=this.getCodeTable();if(null==a||Array.isArray(a)||!a.isRemote())return!1;var b=this.getParentPropertyValue();return null==b?this.isAvailableWhenNoParentValue()?a.isRemoteButNotInitialized():(a.setAsRemoteInitialized(),!1):!a.isSegmentLoaded(b)},isOnLoadingWhenNoParent:function(){var a=this.getCodeTable();return null!=a&&!Array.isArray(a)&&a.isRemoteButNotInitialized()},onComponentClicked:function(){if(this.isEnabled()&&!this.isViewMode()&&(!this.state.popoverDiv||!this.state.popoverDiv.is(":visible"))){var a=this.getCodeTable();this.hasParent()&&this.isOnLoadingWhenHasParent()?this.setState({onloading:!0,alreadySendRequest:!0},function(){a.loadRemoteCodeSegment(this.getParentPropertyValue()).done(function(){this.showPopover()}.bind(this)).always(function(){this.setState({onloading:!1,alreadySendRequest:!1})}.bind(this))}.bind(this)):this.isOnLoadingWhenNoParent()?this.setState({onloading:!0,alreadySendRequest:!0},function(){a.initializeRemote().done(function(){this.showPopover()}.bind(this)).always(function(){this.setState({onloading:!1,alreadySendRequest:!1})}.bind(this))}.bind(this)):this.showPopover()}},onComponentKeyUp:function(a){40===a.keyCode?this.onComponentDownArrowKeyUp(a):38===a.keyCode?this.onComponentUpArrowKeyUp(a):13===a.keyCode&&this.onComponentEnterKeyUp(a)},onComponentEnterKeyUp:function(a){if(a.preventDefault(),a.stopPropagation(),this.isEnabled()&&!this.isViewMode()&&this.state.popoverDiv&&this.state.popoverDiv.is(":visible")){var c=this.state.popoverDiv.find("ul.options > li.active");c.length>0&&(this.setValueToModel(c.attr("data-id")),this.hidePopover(),b(this.refs.comp).focus())}},onComponentDownArrowKeyUp:function(a){if(a.preventDefault(),a.stopPropagation(),this.isEnabled()&&!this.isViewMode())if(this.state.popoverDiv&&this.state.popoverDiv.is(":visible")){var b=this.state.popoverDiv.find("ul.options > li"),c=b.filter(".active");if(0==c.length){var d=b.first();d.addClass("active"),this.scrollIntoView(d)}else{var e=b.last();if(!c.first().is(e)){c.removeClass("active");var f=c.next();f.addClass("active"),this.scrollIntoView(f)}}}else this.onComponentClicked()},onComponentUpArrowKeyUp:function(a){if(a.preventDefault(),a.stopPropagation(),this.isEnabled()&&!this.isViewMode())if(this.state.popoverDiv&&this.state.popoverDiv.is(":visible")){var b=this.state.popoverDiv.find("ul.options > li"),c=b.filter(".active");if(0==c.length){var d=b.last();d.addClass("active"),this.scrollIntoView(d)}else{var e=b.first();if(!c.first().is(e)){c.removeClass("active");var f=c.prev();f.addClass("active"),this.scrollIntoView(f)}}}else this.onComponentClicked()},scrollIntoView:function(c){this.state.onKeyEventProcessed=!0;var d=c.offset(),e=d.top,f=c.outerHeight(),g=e+f,h=c.parent(),i=h.offset(),j=i.top,k=j+h.height(),l=h.children(),m=b(a),n=m.scrollTop(),o=n+m.height();if(e<j||g>k){var p=l.index(c),q=l.toArray().reduce(function(a,c,d){return d<p&&(a+=b(c).outerHeight()),a},0);h.scrollTop(q)}d=c.offset(),e=d.top,g=e+f,g>o&&m.scrollTop(n+g-o),n=m.scrollTop(),e<n&&m.scrollTop(n-(n-e))},defaultOptionClick:function(a){this.setValueToModel(a.id),this.hidePopover(),b(this.refs.comp).focus()},onOptionClick:function(a,b){b.stopPropagation(),b.preventDefault();var c=this.getComponentOption("optionClick");if(c){var d=c.call(this,a);d&&d.done?d.done(function(){this.defaultOptionClick(a)}.bind(this)):this.defaultOptionClick(a)}else this.defaultOptionClick(a)},onOptionMouseEnter:function(a){},onOptionMouseLeave:function(a){},onOptionMouseMove:function(a){!0===this.state.onKeyEventProcessed?delete this.state.onKeyEventProcessed:b(a.target).addClass("active").siblings().removeClass("active")},onClearClick:function(){this.isEnabled()&&!this.isViewMode()&&(this.setValueToModel(null),this.hidePopover())},onFilterTextChange:function(a){if(this.state.popoverDiv.is(":visible")){var b=this.state.popoverDiv.find("div.n-text input[type=text]");this.state.filteTextCaret=b.caret()}else this.state.filteTextCaret=null;if(this.isMobilePhone()){var c=this.state.popoverDiv.find("ul.options");0!==this.getOptionContainerOffsetY(c)&&c.css({transform:"","transition-timing-function":"","transition-duration":""})}this.showPopover(a.new)},getOptionTouchEventContainer:function(a){var c=b(a.target);return"UL"!=c[0].tagName&&(c=c.closest("ul")),c},getOptionContainerOffsetY:function(a){var b=a.css("transform").split(",");return b.length>5?parseFloat(b[5]):0},calcOptionContainerOffsetY:function(a,b){if(b>=0)b=0;else{var c=a.height(),d=a.parent().height();if(c<=d)return 0;b<d-c&&(b=d-c)}return b},onOptionTouchStart:function(a){this.state.touchStartClientY=a.touches[0].clientY;var b=this.getOptionTouchEventContainer(a);this.state.touchStartRelatedY=this.getOptionContainerOffsetY(b),this.state.touchStartTime=moment()},onOptionTouchMove:function(a){var b=a.touches,c=b.length;if(c>0){var d=this.getOptionTouchEventContainer(a),e=b[c-1].clientY-this.state.touchStartClientY,f=this.calcOptionContainerOffsetY(d,this.state.touchStartRelatedY+e);d.css("transform","translateY("+f+"px)"),this.state.touchLastClientY=b[c-1].clientY}},onOptionTouchEnd:function(a){var b=moment().diff(this.state.touchStartTime,"ms");if(b<=300&&null!=this.state.touchLastClientY){var c=this.state.touchLastClientY-this.state.touchStartClientY,d=c/b*10,e=this.getOptionTouchEventContainer(a),f=this.getOptionContainerOffsetY(e),g=this.calcOptionContainerOffsetY(e,f+100*d/2);e.one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",function(){e.css({"transition-timing-function":"","transition-duration":""})}),e.css({"transition-timing-function":"cubic-bezier(0.1, 0.57, 0.1, 1)","transition-duration":"500ms",transform:"translateY("+g+"px)"})}delete this.state.touchStartClientY,delete this.state.touchStartRelatedY,delete this.state.touchStartTime,delete this.state.touchLastClientY},onParentModelChanged:function(a){this.setValueToModel(null)},getParentModel:function(){var a=this.getComponentOption("parentModel");return null==a?this.getModel():a},getParentPropertyValue:function(){return this.getParentModel().get(this.getParentPropertyId())},getParentPropertyId:function(){return this.getComponentOption("parentPropId")},hasParent:function(){return null!=this.getParentPropertyId()},hasFilterText:function(){var a=this.getComponentOption("minimumResultsForSearch");return a>=0&&a!=1/0},convertDataOptions:function(a){return Array.isArray(a)?a:a.list()},getPlaceholder:function(){return this.getComponentOption("placeholder",f.PLACEHOLDER)},isClearAllowed:function(){return this.getComponentOption("allowClear")&&!this.isMobilePhone()},getCodeTable:function(){return this.getComponentOption("data")},getAvailableOptions:function(){if(this.hasParent()){var a=this.getParentPropertyValue();if(null==a)return this.isAvailableWhenNoParentValue()?this.convertDataOptions(this.getCodeTable()):[];var c=this.getComponentOption("parentFilter");if("object"==typeof c)return this.convertDataOptions(this.getCodeTable().filter(b.extend({},c,{value:a})));var d=this.convertDataOptions(this.getCodeTable());return"function"==typeof c?c.call(this,a,d):d.filter(function(b){return b[c]==a})}return this.convertDataOptions(this.getCodeTable())},isAvailableWhenNoParentValue:function(){return!this.hasParent()||this.getComponentOption("availableWhenNoParentValue")},getComponent:function(){return b(d.findDOMNode(this.refs.comp))}}));e.Components.NSelect=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.Select,function(a,b,d,f){return c.createElement(e.Components.NSelect,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NSelectTree",mixins:[e.mixins.PopoverMixin],statics:{POP_FIX_ON_BOTTOM:!1,PLACEHOLDER:"Please Select...",CLOSE_TEXT:"Close"},getDefaultProps:function(){return{defaultOptions:{hideChildWhenParentChecked:!1},treeLayout:{comp:{root:!1,check:!0,multiple:!0,hierarchyCheck:!1}}}},afterWillUpdate:function(a){this.hasParent()&&this.getParentModel().removePostChangeListener(this.getParentPropertyId(),this.onParentModelChanged)},afterDidUpdate:function(a,b){this.hasParent()&&this.getParentModel().addPostChangeListener(this.getParentPropertyId(),this.onParentModelChanged),this.state.popoverDiv&&this.state.popoverDiv.is(":visible")&&this.showPopover()},afterDidMount:function(){this.hasParent()&&this.getParentModel().addPostChangeListener(this.getParentPropertyId(),this.onParentModelChanged),this.state.onloading&&this.getCodeTable().initializeRemote().done(function(){this.setState({onloading:!1})}.bind(this)),this.state.mounted=!0},beforeWillUnmount:function(){this.destroyPopover()},afterWillUnmount:function(){this.hasParent()&&this.getParentModel().removePostChangeListener(this.getParentPropertyId(),this.onParentModelChanged)},renderTree:function(){var a=e.createCellLayout("values",this.getTreeLayout()),b=e.createModel({values:this.getValueFromModel()});return b.addPostChangeListener("values",this.onTreeValueChanged),c.createElement(e.Components.NTree,{model:b,layout:a,key:"tree"})},renderSelectionItem:function(a,b){return this.isMobilePhone()?c.createElement("li",{key:b},a.text):c.createElement("li",{key:b},c.createElement("span",{className:"fa fa-fw fa-remove",onClick:this.onSelectionItemRemove.bind(this,b)}),a.text)},renderSelectionWhenValueAsArray:function(a){var b=this,c=null;if(this.isHideChildWhenParentChecked()){c=this.getAvailableTreeModel().list();var d=function(b){return-1!=a.findIndex(function(a){return a==b.id})},e=function(a){return a.map(function(a){return d(a)?b.renderSelectionItem(a,a.id):a.children?e(a.children):void 0})};return e(c)}return c=this.getAvailableTreeModel().listAllChildren(),Object.keys(c).map(function(d){var e=a.find(function(a){return a==d});if(null!=e)return b.renderSelectionItem(c[e],e)})},renderSelectionWhenValueAsJSON:function(a){var b=this,c=this.getAvailableTreeModel().listWithHierarchyKeys({separator:NTree.NODE_SEPARATOR,rootId:NTree.ROOT_ID});if(this.isHideChildWhenParentChecked()){var d=[],f=function(a){return-1!=d.findIndex(function(b){return a.startsWith(b)})};return Object.keys(c).map(function(g){if(!f(g)){var h=g.split(NTree.NODE_SEPARATOR).slice(1).join(e.PROPERTY_SEPARATOR)+e.PROPERTY_SEPARATOR+"selected";if(e.getValueFromJSON(a,h))return d.push(g+NTree.NODE_SEPARATOR),b.renderSelectionItem(c[g],g)}})}var g=function(a,d,e){var f=e+NTree.NODE_SEPARATOR+d,h=[];return a.selected&&h.push(b.renderSelectionItem(c[f],f)),h.push.apply(h,Object.keys(a).filter(function(a){return"selected"!=a}).map(function(b){return g(a[b],b,f)})),h};return Object.keys(a).filter(function(a){return"selected"!=a}).map(function(b){return g(a[b],b,NTree.ROOT_ID)})},renderSelection:function(){var a=this.getValueFromModel();return null==a?null:this.getTreeLayout().comp.valueAsArray?this.renderSelectionWhenValueAsArray(a):this.renderSelectionWhenValueAsJSON(a)},renderText:function(){var a=function(){if(this.isOnLoading()&&!this.state.mounted)return this.state.onloading=!0,c.createElement("span",{className:"text"},e.Components.NCodeTableWrapper.ON_LOADING);this.state.onloading=!1;var a=this.getValueFromModel();return null==a||Array.isArray(a)&&0==a.length||"object"==typeof a&&0==Object.keys(a).length?this.isViewMode()?c.createElement("span",{className:"text"}):c.createElement("span",{className:"text"},this.getComponentOption("placeholder",f.PLACEHOLDER)):c.createElement("ul",{className:"selection"},this.renderSelection())}.bind(this);return c.createElement("div",{className:"input-group form-control",onClick:this.onComponentClicked,ref:"comp"},a(),c.createElement("span",{className:"fa fa-fw fa-sort-down pull-right"}))},render:function(){var a={"n-disabled":!this.isEnabled(),"n-view-mode":this.isViewMode()};return a[this.getComponentCSS("n-select-tree")]=!0,c.createElement("div",{className:e.LayoutHelper.classSet(a),"aria-readonly":"true",readOnly:"true",tabIndex:this.isEnabled()?"0":null},this.renderText(),this.renderNormalLine(),this.renderFocusLine())},renderPopoverOperations:function(){return this.isMobilePhone()?c.createElement("div",{className:"operations",key:"operations"},c.createElement("div",null,c.createElement("a",{href:"javascript:void(0);",onClick:this.hidePopover},c.createElement("span",null,f.CLOSE_TEXT)))):null},getPopoverContainerCSS:function(){return"n-select-tree-popover"},renderPopoverContent:function(){return[this.renderTree(),this.renderPopoverOperations()]},afterPopoverRenderComplete:function(){if(this.isMobilePhone()){this.state.popoverDiv.find("div.n-tree > ul").on("touchstart",this.onTreeTouchStart).on("touchmove",this.onTreeTouchMove).on("touchend",this.onTreeTouchEnd)}},afterDestoryPopover:function(){if(this.state.popoverDiv&&this.isMobilePhone()){this.state.popoverDiv.find("div.n-tree > ul").off("touchstart",this.onTreeTouchStart).off("touchmove",this.onTreeTouchMove).off("touchend",this.onTreeTouchEnd)}},isOnLoading:function(){return this.getCodeTable().isRemoteButNotInitialized()},onComponentClicked:function(){this.isEnabled()&&!this.isViewMode()&&(this.isOnLoading()?this.getCodeTable().initializeRemote().done(function(){this.setState({onloading:!1}),this.showPopover()}.bind(this)):this.showPopover())},onParentModelChanged:function(){var a=this.getComponentOption("parentChanged");a?this.setValueToModel(a.call(this,this.getModel(),this.getParentPropertyValue())):this.setValueToModel(null),this.forceUpdate()},onTreeValueChanged:function(a){var c=a.new;null==c?this.setValueToModel(c):Array.isArray(c)?this.setValueToModel(c.slice(0)):this.setValueToModel(b.extend(!0,{},c))},onSelectionItemRemove:function(a){if(this.isEnabled()){var b=this.getValueFromModel(),c=this.getTreeLayout().comp.hierarchyCheck;if(null==b);else if(this.getTreeLayout().comp.valueAsArray)if(c){var d=this.getAvailableTreeModel().listWithHierarchyKeys({separator:NTree.NODE_SEPARATOR,rootId:NTree.ROOT_ID}),f=Object.keys(d),g=f.filter(function(b){return-1!=b.indexOf(a+NTree.NODE_SEPARATOR)}).map(function(a){return a.split(NTree.NODE_SEPARATOR).pop()}),h=f.find(function(b){return b.endsWith(NTree.NODE_SEPARATOR+a)}),i=f.filter(function(a){return h.startsWith(a)}).map(function(a){return a.split(NTree.NODE_SEPARATOR).pop()}),j=g.concat(i);this.setValueToModel(b.filter(function(a){return-1==j.findIndex(function(b){return a==b})}))}else this.setValueToModel(b.filter(function(b){return b!=a}));else{var k=a.split(NTree.NODE_SEPARATOR).slice(1),l=e.getValueFromJSON(b,k.join(e.PROPERTY_SEPARATOR));c?(Object.keys(l).forEach(function(a){delete l[a]}),k.splice(k.length-1,1),k.forEach(function(a,c,d){e.setValueIntoJSON(b,d.slice(0,c+1).join(e.PROPERTY_SEPARATOR)+e.PROPERTY_SEPARATOR+"selected",!1)})):delete l.selected,this.getModel().firePostChangeEvent(this.getDataId(),b,b)}}},isNodeCheckClicked:function(a){return 0!=b(a.target).closest(".n-checkbox").length},getNodeTouchEventContainer:function(a){return b(a.target).closest(".n-tree").children("ul").first()},getNodeContainerOffsetY:function(a){var b=a.css("transform").split(",");return b.length>5?parseFloat(b[5]):0},calcNodeContainerOffsetY:function(a,b){if(b>=0)b=0;else{var c=a.height(),d=a.parent().height();if(c<=d)return 0;b<d-c&&(b=d-c)}return b},unwrapTouchEvent:function(a){return a.touches?a:a.originalEvent},
onTreeTouchStart:function(a){if(!this.isNodeCheckClicked(a)){this.state.touchStartClientY=this.unwrapTouchEvent(a).touches[0].clientY;var b=this.getNodeTouchEventContainer(a);this.state.touchStartRelatedY=this.getNodeContainerOffsetY(b),this.state.touchStartTime=moment()}},onTreeTouchMove:function(a){if(!this.isNodeCheckClicked(a)){var b=this.unwrapTouchEvent(a).touches,c=b.length;if(c>0){var d=this.getNodeTouchEventContainer(a),e=b[c-1].clientY-this.state.touchStartClientY,f=this.calcNodeContainerOffsetY(d,this.state.touchStartRelatedY+e);d.css("transform","translateY("+f+"px)"),this.state.touchLastClientY=b[c-1].clientY}}},onTreeTouchEnd:function(a){if(!this.isNodeCheckClicked(a)){var b=moment().diff(this.state.touchStartTime,"ms");if(b<=300&&null!=this.state.touchLastClientY){var c=this.state.touchLastClientY-this.state.touchStartClientY,d=c/b*10,e=this.getNodeTouchEventContainer(a),f=this.getNodeContainerOffsetY(e),g=this.calcNodeContainerOffsetY(e,f+100*d/2);e.one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",function(){e.css({"transition-timing-function":"","transition-duration":""})}),e.css({"transition-timing-function":"cubic-bezier(0.1, 0.57, 0.1, 1)","transition-duration":"500ms",transform:"translateY("+g+"px)"})}delete this.state.touchStartClientY,delete this.state.touchStartRelatedY,delete this.state.touchStartTime,delete this.state.touchLastClientY}},getComponent:function(){return b(d.findDOMNode(this.refs.comp))},getCodeTable:function(){return this.getComponentOption("data")},getAvailableTreeModel:function(){var a=this.getComponentOption("parentFilter"),b=this.getCodeTable();return a?a.call(this,b,this.getParentPropertyValue()):b},getTreeLayout:function(){var a=this.getComponentOption("treeLayout");return a=a?b.extend(!0,{},this.props.treeLayout,a):b.extend(!0,{},this.props.treeLayout),a.comp.data=this.getAvailableTreeModel(),a.comp.valueAsArray=!!a.comp.valueAsArray&&a.comp.valueAsArray,a.evt=a.evt?a.evt:{},a.evt.expand=a.evt.expand?function(b){a.evt.expand.call(this,b),this.onPopoverRenderComplete.call(this)}:this.onPopoverRenderComplete,a.evt.collapse=a.evt.collapse?function(b){a.evt.collapse.call(this,b),this.onPopoverRenderComplete.call(this)}:this.onPopoverRenderComplete,a},isHideChildWhenParentChecked:function(){return!!this.getTreeLayout().comp.hierarchyCheck&&this.getComponentOption("hideChildWhenParentChecked")},hasParent:function(){return null!=this.getParentPropertyId()},getParentPropertyId:function(){return this.getComponentOption("parentPropId")},getParentModel:function(){var a=this.getComponentOption("parentModel");return null==a?this.getModel():a},getParentPropertyValue:function(){return this.getParentModel().get(this.getParentPropertyId())}}));e.Components.NSelectTree=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.SelectTree,function(a,b,d,f){return c.createElement(e.Components.NSelectTree,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass({displayName:"NSideMenu",statics:{getSideMenu:function(a,f,g,h){if(f||(f="side_menu_container"),null==e.sideMenu&&(e.sideMenu={}),null==e.sideMenu[f]){0==b("#"+f).length&&b("<div id='"+f+"' />").appendTo(b(document.body)),e.sideMenu[f]=d.render(c.createElement(e.Components.NSideMenu,{menus:a,className:g,hover:!!h}),document.getElementById(f))}return e.sideMenu[f]}},getDefaultProps:function(){return{hover:!1}},getInitialState:function(){return{}},componentDidMount:function(){b(d.findDOMNode(this.refs.menus)).hide()},renderMenuItem:function(a,b,d,e){if(void 0!==a.children){var f=this,g="item_"+b;return c.createElement("li",{ref:g,key:b},c.createElement("a",{href:"javascript:void(0);",onClick:this.onParentMenuClicked.bind(this,g),ref:g+"_link"},a.text,c.createElement("span",{className:"fa fa-fw fa-angle-double-down n-side-menu-ul",ref:g+"_icon"})),c.createElement("ul",{ref:g+"_child",style:{display:"none"}},a.children.map(function(a,c,d){return f.renderMenuItem(a,b+"_"+c,d,!1)})))}return void 0!==a.func?c.createElement("li",{key:b},c.createElement("a",{href:"javascript:void(0);",onClick:this.onMenuClicked.bind(this,a.func,a.value)},a.text)):!0===a.divider?null:c.createElement("li",{key:b},c.createElement("a",{href:a.url},a.text))},render:function(){var a=this;return c.createElement("div",{className:"n-side-menu",ref:"menus",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave},c.createElement("ul",{className:"nav navbar-nav"},this.props.menus.map(function(b,c,d){return a.renderMenuItem(b,c,d,!0)}),c.createElement("li",{className:"n-side-menu-close"},c.createElement("a",{href:"javascript:void(0);",onClick:this.onCloseClicked},c.createElement("span",{className:"fa fa-fw fa-arrow-circle-left"})))))},onMouseEnter:function(){this.props.hover&&this.show()},onMouseLeave:function(){this.props.hover&&this.willHide()},onMenuClicked:function(a,b){a.call(this,b)},onParentMenuClicked:function(a){b(d.findDOMNode(this.refs[a+"_link"])).blur();var c=b(d.findDOMNode(this.refs[a+"_child"]));c.toggle("fade",function(){c.not(":visible")&&c.find("ul").hide()}),b(d.findDOMNode(this.refs[a+"_icon"])).toggleClass("fa-angle-double-down fa-angle-double-up"),this.collapseMenus(a)},collapseMenus:function(a){var c=this;Object.keys(this.refs).forEach(function(e){if(e.endsWith("_link")){var f=e.substr(0,e.length-5);if(!a||!a.startsWith(f)){var g=b(d.findDOMNode(c.refs[f+"_child"]));g.hide("fade",function(){g.find("ul").hide()})}}}),b(d.findDOMNode(this.refs[a+"_icon"])).toggleClass("fa-angle-double-down fa-angle-double-up")},onCloseClicked:function(){this.hide()},show:function(){this.state.willHide&&(clearTimeout(this.state.willHide),this.state.willHide=null),b(d.findDOMNode(this.refs.menus)).show("fade")},hide:function(){var a=this;b(d.findDOMNode(this.refs.menus)).hide("fade",function(){a.collapseMenus()})},willHide:function(){var a=this;this.state.willHide=setTimeout(function(){a.hide()},300)}});e.Components.NSideMenu=f}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass({displayName:"NTab",getDefaultProps:function(){return{type:"tab",justified:!1,removable:!1}},getInitialState:function(){return{}},componentDidUpdate:function(){this.renderRelatedDOM()},componentDidMount:function(){this.renderRelatedDOM()},renderRelatedDOM:function(){var a=this.getActiveTabIndex();this.props.tabs.forEach(function(c,d){a==d?b("#"+c.innerId).show():b("#"+c.innerId).hide()})},renderIcon:function(a,b){if("string"==typeof a){var d={fa:!0,"fa-fw":!0};return d["fa-"+a]=!0,b&&(d["fa-"+b]=!0),c.createElement("span",{className:e.LayoutHelper.classSet(d)})}return a},renderLabel:function(a){return a?c.createElement("span",null," "+a):null},renderBadge:function(a){return a?c.createElement("span",{className:"badge"},a):null},renderTab:function(a,b){var d={active:b==this.getActiveTabIndex(),hide:!1===a.visible};a.css&&(d[a.css]=!0);var f=c.createElement("a",{href:"javascript:void(0);",className:"n-tab-delete",onClick:this.onRemoveClicked},c.createElement("span",{className:"fa fa-fw fa-times"}));return c.createElement("li",{role:"presentation",className:e.LayoutHelper.classSet(d),key:b},c.createElement("a",{href:"javascript:void(0);",onClick:this.onClicked},this.renderIcon(a.icon,this.props.size),this.renderLabel(a.label),this.renderBadge(a.badge)),this.canRemove(a)?f:null)},render:function(){var a={nav:!0,"nav-justified":!0===this.props.justified,"nav-tabs":"tab"===this.props.type,"nav-pills":"pill"===this.props.type,"nav-direction-vertical":"vertical"===this.props.direction};return this.props.tabClassName&&(a[this.props.tabClassName]=!0),c.createElement("div",{className:"n-tab"},c.createElement("ul",{className:e.LayoutHelper.classSet(a),ref:"tabs"},this.props.tabs.map(this.renderTab)))},canRemove:function(a){return null!=a.removable?!0===a.removable:this.props.removable},getActiveTabIndex:function(){var a=this.props.tabs.findIndex(function(a,b){return!0===a.active});return-1==a&&(a=this.props.tabs.findIndex(function(a,b){if(!1!==a.visible)return a.active=!0,!0})),a},setActiveTabIndex:function(b){return(b<0||b>=this.props.tabs.length)&&a.console.warn("Tab index["+b+"] out of bound."),this.props.tabs.forEach(function(a,c){a.active=c==b}),this.forceUpdate(),this},onClicked:function(a){var c=b(a.target).closest("li"),d=c.index(),e=this.getActiveTabIndex(),f=this.props.canActive;if(f){var g=this.props.tabs[e];if(!1===f.call(this,this.props.tabs[d].value,d,g.value,e))return void b(":focus").blur()}this.setActiveTabIndex(d);var h=this.props.onActive;h&&h.call(this,this.props.tabs[d].value,d)},onRemoveClicked:function(a){var c=b(a.target).closest("li");c.addClass("active"),c.parent().children("li").not(c).removeClass("active");var d=c.index(),e=this.props.tabs[d],f=e.value,g=this.props.canRemove;if(g){if(!1===g.call(this,f,d))return}this.props.tabs[d].visible=!1;var h=-1;this.props.tabs.some(function(a,b){if(!1!==a.visible)return h=b,b>d}),this.setActiveTabIndex(h);var i=this.props.onRemove;i&&i.call(this,f,d)}});e.Components.NTab=f}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NTable",mixins:[e.mixins.ArrayComponentMixin],statics:{__operationButtonWidth:31,__minOperationButtonWidth:40,ROW_HEIGHT:32,TOOLTIP_EDIT:null,TOOLTIP_REMOVE:null,TOOLTIP_MORE:"More Operations...",setOperationButtonWidth:function(a){f.__operationButtonWidth=a},ADD_BUTTON_ICON:"plus",ADD_BUTTON_TEXT:"",DOWNLOADABLE:!1,DOWNLOAD_BUTTON_ICON:"cloud-download",DOWNLOAD_BUTTON_TEXT:"",NO_DATA_DOWNLOAD_TITLE:"Downloading...",NO_DATA_DOWNLOAD:"No data needs to be downloaded...",SEARCH_PLACE_HOLDER:"Search...",ROW_EDIT_BUTTON_ICON:"pencil",ROW_REMOVE_BUTTON_ICON:"trash-o",ROW_MORE_BUTTON_ICON:"sort-down",EDIT_DIALOG_SAVE_BUTTON_TEXT:"Save",EDIT_DIALOG_SAVE_BUTTON_ICON:"floppy-o",SORT_ICON:"sort",SORT_ASC_ICON:"sort-amount-asc",SORT_DESC_ICON:"sort-amount-desc",NO_DATA_LABEL:"No Data",INDEX_HEADER_TEXT:"#",INDEX_HEADER_WIDTH:40,DETAIL_ERROR_MESSAGE:"Detail error please open item and do validate.",REMOVE_CONFIRM_TITLE:"Delete data?",REMOVE_CONFIRM_MESSAGE:["Are you sure you want to delete data?","Deleted data cannot be recovered."],BOOLEAN_TRUE_DISPLAY_TEXT:"Y",BOOLEAN_FALSE_DISPLAY_TEXT:"N",PAGE_JUMPING_PROXY:null,PAGE_JUMPING_PROXY_CALLBACK:null,registerInlineEditor:function(b,c){null!=f.__inlineEditors[b]&&(a.console.warn("Inline editor["+b+"] is repalced."),a.console.warn("From:"),a.console.warn(f.__inlineEditors[b]),a.console.warn("To:"),a.console.warn(c)),f.__inlineEditors[b]=c},getInlineEditor:function(a){var b=f.__inlineEditors[a];if(null==b&&(b=f["__"+a]),null==b)throw e.createComponentException(e.ComponentConstants.Err_Unsupported_Component,"Inline component type["+a+"] is not supported yet.");return b},__inlineEditors:{},__text:{comp:{type:{type:e.ComponentConstants.Text,label:!1}}},__check:{comp:{type:{type:e.ComponentConstants.Check,label:!1}}},__date:{comp:{type:{type:e.ComponentConstants.Date,label:!1}}},__select:{comp:{type:{type:e.ComponentConstants.Select,label:!1}}},__radio:{comp:{type:{type:e.ComponentConstants.Radio,label:!1}}}},getDefaultProps:function(){return{defaultOptions:{header:!0,scrollY:!1,scrollX:!1,fixedRightColumns:0,fixedLeftColumns:0,addable:!1,searchable:!0,operationFixed:!1,editable:!1,removable:!1,indexable:!1,indexFixed:!1,rowSelectFixed:!1,sortable:!0,pageable:!1,countPerPage:20,dialogResetVisible:!1,dialogValidateVisible:!1,collapsible:!1,expanded:!0}}},getInitialState:function(){return{sortColumn:null,sortWay:null,countPerPage:20,pageCount:1,currentPageIndex:1,searchText:null,searchModel:e.createModel({text:null}),searchLayout:e.createCellLayout("text",{comp:{placeholder:f.SEARCH_PLACE_HOLDER},css:{comp:"n-table-search-box"}})}},attachListeners:function(){var a=this;this.getScrollBodyComponent().on("scroll",function(c){var d=b(this);a.getScrollHeaderComponent().scrollLeft(d.scrollLeft()),a.getFixedLeftBodyComponent().scrollTop(d.scrollTop()),a.getFixedRightBodyComponent().scrollTop(d.scrollTop())}),this.getDivComponent().on("mouseenter","tbody tr",function(){var c=b(this).parent().children().index(b(this));a.getDivComponent().find("tbody tr:nth-child("+(c+1)+")").addClass("hover")}).on("mouseleave","tbody tr",function(){var c=b(this).parent().children().index(b(this));a.getDivComponent().find("tbody tr:nth-child("+(c+1)+")").removeClass("hover")}),this.renderHeaderPopover(),this.addPostChangeListener(this.onModelChanged),this.state.searchModel.addPostChangeListener("text",this.onSearchBoxChanged),this.addPostRemoveListener(this.onModelChanged),this.addPostAddListener(this.onModelChanged),this.addPostValidateListener(this.onModelValidateChanged),this.addVisibleDependencyMonitor()},detachListeners:function(){this.getScrollBodyComponent().off("scroll"),this.getDivComponent().off("mouseenter","tbody tr").off("mouseleave","tbody tr"),b(d.findDOMNode(this.refs[this.getHeaderLabelId()])).popover("destroy"),this.removePostChangeListener(this.onModelChanged),this.state.searchModel.removePostChangeListener("text",this.onSearchBoxChanged),this.removePostRemoveListener(this.onModelChanged),this.removePostAddListener(this.onModelChanged),this.removePostValidateListener(this.onModelValidateChanged),this.removeVisibleDependencyMonitor()},componentWillUpdate:function(a){this.detachListeners(),a!=this.props&&(this.state.columns=null),this.unregisterFromComponentCentral()},componentDidUpdate:function(a,b){this.attachListeners(),this.registerToComponentCentral()},componentDidMount:function(){this.attachListeners(),this.registerToComponentCentral()},componentWillUnmount:function(){this.detachListeners(),this.unregisterFromComponentCentral(),this.destroyPopover()},isIE8:function(){return e.browser.msie&&8==e.browser.version},isFirefox:function(){return e.browser.mozilla},prepareDisplayOptions:function(){if(null==this.state.columns){var a=this;this.state.columns=this.getComponentOption("columns"),Array.isArray(this.state.columns)?this.state.columns=e.createTableColumnLayout(this.state.columns):this.state.columns=e.createTableColumnLayout(this.state.columns.columns()),this.fixedRightColumns=this.getComponentOption("fixedRightColumns"),this.fixedLeftColumns=this.getComponentOption("fixedLeftColumns");var b=null,c=this.isEditable(),d=this.isRemovable(),g=this.getComponentOption("rowOperations");null==g?g=[]:Array.isArray(g)||(g=[g]),g=g.filter(function(b){return a.isViewMode()?"edit"!=b.view:a.isViewMode()?void 0:"view"!=b.view}),(c||d||0!=g.length)&&(b={editable:c,removable:d,rowOperations:g,title:"",width:this.calcOperationColumnWidth(c,d,g)},this.state.columns.push(b),(this.fixedRightColumns>0||!0===this.getComponentOption("operationFixed"))&&this.fixedRightColumns++);var h=this.isRowSelectable();h&&(b={rowSelectable:h,width:40,title:""},this.state.columns.splice(0,0,b),(this.fixedLeftColumns>0||!0===this.getComponentOption("rowSelectFixed"))&&this.fixedLeftColumns++);this.isIndexable()&&(b={indexable:!0,width:f.INDEX_HEADER_WIDTH,title:f.INDEX_HEADER_TEXT},this.state.columns.splice(0,0,b),(this.fixedLeftColumns>0||!0===this.getComponentOption("indexFixed"))&&this.fixedLeftColumns++)}},calcOperationColumnWidth:function(a,b,c){var d=this.getComponentOption("operationColumnWidth");if(null!=d)return d;var e=this.getComponentOption("maxOperationButtonCount");if(e){e>(a?1:0)+(b?1:0)+c.length?(d=(a?f.__operationButtonWidth:0)+(b?f.__operationButtonWidth:0),0!=c.length&&(d+=f.__operationButtonWidth*c.length)):d=(e+1)*f.__operationButtonWidth}else d=(a?f.__operationButtonWidth:0)+(b?f.__operationButtonWidth:0),0!=c.length&&(d+=f.__operationButtonWidth*c.length);return d<f.__minOperationButtonWidth?f.__minOperationButtonWidth:d},renderSearchBox:function(){return this.isSearchable()?c.createElement(e.Components.NText,{model:this.state.searchModel,layout:this.state.searchLayout}):null},renderHeadingButtons:function(){var a={display:this.state.expanded?"block":"none"},b=[];return this.isAddable()&&b.push(c.createElement("a",{href:"javascript:void(0);",onClick:this.onAddClicked,className:"n-table-heading-buttons pull-right",ref:"add-button",style:a,key:"add-button"},c.createElement(e.Components.NIcon,{icon:f.ADD_BUTTON_ICON}),this.getComponentOption("addText")||f.ADD_BUTTON_TEXT)),this.isDownloadable()&&b.push(c.createElement("a",{href:"javascript:void(0);",onClick:this.onDownloadClicked,className:"n-table-heading-buttons pull-right",ref:"download-button",style:a,key:"download-button"},c.createElement(e.Components.NIcon,{icon:f.DOWNLOAD_BUTTON_ICON}),f.DOWNLOAD_BUTTON_TEXT)),b},renderPanelHeadingLabel:function(){var a="col-sm-3 col-md-3 col-lg-3";this.getModel().hasError(this.getDataId())&&(a+=" has-error");var b={"n-table-heading-label":!0};return this.isCollapsible()&&(b["n-table-heading-label-collapsible"]=!0),c.createElement("div",{className:a},c.createElement("span",{className:this.getAdditionalCSS("headingLabel",e.LayoutHelper.classSet(b)),ref:this.getHeaderLabelId(),onClick:this.isCollapsible()?this.onTitleClicked:null},this.getLayout().getLabel(this)))},renderHeaderPopover:function(){if(e.ComponentConstants.ERROR_POPOVER&&this.getModel().hasError(this.getDataId())){var a=this.getModel().getError(this.getDataId()),c=this,g=a.map(function(a){return"string"==typeof a?"<span style='display:block'>"+a.format([c.getLayout().getLabel(this)])+"</span>":"<span style='display:block'>"+f.DETAIL_ERROR_MESSAGE+"</span>"});b(d.findDOMNode(this.refs[this.getHeaderLabelId()])).popover({placement:"top",trigger:"hover",html:!0,content:g,animation:!1})}},renderPanelHeading:function(){return this.isHeading()?c.createElement("div",{className:this.getAdditionalCSS("heading","panel-heading n-table-heading")},c.createElement("div",{className:"row"},this.renderPanelHeadingLabel(),c.createElement("div",{className:"col-sm-9 col-md-9 col-lg-9"},this.renderHeadingButtons(),this.renderSearchBox()))):null},renderTableHeaderSortButton:function(a){if(this.isSortable(a)){var b=f.SORT_ICON,d=this.getAdditionalCSS("sort","pull-right n-table-sort");return this.state.sortColumn==a&&(d+=" "+this.getAdditionalCSS("sorted","n-table-sorted"),b="asc"==this.state.sortWay?f.SORT_ASC_ICON:f.SORT_DESC_ICON),c.createElement("a",{href:"javascript:void(0);",className:d,onClick:this.onSortClicked.bind(this,a)},c.createElement(e.Components.NIcon,{icon:b}))}},renderTableHeaderCheckBox:function(a){var b=this.getDataToDisplay(),d=this.computePagination(b),f=this.isCurrentPageAllSelected(a,b,d),g=e.createModel({allCheck:f}),h=e.createCellLayout("allCheck",{comp:{type:e.ComponentConstants.Check}}),i=this;return g.addListener("allCheck","post","change",function(c){var f=c.new;if(null!=b){var g=1;b.forEach(function(b){g>=d.min&&g<=d.max&&e.setValueIntoJSON(b,a.rowSelectable,f),g++}),i.forceUpdate(i.onCheckAllChanged.bind(i,f))}}),c.createElement(e.Components.NCheck,{model:g,layout:h})},renderTableHeading:function(a,b,d){var e=this.getRenderColumnIndexRange(a,b,d),f=0,g=this;return c.createElement("thead",null,c.createElement("tr",null,this.state.columns.map(function(a){if(f>=e.min&&f<=e.max){f++;var b={};return b.width=a.width,a.headerAlign&&(b.textAlign=a.headerAlign),void 0!==a.visible&&!0!==a.visible&&(b.display="none"),a.rowSelectable?c.createElement("td",{style:b,key:f},g.renderTableHeaderCheckBox(a)):c.createElement("td",{style:b,key:f},a.title,g.renderTableHeaderSortButton(a))}f++})))},renderRowEditButton:function(a){var b=e.createCellLayout("editButton",{comp:{style:"link",icon:f.ROW_EDIT_BUTTON_ICON,enabled:this.getRowEditButtonEnabled(),click:this.onEditClicked.bind(this,a.getCurrentModel()),tooltip:f.TOOLTIP_EDIT},css:{comp:"n-table-op-btn"}});return c.createElement(e.Components.NFormButton,{model:a,layout:b})},renderRowRemoveButton:function(a){var b=e.createCellLayout("removeButton",{comp:{style:"link",icon:f.ROW_REMOVE_BUTTON_ICON,enabled:this.getRowRemoveButtonEnabled(),click:this.onRemoveClicked.bind(this,a.getCurrentModel()),tooltip:f.TOOLTIP_REMOVE},css:{comp:"n-table-op-btn"}});return c.createElement(e.Components.NFormButton,{model:a,layout:b})},isRowOperationVisible:function(a,b){var c=a.visible;return!c||this.getRuleValue(c,!0,b)},renderRowOperationButton:function(a,b,d){var f=e.createCellLayout("rowButton",{label:a.icon?null:a.tooltip,comp:Object.keys(a).reduce(function(b,c){return"click"!=c&&(b[c]=a[c]),b},{style:"link",click:this.onRowOperationClicked.bind(this,a.click,b)}),css:{comp:"n-table-op-btn"}});return c.createElement(e.Components.NFormButton,{model:b,layout:f,key:d})},getRowOperations:function(a){var b=a.rowOperations;return void 0!==b&&null!==b||(b=[]),b},renderFlatOperationCell:function(a,b){var d=a.editable?this.renderRowEditButton(b):null,e=a.removable?this.renderRowRemoveButton(b):null,f=this.getRowOperations(a),g=this;return c.createElement("div",{className:"btn-group n-table-op-btn-group",role:"group"},f.map(function(a,c){return g.renderRowOperationButton(a,b,c)}),d,e)},renderPopoverContainer:function(){null==this.state.popoverDiv&&(this.state.popoverDiv=b("<div>"),this.state.popoverDiv.appendTo(b("body")),b(document).on("click",this.onDocumentClicked).on("keyup",this.onDocumentKeyUp)),this.state.popoverDiv.hide()},isRenderMoreOperationButtonsAsIcon:function(a){return!!this.getComponentOption("moreAsMenu")||!a.some(function(a){return null==a.icon})},renderPopoverAsMenu:function(a,b){var d=a.some(function(a){return null!=a.icon}),f=this,g=function(a,g){var h=e.createCellLayout("rowButton",{label:a.tooltip,comp:{style:"link",icon:d?a.icon?a.icon:"placeholder":null,enabled:a.enabled,click:f.onRowOperationClicked.bind(f,a.click,b)},css:{comp:"n-table-op-btn"}});return c.createElement("li",{key:g},c.createElement(e.Components.NFormButton,{model:b,layout:h}))};return c.createElement("ul",{className:"nav"},a.map(g))},renderPopoverAsIcon:function(a,b){var c=this;return a.map(function(a,d){return c.renderRowOperationButton(a,b,d)})},renderPopover:function(a,e,f){var g={display:"block"},h=b(f).closest("a"),i=h.offset();g.top=i.top+h.outerHeight()-5,g.left=i.left,d.render(c.createElement("div",{role:"tooltip",className:"n-table-op-btn-popover popover bottom in",style:g},c.createElement("div",{className:"arrow"}),c.createElement("div",{className:"popover-content"},this.isRenderMoreOperationButtonsAsIcon(a)?this.renderPopoverAsIcon(a,e):this.renderPopoverAsMenu(a,e))),this.state.popoverDiv.get(0))},showPopover:function(a,c,d){this.renderPopoverContainer(),this.renderPopover(a,c,d),this.state.popoverDiv.show();var e={},f=b(d).closest("a"),g=f.offset(),h=this.state.popoverDiv.children(".popover"),i=h.outerWidth();e.left=g.left+f.outerWidth()-i+10,h.css(e)},hidePopover:function(){this.state.popoverDiv&&this.state.popoverDiv.is(":visible")&&(this.state.popoverDiv.hide(),d.render(c.createElement("noscript",null),this.state.popoverDiv.get(0)))},destroyPopover:function(){this.state.popoverDiv&&(b(document).off("click",this.onDocumentClicked).off("keyup",this.onDocumentKeyUp),this.state.popoverDiv.remove(),delete this.state.popoverDiv)},onDocumentClicked:function(a){var c=b(a.target);0!=c.closest(this.state.popoverDiv).length||(0!=c.closest(b(".n-table-op-btn.more")).length?0==c.closest(b(this.refs.div)).length&&this.hidePopover():this.hidePopover())},onDocumentKeyUp:function(a){27===a.keyCode&&this.hidePopover()},onRowOperationMoreClicked:function(a,b,c){this.showPopover(a,b,c)},renderRowOperationMoreButton:function(a,b){var d=e.createCellLayout("rowButton",{comp:{style:"link",icon:f.ROW_MORE_BUTTON_ICON,click:this.onRowOperationMoreClicked.bind(this,a),tooltip:f.TOOLTIP_MORE},css:{comp:"n-table-op-btn more"}});return c.createElement(e.Components.NFormButton,{model:b,layout:d,key:"more-op"})},renderDropDownOperationCell:function(a,b,d){var e=this,f=this.getRowOperations(a);a.editable&&f.push({editButton:!0}),a.removable&&f.push({removeButton:!0}),f=f.filter(function(a){return e.isRowOperationVisible(a,b)});var g=-1,h=[];return f.some(function(a,c){return a.editButton?h.push(e.renderRowEditButton(b)):a.removeButton?h.push(e.renderRowRemoveButton(b)):h.push(e.renderRowOperationButton(a,b,c)),g++,d-g==1}),f.length-g>1&&h.push(this.renderRowOperationMoreButton(f.slice(g+1),b)),c.createElement("div",{className:"btn-group n-table-op-btn-group",role:"group"},h,null)},renderOperationCell:function(a,b){var c=!1,d=this.getComponentOption("maxOperationButtonCount");if(d){(a.editable?1:0)+(a.removable?1:0)+a.rowOperations.length>d&&(c=!0)}return c?this.renderDropDownOperationCell(a,b,d):this.renderFlatOperationCell(a,b)},renderRowSelectCell:function(a,b){var d=this;b.addListener(a.rowSelectable,"post","change",function(a){d.forceUpdate()});var f=e.createCellLayout(a.rowSelectable,{comp:{type:e.ComponentConstants.Check}});return c.createElement(e.Components.NCheck,{model:b,layout:f})},renderTableBodyRow:function(a,d,g,h,i){var j=this.getRenderColumnIndexRange(g,h,i),k=0,l=this,m=d%2==0?"even":"odd";if(this.getModel().hasError(this.getDataId())){for(var n=null,o=this.getModel().getError(this.getDataId()),p=0,q=o.length;p<q;p++)"string"!=typeof o[p]&&(n=o[p].getError(a));null!=n&&(m+=" has-error")}var r=this.createRowModel(a,!0);return this.addRowListener(r),c.createElement("tr",{className:m,key:d},this.state.columns.map(function(g){if(k>=j.min&&k<=j.max){k++;var h={width:g.width};g.styles&&Object.keys(g.styles).forEach(function(a){h[a]=g.styles[a]}),void 0!==g.visible&&!0!==g.visible&&(h.display="none");var i;if(g.editable||g.removable||null!=g.rowOperations)i=l.renderOperationCell(g,r),h.textAlign="left";else if(g.indexable)i=d;else if(g.rowSelectable)i=l.renderRowSelectCell(g,r);else if(g.inline)if("string"==typeof g.inline){var m=f.getInlineEditor(g.inline);m.pos={width:12},m.css?m.css.cell=(m.css.cell," "+m.css.cell):m.css={cell:"inline-editor"},m.label=g.title,m="select"===g.inline||"radio"===g.inline?b.extend(!0,{},{comp:{data:g.codes}},m):b.extend(!0,{},m),i=c.createElement(e.Components.NFormCell,{model:r,layout:e.createCellLayout(g.data,m),direction:"horizontal",view:l.isViewMode()})}else"cell"==g.inline.inlineType?(g.inline.pos={width:12},g.inline.css?g.inline.css.cell="inline-editor"+(g.inline.css.cell?" "+g.inline.css.cell:""):g.inline.css={cell:"inline-editor"},g.inline.label=g.inline.label?g.inline.label:g.title,i=c.createElement(e.Components.NFormCell,{model:r,layout:e.createCellLayout(g.data,g.inline),direction:"horizontal",view:l.isViewMode(),className:g.inline.__className})):i=c.createElement(e.Components.NForm,{model:r,layout:e.createFormLayout(g.inline),direction:"horizontal",view:l.isViewMode()});else i=l.getDisplayTextOfColumn(g,a);return c.createElement("td",{style:h,key:k,className:g.css},i)}k++}))},renderTableBody:function(a,b,d){var e=this.getDataToDisplay();if(null==e||0==e.length)return null;var f=1,g=this,h=this.computePagination(e);return c.createElement("tbody",null,e.map(function(c){return f>=h.min&&f<=h.max?g.renderTableBodyRow(c,f++,a,b,d):(f++,null)}))},renderTableNoScrollY:function(){return c.createElement("div",{className:this.getAdditionalCSS("panelBody","n-table-panel-body")},c.createElement("table",{cellSpacing:"0",className:this.getAdditionalCSS("table","n-table cell-border"),style:this.computeTableStyle(),ref:"table"},this.renderTableHeading(!0),this.renderTableBody(!0)))},renderTableScrollY:function(){var a=this.computeTableStyle(),b={overflowY:"scroll"},d={maxHeight:this.getComponentOption("scrollY"),overflowY:"scroll"};return c.createElement("div",{className:this.getAdditionalCSS("panelBody","n-table-panel-body")},c.createElement("div",{className:"n-table-scroll-head",ref:this.getScrolledHeaderDivId(),style:b},c.createElement("div",{className:"n-table-scroll-head-inner",style:a},c.createElement("table",{cellSpacing:"0",className:this.getAdditionalCSS("table","n-table cell-border"),style:a},this.renderTableHeading(!0)))),c.createElement("div",{className:"n-table-scroll-body",style:d,ref:this.getScrolledBodyDivId()},c.createElement("table",{cellSpacing:"0",className:this.getAdditionalCSS("table","n-table cell-border"),style:a,ref:"table"},this.renderTableBody(!0))))},renderTable:function(){return this.hasVerticalScrollBar()&&this.hasDataToDisplay()?this.renderTableScrollY():this.renderTableNoScrollY()},renderFixedLeftColumnsScrollY:function(){var a={width:this.computeFixedLeftColumnsWidth()},b={width:"100%",overflow:"hidden"};this.hasHorizontalScrollBar()&&(b.maxHeight=this.getComponentOption("scrollY")-(this.isIE8()?0:18));var d={width:"100%"};return c.createElement("div",{className:"n-table-fix-left",style:a},c.createElement("table",{cellSpacing:"0",style:d,className:this.getAdditionalCSS("table","n-table cell-border")},this.renderTableHeading(!1,!0)),c.createElement("div",{ref:this.getFixedLeftBodyDivId(),style:b},c.createElement("table",{cellSpacing:"0",className:this.getAdditionalCSS("table","n-table cell-border"),style:d},this.renderTableBody(!1,!0))))},renderFixedLeftColumnsNoScrollY:function(){var a={width:this.computeFixedLeftColumnsWidth()},b={width:"100%"};return c.createElement("div",{className:"n-table-fix-left",style:a},c.createElement("table",{cellSpacing:"0",className:this.getAdditionalCSS("table","n-table cell-border"),style:b},this.renderTableHeading(!1,!0),this.renderTableBody(!1,!0)))},renderFixedLeftColumns:function(){return!this.hasFixedLeftColumns()&&this.hasDataToDisplay()?null:this.hasVerticalScrollBar()?this.renderFixedLeftColumnsScrollY():this.renderFixedLeftColumnsNoScrollY()},renderFixedRightColumnsNoScrollY:function(){var a={width:this.computeFixedRightColumnsWidth()},b={width:"100%"};return c.createElement("div",{className:"n-table-fix-right",style:a},c.createElement("table",{cellSpacing:"0",className:this.getAdditionalCSS("table","n-table cell-border"),style:b},this.renderTableHeading(!1,!1,!0),this.renderTableBody(!1,!1,!0)))},renderFixedRightColumnsScrollY:function(){var a={width:this.computeFixedRightColumnsWidth(),right:"16px"},b={width:"100%",overflow:"hidden"};this.hasHorizontalScrollBar()&&(b.maxHeight=this.getComponentOption("scrollY")-(this.isIE8()?0:18));var d={width:"100%"};return c.createElement("div",{className:"n-table-fix-right",style:a},c.createElement("div",{className:"n-table-fix-right-head-wrapper"},c.createElement("div",{className:"n-table-fix-right-top-corner"}),c.createElement("table",{cellSpacing:"0",style:d,className:this.getAdditionalCSS("table","n-table cell-border")},this.renderTableHeading(!1,!1,!0))),c.createElement("div",{ref:this.getFixedRightBodyDivId(),style:b},c.createElement("table",{cellSpacing:"0",className:this.getAdditionalCSS("table","n-table cell-border")},this.renderTableBody(!1,!1,!0))))},renderFixedRightColumns:function(){return!this.hasFixedRightColumns()&&this.hasDataToDisplay()?null:this.hasVerticalScrollBar()?this.renderFixedRightColumnsScrollY():this.renderFixedRightColumnsNoScrollY()},renderNoDataReminder:function(){return this.hasDataToDisplay()?null:c.createElement("div",{className:"n-table-no-data"},c.createElement("span",null,f.NO_DATA_LABEL))},renderPagination:function(){return this.isPageable()&&this.hasDataToDisplay()?c.createElement(e.Components.NPagination,{className:"n-table-pagination",pageCount:this.state.pageCount,currentPageIndex:this.state.currentPageIndex,toPage:this.toPage}):null},renderRightTopCorner:function(){var a=null;if(this.hasVerticalScrollBar()&&!this.hasFixedRightColumns()){var b={width:"16px",right:"16px"},d={width:"100%",overflow:"hidden"};this.hasHorizontalScrollBar()&&(d.maxHeight=this.getComponentOption("scrollY")-(this.isIE8()?0:18)),a=c.createElement("div",{className:"n-table-fix-right",style:b},c.createElement("div",{className:"n-table-fix-right-head-wrapper"},c.createElement("div",{className:"n-table-fix-right-top-corner"})))}return a},render:function(){this.prepareDisplayOptions();var a={"n-table-container panel":!0},b=this.getComponentOption("style");b?a["panel-"+b]=!0:a["panel-default"]=!0,this.isHeading()||(a["n-table-no-header"]=!0);var d={display:this.isExpanded()?"block":"none"}
;return c.createElement("div",{className:this.getComponentCSS(e.LayoutHelper.classSet(a)),ref:"div"},this.renderPanelHeading(),c.createElement("div",{ref:"table-panel-body",style:d},c.createElement("div",{className:this.getAdditionalCSS("body","n-table-body-container panel-body")},this.renderTable(),this.renderFixedLeftColumns(),this.renderFixedRightColumns(),this.renderRightTopCorner()),this.renderNoDataReminder(),this.renderPagination()))},hasVerticalScrollBar:function(){return!1!==this.getComponentOption("scrollY")},hasHorizontalScrollBar:function(){return!!this.hasVerticalScrollBar()||!0===this.getComponentOption("scrollX")},computeTableStyle:function(){var a=0;return this.hasHorizontalScrollBar()?(a=0,this.state.columns.forEach(function(b){void 0!==b.visible&&!0!==b.visible||(a+=b.width?1*b.width:0)})):a="100%",{width:a,maxWidth:a}},computeFixedLeftColumnsWidth:function(){var a=0,b=this.getMaxFixedLeftColumnIndex(),c=0;return this.state.columns.forEach(function(d){c<=b&&(void 0===d.visible||!0===d.visible)&&(a+=d.width?1*d.width:0),c++}),a+1},computeFixedRightColumnsWidth:function(){var a=0,b=this.getMinFixedRightColumnIndex(),c=0;return this.state.columns.forEach(function(d){c>=b&&(void 0===d.visible||!0===d.visible)&&(a+=d.width),c++}),a+(this.isFirefox()?3:1)},getRenderColumnIndexRange:function(a,b,c){var d={};return a?(d.min=0,d.max=1e4):b?(d.min=0,d.max=this.getMaxFixedLeftColumnIndex()):c&&(d.min=this.getMinFixedRightColumnIndex(),d.max=1e4),d},getMaxFixedLeftColumnIndex:function(){return this.fixedLeftColumns-1},getMinFixedRightColumnIndex:function(){return this.state.columns.length()-this.fixedRightColumns},getQuerySettings:function(){return this.getComponentOption("criteria")},computePagination:function(a){var b=0,c=999999;if(this.isPageable()){var d=this.getQuerySettings();if(null===d){this.state.countPerPage=this.getComponentOption("countPerPage");var e=0==a.length?1:a.length/this.state.countPerPage;this.state.pageCount=Math.floor(e)==e?e:Math.floor(e)+1,this.state.currentPageIndex=this.state.currentPageIndex>this.state.pageCount?this.state.pageCount:this.state.currentPageIndex,this.state.currentPageIndex=this.state.currentPageIndex<=0?1:this.state.currentPageIndex,b=(this.state.currentPageIndex-1)*this.state.countPerPage+1,c=b+this.state.countPerPage-1}else{var f=this.getModel().get(d);this.state.countPerPage=f.countPerPage,this.state.pageCount=f.pageCount,this.state.currentPageIndex=f.pageIndex,b=1,c=this.state.countPerPage}}return{min:b,max:c}},hasFixedLeftColumns:function(){return this.fixedLeftColumns>0},hasFixedRightColumns:function(){return this.fixedRightColumns>0},isAddable:function(){return this.getComponentOption("addable")&&!this.isViewMode()},isEditable:function(){return this.getComponentOption("editable")},getRowEditButtonEnabled:function(){return this.getComponentOption("rowEditEnabled")},isRemovable:function(){return this.getComponentOption("removable")&&!this.isViewMode()},getRowRemoveButtonEnabled:function(){return this.getComponentOption("rowRemoveEnabled")},isDownloadable:function(){var a=this.getComponentOption("downloadable");return null!=a?a:f.DOWNLOADABLE},isSearchable:function(){return this.getComponentOption("searchable")},isIndexable:function(){return this.getComponentOption("indexable")},isRowSelectable:function(){return!this.isViewMode()&&this.getComponentOption("rowSelectable")},isPageable:function(){return this.getComponentOption("pageable")},isHeading:function(){return this.getComponentOption("header")},isCollapsible:function(){return this.getComponentOption("collapsible")},isExpanded:function(){return void 0===this.state.expanded&&(this.state.expanded=this.getComponentOption("expanded")),this.state.expanded},isSortable:function(a){return void 0===a?this.getComponentOption("sortable"):this.isSortable()?!1!==a.sort&&!(a.editable||a.removable||a.indexable||a.rowSelectable||null!=a.rowOperations):a.sort},getSorter:function(){return this.getComponentOption("sorter")},hasDataToDisplay:function(){var a=this.getDataToDisplay();return null!=a&&a.length>0},getDisplayTextOfColumn:function(a,b){var c=null;if("boolean"==typeof(c=a.render?a.render(b):a.codes?a.codes.getText(e.getValueFromJSON(b,a.data)):e.getValueFromJSON(b,a.data))){if(!0===c)return f.BOOLEAN_TRUE_DISPLAY_TEXT;if(!1===c)return f.BOOLEAN_FALSE_DISPLAY_TEXT}return null==c?null:c.toString()},filterData:function(a,b,c){var d=this.state.searchText.toUpperCase(),e=this;return this.getComponentOption("columns").some(function(b){var c=e.getDisplayTextOfColumn(b,a);return null!=c&&-1!=c.toString().toUpperCase().indexOf(d)})},getDataToDisplay:function(){var a=this.getValueFromModel();return null==a?a:this.isSearching()?a.filter(this.filterData):a},isSearching:function(){return this.isSearchable()&&null!=this.state.searchText&&0!=this.state.searchText.length},isCurrentPageAllSelected:function(a,b,c){var d=1;return null!=b&&!b.some(function(b){return d>=c.min&&d<=c.max?(d++,!0!==b[a.rowSelectable]):(d++,!1)})},onTitleClicked:function(){this.state.expanded=!this.state.expanded,this.state.expanded?(b(d.findDOMNode(this.refs["table-panel-body"])).slideDown(300),b(d.findDOMNode(this.refs["add-button"])).show()):(b(d.findDOMNode(this.refs["table-panel-body"])).slideUp(300),b(d.findDOMNode(this.refs["add-button"])).hide())},onCheckAllChanged:function(a){var b=this.getEventMonitor("checkAll");b&&b.call(this,a)},onAddClicked:function(){var a=e.cloneJSON(this.getComponentOption("modelTemplate")),b=this.createEditingModel(a),c=this.getComponentOption("editLayout"),d=this.getComponentOption("addClick");d?d.call(this,this.getModel(),b,c):this.getEditDialog().show({model:b,layout:e.createFormLayout(c),buttons:{right:[{icon:f.EDIT_DIALOG_SAVE_BUTTON_ICON,text:f.EDIT_DIALOG_SAVE_BUTTON_TEXT,style:"primary",click:this.onAddCompleted}],reset:this.getComponentOption("dialogResetVisible"),validate:this.getComponentOption("dialogValidateVisible")}})},onAddCompleted:function(){var a=this.getEditDialog();if(!(this.getComponentOption("onAddSave")?!1===this.getComponentOption("onAddSave").call(this,a.getModel(),a):a.validate())){var b=a.hide();this.getModel().add(this.getDataId(),b.getCurrentModel())}},onEditClicked:function(a){var b=this.createEditingModel(a),c=this.getComponentOption("editLayout"),d=this.getComponentOption("editClick");d?d.call(this,this.getModel(),b,c):this.getEditDialog().show({model:b,layout:e.createFormLayout(c),buttons:{right:[{icon:f.EDIT_DIALOG_SAVE_BUTTON_ICON,text:f.EDIT_DIALOG_SAVE_BUTTON_TEXT,style:"primary",click:this.onEditCompleted,view:"edit"}],reset:this.getComponentOption("dialogResetVisible"),validate:this.getComponentOption("dialogValidateVisible"),cancel:!this.isViewMode()||function(a,b){b()}},view:this.isViewMode()})},onEditCompleted:function(){var a=this.getEditDialog();if(!(this.getComponentOption("onEditSave")?!1===this.getComponentOption("onEditSave").call(this,a.getModel(),a):a.validate())){var b=this.getEditDialog().hide(),c=b.getOriginalModel(),d=b.getCurrentModel();this.getModel().update(this.getDataId(),c,d)}},onRemoveClicked:function(a){var b=function(a){var b=this.getComponentOption("canRemove");b&&!b.call(this,this.getModel(),a)||this.getModel().remove(this.getDataId(),a),e.Components.NConfirm.getConfirmModal().hide()};e.Components.NConfirm.getConfirmModal().show(f.REMOVE_CONFIRM_TITLE,f.REMOVE_CONFIRM_MESSAGE,b.bind(this,a))},onRowOperationClicked:function(a,b){a.call(this,b.getCurrentModel(),b)},onDownloadClicked:function(){var a=null,c=this.getQuerySettings();if(null===c)a=this.getValueFromModel(),this.exposeDownloading(a);else{var d=this.getModel(),g=d.get(c);g=b.extend({},g);var h=g.url;delete g.url,delete g.pageCount,g.pageIndex=-1,f.PAGE_JUMPING_PROXY&&(g=f.PAGE_JUMPING_PROXY.call(this,g));if(this.getEventMonitor("download"))this.notifyEvent({type:"download",criteria:g,target:this});else{var i=this;e.internalDoPost(h,g).done(function(a){"string"==typeof a&&(a=JSON.parse(a)),f.PAGE_JUMPING_PROXY_CALLBACK&&(a=f.PAGE_JUMPING_PROXY_CALLBACK.call(i,a,i.getDataId()));var b=null;b=a&&a[i.getDataId()]?a[i.getDataId()]:[],i.exposeDownloading(b)})}}},exposeDownloading:function(a){null==a||0==a.length?NConfirm.getConfirmModal().show({title:f.NO_DATA_DOWNLOAD_TITLE,messages:f.NO_DATA_DOWNLOAD,disableConfirm:!0,close:!0}):this.tableToExcel(a)},tableToExcel:function(a){var b=document.createElement("a"),c=this.generateTableExcelHeader(),d="<tbody>"+a.map(this.generateTableExcelBodyRow).join("")+"</tbody>",e="<table>"+c+d+"</table>";e=e.replace(/ /g,"%20"),b.href="data:application/vnd.ms-excel, "+e,b.download="exported_data.xls",b.click()},generateTableExcelHeader:function(){return"<thead><tr>"+this.state.columns.map(function(a){return void 0!==a.visible&&!0!==a.visible?"":a.editable||a.removable||null!=a.rowOperations?"":a.indexable?"":a.rowSelectable?"":"<td>"+a.title+"</td>"}).join("")+"</tr></thead>"},generateTableExcelBodyRow:function(a){var b=this;return"<tr>"+this.state.columns.map(function(c){if(void 0!==c.visible&&!0!==c.visible)return"";if(c.editable||c.removable||null!=c.rowOperations)return"";if(c.indexable)return"";if(c.rowSelectable)return"";var d=b.getDisplayTextOfColumn(c,a);return"<td>"+(null==d?"":d)+"</td>"}).join("")+"</tr>"},onSearchBoxChanged:function(){var a=this.state.searchModel.get("text");null==a||""==a?this.setState({searchText:null}):this.setState({searchText:a})},onSortClicked:function(a){var b=this.getValueFromModel();if(null!=b){var c="asc";this.state.sortColumn==a&&(c="asc"==this.state.sortWay?"desc":"asc");var d=this.getSorter();if(d)return d.call(this,{mode:c,column:a,data:b,criteria:this.getQuerySettings()}),void this.setState({sortColumn:a,sortWay:c});var f=!1;if(void 0!==a.sort&&null!=a.sort)if("function"==typeof a.sort)d=a.sort;else if("number"===a.sort)f=!0;else if("boolean"!=typeof a.sort)throw e.createComponentException(e.ComponentConstants.Err_Unuspported_Column_Sort,"Column sort ["+a.sort+"] is not supported yet.");var g=this;d=null==d?function(b,c){var d=g.getDisplayTextOfColumn(a,b),e=g.getDisplayTextOfColumn(a,c);return null==d?null==e?0:-1:null==e?1:(f&&(d*=1,e*=1),d>e?1:d<e?-1:0)}:d,"asc"==c?b.sort(d):b.sort(function(a,b){return 0-d(a,b)}),this.setState({sortColumn:a,sortWay:c})}},getEditDialog:function(){return void 0!==this.state.editDialog&&null!==this.state.editDialog||(this.state.editDialog=e.Components.NModalForm.createFormModal(this.getLayout().getLabel(this))),this.state.editDialog},createEditingModel:function(a){return this.createRowModel(a,!1)},onModelChanged:function(a){"add"==a.type?(this.computePagination(this.getDataToDisplay()),this.state.currentPageIndex=this.state.pageCount):"remove"==a.type||a.type,null!=this.getModel().getValidator()?this.getModel().validate(this.getDataId()):this.forceUpdate()},toPage:function(a){if(this.state.currentPageIndex!=a){var c=this.getQuerySettings();if(null===c)this.setState({currentPageIndex:a});else{var d=this,g=this.getModel(),h=g.get(c);h=b.extend({},h);var i=h.url;delete h.url,delete h.pageCount,h.pageIndex=a,f.PAGE_JUMPING_PROXY&&(h=f.PAGE_JUMPING_PROXY.call(this,h));this.getEventMonitor("pageChange")?this.notifyEvent({type:"pageChange",criteria:h,target:this}):e.internalDoPost(i,h).done(function(a){"string"==typeof a&&(a=JSON.parse(a)),f.PAGE_JUMPING_PROXY_CALLBACK&&(a=f.PAGE_JUMPING_PROXY_CALLBACK.call(d,a,d.getDataId())),g.mergeCurrentModel(a),d.forceUpdate()})}}},getDivComponent:function(){return b(d.findDOMNode(this.refs.div))},getComponent:function(){return b(d.findDOMNode(this.refs.table))},getHeaderLabelId:function(){return"n-table-header-label"},getScrollHeaderComponent:function(){return b(this.refs[this.getScrolledHeaderDivId()]?d.findDOMNode(this.refs[this.getScrolledHeaderDivId()]):"#___")},getScrolledHeaderDivId:function(){return"n-table-scrolled-head"},getScrollBodyComponent:function(){return b(this.refs[this.getScrolledBodyDivId()]?d.findDOMNode(this.refs[this.getScrolledBodyDivId()]):"#___")},getScrolledBodyDivId:function(){return"n-table-scrolled-body"},getFixedLeftBodyComponent:function(){return b(this.refs[this.getFixedLeftBodyDivId()]?d.findDOMNode(this.refs[this.getFixedLeftBodyDivId()]):"#___")},getFixedLeftBodyDivId:function(){return"n-table-scrolled-left-body"},getFixedRightBodyComponent:function(){return b(this.refs[this.getFixedRightBodyDivId()]?d.findDOMNode(this.refs[this.getFixedRightBodyDivId()]):"#___")},getFixedRightBodyDivId:function(){return"n-table-scrolled-right-body"},clearColumnsDefinition:function(){this.state.columns=null,this.forceUpdate()}}));e.Components.NTable=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.Table,function(a,b,d,f){return c.createElement(e.Components.NTable,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NText",statics:{NUMBER_FORMAT:function(a){for(var b=(a+"").split("."),c=b[0],d=b.length>1?"."+b[1]:"",e=/(\d+)(\d{3})/;e.test(c);)c=c.replace(e,"$1,$2");return c+d},PERCENTAGE:{model:function(a){return isNaN(a)||(a+"").isBlank()?a:(a+"").movePointLeft(2)},view:function(a){return isNaN(a)||(a+"").isBlank()?a:(a+"").movePointRight(2)}},TRIM:!1,DELAY:300},getDefaultProps:function(){return{defaultOptions:{}}},afterWillUpdate:function(a){this.getComponent().off("change",this.onChange),this.uninstallOtherDOMListeners()},beforeDidUpdate:function(a,c){var e=this.getValueFromModel();b(d.findDOMNode(this.refs.focusLine)).hasClass("focus")||(e=this.getFormattedValue(e)),this.getComponent().val()!=e&&this.getComponent().val(e)},afterDidUpdate:function(){this.getComponent().on("change",this.onChange),this.installOtherDOMListeners()},beforeDidMount:function(){this.getComponent().val(this.getFormattedValue(this.getValueFromModel()))},afterDidMount:function(){this.getComponent().on("change",this.onChange),this.installOtherDOMListeners()},afterWillUnmount:function(){this.getComponent().off("change",this.onChange),this.uninstallOtherDOMListeners()},installOtherDOMListeners:function(){var a=this.getEventMonitor();Object.keys(a).filter(function(a){return["change","blur","focus","keyPress","keyUp"].indexOf(a)<0}).forEach(function(b){this.getComponent().on(b,a[b].bind(this))}.bind(this))},uninstallOtherDOMListeners:function(){var a=this.getEventMonitor();Object.keys(a).filter(function(a){return["change","blur","focus","keyPress","keyUp"].indexOf(a)<0}).forEach(function(a){this.getComponent().off(a)}.bind(this))},renderLeftAddon:function(){return this.renderAddon(this.getComponentOption("leftAddon"))},renderText:function(){var a={"form-control":!0},b="text";this.getComponentOption("pwd",!1)&&(b="password");var d=this.getComponentOption("textType");return d&&(b=d),c.createElement("input",{type:b,className:e.LayoutHelper.classSet(a),disabled:!this.isEnabled(),placeholder:this.getComponentOption("placeholder"),maxLength:this.getComponentOption("maxlength"),onKeyPress:this.onKeyPress,onChange:this.onChange,onFocus:this.onComponentFocused,onBlur:this.onComponentBlurred,onKeyUp:this.onKeyUp,ref:"txt"})},renderRightAddon:function(){return this.renderAddon(this.getComponentOption("rightAddon"))},renderAddon:function(a){if(null==a)return null;var b={"input-group-addon":!0,link:null!=a.click,disabled:!this.isEnabled()},d={fa:!0,"fa-fw":!0},f=a.icon;null!=f&&(d["fa-"+f]=!0);var g=null==f?null:c.createElement("span",{className:e.LayoutHelper.classSet(d),key:"iconPart"}),h=a.text,i=!1===a.iconFirst?[h,g]:[g,h];return c.createElement("span",{className:e.LayoutHelper.classSet(b),onClick:this.onAddonClicked.bind(this,a.click)},i.map(function(a){return a}))},render:function(){if(this.isViewMode())return this.renderInViewMode();var a={"n-disabled":!this.isEnabled()};return a[this.getComponentCSS("n-text")]=!0,c.createElement("div",{className:e.LayoutHelper.classSet(a)},c.createElement("div",{className:"input-group"},this.renderLeftAddon(),this.renderText(),this.renderRightAddon()),this.renderNormalLine(),this.renderFocusLine())},onComponentFocused:function(a){b(d.findDOMNode(this.refs.focusLine)).toggleClass("focus"),b(d.findDOMNode(this.refs.normalLine)).toggleClass("focus");var c=this.getValueFromModel();c==this.getComponent().val()||this.getComponent().val(c),this.notifyEvent(a)},onComponentBlurred:function(a){b(d.findDOMNode(this.refs.focusLine)).toggleClass("focus"),b(d.findDOMNode(this.refs.normalLine)).toggleClass("focus");var c=a.target.value;if(this.getComponentOption("trim",f.TRIM)&&(c=null==c?null:(c+"").trim()),c&&!c.isBlank()){var e=this.getFormattedValue(c);e!=c&&this.getComponent().val(e)}this.textEquals(c,this.getValueFromModel())||this.setValueToModel(c),this.notifyEvent(a)},hasText:function(a){return null!=a&&!(a+"").isEmpty()},textEquals:function(a,b){var c=this.hasText(a),d=this.hasText(b);if(c){return a+""===b+""}return!d},textChanged:function(a){var b=this.getValueFromModel();this.textEquals(a,b)||this.setValueToModel(a)},onChange:function(a){this.onComponentChanged(a),this.notifyEvent(a)},onComponentChanged:function(a){if(0===f.DELAY)this.textChanged(a.target.value);else{this.state.textChangeHandler&&(clearTimeout(this.state.textChangeHandler),delete this.state.textChangeHandler);var b=a.target.value;this.state.textChangeHandler=setTimeout(function(){this.textChanged(b)}.bind(this),f.DELAY)}},onKeyPress:function(a){this.onComponentChanged(a),this.notifyEvent(a)},onKeyUp:function(a){this.notifyEvent(a)},onAddonClicked:function(a){this.isAddonClickable(a)&&a.call(this,this.getModel(),this.getValueFromModel())},getComponent:function(){return b(d.findDOMNode(this.refs.txt))},isAddonClickable:function(a){return this.isEnabled()&&a},getTextFormat:function(){return this.getComponentOption("format")},getFormattedValue:function(a){if(a&&("number"==typeof a&&(a+=""),!a.isBlank())){var b=this.getTextFormat();if(b){var c=a;if("currency"==b){var d=this.getComponentOption("fraction");d=d?1*d:0,c=a.currencyFormat(d)}else c=b.call(this,a);return c}}return a},getTextConvertor:function(){return this.getComponentOption("transformer")||this.getComponentOption("convertor")},getValueFromModel:function(){var a=this.getModel().get(this.getDataId()),b=this.getTextConvertor();return b&&b.view?b.view.call(this,a):a},setValueToModel:function(a){var b=this.getTextConvertor();b&&b.model?this.getModel().set(this.getDataId(),b.model.call(this,a)):this.getModel().set(this.getDataId(),a)},getTextInViewMode:function(){return this.getModel().get(this.getDataId())}}));e.Components.NText=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.Text,function(a,b,d,f){return c.createElement(e.Components.NText,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NTextArea",getDefaultProps:function(){return{defaultOptions:{lines:1}}},afterWillUpdate:function(a){this.getComponent().off("change",this.onComponentChanged)},beforeDidUpdate:function(a,b){this.getComponent().val()!=this.getValueFromModel()&&this.getComponent().val(this.getValueFromModel())},afterDidUpdate:function(){this.getComponent().on("change",this.onComponentChanged)},beforeDidMount:function(){this.getComponent().val(this.getValueFromModel())},afterDidMount:function(){this.getComponent().on("change",this.onComponentChanged)},afterWillUnmount:function(){this.getComponent().off("change",this.onComponentChanged)},renderText:function(){var a={"form-control":!0};return a["l"+this.getComponentOption("lines")]=!0,c.createElement("textarea",{className:e.LayoutHelper.classSet(a),disabled:!this.isEnabled(),placeholder:this.getComponentOption("placeholder"),onKeyPress:this.onComponentChanged,onChange:this.onComponentChanged,onFocus:this.onComponentFocused,onBlur:this.onComponentBlurred,ref:"txt"})},render:function(){if(this.isViewMode())return this.renderInViewMode();var a={"n-disabled":!this.isEnabled()};return a[this.getComponentCSS("n-textarea")]=!0,c.createElement("div",{className:e.LayoutHelper.classSet(a)},this.renderText(),this.renderNormalLine(),this.renderFocusLine())},onComponentFocused:function(){b(d.findDOMNode(this.refs.focusLine)).toggleClass("focus"),b(d.findDOMNode(this.refs.normalLine)).toggleClass("focus")},onComponentBlurred:function(){b(d.findDOMNode(this.refs.focusLine)).toggleClass("focus"),b(d.findDOMNode(this.refs.normalLine)).toggleClass("focus")},onComponentChanged:function(a){this.setValueToModel(a.target.value)},onAddonClicked:function(a){a&&a.call(this,this.getModel(),this.getValueFromModel())},getComponent:function(){return b(d.findDOMNode(this.refs.txt))},getTextInViewMode:function(){var a=this.getValueFromModel();return null!=a&&(a=a.split(/\r|\n/)),a}}));e.Components.NTextArea=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.TextArea,function(a,b,d,f){return c.createElement(e.Components.NTextArea,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NToggle",beforeDidUpdate:function(a,b){this.getComponent().prop("checked",this.getValueFromModel())},beforeDidMount:function(){this.getComponent().prop("checked",this.getValueFromModel())},renderLabel:function(a,b){var d={"toggle-label":!0,disabled:!this.isEnabled()};return d[b]=!0,c.createElement("span",{className:e.LayoutHelper.classSet(d)},a)},renderLeftLabel:function(){var a=this.getComponentOption("labelAttached");if(a&&a.left)return this.renderLabel(a.left,"toggle-label-left")},renderRightLabel:function(){var a=this.getComponentOption("labelAttached");if(a&&a.right)return this.renderLabel(a.right,"toggle-label-right")},renderToggleButton:function(){var a=this.isChecked(),b={disabled:!this.isEnabled(),checked:a,unchecked:!a,"toggle-container":!0};return c.createElement("div",{className:e.LayoutHelper.classSet(b)},c.createElement("span",{className:"n-toggle-line"}),c.createElement("span",{className:"n-toggle-true",tabIndex:this.isEnabled()?"-1":null,onClick:this.onButtonClicked.bind(this,!0)}),c.createElement("span",{className:"n-toggle-false",tabIndex:this.isEnabled()?"-1":null,onClick:this.onButtonClicked.bind(this,!1)}))},render:function(){var a={"n-disabled":!this.isEnabled(),"n-view-mode":this.isViewMode()};return a[this.getComponentCSS("n-toggle")]=!0,c.createElement("div",{className:e.LayoutHelper.classSet(a)},c.createElement("input",{type:"checkbox",style:{display:"none"},onChange:this.onComponentChanged,ref:"txt"}),this.renderLeftLabel(),this.renderToggleButton(),this.renderRightLabel())},onButtonClicked:function(a){this.isEnabled()&&!this.isViewMode()&&this.setValueToModel(a)},onComponentChanged:function(a){this.setValueToModel(a.target.checked)},onModelChanged:function(a){this.getComponent().prop("checked",!0===a.new),this.forceUpdate()},isChecked:function(){return!0===this.getValueFromModel()},getComponent:function(){return b(d.findDOMNode(this.refs.txt))}}));e.Components.NToggle=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.Toggle,function(a,b,d,f){return c.createElement(e.Components.NToggle,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b,c,d,e){var f=c.createClass(e.defineCellComponent({displayName:"NTree",statics:{ROOT_LABEL:"Root",FOLDER_ICON:"folder-o",FOLDER_OPEN_ICON:"folder-open-o",FILE_ICON:"file-o",OP_FOLDER_LEAF_ICON:"angle-right",OP_FOLDER_ICON:"angle-double-right",OP_FOLDER_OPEN_ICON:"angle-double-down",OP_FILE_ICON:"",NODE_SEPARATOR:";",ROOT_ID:"0",FILTER_PLACEHOLDER:"Search...",convertValueTreeToArray:function(a,b){var c=[],d=function(a,b){Object.keys(a).forEach(function(e){"selected"==e&&a[e]?b!=f.ROOT_ID?c.push(b):c.selected=!!a.selected||void 0:d(a[e],e)})};return d(a,b),c}},getDefaultProps:function(){return{defaultOptions:{root:!0,check:!1,inactiveSlibing:!0,opIconEnabled:!1,multiple:!0,valueAsArray:!1,hierarchyCheck:!1,expandLevel:1,border:!1,expandButton:{comp:{icon:"plus-square-o",style:"link"}},collapseButton:{comp:{icon:"minus-square-o",style:"link"}}}}},getInitialState:function(){var a=b.extend(!0,{},this.getComponentOption("expandButton"));a&&(a.comp.click||(a.comp.click=this.expandAll),a=e.createCellLayout("expand",a));var c=b.extend(!0,{},this.getComponentOption("collapseButton"));return c&&(c.comp.click||(c.comp.click=this.collapseAll),c=e.createCellLayout("collapse",c)),{activeNodes:{},root:{text:this.getRootLabel(),id:f.ROOT_ID},expandButton:a,collapseButton:c,initialized:!1}},componentWillMount:function(){this.state.root.children&&this.setState({initialized:!0})},componentWillUpdate:function(){if(!this.state.initialized&&this.state.root.children&&this.isSearchable()){var a=this.filterNodes(this.state.root);this.setState({root:a,initialized:!0})}},renderCheck:function(a,b){if(!this.isNodeCanSelect(a))return null;var d=this.getValueFromModel();d=d||{};var f=e.createModel({selected:this.isNodeChecked(b)});f.useBaseAsCurrent();var g={comp:{type:e.ComponentConstants.Check}},h=this.isNodeCheckCanChange(a);null!=h&&(g.comp.enabled=h);var i=e.createCellLayout("selected",g);return f.addPostChangeListener("selected",this.onNodeCheckChanged.bind(this,a,b)),c.createElement(e.Components.NCheck,{model:f,layout:i,view:this.isViewMode()})},renderNode:function(a,b){if(!1===b.visible)return null;var d=this.getNodeId(a,b),f=null;if(this.getComponentOption("opIconEnabled")){var g={iconClassName:"node-op-icon",fixWidth:!0,icon:this.getNodeOperationIcon(b,d)};f=c.createElement("a",{href:"javascript:void(0);",onClick:this.onNodeClicked.bind(this,b,d)},c.createElement(e.Components.NIcon,g))}var h={icon:this.getNodeIcon(b,d),fixWidth:!0,iconClassName:"node-icon"},i=c.createElement("a",{href:"javascript:void(0);",onClick:this.onNodeClicked.bind(this,b,d)},c.createElement(e.Components.NIcon,h)),j=this,k=this.getComponentOption("nodeOperations");k=k?Array.isArray(k)?k:[k]:[],k=k.map(function(a,d){var f=!0;if("boolean"==typeof a.visible?f=a.visible:"function"==typeof a.visible&&(f=a.visible.call(j,b)),!f)return null;var g={icon:a.icon,fixWidth:!0};return c.createElement("a",{href:"javascript:void(0);",onClick:j.onNodeOperationClicked.bind(j,b,a.click),className:"node-button",key:d,title:a.text},c.createElement(e.Components.NIcon,g))}).filter(function(a){return null!=a});var l=this.isActive(d)?"active":null;return c.createElement("li",{className:l,key:d,"data-node-id":d},c.createElement("div",{className:"node-content"},f,i,this.renderCheck(b,d),c.createElement("a",{className:"node-text-link-"+k.length,href:"javascript:void(0);",onClick:this.onNodeLabelClicked.bind(this,b,d)},c.createElement("span",{className:"node-text"},this.getNodeText(b))),k),this.getComponentOption("lazyLoad")&&!l?null:this.renderNodes(b,d))},renderNodes:function(a,b){var d=a.children;return d&&d.length>0&&d.some(function(a){return!1!==a.visible})?c.createElement("ul",{className:"nav"},d.map(this.renderNode.bind(this,b))):null},renderRoot:function(){return c.createElement("ul",{className:"nav"},this.renderNode(null,this.state.root))},renderTopLevel:function(){return c.createElement(e.Components.NCodeTableWrapper,{codetable:this.getCodeTable(),renderer:this.getRealTopLevelRenderer,model:this.getModel(),layout:this.getLayout(),onMounted:this.initExpand})},getRealTopLevelRenderer:function(){var a=this.state.root;return a.children=this.getTopLevelNodes(),this.isRootPaint()?this.renderRoot():this.renderNodes(a,this.getNodeId(null,a))},renderButtons:function(){var a=this.state.expandButton?c.createElement(e.Components.NFormButton,{model:this.getModel(),layout:this.state.expandButton}):null,b=this.state.collapseButton?c.createElement(e.Components.NFormButton,{model:this.getModel(),layout:this.state.collapseButton}):null;return a||b?c.createElement("span",{className:"buttons"},a,b):null},renderFilterText:function(){var a=e.createModel({text:this.state.filterText,disabled:!!this.isMobilePhone()}),b=e.createCellLayout("text",{comp:{placeholder:f.FILTER_PLACEHOLDER,enabled:{depends:"disabled",when:function(a){return!0!==a.get("disabled")}}},css:{comp:"bottom-margin-5"},evt:{keyUp:this.onSearchEnterKeyUp}});return a.addPostChangeListener("text",this.onFilterTextChange),this.state.filterModel=a,c.createElement(e.Components.NText,{model:a,layout:b})},initExpand:function(){var a=this.getComponentOption("expandLevel");null==a&&(a=0),"all"===a&&(a=9999),this.state.root.children&&this.expandTo(a)},render:function(){var a={};this.getComponentOption("height")&&(a.height=this.getComponentOption("height")),this.getComponentOption("maxHeight")&&(a.maxHeight=this.getComponentOption("maxHeight"));var b=this.getComponentCSS("n-tree"),d=this.isSearchable();return d&&(b+=" searchable"),this.getComponentOption("border")&&(b+=" border"),c.createElement("div",{className:b,style:a,ref:"me"},d?this.renderFilterText():null,this.renderTopLevel(),this.renderButtons())},onSearchEnterKeyUp:function(a){a.preventDefault(),a.stopPropagation(),13===a.keyCode&&this.onFilterTextChange(a)},onFilterTextChange:function(a){var b=a.new||this.state.filterModel.get("text"),c=this.filterNodes(this.state.root,b);this.setState({filterText:b,root:c})},filterNodes:function(a,b){return a.children&&a.children.length>0&&(a.children=a.children.map(function(a){return this.filterNodes(a,b)}.bind(this))),!b||a.text.toUpperCase().indexOf(b.toUpperCase())>=0||a.children&&a.children.some(function(a){return!1!==a.visible})?a.visible=!0:a.visible=!1,a},onNodeClicked:function(a,b){this.isLeaf(a)||(this.state.activeNodes[b]?this.collapseNode(a,b):this.expandNode(a,b))},onNodeLabelClicked:function(a,c,e){var f=this.getComponentOption("nodeClick");if(f){var g=b(e.target),h=function(a){this.isMultipleHighlight()&&a||b(d.findDOMNode(this.refs.me)).find("div.node-content").removeClass("node-highlight"),g.closest("div.node-content").addClass("node-highlight")}.bind(this),i=f.call(this,a,h,e);!0===i?h.call(this):"keep"===i?h.call(this,!0):i&&i.done&&i.done(function(a){h.call(this,a)}.bind(this))}else this.onNodeClicked(a,c)},onNodeOperationClicked:function(a,b){b&&b.call(this,a)},onNodeCheckChanged:function(a,b,c,d){var e=this.isHierarchyCheck(),f=this.getValueFromModel();this.isValueAsArray()?(f=f||[],e?(this.checkNodeHierarchy(a,b,c.new,f),this.hierarchyCheckToAncestors(b,f)):this.checkNode(b,c.new,f),this.getValueFromModel()!=f?this.setValueToModel(f):this.getModel().firePostChangeEvent(this.getDataId(),f,f)):(f||(f={}),e?(this.checkNodeHierarchy(a,b,c.new,f),this.hierarchyCheckToAncestors(b,f)):this.checkNode(b,c.new,f),this.getValueFromModel()!=f?this.setValueToModel(f):this.getModel().firePostChangeEvent(this.getDataId(),f,f))},isValueAsArray:function(){return this.getComponentOption("valueAsArray")},checkNode:function(a,b,c){if(this.isValueAsArray())if(this.isMultipleSelection()||(c.length=0),a==this.state.root.id)c.selected=b;else{var d=a.split(f.NODE_SEPARATOR),g=d[d.length-1],h=c.findIndex(function(a){return a==g});b&&-1==h?c.push(g):b||-1==h||c.splice(h,1)}else if(this.isMultipleSelection()||Object.keys(c).forEach(function(a){delete c[a]}),a==this.state.root.id)e.setValueIntoJSON(c,"selected",b);else{var i=a.split(f.NODE_SEPARATOR);e.setValueIntoJSON(c,i.slice(1).join(e.PROPERTY_SEPARATOR)+e.PROPERTY_SEPARATOR+"selected",b)}return c},checkNodeHierarchy:function(a,b,c,d){if(d=this.checkNode(b,c,d),a.children){var e=this;a.children.forEach(function(a){var f=e.getNodeId(b,a);e.checkNodeHierarchy(a,f,c,d)})}return d},isNodeChecked:function(a,b){if(b=b||this.getValueFromModel(),b=b||{},Array.isArray(b)){if(a==this.state.root.id)return b.selected;var c=a.split(f.NODE_SEPARATOR),d=c[c.length-1];return-1!=b.findIndex(function(a){return a==d})}return a==this.state.root.id?e.getValueFromJSON(b,"selected"):e.getValueFromJSON(b,a.split(f.NODE_SEPARATOR).slice(1).join(e.PROPERTY_SEPARATOR)+e.PROPERTY_SEPARATOR+"selected")},hierarchyCheckToAncestors:function(a,b){var c=this,d=function(a,e){if(a.children){var f=!1;return a.children.forEach(function(a){d(a,c.getNodeId(e,a))||(f=!0)}),c.checkNode(e,!f,b),!f}
return c.isNodeChecked(e,b)};d(this.state.root,this.getNodeId(null,this.state.root))},expandTo:function(a){var c=b.extend({},this.state.activeNodes),d=this,e=function(b,f,g){if(g<a){var h=d.getNodeId(b,f);c[h]=f,f.children&&f.children.forEach(function(a){e(h,a,g+1)})}};e(null,this.state.root,0);var f=null;this.setState(function(a,b){return f=a.activeNodes,{activeNodes:c}},function(){d.notifyEvent({type:"expand",before:f,after:c})})},expandAll:function(){var a=b.extend({},this.state.activeNodes),c=this.state.root,d=function(b,c){if(!this.isLeaf(b)){var e=this.getNodeId(c,b);a[e]=b;var f=this;b.children.forEach(function(a){d.call(f,a,e)})}};d.call(this,c,null);var e=this,f=null;this.setState(function(b,c){return f=b.activeNodes,{activeNodes:a}},function(){e.notifyEvent({type:"expand",before:f,after:a})})},collapseAll:function(){var a=this,b={};Object.keys(b).forEach(function(a){a.match(regexp)&&delete b[a]});var c=null;this.setState(function(a,d){return c=a.activeNodes,{activeNodes:b}},function(){a.notifyEvent({type:"collapse",before:c,after:b})})},isRootPaint:function(){return this.getComponentOption("root")},getRootLabel:function(){var a=this.getComponentOption("root");return"string"==typeof a?a:f.ROOT_LABEL},isSearchable:function(){return this.getComponentOption("searchable")&&!this.isViewMode()},isActive:function(a){return this.state.activeNodes[a]},isLeaf:function(a){return!a.children||0==a.children.length},isInactiveSlibingWhenActive:function(){return this.getComponentOption("inactiveSlibing")},collapseNode:function(a,c){var d=new RegExp(c),e=b.extend({},this.state.activeNodes);Object.keys(e).forEach(function(a){a.match(d)&&delete e[a]});var f=this,g=null;this.setState(function(a,b){return g=a.activeNodes,{activeNodes:e}},function(){f.notifyEvent({type:"collapse",before:g,after:e})})},expandNode:function(a,c){var d=b.extend({},this.state.activeNodes);if(this.isInactiveSlibingWhenActive()&&!this.isLeaf(a)){var e=c.lastIndexOf(f.NODE_SEPARATOR);if(e>0){var g=new RegExp(c.substring(0,e+1));Object.keys(d).forEach(function(a){a.match(g)&&delete d[a]})}else this.isRootPaint()||(d={})}d[c]=a;var h=this,i=null;this.setState(function(a,b){return i=a.activeNodes,{activeNodes:d}},function(){h.notifyEvent({type:"expand",before:i,after:d})})},getTopLevelNodes:function(){return this.getCodeTable().list()},getCodeTable:function(){return this.getComponentOption("data")},getNodeIcon:function(a,b){var c=this.isLeaf(a),d=!c||a.folder,e=this.isActive(b);return d?c?this.getCustomNodeIcon({node:a,active:e,folder:!0,leaf:!0},f.FOLDER_ICON):e?this.getCustomNodeIcon({node:a,active:!0,folder:!0,leaf:!1},f.FOLDER_OPEN_ICON):this.getCustomNodeIcon({node:a,active:!1,folder:!0,leaf:!1},f.FOLDER_ICON):this.getCustomNodeIcon({node:a,active:e,folder:!1,leaf:!0},f.FILE_ICON)},getNodeText:function(a){return a.text},getCustomNodeIcon:function(a,b){var c=this.getComponentOption("nodeIcon");return"function"==typeof c?c.call(this,a):c||b},getNodeOperationIcon:function(a,b){var c=this.isLeaf(a),d=!c||a.folder,e=this.isActive(b);return d?c?this.getCustomNodeOperationIcon({node:a,active:e,folder:!0,leaf:!0},f.OP_FOLDER_LEAF_ICON):e?this.getCustomNodeOperationIcon({node:a,active:!0,folder:!0,leaf:!1},f.OP_FOLDER_OPEN_ICON):this.getCustomNodeOperationIcon({node:a,active:!1,folder:!0,leaf:!1},f.OP_FOLDER_ICON):this.getCustomNodeOperationIcon({node:a,active:e,folder:!1,leaf:!0},f.OP_FILE_ICON)},getCustomNodeOperationIcon:function(a,b){var c=this.getComponentOption("opNodeIcon");return"function"==typeof c?c.call(this,a):c||b},isNodeCanSelect:function(a){var b=this.getComponentOption("check");return"function"==typeof b?b.call(this,a):b||!1},isNodeCheckCanChange:function(a){var b=this.getComponentOption("valueCanCheck");return"function"==typeof b?b.call(this,a):null==b||b},isMultipleSelection:function(){return this.getComponentOption("multiple")},isMultipleHighlight:function(){return this.getComponentOption("multipleHightlight",!1)},isHierarchyCheck:function(){return this.getComponentOption("hierarchyCheck")&&this.isMultipleSelection()},getNodeId:function(a,b){return a?a+f.NODE_SEPARATOR+b.id:""+b.id}}));e.Components.NTree=f,e.LayoutHelper.registerComponentRenderer(e.ComponentConstants.Tree,function(a,b,d,f){return c.createElement(e.Components.NTree,e.LayoutHelper.transformParameters(a,b,d,f))})}(window,jQuery,React,ReactDOM,$pt),function(a,b){"undefined"!=typeof DONT_EXPOSE_PARROT_TO_GLOBAL&&!0===DONT_EXPOSE_PARROT_TO_GLOBAL||b.exposeComponents(a)}(window,$pt);
//# sourceMappingURL=nest-parrot.min.js.map