profoundjs
Version:
Profound.js Framework and Server
111 lines • 644 kB
JavaScript
window.pui||(window.pui={});window.pui.baseVersion="6";window.pui.fixPackVersion="39.0";window.pui.version=window.pui.baseVersion+"."+window.pui.fixPackVersion;function b(c){this.onready=this.onfail=this.onsuccess=this.cacheBuster=this.suppressAlert=this.password=this.user=this.async=this.url=this.reqData=this.postData=this.method=null;this.headers={};this.params=null;this.sendAsBinary=!0;var a=this.overrideMimeType=null,d=null,e=null,f=null,g="undefined"!=typeof pui&&"undefined"!=typeof pui.alert?pui.alert:alert,h=this;b.defaultHeaders&&(this.headers=b.defaultHeaders);if("object"==typeof c)for(var q in c)"undefined"!=typeof this[q]&&(this[q]=c[q]);else this.url=
c;if(window.XMLHttpRequest)a=new XMLHttpRequest;else if(window.ActiveXObject)a=new ActiveXObject("Microsoft.XMLHTTP");else{g("Ajax request error: Unsupported browser.");return}this.send=this.send=function(){function p(){if(4==a.readyState){d=0===a.status?C?"Request aborted.":"Request failed. Check the browser console for more details.":a.status+" - "+a.statusText;if(null!=h.onready)h.onready(h);if(200==a.status){if(e=!0,null!=h.onsuccess)h.onsuccess(h)}else if(e=!1,1!=h.suppressAlert&&g(d),null!=
h.onfail)h.onfail(h);f=!1}}var l,n=null,k=null,m=null;if(null==h.method)n="GET";else if("string"==typeof h.method||"GET"==h.method.toUpperCase()&&"POST"==h.method.toUpperCase()&&"PUT"==h.method.toUpperCase()&&"DELETE"==h.method.toUpperCase())n=h.method.toUpperCase();else{g('Invalid value for property: "method".');return}if("POST"==n||"PUT"==n||"DELETE"==n)if(null!=h.reqData?m=h.reqData:null!=h.postData&&(m=h.postData),null!=m){if("string"!=typeof m){g('Invalid value for property: "postData".');return}}else m=
"";if(null==h.async)k=!0;else{if(1!=h.async&&0!=h.async){g('Invalid value for property: "async".');return}k=h.async}if("string"!=typeof h.url)g('Invalid value for property: "url".');else if(null!=h.user&&"string"!=typeof h.user)g('Invalid value for property: "user".');else if(null!=h.password&&"string"!=typeof h.password)g('Invalid value for property: "password".');else if(null!=h.onsuccess&&"function"!=typeof h.onsuccess)g('Invalid value for event: "onsuccess".');else if(null!=h.onfail&&"function"!=
typeof h.onfail)g('Invalid value for event: "onfail".');else if(null!=h.onready&&"function"!=typeof h.onready)g('Invalid value for event: "onready".');else{var r=!0;if(null!=m)for(l in h.headers)"CONTENT-TYPE"==l.toUpperCase()&&-1==h.headers[l].toLowerCase().indexOf("www-form-urlencoded")&&(r=!1);var t=h.url,u=h.params;if("object"==typeof u){var v="";for(l in u){var y=u[l],z=[];"object"==typeof y?null!=y.length&&0<y.length&&(z=y):z.push(y);for(y=0;y<z.length;y++)""!=v&&(v+="&"),v+=encodeURIComponent(l)+
"="+encodeURIComponent(z[y])}""!=v&&(!r||"POST"!=n&&"PUT"!=n&&"DELETE"!=n?(r=t.split("?"),t=2==r.length&&""!=r[1]?r[0]+"?"+r[1]+"&"+v:t+("?"+v)):m=(null!=m&&""!=m?m+"&":"")+v)}"GET"!==n||null!==h.cacheBuster&&!0!==h.cacheBuster||(t=pui.addUrlCacheBuster(t));try{"string"==typeof h.user&&"string"==typeof h.password?a.open(n,t,k,h.user,h.password):a.open(n,t,k);t=!1;var E=h.headers;for(l in E)a.setRequestHeader(l,E[l]),"CONTENT-TYPE"==l.toUpperCase()&&(t=!0);if("POST"==n||"PUT"==n||"DELETE"==n)t||a.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");"string"==typeof h.overrideMimeType&&"function"==typeof a.overrideMimeType&&a.overrideMimeType(h.overrideMimeType)}catch(G){g(G);return}f=!0;var C=!1;1==k&&(a.onload=p,a.onerror=p,a.onabort=function(){C=!0;p()});if(1==h.sendAsBinary)try{a.sendAsBinary(m)}catch(G){a.send(m)}else a.send(m);1!=k&&p()}};this.ok=this.ok=function(){return null!=e?e:!1};this.getResponseText=this.pa=function(){return a.responseText};this.getResponseXML=this.Ac=function(){return a.responseXML};
this.getStatus=this.ia=function(){return a.status};this.getStatusText=this.zb=function(){return a.statusText};this.getStatusMessage=this.yb=function(){return d};this.getAllResponseHeaders=this.getAllResponseHeaders=function(){if(e)try{return a.getAllResponseHeaders()}catch(p){g(p)}};this.getResponseHeader=this.getResponseHeader=function(p){if(e)try{return a.getResponseHeader(p)}catch(l){g(l)}};this.setRequestHeader=this.setRequestHeader=function(p,l){h.headers[p]=l};this.abort=this.abort=function(){if(!0===
f)try{a.abort()}catch(p){g(p)}}}function L(c,a){var d="";if(1==arguments.length&&"object"==typeof arguments[0]){var e=arguments[0];e.async=null;e.onsuccess=null;if("function"==typeof e.handler){var f=!0;var g=e.handler}else f=!1}else null!=a&&"function"==typeof a?(f=!0,g=a):f=!1;e=new b(arguments[0]);e.async=f;e.onsuccess=function(h){d+=h.pa();1==f&&g(d)};e.send();if(0==f)return d}
function M(c,a){var d=null,e=!1;if(1==arguments.length&&"object"==typeof arguments[0]){var f=arguments[0];f.async=null;f.onsuccess=null;1==f.saveResponse&&(e=!0);if("function"==typeof f.handler){var g=!0;var h=f.handler}else g=!1}else null!=a&&"function"==typeof a?(g=!0,h=a):g=!1;f=new b(arguments[0]);f.async=g;f.onsuccess=function(q){q=q.pa();e&&"object"==typeof pui&&(pui.savedJSON=q);try{d=eval("("+q+")")}catch(p){h(null,p);return}1==g&&h(d)};f.send();if(0==g)return d}
"undefined"==typeof window.pui&&(window.pui={});window.RPGspRequest=b;window.pui.Ajax=b;window.pui.AjaxRequest=b;window.ajax=L;
window.ajaxXML=function(c,a){var d=null;if(1==arguments.length&&"object"==typeof arguments[0]){var e=arguments[0];e.async=null;e.onsuccess=null;e.onfail=null;e.onsuccess=null;if("function"==typeof e.handler){var f=!0;var g=e.handler}else f=!1}else null!=a&&"function"==typeof a?(f=!0,g=a):f=!1;e=new b(arguments[0]);e.async=f;e.onsuccess=function(h){d=h.Ac();1==f&&g(d)};e.send();if(0==f)return d};window.ajaxJSON=M;
window.ajaxSubmit=function(c,a){var d="",e="undefined"!=typeof pui&&"undefined"!=typeof pui.alert?pui.alert:alert;if("object"==typeof c)var f=c;else f=document.getElementById(c),null==f&&(f=document.forms[c]);if(null!=f)var g=f.tagName;if(null==f||null==g||"FORM"!=g.toUpperCase())return e("Ajax request error: Invalid form object."),"";if(""==c.action)return e("Ajax request error: Invalid form action."),"";for(c=0;c<f.elements.length;c++)if(e=f.elements[c],null!=e.name&&""!=e.name){g=!1;if("INPUT"==
e.tagName){var h=e.type;h=h.toLowerCase();"hidden"==h&&(g=!0);"password"==h&&(g=!0);"text"==h&&(g=!0);pui.Ef(h)&&(g=!0);""==h&&(g=!0);("checkbox"==h||"radio"==h)&&e.checked&&(g=!0)}"TEXTAREA"==e.tagName&&(g=!0);"SELECT"==e.tagName&&(g=!0);g&&(""!=d&&(d+="&"),d+=e.name+"="+encodeURIComponent(e.value))}f=new b(f.action);f.method="POST";f.postData=d;var q="";if(null!=a&&"function"==typeof a)var p=!0;else p=!1,f.async=!1;f.onsuccess=function(l){q+=l.pa();1==p&&a(q)};f.send();if(0==p)return q};"undefined"==typeof window.pui&&(window.pui={});
function aa(){if(null==document.getElementById("PCCommandApplet")){var c=document.createElement("applet");c.id="PCCommandApplet";c.archive="/profoundui/proddata/applet/PCIntegration.jar";c.code="com.profoundlogic.genie.PCIntegration";c.style.height="0px";c.style.width="0px";if("function"==typeof eval("runCommandCb")){var a=document.createElement("param");a.setAttribute("name","callback");a.setAttribute("value","runCommandCb");c.appendChild(a)}document.body.appendChild(c)}}
window.copyToClipboardCb=function(){copyToClipboardCb(pui.pd);pui.pd=null};function ba(c){c=null!=c&&"object"==typeof c?c:document.getElementById(c);if(null==c)return"";var a="";"div"==c.tagName.toLowerCase()&&(a=c.firstChild,a=null!=a&&null!=a.tagName&&"A"==a.tagName?a.innerHTML:c.innerHTML);if("INPUT"==c.tagName&&"checkbox"==c.type)return!0===c.indeterminate?c.indeterminateValue:c.checked&&null!=c.rb?c.rb:c.checked||null==c.Xe?c.checked:c.Xe;if("INPUT"==c.tagName&&"radio"==c.type)return c.checked;"TEXTAREA"==c.tagName?a=c.value:"INPUT"==c.tagName?a=c.value:"SELECT"==c.tagName&&
(a=c.selectedIndex,a=0<=a?c.options[a].value:c.T&&c.T.Za&&c.T.Za.value?c.T.Za.value:c.value);null!=c.La&&(a=c.La.getValue());null!=c.Na&&(a=c.Na.getValue());null!=c.Se&&(a=c.Se.getValue());null!=c.slider&&(a=String(c.value));null!=c.Ha&&(a="",c.Ha.le&&null!=c.Ha.ve?a=c.Ha.ve:c.Ha.le||null==c.Ha.te||(a=c.Ha.te));c.T&&c.T.Tb&&"function"===typeof c.T.Tb.getPropertyValue&&(a=c.T.Tb.getPropertyValue("value"));for(a=a.replace(/ /g," ");-1!=a.indexOf(String.fromCharCode(160));)a=a.replace(String.fromCharCode(160),
" ");a==c.emptyText&&(a="");return a}function ca(c){if("string"!==typeof c)return c;for(;" "==c.charAt(0);)c=c.replace(c.charAt(0),"");return c}function N(c){return"string"!==typeof c?c:c.replace(/^\s*|\s*$/g,"")}pui.detachCalendar=function(c){"string"==typeof c&&(c=document.getElementById(c));null!=c&&pui.Lf(c)};
function O(c,a,d){var e=!1,f=location.href;f=f.split("?")[0];f=f.split("/");2<f.length&&"auth"==f[f.length-2].toLowerCase()&&(e=!0);f="/profoundui/";var g="PUI0009101.PGM PUI0009102.PGM PUI0009103.PGM PUI0009104.PGM PUI0009107.PGM PUI0009109.PGM PUI0009110.PGM PUI0009119.PGM".split(" ");"string"===typeof pui.widgetURLPrefix&&-1!=g.indexOf(c.toUpperCase())&&(f=pui.widgetURLPrefix,"/"!=f.substr(f.length-1)&&(f+="/"));if(1==e||1==d)f+="auth/";f+=c;null!=a&&1==a&&(f+="/"+PSID);null!=pui.serverURL&&(f=
pui.serverURL+f);return f}pui.getProgramURL=O;function P(){var c=0;null!=window.event&&(null!=window.event.clientY&&(c+=window.event.clientY),null!=document.documentElement&&null!=document.documentElement.scrollTop&&(c+=document.documentElement.scrollTop),null!=document.body&&null!=document.body.scrollTop&&(c+=document.body.scrollTop));return c}pui.Af=function(c){return pui.zc(c).x};pui.Bf=function(c){return pui.zc(c).y};
pui.zc=function(c){c=c||window.event;var a={x:0,y:0};null!=c&&null!=c.touches&&1==c.touches.length?(a.x=c.touches[0].pageX,a.y=c.touches[0].pageY):null!=c&&(c.pageX?a.x=c.pageX:c.clientX&&(a.x=c.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft)),c.pageY?a.y=c.pageY:c.clientY&&(a.y=c.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)));return a};
function Q(){var c={};var a=location.search.substring(1,location.search.length);if(0==a.length)return c;a=a.replace(/\+/g," ");a=a.split("&");for(var d=0;d<a.length;d++){var e=a[d].split("="),f=decodeURIComponent(e[0]),g="";2==e.length&&(g=decodeURIComponent(e[1]));c[f]=g}return c}"undefined"!=typeof applyDesignProperty&&(window.hf=applyDesignProperty);
pui.Zb={encode:function(c){for(var a="",d=0;d<c.length;d++){var e=c.codePointAt(d);65535<e&&d++;128>e?a+=String.fromCharCode(e):(2048>e?a+=String.fromCharCode(e>>6|192):(65536>e?a+=String.fromCharCode(e>>12|224):(a+=String.fromCharCode(e>>18|240),a+=String.fromCharCode(e>>12&63|128)),a+=String.fromCharCode(e>>6&63|128)),a+=String.fromCharCode(e&63|128))}return a},decode:function(c){for(var a="",d=0,e,f,g,h;d<c.length;)e=c.charCodeAt(d),128>e?(a+=String.fromCharCode(e),d++):224>e?(f=c.charCodeAt(d+
1),a+=String.fromCharCode((e&31)<<6|f&63),d+=2):240>e?(f=c.charCodeAt(d+1),g=c.charCodeAt(d+2),a+=String.fromCharCode((e&15)<<12|(f&63)<<6|g&63),d+=3):(f=c.charCodeAt(d+1),g=c.charCodeAt(d+2),h=c.charCodeAt(d+3),a+=String.fromCodePoint((e&7)<<18|(f&63)<<12|(g&63)<<6|h&63),d+=4);return a}};
pui.G={oa:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(c){var a="",d=0;for(c=pui.Zb.encode(c);d<c.length;){var e=c.charCodeAt(d++);var f=c.charCodeAt(d++);var g=c.charCodeAt(d++);var h=e>>2;e=(e&3)<<4|f>>4;var q=(f&15)<<2|g>>6;var p=g&63;isNaN(f)?q=p=64:isNaN(g)&&(p=64);a=a+this.oa.charAt(h)+this.oa.charAt(e)+this.oa.charAt(q)+this.oa.charAt(p)}return a},decode:function(c){var a="",d=0;for(c=c.replace(/[^A-Za-z0-9+/=]/g,"");d<c.length;){var e=this.oa.indexOf(c.charAt(d++));
var f=this.oa.indexOf(c.charAt(d++));var g=this.oa.indexOf(c.charAt(d++));var h=this.oa.indexOf(c.charAt(d++));e=e<<2|f>>4;f=(f&15)<<4|g>>2;var q=(g&3)<<6|h;a+=String.fromCharCode(e);64!=g&&(a+=String.fromCharCode(f));64!=h&&(a+=String.fromCharCode(q))}return a=pui.Zb.decode(a)}};
pui.downloadJSON=function(){if(pui.Kf)pui.saveRecording();else if(null==pui.savedJSON)pui.alert("JSON is not available.");else{var c=pui.savedJSON;if("object"===typeof JSON&&"function"===typeof JSON.parse&&"function"===typeof JSON.stringify)try{c=JSON.stringify(JSON.parse(pui.savedJSON),null," ")}catch(a){}pui.Xd("text/plain","json.txt",c)}};
pui.saveRecording=function(c){for(var a=null,d=0;d<pui.ja.payloads.length;d++)!a&&pui.ja.responses[d].wa&&(a=pui.ja.responses[d].wa.Yf),pui.ja.payloads[d].response=pui.ja.responses[d];var e=Q().testid;(d=e)||(d=prompt("Enter recording name"));if(d)if(pui.pjsServer)0===pui.ja.payloads.length?pui.alert("No recording to save."):(a={id:e,appuser:a,payloads:pui.ja.payloads},d={"Content-Type":"application/json"},sessionStorage["atrium-token"]&&(d.Authorization="Basic "+sessionStorage["atrium-token"]),fetch((pui.serverURL||
"")+"/auto-testing/save-recording",{method:"POST",headers:d,body:JSON.stringify(a)}).then(function(g){g.ok?(window.parent&&window.parent.Atrium&&window.parent.Atrium.api&&"function"===typeof window.parent.Atrium.api.reloadNavParent&&window.parent.Atrium.api.reloadNavParent("test-"+e),pui.ja={payloads:[],responses:[]},"function"===typeof c?c():pui.alert("Recording saved.")):pui.alert("Failed to save recording.")})["catch"](function(g){pui.alert("Error: Unable to save recording.");console.error("Fetch error:",
g)}));else{a=JSON.stringify({user:a,payloads:pui.ja.payloads});var f=d;f.endsWith(".json")||(f+=".json");pui["recording path"]?(d=[],d.push({name:"path",value:pui["recording path"]+f}),d.push({name:"text",value:"1"}),d.push({name:"replace",value:"Y"}),d.push({name:"json",value:a,fileName:f}),a=new pui.ef,a.ff(d),d=O("PUI0001109.pgm"),d=d.replace("/auth",""),a.send(d,function(g){var h;200!=g.ia()&&(h=g.yb());h||(g=eval("("+g.pa()+")"),g.success||(h=g.errorText));h?pui.alert(h):(pui.alert("Recording saved."),
pui.ja={payloads:[],responses:[]})})):pui.Xd("text/plain",f,a)}};
pui.clearRecording=function(c){var a=Q().testid;if(pui.pjsServer){a={id:a};var d={"Content-Type":"application/json"};sessionStorage["atrium-token"]&&(d.Authorization="Basic "+sessionStorage["atrium-token"]);fetch((pui.serverURL||"")+"/auto-testing/clear-recording",{method:"POST",headers:d,body:JSON.stringify(a)}).then(function(e){"function"===typeof c&&c(e)})["catch"](function(e){"function"===typeof c&&c(null,e)})}else"function"===typeof c&&c()};
pui.keepAlive=function(){if("genie"!=context||1!=pui.v.Wa){if("dspf"==context)var c=null==pui.v?O("PUI0001200.pgm"):O("PUI0002110.pgm");else if("genie"==context)c=window.DOCUMENT_URI;else return!1;null!=pui.Kb&&""!=pui.Kb&&(c+="/"+pui.Kb);if(null!=pui.overrideSubmitUrl&&"function"==typeof pui.overrideSubmitUrl)try{c=pui.overrideSubmitUrl(c)}catch(d){}"genie"==context&&pui.Tc(pui.v.Wa=!0);"dspf"==context&&(pui.Pb=!1);pui.Sf();var a={keepalive:"1"};pui.isCloud&&(a.workspace_id=pui.ud.cf.id);L({url:pui.gf(c),
method:"post",params:a,sendAsBinary:!1,suppressAlert:!0,handler:function(){pui.ie();"genie"==context&&pui.Tc(pui.v.Wa=!1);"dspf"==context&&(pui.Pb=!0);for(var d=0;d<pui.Bb.length;d++)pui.Bb[d].unMask()},onfail:function(d){null!=pui.onoffline||pui["suppress comm errors"]||pui.alert(pui.Cf(d));pui.ie();"genie"==context&&pui.Tc(pui.v.Wa=!1);"dspf"==context&&(pui.Pb=!0);for(d=0;d<pui.Bb.length;d++)pui.Bb[d].unMask();if(null!=pui.onoffline)pui.onoffline()}});return!0}};
pui.getWindowSize=function(){if(document.body&&document.body.offsetWidth){var c=document.body.offsetWidth;var a=document.body.offsetHeight}"CSS1Compat"==document.compatMode&&document.documentElement&&document.documentElement.offsetWidth&&(c=document.documentElement.offsetWidth,a=document.documentElement.offsetHeight);window.innerWidth&&window.innerHeight&&(c=window.innerWidth,a=window.innerHeight);window.visualViewport&&window.visualViewport.width&&window.visualViewport.height&&(c=window.visualViewport.width,
a=window.visualViewport.height);document.documentElement&&document.documentElement.clientWidth&&(c=document.documentElement.clientWidth,a=document.documentElement.clientHeight);null==c&&null!=screen&&(c=screen.width);null==a&&null!=screen&&(a=screen.height);null==c&&(c=800);null==a&&(a=600);return{width:c,height:a}};pui.openURL=function(c){window.open(c)};
pui.Hb=function(c){return null==c||"string"!=typeof c?"":"http:"==c.substr(0,5).toLowerCase()||"https:"==c.substr(0,6).toLowerCase()||"data:"==c.substr(0,5).toLowerCase()?c:null!=pui.serverURL?0===c.indexOf(pui.serverURL)?c:pui.serverURL+c:window.cordova&&"/"==c.substr(0,1)?c.substr(1):c};
pui.animate=function(c){var a=c.element;"string"==typeof a&&(a=document.getElementById(a));if(null!=a){var d=c.effect;if("fly in left"==d||"fly in right"==d||"fly out left"==d||"fly out right"==d)var e="left";else if("fly in up"==d||"fly in down"==d||"fly out up"==d||"fly out down"==d)e="top";else if("fade in"==d||"fade out"==d)e="opacity";else if(e=c.properties,null==e&&(e=c.property,null==e))return;"string"==typeof e&&(e=[e]);var f=c.duration;null==f&&(f="500ms");"s"!=f.substr(f.length-1,1)&&(f+=
"s");var g=1E3*parseInt(f);2<f.length&&"ms"==f.substr(f.length-2,2)&&(g=parseInt(f));var h=c.type;null==h&&(h="ease");var q=c.from,p=c.to;switch(d){case "fly in right":q=-a.offsetWidth;q+="px";p="0px";break;case "fly in left":q=a.offsetWidth;q+="px";p="0px";break;case "fly out left":p=-a.offsetWidth;p+="px";q="0px";break;case "fly out right":p=a.offsetWidth;p+="px";q="0px";break;case "fly out down":p=a.offsetHeight;p+="px";q="0px";break;case "fly out up":p=-a.offsetHeight;p+="px";q="0px";break;case "fly in up":q=
a.offsetHeight;q+="px";p="0px";break;case "fly in down":q=-a.offsetHeight;q+="px";p="0px";break;case "fade in":q="0";p="100";break;case "fade out":q="100",p="0"}if(null!=p){var l="";for(d=0;d<e.length;d++){var n=e[d];""!=l&&(l+=", ");l+=n+" "+f+" "+h}var k=["transition","MozTransition","WebkitTransition","msTransition","OTransition"];if(null!=q){if("string"==typeof q||"number"==typeof q)q=[q];for(d=0;d<e.length;d++)n=e[d],a.style[n]=q[d]}setTimeout(function(){for(var m=0;m<k.length;m++)a.style[k[m]]=
l;setTimeout(function(){if("string"==typeof p||"number"==typeof p)p=[p];for(var r=0;r<e.length;r++)a.style[e[r]]=p[r];setTimeout(function(){for(var t=0;t<k.length;t++)a.style[k[t]]="";if(null!=c.oncomplete)c.oncomplete()},g)},1)},1)}}};pui.getActiveElement=function(){return"genie"==context?lastActiveElement:pui.activeElement};pui.fieldExit=function(c){var a=pui.getActiveElement();if(null!=a){var d=!1;null!=c&&(d=!0);"genie"==context?fieldExit(a,d):pui.vf(a)}};pui.gotoNextElement=function(c){R(c,!0)};
pui.gotoPreviousElement=function(c){R(c,!1)};
function R(c,a){a=a?1:-1;var d=document.querySelectorAll("INPUT,SELECT,TEXTAREA"),e=d.length;if(!(2>e)){c=Array.prototype.indexOf.call(d,c);for(var f=c+a,g;f!==c;)if(f===e)f=0;else if(-1===f)f=e-1;else{var h=g=d[f];null!=g&&null!=g.La&&(h=g.La.getBox());null!=g&&null!=g.Na&&(h=g.Na.getBox());if(h.readOnly||h.disabled||"hidden"===h.style.visibility||-1===h.tabIndex||!h.clientHeight||!h.clientWidth)f+=a;else{try{h.focus();if(document.activeElement!=h){f+=a;continue}setTimeout(function(){pui["highlight on focus"]&&
"function"==typeof h.select&&h.select();pui.Nf(null,h)},0)}catch(q){}break}}}}pui.showCalendar=function(c){var a=c;"string"==typeof c&&(a=document.getElementById(c));if(null!=a&&"object"==typeof a){var d=a.kf;null!=d&&(null!=d.click&&"function"==typeof d.click?d.click():null!=d.onclick&&"function"==typeof d.onclick&&setTimeout(function(){d.onclick()},250))}};pui.getComputedStyle=function(c){var a=null;window.getComputedStyle?a=window.getComputedStyle(c):c.currentStyle&&(a=c.currentStyle);return a};
pui.upload=function(c,a){var d,e=c.dir,f=!0===c.overwrite,g;"number"==typeof c.slimit&&(g=c.slimit);var h;"number"==typeof c.flimit&&(h=c.flimit);var q="";"string"==typeof c.altname&&(q=c.altname);var p;typeof c.allowedTypes&&c.allowedTypes instanceof Array&&(p=c.allowedTypes);null==h&&(h=c.files.length);if(null==g||null==p){var l=[];for(d=0;d<c.files.length;d++){var n=c.files[d];var k="undefined"!=typeof n.type&&""!=n.type?n.type:"application/octet-stream";-1==pui.jf(l,k)&&l.push(k);n=n.data&&n.data instanceof
ArrayBuffer?n.data.byteLength:n.size;n=Math.ceil(n/1048576);if(null==m||n>m)var m=n}null==g&&(g=m);null==p&&(p=l)}m=O("PUI0009109.PGM");m+="?AUTH="+encodeURIComponent(pui.Ib?pui.Ib:pui.appJob.auth);"widget"!==c.mode&&(m+="&mode=ajax");c.id&&(m+="&id="+encodeURIComponent(c.id));m+="&r="+Math.floor(1E9*Math.random());pui.isCloud&&(m+="&workspace_id="+pui.ud.cf.id);l=new FormData;l.append("dir",e);l.append("overwrite",f?"1":"0");l.append("flimit",h);l.append("slimit",g);l.append("altname",q);"string"==
typeof c.generateNames&&l.append("generateNames",c.generateNames);for(d=0;d<p.length;d++)l.append("type",p[d]);for(d=0;d<c.files.length;d++){n=c.files[d];if(n.data&&n.data instanceof ArrayBuffer){try{var r=new Blob([n.data])}catch(u){e=new window.WebKitBlobBuilder,e.append(n.data),r=e.getBlob()}l.append("file",r)}else l.append("file",n);l.append("filename",n.name)}var t=new XMLHttpRequest;t.open("POST",m,!0);t.onreadystatechange=function(){if(4==t.readyState){var u=!0;if(200==t.status){try{var v=
eval("("+t.responseText+")")}catch(z){u=!1;var y="Server response missing or invalid."}v&&(u=v.success,u||(v.key?(y=pui.getLanguageText("runtimeMsg","upload "+v.key),"file limit"==v.key&&(y=y.replace("&1",h)),"size limit"==v.key&&(y=y.replace("&1",g))):y=v.error))}else u=!1,y=t.status+" - "+t.statusText+".",0==t.status&&""==t.statusText&&(y="The FILE could not be found in the system.");"function"==typeof a&&a(u,y)}};"function"==typeof c.onabort&&(t.onabort=c.onabort);"function"==typeof c.onprogress&&
"upload"in t&&(t.upload.onprogress=c.onprogress);"function"==typeof c.onload&&(t.onload=c.onload);t.send(l);return t};pui.getCookie=function(c){var a=document.cookie.split(";"),d="",e;for(e=0;e<a.length;e++){var f=a[e].split("=");var g=f[0].replace(/^\s+|\s+$/g,"");if(g==c)return 1<f.length&&(d=unescape(f[1].replace(/^\s+|\s+$/g,""))),d}return null};
pui.setCookie=function(c,a,d,e,f,g,h){var q=new Date;q.setTime(q.getTime());d&&(d*=864E5);q=new Date(q.getTime()+d);document.cookie=c+"="+escape(a)+(d?";expires="+q.toGMTString():"")+(e?";path="+e:"")+(f?";domain="+f:"")+(g?";secure":"")+(h?";SameSite="+h:"")};pui.deleteCookie=function(c,a,d,e,f){pui.getCookie(c)&&(document.cookie=c+"="+(a?";path="+a:"")+(d?";domain="+d:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"+(e?";Secure":"")+(f?";SameSite="+f:""))};
pui.refresh=function(c){null==c&&(c={});var a=c.url;c=c.skin;pui.setCookie("puiRefreshId",pui.Kb,null,"/",null,null,"Strict");pui.Tf=!0;pui.Pe=!1;pui.wd=!1;if(null!=c){c="skin="+encodeURIComponent(c);a=window.location.href;var d=a.split("?");a=d[0];d=d[1];null==d&&(d="");d=d.split("&");for(var e=!1,f=0;f<d.length;f++)5<=d[f].length&&"skin="==d[f].substr(0,5).toLowerCase()&&(d[f]=c,e=!0);e||(1==d.length&&""==d[0]?d[0]=c:d.push(c));d=d.join("&");a=a+"?"+d}null!=a?window.location.href=a:window.location.reload()};
pui.downloadURL=function(c){if(null==pui||null==pui.appJob||null==pui.appJob.auth||""==pui.appJob.auth)return pui.is_ie?"":"data:text/html,<!DOCTYPE html><html><body><p>To download, please connect to a Profound UI session.</p></body></html>";var a=!0===c.inline;if(null==c.id)return"";var d=O("PUI0009110.PGM");d+="?id="+encodeURIComponent(c.id);null!=c.contentType&&(d+="&type="+encodeURIComponent(c.contentType));a&&(d+="&inline=1");d=d+"&usehttprc=0&AUTH="+encodeURIComponent(pui.Ib?pui.Ib:pui.appJob.auth);
return d+="&r="+Math.floor(1E9*Math.random())};pui.download=function(c){var a=pui.downloadURL(c);c=!0===c.inline;if(null==pui||null==pui.appJob||null==pui.appJob.auth||""==pui.appJob.auth)c=!0;c?pui.openURL(a):pui.link(a)};
pui.downloadFile=function(c){if("undefined"===typeof c||null==c||"string"!==typeof c.id||1>c.id.length)pui.alert("Error downloading file. \n\n No file path given",null,"Error","Close");else{var a=pui.downloadURL(c),d=c.id,e=new XMLHttpRequest;e.responseType="blob";e.open("GET",a,!0);e.send();var f=null,g=null,h=null,q=null;e.onprogress=function(p){var l=pui.extractFileNameFromContentDisposition(e.getResponseHeader("Content-Disposition"));if(d.split("/").pop()==l||"error.txt"!=l)"undefined"===typeof e.onprogress.diaglogShown&&
(e.onprogress.diaglogShown=!0,f=document.createElement("dialog"),document.body.appendChild(f),g=document.createElement("p"),f.appendChild(g),h=document.createElement("button"),h.innerHTML="OK",h.onclick=function(){f.close();f.remove()},q=document.createElement("button"),q.innerHTML="Cancel",q.id="cancelButton",q.onclick=function(){e.abort();f.close();f.remove()},f.appendChild(q),g.innerHTML="Downloading file: "+d+"<br> Starting download...",f.showModal(),e.onprogress.lastTime=Date.now()),Date.now()>
e.onprogress.lastTime+2E3&&(g.innerHTML="Downloading file: "+d+"<br>"+p.type+" "+(p.loaded/1048576).toFixed(4)+" mb loaded",e.onprogress.lastTime=Date.now())};e.onloadend=function(){null!=f&&(f.querySelector("button[id='cancelButton']").remove(),f.appendChild(h),g.innerHTML="File "+d+" downloaded successfully.")};e.onreadystatechange=function(){if(4==e.readyState&&200==e.status){var p=pui.extractFileNameFromContentDisposition(e.getResponseHeader("Content-Disposition"));if(d.split("/").pop()!=p&&"error.txt"==
p){var l=new FileReader;l.onload=function(){pui.alert("Error downloading file: "+d+"\n\n"+l.result,null,"Error","Close");console.log(l.result)};l.readAsText(e.response)}else{var n=null;if("string"===typeof c.contentType&&0<c.contentType.length)n=c.contentType;else if(n=e.getResponseHeader("Content-Type").split(";")[0],"string"===typeof n&&"application/octet-stream"==n){var k=p.split(".").pop();if("string"===typeof k)switch(k.toLowerCase()){case "pdf":n="application/pdf";break;case "txt":n="text/plain";
break;case "csv":n="text/csv";break;case "json":n="application/json";break;case "xml":n="application/xml";break;case "html":n="text/html";break;case "htm":n="text/html";break;case "jpg":n="image/jpeg";break;case "jpeg":n="image/jpeg";break;case "png":n="image/png";break;case "gif":n="image/gif"}}k="application/pdf text/plain text/csv application/json application/xml text/html image/jpeg image/png image/gif".split(" ");var m=new File([e.response],p,{type:n});m=URL.createObjectURL(m);var r=document.createElement("a");
"boolean"===typeof c.inline&&c.inline&&k.includes(n)?r.target="_blank":r.download=p;r.name=p;r.href=m;document.body.appendChild(r);r.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}));document.body.removeChild(r)}}}}};pui.extractFileNameFromContentDisposition=function(c){c=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(c);return null!=c&&c[1]?c[1].replace(/['"]/g,""):null};
pui.focusOnContainer=function(){window.parent!=window&&pui.bf(window.parent)&&window.parent.se||pui.Pf||setTimeout(function(){null==pui.X&&(pui.X=document.createElement("input"),pui.X.type=pui.is_touch?"button":"text",pui.X.readOnly=!0,pui.X.style.position="absolute",pui.X.style.left="-999px",pui.X.style.top="-999px",pui.X.style.width="10px",pui.X.style.borderStyle="none",pui.X.style.backgroundColor="transparent",pui.Nc&&pui.Nc.appendChild(pui.X));pui.je=!0;pui.X.focus();setTimeout(function(){pui.je=
!1},0)},1)};pui.addCSS=function(c){var a=document.getElementsByTagName("head")[0],d=document.createElement("style");d.type="text/css";pui.is_old_ie?d.styleSheet.cssText=c:d.innerHTML=c;a.appendChild(d)};pui.loadCSS=function(c){if(null!=pui.de(c))return!1;var a=document.getElementsByTagName("head")[0],d=document.createElement("link");d.setAttribute("rel","stylesheet");d.setAttribute("type","text/css");d.setAttribute("media","screen");d.setAttribute("href",pui.Hb(c));a.appendChild(d);return!0};
pui.removeCSS=function(c){var a=document.getElementsByTagName("head")[0],d=pui.de(c);if(null==d){d=a.getElementsByTagName("style");for(var e=0;e<d.length;e++){var f=d[e];if(f.innerHTML==c||null!=f.styleSheet&&f.styleSheet.cssText==c)return a.removeChild(f),!0}return!1}a.removeChild(d);return!0};
pui.loadJS=function(c){if(null==c)return null;var a;"string"==typeof c&&(a=c);if("object"==typeof c){a=c.path;var d=c.callback;var e=c.onerror;var f=c.test;if(null!=f&&"function"==typeof f&&1==f())return!1}if(null==a)return null;if(null!=pui.Df(pui.Hb(a)))return!1;c=document.getElementsByTagName("head")[0];var g=!1,h=document.createElement("script");h.type="text/javascript";h.onreadystatechange=function(){"complete"!=h.readyState&&"loaded"!=h.readyState||null!=f&&"function"==typeof f&&1!=f()||(g||
null==d||d(),g=!0)};h.onload=function(){if(null==f||"function"!=typeof f||1==f())g||null==d||d(),g=!0};e&&(h.onerror=e);h.src=pui.Hb(a);c.appendChild(h);return!0};
pui.endOfSession=function(c){pui.wd=!1;pui.Pe=!1;if(null!=window.puiMobileClient)window.location.href="index.html",null!=c&&pui.alert(c);else{var a=Q().gobackto;null!=a&&(document.body.innerHTML="",null!=c&&pui.alert(c),location.href=a);null!=navigator.app&&null!=navigator.app.exitApp&&(document.body.innerHTML="",null!=c?pui.alert(c,function(){navigator.app.exitApp()}):navigator.app.exitApp())}};
pui.addUrlCacheBuster=function(c,a){var d=Date.now();if("string"===typeof a&&"get"!==a.toLowerCase())return c;/[&?]r=[^&]+/.test(c)?c=c.replace(/([&?]r=)[^&]+/,function(e,f){return f+d}):(a=-1==c.indexOf("?")?"?":"&",c=c+a+"r="+d);return c};
pui.alert=function(c,a,d,e){window.cordova&&"iOS"==window.device.platform&&null==a&&null==d&&null==e?window.alert(c):null!=window.navigator&&null!=window.navigator.notification&&null!=window.navigator.notification.alert?null==a&&null==d&&null==e&&null!=window.puiMobileClient&&null!=window.puiMobileClient.alert?window.puiMobileClient.alert(c):(null==a&&(a=function(){}),null==d&&(d="Profound UI"),null==e&&(e="OK"),window.navigator.notification.alert(c,a,d,e)):pui.Ff&&window.parent&&window.parent!=window&&
pui.bf(window.parent)&&window.parent.se?console.log("Suppressed alert: "+c):alert(c)};pui.applyProperty=function(c,a,d){return window.applyProperty(c,a,d)};pui.get=function(c){return N(ba(c))};
pui.set=function(c,a){c="object"==typeof c?c:document.getElementById(c);if(null!=c){if("DIV"==c.tagName)null!=c.slider?c.slider.setValue(a):null!=c.La?c.La.setValue(a):null!=c.Na?c.Na.setValue(a):c.button&&c.button.Ve?c.button.Ve.innerHTML=a:c.T&&c.T.Tb?applyProperty(c,"value",a,void 0):c.innerHTML=a;else if("INPUT"==c.tagName||"SELECT"==c.tagName||"TEXTAREA"==c.tagName)"INPUT"==c.tagName&&"checkbox"==c.type?c.checked="boolean"==typeof a?a:null!=c.rb&&a==c.rb?!0:!1:("genie"==context&&a!=c.value&&
pui.v.If(c),c.value=a,null!=c.qd&&(c.qd.value=a));if("dspf"==context||pui.Ye&&null==c.vb){c.modified=!0;pui.Xf(c);var d=c.Zf;null!=c.id&&-1==c.id.indexOf(".")&&null!=c.Kd&&(pui.rf[c.Kd]=!0);null!=d&&(d.hide(),d.wf=!0,pui.Mf(c,d.zf()))}"genie"==context&&null!=c.vb&&null!=c.vb.idx&&(pui.response[c.vb.idx]=c);pui.lf(c);c.T&&c.T.Za&&(c.T.Za.value=a)}};
pui.getActiveContainer=function(){if("genie"==context){for(var c=1,a=document.getElementById("window"+c);a;){var d=document.getElementById("window"+ ++c);if(d)a=d;else break}if(a)return a}else if("dspf"==context&&pui.me)return pui.me;return pui.Nc};pui.getDisplayType=function(){return pui.Ye?"5250-handler":"dspf"==context?"rdf":"5250"};
function T(c){function a(){if(!(n>=l.length)){r=l[n].command;t=l[n].wait;n+=1;if("function"==typeof pui.onPCCommand)try{var v=pui.onPCCommand(r,t);if(null==v||1==v){setTimeout(a,0);return}}catch(z){showFailureMessage(r)}m="?cmd="+encodeURIComponent(r)+"&wait="+(t?"1":"0");if(1==h||2==h)if(q)if(u.params.cmd=r,u.params.sign=1,u.params.hashalg="string"===typeof pui["pccmd hash sign algorithm"]?pui["pccmd hash sign algorithm"].toUpperCase():"SHA-512",1==h){v=M(u);try{if("object"!==typeof v||null===v)throw Error("Empty response");
if(!0!==v.success)throw"string"===typeof v.error&&0<v.error.length?v.error:"Unknown error";var y="";"string"===typeof v.sig&&0<v.sig.length&&(y="&sig="+encodeURIComponent(v.sig));d(y)}catch(z){console.log(z),g(r)}}else u.handler=f,M(u);else d("");else if(3==h)u.params.cmd=r,u.handler=e,M(u);else{if(0==n&&0<l.length){v=[];for(y=0;y<l.length;y++)v.push("("+l[y].pf+")");r=v.join(" && ")}try{p.runCommand(r)}catch(z){v='Unable to execute "'+r+'".\n\n',null!=z&&(v+=z.name+":\n\n"+z.message+"."),alert(v)}}}}
function d(v){if(2==h){var y=new Image;y.onload=a;y.onerror=function(){console.log("PC Command Listener image mode failure.");g(r)};y.src=k+m+"&type=image&rnd="+String(Math.random())+String((new Date).getTime())+v}else{v=new pui.Ajax(k+m+v);v.method="GET";v.async=t?!1:!0;v.suppressAlert=!0;v.onfail=function(z){200!=z.ia()&&(console.log("PC Command Listener comm. failure: "+z.yb()),g(r))};v.onsuccess=function(z){try{var E=JSON.parse(z.pa());if(!E.success&&"string"===typeof E.error){console.log("PC Command Listener failure.",
E.error);g(r);return}}catch(C){}a()};try{v.send()}catch(z){console.log("PC Command Listener failure.",z),g(r)}}}function e(v,y){try{if(y)throw y;if(null==v)throw Error("Empty response from PCCMD crypt program.");if(null!=v.error||"string"===typeof v.error&&0<v.error.length)throw Error("PCCMD crypt error: "+String(v.error));if("string"!==typeof v.cmd||0==v.cmd.length)throw Error("PCCMD crypt response was missing a command.");var z="puilaunch:"+encodeURIComponent(v.cmd),E=document.createElement("iframe");
E.style.display="none";E.src=z;document.body.appendChild(E);setTimeout(function(){null!=E&&null!=E.parentNode&&document.body.removeChild(E);E=null;a()},5E3)}catch(C){console.log(C)}}function f(v,y){try{if(y)throw y;if("object"!==typeof v||null===v)throw Error("Empty response");if(!0!==v.success)throw"string"===typeof v.error&&0<v.error.length?v.error:"Unknown error";y="";"string"===typeof v.sig&&0<v.sig.length&&(y="&sig="+encodeURIComponent(v.sig));d(y)}catch(z){console.log(z),g(r)}}function g(v){console.log("Command: "+
v);v=pui.getLanguageText("runtimeMsg","pccommand error");!1!==pui["alert pccommand errors"]?alert(v):console.log(v);console.log("Visit https://docs.profoundlogic.com/x/aQFK for more information on supporting STRPCCMD.")}var h=1,q=!1;pui["use pc listener"]&&(h=1);pui["pc listener mode"]&&(h=parseInt(pui["pc listener mode"]));if("string"==typeof pui["pc command mode"])switch(pui["pc command mode"]){case "applet":h=0;break;case "listener":case "listener_m1":h=1;break;case "listener_m1s":h=1;q=!0;break;
case "listener_m2":h=2;break;case "listener_m2s":h=2;q=!0;break;case "launcher":h=3;break;default:h=1,console.log("Unsupported pc command mode:",pui["pc command mode"])}if(0==h){var p=document.getElementById("PCCommandApplet");if(!p){pui.dc=c;aa();return}}var l=[],n=0;l="string"==typeof c?[{command:c,wait:!1}]:c;c=parseInt(pui["pc listener port"],10);isNaN(c)&&(c="80");var k="http://localhost:"+c+"/";null!=window.HTTPS&&"ON"==window.HTTPS&&1==h&&(0<=k.toLowerCase().indexOf("localhost")||0<=k.indexOf("127.0.0.1")||
(h=2));var m="",r,t,u={url:O("PUI0009117.pgm"),method:"post",params:{auth:pui.appJob&&pui.appJob.auth?pui.appJob.auth:""},async:!0};a()}window.runCommandCb=function(){T(pui.dc);pui.dc=null};pui.runPCCommand=T;
pui.isServerBusy=function(){if("undefined"==typeof context)return!1;if("dspf"==context&&!1===pui.Pb||"genie"==context&&!0===pui.v.Wa)return!0;for(var c=document.getElementsByTagName("iframe"),a=0;a<c.length;a++){var d=c[a].contentWindow;if(null!=d){var e=null;try{e=d.T}catch(f){}if(null!=e&&"object"===typeof e&&"function"===typeof e.isServerBusy&&e.isServerBusy())return!0}}return!1};
pui.showLastError=function(){if(0==errors.length)alert("No errors have been reported.");else{var c=errors.length-1;alert("Operation: "+errors[c].Jf+"\nId: "+errors[c].id+"\n\nMessage: "+errors[c].text+"\n"+errors[c].Vf)}};
pui.editCode=function(c,a){function d(F,D){var w=" nn/n nn/nn nn/nn/n nn/nn/nn nnn/nn/nn nn/nn/nnnn nnn/nn/nnnn".split(" ");"*ymd"===q.dateEdit&&(w[8]="nnnn/nn/nn",w[9]="nnnnn/nn/nn");w=w[C];F=String(F);F=F.replace(".","");F=F.replace(",","");F=F.replace("-","");F="0000000000"+F;F=F.substr(F.length-D);D="/";null!=q.dateEditSeparator&&(D=q.dateEditSeparator);for(var x=!1,B=0,A="",H=0;H<w.length;H++){var K=w.substr(H,1),J=w.substr(H+1,1);if("/"===K||"/"===J)x=!0;"/"===K?K=D:(K=F.substr(B,1),B+=1,
"0"===K?x||(K=" "):x=!0);A+=K}return A}function e(F,D,w){for(F+="";F.length<D;)F+=w;return F}var f=null,g=0,h=null,q={},p=2;"number"===typeof arguments[p]&&(f=arguments[p],p++,"number"===typeof arguments[p]&&(g=arguments[p],p++));"string"===typeof arguments[p]&&(h=arguments[p],p++);"object"===typeof arguments[p]&&(q=arguments[p],p++);var l=!1;"*astfill"===h&&(l=!0,h=null);var n=!1,k=null,m=!1,r=p=!1;p=" ";pui.wa&&"string"===typeof pui.wa.decimalFormat&&(p=pui.wa.decimalFormat);var t="I"===p||"J"===
p,u="J"===p;null!=q.decimalEdit&&(t=","===q.decimalEdit||"0,"===q.decimalEdit,u="0."===q.decimalEdit||"0,"===q.decimalEdit);"1"<=a&&"4">=a&&(k="999.00");"A"<=a&&"D">=a&&(k="999.00CR");"J"<=a&&"M">=a&&(k="999.00-");"N"<=a&&"Q">=a&&(k="-999.00");if("1"==a||"A"==a||"J"==a||"N"==a||"2"==a||"B"==a||"K"==a||"O"==a)m=!0;p="1"==a||"A"==a||"J"==a||"N"==a||"3"==a||"C"==a||"L"==a||"P"==a?!0:!1;"Z"==a&&(k="999.00");if("X"===a||"Z"===a)r=!0;"X"===a&&(n=!0);"5"<=a&&"9">=a&&pui.alert("User-defined edit code not supported: "+
a+".");"1"<=a&&"9">=a||"A"<=a&&"D">=a||"J"<=a&&"Q">=a||"X"<=a&&"Z">=a||pui.alert("Invalid edit code: "+a+".");var v=(c||0)+"",y=parseFloat(v,10)||0;var z=v.replace(/\..*/,"");"-0"===z&&(z="-");""!=z&&"-"!=z||!u||(z="0");var E=v;-1==E.indexOf(".")&&(E+=".");E=E.replace(/.*\./,"");var C=z.length;3>C&&(C=3);var G=E.length;"number"===typeof f&&(C=f);"number"===typeof g&&(G=g);if("Y"==a)return(3>C||9<C)&&pui.alert("Length not valid for edit code Y."),d(y,C);f=".";t&&(f=",");r&&(f="");0<G&&(E=e(E,G,"0"),
"0"!==z||u||(z=""),v=z+f+E);var I=" ";n&&(I="0");l&&(I="*");if(m){for(g=/(\d+)(\d{3})/;g.test(z);)z=z.replace(g,"$1"+(t?".":",")+"$2");v=z+(0<G?f+E:"")}t=0>y;v=v.replace(/-/g,"");"(999.00)"===k?t&&(v="("+v+")"):"999.00-"===k?v=t?v+"-":v+" ":"999.00CR"===k?v=t?v+"CR":v+" ":"-999.00"===k&&t&&(v="-"+v);h&&(v="EUR"==h?v+" EUR":"$"==h?"-"==v.substr(0,1)?"-"+h+v.substr(1):h+v:h+v);p||0===y&&(v="");(function(){var F=C;F+=G&&!r?1:0;m&&(F+=parseInt((C-G-1)/3));"999.00CR"===k&&(F+=2);"999.00-"===k&&(F+=1);
"-999.00"===k&&(F+=1);"string"===typeof h&&(F+=h.length);var D=v;for(D+="";D.length<F;)D=I+D;v=D})();return v};
pui.editWord=function(c,a,d){function e(){if(0<u.length){var z=u.substr(u.length-1,1);u=u.substr(0,u.length-1);"0"==z&&0==u.length&&y&&(z=v?"*":" ")}else z="0",y&&(z=" "),v&&(z="*");return z}var f;c=String(c);var g={};"object"===typeof d&&(g=d);d="$";null!=g.currencySymbol&&(d=g.currencySymbol);var h=a.indexOf("0")+1,q=a.indexOf("*")+1;if(0==h||0!=q&&q<h)h=q;var p=-1;for(f=a.length-1;0<=f;--f)if(f+1==h||" "==a.substr(f,1)){p=f;break}q=a.substr(0,p+1);var l="",n="",k=!1,m=!1,r=0<=a.substr(p+1).indexOf("-")||
0<=a.substr(p+1).indexOf("CR");for(f=p+1;f<a.length;f++){var t=a.substr(f,1);if("CR"==a.substr(f,2))m=!0,f++;else if("-"==t)m=!0;else if("&"!=t&&("*"!=t||m))if("A"<=t.toUpperCase()&&"Z">=t.toUpperCase()&&r&&!m)a=a.substr(0,f)+" "+a.substr(f+1);else{l=a.substring(p+1,f);n=a.substr(f);k=!0;break}}k||(l=a.substr(p+1));t=".";f=" ";pui.wa&&"string"===typeof pui.wa.decimalFormat&&(f=pui.wa.decimalFormat);"string"===typeof g.decimalFormat&&(f=g.decimalFormat);if("I"===f||"J"===f)t=",";f=0;t=q.split(t);1<
t.length&&(f=t[1].replace(/[^ ]/g,"").length);var u=isNaN(Number(c))?"0":String(c);u=u.replace("-","");t=u.split(".");g=t[0];a="";p=null;1<t.length&&(a=t[1]);if(null==p||isNaN(p))p=f;for(;a.length>p;)a=a.substr(0,a.length-1);for(;p>a.length;)a+="0";for(u=g+a;"0"==u.substr(0,1);)u=u.substr(1);g="";var v=p=!1,y=a=!1;0==h&&(y=!0);for(f=q.length-1;0<=f;--f)k=t=q.substr(f,1)," "==t?k=e():"&"==t?k=" ":"0"==t&&f+1==h?k=e():"*"==t?(v=!0,k=e()):t==d?f+2==h&&(k=e(),a=!0):p&&(k=" ",v&&(k="*")),g=k+g,f<=h&&(y=
!0),y&&0==u.length&&(p=!0);l=l.replace(/&/g," ");l=l.replace(/\*/g," ");0<=c&&(l=l.replace("CR"," "),l=l.replace("-"," "));g=g+l+n;c=g.length-1;g=ca(g);v&&"*"!=g.substr(0,1)&&(g="*"+g);for(a&&(g=d+g);g.length<=c;)g=" "+g;return g};
pui.getRadioGroupValue=function(c){if("string"!==typeof c||"object"!==typeof pui.Lc)return null;for(var a=null,d=pui.sf,e=d.length-1;0<=e;e--){var f=d[e].toUpperCase()+"."+c.toUpperCase();if("undefined"!==typeof pui.Lc[f]){a=pui.Lc[f];break}}if(null==a)return null;c=null;for(d=0;d<a.length;d++)if(e=a[d],e.checked&&null!=e.radioValue){c=e.radioValue;break}return c};pui.Re=function(){for(var c=document.getElementById("auth-form"),a=document.cookie.split("; "),d=!1,e=0;e<a.length;e++){var f=a[e].split("=");if(unescape(f[0])=="pui-signon-"+c.action&&"1"==unescape(f[1])){d=!0;break}}d&&pui.pjsServer&&(d=!1,sessionStorage["atrium-token"]&&(a=new pui.Ajax("/profoundui/pui0005010.pgm"),a.async=!1,a.method="POST",a.headers={Authorization:"Basic "+sessionStorage["atrium-token"]},a.suppressAlert=!0,a.onready=function(g){d=200==g.ia()},a.send()));d||sessionStorage.removeItem("atrium-token");
if("undefined"!=typeof Storage){a=Q();if(a.workstnid)sessionStorage["atrium-params-workstnid"]=a.workstnid;else try{delete sessionStorage["atrium-params-workstnid"]}catch(g){}if(a.suffixid)sessionStorage["atrium-params-suffixid"]=a.suffixid;else try{delete sessionStorage["atrium-params-suffixid"]}catch(g){}if(a.duplicateid)sessionStorage["atrium-params-duplicateid"]=a.duplicateid;else try{delete sessionStorage["atrium-params-duplicateid"]}catch(g){}}if(d)location.href=c.getAttribute("action")||c.action;
else{if(a=document.getElementById("auth-box"))a.style.display="";c.elements["auth-user"].focus()}};
pui.Qe=function(){var c=document.getElementById("auth-form"),a=N(c.elements["auth-user"].value),d=c.elements["auth-password"].value,e=document.getElementById("auth-message");e.innerHTML="";if(""==N(a))return e.innerHTML=authMessages["user required"],c.elements["auth-user"].focus(),!1;if(""==N(d))return e.innerHTML=authMessages["password required"],c.elements["auth-password"].focus(),!1;pui.Fa(function(){localStorage["pui-http-auth-invalid"]&&delete localStorage["pui-http-auth-invalid"];var f=new pui.Ajax("/profoundui/pui0005010.pgm");
f.async=!0;f.method="POST";pui.setReqAuth(f,a,d);f.suppressAlert=!0;f.onready=function(g){if(200==g.ia()){pui.pjsServer&&sessionStorage.setItem("atrium-token",g.headers.authorization.replace("Basic ",""));var h=eval("("+g.pa()+")");g=h.days;var q=!1;1==h.warn&&(0==g?(q=authMessages["password expired"],pui.alert(q),q=!0):(q=authMessages["password pending expiration"],q=q.replace(/{DAYS}/g,g),q=confirm(q)));g=c.getAttribute("action")||c.action;q?(q="/profoundui/changepass?user="+encodeURIComponent(a),
q+="&next="+encodeURIComponent(g),q+="&back="+encodeURIComponent(location.href),location.href=q):(document.cookie=escape("pui-signon-"+c.action)+"=1; path=/",location.href=g)}else e.innerHTML=authMessages["invalid credentials"],c.elements["auth-user"].focus()};f.send()});return!1};
pui.Fa=function(c){sessionStorage.removeItem("atrium-token");var a=new pui.Ajax("/profoundui/pui0005010.pgm");a.async="function"===typeof c?!0:!1;a.method="POST";pui.setReqAuth(a,"PUI_SIGNOFF_USER","PUI_SIGNOFF_USER");a.suppressAlert=!0;"function"===typeof c&&(a.onready=function(){"function"==typeof c&&c()});a.send()};window.pui.signOn=pui.Qe;window.pui.clearCredentials=pui.Fa;window.pui.signOnInit=pui.Re;
pui.ye=function(){var c=Q(),a=document.getElementById("change-user"),d=document.getElementById("change-current"),e=a,f=document.getElementById("change-cancel");"undefined"!=typeof c.user&&(a.value=c.user.toUpperCase(),a.readOnly=!0,a.className+=" read-only",e=d);"undefined"==typeof c.back&&(f.style.display="none");document.getElementById("change-box").style.display="block";e.focus()};pui.xe=function(){var c=Q();"undefined"!=typeof c.back&&(location.href=c.back)};
pui.sd=function(){var c=Q(),a=document.getElementById("change-form"),d=N(a.elements["change-user"].value),e=a.elements["change-current"].value,f=a.elements["change-new"].value,g=a.elements["change-confirm"].value,h=document.getElementById("change-message");h.innerHTML="";if(""==N(d))return h.innerHTML=passMessages["user required"],a.elements["change-user"].focus(),!1;if(""==N(e))return h.innerHTML=passMessages["current required"],a.elements["change-current"].focus(),!1;if(""==N(f))return h.innerHTML=
passMessages["new required"],a.elements["change-new"].focus(),!1;if(""==N(g))return h.innerHTML=passMessages["confirm required"],a.elements["change-confirm"].focus(),!1;if(f!=g)return h.innerHTML=passMessages["must match"],a.elements["change-new"].focus(),!1;g=new pui.Ajax("/profoundui/pui0005011.pgm");g.async=!0;g.method="POST";g.params={};g.params.user=d;g.params.current=e;g.params["new"]=f;g.suppressAlert=!0;pui.setReqAuth(g,d,e);g.onready=function(q){if(200!=q.ia())h.innerHTML="HTTP "+q.ia()+
" - "+q.zb()+".",a.elements["change-user"].focus();else{try{var p=eval("("+q.pa()+")");if("boolean"!=typeof p.success)throw Error("Invalid response format: 'success' is not a boolean.");if(!p.success&&"string"!=typeof p.error)throw Error("Invalid response format: 'error' is not a string.");}catch(l){p={success:!1,error:"The server response is missing or invalid."}}0==p.success?(h.innerHTML=p.error,a.elements["change-user"].focus()):(pui.alert(passMessages.success),pui.Fa(function(){var l=new pui.Ajax("/profoundui/pui0005010.pgm");
l.async=!0;l.method="POST";pui.setReqAuth(l,d,f);l.suppressAlert=!0;l.onready=function(n){200==n.ia()?(pui.pjsServer&&sessionStorage.setItem("atrium-token",n.headers.authorization.replace("Basic ","")),"undefined"!=typeof c.next&&(location.href=c.next)):(pui.alert("HTTP "+n.ia()+" - "+n.zb()+"."),a.elements["change-user"].focus())};l.send()}))}};g.send();return!1};
pui.setReqAuth=function(c,a,d){pui.pjsServer&&(c.headers=c.headers||{},c.headers.authorization="Basic "+btoa(a+":"+d));var e=-1!=navigator.userAgent.indexOf("Edge"),f=!e&&-1!=navigator.userAgent.indexOf("Chrome");e=!e&&-1!=navigator.userAgent.indexOf("Safari")&&!f;var g=-1!=navigator.userAgent.indexOf("Firefox");e||f||g?(c.user=encodeURIComponent(a),c.password=encodeURIComponent(d)):(c.user=a,c.password=d)};window.pui.passInit=pui.ye;window.pui.passCancel=pui.xe;window.pui.changePass=pui.sd;function U(c){var a={};switch(c){case "runtimeMsg":a.closeMessage="This will end your session.";a["no connection message"]="Unable to reach server. Check your connection and try again.";a["upload file limit"]="Limit of &1 file(s) exceeded.";a["upload size limit"]="Limit of &1MB per file exceeded";a["upload no files"]="No files selected.";a["upload duplicate file"]="Duplicate files selected.";a["upload file exists"]="One or more files already exist on the file system.";a["upload prevented"]="Operation prevented by exit program.";
a["upload input limit"]="Total input size limit exceeded.";a["upload no session"]="Not connected to a valid session.";a["upload timeout"]="Transaction timed out.";a["upload invalid response"]="The server response is missing or invalid.";a["upload cancelled"]="Upload canceled.";a["close browser text"]="To complete the log off process, please close your browser window.";a["session ended text"]="Your session has ended.";a["outside ucs2"]="Characters are outside of UCS-2 range.";a["invalid number"]="&1 is not a valid number.";
a["invalid length"]="&1 has an incorrect data length or decimal position.";a["invalid decimal"]="&1 has too many decimal places. (max: &2)";a["invalid choice"]='"&1" is invalid. Valid choices are: "&2" or "&3".';a["invalid date"]='"&1" is not a valid date. Example format: &2';a["invalid time"]='"&1" is not a valid time. Example format: &2';a["invalid time stamp"]='"&1" is not a valid time stamp. Example format: &2';a["invalid percent"]="&1 is not a valid decimal.";a["invalid digits"]='"&1" contains too many digits. Max: &2';
a["exceeds whole"]='"&1" exceeds the maximum number of digits for the whole number portion (&2 digits).';a["exceeds decimal"]='"&1" exceeds the maximum number of digits for the decimal portion (&2 digits).';a["zip too long"]="Zip code is too long. (Maximum: &1 digits)";a["phone too long"]="Phone number is too long. (Maximum: &1 digits)";a["ssno too long"]="Social security number is too long. (Maximum: &1 digits)";a["invalid custom val"]="Invalid custom validation function.";a["error custom val"]=
"Error in custom validation function.";a.ME="Mandatory entry field. You must enter data.";a.MF="Mandatory fill field. You must fill the input box completely.";a.required="The value cannot be blank. This field is required.";a["file required"]="You must select at least one file.";a["signature overflow"]="The signature drawing size exceeds the maximum number of bytes available for storing the signature. Please clear the signature pad and try again.";a.validValues="Value entered is not valid. Valid values are: ";
a.blank="blank";a.or="or";a["upload invalid type"]="One or more files are of invalid type.";a["invalid email"]="Invalid email address.";a["session timed out"]="Your session has timed out.";a["invalid low range"]="Value must be greater than or equal to &1.";a["invalid high range"]="Value must be less than or equal to &1.";a["invalid range"]="Valid range is &1 to &2.";a["unmonitored exception"]="The program has encountered an unmonitored exception. Please contact the system administrator for assistance.";
a["loading x"]="Loading &1...";a["data src not specfd x"]="Data source not specified for &1...";a["name fld not specfd x"]="Name field not specified for &1...";a["val fld not specfd x"]="Value field not specified for &1...";a["failed to load x"]="Failed to load &1.";a["cannot rmv last col"]="You cannot remove the last column.";a["cannot find col"]="Cannot find the specified columnId.";a["subfile deletion"]="Are you sure you want to delete the subfile?";a["downloading x"]="Downloading &1";a["ie9 too low xlsxpics"]=
"Images cannot be exported using IE9 or lower.";a.compressing="Compressing...";a.cancelled="Cancelled";a["keyboard input inhibited"]="Keyboard entry not allowed in this field.";a["pccommand error"]="