(function(a){function b(){var a=AC.Core!=void 0&&typeof AC.Core.lang=="function"&&typeof AC.Core.lang().trElement=="function";b=a?e:f;return a}var c=a.fn.append,d=a.fn.prepend;a.fn.__useTr=!0;var e=function(){return!0},f=function(){return!1};a.fn.append=function(){var d=c.apply(this,arguments);a.fn.__useTr&&b()&&this.closest(".wiziFormApplication").length==0&&AC.Core.lang().trElement(d);return d};a.fn.prepend=function(){var c=d.apply(this,arguments);a.fn.__useTr&&b()&&this.closest(".wiziFormApplication").length==
0&&AC.Core.lang().trElement(c);return c};a.fn.langtext=function(b){if(a.isFunction(b))return this.each(function(c){var d=a(this);d.text(b.call(this,c,d.text()))});if(typeof b!=="object"&&b!==void 0){var c=this.children(),d=c.length,i=this.empty().domManip([(this[0]&&this[0].ownerDocument||document).createTextNode(b)],!0,function(a){this.nodeType===1&&this.appendChild(a)});d>0&&c.each(function(){i.append(this)});return i}return a.getText(this)};return a})(jQuery);
(function(a){function b(b){if(typeof b.data==="string"){var d=b.handler,e=b.data.toLowerCase().split(" ");b.handler=function(b){if(!(this!==b.target&&(/textarea|select/i.test(b.target.nodeName)||b.target.type==="text"))){var c=b.type!=="keypress"&&a.hotkeys.specialKeys[b.which],h=String.fromCharCode(b.which).toLowerCase(),j="",i={};b.altKey&&c!=="alt"&&(j+="alt+");b.ctrlKey&&c!=="ctrl"&&(j+="ctrl+");b.metaKey&&!b.ctrlKey&&c!=="meta"&&(j+="meta+");b.shiftKey&&c!=="shift"&&(j+="shift+");c?i[j+c]=!0:
(i[j+h]=!0,i[j+a.hotkeys.shiftNums[h]]=!0,j==="shift+"&&(i[a.hotkeys.shiftNums[h]]=!0));c=0;for(h=e.length;c<h;c++)if(i[e[c]])return d.apply(this,arguments)}}}}a.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",
109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}};a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:b}})})(jQuery);
(function(a,b){var c=function(){function a(b,c){var d=b.parent,i=null;try{i=d.location.href}catch(m){i=d=null}return d!=void 0&&i!=void 0&&d!=b?a.call(this,d):b.location!=void 0&&b.location.href!=void 0?b.location.href.search("[?&]?"+c+"[#=&]?\\b")!=-1:!1}var c=null,g=null,h=null,j=null,i=null,m=null,o=null,k=null,l=null,n=null,r=null,q=null,p=null,t=null,u=null,z=null,v=null,s=null,w=null,y=null,C=null,G=null,H=null,B=null,D=null,I=null,A={},F=!1,E=null;this.develop=null;this.config=function(){if(c==
null)c=AC.Config;return c};this.dataObject=function(){g=new WiziCore_DataObject;this.dataObject=function(){return g};return g};this.getSession=function(){h==null&&(h=new WiziCore_Api_SessionRequester);return h};this.develop=function(){return A};this.api=function(){j==null&&(j=new WiziCore_Api_Server_Api(this.config()));return j};this.forms=function(){i==null&&(i=new WiziCore_Api_FormRequester);return i};this.wfRequester=function(){H==null&&(H=new WiziCore_Api_WorkflowRequester);return H};this.folders=
function(){m==null&&(m=new WiziCore_Api_FoldersRequester);return m};this.userSettings=function(){o==null&&(o=new WiziCore_Api_UserSettingsRequester);return o};this.accounts=function(){k==null&&(k=new WiziCore_Api_AccountRequester);return k};this.users=function(){l==null&&(l=new WiziCore_Api_UserRequester);return l};this.groups=function(){n==null&&(n=new WiziCore_Api_GroupRequester);return n};this.resources=function(){r==null&&(r=new WiziCore_Api_ResourceRequester);return r};this.reportStatuses=function(){D==
null&&(D=new WiziCore_Api_ReportJobStatusesRequester);return D};this.serverEvents=function(){I==null&&(I=new WiziCore_Api_ServerEvents);return I};this.formThemeManager=function(){q==null&&(q=new WiziCore_Api_ThemeRequester(this.config().themes().form),q.enviroment(WiziCore_Api_ThemeRequester.FORM));return q};this.dataIntegration=function(){p==null&&(p=new WiziCore_Api_DataIntegrationRequester);return p};this.dataAgents=function(){t==null&&(t=new WiziCore_Api_DataAgentRequester);return t};this.connections=
function(){u==null&&(u=new WiziCore_Api_ConnectionRequester);return u};this.queries=function(){z==null&&(z=new WiziCore_Api_QueryRequester);return z};this.formInstances=function(){v==null&&(v=new WiziCore_Api_FormInstanceRequester);return v};this.cordovaBuild=function(){E==null&&(E=new WiziCore_Api_CordovaBuildRequester);return E};this.instanceStatusRequester=function(){C==null&&(C=new WiziCore_Api_InstanceStatusRequester);return C};this.webClient=function(){s==null&&(s=new WiziCore_Api_Server_WebAdapter(this.config()));
return s};this.formRunTime=function(a,b){b!==void 0&&(w[a]=b);return a==void 0?w:w[a]};this.dropFormRunTime=function(a){delete w[a]};this.inputParameters=function(a){a!==void 0&&(y=a);return y};this.widgetScripts=function(){if(G==null)G=AC.Core.widgetScripts;return G};this.publicScripts=function(){B==null&&(B=new WiziCore_Api_PublicScripts);return B};this.dropRequesters=function(){d=null};this.offlineMode=function(a){a!==void 0&&(F=!!a);return F};var J=null;this.setDebuggerKey=function(a){J=a};this.getDebuggerKey=
function(){return J};this.getModeFromUrl=a;y={};w={};A={dev:!1,loadScripts:!0,loadFB:!1,avrtMode:a.call(this,b,"advertising"),propNames:a.call(this,b,"propnames")};this.dataObject()};b.WiziCore_AppContext={};var d=null;b.WiziCore_AppContext.getInstance=function(){d||(d=new c);return d}})(jQuery,window);
var WiziCore_ManagerContext=jQuery.Class.create({_wfApp:null,init:function(){var a={UI:{},editor:null};if(AC.Console&&AC.Console.Manager)a.UI.Manager=new AC.Console.Manager;a.Session=WiziCore_AppContext.getInstance().getSession();if(window.WiziCore_Api_ThemeRequester!=void 0)a.appThemeManager=new WiziCore_Api_ThemeRequester(WiziCore_AppContext.getInstance().config().themes().app);SwirlLangObjectEn!=void 0&&AC.Core.lang(AC.Lng.ENGLISH).lang(SwirlLangObjectEn);this._wfApp=a},getWFApp:function(){return this._wfApp}});
WiziCore_ManagerContext.getInstance=function(){if(WiziCore_ManagerContext.instance==void 0)WiziCore_ManagerContext.instance=new WiziCore_ManagerContext;return WiziCore_ManagerContext.instance.getWFApp()};function WiziCore_Api_Error(a,b){this.message=a;this.code=b}WiziCore_Api_Error.ERR_NEED_CONTEXT=-1E6;WiziCore_Api_Error.ERR_NEED_OBJECT=-1000001;WiziCore_Api_Error.ERR_NOT_UBDOBLE_FN=-1000002;WiziCore_Api_Error.ERR_NOW_EXECUTED=-1000003;WiziCore_Api_Error.ERR_NOT_EXECUTED=-1000004;
WiziCore_Api_Error.ERR_CREATE_ADAPTER=-1000005;WiziCore_Api_Error.ERR_PREPARE_ADAPTER=-1000006;WiziCore_Api_Error.ERR_NEED_REGUEST_ADAPTER=-1000007;WiziCore_Api_Error.ERR_NEED_PARENT_OBJECT=-1000008;WiziCore_Api_Error.ERR_WRONG_OBJECT_TYPE=-1000009;WiziCore_Api_Error.ERR_DIFFERENT_PARENT_LEVEL=101;WiziCore_Api_Error.ERR_NOT_HAVE_ACTIVE_CONTAINER=102;WiziCore_Api_Error.ERR_TOO_MANY_SELCONTAINERS=103;WiziCore_Api_Error.prototype=Error();WiziCore_Api_Error.prototype.constructor=WiziCore_Api_Error;
WiziCore_Api_Error.superclass=Error.prototype;
var WiziCore_Api_Base=jQuery.Class.create({init:function(){},context:function(){return WiziCore_AppContext.getInstance()},managerContext:function(){return WiziCore_ManagerContext.getInstance()},apiRequest:function(a,b,c,d){if(b!=void 0&&jQuery.isArray(b)){var e=this.context().getSession().getToken();b.splice(0,0,e)}this.apiRequestPlain(a,b,c,d)},apiRequestPlain:function(a,b,c,d){var e=this.context().api(),a=e.createRequest(a,b),f=this;e.sendRequest(a,function(a){c({data:{self:f}},a)},d)},apiRequestNorm:function(a,
b,c){this.apiRequest(a,b,function(a,b){var f=b.error,g=b.object,h=f?null:g.result;typeof c=="function"&&c(f?g:null,h)})}});
AC.Core=function(){var a=null,b=null,c=null,d={},e=[],f={Widgets:function(){a==null&&(a=AC.WidgetPluginManager());return a},cookie:function(){c==null&&(c=new WiziCookie);return c},lang:function(a){b==null&&(b=AC.Lng(a));return b}};f.addExtendsToApp=function(a,b){if(a!=void 0&&b!=void 0){d[a]=b;for(var c=0,i=e.length;c<i;c++){var m=e[c];typeof m=="object"&&f.registerExtendsObject(m.registerTo,m.context,m.app)}}};f.registerExtendsObject=function(a,b,c){if(a!=void 0)for(var i in d)a[i]==void 0&&d[i]!=
void 0&&(a[i]=d[i],b!=void 0&&typeof a[i]=="object"&&(typeof a[i].context=="function"&&a[i].context(b),typeof a[i].app=="function"&&a[i].app(c)))};(function(){for(var a=[],b=[],c=0;c<100;c++)b="9dGVHq2dH4Sfwqzo5tBz9Rjd5LzxtJGAcFRonwnLaSIWfq2IMpMof4JMP3zAy1GsteBPwY8ub3V4pC7HhcwJItNaQeQAGzz0MKfw".charCodeAt(c)^"N3ubbm8sidE4WHbmt1w9B3WsrwiXSGRHGChqbbXR3XaRyG68xDUnYXah27GG1QDHsb7MhfRFnrBwgSKKrIr0WqGeINCVfISEb9cy".charCodeAt(c),b=b%58+65,a.push(String.fromCharCode(b));b=[];b.push("zf","l","ags");f[b.join("")]=
a.join("")})();return f}();
(function(a,b){var c=function(d){function e(){var a=WiziCore_AppContext.getInstance().getDebuggerKey(),b={};a&&(b["X-AC-Debug"]=a);return b}var f="",g="json",h="Flash",j=null,i=!1,m=!1,o=null,k=null,l=null;this.RequiresLoaded=function(){try{j=new b["WiziCore_Api_Server_"+h+"Adapter"](k)}catch(d){a(this).trigger(c.onErrorCreate),m="Adapter create error"}var i=this;a(j).unbind(c.onAdapterStateChange);a(j).bind(c.onAdapterStateChange,function(b,d){d=="ready"?i.AdapterReady():(a(i).trigger(c.onErrorPrepare),
m="Adapter error prepare")})};this.onResponse=function(a,b){var c=a.state,d=a.data,i=a.status!==void 0&&a.statusText!==void 0?a.statusText+"("+a.status+")":"error",e=a.uid;if(b==null)acDebugger.systemLog("WiziCore_Api_Server_Api :: onResponce | callback for onResponce is NULL");else if(c=="good"){c=null;try{c=JSON.parse(d)}catch(m){acDebugger.systemLog1("api:adapterReady",m)}c!=null?c.error!=void 0?b({error:!0,object:c.error,status:i}):b({error:!1,object:c,status:i}):b({error:!0,object:"Error json parse"});
swirlDebugger.traceRequest(null,{uid:e,data:c,status:i},"answer")}else b({error:!0,object:d,status:i}),swirlDebugger.traceRequest(null,{uid:e,data:d,status:i},"answer")};this.createRequest=function(a,b){c.sequense++;var d=c.sequense;l[d]={method:a,data:b,sequense:d};return d};this.AdapterReady=function(){i=!0;var a=o,b;for(b in a){var c=a[b];this.sendRequest(c.uid,c.callback,c.options)}};this.sendRequest=function(b,d,i){if(b==void 0||l[b]==void 0)throw new WiziCore_Api_Error("Need created request",
WiziCore_Api_Error.ERR_NEED_REGUEST_ADAPTER);d=d==void 0?null:d;if(!j.isAdapterReady()&&m==!1)o[b]={uid:b,callback:d,options:i};else if(m!=!1)a(this).trigger(c.onError,[m]);else{var f=this,h=l[b],k=h.method,g=h.data;if(this.type()=="json"){for(var v=[],s=0;s<g.length;s++)v[s]=g[s];k=JSON.stringify({jsonrpc:"2.0",method:k,params:v,id:b});g=this.loadPath();swirlDebugger.traceRequest(g,h,"send");h=e();if(WiziCore_AppContext.getInstance().getDebuggerKey())i||(i={}),i.timeout=12E5;j.sendRequest(g,k,b,
function(a){delete l[b];delete o[b];f.onResponse(a,d)},i,h)}}};this.sendPostRequest=function(b,d){if(b==void 0||l[b]==void 0)throw new WiziCore_Api_Error("Need created request",WiziCore_Api_Error.ERR_NEED_REGUEST_ADAPTER);d=d==void 0?null:d;if(!i&&m==!1)o[b]={uid:b,callback:d};else if(m!=!1)a(this).trigger(c.onError,[m]);else{var e=this,f=l[b],h=f.method,f=f.data;if(this.type()=="json"){for(var h={method:h},k=0;k<f.length;k++)h[k]=f[k];f=this.loadPath();j.sendPostRequest(f,h,b,function(a){delete l[b];
e.onResponse(a)})}}};this.loadPath=function(){var a=f;a[a.length-1]!="/"&&(a+="/");this.loadPath=function(){return a};return a};this.baseServer=function(a){a!=void 0&&(f=a);return f};this.type=function(a){a!=void 0&&(g=a);return g};this.method=function(a){a!=void 0&&(_method=a);return _method};this.adapter=function(){return j};d!=void 0?(d.apiAdapter!=void 0&&(h=d.apiAdapter()),d.formatApi!=void 0&&this.type(d.formatApi()),d.serverApi!=void 0&&this.baseServer(d.serverApi()),k=d):k={};o={};l={};j==
null&&this.RequiresLoaded()};c.sequense=0;c.onErrorCreate="E#WiziCore_Api_Server_Api#onErrorCreate";c.onErrorPrepare="E#WiziCore_Api_Server_Api#onErrorPrepare";c.onError="E#WiziCore_Api_Server_Api#onError";c.onAdapterStateChange="Events#WiziCore_Api_Server_Api#AdapterStateChange";c.onAdapterResponseReady="Events#WiziCore_Api_Server_Api#AdapterResponseReady";c.POST="POST";c.GET="GET";b.WiziCore_Api_Server_Api=c})(jQuery,window);
var WiziCore_Api_Server_FlashAdapter=jQuery.Class.create({_adapterId:"WiziFlashAdapterId",_adapterIdTrigger:"WiziFlashAdapterIdTrigger",_adapter:null,_adapterUrl:"http://wizi.azazello.ipshps.local/wiziCore/api/server/adapter/WiziSendRequest.swf",_timer:null,_isAdapterWasReady:null,_flashVersion:"9.0.0",_requestCallbacks:null,init:function(a){if(a!=void 0){if(a.needFlashVersion!=void 0)this._flashVersion=a.needFlashVersion();if(a.flashAdapterUrl!=void 0)this._adapterUrl=a.flashAdapterUrl()}this._requestCallbacks=
{};if($("#"+this._adapterId).length==0)a=$('<div style="width : 1px; height: 1px; font-size: 0px; position: absolute; left: -1px; top : -1px;">\r\n    <div id="WiziFlashAdapterIdTrigger" />\r\n</div>'),$(document.body).append(a),this._adapter=$("<div>"),a.append(this._adapter),this._adapter.attr("id",this._adapterId);this.createSwfObject(this._adapterId)},createSwfObject:function(a){$(a).empty();swfobject.embedSWF(this._adapterUrl,this._adapterId,"1","1",this._flashVersion,"","",{allowScriptAccess:"always",
flashvars:"id="+this._adapterId});var b=this;this._timer=new WiziCore_Api_Timer(200,300);$(this._timer).bind(WiziCore_Api_Timer.TimerTick,function(){b.isAdapterReady()});$(this._timer).one(WiziCore_Api_Timer.TimerComplete,function(){$(b).trigger(WiziCore_Api_Server_Api.onAdapterStateChange,"error")});this._timer.start()},isAdapterReady:function(){this._adapter=document.getElementById(this._adapterId);if(this._adapter==null)return!1;var a=!1;try{if(typeof this._adapter.isReady!="function"){if(this._isAdapterWasReady==
!0)this.createSwfObject(this._adapterId),this._isAdapterWasReady=!1;return!1}a=this._adapter.isReady()}catch(b){acDebugger.systemLog1("flash:isAdapterReady",b)}if(a&&this._timer!=null){this._timer.stop();this._timer=null;var c=this;$("#"+this._adapterIdTrigger).bind("ResponseFromFlashAdapter",function(a,b){b.uid!=void 0&&(c._requestCallbacks[b.uid](b),delete c._requestCallbacks[b.uid]);$(c).trigger(WiziCore_Api_Server_Api.onAdapterResponseReady,b)});$(this).trigger(WiziCore_Api_Server_Api.onAdapterStateChange,
"ready");this._isAdapterWasReady=!0}return a},sendRequest:function(a,b,c,d){this._requestCallbacks[c]=d;this._adapter.sendRequest(a,b,c)},sendPostRequest:function(a,b,c,d){this.isAdapterReady()&&(this._requestCallbacks[c]=d,this._adapter.sendPostRequest(a,b,c))}});function ResponseFromFlashAdapter(a,b,c){$("#WiziFlashAdapterIdTrigger").trigger("ResponseFromFlashAdapter",[{state:a,data:b,uid:c}])}
(function(a,b,c,d){var e,f,g=b.WiziCore_Api_Server_WebAdapter=jQuery.Class.create({_testedDomain:null,_clientApi:"",_timeout:12E4,_defaultTimeout:12E4,_workingCount:0,init:function(b){e=WiziCore_AppContext.getInstance();f=e.develop().dev;this._testedDomain={};if(b!=d&&b.clientApi!=d)this._clientApi=b.clientApi();a(this).trigger(WiziCore_Api_Server_Api.onAdapterStateChange,"ready");this._defaultTimeout=this._timeout;WiziCore_Helper.isPrinting()&&this.startCheckWorking()},timeout:function(a){if(a!==
d)this._timeout=a=="default"?this._defaultTimeout:a;return this._timeout},isAdapterReady:function(){a(this).trigger(WiziCore_Api_Server_Api.onAdapterStateChange,"ready");return!0},sendRequest:function(a,b,c,d,e,f){this.incWorking();var l=this;this.httpRequest(a,"POST",function(a,b,e){l.decWorking();d({state:b==!1?"good":"error",data:a,uid:c,status:e.status,statusText:e.statusText})},b,"html",f,e);b=null},sendPostRequest:function(b,c,d,e){if(this.isAdapterReady()){var f=this;f.incWorking();a.post(b,
c,function(a,b){f.decWorking();e({state:b,data:a,uid:d})});c=null}},getDomain:function(a){if(typeof a!="string")return a;var b=a.indexOf("//");b==-1&&(b=0);var c=a.indexOf("/",b+2);if(c==-1)c=a.length;return a.substring(b+2,c)},_validateNetworkState:function(a){return!WiziCore_Helper.isPhoneGapOnline()?(this.httpResponse(a,"offline",!0),!1):!0},sendSimpleRequest:function(b,c,i,e,f,k,l,n){var g=this,l=l||{};if(l.ignoreNetworkState||this._validateNetworkState(i)!==!1){g.incWorking();b={type:c,url:b,
dataType:f,data:e,cache:!1,timeout:l.timeout?l.timeout:this._timeout,success:function(a,b,c){g.httpResponse(i,a,!1,c)},error:function(a,b){g.httpResponse(i,b,!0,a)},beforeSend:function(a){if(k!=d)for(var b in k)a.setRequestHeader(b,k[b])}};b=jQuery.extend(l,b);l=a.ajax(b);if(n)n.request=l;e=null}},httpRequest:function(a,b,c,d,e,f,l,n){return this._httpRequestSendRequest(this._httpRequestInit(a,b,e,l),c,d,f,l,n)},_httpRequestInit:function(c,f,i,m){var m=m||{},o=m.accrossdomain,k=m.useProxy,m=this.getDomain(c),
l=this.getDomain(b.location.href),o=k||b.location.href.indexOf("file://")==-1&&(o===!1||m!=l&&!a.support.cors);if(f==d)f=WiziCore_Api_Server_Api.GET;if(i){i=i.toLowerCase();if(i=="xml")var n="XML2JSON";if(i=="string"||i=="xml")i="html";i=="xmldom"&&(i="xml")}if(o&&l!=m)var g={"X-Ac-Session":e.getSession().getToken()},c=this._clientApi+"acgo?path="+WiziCore_Helper.encode64(c);return{headers:g,acConvert:n,canProxy:o,domain:m,myDomain:l,url:c,type:f,dataType:i}},_httpRequestSendRequest:function(b,c,
i,e,f,k){if(typeof c!="function")return!1;var l=this,n=b.url,g=b.type,q=b.dataType,p=b.acConvert,b=b.headers||{},e=e||{},e=a.extend({},e,b);this.incWorking();try{this.sendSimpleRequest(n,g,function(a,b,d){!b&&d.status!=0?l.httpResponse(c,a,!1,d,p):l.httpResponse(c,a,!0,d)},i,q,e,f,k)}catch(t){l.httpResponse(c,d,!0)}return!0},httpResponse:function(a,b,c,d,e){function k(){e&&(b=l[e].call(l,b));a.call(l,b,c,d)}this.decWorking();var l=this;if(f)k();else try{k()}catch(n){WiziCore_OnErrorEvent.showError(n)}},
soapRequest:function(a,c,i,e,f){if(b.SOAPClient!=d){var k=new SOAPClientParameters,l=this,n;for(n in i)k.add(n,i[n]);l.incWorking();SOAPClient.invoke(a,c,k,function(){l.decWorking();e&&e.apply(this,arguments)},this,f)}},XML2JSON:function(b){var c={};try{c=a.xml2json(b)}catch(d){}return c},JSON2XML:function(a){return this.TEXT2XML(this.JSON2TEXT(a))},TEXT2XML:function(b){var c={};try{c=a.text2xml(b)}catch(d){}return c},TEXT2JSON:function(a){var b={};try{b=JSON.parse(a)}catch(c){}return b},JSON2TEXT:function(a){var b=
{};try{b=JSON.stringify(a)}catch(c){}return b},startCheckWorking:function(){this._working=!0},incWorking:function(){this._working&&this._workingCount++},decWorking:function(){this._working&&(this._workingCount--,this.checkWorking())},checkWorking:function(b){if(this._working&&(clearTimeout(this._workingTimer),this._workingCount==0)){var c=this;b?a(this).trigger(g.onAllDataReceived):this._workingTimer=setTimeout(function(){c.checkWorking(!0)},500)}}});g.onAllDataReceived="Event#WiziCore_Api_Server_WebAdapter#onAllDataReceived"})(jQuery,
window,AC);
var WiziCore_Api_ClientBase=WiziCore_Api_Base.extend({_parent:null,_project:null,_id:null,_name:null,_children:null,_widget:null,_ap:null,_ep:null,_form:null,_parentLevel:null,_valName:"__value",_dataPropName:"text",_eventsHandles:null,init:function(a,b,c,d,e,f){this._super(a);if(b==void 0&&b!=null)throw new WiziCore_Api_Error("Need parent",WiziCore_Api_Error.ERR_NEED_PARENT_OBJECT);if(c==void 0)throw new WiziCore_Api_Error("Need json for project",WiziCore_Api_Error.ERR_NEED_OBJECT);this._parent=b;
this.form(d);this.page(e);this.buildProjectFromJSON(c,f);this._project.repeat==void 0&&(this._project.repeat=!1);this._eventsHandles={}},checkWidgetName:function(a,b){var c=a.name;if(b!=null&&typeof b.findName=="function"){var d=b.findName(c),e=c.search(/\d+$/),f=c;e!=-1&&(f=f.substring(0,e));if(d!=null&&d.id()!=a.id)for(d=1;d<999999;d++)if(e=f+d,b.findName(e)==null){c=e;break}}return c},buildProjectFromJSON:function(a,b){try{this._children=null;if(a==void 0)throw new WiziCore_Api_Error("Need json for project",
WiziCore_Api_Error.ERR_NEED_OBJECT);this._project=a;if(this._project.id==void 0)this._project.id=WiziCore_Helper.generateUniqueId(36,"w");if(this._project.name==void 0)this._project.name="widget";if(this._project._dataPropName!=void 0)this._dataPropName=this._project._dataPropName;this._project.name=this.checkWidgetName(this._project,this.form());if(this._project.widgetClass==void 0)this._project.widgetClass="WiziCore_UI_BaseWidget";this._project.actions!=void 0?this._project.actions instanceof Array?
this._project.actions={}:this._actions=this._project.actions:this._project.actions={};if(this._project.items!=void 0){var c=this._project.items,d=!1,e;for(e in c){var f,g=c[e].widgetClass;try{if(window[g]!=void 0)f=window[g];else{d==!1&&(d=!0,AC.Core.lang().trText("widget_base_invalid_widget"));acDebugger.systemLog("no current widget in system",c[e].widgetClass);break}}catch(h){acDebugger.systemLog1("buildProjectFromJSON::check widget class",g,h)}var j=this.createItem(c[e],b);f!=void 0&&this.addItem(j)}}if(this._project.realId==
void 0||b!==!0)this._project.realId=this._project.id}catch(i){acDebugger.systemLog1("base:buildProjectFromJSON",i)}},createItem:function(a,b){return new WiziCore_Api_ClientBase(this.context(),this,a,this.form(),this.page(),b)},clone:function(a,b){var c=jQuery.extend(!1,this.project(),{});c.id=AC.Widgets.Base.generateUniqueId();if(a!=!0)c.name=this.checkWidgetName(c,this.form());c=new WiziCore_Api_ClientBase(this.context(),this.parent(),c,void 0,void 0,b);if(a){var d=WiziCore_Helper.cloneAction(this.form(),
this,c);d!=null&&this.form().executeActions([d],c)}var d=c.children(),e=[],f=[],g;for(g in d){var h=d[g];e.push(h);h=h.clone(a,b);f.push(h)}for(g in e)c.deleteItem(e[g]);for(g in f)c.addItem(f[g]);d!=void 0&&c.project(c.project());return c},addItem:function(a){a.form(this.parent().form());a.page(this.parent().page());this.children().push(a);var b=this.children().length-1;$(a).bind(WiziCore_Api_ClientBase.ADD_ITEM_EVENT,function(){});$(a).bind(WiziCore_Api_ClientBase.DELETE_ITEM_EVENT,function(){});
$(this).trigger(WiziCore_Api_ClientBase.ADD_ITEM_EVENT,[a,b]);$(this).trigger(WiziCore_Api_ClientBase.onChangePage,[new jQuery.Event(WiziCore_Api_ClientBase.ADD_WIDGET_EVENT),a,b])},deleteItem:function(a){for(var b=a.prop("id"),c=-1,d=this._children,e=0,f=d.length;e<f;++e)if(d[e].prop("id")==b){c=e;break}if(c!=-1)this._children.splice(c,1);else{b=0;for(e=d.length;b<e;++b)if(f=d[b].deleteItem(a),f!=-1){c=f;break}}$(a).unbind(WiziCore_Api_ClientBase.ADD_ITEM_EVENT);$(a).unbind(WiziCore_Api_ClientBase.DELETE_ITEM_EVENT);
$(a).unbind(WiziCore_Api_ClientBase.onChangePage);$(this).trigger(WiziCore_Api_ClientBase.DELETE_ITEM_EVENT,[a,c]);$(this).trigger(WiziCore_Api_ClientBase.onChangePage,[void 0,a,c]);return c},getPropNameByLowerCase:function(a){var b=this.getPropsNames(),c=a.toLowerCase();b[c]!==void 0&&(a=b[c]);return a},getPropsNames:function(){if(this._propsNames==void 0){var a=this.getAvailableProps(),b={},c;for(c in a){if(a[c].props!=void 0)var d=a[c].props;for(var e in d){var f=d[e].name;f!=void 0&&(b[f.toLowerCase()]=
f)}}this._propsNames=b}return this._propsNames},prop:function(a,b,c){a=this.getPropNameByLowerCase(a);b!==void 0&&(a=="name"&&typeof this.form=="function"&&typeof this.form().updateCodeAfterWidgetChangeName=="function"&&(acDebugger.systemLog("updateCodeAfterWidgetChangeName",this.id(),b),this.form().updateCodeAfterWidgetChangeName(this,b,this._project[a])),this.getPropsNames()[a.toLowerCase()]!=void 0?(this._project[a]=b,(c==void 0||c.disableTrigger==void 0||c.disableTrigger!==!0)&&$(this).trigger(WiziCore_Api_ClientBase.PROPERTY_CHANGE_EVENT,
[a,b])):this._project[a]=b);if(this._project[a]===void 0||this._project[a]==="")if(b=!1,this.context!=void 0&&typeof this.context=="function"){var d=this._project.widgetStyle;if(this.context().formThemeManager!=void 0&&d!=void 0){var e=this.context().formThemeManager(),f=this._project.widgetClass,g=WiziCore_Api_ClientBase._WIZI_USE_STYLE_CONSTANT,h=e.themeContent(this.prop("theme"))[f];if(h==void 0)h=e.themeContent(this.prop("theme")).WiziCore_Api_Page,this.page!=void 0&&this.page()!==null&&this.page().prop!=
void 0&&(d=this.page().prop("widgetStyle"));if(h!=void 0){h=e.themeContent(this.prop("theme"))[f];if(h!=void 0&&h[d]!=void 0)var j=h[d];j!=void 0&&j[a]!=void 0&&(g=j[a]);if(g!==WiziCore_Api_ClientBase._WIZI_USE_STYLE_CONSTANT&&(a=="font"||a=="fontColor")&&f!="WiziCore_Api_Page")if(e=e.themeContent(this.prop("theme")).WiziCore_Api_Page,e!=void 0&&this.page!=void 0&&this.page()!==void 0&&this.page()!==null&&this.page().prop!=void 0&&(d=this.page().prop("widgetStyle"),g===""&&(g=this.page().prop(a),
b=!0),e[d]!=void 0&&(e=e[d],(e[a]!==void 0||e[a]!=="")&&g==="")))g=e[a],b=!0;if(g==void 0||g=="")h!=void 0&&h[d]!=void 0&&(j=h[d]),j!=void 0&&j[a]!=void 0&&(g=j[a])}if(g===WiziCore_Api_ClientBase._WIZI_USE_STYLE_CONSTANT||g=="")j=this.getEmptyProps(),j!=void 0&&j[a]!=void 0&&(g=j[a]);if(g!==WiziCore_Api_ClientBase._WIZI_USE_STYLE_CONSTANT){if(c!=void 0&&typeof c=="object"&&(c.compute=!0,b&&c.usePage!=void 0))c.usePage=!0;return g}}}return this._project[a]===void 0?void 0:this._project[a]},value:function(a,
b){var c=this.prop(this._valName,a);a!==void 0&&b!==!1&&$(this).trigger(WiziCore_Api_ClientBase.onChangeBaseValue,[a]);return c},valueFromWidget:function(a){return this.value(a,!1)},offset:function(){var a={x:parseInt(this.prop("x")),y:parseInt(this.prop("y"))},b=this.parent().offset();a.x+=b.x;a.y+=b.y;return a},traverseChildren:function(a){var b=a(this);if(b)return!0;for(var c=this.children(),d=0;d<c.length;++d)if(b=c[d].traverseChildren(a))return!0;return!1},find:function(a){var b=null;this.traverseChildren(function(c){var d=
c.prop("id")==a;d&&(b=c);return d});return b},findName:function(a){if(this.prop("name").toUpperCase()==a.toUpperCase())return this;else for(var b in this.children()){var c=this.children()[b];if(c!=void 0&&typeof c.findName=="function"&&(c=c.findName(a),c!=null))return c}return null},getAvailableProps:function(){if(this._ap==null)this._ap=AC.Core.Widgets().getAvailableWidgetProperties(this.widgetClass());return this._ap},getEmptyProps:function(){if(this._ep==null)this._ep=AC.Core.Widgets().getEmptyWidgetProperties(this.widgetClass());
return this._ep},parent:function(a){if(a!=void 0)this._parent=a,$(this).trigger(WiziCore_Api_ClientBase.onChangeParent,[a]);return this._parent},project:function(a){var b=a!=void 0?a:jQuery.extend(!0,{},this._project);if(a==void 0){b.items=[];for(var c in this.children())b.items.push(this.children()[c].project());b.items.length==0&&delete b.items;delete b[this._valName]}else this._project=a;b.complexType==null&&delete b.complexType;return b},id:function(){return this._project.id},realId:function(){return this._project.realId},
name:function(){return this._project.name},isIncludedInSchema:function(){return this._project.isIncludedInSchema},dataType:function(){return this._project.dataType},widgetClass:function(){var a="WiziCore_UI_BaseWidget";if(this._project!=null)a=this._project.widgetClass;return a},children:function(){if(this._children==null)this._children=[];return this._children},childrencount:function(){var a=0,b;for(b in this.children())a++;return a},form:function(a){if(a!=void 0)this._form=a;return this._form},
page:function(a){if(a!=void 0)this._page=a;return this._page},fullNamePath:function(){return this.fullPath(this,"")},fullPath:function(a,b){var c=typeof a.name=="function"?a.name():"",d=typeof a.parent=="function"?a.parent():null;b!=""&&(b="."+b);b=c+b;d!=null&&d.id()!=this.form().id()&&(b=this.fullPath(d,b));return b},repeat:function(a){a!=void 0&&(this._project.repeat=a);return this._project.repeat},isRepeatShowOn:function(a){var b=this.repeat();if(b==!1)return!1;var c=b.include,d=!0;if(c!="all"){var b=
b.pages,d=!c,e;for(e in b)if(a==b[e]){d=c;break}}return d},wiziHandlerAddEvent:function(a){var b=a;if(typeof a=="object"&&a.type!=void 0)b=a.type;this._eventsHandles[b]==void 0&&(this._eventsHandles[b]=0);this._eventsHandles[b]++;(b!=WiziCore_Api_ClientBase.onAddEventHandler&&b!=WiziCore_Api_ClientBase.onRemoveEventHandler)==!0&&$(this).trigger(WiziCore_Api_ClientBase.onAddEventHandler,b)},wiziHandlerRemoveEvent:function(a){var b=a;if(typeof a=="object"&&a.type!=void 0)b=a.type;this._eventsHandles[b]==
void 0&&(this._eventsHandles[b]=1);this._eventsHandles[b]--;this._eventsHandles[b]<0&&(this._eventsHandles[b]=0);(b!=WiziCore_Api_ClientBase.onAddEventHandler&&b!=WiziCore_Api_ClientBase.onRemoveEventHandler)==!0&&$(this).trigger(WiziCore_Api_ClientBase.onRemoveEventHandler,b)},eventsHandles:function(){return this._eventsHandles},dataPropName:function(){return this._dataPropName}});WiziCore_Api_ClientBase._WIZI_USE_STYLE_CONSTANT="@#!!!WIZI_asdlkfj adsfq2df a#$%!@$%!%$Dfdagh dopidasfgf;;[[23/.,ZXCV><><?/!#@@@";
WiziCore_Api_ClientBase.PROPERTY_CHANGE_EVENT="E#ClientApi#PropertyChanghed";WiziCore_Api_ClientBase.ADD_ITEM_EVENT="E#ClientApi#AddItem";WiziCore_Api_ClientBase.ADD_WIDGET_EVENT="E#ClientApi#addWidgetEvent";WiziCore_Api_ClientBase.DELETE_WIDGET_EVENT="E#ClientApi#deleteWidgetEvent";WiziCore_Api_ClientBase.DELETE_ITEM_EVENT="E#ClientApi#DeleteItem";WiziCore_Api_ClientBase.onChangePage="E#ClientApi#ChangePage";WiziCore_Api_ClientBase.onChangeParent="E#ClientApi#ChangeParent";
WiziCore_Api_ClientBase.onChangeBaseValue="E#ClientApi#onChangeBaseValue";WiziCore_Api_ClientBase.onAddEventHandler="E#ClientApi#onAddEventhandler";WiziCore_Api_ClientBase.onRemoveEventHandler="E#ClientApi#onRemoveEventhandler";WiziCore_Api_ClientBase.onSelectValue="E#WiziCore_Api_ClientBase#onSelectValue";WiziCore_Api_ClientBase.onSetValue="E#WiziCore_Api_ClientBase#onSetValue";
WiziCore_Api_ClientBase.simpleConstDataSchema=function(a,b,c){if(a.isIncludedInSchema())return b={label:a.name(),type:WiziCore_Api_ClientForm.Kind.SIMPLE,structure:b},c[a.realId()]=b};WiziCore_Api_ClientBase.simpleDataSchema=function(a,b){var c=a.dataType()||WiziCore_Api_ClientForm.Type.STRING;return WiziCore_Api_ClientBase.simpleConstDataSchema(a,c,b)};WiziCore_Api_ClientBase.simpleDataObjectValue=function(a,b,c){if(c||a.isIncludedInSchema())return b[a.realId()]=a.value(),!0};
WiziCore_Api_ClientBase.getValueFromDataObject=function(a,b){return typeof b=="object"&&b!=null?b[a.realId()]:null};WiziCore_Api_ClientBase.setDataObjectValueSimple=function(a,b,c){if(a.isIncludedInSchema()){b=WiziCore_Api_ClientBase.getValueFromDataObject(a,b);if(b===null){var d=a.prop("defaultValue");d!==void 0?b=d:c!==void 0&&(b=c)}b!==void 0&&a.value(b)}};var WiziCore_Api_ClientForm={};
(function(a){a.ADD_PAGE_EVENT="E#WiziCore_Api_ClientForm#AddPage";a.DELETE_PAGE_EVENT="E#WiziCore_Api_ClientForm#DeletePage";a.ADD_REPEATE_EVENT="E#WiziCore_Api_ClientForm#AddRepeate";a.DELETE_REPEATE_EVENT="E#WiziCore_Api_ClientForm#DeleteRepeate";a.SHOW_PAGE="E#WiziCore_Api_ClientForm#ShowPage";a.onChangeTheme="E#WiziCore_Api_ClientForm#onChangeTheme";a.onShowNextPage="E#WiziCore_Api_ClientForm#onShowNextPage";a.onShowPrevPage="E#WiziCore_Api_ClientForm#onShowPrevPage";a.onShowPageByNum="E#WiziCore_Api_ClientForm#onShowPageByNum";
a.onShowPage="E#WiziCore_Api_ClientForm#onShowPage";a.onShowCallingPage="E#WiziCore_Api_ClientForm#onShowCallingPage";a.onClosing="E#WiziCore_Api_ClientForm#onClosing";a.onSubmit="E#WiziCore_Api_ClientForm#onSubmit";a.onStorageChanged="E#WiziCore_Api_ClientForm#onStorageChanged";a.onPageStackClear="E#WiziCore_Api_ClientForm#onPageStackClear";a.onPageStackBack="E#WiziCore_Api_ClientForm#onPageStackBack";a.onPageStackForward="E#WiziCore_Api_ClientForm#onPageStackForward";a.Type={STRING:"String",INTEGER:"Integer",
REAL:"Real",BOOLEAN:"Boolean",DATE:"Date"};a.Kind={SIMPLE:"Simple",OBJECT:"Object",LIST:"List",OBJECT_LIST:"ObjectList"};a.DEFAULT_LIST_KEY="_";a.MANDATORY_FORM_WIDGETS=1;a.MANDATORY_ARRAY_WIDGETS=2;a.MANDATORY_BOTH=3;a.ACTION_CODE_TYPE_AE="ActionEditor";a.ACTION_CODE_TYPE_JS="Javascript";a.ACTION_CODE_TYPE_EMPTY="No Handler"})(WiziCore_Api_ClientForm);
WiziCore_Form=function(){this.queries=this.children=this.repeates=this.id_folder=this.pages=this.name=this.version=this.id_user=this.id_form=null;this.theme="_default";this.actions={userCode:"",genCode:"",system:[]};this.redirectUrl=this.pageTarget=null;this.defaultPage=0;this.facebookName=this.backgroundRformMepeat=this.backgroundColor=this.backgroundImage=null;this.hasStorage="None";this.instanceTitleTemplate="";this.applicationRelationships=this.dataSchema=null;this.integrityHandling="message";
this.mandatoryMessage=this.uniquenessMessage="";this.views=[];this.renderCharts=this.loginFormId=null;this.highlightOpacity=20;this.gmapsApiKey=this.gaAccountId=this.shortUrl=this.workflow=this.liveName=this.validateMessage=this.highlightColor=null;this.orientation="any";this.fullScreen=!1;this.filesList=null;this.htmlHead="";this.autoFocus=!0;this.mobileSplash={mobile:"Default",desktop:"Default"};this.desktopSplash="Default";this.linkedExportApp=this.twirlyThingOptions=null;this.displayHourglassOver=
"widget";this.advertising=null};WiziCore_ApplicationRelationship=function(){this.toApplication=this.type=this.name=this.id_relation=null};WiziApp_InstanceRelationData=function(){this.added=this.removed=this.relationName=null};WiziApp_ForeignAppChange=function(){this.tempKey=this.data=this.key=this.action=null};
WiziApp_FormInstance=function(){this.lock_until=this.lock_id_user=this.status=this.id_form=this.id_user=this.time_created=this.widget_state=this.content=this.action=this.form_version=this.base_id_content=this.title=this.id_form_instance=this.id_content=null};WiziCore_Folder=function(){this.id_user=this.parent=this.title=this.id_folder=null};WiziCore_User=function(){this.removed=this.group=this.role=this.type=this.login=this.id=this.password=this.username=null};
WiziCore_Identifier=function(){this.params=this.name=this.id_identifier=null};WiziCore_Widget=function(){this.name=this.id=null;this.state=!1;this.type=this.code=this.icon=this.section=null};WiziCore_Page=function(){this.name=this.id=null;this.children=[];this.font=this.shadow=this.bgColor=this.height=this.width=null;this.centered=!1;this.widgetStyle="default"};
WiziCore_Resource=function(){this.type=this.ticket=this.filename=this.original=this.url=this.name=this.id_folder=this.id_user=this.id_resource=null};WiziCore_Theme=function(){this.id_folder=this.name=this.id_user=this.id_theme=null};WiziCore_Notifier=function(){this.type=this.settings=this.name=this.id_folder=this.id_user=this.id_notifier=null};WiziReport_Connection=function(){this.id_data_agent=this.type=this.id_folder=this.id_user=this.params=this.name=this.id_connection=null};
WiziReport_View=function(){this.filter=[];this.name="";this.viewId=this.queryId=null;this.enable=!0;this.inputs={};this.outputs={}};WiziCore_Group=function(){this.name=this.id_group=null};WiziReport_Query_Join=function(){this.alias=this.table=this.joinType=this.joinExpression=this.tableRight=this.tableLeft=null;this.inputs=[];this.outputs=[]};WiziReport_Query_Table=function(){this.alias=this.table=null;this.inputs=[];this.outputs=[]};
WiziReport_Query=function(){this.name=this.id_folder=this.id_query=null;this.type="Select";this.join=null};WiziReport_Request=function(){this.params=this.interval=this.orderBy=this.groupBy=this.outputs=this.inputs=this.queryId=this.viewId=null};WiziReport_Query_Field=function(a,b){this.name=a;this.value=b};WiziReport_DataAgent=function(){this.params=this.type=this.id_folder=this.id_user=this.name=this.id_data_agent=null};
var WiziCore_Api_Connection=WiziCore_Api_Base.extend({_connectionType:"Database",_connectionName:"Connection",_connectionId:"Connection",_userId:null,_folderId:null,_params:null,_idDataAgent:null,init:function(a){this._super(a);this._params={};this._dataSources=[]},connectionType:function(a){if(a!=void 0)this._connectionType=a;return this._connectionType},connectionName:function(a){if(a!=void 0)this._connectionName=a;return this._connectionName},connectionId:function(a){if(a!=void 0)this._connectionId=
a;return this._connectionId},userId:function(a){if(a!==void 0)this._userId=a;return this._userId},folderId:function(a){if(a!==void 0)this._folderId=a;return this._folderId},idDataAgent:function(a){if(a!=void 0)this._idDataAgent=a;return this._idDataAgent},xml:function(a){a=$(a)[0];if(a.nodeName.toLowerCase()=="connection")for(var b in a.attributes){var c=a.attributes[b],d=c.nodeName,c=c.nodeValue;switch(d){case "id":this.connectionId(c);break;case "type":this.connectionType(c);break;case "name":this.connectionName(c);
break;default:this._params[d]=c}}},json:function(a){if(a!=void 0)for(var b in a){var c=a[b];switch(b){case "id_connection":this.connectionId(c);break;case "id_data_agent":this.idDataAgent(c);break;case "type":this.connectionType(c);break;case "name":this.connectionName(c);break;case "id_user":this.userId(c);break;case "id_folder":this.folderId(c);break;case "params":for(var d in c)this._params[d]=c[d];break;case "data_sources":var e=[];for(d in c){var f=new WiziCore_Api_Query(this.context(),this,
c[d].name);f.inputs(c[d].input);f.outputs(c[d].output);f.params(c[d].params);e.push(f)}this.dataSources(e);break;default:this._params[b]=c}}a=new WiziReport_Connection;a.id_connection=this.connectionId();a.id_folder=this.folderId();a.id_user=this.userId();a.name=this.connectionName();a.params=this._params;a.type=this.connectionType();a.id_data_agent=this.idDataAgent();return a},param:function(a,b){b!=void 0&&(this._params[a]=b);return this._params[a]},params:function(a){if(a!==void 0)this._params=
a;return this._params}});WiziCore_Api_Connection.Database="Database";WiziCore_Api_Connection.WebService="WebService";
var WiziCore_Api_Query=WiziCore_Api_Base.extend({_id_query:null,_id_folder:null,_name:null,_mainTable:null,_type:null,init:function(){this._super()},json:function(a){a!=void 0&&(this.name(a.name),this.queryId(a.id_query),this.folderId(a.id_folder),this.join(a.join),this.type(a.type));a={};a.name=this.name();a.id_query=this.queryId();a.id_folder=this.folderId();a.type=this.type();a.join=this.join();return a},name:function(a){if(a!==void 0)this._name=a;return this._name},type:function(a){if(a!==void 0)this._type=
a;return this._type},queryId:function(a){if(a!==void 0)this._id_query=a;return this._id_query},folderId:function(a){if(a!==void 0)this._id_folder=a;return this._id_folder},join:function(a){if(a!==void 0)this._join=a;return this._join}}),WiziCore_Api_LocalDb=function(a,b,c,d,e){var f;return{setKey:function(a){f=a},verifyKey:function(a){return a==f},getDb:function(a,b,c){new d(a,function(a,c){typeof b=="function"&&b(a,c)},c,f==null?e:{password:f})},remove:function(a,b,c){d.remove(a,b,function(a){a.status==
0?WiziCore_Helper.callCallback(b,arguments):WiziCore_Helper.callCallback(c,arguments)})}}}($,window,document,window.PGSQLitePlugin),WiziCore_Api_ClientView_LocalData=function(a,b,c,d){function e(a,b,c){switch(a.toUpperCase()){case "SUM":case "COUNT":case "MAX":case "MIN":case "AVG":case "DATE":return a.toLowerCase()+"("+b+")";case "YEAR":return"strftime('%Y',"+b+")";case "MONTH":return"strftime('%m',"+b+")";case "DAY":return"strftime('%d',"+b+")";case "WEEK":return"strftime('%W',"+b+")";case "DATETOLOCALE":return"datetime("+
b+", 'localtime')";case "DATETOUTC":return"datetime("+b+", 'utc')";case "DATETORTZ":return"datetime("+b+", '"+c+" minutes')";case "MONTHNAMESHORT":case "MONTHNAMELONG":case "DAYNAME":throw"Unsupported function";case "QUATER":throw"Unsupported function";case "CONCAT":throw"Unsupported function";}return a+"("+b+")"}function f(a,b){var c,o,k="",h=/(?:'((?:[^\\']|\\')*?)'|"((?:[^\\"]|\\")*?)"|({[^}]+?})|\b(SUM|COUNT|YEAR|MONTH|MONTHNAMESHORT|MONTHNAMELONG|DAY|DAYNAME|WEEK|QUATER|MAX|MIN|AVG|DATE|DATETOLOCALE|DATETORTZ|DATETOUTC|CONCAT)\s*\()/i,
n=0;do{var g=h.exec(a);if(g)if(g.index!=0&&(k+=a.substr(0,g.index)),n=g.index+g[0].length,g[1]!=d)k+="'"+g[1]+"'";else if(g[2]!=d)k+="'"+g[2].replace(/(\\'|')/g,"''")+"'";else if(g[3]!=d)k+='"'+g[3].replace(/\"/g,'""')+'"';else{if(g[4]!=d){o=a.substr(n);var q=/(?:'(?:[^\\']|\\'*?)'|"(?:[^\\"]|\\")*?"|(\()|(\)))/g;c="";var p=1,t=0;do{var u=q.exec(o);if(!u){c+=o.substr(t);break}u.index!=0&&(c+=o.substr(t,u.index));if(u[1]!=d)++p;else if(u[2]!=d&&(--p,p==0))break;c+=u;t=u.index+u[0].length}while(1);
o=f(c);c=c.length;n+=c+1;k+=e(g[4],o,b)}}else k+=a;a=a.substr(n)}while(g);return k}function g(a,b,c,d){var e,h,n="",g=!0;for(e=0,h=a.length;e<h;++e){var q=a[e];q==null||q==""||(g?g=!1:n+=b,q=f(q,c),n+=d?"("+q+")":q)}return n}function h(a,b){var c,d,e="SELECT ",h={},n=!0;for(c=0,d=a.outputs.length;c<d;++c){c!=0&&(e+=",");var n=a.outputs[c],r="c"+c;h[r]=n;n=f(n,b);e+=n+" as "+r}e+=" FROM "+('"'+a.queryId.replace(/\"/g,'""')+'"');a.inputs&&a.inputs.length>0&&(e+=" WHERE ",e+=g(a.inputs," AND ",b,!0));
a.groupBy&&a.groupBy.length>0&&(e+=" GROUP BY ",e+=g(a.groupBy,",",b));if(a.orderBy&&a.orderBy.length>0){e+=" ORDER BY ";n=!0;for(c=0,d=a.orderBy.length;c<d;++c){var q=a.orderBy[c],r=q.field;if(!(r==null||r==""))n?n=!1:e+=",",(q=q.direction)||(q="asc"),r=f(r),e+=r+" "+q}}c="";if(a.interval){d=-1;if(a.interval.count!=null)d=a.interval.count;c+=" LIMIT "+d;a.interval.start!=null&&a.interval.start!=0&&(c+=" OFFSET "+a.interval.start)}return{mainSql:e,limitPart:c,aliasMap:h}}return{loadDataFromLocalDb:function(a,
b){if(typeof b=="function"){var c=this._form.getTimeZone(),c=h(a,c),d=c.mainSql,e=c.limitPart,f=c.aliasMap;WiziCore_Api_LocalDb.getDb("sync",function(a,c){var m="SELECT COUNT(*) as c FROM ("+d+") as t";c.executeSql(d+e,function(a){c.executeSql(m,function(c){var d={data:null,rowsCount:null},e=a.rows,m=[],o=[],h,k;for(k in f)o.push(f[k]);m.push(o);for(o=0,h=e.length;o<h;++o){var j=e[o],n=[];for(k in f)n.push(j[k]);m.push(n)}d.rowsCount=c.rows[0].c;d.data=m;b(!1,{result:d})},function(){b(!0,{result:null})})},
function(){b(!0,{result:null})})},function(){b(!0,{result:null})})}}}}($,window,document),WiziCore_Api_ClientView=WiziCore_Api_Base.extend($.extend({},WiziCore_Api_ClientView_LocalData,{_form:null,_project:null,_filters:null,_binds:null,_loads:null,init:function(a,b){this._binds=[];this._loads=[];this._project=b;this._form=a;this._filters={}},project:function(){return this._project},queryId:function(){return this._project.queryId},enable:function(a){a!=void 0&&(this._project.enable=a);this._project.enable===
void 0&&(this._project.enable=!0);return this._project.enable},_callCallbacks:function(a,b){for(var c=0,d=this._binds.length;c<d;c++)this._binds[c].callback.call(this._binds[c].obj,a,b)},removeCallback:function(a,b){for(var c=!1,d=0,e=this._binds.length;d<e;d++)if(this._binds[d].callback==a&&this._binds[d].obj==b){c=d;break}c!==!1&&this._binds.splice(d,1)},isLoadCallbackExist:function(a,b){for(var c=0,d=this._loads.length;c<d;c++)if(this._loads[c].callback==a&&b==this._loads[c].obj)return!0;return!1},
loadData:function(a,b,c,d,e){typeof e=="function"&&this._binds.push({callback:e,obj:b});typeof d=="function"&&!this.isLoadCallbackExist(d,b)&&this._loads.push({callback:d,obj:b});if(this.enable()){if(!this.context().offlineMode())for(var f in a)if(a[f]instanceof Array){d=0;for(e=a[f].length;d<e;d++){var g=a[f][d]!=void 0&&a[f][d].value!=void 0?a[f][d].value:a[f][d];if(typeof g=="string"){var h=this._form.getTimeZone(),j=(new Date).getTimezoneOffset(),i=j<=0?" + ":" - ",m=h<=0?" + ":" - ",o=j<=0?" - ":
" + ";if(g.match(/datetolocale/i)&&g.match(/interval/i)==null)a[f][d].value=g.replace(/((datetolocale)\([^)]*)(\))/i,"$1"+i+"interval '"+Math.abs(j)+"' minute)");if(g.match(/datetortz/i)&&g.match(/interval/i)==null)a[f][d].value=g.replace(/((datetortz)\([^)]*)(\))/i,"$1"+m+"interval '"+Math.abs(h)+"' minute)");if(g.match(/datetoutc/i)&&g.match(/interval/i)==null)a[f][d].value=g.replace(/((datetoutc)\([^)]*)(\))/i,"$1"+o+"interval '"+Math.abs(j)+"' minute)")}}}var k=this._buildRequest(a),a=k[0];if(a.outputs.length<
1)c.call(b,!0);else{f=this.context().dataIntegration();var l=this;this._traceData(b,a,void 0,"send");d=this._form?this._form.id():"";e=function(a,d){l._traceData(b,{object:d,error:a},void 0,"answer");l._onDataReceived(a,d,k[1],c,b)};this.context().offlineMode()?this.loadDataFromLocalDb(a,e):f.loadData(a,d,void 0,!0,e)}}else c.call(b,!0)},_onDataReceived:function(a,b,c,d,e){if(a==!1){a=b.result.data;if(b&&typeof b.result=="object"&&b.result.data instanceof Array&&b.result.data.length>0)for(var f=a[0],
g=0,h=f.length;g<h;++g)f[g]in c&&(f[g]=c[f[g]]);d.call(e,!1,a,b.result.rowsCount)}else d.call(e,!0)},_processOutputs:function(a){var b=this.context().dataObject(),c=[],d=[],e={},f;for(f in a)if(a[f].value&&a[f].value.length!=0){var g=b.processString(this._form,a[f].value);if(e[g]==void 0)c.push(g),d[g]=a[f].value,e[g]=!0}return[c,d]},_processInputs:function(a,b,c){var d=[];this._addInputs(d,this.getGeneralFilter());b&&this._addInputs(d,this.getFilters([c]));this._addInputs(d,a);return d},_addInputs:function(a,
b){if(b!=void 0)for(var c=this.context().dataObject(),d=0,e=b.length;d<e;d++)a.push(c.processString(this._form,b[d]))},_processGroupBy:function(a){var b=this.context().dataObject(),c=[];if(a!=void 0)for(var d=0,e=a.length;d<e;d++)a[d]!=""&&c.push(b.processString(this._form,a[d]));return c},_processOrderBy:function(a){var b=this.context().dataObject(),c=[];if(a!=void 0)for(var d=0,e=a.length;d<e;d++)a[d].value!=""&&c.push({direction:a[d].asc?"asc":"desc",field:b.processString(this._form,a[d].value)});
return c},_getGlobalParams:function(){return this.context().getSession().getDataAgentParams()},params:function(a){a!=void 0&&(this._project.params=a);return this._project.params},_buildRequest:function(a){var b=new WiziReport_Request;b.queryId=this._project.queryId;var c=this._processOutputs(a.outputs);b.outputs=c[0];b.interval=a.interval;b.inputs=this._processInputs(a.inputs,a.listen,a.id);b.groupBy=this._processGroupBy(a.groupBy);b.orderBy=this._processOrderBy(a.orderBy);var a=this.params(),d=this._getGlobalParams();
b.params=[];if(a!==void 0)for(var e in a)b.params.push(a[e]);if(d!==void 0)for(e in d)b.params.push(d[e]);return[b,c[1]]},_addBindCallback:function(a){for(var b=!1,c=0,d=this._binds.length;c<d;c++)if(this._binds[c]==a){b=!0;break}b||this._binds.push(a)},_loadCallback:function(){},applyDrillDown:function(a,b,c){if(c==!0)this._filters={};typeof b=="string"&&(b=[b]);this._filters[a]=b;this._form.onDrillDown(this._project.name,a,b,c?!0:!1);this._callCallbacks(a,c)},resetFilter:function(){this._filters=
{};this._callCallbacks(void 0,!0)},getGeneralFilter:function(){var a=[];if(this._project.filter instanceof Array)for(var b=this._project.filter.length,c=0;c<b;c++){var d=this._project.filter[c];d!=""&&a.push(d)}return a},getFilters:function(a){var b=[],c;for(c in this._filters)if(!WiziCore_Helper.inArray(c,a)&&this._filters[c]instanceof Array)for(var d in this._filters[c]){var e=this._filters[c][d];e!=""&&b.push(e)}return b},reload:function(){this._callLoadCallbacks()},_callLoadCallbacks:function(){for(var a=
0,b=this._loads.length;a<b;a++)this._loads[a].callback.call(this._loads[a].obj)},_traceData:function(a,b,c,d){swirlDebugger.traceLoadDataRequest(a,b,c,d)},loadQueryAndExtractAppId:function(a){var b=this.queryId(),c=this.context().queries(),d=this;c.queries()[b]==void 0?c.loadQuery(b,function(b,c){var g=null;b||(g=d.extractAppIdFromQuery(c));WiziCore_Helper.callCallback(a,[g])}):(appId=this.extractAppIdFromQuery(c.queries()[b]),WiziCore_Helper.callCallback(a,[appId]))},extractAppIdFromQuery:function(a){var b=
null;a.join().joinType=="table"&&(a=a.join().table.split("."),a.length==2&&a[0]==WiziCore_Api_ConnectionRequester.RDB_CONNECTION_ID&&(b=a[1]));return b}}));WiziCore_Api_ClientView.onFilterUpdated="Events#WiziCore_Api_ClientView#onFilterUpdated";WiziCore_Api_ClientView.onReload="Events#WiziCore_Api_ClientView#onReload";WiziCore_Api_ClientView.CRUD={DB:1,RDB:2};
var WiziCore_Api_ClientFormInstance=WiziCore_Api_Base.extend({_project:null,init:function(a,b){this._project=a;b!=void 0&&(this._project.id_form=b)},id:function(){return this._project.id_form_instance},formId:function(){return this._project.id_form},project:function(){var a=this.formId();this._project.form_version=this.context().forms().forms()[a].version()||0;this._project.content=this.collectDataObject();this._project.title=this.generateTitle(this._project.content);this._project.widgets_state=this.collectWidgetsState();
this._project.status=WiziCore_Api_ClientFormInstance.STATUS_NORMAL;return this._project},collectWidgetsState:function(){var a=this.formId(),b={};this.context().forms().forms()[a].traverseAll(function(a){var d=a.getAvailableProps(),e=a.realId();b[e]={};for(var f in d)if(d[f].props!=void 0){var g=d[f].props,h;for(h in g){var j=g[h],i=g[h].name;i!=void 0&&j.persistent!=void 0&&j.persistent==!0&&(b[e][i]=a.prop(i))}}});return b},restoreWidgetsState:function(a){var b=this._project.widgets_state;typeof b==
"object"&&a.traverseAll(function(a){var d=a.realId(),d=b[d],e=a.getAvailableProps(),f;for(f in e)if(e[f].props!=void 0){var g=e[f].props,h;for(h in g){var j=g[h].name;j!=void 0&&a.prop(j,d[j])}}})},collectDataObject:function(){for(var a=this.formId(),b=this.context().forms().forms()[a],a={},c=b.pages(),d=0;d<c.length;++d)for(var e=c[d].widgets(),f=0;f<e.length;++f)e[f].appendValueToDataObject(a);b=b.repeates();for(d=0;d<b.length;++d)b[d].appendValueToDataObject(a);return a},applyDataObject:function(a){for(var b=
this._project.content,c=a.pages(),d=0;d<c.length;++d)for(var e=c[d].widgets(),f=0;f<e.length;++f)e[f].setValueFromDataObject(b);a=a.repeates();for(d=0;d<a.length;++d)a[d].setValueFromDataObject(b)},generateTitle:function(a){var b=this.formId(),c=this.context().forms().forms()[b],b=c.instanceTitleTemplate(),d=[],e=/\{.*?\}/,f={};for(c.traverseAll(function(b){var c=b.realId();a[c]!=void 0&&(f[b.name()]=c)});;)if(c=e.exec(b),c==null){d.push(b);break}else{var g=b.search(e),h=b.substring(0,g);d.push(h);
h=c[0].substring(1,c[0].length-1);h=f[h];h!=void 0&&d.push(a[h]);b=b.slice(g+c[0].length)}return d.join("")},submit:function(a,b,c){acDebugger.systemLog("submitting",a);var d=this.context().formInstances(),e=this.project(),f=e.id_form_instance;if(a=a||f==null)e.id_form_instance=null;acDebugger.systemLog("data to submit: ",e);d.submitFormInstance(a,e,b,c)},saveDraft:function(){}});
WiziCore_Api_ClientFormInstance.createNewInstance=function(a){var b=new WiziApp_FormInstance;return new WiziCore_Api_ClientFormInstance(b,a.id())};WiziCore_Api_ClientFormInstance.STATUS_NORMAL=1;WiziCore_Api_ClientFormInstance.STATUS_DELETED=2;
var WiziCore_Api_FormInstanceInfo=WiziCore_Api_Base.extend({_id:null,_version:null,_contentId:null,_stageId:null,_roleId:null,_roleName:null,_roleTitle:null,_lockStatus:null,_timeCreated:null,init:function(a){if(a!=void 0)this._id=a.id_form_instance,this._version=a.version,this._contentId=a.id_content,this._stageId=a.id_stage,this._roleId=a.roleId,this._roleName=a.roleName,this._roleTitle=a.roleTitle,this._lockStatus=a.lock_status,this._timeCreated=a.time_created},id:function(){return this._id},version:function(){return this._version},
contentId:function(){return this._contentId},stageId:function(){return this._stageId},role:function(){var a={id:this._roleName,name:this._roleTitle};if(this._roleId==null||this._roleName==void 0)a.id=null,a.name="Anonymous";return a},lockStatus:function(){return this._lockStatus},timeCreated:function(){return this._timeCreated}});WiziCore_Api_FormInstanceInfo.Status={NORMAL:1,DELETED:2};
var WiziCore_ObjectChooserTypes={WIDGET:"widget_type",PAGE:"page_type",MYDETAILS:"mydetails_type",VIEW:"view_type",QUERY:"query_type",APP:"application_type",CONNECTION:"connection_type",THEME:"theme_type",RESOURCE:"resource_type",USER:"user_type",ENVIRONMENT:"environment_type",SIMPLE_EXPRESSION:"simple_Expression",WIDGET_ARRAY:"widget_array",APP_INSTANCE:"app_instance"};
(function(a,b,c,d){var e={};b.WiziCore_UI_FormRuntime=function(a){function b(e,i){function m(){l&&WiziCore_Helper.showInfo(AC.Core.lang().trText("widget_proptype_abtn_gotourl")+" : "+l);k&&(e=null);o.stop(e)}var o=this,k=this._mode==c.PREVIEW_MODE,l=k&&e&&e.url?e.url:null;if(i)m();else{var n=e!=d&&e.message!=d?e.message:AC.Core.lang().tr("dialog_close_form"),n=WiziCore_Helper.showWarning("",n,!1,WiziCore_UI_MessageBoxWidget.MB_YESNO);a(n).one(WiziCore_UI_MessageBoxWidget.onDialogClose,function(a,
b){switch(b){case WiziCore_UI_MessageBoxWidget.IDYES:m()}})}}var c=WiziCore_Api_Base.extend({_form:null,_mode:null,_wnd:null,_session:null,_pageId:null,_visualizer:null,_vuid:null,_interval:null,_firstStateProject:null,_embedRunTimes:null,_embedCall:null,_id:null,init:function(a,b){this._super.apply(this,arguments);this._mode=a;this._embedRunTimes=[];b&&this.wnd(b)},beforeSwitchShow:function(){this.stop();this.pageId(null)},switchShow:function(a,b,c){this.wnd()!=null&&this.wnd().empty();this.show(a,
b,this.wnd(),c)},loadMode:function(a,b){if(this.wnd())if(a==!0){var b=b==d?{}:b,c=b.mode!=d?b.mode:"transparent";WiziCore_Helper.loadMode(this.wnd(),c,b.text,b.color,b.bgColor,b.opacity,b.over,b.image)}else WiziCore_Helper.loadMode(this.wnd(),!1)},twirlyThing:function(a,b){if(this.wnd()){var b=!b||typeof b!="object"?{}:b,c=b.widget,e=b.form,f=c?c.displayHourglassOver():null;f=="inherit"&&(f=e.displayHourglassOver());var a=a==d?!1:a,h=this.wnd();f=="wholeapp"?(delete b.image,e._twirlyThing(a,b)):(e=
5E5,e=isNaN(e)?15E6:e,c=c?c.id():h.attr("id"),b.zIndex=e,b.uid=c,WiziCore_Helper.twirlyThing(h,a,b))}},reOpen:function(){var a=this._firstStateProject,b=this.context().forms(),c=this,d=WiziCore_Helper.clone(a.formProject),e=WiziCore_Helper.clone(a.instanceProj);this.stop();b._populateCurrentFormResult(d,e,function(b,d,e,i){b==!1&&(c._embedCall&&c._embedCall.embedWidget._setApps(e,c._embedCall.parentApp),c.show(e,i,c.wnd(),a.param,!1))})},addEmbedRuntime:function(a){this._embedRunTimes.push(a)},isRunning:function(a){var b=
this.context().formRunTime(),c=!1,d;for(d in b)if(b[d].id()==a){c=!0;break}return c},closeForm:function(){b.apply(this,arguments)},show:function(b,i,m,o,k){var l=this;if(b==null||b==d)throw new WiziCore_Api_Error("Need form",WiziCore_Api_Error.ERR_NEED_OBJECT);e[b.liveName()]=b.id();e[b.id()]=b.id();this._id=b.runTimeId();o.embedCall!=d&&(this._embedCall=o.embedCall);o.embedCall=d;this.loadMode(!1);if(k!==!1)k={},k.formProject=b.clone(),k.instanceProj=WiziCore_Helper.clone(i),k.param=o,this._firstStateProject=
k;this.form(b);b.runtimeMode(this._mode);if(m==null||m==d)throw new WiziCore_Api_Error("Need object",WiziCore_Api_Error.ERR_NEED_OBJECT);this.wnd(m);if(this._mode==c.PREVIEW_MODE){if(o.visualizer!==d)this.visualizer(o.visualizer);else throw new WiziCore_Api_Error("Need visualizer",WiziCore_Api_Error.ERR_NEED_OBJECT);if(o.pageId!==d)this.pageId(o.pageId);else throw new WiziCore_Api_Error("Need pageId",WiziCore_Api_Error.ERR_NEED_OBJECT);this.context().formRunTime(this.id(),this)}else if(o.pageId!==
d&&this.pageId(o.pageId),o.session!==d)this.session(o.session),this.context().formRunTime(this.id(),this),this.visualizer(new WiziCore_Visualizer(this.session()));else throw new WiziCore_Api_Error("Need session",WiziCore_Api_Error.ERR_NEED_OBJECT);b.prop("hasStorage")!="None"&&b.applyInstance(i);o=this.vuid();i=function(){a(b).trigger(AC.Widgets.WiziCore_Api_Form.onAppStarted);if(l._embedCall)l._embedCall.embedWidget.onEmbedAppStarted();l.setIntervalSaveDraft();b.phoneGapOptions()!=null&&typeof b.phoneGapOptions()==
"object"?(b.phoneGapOptions().autohidesplash||b.phoneGapOptions().autohidesplash===d)&&WiziCore_Helper.hideCordovaSplashScreen():WiziCore_Helper.hideCordovaSplashScreen()};o==null&&(o=this.visualizer().startVisualize(b,this.wnd(),WiziCore_Visualizer.RUN_MODE),this.vuid(o));for(var o=null,k=b.pages(),n=0,g=k.length;n<g;n++)if(k[n].id()==this.pageId()){o=k[n];break}if(o!==null)a(o).one(AC.Widgets.WiziCore_Api_Page.onPageShow,i);b.isPrinting()?this.visualizer().printPages(this.vuid()):this.visualizer().showPage(this.vuid(),
this.pageId());!b.isEmbed()&&!b.isIframeMode()&&!b.isPrinting()&&(WiziCore_Address_History.clearCache(),a(WiziCore_Address_History).bind(WiziCore_Address_History.onChanged+"."+this.id(),function(a,b){l.onHistoryChanged(a,b)}));switch(this._mode){case c.PREVIEW_MODE:m.focus()}o===null&&i()},onHistoryChanged:function(a,b){var c=this.visualizer().isDialogMode(this.vuid()),f=b.pathNames,h=f[0]!=d?f[0]:null,l=this.form(),n=null;if(!(c||WiziCore_Helper.getOpenedDialogs()!=0))if(f.length==2&&(c=f[0]!=d?
f[0]:null,h=f[1]!=d?decodeURI(f[1]):null,e[c]&&(n=e[c])),n!=null&&l.id()!=n)f={appId:n},h!=null&&(f.pageName=h),l.switchApp(f);else if(h!=null)l._transitionOptions?(l.pageJump(h,l._transitionOptions.transition,l._transitionOptions.reverse),l._transitionOptions=null):l.pageJump(h)},vuid:function(a){if(a!==d)this._vuid=a;return this._vuid},setIntervalSaveDraft:function(){var a=this.form().prop("hasStorage");(typeof a=="string"?a!="None":a)&&acDebugger.systemLog("storage = TRUE")},clearIntervalSaveDraft:function(){clearInterval(this._interval)},
stop:function(b){for(var d=this._embedRunTimes,e=this.form(),o=e&&e.id(),e=e?e.isEmbed()||e.isIframeMode():!1,k=0,l=d.length;k<l;k++)d[k].stop();this.visualizer()&&(this.visualizer().stopVisualize(this.vuid(),b),this.clearIntervalSaveDraft());this.context().dropFormRunTime(this.id());this.vuid(null);e||a(WiziCore_Address_History).unbind(WiziCore_Address_History.onChanged+"."+this.id());if(this._embedCall)this._embedCall.embedWidget.onEmbedAppStopped(),this._embedCall=null;a(this).trigger(c.onFormStop,
[this.id()]);this._embedRunTimes.length=0;this._visualizer=null;o&&delete this.context().forms().forms()[o];this.form(null)},visualizer:function(a){if(a!=d)this._visualizer=a;return this._visualizer},wnd:function(a){if(a!=d)this._wnd=a;return this._wnd},form:function(a){if(a!==d)this._form=a;return this._form},session:function(a){if(a!=d)this._session=a;return this._session},pageId:function(a){if(a!==d)this._pageId=a;else if(this._mode==c.LIVE_MODE&&this._pageId==null){a=this.form().pages();acDebugger.systemLog("pages.length ",
a.length);this._pageId=a[0].id();var b=this.form().prop("defaultPage");a[b]!=d&&(b=a[b].id());for(var e=0;e<a.length;e++){var f=a[e].id();if(f==b){this._pageId=f;break}}}return this._pageId},id:function(){return this._id}});c.PREVIEW_MODE="preview";c.LIVE_MODE="live";c.onFormShow="Events#WiziCore_UI_FormRuntime#FormShow";c.onFormStop="Events#WiziCore_UI_FormRuntime#FormStop";return c}(a)})(jQuery,window,document);
var TZDate=jQuery.Class.create({_isUTC:!1,_isRTZ:!1,init:function(a){this._base=new Date;this._localZone=this._base.getTimezoneOffset();this._timeZone=this._base.getTimezoneOffset();this._type="locale";if(a!=void 0&&$.isArray(a))this._type=a[0],a.splice(0,1),this.initialDate(a)},toString:function(){var a="";this._type=="utc"?a=this.dtDateToString("UTCDateTime","DOW Month D Y HH:MM:SS TX",this._base,"utc"):this._type=="rtz"?a=this.dtDateToString("RTZDateTime","DOW Month D Y HH:MM:SS TX",this._base,
"rtz"):this._type=="locale"&&(a=this.dtDateToString("localeDateTime","DOW Month D Y HH:MM:SS TX",this._base,"locale"));return a},toLocaleString:function(){return ret=this.dtDateToString("localeDateTime","DOW Month D Y HH:MM:SS TX",this._base,"locale")},dtAdjust:function(a){if(a==null)return this;if(typeof a=="string")if(a=="locale")this._type=="utc"?this._base.setMinutes(this._base.getMinutes()-this._localZone):this._type=="rtz"&&this._base.setMinutes(this._base.getMinutes()-this._localZone+this._timeZone),
this._timeZone=x.getTimezoneOffset(),this._type="locale";else if(a=="utc")this._type=="locale"?this._base.setMinutes(this._base.getMinutes()+this._localZone):this._type=="rtz"&&this._base.setMinutes(this._base.getMinutes()+this._timeZone),this._timeZone=0,this._type="utc";else{if(a=="rtz")this._type=="locale"?this._base.setMinutes(this._base.getMinutes()+this._localZone-this._timeZone):this._type=="utc"&&this._base.setMinutes(this._base.getMinutes()-this._timeZone),this._type="rtz"}else this._type==
"rtz"&&this._base.setMinutes(this._base.getMinutes()+this._timeZone-parseInt(a)),this._timeZone=parseInt(a)},dtAdd:function(a,b){if(a==null)return this;b=parseInt(b);if(a=="Y")this._base.setFullYear(this._base.getFullYear()+b);else if(a=="M")this._base.setMonth(this._base.getMonth()+b);else if(a=="W")this._base.setDate(this._base.getDate()+b*7);else if(a=="D")this._base.setDate(this._base.getDate()+b);else if(a=="H")this._base.setHours(this._base.getHours()+b);else if(a=="m")this._base.setMinutes(this._base.getMinutes()+
b);else if(a=="S")this._base.setSeconds(this._base.getSeconds()+b);else if(a=="X"){var c=parseInt(b/5),d=b-5*c;this._base.setDate(this._base.getDate()+7*c);d+this._base.getDay()>5?this._base.setDate(this._base.getDate()+(d+2)):this._base.setDate(this._base.getDate()+d)}return this},dtDifference:function(a,b){var c=0,d=this._base-a._base;if(b==null)return c;b=="Y"?c=parseInt(this._base.getFullYear()-a._base.getFullYear()):b=="M"?(c=this._base.getMonth(),d=a._base.getMonth(),c=parseInt(this._base.getFullYear()-
a._base.getFullYear())*12-(c-d)):b=="W"?c=d.valueOf()/6048E5:b=="D"?c=d.valueOf()/864E5:b=="H"?c=d.valueOf()/36E5:b=="m"?c=d.valueOf()/6E4:b=="S"?c=d.valueOf()/1E3:b=="X"&&(c=this.dtDifference(a,"D"),c=Math.round(c)-7*Math.round(c/7)+Math.round(c/7)*5);return c},dtDateToString:function(a,b,c,d){var e=a.match(/(locale)*(RTZ)*(UTC)*(Date)*(Time)*/),a=e[1]!==void 0?!0:!1,f=e[3]!==void 0?!0:!1,g=e[4]!==void 0?!0:!1,e=e[5]!==void 0?!0:!1,h=new Date(this._base),j=new Date(this._base),i=this._type;c!=void 0&&
(h=new Date(c));d!=void 0&&(i=d);i=="utc"?(h.setMinutes(h.getMinutes()-this._localZone),j.setMinutes(j.getMinutes()-this._localZone)):i=="rtz"&&j.setMinutes(j.getMinutes()+this._timeZone-this._localZone);b=b.replace(/SS/g,e?f?this.pad(h.getUTCSeconds()):this.pad(h.getSeconds()):"00");b=b.replace(/(?=\b)MM\b/g,e?f?this.pad(h.getUTCMinutes()):this.pad(h.getMinutes()):"00");b=b.replace(/(?=\b)HH\b/g,e?f?this.pad(h.getUTCHours()):this.pad(h.getHours()):"00");b=b.replace(/(?=\b)Y\b/g,g?f?h.getUTCFullYear():
h.getFullYear():"0000");b=b.replace(/(?=\b)DOW\b/g,g?f?this.getDayOfWeek(h.getUTCDay()):this.getDayOfWeek(h.getDay()):"DOW");b=b.replace(/(?=\b)Month\b/g,g?f?this.getMonthName(h.getUTCMonth()+1):this.getMonthName(h.getMonth()+1):"Month");b=b.replace(/(?=\b)M\b/g,g?f?this.pad(h.getUTCMonth()+1):this.pad(h.getMonth()+1):"00");b=b.replace(/(?=\b)D\b/g,g?f?this.pad(h.getUTCDate()):this.pad(h.getDate()):"00");b=b.replace(/(?=\b)TZ\b/g,f?this.getTimeZoneString(0):a?this.getTimeZoneString(this._localZone):
this.getTimeZoneString(this._timeZone));b=b.replace(/(?=\b)TX\b/g,f?this.getTimeZoneGMTString(0):a?this.getTimeZoneGMTString(this._localZone):this.getTimeZoneGMTString(this._timeZone));return b=b.replace(/(?=\b)LOCALE\b/g,j.toLocaleString())},toLocaleString:function(){return this.dtDateToString("localDateTime","LOCALE")},pad:function(a){return a<10?"0"+a:a},getTimeZoneString:function(a){var b="";b+=a>0?"-":"+";a=Math.abs(a);b+=this.pad(Math.ceil(a/60));b+=this.pad(a-Math.ceil(a/60)*60);return b},
getTimeZoneGMTString:function(a){var b="GMT";b+=a>0?"-":"+";a=Math.abs(a);b+=this.pad(Math.ceil(a/60));b+=this.pad(a-Math.ceil(a/60)*60);return b},getDayOfWeek:function(a){return"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun".split(",")[a]},getMonthName:function(a){return"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(",")[a-1]},initialDate:function(a){this._base=a.length==7?new Date(a[0],a[1],a[2],a[3],a[4],a[5],a[6]):a.length==6?new Date(a[0],a[1],a[2],a[3],a[4],a[5]):a.length==5?new Date(a[0],a[1],a[2],
a[3],a[4]):a.length==4?new Date(a[0],a[1],a[2],a[3]):a.length==3?new Date(a[0],a[1],a[2]):a.length==2?new Date(a[0],a[1]):a.length==1?WiziCore_Helper.dateStrToJsDate(a[0]):a.length==0?new Date:null;if(!this._base)this._base=new Date;this._localZone=this._base.getTimezoneOffset();this._timeZone=this.getTimeZone();if(this._type=="locale")this._isRTZ=this._isUTC=!1;else if(this._type=="rtz")this._isUTC=!1,this._isRTZ=!0,this._base.setMinutes(this._base.getMinutes()-this._timeZone+this._localZone);else if(this._type==
"utc")this._isUTC=!0,this._isRTZ=!1,this._base.setMinutes(this._base.getMinutes()+this._localZone)},getTimeZone:function(){return this._timeZone},setTimeZone:function(a){if(a!=void 0)this._timeZone=a},getJsDate:function(){return new Date(this._base)}}),WiziCore_Api_Timer=jQuery.Class.create({_currentCount:0,_delay:0,_repeatCount:0,_running:!1,_timerHandler:null,init:function(a,b){if(a!=void 0&&(this._delay=a,b!=void 0))this._repeatCount=b},stop:function(){if(this._timerHandler!=null)clearInterval(this._timerHandler),
this._timerHandler=null,this._running=!1},reset:function(){this.stop();this._currentCount=0},start:function(){this.running()&&this.stop();var a=this;this._timerHandler=setInterval(function(){a._currentCount++;$(a).trigger(WiziCore_Api_Timer.TimerTick,a.currentCount());a.repeatCount()!=0&&a.currentCount()==a.repeatCount()&&(a.stop(),$(a).trigger(WiziCore_Api_Timer.TimerComplete,a.currentCount()))},this.delay())},currentCount:function(){return this._currentCount},running:function(){return this._running},
delay:function(a){if(this.running())return this._delay;if(a!=void 0)this._delay=a;return this._delay},repeatCount:function(a){if(this.running())return this._repeatCount;if(a!=void 0)this._repeatCount=a;return this._repeatCount}});WiziCore_Api_Timer.TimerTick="Events#WiziCore_Api_Timer#Tick";WiziCore_Api_Timer.TimerComplete="Events#WiziCore_Api_Timer#Complete";
(function(a,b,c,d,e){d.Core.widgetScripts={_scriptList:null,_cssList:null,_inited:!1,_queue:null,_reg:"([^/]+\\.js)",initList:function(){if(!this._inited){this._inited=!0;this._queue=[];this._scriptList={};this._cssList={};var a=this;c("script").each(function(b,d){var e=c(d).attr("src"),i=RegExp(a._reg,"ig").exec(e);if(i!=null&&(e.indexOf("widgets")!=-1||e.indexOf("Resources/widgets")!=-1))a._scriptList[i[0]]=!0});c("link").each(function(b,d){if(c(d).attr("rel")=="stylesheet"&&c(d).attr("type")==
"text/css"){var e=c(d).attr("href");a._cssList[e]=!0}})}},getCsses:function(a){if(a)for(var d=0,e=a.length;d<e;++d){var j=a[d];j in this._cssList||(b.createStyleSheet?b.createStyleSheet(j):c("head").append('<link rel="stylesheet" type="text/css" href="'+j+'" />'),this._cssList[j]=!0)}},getScripts:function(a,b,c){if(a&&WiziCore_AppContext.getInstance().develop().loadScripts){var d={},i=!0,m=this._scriptList;d.callback=b;d.widgets=[];for(var o=0,k=a.length;o<k;o++){var l=RegExp(this._reg,"ig").exec(a[o]);
l!=null&&(l=l[0],d.widgets.push(l),m[l]==e?(i=!1,m[l]="loading",this._getScript(a[o],l,b,c)):m[l]=="loading"&&(i=!1))}i?b(!0):this._queue.push(d)}else b(!1)},checkQueue:function(){for(var a=this._queue,b=this._scriptList,c,d,e,m,o=0,k=a.length;o<k;o++)if((e=a[o])&&e.callback){d=c=!0;m=e.widgets;for(var l=0,n=m.length;l<n;l++)b[m[l]]=="error"&&(d=!1),b[m[l]]=="loading"&&(c=!1);if(c)e.callback&&e.callback(d),e.callback=null}for(o=a.length-1,k=0;o>=k;o--)a[o].callback==null&&a.splice(o,1)},_getScript:function(a,
b){var d=this._scriptList,e=this;WiziCore_Helper.canGetScript(a)&&c.getScript(a,function(a,c){d[b]=c=="success"?!0:"error";e.checkQueue()}).fail(function(){d[b]="error";e.checkQueue();throw"error loading "+a;})}}})(window,document,jQuery,AC);
var WiziCore_Api_Color=jQuery.Class.create({ok:!1,r:0,g:0,b:0,_transparent:!1,_isNone:!1,simple_colors:{aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",
darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",
ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",
lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",
olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",
snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},init:function(a){if(a==void 0)a="#000000",this._isNone=!0;if(typeof a!="string")a="#000000",this._isNone=!0;a=a.replace(/ /g,"");a=a.toLowerCase();if(a=="transparent")this._transparent=!0,a="#000000";a.charAt(0)=="#"&&(a=a.substr(1,6));for(var b in this.simple_colors)a==
b&&(a=this.simple_colors[b]);b=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(a){return[parseInt(a[1]),parseInt(a[2]),parseInt(a[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}}];
for(var c=0;c<b.length;c++){var d=b[c].process,e=b[c].re.exec(a);if(e)d=d(e),this.r=d[0],this.g=d[1],this.b=d[2],this.ok=!0}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r;this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g;this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b},toInt:function(){return this.getReturnVal(65536*this.r+256*this.g+this.b)},toRGB:function(){return this.getReturnVal("rgb("+this.r+", "+this.g+", "+this.b+")")},toHex:function(){var a=this.r.toString(16),b=this.g.toString(16),
c=this.b.toString(16);a.length==1&&(a="0"+a);b.length==1&&(b="0"+b);c.length==1&&(c="0"+c);return this.getReturnVal("#"+a+b+c)},getInvertHex:function(){var a=this.toHex().slice(1);this.r=255-parseInt(a.slice(0,2),16);this.g=255-parseInt(a.slice(2,4),16);this.b=255-parseInt(a.slice(4,6),16);return this.toHex()},rgbToGray:function(){var a=Math.round(0.3*this.r+0.59*this.g+0.11*this.b);this.b=this.g=this.r=a;return this.toHex()},redValue:function(){return this.r},greenValue:function(){return this.g},
blueValue:function(){return this.b},transparent:function(){return this._transparent},isNone:function(){return this._isNone},getReturnVal:function(a){this.transparent()&&(a="transparent");this.isNone()&&(a=null);return a}});
(function(a,b){a.WiziCore_Api_Debugger=jQuery.Class.create({_debug:!0,_open:!1,_chashed:!1,_timeDebug:{},_requests:{},_requestsData:{},_openMode:0,_dlg:null,_debugContent:null,_template:'<div>\n    <div id="deBugsDlg">\n        <ul>\n            <li><a href="#deBugsDlgerror">Debug info</a></li>\n            <li><a href="#deBugsDlgdatarequest">Data request</a></li>\n            <li><a href="#deBugsDlgallrequest">All request</a></li>\n        </ul>\n\n        <div id="deBugsDlgerror" style="width: 100%; height: 100%; overflow: auto;">\n            \n        </div>\n\n        <div id="deBugsDlgdatarequest" style="width: 100%; height: 100%; overflow: auto;">\n            <table style="width: 100%; vertical-align: top;" border="1">\n                <tr id="deBugsDlgdatarequesttable">\n                    <td>Base info</td>\n                    <td>Request</td>\n                    <td>Response</td>\n                    <td>Debug</td>\n                </tr>\n            </table>\n        </div>\n\n        <div id="deBugsDlgallrequest" style="width: 100%; height: 100%; overflow: auto;">\n            \n        </div>\n    </div>\n</div>',_systemLogMode:!1,
_profiling:!1,init:function(){this._debug&&(this.initDebugContent(),this.initTimeDebug())},initDebugContent:function(){this._debugContent=$(this._template)},openMode:function(a){if(a!=void 0)this._openMode=a;return this._openMode},openDebugWindow:function(a){this._open=!0;var b=this._dlg,e=this._debugContent;b!=null?b.dialog("open"):(this.debugWindow(),b=this._dlg,b.append(e),e.find("#deBugsDlg").tabs().css({width:e.parent().find(".ui-dialog-content").width(),height:e.parent().find(".ui-dialog-content").height()-
50}));a!=void 0&&e.find("#deBugsDlg").tabs("select",a)},hideDebugWindow:function(){this._dlg!=null&&this._dlg.dialog("close")},debugWindow:function(){var a=$("<div>");this._dlg=a;var b=this,e=jQuery.extend({modal:!1,height:500,width:600,title:"Debugger",resizable:!0,zIndex:2E3,resize:function(){a.find("#deBugsDlg").css({width:a.parent().find(".ui-dialog-content").width(),height:a.parent().find(".ui-dialog-content").height()-50})},close:function(){b._open=!1},buttons:{Close:function(){a.dialog("close")},
Clear:function(){a.find("#deBugsDlgerror").hasClass("ui-tabs-hide")||a.find("#deBugsDlgerror").empty();a.find("#deBugsDlgallrequest").hasClass("ui-tabs-hide")||a.find("#deBugsDlgallrequest").empty();a.find("#deBugsDlgdatarequest").hasClass("ui-tabs-hide")||a.find("#deBugsDlgdatarequest").find("tr:gt(0)").remove()}},dialogClass:"wa-system-dialog wa-system-style"},{});$(document.body).append(a);a.dialog(e);a.parent().find(".ui-icon-closethick").css({height:15,width:15})},logTime:function(a,b){var e=
(new Date).getTime();b!=void 0?this.log("message",a,"time",e,"delta",e-b):this.log("message",a,"start time",e);return e},traceLoadDataRequest:function(a,b,e,f){var g=a.id(),h=a.name(),a=a.widgetClass(),j=this;if(f=="send"){f=$("<tr>");f.attr("id","db_"+g+e);var i=$("<td>"),m=$("<td>"),o=$("<td>"),k=$("<td>");f.append(i);f.append(m);f.append(o);f.append(k);i.append($("<p>").text("Object name: "+h));i.append($("<p>").text("Object id: "+g));i.append($("<p>").text("Object class: "+a));i.append($("<p>").text("Date and time: "+
(new Date).format("isoDateTime")));m.append(j.getHtmlFromObject(b));b=$("<div>");b.html("<font color='red'>Wait response</font>");b.attr("id","db_"+g+"_answ_"+e);o.append(b);b.toggle();f.insertAfter("#deBugsDlgdatarequesttable")}else if(h=$("#db_"+g+e),e=$("#db_"+g+"_answ_"+e),b.error==!0)h.find("td:first").css({"border-color":"red","background-color":"red",color:"white"}),e.html(j.getHtmlFromObject(b.object.result)),this.openMode()==WiziCore_Api_Debugger.MODE_AUTO_OPEN&&this.openDebugWindow(1);else{b.object.result.debug!=
void 0&&h.find("td:eq(3)").text(b.object.result.debug.toString());var l=b.object.result.data;e.html($("<p>").click(function(){$(this).parent().html(j.getHtmlFromObject(l))}).text("Click for show responce"))}},traceRequest:function(a,b,e,f){if(this._openMode!=WiziCore_Api_Debugger.MODE_USER_OPEN){f==void 0&&(f="system");var g=b.sequense;if(e=="answer")g=b.uid;this._requests[g]==void 0&&(this._requests[g]={});var h=this;this._requests[g][e]={data:b,url:a};if(this._debugContent!=null&&(b=this._debugContent.find("#deBugsDlgallrequest"),
e=="send")){e=$("<div style='border : 1px solid black; margin-bottom : 1px;'>");e.attr("id","deBugsDlgallrequest"+g);var j=$("<div>");j.attr("id","deBugsDlgallrequest"+g+"send");var i=$("<div>");i.attr("id","deBugsDlgallrequest"+g+"answer");i.hide();e.append($("<a href='#' style='margin-right : 10px;'>").click(function(){$(this).parent();j.show();i.hide()}).text("Send"));e.append($("<a href='#'>").click(function(){if($(this).attr("init")==void 0)if(h._requests[g].answer!=void 0){var a=this;setTimeout(function(){$(a).attr("init",
!0)},1);i.html("Initing...")}else i.html("<font color='red'>No answer</font>");i.show();j.hide()}).text("Answer"));e.append($("<p>").text(a));j.append("");e.append(j);e.append(i);b.append(e)}}},getHtmlFromObject:function(a){var b=typeof a,e=$("<span>");switch(b){case "object":for(var f in a){var b=this.getHtmlFromObject(a[f]),g=$("<div style='margin-left : 5px;'>");g.click(function(a){$(this).children("span").toggle();a.preventDefault();a.stopPropagation()});e.append(g.text(f+" : ").append(b))}break;
case "function":break;default:e.html(a)}return e},reloadCss:function(){var a=$("link.wiziapp"),b=a.attr("href");a.attr("href",b+"?1")},assert:function(){if(this.consoleSupport())try{b!=void 0&&b.assert.apply(b,arguments)}catch(a){this._chashed=!0}},consoleSupport:function(){var a=navigator.userAgent.match(/iPad/i)!=null,d=b&&(jQuery.browser.mozilla||jQuery.browser.webkit&&!a);this.consoleSupport=function(){return d};return d},isIOs:function(){var a=navigator.userAgent.match(/iPad/i)!=null,b=navigator.userAgent.match(/iPhone/i)!=
null,e=a||b;this.isIOs=function(){return e};return e},error:function(a){this._debug&&this.consoleSupport()&&b.error(a)},log:function(){if(this._debug)if(this.isIOs())this.log1.apply(this,arguments);else{var a=this.consoleSupport(),d=arguments;if(!a){a=arguments.length;d="";try{for(var e=0;e<a;e++)d+=JSON.stringify(arguments[e])+";"}catch(f){d+="Debugger error :: too much recursion"}}try{b.log(d)}catch(g){this._chashed=!0}}},log1:function(){if(this._debug){for(var a=this.consoleSupport(),d=this.isIOs(),
e=[],f=0,g=arguments.length;f<g;++f)(arguments[f]instanceof TypeError||arguments[f]instanceof ReferenceError)&&e.push(arguments[f].stack),e.push(arguments[f]);e=[];if(d||!a){a=arguments.length;d="";for(f=0;f<a;f++){if(typeof arguments[f]=="object")for(var h in arguments[f])d+=h+" : "+arguments[f][h]+",";else d+=arguments[f];d+=";"}e=d}else{f=0;for(g=arguments.length;f<g;++f)(arguments[f]instanceof TypeError||arguments[f]instanceof ReferenceError)&&e.push(arguments[f].stack),e.push(arguments[f])}try{b&&
b.log(e)}catch(j){this._chashed=!0}}},log2helper:function(a){for(var b=arguments.length,e="",f=1;f<b;f++){switch(typeof arguments[f]){case "function":case "number":case "boolean":e+=arguments[f];break;case "string":e+='"'+arguments[f]+'"';break;case "object":if(arguments[f]==null){e+="null";break}if(arguments[f]==void 0){e+="undefined";break}var g=arguments[f]instanceof Array,h=!1;e+=g==!0?"[":"{";for(var j in arguments[f])e+=a>2?j+" : "+arguments[f][j]+", ":j+" : "+this.log2helper(a+1,arguments[f][j])+
", ",h=!0;h==!0&&(e=e.substring(0,e.length-2));e+=g==!0?"]":"}"}e+=";"}return e},initTimeDebug:function(){this._timeDebug=[];this.timeDebug("timeDebug.initialized")},timeDebug:function(a){var b=(new Date).getTime(),e=0;if(this._timeDebug[this._timeDebug.length-1]!=void 0){var f=this._timeDebug[this._timeDebug.length-1].time;f!=void 0&&(e=b-f)}this._timeDebug.push({message:a,time:b,delta:e})},showTimeDebug:function(){for(var a in this._timeDebug)debuger.log(this._timeDebug[a])},getTimeDebug:function(){return this._timeDebug},
systemLog:function(){this.systemLogMode()&&this.log.apply(this,arguments)},systemLog1:function(){this.systemLogMode()&&this.log1.apply(this,arguments)},dir:function(){b&&b.dir&&b.dir(arguments)},profile:function(){if(!this._profiling&&b)this._profiling=!0,b.profile()},profileEnd:function(){if(b)this._profiling=!1,b.profileEnd()},systemLogMode:function(a){if(a!=void 0)this._systemLogMode=a;return this._systemLogMode},_getModeFromUrl:function(a,b){var e=a.parent,f=null;try{f=e.location.href}catch(g){f=
e=null}return e!=void 0&&f!=void 0&&e!=a?this._getModeFromUrl(e):a.location!=void 0&&a.location.href!=void 0?a.location.href.search("[?&]?"+b+"[#=&]?\\b")!=-1?!0:!1:!1},_getSystemLogModeFromUrl:function(a,b){var e=WiziCore_AppContext.getInstance().getModeFromUrl(a,b);e||(e=this.systemLogMode());return e}});WiziCore_Api_Debugger.MODE_AUTO_OPEN=0;WiziCore_Api_Debugger.MODE_USER_OPEN=1;WiziCore_Api_Debugger.SYSTEM_LOG_MODE="debug"})(window,window.console);
$(document).ready(function(){swirlDebugger=acDebugger=debuger=new WiziCore_Api_Debugger;acDebugger.systemLogMode(acDebugger._getSystemLogModeFromUrl(window,"debug"))});
var WiziCore_Api_DataIntegrationRequester=WiziCore_Api_Base.extend({init:function(a){this._super(a)},getDBListTables:function(){},onGetDBListTables:function(a){var b=a.error,a=a.object;$(this).trigger(WiziCore_Api_DataIntegrationRequester.getDBListTables,[b,a])},onLoadConnectionSchema:function(a,b){var c=a.error,d=a.object;$(this).trigger(WiziCore_Api_DataIntegrationRequester.onLoadConnectionSchema,[c,d]);b!=void 0&&b(c,d.result)},loadConnectionSchema:function(a,b,c){var d=this;this.apiRequest("getConnectionSchema",
[a,b],function(a,b){d.onLoadConnectionSchema(b,c)})},testConnection:function(a,b){var c=this;this.apiRequest("testConnection",[a],function(a,e){c.onTestConnection(e,b)})},onTestConnection:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d);$(this).trigger(WiziCore_Api_DataIntegrationRequester.onTestConnection,[c,d])},loadConnectionTypes:function(){var a=this;this.apiRequest("getConnectionTypes",[],function(b,c){a.onLoadConnectionTypes(c)})},onLoadConnectionTypes:function(a){var b=
a.error,a=a.object;$(this).trigger(WiziCore_Api_DataIntegrationRequester.onLoadConnectionTypes,[b,a])},loadConnectionTypeParameters:function(a){var b=this;this.apiRequest("getConnectionTypeParameters",[a],function(a,d){b.onLoadConnectionTypeParameters(d)})},onLoadConnectionTypeParameters:function(a){var b=a.error,a=a.object;$(this).trigger(WiziCore_Api_DataIntegrationRequester.onLoadConnectionTypeParameters,[b,a])},loadData:function(a,b,c,d,e){var f=this;this.apiRequest("getData",[a,b,d],function(a,
b){f.onLoadData(b,c,e)})},onLoadData:function(a,b,c){var d=a.error,a=a.object;c!=void 0&&c(d,a,b);$(this).trigger(WiziCore_Api_DataIntegrationRequester.onLoadData,[d,a,b])},loadDataPreview:function(a,b,c,d){var e=this;this.apiRequest("getDataPreview",[a,b],function(a,b){e.onLoadDataPreview(b,c,d)})},onLoadDataPreview:function(a,b,c){var d=a.error,a=a.object,e=d==!0?a:null;$(this).trigger(WiziCore_Api_DataIntegrationRequester.onLoadDataPreview,[d,a,b]);a=e==null?a.result:null;c!=void 0&&c(e,a,b)},
lookupDatabases:function(a,b){var c=this;this.apiRequest("lookupDatabases",[a],function(a,e){c.onLookupDatabases(e,b)})},onLookupDatabases:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d);$(this).trigger(WiziCore_Api_DataIntegrationRequester.onLookupDatabases,[c,d])},loadDataForOffline:function(a,b,c,d){if(typeof d=="function"){var e=!1,f;for(f in a)if(a.hasOwnProperty(f)){e=!0;break}!e&&(!$.isArray(b)||b.length==0)?WiziCore_Helper.callCallback(d,[{}]):this.apiRequest("loadDataForOffline",
[a,b,c],function(a,b){var c=b.object,e=b.error==!0?c:null,c=e==null?c.result:null;d(e,c)})}},pushOfflineData:function(a,b){this.apiRequest("pushOfflineData",[a],function(a,d){var e=d.object,f=d.error==!0?e:null,e=f==null?e.result:null;typeof b=="function"&&b(f,e)})}});WiziCore_Api_DataIntegrationRequester.onLoadConnectionTypes="Events#WiziCore_Api_DataIntegrationRequester#LoadConnectionTypes";WiziCore_Api_DataIntegrationRequester.onLoadConnectionTypeParameters="Events#WiziCore_Api_ConnectionRequester#onLoadConnectionTypeParameters";
WiziCore_Api_DataIntegrationRequester.onTestConnection="Events#WiziCore_Api_DataIntegrationRequester#onTestConnection";WiziCore_Api_DataIntegrationRequester.onLoadConnectionSchema="Events#WiziCore_Api_DataIntegrationRequester#onLoadConnectionSchema";WiziCore_Api_DataIntegrationRequester.getDBListTables="Events#WiziCore_Api_DataIntegrationRequester#getDBListTables";WiziCore_Api_DataIntegrationRequester.onLoadData="Events#WiziCore_Api_DataIntegrationRequester#onLoadData";
WiziCore_Api_DataIntegrationRequester.onLookupDatabases="Events#WiziCore_Api_DataIntegrationRequester#onLookupDatabases";WiziCore_Api_DataIntegrationRequester.onLoadDataPreview="Events#WiziCore_Api_DataIntegrationRequester#onLoadDataPreview";
var WiziCore_Api_FormRequester=WiziCore_Api_Base.extend({_forms:null,_formFolders:null,init:function(){this._super.apply(this,arguments);this._forms={}},createForm:function(a,b){var c=this;this.apiRequest("createForm",[a],function(a,e){c.onFormCreated(e,b)})},buildMobileApp:function(a,b,c,d){var e=this;this.apiRequest("buildMobileApp",[a,b,c],function(a,b){e.onBuildMobileApp(b,d)})},onBuildMobileApp:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d)},mobileBuild:function(a,b,c,d){var e=
this;this.apiRequest("mobileBuild",[a,b,c],function(a,b){e.onMobileBuild(b,d)})},onMobileBuild:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d)},getMobileAppBuildStatus:function(a,b){var c=this;this.apiRequest("getMobileAppBuildStatus",[a],function(a,e){c.onGetMobileAppBuildStatus(e,b)})},onGetMobileAppBuildStatus:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d)},getNeedUnlockStatus:function(a,b){var c=this;this.apiRequest("getNeedUnlockStatus",[a],function(a,
e){c.onGetNeedUnlockStatus(e,b)})},onGetNeedUnlockStatus:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d.result)},getPhonegapCertificates:function(a,b){var c=this;this.apiRequest("getPhonegapCertificates",[a],function(a,e){c.onGetPhonegapCertificates(e,b)})},onGetPhonegapCertificates:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d.result)},unlockPhonegapKey:function(a,b,c,d,e){var f=this;this.apiRequest("unlockPhonegapKey",[a,b,c,d],function(a,b){f.onUnlockPhonegapKey(b,
e)})},onUnlockPhonegapKey:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d.result)},checkMobileAppStatus:function(a,b){var c=this;this.apiRequest("checkMobileAppStatus",[a],function(a,e){c.onCheckMobileAppStatus(e,b)})},onCheckMobileAppStatus:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d)},getListMobileApp:function(a,b){var c=this;this.apiRequest("getListMobileApp",[a],function(a,e){c.onGetListMobileApp(e,b)})},onGetListMobileApp:function(a,b){var c=a.error,
d=a.object;typeof b=="function"&&b(c,d)},getMobileErrorLogByIdAndPlatform:function(a,b,c){var d=this;this.apiRequest("getMobileErrorLogByIdAndPlatform",[a,b],function(a,b){d.onGetMobileErrorLogByIdAndPlatform(b,c)})},onGetMobileErrorLogByIdAndPlatform:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d)},removeMobileCertificate:function(a,b){var c=this;this.apiRequest("removeMobileCertificate",[a],function(a,e){c.onRemoveMobileCertificate(e,b)})},onRemoveMobileCertificate:function(a,
b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d)},getMobileCertificatesList:function(a){var b=this;this.apiRequest("getMobileCertificatesList",[],function(c,d){b.onGetMobileCertificatesList(d,a)})},onGetMobileCertificatesList:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d)},prepareAppZip:function(a,b,c,d){this.apiRequest("prepareAppZipV2",[a,c],function(a,b){var c=b.object.result,h=b.error;typeof d=="function"&&d(h,c?c:null)})},getAppZipStatus:function(a,b){this.apiRequest("getAppZipStatus",
[a],function(a,d){var e=d.error,f=d.object;if(!e)f=d.object.result;typeof b=="function"&&b(e,f)})},onFormCreated:function(a,b){var c=a.error,d=a.object;if(!a.error){var e=new AC.Widgets.WiziCore_Api_Form({project:d.result,level:2});this.forms()[e.id()]=e}typeof b=="function"&&b(c,d);$(this).trigger(WiziCore_Api_FormRequester.onCreated,[c,d])},checkForm:function(){},stopCheckForm:function(){clearTimeout(this._checkTimer);this._checkTimer=null;this._stopChecking=!0;this._checkRequest&&this._checkRequest.abort()},
openForm:function(a,b,c,d){this.context().users().currUser();this._blockingForm=!1;this.openFormAfterBlock(a,b,c,d)},openFormVersionInEditor:function(a,b,c,d){this.context().users().currUser();this._blockingForm=!1;this.openFormVersionInEditorAfterBlock(a,b,c,d)},freeForm:function(){},blockForm:function(){},showBlockError:function(a,b){a=a?AC.Core.lang().trText("console_blocked_by")+": "+a:"";WiziCore_Helper.enableInterface();b?WiziCore_Helper.showError(AC.Core.lang().trText("dialog_block_server_error")):
WiziCore_Helper.showError(AC.Core.lang().trText("dialog_block_error"),a)},openFormAfterBlock:function(a,b,c,d){var e=this;this.apiRequest("getForm",[a],function(f,g){var h=g.object,j=g.error;if(j)$(e).trigger(WiziCore_Api_FormRequester.onOpen,[j,g]),typeof c=="function"&&c(j,g);else{var i=function(){if(b)e.onFormOpened(g,a,c,d);else e.loadTheme(g,a,c,d)};h.result.loginFormId!=null?e.addLoginFormToForms(h.result.loginFormId,function(){i()}):i()}})},openFormVersionInEditorAfterBlock:function(a,b,c,
d){var e=this;this.loadFormVersion(a,b,function(b,g){if(b)$(e).trigger(WiziCore_Api_FormRequester.onOpen,[b,g]),typeof d=="function"&&d(b,g);else if(c)e.onFormOpened(g,a,d,WiziCore_Visualizer.EDITOR_MODE);else e.loadTheme(g,a,d,WiziCore_Visualizer.EDITOR_MODE)})},loadFormVersion:function(a,b,c){this.apiRequest("getFormRevision",[a,b],function(a,b){var f=b.error;typeof c=="function"&&c(f,b)})},loadTheme:function(a,b,c,d){var e=a.error,f=a.object,g=this;if(e)$(this).trigger(WiziCore_Api_FormRequester.onOpen,
[e,a]),typeof c=="function"&&c(e,a);else{var h=0,e=this.context().formThemeManager();$(e).one(WiziCore_Api_ThemeRequester.onLoaded,function(e,i){h++;i?($(g).trigger(WiziCore_Api_FormRequester.onOpen,[i,a]),typeof c=="function"&&c(i,a)):h==2&&(h=3,g.onFormOpened(a,b,c,d))});f=f.result.theme;if(typeof f=="object"&&f.id!=void 0)f=f.id;e.loadTheme(f);e.loadThemeContent(f,function(e){h++;h==2&&(h=3,g.onFormOpened(a,b,c,d));e&&$(g).trigger(WiziCore_Api_FormRequester.onThemeContextLoadError)})}},onFormOpened:function(a,
b,c,d){var e=a.error,f=a.object;e||(a=this.forms()[b],a==void 0||d==WiziCore_Visualizer.RUN_MODE?(a=new AC.Widgets.WiziCore_Api_Form({project:f.result,level:0,mode:d}),this.forms()[b]=a):(a.level(0),d!=void 0&&a.mode(d),a.project(f.result)));$(this).trigger(WiziCore_Api_FormRequester.onOpen,[e,a]);typeof c=="function"&&c(e,a)},addLoginFormToForms:function(a,b){a==void 0||this.forms()[a]!=void 0?b():this.reloadFormById(a,b)},reloadFormById:function(a,b){var c=this;this.forms()[a]&&delete this.forms()[a];
this.apiRequest("getForm",[a],function(a,e){var f=e.object;e.error||c.addForms([f.result]);b()})},deleteForm:function(a){var b=this;this.apiRequest("deleteForm",[a],function(c,d){b.onFormDeleted(d,a)})},onFormDeleted:function(a,b){var c=a.error,d=a.object;if(c==!1){var e=this.forms();e[b]!=void 0&&(e[b].destroy(),delete e[b])}$(this).trigger(WiziCore_Api_FormRequester.onDeleted,[c,d])},saveForm:function(a,b){var c=this.forms()[a];if(c!=void 0)c.workflow()!=void 0&&c.workflow().containers.length==
0&&c.workflow(null),this.saveFormJson(c.project(),b);else this.onFormSaved({error:!0,object:{message:"Form not found"}})},saveFormJson:function(a,b){var c=this;this.apiRequest("saveForm",[a],function(a,e){c.onFormSaved(e,b)})},onFormSaved:function(a,b){var c=a.error,d=a.object;$(this).trigger(WiziCore_Api_FormRequester.onSaved,[c,d]);b!=void 0&&b(c,d)},loadFormList:function(a){var b=this;this.apiRequest("getUserForms",[],function(c,d){b.onFormListLoaded(d,a)})},onFormListLoaded:function(a,b){var c=
a.object;if(a.error==!0||c.result==null)$(this).trigger(WiziCore_Api_FormRequester.onError,[c]);else{this.addForms(c.result);var d=this.forms(),c=c.result,e=[],f=this.context().dataObject().getValue("User.Id"),g;for(g in d){var h=d[g].level()==2||d[g].userId()!=f,j;for(j in c){var i=c[j];typeof i=="object"&&g==i.id_form&&(h=!1)}h&&g!=void 0&&e.push(g)}for(g in e)delete this._forms[e[g]]}WiziCore_Helper.callCallback(b,[a.error,a.object]);$(this).trigger(WiziCore_Api_FormRequester.onListLoaded,[this._forms])},
addForms:function(a){for(var b=0,c=a.length;b<c;b++)if(typeof a[b]=="object"&&(this.forms()[a[b].id_form]==void 0||this.forms()[a[b].id_form]!=void 0&&a[b].name!=this.forms()[a[b].id_form].name())){var d=new AC.Widgets.WiziCore_Api_Form({project:a[b],level:2});this.forms()[d.id()]=d}},getLoginFormId:function(a){try{var b=this;this.apiRequest("getLoginFormId",[a],function(a,c){var f=c.object,g=c.error;$(b).trigger(WiziCore_Api_FormRequester.onGetLoginFormId,[g,f])})}catch(c){acDebugger.systemLog1("session:getLoginFormId",
c)}},loadFormFolderList:function(a){var b=this;this.context().folders().loadFolderList(WiziCore_Api_FoldersRequester.FORM,null,function(c,d){b.onFormFolderListLoaded(c,d,a)})},onFormFolderListLoaded:function(a,b,c){this._formFolders=b;WiziCore_Helper.callCallback(c,[a,b]);$(this).trigger(WiziCore_Api_FormRequester.onFolderListLoaded,[b])},createFormFolder:function(a,b){var c=this,d=this.context().folders();b?($(d).one(WiziCore_Api_FoldersRequester.onCreatePublicFolder+WiziCore_Api_FoldersRequester.FORM,
function(a,b,d){c.onFormFolderCreated(b,d)}),d.createPublicFolder(WiziCore_Api_FoldersRequester.FORM,a)):($(d).one(WiziCore_Api_FoldersRequester.onCreated+WiziCore_Api_FoldersRequester.FORM,function(a,b,d){c.onFormFolderCreated(b,d)}),d.createFolder(WiziCore_Api_FoldersRequester.FORM,a))},onFormFolderCreated:function(a,b){$(this).trigger(WiziCore_Api_FormRequester.onFolderCreated,[a,b])},deleteFormFolder:function(a,b,c){var d=this,e=this.context().folders();c?($(e).one(WiziCore_Api_FoldersRequester.onDeleted+
WiziCore_Api_FoldersRequester.FORM,function(a,b,c){d.onFormFolderDeleted(b,c)}),e.deletePublicFolder(WiziCore_Api_FoldersRequester.FORM,a,b)):($(e).one(WiziCore_Api_FoldersRequester.onDeleted+WiziCore_Api_FoldersRequester.FORM,function(a,b,c){d.onFormFolderDeleted(b,c)}),e.deleteFolder(WiziCore_Api_FoldersRequester.FORM,a,b))},onFormFolderDeleted:function(a,b){$(this).trigger(WiziCore_Api_FormRequester.onFolderDeleted,[a,b])},saveFormFolder:function(a){var b=this,c=this.context().folders();$(c).one(WiziCore_Api_FoldersRequester.onSaved+
WiziCore_Api_FoldersRequester.FORM,function(a,c,f){b.onFormFolderSaved(c,f)});c.saveFolder(WiziCore_Api_FoldersRequester.FORM,a)},onFormFolderSaved:function(a,b){$(this).trigger(WiziCore_Api_FormRequester.onFolderSaved,[a,b])},forms:function(){if(this._forms==null)this._forms={};return this._forms},_populateFormResult:function(a,b){a.form!==null&&typeof a.form=="object"?this.populateCurrentFormResult(a,a.form,b):a.loginForm!==null&&typeof a.loginForm=="object"&&this.populateCurrentFormResult(a,a.loginForm,
b)},populateCurrentFormResult:function(a,b,c){var d=this.context().formThemeManager(),e=a.instance;d.onThemeLoaded({error:!1,object:{result:a.theme}},a.theme.id_theme);d.onThemeContentLoaded(a.theme.id_theme,!1,a.themeContent);this._populateCurrentFormResult(b,e,c)},_populateCurrentFormResult:function(a,b,c){var d=this.context();this.onFormOpened({error:!1,object:{result:a}},a.id_form,function(a,f){var g=f.prop("hasStorage");if(!(typeof g=="string"?g!="None":g)||b==null)c(!1,"",f,null);else if(b!=
null){g=d.formInstances();try{g.onFormInstanceLoaded({error:!1,object:{result:b}},b.id_form_instance,function(a,b,d){a==!0?(a=d.object!=void 0?d.object.message:AC.Core.lang().tr("live_load_inst_error"),c(!0,a,f,d)):c(!1,"",f,d)})}catch(h){acDebugger.systemLog1("live::formLoaded",h)}}},WiziCore_Visualizer.RUN_MODE)},getFormIdByLiveName:function(a,b){var c=this;this.apiRequest("getFormIdByLiveName",[a],function(a,e){c.onGetFormIdByLiveName(e,b)})},onGetFormIdByLiveName:function(a,b){var c=a.error,d=
a.object;typeof b=="function"&&b(c,d)},openFormInLiveMode:function(a,b,c,d,e){var f={};typeof a=="object"&&arguments.length==1?f=a:(f.formId=a,f.formName=b,f.instanceId=c,f.roleId=d,f.inNewTab=e);var g="liveMode_"+WiziCore_Helper.generateUniqueId(),h="live.php?";f.formName!=void 0&&f.formName!=""&&f.formName!=null?h=f.formName:h+="formId="+f.formId;f.instanceId!=void 0&&(h+="&instanceId="+f.instanceId);f.roleId!=void 0&&(h+="&roleId="+f.roleId);f.printing&&(h+="&printing="+f.printing+"");f.debugSession&&
(h+="&debugSession="+f.debugSession+"");f.debugKey&&(h+="&debugKey="+f.debugKey+"");h="http://"+window.location.hostname+"/"+h;f=f.inNewTab?window.open(h,"_newtab"):window.open(h,g,"status=0,toolbar=0,resizable=1,menubar=0,location=0,directories=0,scrollbars=1");acDebugger.systemLog("window.parent",window.parent);f.focus();return f},getFormRevisionsList:function(a,b){this.apiRequest("getFormRevisionsList",[a],function(a,d){var e=d.object.result,f=d.error;typeof b=="function"&&b(f,e)})},nameExists:function(a,
b){var c=this.forms(),d=this,e=0,f=!1,g;for(g in c)if(e++,c[g].name()===a){f=!0;break}e>0?typeof b==="function"&&b(f):this.loadFormList(function(c){if(typeof b==="function")if(c)b(!1);else{var c=0,e=!1,i=d._forms,f;for(f in i)if(c++,i[f].name()===a){e=!0;break}b(c>0?e:!1)}})}});WiziCore_Api_FormRequester.onSaved="Events#WiziCore_Api_FormClient#FormSaved";WiziCore_Api_FormRequester.onListLoaded="Events#WiziCore_Api_FormClient#ListLoaded";WiziCore_Api_FormRequester.onCreated="Events#WiziCore_Api_FormClient#Form#Created";
WiziCore_Api_FormRequester.onDeleted="Events#WiziCore_Api_FormClient#Form#Deleted";WiziCore_Api_FormRequester.onOpen="Events#WiziCore_Api_FormClient#Form#Opened";WiziCore_Api_FormRequester.onFolderListLoaded="Events#WiziCore_Api_FormClient#Folder#ListLoaded";WiziCore_Api_FormRequester.onFolderCreated="Events#WiziCore_Api_FormClient#Folder#Created";WiziCore_Api_FormRequester.onFolderDeleted="Events#WiziCore_Api_FormClient#Folder#Deleted";WiziCore_Api_FormRequester.onFolderSaved="Events#WiziCore_Api_FormClient#Folder#Saved";
WiziCore_Api_FormRequester.onError="Events#WiziCore_Api_FormClient#Error";WiziCore_Api_FormRequester.onGetLoginFormId="Events#WiziCore_Api_FormClient#onGetLoginFormId";WiziCore_Api_FormRequester.onThemeContextLoadError="Events#WiziCore_Api_FormClient#onThemeContextLoadError";
var WiziCore_Api_SessionRequester=function(a){function b(a,b){var d=a.error,e=a.object;d?(m=null,AC.Core.cookie().cookie("swirlSession",null),o=e):e.result!=null?m=e.result:(d=!0,o={message:"Error autentification",code:-1});d?(typeof b=="function"&&b(m,d),$(this).trigger(WiziCore_Api_SessionRequester.onCreated,[m,d])):c.call(this,b)}function c(a){var b=this;this.context().userSettings().loadSettings(function(){b.context().accounts().getMyRights(function(c){if(c)a(m,c);else{var d=b.context().users();
d.loadUserBySession(function(c,e){(c=c||d==null)||b.context().dataObject().setUserDetails(e);typeof a=="function"&&a(m,c)})}})});this.context().accounts().loadIdentsParams()}function d(a){var b=null,c=null;if(a)for(var d=0,e=a.length;d<e;d++){var i=a[d][0];if(i.match(/^(http:|https:)\/\/.*\.css.*$/i)!=null||i.match(/^Resources\/.*\.css.*$/i)!=null)!b&&(b=[]),b.push(i);else if(i.match(/^(http:|https:)\/\/.*\.js.*$/i)!=null||i.match(/^Resources\/.*\.js.*$/i)!=null)!c&&(c=[]),c.push(i)}return{scripts:c,
csses:b}}function e(b,c,d,e,i,f){c.error?WiziCore_Helper.callCallback(d,[c]):(e=e!=a?e:c.object.result.formResult.widgetScripts,i=i!=a?i:c.object.result.formResult.widgetCsses,b.context().widgetScripts().getCsses(i),b.context().widgetScripts().getScripts(e,function(){WiziCore_Helper.callCallback(d,[c])},f))}function f(a,b){var c=WiziCore_AppContext.getInstance().config().localAppsPath()+a+".json";$.ajax({url:c,dataType:"json",success:function(a){b(!1,a)},error:function(){b(!0)}})}function g(b){try{this.setToken(b.sessionId,
a,!1);var c=this.context().userSettings(),d=this.context().users(),e=this.context().accounts();if(b.userParameters!=a)e.onIdentsParamsLoaded({error:!1,object:{result:b.userParameters}});if(b.userSettings!=a)c.onSettingsLoaded({error:!1,object:{result:b.userSettings}});if(b.user!=a)d.onUserLoaded({error:!1,object:{result:b.user}});b.user!=a&&this.context().dataObject().setUserDetails(b.user)}catch(i){acDebugger.systemLog1(i)}}function h(a,b,c,d){var e=a.object,a=a.error?e:null;if(d&&a&&a.message==
"SMTP settings are not set")throw c;WiziCore_Helper.callCallback(b,[a])}var j=function(){this.init.apply(this,arguments)};AC.extend(j,WiziCore_Api_Base);var i=j.prototype,m=null,o="",k=[],l=null;i.init=function(){j._sc.init.apply(this,arguments);AC.Core.registerExtendsObject(this,this)};i.createSession=function(a,c,d){var e=this;try{this.apiRequestPlain("createSession",[a,c],function(a,c){b.call(e,c,d)})}catch(i){acDebugger.systemLog1("session:createSession",i)}};i.createGuestSession=function(a){var c=
this;try{this.apiRequestPlain("createGuestSession",[],function(d,e){b.call(c,e,a)})}catch(d){acDebugger.systemLog1("session:CreateGuestSession",d)}};i.sessionLogout=function(a){m!=null&&this.apiRequest("closeSession",[],function(b,c){m=null;WiziCore_Helper.callCallback(a,[c]);m!=null&&(m=null);o!=null&&(o=null);k!=null&&(k=[])})};i.loginAndLoadForm=function(a,b,c,d,i,f){var m=this;this.apiRequestPlain("loginAndLoadForm",[a,b,c,d,f],function(a,b){e(m,b,i)})};i.loginAndLoadFormWithSession=function(a,
b,c,d,i){var f=this;this.apiRequestPlain("loginAndLoadFormWithSessionId",[a,b,c,i],function(a,b){e(f,b,d)})};i.loadFullForm=function(a,b,c,i,o){var a=a||m,k=this;WiziCore_Helper.isNative()&&!AC.remoteDebug?f(b,function(a,b){if(a)e(k,{error:"Could not load app"},i,null);else{var f={error:!1,object:{result:b}},m=b.widgetScripts||null,h=b.widgetCsses||null;if(b.form.filesList){var l=d(b.form.filesList);l.scripts&&m&&(m=m.concat(l.scripts));l.csses&&h&&(h=h.concat(l.csses))}c==null?e(k,f,i,m,h,!1):k.context().formInstances().loadFormInstance(c,
function(a,b,c){if(!a)f.object.result.instance=c;e(k,f,i,m,h,!1)},o)}}):this.apiRequestPlain("loadFullForm",[a,b,c,o],function(a,b){var c=b&&b.object&&b.object.result&&b.object.result.widgetScripts?b.object.result.widgetScripts:null,f=b&&b.object&&b.object.result&&b.object.result.widgetCsses?b.object.result.widgetCsses:null;if(b.object.result&&b.object.result.form&&b.object.result.form.filesList){var m=d(b.object.result.form.filesList);m.scripts&&c&&(c=c.concat(m.scripts));m.csses&&f&&(f=f.concat(m.csses))}e(k,
b,i,c,f)})};i.loginFull=function(a,b,c,d){var e=this,i=function(a,b){b.error||g.call(e,b.object.result);WiziCore_Helper.callCallback(d,[b])};if(WiziCore_Helper.isNative()&&this.context().offlineMode()&&!AC.remoteDebug){var m=function(){WiziCore_Helper.callCallback(d,[{error:"Could not load app"}])};f(c,function(a){a?m():WiziCore_Api_LocalDb.getDb("sync",function(a,b){b.executeSql("SELECT attribute, value FROM offlineInfo",function(a){for(var a=a.rows,b={},c=0,d=a.length;c<d;++c)b[a[c].attribute]=
JSON.parse(a[c].value);i(null,{error:!1,object:{result:b}})},m)},m)})}else this.apiRequestPlain("loginFull",[a,b,c],i)};i.populateLoginResult=function(){g.apply(this,arguments)};i.setToken=function(a,b,d){m=a;d!==!1&&c.call(this,function(a,c){WiziCore_Helper.callCallback(b,[c])})};i.getToken=function(){return m};i.error=function(){return o};i.setDataAgentParam=function(a,b,c){var d=!1,e;for(e in k)if(k[e].dataAgent==a&&k[e].name==b)k[e].value=c,d=!0;d||k.push({dataAgent:a,name:b,value:c})};i.getDataAgentParams=
function(){return k};i.sendEmail=function(a,b){this.apiRequest("sendEmail",[a],function(a,c){h(c,b,AC.Core.lang().tr("usercode_send_email_error_text"),!0)})};i.sendEmailTest=function(a,b,c){this.apiRequest("sendTestEmail",[a,b],function(a,b){h(b,c)})};i.getAccountFeatures=function(a){this.apiRequestPlain("getAccountFeatures",[],function(b,c){WiziCore_Helper.callCallback(a,[c.error,c.object.result])})};i.executeFunction=function(a,b,c,d,e){var i=this;this.apiRequest("executeFunctionV2",[a,d,e],function(a,
e){var f=e.object.result,m=e.error;if(m)WiziCore_Helper.callCallback(b,[m,e.object]);else{var o=f.taskId,k=f.url;$.browser.msie&&(k=k.replace(/^https*:\/\//,document.location.protocol=="https:"?"https://":"http://"));var h=!1,l={},n,j;i.context().serverEvents().registerHandler(o,k,function(a){switch(a.type){case "result":var e=a.data,f=null,m=!0;if(e){m=!1;f=e[1];if(window.console&&window.console.log)for(var g=0,t=f.length;g<t;++g)console.log("Server message: "+f[g]);f=e[0];e=e[2];if(e!=null&&$.isArray(e)){g=
0;for(t=e.length;g<t;++g)e[g]in l||(l[e[g]]=1)}}a.error&&(f=a.error instanceof Object&&a.error.message,window.console&&window.console.log&&window.console.log('Method "'+d+'" call error:'+JSON.stringify(f)));WiziCore_Helper.callCallback(b,[m,f]);n=h=!0;for(j in l)if(l[j]){n=!1;break}n&&i.context().serverEvents().unregisterHandler(o,k);break;case "async_result":e=a.id;l[e]=0;n=!1;if(h)for(j in n=!0,l)if(l[j]){n=!1;break}n&&i.context().serverEvents().unregisterHandler(o,k);f=m=null;a.data?f=a.data:m=
a.error;WiziCore_Helper.callCallback(c,[e,m,f])}})}});e=null};i.printApp=function(a,b,c){var d=this;this.apiRequest("printAppV2",[a,b],function(a,b){var e=b.object.result,i=b.error,e=e?e:null;if(i)WiziCore_Helper.callCallback(c,[i,e]);else{var f=e.taskId,m=e.url;d.context().serverEvents().registerHandler(f,m,function(a){if(a.type=="result"){d.context().serverEvents().unregisterHandler(f,m);var b=a.data,e=null,i=!0;if(b)i=!1,e=b.url;a.error&&(e=a.error instanceof Object&&a.error.message);WiziCore_Helper.callCallback(c,
[i,e])}})}});b=null};i.dumpZipApp=function(a,b){var c=this.context().config().serverUrl()+"dumpZipApp.php?appId="+a+"&session="+m;b===!0&&(c+="&debug=true");window.open(c)};i.translateText=function(a,b){this.apiRequest("translateText",[a],function(a,c){WiziCore_Helper.callCallback(b,[c.error,c.object.result])})};i.getOrLoadNotificationServiceUrl=function(a){typeof a=="function"&&(l!=null?a(!1,l):this.apiRequest("getUserNotificationServiceUrl",[],function(b,c){var d=c.object.result;c.error?a(!0):(l=
d,a(!1,l))}))};return j}();WiziCore_Api_SessionRequester.onCreated="Events#WiziCore_Api_SessionRequester#Created";WiziCore_Api_SessionRequester.onLiveLogin="Events#WiziCore_Api_SessionRequester#onLiveLogin";
var WiziCore_Api_UserRequester=WiziCore_Api_Base.extend({_users:null,_userGroups:null,_currUser:null,init:function(a){this._super(a);this._users={};this._context=a},createUser:function(a,b){var c=this;this.apiRequest("createUser",[a],function(a,e){c.onUserCreated(e,b)})},onUserCreated:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d);$(this).trigger(WiziCore_Api_UserRequester.onCreated,[c,d])},setPassword:function(a,b,c){var d=this;this.apiRequest("setPassword",[a,b],function(a,
b){d.onPasswordSets(b,c)})},onPasswordSets:function(a,b){var c=a.error,d=a.object;b!=void 0&&typeof b=="function"&&b(c,d)},setMyPassword:function(a,b,c){var d=this;this.apiRequest("setMyPassword",[a,b],function(a,b){d.onMyPasswordSets(b,c)})},onMyPasswordSets:function(a,b){var c=a.error,d=a.object;b!=void 0&&typeof b=="function"&&b(c,d)},registerUser:function(a,b,c,d){var e=this;this.apiRequest("registerUser",[a,b,c],function(a,b){e.onUserRegister(b,d)})},onUserRegister:function(a,b){var c=a.error,
d=a.object;typeof b=="function"&&b(c,d);$(this).trigger(WiziCore_Api_UserRequester.onUserRegister,[c,d])},deleteUser:function(a,b){var c=this;this.apiRequest("deleteUser",[a],function(a,e){c.onUserDeleted(e,b)})},onUserDeleted:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d);$(this).trigger(WiziCore_Api_UserRequester.onDeleted,[c,d])},saveUser:function(a,b){var c=this;this.apiRequest("saveUser",[a],function(a,e){c.onUserSaved(e,b)})},onUserSaved:function(a,b){var c=a.error,d=a.object;
typeof b=="function"&&b(c,d);$(this).trigger(WiziCore_Api_UserRequester.onSaved,[c,d])},loadUserList:function(a,b){var c=this;this.apiRequest("getUsers",[a],function(d,e){c.onUserListLoaded(e,a==void 0,b)})},onUserListLoaded:function(a,b,c){var d=a.object,d=(a=a.error||d.result==null)?[]:d.result;a&&acDebugger.systemLog("users::here");b&&(this._users=d);WiziCore_Helper.callCallback(c,[a,d]);$(this).trigger(WiziCore_Api_UserRequester.onListLoaded,[d])},loadUser:function(a){var b=this;this.apiRequest("getUser",
[a],function(a,d){b.onUserLoaded(d)})},loadUserBySession:function(a){var b=this;this.apiRequest("getUserBySessionId",[],function(c,d){b.onUserLoaded(d,a)})},onUserLoaded:function(a,b){var c=a.object;this._users=[];a.error==!0||c.result==null?acDebugger.systemLog("users::here"):this._currUser=c.result;c=a.error==!0||c.error!=null;typeof b=="function"&&b(c,this._currUser);$(this).trigger(WiziCore_Api_UserRequester.onLoaded,[c,this._currUser])},getMemberOf:function(a,b){var c=this;this.apiRequest("getMemberOf",
[a],function(a,e){c.onGetMemberOf(e,b)})},onGetMemberOf:function(a,b){WiziCore_Helper.callCallback(b,[a.error,a.object]);$(this).trigger(WiziCore_Api_UserRequester.onGetMemberOf,[a.error,a.object])},getCaptcha:function(a,b,c,d,e,f){var g=this;this.apiRequest("getCaptcha",[a,b,c,d,e],function(a,b){g.onGetCaptcha(b,f)})},onGetCaptcha:function(a,b){typeof b=="function"&&b(a.error,a.object)},userList:function(){if(this._users==null)this._users={};return this._users},currUser:function(){if(this._currUser==
null)this._currUser={};return this._currUser},isUserLoaded:function(a){return this.getUserById(a)!=void 0?!0:!1},getUserById:function(a){for(var b=this.userList(),c=null,d=0,e=b.length;d<e;d++)if(b[d].id==a){c=b[d];break}return c},checkUserDisabling:function(a,b,c){var d=this;this.apiRequest("checkUserDisabling",[a,b],function(a,b){d.onCheckUserDisabling(b,c)})},onCheckUserDisabling:function(a,b){WiziCore_Helper.callCallback(b,[a.error,a.object])},getUserStatistics:function(a,b,c){var d=this;this.apiRequest("getUserStatistics",
[a,b],function(a,b){d.onGetUserStatistics(b,c)})},onGetUserStatistics:function(a,b){WiziCore_Helper.callCallback(b,[a.error,a.object]);$(this).trigger(WiziCore_Api_UserRequester.onGetUserStatistics,[a.error,a.object])}});WiziCore_Api_UserRequester.onListLoaded="Events#WiziCore_Api_UserRequester#ListLoaded";WiziCore_Api_UserRequester.onCreated="Events#WiziCore_Api_UserRequester#User#Created";WiziCore_Api_UserRequester.onDeleted="Events#WiziCore_Api_UserRequester#User#Deleted";
WiziCore_Api_UserRequester.onSaved="Events#WiziCore_Api_UserRequester#User#Saved";WiziCore_Api_UserRequester.onLoaded="Events#WiziCore_Api_UserRequester#User#Loaded";WiziCore_Api_UserRequester.onGetMemberOf="Events#WiziCore_Api_UserRequester#User#onGetMemberOf";WiziCore_Api_UserRequester.onUserRegister="Events#WiziCore_Api_UserRequester#User#onUserRegister";WiziCore_Api_UserRequester.onGetUserStatistics="Events#WiziCore_Api_UserRequester#User#onGetUserStatistics";WiziCore_Api_UserRequester.USER="u";
WiziCore_Api_UserRequester.SYSTEM_USER_TYPE="developer";WiziCore_Api_UserRequester.APP_USER_TYPE="app";
var WiziCore_Api_CordovaBuildRequester=WiziCore_Api_Base.extend({init:function(a){this._super(a)},getCordovaBuildApps:function(a){var b=this;this.apiRequest("getCordovaBuildApps",[],function(c,d){b.onGetCordovaBuildApps(d,a)})},onGetCordovaBuildApps:function(a,b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},initBuildByFileId:function(a,b,c){var d=this;this.apiRequest("initCordovaBuildByFileId",[a,b],function(a,b){d.onInitBuildByFileId(b,c)})},onInitBuildByFileId:function(a,
b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},appBuildsList:function(a,b){var c=this;this.apiRequest("getCordovaAppBuildsList",[a],function(a,e){c.onAppBuildsList(e,b)})},onAppBuildsList:function(a,b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},getCordovaBuildConfig:function(a,b){var c=this;this.apiRequest("getCordovaBuildConfig",[a],function(a,e){c.onGetCordovaBuildConfig(e,b)})},onGetCordovaBuildConfig:function(a,b){var c=a.error,
d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},saveCordovaBuildConfig:function(a,b,c){var d=this;this.apiRequest("saveCordovaBuildConfig",[a,b],function(a,b){d.onSaveCordovaBuildConfig(b,c)})},onSaveCordovaBuildConfig:function(a,b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},acAppBuildsList:function(a,b){var c=this;this.apiRequest("getCordovaAcAppBuildsList",[a],function(a,e){c.onGetCordovaAcAppBuildsList(e,b)})},onGetCordovaAcAppBuildsList:function(a,
b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},getCordovaUploadCertificateUrl:function(a){var b=this;this.apiRequest("getCordovaUploadCertificateUrl",[],function(c,d){b.onGetCordovaUploadCertificateUrl(d,a)})},onGetCordovaUploadCertificateUrl:function(a,b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},getCordovaCertificateLink:function(a,b){var c=this;this.apiRequest("getCordovaCertificateLink",[a],function(a,e){c.onGetCordovaCertificateLink(e,
b)})},onGetCordovaCertificateLink:function(a,b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},generateCordovaCertificate:function(a,b,c){var d=this;this.apiRequest("generateCordovaCertificate",[a,b],function(a,b){d.onGenerateCordovaCertificate(b,c)})},onGenerateCordovaCertificate:function(a,b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},getCordovaIOSRequests:function(a){var b=this;this.apiRequest("getCordovaIOSRequests",[],function(c,
d){b.onGetCordovaIOSRequests(d,a)})},onGetCordovaIOSRequests:function(a,b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},cancelCordovaIOSRequest:function(a,b){var c=this;this.apiRequest("cancelCordovaIOSRequest",[a],function(a,e){c.onCancelCordovaIOSRequest(e,b)})},onCancelCordovaIOSRequest:function(a,b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},getCordovaCertificateList:function(a){var b=this;this.apiRequest("getCordovaCertificateList",
[],function(c,d){b.onGetCordovaCertificateList(d,a)})},onGetCordovaCertificateList:function(a,b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},deleteCordovaCertificate:function(a,b){var c=this;this.apiRequest("deleteCordovaCertificate",[a],function(a,e){c.onDeleteCordovaCertificate(e,b)})},onDeleteCordovaCertificate:function(a,b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},deleteApp:function(a,b){var c=this;this.apiRequest("deleteCordovaApp",
[a],function(a,e){c.onDeleteApp(e,b)})},onDeleteApp:function(a,b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},buildInitedApp:function(a,b,c){var d=this;this.apiRequest("buildCordovaInitedApp",[a,b],function(a,b){d.onBuildInitedApp(b,c)})},onBuildInitedApp:function(a,b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},buildAcApp:function(a,b,c,d){var e=this;this.apiRequest("buildCordovaAcApp",[a,b,c],function(a,b){e.onBuildCordovaAcApp(b,
d)})},onBuildCordovaAcApp:function(a,b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},rebuildBuild:function(a,b,c){var d=this;this.apiRequest("rebuildCordovaBuild",[a,b],function(a,b){d.onRebuildBuild(b,c)})},onRebuildBuild:function(a,b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},createAppAndGetUploadTicket:function(a,b){var c=this;this.apiRequest("createCordovaAppAndGetUploadTicket",[a],function(a,e){c.onCreateAppAndGetUploadTicket(e,
b)})},onCreateAppAndGetUploadTicket:function(a,b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)},getUploadTicket:function(a){var b=this;this.apiRequest("getCordovaUploadTicket",[],function(c,d){b.onGetUploadTicket(d,a)})},onGetUploadTicket:function(a,b){var c=a.error,d=c==!1?a.object.result:a.object;typeof b=="function"&&b(c,d)}}),WiziCore_Api_UserSettingsRequester=WiziCore_Api_Base.extend({_settings:null,_isLoad:!1,init:function(a){this._super(a);this._settings={}},
loadSettings:function(a){var b=this;this.apiRequest("getUserSettings",[],function(c,d){b.onSettingsLoaded(d,a)})},onSettingsLoaded:function(a,b){var c=a.error,d=a.object;if(a.error!=!0)this._settings=d.result||{},this._isLoad=!0;typeof b=="function"&&b(c,this._settings);$(this).trigger(WiziCore_Api_UserSettingsRequester.onLoad,[c,this._settings])},saveSettings:function(){var a=this;this.apiRequest("saveUserSettings",[this._settings],function(b,c){a.onSettingsSaveded(c)})},onSettingsSaveded:function(a){var b=
a.error,c=a.object;if(a.error!=!0)this._settings=c.result;$(this).trigger(WiziCore_Api_UserSettingsRequester.onSave,[b,this._settings])},settings:function(a){if(a!=void 0)this._settings=a;return this._settings},settingsSection:function(a,b){b!==void 0&&(this._settings[a]=b);this._settings[a]==void 0&&(this._settings[a]={});return this._settings[a]},settingsSectionParam:function(a,b,c){a=this.settingsSection(a);c!=void 0&&(a[b]=c);return a[b]},isLoad:function(){return this._isLoad}});
WiziCore_Api_UserSettingsRequester.onLoad="Events#WiziCore_Api_UserSettingsRequester#Load";WiziCore_Api_UserSettingsRequester.onSave="Events#WiziCore_Api_UserSettingsRequester#Save";
var WiziCore_Api_QueryRequester=WiziCore_Api_Base.extend({_queries:null,_connFolders:null,init:function(a){this._super(a);this._queries={}},createQuery:function(a){if(a===void 0)throw new WiziCore_Api_Error("Need query",WiziCore_Api_Error.ERR_NEED_OBJECT);var b=this;this.apiRequest("createQuery",[a],function(a,d){b.onQueryCreated(d)})},onQueryCreated:function(a){var b=a.object,c=null;a.error||(c=new WiziCore_Api_Query,c.json(b.result),this.queries()[c.queryId()]=c);$(this).trigger(WiziCore_Api_QueryRequester.onCreated,
[a.error,c])},saveQuery:function(a,b){if(this.queries()[a]===void 0)throw new WiziCore_Api_Error("Need query",WiziCore_Api_Error.ERR_NEED_OBJECT);this.saveQueryJson(this.queries()[a].json(),b)},saveQueryJson:function(a,b){var c=this;this.apiRequest("saveQuery",[a],function(a,e){c.onQuerySaved(e,b)})},onQuerySaved:function(a,b){var c=null,d=a.object,e=a.error;e==!0?c=a:(c=new WiziCore_Api_Query,c.json(d.result),this.queries()[c.queryId()]!==void 0?c=this.queries()[c.queryId()]:this.queries()[c.queryId()]=
c);typeof b=="function"&&b(e,c);$(this).trigger(WiziCore_Api_QueryRequester.onSaved,[e,c])},deleteQuery:function(a){if(this.queries()[a]===void 0)throw new WiziCore_Api_Error("Need query",WiziCore_Api_Error.ERR_NEED_OBJECT);var b=this;this.apiRequest("deleteQuery",[a],function(c,d){d.error!=!0&&delete b.queries()[a];b.onQueryDeleted(d)})},onQueryDeleted:function(a){$(this).trigger(WiziCore_Api_QueryRequester.onDeleted,[a.error])},loadQueryList:function(a){var b=this;this.apiRequest("getUserQueries",
[],function(c,d){b.onQueryListLoaded(d,a)})},onQueryListLoaded:function(a,b){var c=a.object?a.object.result:{},d=a.error;if(!d){this._queries={};for(var e in c){var f=new WiziCore_Api_Query;f.json(c[e]);this.queries()[f.queryId()]=f}}WiziCore_Helper.callCallback(b,[d,this.queries()])},loadQuery:function(a,b){if(a===void 0)throw new WiziCore_Api_Error("Need query identificator",WiziCore_Api_Error.ERR_NEED_OBJECT);var c=this;this.apiRequest("getQuery",[a],function(a,e){c.onQueryLoaded(e,b)})},onQueryLoaded:function(a,
b){var c=a.object,d=a.error,e=null;d||(e=new WiziCore_Api_Query,e.json(c.result),this.queries()[e.queryId()]=e);$(this).trigger(WiziCore_Api_QueryRequester.onLoaded,[d,e]);try{var f=d;d||(f=c.error!=void 0&&c.error!=null?!0:!1);WiziCore_Helper.callCallback(b,[f,e])}catch(g){}},loadQueryFolderList:function(a){var b=this;this.context().folders().loadFolderList(WiziCore_Api_FoldersRequester.QUERY,void 0,function(c,d){b._connFolders=d;WiziCore_Helper.callCallback(a,[c,b._connFolders])})},createQueryFolder:function(a){var b=
this,c=this.context().folders();$(c).one(WiziCore_Api_FoldersRequester.onCreated+WiziCore_Api_FoldersRequester.QUERY,function(a,c,f){b.onQueryFolderCreated(c,f)});c.createFolder(WiziCore_Api_FoldersRequester.QUERY,a)},onQueryFolderCreated:function(a,b){$(this).trigger(WiziCore_Api_QueryRequester.onFolderCreated,[a,b])},deleteQueryFolder:function(a,b){var c=this,d=this.context().folders();$(d).one(WiziCore_Api_FoldersRequester.onDeleted+WiziCore_Api_FoldersRequester.QUERY,function(a,b,d){c.onQueryFolderDeleted(b,
d)});d.deleteFolder(WiziCore_Api_FoldersRequester.QUERY,a,b)},onQueryFolderDeleted:function(a,b){$(this).trigger(WiziCore_Api_QueryRequester.onFolderDeleted,[a,b])},saveQueryFolder:function(a){var b=this,c=this.context().folders();$(c).one(WiziCore_Api_FoldersRequester.onSaved+WiziCore_Api_FoldersRequester.QUERY,function(a,c,f){b.onFormFolderSaved(c,f)});c.saveFolder(WiziCore_Api_FoldersRequester.QUERY,a)},onFormFolderSaved:function(a,b){$(this).trigger(WiziCore_Api_QueryRequester.onFolderSaved,[a,
b])},queries:function(){if(this._queries==null)this._queries={};return this._queries},getDatasourceByName:function(a){for(var b in this.queries()){var c=this.queries()[b].getDatasource(a);if(c!==null)return c}return null},nameExists:function(a,b){var c=this.queries(),d=0,e=!1,f;for(f in c)if(d++,c[f]._name===a){e=!0;break}d>0?typeof b==="function"&&b(e):this.loadQueryList(function(c,d){if(typeof b==="function"){var e=0,i=!1,f;for(f in d)if(e++,d[f]._name===a){i=!0;break}b(e>0?i:!1)}})},getLastDataUrl:function(a,
b){if(typeof b=="function"){var c=this;this.apiRequest("getLastDataUrl",[a],function(a,e){c.onDataUrlLoaded(e,b)})}},generateDataUrl:function(a,b){if(typeof b=="function"){var c=this;this.apiRequest("generateDataUrl",[a],function(a,e){c.onDataUrlLoaded(e,b)})}},onDataUrlLoaded:function(a,b){var c=a.object;a.error?b(c):b(null,c.result)}});WiziCore_Api_QueryRequester.onLoaded="Events#WiziCore_Api_QueryRequester#onLoaded";WiziCore_Api_QueryRequester.onSaved="Events#WiziCore_Api_QueryRequester#onSaved";
WiziCore_Api_QueryRequester.onCreated="Events#WiziCore_Api_QueryRequester#onCreated";WiziCore_Api_QueryRequester.onDeleted="Events#WiziCore_Api_QueryRequester#onDeleted";WiziCore_Api_QueryRequester.onFolderCreated="Events#WiziCore_Api_QueryRequester#Folder#Created";WiziCore_Api_QueryRequester.onFolderDeleted="Events#WiziCore_Api_QueryRequester#Folder#Deleted";WiziCore_Api_QueryRequester.onFolderSaved="Events#WiziCore_Api_QueryRequester#Folder#Saved";
AC.WidgetPluginManager=function(){function a(a){a&&a.indexOf("://")==-1&&a.indexOf(d)!=0&&(a.indexOf("wiziCore/extWidgets")==-1&&(a="wiziCore/extWidgets/"+a),a=d+a);return a}function b(a,b,c,d){var e=a,f={};typeof a=="string"&&(e=AC.Widgets[a]?AC.Widgets[a]:window[a]);d=d==void 0?!1:d;e=AC.initClass(e);if(e!=void 0)try{typeof e[b]=="function"?f=d?e[b]:e[b](c):typeof e.capabilities=="function"&&e.capabilities()[b]!==void 0&&(f=typeof e.capabilities()[b]=="function"?d?e.capabilities()[b]:e.capabilities()[b](c):
e.capabilities()[b])}catch(h){acDebugger.systemLog1("widgetPluginManager :: "+a+" :: "+b+" :: "+c,h)}else acDebugger.systemLog1("widgetPluginManager :: "+a+" :: "+b+" :: "+c);return f}var c=function(){this.init.apply(this,arguments)},d=WiziCore_AppContext.getInstance().config().staticUrl();AC.extend(c,WiziCore_Api_Base);var e=c.prototype,f=null,g=null,h=null;e.init=function(){g={};f={}};e.createWidgetWithDefaultProps=function(a,b,c,d){var e=this.getDefaultWidgetProperties(a),f=null;try{AC.Widgets[a]&&
typeof AC.Widgets[a].beforeInit=="function"&&AC.Widgets[a].beforeInit(c),AC.initClass(AC.Widgets[a]),f=new AC.Widgets[a]({project:e,mode:b,form:c,page:d})}catch(h){acDebugger.systemLog1("widgetPluginManager:createWidget",h),f=null}return f};e.getAvailableWidgetProperties=function(a){return b.call(this,a,"props")};e.getEmptyWidgetProperties=function(a){return b.call(this,a,"emptyProps")};e.getDefaultWidgetProperties=function(a){return $.extend(!0,{},b.call(this,a,"defaultProps"))};e.getWidgetActions=
function(a){return b.call(this,a,"actions")};e.getWidgetLangs=function(a){return b.call(this,a,"langs")};e.getInlineEditPropName=function(a){return b.call(this,a,"inlineEditPropName")};e.getContainerType=function(a){return b.call(this,a,"containerType")};e.getIsField=function(a){return b.call(this,a,"isField")};e.getWidgetResizeProperties=function(a){return b.call(this,a,"resizeProperties")};e.calculateWidgetProperties=function(a,c,d){a=b.call(this,a,"calculateProps",void 0,!0);typeof a=="function"&&
(d=a(c,d));return d};e.registerWidget=function(b,c,d,e,k,h,n){f[c]==void 0&&(f[c]=[]);var r=g.length,n=n!==!1,h=a(h),d={className:b,icon:d,descr:e,uid:r,section:c,cssClass:k,toolIcon:h,visible:n};g[b]=d;window[b]&&!AC.Widgets[b]&&(AC.Widgets[b]=window[b]);AC.Widgets[b]&&f[c].push(d)};e.deregisterWidget=function(a){g[a]&&delete g[a];var b,c,d,e;for(b in f){e=f[b];for(d=0,c=e.length;d<c;++d)try{e[d].className==a&&e.splice(d,1)}catch(h){}}};e.registerExWidgets=function(){var a=h;if(a!=null)for(var b in a)this.registerWidget(a[b].className,
a[b].section,a[b].icon,a[b].descr,a[b].cssClass,a[b].toolIcon,a[b].visible)};e.registerExWidget=function(b,c,d,e,f){h=h||[];f=a(f);h.push({className:b,section:c,icon:d,descr:e,cssClass:null,toolIcon:f})};e.widgets=function(){return f};e.widgetsOrderArray=function(){return"widget_cat_common,widget_cat_mobile,widget_cat_adv,widget_cat_auth,widget_cat_cont,widget_cat_chart,widget_cat_gauge,sections_extensible,widget_cat_beta,widget_cat_deprecated".split(",")};return new c};
var WiziCore_Api_ResourceRequester=WiziCore_Api_Base.extend({_resources:null,_resourceFolders:null,init:function(a){this._super(a);this._resources=null;this._context=a},createResourceByTicket:function(a){var b=this;this.apiRequest("uploadResourceByTicket",[a],function(a,d){b.onResourceCreated(d,WiziCore_Api_ResourceRequester.onCreatedByTicket)})},createResourceByUrl:function(a){var b=this;this.apiRequest("uploadResourceByUrl",[a],function(a,d){b.onResourceCreated(d,WiziCore_Api_ResourceRequester.onCreatedByUrl)})},
createResource:function(a,b){this.apiRequest("createResource",[a],function(a,d){WiziCore_Helper.callCallback(b,[d.error,d.object])})},createResourceClone:function(a,b,c){this.apiRequest("uploadResourceClone",[a,b],function(a,b){WiziCore_Helper.callCallback(c,[b.error,b.object])})},onResourceCreated:function(a,b){var c=a.error,d=a.object;$(this).trigger(b,[c,d])},loadResourceList:function(a,b){var c=this,d=!b||b.typeFilter==void 0?!0:!1;this.apiRequest("getUserResources",[b],function(b,f){c.onResourceListLoaded(f,
d,a)})},onResourceListLoaded:function(a,b,c){var d=a.object,a=a.error||!d||!d.result?!0:!1;if(!a){for(var e={},f=0,g=d.result.length;f<g;f++){var h=d.result[f];e[h.id_resource]=h}if(b)this._resources={};this._resources=$.extend(this._resources,e)}WiziCore_Helper.callCallback(c,[a,e])},loadResourceFolderList:function(a){var b=this;this.context().folders().loadFolderList(WiziCore_Api_FoldersRequester.RESOURCE,void 0,function(c,d){b._resourceFolders=d;WiziCore_Helper.callCallback(a,[c,d])})},createResourceFolder:function(a){var b=
this,c=this.context().folders();$(c).one(WiziCore_Api_FoldersRequester.onCreated+WiziCore_Api_FoldersRequester.RESOURCE,function(a,c,f){b.onResourceFolderCreated(c,f)});c.createFolder(WiziCore_Api_FoldersRequester.RESOURCE,a)},onResourceFolderCreated:function(a,b){$(this).trigger(WiziCore_Api_ResourceRequester.onFolderCreated,[a,b])},deleteResourceFolder:function(a,b){var c=this,d=this.context().folders();$(d).one(WiziCore_Api_FoldersRequester.onDeleted+WiziCore_Api_FoldersRequester.RESOURCE,function(a,
b,d){c.onResourceFolderDeleted(b,d)});d.deleteFolder(WiziCore_Api_FoldersRequester.RESOURCE,a,b)},onResourceFolderDeleted:function(a,b){$(this).trigger(WiziCore_Api_ResourceRequester.onFolderDeleted,[a,b])},saveResourceFolder:function(a){var b=this,c=this.context().folders();$(c).one(WiziCore_Api_FoldersRequester.onSaved+WiziCore_Api_FoldersRequester.RESOURCE,function(a,c,f){b.onResourceFolderSaved(c,f)});c.saveFolder(WiziCore_Api_FoldersRequester.RESOURCE,a)},onResourceFolderSaved:function(a,b){$(this).trigger(WiziCore_Api_ResourceRequester.onFolderSaved,
[a,b])},deleteResource:function(a,b){var c=this;this.apiRequest("deleteResource",[a],function(a,e){c.onResourceDeleted(e,b)})},onResourceDeleted:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d);$(this).trigger(WiziCore_Api_ResourceRequester.onDelete,[c,d])},loadResource:function(a,b){var c=this;this.apiRequest("getResource",[a],function(a,e){c.onResourceLoaded(e,b)})},onResourceLoaded:function(a,b){var c=a.error,d=a.object;if(c==!1){if(this._resources==void 0)this._resources={};
this._resources[d.result.id_resource]=d.result}typeof b=="function"&&b(c,d);$(this).trigger(WiziCore_Api_ResourceRequester.onLoaded,[c,d])},saveResource:function(a,b){var c=this;this.apiRequest("saveResource",[a],function(a,e){c.onResourceSaved(e,b)})},onResourceSaved:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d.result);$(this).trigger(WiziCore_Api_ResourceRequester.onSaved,[c,d.result])},parseResource:function(a,b,c){var d=this;this.apiRequest("parseResource",[a,b],function(a,
b){d.onResourceParsed(b,c)})},onResourceParsed:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d)},resourceList:function(){if(this._resources===null)this._resources={};return this._resources},getListResource:function(a,b){var c=this;this.apiRequest("getListResource",[a],function(a,e){c.onDataReceived(e,b)})},updateListResource:function(a,b){var c=this;this.apiRequest("updateListResource",[a],function(a,e){c.onDataReceived(e,b)})},onDataReceived:function(a,b){WiziCore_Helper.callCallback(b,
[a.error,a.object?a.object.result:null])},nameExists:function(a,b){var c=this.resourceList(),d=0,e=!1,f;for(f in c)if(d++,c[f].name===a){e=!0;break}d>0?typeof b==="function"&&b(e):this.loadResourceList(function(c,d){if(typeof b==="function"){var e=0,i=!1,f;for(f in d)if(e++,d[f].name===a){i=!0;break}b(e>0?i:!1)}})},runReport:function(a,b,c,d,e){var f=this;this.apiRequest("runReportV2",[a,b,c,d],function(a,b){f.onReportJobAdded(b,e)})},onReportJobAdded:function(a,b){var c=a.object,d=null,e=null,f=
null;a.error==!0?(d=c,typeof b=="function"&&b(!0)):(e=c.result.taskId,f=c.result.url);typeof b=="function"&&b(d,e,f)}});WiziCore_Api_ResourceRequester.ErrorFolderEmpty="folder is not empty";WiziCore_Api_ResourceRequester.onCreatedByUrl="E#Resources#CreatedByUrl";WiziCore_Api_ResourceRequester.onCreatedByTicket="E#Resources#CreatedByTicket";WiziCore_Api_ResourceRequester.onDelete="E#Resources#Deleted";WiziCore_Api_ResourceRequester.onLoaded="E#Resources#Resource#Loaded";
WiziCore_Api_ResourceRequester.onSaved="E#Resources#Saved";WiziCore_Api_ResourceRequester.onFolderCreated="E#Resources#Folder#Create";WiziCore_Api_ResourceRequester.onFolderSaved="E#Resources#Folder#Save";WiziCore_Api_ResourceRequester.onFolderDeleted="E#Resources#Folder#Delete";WiziCore_Api_ResourceRequester.onFolderOrItemMoved="E#Resources#FolderOrItem#Moved";
WiziCore_Api_ResourceRequester.FileType={UNKNOWN:"unknown",IMAGE:"image",VIDEO:"video",AUDIO:"audio",DOCUMENT:"doc",TABLE:"table",DATA:"data",ARCHIVE:"archive",REPORT:"report",MAILMERGE:"mailmerge"};
var WiziCore_Api_ReportJobStatusesRequester=function(){function a(a,b,c){a.apiRequest("getReportJobStatuses",[b],function(a,b){var d=b.error,e=b.object,f=d?null:e.result;typeof c=="function"&&c(d?e:null,f)})}function b(d,e){var h=[],j;for(j in e)e.hasOwnProperty(j)&&h.push(j);a(d,h,function(a,m){var o;if(a)for(var k=0,l=h.length;k<l;++k){var n=h[k];n in e&&(o=e[n],typeof o=="function"&&o({status:WiziCore_Api_ReportJobStatusesRequester.Status.ERROR}),delete e[n])}else for(l in k={},k[WiziCore_Api_ReportJobStatusesRequester.Status.READY]=
!0,k[WiziCore_Api_ReportJobStatusesRequester.Status.ERROR]=!0,m)n=m[l],l in e&&n.status in k&&(o=e[l],typeof o=="function"&&o(n),delete e[l]);o=!0;for(var j in e)if(e.hasOwnProperty(j)){o=!1;break}o||setTimeout(function(){b(d,e)},c)})}var c=5E3,d=function(){this.init.apply(this,arguments)};AC.extend(d,WiziCore_Api_Base);var e=d.prototype;e.init=function(){d._sc.init.apply(this,arguments);this._jobIdsToCheck={}};e.addJobId=function(a,c){var d=!0,e;for(e in this._jobIdsToCheck)if(this._jobIdsToCheck.hasOwnProperty(e)){d=
!1;break}this._jobIdsToCheck[a]=c;d&&b(this,this._jobIdsToCheck)};e.removeJobId=function(a){a in this._jobIdsToCheck&&delete this._jobIdsToCheck[a]};return d}();WiziCore_Api_ReportJobStatusesRequester.Status={PROCESSING:"processing",READY:"ready",ERROR:"error"};
AC.NotificationConnection=function(a){function b(i){var m={debug:acDebugger.systemLogMode()};if("sockjs_protocols_whitelist"in AC)m.protocols_whitelist=AC.sockjs_protocols_whitelist;m=new SockJS(i._notificationServiceUrl,null,m);i._sockJs=m;acDebugger.systemLog(new Date+" created SockJS object");m.onopen=function(){acDebugger.systemLog(new Date+" SockJS opened");c(i);i._currentId=0;i._lastHeartbeat=new Date;i._heartbeatIntervalId=setInterval(function(){var a=(new Date).getTime(),b=i._lastHeartbeat.getTime();
a-b>f&&(acDebugger.systemLog(new Date+" heartbeat timeout, sockjs state="+i._sockJs.readyState),i._sockJs.readyState!==SockJS.CLOSED&&(acDebugger.systemLog(new Date+" closing on heartbeat timeout"),i._sockJs.close()))},g);for(var a in i._notificationHandlers)acDebugger.systemLog(new Date+" onopen: sending pending subscriptions"),d(i,a,"subscribe")};m.onheartbeat=function(){i._lastHeartbeat=new Date};m.onerror=function(a){acDebugger.systemLog(a)};m.onclose=function(a){acDebugger.systemLog(new Date+
" onclose "+JSON.stringify(a));i._sockJs=null;clearInterval(i._heartbeatIntervalId);i._pendingResponses={};c(i);$.isEmptyObject(i._notificationHandlers)||setTimeout(function(){b(i)},e)};m.onmessage=function(b){var d=JSON.parse(b.data),b=d._msgId;if(b!==a){if(acDebugger.systemLog(new Date+" got confirm"),delete i._pendingResponses[b],$.isEmptyObject(i._pendingResponses)&&$.isEmptyObject(i._notificationHandlers))acDebugger.systemLog(new Date+" got last unsubscribe confirm"),c(i),i._lastCloseTimeoutId=
setTimeout(function(){acDebugger.systemLog(new Date+" close timeout");$.isEmptyObject(i._pendingResponses)&&$.isEmptyObject(i._notificationHandlers)&&(acDebugger.systemLog(new Date+" before close: SockJS state="+i._sockJs.readyState),i._sockJs.readyState!==SockJS.CLOSED&&!AC.debug_sockjs_noclose&&i._sockJs.close())},j)}else{acDebugger.systemLog(new Date+" got message");var e=d.id,b=d.data,d=d.notificationId;if(d!=null){e in h||(h[e]={});var f=h[e];if(d in f)return;else f[d]=new Date}e=i._notificationHandlers[e];
typeof e=="function"&&(acDebugger.systemLog(new Date+" calling handler"),e(b))}}}function c(a){a._lastCloseTimeoutId&&clearTimeout(a._lastCloseTimeoutId);a._lastCloseTimeoutId=null}function d(a,b,d){c(a);b=JSON.stringify({id:b,type:d,_msgId:a._currentId});a._pendingResponses[a._currentId]=1;++a._currentId;a._sockJs.send(b)}var e=2E3,f=3E4,g=1E4,h={},j=5E3;setInterval(function(){for(var a in h){var b=h[a],c;for(c in b){var d=(new Date).getTime(),e=b[c].getTime();d-e>6E5&&delete b[c];$.isEmptyObject(b)&&
delete h[a]}}},3E5);var i=function(a){this._notificationServiceUrl=a;this._sockJs=null;this._notificationHandlers={};this._currentId=0;this._pendingResponses={};this._lastCloseTimeoutId=this._heartbeatIntervalId=this._lastHeartbeat=null},m=i.prototype;m.subscribe=function(a,c){this._notificationHandlers[a]=c;acDebugger.systemLog(new Date+" added subscription handler");this._sockJs==null?b(this):this._sockJs.readyState===SockJS.OPEN&&(acDebugger.systemLog(new Date+" sending subscription message immediately "+
a),d(this,a,"subscribe"))};m.unsubscribe=function(a){delete this._notificationHandlers[a];acDebugger.systemLog(new Date+" removed subscription handler");this._sockJs!=null&&this._sockJs.readyState===SockJS.OPEN&&(acDebugger.systemLog(new Date+" sending unsubscription message immediately "+a),d(this,a,"unsubscribe"))};return i}();
var WiziCore_Api_ServerEvents=function(){function a(a,b){b in a._notificationConnections||(a._notificationConnections[b]=new AC.NotificationConnection(b));return a._notificationConnections[b]}var b=function(){this.init.apply(this,arguments)};AC.extend(b,WiziCore_Api_Base);var c=b.prototype;c.init=function(){b._sc.init.apply(this,arguments);this._notificationConnections={}};c.registerHandler=function(b,c,f){a(this,c).subscribe(b,f)};c.unregisterHandler=function(b,c){a(this,c).unsubscribe(b)};return b}(),
WiziCore_Api_ConnectionRequester=WiziCore_Api_Base.extend({_connections:null,_connFolders:null,init:function(a){this._super(a);this._connections={};this._connections[WiziCore_Api_ConnectionRequester.CDB_CONNECTION_ID]=this._getCdbConnection();this._connections[WiziCore_Api_ConnectionRequester.RDB_CONNECTION_ID]=this._getRdbConnection();this._connections[WiziCore_Api_ConnectionRequester.LISTS_CONNECTION_ID]=this._getListsConnection()},_getListsConnection:function(){var a=new WiziCore_Api_Connection(this.context());
a._connectionId=WiziCore_Api_ConnectionRequester.LISTS_CONNECTION_ID;a._connectionName=AC.Core.lang().trText("qwizard_listsConnectionName");return a},_getCdbConnection:function(){var a=new WiziCore_Api_Connection(this.context());a._connectionId=WiziCore_Api_ConnectionRequester.CDB_CONNECTION_ID;a._connectionName=AC.Core.lang().trText("qwizard_cdbConnectionName");return a},_getRdbConnection:function(){var a=new WiziCore_Api_Connection(this.context());a._connectionId=WiziCore_Api_ConnectionRequester.RDB_CONNECTION_ID;
a._connectionName=AC.Core.lang().trText("qwizard_rdbConnectionName");return a},createConnection:function(a){if(a===void 0)throw new WiziCore_Api_Error("Need connection name",WiziCore_Api_Error.ERR_NEED_OBJECT);var b=this;this.apiRequest("createConnection",[a],function(a,d){b.onConnectionCreated(d)})},onConnectionCreated:function(a){var b=a.object,c=null;a.error!=!0&&(c=new WiziCore_Api_Connection(this.context()),c.json(b.result),this.connections()[c.connectionId()]=c);$(this).trigger(WiziCore_Api_ConnectionRequester.onCreated,
[a.error,c])},saveConnection:function(a,b){if(this.connections()[a]===void 0)throw new WiziCore_Api_Error("Need connection",WiziCore_Api_Error.ERR_NEED_OBJECT);this.saveConnectionJson(this.connections()[a].json(),b)},saveConnectionJson:function(a,b){var c=this;this.apiRequest("saveConnection",[a],function(a,e){c.onConnectionSaved(e,b)})},onConnectionSaved:function(a,b){var c=null,d=a.object,e=a.error;e==!1&&(c=new WiziCore_Api_Connection(this.context()),c.json(d.result),this.connections()[c.connectionId()]!==
void 0?c=this.connections()[c.connectionId()]:this.connections()[c.connectionId()]=c);typeof b=="function"&&b(e,c);$(this).trigger(WiziCore_Api_ConnectionRequester.onSaved,[e,c])},deleteConnection:function(a){if(this.connections()[a]===void 0)throw new WiziCore_Api_Error("Need connection",WiziCore_Api_Error.ERR_NEED_OBJECT);var b=this;this.apiRequest("deleteConnection",[a],function(c,d){d.error!=!0&&delete b.connections()[a];b.onConnectionDeleted(d)})},onConnectionDeleted:function(a){$(this).trigger(WiziCore_Api_ConnectionRequester.onDeleted,
[a.error])},loadConnectionList:function(){var a=this;this.apiRequest("getUserConnections",[],function(b,c){a.onConnectionListLoaded(c)})},onConnectionListLoaded:function(a){var b=a.object,c={};if(a.error!=!0)for(var d in b.result)try{if(!(b.result[d].type&&b.result[d].type==="RSS")){var e=new WiziCore_Api_Connection(this.context());e.json(b.result[d]);this.connections()[e.connectionId()]=e;c[e.connectionId()]=e}}catch(f){acDebugger.systemLog1("connections:onConnectionListLoaded",f)}$(this).trigger(WiziCore_Api_ConnectionRequester.onListLoaded,
[c])},loadConnection:function(a,b){if(a===void 0)throw new WiziCore_Api_Error("Need connection identificztor",WiziCore_Api_Error.ERR_NEED_OBJECT);switch(a){case WiziCore_Api_ConnectionRequester.CDB_CONNECTION_ID:case WiziCore_Api_ConnectionRequester.RDB_CONNECTION_ID:case WiziCore_Api_ConnectionRequester.LISTS_CONNECTION_ID:typeof b=="function"&&b(null,this.connections()[a]);break;default:var c=this;this.apiRequest("getConnection",[a],function(a,e){c.onConnectionLoaded(e,b)})}},onConnectionLoaded:function(a,
b){var c=a.object,d=a.error;if(d!=!0){var e=new WiziCore_Api_Connection(this.context());e.json(c.result);this.connections()[e.connectionId()]=e}try{b!=void 0&&b(d,e),$(this).trigger(WiziCore_Api_ConnectionRequester.onLoaded,[d,e])}catch(f){acDebugger.systemLog1(f)}},loadConnectionFolderList:function(){var a=this;this.context().folders().loadFolderList(WiziCore_Api_FoldersRequester.CONNECTION,void 0,function(b,c){a.onConnectionFolderListLoaded(c)})},onConnectionFolderListLoaded:function(a){this._connFolders=
a;$(this).trigger(WiziCore_Api_ConnectionRequester.onFolderListLoaded,[a])},createConnectionFolder:function(a){var b=this,c=this.context().folders();$(c).one(WiziCore_Api_FoldersRequester.onCreated+WiziCore_Api_FoldersRequester.CONNECTION,function(a,c,f){b.onConnectionFolderCreated(c,f)});c.createFolder(WiziCore_Api_FoldersRequester.CONNECTION,a)},onConnectionFolderCreated:function(a,b){$(this).trigger(WiziCore_Api_ConnectionRequester.onFolderCreated,[a,b])},deleteConnectionFolder:function(a,b){var c=
this,d=this.context().folders();$(d).one(WiziCore_Api_FoldersRequester.onDeleted+WiziCore_Api_FoldersRequester.CONNECTION,function(a,b,d){c.onConnectionFolderDeleted(b,d)});d.deleteFolder(WiziCore_Api_FoldersRequester.CONNECTION,a,b)},onConnectionFolderDeleted:function(a,b){$(this).trigger(WiziCore_Api_ConnectionRequester.onFolderDeleted,[a,b])},saveConnectionFolder:function(a){var b=this,c=this.context().folders();$(c).one(WiziCore_Api_FoldersRequester.onSaved+WiziCore_Api_FoldersRequester.CONNECTION,
function(a,c,f){b.onConnectionFolderSaved(c,f)});c.saveFolder(WiziCore_Api_FoldersRequester.CONNECTION,a)},onConnectionFolderSaved:function(a,b){$(this).trigger(WiziCore_Api_ConnectionRequester.onFolderSaved,[a,b])},connections:function(){if(this._connections==null)this._connections={};return this._connections},getDatasourceByName:function(a){for(var b in this.connections()){var c=this.connections()[b].getDatasource(a);if(c!==null)return c}return null},nameExists:function(a,b){var c=this.connections(),
d=0,e=!1,f;for(f in c)if(d++,c[f]._connectionName===a){e=!0;break}d>2?typeof b==="function"&&b(e):($(this).bind(WiziCore_Api_ConnectionRequester.onListLoaded,function(c,d){if(typeof b==="function"){var e=0,i=!1,f;for(f in d)if(e++,d[f]._connectionName===a){i=!0;break}b(e>0?i:!1)}}),this.loadConnectionList())}});WiziCore_Api_ConnectionRequester.onListLoaded="Events#WiziCore_Api_ConnectionRequester#onListLoaded";WiziCore_Api_ConnectionRequester.onLoaded="Events#WiziCore_Api_ConnectionRequester#onLoaded";
WiziCore_Api_ConnectionRequester.onSaved="Events#WiziCore_Api_ConnectionRequester#onSaved";WiziCore_Api_ConnectionRequester.onCreated="Events#WiziCore_Api_ConnectionRequester#onCreated";WiziCore_Api_ConnectionRequester.onDeleted="Events#WiziCore_Api_ConnectionRequester#onDeleted";WiziCore_Api_ConnectionRequester.onFolderListLoaded="Events#WiziCore_Api_ConnectionRequester#Folder#ListLoaded";WiziCore_Api_ConnectionRequester.onFolderCreated="Events#WiziCore_Api_ConnectionRequester#Folder#Created";
WiziCore_Api_ConnectionRequester.onFolderDeleted="Events#WiziCore_Api_ConnectionRequester#Folder#Deleted";WiziCore_Api_ConnectionRequester.onFolderSaved="Events#WiziCore_Api_ConnectionRequester#Folder#Saved";WiziCore_Api_ConnectionRequester.CDB_CONNECTION_ID="00000000-0000-0000-0000-000000000010";WiziCore_Api_ConnectionRequester.RDB_CONNECTION_ID="00000000-0000-0000-0000-000000000011";WiziCore_Api_ConnectionRequester.LISTS_CONNECTION_ID="00000000-0000-0000-0000-000000000012";
WiziCore_Api_ConnectionRequester.RDB_INSTANCE_ID_FIELD="instance_id";
var WiziCore_Api_ThemeRequester=WiziCore_Api_Base.extend({_theme:null,_currThemeName:null,_themes:null,_enviroment:0,_themeContent:null,init:function(a){this._super();this._themeContent={};a!=void 0&&(this.themes(a),this.theme("_default"))},theme:function(a,b){var c=null;if(a!=void 0&&this._currThemeName!=a){if(typeof a=="object")a=a.id;var d=this.themes(),e;for(e in d){var f=d[e];f!=void 0&&f.id_theme==a&&(c=d[e])}if(c!=null){if(c.imgPath==void 0)d=this.context().config().staticUrl(),e=this.enviroment()==
WiziCore_Api_ThemeRequester.FORM?"form":"app",c.imgPath=d+"themes/"+e+"/_default/images";this._theme=c;this._currThemeName=a;this.applyTheme(b)}}return this._theme},themes:function(a){if(a!=void 0)this._themes=a;if(this._themes===null)this._themes={};return this._themes},applyTheme:function(){this.enviroment()!=0&&this.enviroment()},removeTheme:function(){if(this.enviroment()!=0){var a=WiziCore_Api_ThemeRequester.TYPE_APP;if(this.enviroment()==WiziCore_Api_ThemeRequester.FORM)a=WiziCore_Api_ThemeRequester.TYPE_FORM;
$("link."+a).remove();this._currThemeName=""}},getImgPath:function(){return this._theme.imgPath},enviroment:function(a){if(a!=void 0)this._enviroment=a;return this._enviroment},createTheme:function(a){var b=this;this.apiRequest("createTheme",[a],function(a,d){b.onThemeCreated(d,WiziCore_Api_ThemeRequester.onThemeCreaded)})},onThemeCreated:function(a,b){var c=a.error,d=a.object;$(this).trigger(b,[c,d])},loadThemeList:function(){var a=this;this.apiRequest("getUserThemes",[],function(b,c){a.onThemeListLoaded(c)})},
onThemeListLoaded:function(a){var b=a.object;if(a.error==!0||b.result==null)this.themes({});else{this.themes({});for(var c in b.result)a=b.result[c],this.themes()[a.id_theme]=a}$(this).trigger(WiziCore_Api_ThemeRequester.onListLoad,[this.themes()])},loadThemeFolderList:function(){var a=this;this.context().folders().loadFolderList(WiziCore_Api_FoldersRequester.THEME,void 0,function(b,c){a.onThemeFolderListLoaded(c)})},onThemeFolderListLoaded:function(a){this._themeFolders=a;$(this).trigger(WiziCore_Api_ThemeRequester.onFolderListLoaded,
[a])},createThemeFolder:function(a){var b=this,c=this.context().folders();$(c).one(WiziCore_Api_FoldersRequester.onCreated+WiziCore_Api_FoldersRequester.THEME,function(a,c,f){b.onThemeFolderCreated(c,f)});c.createFolder(WiziCore_Api_FoldersRequester.THEME,a)},onThemeFolderCreated:function(a,b){$(this).trigger(WiziCore_Api_ThemeRequester.onFolderCreated,[a,b])},deleteThemeFolder:function(a,b){var c=this,d=this.context().folders();$(d).one(WiziCore_Api_FoldersRequester.onDeleted+WiziCore_Api_FoldersRequester.THEME,
function(a,b,d){c.onThemeFolderDeleted(b,d)});d.deleteFolder(WiziCore_Api_FoldersRequester.THEME,a,b)},onThemeFolderDeleted:function(a,b){$(this).trigger(WiziCore_Api_ThemeRequester.onFolderDeleted,[a,b])},saveThemeFolder:function(a){var b=this,c=this.context().folders();$(c).one(WiziCore_Api_FoldersRequester.onSaved+WiziCore_Api_FoldersRequester.THEME,function(a,c,f){b.onThemeFolderSaved(c,f)});c.saveFolder(WiziCore_Api_FoldersRequester.THEME,a)},onThemeFolderSaved:function(a,b){$(this).trigger(WiziCore_Api_ThemeRequester.onFolderSaved,
[a,b])},deleteTheme:function(a){var b=this;this.apiRequest("removeTheme",[a],function(a,d){b.onThemeDeleted(d)})},onThemeDeleted:function(a){var b=a.error,a=a.object;$(this).trigger(WiziCore_Api_ThemeRequester.onDelete,[b,a])},loadTheme:function(a,b){var c=this;this.apiRequest("getTheme",[a],function(d,e){c.onThemeLoaded(e,a,b)})},onThemeLoaded:function(a,b,c){var d=a.error,e=a.object,f=e.result;if(d)f=a;else if(this.themes()[b]==void 0)this.themes()[b]=e.result;$(this).trigger(WiziCore_Api_ThemeRequester.onLoaded,
[d,f]);typeof c=="function"&&c(d,f)},saveTheme:function(a,b){var c=this;this.apiRequest("saveTheme",[a],function(a,e){c.onThemeSaved(e,b)})},saveThemeById:function(a,b){if(this.themes()[a]===void 0)throw new WiziCore_Api_Error("Need theme",WiziCore_Api_Error.ERR_NEED_OBJECT);this.saveTheme(this.themes()[a],b)},onThemeSaved:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d);$(this).trigger(WiziCore_Api_ThemeRequester.onSaved,[c,d])},setTheme:function(a){if(a!=void 0)for(var b in this.themes())this.themes()[b].id_theme==
a.id_theme&&(this.themes()[b]=a)},saveThemeContent:function(a,b,c){var d=this;this.apiRequest("saveThemeContent",[a,b],function(a,b){d.onThemeContentSaved(b,c)})},onThemeContentSaved:function(a,b){var c=a.error,d=a.object;$(this).trigger(WiziCore_Api_ThemeRequester.onContentSaved,[c,d]);typeof b=="function"&&b(c,d)},loadThemeContent:function(a,b){var c=this,d=this.context().config().serverThemeUrl()+a;jQuery.ajax({type:"GET",url:d,success:function(d,f){c.onThemeContentLoaded(a,f!="success",d,b)},
error:function(d,f){c.onThemeContentLoaded(a,f!="success",null,b)},dataType:"json"})},onThemeContentLoaded:function(a,b,c,d){b||this.themeContent(a,c);typeof d=="function"&&d(b,c)},themeContent:function(a,b){this._themeContent[a]==null&&(this._themeContent[a]={});b!=void 0&&(this._themeContent[a]=b);return this._themeContent[a]},saveThemeDraftContent:function(a,b){var c=this;this.apiRequest("saveDraftThemeContent",[a,b],function(a,b){c.onThemeDraftContentSaved(b)})},onThemeDraftContentSaved:function(a){var b=
a.error,a=a.object;$(this).trigger(WiziCore_Api_ThemeRequester.onDraftContentSaved,[b,a])},loadThemeDraftContent:function(a,b){var c=this;this.apiRequest("loadDraftThemeContent",[a,b],function(a,b){c.onThemeDraftContentLoaded(b)})},onThemeDraftContentLoaded:function(a){var b=a.error,a=a.object;$(this).trigger(WiziCore_Api_ThemeRequester.onDraftContentLoaded,[b,a])},getThemeStyles:function(a,b,c){var d=this;c==void 0&&(c=null);this.apiRequest("getThemeStyles",[a,b,c],function(e,f){d.onGetThemeStyles(a,
b,c,f)})},onGetThemeStyles:function(a,b,c,d){var e=d.error,d=d.object,a=this.themeContent(a);a[b]=c==null?d.result:jQuery.extend(d.result,a[b]);$(this).trigger(WiziCore_Api_ThemeRequester.onStylesLoaded,[e,d])},setThemeStyle:function(a,b,c,d){var e=this;this.apiRequest("setThemeStyle",[a,b,c,d],function(a,b){e.onSetThemeStyle(b)})},onSetThemeStyle:function(a){var b=a.error,a=a.object;$(this).trigger(WiziCore_Api_ThemeRequester.onStylesSaved,[b,a])},deleteThemeStyle:function(a,b,c){var d=this;this.apiRequest("deleteThemeStyle",
[a,b,c],function(a,b){d.onDeleteThemeStyle(b)})},onDeleteThemeStyle:function(a){var b=a.error,a=a.object;$(this).trigger(WiziCore_Api_ThemeRequester.onStylesDeleted,[b,a])},nameExists:function(a,b){var c=this.themes(),d=0,e=!1,f;for(f in c)if(d++,c[f].name===a){e=!0;break}d>1?typeof b==="function"&&b(e):($(this).bind(WiziCore_Api_ThemeRequester.onListLoad,function(c,d){if(typeof b==="function"){var e=0,i=!1,f;for(f in d)if(e++,d[f].name===a){i=!0;break}b(e>0?i:!1)}}),this.loadThemeList())}});
WiziCore_Api_ThemeRequester.APP=1;WiziCore_Api_ThemeRequester.FORM=2;WiziCore_Api_ThemeRequester.TYPE_FORM="wiziform";WiziCore_Api_ThemeRequester.TYPE_APP="wiziapp";WiziCore_Api_ThemeRequester.onThemeCreaded="E#Resources#ThemeCreated";WiziCore_Api_ThemeRequester.onListLoad="E#Themes#ThemeListLoaded";WiziCore_Api_ThemeRequester.onCreatedByUrl="E#Themes#CreatedByUrl";WiziCore_Api_ThemeRequester.onCreatedByTicket="E#Themes#CreatedByTicket";WiziCore_Api_ThemeRequester.onDelete="E#Themes#Deleted";
WiziCore_Api_ThemeRequester.onLoaded="E#Themes#Theme#Loaded";WiziCore_Api_ThemeRequester.onSaved="E#Themes#Saved";WiziCore_Api_ThemeRequester.onFolderCreated="E#Themes#Folder#Create";WiziCore_Api_ThemeRequester.onFolderSaved="E#Themes#Folder#Save";WiziCore_Api_ThemeRequester.onFolderDeleted="E#Themes#Folder#Delete";WiziCore_Api_ThemeRequester.onFolderOrItemMoved="E#Themes#FolderOrItem#Moved";WiziCore_Api_ThemeRequester.onFolderListLoaded="E#Themes#Folder#ListLoaded";
WiziCore_Api_ThemeRequester.onDraftContentLoaded="E#Themes#DraftContent#Loaded";WiziCore_Api_ThemeRequester.onDraftContentSaved="E#Themes#DraftContent#Saved";WiziCore_Api_ThemeRequester.onContentLoaded="E#Themes#Content#Loaded";WiziCore_Api_ThemeRequester.onContentSaved="E#Themes#Content#Saved";WiziCore_Api_ThemeRequester.onStylesLoaded="E#Themes#Styles#Loaded";WiziCore_Api_ThemeRequester.onStylesSaved="E#Themes#Styles#Saved";WiziCore_Api_ThemeRequester.onStylesDeleted="E#Themes#Styles#Deleted";
var WiziCookie=jQuery.Class.create({init:function(){},cookie:function(a,b,c){if(typeof b!="undefined"){c=c||{};if(b===null)b="",c.expires=-1;var d="";if(c.expires&&(typeof c.expires=="number"||c.expires.toUTCString))typeof c.expires=="number"?(d=new Date,d.setTime(d.getTime()+c.expires*864E5)):d=c.expires,d="; expires="+d.toUTCString();var e=c.path?"; path="+c.path:"",f=c.domain?"; domain="+c.domain:"",c=c.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(b),d,e,f,c].join("")}b=null;
if(document.cookie&&document.cookie!=""){c=document.cookie.split(";");for(d=0;d<c.length;d++)if(e=jQuery.trim(c[d]),e.substring(0,a.length+1)==a+"="){b=decodeURIComponent(e.substring(a.length+1));break}}return b}}),WiziCore_Api_GroupRequester=WiziCore_Api_Base.extend({_groups:null,_groupGroups:null,_currGroup:null,_systemGroups:null,init:function(a){this._super(a);this._groups={};this._context=a;this._systemGroups=[{id_group:WiziCore_Api_AccountRequester.ALL_USERS,name:AC.Core.lang().trText("permission_alluser")},
{id_group:WiziCore_Api_AccountRequester.AUTH_USERS,name:AC.Core.lang().trText("permission_authuser")},{id_group:WiziCore_Api_AccountRequester.SWIRL_USERS,name:AC.Core.lang().trText("permission_swirl_user")}]},createGroup:function(a,b){var c=this;this.apiRequest("createGroup",[a],function(a,e){c.onGroupCreated(e,b)})},onGroupCreated:function(a,b){var c=a.error,d=a.object;WiziCore_Helper.callCallback(b,[c,d]);$(this).trigger(WiziCore_Api_GroupRequester.onCreated,[c,d])},deleteGroup:function(a,b){var c=
this;this.apiRequest("deleteGroup",[a],function(a,e){c.onGroupDeleted(e,b)})},onGroupDeleted:function(a,b){var c=a.error,d=a.object;WiziCore_Helper.callCallback(b,[c,d]);$(this).trigger(WiziCore_Api_GroupRequester.onDeleted,[c,d])},saveGroup:function(a,b){var c=this;this.apiRequest("saveGroup",[a],function(a,e){c.onGroupSaved(e,b)})},onGroupSaved:function(a,b){var c=a.error,d=a.object;WiziCore_Helper.callCallback(b,[c,d]);$(this).trigger(WiziCore_Api_GroupRequester.onSaved,[c,d])},loadGroupList:function(a,
b){var c=this;this.apiRequest("getGroups",[a],function(d,e){c.onGroupListLoaded(e,a==void 0,b)})},onGroupListLoaded:function(a,b,c){var d=a.object,d=(a=a.error==!0||d.result==null)?[]:d.result;a&&acDebugger.systemLog("groups::here");b&&(this._groups=d);WiziCore_Helper.callCallback(c,[a,d]);$(this).trigger(WiziCore_Api_GroupRequester.onListLoaded,[d])},loadGroup:function(a){var b=this;this.apiRequest("getGroup",[a],function(a,d){b.onGroupLoaded(d)})},loadGroupBySession:function(){var a=this;this.apiRequest("getGroupBySessionId",
[],function(b,c){a.onGroupLoaded(c)})},onGroupLoaded:function(a){var b=a.object;this._groups=[];a.error==!0||b.result==null?acDebugger.systemLog("groups::here"):this._currGroup=b.result;$(this).trigger(WiziCore_Api_GroupRequester.onLoaded,[this._currGroup])},addToGroup:function(a,b,c,d){var e=this;this.apiRequest("addToGroup",[a,b,c],function(a,b){e.onAddToGroup(b,d)})},onAddToGroup:function(a,b){WiziCore_Helper.callCallback(b,[a.error,a.object]);$(this).trigger(WiziCore_Api_GroupRequester.onAddToGroup,
[a.error,a.object])},getGroupMembers:function(a,b,c){var d=this;this.apiRequest("getGroupMembers",[a,b],function(a,b){d.onGetGroupMembers(b,c)})},onGetGroupMembers:function(a,b){WiziCore_Helper.callCallback(b,[a.error,a.object]);$(this).trigger(WiziCore_Api_GroupRequester.onGetGroupMembers,[a.error,a.object])},removeFromGroup:function(a,b,c){var d=this;this.apiRequest("removeFromGroup",[a,b],function(a,b){d.onRemoveFromGroup(b,c)})},onRemoveFromGroup:function(a,b){WiziCore_Helper.callCallback(b,[a.error,
a.object]);$(this).trigger(WiziCore_Api_GroupRequester.onRemoveFromGroup,[a.error,a.object])},groupList:function(){if(this._groups==null)this._groups={};return this._groups},currGroup:function(){if(this._currGroup==null)this._currGroup={};return this._currGroup},isGroupLoaded:function(a){return this.getGroupById(a)!=void 0?!0:!1},getGroupById:function(a){for(var b=this.groupList(),c=null,d=0,e=b.length;d<e;d++)if(b[d].id_group==a){c=b[d];break}if(!c){b=this.systemGroupList();d=0;for(e=b.length;d<
e;d++)if(b[d].id_group==a){c=b[d];break}}return c},systemGroupList:function(){return this._systemGroups}});WiziCore_Api_GroupRequester.onListLoaded="Events#WiziCore_Api_GroupRequester#ListLoaded";WiziCore_Api_GroupRequester.onCreated="Events#WiziCore_Api_GroupRequester#Group#Created";WiziCore_Api_GroupRequester.onDeleted="Events#WiziCore_Api_GroupRequester#Group#Deleted";WiziCore_Api_GroupRequester.onSaved="Events#WiziCore_Api_GroupRequester#Group#Saved";WiziCore_Api_GroupRequester.onLoaded="Events#WiziCore_Api_GroupRequester#Group#Loaded";
WiziCore_Api_GroupRequester.onAddToGroup="Events#WiziCore_Api_GroupRequester#Group#AddToGroup";WiziCore_Api_GroupRequester.onGetGroupMembers="Events#WiziCore_Api_GroupRequester#Group#onGetGroupMembers";WiziCore_Api_GroupRequester.onRemoveFromGroup="Events#WiziCore_Api_GroupRequester#Group#onRemoveFromGroup";WiziCore_Api_GroupRequester.GROUP="g";
var WiziCore_Api_AccountRequester=WiziCore_Api_Base.extend({_rightsForObject:null,_cacheMyObjectRights:null,_idents:null,_rights:null,_myRights:null,_identsParams:null,_identsParamsByUser:null,_widgets:null,init:function(a){this._super(a);this._rightsForObject={};this._cacheMyObjectRights={};this._rights={};this._context=a},getRights:function(a,b){var c=this;this.apiRequest("getRights",[a],function(d,e){c.onGetRights(e,a,b)})},onGetRights:function(a,b,c){var d=a.error,a=a.object;if(d==!1)this._rights[b]=
a.result;typeof c=="function"&&c(d,a);$(this).trigger(WiziCore_Api_AccountRequester.onGetRights,[d,a])},rights:function(){return this._rights},myRights:function(){return this._myRights},getMyRights:function(a){var b=this;this.apiRequest("getMyRights",[],function(c,d){b.onGetMyRights(d,a)})},onGetMyRights:function(a,b){var c=a.object,d=null,e=null;a.error==!0?d=c:this._myRights=e=c.result;typeof b=="function"&&b(d,e)},checkGroupDisabling:function(a,b,c){this.apiRequest("checkGroupDisabling",[a,b],
function(a,b){typeof c=="function"&&c(b.error,b.object)})},setRights:function(a,b,c){var d=this;this._rights[a]=b;this.apiRequest("setRights",[a,b],function(a,b){d.onSetRights(b,c)})},onSetRights:function(a,b){typeof b=="function"&&b(a.error,a.object);$(this).trigger(WiziCore_Api_AccountRequester.onSetRights,[a.error,a.object])},getObjectPermissions:function(a,b){var c=this;this.apiRequest("getObjectPermissions",[a],function(d,e){c.onGetObjectPermissions(e,a,b)})},onGetObjectPermissions:function(a,
b,c){var d=a.error,a=a.object;if(d==!1)this._rightsForObject[b]=a.result;WiziCore_Helper.callCallback(c,[d,a])},setObjectPermissions:function(a,b,c){var d=this;this.apiRequest("setObjectPermissions",[a,b],function(a,b){d.onSetObjectPermissions(b,c)})},onSetObjectPermissions:function(a,b){var c=a.error,a=a.object;WiziCore_Helper.callCallback(b,[c,a])},clearMyObjectPermissionsCache:function(a){a=this.getSectionForMyCache(a);delete this._cacheMyObjectRights[a]},getSectionForMyCache:function(a){return a==
void 0?"_default_":a},getMyObjectPermissions:function(a,b,c){b=this.getSectionForMyCache(b);if(this._cacheMyObjectRights[b]&&this._cacheMyObjectRights[b][a])this.onGetMyObjectPermissions({error:!1,object:{result:this._cacheMyObjectRights[b][a]}},void 0,b,c);else{var d=this;this.apiRequest("getMyObjectPermissions",[a],function(e,f){d.onGetMyObjectPermissions(f,a,b,c)})}},onGetMyObjectPermissions:function(a,b,c,d){var e=a.object,f={};if(!(a.error==!0||e.result==null))f=e.result,this._cacheMyObjectRights[c]==
void 0&&(this._cacheMyObjectRights[c]={}),b!=void 0&&(this._cacheMyObjectRights[c][b]=f);typeof d=="function"&&d(f)},identifiers:function(){if(this._idents==null)this._idents={};return this._idents},widgets:function(){if(this._widgets==null)this._widgets={};return this._widgets},identParams:function(){if(this._identsParams==null)this._identsParams={};return this._identsParams},identParamsByUser:function(a){this._identsParamsByUser[a]==null&&(this._identsParamsByUser[a]={});return this._identsParamsByUser},
createIdent:function(a,b){var c=this;this.apiRequest("createUserIdentifier",[a],function(a,e){c.onIdentCreated(e,b)})},onIdentCreated:function(a,b){var c=a.error,d=c?a.object:a.object;c||d!=void 0&&(this._idents[a.id_identifier]=d);typeof b=="function"&&b(c,d)},deleteIdent:function(a,b,c){var d=this;this.apiRequest("deleteUserIdentifier",[a],function(a,b){d.onIdentDeleted(b,c)})},onIdentDeleted:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d.result)},saveIdent:function(a,b,c){var d=
this;this.apiRequest("saveUserIdentifier",[a,b!=void 0?b:null],function(a,b){d.onIdentSaved(b,c)})},saveIdentById:function(a){if(this.identifiers()[a]===void 0)throw new WiziCore_Api_Error("Need theme",WiziCore_Api_Error.ERR_NEED_OBJECT);this.saveIdent(this.identifiers()[a])},onIdentSaved:function(a,b){var c=a.error,d=a.object;if(!c&&d.result.id_identifier)this.identifiers()[d.result.id_identifier]=d.result;typeof b=="function"&&b(c,d.result)},loadIdent:function(a){var b=this;this.apiRequest("getIdentifiers",
[a],function(c,d){b.onIdentLoaded(d,a)})},onIdentLoaded:function(a,b){var c=a.error,d=a.object;if(c)$(this).trigger(WiziCore_Api_AccountRequester.onLoaded,[c,a]);else{if(this.identifiers()[b]==void 0)this.identifiers()[b]=d.result;$(this).trigger(WiziCore_Api_AccountRequester.onLoaded,[c,d.result])}},loadIdentList:function(a){var b=this;this.apiRequest("getUserIdentifiers",[null],function(c,d){b.onIdentListLoaded(d,a)})},onIdentListLoaded:function(a,b){var c=a.object,d=a.error==!0||c.result==null?
!0:!1;if(d)$(this).trigger(WiziCore_Api_AccountRequester.onError,[c]);else{this._idents={};for(var e in c.result){var f=c.result[e];if(f.params.length==0)f.params=[];this.identifiers()[f.id_identifier]=f}}typeof b=="function"&&b(d,this.identifiers());$(this).trigger(WiziCore_Api_AccountRequester.onListLoaded,[this.identifiers()])},saveIdentParams:function(a,b,c){var d=this;this.apiRequest("saveUserIdentifierParams",[a,c],function(a,c){d.onIdentParamsSaved(c,b)})},onIdentParamsSaved:function(a,b){var c=
a.error,d=a.object;c||this.context().dataObject().setUserParameters([d.result]);typeof b=="function"&&b(c,d)},loadIdentsParamsByUser:function(a,b){var c=this;this.apiRequest("getUserIdentifiersParams",[a],function(d,e){c.onIdentsParamsLoaded(e,b,a)})},loadIdentsParams:function(a){var b=this;this.apiRequest("getUserIdentifiersParams",[],function(c,d){b.onIdentsParamsLoaded(d,a)})},onIdentsParamsLoaded:function(a,b,c){var d=a.object,a=a.error;if(a==!0||d.result==null)$(this).trigger(WiziCore_Api_AccountRequester.onError,
[d]);else if(c!=void 0){this._identsParamsByUser=this._identsParamsByUser==null?{}:this._identsParamsByUser;this._identsParamsByUser[c]={};for(var e in d.result){var f=d.result[e];if(f.params.length==0)f.params=[];this._identsParamsByUser[c][f.id_identifier]=f}}else{this._identsParams={};for(e in d.result){f=d.result[e];if(f.params.length==0)f.params=[];this._identsParams[f.id_identifier]=f}this.context().dataObject().setUserParameters(this.identParams())}try{var g=c!=void 0?this.identParamsByUser(c):
this.identParams();typeof b=="function"&&b(a,g)}catch(h){acDebugger.systemLog("onIdentsParamsLoaded : error",h)}},loadWidgetsList:function(a){var b=this;this.apiRequest("getWidgetList",[null],function(c,d){b.onWidgetsListLoaded(d,a)})},onWidgetsListLoaded:function(a,b){var c=a.object,d=a.error==!0||c.result==null;if(d)$(this).trigger(WiziCore_Api_AccountRequester.onError,[c]);else{var e=this._widgets={},f;for(f in c.result){var g=c.result[f];e[g.id]=g}}typeof b=="function"&&b(d,this._widgets)},createWidget:function(a){var b=
this;this.apiRequest("createWidget",[a],function(a,d){b.onWidgetCreated(d)})},onWidgetCreated:function(a){var b=a.error,c=a.object;if(a.error!=!0&&c.result!=null&&c.result!=void 0)this._widgets[c.result.id]=c.result;$(this).trigger(WiziCore_Api_AccountRequester.onWidgetCreated,[b,c])},deleteWidget:function(a){var b=this;this.apiRequest("deleteWidget",[a],function(a,d){b.onWidgetDeleted(d)})},onWidgetDeleted:function(a){var b=a.error,a=a.object;$(this).trigger(WiziCore_Api_AccountRequester.onWidgetDeleted,
[b,a])},saveWidget:function(a,b){var c=this;this.apiRequest("saveWidget",[a],function(a,e){c.onWidgetSaved(e,b)})},onWidgetSaved:function(a,b){var c=a.error,d=a.object;b!=void 0&&b(c,d);$(this).trigger(WiziCore_Api_AccountRequester.onWidgetSaved,[c,d])},setAccountSettings:function(a,b){var c=this;this.apiRequest("setAccountSettings",[a],function(a,e){c.onAccountSettingsSets(e,b)})},onAccountSettingsSets:function(a,b){var c=a.error,d=a.object;b!=void 0&&b(c,d)},getAccountSettings:function(a,b){var c=
this;this.apiRequest("getAccountSettings",[a],function(a,e){c.onAccountSettingsGets(e,b)})},onAccountSettingsGets:function(a,b){var c=a.error,d=a.object;b!=void 0&&b(c,d)},uploadForNative:function(a,b,c,d,e,f,g){d==null&&(d={});var h=new FileTransfer,j=this.context().getSession().getToken(),c=new FileUploadOptions("file",c,e,d);if(e!=null)c.mimeType=e;c.chunkedMode=!1;d.sessionId=j;h.upload(a,b,f,g,c)}});WiziCore_Api_AccountRequester.rights="login,public folder,form,resource,connection,query,account,user,int agent,widget,theme,notifier,all_logs_read,logs_write".split(",");
WiziCore_Api_AccountRequester.RIGHTS_LOGIN="login";WiziCore_Api_AccountRequester.RIGHTS_PUBLIC_FOLDER="public folder";WiziCore_Api_AccountRequester.RIGHTS_FORM="form";WiziCore_Api_AccountRequester.RIGHTS_RESOURCE="resource";WiziCore_Api_AccountRequester.RIGHTS_CONNECTION="connection";WiziCore_Api_AccountRequester.RIGHTS_QUERY="query";WiziCore_Api_AccountRequester.RIGHTS_ACCOUNT="account";WiziCore_Api_AccountRequester.RIGHTS_USER="user";WiziCore_Api_AccountRequester.RIGHTS_ACCOUNT="account";
WiziCore_Api_AccountRequester.RIGHTS_INTEGRATION_AGENT="int agent";WiziCore_Api_AccountRequester.RIGHTS_WIDGET="widget";WiziCore_Api_AccountRequester.RIGHTS_THEME="theme";WiziCore_Api_AccountRequester.RIGHTS_NOTIFIER="notifier";WiziCore_Api_AccountRequester.RIGHTS_ALL_LOGS_READ="all_logs_read";WiziCore_Api_AccountRequester.RIGHTS_LOGS_WRITE="logs_write";WiziCore_Api_AccountRequester.PERMISSION_LIST="list";WiziCore_Api_AccountRequester.PERMISSION_USE="use";
WiziCore_Api_AccountRequester.PERMISSION_EDIT="edit";WiziCore_Api_AccountRequester.PERMISSION_ADMIN="admin";WiziCore_Api_AccountRequester.onGetRights="Events#WiziCore_Api_AccountRequester#onGetRights";WiziCore_Api_AccountRequester.onSetRights="Events#WiziCore_Api_AccountRequester#onSetRights";WiziCore_Api_AccountRequester.ALLOW="a";WiziCore_Api_AccountRequester.DENY="d";WiziCore_Api_AccountRequester.ALL_USERS="00000000-0000-0000-0000-000000000000";WiziCore_Api_AccountRequester.AUTH_USERS="00000000-0000-0000-0000-000000000001";
WiziCore_Api_AccountRequester.SWIRL_USERS="00000000-0000-0000-0000-000000000002";WiziCore_Api_AccountRequester.onError="Events#WiziCore_Api_AccountRequester#onError";WiziCore_Api_AccountRequester.onWidgetCreated="Events#WiziCore_Api_AccountRequester#onWidgetCreated";WiziCore_Api_AccountRequester.onWidgetSaved="Events#WiziCore_Api_AccountRequester#onWidgetSaved";WiziCore_Api_AccountRequester.onWidgetDeleted="Events#WiziCore_Api_AccountRequester#onWidgetDeleted";
WiziCore_Api_AccountRequester.onListLoaded="Events#WiziCore_Api_AccountRequester#onListLoaded";WiziCore_Api_AccountRequester.onLoaded="Events#WiziCore_Api_AccountRequester#onLoaded";WiziCore_Api_AccountRequester.SMTP_PARAMS="SMTP";WiziCore_Api_AccountRequester.PHONEGAP_PARAMS="PhoneGap";WiziCore_Api_AccountRequester.GOOGLEANALYTICS_PARAMS="GoogleAnalytics";WiziCore_Api_AccountRequester.GOOGLEANALYTICS_PARAMS_ACCOUNTID="accountid";WiziCore_Api_AccountRequester.GOOGLEMAPS_PARAMS="GoogleMaps";
WiziCore_Api_AccountRequester.GOOGLEMAPS_PARAMS_API_KEY="apikey";WiziCore_Api_AccountRequester.SMTP_PARAMS_HOST="host";WiziCore_Api_AccountRequester.SMTP_PARAMS_USER="user";WiziCore_Api_AccountRequester.SMTP_PARAMS_PWD="password";WiziCore_Api_AccountRequester.SMTP_PARAMS_CONN_SEC="security";WiziCore_Api_AccountRequester.SMTP_PARAMS_DEFAULT_FROM_NAME="defaultFromName";WiziCore_Api_AccountRequester.SMTP_PARAMS_DEFAULT_FROM_ADDRESS="defaultFromAddress";
var WiziCore_Api_FoldersRequester=WiziCore_Api_Base.extend({init:function(a){this._super(a);this._context=a},createFolder:function(a,b){var c=this;this.apiRequest("createFolder",[a,b],function(b,e){c.onFolderCreated(e,a)})},onFolderCreated:function(a,b){var c=a.error,d=a.object;$(this).trigger(WiziCore_Api_FoldersRequester.onCreated+b,[c,d])},deleteFolder:function(a,b,c){var d=this;this.apiRequest("deleteFolder",[a,b,c],function(b,c){d.onFolderDeleted(c,a)})},getFolderItems:function(a,b,c,d){this.apiRequest("getFolderDependency",
[a,b,c],function(a,b){WiziCore_Helper.callCallback(d,[b.error,b.object])})},onFolderDeleted:function(a,b){var c=a.error,d=a.object;$(this).trigger(WiziCore_Api_FoldersRequester.onDeleted+b,[c,d])},saveFolder:function(a,b){var c=this;this.apiRequest("saveFolder",[a,b],function(b,e){c.onFolderSaved(e,a)})},onFolderSaved:function(a,b){var c=a.error,d=a.object;$(this).trigger(WiziCore_Api_FoldersRequester.onSaved+b,[c,d])},loadFolderList:function(a,b,c){var d=this;this.apiRequest("getFolders",[a,b],function(b,
f){d.onFolderListLoaded(f,a,c)})},onFolderListLoaded:function(a,b,c){var d=a.object,a=a.error==!0||d.result==null,e=!a&&$.isArray(d.result)?d.result:[];a&&$(this).trigger(WiziCore_Api_FoldersRequester.onError+b,[d]);WiziCore_Helper.callCallback(c,[a,e])},getSharedUserList:function(a,b){var c=this;this.apiRequest("getSharedUserList",[a],function(d,e){c.onGetSharedUserList(e,a,b)})},onGetSharedUserList:function(a,b,c){var d=a.object,e=(a=a.error==!0||d.result==null)?[]:d.result;a&&$(this).trigger(WiziCore_Api_FoldersRequester.onError+
b,[d]);WiziCore_Helper.callCallback(c,[a,e])},getSharedFoldersList:function(a,b,c){var d=this;this.apiRequest("getSharedFoldersList",[a,b],function(b,f){d.onGetSharedFoldersList(f,a,c)})},onGetSharedFoldersList:function(a,b,c){var d=a.object,e=(a=a.error==!0||d.result==null)?[]:d.result;a&&$(this).trigger(WiziCore_Api_FoldersRequester.onError+b,[d]);WiziCore_Helper.callCallback(c,[a,e])},getSharedItemsList:function(a,b,c,d){var e=this;this.apiRequest("getSharedItemsList",[a,b,d],function(b,d){e.onGetSharedItemsList(d,
a,c)})},onGetSharedItemsList:function(a,b,c){var d=a.object,e=(a=a.error==!0||d.result==null)?[]:d.result,f=this.context().wfRequester();if(a)$(this).trigger(WiziCore_Api_FoldersRequester.onError+b,[d]);else switch(b){case WiziCore_Api_FoldersRequester.FORM:this.context().forms().addForms(e);break;case WiziCore_Api_FoldersRequester.NOTIFIER:b=0;for(d=e.length;b<d;b++)f.addNotifier(e[b])}WiziCore_Helper.callCallback(c,[a,e])},addToPublicFolder:function(a,b,c){var d=this;this.apiRequest("addToPublicFolder",
[a,b,c],function(b,c){d.onAddToPublicFolder(c,a)})},onAddToPublicFolder:function(a,b){$(this).trigger(WiziCore_Api_FoldersRequester.onAddToPublicFolder+b,[a])},removeFromPublicFolder:function(a,b,c){var d=this;this.apiRequest("removeFromPublicFolder",[a,b,c],function(b,c){d.onRemoveFromPublicFolder(c,a)})},onRemoveFromPublicFolder:function(a,b){$(this).trigger(WiziCore_Api_FoldersRequester.onRemoveFromPublicFolder+b,[a.error,a.object])},getPublicSubFolders:function(a,b){var c=this;this.apiRequest("getPublicSubFolders",
[a,b],function(b,e){c.onGetPublicSubFolders(e,a)})},onGetPublicSubFolders:function(a,b){var c=a.object,d=[];a.error==!0||c.result==null?$(this).trigger(WiziCore_Api_FoldersRequester.onError+b,[c]):d=c.result;$(this).trigger(WiziCore_Api_FoldersRequester.onGetPublicSubFolders+b,[d])},getPublicFolderChildren:function(a,b){var c=this;this.apiRequest("getPublicFolderChildren",[a,b],function(b,e){c.onGetPublicFolderChildren(e,a)})},onGetPublicFolderChildren:function(a,b){var c=a.object,d=[];a.error==!0||
c.result==null?$(this).trigger(WiziCore_Api_FoldersRequester.onError+b,[c]):d=c.result;$(this).trigger(WiziCore_Api_FoldersRequester.onGetPublicFolderChildren+b,[d])},createPublicFolder:function(a,b){var c=this;this.apiRequest("createPublicFolder",[a,b],function(b,e){c.onCreatePublicFolder(e,a)})},onCreatePublicFolder:function(a,b){var c=a.error,d=a.object;$(this).trigger(WiziCore_Api_FoldersRequester.onCreatePublicFolder+b,[c,d])},deletePublicFolder:function(a,b,c){var d=this;this.apiRequest("deletePublicFolder",
[a,b,c],function(b,c){d.onDeletePublicFolder(c,a)})},onDeletePublicFolder:function(a,b){var c=a.error,d=a.object;$(this).trigger(WiziCore_Api_FoldersRequester.onDeletePublicFolder+b,[c,d])},getFolder:function(a,b){var c=this;this.apiRequest("getFolder",[a,b],function(b,e){c.onGetFolder(e,a)})},onGetFolder:function(a,b){var c=a.error,d=a.object;$(this).trigger(WiziCore_Api_FoldersRequester.onGetFolder+b,[c,d])}});WiziCore_Api_FoldersRequester.FORM="form";WiziCore_Api_FoldersRequester.QUERY="query";
WiziCore_Api_FoldersRequester.CONNECTION="connection";WiziCore_Api_FoldersRequester.RESOURCE="resource";WiziCore_Api_FoldersRequester.THEME="theme";WiziCore_Api_FoldersRequester.DATA_AGENT="data_agent";WiziCore_Api_FoldersRequester.WIDGETS="widgets";WiziCore_Api_FoldersRequester.NOTIFIER="notification_service";WiziCore_Api_FoldersRequester.HTML5BUILD="html5_builder";WiziCore_Api_FoldersRequester.USER="user";WiziCore_Api_FoldersRequester.GROUP="group";WiziCore_Api_FoldersRequester.ACCOUNT="account";
WiziCore_Api_FoldersRequester.MYDETAILS="myDetails";WiziCore_Api_FoldersRequester.onError="Events#WiziCore_Api_FoldersRequester#onError#";WiziCore_Api_FoldersRequester.onCreated="Events#WiziCore_Api_FoldersRequester#onCreated#";WiziCore_Api_FoldersRequester.onGetFolder="Events#WiziCore_Api_FoldersRequester#onGetFolder#";WiziCore_Api_FoldersRequester.onDeleted="Events#WiziCore_Api_FoldersRequester#onDeleted#";WiziCore_Api_FoldersRequester.onSaved="Events#WiziCore_Api_FoldersRequester#onSaved#";
WiziCore_Api_FoldersRequester.onGetSharedFoldersList="Events#WiziCore_Api_FoldersRequester#onGetSharedFoldersList#";WiziCore_Api_FoldersRequester.onAddToPublicFolder="Events#WiziCore_Api_FoldersRequester#onAddToPublicFolder#";WiziCore_Api_FoldersRequester.onRemoveFromPublicFolder="Events#WiziCore_Api_FoldersRequester#onRemoveToPublicFolder#";WiziCore_Api_FoldersRequester.onGetPublicSubFolders="Events#WiziCore_Api_FoldersRequester#onGetPublicSubFolders#";
WiziCore_Api_FoldersRequester.onGetPublicFolderChildren="Events#WiziCore_Api_FoldersRequester#onGetPublicFolderChildren#";WiziCore_Api_FoldersRequester.onCreatePublicFolder="Events#WiziCore_Api_FoldersRequester#onCreatePublicFolder#";WiziCore_Api_FoldersRequester.onDeletePublicFolder="Events#WiziCore_Api_FoldersRequester#onDeletePublicFolder#";
var WiziCore_Api_FormInstanceRequester=WiziCore_Api_Base.extend({_formInstances:null,init:function(a){this._super(a);this._formInstances={};this._context=a},submitFormInstance:function(a,b,c,d,e){var f={abortSaving:!1};$(this).trigger(WiziCore_Api_FormInstanceRequester.onPreSubmit,[f]);if(f.abortSaving)acDebugger.systemLog("aborted submission of form instance"),WiziCore_Helper.callCallback(d,[]);else{acDebugger.systemLog("create and send request for formInstance create");var g=this;this.apiRequest(a?
"createFormInstance":"saveFormInstance",[b,e],function(b,d){g.onFormInstanceSubmitted(d,a,c)})}},onFormInstanceSubmitted:function(a,b,c){var d=a.object,e=void 0,f=void 0,g=null;a.error==!0?(g=d,acDebugger.systemLog("error ",d)):(e=d.result,f=e.id_form_instance);WiziCore_Helper.callCallback(c,[g,f,b,e]);$(this).trigger(WiziCore_Api_FormInstanceRequester.onSubmitted,[g,f,b,e])},saveFormInstanceDraft:function(a){acDebugger.systemLog("saved and send request for formInstanceDraft save");var b=this;this.apiRequest("saveFormInstanceDraft",
[a],function(a,d){b.onFormInstanceDraftSaved(d)})},onFormInstanceDraftSaved:function(a){var b=a.object;a.error?acDebugger.systemLog("error ",b):acDebugger.systemLog("object.result DRAFT",b.result)},formInstances:function(){if(this._formInstances==null)this._formInstances={};return this._formInstances},loadFormInstance:function(a,b,c){var d=this;this.context().offlineMode()?WiziCore_Api_LocalDb.getDb("sync",function(c,d){var g="SELECT instance FROM app_instances WHERE instanceId = "+("'"+a.replace(/\'/g,
"''")+"'");d.executeSql(g,function(c){var c=c.rows,d=null;c.length>0&&(d=JSON.parse(c[0].instance));typeof b=="function"&&(d?b(null,a,d):b(!0))},function(){typeof b=="function"&&b(!0)})}):this.apiRequest("getFormInstance",[a,c],function(c,f){d.onFormInstanceLoaded(f,a,b)})},onFormInstanceLoaded:function(a,b,c){var d=a.object,e=null,f=void 0;a.error==!0?e=d:f=d.result;WiziCore_Helper.callCallback(c,[e,b,f])},loadFormInstanceList:function(a,b){var c=this;this.apiRequest("getFormInstanceList",[[{key:"id_form",
value:[a]},{key:"status",value:[1]}],!1],function(a,e){c.onFormInstanceListLoaded(e,b)})},onFormInstanceListLoaded:function(a,b){var c=a.object;WiziCore_Helper.callCallback(b,[a.error==!0?c:null,c.result])},deleteFormInstance:function(a,b){var c=this;this.apiRequest("deleteFormInstance",[a],function(d,e){c.onFormInstanceDeleted(e,a,b)})},onFormInstanceDeleted:function(a,b,c){var d=a.error,a=a.object;WiziCore_Helper.callCallback(c,[d==!0?a:null,b,d==!0?void 0:a.result])},deleteAllInstances:function(a,
b){var c=this;this.apiRequest("deleteAllInstances",[a],function(a,e){c.onDeletedAllInstances(e,b)})},onDeletedAllInstances:function(a,b){var c=a.object;WiziCore_Helper.callCallback(b,[a.error==!0?c:null])},setInstanceRelations:function(a,b,c){var d=this;this.apiRequest("setInstanceRelations",[a,b],function(b,f){d.onInstanceRelationsSet(f,a,c)})},onInstanceRelationsSet:function(a,b,c){var d=a.error,a=a.object;WiziCore_Helper.callCallback(c,[d==!0?a:null,b,d==!0?void 0:a.result])},changeAppData:function(a,
b,c,d,e,f){var g=this;this.apiRequest("changeAppData",[a,b,c,d,e],function(a,b){g.onChangeAppData(b,f)})},onChangeAppData:function(a,b){var c=a.error,d=a.object;WiziCore_Helper.callCallback(b,[c==!0?d:null,c==!0?null:d.result])}});WiziCore_Api_FormInstanceRequester.onListLoaded="Events#WiziCore_Api_FormInstanceRequester#Form#onListLoaded";WiziCore_Api_FormInstanceRequester.onSaved="Events#WiziCore_Api_FormInstanceRequester#Form#Saved";WiziCore_Api_FormInstanceRequester.onSubmitted="Events#WiziCore_Api_FormInstanceRequester#Form#Submitted";
WiziCore_Api_FormInstanceRequester.onPreSubmit="E#WiziCore_Api_FormInstanceRequester#onPreSubmit";
var WiziCore_Api_Storage=WiziCore_Api_Base.extend({_dataObject:null,_dataSchema:null,init:function(a,b,c){this._super(a);this._dataObject=b;this._dataSchema=c},setDataField:function(a,b,c){if(a!=void 0&&b!=void 0){var d=this._dataObject[a];this._dataObject[a]=b;d!=b&&c!=void 0&&$(this).trigger(WiziCore_Api_ClientForm.onStorageChanged,[this,a,c])}},dataField:function(a){return a==void 0?(acDebugger.systemLog("No dataFieldName"),null):this._dataObject[a]},fieldIsValid:function(a,b){switch(a.type){case "string":return typeof b==
"string";case "float":return this.isFloat(b);case "integer":return this.isInteger(b);case "date":return this.isDate(b);case "complex":return this.complexFieldIsValid(a.schema,b)}},isFloat:function(){return!1},isInteger:function(){return!1},isDate:function(){return!1},complexFieldIsValid:function(a,b){for(var c in b){var d=a[c];if(d==void 0)return acDebugger.systemLog("No dataField in schema with name ",dataFieldName),null;if(!this.fieldIsValid(d,this._dataObject[c]))return!1}return!0}}),WiziCore_Api_DataAgentRequester=
WiziCore_Api_Base.extend({_dataAgents:null,_daFolders:null,_daTypes:null,init:function(a){this._super(a);this._dataAgents={};this._daTypes={};this._context=a},createDataAgent:function(a,b){var c=this;this.apiRequest("createDataAgent",[a],function(a,e){c.onDataAgentCreated(e,b)})},onDataAgentCreated:function(a,b){var c=a.error,d=a.object,e=null;e=c==!0?d:this._dataAgents[d.result.id_data_agent]=d.result;WiziCore_Helper.callCallback(b,[c,e]);$(this).trigger(WiziCore_Api_DataAgentRequester.onCreated,
[c,e])},deleteDataAgent:function(a){var b=this;this.apiRequest("deleteDataAgent",[a],function(a,d){b.onDataAgentDeleted(d)})},onDataAgentDeleted:function(a){var b=a.error,a=a.object;$(this).trigger(WiziCore_Api_DataAgentRequester.onDeleted,[b,a])},saveDataAgent:function(a,b){var c=this;acDebugger.systemLog("data",a);this.apiRequest("saveDataAgent",[a],function(a,e){c.onDataAgentSaved(e,b)})},saveDataAgentById:function(a,b){if(this.dataAgents()[a]===void 0)throw new WiziCore_Api_Error("Need theme",
WiziCore_Api_Error.ERR_NEED_OBJECT);this.saveDataAgent(this.dataAgents()[a],b)},onDataAgentSaved:function(a,b){var c=a.error,d=a.object;typeof b=="function"&&b(c,d);$(this).trigger(WiziCore_Api_DataAgentRequester.onSaved,[c,d])},loadDataAgent:function(a,b){var c=this;this.apiRequest("getDataAgent",[a],function(d,e){c.onDataAgentLoaded(e,a,b)})},onDataAgentLoaded:function(a,b,c){var d=a.error,e=a.object;if(!d){if(this.dataAgents()[b]==void 0)this.dataAgents()[b]=e.result;a=e.result}$(this).trigger(WiziCore_Api_DataAgentRequester.onLoaded,
[d,a]);typeof c=="function"&&c(d,a)},loadDataAgentList:function(a){var b=this;this.apiRequest("getUserDataAgents",[],function(c,d){b.onDataAgentListLoaded(d,a)})},onDataAgentListLoaded:function(a,b){var c=a.object;if(a.error==!0||c.result==null)$(this).trigger(WiziCore_Api_DataAgentRequester.onError,[c]);else{this._dataAgents={};for(var d in c.result){var e=c.result[d];if(!(e.type&&e.type==="RSS")){if(e.params.length==0)e.params={};this.dataAgents()[e.id_data_agent]=e}}typeof b=="function"&&b(this.dataAgents())}$(this).trigger(WiziCore_Api_DataAgentRequester.onListLoaded,
[this.dataAgents()])},loadDataAgentTypes:function(a){var b=this;this.apiRequest("getAvailableDataAgentTypes",[],function(c,d){b.onLoadDataAgentTypes(d,a)})},onLoadDataAgentTypes:function(a,b){var c=a.error,d=a.object;if(!(a.error==!0||d.result==null)){this._daTypes={};for(var e in d.result)this._daTypes[e]=d.result[e]}WiziCore_Helper.callCallback(b,[c,this.dataAgentTypes()]);$(this).trigger(WiziCore_Api_DataAgentRequester.onLoadDataAgentTypes,[c,this.dataAgentTypes()])},loadDataAgentFolderList:function(){var a=
this;this.context().folders().loadFolderList(WiziCore_Api_FoldersRequester.DATA_AGENT,void 0,function(b,c){a.onDataAgentFolderListLoaded(c)})},onDataAgentFolderListLoaded:function(a){this._daFolders=a;$(this).trigger(WiziCore_Api_DataAgentRequester.onFolderListLoaded,[a])},createDataAgentFolder:function(a,b){var c=this,d=this.context().folders();b?($(d).one(WiziCore_Api_FoldersRequester.onCreatePublicFolder+WiziCore_Api_FoldersRequester.DATA_AGENT,function(a,b,d){c.onDataAgentFolderCreated(b,d)}),
d.createPublicFolder(WiziCore_Api_FoldersRequester.DATA_AGENT,a)):($(d).one(WiziCore_Api_FoldersRequester.onCreated+WiziCore_Api_FoldersRequester.DATA_AGENT,function(a,b,d){c.onDataAgentFolderCreated(b,d)}),d.createFolder(WiziCore_Api_FoldersRequester.DATA_AGENT,a))},onDataAgentFolderCreated:function(a,b){$(this).trigger(WiziCore_Api_DataAgentRequester.onFolderCreated,[a,b])},deleteDataAgentFolder:function(a,b,c){var d=this,e=this.context().folders();c?($(e).one(WiziCore_Api_FoldersRequester.onDeleted+
WiziCore_Api_FoldersRequester.DATA_AGENT,function(a,b,c){d.onDataAgentFolderDeleted(b,c)}),e.deletePublicFolder(WiziCore_Api_FoldersRequester.DATA_AGENT,a,b)):($(e).one(WiziCore_Api_FoldersRequester.onDeleted+WiziCore_Api_FoldersRequester.DATA_AGENT,function(a,b,c){d.onDataAgentFolderDeleted(b,c)}),e.deleteFolder(WiziCore_Api_FoldersRequester.DATA_AGENT,a,b))},onDataAgentFolderDeleted:function(a,b){$(this).trigger(WiziCore_Api_DataAgentRequester.onFolderDeleted,[a,b])},saveDataAgentFolder:function(a){var b=
this,c=this.context().folders();$(c).one(WiziCore_Api_FoldersRequester.onSaved+WiziCore_Api_FoldersRequester.DATA_AGENT,function(a,c,f){b.onDataAgentFolderSaved(c,f)});c.saveFolder(WiziCore_Api_FoldersRequester.DATA_AGENT,a)},onDataAgentFolderSaved:function(a,b){$(this).trigger(WiziCore_Api_DataAgentRequester.onFolderSaved,[a,b])},dataAgents:function(){if(this._dataAgents==null)this._dataAgents={};return this._dataAgents},dataAgentTypes:function(){if(this._daTypes==null)this._daTypes={};return this._daTypes},
nameExists:function(a,b){var c=this.dataAgents(),d=0,e=!1,f;for(f in c)if(d++,c[f].name===a){e=!0;break}d>0?typeof b==="function"&&b(e):($(this).bind(WiziCore_Api_DataAgentRequester.onError,function(){typeof b==="function"&&b(!1)}),$(this).bind(WiziCore_Api_DataAgentRequester.onListLoaded,function(c,d){if(typeof b==="function"){var e=0,i=!1,f;for(f in d)if(e++,d[f].name===a){i=!0;break}b(e>0?i:!1)}}),this.loadDataAgentList())}});WiziCore_Api_DataAgentRequester.onSaved="Events#WiziCore_Api_DataAgentRequester#DataAgentSaved";
WiziCore_Api_DataAgentRequester.onListLoaded="Events#WiziCore_Api_DataAgentRequester#ListLoaded";WiziCore_Api_DataAgentRequester.onCreated="Events#WiziCore_Api_DataAgentRequester#DataAgent#Created";WiziCore_Api_DataAgentRequester.onDeleted="Events#WiziCore_Api_DataAgentRequester#DataAgent#Deleted";WiziCore_Api_DataAgentRequester.onFolderListLoaded="Events#WiziCore_Api_DataAgentRequester#Folder#ListLoaded";WiziCore_Api_DataAgentRequester.onFolderCreated="Events#WiziCore_Api_DataAgentRequester#Folder#Created";
WiziCore_Api_DataAgentRequester.onFolderDeleted="Events#WiziCore_Api_DataAgentRequester#Folder#Deleted";WiziCore_Api_DataAgentRequester.onFolderSaved="Events#WiziCore_Api_DataAgentRequester#Folder#Saved";WiziCore_Api_DataAgentRequester.onError="Events#WiziCore_Api_DataAgentRequester#Error";WiziCore_Api_DataAgentRequester.onLoadDataAgentTypes="Events#WiziCore_Api_DataAgentRequester#TypesLoaded";WiziCore_Api_DataAgentRequester.onLoaded="Events#WiziCore_Api_DataAgentRequester#AgentLoaded";
var WiziCore_Api_InstanceStatusRequester=WiziCore_Api_Base.extend({_instanceStatuses:null,init:function(){this._instanceStatuses={}},_addVersion:function(a,b){this._instanceStatuses[a]==void 0&&(this._instanceStatuses[a]={});var c=this._instanceStatuses[a];c[b]!=b&&(c[b]={status:WiziCore_Api_InstanceStatusRequester.Status.PENDING,error:null})},addInstances:function(a){var b=!0,c;for(c in this._instanceStatuses){b=!1;break}c=0;for(var d=a.length;c<d;++c){var e=a[c];this._addVersion(e.id,e.version)}b&&
this._requestStatuses()},addInstance:function(a,b){var c=!0,d;for(d in this._instanceStatuses){c=!1;break}this._addVersion(a,b);c&&this._requestStatuses()},_requestStatuses:function(){var a=this,b=WiziCore_Helper.clone(this._instanceStatuses);this.checkStatus(this._instanceStatuses,function(c,d){c?a._onErrorRequestingStatus():a._checkChangedStatuses(d,b)})},_onErrorRequestingStatus:function(){for(var a in this._instanceStatuses){var b=this._instanceStatuses[a],c;for(c in b){var d=b[c];d.status=WiziCore_Api_InstanceStatusRequester.Status.ERROR;
$(this).trigger(WiziCore_Api_InstanceStatusRequester.onInstanceStatusChanged,[a,c,d])}}this._instanceStatuses={}},_checkChangedStatuses:function(a,b){var c=[],d;for(d in this._instanceStatuses){var e=this._instanceStatuses[d],f;for(f in e){var g=e[f];if((d in b&&f in b[d]?b[d][f]:null)!=null){var h=null;a!=null&&a[d]!=void 0&&a[d][f]!=void 0&&(h=a[d][f]);acDebugger.systemLog1("checking instance statuses",d,f,h);if(h==null)g.status=WiziCore_Api_InstanceStatusRequester.Status.ERROR,$(this).trigger(WiziCore_Api_InstanceStatusRequester.onInstanceStatusChanged,
[d,f,g]),c.push({id:d,version:f});else{var g=g.status,j=h.status;e[f]=h;g!=j&&$(this).trigger(WiziCore_Api_InstanceStatusRequester.onInstanceStatusChanged,[d,f,h]);j!=WiziCore_Api_InstanceStatusRequester.Status.PENDING&&j!=WiziCore_Api_InstanceStatusRequester.Status.PROCESSING&&c.push({id:d,version:f})}}}}d=0;for(e=c.length;d<e;++d)f=c[d],this._removeInstance(f.id,f.version);var c=!0,i;for(i in this._instanceStatuses){c=!1;break}if(!c){var m=this;setTimeout(function(){m._requestStatuses()},WiziCore_Api_InstanceStatusRequester.CHECK_INTERVAL)}},
_removeInstance:function(a,b){if(this._instanceStatuses[a]!=void 0){var c=this._instanceStatuses[a];if(c[b]!==void 0){delete c[b];var d=!0,e;for(e in c){d=!1;break}d&&delete this._instanceStatuses[a]}}},checkStatus:function(a,b){var c=this;this.apiRequest("checkInstanceStatusesChange",[a],function(a,e){c._onCheckStatusResponse(e,b)})},_onCheckStatusResponse:function(a,b){var c=a.error,d=a.object;WiziCore_Helper.callCallback(b,[c?d:null,c?null:d.result])}});
WiziCore_Api_InstanceStatusRequester.CHECK_INTERVAL=1E3;WiziCore_Api_InstanceStatusRequester.Status={PENDING:"pending",PROCESSING:"processing",VALID:"valid",ERROR:"error",WARNING:"warning"};WiziCore_Api_InstanceStatusRequester.onInstanceStatusChanged="Events#WiziCore_Api_InstanceStatusRequester#onInstanceStatusChanged";
var WiziCore_Api_WorkflowRequester=WiziCore_Api_Base.extend({_notifiers:{},_apiRequestWithCallback:function(a,b,c){this.apiRequest(a,b,function(a,b){var f=b?b.object:null;WiziCore_Helper.callCallback(c,[b.error,f?f.result:null,f?f.message:null])})},setAppRoles:function(a,b,c){this._apiRequestWithCallback("setAppRoles",[a,b],c)},assignToRole:function(a,b,c,d,e){this._apiRequestWithCallback("assignRole",[a,b,c,d],e)},unassignFromRole:function(a,b,c,d,e){this._apiRequestWithCallback("unassignRole",[a,
b,c,d],e)},assignInstance:function(a,b,c,d,e,f,g,h){this._apiRequestWithCallback("assignInstance",[a,b,c,d,e,f,g],h)},cancelAssignments:function(a,b,c,d,e){this._apiRequestWithCallback("cancelAssignments",[a,b,c,d],e)},getUserAssignmentsForApp:function(a,b){this._apiRequestWithCallback("getUserAssignmentsForApp",[a],b)},getAssignmentsForApp:function(a,b){this._apiRequestWithCallback("getAssignmentsForApp",[a],b)},getUserAssignments:function(a){this._apiRequestWithCallback("getUserAssignments",[],
a)},getAssignedRoles:function(a,b){this._apiRequestWithCallback("getAssignedRoles",[a],function(a,d){var e=[];if(a==!1)for(var f=0;f<d.result.length;f++){var g=d.result[f];e.push({id:g.name,name:g.title})}WiziCore_Helper.callCallback(b,[a,e])})},getNotifier:function(a,b){var c=this;this._apiRequestWithCallback("getNotifier",[a],function(a,e){a||(c.notifiers()[e.id_notifier]=e);WiziCore_Helper.callCallback(b,[a,e])})},createNotifier:function(a,b){var c=this;this._apiRequestWithCallback("createNotifier",
[a],function(a,e){a||(c.notifiers()[e.id_notifier]=e);WiziCore_Helper.callCallback(b,[a,e])})},saveNotifier:function(a,b){var c=this;this._apiRequestWithCallback("saveNotifier",[a],function(a,e){a||(c.notifiers()[e.id_notifier]=e);WiziCore_Helper.callCallback(b,[a,e])})},deleteNotifier:function(a,b){var c=this;this._apiRequestWithCallback("deleteNotifier",[a],function(d,e){d||delete c.notifiers()[a];WiziCore_Helper.callCallback(b,[d,e])})},getUserNotifiers:function(a){var b=this;this._apiRequestWithCallback("getUserNotifiers",
[],function(c,d){if(!c)for(var e=0,f=d.length;e<f;e++)b.notifiers()[d[e].id_notifier]=d[e];WiziCore_Helper.callCallback(a,[c,d])})},getUserNotifications:function(a,b,c,d,e){this._apiRequestWithCallback("getUserNotifications",[a,b,c,d],e)},getNotifications:function(a,b,c,d){this._apiRequestWithCallback("getNotifications",[a,b,c],d)},notifiers:function(){return this._notifiers},addNotifier:function(a){this.notifiers()[a.id_notifier]=a},getNotificationTask:function(a,b){this._apiRequestWithCallback("getNotificationTask",
[a],b)},setNotificationTask:function(a,b){this._apiRequestWithCallback("setNotificationTask",[a],b)},cancelNotificationTask:function(a,b){this._apiRequestWithCallback("cancelNotificationTask",[a],b)}}),WiziCore_DataObject=WiziCore_Api_Base.extend({_details:{},init:function(a){this._super(a);this.setValue(this.buildPath(WiziCore_DataObject.INSTANCE,WiziCore_DataObject.ID),"")},setValue:function(a,b){this._details[a]=b;return!1},getValue:function(a){return this._details[a]},setForm:function(){},setUserDetails:function(a){this.setValue(this.buildPath(WiziCore_DataObject.USER,
WiziCore_DataObject.ID),a.id);this.setValue(this.buildPath(WiziCore_DataObject.USER,WiziCore_DataObject.NAME),a.username);this.setValue(this.buildPath(WiziCore_DataObject.USER,WiziCore_DataObject.LOGIN),a.login);this.setValue(this.buildPath(WiziCore_DataObject.USER,WiziCore_DataObject.TYPE),a.type);this.setValue(this.buildPath(WiziCore_DataObject.USER,WiziCore_DataObject.CREATED_AT),a.created_at)},setFormInstance:function(a){this.setValue(this.buildPath(WiziCore_DataObject.INSTANCE,WiziCore_DataObject.ID),
a.id())},setUserParameters:function(a){for(var b in a){var c=this.buildPath(WiziCore_DataObject.USER,WiziCore_DataObject.PARAMETERS,a[b].name),d;for(d in a[b].params)this.setValue(this.buildPath(c,a[b].params[d].name),a[b].params[d].value)}},buildPath:function(){return Array.prototype.slice.call(arguments).join(".")},setInstanceDetails:function(){},getDetails:function(a){return this.getValue(a)},processString:function(a,b,c){c=c==void 0?!0:c;if(b==void 0)return b;for(var d in this._details)if(this._details[d]!=
void 0){var e=RegExp("\\["+d+"\\]","g"),f=this._details[d];c==!0&&(f=WiziCore_Helper.escapeString(f));b=b.replace(e,f)}b=this.replaceWithWidgetsValues(a,b,c);return b=this.replaceWithStageValues(a,b,c)},processToken:function(a,b,c){c=c==void 0?!0:c;if(b==void 0)return b;for(var d in this._details)if(this._details[d]!=void 0){var e=RegExp("\\["+d+"\\]","g"),f=this._details[d];c==!0&&(f=WiziCore_Helper.escapeString(f));b=b.replace(e,f)}return b=this.replaceWidgetToken(a,b)},addSlashes:function(a){return(a+
"").split("\\").join("\\\\").split('"').join('\\"').split("'").join("\\'")},replaceWithStageValues:function(a,b,c){var d=this,e=a.currentFormInstanceInfo(),f={id:null,description:null,title:null,name:null};if(e!=void 0&&(e=e.stageId(),e!=void 0)){for(var a=a.workflow().containers,g=null,h=0,j=a.length;h<j;++h){var i=a[h];if(i.id==e){g=i;break}}if(g!=void 0)f.id=g.id,f.name=g.name,f.title=g.title,f.description=g.description}if(c)for(h in f)f[h]=WiziCore_Helper.escapeString(f[h]);(function(a){b=b.replace("["+
d.buildPath(a.STAGE,a.ID)+"]",f.id);b=b.replace("["+d.buildPath(a.STAGE,a.NAME)+"]",f.name);b=b.replace("["+d.buildPath(a.STAGE,a.TITLE)+"]",f.title);b=b.replace("["+d.buildPath(a.STAGE,a.DESCRIPTION)+"]",f.description)})(WiziCore_DataObject);return b},replaceWidgetToken:function(a,b){var c=null,d=null,d="";if((c=RegExp("\\[Form\\.Widgets\\.([^\\]]+)\\]","g").exec(b))!=null)d=c[1];var d=d.split(".",2),c=d[0],d=d[1],e=b;c!=void 0&&c!=""&&(c=a.findName(c),c!=void 0&&(e=c.value(),d!=void 0&&e!=void 0&&
e[d]!=void 0&&(e=e[d])));return e},replaceWithWidgetsValues:function(a,b,c){for(var d=RegExp("\\[Form\\.Widgets\\.([^\\]]+)\\]","g"),e=[],f;(f=d.exec(b))!=null;)e.push(f[1]);d=[];f=e.length;for(var g=0;g<f;g++){var h=e[g],j=a.getData(h);d.push([h,j])}f=d.length;for(g=0;g<f;g++)a=d[g],e=c==!0?WiziCore_Helper.escapeString(a[1]):a[1],b=b.replace("[Form.Widgets."+a[0]+"]",e);return b},isInt:function(a){return WiziCore_Helper.isInt(a)},getConstants:function(){var a=[],b;for(b in this._details)a.push(b);
return a},getConstantsExpression:function(){var a=[],b;for(b in this._details)a.push("["+b+"]");var c=this.getFormFields(),d=c.length;for(b=0;b<d;b++)a.push("["+c[b]+"]");c=this.getStageFields();b=0;for(d=c.length;b<d;b++)a.push("["+c[b]+"]");return a},getStageFields:function(){return[this.buildPath(WiziCore_DataObject.STAGE,WiziCore_DataObject.ID),this.buildPath(WiziCore_DataObject.STAGE,WiziCore_DataObject.TITLE),this.buildPath(WiziCore_DataObject.STAGE,WiziCore_DataObject.DESCRIPTION),this.buildPath(WiziCore_DataObject.STAGE,
WiziCore_DataObject.NAME)]},getEditorForm:function(){var a=this.managerContext().editor;return a!=null?a.form():void 0},getFormFields:function(){for(var a=this.getChildren(this.getEditorForm()),b=a.length,c=0;c<b;c++)a[c]=this.buildPath(WiziCore_DataObject.FORM,WiziCore_DataObject.WIDGETS,a[c]);return a},getChildren:function(a){return a.getFormFields()}});WiziCore_DataObject.SESSION="Session";WiziCore_DataObject.USER="User";WiziCore_DataObject.INSTANCE="Instance";WiziCore_DataObject.FORM="Form";
WiziCore_DataObject.WIDGETS="Widgets";WiziCore_DataObject.PARAMETERS="Parameters";WiziCore_DataObject.ID="Id";WiziCore_DataObject.LOGIN="Login";WiziCore_DataObject.NAME="Name";WiziCore_DataObject.TYPE="Type";WiziCore_DataObject.STAGE="Stage";WiziCore_DataObject.DESCRIPTION="Description";WiziCore_DataObject.TITLE="Title";WiziCore_DataObject.CREATED_AT="Created_at";
var WiziCore_Address_History=function(a,b){function c(a,c){typeof c=="function"&&c(a);a==-1?b(h).trigger(h.onBack):b(h).trigger(h.onForward)}var d=[],e=!0,f=!1,g=0,h={init:function(){a==a.parent&&(b.address.init(function(a){d.push({value:a.value});g=-1}).change(function(a){if(!e){var i=a.value;b(h).trigger(h.onChanged,[a]);d[g]&&d[g].value==i?(c(-1,d[g].callback),g--):d[g+2]&&d[g+2].value==i&&(c(1,d[g]!=void 0?d[g].callback:null),g++)}}),f=!0)},clearCache:function(){d.length=0;d=[{value:"/"}];g=-1},
write:function(a,c){a=a!=""?"/"+a:a;d.push({value:a,callback:c});g++;d.splice(g+2,d.length-(g+2));e=!0;f&&b.address.value(a);e=!1}};h.init();h.onChanged="E#WiziCore_Address_History#changed";h.onBack="E#WiziCore_Address_History#back";h.onForward="E#WiziCore_Address_History#forward";return h}(window,jQuery),WiziCore_Visualizer=function(a,b,c,d){function e(a,b,d,e){var f=new $.Deferred,k=$("html"),l=(new Date).getTime();c.ac_force_resize_check=!0;k.addClass("m-ui-mobile-viewport-transitioning");e.animationComplete(function(){var d=
(new Date).getTime()-l;e.removeClass(a+(b?"MobileReverse":"Mobile"));k.removeClass("m-ui-mobile-viewport-transitioning");c.ac_force_resize_check=!1;f.resolve(d)});d&&d.css({top:0,left:0,"z-index":0});e&&(e.css({"z-index":2E3}),e.addClass(a+(b?"MobileReverse":"Mobile")));return f.promise()}function f(a,b,d,e){var f=new $.Deferred,k=b?" reverse":"",l="m-ui-mobile-viewport-transitioning viewport-"+a,n=function(){d&&(d.add(e).removeClass("out in reverse "+a),d.parent().removeClass(l));c.ac_iscroll_scroll=
!1;f.resolve(a,b,d,e)};d?d.animationComplete(n):n();c.ac_iscroll_scroll=!0;e&&(e.addClass(a+" out"+k),e.css({top:e.data("top")||""}));d&&(d.parent().addClass(l),d.addClass(" "+a+" in"+k),d.css({top:d.data("top")||""}));return f.promise()}var g=a.Visualizer=WiziCore_Api_Base.extend({_mode:0,_visualized:null,_pageStack:null,_visId:null,init:function(){this._super();this._visId=WiziCore_Helper.generateId(32,"p");this._visualized=[];this._pageStack={data:[],ptr:null,maxSize:50,forward:function(){return this.ptr==
null||this.ptr==this.data.length-1?null:this.data[++this.ptr]},back:function(){return this.ptr==null||this.ptr==0?null:this.data[--this.ptr]},add:function(a){this.ptr<this.data.length-1&&this.data.splice(this.ptr+1,this.data.length);this.data.length>this.maxSize&&this.recalculate();if(this.data[this.data.length-1]!=a)this.data.push(a),this.ptr=this.data.length-1},recalculate:function(){for(var a=0,b=this.data.length-1;a<b;a++)this.data[a]=this.data[a+1]},clear:function(){this.data=[];this.ptr=null}}},
mode:function(a){if(a!=d)this._mode=a;return this._mode},startVisualize:function(a,b,e){e!=d&&this.mode(e);jQuery.fn.__useTr=!1;e=this._visualized.length;if(a==d)return jQuery.fn.__useTr=!0,null;var f=this;a.mode(this.mode());a.draw(b);a.runtimeMode()==WiziCore_UI_FormRuntime.PREVIEW_MODE||a.isEmbed()?a._scrolledElement(b):a._scrolledElement(c);a._zIndex=WiziCore_Helper.getTopZIndex();a.base();var o={project:a,div:a.base(),form:a,pages:{},mode:this._mode,currentPage:null,prevPageId:null,dialog:{mode:!1,
div:null,currentPage:null,prevPageId:null},dialogHistory:[]};$(a).bind(WiziCore_Api_ClientForm.ADD_PAGE_EVENT,function(a,b){o.pages[b]=!1});$(a).bind(WiziCore_Api_ClientForm.DELETE_PAGE_EVENT,function(a,b){delete o.pages[b];if(b==o.currentPageId)o.currentPage=null,o.currentPageId=null});$(a).bind(WiziCore_Api_ClientForm.onShowNextPage,{self:f,vuid:e},f.showNextPage);$(a).bind(WiziCore_Api_ClientForm.onShowPrevPage,{self:f,vuid:e},f.showPrevPage);$(a).bind(WiziCore_Api_ClientForm.onShowCallingPage,
{self:f,vuid:e},f.showCallingPage);$(a).bind(WiziCore_Api_ClientForm.onShowPageByNum,{self:f,vuid:e},function(a,b,c,d){f.showPageByNum(a,b,c,d)});$(a).bind(WiziCore_Api_ClientForm.onPageStackBack,{self:f,vuid:e},f.pageStackBack);$(a).bind(WiziCore_Api_ClientForm.onPageStackForward,{self:f,vuid:e},f.pageStackForward);$(a).bind(WiziCore_Api_ClientForm.onPageStackClear,{self:f,vuid:e},f.pageStackClear);WiziCore_Helper.map(a.pages(),function(a){o.pages[a.id()]=!1});this._visualized.push(o);jQuery.fn.__useTr=
!0;return e},stopVisualize:function(e,f){var i=this._visualized[e];if(i!=d){var m=i.div.parent();i.project.destroy();$(b,c).unbind("."+this._visId);if(f==d)i.div.remove();else{i.div.empty();if(f.url!=d&&f.url!="")c.location=f.url;m.append(a.Core.lang().tr("standart_close_message"))}this._pageStack.clear();this._visualized.splice(e,1);jQuery.fn.__useTr=!0}},setDialogMode:function(a,b){var c=this._visualized[a].dialog;if(b!=d)c.mode=b;return c.mode},logTime:function(a,b){var c=(new Date).getTime();
acDebugger.systemLog("message",a,"time",c,"delta",c-b);return c},_getTransitionObject:function(a,b,c,e){if(b===!0||b===!1)c=b,b=d;return{transition:d===b?this._visualized[a].form.pageTransition():b,reverse:c?c:e}},showNextPage:function(a,b,c){var e=a.data.self,a=a.data.vuid,f=e._visualized[a];if(f==d)return 0;for(var k=f.dialog.mode?f.dialog.currentPageId:f.currentPageId,f=f.form.pages(),l=0;l<f.length;l++)if(f[l].id()==k)return l++,l<f.length&&e.showPage(a,f[l].id(),d,d,e._getTransitionObject(a,
b,c,!1)),l-1;return 0},showPrevPage:function(a,b,c){var e=a.data.self,a=a.data.vuid,f=e._visualized[a];if(f==d)return 0;for(var k=f.dialog.mode?f.dialog.currentPageId:f.currentPageId,f=f.form.pages(),l=0;l<f.length;l++)if(f[l].id()==k)return l--,l>=0&&e.showPage(a,f[l].id(),d,d,e._getTransitionObject(a,b,c,!0)),l+1;return 0},showCallingPage:function(a,b,c){var e=a.data.self,a=a.data.vuid,f=e._visualized[a];if(f==d)return 0;f=f.dialog.mode?f.dialog.prevPageId:f.prevPageId;f!=null&&e.showPage(a,f,d,
d,e._getTransitionObject(a,b,c,!0));return 0},showPageByNum:function(a,b,c,e){var f=a.data.self,a=a.data.vuid,k=f._visualized[a];if(k==d)return 0;for(var l=k.dialog.mode?k.dialog.currentPageId:k.currentPageId,n=0,k=k.form.pages(),g=0,q=k.length;g<q;++g)k[g].id()==l&&(n=g);l=null;k[b]&&b!=n&&WiziCore_Helper.isInteger(b)?l=k[b].id():b!=null&&b!=""&&(l=b);this.showPage(a,l,d,d,f._getTransitionObject(a,c,e,!1));return n},pageStackBack:function(a,b,c){var e=a.data.self,a=a.data.vuid,f=e._visualized[a].form;
f.isEmbed()||f.isIframeMode()?(f=e._pageStack.back(),f!=null&&e.showPage(a,f,d,!0,e._getTransitionObject(a,b,c,!0))):(f._transitionOptions={transition:b,reverse:c},history.go(-1))},pageStackForward:function(a,b,c){var e=a.data.self,a=a.data.vuid,f=e._visualized[a].form;f.isEmbed()||f.isIframeMode()?(f=e._pageStack.forward(),f!=null&&e.showPage(a,f,d,!0,e._getTransitionObject(a,b,c,!1))):(f._transitionOptions={transition:b,reverse:c},history.go(1))},pageStackClear:function(a){a.data.self._pageStack.clear()},
printPages:function(a){function c(a){var b,d,e,i;for(e=0,i=q.length;e<i;e++)if(d=q[e],d.id()==a||d.name()==a||e==a){b=d.id();break}return b}var e=this._visualized[a];if(e!=d){var f=e.form.getPrintData(),o=f&&f.pages?f.pages:null,k=f&&f.widgetProps?f.widgetProps:null,l,n,g,f=[],e=e.form,q=e.pages();$("html").css("overflow","visible");$(b.body).css("overflow","visible").addClass("wa-print-page-breaks");if(k)for(g in k)if(l=e.w(g))n=k[g],n===!0?n={visible:!0}:n===!1&&(n={visible:!1}),l.prop(n);if($.isArray(o))for(k=
0,l=o.length;k<l;k++)(g=c(o[k]))&&f.push(g);else for(k=0,l=q.length;k<l;k++)f.push(q[k].id());setTimeout(function(){WiziCore_Helper.callPrint()},12E4);for(k=0,l=f.length;k<l;k++)this.showPage(a,f[k],!1,!0,d,d,!0);this._checkPrintDataLoaded(e)}},_checkPrintDataLoaded:function(a){var b=0;a.webClient.checkWorking();$(a.webClient).one(WiziCore_Api_Server_WebAdapter.onAllDataReceived,function(){b++;b>=2&&WiziCore_Helper.callPrint()});this.context().api().adapter().checkWorking();$(this.context().api().adapter()).one(WiziCore_Api_Server_WebAdapter.onAllDataReceived,
function(){b++;b>=2&&WiziCore_Helper.callPrint()})},showPage:function(b,c,e,f,o,k,l){o=o?o:this._getTransitionObject(b);f==d&&this.mode()==g.RUN_MODE&&this._pageStack.add(c);var n=this._visualized[b];if(n!=d){jQuery.fn.__useTr=!1;var b=n.project.base(),r=n.mode,q=n.dialog.mode,p=n.pages[c];r!=g.RUN_MODE&&b.show();if(!p){for(var b=n.form.pages(),e=0,t=b.length;e<t;e++)if(b[e].id()==c){p=b[e];n.pages[c]=p;break}if(!p){jQuery.fn.__useTr=!0;return}}var u=q?n.dialog.currentPage:n.currentPage,b=u&&typeof u==
"object"?u.pageContainer().base:null,e=p&&typeof p=="object"?p.pageContainer().base:null;p&&u&&p.id()==u.id()?p.reDrawRepeatWidgets(!0):(p.ignoreUpdatelayout=!q,this._changePage(p.form(),p,u,b,e,q,function(){this.__showPage(n,p,q);u!=null&&$(u).trigger(a.Widgets.WiziCore_Api_Page.onPageLeft)},function(){l||this.__hidePage(u,p)},function(){p.ignoreUpdatelayout&&p._updateLayout();delete p.ignoreUpdatelayout;if(r==g.RUN_MODE&&p.autoPageJump()&&p.autoJumpTime()>-1){var b=p.autoPageJump(),e=p.autoJumpTime();
b!=null&&b!=""&&e!=null&&e!=""&&setTimeout(function(){$(p.form()).trigger(WiziCore_Api_ClientForm.onShowPageByNum,[b])},parseInt(e)*1E3)}var i=q?n.dialog:n,e=i.currentPage;i.currentPage=p;i.prevPageId=i.currentPageId;i.currentPageId=c;f==d&&!n.form.isEmbed()&&!n.form.isPrinting()&&!n.form.isIframeMode()&&!q&&this.mode()==g.RUN_MODE&&(i=n.form.liveName()!=d?n.form.liveName():n.form.id(),WiziCore_Address_History.write(i+"/"+p.name()));q&&p._zindex(this._findMaxZIndex(n.div)+1);!k&&p.form().autoFocus()!==
!1&&this.setFocusToChild(p);$(p).trigger(a.Widgets.WiziCore_Api_Page.onPagePreShow);$(p).trigger(a.Widgets.WiziCore_Api_Page.onPageShow);$(p.form()).trigger(a.Widgets.WiziCore_Api_Form.PageChanging.onShow,[p]);$(p.form()).trigger(a.Widgets.WiziCore_Api_Form.onPageChange,[e?e.name():d,p?p.name():d]);jQuery.fn.__useTr=!0},o.transition,o.reverse,l))}},__hidePage:function(a,b){a!=null&&a!=b&&(a.dialogMode(!1),a.hide())},__showPage:function(a,b,c){try{a.form._setCurrentPage(b),b.dialogMode(c),b.show(a.div)}catch(d){acDebugger.systemLog1("vizualizer::wpage.show()::",
b.widgetClass(),d)}},_moveStaticPanelsToForm:function(a,b){if(b){var c=b.children(),d=a.children(),e=[],f=[],l=[],n=[];WiziCore_Helper.map(c,function(a,b){var c=a.repeat(),d=null;typeof a.fixed=="function"&&(d=a.fixed());if(c||d)d=="static_top"||d=="top"?e.push({child:a,pos:b,repeat:c,fixed:d}):(d=="static_bottom"||d=="bottom")&&l.push({child:a,pos:b,repeat:c,fixed:d})});WiziCore_Helper.map(d,function(a,b){var c=a.repeat(),d=null;typeof a.fixed=="function"&&(d=a.fixed());if(c||d)d=="static_top"||
d=="top"?f.push({child:a,pos:b,repeat:c,fixed:d}):(d=="static_bottom"||d=="bottom")&&n.push({child:a,pos:b,repeat:c,fixed:d})});var g=!1;if(f.length==e.length){g=!0;for(d=0;d<f.length;d++)f[d].child.name()!=e[d].child.name()?g=!1:f[d].fixed=="top"&&(g=!1)}c=!1;if(n.length==l.length){c=!0;for(d=0;d<n.length;d++)n[d].child.name()!=l[d].child.name()?c=!1:n[d].fixed=="bottom"&&(c=!1)}d=null;if(g)g=jQuery.fn.__useTr,jQuery.fn.__useTr=!1,b.pageContainer().topCont.prependTo(b.form().base()),d=b.pageContainer().topCont,
jQuery.fn.__useTr=g;var q=null;if(c)g=jQuery.fn.__useTr,jQuery.fn.__useTr=!1,b.pageContainer().bottomCont.appendTo(b.form().base()),q=b.pageContainer().bottomCont,jQuery.fn.__useTr=g;return{top:d,bottom:q}}else return{}},setFixedStaticContainersPosition:function(b,c,d){if(!WiziCore_Helper.isPositionFixedSupport()&&d){var b=a.Advertising,e=0,f=0;b.toolbarHeight();var k=d.pageContainer(),l=k.topCont.height(),n=k.centerCont.height(),f=k.bottomCont.height(),c=this._moveStaticPanelsToForm(c,d),e=l;b.usingAdvertToolbar()&&
b.isBottomPosition()&&(f+=n,c.bottom?b.setToolboxTop(n+"px"):b.setToolboxTop(f+"px"));c.top||(e-=l);k.centerCont.css({top:e+"px"});c.bottom?k.bottomCont.css({top:n+"px"}):k.bottomCont.css({top:e+"px"})}},dropFixedStaticContainersPosition:function(b,c,d){if(!WiziCore_Helper.isPositionFixedSupport()&&d)b=d.pageContainer(),c=a.Advertising,c.usingAdvertToolbar()&&c.isBottomPosition()&&c.setToolboxTop(""),b.centerCont.css({top:""}),b.bottomCont.css({top:""})},_changePage:function(b,j,i,m,o,k,l,n,r,q,p){function t(){if(!H&&
!k){var b=j.scrollTop(),b=isNaN(b)||b<=0.1?0.1:b,b=C?b:0.1;s[0]==c?((G&&C===!1||C||!G)&&c.scrollTo(0,b),D&&a.Advertising.setRelativePositionByScroll()):(s.scrollLeft(0),s.scrollTop(b))}}function u(c){j.pageContainer().centerCont.css({top:"",left:""});i&&(i.pageContainer().centerCont.css({top:"",left:""}),t());j.isPageChanging(!1);i&&i.isPageChanging(!1);$.vmouse.preventRealEvents=!1;clearTimeout(v._timeOutPageChanged);v._timeOutPageChanged=setTimeout(function(){WiziCore_Helper.hideClickHelper();$.event.special.scrollstart.enabled=
!0;b&&!b.isDestroyed()&&$(b).trigger(a.Widgets.WiziCore_Api_Form.PageChanging.onStop,[j.id()])},c?c:450)}function z(){v._moveStaticPanelsToPage(F,i);o.data("topDefault",null);m.data("topDefault",null);n.call(v);r.call(v);k||(m.css("z-index",1),o.css("z-index",1));u()}$.event.special.scrollstart.enabled=!1;$.vmouse.preventRealEvents=!0;j&&i&&b.checkFocusForm(!0);var v=this;$(c);var s=b._scrolledElement(),w=b.restoreScrollTop(),y=j.restoreScrollTop(),C=y||y!==!1&&w,G=b.isNativeApp(),H=this.mode()!=
g.RUN_MODE,w=WiziCore_Helper.isAndroid(),B=WiziCore_Helper.isAndroid4(),y=b.runtimeMode()==WiziCore_UI_FormRuntime.PREVIEW_MODE,D=WiziCore_Helper.isMobile(),w=H||y||q==d||q=="none"||q==""||o==d||m==d||k||w&&!B||WiziCore_Helper.isOldiPhone(),y=o&&m&&!y&&(!q||q=="none"),I=function(){l.call(v);j.setDesktopPagePos();j.onPagePainted()};$(b).trigger(a.Widgets.WiziCore_Api_Form.PageChanging.onStart,[j.id()]);j.isPageChanging(!0);i&&i.isPageChanging(!0);if(i&&!k){var B=s.scrollTop(),A=s.scrollLeft();i.scrollTop(B);
i.scrollLeft(A)}WiziCore_Helper.showClickHelper(y);if(w){t();var F=this._moveStaticPanelsToForm(j,i),y=j.isDrawn(),w=j.transitionMode();D&&(!y&&w!="prerendering"||w=="postrendering")?(i?b.twirlyThing(b,!0):WiziCore_Helper.appLoadSplashHide(j),setTimeout(function(){n.call(v);l.call(v);v._moveStaticPanelsToPage(F,i);j.setDesktopPagePos();j.onPagePainted();r.call(v);i&&b.twirlyThing(b,!1);u();v._defaultZIndex=null},100)):(v._moveStaticPanelsToPage(F,i),WiziCore_Helper.appLoadSplashHide(j),n.call(v),
l.call(v),r.call(v),j.setDesktopPagePos(),j.onPagePainted(),u(),v._defaultZIndex=null)}else{F=this._moveStaticPanelsToForm(j,i);if((w=q=="slide"||q=="fade")&&!D)switch(q){case "mobileSlide":q="slide";break;case "mobileFade":q="fade"}if(D&&w){this._defaultZIndex=null;o.data("topDefault","-5000px");var E=!1,y=j.isDrawn(),w=j.transitionMode(),B=i.transitionMode(),A="auto";if(w=="postrendering"||B=="postrendering")A="postrendering";else if(w=="prerendering"||B=="prerendering")A="prerendering";A=A==d?
"auto":A;(E=A=="postrendering"?!0:A=="prerendering"?!1:y?i.transitionTime(d,j.id())<a.Widgets.WiziCore_Api_Page.MAX_TRANSITION_TIME?!1:!0:!0)||I();i&&i.pageContainer().centerCont.css({top:""});this.setFixedStaticContainersPosition(b,j,i);E?(b.twirlyThing(b,!0),setTimeout(function(){I();b.twirlyThing(b,!1);e(q,p,o,m,E).done(function(a){v.dropFixedStaticContainersPosition(b,j,i);i.transitionTime(a,j.id());z()})},100)):e(q,p,o,m,E).done(function(a){v.dropFixedStaticContainersPosition(b,j,i);i.transitionTime(a,
j.id());z()})}else{w=2E3;y=1;if(k){if(!this._defaultZIndex)this._defaultZIndex=this._findMaxZIndex(m.parent());w=this._defaultZIndex+2E3;y=w-500}else this._defaultZIndex=null,o.data("topDefault","-5000px");p?(m.css("z-index",w),o.css("z-index",y)):(m.css("z-index",y),o.css("z-index",w));l.call(v);j.setDesktopPagePos();j.onPagePainted();C&&j.pageContainer().centerCont.css({top:-j.scrollTop()});i&&i.pageContainer().centerCont.css({top:-i.scrollTop()});f(q,p,o,m,y,w).done(z)}}},_moveStaticPanelsToPage:function(a,
b){var c=jQuery.fn.__useTr;jQuery.fn.__useTr=!1;a.top&&b&&a.top.prependTo(b.pageContainer().base);a.bottom&&b&&a.bottom.appendTo(b.pageContainer().base);jQuery.fn.__useTr=c},setFocusToChild:function(a){if(!WiziCore_Helper.isMobile()&&!(this.mode()!=g.RUN_MODE||a.form().isEmbed()||a.form().isIframeMode())){var b=null,c=null;a.traverseChildren(function(a){var e=a.prop("tabindex"),f=a.prop("tabStop"),e=e==d?null:e;e!=null&&f&&(b==null?(b=e,c=a):b>e&&(b=e,c=a))});c!=null&&c.setFocus()}},formPages:function(a){a=
this._visualized[a];return a==d?null:a.pages},form:function(a){a=this._visualized[a];return a==d?null:a.project},currentFormPage:function(a,b){var c=this._visualized[a];return c==d?null:b&&c.dialog.mode?c.dialog.currentPage:c.currentPage},isDialogMode:function(a){a=this._visualized[a];return a==d?null:a.dialog.mode?!0:!1},collectTabIndex:function(a){if(a){var b=this;this._tabIndexColectables=[];a.tableBase().find("input,a,textarea,select").each(function(){var a=$(this),c=a.attr("tabindex");isNaN(c)||
(b._tabIndexColectables.push([a,a.attr("tabindex")]),a.attr("tabindex","-1"))})}},restoreTabIndex:function(a){if(a&&this._tabIndexColectables)for(a=0;a<this._tabIndexColectables.length;a++)this._tabIndexColectables[a][0].attr("tabindex",this._tabIndexColectables[a][1])},showPageDialog:function(a,b){var c=this.currentFormPage(a,!0),e=this.getPageFromForm(a,b);if(e!=d){var f=this._visualized[a];if(!(f==d||f.dialog&&f.dialog.currentPageId==b)){var k=$("<div class='waDialogModeOverlay'/>").css({"z-index":this._findMaxZIndex(f.div)+
50});e.id()!=c.id()&&this.collectTabIndex(c);this.setDialogMode(a,!0);f.div.prepend(k);c.pageDisableDiv(k);this.showPage(a,b,!1,d,{transition:null});f.dialogHistory.push({lastId:c.id(),overlay:k});this.mobileScrollDialogFix(a,b,!0,k)}}},mobileScrollDialogFix:function(a,d,e,f){var o=WiziCore_Helper.isMobile()||WiziCore_Helper.isNative(),k=$(c),l=$(b),n=this._visualized[a].pages[d],a=this._visId+".dialog-"+d;if(e){var g=function(){};if(o){var q=WiziCore_Helper.isPositionFixedSupport();q?n.form().isEmbed()?
f.css({left:"",top:""}):WiziCore_Helper.isAndroid()&&!WiziCore_Helper.isAndroid4()?f.css({left:"",top:"",width:l.width()+"px",height:l.height()+"px"}):f.css({position:"fixed",left:"",top:""}):(k.scrollTop()<1&&c.scrollTo(0,1),g=function(){var a=WiziCore_Helper.getWindowDimension();f.css({top:k.scrollTop(),left:k.scrollLeft(),width:a.width,height:a.height})},g());$(b,c).unbind("scroll."+a).bind("scroll."+a,function(){var a=function(){n.hasFocus()||(n.setDesktopPagePos(!0),q||(WiziCore_Helper.isIOS()?
f.css({top:k.scrollTop(),left:""}):n.pWidth()?f.css({top:k.scrollTop(),left:""}):f.css({top:k.scrollTop(),left:k.scrollLeft()})));if(WiziCore_Helper.isNative()&&WiziCore_Helper.isIOS()&&!WiziCore_Helper.isIPad()){n.setDesktopPagePos(!0);var a=WiziCore_Helper.getWindowDimension();f.css({width:a.width,height:a.height})}};WiziCore_Helper.isMobile()&&!WiziCore_Helper.isPositionFixedSupport()?setTimeout(function(){a()},400):a()})}else n.form().isEmbed()?f.css({left:"",top:""}):f.css({position:"fixed",
left:"",top:""});k.unbind("resize."+a).bind("resize."+a,function(){g();n.setDesktopPagePos()})}else o&&$(b,c).unbind("scroll."+a),k.unbind("resize."+a)},removePageDialog:function(a){var b=this.currentFormPage(a,!0);this.restoreTabIndex(b);if(b!=d&&b._isDrawn&&this.isDialogMode(a)){WiziCore_Helper.showClickHelper();if(c.Code)c.Code.PhotoSwipe.stopTapEvent=!0;b.dialogMode(!1);b.hide();this.mobileScrollDialogFix(a,b.id(),!1);var b=this._visualized[a],e=b.dialogHistory;b.dialog.currentPage=null;b.dialog.currentPageId=
null;b.dialog.div=null;b.dialog.prevPageId=null;if(e.length>0){var f=e.pop();e.length==0&&this.setDialogMode(a,!1);f.overlay.remove();this.showPage(a,f.lastId,!1,d,{transition:null},!0)}setTimeout(function(){if(c.Code)c.Code.PhotoSwipe.stopTapEvent=!1;WiziCore_Helper.hideClickHelper()},400);a=this.currentFormPage(a,!0);b.form._setCurrentPage(a);a.pageDisableDiv(null)}},getPageFromForm:function(a,b){var c=this._visualized[a];return c==d?null:c.form.getPageByUid(b)},_findMaxZIndex:function(a){var b=
20;a.children().each(function(){var a=parseInt($(this).css("z-index"));$(this).attr("data-role")!="dialog"&&$(this).css("z-index")!="auto"&&a>b&&(b=a)});return parseInt(b)},visProject:function(){return this._visualized}});g.EDITOR_MODE=0;g.RUN_MODE=1;return g}(AC,document,window),WiziCore_Helper=function(a,b){function c(){return!0}function d(){return!1}function e(){var a=f.getWindowDimension();g.width(a.width);g.height(a.height)}var f={_isConfirmClose:!1,_isIE7:null,_isIE8:null,_openedDialogs:0,googleMapsApiVersion:null,
appLoadSplashHide:function(c){f.appLoadSplashHide=c?c.widgetClass!=b?function(){}:function(b){a(b).one(AC.Widgets.WiziCore_Api_Page.onPagePreShow,function(){c.remove();a(".m-ui-disableresize").removeClass("m-ui-disableresize");setTimeout(function(){window.scrollTo(0,1)},0)});f.appLoadSplashHide=function(){}}:function(){}},isFirefox:function(){var a=RegExp("firefox","gi").test(navigator.userAgent);f.isFirefox=a?c:d;return a},isMobile:function(){var a=/(mobile|android)/i.test(navigator.userAgent);f.isMobile=
a?c:d;return a},isAndroid:function(){var a=/android/gi.test(navigator.appVersion);f.isAndroid=a?c:d;return a},isAndroid4:function(){var a=/android 4/gi.test(navigator.appVersion);f.isAndroid4=a?c:d;return a},isAndroid4_0:function(){var a=/android 4\.0/gi.test(navigator.appVersion);f.isAndroid4_0=a?c:d;return a},getAndroidVersion:function(){var a=navigator.appVersion.match(/android (\d+)\.(\d+)\.(\d+)/i);if(a!=null){a.splice(0,1);for(var b=0;b<a.length;b++)a[b]=parseInt(a[b],10)}f.getAndroidVersion=
function(){return a};return a},getCordovaVersion:function(){var a=null,b=window.device;if(b&&b.cordova){a=b.cordova.match(/(\d+)\.(\d+)\.(\d+)/i);if(a!=null){a.splice(0,1);for(b=0;b<a.length;b++)a[b]=parseInt(a[b],10)}f.getCordovaVersion=function(){return a}}return a},getPlatform:function(){var a="unknown";if(f.isAndroid())a="android";else if(f.isIOS())a="ios";else for(var b=[{platform:"windows",identity:"Windows"},{platform:"mac",identity:"Mac"},{platform:"linux",identity:"Linux"},{platform:"windows",
identity:"Win32"},{platform:"windows",identity:"Win64"}],c=b.length,d=0;d<c;d++)if(navigator.platform.indexOf(b[d].identity)!=-1){a=b[d].platform;break}f.getPlatform=function(){return a};return a},getPlatfromInfo:function(){var a=f.getPlatform(),c={};c.platform=a;switch(a){case "ios":c.iOSVersion=(""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",".")||0;c.isIPad=f.isIPad();c.isIPhone=f.isIPhone();
c.isOldIPhone=f.isOldiPhone();break;case "android":var d=f.getAndroidVersion();c.androidVersion=d!=b?d.join("."):"unknown"}for(var d=[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome",versionSearch:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{string:navigator.userAgent,subString:"Mobile Safari",identity:"Mobile Safari",versionSearch:"Version"},
{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox",versionSearch:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",
identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],e=function(a,b){if(a&&b){var c=a.indexOf(b);return c==-1?void 0:parseFloat(a.substring(c+b.length+1))}},l=0,n=d.length;l<n;l++){var g=d[l].string;if(g&&g.indexOf(d[l].subString)!=-1){c.browser=d[l].identity;if(d[l].versionSearch&&(c.version=e(navigator.userAgent,d[l].versionSearch)||e(navigator.appVersion,d[l].versionSearch),a=="ios"))c.version=e(navigator.userAgent,
"Mobile"),c.browser="Mobile "+c.browser;break}}c.browser=c.browser||"unknown";c.version=c.version||"unknown";c.isNative=f.isNative();f.getPlatfromInfo=function(){return c};return c},getPlatformInfo:function(){return f.getPlatfromInfo()},canUseSmsBody:function(){var a=f.isMobile()||f.isNative(),b=f.getAndroidVersion(),e=f.isIOS()&&a,a=f.isAndroid()&&a,k=!0;if(e||a&&!(b[0]==4&&b[1]>0)&&!(b[0]==2&&b[1]>2&&b[2]>3))k=!1;f.canUseSmsBody=k?c:d;return k},iOSVersion:function(){var a=0,b=navigator.userAgent.match(/AppleWebKit\/([0-9]+)/),
a=(b=!!b&&b[1])?b:a;this.iOSVersion=function(){return a};return a},isOldiPhone:function(){var a=/iPhone/.test(navigator.platform)&&window.devicePixelRatio+""=="1";this.isOldiPhone=function(){return a};return a},generateQRCode:function(a,b){if(!this.isCanvasSupport()&&b)b.render="table";b||(b={});if(!b.text)b.text="";a.empty();a.qrcode(b)},isCanvasSupport:function(){var a=document.createElement("canvas"),b=!(!a.getContext||!a.getContext("2d"));this.isCanvasSupport=function(){return b};return b},isPositionFixedSupport:function(){var a=
!0,b=window,e=navigator.userAgent,k=navigator.platform,l=e.match(/AppleWebKit\/([0-9]+)/),l=!!l&&l[1],n=e.match(/Fennec\/([0-9]+)/),n=!!n&&n[1],g=e.match(/Opera Mobile\/([0-9]+)/),h=b.blackberry&&b.navigator.appVersion.match(/Version\/([0-9]+)/),h=!!h&&parseInt(h[1],10);if((k.indexOf("iPhone")>-1||k.indexOf("iPad")>-1||k.indexOf("iPod")>-1)&&l&&l<534||b.operamini&&{}.toString.call(b.operamini)==="[object OperaMini]"||g&&omverson<7458||e.indexOf("Android")>-1&&l&&l<533||n&&n<6||"palmGetResource"in
window&&l&&l<534||b.blackberry&&h<7||e.indexOf("MeeGo")>-1&&e.indexOf("NokiaBrowser/8.5.0")>-1)a=!1;f.isPositionFixedSupport=a?c:d;return a},isIOS:function(){var a=/iPhone|iPad|iPod/.test(navigator.platform)&&navigator.userAgent.indexOf("AppleWebKit")>-1;f.isIOS=a?c:d;return a},isIPad:function(){var a=/iPad/.test(navigator.platform)&&navigator.userAgent.indexOf("AppleWebKit")>-1;f.isIPad=a?c:d;return a},isIPhone:function(){var a=/iPhone/.test(navigator.platform)&&navigator.userAgent.indexOf("AppleWebKit")>
-1;f.isIPhone=a?c:d;return a},isNative:function(){var a=f.getCordova()!==null;f.isNative=a?c:d;return a},getCordova:function(){var a=null;window.PhoneGap!=b?a=window.PhoneGap:window.cordova!=b?a=window.cordova:window.Cordova!=b&&(a=window.Cordova);f.getCordova=function(){return a};return a},hideCordovaSplashScreen:function(){f.isNative()&&typeof f.getCordova().exec=="function"&&f.getCordova().exec(null,null,"SplashScreen","hide",[])},showCordovaSplashScreen:function(){f.isNative()&&typeof f.getCordova().exec==
"function"&&f.getCordova().exec(null,null,"SplashScreen","show",[])},reCalcElementDOM:function(a){a.addClass("ac-refresh-chrome-element");a.width();a.removeClass("ac-refresh-chrome-element")},hasPlaceholder:function(){var a="placeholder"in document.createElement("input");f.hasPlaceholder=a?c:d;return a},replaceNames:function(a,b){a.name=b[a.name]?b[a.name]:a.name;if(a.children)for(var c=0,d=a.children.length;c<d;c++)a.children[c]=this.replaceNames(a.children[c],b);return a},isRepeatWidget:function(a){a=
a.repeat();return a!=b&&typeof a=="object"},showWarning:function(a,c,d,e,f){var n=AC.Core.lang().trText("dialog_warning"),e=e==b?WiziCore_UI_MessageBoxWidget.MB_OK:e;return this.showDialog(a,n,e,WiziCore_UI_MessageBoxWidget.MB_ICONEXCLAMATION,d,c,null,null,f)},showPrompt:function(a,c,d,e,f){a==b&&(a=AC.Core.lang().tr("dialog_title_prompt"));return this.showDialog({message:"",title:a,buttons:WiziCore_UI_MessageBoxWidget.MB_OKCANCEL,icon:WiziCore_UI_MessageBoxWidget.MB_ICONPROMPT,resizable:d,fullMessage:c,
rule:e,description:f})},showDelete:function(a,b){var c=AC.Core.lang().tr("dialog_title_delete");return this.showDialog(a,c,WiziCore_UI_MessageBoxWidget.MB_YESNO,WiziCore_UI_MessageBoxWidget.MB_ICONDELETE,!1,"",0,b)},showError:function(a,b,c,d){var e=AC.Core.lang().trText("dialog_error");return this.showDialog(a,e,WiziCore_UI_MessageBoxWidget.MB_COPYOK,WiziCore_UI_MessageBoxWidget.MB_ICONERROR,d,b,c)},showValid:function(a,c){var d=AC.Core.lang().tr("dialog_title_validate"),e=WiziCore_UI_MessageBoxWidget.MB_OK,
f=WiziCore_UI_MessageBoxWidget.MB_ICONVALIDATE;typeof a=="string"&&(a="-"+a);if(typeof a=="object"){var n="",g;for(g in a)n+="-"+a[g]+"<br/>";a=n}return this.showDialog(b,d,e,f,c,a)},showCustom:function(a,c,d,e,f){var e=e!=b?e:WiziCore_UI_MessageBoxWidget.MB_OK,n=b;if(f)n=WiziCore_UI_MessageBoxWidget.MB_ICONEXCLAMATION;typeof c=="string"&&(c="-"+c);if(typeof c=="object"){var f="",g;for(g in c)f+="-"+c[g]+"<br/>";c=f}return this.showDialog(b,a,e,n,d,c)},showConfirm:function(a,c,d,e,f){c==b&&(c=AC.Core.lang().tr("dialog_title_question"));
var n=WiziCore_UI_MessageBoxWidget.MB_YESNO;e!=b&&(n=e);return this.showDialog(b,c,n,WiziCore_UI_MessageBoxWidget.MB_ICONQUESTION,d,a,0,f)},showInfo:function(a,c,d,e,f){c==b&&(c=AC.Core.lang().tr("dialog_title_information"));return this.showDialog(b,c,WiziCore_UI_MessageBoxWidget.MB_OK,WiziCore_UI_MessageBoxWidget.MB_ICONINFORMATION,d,a,0,!1,e,f)},showImportExport:function(a,c,d,e,f){c==b&&(c=AC.Core.lang().tr("dialog_title_information"));return this.showDialog(b,c,WiziCore_UI_MessageBoxWidget.MB_CLOSE,
b,d,a,0,!1,e,f)},getOpenedDialogs:function(){return this._openedDialogs},openedDialogsInc:function(){this._openedDialogs++},openedDialogsDec:function(){this._openedDialogs>0&&this._openedDialogs--},showDialog:function(c,d,e,k,l,n,g,q,p,t,u,z,v){var s={},w=this.isMobile();w&&h();s=typeof c=="object"&&arguments.length==1?c:{message:c,fullMessage:n,errorNum:g,buttons:e,icon:k,title:d,autoOpen:u,resizable:l,multiple:q,width:p,height:t,rule:z,description:v};s.widgetClass="WiziCore_UI_MessageBoxWidget";
s.message=s.message==b?"":s.message;s.fullMessage=s.fullMessage==b?"":s.fullMessage;s.errorNum=s.errorNum==b?"":s.errorNum;s.title=s.title==b?"":s.title;s.autoOpen=s.autoOpen==b?!0:s.autoOpen;s.resizable=s.resizable==b?WiziCore_UI_MessageBoxWidget.NO_RESIZABLE:s.resizable;s.multiple=s.multiple==b?!1:s.multiple;s.buttons=s.buttons==b?WiziCore_UI_MessageBoxWidget.MB_OK:s.buttons;s.icon=s.icon==b?WiziCore_UI_MessageBoxWidget.MB_ICONNONE:s.icon;var y=AC.Core.Widgets().getDefaultWidgetProperties(s.widgetClass),
s=a.extend(!0,y,s),s=new WiziCore_UI_MessageBoxWidget({project:s,mode:WiziCore_Visualizer.RUN_MODE});s.drawInConsole();w&&(j(!0),a(s).one(WiziCore_UI_MessageBoxWidget.onDialogClose,function(){f.openedDialogsDec();h();j(!0)}),f.openedDialogsInc());return s},disableInterface:function(c,d,e,f){this.disablePlane(d,e,f);d=a(".wiziAppDisableDivText");d.length==0&&(d=a("<div class='wiziAppDisableDivText'>\r\n    <table align='center' valign='middle'><tr><td>\r\n                <span class=\"wiziAppDisableTextSpan wf-corner-small wf-box-shadow\">\r\n                    <span class=\"loadingImg\"/><br>\r\n                    <span id=\"wiziAppDisableText\"></span>\r\n                </span>\r\n            </td></tr></table>\r\n</div>"));
(f?f:a(document.body)).append(d);c!=b&&a(".wiziAppDisableDivText").find("#wiziAppDisableText").html(c)},disablePlane:function(c,d,e){var d=d===b?0.4:d,c=c===b?"#000":c,f=a(".wiziAppDisableDiv");f.length==0&&(f=a("<div class='wiziAppDisableDiv'>"),f.css({opacity:d,"background-color":c}));(e?e:a(document.body)).append(f)},twirlyThing:function(c,d,e){function k(){p.length>0&&(c.hasClass("ac-twirlyThings-child-hider")&&c.removeClass("ac-twirlyThings-child-hider"),p.remove(),g.unbind("scroll.tw"+n+" "+
h));c.hasClass("WiziCore_Api_Form")&&c.parent().closest(".WiziCore_Api_Form").length==0&&a("html").removeClass("ac-twirlyThing-block-disableInterface")}var e=!e||typeof e!="object"?{}:e,l=e.uid!=b?"ac-twirlyThings-"+e.uid:"ac-twirlyThing-element",n=e.uid!=b?e.uid:"twUid",g=a(window),h="DOMMouseScroll.twParentApp mousewheel.twParentApp touchmove.twParentApp",p=c.children("."+l);d&&c.children(".ac-twirlyThing-element").length>0&&k();if(d){e.zIndex=e.zIndex==b?0:e.zIndex;e.text=e.text==b?"":e.text;e.font=
e.font==b?"":e.font;e.textPadding=e.textPadding==b?"0":e.textPadding;e.bgColor=e.bgColor==b?"white":e.bgColor;e.bgColorBox=e.bgColorBox==b?"transparent":e.bgColorBox;e.color=e.color==b?"black":e.color;e.opacity=e.opacity==b?0.7:e.opacity;e.opacityBox=e.opacityBox==b?1:e.opacityBox;e.image=e.image==b?"Default":e.image;e.top=e.top==b?"0px":e.top;e.left=e.left==b?"0px":e.left;e.border=e.border==b?"none":e.border;e.width=e.width==b?"27px":e.width;e.height=e.height==b?"27px":e.height;e.shadow=e.shadow==
b?"none":e.shadow;e.borderradius=e.borderradius==b?0:e.borderradius;e.padding=e.padding==b?"0":e.padding;var t=a('<div style="width: 100%; height:100%; position : absolute; top: 0; left: 0;" class="ac-twirlyThing-element">\n    <div class="ac-tw-bg" style="width: 100%; height:100%; position : absolute; top: 0; left: 0;"></div>\n    <div class="ac-tw-center" style="margin: auto;left:0; right:0;top:0; bottom:0;position: absolute;border: #000 solid 1px;background: white;text-align: center; width: 100px; height: 100px; overflow: visible;">\n        <span class="loadingImg" style="display: block; margin : 0 auto;"></span>\n        <img class="hourglassImg"/>\n        <span class="ac-tw-text" style="display: block; word-wrap: break-word;"></span>\n    </div>\n</div>');
t.addClass(l);t.css({"z-index":e.zIndex,top:e.top,left:e.left});t.find("div.ac-tw-bg").css({"background-color":e.bgColor,opacity:e.opacity,filter:"Alpha(Opacity="+e.opacity*100+")"});if(e.text||e.text===""||e.text=="0")e.font!=""&&t.find("span.ac-tw-text").css({font:e.font}),t.find("span.ac-tw-text").text(e.text).css({color:e.color,padding:e.textPadding});t.find("div.ac-tw-center").css({width:e.width,height:e.height,border:e.border,"border-radius":e.borderradius,"-moz-border-radius":e.borderradius,
"-webkit-border-radius":e.borderradius,"box-shadow":e.shadow,"-moz-box-shadow":e.shadow,"-webkit-box-shadow":e.shadow,"-khtml-box-shadow":e.shadow,"-icab-box-shadow":e.shadow,"-o-box-shadow":e.shadow,"-ms-box-sizing":"border-box","-webkit-box-sizing":"border-box","-moz-box-sizing":"border-box","box-sizing":"border-box","background-color":e.bgColorBox,padding:e.padding,opacity:e.opacityBox,filter:"Alpha(Opacity="+e.opacityBox*100+")"});c.hasClass("WiziCore_Api_Form")&&c.parent().closest(".WiziCore_Api_Form").length==
0&&(a("html").addClass("ac-twirlyThing-block-disableInterface"),g.bind(h,function(a){a.stopPropagation();a.preventDefault()}),!f.isPositionFixedSupport()&&f.isIOS()&&(d=f.getWindowDimension(),l=screen&&screen.height||d.height,t.width(d.width),t.height(l)));(c.hasClass("WiziCore_Api_Form")||e.displayHourglassOver=="widgetOnly")&&c.addClass("ac-twirlyThings-child-hider");c.parent().closest(".WiziCore_Api_Form").length==0&&(f.isPositionFixedSupport()?c.closest(".ui-dialog").length==0&&!e.runFromPreview&&
t.css({position:"fixed","z-index":1E3}):g.bind("scroll.tw"+n,function(){t&&t.css({top:g.scrollTop(),left:g.scrollLeft()})}));c.addClass("ac-twirlyThings-child");c.append(t);e.image!="Default"&&(t.find(".hourglassImg").attr("src",e.image).css({display:"inline-block"}),t.find(".loadingImg").hide())}else k()},loadMode:function(c,d,e,k,l,n,g,h,p,t){if(c)if(h==b&&(h="Default"),d!==!1&&h!=null){var g=g===b?!0:g,k=k===b?"#000000":k,l=l===b?"#FFFFFF":l,n=n===b?0.7:n,j=a('<div class="wiziLoadMode ac-twirlyThing-element">\n    <div class="wiziLoadModeBg"></div>\n    <table style="width : 100%; height : 100%; position: absolute; top: 0px; left: 0px">\n        <tr style="width : 100%; height : 100%;">\n            <td style="width : 100%; height : 100%;" align="center" valign="middle">\n                <img class="hourglassImg"/>\n                <span class="loadingImg"></span><br>\n                <span class="loadingLogoImgWithA"><span class="loadingLogoImgSmall"></span></span>\n                <span class="loadingSpan"></span>\n            </td>\n        </tr>\n    </table>\n</div>\n');
j.find(".loadingLogoImgWithA").hide();j.find(".wiziLoadModeBg").css({height:"100%",width:"100%","background-color":l,opacity:n,filter:"Alpha(Opacity="+n*100+")"});h!="Default"&&(j.find(".loadingImg").hide(),j.find(".hourglassImg").css("display","inline").attr("src",h));d=="transparent"&&(j.css("background-color","transparent"),j.find(".loadingImg").addClass("wf-corner-small wf-box-shadow").css("background-color","white"));p&&j.find(".loadingImg").css(p);g&&(j.addClass("wiziLoadModeOver"),a.browser.msie&&
(j.css({position:"fixed"}),f.checkForIE7()&&(c.attr("id")=="wiziLiveMode"||c.hasClass("wiziFormApplication"))&&j.css({left:"0px",top:"0px"})));e!=b&&(j.find(".loadingSpan").text(AC.Core.lang().trText(e)),j.find(".loadingSpan").css("color",k));var z=0;c.data("wiziloadmode",!0);if(d=="transparent")j.width("100%").height("100%"),c.find("#wiziLiveMode").length>0?c.find("#wiziLiveMode").addClass("ac-twirlyThings-child-hider"):(t&&c.addClass("ac-twirlyThings-child-hider"),c.addClass("ac-twirlyThings-child")),
c.prepend(j);else{var v=function(){++z;c.is(":visible")==0?z<2E3&&c.data("wiziloadmode")===!0&&window.setTimeout(v,10):c.data("wiziloadmode")&&(j.width(c.width()).height(c.height()),c.find("#wiziLiveMode").length>0?c.find("#wiziLiveMode").addClass("ac-twirlyThings-child-hider"):(t&&c.addClass("ac-twirlyThings-child-hider"),c.addClass("ac-twirlyThings-child")),c.prepend(j))};v()}}else c.find("> .wiziLoadMode").remove(),c.data("wiziloadmode",!1),c.find("#wiziLiveMode").length>0?c.find("#wiziLiveMode").removeClass("ac-twirlyThings-child-hider"):
c.removeClass("ac-twirlyThings-child-hider")},enableInterface:function(){a(".wiziAppDisableDiv").remove();a(".wiziAppDisableDivText").remove()},checkEmail:function(a){return RegExp("[\\w\\.+]{1,}[@][\\w\\-]{1,}([.]([\\w\\-]{1,})){1,5}$","ig").test(a)},updateDomainLogins:function(c){var d=[];try{d=JSON.parse(AC.Core.cookie().cookie("domainLogins")),d=!a.isArray(d)?[]:d}catch(e){acDebugger.systemLog("domainLogins no data"),d=[]}for(var f=window.location.host,l="."+RegExp("[^.]*.[^.]*$","ig").exec(f)[0],
n=[],g=10,h=0,p=d.length;h<p;h++)d[h]!==f&&g>0&&(n.push(d[h]),g--);d=n;(c==!0||c==b)&&d.splice(0,0,f);c=JSON.stringify(d);AC.Core.cookie().cookie("domainLogins",c,{expires:2592E3,path:"/",domain:l})},confirmCloseEnable:function(a){this.closeMessage=a;window.onbeforeunload=wiziAppCheckClose;this._isConfirmClose=!0},confirmCloseDisable:function(){window.onbeforeunload=null;this._isConfirmClose=!1},isConfirmClose:function(){return this._isConfirmClose},generateId:function(a,c,d){var d=d!==b?d:"abcdefghijklmnopqrstuvwxyz0123456789-",
e=d.length,a=a==b?36:a,c=c==b?"w":c;c.length!=0&&(a-=c.length);for(var f=0;f<a;f++){var n=parseInt(e*Math.random());c+=d.charAt(n)}return c},generateUniqueId:function(a,b){return f.generateId(a,b)},inArray:function(a,b){for(var c=0;c<b.length;c++)if(a==b[c])return!0;return!1},canGetScript:function(a){var b=!0;(a.indexOf("http:")==0||a.indexOf("https:")==0)&&!this.isPhoneGapOnline()&&(b=!1);return b},openExternal:function(b){var c=a('<a href="" target="_blank"/>')[0];c.href=b;b=document.createEvent("UIEvents");
b.initEvent("click",!0,!0);c.dispatchEvent(b)},isPhoneGapOnline:function(){var a=null,b=f.getCordovaVersion(),b=b&&(b[0]>2||b[0]==2&&b[1]>=3);if(navigator)if(navigator.connection&&b)a=navigator.connection;else if(navigator.network&&navigator.network.connection)a=navigator.network.connection;return f.getCordova()!=null&&a&&window.Connection&&(a.type==Connection.NONE||a.type==Connection.UNKNOWN)?!1:!0},labelTextCheck:function(a){return a.replace(RegExp("(<.*?>)","g"),"")},isLngToken:function(a){a+=
"";return a!=null&&a.match(/^ac\-([\w-]+)$/g)!=null},findWidgetInContext:function(a,b){return b.find(a)},getCkEditorStyles:function(b,c){var d=[{name:"Marker: Yellow",element:"span",styles:{"background-color":"Yellow"}},{name:"Marker: Green",element:"span",styles:{"background-color":"Lime"}},{name:"Big",element:"big"},{name:"Small",element:"small"},{name:"Typewriter",element:"tt"},{name:"Computer Code",element:"code"},{name:"Keyboard Phrase",element:"kbd"},{name:"Sample Text",element:"samp"},{name:"Variable",
element:"var"},{name:"Deleted Text",element:"del"},{name:"Inserted Text",element:"ins"},{name:"Cited Work",element:"cite"},{name:"Inline Quotation",element:"q"},{name:"Image on Left",element:"img",attributes:{style:"padding: 5px; margin-right: 5px",border:"2",align:"left"}},{name:"Image on Right",element:"img",attributes:{style:"padding: 5px; margin-left: 5px",border:"2",align:"right"}},{name:"Borderless Table",element:"table",styles:{"border-style":"hidden","background-color":"#E6E6FA"}},{name:"Square Bulleted List",
element:"ul",styles:{"list-style-type":"square"}}],e=b.themeContent()[c],f;if(e)for(var n in e){var g="color,font,background-color,line-height,letter-spacing,paragraphSpacing".split(",");this.getEscapedStyleName(n,c);f={name:n,element:"span",styles:{color:"",font:"","background-color":"","line-height":"","letter-spacing":""}};var h=e[n];if(h)for(var p in h)a.inArray(p,g)!==-1&&(f.styles[p]=h[p]);d.push(f)}return d},getEscapedStyleName:function(a,b){var c="-"+a.replace(RegExp(" ","ig"),"sub236"),c=
c.replace(RegExp("\\.","ig"),"sub237"),c=c.replace(RegExp("#","ig"),"sub238");return"ac-"+b+c},appendStyleSheetsForWidgets:function(b,c,d){d&&a("style."+c).remove();if(a("style."+c).length==0&&(b=b.themeContent()[c])){var d="<style class='"+c+" ac-widget-style-content'>",e;for(e in b){var f=b[e];d+="."+this.getEscapedStyleName(e,c)+"{";for(var g in f)if(f[g]){switch(g){case "fontColor":d+="color";break;case "bgColor":d+="background-color";case "background_color":d+="background-color";break;case "lineHeight":d+=
"line-height";break;case "letterSpacing":d+="letter-spacing";break;default:d+=g}d+=":"+f[g]+";"}d+="}"}d+="</style>";a(document.body).prepend(a(d))}},mapEnum:function(a,b){var c={},d;for(d in b)c[a[d]]=b[d];return c},setIfNeedDefaultContainerBorder:function(a,c){var d=c==b||c=="",e=!d?parseInt(c)<1:!0;(e=!e&&!d?c.indexOf("none")!=-1:e)&&a.css("border","1px dotted #000000")},getWidgetPosition:function(a){return{x:parseInt(a.prop("x"),10),y:parseInt(a.prop("y"),10)}},expandWidgetSizeByProp:function(a,
b,c){if(b=="width")return f.expandWidgetWidth(a,c);else if(b=="height")return f.expandWidgetHeight(a,c);return!1},expandWidgetWidth:function(a,b){var c=parseInt(a.width()),d=parseInt(b);return c<d?(a.object().prop("width",d),!0):!1},expandWidgetHeight:function(a,b){var c=parseInt(a.height()),d=parseInt(b);return c<d?(a.object().prop("height",d),!0):!1},FlagStorage:"WiziCore_FlagStorage",setLocalStorageFlag:function(a,b){try{var c=window.localStorage.getItem(f.FlagStorage),d=c?JSON.parse(c):null,d=
d==null?{}:d;d[a]=b;c=JSON.stringify(d);window.localStorage.setItem(f.FlagStorage,c)}catch(e){acDebugger.systemLog("error in save data to local storage e:",e)}},getLocalStorageFlag:function(a){var b=null;try{var c=window.localStorage.getItem(f.FlagStorage);c!=null&&(b=JSON.parse(c)[a])}catch(d){acDebugger.systemLog("error in get data from local storage e:",d),b=null}return b},expandWidgetSizeByChild:function(a,b){var c=parseInt(b.object().prop("width")),d=parseInt(b.object().prop("height")),e=parseInt(b.object().prop("x")),
f=parseInt(b.object().prop("y")),g=parseInt(a.object().prop("width")),h=parseInt(a.object().prop("height"));c+=e;d+=f;c>g&&a.object().prop("width",c);d>h&&a.object().prop("height",d)},selectContainersFromWidgets:function(a){for(var c=[],d=0;d<a.length;++d){var e=a[d],f=e.object!=b?e.object:e.object()!=b?e.object():e;f!=null&&AC.Core.Widgets().getContainerType(f.widgetClass())==AC.Widgets.Base.CASE_TYPE_CONTAINER&&c.push(e)}return c},callCallback:function(a,b){typeof a=="function"&&a.apply(null,b)},
cloneAction:function(a,b,c){var d=null,e;for(e in a.actions().system){var f=a.actions().system[e];if(f.objectid==b.id()){d={objectid:c.id(),actionid:f.actionid,handler:f.handler,actions:f.actions};break}}return d},getFileExt:function(a){a=(a+"").split(".");return a[a.length-1].toLowerCase()},escapeString:function(a){return(a+"").split("\\").join("\\\\").split('"').join('\\"').split("'").join("\\'")},escapeHTMLtags:function(a){return(a+"").replace(RegExp("<|>","g"),function(a){return a=="<"?"&lt;":
"&gt;"})},isInt:function(a){var b=parseInt(a);return isNaN(b)?!1:a==b&&a.toString()==b.toString()},checkForIEandBlock:function(){var b=!0;a.browser.msie&&(this.showWarning("",AC.Core.lang().tr("helper_ie_not_supp"),!1),b=!1);return b},checkForIE7:function(){if(this._isIE7===null)this._isIE7=a.browser.msie&&parseInt(a.browser.version,10)<=7;return this._isIE7},checkForIE8:function(){if(this._isIE8===null)this._isIE8=a.browser.msie&&parseInt(a.browser.version,10)<=8;return this._isIE8},validateLiveName:function(a){return a.replace(RegExp("[^a-z0-9A-Z-._ ]+",
"gi"))===a},clone:function(b){var c={};a.extend(!0,c,{val:b});return c.val},checkFlash:function(){var a=!1;try{var c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"]&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin||c)a=!0}catch(d){navigator.mimeTypes["application/x-shockwave-flash"]!=b&&(a=!0)}return a},getExceptionsString:function(a,b){return a+" '"+b+"' doesn't exist."},trueF:function(){return!0},
falseF:function(){return!1},updateWidgetEventsByName:function(a,c,d){if(d.system!=b){var e=d.system,f=null,f=AC.Widgets.WiziCore_Api_Form.Scripts.CLIENT;this._checkUserScripts(d,f,"files");this._checkUserScripts(d,f,"folders");for(var g=d[f].files,h=0,q=e.length;h<q;h++)if(e[h].objectid==a&&(f=e[h],f!=null)){var p=this.createFunctionHandler(c,f.actions,"").fHandler,j=RegExp(f.handler,"ig");if(d.userCode!=null)d.userCode=d.userCode.replace(j,p);if(f.code!=b)f.code=f.code.replace(j,p);for(var u in g)g[u]=
g[u].replace(j,p);f.handler=p}}return d},_checkUserScripts:function(c,d,e){c&&(c[d]==b?c[d]={}:a.isArray(c[d])&&c[d].length==0&&(c[d]={}),c[d][e]==b?c[d][e]={}:a.isArray(c[d][e])&&c[d][e].length==0&&(c[d][e]={}))},pageFileExists:function(a){var b=!1,c=WiziCore_ManagerContext.getInstance().editor.form().actions()[AC.Widgets.WiziCore_Api_Form.Scripts.CLIENT].files,a=a.toUpperCase(),d;for(d in c)if(a==d.toUpperCase()){b=d;break}return b},checkUserName:function(a){return/^[^ ].*$/.test(a)},checkWidgetName:function(c,
d){var e=WiziCore_ManagerContext.getInstance().editor,g=c.replace(RegExp("\\s","g"),"_"),l=!1,l=g==""?null:e.form().findName(g),n=!1,h=!1,e=e.selectManager(),q="";if(e&&(e=e.selectedObjects())&&e[0])e[0].object.widgetClass()=="WiziCore_Api_Page"&&(h=!0),e[0].object.widgetClass()=="WiziCore_Api_Form"&&(n=!0);if(l==null){var p;h&&(p=/[^a-z0-9A-Z\-\._ ]+/);l=f.checkAppName(g,n,b,p)?g:!1}else g!=d&&g.toUpperCase()!=d.toUpperCase()?(q=AC.Core.lang().tr("widget_name_used"),f.showWarning(a(q).text()),l=
!1):l=g;return l},checkAppName:function(c,d,e,g){if(c==b||a.trim(c)=="")return!1;var d=d==b||d?!0:!1,l="",n=!0,g=(g||/[#",\.<>\\\/']/).test(c),h=/^[\.,"\'?!;:#\$%&\(\)*+-\/<>=@\[\]\\\^_\{\}|~\s\d]/.test(c[0]);if((h==!1?g:h)==!1){var g="break,if,else,function,case,delete,while,repeates,repeat,pages,showPage,showPrevPage,showNextPage,showPageByNum,theme,themeName,findName,find,buildDOMChield,buildDOM,executeActions,actions,level,pagescount,deleteRepeates,addRepeates,deleteItem,deletePage,addItem,addPage,createItem,createPage,project,prop,buildProjectFromJSON,offset,init,createItem,clone,addItem,deleteItem,getAvailableProps,getAvailableMethods,parent,id,name,widgetClass,children,childrencount,form,page,repeat,isRepeatShowOn,wiziHandlerAddEvent,wiziHandlerRemoveEvent,eventsHandles".split(","),
q;for(q in g)if(c==g[q]){n=!1;l=d?AC.Core.lang().tr("console_application_dialog_createform_error_name_reserved"):AC.Core.lang().tr("console_error_name_reserved");break}}else l=h==!0?d?AC.Core.lang().tr("console_application_dialog_createform_error_name_num_first"):AC.Core.lang().tr("console_error_name_num_first"):AC.Core.lang().tr("console_application_dialog_createform_error_name_special_chars"),n=!1;!d&&c=="application"&&(l=AC.Core.lang().tr("console_error_name_reserved"),n=!1);return e?{allow:n,
error:a(l).text()}:(n==!1&&f.showWarning(a(l).text()),n)},createFunctionHandler:function(a,c,d,e){var f=c.params,a=e!=b&&e==="WiziCore_Api_Form"?"application":a.replace(RegExp("[^\\w]","g"),"_"),a="handler_"+a+"_"+c.funcview,c="function "+a+"(";f!=b&&(c+=f);d=d==b?"\n\t\n":d;c+="){"+d+"}\n";return{fCode:c,fHandler:a}},_getUniqueName:function(a,b){var c=a.search(/\d+$/),d=a;f.indexOf(b,d)!=-1&&c!=-1&&(d=d.substring(0,c));if(f.indexOf(b,d)!=-1)for(var c=d,e=1;e<999999;e++){if(f.indexOf(b,c)==-1){a=
c;break}c=d+e}else a=d;return a},getMaxTabOrder:function(a){var c=1;(a.page()!=b?a.page():a.form()).traverseChildren(function(a){a=parseInt(a.prop("tabindex"));!isNaN(a)&&a>=c&&(c=a+1)});return c},identifyMaxContainerZIndex:function(a){var b=0;a.children().map(function(a){a=parseInt(a.zindex());isNaN(a)||(b=Math.max(b,a))});return b},getMinZIndexFromProps:function(a,b){var c=0;a.map(function(a){a=parseInt(b!==!0?a.zindex:a.project.zindex);a=isNaN(a)?0:a;c=c==0?a:Math.min(c,a)});return c},objectIsEmpty:function(a){for(var b in a)if(Object.prototype.hasOwnProperty.call(a,
b))return!1;return!0},objectsAreEqual:function(a,b){if(a==null&&b==null)return!0;for(var c in a)if(!(c in b))return!1;for(c in b)if(!(c in a))return!1;for(c in a){var d=a[c],e=b[c],g=typeof d;if(g!=typeof e)return!1;switch(g){case "object":if(!f.objectsAreEqual(d,e))return!1;break;case "function":if(d.toString()!=e.toString())return!1;break;default:if(d!=e)return!1}}return!0},setDocumentTitle:function(a,c){if(a!=b)if(a=="login")document.title=AC.Core.lang().trText("page_login");else if(a=="console")document.title=
AC.Core.lang().trText("page_console");else if(a=="application")document.title=c+" Application - Application Craft"},getHttpUrl:function(a){a.indexOf("https://")==0&&(a=a.replace("https://","http://"));return a},getTopZIndex:function(b){return Math.max(0,Math.max.apply(null,a.map(a(b||"body *"),function(b){return parseInt(a(b).css("z-index"))||null})))},isPrinting:function(){return!!this.getPrintData()},getPrintData:function(){if(this._printingData===b&&(this._printingData=null,!a.browser.msie))if(window.hasOwnProperty("acPrinting")){var c=
window.acPrinting;this._printingData=c=!c?{}:c}else{var c=WiziCore_AppContext.getInstance().inputParameters(),d=c.printing;if(c.hasOwnProperty("printing")){try{d=unescape(!d?"{}":d),d=JSON.parse(d)}catch(e){this._printingData=null}this._printingData=d}}return this._printingData},callPrint:function(){if(this.isPrinting())window.status="readyForPrinting"},pageChangingHook:function(b,c,d,e,f){function g(){c.hide();f.disabled&&c.attr("disabled",!0)}this.isMobile()?(this.removePageChangingHook(b,d),e.page()&&
e.page().isPageChanging()&&g(),a(b).bind(AC.Widgets.WiziCore_Api_Form.PageChanging.onStart+"."+d,function(){g()}).bind(AC.Widgets.WiziCore_Api_Form.PageChanging.onStop+"."+d,function(){c.show();f.disabled&&(c.removeAttr("disabled"),e._updateEnable())})):this.pageChangingHook=function(){}},removePageChangingHook:function(b,c){a(b).unbind(AC.Widgets.WiziCore_Api_Form.PageChanging.onStart+"."+c+" "+AC.Widgets.WiziCore_Api_Form.PageChanging.onStop+"."+c)},getWindowDimension:function(){var a={width:0,
height:0};window.innerHeight!==b?(a.width=window.innerWidth,a.height=window.innerHeight):(a.width=document.body.clientWidth?document.body.clientWidth:document.documentElement.clientWidth,a.height=document.body.clientHeight?document.body.clientHeight:document.documentElement.clientHeight);return a},getOutputWindowDimensions:function(b){var c={};if(b.runtimeMode()==WiziCore_UI_FormRuntime.PREVIEW_MODE){b=this._outputWindow;if(!b||!b.is(":visible"))b=this._outputWindow=a("#wiziFormPreviewContentFrame");
c.widht=b.width();c.height=b.height()}else c=this.getWindowDimension();return c},isDate:function(a){var b=!0;Object.prototype.toString.call(a)==="[object Date]"?isNaN(a.getTime())&&(b=!1):b=!1;return b},isoDateString:function(a,b,c,d,e){function f(a){return a<10?"0"+a:a}e=="utc"?b.setMinutes(b.getMinutes()-(new Date(b)).getTimezoneOffset()):e=="rtz"&&b.setMinutes(b.getMinutes()+a.getTimeZone()-(new Date(b)).getTimezoneOffset());return(d?b.getUTCFullYear():b.getFullYear())+"-"+f((d?b.getUTCMonth():
b.getMonth())+1)+"-"+f(d?b.getUTCDate():b.getDate())+"T"+(c?f(d?b.getUTCHours():b.getHours()):"00")+":"+(c?f(d?b.getUTCMinutes():b.getMinutes()):"00")+":"+(c?f(d?b.getUTCSeconds():b.getSeconds()):"00")+"Z"},parseUTCISO8601:function(a,b,c,d){var e=b.split("T"),b=e[0].split("-"),e=e[1].split("Z")[0].split(":"),f=e[2].split("."),g=+e[0],h=new Date;c?(h.setUTCFullYear(+b[0]),h.setUTCMonth(+b[1]-1),h.setUTCDate(+b[2]),h.setUTCHours(+g),h.setUTCMinutes(+e[1]),h.setUTCSeconds(+f[0]),f[1]&&h.setUTCMilliseconds(+f[1])):
(h.setFullYear(+b[0]),h.setMonth(+b[1]-1),h.setDate(+b[2]),h.setHours(+g),h.setMinutes(+e[1]),h.setSeconds(+f[0]),f[1]&&h.setMilliseconds(+f[1]));d=="utc"?h.setMinutes(h.getMinutes()+(new Date(h)).getTimezoneOffset()):d=="rtz"&&h.setMinutes(h.getMinutes()-a.getTimeZone()+(new Date(h)).getTimezoneOffset());return h},mysqlTimeStampToDate:function(a){a=a.replace(/^([0-9]{2,4})-([0-1][0-9])-([0-3][0-9]) (?:([0-2][0-9]):([0-5][0-9]):([0-5][0-9]))?$/,"$1 $2 $3 $4 $5 $6").split(" ");return new Date(a[0],
a[1]-1,a[2],a[3],a[4],a[5])},dateToMysqlTimeStamp:function(a){var b=new Date(a),a=b.getFullYear(),c=b.getMonth()+1;c<10&&(c="0"+c);var d=b.getDate();d<10&&(d="0"+d);var e=b.getHours();e<10&&(e="0"+e);var f=b.getMinutes();f<10&&(f="0"+f);b=b.getSeconds();b<10&&(b="0"+b);return a+"-"+c+"-"+d+" "+e+":"+f+":"+b},dateStrToJsDate:function(a){var b;b=this.dbDateToJSDate(String(a));if(b==null||b&&b.toString()=="Invalid Date")b=new Date(String(a));return b},dbDateToJSDate:function(a){var b=null;if(a=/([0-9]+)-([0-9]+)-([0-9]+)[T\s]([0-9]+):([0-9]+):([0-9]+)*/.exec(a))b=
new Date,b.setUTCFullYear(a[1],a[2]-1,a[3]),b.setUTCHours(a[4],a[5]),b.setSeconds(a[6]);return b},dateToStringFormat:function(a,b){var c=function(a){var b=a;a<10&&(b="0"+a);return b},d=""+a,e=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),h=b.getFullYear(),p=b.getMonth()+1,j=b.getDate(),d=d.replace(/\bHH\b/g,c(e)),d=d.replace(/\bMM\b/g,c(f)),d=d.replace(/\bSS\b/g,c(g)),d=d.replace(/\bmm\b/g,c(p)),d=d.replace(/\byy\b/g,h);return d=d.replace(/\bdd\b/g,c(j))},callCallbackAndCatchErrors:function(a,b,
c,d){try{typeof c=="function"&&c.apply(null,d)}catch(e){a._onUserCodeError(e,b)}},isInteger:function(a){return/^\s*(\+|-)?\d+\s*$/.test(a)},decodeHTML:function(b){return b==""?b:a("<div/>").html(b).text()},isUrl:function(a){return/^(https?|ftp|file):\/\/[^\s]+$/.test(a)},getBoxSizing:function(a){var b=null;a&&(b=f.isFirefox()?a.css("-moz-box-sizing"):a.css("box-sizing"));return b}};f.initIEFixes=function(){var a=Array.prototype.filter;a||(a=function(a,b){var c=[],d,e;for(d=0,e=this.length;d<e;d++)a.call(b,
this[d])&&c.push(this[d]);return c});f.filter=function(b,c,d){return a.apply(b,[c,d])};var b=Array.prototype.map;b||(b=function(a,b){if(this===void 0||this===null)throw new TypeError;var c=Object(this),d=c.length>>>0;if(typeof a!=="function")throw new TypeError;res=Array(d);for(var e=0;e<d;e++)e in c&&(res[e]=a.call(b,c[e],e,c));return res});f.map=function(a,c,d){return b.apply(a,[c,d])};var c=Array.prototype.indexOf;c||(c=function(a){if(this===void 0||this===null)throw new TypeError;var b=Object(this),
c=b.length>>>0;if(c===0)return-1;var d=0,e=d;arguments.length>0&&(d=Number(arguments[1]),d!==d?d=0:d!==0&&d!==1/e&&d!==-(1/e)&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;for(d=d>=0?d:Math.max(c-Math.abs(d),0);d<c;d++)if(d in b&&b[d]===a)return d;return-1});f.indexOf=function(a,b,d){return c.apply(a,[b,d])}};f.encode64=function(a){var b="",c,d,e,f,g,h,p=0,a=a.replace(/\r\n/g,"\n");d="";for(e=0;e<a.length;e++)f=a.charCodeAt(e),f<128?d+=String.fromCharCode(f):(f>127&&f<2048?d+=String.fromCharCode(f>>
6|192):(d+=String.fromCharCode(f>>12|224),d+=String.fromCharCode(f>>6&63|128)),d+=String.fromCharCode(f&63|128));for(a=d;p<a.length;)c=a.charCodeAt(p++),d=a.charCodeAt(p++),e=a.charCodeAt(p++),f=c>>2,c=(c&3)<<4|d>>4,g=(d&15)<<2|e>>6,h=e&63,isNaN(d)?g=h=64:isNaN(e)&&(h=64),b=b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g)+
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h);return b};f.decode64=function(a){for(var b="",c,d,e,f,g,h=0,a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<a.length;)c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)),d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)),g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)),
c=c<<2|d>>4,d=(d&15)<<4|f>>2,e=(f&3)<<6|g,b+=String.fromCharCode(c),f!=64&&(b+=String.fromCharCode(d)),g!=64&&(b+=String.fromCharCode(e));a=b;b="";for(h=0;h<a.length;)f=a.charCodeAt(h),f<128?(b+=String.fromCharCode(f),h++):f>191&&f<224?(g=a.charCodeAt(h+1),b+=String.fromCharCode((f&31)<<6|g&63),h+=2):(g=a.charCodeAt(h+1),c3=a.charCodeAt(h+2),b+=String.fromCharCode((f&15)<<12|(g&63)<<6|c3&63),h+=3);return b};f.initIEFixes();var g=a("<div class='wa-visualizer-helper'><input disabled></div>"),h=function(a){a!==
!1&&g.css({left:window.pageXOffset+"px",top:window.pageYOffset+"px"});g.show().attr("tabindex","-1").focus();e()},j=function(a){function b(){g.hide().removeAttr("tabindex");g.css({left:"0px",top:"0px"})}a?setTimeout(function(){b()},400):b()};f.isMobile()?a(document).ready(function(){e();a(document.body).append(g)}):(h=function(){},j=function(){});f.showClickHelper=h;f.hideClickHelper=j;if(!String.prototype.ltrim)String.prototype.ltrim=function(){return this.replace(/^\s+/,"")};if(!String.prototype.rtrim)String.prototype.rtrim=
function(){return this.replace(/\s+$/,"")};return f}(jQuery);function wiziAppCheckClose(){return WiziCore_Helper.closeMessage}function makePropCell(a,b){var c=jqSimpleGrid.types;c[a]=b;c[a].prototype=new c.baseType}
(function(a,b,c,d,e){var f=!d.designerMode?d.advertisingWidget:!1,g=!d.designerMode?d.advertisingSplash:!0,h=!d.designerMode?d.advertisingMandatoryToolbar:!1,j=!d.designerMode?d.advertisingBadKeywords:!1,i=null,m,o=d.advertisingPosition,k=function(){};d.Advertising={initConsole:function(){WiziCore_AppContext.getInstance();f=d.Features.isAccessAllowed(d.Features.FEATURE_ADS)?!0:!1;d.Features.isAccessAllowed(d.Features.FEATURE_MANDATORY_ADS)&&a.jqSimpleGrid&&(a.jqSimpleGrid.types.advertisingApp=a.jqSimpleGrid.types.featureNotRequired);
if(!d.Features.isAccessAllowed(d.Features.FEATURE_SPLASH)&&a.jqSimpleGrid)a.jqSimpleGrid.types.desktopSplash=a.jqSimpleGrid.types.featureNotAvailable,a.jqSimpleGrid.types.splashScreenOptions=a.jqSimpleGrid.types.featureNotAvailable},initLive:function(b,d){k=d;if(g){var e=i=c('<div class="wa-avrt-splash-main">\r\n    <div class="wa-avrt-splash-first-screen" style="position: absolute; top:0px; left: 0px; width:100%;">\r\n        <span class="wa-avrt-ac-logo"></span>\r\n        <div class="wa-avrt-loading-bg">\r\n            <span class="wa-avrt-loading"></span>\r\n        </div>\r\n        <div class="wa-avrt-splash-btn wa-avrt-splash-learn-more" >LEARN MORE</div>\r\n    </div>\r\n    <div style="display:none; position: absolute; top:0px; left: 0px;" class="wa-avrt-splash-learn-more-screen">\r\n        <span class="wa-avrt-ac-logo"></span>\r\n        <ul class="wa-avrt-list">\r\n            <li>Mobile app development patform</li>\r\n            <li>100% cloud based</li>\r\n            <li>Drag & drop UI</li>\r\n            <li>Build mobile, tablet and desktop apps</li>\r\n        </ul>\r\n        <div class="wa-avrt-splash-btn wa-avrt-splash-btn-appcraft" >WWW.APPLICATIONCRAFT.COM</div>\r\n    </div>\r\n</div>');
e.find(".wa-avrt-splash-learn-more").click(function(){k._stopTimeout=!0;e.find(".wa-avrt-splash-first-screen").hide();e.find(".wa-avrt-splash-learn-more-screen").fadeIn()});e.find(".wa-avrt-splash-btn-appcraft").bind("vclick",function(){WiziCore_Helper.isNative()?WiziCore_Helper.openExternal("http://www.applicationcraft.com"):a.open("http://www.applicationcraft.com","AC_Advert")});this.showPopup(b)}else this.callCallback()},dropRelativePositionByScroll:function(){m&&m.css({left:""})},setRelativePositionByScroll:function(){function b(){var c=
a.pageXOffset;m&&m.css({left:c+"px"})}this.usingAdvertToolbar()?(this.setRelativePositionByScroll=b,b()):this.setRelativePositionByScroll=function(){}},checkWidthOfAdvert:function(a){this.usingAdvertToolbar()&&m&&a(m)},setToolboxTop:function(a){this.usingAdvertToolbar()&&m&&m.css({top:a})},callCallback:function(){if(this.usingAdvertToolbar()){var a=this;m=c("#wiziLiveMode").next();m.addClass("wa-avrt-toolbox");m.show();this.isBottomPosition()||m.addClass("wa-avrt-toolbox-top");WiziCore_Helper.isPositionFixedSupport()||
c(b).scroll(function(){a.setRelativePositionByScroll()});var d=m.find("a"),f=m.find(".wa-avrt-toolbox-fallback");d.length>0&&d.prop("target","_blank");f.length>0&&d.length==0&&f.wrap("<a href='http://www.applicationcraft.com' target='_blank'></a>")}k&&(k(),k=e)},haveBadKeywords:function(){return j},usingAdvertToolbar:function(){return h===!1},usingAdvertSplash:function(){return g},usingAdvertWidget:function(){return f},isBottomPosition:function(){return o=="bottom"},toolbarHeight:function(){return m&&
m.height()||0},previewLink:function(b){var d=WiziCore_Helper.isNative();WiziCore_Helper.isMobile();c(a);c("<div style='position: absolute; top:5px; left:5px; z-index: 10; cursor: pointer; opacity: 0.3; background: black; text-align: center; color:white;' data-lng='ac-advert_ext_preview_text'/>");c("<div style='width:100%; height:100%; position: relative; overflow: hidden;'/>");WiziCore_Helper.getWindowDimension();d?WiziCore_Helper.openExternal(b):a.open(b,"AC_Advert")},showPopup:function(a){function b(){a.removeClass("wa-avrt-splash-bg");
c.callCallback()}a.empty().append(i);a.addClass("wa-avrt-splash-bg");var c=this,d=WiziCore_Helper.isNative(),e=d?2E3:3E3;d&&i.find(".wa-avrt-splash-learn-more").hide();setTimeout(function(){k&&(k._stopTimeout?setTimeout(function(){b()},e):b())},e)}}})(window,document,jQuery,AC);
AC.Lng=function(a){var b=null,c=null,d={},b=a!=void 0?a:AC.Lng.ENGLISH,c={};d.use=function(a){if(a!=void 0)jQuery.fn.__useTr=a;return jQuery.fn.__useTr};d.langName=function(a){a!=void 0&&(b=a);return b};d.lang=function(a,b){a!=void 0&&(c=$.extend(!0,c,a));b!=void 0&&d.langName(b);return c};d.registerWidgetLang=function(a){var b=d.langName();if(b!=void 0&&a!==void 0)b=a[b],b==void 0&&(b=a.en),b!=void 0&&(c=$.extend({},b,c))};d.tr=function(a){return"<span lang='ac-"+a+"'>"+d.trText(a)+"</span>"};d.trText=
function(a){a!=void 0&&a[0]=="*"&&(a=a.substring(1,a.length));return c[a]!=void 0?c[a]:a};d.trAll=function(){};d.trValue=function(a,b){a[0]=="*"&&(a=a.substring(1,a.length));return c[a]!=void 0?c[a]:b};d.trVisible=function(){d.trElement($(document.body))};d.trElement=function(a){if(c&&a){var b=this;$(a).find("*[data-lng|=ac]").not(".wiziFormApplication  *").each(function(){var a=$(this).attr("data-lng"),a=a.substring(3,a.length);$(this).langtext(b.trValue(a,a))})}};return d};AC.Lng.ENGLISH="En";
AC.Lng.RUSSIAN="Ru";
AC.AppLng=function(){var a={};a.tr=function(b,c,d,e){return"<span lang='"+b+"'>"+a.trText(b,c,d,e)+"</span>"};a.trText=function(a,c,d,e,f){a!=void 0&&a[0]=="*"&&(a=a.substring(1,a.length));return!c?a:d&&c[d]&&c[d][a]!=void 0?c[d][a]:!f&&e&&c[e]&&c[e][a]!=void 0?c[e][a]:a};a.trValue=function(a,c,d,e,f){a[0]=="*"&&(a=a.substring(1,a.length));return d[e]&&d[e][a]!=void 0?d[e][a]:d[f]&&d[f][a]!=void 0?d[f][a]:c};a.trElement=function(a,c,d,e){if(c&&a){var f=this;$(a).find("*[data-lng|=ac]").each(function(){var a=$(this).attr("data-lng");
$(this).langtext(f.trValue(a,a,c,d,e))})}};return a};
var WiziCore_ErrorConstants={FOREIGN_INSTANCE_STATUS_ERROR:{code:1E3,message:"In mulitple items request some of the items caused error, check detailed error data."},METHOD_NOT_FOUND:{code:1001,message:"Method not found."},WIDGET_NOT_FOUND:{code:1002,message:"Widget not found."},NO_INSTANCE_AVAILABLE:{code:1003,message:"No instance is available."},INSTANCE_STATUS_ERROR:{code:1004,message:"The item caused error, check detailed error data."},STAGE_NOT_FOUND:{code:1005,message:"Stage not found."}};
function wiziCoreErrorObject(a){var b=null,a=WiziCore_ErrorConstants[a];a!=void 0&&(b=typeof a=="object"?a:{code:a});return b}function raiseWiziCoreError(a){var a=WiziCore_ErrorConstants[a],b,c;a!=void 0&&(b=(c=typeof a=="object")?a.message:void 0,c=c?a.code:a);throw new WiziCore_Api_Error(b,c);}
var WiziCore_RowUserData=jQuery.Class.create({_userDataObject:null,init:function(){},_getUserDataObject:function(){if(this._userDataObject==null)this._userDataObject={};return this._userDataObject},_getRow:function(a,b){var c=this._getUserDataObject();(b===void 0||b)&&c[a]===void 0&&(c[a]={});return c[a]},rowData:function(a,b,c){var d=c!==void 0,a=this._getRow(a,d);d&&(a[b]=c);return a==void 0?void 0:a[b]},rowDataExists:function(a){return this._getRow(a,!1)===void 0}}),WiziCore_UserData=jQuery.Class.create({_userDataObject:null,
init:function(){},_getUserDataObject:function(){if(this._userDataObject==null)this._userDataObject={};return this._userDataObject},data:function(a,b){var c=this._getUserDataObject();b!==void 0&&(c[a]=b);return c[a]}}),WiziCore_GlobalDataPool=null;try{WiziCore_GlobalDataPool=parent.WiziCore_GlobalDataPool}catch(e$$32){WiziCore_GlobalDataPool=null}
WiziCore_GlobalDataPool||(WiziCore_GlobalDataPool={_storage:{},getGlobalData:function(a){return WiziCore_GlobalDataPool._storage[a]},setGlobalData:function(a,b){WiziCore_GlobalDataPool._storage[a]=b},clearGlobalData:function(a){delete WiziCore_GlobalDataPool._storage[a]}});
var WiziCore_Api_TwitterClient=WiziCore_Api_Base.extend({_authString:null,_name:null,_pass:null,_serviceUrl:"http://api.twitter.com/1/",_nc:null,_format:"json",_isAuth:!1,init:function(){this._super(this)},auth:function(a,b){this._name=a;this._pass=b;this._authString=btoa(a+":"+b)},isAuth:function(){return this._isAuth},publicTimeline:function(a){this._sendRequestGet(this._serviceUrl+"statuses/public_timeline."+this._format,a,!1)},statusesShow:function(a,b){this._sendRequestGet(this._serviceUrl+"statuses/show/"+
a+"."+this._format,b,!1)},statusesFrends:function(a,b){this._sendRequestGet(this._serviceUrl+"statuses/friends/"+a+"."+this._format,b,!1)},friendsIds:function(a,b){this._sendRequestGet(this._serviceUrl+"friends/ids/"+a+"."+this._format,b,!1)},userShow:function(a,b){this._sendRequestGet(this._serviceUrl+"users/show/"+a+"."+this._format,b,!1)},userSuggestions:function(a){this._sendRequestGet(this._serviceUrl+"users/suggestions."+this._format,a,!1)},test:function(a){this._sendRequestGet(this._serviceUrl+
"help/test.js."+this._format,a,!1)},update:function(a,b,c){if(b){var d=this._serviceUrl+"statuses/update."+this._format;d+="?status="+escape(b);d=this._addParamToQueryURL(d,!0,c,"in_reply_to_status_id");this._sendRequestPost(d,a,!0)}},verifyCredentials:function(a){var b=this;this._sendRequestGet(this._serviceUrl+"account/verify_credentials."+this._format,function(c,d){b._isAuth=!0;typeof a=="function"&&a.call(b,c,d)},!0)},userTimeline:function(a,b,c,d,e,f){b=b?this._serviceUrl+"statuses/user_timeline/"+
b+"."+this._format:this._serviceUrl+"statuses/user_timeline."+this._format;b=this._addParamToQueryURL(b,!1,c,"since");b=this._addParamToQueryURL(b,c,d,"since_id");b=this._addParamToQueryURL(b,c||d,e,"count");b=this._addParamToQueryURL(b,c||d||e,f,"page");this._sendRequestGet(b,a,!0)},_addParamToQueryURL:function(a,b,c,d){c&&(a+=b?"&":"?",a+=d+"="+escape(c.toString().replace(/ /g,"+")));return a},_sendRequestGet:function(a,b,c){this._sendRequest("GET",a,b,c)},_sendRequestPost:function(a,b,c,d){this._sendRequest("POST",
a,b,c,d)},_sendRequest:function(a,b,c,d,e){if(this._nc==null){var f=this.context();if(f!=void 0&&typeof f.webClient=="function"){if(this._nc=f.webClient(),typeof this._nc!="object")return}else return}f={};if(d||this._isAuth)f={Authorization:"Basic "+this._authString};a=="GET"&&(e=void 0);this._nc.httpRequest(b,a,function(a,b){typeof c=="function"&&c.call(this,a,b)},e,"json",f)}});$(document).ready(function(){AC.Core.addExtendsToApp("twitterClient",new WiziCore_Api_TwitterClient)});
if(window.AC&&!window.AC.PGPluginEmulator)AC.PGPluginEmulator=function(){function a(a,b){if(m[b].showWarningNotNative&&!m[b].warningWasShown)alert(a),m[b].warningWasShown=!0}function b(){}function c(b){c=null;if(!WiziCore_Helper.isNative()){var b=b.additionalFields&&b.additionalFields.adMobforseStart!==void 0?b.additionalFields.adMobforseStart:!0,d=function(){},e=AC.Core.lang().trText("phonegap_AdMobPlugin_emulation");d.prototype.start=function(b){a(e,"AdMob");typeof b=="function"&&b(e)};d.prototype.stop=
function(b){a(e,"AdMob");typeof b=="function"&&b(e)};if(!window.plugins)window.plugins={};window.plugins.AdMob=new d;b&&window.plugins.AdMob.start()}}function d(){d=null;if(!WiziCore_Helper.isNative()){var b=function(){},c=AC.Core.lang().trText("phonegap_LocalNotificationPlugin_emulation");b.NSMinuteCalendarUnit=1;b.NSHourCalendarUnit=2;b.NSDayCalendarUnit=3;b.NSWeekCalendarUnit=4;b.NSEraCalendarUnit=5;b.NSYearCalendarUnit=6;b.NSMonthCalendarUnit=7;b.NSSecondCalendarUnit=8;b.NSQuarterCalendarUnit=
9;b.prototype.start=function(b,d){typeof d=="function"&&d(c);a(c,"LocalNotification")};b.prototype.setSpringBoardBadgeCount=function(b,d,e){typeof e=="function"&&e(c);a(c,"LocalNotification")};b.prototype.getSpringBoardBadgeCount=function(b,d){typeof d=="function"&&d(c);a(c,"LocalNotification")};b.prototype.addPresent=function(b,d,e){typeof e=="function"&&e(c);a(c,"LocalNotification")};b.prototype.addSchedule=function(b,d,e){typeof e=="function"&&e(c);a(c,"LocalNotification")};b.prototype.cancelAll=
function(b,d){typeof d=="function"&&d(c);a(c,"LocalNotification")};b.prototype.cancel=function(b,d,e){typeof e=="function"&&e(c);a(c,"LocalNotification")};if(!window.plugins)window.plugins={};window.plugins.localNotification=new b;window.LocalNotification=b}}function e(){e=null;if(!WiziCore_Helper.isNative()){var b=function(){},c=AC.Core.lang().trText("phonegap_XtifyPlugin_emulation");b.prototype.start=function(b,d){typeof d=="function"&&d(c);a(c,"Xtify")};b.prototype.setSpringBoardBadgeCount=function(b,
d,e){typeof e=="function"&&e(c);a(c,"Xtify")};b.prototype.getSpringBoardBadgeCount=function(b,d){typeof d=="function"&&d(c);a(c,"Xtify")};b.prototype.clearNotifications=function(b,d){typeof d=="function"&&d(c);a(c,"Xtify")};b.prototype.getXid=function(b,d){typeof d=="function"&&d(c);a(c,"Xtify")};b.prototype.isRegistered=function(b,d){typeof d=="function"&&d(c);a(c,"Xtify")};b.prototype.setNotifIcon=function(b,d){typeof d=="function"&&d(c);a(c,"Xtify")};if(!window.plugins)window.plugins={};window.plugins.XtifySDK=
new b}}function f(){f=null;if(!WiziCore_Helper.isNative()){var b=function(){},c=AC.Core.lang().trText("phonegap_ZXingPlugin_emulation");b.prototype.scan=function(b,d){typeof d=="function"&&d(c);a(c,"BarCodeScanner")};b.prototype.encode=function(b,d){typeof d=="function"&&d(c);a(c,"BarCodeScanner")};if(!window.plugins)window.plugins={};window.plugins.barcodeScanner=new b}}function g(){g=null;if(!WiziCore_Helper.isNative()){var b=function(){};b.prototype.scan=function(b,c){var d=AC.Core.lang().trText("phonegap_scanditFreePlugin_emulation");
typeof c=="function"&&c(d);a(d,"ScanditSDKFree")};if(!window.plugins)window.plugins={};window.plugins.ScanditSDK=new b}}function h(){h=null;if(!WiziCore_Helper.isNative()){var b,c,d,e,f=window;b={};d=0;c=function(a){var c;c="cb"+(d+=1);b[c]=a;return c};e=function(a,b,d){var e,f;e={};f=!1;if(typeof b==="function")f=!0,e.success=b;if(typeof d==="function")f=!0,e.error=d;if(f)a.callback=c(e);return a};f.PGSQLitePlugin=function(){function c(b,d,e,f){a(AC.Core.lang().trText("phonegap_pgsqliteplugin_emulation"),
"PGSQLitePlugin");this.dbPath=b;this.openSuccess=d;this.openError=e;if(!b)throw Error("Cannot create a PGSQLitePlugin instance without a dbPath");this.openSuccess||(this.openSuccess=function(){console.log("DB opened: "+b)});this.openError||(this.openError=function(a){console.log(a.message)});this.open(this.openSuccess,this.openError,f===void 0?0:f);return this}c.prototype.openDBs={};c.handleCallback=function(a,c,d){var e;if((e=b[a])!=null&&typeof e[c]==="function")e[c](d);b[a]=null;delete b[a]};c.prototype.executeSql=
function(a,b,c){if(!a)throw Error("Cannot executeSql without a query");var d=typeof a=="object"?a[0]:a,e=typeof a=="object"&&a.length>1?a.slice(1,a.length):[];this.openDBs[this.dbPath].db.transaction(function(a){a.executeSql(d,e,function(a,c){if(b){for(var d=0;d<c.rows.length;d++)c.rows[d]=c.rows.item(d);b(c)}},function(a,b){c&&c.call(window,b)})})};c.prototype.changeVersion=function(a,b){this.openDBs[this.dbPath].db.changeVersion(a,b)};c.prototype.transaction=function(a,b,c){var d;d=new f.PGSQLitePluginTransaction(this.dbPath,
this);a(d);return d.complete(b,c)};c.prototype.insert=function(a,b,c,d){var a="INSERT INTO "+a,e="(",f="(",g;for(g in b)b[g]!==void 0&&b[g]!==null&&(e+=g+",",f+="'"+b[g].toString()+"',");e=e.substring(0,e.length-1)+")";f=f.substring(0,f.length-1)+")";a+=" "+e+" values "+f+";";this.executeSql(a,function(a){c&&c(a.insertId)},d)};c.prototype.del=function(a,b,c,d,e){a="DELETE FROM "+a;b&&(a+=" WHERE ");if(c)var f=0,b=b.replace(/\?/g,function(){if(f>c.length)return"?";else{f++;var a=c[f-1];return"'"+a+
"'"}});a+=b;this.executeSql(a,function(a){d&&d(a.rowsAffected)},e)};c.prototype.update=function(a,b,c,d,e,f){var a="UPDATE "+a+" SET ",g;for(g in b)b[g]!==void 0&&b[g]!==null&&(a+=g+" = '"+b[g]+"',");a=a.substring(0,a.length-1)+" ";if(c){if(d instanceof Array)var h=0,c=c.replace(/\?/g,function(){if(h>d.length)return"?";else{h++;var a=d[h-1];return"'"+a+"'"}});a+=" WHERE "+c}this.executeSql(a,function(a){e&&e(a.rowsAffected)},f)};c.prototype.query=function(a,b,c,d,e,f,g,h,i,l){var n="SELECT ";if(b){for(var k in b)n+=
b[k]+",";n=n.substring(0,n.length-1)}else b+=" * ";n+=" FROM "+a+" ";if(c){if(d instanceof Array)var j=0,c=c.replace(/\?/g,function(){if(j>d.length)return"?";else{j++;var a=d[j-1];return"'"+a+"'"}});n+=" WHERE "+c}e&&(n+=" GROUP BY "+e+" ");f&&(n+=" HAVING "+f+" ");g&&(n+=" ORDER BY "+g+" ");h&&(n+=" LIMIT "+h+" ");this.executeSql(n,i,l)};c.prototype.open=function(a,b){var c,d=this;if(this.dbPath in this.openDBs){if(typeof a=="function")d.tid!=void 0&&clearTimeout(d.tid),d.tid=setTimeout(function(){a(d.openDBs[d.dbPath].result,
d.openDBs[d.dbPath].self)},100)}else{c=e({path:this.dbPath},a,b);var f={version:0,status:1};c=window.openDatabase(c.path,"","",5242880);d.openDBs[d.dbPath]={self:d,result:f,db:c};f.version=c.version;c.version!=0&&c.version!=""?f.status=0:c.changeVersion("","0");if(typeof a=="function")d.tid!=void 0&&clearTimeout(d.tid),d.tid=setTimeout(function(){a(f,d)},100)}};c.prototype.close=function(a,b){this.dbPath in this.openDBs&&(delete this.openDBs[this.dbPath],e({path:this.dbPath},a,b))};return c}();f.PGSQLitePluginTransaction=
function(){function a(b,c){this.dbPath=b;this.executes=[];this._isSimple=!0;this.db=c}a.prototype.executeSql=function(a){this.executes.push(a)};a.prototype.insert=function(a,b){this.executes.push({table:a,values:b,type:"insert"})};a.prototype.del=function(a,b,c){this.executes.push({table:a,where:b,whereArgs:c,type:"del"})};a.prototype.query=function(a,b,c,d,e,f,g,h){this.executes.push({table:a,columns:b,where:c,whereArgs:d,groupBy:e,having:f,orderBy:g,limit:h,type:"query"})};a.prototype.update=function(a,
b,c,d){this.executes.push({table:a,values:b,where:c,whereArgs:d,type:"update"})};a.prototype.run=function(a,b){if(this.executes.length>0){var c=this,d=this.executes.shift(),e=typeof d=="object"?d.type:"raw";e=="raw"?this.db.executeSql(d,function(){c.executes.length!=0?c.run(a,b):(c.__completed=!0,a&&a.apply(this,arguments))},function(a){typeof b=="function"&&b.apply(this,arguments)}):e=="insert"?this.db.insert(d.table,d.values,function(){c.run(a,b)},function(){typeof b=="function"&&b.apply(this,arguments)}):
e=="del"?this.db.del(d.table,d.where,d.whereArgs,function(){c.run(a,b)},function(){typeof b=="function"&&b.apply(this,arguments)}):e=="update"?this.db.update(d.table,d.values,d.where,d.whereArgs,function(){c.run(a,b)},function(){typeof b=="function"&&b.apply(this,arguments)}):e=="query"&&this.db.query(d.table,d.columns,d.where,d.whereArgs,d.groupBy,d.having,d.orderBy,d.limit,function(){c.run(a,b)},function(){typeof b=="function"&&b.apply(this,arguments)})}else this.__completed=!0,a&&a.apply(this,
arguments)};a.prototype.complete=function(a,b){if(this.__completed==!1)throw Error("Transaction already run");this.__completed=!1;this.run(a,b)};return a}();f.PGSQLiteHelper=function(){this.DATABASE_NAME="test.db";this.DATABASE_VERSION=1;this.DATABASE_STORAGE="auto";this.dbHelper=null;this.CREATE_BATCH=[];this.UPDATE_BATCH=[];this.version=function(){return this.DATABASE_VERSION};this.openDatabase=function(a,b,c){var c=c===void 0?this.DATABASE_VERSION:c,d=this,e=null;try{e=new PGSQLitePlugin(d.DATABASE_NAME,
function(c){setTimeout(function(){d.dbHelper=e;if(c.status==1)d.onCreate(function(){typeof a=="function"&&a(e,d.DATABASE_VERSION)},b);else if(parseInt(c.version,10)<parseInt(d.DATABASE_VERSION,10))d.onUpdate(c.version,function(){typeof a=="function"&&a(e,d.DATABASE_VERSION)},b);else typeof a=="function"&&a(e,d.DATABASE_VERSION)},500)},b,c,d.DATABASE_STORAGE)}catch(f){c<0?b&&b():c==0?d.openDatabase(a,b,d.DATABASE_VERSION):d.openDatabase(a,b,c-1)}};this.onCreate=function(a,b){var c=this;c.dbHelper.transaction(function(a){for(var b in c.CREATE_BATCH)a.executeSql(c.CREATE_BATCH[b])},
function(){c.dbHelper.changeVersion(0,c.DATABASE_VERSION);typeof a=="function"&&a()},b)};this.onUpdate=function(a,b,c){var d=a,a=parseInt(a,10)-1,e=parseInt(this.DATABASE_VERSION,10)-1,f=this;f.dbHelper.transaction(function(b){for(var c=a;c<e;c++)for(var d in f.UPDATE_BATCH[c])b.executeSql(f.UPDATE_BATCH[c][d])},function(){f.dbHelper.changeVersion(d,f.DATABASE_VERSION);typeof b=="function"&&b()},c)};this.getDB=function(){return this.db}}}}function j(){j=null;if(!WiziCore_Helper.isNative()){var b=
function(){};b.prototype.mailTo=function(b,c,d){b?(b=AC.Core.lang().trText("phonegap_mailToPlugin_emulation"),typeof d=="function"&&d(b),a(b,"MailToPlugin")):typeof d=="function"&&d("Nothing to send")};if(!window.plugins)window.plugins={};window.plugins.MailTo=new b}}function i(){i=null;WiziCore_Helper.isNative()||function(){function b(){}var c=null;b.install=function(){console.log("ChildBrowser.install is deprecated")};b.showWebPage=function(d,e){a(AC.Core.lang().trText("phonegap_childBrowser_emulation"),
"ChildBrowser");e||(e={showLocationBar:!0});var f="scrollbars=yes";f+=e.showLocationBar?"location=yes":"location=no";f+=e.showAddress?"status=yes":"status=no";f+=e.showNavigationBar?"toolbar=yes":"toolbar=no";c=window.open(d,"ChildBrowser",f);var g=setInterval(function(){if(c.closed)switch(clearTimeout(g),0){case 0:if(typeof b.onClose==="function")b.onClose()}},500)};b.close=function(){c!=null&&c.close()};b.openExternal=function(){var c=AC.Core.lang().trText("phonegap_childBrowser_support_in_native");
a(c,"ChildBrowser");if(typeof b.onError==="function")b.onError(c)};if(!window.plugins)window.plugins={};return window.plugins.childBrowser=b}()}var m={ChildBrowser:{showWarningNotNative:!0,warningWasShown:!1},PGSQLitePlugin:{showWarningNotNative:!0,warningWasShown:!1},MailToPlugin:{showWarningNotNative:!0,warningWasShown:!1},ScanditSDKFree:{showWarningNotNative:!0,warningWasShown:!1},BarCodeScanner:{showWarningNotNative:!0,warningWasShown:!1},Xtify:{showWarningNotNative:!0,warningWasShown:!1},AdMob:{showWarningNotNative:!0,
warningWasShown:!1},Xtify:{showWarningNotNative:!0,warningWasShown:!1},LocalNotification:{showWarningNotNative:!0,warningWasShown:!1}};b.setPlugins=function(a,b){for(var l=0,n=a.length;l<n;l++){var r=a[l];if(r.name=="ChildBrowser"&&r.enabled)m.ChildBrowser.showWarningNotNative=r.showWarningNotNative!==void 0?r.showWarningNotNative:!0,i&&i();else if(r.name=="PGSQLitePlugin"&&r.enabled)m.PGSQLitePlugin.showWarningNotNative=r.showWarningNotNative!==void 0?r.showWarningNotNative:!0,h&&h();else if(r.name==
"MailToPlugin"&&r.enabled)m.MailToPlugin.showWarningNotNative=r.showWarningNotNative!==void 0?r.showWarningNotNative:!0,j&&j();else if(r.name=="ScanditSDKFree"&&r.enabled)m.ScanditSDKFree.showWarningNotNative=r.showWarningNotNative!==void 0?r.showWarningNotNative:!0,g&&g();else if(r.name=="BarCodeScanner"&&r.enabled)m.BarCodeScanner.showWarningNotNative=r.showWarningNotNative!==void 0?r.showWarningNotNative:!0,f&&f();else if(r.name=="Xtify"&&r.enabled)m.Xtify.showWarningNotNative=r.showWarningNotNative!==
void 0?r.showWarningNotNative:!0,e&&e();else if(r.name=="AdMob"&&r.enabled)m.AdMob.showWarningNotNative=r.showWarningNotNative!==void 0?r.showWarningNotNative:!0,c&&c(r,b);else if(r.name=="LocalNotification"&&r.enabled)m.LocalNotification.showWarningNotNative=r.showWarningNotNative!==void 0?r.showWarningNotNative:!0,d&&d()}};return b}(jQuery,window,document);
var WiziCore_Api_WeatherClient=WiziCore_Api_Base.extend({_serviceUrl:"http://wsf.cdyne.com/WeatherWS/Weather.asmx",_weatherInformationCached:null,_nc:null,_app:null,init:function(){this._super(this)},app:function(a){if(a!=void 0)this._app=a;return this._app},getWebClient:function(){if(this._nc==null){var a=this.context();if(a!=void 0&&typeof a.webClient=="function")this._nc=a.webClient()}return this._nc},getWeatherInformation:function(a){if(this._weatherInformationCached!=null)this.onGetWeatherInformation(this._weatherInformationCached,
!1,a);else{var b=this.getWebClient();if(b!=null){var c=this,d=this._serviceUrl+"/GetWeatherInformation?";this.app().httpRequest(d,"GET",function(d,f){var g={};f==!1&&(typeof d=="string"?g=b.XML2JSON(d):typeof d=="object"&&(g=d));c.onGetWeatherInformation(g,f,a)},void 0,"xml")}}},onGetWeatherInformation:function(a,b,c){c!=void 0&&c.call(this,a,b);if(b==!1)this._weatherInformationCached=a},getCityWeatherByZIP:function(a,b){if(a!=void 0){var c=this.getWebClient();if(c!=null){var d=this,e=this._serviceUrl+
"/GetCityWeatherByZIP";this.app().httpRequest(e,"GET",function(a,e){var h={};e==!1&&(typeof a=="string"?h=c.XML2JSON(a):typeof a=="object"&&(h=a));b!=void 0&&b.call(d,h,e)},{ZIP:a.toString()},"xml")}}},getCityForecastByZIP:function(a,b){if(a!=void 0){var c=this.getWebClient();if(c!=null){var d=this,e=this._serviceUrl+"/GetCityForecastByZIP";this.app().httpRequest(e,"GET",function(a,e){var h={};e==!1&&(typeof a=="string"?h=c.XML2JSON(a):typeof a=="object"&&(h=a));b!=void 0&&b.call(d,h,e)},{ZIP:a.toString()},
"xml")}}},setData:function(a,b){if(typeof a=="string"){var c=this.app();c!=null&&c.setData(a,b)}else a&&typeof a.setData=="function"&&a.setData(b)},fillGrid:function(a,b,c,d){var e={},f;for(f in d.WeatherDescription)if(d.WeatherDescription[f]!==void 0){var g=d.WeatherDescription[f];g.WeatherID!=-1&&(e[g.WeatherID]=g)}var d=[],h=[];if(b!=null)for(f in h=b.split(","),h)d.push("");var b={rows:[]},j=1,c=c.ForecastResult.Forecast!==void 0?c.ForecastResult.Forecast:c.ForecastResult;for(f in c)if(c[f]){var g=
c[f],i="";if(e[g.WeatherID]!=void 0)i=e[g.WeatherID].PictureURL;var m=$.extend(!0,[],d);for(f in m)switch(h[parseInt(f)]){case "date":m[f]=g.Date;break;case "desc":m[f]=g.Desciption;break;case "low":m[f]=g.Temperatures.MorningLow;break;case "high":m[f]=g.Temperatures.DaytimeHigh;break;case "precip":m[f]=g.ProbabilityOfPrecipiation.Nighttime+"/"+g.ProbabilityOfPrecipiation.Daytime;break;case "icon":m[f]=i}b.rows.push({id:j,data:m});j++}this.setData(a,b)},WeatherForecast:function(a,b,c,d,e,f,g){if(a!=
void 0){var h=this;h.setData(b,"");h.setData(d,"");h.setData(e,"");h.setData(f,{rows:[]});this.getWeatherInformation(function(j,i){i==!1?h.getCityForecastByZIP(a,function(a,i){i==!1&&a!=void 0&&(h.setData(b,a.Success),h.setData(d,a.State),h.setData(e,a.City),(a.Success=="true"||a.Success===!0&&g!=void 0)&&h.fillGrid(f,g,a,j));typeof c=="function"&&c.call(this,a,i)}):typeof c=="function"&&c.call(this,j,i)})}}});$(document).ready(function(){AC.Core.addExtendsToApp("weatherClient",new WiziCore_Api_WeatherClient)});
var WiziCore_Api_FacebookLogin=WiziCore_Api_Base.extend({triggerObject:{},_authUrl:"https://graph.facebook.com/oauth/authorize?client_id={clientId}&redirect_uri={redirectUrl}&display=popup",_clientId:"fb79f993dbd82ea7d2bed96ab0ffbf1a",_container:null,_redirectUrl:function(){var a=this.context();if(a!=void 0)return a=a.config().serverApi(),a=a.replace("json",""),a+"WiziDataAgent/Facebook/login.php"},loadClientKey:function(){var a=this.context();if(a!=void 0&&(a=a.config().facebookId(),a!=void 0))this._clientId=
a},init:function(){this._super(this)},login:function(a,b,c){this.loadClientKey();if(!this.checkIsLoggedIn(a)&&!this.checkCookieLogin(a)){var b=b==void 0?this._clientId:b,c=c==void 0?this._redirectUrl():c,d=this._authUrl,d=d.replace("{clientId}",b),d=d.replace("{redirectUrl}",c);this._openIframe(d,a)}},checkCookieLogin:function(a){var b=AC.Core.cookie().cookie("facebookAppTicket");return b!=void 0?(this.setDataAgentParam(b),a(!1,b),!0):!1},checkIsLoggedIn:function(a){var b=this.context();if(b!=void 0)for(var b=
b.getDataAgentParams(),c=0;c<b.length;c++)if(b[c].dataAgent=="Facebook"&&b[c].name=="access_key")return a(!1,b[c].value),!0;return!1},_openIframe:function(a,b){this._container=window.open(a,"Facebook Login","menubar=no,location=yes,resizable=no,scrollbars=no,status=no,height=500px,width=500px");this._container.focus();var c=this;$(this.triggerObject).bind(WiziCore_Api_FacebookLogin.onIframeLoginSuccess,function(a,e,f){c.onSuccess(e,f);AC.Core.cookie().cookie("facebookAppTicket",e,{expires:f,path:"/"});
b(!1,e,f)});$(this.triggerObject).bind(WiziCore_Api_FacebookLogin.onIframeLoginError,function(a,e){c.onFail(e);b(!0)})},setDataAgentParam:function(a){var b=this.context();b!=void 0&&typeof b.webClient=="function"&&b.setDataAgentParam("Facebook","access_key",a)},onSuccess:function(a){this.setDataAgentParam(a);this._container.close();window.focus()},onFail:function(a){alert(a);this._container.close();window.focus()}});WiziCore_Api_FacebookLogin.onIframeLoginSuccess="E#WiziCore_Api_FacebookLogin#onIframeLoginSuccess";
WiziCore_Api_FacebookLogin.onIframeLoginError="E#WiziCore_Api_FacebookLogin#onIframeLoginError";$(document).ready(function(){AC.Core.addExtendsToApp("facebook",new WiziCore_Api_FacebookLogin);WiziOnFacebookLoginSuccess=function(a,b){$(WiziCore_Api_FacebookLogin.prototype.triggerObject).trigger(WiziCore_Api_FacebookLogin.onIframeLoginSuccess,[a,b])};WiziOnFacebookLoginFail=function(a){$(WiziCore_Api_FacebookLogin.prototype.triggerObject).trigger(WiziCore_Api_FacebookLogin.onIframeLoginError,a)}});
function swirlArrayToJsonFormat(a){var b={rows:[]};if(a instanceof Array){var c=1,d;for(d in a)a[d]&&b.rows.push({data:a[d],id:c}),c++}return b}function swirlJsonFormatToArray(a){var b=[];if(a instanceof Object)for(var c in a.rows)b.push(a.rows[c].data);return b}$(document).ready(function(){AC.Core.addExtendsToApp("arrayToAdvanced",swirlArrayToJsonFormat);AC.Core.addExtendsToApp("advancedToArray",swirlJsonFormatToArray)});
(function(a,b,c,d){d.ssjDebug=new function(){function e(){return m||WiziCore_Helper.generateId().split("-").join("")}function f(){var c=e(),d=WiziCore_AppContext.getInstance().config().serverUrl();WiziCore_AppContext.getInstance().setDebuggerKey(c);i&&a(i).unbind("unload.ssjDebug");i=b.open(d+"debugRouter?debugKey="+c,"ac-debugger","width=800,height=550");var f=a(i);f.bind("load.ssjDebug",function(){f.bind("unload.ssjDebug",function(){WiziCore_AppContext.getInstance().setDebuggerKey(null);f=i=null;
b.onbeforeunload=null;h()});f.unbind("load.ssjDebug")});a(b).bind("unload.ssjDebug",function(){i&&i.close()});b.acDebugDoMeFocus=g;b.ac_debug_iframeLoaded=h}function g(){if(a("#"+j).length==0){var b=d.Core.lang().tr("ssj_breakpoint_message"),e=a('<div id="'+j+'"><div id="dialog-overlay"></div><div id="dialog-box"><div class="dialog-content"><div id="dialog-message">'+b+'</div><a href="#" class="ssj-button">Go</a></div></div></div>');e.click(function(){i.focus();e.remove()});a(c.body).append(e)}}function h(){a("#"+
j).remove()}var j="ACDebugBreakPointPopup",i=null,m=null;this.openWindow=function(){f()};this.bindHotkey=function(){a(c).bind("keydown.ssjDebug","Ctrl+i",a.proxy(f,this));a(c).bind("keydown.ssjDebug","Meta+i",a.proxy(f,this))};this.unBindHotkey=function(){a(c).unbind("keydown.ssjDebug")};this.setDebugKey=function(a){m=a};this.genDebuggerKey=e}})(jQuery,window,document,window.AC);
$(document).ready(function(){var a=AC.Core.Widgets(),b=function(){a.registerWidget.apply(a,arguments)};b("WiziCore_UI_BaseWidget","widget_cat_common","widget_name_base","Base","labelwidget",void 0,!1);b("WiziCore_UI_RadioWidget","widget_cat_common","widget_name_radio","Radio","radiobtnwidget");b("WiziCore_UI_CheckBoxWidget","widget_cat_common","widget_name_ch","Checkbox","checkboxwidget");b("WiziCore_UI_LabelWidget","widget_cat_common","widget_name_label","Label","labelwidget");b("WiziCore_UI_TextWidget",
"widget_cat_common","widget_name_text","Text","textwidget");b("WiziCore_UI_TextAreaWidget","widget_cat_common","widget_name_textarea","TextArea","textareawidget");b("WiziCore_UI_TextANumWidget","widget_cat_common","widget_name_textnum","Text","numtextwidget");b("WiziCore_UI_NumericWidget","widget_cat_common","widget_name_numeric","Text","numtextwidget");b("WiziCore_UI_NextButtonWidget","widget_cat_common","widget_name_buttonaction","Action Button","buttonnextwidget");b("WiziCore_UI_SubmitButtonWidget",
"widget_cat_deprecated","widget_name_buttonsubmit","Submit Button","buttonnextwidget");b("UploadButton","widget_cat_common","widget_name_buttonupload","Upload Button","buttonnextwidget");b("WiziCore_UI_ImgWidget","widget_cat_common","widget_name_image","Image","imagewidget");b("WiziCore_UI_ImgQrCodeWidget","widget_cat_common","widget_name_qr_code","QR Code","qrcodeimagewidget");b("DatePicker","widget_cat_common","widget_name_datepick","Date Picker","datepickerwidget");b("WiziCore_UI_ListBoxWidget",
"widget_cat_common","widget_name_listbox","ListBox","listboxwidget");b("WiziCore_UI_ComboBoxWidget","widget_cat_common","widget_name_dropdown","DropDown","comboboxwidget");b("WiziCore_UI_ColorPickerWidget","widget_cat_common","widget_name_colorpick","ColorPicker","colorpickerwidget");b("WiziCore_UI_WysiwygWidget","widget_cat_common","widget_name_wysiwyg","Rich Text","richtextwidget");b("WiziCore_UI_FancyButton","widget_cat_common","widget_name_fancy_btn","Fancy Button","fancybtnwidget");b("HTML",
"widget_cat_common","widget_name_html","HTML","labelwidget");b("WiziCore_UI_CheckBoxMobileWidget","widget_cat_mobile","widget_name_ch","Checkbox","checkboxwidget");b("WiziCore_UI_ContainerMobileWidget","widget_cat_mobile","widget_name_mobcnt","Toolbar","panelcontainerwidget");b("WiziCore_UI_TextAreaMobileWidget","widget_cat_mobile","widget_name_textarea","TextArea","textareawidget");b("WiziCore_UI_ActionButtonMobileWidget","widget_cat_mobile","widget_name_buttonaction","Action Button","buttonnextwidget");
b("WiziCore_UI_SubmitButtonMobileWidget","widget_cat_deprecated","widget_name_mobilebuttonsubmit","Mobile Submit Button","buttonnextwidget");b("MobileUploadButton","widget_cat_mobile","widget_name_buttonupload","Upload Button","buttonnextwidget");b("WiziCore_UI_PopupDropdownMobileWidget","widget_cat_mobile","widget_name_popup_dropdown","ListBox","popupdropdownwidget");b("WiziCore_UI_ExpandedRadioMobileWidget","widget_cat_mobile","widget_name_radiobuttongroup","ListBox","radiobtngroupwidget");b("WiziCore_UI_PopupListboxMobileWidget",
"widget_cat_mobile","widget_name_popup_listbox","ListBox","listboxwidget");b("WiziCore_UI_TextMobileWidget","widget_cat_mobile","widget_name_text","Text","textwidget");b("WiziCore_UI_SearchMobileWidget","widget_cat_mobile","widget_name_search","Search","textwidget");b("WiziCore_UI_SliderMobileWidget","widget_cat_mobile","m_widget_name_slider","Slider","sliderhwidget");b("WiziCore_UI_FlipToggleSwitchMobileWidget","widget_cat_mobile","m_widget_name_fliptoggleswitch","Flip Toggle Switch","sliderhwidget");
b("WiziCore_UI_CheckBoxGroupMobileWidget","widget_cat_mobile","m_widget_name_checkboxgroup","Checkbox Group","checkboxgroupwidget");b("WiziCore_UI_ListMobileWidget","widget_cat_mobile","m_widget_name_list","List","listmobilewidget");b("WiziCore_UI_NavBarMobileWidget","widget_cat_mobile","m_widget_name_navbar","NavBar","navbarwidget");b("WiziCore_UI_ContextMenuMobileWidget","widget_cat_beta","m_widget_name_contextmenu","ContextMenu","contextmenuwidget");b("WiziCore_UI_CollapsibleMobileWidget","widget_cat_mobile",
"m_widget_name_collapsible","Collapsible","listboxwidget");b("WiziCore_UI_AuthButtonMobileWidget","widget_cat_mobile","m_widget_name_auth","Authentication Button","signin");b("WiziCore_UI_LabelMobileWidget","widget_cat_mobile","widget_name_label","Label","labelwidget");b("Mobiscroll","widget_cat_mobile","widget_name_mobiscroll","Mobiscroll","mobiscrollwidget");b("MobiscrollList","widget_cat_mobile","widget_name_mobiscroll_list","MobiscrollList","mobiscrollwidget");b("Photoswipe","widget_cat_adv",
"widget_name_photoswipe","Photoswipe","photoswipewidget");b("MediaElementAudio","widget_cat_adv","widget_name_mediaelementaudio","Audio","audiowidget");b("MediaElementVideo","widget_cat_adv","widget_name_mediaelementvideo","Video","videowidget");b("HTML5Audio","widget_cat_adv","widget_name_html5mediaelementaudio","Audio","audiowidget");b("HTML5Video","widget_cat_adv","widget_name_html5mediaelementvideo","Video","videowidget");b("jPlayer","widget_cat_beta","widget_name_jplayer","jPlayer","videowidget");
b("Youtube","widget_cat_adv","widget_name_youtube","Youtube","youtubewidget");b("GoogleMapsAdvanced","widget_cat_adv","widget_name_gmapsadvanced","GoogleMapsAdvanced","wiziCore/extWidgets/googleMaps/googleMaps.png","wiziCore/extWidgets/googleMaps/googleMaps.png");b("WiziCore_UI_GridWidget","widget_cat_adv","widget_name_grid","Group","gridwidget");b("WiziCore_UI_MaskEditWidget","widget_cat_adv","widget_name_maskedit","Text","masktextwidget");b("WiziCore_UI_SliderVWidget","widget_cat_adv","widget_name_vslider",
"Slider","slidervwidget");b("WiziCore_UI_SliderHWidget","widget_cat_adv","widget_name_hslider","Slider","sliderhwidget");b("WiziCore_UI_SearchWidget","widget_cat_adv","widget_name_search","Search text","textwidget");b("WiziCore_UI_EmbedAppWidget","widget_cat_adv","widget_name_embed_app","Embed App","embedappwidget");b("WiziCore_UI_FileUploadWidget","widget_cat_adv","widget_name_fileupload","File Upload","fileuploadwidget");b("WiziCore_UI_ResetButtonWidget","widget_cat_adv","widget_name_buttonreset",
"Reset Filter","buttonresetwidget");b("WiziCore_UI_MenuAdvancedWidget","widget_cat_adv","widget_name_advanced_menu","Advanced Menu","accordionwidget");b("ShareThis","widget_cat_beta","widget_name_share_this","ShareThis","share-this-widget");b("CircleMenu","widget_cat_beta","widget_name_circle_menu","Circle Menu","bulbwidget");b("WiziCore_UI_PasswordWidget","widget_cat_auth","widget_password","Password","upass");b("WiziCore_UI_SignInButtonWidget","widget_cat_auth","auth_signin","Sign In","signin");
b("WiziCore_UI_SignUpButtonWidget","widget_cat_auth","auth_widget_signup","Sign Up","signup");b("WiziCore_UI_CaptchaWidget","widget_cat_auth","captcha","Captcha","captcha");b("WiziCore_UI_ShapeWidget","widget_cat_common","widget_name_shape","Shape","boxshapewidget");b("WiziCore_UI_AccordionWidget","widget_cat_cont","widget_name_accordion","Tab","accordionwidget");b("WiziCore_UI_TabWidget","widget_cat_cont","widget_name_tab","Tab","tabwidget");b("RepeatContainer","widget_cat_cont","widget_name_repeat_container",
"Repeat container","repeatwidget");b("WiziCore_UI_PageButtonWidget","widget_cat_cont","widget_name_page_button","Page button","boxshapewidget");b("WiziCore_UI_PanelContainerWidget","widget_cat_cont","widget_name_panel_container","Panel","panelcontainerwidget");b("WiziCore_UI_TableLayoutWidget","widget_cat_cont","widget_name_table","Table","panelcontainerwidget");b("WiziCore_UI_DataContainerWidget","widget_cat_cont","widget_name_data_container","Data Container","datacontainerwidget");b("WiziCore_UI_IFrameWidget",
"widget_cat_cont","widget_name_iframe","Iframe","iframewidget");b("WiziCore_UI_flotChartBaseWidget","widget_cat_adv","widget_name_flotchart","Line","linewidget");b("Calendar","widget_cat_adv","widget_name_calendar","Calendar","calendarwidget");b("WiziCore_UI_TimelineWidget","widget_cat_adv","widget_name_timeline","Timeline","timelinewidget");b("Zingchart","widget_cat_beta","widget_name_zingchart","Zingchart","zingchart-widget");b("Advertising","widget_cat_adv","widget_name_advertising","Advertising",
"advertisingwidget");b("Scandit","widget_cat_beta","widget_name_scandit","Scandit Button","scandit_widget");AC.Core.Widgets().registerExWidgets()});
(function(a,b,c){function d(a){var b="";switch(typeof a){case "string":b+=a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");break;case "number":case "boolean":b+=a.toString();break;case "object":if(a.constructor.toString().indexOf("function Date()")>-1){for(var c=a.getFullYear().toString(),e=(a.getMonth()+1).toString(),e=e.length==1?"0"+e:e,f=a.getDate().toString(),f=f.length==1?"0"+f:f,g=a.getHours().toString(),g=g.length==1?"0"+g:g,h=a.getMinutes().toString(),h=h.length==1?"0"+h:
h,i=a.getSeconds().toString(),i=i.length==1?"0"+i:i,k=a.getMilliseconds().toString(),j=Math.abs(a.getTimezoneOffset()),m=0;j>=60;)m++,j-=60;j=j.toString().length==1?"0"+j.toString():j.toString();m=m.toString().length==1?"0"+m.toString():m.toString();a=(a.getTimezoneOffset()<0?"+":"-")+m+":"+j;b+=c+"-"+e+"-"+f+"T"+g+":"+h+":"+i+"."+k+a}else if(a.constructor.toString().indexOf("function Array()")>-1)for(e in a)if(isNaN(e))b+="<"+e+">"+d(a[e])+"</"+e+">";else{c=/function\s+(\w*)\s*\(/ig.exec(a[e].constructor.toString())[1];
switch(c){case "":c=typeof a[e];break;case "String":c="string";break;case "Number":c="int";break;case "Boolean":c="bool";break;case "Date":c="DateTime"}b+="<"+c+">"+d(a[e])+"</"+c+">"}else for(e in a)b+="<"+e+">"+d(a[e])+"</"+e+">";break;default:throw Error(500,"SOAPClientParameters: type '"+typeof a+"' is not supported");}return b}function e(a,b,d,e,g,h){var h=h||{},i=h.wsdlUrl||a+"?wsdl";k[a]=h.arrayTypes||[];var j=o[a];j!=c?f(a,b,d,e,j,g,h):g.httpRequest(i,"GET",function(c,i,j){if(!i)c=h,j=j.responseXML,
o[a]=j,f(a,b,d,e,j,g,c)},{},"xmldom",c,h)}function f(b,d,e,f,h,i,j){var m=h.documentElement.attributes.targetNamespace+""=="undefined"?h.documentElement.attributes.getNamedItem("targetNamespace").nodeValue:h.documentElement.attributes.targetNamespace.value,m=j.namespace||m;if(j.tagNamespace===c&&(m==c||m.length==0))j.tagNamespace=!0;var o=j.tagNamespace?"":"nsp:",e='<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'+
(j.tagNamespace?"":' xmlns:nsp="'+m+'"')+"><soap:Body><"+o+d+" "+(j.tagNamespace?'xmlns="'+m+'"':"")+">"+e.toXml(o)+"</"+o+d+"></soap:Body></soap:Envelope>",o=(o=$(h).find('[name="'+d+'"]').find("operation").attr("soapAction"))?o:(m.lastIndexOf("/")!=m.length-1?m+"/":m)+d,s=j?j.responseNode:c;i.httpRequest(b,"POST",function(e,i){if(i){var j=XMLHttpRequest.responseText;if(j==""||j==c)j='<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>0</faultcode><faultstring>Error</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>';
if(a.ActiveXObject){var m=new ActiveXObject("Microsoft.XMLDOM");m.async="false";m.loadXML(j)}else m=(new DOMParser).parseFromString(j,"text/xml");g(d,f,h,m,k[b],s)}else g(d,f,h,e,k[b],s)},e,"xmldom",{SOAPAction:o,"Content-Type":"text/xml; charset=utf-8"},j)}function g(a,b,d,e,f,g){var i=null,g=m(e,g||"return");g.length==0&&(g=m(e,a+"Result"));g.length==0&&(g=m(e,a+"Response"));g.length==0&&(g=m(e,a+"Return"));if(g.length==0){if(swirlDebugger.log("_onSendSoapRequest::0"),e.getElementsByTagName("faultcode").length>
0)d=e.getElementsByTagName("faultstring")[0].childNodes[0].nodeValue,i=Error(500,d)}else{swirlDebugger.log("_onSendSoapRequest::1");var a=g[0],i={},g=d.getElementsByTagName("s:element"),j=!0;g.length==0&&(g=d.getElementsByTagName("xsd:element"));g.length==0&&(g=d.getElementsByTagName("element"),j=!1);for(var k=0;k<g.length;k++)if(j){if(g[k].attributes.getNamedItem("name")!=null&&g[k].attributes.getNamedItem("type")!=null)i[g[k].attributes.getNamedItem("name").nodeValue]=g[k].attributes.getNamedItem("type").nodeValue}else if(g[k].attributes.name!=
null&&g[k].attributes.type!=null)i[g[k].attributes.name.value]=g[k].attributes.type.value;g=d.getElementsByTagName("xsd:complexType");for(k=0;k<g.length;k++)if(g[k].attributes.getNamedItem("name")!=null&&g[k].getElementsByTagName("xsd:restriction")[0]!=c)i[g[k].attributes.getNamedItem("name").nodeValue]=g[k].getElementsByTagName("xsd:restriction")[0].attributes.getNamedItem("base").nodeValue;i=h(a,i,f)}b&&b(i,e)}function h(a,d,e){if(a==null)return"";if(a.nodeType==3||a.nodeType==4)return j(a,d);if(a.childNodes.length==
1&&(a.childNodes[0].nodeType==3||a.childNodes[0].nodeType==4))return h(a.childNodes[0],d,e);if(i(a,d).toLowerCase().indexOf("array")!=-1)for(var f=[],g=0;g<a.childNodes.length;g++)f[f.length]=h(a.childNodes[g],d,e);else{f="";a.hasChildNodes()&&(f={});for(var k={},g=0;g<a.childNodes.length;g++){var m=h(a.childNodes[g],d,e),o=a.childNodes[g].nodeName;b.indexOf(e,a.childNodes[g].nodeName)!=-1?(f[o]instanceof Array||(f[o]=[]),f[o].push(m)):f[o]==c?f[o]=m:(k[o]===c&&(k[o]=!0,f[o]=[f[o]]),f[o].push(m))}}return f}
function j(a,b){var c=a.nodeValue;switch(i(a.parentNode,b).toLowerCase()){default:case "s:string":case "xsd:string":return c!=null?c+"":"";case "s:boolean":case "xsd:boolean":return c+""=="true";case "s:int":case "s:long":case "xsd:int":case "xsd:long":return c!=null?parseInt(c+"",10):0;case "s:double":case "xsd:double":return c!=null?parseFloat(c+""):0;case "s:datetime":case "xsd:datetime":if(c==null)return null;else{c+="";var c=c.substring(0,c.lastIndexOf(".")==-1?c.length:c.lastIndexOf(".")),c=
c.replace(/T/gi," "),c=c.replace(/-/gi,"/"),d=new Date;d.setTime(Date.parse(c));return d}}}function i(a,b){var d=b[a.nodeName]+"";if(d=="undefined"){var e=a.attributes.getNamedItem("xsi:type");e!=c&&e.nodeValue!=c&&(d=e.nodeValue.split(":"),d=b[d[d.length-1]]+"")}return d=="undefined"?"":d}function m(a,b){try{return a.selectNodes('.//*[local-name()="'+b+'"]')}catch(c){}return a!=null?a.getElementsByTagName(b):null}a.SOAPClientParameters=function(){var a=[];this.add=function(b,c){a[b]=c;return this};
this.toXml=function(b){var c="",e;for(e in a)c+=a[e]===null?"<"+b+e+' xsi:nil="1"></'+b+e+">":"<"+b+e+">"+d(a[e])+"</"+b+e+">";return c}};(a.SOAPClient=function(){}).invoke=function(a,b,c,d,f,g){e(a,b,c,d,f,g)};var o={},k={}})(window,WiziCore_Helper);
