You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
25 KiB
2 lines
25 KiB
var prefData=window.performance.timing;(function(root,window,document,pref_data,undefined){var tts=function(arg,doc){if(doc=doc&&doc.first||doc||document,"function"!=typeof arg){var match,ret=Object.create(tts.fn);if("object"==typeof arg)if("length"in arg){ret.length=arg.length;for(var o=0;o<arg.length;o++)ret[o]=arg[o]}else ret[0]=arg,ret.length=1;else if(arg)if(match=arg.match(/<(.+)>/))ret[0]=doc.createElement(match[1]),ret.length=1;else{var els=doc.querySelectorAll(arg);ret.length=els.length;for(var w=0;w<els.length;w++)ret[w]=els[w]}else ret[0]=doc.createDocumentFragment(),ret.length=1;return ret}"loading"==doc.readyState?doc.addEventListener("DOMContentLoaded",arg):arg()};tts.version="1.0",tts.performanceData=pref_data,tts.pageLoadTime=function(){return pref_data.loadEventEnd-pref_data.navigationStart},tts.connectTime=function(){return pref_data.responseEnd-pref_data.requestStart},tts.renderTime=function(){return pref_data.domComplete-pref_data.domLoading},tts.isNotSet=function(check){return null==check||0===check.length},tts.getValue=function(input,defaults){return!0===tts.isNotSet(input)?defaults:input},tts.matches=["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector"].filter((function(sel){return sel in document.documentElement}))[0],tts.fn=Object.create(Array.prototype,{each:{value:function(callback){tts.isFunction(callback);for(var $this={},index=0;index<this.length;index++)($this=this[index]).callback=callback,$this.callback(index);return this}},first:{get:function(){return this[0]}},eq:{value:function(i){return tts(this[i||0])}},on:{value:function(evt,fn){tts.isFunction(fn)||tts.logger("Callback should be a function","warn");for(var hasit=this[0].addEventListener,i=0;i<this.length;i++)hasit?this[i].addEventListener(evt,fn):this[i].attachEvent("on"+evt,fn);return this}},off:{value:function(evt,fn){tts.isFunction(fn)||tts.logger("Callback should be a function","warn");for(var hasit=this[0].removeEventListener,i=0;i<this.length;i++)hasit?this[i].removeEventListener(evt,fn):this[i].detachEvent("on"+evt,fn);return this}},trigger:{value:function(eventName){for(var i=0;i<this.length;i++){var event=document.createEvent("Event");event.initEvent(eventName,!0,!0),this[i].dispatchEvent(event)}return this}},toggleClass:{value:function(cls){for(var i=0;i<this.length;i++)if(this[i].classList)this[i].classList.toggle(cls);else{var classes=this[i].className.split(" "),existingIndex=classes.indexOf(cls);existingIndex>=0?classes.splice(existingIndex,1):classes.push(cls),this[i].className=classes.join(" ")}return this}},addClass:{value:function(cls){for(var i=0;i<this.length;i++)tts.fn.hasClass.call({first:this[i]},cls)||(this[i].className+=" "+cls);return this}},removeClass:{value:function(cls){for(var i=0;i<this.length;i++)this[i].className=this[i].className.replace(cls,"");return this}},hasClass:{value:function(cls){return""!=this.first.className&&new RegExp("\\b"+cls+"\\b").test(this.first.className)}},prop:{value:function(property,value){if(void 0===value)return this.first[property];for(var i=0;i<this.length;i++)this[i][property]=value;return this}},attr:{value:function(property,value){if(void 0===value)return this.first.getAttribute(property);for(var i=0;i<this.length;i++)this[i].setAttribute(property,value);return this}},removeAttr:{value:function(property){for(var i=0;i<this.length;i++)this[i].removeAttribute(property);return this}},val:{value:function(value){var el=this.first,prop="value";switch(el.tagName){case"SELECT":prop="selectedIndex";break;case"OPTION":prop="selected";break;case"INPUT":"checkbox"!=el.type&&"radio"!=el.type||(prop="checked")}return this.prop(prop,value)}},append:{value:function(value){for(var v=tts(value),len=v.length,i=0;i<len;i++)this.first.appendChild(v[i].first||v[i]);return this}},before:{value:function(value){return this.first.parentElement.insertBefore(tts().append(value).first,this.first),this}},parent:{value:function(){return tts(this.first.parentNode)}},clone:{value:function(){return tts(this.first.cloneNode(!0))}},remove:{value:function(){for(var i=0;i<this.length;i++)this[i].parentNode.removeChild(this[i]);return this}},find:{value:function(value){return tts(value,this.first)}},closest:{value:function(selector){var el=this.first;do{if(el[tts.matches](selector))return tts(el)}while(el=el.parentElement);return null}},is:{value:function(selector){return tts(this.filter((function(el){return el[tts.matches](selector)})))}},css:{value:function(property,value){if(void 0===value)return this.first.style[property];for(var i=0;i<this.length;i++)this[i].style[property]=value;return this}},html:{value:function(value){return this.prop("innerHTML",value)}},text:{value:function(value){return this.prop("textContent",value)}},empty:{value:function(){return this.prop("innerHTML","")}},hide:{value:function(){for(var i=0;i<this.length;i++)this[i].style.display="none";return this}},show:{value:function(type){for(var display_type=type||"",i=0;i<this.length;i++)this[i].style.display=display_type;return this}},invisible:{value:function(){for(var i=0;i<this.length;i++)this[i].style.visibility="hidden";return this}},visible:{value:function(type){for(var i=0;i<this.length;i++)this[i].style.visibility="visible";return this}},fadeStop:{value:function(){for(var i=0;i<this.length;i++)this[i].style.opacity=1,this[i].style.filter="alpha(opacity=1)",this[i].style.display="inline-block",this[i].style.visibility="visible"}},fadeIn:{value:function(ms,display){for(var tms=void 0===ms?600:ms,display_as=void 0===display?"inline-block":display,i=0;i<this.length;i++){var elem=this[i].style,opacity={},timer={};elem.opacity=0,elem.filter="alpha(opacity=0)",elem.display=display_as,elem.visibility="visible",opacity.i=0,timer.i=setInterval((function(){opacity.i+=50/tms,opacity.i>=1&&(clearInterval(timer.i),opacity.i=1),elem.opacity=opacity.i,elem.filter="alpha(opacity="+100*opacity.i+")"}),50)}}},fadeOut:{value:function(ms){for(var tms=void 0===ms?600:ms,i=0;i<this.length;i++){var opacity={},timer={},elem=this[i].style;opacity.i=1,timer.i=setInterval((function(){opacity.i-=50/tms,opacity.i<=0&&(clearInterval(timer.i),opacity.i=0,elem.display="none",elem.visibility="hidden"),elem.opacity=opacity.i,elem.filter="alpha(opacity="+100*opacity.i+")"}),50)}}}}),tts.now=function(){return Date.now()},tts.parse=function(string){return JSON.parse(string)},tts.map=function(array,callback,arg){return array.map(callback,arg)},tts.random=function(min,max){return Math.floor(Math.random()*max+min)},tts.trim=function(string){return string.trim()},tts.inArray=function(item,array){return-1!==array.indexOf(item)},tts.isFunction=function(item){if("function"==typeof item)return!0;var type=Object.prototype.toString.call(item);return"[object Function]"===type||"[object GeneratorFunction]"===type};var arrayOfCalls=[];function json_parse(json){try{var obj=JSON.parse(json),unfetched=obj.unfetched;void 0!==unfetched&&console.warn(`You have some unFetched JSON Vars: ${unfetched}`);var err=obj.error;if(void 0===err)return obj;if(null!==err)throw err}catch(e){return e}}function doProgress(eventName,evt){if(!1!==eventName&&evt.lengthComputable){var percentComplete=evt.loaded/evt.total*100,pc=Math.round(percentComplete),event=new CustomEvent(eventName,{detail:{progress:pc}});document.getElementsByTagName("body")[0].dispatchEvent(event)}}function setHTML(elementID,html){try{return document.getElementById(elementID).innerHTML=html}catch(e){tts.logger("ID of "+elementID+" not found...!","warn")}}tts.once=function(callback,id,parms){var fn=window[callback],found=!(tts.inArray(id,arrayOfCalls)||!tts.isFunction(fn))&&fn(parms);return!1!==found&&arrayOfCalls.push(id),found},tts.isEmptyObject=function(obj){return 0===Object.keys(obj).length},tts.isEmpty=function(str){return!str||0===str.length},tts.isNumeric=function(n){return!isNaN(parseFloat(n))&&isFinite(n)},tts.extend=function(object1,object2){return Object.assign({},object1,object2)},tts.when=function(arrayOfPromises){return new Promise((function(resolve,reject){Promise.all(arrayOfPromises).then((values=>{resolve(values)})).catch((errors=>{reject(errors)}))}))},tts.grab_form=function(form_id){try{let myForm=document.getElementById(form_id),arr={};for(var i=0;i<myForm.elements.length;i++){let id=myForm.elements[i].id,value=myForm.elements[i].value,node=myForm.elements[i].nodeName;"INPUT"!=node&&"TEXTAREA"!=node&&"SELECT"!=node||void 0===id||""===id||(arr[id]=value)}return arr}catch(e){return tts.logger(e),!1}},tts.send_json=function(php_script,args){return new Promise((function(myResolve,myReject){if(!1===args){throw"No Data from Form!"}var xmlhttp=new XMLHttpRequest;xmlhttp.open("POST",php_script),xmlhttp.setRequestHeader("Content-Type","application/json;charset=UTF-8"),xmlhttp.onreadystatechange=function(){4==this.readyState&&(200==this.status?myResolve(json_parse(this.response)):myReject(json_parse(this.response)))},xmlhttp.send(JSON.stringify(args))}))},tts.Post=function(url,data){return new Promise(((resolve,reject)=>{var request=new XMLHttpRequest;request.open("POST",url,!0),request.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),request.onload=function(d){resolve(d.currentTarget.responseText)};try{request.send(data)}catch(err){reject(err)}}))},tts.lastAjax=!1;tts.ajax=function(url,options){return void 0===options&&(options={}),new Promise((function(resolve,reject){!function(url,resolve,reject,options){var doCache=tts.getValue(options.useCache,!1),eventName=tts.getValue(options.eventName,!1),elementID=tts.getValue(options.elementID,!1),ts=tts.getValue(options.ts,"");if(doCache){var myCache=new tts.store;if(myCache){let stored_data=myCache.get(url+ts),done=tts.getValue(stored_data,!1);if(!tts.isEmpty(done))return tts.logger("Used cache, on "+url+" !"),tts.lastAjax=!1,doProgress(eventName,{lengthComputable:!0,loaded:100,total:100}),elementID&&setHTML(elementID,stored_data),resolve(stored_data);tts.logger("Adding to cache, for "+url+" !")}else tts.logger("No Cache Engine enabled, for "+url+" !")}else tts.logger("No Caching, for "+url);var xmlHttp=new XMLHttpRequest;if(tts.lastAjax=xmlHttp,xmlHttp.upload.addEventListener("progress",(function(evt){doProgress(eventName,evt)})),xmlHttp.addEventListener("progress",(function(evt){doProgress(eventName,evt)})),xmlHttp.onreadystatechange=function(){var result;if(4==xmlHttp.readyState)if(200==xmlHttp.status){switch(options.dataType){case"xml":result=xmlHttp.responseXML;break;case"json":result=JSON.parse(xmlHttp.responseText);break;default:result=xmlHttp.responseText}myCache&&doCache&&myCache.set(url+ts,result),elementID&&setHTML(elementID,result),resolve(result)}else reject&&reject("Ajax error: "+xmlHttp.status+" url: "+url)},xmlHttp.open(options.method||"GET",url,!0),options.headers)for(var key in options.headers)xmlHttp.setRequestHeader(key,options.headers[key]);xmlHttp.send(options.data||"")}(url,resolve,reject,options)}))};var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s)}function decode(s){return config.raw?s:decodeURIComponent(s)}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value))}function read(s,converter){var value=config.raw?s:function parseCookieValue(s){0===s.indexOf('"')&&(s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return s=decodeURIComponent(s.replace(pluses," ")),config.json?JSON.parse(s):s}catch(e){}}(s);return tts.isFunction(converter)?converter(value):value}var config=tts.cookie=function(key,value,options){if(arguments.length>1&&!tts.isFunction(value)){if("number"==typeof(options=tts.extend(config.defaults,options)).expires){var days=options.expires,t=options.expires=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*days)}return document.cookie=[encode(key),"=",stringifyCookieValue(value),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join("")}var result=key?undefined:{},cookies=document.cookie?document.cookie.split("; "):[],l=cookies.length;for(let i=0;i<l;i++){var parts=cookies[i].split("="),name=decode(parts.shift()),cookie=parts.join("=");if(key===name){result=read(cookie,value);break}key||(cookie=read(cookie))===undefined||(result[name]=cookie)}return result};config.defaults={},tts.removeCookie=function(key,options){return tts.cookie(key,"",$.extend({},options,{expires:-1})),!$.cookie(key)};class MyRouter{constructor(opts){var self=this;return this.events={},this.state=null,this.options=opts||{},this.options.env=this.options.env||(0===Object.keys(root).length&&process&&!0!==process.browser?"server":"client"),this.options.mode=this.options.mode||("server"!==this.options.env&&this.options.pushState&&root.history&&root.history.pushState?"pushState":"hashchange"),"function"==typeof root.addEventListener&&(root.addEventListener("hashchange",(function(){self.trigger("hashchange")})),root.addEventListener("popstate",(function(e){if(self.state&&null===self.state.previousState)return!1;self.trigger("navigate")}))),this}}MyRouter.regexRoute=function(path,keys,sensitive,strict){return path instanceof RegExp?path:(path instanceof Array&&(path="("+path.join("|")+")"),path=path.concat(strict?"":"/?").replace(/\/\(/g,"(?:/").replace(/\+/g,"__plus__").replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g,(function(_,slash,format,key,capture,optional){return keys.push({name:key,optional:!!optional}),slash=slash||"",(optional?"":slash)+"(?:"+(optional?slash:"")+(format||"")+(capture||(format?"([^/.]+?)":"([^/]+?)"))+")"+(optional||"")})).replace(/([\/.])/g,"\\$1").replace(/__plus__/g,"(.+)").replace(/\*/g,"(.*)"),new RegExp("^"+path+"$",sensitive?"":"i"))},MyRouter._forEach=function(a,callback){return"function"==typeof Array.prototype.forEach?Array.prototype.forEach.call(a,callback):function(c,next){for(var i=0,n=this.length;i<n;++i)c.call(next,this[i],i,this)}.call(a,callback)},MyRouter.prototype.get=MyRouter.prototype.add=function(route){var self=this,middleware=Array.prototype.slice.call(arguments,1,-1),handler=Array.prototype.slice.call(arguments,-1)[0],request=new Request(route),invoke=function RouteHandler(){var req=request.parse(self.path());if(req.match){var extra={route,params:req.params,req,regex:req.match},stack=new CallStack(self,extra).enqueue(middleware.concat(handler));if(self.trigger("match",stack,req),!stack.runCallback)return self;if(stack.previousState=self.state,self.state=stack,stack.parent()&&!1===stack.parent().propagateEvent)return stack.propagateEvent=!1,self;stack.callback()}return self},eventName="pushState"!==self.options.mode&&"server"!==self.options.env?"hashchange":"navigate";return invoke().on(eventName,invoke)},MyRouter.prototype.trigger=function(event){var self=this,params=Array.prototype.slice.call(arguments,1);return this.events[event]&&MyRouter._forEach(this.events[event],(function(fn){fn.apply(self,params)})),this},MyRouter.prototype.on=MyRouter.prototype.bind=function(event,handler){var self=this,events=event.split(" ");return MyRouter._forEach(events,(function(event){self.events[event]?self.events[event].push(handler):self.events[event]=[handler]})),this},MyRouter.prototype.once=function(event,handler){var ran=!1;return this.on(event,(function(){return!ran&&(ran=!0,handler.apply(this,arguments),handler=null,!0)}))},MyRouter.prototype.context=function(context){var self=this,middleware=Array.prototype.slice.call(arguments,1);return function(){var value=arguments[0],submiddleware=arguments.length>2?Array.prototype.slice.call(arguments,1,-1):[],handler=Array.prototype.slice.call(arguments,-1)[0],prefix="/"!==context.slice(-1)&&"/"!==value&&""!==value?context+"/":context,path="/"!==value.substr(0,1)?value:value.substr(1),pattern=prefix+path;return self.add.apply(self,[pattern].concat(middleware).concat(submiddleware).concat([handler]))}},MyRouter.prototype.navigate=function(path){return this.path(path).trigger("navigate")},MyRouter.prototype.path=function(pathname){var frag;return"string"==typeof pathname?("pushState"===this.options.mode?(frag=this.options.root?this.options.root+pathname:pathname,root.history.pushState({},null,frag)):root.location?root.location.hash=(this.options.hashBang?"!":"")+pathname:root._pathname=pathname||"",this):void 0===pathname?frag="pushState"===this.options.mode?root.location.pathname.replace(this.options.root,""):"pushState"!==this.options.mode&&root.location?root.location.hash?root.location.hash.split(this.options.hashBang?"#!":"#")[1]:"":root._pathname||"":!1===pathname?("pushState"===this.options.mode?root.history.pushState({},null,this.options.root||"/"):root.location&&(root.location.hash=this.options.hashBang?"!":""),this):void 0},MyRouter.listen=function(){var opts,routes;return arguments[0]&&arguments[1]?(opts=arguments[0],routes=arguments[1]):routes=arguments[0],function(){for(var key in routes)this.add.call(this,key,routes[key]);return this}.call(new MyRouter(opts||{}))};class CallStack{constructor(router,extendObj){for(var key in this.stack=CallStack.global.slice(0),this.router=router,this.runCallback=!0,this.callbackRan=!1,this.propagateEvent=!0,this.value=router.path(),extendObj)this[key]=extendObj[key];return this}}function Request(route){this.route=route,this.keys=[],this.regex=MyRouter.regexRoute(route,this.keys)}CallStack.global=[],CallStack.prototype.preventDefault=function(){this.runCallback=!1},CallStack.prototype.stopPropagation=function(){this.propagateEvent=!1},CallStack.prototype.parent=function(){return!!!(!this.previousState||!this.previousState.value||this.previousState.value!=this.value)&&this.previousState},CallStack.prototype.callback=function(){this.callbackRan=!0,this.timeStamp=Date.now(),this.next()},CallStack.prototype.enqueue=function(handler,atIndex){for(var handlers=Array.isArray(handler)?atIndex<handler.length?handler.reverse():handler:[handler];handlers.length;)this.stack.splice(atIndex||this.stack.length+1,0,handlers.shift());return this},CallStack.prototype.next=function(){var self=this;return this.stack.shift().call(this.router,this.req,this,(function next(){self.next.call(self)}))},Request.prototype.parse=function(path){var match=path.match(this.regex),self=this,req={params:{},keys:this.keys,matches:(match||[]).slice(1),match};return MyRouter._forEach(req.matches,(function(value,i){var key=self.keys[i]&&self.keys[i].name?self.keys[i].name:i;req.params[key]=value?decodeURIComponent(value):undefined})),req},MyRouter.CallStack=CallStack,MyRouter.Request=Request,tts.Router=new MyRouter;var assets_loaded_once=[];function store(temp){return this.temp=void 0!==temp&&temp,"undefined"!=typeof Storage}tts.AddAssetCachedFile=function(full_file){assets_loaded_once.push(full_file)},tts.getAsset=(source,options)=>(void 0===options&&(options={}),new Promise(((resolve,reject)=>{var defaults_caching=tts.getValue(DO_CACHE_ON_ASSETS,!0),file=source.name,kind=file.split(".").pop(),doCache=tts.getValue(source.useCache,defaults_caching),full_file=tts.getValue(source.path,"")+file,ts=tts.getValue(source.ts,"");if(-1!==assets_loaded_once.indexOf(full_file))resolve("Already Loaded..."+full_file);else if(assets_loaded_once.push(full_file),"css"===kind){var dataType=tts.getValue(source.dataType,"text/css"),style=document.createElement("style"),elm=tts.getValue(options.element,document.getElementsByTagName("style")[0]||document.getElementsByTagName("head")[0]);(loaded=tts.ajax(full_file,{dataType:"text/css",useCache:doCache,ts})).then((function(code){style.type=dataType,style.innerText=code,elm.parentNode.insertBefore(style,elm.nextSibling),setTimeout((function(){resolve()}),12)})),loaded.catch((function(e){reject(e)}))}else{dataType=tts.getValue(source.dataType,"text/javascript");var loaded,script=document.createElement("script");elm=tts.getValue(options.element,document.getElementsByTagName("script")[0]||document.getElementsByTagName("head")[0]);(loaded=tts.ajax(full_file,{dataType:"text/javascript",useCache:doCache,ts})).then((function(code){script.type=dataType,script.text=code,elm.parentNode.insertBefore(script,elm),setTimeout((function(){resolve()}),12)})),loaded.catch((function(e){reject(e)}))}}))),tts.mergeOptions=function(sources,options){let keys=Object.keys(options);for(let key of keys)for(var x=0;x<sources.length;x++)void 0===sources[x][key]&&(sources[x][key]=options[key])},tts.getMultiAssets=(sources,options)=>{void 0===options&&(options={});var prArr=[];return sources.forEach((function(source){!function(source){prArr.push(new Promise((function(resolve,reject){tts.getAsset(source,options).then((function(){resolve()})).catch((function(e){reject(e)}))})))}(source)})),Promise.all(prArr,(function(){return!0}))},store.prototype.set=function(name,data){try{if("undefined"!=typeof Storage){var d=JSON.stringify(data);return!1===this.temp?localStorage.setItem(name,d):sessionStorage.setItem(name,d),!0}return!1}catch(er){return!1}},store.prototype.get=function(name){return"undefined"!=typeof Storage&&(!1===this.temp?JSON.parse(localStorage.getItem(name)):JSON.parse(sessionStorage.getItem(name)))},store.prototype.remove=function(name){return"undefined"!=typeof Storage&&(!1===this.temp?localStorage.removeItem(name):sessionStorage.removeItem(name),!0)},store.prototype.clear=function(){return"undefined"!=typeof Storage&&(!1===this.temp?localStorage.clear():sessionStorage.clear(),!0)},tts.store=store,tts.time=function(){var now=new Date;return(now.getHours()%12||12)+":"+now.getMinutes()+":"+now.getSeconds()+" "+(now.getHours()<12?"AM":"PM")},tts.debugMode=!0,tts.doTrace=!1;var startTimer=[],endTimer=[],time=[],beginCodeTimer=0,loggerData=[{message:navigator.userAgent,kind:"userAgent",option:""}];tts.allowedElapsedTime=4e3,tts.completedCodeTimer=0,tts.startCodeTimer=function(){beginCodeTimer=Date.now()},tts.endCodeTimer=function(){tts.completedCodeTimer=Date.now()-beginCodeTimer,loggerData.push({message:"Toal Code Time Elapsed",kind:"MainTimer",option:tts.completedCodeTimer}),tts.completedCodeTimer>tts.allowedElapsedTime&&tts.sendReport()},tts.getLoggerData=loggerData,tts.logger=function(message,level,option){if(void 0===level&&(level="info"),void 0===option&&(option=""),!1===tts.debugMode||!window.console)return!1;if(message="object"==typeof message?`[ ${tts.time()} ] `+JSON.stringify(message):`[ ${tts.time()} ] ${message}`,"microStart"===level||"start"===level?console.group(message,option):"microStop"===level||"stop"===level?console.groupEnd(message,option):loggerData.push({message,kind:level,option}),!tts.doTrace||"warn"!==level&&"error"!==level||console.trace(),"info"===level&&console.info)console.info(message);else if("microStart"===level&&performance.now)startTimer[option]=performance.now();else if("microStop"===level&&performance.now){endTimer[option]=performance.now();var data=endTimer[option]-startTimer[option];console.info(data),loggerData.push({message,kind:level,option:data})}else if("warn"===level&&console.warn)console.warn(message);else if("error"===level&&console.error)console.error(message);else if("table"===level&&console.table)console.table(message,option);else if("group"===level&&console.group)console.group(message,option);else if("end"===level&&console.groupEnd)console.groupEnd(message,option);else if("trace"===level&&console.trace)console.trace();else if("start"===level&&console.time)console.time(option),time[option]=Date.now();else if("stop"===level&&console.timeEnd){console.timeEnd(option);data=Date.now()-time[option];loggerData.push({message,kind:level,option:data})}else console.log&&console.log(message)},tts.ReportsURL="",tts.sendReport=function(markComplete){return new Promise(((resolve,reject)=>{if(""===tts.ReportsURL)reject();else{var strValues="&logs="+encodeURI(JSON.stringify(loggerData));!1===sent_errors_yet&&(void 0===markComplete&&(markComplete=!1),!0===markComplete&&(sent_errors_yet=!0),tts.Post(tts.ReportsURL,strValues).then((values=>{resolve(values)})).catch((errors=>{reject(errors)})))}}))};var sent_errors_yet=!1;try{window.onerror=function errorReports(errorMsg,url,lineNumber,column,errorObj){if(""===tts.ReportsURL)return!1;if(!(errorMsg.indexOf("Script error.")>-1||"null"==typeof errorMsg)){var strValues="errMessage="+encodeURI(errorMsg);strValues+="&errLine="+encodeURI(lineNumber),"undeinfed"!=typeof column&&"null"!=typeof column&&(strValues+="&errColumn="+encodeURI(column)),"undeinfed"!=typeof errorObj&&"null"!=typeof errorObj&&(strValues+="&errObject="+encodeURI(errorObj)),strValues+="&queryString="+encodeURI(location.search),strValues+="&Url="+encodeURI(url),strValues+="&Path="+encodeURI(location.pathname),strValues+="&Hash="+encodeURI(location.hash),strValues+="&HTTPRef="+encodeURI(document.referrer),strValues+="&logs="+encodeURI(JSON.stringify(loggerData)),!1===sent_errors_yet&&tts.Post(tts.ReportsURL,strValues),sent_errors_yet=!0}}}catch(er){}var array_of_frames=[],printFrameID=0;function donePrintFrame(){var frm=document.getElementById(printFrameID).contentWindow;frm.focus(),frm.print()}tts.printFrame=function(id,src){try{for(var i=0;i<array_of_frames.length;i++)document.body.removeChild(array_of_frames[i]),array_of_frames.pop();var newIframe=document.createElement("iframe");newIframe.width="0",newIframe.height="0",newIframe.name=id,newIframe.id=id,newIframe.src=src,printFrameID=id,document.body.appendChild(newIframe),array_of_frames.push(newIframe),newIframe.onload=donePrintFrame}catch(err){tts.logger(err.message)}return!1},"object"==typeof module&&module.exports?module.exports=tts:window.tts=tts}).call({},"object"==typeof window?window:this,window,document,prefData);
|
|
//# sourceMappingURL=tts.min.map
|
|
|