diff --git a/dist/tensorspace.cjs.js b/dist/tensorspace.cjs.js index 24719eeb..5b50fb99 100644 --- a/dist/tensorspace.cjs.js +++ b/dist/tensorspace.cjs.js @@ -21892,9 +21892,22 @@ function Reshape( config ) { this.actualHeight = undefined; this.actualDepth = undefined; + this.depth = undefined; + this.layerDimension = undefined; this.openFmCenters = undefined; + this.lastLayer = undefined; + + if ( config !== undefined && + ( config.targetShape !== undefined || config.shape !== undefined ) ) { + + this.setReshapeType(); + this.createActualLayer(); + this.updateLayerMetric(); + + } + } Reshape.prototype = { @@ -21945,10 +21958,14 @@ Reshape.prototype = { this.actualHeight = this.actualLayer.actualHeight; this.actualDepth = this.actualLayer.actualDepth; + this.depth = this.actualLayer.depth; + this.layerDimension = this.actualLayer.layerDimension; this.openFmCenters = this.actualLayer.openFmCenters; + this.lastLayer = this.actualLayer.lastLayer; + }, /** @@ -21997,6 +22014,13 @@ Reshape.prototype = { setEnvironment: function( context, model ) { + if ( this.actualLayer === undefined ) { + + this.createActualLayer(); + this.updateLayerMetric(); + + } + this.actualLayer.setEnvironment( context, model ); }, @@ -22043,6 +22067,20 @@ Reshape.prototype = { }, + translateLayer: function( targetCenter, translateTime ) { + + this.actualLayer.translateLayer( targetCenter, translateTime ); + + }, + + apply: function( lastLayer ) { + + this.actualLayer.apply( lastLayer ); + + this.updateLayerMetric(); + + }, + setShape: function( shape ) { // Based on shape dimension, update proxy states. @@ -22077,6 +22115,15 @@ Reshape.prototype = { assemble: function() { + this.setReshapeType(); + + this.actualLayer.assemble(); + this.updateLayerMetric(); + + }, + + setReshapeType: function() { + // If "setShape" has been called before, there is no need to check "shape" attribute or "targetShape" attribute in config. if ( this.reshapeType === undefined ) { @@ -22139,9 +22186,6 @@ Reshape.prototype = { } - this.actualLayer.assemble(); - this.updateLayerMetric(); - } }; @@ -31329,6 +31373,8 @@ function MergeProxy( operatorType, layerList, config ) { this.actualHeight = undefined; this.actualDepth = undefined; + this.depth = undefined; + this.layerDimension = undefined; this.openFmCenters = undefined; @@ -31373,6 +31419,8 @@ MergeProxy.prototype = { this.actualHeight = this.actualLayer.actualHeight; this.actualDepth = this.actualLayer.actualDepth; + this.depth = this.actualLayer.depth; + this.layerDimension = this.actualLayer.layerDimension; this.openFmCenters = this.actualLayer.openFmCenters; @@ -31420,6 +31468,14 @@ MergeProxy.prototype = { setEnvironment: function( context, model ) { + if ( this.actualLayer === undefined ) { + + MergeValidator.validateDimension( this.layerList ); + this.createActualLayer(); + this.updateLayerMetric(); + + } + this.actualLayer.setEnvironment( context, model ); }, @@ -31472,6 +31528,12 @@ MergeProxy.prototype = { }, + translateLayer: function( targetCenter, translateTime ) { + + this.actualLayer.translateLayer( targetCenter, translateTime ); + + }, + setShape: function( shape ) { // make sure the input elements have the same dimension. @@ -31863,7 +31925,7 @@ function Multiply( layerList, config ) { } -let version = "0.6.0"; +let version = "0.6.1"; /** * @author syt123450 / https://github.com/syt123450 diff --git a/dist/tensorspace.dev.esm.js b/dist/tensorspace.dev.esm.js index 0a64f4be..4cac905b 100644 --- a/dist/tensorspace.dev.esm.js +++ b/dist/tensorspace.dev.esm.js @@ -22547,9 +22547,22 @@ function Reshape( config ) { this.actualHeight = undefined; this.actualDepth = undefined; + this.depth = undefined; + this.layerDimension = undefined; this.openFmCenters = undefined; + this.lastLayer = undefined; + + if ( config !== undefined && + ( config.targetShape !== undefined || config.shape !== undefined ) ) { + + this.setReshapeType(); + this.createActualLayer(); + this.updateLayerMetric(); + + } + } Reshape.prototype = { @@ -22600,10 +22613,14 @@ Reshape.prototype = { this.actualHeight = this.actualLayer.actualHeight; this.actualDepth = this.actualLayer.actualDepth; + this.depth = this.actualLayer.depth; + this.layerDimension = this.actualLayer.layerDimension; this.openFmCenters = this.actualLayer.openFmCenters; + this.lastLayer = this.actualLayer.lastLayer; + }, /** @@ -22652,6 +22669,13 @@ Reshape.prototype = { setEnvironment: function( context, model ) { + if ( this.actualLayer === undefined ) { + + this.createActualLayer(); + this.updateLayerMetric(); + + } + this.actualLayer.setEnvironment( context, model ); }, @@ -22698,6 +22722,20 @@ Reshape.prototype = { }, + translateLayer: function( targetCenter, translateTime ) { + + this.actualLayer.translateLayer( targetCenter, translateTime ); + + }, + + apply: function( lastLayer ) { + + this.actualLayer.apply( lastLayer ); + + this.updateLayerMetric(); + + }, + setShape: function( shape ) { // Based on shape dimension, update proxy states. @@ -22732,6 +22770,15 @@ Reshape.prototype = { assemble: function() { + this.setReshapeType(); + + this.actualLayer.assemble(); + this.updateLayerMetric(); + + }, + + setReshapeType: function() { + // If "setShape" has been called before, there is no need to check "shape" attribute or "targetShape" attribute in config. if ( this.reshapeType === undefined ) { @@ -22794,9 +22841,6 @@ Reshape.prototype = { } - this.actualLayer.assemble(); - this.updateLayerMetric(); - } }; @@ -31984,6 +32028,8 @@ function MergeProxy( operatorType, layerList, config ) { this.actualHeight = undefined; this.actualDepth = undefined; + this.depth = undefined; + this.layerDimension = undefined; this.openFmCenters = undefined; @@ -32028,6 +32074,8 @@ MergeProxy.prototype = { this.actualHeight = this.actualLayer.actualHeight; this.actualDepth = this.actualLayer.actualDepth; + this.depth = this.actualLayer.depth; + this.layerDimension = this.actualLayer.layerDimension; this.openFmCenters = this.actualLayer.openFmCenters; @@ -32075,6 +32123,14 @@ MergeProxy.prototype = { setEnvironment: function( context, model ) { + if ( this.actualLayer === undefined ) { + + MergeValidator.validateDimension( this.layerList ); + this.createActualLayer(); + this.updateLayerMetric(); + + } + this.actualLayer.setEnvironment( context, model ); }, @@ -32127,6 +32183,12 @@ MergeProxy.prototype = { }, + translateLayer: function( targetCenter, translateTime ) { + + this.actualLayer.translateLayer( targetCenter, translateTime ); + + }, + setShape: function( shape ) { // make sure the input elements have the same dimension. @@ -32518,7 +32580,7 @@ function Multiply( layerList, config ) { } -let version = "0.6.0"; +let version = "0.6.1"; /** * @author syt123450 / https://github.com/syt123450 diff --git a/dist/tensorspace.js b/dist/tensorspace.js index 74fef081..7626dd76 100644 --- a/dist/tensorspace.js +++ b/dist/tensorspace.js @@ -21886,9 +21886,22 @@ var TSP = (function (exports,tf,THREE,TWEEN,TrackballControls) { this.actualHeight = undefined; this.actualDepth = undefined; + this.depth = undefined; + this.layerDimension = undefined; this.openFmCenters = undefined; + this.lastLayer = undefined; + + if ( config !== undefined && + ( config.targetShape !== undefined || config.shape !== undefined ) ) { + + this.setReshapeType(); + this.createActualLayer(); + this.updateLayerMetric(); + + } + } Reshape.prototype = { @@ -21939,10 +21952,14 @@ var TSP = (function (exports,tf,THREE,TWEEN,TrackballControls) { this.actualHeight = this.actualLayer.actualHeight; this.actualDepth = this.actualLayer.actualDepth; + this.depth = this.actualLayer.depth; + this.layerDimension = this.actualLayer.layerDimension; this.openFmCenters = this.actualLayer.openFmCenters; + this.lastLayer = this.actualLayer.lastLayer; + }, /** @@ -21991,6 +22008,13 @@ var TSP = (function (exports,tf,THREE,TWEEN,TrackballControls) { setEnvironment: function( context, model ) { + if ( this.actualLayer === undefined ) { + + this.createActualLayer(); + this.updateLayerMetric(); + + } + this.actualLayer.setEnvironment( context, model ); }, @@ -22037,6 +22061,20 @@ var TSP = (function (exports,tf,THREE,TWEEN,TrackballControls) { }, + translateLayer: function( targetCenter, translateTime ) { + + this.actualLayer.translateLayer( targetCenter, translateTime ); + + }, + + apply: function( lastLayer ) { + + this.actualLayer.apply( lastLayer ); + + this.updateLayerMetric(); + + }, + setShape: function( shape ) { // Based on shape dimension, update proxy states. @@ -22071,6 +22109,15 @@ var TSP = (function (exports,tf,THREE,TWEEN,TrackballControls) { assemble: function() { + this.setReshapeType(); + + this.actualLayer.assemble(); + this.updateLayerMetric(); + + }, + + setReshapeType: function() { + // If "setShape" has been called before, there is no need to check "shape" attribute or "targetShape" attribute in config. if ( this.reshapeType === undefined ) { @@ -22133,9 +22180,6 @@ var TSP = (function (exports,tf,THREE,TWEEN,TrackballControls) { } - this.actualLayer.assemble(); - this.updateLayerMetric(); - } }; @@ -31323,6 +31367,8 @@ var TSP = (function (exports,tf,THREE,TWEEN,TrackballControls) { this.actualHeight = undefined; this.actualDepth = undefined; + this.depth = undefined; + this.layerDimension = undefined; this.openFmCenters = undefined; @@ -31367,6 +31413,8 @@ var TSP = (function (exports,tf,THREE,TWEEN,TrackballControls) { this.actualHeight = this.actualLayer.actualHeight; this.actualDepth = this.actualLayer.actualDepth; + this.depth = this.actualLayer.depth; + this.layerDimension = this.actualLayer.layerDimension; this.openFmCenters = this.actualLayer.openFmCenters; @@ -31414,6 +31462,14 @@ var TSP = (function (exports,tf,THREE,TWEEN,TrackballControls) { setEnvironment: function( context, model ) { + if ( this.actualLayer === undefined ) { + + MergeValidator.validateDimension( this.layerList ); + this.createActualLayer(); + this.updateLayerMetric(); + + } + this.actualLayer.setEnvironment( context, model ); }, @@ -31466,6 +31522,12 @@ var TSP = (function (exports,tf,THREE,TWEEN,TrackballControls) { }, + translateLayer: function( targetCenter, translateTime ) { + + this.actualLayer.translateLayer( targetCenter, translateTime ); + + }, + setShape: function( shape ) { // make sure the input elements have the same dimension. @@ -31857,7 +31919,7 @@ var TSP = (function (exports,tf,THREE,TWEEN,TrackballControls) { } - let version = "0.6.0"; + let version = "0.6.1"; /** * @author syt123450 / https://github.com/syt123450 diff --git a/dist/tensorspace.min.js b/dist/tensorspace.min.js index 7fcd1cc7..26f49d46 100644 --- a/dist/tensorspace.min.js +++ b/dist/tensorspace.min.js @@ -1,2 +1,2 @@ // https://github.com/tensorspace-team/tensorspace/blob/master/LICENSE -var TSP=function(A,t,e,i,l){"use strict";function q(A,t){this.model=A,this.config=t,this.onCompleteCallback=void 0,this.onProgressCallBack=void 0,this.tfjsLoadOption={},this.loadLoaderConfig(t)}function g(A,t){this.model=A,this.inputNum=void 0,this.inputShapes=void 0,this.loadPredictorConfig(t)}function n(A,t){g.call(this,A,t),this.predictorType="TfjsPredictor"}function s(A,t){q.call(this,A,t),this.url=void 0,this.loadTfjsConfig(t),this.loaderType="TfjsLoader"}function a(A,t){g.call(this,A,t),this.predictorType="KerasPredictor"}function h(A,t){q.call(this,A,t),this.url=void 0,this.loadKerasConfig(t),this.loaderType="KerasLoader"}function o(A,t){g.call(this,A,t),this.outputsName=void 0,this.predictorType="TfPredictor"}function C(A,t){q.call(this,A,t),this.url=void 0,this.outputsName=void 0,this.loadTfConfig(t),this.loaderType="TfLoader"}function I(A,t){n.call(this,A,t),this.predictorType="LivePredictor"}function r(A,t){q.call(this,A,t),this.modelHandler=void 0,this.loadLiveConfig(t),this.loaderType="liveLoader"}function d(A){return this.layerInitStatus=!1,this.layerShape="rect",this.aggregationStrategy="average",this.relationSystem=!0,this.textSystem=!0,this.stats=!1,this.animeTime=2e3,this.minOpacity=.4,this.predictDataShapes=void 0,this.feedInputs=void 0,this.hasCloseButton=!0,this.color={background:0,input1d:15658734,greyscaleInput:15658734,RGBInput:15658734,conv1d:16252462,conv2d:16252462,depthwiseConv2d:16498463,conv2dTranspose:16733986,cropping1d:13565062,cropping2d:13565062,pooling1d:65535,pooling2d:65535,dense:65280,padding1d:7255807,padding2d:7255807,output1d:15658734,output2d:15658734,outputDetection:15658734,yoloGrid:15658734,flatten:14672638,globalPooling1d:7255807,globalPooling2d:7255807,upSampling1d:3204042,upSampling2d:3204042,reshape:10651636,activation1d:16538780,activation2d:16538780,activation3d:16538780,basicLayer1d:15764061,basicLayer2d:15764061,basicLayer3d:15764061,add:14827095,subtract:14827095,multiply:14827095,maximum:14827095,average:14827095,dot:14827095,concatenate:16359868},void 0!==A&&(void 0!==A.layerShape&&(this.layerShape=A.layerShape),void 0!==A.aggregationStrategy&&("average"===A.aggregationStrategy||"max"===A.aggregationStrategy?this.aggregationStrategy=A.aggregationStrategy:console.error('"aggregationStrategy" property do not support config for '+A.aggregationStrategy+' use "average" or "max" instead.')),void 0!==A.relationSystem&&("enable"===A.relationSystem?this.relationSystem=!0:"disable"===A.relationSystem?this.relationSystem=!1:console.error('"relationSystem" property do not support config for '+A.relationSystem+' use "enable" or "disable" instead.')),void 0!==A.textSystem&&("enable"===A.textSystem?this.textSystem=!0:"disable"===A.textSystem?this.textSystem=!1:console.error('"textSystem" property do not support config for '+A.textSystem+' use "enable" or "disable" instead.')),void 0!==A.layerInitStatus&&("close"===A.layerInitStatus?this.layerInitStatus=!1:"open"===A.layerInitStatus?this.layerInitStatus=!0:console.error("LayerInitStatus "+A.layerInitStatus+" is not support.")),void 0!==A.animeTime&&A.animeTime>0&&(this.animeTime=A.animeTime),void 0!==A.minOpacity&&A.minOpacity>0&&(this.minOpacity=A.minOpacity),void 0!==A.stats&&(this.stats=A.stats),void 0!==A.predictDataShapes&&(this.predictDataShapes=A.predictDataShapes),void 0!==A.feedInputs&&(this.feedInputs=A.feedInputs),void 0!==A.hasCloseButton&&(this.hasCloseButton=A.hasCloseButton),void 0!==A.color&&(void 0!==A.color.background&&(this.color.background=A.color.background),void 0!==A.color.input1d&&(this.color.input1d=A.color.input1d),void 0!==A.color.greyscaleInput&&(this.color.greyscaleInput=A.color.greyscaleInput),void 0!==A.color.RGBInput&&(this.color.RGBInput=A.color.RGBInput),void 0!==A.color.conv1d&&(this.color.conv1d=A.color.conv1d),void 0!==A.color.conv2d&&(this.color.conv2d=A.color.conv2d),void 0!==A.color.conv2dTranspose&&(this.color.conv2dTranspose=A.color.conv2dTranspose),void 0!==A.color.cropping1d&&(this.color.cropping1d=A.color.cropping1d),void 0!==A.color.cropping2d&&(this.color.cropping2d=A.color.cropping2d),void 0!==A.color.pooling1d&&(this.color.pooling1d=A.color.pooling1d),void 0!==A.color.pooling2d&&(this.color.pooling2d=A.color.pooling2d),void 0!==A.color.dense&&(this.color.dense=A.color.dense),void 0!==A.color.padding1d&&(this.color.padding1d=A.color.padding1d),void 0!==A.color.padding2d&&(this.color.padding2d=A.color.padding2d),void 0!==A.color.output1d&&(this.color.output1d=A.color.output1d),void 0!==A.color.output2d&&(this.color.output2d=A.color.output2d),void 0!==A.color.outputDetection&&(this.color.outputDetection=A.color.outputDetection),void 0!==A.color.yoloGrid&&(this.color.yoloGrid=A.color.yoloGrid),void 0!==A.color.flatten&&(this.color.flatten=A.color.flatten),void 0!==A.color.globalPooling1d&&(this.color.globalPooling1d=A.color.globalPooling1d),void 0!==A.color.globalPooling2d&&(this.color.globalPooling2d=A.color.globalPooling2d),void 0!==A.color.upSampling1d&&(this.color.upSampling1d=A.color.upSampling1d),void 0!==A.color.upSampling2d&&(this.color.upSampling2d=A.color.upSampling2d),void 0!==A.color.reshape&&(this.color.reshape=A.color.reshape),void 0!==A.color.activation1d&&(this.color.activation1d=A.color.activation1d),void 0!==A.color.activation2d&&(this.color.activation2d=A.color.activation2d),void 0!==A.color.activation3d&&(this.color.activation3d=A.color.activation3d),void 0!==A.color.basicLayer1d&&(this.color.basicLayer1d=A.color.basicLayer1d),void 0!==A.color.basicLayer2d&&(this.color.basicLayer2d=A.color.basicLayer2d),void 0!==A.color.basicLayer3d&&(this.color.basicLayer3d=A.color.basicLayer3d),void 0!==A.color.add&&(this.color.add=A.color.add),void 0!==A.color.subtract&&(this.color.subtract=A.color.subtract),void 0!==A.color.multiply&&(this.color.multiply=A.color.multiply),void 0!==A.color.maximum&&(this.color.maximum=A.color.maximum),void 0!==A.color.average&&(this.color.average=A.color.average),void 0!==A.color.dot&&(this.color.dot=A.color.dot),void 0!==A.color.concatenate&&(this.color.concatenate=A.color.concatenate))),this}q.prototype={loadLoaderConfig:function(A){void 0!==this.config&&(void 0!==A.onProgress&&(this.onProgressCallBack=A.onProgress,this.tfjsLoadOption.onProgress=A.onProgress),void 0!==A.onComplete&&(this.onCompleteCallback=A.onComplete))},preLoad:function(){this.model.loader=this,this.model.hasLoader=!0,this.model.isInitialized&&this.load().then(function(){})},load:async function(){},setPredictor:function(){}},g.prototype={loadPredictorConfig:function(A){let t=[];if(void 0!==this.model.configuration.predictDataShapes){let A=this.model.configuration.predictDataShapes;for(let e=0;e{let t=e.createInputTensor(A);return e.model.resource.predict(t)})}}),s.prototype=Object.assign(Object.create(q.prototype),{load:async function(){const A=await t.loadLayersModel(this.url,this.tfjsLoadOption);this.model.resource=A,"Model"===this.model.modelType&&(this.model.outputsOrder=A.outputNames),this.setPredictor(),void 0!==this.onCompleteCallback&&this.onCompleteCallback()},setPredictor:function(){let A=new n(this.model,this.config);this.model.predictor=A},loadTfjsConfig:function(A){void 0!==A.url?this.url=A.url:console.error('"url" property is required to load tensorflow.js model.')}}),a.prototype=Object.assign(Object.create(g.prototype),{predict:function(A){let e=this;return t.tidy(()=>{let t=e.createInputTensor(A);return e.model.resource.predict(t)})}}),h.prototype=Object.assign(Object.create(q.prototype),{load:async function(){const A=await t.loadLayersModel(this.url,this.tfjsLoadOption);this.model.resource=A,"Model"===this.model.modelType&&(this.model.outputsOrder=A.outputNames),this.setPredictor(),void 0!==this.onCompleteCallback&&this.onCompleteCallback()},setPredictor:function(){let A=new a(this.model,this.config);this.model.predictor=A},loadKerasConfig:function(A){void 0!==A.url?this.url=A.url:console.error('"url" property is required to load Keras model.')}}),o.prototype=Object.assign(Object.create(g.prototype),{predict:function(A){let e=this;return t.tidy(()=>{let t,i=e.createInputTensor(A);return t=void 0!==this.outputsName?e.model.resource.execute(i,this.outputsName):e.model.resource.predict(i)})},setOutputsName:function(A){this.outputsName=A}}),C.prototype=Object.assign(Object.create(q.prototype),{load:async function(){let A;A=void 0!==this.outputsName?await t.loadGraphModel(this.url,this.tfjsLoadOption):await t.loadLayersModel(this.url,this.tfjsLoadOption),this.model.resource=A,"Model"===this.model.modelType&&(this.model.outputsOrder=A.outputNames),this.setPredictor(),void 0!==this.onCompleteCallback&&this.onCompleteCallback()},setPredictor:function(){let A=new o(this.model,this.config);A.setOutputsName(this.outputsName),this.model.predictor=A},loadTfConfig:function(A){void 0!==A.url?this.url=A.url:console.error('"url" property is required to load tensorflow model.'),void 0!==A.outputsName&&(this.outputsName=A.outputsName)}}),I.prototype=Object.assign(Object.create(n.prototype),{}),r.prototype=Object.assign(Object.create(q.prototype),{load:async function(){this.model.resource=this.modelHandler,"Model"===this.model.modelType&&(this.model.outputsOrder=this.model.outputNames),this.setPredictor(),void 0!==this.onCompleteCallback&&this.onCompleteCallback()},setPredictor:function(){let A=new I(this.model,this.config);this.model.predictor=A},loadLiveConfig:function(A){void 0!==A.modelHandler?this.modelHandler=A.modelHandler:console.error('"modelHandler" property is required to load live model.')}});const u=function(){return{isElement:function(A){return"object"==typeof HTMLElement?A instanceof HTMLElement:A&&"object"==typeof A&&null!==A&&1===A.nodeType&&"string"==typeof A.nodeName}}}();function m(A,t){this.container=void 0,this.loader=void 0,this.hasLoader=!1,this.isInitialized=!1,this.resource=void 0,this.inputValue=void 0,this.predictResult=void 0,this.predictor=void 0,this.modelType=void 0,this.layers=[],this.depth=void 0,this.configuration=void 0,this.modelContext=new e.Object3D,this.loadConfiguration(A,t)}m.prototype={loadConfiguration:function(A,t){u.isElement(A)?(this.container=A,this.configuration=new d(t)):this.configuration=new d(A)},load:function(A){"tfjs"===A.type?this.loadTfjsModel(A):"keras"===A.type?this.loadKerasModel(A):"tensorflow"===A.type?this.loadTfModel(A):(A.type="live")?this.loadLiveModel(A):console.error("Do not support to load model type "+A.type)},loadTfjsModel:function(A){new s(this,A).preLoad()},loadKerasModel:function(A){new h(this,A).preLoad()},loadTfModel:function(A){new C(this,A).preLoad()},loadLiveModel:function(A){new r(this,A).preLoad()},setLoader:function(A){this.loader=A},getLayerByName:function(A){for(let t=0;tl?e:l,t.push(l)):t.push(1)}for(let l=0;l1?i.push(t[l]/e*y):i.push(1);return i}}}();function J(A){this.tspModel=A,this.hoveredLayer=void 0,this.hoveredEmissive=void 0}function k(A){J.call(this,A)}function Q(A){J.call(this,A)}J.prototype={handleClick:function(){},handleHover:function(A){}},k.prototype=Object.assign(Object.create(J.prototype),{handleClick:function(A){this.tspModel.layers[A.layerIndex-1].handleClick(A)},handleHover:function(A){void 0!==this.hoveredLayer&&(this.hoveredLayer.handleHoverOut(),this.hoveredLayer=void 0),void 0!==this.hoveredEmissive&&(this.hoveredEmissive.context.darken(),this.hoveredEmissive=void 0);for(let t=0;t0&&"Mesh"===A[t].object.type){let e=A[t].object;if(!0===e.hoverable){e.emissiveable&&(this.hoveredEmissive=e,e.context.emissive());let A=this.tspModel.layers[e.layerIndex-1];A.handleHoverIn(e),this.hoveredLayer=A;break}}}}),Q.prototype=Object.assign(Object.create(J.prototype),{handleClick:function(A){let t=this.tspModel.layers[A.layerIndex];t.handleClick(A);let e=t.openTime,i=this.tspModel.layerLookupMap[A.layerIndex];this.tspModel.rearrangeLayerInLevel(i,e)},handleHover:function(A){void 0!==this.hoveredLayer&&(this.hoveredLayer.handleHoverOut(),this.hoveredLayer=void 0),void 0!==this.hoveredEmissive&&(this.hoveredEmissive.context.darken(),this.hoveredEmissive=void 0);for(let t=0;t0&&"Mesh"===A[t].object.type){let e=A[t].object;if(!0===e.hoverable){e.emissiveable&&(this.hoveredEmissive=e,e.context.emissive());let A=this.tspModel.layers[e.layerIndex];A.handleHoverIn(e),this.hoveredLayer=A;break}}}});let D=function(){return{getEventHandler:function(A){return"Sequential"===A.modelType?new k(A):"Model"===A.modelType?new Q(A):void 0}}}(),b=function(){return{getElementViewTop:function(A){let t,e=A.offsetTop,i=A.offsetParent;for(;null!==i;)e+=i.offsetTop,i=i.offsetParent;return e-(t="BackCompat"===document.compatMode?document.body.scrollTop:0===document.documentElement.scrollTop?document.body.scrollTop:document.documentElement.scrollTop)},getElementViewLeft:function(A){let t,e=A.offsetLeft,i=A.offsetParent;for(;null!==i;)e+=i.offsetLeft,i=i.offsetParent;return e-(t="BackCompat"===document.compatMode?document.body.scrollLeft:0===document.documentElement.scrollTop?document.body.scrollLeft:document.documentElement.scrollLeft)}}}();function L(A,t){this.tspModel=A,this.handlers=t}function G(A,t){L.call(this,A,t),this.container=A.container,this.scene=void 0,this.camera=void 0,this.stats=void 0,this.renderer=void 0,this.clock=void 0,this.cameraControls=void 0,this.raycaster=void 0,this.mouse=void 0,this.hasStats=void 0,this.backgroundColor=void 0,this.sceneArea=void 0,this.domParams={left:void 0,top:void 0,width:void 0,height:void 0},this.loadSceneConfig(A.configuration)}L.prototype={init:function(){},reset:function(){}},G.prototype=Object.assign(Object.create(L.prototype),{init:function(){this.createScene(),this.registerEvent(),this.animate()},reset:function(){this.cameraControls.reset(),this.updateCamera()},loadSceneConfig:function(A){this.hasStats=A.stats,this.backgroundColor=A.color.background},createScene:function(){let A=document.createElement("canvas");this.sceneArea=A,this.setSceneSize(),A.style.backgroundColor=this.backgroundColor,this.clock=new e.Clock,this.renderer=new e.WebGLRenderer({canvas:A,antialias:!0}),this.renderer.setSize(A.width,A.height),this.container.appendChild(this.renderer.domElement),this.camera=new e.PerspectiveCamera,this.camera.fov=45,this.camera.aspect=this.container.clientWidth/this.container.clientHeight,this.camera.near=.1,this.camera.far=1e4,this.camera.updateProjectionMatrix(),this.camera.name="defaultCamera",this.scene=new e.Scene,this.scene.background=new e.Color(this.backgroundColor),this.scene.add(this.tspModel.modelContext),this.hasStats&&("undefined"!=typeof Stats?(this.stats=new Stats,this.stats.dom.style.position="absolute",this.stats.dom.style.zIndex="1",this.stats.showPanel(0),this.container.appendChild(this.stats.dom)):import("stats-js").then(A=>{this.stats=new A,this.stats.dom.style.position="absolute",this.stats.dom.style.zIndex="1",this.stats.showPanel(0),this.container.appendChild(this.stats.dom)}).catch(()=>{"undefined"!=typeof Stats?(this.stats=new Stats,this.stats.dom.style.position="absolute",this.stats.dom.style.zIndex="1",this.stats.showPanel(0),this.container.appendChild(this.stats.dom)):"undefined"==typeof window?console.error("Please import stats-js"):console.error("Please include