@mappedin/dynamic-focus 6.0.1-beta.49 → 6.0.1-beta.51
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/lib/esm/index.js +1 -1
- package/package.json +2 -2
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var ct=Object.defineProperty,pt=Object.defineProperties;var _t=Object.getOwnPropertyDescriptors;var ut=Object.getOwnPropertySymbols;var vt=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable;var ht=t=>{throw TypeError(t)};var J=(t,e,i)=>e in t?ct(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,W=(t,e)=>{for(var i in e||(e={}))vt.call(e,i)&&J(t,i,e[i]);if(ut)for(var i of ut(e))gt.call(e,i)&&J(t,i,e[i]);return t},Q=(t,e)=>pt(t,_t(e)),n=(t,e)=>ct(t,"name",{value:e,configurable:!0});var D=(t,e,i)=>J(t,typeof e!="symbol"?e+"":e,i),H=(t,e,i)=>e.has(t)||ht("Cannot "+i);var r=(t,e,i)=>(H(t,e,"read from private field"),i?i.call(t):e.get(t)),l=(t,e,i)=>e.has(t)?ht("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),g=(t,e,i,s)=>(H(t,e,"write to private field"),s?s.call(t,i):e.set(t,i),i),j=(t,e,i)=>(H(t,e,"access private method"),i);var p={env:{NODE_ENV:"production",npm_package_version:"6.0.1-beta.49"}};var mt="[MappedinJS]";function Et(t=""){let e="".concat(mt).concat(t?"-".concat(t):"");return{logState:p.env.NODE_ENV==="test"?3:0,log(...i){this.logState<=0&&console.log(e,...i)},warn(...i){this.logState<=1&&console.warn(e,...i)},error(...i){this.logState<=2&&console.error(e,...i)},assert(...i){console.assert(...i)},time(i){console.time(i)},timeEnd(i){console.timeEnd(i)},setLevel(i){0<=i&&i<=3&&(this.logState=i)}}}n(Et,"createLogger");var bt=Et();var w=bt;var tt=class tt extends Error{};n(tt,"InvalidTokenError");var X=tt;X.prototype.name="InvalidTokenError";function et(t,e,i,s){return(t<e||t>i)&&w.warn(s),Math.min(i,Math.max(e,t))}n(et,"clampWithWarning");function lt(t,e){if(t==null||e==null)return t===e;if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}n(lt,"arraysEqual");var it=class it{constructor(){D(this,"_subscribers",{})}publish(e,i){!this._subscribers||!this._subscribers[e]||this._subscribers[e].forEach(function(s){typeof s=="function"&&s(i)})}on(e,i){this._subscribers||(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(i)}off(e,i){if(!this._subscribers||this._subscribers[e]==null)return;let s=this._subscribers[e].indexOf(i);s!==-1&&this._subscribers[e].splice(s,1)}destroy(){this._subscribers={}}};n(it,"PubSub");var Z=it;var I=Object.freeze({Linear:Object.freeze({None:n(function(t){return t},"None"),In:n(function(t){return t},"In"),Out:n(function(t){return t},"Out"),InOut:n(function(t){return t},"InOut")}),Quadratic:Object.freeze({In:n(function(t){return t*t},"In"),Out:n(function(t){return t*(2-t)},"Out"),InOut:n(function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},"InOut")}),Cubic:Object.freeze({In:n(function(t){return t*t*t},"In"),Out:n(function(t){return--t*t*t+1},"Out"),InOut:n(function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},"InOut")}),Quartic:Object.freeze({In:n(function(t){return t*t*t*t},"In"),Out:n(function(t){return 1- --t*t*t*t},"Out"),InOut:n(function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},"InOut")}),Quintic:Object.freeze({In:n(function(t){return t*t*t*t*t},"In"),Out:n(function(t){return--t*t*t*t*t+1},"Out"),InOut:n(function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},"InOut")}),Sinusoidal:Object.freeze({In:n(function(t){return 1-Math.sin((1-t)*Math.PI/2)},"In"),Out:n(function(t){return Math.sin(t*Math.PI/2)},"Out"),InOut:n(function(t){return .5*(1-Math.sin(Math.PI*(.5-t)))},"InOut")}),Exponential:Object.freeze({In:n(function(t){return t===0?0:Math.pow(1024,t-1)},"In"),Out:n(function(t){return t===1?1:1-Math.pow(2,-10*t)},"Out"),InOut:n(function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)},"InOut")}),Circular:Object.freeze({In:n(function(t){return 1-Math.sqrt(1-t*t)},"In"),Out:n(function(t){return Math.sqrt(1- --t*t)},"Out"),InOut:n(function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},"InOut")}),Elastic:Object.freeze({In:n(function(t){return t===0?0:t===1?1:-Math.pow(2,10*(t-1))*Math.sin((t-1.1)*5*Math.PI)},"In"),Out:n(function(t){return t===0?0:t===1?1:Math.pow(2,-10*t)*Math.sin((t-.1)*5*Math.PI)+1},"Out"),InOut:n(function(t){return t===0?0:t===1?1:(t*=2,t<1?-.5*Math.pow(2,10*(t-1))*Math.sin((t-1.1)*5*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin((t-1.1)*5*Math.PI)+1)},"InOut")}),Back:Object.freeze({In:n(function(t){var e=1.70158;return t===1?1:t*t*((e+1)*t-e)},"In"),Out:n(function(t){var e=1.70158;return t===0?0:--t*t*((e+1)*t+e)+1},"Out"),InOut:n(function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)},"InOut")}),Bounce:Object.freeze({In:n(function(t){return 1-I.Bounce.Out(1-t)},"In"),Out:n(function(t){return t<.36363636363636365?7.5625*t*t:t<.7272727272727273?7.5625*(t-=.5454545454545454)*t+.75:t<.9090909090909091?7.5625*(t-=.8181818181818182)*t+.9375:7.5625*(t-=.9545454545454546)*t+.984375},"Out"),InOut:n(function(t){return t<.5?I.Bounce.In(t*2)*.5:I.Bounce.Out(t*2-1)*.5+.5},"InOut")}),generatePow:n(function(t){return t===void 0&&(t=4),t=t<Number.EPSILON?Number.EPSILON:t,t=t>1e4?1e4:t,{In:n(function(e){return Math.pow(e,t)},"In"),Out:n(function(e){return 1-Math.pow(1-e,t)},"Out"),InOut:n(function(e){return e<.5?Math.pow(e*2,t)/2:(1-Math.pow(2-e*2,t))/2+.5},"InOut")}},"generatePow")}),$=n(function(){return performance.now()},"now"),st=function(){function t(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return n(t,"Group"),t.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(i){return e._tweens[i]})},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(){for(var e,i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];for(var o=0,u=i;o<u.length;o++){var a=u[o];(e=a._group)===null||e===void 0||e.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},t.prototype.remove=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var s=0,o=e;s<o.length;s++){var u=o[s];u._group=void 0,delete this._tweens[u.getId()],delete this._tweensAddedDuringUpdate[u.getId()]}},t.prototype.allStopped=function(){return this.getAll().every(function(e){return!e.isPlaying()})},t.prototype.update=function(e,i){e===void 0&&(e=$()),i===void 0&&(i=!0);var s=Object.keys(this._tweens);if(s.length!==0)for(;s.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<s.length;o++){var u=this._tweens[s[o]],a=!i;u&&u.update(e,a)===!1&&!i&&this.remove(u)}s=Object.keys(this._tweensAddedDuringUpdate)}},t}(),N={Linear:n(function(t,e){var i=t.length-1,s=i*e,o=Math.floor(s),u=N.Utils.Linear;return e<0?u(t[0],t[1],s):e>1?u(t[i],t[i-1],i-s):u(t[o],t[o+1>i?i:o+1],s-o)},"Linear"),Bezier:n(function(t,e){for(var i=0,s=t.length-1,o=Math.pow,u=N.Utils.Bernstein,a=0;a<=s;a++)i+=o(1-e,s-a)*o(e,a)*t[a]*u(s,a);return i},"Bezier"),CatmullRom:n(function(t,e){var i=t.length-1,s=i*e,o=Math.floor(s),u=N.Utils.CatmullRom;return t[0]===t[i]?(e<0&&(o=Math.floor(s=i*(1+e))),u(t[(o-1+i)%i],t[o],t[(o+1)%i],t[(o+2)%i],s-o)):e<0?t[0]-(u(t[0],t[0],t[1],t[1],-s)-t[0]):e>1?t[i]-(u(t[i],t[i],t[i-1],t[i-1],s-i)-t[i]):u(t[o?o-1:0],t[o],t[i<o+1?i:o+1],t[i<o+2?i:o+2],s-o)},"CatmullRom"),Utils:{Linear:n(function(t,e,i){return(e-t)*i+t},"Linear"),Bernstein:n(function(t,e){var i=N.Utils.Factorial;return i(t)/i(e)/i(t-e)},"Bernstein"),Factorial:function(){var t=[1];return function(e){var i=1;if(t[e])return t[e];for(var s=e;s>1;s--)i*=s;return t[e]=i,i}}(),CatmullRom:n(function(t,e,i,s,o){var u=(i-t)*.5,a=(s-e)*.5,h=o*o,d=o*h;return(2*e-2*i+u+a)*d+(-3*e+3*i-2*u-a)*h+u*o+e},"CatmullRom")}},ft=function(){function t(){}return n(t,"Sequence"),t.nextId=function(){return t._nextId++},t._nextId=0,t}(),rt=new st,dt=function(){function t(e,i){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=I.Linear.None,this._interpolationFunction=N.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=ft.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,typeof i=="object"?(this._group=i,i.add(this)):i===!0&&(this._group=rt,rt.add(this))}return n(t,"Tween"),t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.getDuration=function(){return this._duration},t.prototype.to=function(e,i){if(i===void 0&&(i=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=i<0?0:i,this},t.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},t.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},t.prototype.start=function(e,i){if(e===void 0&&(e=$()),i===void 0&&(i=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var s in this._valuesStartRepeat)this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||i){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var u in this._valuesEnd)o[u]=this._valuesEnd[u];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,i)}return this},t.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},t.prototype._setupProperties=function(e,i,s,o,u){for(var a in s){var h=e[a],d=Array.isArray(h),y=d?"array":typeof h,v=!d&&Array.isArray(s[a]);if(!(y==="undefined"||y==="function")){if(v){var m=s[a];if(m.length===0)continue;for(var B=[h],M=0,q=m.length;M<q;M+=1){var G=this._handleRelativeValue(h,m[M]);if(isNaN(G)){v=!1,console.warn("Found invalid interpolation list. Skipping.");break}B.push(G)}v&&(s[a]=B)}if((y==="object"||d)&&h&&!v){i[a]=d?[]:{};var U=h;for(var T in U)i[a][T]=U[T];o[a]=d?[]:{};var m=s[a];if(!this._isDynamic){var at={};for(var T in m)at[T]=m[T];s[a]=m=at}this._setupProperties(U,i[a],m,o[a],u)}else(typeof i[a]>"u"||u)&&(i[a]=h),d||(i[a]*=1),v?o[a]=s[a].slice().reverse():o[a]=i[a]||0}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},t.prototype.pause=function(e){return e===void 0&&(e=$()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this)},t.prototype.resume=function(e){return e===void 0&&(e=$()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this)},t.prototype.stopChainedTweens=function(){for(var e=0,i=this._chainedTweens.length;e<i;e++)this._chainedTweens[e].stop();return this},t.prototype.group=function(e){return e?(e.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},t.prototype.remove=function(){var e;return(e=this._group)===null||e===void 0||e.remove(this),this},t.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},t.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},t.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},t.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},t.prototype.easing=function(e){return e===void 0&&(e=I.Linear.None),this._easingFunction=e,this},t.prototype.interpolation=function(e){return e===void 0&&(e=N.Linear),this._interpolationFunction=e,this},t.prototype.chain=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return this._chainedTweens=e,this},t.prototype.onStart=function(e){return this._onStartCallback=e,this},t.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},t.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},t.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},t.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},t.prototype.onStop=function(e){return this._onStopCallback=e,this},t.prototype.update=function(e,i){var s=this,o;if(e===void 0&&(e=$()),i===void 0&&(i=t.autoStartOnUpdate),this._isPaused)return!0;var u;if(!this._goToEnd&&!this._isPlaying)if(i)this.start(e,!0);else return!1;if(this._goToEnd=!1,e<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=e-this._startTime,h=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),d=this._duration+this._repeat*h,y=n(function(){if(s._duration===0||a>d)return 1;var G=Math.trunc(a/h),U=a-G*h,T=Math.min(U/s._duration,1);return T===0&&a===s._duration?1:T},"calculateElapsedPortion"),v=y(),m=this._easingFunction(v);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,m),this._onUpdateCallback&&this._onUpdateCallback(this._object,v),this._duration===0||a>=this._duration)if(this._repeat>0){var B=Math.min(Math.trunc((a-this._duration)/h)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=B);for(u in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[u]=="string"&&(this._valuesStartRepeat[u]=this._valuesStartRepeat[u]+parseFloat(this._valuesEnd[u])),this._yoyo&&this._swapEndStartRepeatValues(u),this._valuesStart[u]=this._valuesStartRepeat[u];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=h*B,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var M=0,q=this._chainedTweens.length;M<q;M++)this._chainedTweens[M].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(e,i,s,o){for(var u in s)if(i[u]!==void 0){var a=i[u]||0,h=s[u],d=Array.isArray(e[u]),y=Array.isArray(h),v=!d&&y;v?e[u]=this._interpolationFunction(h,o):typeof h=="object"&&h?this._updateProperties(e[u],a,h,o):(h=this._handleRelativeValue(a,h),typeof h=="number"&&(e[u]=a+(h-a)*o))}},t.prototype._handleRelativeValue=function(e,i){return typeof i!="string"?i:i.charAt(0)==="+"||i.charAt(0)==="-"?e+parseFloat(i):parseFloat(i)},t.prototype._swapEndStartRepeatValues=function(e){var i=this._valuesStartRepeat[e],s=this._valuesEnd[e];typeof s=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(s):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=i},t.autoStartOnUpdate=!1,t}();var ve=ft.nextId,E=rt,ge=E.getAll.bind(E),ye=E.removeAll.bind(E),me=E.add.bind(E),Ee=E.remove.bind(E),be=E.update.bind(E);var St={indoorZoomThreshold:18,outdoorZoomThreshold:17,setFloorOnFocus:!0,autoFocus:!1,indoorAnimationOptions:{duration:150},outdoorAnimationOptions:{duration:150}},x,c,_,f,F,b,A,L,O,S,P,k,C,K,Y,z,R,V,ot=class ot{constructor(e,i){l(this,C);l(this,x);l(this,c);l(this,_);l(this,f,St);l(this,F);l(this,b,new Map);l(this,A,new Set);l(this,L,new Map);l(this,O,new Map);D(this,"tweenGroup",new st);l(this,S,!1);l(this,P,[]);l(this,k,[]);D(this,"on",n((e,i)=>{r(this,x).on(e,i)},"on"));D(this,"off",n((e,i)=>{r(this,x).off(e,i)},"off"));l(this,Y,n(e=>{let{facades:i}=e;if(!lt(i,this.focusedFacades)){if(g(this,P,i),r(this,A).clear(),i.length>0)for(let s of i)r(this,A).add(s.id);r(this,f).autoFocus&&this.focus()}},"#handleDynamicFocusChange"));l(this,z,n(e=>{let{floor:i}=e;if(r(this,c).manualFloorVisibility===!0&&i.floorStack.id!==r(this,F))for(let o of i.floorStack.floors)o.id!==i.id&&r(this,c).updateState(o,{visible:!1});r(this,O).set(i.floorStack.id,i.id);let s=i.floorStack.facade;s&&j(this,C,K).call(this,s,"open")},"#handleFloorChange"));l(this,R,n(e=>{let{zoomLevel:i}=e;i>=r(this,f).indoorZoomThreshold&&!r(this,S)?(g(this,S,!0),r(this,f).autoFocus&&this.focus()):i<=r(this,f).outdoorZoomThreshold&&r(this,S)&&(g(this,S,!1),r(this,O).clear(),r(this,f).autoFocus&&this.focus())},"#handleCameraChange"));l(this,V,n(()=>{this.tweenGroup.update()},"#render"));g(this,x,new Z),g(this,c,e),g(this,_,Object.values(r(this,c).getMapData())[0]),r(this,c).preloadFloors(r(this,_).getByType("floor-stack").map(s=>s.defaultFloor)),r(this,c).manualFloorVisibility=!0,this.updateState(Q(W({},i),{outdoorFloorStack:(i==null?void 0:i.outdoorFloorStack)||r(this,_).getByType("floor-stack").find(s=>s.type==="Outdoor")||r(this,_).getByType("floor-stack")[0]})),r(this,c).on("pre-render",r(this,V)),r(this,c).on("floor-change-start",r(this,z)),r(this,c).on("facades-in-view-change",r(this,Y)),r(this,c).Camera.updateFacadesInView(),r(this,c).on("camera-change",r(this,R)),r(this,R).call(this,{zoomLevel:r(this,c).Camera.zoomLevel,center:r(this,c).Camera.center,bearing:r(this,c).Camera.bearing,pitch:r(this,c).Camera.pitch})}get focusedFacades(){return[...r(this,P)]}get visibleFloors(){return[...r(this,k)]}get visibleFloorStacks(){return r(this,k).map(e=>e.floorStack)}getState(){return Q(W({},r(this,f)),{outdoorFloorStack:r(this,_).getById("floor-stack",r(this,F))})}updateState(e){if(e.indoorZoomThreshold!=null&&(e.indoorZoomThreshold=et(e.indoorZoomThreshold,r(this,f).outdoorZoomThreshold,r(this,c).Camera.maxZoomLevel,"fadeInAtZoomLevel must be between fadeOutAtZoomLevel (".concat(r(this,f).outdoorZoomThreshold,") and maxZoomLevel (").concat(r(this,c).Camera.maxZoomLevel,")."))),e.outdoorZoomThreshold!=null&&(e.outdoorZoomThreshold=et(e.outdoorZoomThreshold,r(this,c).Camera.minZoomLevel,r(this,f).indoorZoomThreshold,"fadeOutAtZoomLevel must be between minZoomLevel (".concat(r(this,c).Camera.minZoomLevel,") and fadeInAtZoomLevel (").concat(r(this,f).indoorZoomThreshold,")."))),e.outdoorFloorStack!=null){let i=r(this,_).getById("floor-stack",r(this,F));if(i)for(let s of i.floors)r(this,c).updateState(s,{visible:!1});g(this,F,e.outdoorFloorStack.id);for(let s of e.outdoorFloorStack.floors)r(this,c).updateState(s,{visible:!0})}g(this,f,Object.assign({},r(this,f),e))}destroy(){r(this,c).off("facades-in-view-change",r(this,Y)),r(this,c).off("floor-change-start",r(this,z)),r(this,c).off("camera-change",r(this,R)),r(this,c).off("pre-render",r(this,V));for(let e of r(this,_).getByType("facade")){let i=r(this,b).get(e.id);i&&(i.stop(),r(this,b).delete(e.id)),r(this,c).updateState(e,{visible:!0,opacity:1})}for(let e of r(this,_).getByType("floor"))r(this,c).updateState(e,{visible:e.id===r(this,c).currentFloor.id});r(this,c).manualFloorVisibility=!1}focus(e=r(this,f).setFloorOnFocus){var i;if(r(this,x).publish("focus",{facades:this.focusedFacades}),e){let s=r(this,P).length>0?this.focusedFacades[0].floorStack:void 0,o=r(this,_).getById("floor-stack",r(this,F)),u=r(this,S)?s:o,a=u?this.getDefaultFloorForStack(u):void 0;a&&a.id!==r(this,c).currentFloor.id&&r(this,c).setFloor(a,{context:"dynamic-focus"})}g(this,k,[]);for(let s of r(this,_).getByType("facade")){let o=s.floorStack;if(o.id===r(this,c).currentFloorStack.id)continue;let u=this.getDefaultFloorForStack(o),a=(i=r(this,c).getState(s))==null?void 0:i.visible;r(this,S)&&r(this,A).has(s.id)&&a===!0?(this.setCurrentFloorForStack(o,u),r(this,c).updateState(u,{visible:!0}),j(this,C,K).call(this,s,"open"),r(this,k).push(u)):a===!1&&j(this,C,K).call(this,s,"close",()=>{for(let h of o.floors)r(this,c).updateState(h,{visible:!1})})}}setDefaultFloorForStack(e,i){if(i.floorStack.id!==e.id){w.warn("Floor (".concat(i.id,") does not belong to floor stack (").concat(e.id,"). Default floor will not be set."));return}r(this,L).set(e.id,i.id)}resetDefaultFloorForStack(e){r(this,L).delete(e.id)}getDefaultFloorForStack(e){var i;return r(this,_).getById("floor",(i=r(this,L).get(e.id))!=null?i:"")||e.defaultFloor||e.floors[0]}setCurrentFloorForStack(e,i){if(i.floorStack.id!==e.id){w.warn("Floor (".concat(i.id,") does not belong to floor stack (").concat(e.id,"). Current floor will not be set."));return}if(r(this,O).set(e.id,i.id),e.facade){let s=r(this,c).getState(e.facade);if(s&&s.opacity<1)for(let o of e.floors)r(this,c).updateState(o,{visible:o.id===i.id})}}getCurrentFloorForStack(e){var i;return r(this,_).getById("floor",(i=r(this,O).get(e.id))!=null?i:"")||this.getDefaultFloorForStack(e)}};x=new WeakMap,c=new WeakMap,_=new WeakMap,f=new WeakMap,F=new WeakMap,b=new WeakMap,A=new WeakMap,L=new WeakMap,O=new WeakMap,S=new WeakMap,P=new WeakMap,k=new WeakMap,C=new WeakSet,K=n(function(e,i,s){var y;let o=r(this,c).getState(e);if(!o){w.warn("Facade (".concat(e.id,") not found in map view."));return}let u=o.opacity,a=i==="open"?0:1;if(a===u){r(this,c).updateState(e,{visible:a===1,opacity:a}),s==null||s();return}r(this,b).has(e.id)&&((y=r(this,b).get(e.id))==null||y.stop(),r(this,b).delete(e.id));let h=i==="open"?r(this,f).indoorAnimationOptions.duration:r(this,f).outdoorAnimationOptions.duration,d=new dt({opacity:u}).to({opacity:a},h).easing(I.Quadratic.In).onUpdate(({opacity:v})=>{r(this,c).updateState(e,{visible:!0,opacity:v})}).onComplete(()=>{r(this,c).updateState(e,{visible:i==="close"}),s==null||s()}).start();r(this,V).call(this),this.tweenGroup.add(d),r(this,b).set(e.id,d)},"#animate"),Y=new WeakMap,z=new WeakMap,R=new WeakMap,V=new WeakMap,n(ot,"DynamicFocus");var nt=ot;export{nt as DynamicFocus};
|
|
1
|
+
var ct=Object.defineProperty,pt=Object.defineProperties;var _t=Object.getOwnPropertyDescriptors;var ut=Object.getOwnPropertySymbols;var vt=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable;var ht=t=>{throw TypeError(t)};var J=(t,e,i)=>e in t?ct(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,W=(t,e)=>{for(var i in e||(e={}))vt.call(e,i)&&J(t,i,e[i]);if(ut)for(var i of ut(e))gt.call(e,i)&&J(t,i,e[i]);return t},Q=(t,e)=>pt(t,_t(e)),s=(t,e)=>ct(t,"name",{value:e,configurable:!0});var D=(t,e,i)=>J(t,typeof e!="symbol"?e+"":e,i),H=(t,e,i)=>e.has(t)||ht("Cannot "+i);var n=(t,e,i)=>(H(t,e,"read from private field"),i?i.call(t):e.get(t)),f=(t,e,i)=>e.has(t)?ht("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),y=(t,e,i,r)=>(H(t,e,"write to private field"),r?r.call(t,i):e.set(t,i),i),G=(t,e,i)=>(H(t,e,"access private method"),i);var p={env:{NODE_ENV:"production",npm_package_version:"6.0.1-beta.51"}};var mt="[MappedinJS]";function Et(t=""){let e="".concat(mt).concat(t?"-".concat(t):""),i=s((r,a)=>{if(typeof window<"u"&&window.rnDebug){let u=a.map(o=>o instanceof Error&&o.stack?"".concat(o.message,"\n").concat(o.stack):o);window.rnDebug("".concat(e," ").concat(r,": ").concat(u.join(" ")))}},"rnDebug");return{logState:p.env.NODE_ENV==="test"?3:0,log(...r){this.logState<=0&&(console.log(e,...r),i("log",r))},warn(...r){this.logState<=1&&(console.warn(e,...r),i("warn",r))},error(...r){this.logState<=2&&(console.error(e,...r),i("error",r))},assert(...r){console.assert(...r)},time(r){console.time(r)},timeEnd(r){console.timeEnd(r)},setLevel(r){0<=r&&r<=3&&(this.logState=r)}}}s(Et,"createLogger");var bt=Et();var M=bt;var tt=class tt extends Error{};s(tt,"InvalidTokenError");var X=tt;X.prototype.name="InvalidTokenError";function et(t,e,i,r){return(t<e||t>i)&&M.warn(r),Math.min(i,Math.max(e,t))}s(et,"clampWithWarning");function lt(t,e){if(t==null||e==null)return t===e;if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}s(lt,"arraysEqual");var it=class it{constructor(){D(this,"_subscribers",{})}publish(e,i){!this._subscribers||!this._subscribers[e]||this._subscribers[e].forEach(function(r){typeof r=="function"&&r(i)})}on(e,i){this._subscribers||(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(i)}off(e,i){if(!this._subscribers||this._subscribers[e]==null)return;let r=this._subscribers[e].indexOf(i);r!==-1&&this._subscribers[e].splice(r,1)}destroy(){this._subscribers={}}};s(it,"PubSub");var $=it;var x=Object.freeze({Linear:Object.freeze({None:s(function(t){return t},"None"),In:s(function(t){return t},"In"),Out:s(function(t){return t},"Out"),InOut:s(function(t){return t},"InOut")}),Quadratic:Object.freeze({In:s(function(t){return t*t},"In"),Out:s(function(t){return t*(2-t)},"Out"),InOut:s(function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},"InOut")}),Cubic:Object.freeze({In:s(function(t){return t*t*t},"In"),Out:s(function(t){return--t*t*t+1},"Out"),InOut:s(function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},"InOut")}),Quartic:Object.freeze({In:s(function(t){return t*t*t*t},"In"),Out:s(function(t){return 1- --t*t*t*t},"Out"),InOut:s(function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},"InOut")}),Quintic:Object.freeze({In:s(function(t){return t*t*t*t*t},"In"),Out:s(function(t){return--t*t*t*t*t+1},"Out"),InOut:s(function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},"InOut")}),Sinusoidal:Object.freeze({In:s(function(t){return 1-Math.sin((1-t)*Math.PI/2)},"In"),Out:s(function(t){return Math.sin(t*Math.PI/2)},"Out"),InOut:s(function(t){return .5*(1-Math.sin(Math.PI*(.5-t)))},"InOut")}),Exponential:Object.freeze({In:s(function(t){return t===0?0:Math.pow(1024,t-1)},"In"),Out:s(function(t){return t===1?1:1-Math.pow(2,-10*t)},"Out"),InOut:s(function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)},"InOut")}),Circular:Object.freeze({In:s(function(t){return 1-Math.sqrt(1-t*t)},"In"),Out:s(function(t){return Math.sqrt(1- --t*t)},"Out"),InOut:s(function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},"InOut")}),Elastic:Object.freeze({In:s(function(t){return t===0?0:t===1?1:-Math.pow(2,10*(t-1))*Math.sin((t-1.1)*5*Math.PI)},"In"),Out:s(function(t){return t===0?0:t===1?1:Math.pow(2,-10*t)*Math.sin((t-.1)*5*Math.PI)+1},"Out"),InOut:s(function(t){return t===0?0:t===1?1:(t*=2,t<1?-.5*Math.pow(2,10*(t-1))*Math.sin((t-1.1)*5*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin((t-1.1)*5*Math.PI)+1)},"InOut")}),Back:Object.freeze({In:s(function(t){var e=1.70158;return t===1?1:t*t*((e+1)*t-e)},"In"),Out:s(function(t){var e=1.70158;return t===0?0:--t*t*((e+1)*t+e)+1},"Out"),InOut:s(function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)},"InOut")}),Bounce:Object.freeze({In:s(function(t){return 1-x.Bounce.Out(1-t)},"In"),Out:s(function(t){return t<.36363636363636365?7.5625*t*t:t<.7272727272727273?7.5625*(t-=.5454545454545454)*t+.75:t<.9090909090909091?7.5625*(t-=.8181818181818182)*t+.9375:7.5625*(t-=.9545454545454546)*t+.984375},"Out"),InOut:s(function(t){return t<.5?x.Bounce.In(t*2)*.5:x.Bounce.Out(t*2-1)*.5+.5},"InOut")}),generatePow:s(function(t){return t===void 0&&(t=4),t=t<Number.EPSILON?Number.EPSILON:t,t=t>1e4?1e4:t,{In:s(function(e){return Math.pow(e,t)},"In"),Out:s(function(e){return 1-Math.pow(1-e,t)},"Out"),InOut:s(function(e){return e<.5?Math.pow(e*2,t)/2:(1-Math.pow(2-e*2,t))/2+.5},"InOut")}},"generatePow")}),Z=s(function(){return performance.now()},"now"),nt=function(){function t(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return s(t,"Group"),t.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(i){return e._tweens[i]})},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(){for(var e,i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];for(var a=0,u=i;a<u.length;a++){var o=u[a];(e=o._group)===null||e===void 0||e.remove(o),o._group=this,this._tweens[o.getId()]=o,this._tweensAddedDuringUpdate[o.getId()]=o}},t.prototype.remove=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var r=0,a=e;r<a.length;r++){var u=a[r];u._group=void 0,delete this._tweens[u.getId()],delete this._tweensAddedDuringUpdate[u.getId()]}},t.prototype.allStopped=function(){return this.getAll().every(function(e){return!e.isPlaying()})},t.prototype.update=function(e,i){e===void 0&&(e=Z()),i===void 0&&(i=!0);var r=Object.keys(this._tweens);if(r.length!==0)for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var a=0;a<r.length;a++){var u=this._tweens[r[a]],o=!i;u&&u.update(e,o)===!1&&!i&&this.remove(u)}r=Object.keys(this._tweensAddedDuringUpdate)}},t}(),N={Linear:s(function(t,e){var i=t.length-1,r=i*e,a=Math.floor(r),u=N.Utils.Linear;return e<0?u(t[0],t[1],r):e>1?u(t[i],t[i-1],i-r):u(t[a],t[a+1>i?i:a+1],r-a)},"Linear"),Bezier:s(function(t,e){for(var i=0,r=t.length-1,a=Math.pow,u=N.Utils.Bernstein,o=0;o<=r;o++)i+=a(1-e,r-o)*a(e,o)*t[o]*u(r,o);return i},"Bezier"),CatmullRom:s(function(t,e){var i=t.length-1,r=i*e,a=Math.floor(r),u=N.Utils.CatmullRom;return t[0]===t[i]?(e<0&&(a=Math.floor(r=i*(1+e))),u(t[(a-1+i)%i],t[a],t[(a+1)%i],t[(a+2)%i],r-a)):e<0?t[0]-(u(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[i]-(u(t[i],t[i],t[i-1],t[i-1],r-i)-t[i]):u(t[a?a-1:0],t[a],t[i<a+1?i:a+1],t[i<a+2?i:a+2],r-a)},"CatmullRom"),Utils:{Linear:s(function(t,e,i){return(e-t)*i+t},"Linear"),Bernstein:s(function(t,e){var i=N.Utils.Factorial;return i(t)/i(e)/i(t-e)},"Bernstein"),Factorial:function(){var t=[1];return function(e){var i=1;if(t[e])return t[e];for(var r=e;r>1;r--)i*=r;return t[e]=i,i}}(),CatmullRom:s(function(t,e,i,r,a){var u=(i-t)*.5,o=(r-e)*.5,h=a*a,l=a*h;return(2*e-2*i+u+o)*l+(-3*e+3*i-2*u-o)*h+u*a+e},"CatmullRom")}},ft=function(){function t(){}return s(t,"Sequence"),t.nextId=function(){return t._nextId++},t._nextId=0,t}(),rt=new nt,dt=function(){function t(e,i){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=x.Linear.None,this._interpolationFunction=N.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=ft.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,typeof i=="object"?(this._group=i,i.add(this)):i===!0&&(this._group=rt,rt.add(this))}return s(t,"Tween"),t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.getDuration=function(){return this._duration},t.prototype.to=function(e,i){if(i===void 0&&(i=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=i<0?0:i,this},t.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},t.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},t.prototype.start=function(e,i){if(e===void 0&&(e=Z()),i===void 0&&(i=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var r in this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||i){if(this._propertiesAreSetUp=!0,!this._isDynamic){var a={};for(var u in this._valuesEnd)a[u]=this._valuesEnd[u];this._valuesEnd=a}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,i)}return this},t.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},t.prototype._setupProperties=function(e,i,r,a,u){for(var o in r){var h=e[o],l=Array.isArray(h),g=l?"array":typeof h,v=!l&&Array.isArray(r[o]);if(!(g==="undefined"||g==="function")){if(v){var m=r[o];if(m.length===0)continue;for(var B=[h],w=0,q=m.length;w<q;w+=1){var z=this._handleRelativeValue(h,m[w]);if(isNaN(z)){v=!1,console.warn("Found invalid interpolation list. Skipping.");break}B.push(z)}v&&(r[o]=B)}if((g==="object"||l)&&h&&!v){i[o]=l?[]:{};var U=h;for(var T in U)i[o][T]=U[T];a[o]=l?[]:{};var m=r[o];if(!this._isDynamic){var at={};for(var T in m)at[T]=m[T];r[o]=m=at}this._setupProperties(U,i[o],m,a[o],u)}else(typeof i[o]>"u"||u)&&(i[o]=h),l||(i[o]*=1),v?a[o]=r[o].slice().reverse():a[o]=i[o]||0}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},t.prototype.pause=function(e){return e===void 0&&(e=Z()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this)},t.prototype.resume=function(e){return e===void 0&&(e=Z()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this)},t.prototype.stopChainedTweens=function(){for(var e=0,i=this._chainedTweens.length;e<i;e++)this._chainedTweens[e].stop();return this},t.prototype.group=function(e){return e?(e.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},t.prototype.remove=function(){var e;return(e=this._group)===null||e===void 0||e.remove(this),this},t.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},t.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},t.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},t.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},t.prototype.easing=function(e){return e===void 0&&(e=x.Linear.None),this._easingFunction=e,this},t.prototype.interpolation=function(e){return e===void 0&&(e=N.Linear),this._interpolationFunction=e,this},t.prototype.chain=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return this._chainedTweens=e,this},t.prototype.onStart=function(e){return this._onStartCallback=e,this},t.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},t.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},t.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},t.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},t.prototype.onStop=function(e){return this._onStopCallback=e,this},t.prototype.update=function(e,i){var r=this,a;if(e===void 0&&(e=Z()),i===void 0&&(i=t.autoStartOnUpdate),this._isPaused)return!0;var u;if(!this._goToEnd&&!this._isPlaying)if(i)this.start(e,!0);else return!1;if(this._goToEnd=!1,e<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var o=e-this._startTime,h=this._duration+((a=this._repeatDelayTime)!==null&&a!==void 0?a:this._delayTime),l=this._duration+this._repeat*h,g=s(function(){if(r._duration===0||o>l)return 1;var z=Math.trunc(o/h),U=o-z*h,T=Math.min(U/r._duration,1);return T===0&&o===r._duration?1:T},"calculateElapsedPortion"),v=g(),m=this._easingFunction(v);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,m),this._onUpdateCallback&&this._onUpdateCallback(this._object,v),this._duration===0||o>=this._duration)if(this._repeat>0){var B=Math.min(Math.trunc((o-this._duration)/h)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=B);for(u in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[u]=="string"&&(this._valuesStartRepeat[u]=this._valuesStartRepeat[u]+parseFloat(this._valuesEnd[u])),this._yoyo&&this._swapEndStartRepeatValues(u),this._valuesStart[u]=this._valuesStartRepeat[u];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=h*B,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var w=0,q=this._chainedTweens.length;w<q;w++)this._chainedTweens[w].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(e,i,r,a){for(var u in r)if(i[u]!==void 0){var o=i[u]||0,h=r[u],l=Array.isArray(e[u]),g=Array.isArray(h),v=!l&&g;v?e[u]=this._interpolationFunction(h,a):typeof h=="object"&&h?this._updateProperties(e[u],o,h,a):(h=this._handleRelativeValue(o,h),typeof h=="number"&&(e[u]=o+(h-o)*a))}},t.prototype._handleRelativeValue=function(e,i){return typeof i!="string"?i:i.charAt(0)==="+"||i.charAt(0)==="-"?e+parseFloat(i):parseFloat(i)},t.prototype._swapEndStartRepeatValues=function(e){var i=this._valuesStartRepeat[e],r=this._valuesEnd[e];typeof r=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(r):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=i},t.autoStartOnUpdate=!1,t}();var ve=ft.nextId,E=rt,ge=E.getAll.bind(E),ye=E.removeAll.bind(E),me=E.add.bind(E),Ee=E.remove.bind(E),be=E.update.bind(E);var St={indoorZoomThreshold:18,outdoorZoomThreshold:17,setFloorOnFocus:!0,autoFocus:!1,indoorAnimationOptions:{duration:150},outdoorAnimationOptions:{duration:150}},I,c,_,d,F,b,A,L,O,S,P,k,C,K,Y,j,R,V,ot=class ot{constructor(e,i){f(this,C);f(this,I);f(this,c);f(this,_);f(this,d,St);f(this,F);f(this,b,new Map);f(this,A,new Set);f(this,L,new Map);f(this,O,new Map);D(this,"tweenGroup",new nt);f(this,S,!1);f(this,P,[]);f(this,k,[]);D(this,"on",s((e,i)=>{n(this,I).on(e,i)},"on"));D(this,"off",s((e,i)=>{n(this,I).off(e,i)},"off"));f(this,Y,s(e=>{let{facades:i}=e;if(!lt(i,this.focusedFacades)){if(y(this,P,i),n(this,A).clear(),i.length>0)for(let r of i)n(this,A).add(r.id);n(this,d).autoFocus&&this.focus()}},"#handleDynamicFocusChange"));f(this,j,s(e=>{let{floor:i}=e;if(n(this,c).manualFloorVisibility===!0&&i.floorStack.id!==n(this,F))for(let a of i.floorStack.floors)a.id!==i.id&&n(this,c).updateState(a,{visible:!1});n(this,O).set(i.floorStack.id,i.id);let r=i.floorStack.facade;r&&G(this,C,K).call(this,r,"open")},"#handleFloorChange"));f(this,R,s(e=>{let{zoomLevel:i}=e;i>=n(this,d).indoorZoomThreshold&&!n(this,S)?(y(this,S,!0),n(this,d).autoFocus&&this.focus()):i<=n(this,d).outdoorZoomThreshold&&n(this,S)&&(y(this,S,!1),n(this,O).clear(),n(this,d).autoFocus&&this.focus())},"#handleCameraChange"));f(this,V,s(()=>{this.tweenGroup.update()},"#render"));y(this,I,new $),y(this,c,e),y(this,_,Object.values(n(this,c).getMapData())[0]),n(this,c).preloadFloors(n(this,_).getByType("floor-stack").map(r=>r.defaultFloor)),n(this,c).manualFloorVisibility=!0,this.updateState(Q(W({},i),{outdoorFloorStack:(i==null?void 0:i.outdoorFloorStack)||n(this,_).getByType("floor-stack").find(r=>r.type==="Outdoor")||n(this,_).getByType("floor-stack")[0]})),n(this,c).on("pre-render",n(this,V)),n(this,c).on("floor-change-start",n(this,j)),n(this,c).on("facades-in-view-change",n(this,Y)),n(this,c).Camera.updateFacadesInView(),n(this,c).on("camera-change",n(this,R)),n(this,R).call(this,{zoomLevel:n(this,c).Camera.zoomLevel,center:n(this,c).Camera.center,bearing:n(this,c).Camera.bearing,pitch:n(this,c).Camera.pitch})}get focusedFacades(){return[...n(this,P)]}get visibleFloors(){return[...n(this,k)]}get visibleFloorStacks(){return n(this,k).map(e=>e.floorStack)}getState(){return Q(W({},n(this,d)),{outdoorFloorStack:n(this,_).getById("floor-stack",n(this,F))})}updateState(e){if(e.indoorZoomThreshold!=null&&(e.indoorZoomThreshold=et(e.indoorZoomThreshold,n(this,d).outdoorZoomThreshold,n(this,c).Camera.maxZoomLevel,"fadeInAtZoomLevel must be between fadeOutAtZoomLevel (".concat(n(this,d).outdoorZoomThreshold,") and maxZoomLevel (").concat(n(this,c).Camera.maxZoomLevel,")."))),e.outdoorZoomThreshold!=null&&(e.outdoorZoomThreshold=et(e.outdoorZoomThreshold,n(this,c).Camera.minZoomLevel,n(this,d).indoorZoomThreshold,"fadeOutAtZoomLevel must be between minZoomLevel (".concat(n(this,c).Camera.minZoomLevel,") and fadeInAtZoomLevel (").concat(n(this,d).indoorZoomThreshold,")."))),e.outdoorFloorStack!=null){let i=n(this,_).getById("floor-stack",n(this,F));if(i)for(let r of i.floors)n(this,c).updateState(r,{visible:!1});y(this,F,e.outdoorFloorStack.id);for(let r of e.outdoorFloorStack.floors)n(this,c).updateState(r,{visible:!0})}y(this,d,Object.assign({},n(this,d),e))}destroy(){n(this,c).off("facades-in-view-change",n(this,Y)),n(this,c).off("floor-change-start",n(this,j)),n(this,c).off("camera-change",n(this,R)),n(this,c).off("pre-render",n(this,V));for(let e of n(this,_).getByType("facade")){let i=n(this,b).get(e.id);i&&(i.stop(),n(this,b).delete(e.id)),n(this,c).updateState(e,{visible:!0,opacity:1})}for(let e of n(this,_).getByType("floor"))n(this,c).updateState(e,{visible:e.id===n(this,c).currentFloor.id});n(this,c).manualFloorVisibility=!1}focus(e=n(this,d).setFloorOnFocus){var u;n(this,I).publish("focus",{facades:this.focusedFacades});let i=n(this,P).length>0?this.focusedFacades[0].floorStack:void 0,r=n(this,_).getById("floor-stack",n(this,F)),a=n(this,S)?i:r;if(e&&a!==n(this,c).currentFloorStack){let o=a?this.getDefaultFloorForStack(a):void 0;o&&o.id!==n(this,c).currentFloor.id&&n(this,c).setFloor(o,{context:"dynamic-focus"})}y(this,k,[]);for(let o of n(this,_).getByType("facade")){let h=o.floorStack;if(h.id===n(this,c).currentFloorStack.id)continue;let l=this.getDefaultFloorForStack(h),g=(u=n(this,c).getState(o))==null?void 0:u.visible;n(this,S)&&n(this,A).has(o.id)&&g===!0?(this.setCurrentFloorForStack(h,l),n(this,c).updateState(l,{visible:!0}),G(this,C,K).call(this,o,"open"),n(this,k).push(l)):g===!1&&G(this,C,K).call(this,o,"close",()=>{for(let v of h.floors)n(this,c).updateState(v,{visible:!1})})}}setDefaultFloorForStack(e,i){if(i.floorStack.id!==e.id){M.warn("Floor (".concat(i.id,") does not belong to floor stack (").concat(e.id,"). Default floor will not be set."));return}n(this,L).set(e.id,i.id)}resetDefaultFloorForStack(e){n(this,L).delete(e.id)}getDefaultFloorForStack(e){var i;return n(this,_).getById("floor",(i=n(this,L).get(e.id))!=null?i:"")||e.defaultFloor||e.floors[0]}setCurrentFloorForStack(e,i){if(i.floorStack.id!==e.id){M.warn("Floor (".concat(i.id,") does not belong to floor stack (").concat(e.id,"). Current floor will not be set."));return}if(n(this,O).set(e.id,i.id),e.facade){let r=n(this,c).getState(e.facade);if(r&&r.opacity<1)for(let a of e.floors)n(this,c).updateState(a,{visible:a.id===i.id})}}getCurrentFloorForStack(e){var i;return n(this,_).getById("floor",(i=n(this,O).get(e.id))!=null?i:"")||this.getDefaultFloorForStack(e)}};I=new WeakMap,c=new WeakMap,_=new WeakMap,d=new WeakMap,F=new WeakMap,b=new WeakMap,A=new WeakMap,L=new WeakMap,O=new WeakMap,S=new WeakMap,P=new WeakMap,k=new WeakMap,C=new WeakSet,K=s(function(e,i,r){var g;let a=n(this,c).getState(e);if(!a){M.warn("Facade (".concat(e.id,") not found in map view."));return}let u=a.opacity,o=i==="open"?0:1;if(o===u){n(this,c).updateState(e,{visible:o===1,opacity:o}),r==null||r();return}n(this,b).has(e.id)&&((g=n(this,b).get(e.id))==null||g.stop(),n(this,b).delete(e.id));let h=i==="open"?n(this,d).indoorAnimationOptions.duration:n(this,d).outdoorAnimationOptions.duration,l=new dt({opacity:u}).to({opacity:o},h).easing(x.Quadratic.In).onUpdate(({opacity:v})=>{n(this,c).updateState(e,{visible:!0,opacity:v})}).onComplete(()=>{n(this,c).updateState(e,{visible:i==="close"}),r==null||r()}).start();n(this,V).call(this),this.tweenGroup.add(l),n(this,b).set(e.id,l)},"#animate"),Y=new WeakMap,j=new WeakMap,R=new WeakMap,V=new WeakMap,s(ot,"DynamicFocus");var st=ot;export{st as DynamicFocus};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mappedin/dynamic-focus",
|
|
3
|
-
"version": "6.0.1-beta.
|
|
3
|
+
"version": "6.0.1-beta.51",
|
|
4
4
|
"homepage": "https://developer.mappedin.com/",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "lib/esm/index.js",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"volta": {
|
|
31
31
|
"extends": "../../package.json"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "e2b87403478e2cf4c2f0e07a053e2c74d2a125fa"
|
|
34
34
|
}
|