targetj 1.0.35 → 1.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Exports.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./src/App.js"
2
2
  export * from "./src/TModel.js"
3
3
  export * from "./src/SearchUtil.js"
4
+ export * from "./src/$Dom.js"
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var t,e={style:void 0,localStorage:null,startTimes:[],callCount:{},delayProcess:{},setup:function(){if("function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),"function"!=typeof String.prototype.startsWith&&(String.prototype.startsWith=function(t){return 0===this.indexOf(t)}),"function"!=typeof String.prototype.endsWith&&(String.prototype.endsWith=function(t){return-1!==this.indexOf(t,this.length-t.length)}),"function"!=typeof String.prototype.hashCode&&(String.prototype.hashCode=function(){var t,e,i=0;if(0===this.length)return i;for(t=0,e=this.length;t<e;t++)i=(i<<5)-i+this.charCodeAt(t),i|=0;return Math.abs(i)}),Array.prototype.oids||(Array.prototype.oids=function(t){return this.map((function(t){return t.oid})).join(t||" ")}),Array.spaces||(Array.spaces=function(t){return Array(t).join(" ")}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null===this)throw new TypeError('"this" is null or not defined');var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var n=arguments[1],a=0;a<i;){var s=e[a];if(t.call(n,s,a,e))return s;a++}},configurable:!0,writable:!0}),!document.getElementsByClassName){var t=[].indexOf||function(t){for(var e=0;e<this.length;e++)if(this[e]===t)return e;return-1},e=function(e,i){return document.querySelectorAll?i.querySelectorAll("."+e):function(){for(var n=i.getElementsByTagName("*"),a=[],s=0;s<n.length;s++)n[s].className&&(" "+n[s].className+" ").indexOf(" "+e+" ")>-1&&-1===t.call(a,n[s])&&a.push(n[s]);return a}()};document.getElementsByClassName=function(t){return e(t,document)},Element.prototype.getElementsByClassName=function(t){return e(t,this)}}for(var i=0,n=["ms","moz","webkit","o"],a=0;a<n.length&&!window.requestAnimationFrame;++a)window.requestAnimationFrame=window[n[a]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[n[a]+"CancelAnimationFrame"]||window[n[a]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,e){var n=(new Date).getTime(),a=Math.max(0,16-(n-i)),s=window.setTimeout((function(){t(n+a)}),a);return i=n+a,s}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),this.style={transform:this.prefixStyle("transform"),transitionTimingFunction:this.prefixStyle("transitionTimingFunction"),transitionDuration:this.prefixStyle("transitionDuration")}},log:function(t){return!0===t?console.log:function(){}},getLocalStorage:function(){if(null===this.localStorage)try{this.localStorage=window.localStorage,this.localStorage.setItem("TEST","1"),this.localStorage.removeItem("TEST")}catch(t){this.localStorage=!1}return this.localStorage},prefixStyle:function(t){for(var e=document.createElement("div").style,i="",n=["webkitT","MozT","msT","OT","t"],a=0;a<n.length;a++)n[a]+"ransform"in e&&(i=n[a].substr(0,n[a].length-1));return""===i?t:i+t.charAt(0).toUpperCase()+t.substr(1)},getParameterByName:function(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(location.search);return null===e?0:decodeURIComponent(e[1].replace(/\+/g," "))},now:Date.now||function(){return(new Date).getTime()},nowInSeconds:function(){return Math.floor(this.now()/1e3)},time:function(t){this.startTimes.push({label:t,time:this.now()})},timeEnd:function(t){t=t||0;var i,n,a=[];e.time("#end#");for(var s=1;s<this.startTimes.length;s++)(i=this.startTimes[s].time-this.startTimes[s-1].time)>=t&&a.push(this.startTimes[s-1].label+" = "+i);for(n in this.callCount)a.push("count: "+n+" = "+this.callCount[n]);return console.log(a),this.startTimes.length=0,this.callCount={},a},createCookie:function(t,e,i){if(t){var n;if(i){var a=new Date;a.setTime(a.getTime()+24*i*60*60*1e3),n="; expires="+a.toGMTString()}else n="";document.cookie=escape(t)+"="+escape(e)+n+"; path=/"}},readCookie:function(t){for(var e=escape(t)+"=",i=document.cookie.split(";"),n=0;n<i.length;n++){for(var a=i[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(e))return unescape(a.substring(e.length,a.length))}return null},eraseCookie:function(t){e.createCookie(t,"",-1)},delay:function(t,i,n){var a,s=e.now()+n;return this.delayProcess.id?s>=this.delayProcess.timeStamp?a={timeStamp:s,oid:i,delay:n}:s<this.delayProcess.timeStamp&&(a={timeStamp:this.delayProcess.timeStamp,oid:this.delayProcess.oid,delay:this.delayProcess.delay},clearTimeout(this.delayProcess.id),this.delayProcess.oid=i,this.delayProcess.timeStamp=s,this.delayProcess.delay=n,this.delayProcess.id=setTimeout((function(){t(),e.delayProcess={}}),n)):(this.delayProcess.oid=i,this.delayProcess.timeStamp=s,this.delayProcess.delay=n,this.delayProcess.id=setTimeout((function(){t(),e.delayProcess={}}),n)),a}};function i(){}function n(){}function a(t){"string"==typeof t?(this.selector=t,this.element=a.query(t)):t&&(this.element=t),this.childrenCount=0,this.$domParent=void 0,this.originalContent=void 0,this.textOnly=!0}function s(){}function r(){}function o(t){this.tmodel=t,this.xNext=0,this.xNorth=0,this.xWest=0,this.xEast=0,this.xSouth=0,this.xOverflow=0,this.xOffset=0,this.yNext=0,this.yNorth=0,this.yWest=0,this.yEast=0,this.ySouth=0,this.yOffset=0,this.reset()}function l(t,e){1===arguments.length&&"object"==typeof t&&(e=t,t=""),this.type=t||i.getTypeFromCallerFile()||"blank",this.targets=Object.assign({},e);var n=m.getOid(this.type);this.oid=n.oid,this.oidNum=n.num,this.targetValues={},this.actualValues={x:0,y:0,width:0,height:0,leftMargin:0,rightMargin:0,topMargin:0,bottomMargin:0,opacity:1,zIndex:1,scale:1,rotate:0,scrollLeft:0,scrollTop:0,textOnly:!0,html:void 0,css:"",style:null,children:[],addedChildren:[],allChildren:[],isInFlow:!0,canHaveDom:!0,canHandleEvents:!1,isOverflowHidden:!1,canBeVisible:!0,canBeBracketed:!0,isDomDeletable:!0},this.activeTargetKeyMap={},this.targetUpdatingMap={},this.targetUpdatingList=[],this.updatingChildren=[],this.targetLastUpdateMap={},this.parent=null,this.$dom=null,this.yVisible=!1,this.xVisible=!1,this.domHeight=void 0,this.domWidth=void 0,this.innerContentWidth=0,this.innerContentHeight=0,this.contentWidth=0,this.contentHeight=0,this.x=0,this.y=0,this.absX=0,this.absY=0,this.deepY=0,this.deepX=0,this.inFlowVisibles=[],this.domValues={}}function u(){this.currentTouch={deltaY:0,deltaX:0,pinchDelta:0,key:"",manualMomentumFlag:!1,orientation:"none",dir:"",timeStamp:0},this.eventMap={mousedown:"touchstart",touchstart:"touchstart",mousemove:"touchmove",touchmove:"touchmove",touchend:"touchend",touchcancel:"touchend",pointerup:"touchend",MSPointerUp:"touchend",mouseup:"touchend",pointercancel:"touchend",MSPointerCancel:"touchend",mousecancel:"touchend",mouseleave:"touchleave",wheel:"wheel",DOMMouseScroll:"wheel",mousewheel:"wheel",keyup:"key",resize:"resize",orientationchange:"resize"},this.lastEvent=void 0,this.eventName="",this.eventTagName="",this.cursor={x:0,y:0},this.start0=void 0,this.start1=void 0,this.end0=void 0,this.end1=void 0,this.touchCount=0,this.currentEvent="",this.currentHandlers={touch:null,scrollLeft:null,scrollTop:null,pinch:null}}function h(){this.resultMap={},this.loadingMap={},this.singleLoadList=void 0,this.groupLoadList=void 0,this.imgLoadList=void 0,this.stopLoadingAfterAttempts=i.isDefined(t.stopLoadingAfterAttempts)?t.stopLoadingAfterAttempts:10,this.attemptFailedInterval=i.isDefined(t.attemptFailedInterval)?t.attemptFailedInterval:2e3,this.statistics={}}function c(t){var e=new l("BI");return e.parent=t,e.newFlag=!0,e.targets={canHaveDom:!1,innerXEast:{loop:!0,value:function(){return i.isDefined(e.getRealParent().getValue("innerXEast"))?e.getRealParent().getValue("innerXEast"):e.getRealParent().absX+e.getRealParent().getWidth()}},xOverflow:{loop:!0,value:function(){return this.getRealParent().getX()}},outerXEast:0},e.getTargetWidth=function(){return this.getContentWidth()},e.getTargetHeight=function(){return this.getContentHeight()},e.getWidth=function(){return this.getContentWidth()||1},e.getHeight=function(){return this.getContentHeight()||1},e.getInnerWidth=function(){return this.innerContentWidth},e.getInnerContentHeight=function(){return this.innerContentHeight},e.getScrollTop=function(){return this.initParents(),this.getRealParent().getScrollTop()},e.getScrollLeft=function(){return this.initParents(),this.getRealParent().getScrollLeft()},e.addUpdatingChild=function(t){this.getRealParent().addUpdatingChild(t)},e.createViewport=function(){return this.getRealParent().createViewport.call(this)},e.getRealParent=function(){return this.initParents(),this.realParent},e.shouldCalculateChildrenLocations=function(){var t=this.isVisible()||this.newFlag;return this.newFlag=!1,t},e.getChildren=function(){return this.actualValues.tchildren},e.addToParentVisibleList=function(){},e.initParents=function(){if(!this.realParent&&!this.topBracket){for(var t=this,e=this.bracketParent;e&&"BI"===e.type;)t=e,e=e.bracketParent;this.realParent=e,this.topBracket=t}},e.getChildrenOids=function(){for(var t=[],e=this.getChildren(),i=0;i<e.length;i++){var n=e[i];if("BI"===n.type){var a=n.getChildrenOids();t=[].concat(t,[n.oid],a)}else t.push(n.oid+":"+(n.location?n.y+"px":"0px"))}return t},e}function d(){this.hasLocationList=[],this.hasLocationMap={},this.bracketThreshold=4,this.locationCount=[]}function g(){this.lastLink=document.URL,this.pageCache={}}function p(){this.init()}function f(){this.doneTargets=[]}function m(i,n){return(t=function(i,n){function r(){}return r.throttle=0,r.debugLevel=0,r.runningFlag=!1,r.rootId=n||"#tpage",r.init=function(){return e.setup(),r.window=new a(window),r.window.addEvent("popstate",(function(e){e.state&&t.pager.openLinkFromHistory(e.state)})),r.loader=new h,r.pager=new g,r.dim=function(){function t(){}return t.screen={x:0,y:0,width:0,height:0},t.measureScreen=function(){return t.screen.width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t.screen.height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,t},t}().measureScreen(),r.ui=new l("ui",{width:{loop:!0,value:function(){return r.dim.screen.width}},height:{loop:!0,value:function(){return r.dim.screen.height}}}),r.ui.xVisible=!0,r.ui.yVisible=!0,r.events=new u,r.locationManager=new d,r.targetManager=new f,r.manager=new p,window.history.pushState({link:document.URL},"",document.URL),i&&r.ui.addChild(i),r},r.start=function(){return r.runningFlag=!1,a.query(r.rootId)?r.$dom=new a(r.rootId):(r.$dom=new a,r.$dom.create("div"),r.$dom.setSelector(r.rootId),r.$dom.setId(r.rootId),r.$dom.attr("tabindex","0"),new a("body").append$Dom(r.$dom)),r.events.removeHandlers(),r.events.clear(),r.events.addHandlers(),r.dim.measureScreen(),r.resetRuns(),r.runningFlag=!0,r.$dom.focus(),r.manager.scheduleRun(0,"appStart"),r},r.stop=function(){return r.runningFlag=!1,r.events.removeHandlers(),r.events.clear(),r.resetRuns(),r},r.addChild=function(t){r.ui.addChild(t)},r.resetRuns=function(){r.manager.nextRuns=[],r.manager.runningStep=0,r.manager.runningFlag=!1},r.reset=function(){r.manager.lists.visible.forEach((function(t){t.domValues={}})),r.manager.lists.visible.length=0,r.manager.lists.invisibleDom.length=0,r.manager.lists.deletedTModel.length=0,r.manager.lists.visibleNoDom.length=0,r.manager.visibleTypeMap={},r.manager.visibleOidMap={},r.locationManager.hasLocationList.length=0,s.foundParentWithTarget={},s.foundTypeMap={},s.foundTargetMap={}},r.isRunning=function(){return r.runningFlag},r.find=function(t){return s.find(t)},r}(i,n)).init().start(),t}i.getTypeFromCallerFile=function(){var t=new Error("PRINTING CALL STACK").stack.split("\n"),e=t.findIndex((function(t){return t.indexOf("TModel")>=0})),n=(e<t.length-1?t[e+1]:"").match(/[a-zA-Z]{3,}/);return i.isDefined(n)?n[0]:""},i.initDoms=function(t){var e=a.findByClass("tgt");t.forEach((function(t){t.$dom=null}));for(var n=i.list2map(t.filter((function(t){return"BI"!==t.type}))),s=0;s<e.length;s++){var r=e[s],o=r.getAttribute("id"),l=n[o];l&&!l.hasDom()?l.$dom=new a("#"+o):a.detach(r)}},i.list2map=function(t,e){return t.reduce((function(t,n){return t[n.oid]=i.isDefined(e)?e:n,t}),{})},i.getDeepList=function(t){var e=[];return function t(i){if(i.hasChildren()){var n=i.getChildren();e=e.concat(n),n.forEach((function(e){t(e)}))}}(t),e},i.getDeepUpdatingList=function(t){var e=[];return function t(i){i.updatingChildren&&(e=e.concat(i.updatingChildren),i.updatingChildren.forEach((function(e){t(e)})))}(t),e},i.areEqual=function(t,e,n){return n?JSON.stringify(t)===JSON.stringify(e):!(!i.isDefined(t)||!i.isDefined(e))&&t===e},i.momentum=function(t,e,i){i=i||1;var n=e-t,a=Math.abs(n)/i*5e3,s=100*a/10;return n>0?n+=s:n-=s,{distance:Math.round(n)/50,duration:a,momentumDistance:s,time:5*i}},i.isDefined=function(t){return null!=t},i.isNumber=function(t){return"number"==typeof t&&!isNaN(t)},i.limit=function(t,e,n){return(t=(t=i.isDefined(t)?t:e)>n?n:t)<e?e:t},i.getOptionValue=function(t,e,n){return i.isDefined(t)?"function"==typeof t?t.call(n):t:e},i.executeFunctionByName=function(t,e){if(!t)return null;for(var i=Array.prototype.slice.call(arguments,2),n=t.split("."),a=n.pop(),s=0;s<n.length;s++)e=e[n[s]];return e&&e[a]?e[a].apply(e,i):void 0},i.formatPeriod=function(t){return(t=t<0?0:t)<120?t+" sec":t<7200?Math.floor(t/60)+" min":t<172800?Math.floor(t/3600)+" hours":Math.floor(t/86400)+" days"},i.formatNum=function(t,e){if(!t)return 0;var i=t.toString();return parseFloat(i).toFixed(e)},i.distance=function(t,e,i,n){return Math.sqrt((i-t)*(i-t)+(n-e)*(n-e))},i.getFullLink=function(t){if(i.isDefined(t)){if(0===t.indexOf("http"))return t;var e=window.location.protocol,n=(e+=e.endsWith(":")?"//":"://")+window.location.hostname;return t.startsWith("/")?n+t:n+"/"+t}},n.linear=function(t){return t},n.easeInQuad=function(t){return t*t},n.easeOutExpo=function(t){return 1-(1-t)*(1-t)},n.circular=function(t){return Math.sqrt(1- --t*t)},a.prototype.exists=function(){return this.selector&&(this.element=a.query(this.selector)),!!this.element},a.prototype.create=function(t){this.element=document.createElement(t)},a.prototype.setSelector=function(t){this.selector=t},a.prototype.setId=function(t){this.attr("id","#"===t[0]?t.slice(1):t)},a.prototype.focus=function(){this.element.focus()},a.prototype.attr=function(t,e){if(this.element)return i.isDefined(e)?void this.element.setAttribute(t,e):this.element.getAttribute(t)},a.prototype.opacity=function(t){if(!i.isDefined(t))return this.element.style.opacity;this.element.style.opacity=t},a.prototype.width=function(t){if(!i.isDefined(t))return this.element.offsetWidth;this.element.style.width=i.isNumber(t)?t+"px":t},a.prototype.height=function(t){if(!i.isDefined(t))return this.element.offsetHeight;this.element.style.height=i.isNumber(t)?t+"px":t},a.prototype.zIndex=function(t){return i.isDefined(t)&&(this.element.style.zIndex=t),this.element.style.zIndex},a.prototype.css=function(t){if(!i.isDefined(t))return this.attr("classs");this.attr("class",t)},a.prototype.setStyleByMap=function(t){var e=this;Object.keys(t).forEach((function(i){var n=t[i];switch(i){case"transform":e.transform.apply(e,n);break;case"width":e.width(n);break;case"height":e.height(n);break;case"zIndex":e.zIndex(n);break;case"opacity":e.opacity(n);break;default:e.setStyle(i,n)}}))},a.prototype.setStyle=function(t,e){this.element.style[t]=e},a.prototype.getStyle=function(t){return this.element.style[t]},a.prototype.getStyleValue=function(t){var e=this.getStyle(t),n=i.isDefined(e)?e.replace(/[^-\d.]/g,""):0;return parseFloat(n)},a.prototype.parent=function(){return this.element?this.element.parentElement:null},a.prototype.detach=function(){a.detach(this.element),this.$domParent&&this.$domParent.childrenCount>0&&this.$domParent.childrenCount--},a.prototype.append$Dom=function(t){this.element.appendChild(t.element)},a.prototype.appendTModel$Dom=function(t){0===this.childrenCount&&this.element.children.length>1&&t.getDomParent()&&t.getDomParent().getHtml()&&t.getDomParent().getHtml()===this.originalContent&&(this.element.innerHTML="<div>"+this.html()+"</div>"),this.element.appendChild(t.$dom.element),t.$dom.$domParent=this,this.childrenCount++},a.prototype.html=function(t){if(!i.isDefined(t))return this.originalContent;if(this.childrenCount>0){var e=document.createElement("div");e.innerHTML=t,i.isDefined(this.originalContent)?this.element.replaceChild(e,this.element.firstChild):this.element.insertBefore(e,this.element.firstChild),this.originalContent=t,this.textOnly=!1}else this.element.innerHTML=t,this.originalContent=t,this.textOnly=!1},a.prototype.text=function(t){if(!i.isDefined(t))return this.originalContent;if(this.childrenCount>0){var e=document.createTextNode(t);i.isDefined(this.originalContent)?this.element.replaceChild(e,this.element.firstChild):this.element.insertBefore(e,this.element.firstChild),this.originalContent=t,this.textOnly=!0}else this.element.textContent=t,this.originalContent=t,this.textOnly=!0},a.prototype.outerHTML=function(t){this.element.outerHTML=t},a.prototype.innerHTML=function(t){if(!i.isDefined(t))return this.element.innerHTML;this.element.innerHTML=t},a.prototype.addClass=function(t){var e=this.attr("class"),i=e?e.indexOf(t)>=0?e:e+" "+t:t;i!==e&&this.attr("class",i)},a.prototype.addEvent=function(t,e){this.element.addEventListener?this.element.addEventListener(t,e,{capture:!1,passive:!1}):this.element.attachEvent("on"+t,e)},a.prototype.detachEvent=function(t,e){this.element.removeEventListener?this.element.removeEventListener(t,e,!1):this.element.detachEvent?this.element.detachEvent("on"+t,e):this.element["on"+t]=null},a.prototype.transform=function(t,i,n,a){var s=this.createTrasformValue(t,i,n,a);s!==this.element.style[e.style.transform]&&(this.element.style[e.style.transform]=s)},a.prototype.createTrasformValue=function(t,e,n,a){return"translate("+t+"px,"+e+"px)"+(n=i.isDefined(n)&&0!==n?"rotate("+n+"deg)":"")+(i.isDefined(a)&&1!==a?"scale("+a+")":"")},a.prototype.getContext=function(t,e){var n=i.isDefined(e)?a.query(e):this.query("canvas");return n?n.getContext(t):void 0},a.prototype.findFirstByClass=function(t){return a.findFirstByClass(t,this.element)},a.prototype.findFirstByTag=function(t){return a.findFirstByTag(t,this.element)},a.prototype.query=function(t){return"#"===t[0]?a.findById(t):"."===t[0]?this.findFirstByClass(t):this.findFirstByTag(t)},a.query=function(t){return"#"===t[0]?a.findById(t):"."===t[0]?a.findFirstByClass(t):a.findFirstByTag(t)},a.findById=function(t){return document.getElementById("#"===t[0]?t.slice(1):t)},a.findFirstByClass=function(t,e){var i=a.findByClass(t,e);return i.length>0?i[0]:null},a.findFirstByTag=function(t,e){var i=a.findByTag(t,e);return i.length>0?i[0]:null},a.findByTag=function(t,e){return(e=i.isDefined(e)?e:document).getElementsByTagName(t)},a.findByClass=function(t,e){return(e=i.isDefined(e)?e:document).getElementsByClassName("."===t[0]?t.slice(1):t)},a.findNearestParentWithId=function(t){for(;t;){if("function"==typeof t.getAttribute&&t.getAttribute("id"))return t.getAttribute("id");t=t.parentElement}},a.detach=function(t){var e=i.isDefined(t)?t.parentElement:null;e&&e.removeChild(t)},a.ready=function(t){new a(document).addEvent("DOMContentLoaded",t)},a.ajax=function(t){var e=new XMLHttpRequest,i="";t.data&&(i=Object.keys(t.data).map((function(e){return e+"="+encodeURIComponent(t.data[e])})).join("&")),e.onreadystatechange=function(){if(4===e.readyState)if(200===e.status){var i="json"===t.dataType?JSON.parse(this.responseText):this.responseText;t.success(i)}else t.error(e.status)},"POST"===t.type?(e.open(t.type,t.url,!0),e.setRequestHeader("Content-type","application/x-www-form-urlencoded"),e.send(i)):(t.url+=i?t.url>""&&t.url.indexOf("?")>=0?"&"+i:"?"+i:"",e.open(t.type,t.url,!0),e.send())},s.foundParentWithType={},s.foundParentWithTarget={},s.foundTypeMap={},s.foundTargetMap={},s.foundOids={},s.findFirstPinchHandler=function(t){return s.findEventHandler(t,"pinch")},s.findFirstScrollTopHandler=function(t){return s.findEventHandler(t,"scrollTop")},s.findFirstScrollLeftHandler=function(t){return s.findEventHandler(t,"scrollLeft")},s.findFirstTouchHandler=function(t){return s.findEventHandler(t,"touch")},s.findEventHandler=function(t,e){for(;t;){if(!0===t.canHandleEvents()||t.canHandleEvents()===e||Array.isArray(t.canHandleEvents())&&t.canHandleEvents().includes(e))return t;t=t.getParent()}},s.findParentWithType=function(t,e){var n,a=t.oid+"__"+e;return i.isDefined(s.foundParentWithType[a])||(function(){for(n=t.getParent();n&&n.type!==e;)n=n.getParent()}(),n&&(s.foundParentWithType[a]=n)),s.foundParentWithType[a]},s.findParentWithTarget=function(t,e){var n,a=t.oid+"__"+e;return i.isDefined(s.foundParentWithTarget[a])||(function(){for(n=t.getParent();n&&!i.isDefined(n.targets[e])&&!i.isDefined(n.targetValues[e]);)n=n.getParent()}(),n&&(s.foundParentWithTarget[a]=n)),s.foundParentWithTarget[a]},s.findByType=function(e){var n;return i.isDefined(s.foundTypeMap[e])||(n=function t(i){if(i.tmodel.type===e)return i;for(var a,s=i.getChildren(),r=0;s&&r<s.length&&!a;r++)(n=s[r]).hasChildren()?a=t(n):n.type===e&&(a=n);return a}(t.ui))&&(s.foundTypeMap[e]=n),s.foundTypeMap[e]},s.findByTarget=function(e){var n;return i.isDefined(s.foundTargetMap[e])||(n=function t(i){if(i.targets[e])return i;for(var a,s=i.getChildren(),r=0;s&&r<s.length&&!a;r++)(n=s[r]).hasChildren()?a=t(n):n.targets[e]&&(a=n);return a}(t.ui))&&(s.foundTargetMap[e]=n),s.foundTargetMap[e]},s.find=function(e){var n;return i.isDefined(s.foundOids[e])||(n=function t(i){if(i.oid===e)return i;for(var a,s=i.getChildren(),r=0;s&&r<s.length&&!a;r++)(n=s[r]).hasChildren()?a=t(n):n.oid===e&&(a=n);return a}(t.ui))&&(s.foundOids[e]=n),s.foundOids[e]},r.extractInvisibles=function(t,e,i){"object"==typeof e&&e&&Object.keys(e).forEach((function(n){"onInvisible"===n&&(t.invisibleFunctions||(t.invisibleFunctions=[]),t.invisibleFunctions.push({fn:e[n],key:i}))}))},r.emptyValue=function(){return{value:void 0,step:0,steps:0,cycle:0,cycles:0,stepInterval:0,lastActualValue:void 0,actualTimeStamp:void 0,actualValueLastUpdate:0,status:"",executionCounter:0,callingTargetKey:void 0}},r.getValueStepsCycles=function(t,e,n,a,s){var r=0,o=0,u=0,h=0,c=t.getValue(s);return function e(d){return Array.isArray(d)?d.valueOnly?[d,o,u,h]:(r="function"==typeof d[0]?d[0].call(t,s,n,c):d[0],o=d.length>=2?d[1]:o,u=d.length>=3?d[2]:u,h=d.length>=4?d[3]:h,[r,o,u,h]):"object"!=typeof d||!d||d instanceof l?"function"==typeof d?e(d.call(t,s,n,c)):"number"==typeof d||"string"==typeof d||"boolean"==typeof d||d instanceof l||"object"==typeof d?[d,o,u,h]:[r,o,u,h]:(r="function"==typeof d.value?d.value.call(t,s,n,c):i.isDefined(d.value)?d.value:d,o="function"==typeof d.steps?d.steps.call(t,s,n):i.isDefined(d.steps)?d.steps:0,u="function"==typeof d.stepInterval?d.stepInterval.call(t,s,n,t.getTargetStepInterval(s),o):i.isDefined(d.stepInterval)?d.stepInterval:0,h="function"==typeof d.cycles?d.cycles.call(t,s,n,t.getTargetCycles(s)):i.isDefined(d.cycles)?d.cycles:0,Array.isArray(r)&&!1===a&&!r.valueOnly?e(r):[r,o,u,h])}(e)},r.assignValueArray=function(t,e,n){if(Array.isArray(n)){var a=n[0],s=n[1],r=n[2],o=n[3],l=t.targets[e],u=(t.getTargetCycle(e),t.targetValues[e]),h=u?u.value:void 0,c=!i.areEqual(h,a,l.deepEquality)||!i.isDefined(u)||!t.isTargetUpdating(e)&&!t.doesTargetEqualActual(e);(c||u.steps!==s||u.cycles!==o||u.stepInterval!==r)&&(t.setTargetValue(e,a,s,r,o,e),t.targetValues[e].executionCounter++,c&&(t.resetTargetStep(e),t.resetLastActualValue(e)))}},r.getIntervalValue=function(t,e,n){var a="function"==typeof n?n.call(t,e):n;return i.isNumber(a)?a:0},r.getActualSchedulePeriod=function(t,n,a){var s,r=e.now(),o=0;return a>0?i.isDefined(t.getActualTimeStamp(n))?o=(s=r-t.getActualTimeStamp(n))<a?a-s:0:(t.setActualTimeStamp(n,r),o=a):i.isDefined(t.getActualTimeStamp(n))&&(o=(s=r-t.getActualTimeStamp(n))<0?-s:0),o},r.getTargetSchedulePeriod=function(t,n,a){var s,r=e.now(),o=0;return a>0?i.isDefined(t.getTargetTimeStamp(n))?o=(s=r-t.getTargetTimeStamp(n))<a?a-s:0:(t.setTargetTimeStamp(n,r),o=a):i.isDefined(t.getTargetTimeStamp(n))&&(o=(s=r-t.getTargetTimeStamp(n))<0?-s:0),o},r.handleValueChange=function(t,e,n,a,s,r){"object"==typeof t.targets[e]&&"function"==typeof t.targets[e].onValueChange&&!i.areEqual(n,a,t.targets[e].deepEquality)&&t.targets[e].onValueChange.call(t,e,n,a,r)},r.setWidthFromDom=function(t){var e=i.isDefined(t.domWidth)?t.domWidth.width:10;i.isDefined(t.domWidth)&&t.domWidth.height===t.getHeight()&&!t.hasTargetUpdatedAfter("width","width",t.getParent())||(t.$dom.width("auto"),e=t.$dom.width()),t.domWidth={width:e,height:t.getHeight()},t.setValue("width",e)},r.setHeightFromDom=function(t){var e=i.isDefined(t.domHeight)?t.domHeight.height:10;i.isDefined(t.domHeight)&&t.domHeight.width===t.getWidth()&&!t.hasTargetUpdatedAfter("height","height",t.getParent())||(t.$dom.height("auto"),e=t.$dom.height()),t.domHeight={height:e,width:t.getWidth()},t.setValue("height",e)},o.prototype.reset=function(){var t,e;return"BI"===this.tmodel.type?(t=this.tmodel.getX()+this.tmodel.getScrollLeft(),e=this.tmodel.getY()+this.tmodel.getScrollTop(),this.xNext=t,this.xNorth=t,this.xEast=t,this.xSouth=t,this.xWest=t,this.xOverflow=i.isDefined(this.tmodel.getValue("xOverflow"))?this.tmodel.getValue("xOverflow"):t,this.yNext=e,this.yNorth=e,this.yWest=e,this.yEast=e,this.ySouth=this.tmodel.getRealParent().viewport?this.tmodel.getRealParent().viewport.ySouth:e):(t=this.tmodel.getX(),e=this.tmodel.getY(),this.xNext=t,this.xNorth=t,this.xEast=t,this.xSouth=t,this.xWest=t,this.xOverflow=i.isDefined(this.tmodel.getValue("xOverflow"))?this.tmodel.getValue("xOverflow"):t,this.yNext=e,this.yNorth=e,this.yWest=e,this.yEast=e,this.ySouth=e),this},o.prototype.setCurrentChild=function(t){this.currentChild=t,this.xOffset=t.getDomParent()?-t.getDomParent().getX():0,this.yOffset=t.getDomParent()?-t.getDomParent().getY():0},o.prototype.getXNext=function(){return this.xNext+this.currentChild.getLeftMargin()+this.xOffset-this.tmodel.getScrollLeft()},o.prototype.getYNext=function(){return this.yNext+this.currentChild.getTopMargin()+this.yOffset-this.tmodel.getScrollTop()},o.prototype.isXVisible=function(t,e,i,n,a){return"BI"===t.type||e<=a&&i>=n},o.prototype.isYVisible=function(t,e,i,n,a){return e<=a&&i>=n},o.prototype.isVisible=function(e){var i=e.getDomParent()?e.getDomParent().getScale():1,n=t.dim.screen.x,a=t.dim.screen.y,s=t.dim.screen.width,r=t.dim.screen.height,o=e.getX(),l=e.getY();e.getDomHolder()!==t.$dom?(n=e.getDomParent().isInFlow()?e.getDomParent().absX:e.getDomParent().getX(),a=e.getDomParent().isInFlow()?e.getDomParent().absY:e.getDomParent().getY(),s=Math.min(s,n+e.getDomParent().getWidth()),r=Math.min(r,a+e.getDomParent().getHeight()),n=Math.max(0,n),a=Math.max(0,a),o=e.getDomParent().isInFlow()?e.getDomParent().absX+e.getX():e.getDomParent().getX()+e.getX(),l=e.getDomParent().isInFlow()?e.getDomParent().absY+e.getY():e.getDomParent().getY()+e.getY()):"BI"===e.type&&(s=e.getRealParent().getX()+e.getRealParent().getWidth(),r=e.getRealParent().getY()+e.getRealParent().getHeight());var u=i*e.getTargetScale(),h=u*e.getTargetWidth(),c=u*e.getTargetHeight();return e.xVisible=this.isXVisible(e,o,o+h,n,s),e.yVisible=this.isYVisible(e,l,l+c,a,r),e.isVisible()},o.prototype.isOverflow=function(t,e){if(i.isNumber(t)&&i.isNumber(e))return t>e},o.prototype.overflow=function(){this.xNext=this.xOverflow,this.yNext=this.ySouth},o.prototype.appendNewLine=function(){var t=this.currentChild.getHeight()*this.currentChild.getScale();this.xNext=this.xOverflow,this.yNext=this.ySouth+t+this.currentChild.getTopMargin()+this.currentChild.getBottomMargin()+this.currentChild.getValue("appendNewLine"),this.yEast=this.yNext,this.xSouth=this.xNext,this.ySouth=Math.max(this.yNext,this.ySouth),this.currentChild.getRealParent().viewport.xEast=Math.max(this.currentChild.getRealParent().viewport.xEast,this.xEast),this.currentChild.getRealParent().viewport.ySouth=Math.max(this.currentChild.getRealParent().viewport.ySouth,this.ySouth)},o.prototype.nextLocation=function(){var t=this.currentChild.getInnerWidth()*this.currentChild.getScale(),e=this.currentChild.getInnerHeight()*this.currentChild.getScale(),i=this.currentChild.getInnerContentHeight()*this.currentChild.getScale(),n=this.yNext+e+this.currentChild.getTopMargin()+this.currentChild.getBottomMargin();this.xNext+=t+this.currentChild.getLeftMargin()+this.currentChild.getRightMargin(),this.yNext+=i,this.xSouth=this.xNext,this.yEast=this.yNext,this.xEast=Math.max(this.xNext,this.xEast),this.ySouth=Math.max(n,this.ySouth),this.currentChild.getRealParent().viewport.xEast=Math.max(this.currentChild.getRealParent().viewport.xEast,this.xEast),this.currentChild.getRealParent().viewport.ySouth=Math.max(this.currentChild.getRealParent().viewport.ySouth,this.ySouth)},o.prototype.calcContentWidthHeight=function(){this.tmodel.contentHeight=this.ySouth-this.yNorth,this.tmodel.innerContentHeight=this.yEast-this.yNorth,this.tmodel.innerContentWidth=this.xSouth-this.xWest,this.tmodel.contentWidth=this.xEast-this.xWest},l.prototype.getParent=function(){return this.parent},l.prototype.getRealParent=function(){return this.parent},l.prototype.getDomParent=function(){return this.actualValues.domParent?this.actualValues.domParent:null},l.prototype.getDomHolder=function(){return this.getDomParent()?this.getDomParent().$dom:t.$dom},l.prototype.hasDomHolderChanged=function(){return this.getDomHolder()&&this.getDomHolder().exists()&&this.$dom.parent().getAttribute("id")!==this.getDomHolder().attr("id")},l.prototype.hasDom=function(){return!!this.$dom&&this.$dom.exists()},l.prototype.hasChildren=function(){return this.getChildren().length>0},l.prototype.getChildren=function(){if(!this.getActualValueLastUpdate("allChildren")||this.getActualValueLastUpdate("children")>=this.getActualValueLastUpdate("allChildren")||this.getActualValueLastUpdate("addedChildren")>=this.getActualValueLastUpdate("allChildren")){if(this.actualValues.allChildren=this.actualValues.children.concat(this.actualValues.addedChildren),this.actualValues.children.length>0){var t=this;this.actualValues.children.forEach((function(e){e.parent=t})),this.actualValues.allChildren.sort((function(t,e){return!t.canBeBracketed()&&e.canBeBracketed()?-1:1}))}this.targetValues.allChildren?this.setActualValueLastUpdate("allChildren"):this.setTargetValue("allChildren",this.actualValues.allChildren)}return this.actualValues.allChildren},l.prototype.getAllNestedChildren=function(){var t=[];return function e(i){if(i.hasChildren()){var n=i.getChildren();t=t.concat(n),n.forEach((function(t){e(t)}))}}(this),t},l.prototype.getLastChild=function(){return this.hasChildren()?this.getChildren()[this.getChildren().length-1]:void 0},l.prototype.getFirstChild=function(){return this.hasChildren()?this.getChildren()[0]:void 0},l.prototype.getChild=function(t){return this.hasChildren()?this.getChildren()[t]:void 0},l.prototype.getChildIndex=function(t){return this.getChildren().indexOf(t)},l.prototype.getChildrenOids=function(){return this.getChildren().oids()},l.prototype.filterChildren=function(t){return this.getChildren().filter((function(e){return Array.isArray(t)?t.includes(e.type):"function"==typeof t?t.call(e):e.type===t}))},l.prototype.findChild=function(t){return this.getChildren().find((function(e,i){return"function"==typeof t?t.call(e):e.type===t}))},l.prototype.findLastChild=function(t){return this.getChildren().findLast((function(e){return"function"==typeof t?t.call(e):e.type===t}))},l.prototype.getParentValue=function(t){var e=s.findParentWithTarget(this,t);return e?e.getValue(t):void 0},l.prototype.getGlobalValue=function(t){var e=s.findByTarget(t);return e?e.getValue(t):void 0},l.prototype.getGlobalValueByType=function(t,e){var i=s.findByType(t);return i?i.getValue(e):void 0},l.prototype.getContentHeight=function(){return this.contentHeight},l.prototype.getInnerContentHeight=function(){return 0},l.prototype.getInnerHeight=function(){return i.isDefined(this.actualValues.innerHeight)?this.actualValues.innerHeight:this.getHeight()},l.prototype.getInnerWidth=function(){return i.isDefined(this.actualValues.innerWidth)?this.actualValues.innerWidth:this.getWidth()},l.prototype.getContentWidth=function(){return this.contentWidth},l.prototype.getUIDepth=function(){for(var t=0,e=this.parent;e;)t++,e=e.parent;return t},l.prototype.resetVisibleList=function(){this.inFlowVisibles.length=0},l.prototype.addToParentVisibleList=function(){this.isVisible()&&this.isInFlow()&&this.getParent()&&this.getParent().inFlowVisibles.push(this)},l.prototype.isVisible=function(){return this.xVisible&&this.yVisible},l.prototype.createViewport=function(){return this.viewport=this.viewport?this.viewport.reset():new o(this),this.viewport},l.prototype.setLocation=function(t){this.x=t.getXNext(),this.y=t.getYNext(),this.absX=this.getDomParent()?this.getDomParent().absX+this.x:this.x,this.absY=this.getDomParent()?this.getDomParent().absY+this.y:this.y;var e=s.findFirstScrollTopHandler(this),i=s.findFirstScrollLeftHandler(this);this.deepX=this.absX+(e?e.getScrollTop():0),this.deepY=this.absY+(i?i.getScrollLeft():0)},l.prototype.shouldCalculateChildrenLocations=function(){return this.isVisible()&&this.canBeVisible()&&(this.hasChildren()||this.getContentHeight()>0)},l.prototype.manuallyCalculateChildrenLocations=function(){},l.prototype.fixOpacity=function(){var t=this.getOpacity().toFixed(2);this.$dom.opacity()!==t&&this.$dom.opacity(t)},l.prototype.fixCss=function(){var t=this.getCss();this.$dom.css()!==t&&this.$dom.css(t)},l.prototype.fixStyle=function(){var t=this.getStyle();i.isDefined(t)&&this.domValues.style!==t&&(this.$dom.setStyleByMap(t),this.domValues.style=t)},l.prototype.fixXYRotateScale=function(){var t=Math.floor(this.getX()),e=Math.floor(this.getY()),n=Math.floor(this.getRotate()),a=i.formatNum(this.getScale(),2);this.domValues.x===t&&this.domValues.y===e&&this.domValues.rotate===n&&this.domValues.scale===a||(this.$dom.transform(t,e,n,a),this.domValues.y=e,this.domValues.x=t,this.domValues.rotate=n,this.domValues.scale=a)},l.prototype.fixDim=function(){var t=Math.floor(this.getWidth()),e=Math.floor(this.getHeight());this.$dom.width()===t&&this.$dom.height()===e||(this.$dom.width(t),this.$dom.height(e))},l.prototype.fixZIndex=function(){var t=Math.floor(this.getZIndex());this.$dom.zIndex()!==t&&this.$dom.zIndex(t)},l.prototype.isMarkedDeleted=function(){return!0===this.getValue("tmodelDeletedFlag")},l.prototype.markAsDeleted=function(){this.setTargetValue("tmodelDeletedFlag",!0),this.getChildren().forEach((function(t){t.markAsDeleted()}))},l.prototype.isTextOnly=function(){return this.actualValues.textOnly},l.prototype.getHtml=function(){return this.actualValues.html},l.prototype.isOverflowHidden=function(){return this.actualValues.isOverflowHidden},l.prototype.isInFlow=function(){return this.actualValues.isInFlow},l.prototype.canHandleEvents=function(){return this.actualValues.canHandleEvents},l.prototype.canBeBracketed=function(){return this.actualValues.canBeBracketed},l.prototype.canBeVisible=function(){return this.actualValues.canBeVisible},l.prototype.canHaveDom=function(){return this.actualValues.canHaveDom},l.prototype.isDomDeletable=function(){return this.actualValues.isDomDeletable},l.prototype.getOpacity=function(){return this.actualValues.opacity},l.prototype.getX=function(){return this.actualValues.x},l.prototype.getY=function(){return this.actualValues.y},l.prototype.getZIndex=function(){return this.actualValues.zIndex},l.prototype.getScale=function(){return this.actualValues.scale},l.prototype.getValue=function(t){return this.actualValues[t]},l.prototype.getTopMargin=function(){return this.actualValues.topMargin},l.prototype.getLeftMargin=function(){return this.actualValues.leftMargin},l.prototype.getRightMargin=function(){return this.actualValues.rightMargin},l.prototype.getBottomMargin=function(){return this.actualValues.bottomMargin},l.prototype.getRotate=function(){return this.actualValues.rotate},l.prototype.getWidth=function(){return this.actualValues.width},l.prototype.getHeight=function(){return this.actualValues.height},l.prototype.getScrollTop=function(){return Math.floor(this.actualValues.scrollTop)},l.prototype.getScrollLeft=function(){return Math.floor(this.actualValues.scrollLeft)},l.prototype.getCss=function(){return this.actualValues.css.indexOf("tgt")>=0?this.actualValues.css:this.actualValues.css?"tgt "+this.actualValues.css:"tgt"},l.prototype.getStyle=function(){return this.actualValues.style},l.prototype.getScaledWidth=function(){return this.getWidth()*this.getScale()},l.prototype.getScaledHeight=function(){return this.getHeight()*this.getScale()},l.prototype.getTargetStepPercent=function(t,e){var n=this.getTargetSteps(t);return e=i.isDefined(e)?e:this.getTargetStep(t),n?e/n:1},l.prototype.resetTargetStep=function(t){this.targetValues[t]&&(this.targetValues[t].step=0)},l.prototype.resetTargetCycle=function(t){this.targetValues[t]&&(this.targetValues[t].cycle=0)},l.prototype.resetActualTimeStamp=function(t){this.targetValues[t]&&(this.targetValues[t].actualTimeStamp=void 0)},l.prototype.resetLastActualValue=function(t){this.targetValues[t]&&(this.targetValues[t].lastActualValue=void 0)},l.prototype.hasTargetUpdatedAfter=function(t,n,a){var s=!1,r=(a=i.isDefined(a)?a:this)?a.getActualValueLastUpdate(n):0;return r>0&&(!this.targetLastUpdateMap[t+"_"+n]||this.targetLastUpdateMap[t+"_"+n]-r<10)&&(s=!0,this.targetLastUpdateMap[t+"_"+n]=e.now()),s},l.prototype.updateTargetStatus=function(t){if(this.targetValues[t]){var e=this.getTargetCycle(t),i=this.getTargetCycles(t),n=this.getTargetStep(t),a=this.getTargetSteps(t);this.targetValues[t].status="",(a>0||i>0)&&(n<a||e<i||!this.doesTargetEqualActual(t))?this.targetValues[t].status="updating":!this.doesTargetEqualActual(t)&&this.isTargetInLoop(t)||(this.targetValues[t].status="done")}},l.prototype.getTargetStatus=function(t){return this.targetValues[t]?this.targetValues[t].status:0},l.prototype.isTargetUpdating=function(t){return this.targetValues[t]&&"updating"===this.targetValues[t].status},l.prototype.isTargetDone=function(t){return this.targetValues[t]&&"done"===this.targetValues[t].status},l.prototype.isTargetComplete=function(t){return this.targetValues[t]&&"complete"===this.targetValues[t].status},l.prototype.hasTargetGotExecuted=function(t){return!this.targets[t]||this.targetValues[t]&&this.targetValues[t].executionCounter>0},l.prototype.setTargetComplete=function(t){this.targetValues[t]&&(this.targetValues[t].status="complete")},l.prototype.isTargetEnabled=function(t){var e=this.targets[t];return!(!i.isDefined(e)||!1===e.enabledOn||"function"==typeof e.enabledOn&&!e.enabledOn.call(this,t))},l.prototype.isTargetInLoop=function(t){return i.isDefined(this.targets[t])&&this.targets[t].loop},l.prototype.enableTargetLoop=function(t){i.isDefined(this.targets[t])&&(this.targets[t].loop=!0)},l.prototype.disableTargetLoop=function(t){i.isDefined(this.targets[t])&&(this.targets[t].loop=!1)},l.prototype.doesTargetEqualActual=function(t){return this.targetValues[t]&&this.getTargetValue(t)===this.getValue(t)},l.prototype.getTargetValue=function(t){return this.targetValues[t]?"function"==typeof this.targetValues[t].value?this.targetValues[t].value.call(this):this.targetValues[t].value:void 0},l.prototype.getTargetSteps=function(t){return this.targetValues[t]&&this.targetValues[t].steps||0},l.prototype.getTargetStep=function(t){return this.targetValues[t]?this.targetValues[t].step:0},l.prototype.getActualTimeStamp=function(t){return this.targetValues[t]?this.targetValues[t].actualTimeStamp:void 0},l.prototype.getLastActualValue=function(t){return this.targetValues[t]?this.targetValues[t].lastActualValue:void 0},l.prototype.getActualValueLastUpdate=function(t){return this.targetValues[t]?this.targetValues[t].actualValueLastUpdate:void 0},l.prototype.setTargetStep=function(t,e){return this.targetValues[t]&&(this.targetValues[t].step=e),this.targetValues[t].step},l.prototype.getTargetCycles=function(t){return this.targetValues[t]&&this.targetValues[t].cycles||0},l.prototype.getTargetCycle=function(t){return this.targetValues[t]?this.targetValues[t].cycle:0},l.prototype.setTargetCycle=function(t,e){this.targetValues[t]&&(this.targetValues[t].cycle=e)},l.prototype.setActualTimeStamp=function(t,e){this.targetValues[t]&&(this.targetValues[t].actualTimeStamp=e)},l.prototype.setLastActualValue=function(t,e){this.targetValues[t]&&(this.targetValues[t].lastActualValue=e)},l.prototype.setActualValueLastUpdate=function(t){this.targetValues[t]&&(this.targetValues[t].actualValueLastUpdate=e.now())},l.prototype.getTargetEasing=function(t){return"object"==typeof this.targets[t]&&this.targets[t].easing?this.targets[t].easing:void 0},l.prototype.getTargetStepInterval=function(t){return this.targetValues[t]?this.targetValues[t].stepInterval:void 0},l.prototype.getTargetEventFunctions=function(t){return this.targetValues[t]?this.targetValues[t].events:void 0},l.prototype.getCallingTargetKey=function(t){return this.targetValues[t]?this.targetValues[t].callingTargetKey:void 0},l.prototype.resetCallingTargetKey=function(t){this.targetValues[t]&&(this.targetValues[t].callingTargetKey=t)},l.prototype.setTargetValue=function(e,n,a,s,o,l){if(!i.isDefined(this.targetValues[e])||n!==this.targetValues[e].value||n!==this.actualValues[e]||a||o||s||"object"==typeof this.targets[e]){if(a=a||0,o=o||0,s=s||0,this.targetValues[e]?(e===l||this.targetValues[e].callingTargetKey===l&&n===this.targetValues[e].value||(this.targetValues[e].step=0),this.targetValues[e].value=n,this.targetValues[e].steps=a,this.targetValues[e].cycles=o,this.targetValues[e].stepInterval=s,this.targetValues[e].callingTargetKey=l):(this.targetValues[e]=Object.assign(r.emptyValue(),{value:n,steps:a,cycles:o,stepInterval:s,callingTargetKey:l}),r.extractInvisibles(this,this.targets[e],e)),0===a&&0===o){var u=this.actualValues[e];this.actualValues[e]="function"==typeof n?n.call(this):n,this.setActualValueLastUpdate(e),r.handleValueChange(this,e,this.actualValues[e],u,0,0)}this.updateTargetStatus(e),this.isTargetUpdating(e)&&e!==l&&(this.activeTargetKeyMap[e]=!0,this.targetUpdatingMap[e]||(this.targetUpdatingList.push(e),this.targetUpdatingMap[e]=e),this.resetLastActualValue(e)),t.manager.scheduleRun(10,"setTargetValue-"+(this.getParent()?this.getParent().oid:"")+"-"+this.oid+"-"+e)}},l.prototype.setValue=function(t,e){this.actualValues[t]=e},l.prototype.addChild=function(e,n){var a=this.actualValues.addedChildren;return n=e.canBeBracketed()?i.isDefined(n)?n:a.length:0,e.parent=this,n>=a.length?a.push(e):a.splice(n,0,e),this.setActualValueLastUpdate("children"),this.targetValues.addedChildren?this.setActualValueLastUpdate("addedChildren"):this.setTargetValue("addedChildren",a),t.manager.scheduleRun(10,"addChild-"+this.oid+"-"+e.oid),n},l.prototype.addUpdatingChild=function(t){-1===this.updatingChildren.indexOf(t)&&this.updatingChildren.push(t)},l.prototype.removeUpdatingChild=function(t){var e=this.updatingChildren.indexOf(t);e>=0&&this.updatingChildren.splice(e,1)},l.prototype.addTarget=function(e,i){this.targets[e]=i,this.activeTargetKeyMap[e]=!0,delete this.targetValues[e],t.manager.scheduleRun(10,"addTarget-"+this.oid+"-"+e)},l.prototype.deleteTargetValues=function(e){delete this.targetValues[e],this.activeTargetKeyMap[e]=!0,t.manager.scheduleRun(10,"deleteTargetValues-"+this.oid+"-"+e)},l.prototype.getTargetHeight=function(){return this.getTargetValue("height")||1},l.prototype.getTargetWidth=function(){return this.getTargetValue("width")||1},l.prototype.getTargetScale=function(){return this.getTargetValue("scale")||1},u.prototype.removeHandlers=function(){if(this.bindedHandleEvent){var e=this;Object.keys(this.eventMap).forEach((function(i){("resize"===e.eventMap[i]?t.window:t.$dom).detachEvent(i,e.bindedHandleEvent)}))}},u.prototype.addHandlers=function(){this.bindedHandleEvent=this.bindedHandleEvent?this.bindedHandleEvent:this.handleEvent.bind(this);var e=this;Object.keys(this.eventMap).forEach((function(i){("resize"===e.eventMap[i]?t.window:t.$dom).addEvent(i,e.bindedHandleEvent)}))},u.prototype.captureEvents=function(){this.lastEvent?(this.findEventHandlers(this.lastEvent),this.currentEvent=this.eventName,this.eventName="",this.lastEvent=void 0):this.currentEvent=""},u.prototype.handleEvent=function(e){if(!this.eventName||this.eventName===this.currentEvent){switch(this.eventTagName=(e.target.tagName||"").toUpperCase(),this.eventName=this.eventMap[e.type],this.eventName){case"touchstart":this.clear(),["INPUT","TEXTAREA"].includes(this.eventTagName)||(this.touchCount=this.countTouches(e),e.preventDefault(),this.start(e));break;case"touchmove":var i=this.getTouch(e);this.cursor.x=i.x,this.cursor.y=i.y,e.preventDefault(),this.touchCount>0&&this.move(e);break;case"touchend":e.preventDefault(),this.end(e);break;case"wheel":e.preventDefault(),this.wheel(e);break;case"key":this.keyUpHandler(e);break;case"resize":t.dim.measureScreen()}this.lastEvent=e,t.manager.scheduleRun(0,this.eventName+"-"+this.eventTagName)}},u.prototype.findEventHandlers=function(e){var i="function"==typeof e.target.getAttribute?e.target.getAttribute("id"):"";i||(i=a.findNearestParentWithId(e.target));var n=t.manager.visibleOidMap[i],r=n?s.findFirstTouchHandler(n):null,o=n?s.findFirstScrollLeftHandler(n):null,l=n?s.findFirstScrollTopHandler(n):null,u=n?s.findFirstPinchHandler(n):null;this.currentHandlers.touch=r,this.currentHandlers.scrollLeft=o,this.currentHandlers.scrollTop=l,this.currentHandlers.pinch=u},u.prototype.clear=function(){this.start0=void 0,this.start1=void 0,this.end0=void 0,this.end1=void 0,this.touchCount=0,this.resetCurrentTouch()},u.prototype.resetCurrentTouch=function(){this.currentTouch.deltaY=0,this.currentTouch.deltaX=0,this.currentTouch.pinchDelta=0,this.currentTouch.manualMomentumFlag=!1,this.currentTouch.orientation="none",this.currentTouch.key=""},u.prototype.resetEvents=function(){if(this.currentTouch.timeStamp>0){var i=e.now()-this.currentTouch.timeStamp,n=0;Math.abs(this.currentTouch.deltaY)>.001||Math.abs(this.currentTouch.deltaX)>.001||Math.abs(this.currentTouch.pinchDelta)>.001?i>70?(this.currentTouch.deltaY=0,this.currentTouch.deltaX=0,this.currentTouch.pinchDelta=0):this.currentTouch.manualMomentumFlag&&(this.currentTouch.deltaY*=.95,this.currentTouch.deltaX*=.95,n=10):i>600&&(this.clear(),this.currentTouch.timeStamp=0),t.manager.scheduleRun(n,"scroll decay")}else(this.eventName||this.lastEvent)&&(this.eventName="",t.manager.scheduleRun(1,"reseting current event"))},u.prototype.getTouchHandler=function(){return this.currentHandlers.touch},u.prototype.getTouchHandlerType=function(){return this.currentHandlers.touch?this.currentHandlers.touch.type:null},u.prototype.getTouchHandlerOid=function(){return this.currentHandlers.touch?this.currentHandlers.touch.oid:null},u.prototype.isClickEvent=function(){return"click"===this.currentEvent},u.prototype.isResizeEvent=function(){return"resize"===this.currentEvent},u.prototype.getCurrentEvent=function(){return this.currentEvent},u.prototype.isClickHandler=function(t){return this.getTouchHandler()===t&&this.isClickEvent()},u.prototype.isClickHandlerType=function(t){return this.getTouchHandlerType()===t&&this.isClickEvent()},u.prototype.isTouchHandler=function(t){return this.getTouchHandler()===t},u.prototype.isTouchHandlerType=function(t){return this.getTouchHandlerType()===t},u.prototype.isTouchHandlerOrAncestor=function(t){for(var e=this.getTouchHandler();e;){if(e===t)return!0;e=e.getParent()}return!1},u.prototype.isScrollLeftHandler=function(t){return this.currentHandlers.scrollLeft===t},u.prototype.isScrollTopHandler=function(t){return this.currentHandlers.scrollTop===t},u.prototype.isPinchHandler=function(t){return this.currentHandlers.pinch===t},u.prototype.countTouches=function(t){return t.touches&&t.touches.length?t.touches.length:t.originalEvent&&t.originalEvent.touches&&t.originalEvent.touches.length?t.originalEvent.touches.length:1},u.prototype.keyUpHandler=function(t){var e=(t=t||window.event).which||t.keyCode;this.currentTouch.key=e,37===e?this.setDeltaXDeltaY(-10,0):38===e?this.setDeltaXDeltaY(0,-10):39===e?this.setDeltaXDeltaY(10,0):40===e&&this.setDeltaXDeltaY(0,10)},u.prototype.getTouch=function(t,i){if(t){i=i||0;var n=t.touches&&t.touches[i]?t.touches[i]:t;return n.originalEvent&&n.originalEvent.touches&&(n=n.originalEvent.touches[i]),{x:n.pageX||n.clientX||0,y:n.pageY||n.clientY||0,target:n.target,timeStamp:e.now()}}},u.prototype.start=function(t){return this.start0=this.getTouch(t),this.start1=this.getTouch(t,1),this.cursor.x=this.start0.x,this.cursor.y=this.start0.y,t.stopPropagation()},u.prototype.move=function(t){var e,n;if(1===this.touchCount)this.start0.y=this.end0?this.end0.y:this.start0.y,this.start0.x=this.end0?this.end0.x:this.start0.x,this.end0=this.getTouch(t),this.start1=void 0,this.end1=void 0,i.isDefined(this.end0)&&(e=this.start0.x-this.end0.x,n=this.start0.y-this.end0.y,this.setDeltaXDeltaY(e,n));else if(this.touchCount>=2){this.end0=this.getTouch(t),this.end1=this.getTouch(t,1);var a=i.distance(this.start0.x,this.start0.y,this.start1.x,this.start1.y),s=i.distance(this.end0.x,this.end0.y,this.end1.x,this.end1.y);this.currentTouch.diff=s-a,this.setCurrentTouchParam("pinchDelta",this.currentTouch.diff>0?.3:this.currentTouch.diff<0?-.3:0)}return t.stopPropagation()},u.prototype.end=function(t){var e;i.isDefined(this.end0)||(this.end0=this.getTouch(t));var n=i.isDefined(this.end0)&&i.isDefined(this.start0)?this.end0.timeStamp-this.start0.timeStamp:0;if(this.touchCount<=1&&i.isDefined(this.end0)&&i.isDefined(this.start0)){var a=this.start0.x-this.end0.x,s=this.start0.y-this.end0.y,r=this.end0.timeStamp-this.start0.timeStamp;"horizontal"===this.currentTouch.orientation&&Math.abs(a)>1?(e=i.momentum(0,a,r),this.setCurrentTouchParam("deltaX",e.distance,e.duration),this.currentTouch.manualMomentumFlag=!0):"vertical"===this.currentTouch.orientation&&Math.abs(s)>1&&(e=i.momentum(0,s,r),this.setCurrentTouchParam("deltaY",e.distance,e.duration),this.currentTouch.manualMomentumFlag=!0)}return!e&&1===this.touchCount&&n<300&&(this.eventName="click",this.clear(),this.currentTouch.timeStamp=0),this.touchCount=0,t.stopPropagation()},u.prototype.setDeltaXDeltaY=function(t,e){var i=Math.abs(t)-Math.abs(e);i>=1?("none"===this.currentTouch.orientation||"vertical"===this.currentTouch.orientation&&i>3||"horizontal"===this.currentTouch.orientation)&&(this.currentTouch.orientation="horizontal",this.currentTouch.dir=this.currentTouch.deltaX<=-1?"left":this.currentTouch.deltaX>=1?"right":this.currentTouch.dir,this.setCurrentTouchParam("deltaX",t),this.currentTouch.deltaY=0):"none"===this.currentTouch.orientation||"horizontal"===this.currentTouch.orientation&&i<-3||"vertical"===this.currentTouch.orientation?(this.currentTouch.orientation="vertical",this.currentTouch.dir=this.currentTouch.deltaY<=-1?"up":this.currentTouch.deltaY>=1?"down":this.currentTouch.dir,this.setCurrentTouchParam("deltaY",e),this.currentTouch.deltaX=0):(this.currentTouch.deltaX=0,this.currentTouch.deltaY=0)},u.prototype.setCurrentTouchParam=function(t,n,a){this.currentTouch[t]=n,this.currentTouch.timeStamp=i.isDefined(a)?e.now()+a:Math.max(this.currentTouch.timeStamp,e.now())},u.prototype.wheel=function(t){var e=0,i=0;this.currentTouch.pinchDelta=0,this.start0=this.getTouch(t),t.ctrlKey&&"deltaY"in t?this.setCurrentTouchParam("pinchDelta",-t.deltaY/10):"deltaX"in t?(e=t.deltaX,i=t.deltaY):"wheelDeltaX"in t?(e=-t.wheelDeltaX/120,i=-t.wheelDeltaY/120):"wheelDelta"in t?e=-t.wheelDelta/120:"detail"in t&&(e=t.detail/3),this.setDeltaXDeltaY(e,i)},h.prototype.initSingleLoad=function(t,e,i){this.isLoading(t)||this.isLoaded(t)&&!i||this.getLoadingAttempts(t)>this.stopLoadingAfterAttempts||(this.initLoadingMap(t),this.singleLoadList=this.singleLoadList?this.singleLoadList:{},this.singleLoadList[t]={fetchId:t,query:e})},h.prototype.initGroupLoad=function(t,e,i,n,a){var s=JSON.stringify({query:i,idKey:n,separator:a});this.isLoading(t)||this.isLoaded(t)||this.getLoadingAttempts(t)>this.stopLoadingAfterAttempts||(this.initLoadingMap(t),this.groupLoadList=this.groupLoadList?this.groupLoadList:{},this.groupLoadList[s]||(this.groupLoadList[s]=[]),this.groupLoadList[s].push({fetchId:t,dataId:e}))},h.prototype.initImgLoad=function(t,e){this.isLoading(t)||this.isLoaded(t)||this.getLoadingAttempts(t)>this.stopLoadingAfterAttempts||(this.initLoadingMap(t,"image"),this.imgLoadList=this.imgLoadList?this.imgLoadList:{},this.imgLoadList[t]={fetchId:t,src:e})},h.prototype.isLoading=function(t){return!!i.isDefined(this.loadingMap[t])&&this.loadingMap[t].loadingFlag},h.prototype.isLoaded=function(t){return i.isDefined(this.resultMap[t])&&!0===this.resultMap[t].success},h.prototype.getLoadingAttempts=function(t){return i.isDefined(this.loadingMap[t])?this.loadingMap[t].attempts:0},h.prototype.getSuccessLoadingTime=function(t){return i.isDefined(this.loadingMap[t])&&!0===this.loadingMap[t].success?this.loadingMap[t].loadingTime:void 0},h.prototype.getFailedInterval=function(t){return i.isDefined(this.loadingMap[t])?this.loadingMap[t].attempts*this.attemptFailedInterval:0},h.prototype.fetchResult=function(t){return this.resultMap[t]},h.prototype.hasLoadedSuccessfully=function(t){return this.resultMap[t]&&!0===this.resultMap[t].success},h.prototype.hasLoadedUnsuccessfully=function(t){return this.resultMap[t]&&!1===this.resultMap[t].success},h.prototype.fetchErrors=function(t){return this.resultMap[t]&&this.resultMap[t].result&&this.resultMap[t].result.errors?this.resultMap[t].result.errors:void 0},h.prototype.initLoadingMap=function(t,n){n=n||this.getCategoryFromFetchId(t),i.isDefined(this.loadingMap[t])?(this.loadingMap[t].loadingFlag=!0,this.loadingMap[t].startTime=e.now(),this.loadingMap[t].loadingTime=void 0):this.loadingMap[t]={fetchId:t,category:n,loadingFlag:!0,attempts:0,startTime:e.now(),loadingTime:void 0,success:!1}},h.prototype.groupLoad=function(){if(this.groupLoadList){for(var t=Object.keys(this.groupLoadList),e=0;e<t.length;e++){for(var i=t[e],n=this.groupLoadList[i],a=[],s={},r=0;r<n.length;r++){var o=n[r].dataId;a.push(o),s[o]=n[r].fetchId}if(a.length>0){var l=JSON.parse(i),u=this.updateQueryValue(l.query,a.join(l.separator));this.groupAjax(u,s,l.idKey)}delete this.groupLoadList[i]}this.groupLoadList=void 0}},h.prototype.singleLoad=function(){if(this.singleLoadList){for(var t=Object.keys(this.singleLoadList),e=0;e<t.length;e++){var i=this.singleLoadList[t[e]];this.singleAjax(i.query,i.fetchId)}this.singleLoadList=void 0}},h.prototype.imgLoad=function(){if(this.imgLoadList){for(var t=Object.keys(this.imgLoadList),e=0;e<t.length;e++){var i=this.imgLoadList[t[e]];this.imgAjax(i.src,i.fetchId)}this.imgLoadList=void 0}},h.prototype.updateQueryValue=function(t,e){for(var i in t)"%s"===t[i]?t[i]=e:"%d"===t[i]?t[i]="number"==typeof e?e:parseFloat(e):"object"==typeof t[i]&&this.updateQueryValue(t[i],e);return t},h.prototype.singleAjax=function(i,n){var s=this,r={dataType:"json",type:"GET",success:function(i){s.loadingMap[n].loadingFlag=!1,s.loadingMap[n].loadingTime=e.now()-s.loadingMap[n].startTime,s.loadingMap[n].success=!0,s.loadingMap[n].attempts++,s.resultMap[n]=Object.assign({result:i},s.loadingMap[n]),delete s.loadingMap[n],s.updateStatistics(n),t.manager.scheduleRun(0,"singleAjax_success_"+n)},error:function(i){s.resultMap[n]={error:i,success:!1},s.loadingMap[n].loadingFlag=!1,s.loadingMap[n].loadingTime=e.now()-s.loadingMap[n].startTime,s.loadingMap[n].attempts++,t.manager.scheduleRun(0,"singleAjax_error_"+n)}};a.ajax(Object.assign(r,i))},h.prototype.groupAjax=function(i,n,s){var r=this,o={dataType:"json",type:"GET",success:function(a){for(var o=0;o<a.length;o++){var l=a[o][s];if(n[l]){var u=n[l];r.loadingMap[u].loadingFlag=!1,r.loadingMap[u].loadingTime=e.now()-r.loadingMap[u].startTime,r.loadingMap[u].success=!0,r.loadingMap[u].attempts++,r.resultMap[u]=Object.assign({result:a[o]},r.loadingMap[u]),r.updateStatistics(u),delete r.loadingMap[u],delete n[l]}}Object.keys(n).forEach((function(t){var i=n[t];r.loadingMap[i].success||(r.loadingMap[i].loadingFlag=!1,r.loadingMap[i].loadingTime=e.now()-r.loadingMap[i].startTime,r.loadingMap[i].attempts++)})),t.manager.scheduleRun(0,"groupAjax_success_"+i)},error:function(e){Object.keys(n).forEach((function(t){var i=n[t];r.resultMap[i]={error:e,success:!1},r.loadingMap[i].loadingFlag=!1,r.loadingMap[i].attempts++})),t.manager.scheduleRun(0,"groupAjax_error_"+i)}};a.ajax(Object.assign(o,i))},h.prototype.imgAjax=function(i,n){var s=this,r=new Image;r.src=i,r.onload=function(){s.loadingMap[n].loadingFlag=!1,s.loadingMap[n].loadingTime=e.now()-s.loadingMap[n].startTime,s.loadingMap[n].success=!0,s.loadingMap[n].attempts++,s.resultMap[n]=Object.assign({width:this.width,height:this.height,$image:new a(r)},s.loadingMap[n]),s.updateStatistics(n,"image"),delete s.loadingMap[n],t.manager.scheduleRun(0,"imgAjax_success_"+n)},r.onerror=r.onabort=function(){s.resultMap[n]={result:"no image",success:!1},s.loadingMap[n].loadingFlag=!1,s.loadingMap[n].loadingTime=e.now()-s.loadingMap[n].startTime,s.loadingMap[n].attempts++,t.manager.scheduleRun(0,"imgAjax_error_"+n)}},h.prototype.getCategoryFromFetchId=function(t){return t.replace(/[^a-zA-Z]/g,"")},h.prototype.updateStatistics=function(t,i){i=i||this.getCategoryFromFetchId(t),this.statistics[i]?(this.statistics[i].count++,this.statistics[i].totalTime+=this.resultMap[t].loadingTime,this.statistics[i].lastUpdate=e.now(),delete this.statistics[i].averageTime):this.statistics[i]={count:1,totalTime:this.resultMap[t].loadingTime,lastUpdate:e.now()}},h.prototype.getAverageLoadingTime=function(t){var i=e.now();if(this.statistics[t]&&this.statistics[t].averageTime&&i-this.statistics[t].lastUpdate<500)return this.statistics[t].averageTime;var n=this.statistics[t]?this.statistics[t].totalTime:0,a=this.statistics[t]?this.statistics[t].count:0;return Object.values(this.loadingMap).filter((function(e){return e.category===t})).forEach((function(t){n+=i-t.startTime,a++})),this.statistics[t]?(this.statistics[t].averageTime=a>0?n/a:0,this.statistics[t].lastUpdate=e.now(),this.statistics[t].averageTime):0},c.bracketMap={},c.bracketAllMap={},c.generate=function(e,i){var n,a=c.bracketMap[e.oid],s=Math.max(e.getActualValueLastUpdate("allChildren"),e.getActualValueLastUpdate("width"),e.getActualValueLastUpdate("height"));if(a&&a.lastUpdate>=s)a=c.bracketMap[e.oid];else{a={lastUpdate:s,list:[]};var r=(i="BI"===e.type||i?i:e.getChildren()).length,o=0;for(n=0;n<r&&!i[n].canBeBracketed();n++)o++,a.list.push(i[n]);var l=Math.max(2,t.locationManager.bracketThreshold-1),u=Math.ceil((r-o)/l),h=o;for(n=0;n<u;n++){var d,g=Math.min(r-h,l),p=e.oid+"_"+e.getWidth()+"_"+e.getHeight()+"_"+i.slice(h,h+g).oids("_");c.bracketAllMap[p]?d=c.bracketAllMap[p]:(d=new c(e),c.bracketAllMap[p]=d,d.actualValues.tchildren=i.slice(h,h+g),"BI"===d.actualValues.tchildren[0].type&&d.actualValues.children.forEach((function(t){t.bracketParent=d})),d.bracketParent=e),a.list.push(d),h+=g}a.list.length-o>t.locationManager.bracketThreshold?a=c.generate(e,a.list):c.bracketMap[e.oid]=a}return a},d.prototype.calculateAll=function(){this.hasLocationList.length=0,this.hasLocationMap={},this.locationCount.length=0,t.targetManager.doneTargets.length=0,this.startTime=e.now(),this.calculate(),t.targetManager.doneTargets.length>0&&(t.targetManager.doneTargets.forEach((function(t){t.tmodel.isTargetDone(t.key)&&t.tmodel.setTargetComplete(t.key)})),t.manager.scheduleRun(10,"done to complete"))},d.prototype.calculate=function(){this.addToLocationList(t.ui),this.calculateContainer(t.ui)},d.prototype.getChildren=function(t){var e;return this.isProlificContainer(t)&&(e=c.generate(t)),e?e.list:t.getChildren()},d.prototype.isProlificContainer=function(t){return t.canBeBracketed()&&t.getChildren().length>this.bracketThreshold},d.prototype.calculateContainer=function(n){var a=this.getChildren(n),s=n.createViewport();n.resetVisibleList();for(var r=0;r<a.length&&t.isRunning();){var o,l,u=a[r++];if(this.calculateTargets(u),u.getActualValueLastUpdate("canBeBracketed")>u.getParent().getActualValueLastUpdate("allChildren")&&delete u.getParent().targetValues.allChildren,s.setCurrentChild(u),u.setLocation(s),l=i.isDefined(n.getValue("innerXEast"))?n.getValue("innerXEast"):n.absX+n.getInnerWidth(),o=i.isDefined(u.getValue("outerXEast"))?u.getValue("outerXEast"):u.absX+u.getInnerWidth(),s.isOverflow(o,l)?(s.overflow(),u.setLocation(s)):u.setLocation(s),u.canBeVisible()&&!this.hasLocationMap[u.oid]&&this.addToLocationList(u),u.targetUpdatingMap.x||(i.isDefined(u.targets.x)?t.targetManager.setTargetValue(u,"x"):i.isDefined(u.targetValues.x)||u.setValue("x",u.x)),u.targetUpdatingMap.y||(i.isDefined(u.targets.y)?t.targetManager.setTargetValue(u,"y"):i.isDefined(u.targetValues.y)||u.setValue("y",u.y)),s.isVisible(u),u.addToParentVisibleList(),u.shouldCalculateChildrenLocations()?this.calculateContainer(u):u.manuallyCalculateChildrenLocations(),u.isVisible()&&u.canBeVisible()&&(u.targetUpdatingList.length>0||u.updatingChildren.length>0)&&n.addUpdatingChild(u),u.isInFlow()){var h=u.getHeight();u.hasChildren()&&(t.targetManager.setTargetValuesWithKeys(u,["width","height"],!0),t.targetManager.setJustActualValue(u,"width"),t.targetManager.setJustActualValue(u,"height")),u.getHeight()!==h&&t.events.isScrollTopHandler(u.getParent())&&"up"===t.events.currentTouch.dir&&this.calculateContainer(u),i.isNumber(u.getValue("appendNewLine"))?s.appendNewLine():s.nextLocation()}this.locationCount.push(u.oid+"-"+u.targetUpdatingList.length+"-"+(e.now()-this.startTime))}s.calcContentWidthHeight()},d.prototype.calculateTargets=function(e){t.targetManager.setTargetValues(e),t.targetManager.setActualValues(e),!i.isDefined(e.targetValues.width)&&e.hasDom()&&r.setWidthFromDom(e),!i.isDefined(e.targetValues.height)&&e.hasDom()&&r.setHeightFromDom(e)},d.prototype.addToLocationList=function(t){this.hasLocationList.push(t),this.hasLocationMap[t.oid]=t},g.prototype.openPage=function(e,n){n=!i.isDefined(n)||n,t.stop(),t.reset();var s=this;"function"==typeof t.updateAnalytics&&t.updateAnalytics(e),!this.pageCache[e]&&n?a.ajax({url:e,type:"GET",data:{tpageOnly:!0},success:function(i){t.$dom.outerHTML(i),t.resetUI(),s.lastLink=e,t.start()},error:function(){s.lastLink=void 0,history.back()}}):this.pageCache[e]?(t.$dom.innerHTML(this.pageCache[e].html),t.ui=this.pageCache[e].ui,i.initDoms(this.pageCache[e].visibleList),t.manager.lists.visible=this.pageCache[e].visibleList.slice(0),s.lastLink=e,setTimeout(t.start)):(t.$dom.innerHTML(""),t.resetUI(),s.lastLink=e,setTimeout(t.start))},g.prototype.openLinkFromHistory=function(e){e.link?this.openPage(e.link):e.browserUrl&&(history.replaceState({link:e.browserUrl},"",e.browserUrl),this.openPage(e.browserUrl)),t.manager.scheduleRun(0,"pagemanager-openLinkFromHistory")},g.prototype.openLink=function(e,n){e=i.getFullLink(e),this.lastLink&&(this.pageCache[this.lastLink]={link:this.lastLink,html:t.$dom.innerHTML(),visibleList:t.manager.lists.visible.slice(0),ui:t.ui}),history.pushState({link:e},"",e),this.openPage(e,n),t.manager.scheduleRun(0,"pagemanager-processOpenLink")},g.prototype.updateBrowserUrl=function(e){window.history.state.browserUrl?history.replaceState({browserUrl:e},"",e):(this.pageCache[document.URL]={link:document.URL,html:t.$dom.innerHTML(),visibleList:t.manager.lists.visible.slice(0),ui:t.ui},history.pushState({browserUrl:e},"",e)),t.manager.scheduleRun(0,"pagemanager-processUpdateBrowserUrl")},g.prototype.back=function(){return history.back()},p.prototype.init=function(){this.lists={visible:[],invisibleDom:[],deletedTModel:[],visibleNoDom:[]},this.visibleTypeMap={},this.visibleOidMap={},this.nextRuns=[],this.runningStep=0,this.runningFlag=!1},p.prototype.visibles=function(t,e){return e=e||this.lists.visible,this.lists.visible.filter((function(e){return e.type===t||!t})).map((function(t){return t.oid}))},p.prototype.findVisible=function(t){return this.lists.visible.find((function(e){return e.type===t}))},p.prototype.findLastVisible=function(t){return this.lists.visible.findLast((function(e){return e.type===t}))},p.prototype.analyze=function(){var e,n,a=i.list2map(this.lists.visible);for(this.lists.visible.length=0,this.lists.visibleNoDom.length=0,this.visibleTypeMap={},this.visibleOidMap={},e=0;e<t.locationManager.hasLocationList.length;e++){var s=(n=t.locationManager.hasLocationList[e]).isVisible();n.isMarkedDeleted()&&-1===this.lists.deletedTModel.indexOf(n)?(this.lists.deletedTModel=[].concat(this.lists.deletedTModel,n,n.getAllNestedChildren()),a[n.oid]=null):s&&(a[n.oid]=null,this.lists.visible.push(n),this.visibleOidMap[n.oid]=n,this.visibleTypeMap[n.type]||(this.visibleTypeMap[n.type]=[]),this.visibleTypeMap[n.type].push(n),n.canHaveDom()&&!n.hasDom()&&n.getDomHolder()&&n.getDomHolder().exists()&&-1===this.lists.visibleNoDom.indexOf(n)&&this.lists.visibleNoDom.push(n))}var r=Object.values(a).filter((function(t){return null!==t}));r.forEach((function(e){e.hasDom()&&t.manager.lists.invisibleDom.push(e)}))},p.prototype.renderTModels=function(){var t,e,n=[],a=[];for(this.lists.visible.forEach((function(t){t.hasDom()&&i.isDefined(t.getHtml())&&(t.$dom.html()===t.getHtml()&&t.$dom.textOnly===t.isTextOnly()||n.push(t)),t.hasDom()&&t.hasDomHolderChanged()&&a.push(t)})),t=0;t<n.length;t++)(e=n[t]).isTextOnly()?e.$dom.text(e.getHtml()):e.$dom.html(e.getHtml()),e.setActualValueLastUpdate("html"),e.domHeight=void 0,e.domWidth=void 0;for(t=0;t<a.length;t++)(e=a[t]).$dom.detach(),e.getDomHolder().appendTModel$Dom(e)},p.prototype.deleteDoms=function(){var t;for(t=0;t<this.lists.invisibleDom.length;t++){var e=this.lists.invisibleDom[t];e.domValues={},e.xVisible=!1,e.yVisible=!1,e.invisibleFunctions&&e.invisibleFunctions.forEach((function(t){var i=t.key;t.fn.call(e,i,e.getTargetStep(i),e.getTargetCycle(i),e.getTargetSteps(i),e.getTargetCycles(i))})),e.isDomDeletable()&&(e.$dom.detach(),e.$dom=null)}for(t=0;t<this.lists.deletedTModel.length;t++)this.removeTModel(this.lists.deletedTModel[t]);var i=this.lists.invisibleDom.length>0||this.lists.deletedTModel.length>0;this.lists.invisibleDom.length=0,this.lists.deletedTModel.length=0,i&&this.scheduleRun(0,"deleteDoms")},p.prototype.removeTModel=function(t){t.markAsDeleted();var e,i=t.getParent();i&&i.hasChildren()&&(i.removeUpdatingChild(t),(e=i.getValue("children").indexOf(t))>=0&&(i.getValue("children").splice(e,1),i.setActualValueLastUpdate("children")),(e=i.getValue("addedChildren").indexOf(t))>=0&&(i.getValue("addedChildren").splice(e,1),i.setActualValueLastUpdate("addedChildren")),i.setActualValueLastUpdate("allChildren")),t.$dom&&(t.$dom.detach(),t.$dom=null)},p.prototype.createDoms=function(){var e,n,s,r=[],o=[];for(this.lists.visibleNoDom.sort((function(t,e){return t.hasChildren()&&e.hasChildren()?t.getUIDepth()<e.getUIDepth()?-1:1:t.hasChildren()?-1:1})),e=0;e<this.lists.visibleNoDom.length;e++)s=this.lists.visibleNoDom[e],a.query("#"+s.oid)?(n=new a("#"+s.oid),s.$dom=n):o.push(s);for(e=0;e<o.length;e++){s=o[e];var l=Math.floor(s.getX()),u=Math.floor(s.getY()),h=Math.floor(s.getRotate()),c=i.formatNum(s.getScale(),2),d=Math.floor(s.getWidth()),g=Math.floor(s.getHeight()),p=Math.floor(s.getZIndex()),f={position:"absolute",top:0,left:0,transform:[l,u,h,c],width:d+"px",opacity:s.getOpacity().toFixed(2),height:g+"px",zIndex:p};(n=new a).create("div"),n.setSelector("#"+s.oid),n.setId(s.oid),n.css(s.getCss()),n.setStyleByMap(f),s.domValues={},s.domValues.x=l,s.domValues.y=u,s.domValues.rotate=h,s.domValues.scale=c,s.$dom=n;var m=r.find((function(t){return t.domHolder===s.getDomHolder()}));m?m.tmodels.push(s):r.push({domHolder:s.getDomHolder(),tmodels:[s]})}r.map((function(t){t.tmodels.map((function(e){t.domHolder.appendTModel$Dom(e)}))})),r.length&&t.manager.scheduleRun(1,"createDom")},p.prototype.scheduleRun=function(i,n){if(i<1&&0===t.throttle)t.manager.run(n,i);else{var a=e.delay((function(){t.manager.run(n,i)}),n,0===t.throttle?i||0:t.throttle),s=this.nextRuns.length>0?this.nextRuns[this.nextRuns.length-1]:null;a&&(!s||a.delay>s.delay)&&this.nextRuns.push(a)}},p.prototype.run=function(i,n){t.isRunning()?t.manager.runningFlag?t.manager.scheduleRun(1,i):(t.manager.runningFlag=!0,window.requestAnimationFrame((function(){for(var a=e.now();e.now()-a<25&&t.manager.runningStep<7&&t.isRunning();){switch(t.manager.runningStep){case 0:t.events.captureEvents(),t.locationManager.calculateTargets(t.ui),t.locationManager.calculateAll(),t.events.resetEvents();break;case 1:t.manager.analyze();break;case 2:t.manager.createDoms();break;case 3:t.manager.renderTModels();break;case 4:for(var s=0;s<t.manager.lists.visible.length;s++){var r=t.manager.lists.visible[s];r.hasDom()&&(r.fixXYRotateScale(),r.fixOpacity(),r.fixZIndex(),r.fixCss(),r.fixStyle(),r.fixDim())}break;case 5:t.manager.deleteDoms();break;case 6:t.loader.singleLoad(),t.loader.groupLoad(),t.loader.imgLoad()}t.manager.runningStep++}t.debugLevel>0&&(e.log(t.debugLevel>0&&e.now()-a>10)("it took: "+(e.now()-a)+", "+i),e.log(t.debugLevel>0&&e.now()-a>10)("count: "+t.locationManager.locationCount),e.log(t.debugLevel>1)("request from: "+i+" delay: "+n)),t.manager.runningFlag=!1,7!==t.manager.runningStep?t.manager.run("rendering: "+t.manager.runningStep):(t.manager.runningStep=0,t.manager.getNextRun())}))):this.getNextRun()},p.prototype.getNextRun=function(){if(this.nextRuns.length>0&&t.isRunning()){var i=this.nextRuns.pop();i&&t.manager.scheduleRun(i.timeStamp-e.now(),i.oid)}},f.prototype.setTargetValuesWithKeys=function(t,e,i){for(var n=0;n<e.length;n++){var a=e[n];t.targetValues[a]&&t.getCallingTargetKey(a)===a&&this.setTargetValue(t,a,i)}},f.prototype.setTargetValues=function(t){var e=Object.keys(t.activeTargetKeyMap);t.targets!==t.actualValues.targets&&(t.actualValues.targets=t.targets,Object.keys(t.targets).forEach((function(t){-1===e.indexOf(t)&&e.push(t)}))),t.targetUpdatingMap={},t.targetUpdatingList=[];for(var i=0;i<e.length;i++){var n=e[i];t.targetUpdatingMap[n]||(t.isTargetUpdating(n)&&t.getCallingTargetKey(n)!==n||this.setTargetValue(t,n)?(t.targetUpdatingMap[n]=!0,t.targetUpdatingList.push(n)):t.isTargetDone(n)&&!t.isTargetComplete(n)&&this.doneTargets.push({tmodel:t,key:n}))}t.getParent()&&0===t.targetUpdatingList.length&&t.getParent().removeUpdatingChild(t)},f.prototype.setTargetValue=function(e,n,a){var s=e.targets[n];if(i.isDefined(s))if(e.isTargetUpdating(n)||!e.targetValues[n]||e.isTargetInLoop(n)||!e.hasTargetGotExecuted(n)||a){if(e.isTargetEnabled(n)){var o=!!s&&!!s.valueOnly;if(!i.isDefined(e.getActualTimeStamp(n))){var l=e.getTargetCycle(n),u=r.getValueStepsCycles(e,s,l,o,n);r.assignValueArray(e,n,u)}if(!e.isTargetInLoop(n)&&e.isTargetDone(n)&&e.isTargetComplete(n)&&!i.isDefined(e.getActualTimeStamp(n))&&e.hasTargetGotExecuted(n)?e.activeTargetKeyMap[n]&&delete e.activeTargetKeyMap[n]:e.activeTargetKeyMap[n]=!0,i.isDefined(e.getActualTimeStamp(n))){var h=r.getActualSchedulePeriod(e,n,e.getTargetStepInterval(n));h>0&&t.manager.scheduleRun(h,"actualInterval__"+e.oid+"__"+n)}return!e.isTargetDone(n)&&!e.isTargetComplete(n)||!e.doesTargetEqualActual(n)}e.activeTargetKeyMap[n]=!0}else e.activeTargetKeyMap[n]&&delete e.activeTargetKeyMap[n];else delete e.activeTargetKeyMap[n]},f.prototype.setActualValues=function(e){var n,a,s=[];for(n=0;n<e.targetUpdatingList.length;n++){a=e.targetUpdatingList[n],e.targets[a];var o=e.getTargetStatus(a);e.isTargetUpdating(a)&&s.push(a),o!==e.getTargetStatus(a)&&t.manager.scheduleRun(1,e.oid+"-"+a+"-statusChange")}for(n=0;n<s.length;n++){a=s[n];var l=r.getActualSchedulePeriod(e,a,e.getTargetStepInterval(a));0!==l&&i.isDefined(l)?t.manager.scheduleRun(l,"actualInterval__"+e.oid+"__"+a):this.setActualValue(e,a)}},f.prototype.setJustActualValue=function(t,e){var a=t.targets[e];if(!t.targetValues[e]||a&&"function"==typeof a.enabledOn&&!a.enabledOn.call(t,e))return!1;var s=t.getTargetValue(e),r=t.getTargetStep(e),o=i.isDefined(t.getTargetEasing(e))?t.getTargetEasing(e):n.linear,l=t.getTargetSteps(e),u=o(t.getTargetStepPercent(e,r));r<l?(i.isDefined(t.getLastActualValue(e))||t.setLastActualValue(e,t.actualValues[e]),t.actualValues[e]="number"==typeof s?s*u+t.getLastActualValue(e)*(1-u):s):t.actualValues[e]=s},f.prototype.setActualValue=function(a,s){if(!a.targetValues[s])return!1;var o=a.getTargetValue(s),l=a.getTargetStep(s),u=a.getTargetSteps(s),h=i.isDefined(a.getTargetEasing(s))?a.getTargetEasing(s):n.linear,c=a.getTargetCycle(s),d=h(a.getTargetStepPercent(s,l)),g=!1,p=a.getTargetStepInterval(s),f=(a.getActualValueLastUpdate(s),a.actualValues[s]),m=l,y=c;e.now(),l<u&&(i.isDefined(a.getLastActualValue(s))||a.setLastActualValue(s,a.actualValues[s]),a.actualValues[s]="number"==typeof o?o*d+a.getLastActualValue(s)*(1-d):o,a.setActualValueLastUpdate(s),a.setActualValueLastUpdate(s),i.isDefined(p),l=a.setTargetStep(s,l+1)),l>=u&&(a.actualValues[s]=o,a.setActualValueLastUpdate(s),"object"==typeof a.targets[s]&&"function"==typeof a.targets[s].onStepsEnd&&a.targets[s].onStepsEnd.call(a,s,c),a.updateTargetStatus(s),a.getTargetCycle(s)<a.getTargetCycles(s)&&(a.setTargetCycle(s,a.getTargetCycle(s)+1),g=!0,a.resetTargetStep(s),a.resetLastActualValue(s))),r.handleValueChange(a,s,a.actualValues[s],f,m,y),i.isDefined(a.getActualTimeStamp(s))&&a.resetActualTimeStamp(s),(l<u||g)&&t.manager.scheduleRun(l<u?p:0,a.oid+"---"+s+"-"+l+"/"+u+"-"+c+"-"+p)},window.t=window.t||s.find,m.oids={},m.getOid=function(t){i.isDefined(m.oids[t])||(m.oids[t]=0);var e=m.oids[t]++;return{oid:e>0?t+e:t,num:e}}})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "targetj",
3
- "version": "1.0.35",
3
+ "version": "1.0.36",
4
4
  "keywords": [
5
5
  "targetj"
6
6
  ],
@@ -22,6 +22,9 @@
22
22
  "grunt": "^1.6.1",
23
23
  "grunt-contrib-concat": "^2.1.0",
24
24
  "grunt-contrib-jshint": "^3.2.0",
25
- "grunt-contrib-uglify": "^5.2.2"
25
+ "grunt-contrib-uglify": "^5.2.2",
26
+ "webpack": "^5.91.0",
27
+ "webpack-cli": "^5.1.4",
28
+ "wepback": "^1.0.0"
26
29
  }
27
30
  }
package/src/App.js CHANGED
@@ -161,10 +161,6 @@ function getLoader() {
161
161
  return tapp ? tapp.loader : null;
162
162
  }
163
163
 
164
- function getEvents() {
165
- return tapp ? tapp.events : null;
166
- }
167
-
168
164
  window.t = window.t || SearchUtil.find;
169
165
 
170
166
  App.oids = {};
@@ -0,0 +1,10 @@
1
+ const path = require('path');
2
+
3
+ module.exports = {
4
+ entry: './Exports.js',
5
+ mode: 'production',
6
+ output: {
7
+ path: path.resolve(__dirname, 'dist'),
8
+ filename: 'targetj.js'
9
+ }
10
+ };