architwin 1.0.9
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/README.md +530 -0
- package/bundle/LICENSE.md +17 -0
- package/bundle/css/core.css +21 -0
- package/bundle/css/late.css +22 -0
- package/bundle/css/showcase.css +406 -0
- package/bundle/css/unsupported_browser.css +1 -0
- package/bundle/cursors/grab.png +0 -0
- package/bundle/cursors/grabbing.png +0 -0
- package/bundle/cursors/rbe-default.png +0 -0
- package/bundle/cursors/rbe-finish-room.png +0 -0
- package/bundle/cursors/rbe-moving.png +0 -0
- package/bundle/cursors/rbe-place-door.png +0 -0
- package/bundle/cursors/rbe-place-node.png +0 -0
- package/bundle/cursors/rbe-place-opening.png +0 -0
- package/bundle/cursors/zoom-in.png +0 -0
- package/bundle/cursors/zoom-out.png +0 -0
- package/bundle/fonts/ibm-plex-sans-100.woff +0 -0
- package/bundle/fonts/ibm-plex-sans-100.woff2 +0 -0
- package/bundle/fonts/ibm-plex-sans-100italic.woff +0 -0
- package/bundle/fonts/ibm-plex-sans-100italic.woff2 +0 -0
- package/bundle/fonts/ibm-plex-sans-200.woff +0 -0
- package/bundle/fonts/ibm-plex-sans-200.woff2 +0 -0
- package/bundle/fonts/ibm-plex-sans-200italic.woff +0 -0
- package/bundle/fonts/ibm-plex-sans-200italic.woff2 +0 -0
- package/bundle/fonts/ibm-plex-sans-300.woff +0 -0
- package/bundle/fonts/ibm-plex-sans-300.woff2 +0 -0
- package/bundle/fonts/ibm-plex-sans-300italic.woff +0 -0
- package/bundle/fonts/ibm-plex-sans-300italic.woff2 +0 -0
- package/bundle/fonts/ibm-plex-sans-500.woff +0 -0
- package/bundle/fonts/ibm-plex-sans-500.woff2 +0 -0
- package/bundle/fonts/ibm-plex-sans-500italic.woff +0 -0
- package/bundle/fonts/ibm-plex-sans-500italic.woff2 +0 -0
- package/bundle/fonts/ibm-plex-sans-600.woff +0 -0
- package/bundle/fonts/ibm-plex-sans-600.woff2 +0 -0
- package/bundle/fonts/ibm-plex-sans-600italic.woff +0 -0
- package/bundle/fonts/ibm-plex-sans-600italic.woff2 +0 -0
- package/bundle/fonts/ibm-plex-sans-700.woff +0 -0
- package/bundle/fonts/ibm-plex-sans-700.woff2 +0 -0
- package/bundle/fonts/ibm-plex-sans-700italic.woff +0 -0
- package/bundle/fonts/ibm-plex-sans-700italic.woff2 +0 -0
- package/bundle/fonts/ibm-plex-sans-italic.woff +0 -0
- package/bundle/fonts/ibm-plex-sans-italic.woff2 +0 -0
- package/bundle/fonts/ibm-plex-sans-regular.woff +0 -0
- package/bundle/fonts/ibm-plex-sans-regular.woff2 +0 -0
- package/bundle/fonts/mp-font.svg +2079 -0
- package/bundle/fonts/mp-font.woff +0 -0
- package/bundle/fonts/mp-font.woff2 +0 -0
- package/bundle/fonts/roboto-100.woff +0 -0
- package/bundle/fonts/roboto-100.woff2 +0 -0
- package/bundle/fonts/roboto-100italic.woff +0 -0
- package/bundle/fonts/roboto-100italic.woff2 +0 -0
- package/bundle/fonts/roboto-300.woff +0 -0
- package/bundle/fonts/roboto-300.woff2 +0 -0
- package/bundle/fonts/roboto-300italic.woff +0 -0
- package/bundle/fonts/roboto-300italic.woff2 +0 -0
- package/bundle/fonts/roboto-500.woff +0 -0
- package/bundle/fonts/roboto-500.woff2 +0 -0
- package/bundle/fonts/roboto-500italic.woff +0 -0
- package/bundle/fonts/roboto-500italic.woff2 +0 -0
- package/bundle/fonts/roboto-700.woff +0 -0
- package/bundle/fonts/roboto-700.woff2 +0 -0
- package/bundle/fonts/roboto-700italic.woff +0 -0
- package/bundle/fonts/roboto-700italic.woff2 +0 -0
- package/bundle/fonts/roboto-900.woff +0 -0
- package/bundle/fonts/roboto-900.woff2 +0 -0
- package/bundle/fonts/roboto-900italic.woff +0 -0
- package/bundle/fonts/roboto-900italic.woff2 +0 -0
- package/bundle/fonts/roboto-italic.woff +0 -0
- package/bundle/fonts/roboto-italic.woff2 +0 -0
- package/bundle/fonts/roboto-regular.woff +0 -0
- package/bundle/fonts/roboto-regular.woff2 +0 -0
- package/bundle/images/360_placement_pin_mask.png +0 -0
- package/bundle/images/Desktop-help-play-button.svg +1 -0
- package/bundle/images/Desktop-help-spacebar.png +0 -0
- package/bundle/images/MP-logo_H_lock-RGB_color-black.svg +24 -0
- package/bundle/images/NoteColor.png +0 -0
- package/bundle/images/chrome.png +0 -0
- package/bundle/images/edge.png +0 -0
- package/bundle/images/escape.png +0 -0
- package/bundle/images/exterior.png +0 -0
- package/bundle/images/exterior_hover.png +0 -0
- package/bundle/images/firefox.png +0 -0
- package/bundle/images/headset-quest-2.png +0 -0
- package/bundle/images/interior.png +0 -0
- package/bundle/images/interior_hover.png +0 -0
- package/bundle/images/login-screen-background.jpg +0 -0
- package/bundle/images/matterport-app-icon.svg +9 -0
- package/bundle/images/matterport-logo-light.svg +1 -0
- package/bundle/images/mattertag-disc-128-free.v1.png +0 -0
- package/bundle/images/mobile-help-play-button.svg +1 -0
- package/bundle/images/nav_help_360.png +0 -0
- package/bundle/images/nav_help_click_inside.png +0 -0
- package/bundle/images/nav_help_gesture_drag.png +0 -0
- package/bundle/images/nav_help_gesture_drag_two_finger.png +0 -0
- package/bundle/images/nav_help_gesture_pinch.png +0 -0
- package/bundle/images/nav_help_gesture_position.png +0 -0
- package/bundle/images/nav_help_gesture_position_two_finger.png +0 -0
- package/bundle/images/nav_help_gesture_tap.png +0 -0
- package/bundle/images/nav_help_inside_key.png +0 -0
- package/bundle/images/nav_help_keyboard_all.png +0 -0
- package/bundle/images/nav_help_keyboard_left_right.png +0 -0
- package/bundle/images/nav_help_keyboard_up_down.png +0 -0
- package/bundle/images/nav_help_mouse_click.png +0 -0
- package/bundle/images/nav_help_mouse_drag_left.png +0 -0
- package/bundle/images/nav_help_mouse_drag_right.png +0 -0
- package/bundle/images/nav_help_mouse_position_left.png +0 -0
- package/bundle/images/nav_help_mouse_position_right.png +0 -0
- package/bundle/images/nav_help_mouse_zoom.png +0 -0
- package/bundle/images/nav_help_tap_inside.png +0 -0
- package/bundle/images/nav_help_zoom_keys.png +0 -0
- package/bundle/images/objectColor.png +0 -0
- package/bundle/images/outlineBasic1024.png +0 -0
- package/bundle/images/outlineBasic2048.png +0 -0
- package/bundle/images/outlineBasic4096.png +0 -0
- package/bundle/images/outlineBasic512.png +0 -0
- package/bundle/images/outlineEnhanced1024.png +0 -0
- package/bundle/images/outlineEnhanced2048.png +0 -0
- package/bundle/images/outlineEnhanced4096.png +0 -0
- package/bundle/images/outlineEnhanced512.png +0 -0
- package/bundle/images/pinAnchor.png +0 -0
- package/bundle/images/pinIconDefault.png +0 -0
- package/bundle/images/safari.png +0 -0
- package/bundle/images/scope.svg +3 -0
- package/bundle/images/selected_sweep_glow.png +0 -0
- package/bundle/images/showcase-password-background.jpg +0 -0
- package/bundle/images/surface_grid_planar_256.png +0 -0
- package/bundle/images/tagColor.png +0 -0
- package/bundle/images/unsupported-browser.jpg +0 -0
- package/bundle/images/uv_grid_opengl.jpg +0 -0
- package/bundle/images/vert_arrows.png +0 -0
- package/bundle/js/136.js +18 -0
- package/bundle/js/136.js.LICENSE.txt +20 -0
- package/bundle/js/143.js +2 -0
- package/bundle/js/143.js.LICENSE.txt +20 -0
- package/bundle/js/145.js +2 -0
- package/bundle/js/145.js.LICENSE.txt +20 -0
- package/bundle/js/189.js +2 -0
- package/bundle/js/189.js.LICENSE.txt +20 -0
- package/bundle/js/217.js +2 -0
- package/bundle/js/217.js.LICENSE.txt +20 -0
- package/bundle/js/313.js +2 -0
- package/bundle/js/313.js.LICENSE.txt +20 -0
- package/bundle/js/316.js +2 -0
- package/bundle/js/316.js.LICENSE.txt +27 -0
- package/bundle/js/321.js +2 -0
- package/bundle/js/321.js.LICENSE.txt +20 -0
- package/bundle/js/324.js +2 -0
- package/bundle/js/324.js.LICENSE.txt +20 -0
- package/bundle/js/325.js +2 -0
- package/bundle/js/325.js.LICENSE.txt +20 -0
- package/bundle/js/330.js +2 -0
- package/bundle/js/330.js.LICENSE.txt +20 -0
- package/bundle/js/335.js +2 -0
- package/bundle/js/335.js.LICENSE.txt +20 -0
- package/bundle/js/376.js +2 -0
- package/bundle/js/376.js.LICENSE.txt +20 -0
- package/bundle/js/422.js +2 -0
- package/bundle/js/422.js.LICENSE.txt +22 -0
- package/bundle/js/493.js +2 -0
- package/bundle/js/493.js.LICENSE.txt +27 -0
- package/bundle/js/512.js +2 -0
- package/bundle/js/512.js.LICENSE.txt +20 -0
- package/bundle/js/519.js +2 -0
- package/bundle/js/519.js.LICENSE.txt +20 -0
- package/bundle/js/521.js +2 -0
- package/bundle/js/521.js.LICENSE.txt +20 -0
- package/bundle/js/525.js +2 -0
- package/bundle/js/525.js.LICENSE.txt +20 -0
- package/bundle/js/607.js +2 -0
- package/bundle/js/607.js.LICENSE.txt +27 -0
- package/bundle/js/644.js +2 -0
- package/bundle/js/644.js.LICENSE.txt +63 -0
- package/bundle/js/648.js +2 -0
- package/bundle/js/648.js.LICENSE.txt +20 -0
- package/bundle/js/66.js +2 -0
- package/bundle/js/66.js.LICENSE.txt +20 -0
- package/bundle/js/662.js +2 -0
- package/bundle/js/662.js.LICENSE.txt +20 -0
- package/bundle/js/668.js +2 -0
- package/bundle/js/668.js.LICENSE.txt +20 -0
- package/bundle/js/718.js +2 -0
- package/bundle/js/718.js.LICENSE.txt +20 -0
- package/bundle/js/764.js +2 -0
- package/bundle/js/764.js.LICENSE.txt +29 -0
- package/bundle/js/833.js +20 -0
- package/bundle/js/833.js.LICENSE.txt +20 -0
- package/bundle/js/858.js +2 -0
- package/bundle/js/858.js.LICENSE.txt +20 -0
- package/bundle/js/916.js +2 -0
- package/bundle/js/916.js.LICENSE.txt +20 -0
- package/bundle/js/924.js +2 -0
- package/bundle/js/924.js.LICENSE.txt +20 -0
- package/bundle/js/932.js +2 -0
- package/bundle/js/932.js.LICENSE.txt +20 -0
- package/bundle/js/948.js +2 -0
- package/bundle/js/948.js.LICENSE.txt +20 -0
- package/bundle/js/958.js +2 -0
- package/bundle/js/958.js.LICENSE.txt +20 -0
- package/bundle/js/JPEGDecoder.worker.worker.js.LICENSE.txt +29 -0
- package/bundle/js/JPEGEncoder.worker.worker.js.LICENSE.txt +29 -0
- package/bundle/js/PNGDecoder.worker.worker.js.LICENSE.txt +20 -0
- package/bundle/js/PNGEncoder.worker.worker.js.LICENSE.txt +20 -0
- package/bundle/js/browser-check.js +2 -0
- package/bundle/js/browser-check.js.LICENSE.txt +18 -0
- package/bundle/js/showcase.js +6 -0
- package/bundle/js/showcase.js.LICENSE.txt +144 -0
- package/bundle/locale/messages/strings_de.json +1 -0
- package/bundle/locale/messages/strings_es.json +1 -0
- package/bundle/locale/messages/strings_fr.json +1 -0
- package/bundle/locale/messages/strings_it.json +1 -0
- package/bundle/locale/messages/strings_ja.json +1 -0
- package/bundle/locale/messages/strings_ko.json +1 -0
- package/bundle/locale/messages/strings_nl.json +1 -0
- package/bundle/locale/messages/strings_pt.json +1 -0
- package/bundle/locale/messages/strings_ru.json +1 -0
- package/bundle/locale/messages/strings_zh-CN.json +1 -0
- package/bundle/locale/messages/strings_zh-TW.json +1 -0
- package/bundle/locale/strings.json +1 -0
- package/bundle/sdk/cursors/grab.png +0 -0
- package/bundle/sdk/cursors/grabbing.png +0 -0
- package/bundle/sdk/cursors/rbe-default.png +0 -0
- package/bundle/sdk/cursors/rbe-finish-room.png +0 -0
- package/bundle/sdk/cursors/rbe-moving.png +0 -0
- package/bundle/sdk/cursors/rbe-place-door.png +0 -0
- package/bundle/sdk/cursors/rbe-place-node.png +0 -0
- package/bundle/sdk/cursors/rbe-place-opening.png +0 -0
- package/bundle/sdk/cursors/zoom-in.png +0 -0
- package/bundle/sdk/cursors/zoom-out.png +0 -0
- package/bundle/sdk/sandbox.html +1 -0
- package/bundle/sdk/sdk-client.js +1 -0
- package/bundle/sdk/sdk-interface.js +1 -0
- package/bundle/sdk.d.ts +5312 -0
- package/bundle/showcase.html +114 -0
- package/bundle/terms/terms-de-DE.html +69 -0
- package/bundle/terms/terms-en-GB.html +62 -0
- package/bundle/terms/terms-en-US.html +62 -0
- package/bundle/terms/terms-es-MX.html +66 -0
- package/bundle/terms/terms-fr-FR.html +65 -0
- package/bundle/terms/terms-it-IT.html +65 -0
- package/bundle/terms/terms-ja-JP.html +64 -0
- package/bundle/terms/terms-ko-KR.html +65 -0
- package/bundle/terms/terms-nl-NL.html +65 -0
- package/bundle/terms/terms-pt-BR.html +75 -0
- package/bundle/terms/terms-ru-RU.html +72 -0
- package/bundle/terms/terms-zh-CN.html +65 -0
- package/bundle/terms/terms-zh-TW.html +84 -0
- package/bundle/vendors/three/0.146.0/libs/basis/README.md +32 -0
- package/bundle/vendors/three/0.146.0/libs/basis/basis_transcoder.js +1 -0
- package/bundle/vendors/three/0.146.0/libs/basis/basis_transcoder.wasm +0 -0
- package/bundle/vendors/three/0.146.0/libs/basis/no-dynamic-execution.patch +11 -0
- package/bundle/vendors/three/0.146.0/libs/draco/README.md +32 -0
- package/bundle/vendors/three/0.146.0/libs/draco/draco_decoder.js +1 -0
- package/bundle/vendors/three/0.146.0/libs/draco/draco_decoder.wasm +0 -0
- package/bundle/vendors/three/0.146.0/libs/draco/draco_encoder.js +1 -0
- package/bundle/vendors/three/0.146.0/libs/draco/draco_wasm_wrapper.js +1 -0
- package/bundle/vendors/three/0.146.0/libs/draco/gltf/draco_decoder.js +1 -0
- package/bundle/vendors/three/0.146.0/libs/draco/gltf/draco_decoder.wasm +0 -0
- package/bundle/vendors/three/0.146.0/libs/draco/gltf/draco_encoder.js +1 -0
- package/bundle/vendors/three/0.146.0/libs/draco/gltf/draco_wasm_wrapper.js +1 -0
- package/bundle/vendors/three/0.146.0/three.cjs +2 -0
- package/bundle/vendors/three/0.146.0/three.cjs.LICENSE.txt +5 -0
- package/bundle/vendors/three/0.146.0/three.js +2 -0
- package/bundle/vendors/three/0.146.0/three.js.LICENSE.txt +5 -0
- package/bundle/vendors/three/0.146.0/three.min.js +2 -0
- package/bundle/vendors/three/0.146.0/three.min.js.LICENSE.txt +5 -0
- package/bundle/vendors/three/0.146.0/three.module.js +2 -0
- package/bundle/vendors/three/0.146.0/three.module.js.LICENSE.txt +5 -0
- package/bundle/version.txt +1 -0
- package/lib/architwin.d.ts +24 -0
- package/lib/architwin.min.js +1 -0
- package/lib/types.d.ts +123 -0
- package/lib/types.js +2 -0
- package/package.json +26 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,t,n,o,a,s,i,r,c,d,h,l,u,p,m,g,w,f,T,I,E,y={d:(e,t)=>{for(var n in t)y.o(t,n)&&!y.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},v={};y.d(v,{w:()=>E,c:()=>Bi}),function(e){let t,n,o;!function(e){e.PHASE_CHANGE="application.phasechange"}(t=e.Event||(e.Event={})),function(e){e.UNINITIALIZED="appphase.uninitialized",e.WAITING="appphase.waiting",e.LOADING="appphase.loading",e.STARTING="appphase.starting",e.PLAYING="appphase.playing",e.ERROR="appphase.error"}(n=e.Phase||(e.Phase={})),function(e){e.UNKNOWN="application.unknown",e.WEBVR="application.webvr",e.SHOWCASE="application.showcase",e.WORKSHOP="application.workshop"}(o=e.Application||(e.Application={}))}(e||(e={})),function(e){let t,n;!function(e){e.MOVE="camera.move"}(t=e.Event||(e.Event={})),function(e){e.FORWARD="FORWARD",e.LEFT="LEFT",e.RIGHT="RIGHT",e.BACK="BACK",e.UP="UP",e.DOWN="DOWN"}(n=e.Direction||(e.Direction={}))}(t||(t={})),function(e){let t;!function(e){e.CHANGE_START="floors.changestart",e.CHANGE_END="floors.changeend"}(t=e.Event||(e.Event={}))}(n||(n={})),function(e){let t;!function(e){e.SUCCESS="astar.status.success",e.NO_PATH="astar.status.no_path",e.TIMEOUT="astar.status.timeout",e.NO_START_VERTEX="astar.status.no_start",e.NO_END_VERTEX="astar.status.no_end"}(t=e.AStarStatus||(e.AStarStatus={}))}(o||(o={})),function(e){let t;!function(e){e.POSITION_UPDATED="label.positionupdated"}(t=e.Event||(e.Event={}))}(a||(a={})),function(e){let t,n;!function(e){e.WINDOW="link.creationpolicy.window",e.REFERRER="link.creationpolicy.referrer",e.MATTERPORT="link.creationpolicy.matterport"}(t=e.CreationPolicy||(e.CreationPolicy={})),function(e){e.DEFAULT="link.openpolicy.deafult",e.NEW_WINDOW="link.openpolicy.newwindow",e.SAME_FRAME="link.openpolicy.sameframe",e.CURRENT_WINDOW="link.openpolicy.current"}(n=e.OpenPolicy||(e.OpenPolicy={}))}(s||(s={})),function(e){let t,n,o,a,s;!function(e){e.INSTANT="transition.instant",e.FLY="transition.fly",e.FADEOUT="transition.fade"}(t=e.Transition||(e.Transition={})),function(e){e.NAVIGATION="tag.link.nav",e.MODEL="tag.link.model",e.EXT_LINK="tag.link.ext"}(n=e.LinkType||(e.LinkType={})),function(e){e.NONE="tag.chunk.none",e.TEXT="tag.chunk.text",e.LINK="tag.chunk.link"}(o=e.DescriptionChunkType||(e.DescriptionChunkType={})),function(e){e.HOVER="tag.hover",e.CLICK="tag.click",e.LINK_OPEN="tag.linkopen"}(a=e.Event||(e.Event={})),function(e){e.NONE="mattertag.media.none",e.PHOTO="mattertag.media.photo",e.VIDEO="mattertag.media.video",e.RICH="mattertag.media.rich"}(s=e.MediaType||(e.MediaType={}))}(i||(i={})),function(e){let t,n,o;!function(e){e.INSIDE="mode.inside",e.OUTSIDE="mode.outside",e.DOLLHOUSE="mode.dollhouse",e.FLOORPLAN="mode.floorplan",e.TRANSITIONING="mode.transitioning"}(t=e.Mode||(e.Mode={})),function(e){e.CHANGE_START="viewmode.changestart",e.CHANGE_END="viewmode.changeend"}(n=e.Event||(e.Event={})),function(e){e.INSTANT="transition.instant",e.FLY="transition.fly",e.FADEOUT="transition.fade"}(o=e.TransitionType||(e.TransitionType={}))}(r||(r={})),function(e){let t;!function(e){e.MODEL_LOADED="model.loaded"}(t=e.Event||(e.Event={}))}(c||(c={})),function(e){let t;!function(e){e.NONE="intersectedobject.none",e.MODEL="intersectedobject.model",e.TAG="intersectedobject.tag",e.SWEEP="intersectedobject.sweep",e.UNKNOWN="intersectedobject.unknown"}(t=e.Colliders||(e.Colliders={}))}(d||(d={})),function(e){let t,n;!function(e){e.CAMERA="sensor.sensortype.camera"}(t=e.SensorType||(e.SensorType={})),function(e){e.SPHERE="sensor.sourcetype.sphere",e.BOX="sensor.sourcetype.box",e.CYLINDER="sensor.sourcetype.cylinder"}(n=e.SourceType||(e.SourceType={}))}(h||(h={})),function(e){let t,n,o,a;!function(e){e.ENTER="sweep.enter",e.EXIT="sweep.exit"}(t=e.Event||(e.Event={})),function(e){e.INSTANT="transition.instant",e.FLY="transition.fly",e.FADEOUT="transition.fade"}(n=e.Transition||(e.Transition={})),function(e){e.ALIGNED="aligned",e.UNALIGNED="unaligned"}(o=e.Alignment||(e.Alignment={})),function(e){e.UNPLACED="unplaced",e.AUTO="auto",e.MANUAL="manual"}(a=e.Placement||(e.Placement={}))}(l||(l={})),function(e){let t;!function(e){e.UNKNOWN="tag.attachment.unknown",e.APPLICATION="tag.attachment.application",e.AUDIO="tag.attachment.audio",e.IMAGE="tag.attachment.image",e.MODEL="tag.attachment.model",e.PDF="tag.attachment.pdf",e.RICH="tag.attachment.rich",e.TEXT="tag.attachment.text",e.VIDEO="tag.attachment.video",e.ZIP="tag.attachment.zip",e.SANDBOX="tag.attachment.sandbox"}(t=e.AttachmentType||(e.AttachmentType={}))}(u||(u={})),function(e){let t,n;!function(e){e.STARTED="tour.started",e.STOPPED="tour.stopped",e.ENDED="tour.ended",e.STEPPED="tour.stepped"}(t=e.Event||(e.Event={})),function(e){e.INACTIVE="tour.inactive",e.ACTIVE="tour.active",e.STOP_SCHEDULED="tour.stopscheduled"}(n=e.PlayState||(e.PlayState={}))}(p||(p={})),function(e){let t,n,o;!function(e){e.OBJ_LOADER="mp.objLoader",e.FBX_LOADER="mp.fbxLoader",e.DAE_LOADER="mp.daeLoader",e.GLTF_LOADER="mp.gltfLoader",e.SCROLLING_TUBE="mp.scrollingTube",e.TRANSFORM_CONTROLS="mp.transformControls",e.LIGHTS_COMPONENT="mp.lights",e.POINT_LIGHT="mp.pointLight",e.DIRECTIONAL_LIGHT="mp.directionalLight",e.AMBIENT_LIGHT="mp.ambientLight",e.CAMERA="mp.camera",e.INPUT="mp.input",e.XR="mp.xr"}(t=e.Component||(e.Component={})),function(e){e.CLICK="INTERACTION.CLICK",e.HOVER="INTERACTION.HOVER",e.DRAG="INTERACTION.DRAG",e.DRAG_BEGIN="INTERACTION.DRAG_BEGIN",e.DRAG_END="INTERACTION.DRAG_END",e.POINTER_MOVE="INTERACTION.POINTER_MOVE",e.POINTER_BUTTON="INTERACTION.POINTER_BUTTON",e.SCROLL="INTERACTION.SCROLL",e.KEY="INTERACTION.KEY",e.LONG_PRESS_START="INTERACTION.LONG_PRESS_START",e.LONG_PRESS_END="INTERACTION.LONG_PRESS_END",e.MULTI_SWIPE="INTERACTION.MULTI_SWIPE",e.MULTI_SWIPE_END="INTERACTION.MULTI_SWIPE_END",e.PINCH="INTERACTION.PINCH",e.PINCH_END="INTERACTION.PINCH_END",e.ROTATE="INTERACTION.ROTATE",e.ROTATE_END="INTERACTION.ROTATE_END"}(n=e.InteractionType||(e.InteractionType={})),function(e){e.INPUT="input",e.OUTPUT="output",e.EVENT="event",e.EMIT="emit"}(o=e.PathType||(e.PathType={}))}(m||(m={})),function(e){e[e.BACKSPACE=8]="BACKSPACE",e[e.TAB=9]="TAB",e[e.RETURN=13]="RETURN",e[e.SHIFT=16]="SHIFT",e[e.CONTROL=17]="CONTROL",e[e.ALT=18]="ALT",e[e.ESCAPE=27]="ESCAPE",e[e.SPACE=32]="SPACE",e[e.HASH=35]="HASH",e[e.LEFTARROW=37]="LEFTARROW",e[e.UPARROW=38]="UPARROW",e[e.RIGHTARROW=39]="RIGHTARROW",e[e.DOWNARROW=40]="DOWNARROW",e[e.DELETE=46]="DELETE",e[e.ZERO=48]="ZERO",e[e.ONE=49]="ONE",e[e.TWO=50]="TWO",e[e.THREE=51]="THREE",e[e.FOUR=52]="FOUR",e[e.FIVE=53]="FIVE",e[e.SIX=54]="SIX",e[e.SEVEN=55]="SEVEN",e[e.EIGHT=56]="EIGHT",e[e.NINE=57]="NINE",e[e.AT=64]="AT",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.SEMICOLON=186]="SEMICOLON",e[e.PLUSEQUALS=187]="PLUSEQUALS",e[e.COMMA=188]="COMMA",e[e.DASHUNDERSCORE=189]="DASHUNDERSCORE",e[e.PERIOD=190]="PERIOD",e[e.OPENBRACKET=219]="OPENBRACKET"}(g||(g={})),function(e){e[e.DOWN=0]="DOWN",e[e.PRESSED=1]="PRESSED",e[e.UP=2]="UP"}(w||(w={})),function(e){e[e.PRIMARY=0]="PRIMARY",e[e.MIDDLE=1]="MIDDLE",e[e.SECONDARY=2]="SECONDARY",e[e.BACK=3]="BACK",e[e.FORWARD=4]="FORWARD",e[e.COUNT=5]="COUNT"}(f||(f={})),function(e){e[e.NONE=0]="NONE",e[e.PRIMARY=1]="PRIMARY",e[e.SECONDARY=4]="SECONDARY",e[e.MIDDLE=2]="MIDDLE",e[e.BACK=8]="BACK",e[e.FORWARD=16]="FORWARD",e[e.ALL=31]="ALL"}(T||(T={}));class A{constructor(e){this.directionMap={[t.Direction.FORWARD]:e.FORWARD.clone(),[t.Direction.LEFT]:e.LEFT.clone(),[t.Direction.RIGHT]:e.RIGHT.clone(),[t.Direction.BACK]:e.BACK.clone(),[t.Direction.UP]:e.UP.clone(),[t.Direction.DOWN]:e.DOWN.clone()}}toVector(e){return this.directionMap[e]}}class C{constructor(e){this.CwfViewmode=e}toSdk(e,t){switch(e){case this.CwfViewmode.Panorama:return t?r.Mode.INSIDE:r.Mode.OUTSIDE;case this.CwfViewmode.Dollhouse:return r.Mode.DOLLHOUSE;case this.CwfViewmode.Floorplan:return r.Mode.FLOORPLAN;case this.CwfViewmode.Transition:return r.Mode.TRANSITIONING;case this.CwfViewmode.Outdoor:return r.Mode.OUTSIDE;default:return r.Mode.INSIDE}}fromSdk(e){switch(e){case r.Mode.INSIDE:case r.Mode.OUTSIDE:return this.CwfViewmode.Panorama;case r.Mode.DOLLHOUSE:return this.CwfViewmode.Dollhouse;case r.Mode.FLOORPLAN:return this.CwfViewmode.Floorplan;case r.Mode.TRANSITIONING:return this.CwfViewmode.Transition}}}class S{constructor(e){this.CommandMode=e}toSdk(e){switch(e){case this.CommandMode.INSIDE:return r.Mode.INSIDE;case this.CommandMode.DOLLHOUSE:return r.Mode.DOLLHOUSE;case this.CommandMode.FLOORPLAN:return r.Mode.FLOORPLAN;case this.CommandMode.TRANSITIONING:return r.Mode.TRANSITIONING;case this.CommandMode.OUTSIDE:return r.Mode.OUTSIDE;default:return r.Mode.INSIDE}}fromSdk(e){switch(e){case r.Mode.INSIDE:return this.CommandMode.INSIDE;case r.Mode.OUTSIDE:return this.CommandMode.OUTSIDE;case r.Mode.DOLLHOUSE:return this.CommandMode.DOLLHOUSE;case r.Mode.FLOORPLAN:return this.CommandMode.FLOORPLAN;case r.Mode.TRANSITIONING:return this.CommandMode.TRANSITIONING}}}!function(e){e.INSTANT="transition.instant",e.FLY="transition.fly",e.FADEOUT="transition.fade",e.MOVEFADE="transition.movefade"}(I||(I={}));class D{constructor(e){this.toSdkTransitionMap={[e.Interpolate]:I.FLY,[e.FadeToBlack]:I.FADEOUT,[e.Instant]:I.INSTANT,[e.MoveToBlack]:I.MOVEFADE},this.fromSdkTransitionMap={[I.FLY]:e.Interpolate,[I.FADEOUT]:e.FadeToBlack,[I.INSTANT]:e.Instant,[I.MOVEFADE]:e.MoveToBlack}}toSdkTransition(e){return this.toSdkTransitionMap[e]}fromSdkTransition(e){return this.fromSdkTransitionMap[e]}}class b{constructor(e){this.THREE=e,this.tempEuler=new e.Euler}quaternionToRotation(e,t){const n=this.tempEuler.setFromQuaternion(e,b.eulerOrder),o=t||{};return o.x=this.THREE.MathUtils.radToDeg(n.x),o.y=this.THREE.MathUtils.radToDeg(n.y),o.z=this.THREE.MathUtils.radToDeg(n.z),o}rotationToQuaternion(e,t){const n=t||new this.THREE.Quaternion;return this.tempEuler.x=this.THREE.MathUtils.degToRad(e.x),this.tempEuler.y=this.THREE.MathUtils.degToRad(e.y),this.tempEuler.z=this.THREE.MathUtils.degToRad(e.z||0),this.tempEuler.order=b.eulerOrder,n.setFromEuler(this.tempEuler)}}b.eulerOrder="YXZ";class O{constructor(e){this.CwfSweepAlignmentType=e}isSweepAligned(e,t){if(!e||!t)return!1;const n=t&&e.getSweep(t);return!!n&&n.alignmentType===this.CwfSweepAlignmentType.ALIGNED}isCurrentSweepAligned(e){return this.isSweepAligned(e,e.currentSweep)}}!function(e){e.LEGACY="legacy",e.API="api"}(E||(E={}));class M{constructor(e){this.sweepData=e}getIdForSweep(e){return e.uuid}getSweepForId(e){return this.sweepData.getSweepByUuid(e)}getIdFromCwfId(e){const t=this.sweepData.getSweep(e);return this.getIdForSweep(t)}}class N{constructor(e){this.sweepData=e}getIdForSweep(e){return e.id}getSweepForId(e){return this.sweepData.getSweep(e)}getIdFromCwfId(e){const t=this.sweepData.getSweep(e);return this.getIdForSweep(t)}}class R{constructor(e){this.floorData=e}getIdForFloor(e){return String(e.index)}getFloorForId(e){return this.floorData.getFloorAtIndex(parseInt(e,10))}getIdFromCwfId(e){const t=this.floorData.getFloor(e);return this.getIdForFloor(t)}}class P{constructor(e){this.floorData=e}getIdForFloor(e){return e.id}getFloorForId(e){return this.floorData.getFloor(e)}getIdFromCwfId(e){const t=this.floorData.getFloor(e);return this.getIdForFloor(t)}}class L{constructor(e,t){this.roomData=e,this.floorData=t}getIdForRoom(e){const t=this.floorData.getFloor(e.floorId);return t?String((t.index<<16)+e.meshSubgroup):""}getRoomForId(e){return this.roomData.getByMeshSubgroup(65535&parseInt(e,10))}getIdFromCwfId(e){const t=this.roomData.get(e);return this.getIdForRoom(t)}}class x{constructor(e){this.roomData=e}getIdForRoom(e){return e.id}getRoomForId(e){return this.roomData.get(e)}getIdFromCwfId(e){const t=this.roomData.get(e);return this.getIdForRoom(t)}}class k{constructor(t){this.toSdkPhaseMap={[t.UNINITIALIZED]:e.Phase.UNINITIALIZED,[t.WAITING]:e.Phase.WAITING,[t.LOADING]:e.Phase.LOADING,[t.STARTING]:e.Phase.STARTING,[t.PLAYING]:e.Phase.PLAYING,[t.ERROR]:e.Phase.ERROR},this.fromSdkPhaseMap={[e.Phase.UNINITIALIZED]:t.UNINITIALIZED,[e.Phase.WAITING]:t.WAITING,[e.Phase.LOADING]:t.LOADING,[e.Phase.STARTING]:t.STARTING,[e.Phase.PLAYING]:t.PLAYING,[e.Phase.ERROR]:t.ERROR}}toSdkAppPhase(e){return this.toSdkPhaseMap[e]}fromSdkAppPhase(e){return this.fromSdkPhaseMap[e]}}class _{constructor(t){this.toSdkApplicationMap={[t.SHOWCASE]:e.Application.SHOWCASE,[t.WORKSHOP]:e.Application.WORKSHOP,[t.WEBVR]:e.Application.WEBVR,[t.UNKNOWN]:e.Application.UNKNOWN},this.fromSdkApplicationMap={[e.Application.SHOWCASE]:t.SHOWCASE,[e.Application.WORKSHOP]:t.WORKSHOP,[e.Application.WEBVR]:t.WEBVR,[e.Application.UNKNOWN]:t.UNKNOWN}}toSdkApplication(e){return this.toSdkApplicationMap[e]}fromSdkApplication(e){return this.fromSdkApplicationMap[e]}}class U{constructor(e,t,n){this.dependencies=e,this.subscriptionFactory=t,this.observers=new Set,this.currentData=n.create(),this.freshDataCache=n.create()}static async create(e,t,n){const o=await e.getDependencies();return new U(o,t,n)}getData(){return this.currentData.data}subscribe(e){return this.addObserver(e),new class{constructor(e){this.sdkObservable=e,this.renew()}renew(){this.sdkObservable.addObserver(e)}cancel(){this.sdkObservable.removeObserver(e)}}(this)}addObserver(e){if(!this.observers.has(e)){class t{constructor(e){this.observable=e}onChanged(){this.observable.onChanged()}}this.observers.add(e),1===this.observers.size&&(this.currentData.update(...this.dependencies),this.changeSubscription=this.subscriptionFactory.create(new t(this),...this.dependencies)),e.dirty=!0}}removeObserver(e){0!==this.observers.size&&(this.observers.delete(e),0===this.observers.size&&this.changeSubscription.cancel())}onChanged(){if(this.freshDataCache.update(...this.dependencies),!this.currentData.equals(this.freshDataCache)){this.currentData.copy(this.freshDataCache);for(const e of this.observers)e.dirty=!0}}}class F{constructor(e,...t){this.ctor=e,this.args=t}create(...e){return new this.ctor(...this.args,...e)}}const V=e=>"propertyObservers"===e||"changeObservers"===e||"isObservable"===e||"childChangeFunctions"===e||"isObservableProxy"===e||"diffRoot"===e||"elementChangedHandlers"===e||"knownKeysMap"===e||"knownKeysList"===e||"isVector2"===e||"isVector3"===e||"isQuaternion"===e||"onPropertyChanged"===e||"removeOnPropertyChanged"===e||"onChanged"===e||"target"===e,G=(e,t=[])=>{if(void 0!==e){if(t.includes(e))return Array.isArray(e)||ArrayBuffer.isView(e)?[]:{};if(e instanceof Date)return new Date(e);if(null===e)return null;if(e.deepCopy)return e.deepCopy();if(e.isQuaternion)return{x:e.x,y:e.y,z:e.z,w:e.w};if("object"==typeof e){const n=Array.isArray(e)||ArrayBuffer.isView(e)?[]:{};for(const o in e){if(V(o))continue;const a=e[o];a instanceof Date?n[o]=new Date(a):"function"!=typeof a&&(t.push(e),n[o]="object"==typeof a?G(a,t):a,t.pop())}return n}return e}},H=(e,t)=>{if(null===e||"object"!=typeof e)return e!==t;if(!t)return!0;for(const n in t)if(!(n in e))return!0;for(const n in e)if(H(e[n],t[n]))return!0;return!1};class z{create(e,t){return t.onChanged((()=>e.onChanged()))}}class B{constructor(t,n){this._data={phase:e.Phase.UNINITIALIZED,phaseTimes:{},application:e.Application.SHOWCASE},this.AppPhase=t.AppPhase,this.appPhaseConverter=n.appPhaseConverter,this.applicationConverter=n.applicationConverter}get data(){return this._data}equals(e){return!H(this,e)}copy(e){this._data.phase=e.data.phase,function(e,t,...n){for(const o of n)e[o]=t[o]}(this.data.phaseTimes,e.data.phaseTimes),this._data.application=e.data.application}update(t){this._data.phase=this.appPhaseConverter.toSdkAppPhase(t.phase),this._data.application=this.applicationConverter.toSdkApplication(t.application),this._data.phaseTimes[e.Phase.WAITING]=t.phaseTimes[this.AppPhase.WAITING],this._data.phaseTimes[e.Phase.LOADING]=t.phaseTimes[this.AppPhase.LOADING],this._data.phaseTimes[e.Phase.PLAYING]=t.phaseTimes[this.AppPhase.PLAYING],this._data.phaseTimes[e.Phase.STARTING]=t.phaseTimes[this.AppPhase.STARTING],this._data.phaseTimes[e.Phase.UNINITIALIZED]=t.phaseTimes[this.AppPhase.UNINITIALIZED],this._data.phaseTimes[e.Phase.ERROR]=t.phaseTimes[this.AppPhase.ERROR]}}class j{}class W extends j{constructor(){super(),this.id="GET_APP_STATE"}}class q extends j{constructor(){super(),this.id="GET_APP_PHASE_TIMES"}}var $,K;!function(e){e[e.LOW=0]="LOW",e[e.MEDIUM=1]="MEDIUM",e[e.HIGH=2]="HIGH",e[e.HIGHEST=3]="HIGHEST"}($||($={})),function(e){e[e.PENDING=0]="PENDING",e[e.SENDING=1]="SENDING",e[e.FAILED=2]="FAILED",e[e.DONE=3]="DONE"}(K||(K={}));const Y=new WeakMap;class X{constructor({retries:e=0,concurrency:t=6}={}){this.totalBytesDownloaded=0,this.queue=[],this.retries=e,this.concurrency=t}get(e,t){return this.request("GET",e,t)}head(e,t){return this.request("HEAD",e,t)}options(e,t){return this.request("OPTIONS",e,t)}post(e,t){return this.request("POST",e,t)}put(e,t){return this.request("PUT",e,t)}patch(e,t){return this.request("PATCH",e,t)}delete(e,t){return this.request("DELETE",e,t)}request(e,t,n){const o=new Z(e,t,n);if(null==n?void 0:n.signal){const e=()=>{this.queue.includes(o)&&(o.status===K.SENDING&&o.abort(),this.dequeue(o),o.onFail(new DOMException("Aborted","AbortError")))};n.signal.addEventListener("abort",e),Y.set(o,(()=>{var t;null===(t=n.signal)||void 0===t||t.removeEventListener("abort",e),Y.delete(o)}))}return this.enqueue(o),o.promise}update(){let e;for(;e=this.getNextPendingRequest();)this.sendRequest(e);for(;e=this.getNextOverflowingGet();)e.abort(),e.status=K.PENDING;this.updateTimeout=null}enqueue(e){let t=0;for(t=0;t<this.queue.length;t++){if(this.queue[t].priority<e.priority)break}this.queue.splice(t,0,e),this.updateTimeout||(this.updateTimeout=window.setTimeout((()=>{this.update()}),1))}dequeue(e){var t;null===(t=Y.get(e))||void 0===t||t();const n=this.queue.indexOf(e);if(-1===n)throw new Error("Can't dequeue request not in queue");this.queue.splice(n,1),this.update()}getNextPendingRequest(){for(let e=0;e<this.queue.length&&e<this.concurrency;e++){const t=this.queue[e];if(t.status===K.PENDING)return t}return null}getNextOverflowingGet(){for(let e=this.concurrency;e<this.queue.length;e++){const t=this.queue[e];if(t.status===K.SENDING&&t.priority!==$.HIGHEST&&"GET"===t.method)return t}return null}shouldRetryStatusCode(e){return!X.doNotRetryStatusCodes[e]}sendRequest(e){e.status=K.SENDING,e.send().then((t=>{e.status=K.DONE,this.dequeue(e),e.contentLength&&e.contentLength>0&&(this.totalBytesDownloaded+=Number(e.contentLength)),e.onDone(t)})).catch((t=>{const n=null!==e.maxRetries?e.maxRetries:this.retries;let o=e.sendAttempts<n;if("object"==typeof t){const e=t.status_code||0;o=o&&this.shouldRetryStatusCode(e)}o?(e.status=K.PENDING,this.update(),console.warn(`Retried ${e.url}`),console.warn(t)):(e.status=K.FAILED,this.dequeue(e),console.warn(`Failed ${e.url}`),e.onFail(t))}))}}X.doNotRetryStatusCodes={400:!0,401:!0,403:!0,404:!0,405:!0,406:!0,410:!0,411:!0,414:!0,415:!0,421:!0,431:!0,451:!0};class Z{constructor(e,t,n={}){this.sendAttempts=0,this.status=K.PENDING,this.contentLength=0,this.isAborting=!1,this.url=t,this.method=e,this.auth=n.auth||null,this.withCredentials=n.withCredentials||!1,this.priority=n.priority||$.MEDIUM,this.responseType=n.responseType||null,this.body=n.body||null,this.headers=n.headers||{},this.maxRetries=n.maxRetries||null,this.onProgress=n.onProgress,this.promise=new Promise(((e,t)=>{this.onDone=e,this.onFail=t}))}send(){const e=this.xhr=function(e,t,n){let o;if("undefined"!=typeof XMLHttpRequest)o=new XMLHttpRequest,o.withCredentials=n;else{if("undefined"==typeof XDomainRequest)throw new Error("No XMLHTTPRequest or XDomainRequest... are you trying to run me in node? :(");o=new XDomainRequest}return o.open(e,t,!0),o}(this.method,this.url,this.withCredentials);if(this.responseType)if("arraybuffer"===this.responseType||"text"===this.responseType||"json"===this.responseType||"blob"===this.responseType)e.responseType=this.responseType;else{if("image"!==this.responseType)throw new Error('reponseType can only be one of "arraybuffer", "text", "json", "blob", "image"');e.responseType="blob"}"json"===this.responseType&&e.setRequestHeader("Accept","application/json"),this.auth&&"string"==typeof this.auth&&e.setRequestHeader("Authorization",this.auth);for(const t in this.headers)e.setRequestHeader(t,this.headers[t]);return this.body&&"object"==typeof this.body&&(this.body instanceof FormData||(this.body=JSON.stringify(this.body),e.setRequestHeader("Content-Type","application/json"))),this.onProgress&&(e.onprogress=this.onProgress),new Promise(((t,n)=>{e.onreadystatechange=()=>{if(4===e.readyState){if(200===e.status||201===e.status||204===e.status)return this.parseResponse(this.xhr).then((e=>{t(e)}));if(!this.isAborting)return this.parseResponse(this.xhr).then((t=>{n(Object.assign({status_code:e.status},t))})).catch((()=>{n({status_code:e.status})}));this.isAborting=!1}},e.onerror=function(e){n(e)},e.send(this.body),this.sendAttempts++}))}parseResponse(e){return new Promise(((t,n)=>{var o;try{if(!e)throw new Error(`No request received. Trying ${this.method} on ${this.url} and expecting ${this.responseType}, but request was ${this.xhr}`);let n=e.response;if(this.contentLength=parseInt(null!==(o=e.getResponseHeader("Content-Length"))&&void 0!==o?o:"0",10),"json"===this.responseType&&"object"!=typeof n)t(JSON.parse(e.responseText));else if(200!==e.status&&201!==e.status&&204!==e.status||"image"!==this.responseType)t(n);else{const e=URL.createObjectURL(n);n=new Image,n.src=e,n.crossOrigin="Anonymous",n.onload=function(){URL.revokeObjectURL(e),t(n)}}}catch(e){n({error:"Payload was not valid JSON"})}}))}abort(){if(null===this.xhr)throw new Error("Cannot abort unsent Request");this.isAborting=!0,this.xhr.abort()}}const Q=window.navigationStart||Date.now();var J;!function(e){e[e.ERROR=0]="ERROR",e[e.WARN=1]="WARN",e[e.INFO=2]="INFO",e[e.DEBUG=3]="DEBUG"}(J||(J={}));class ee{constructor(e){this.timers={},this.handlers={[J.DEBUG]:console.debug,[J.INFO]:console.info,[J.WARN]:console.warn,[J.ERROR]:console.error};const t=e.split(new RegExp("/|\\\\"));this.prefix="["+t[t.length-1].replace(".js","")+"]"}message(e){if(ee.level>=e&&console){return(this.handlers[e]?this.handlers[e]:console.log).bind(console,this.getPrefix())}return()=>{}}get debug(){return this.message(J.DEBUG)}get devInfo(){return()=>{}}get debugInfo(){return this.debug}get debugWarn(){return this.message(ee.level>=J.DEBUG?J.WARN:J.DEBUG)}get info(){return this.message(J.INFO)}get warn(){return this.message(J.WARN)}get error(){return this.message(J.ERROR)}time(e){ee.level>=J.DEBUG&&(this.timers[e]=Date.now())}timeEnd(e){if(ee.level>=J.DEBUG){const t=this.timers[e];if(!t)return;const n=(Date.now()-t)/1e3;this.debug(e,n+"s")}}getPrefix(){const e=(Date.now()-Q)/1e3+"s";return`${this.prefix} ${e}`}}ee.level=J.INFO;const te=new ee("sdk command");class ne{constructor(e){this._executor=e}static async create(e,t){const n=await e.getDependencies();return new ne(t.create(...n))}get executor(){return this._executor}validateInput(e,t){return this.executor.validateInput(e,t)}exec(e,t){const n=this.executor.validateInput(e,t);return this.executor.exec(n,t)}}function oe(e,t,n){return`'${e}' is expected to be a(n) ${t}; got '${JSON.stringify(n)}'`}function ae(e,t,n){return e.validateInput(t,n)}function se(e,t,n){return e.exec(t,n)}async function ie(e,t){return new class{constructor(e){this.command=e}validateInput(e,t){return ae(this.command,e,t)}exec(e,n){return te.warn(t),this.command.exec(e,n)}}(await e)}function re(e){return!!e&&"string"==typeof e}function ce(e){return"string"==typeof e}class de{constructor(){this.base=new Promise(((e,t)=>{this.resolver=e,this.rejecter=t})),this._promise=new he(this.base,this),this.progressCallbacks=[]}then(e,t){return this.base.then(e,t)}catch(e){return this.base.catch(e)}resolve(e){return this.resolver(e),this}reject(e){return this.rejecter(e),this}notify(e){for(const t of this.progressCallbacks)t(e)}progress(e){return this.progressCallbacks.push(e),this}promise(){return this._promise}nativePromise(){return this.base}static resolve(){const e=new de;return e.resolve(),e.promise()}static reject(e){const t=new de;return t.reject(e),t.promise()}static all(e){const t=[];for(const n of e)n.nativePromise?t.push(n.nativePromise()):t.push(n);const n=new de;return Promise.all(t).then((e=>n.resolve(e)),(e=>n.reject(e))),n.promise()}}class he{constructor(e,t){this.basePromise=e,this.baseDeferred=t}then(e,t){return this.baseDeferred.then(e,t),this}catch(e){return this.baseDeferred.catch(e),this}progress(e){return this.baseDeferred.progress(e),this}nativePromise(){return this.basePromise}}const le=new ee("asset.registerTexture");class ue{constructor(e,t,n){this.THREE=e,this.loadImage=t,this.scopedTextures=n,this.svgLoader=new pe(new X)}validateInput(e,t){const{textureId:n,textureSrc:o}=e;if(!re(n))throw Error(`textureId ${n} is not a valid string`);if(!re(o))throw Error(`textureSrc ${o} is not a valid string`);const a=this.scopedTextures.get(t.applicationKey);if(a){if(a.map[n])throw Error(n+" already has a registered texture")}return{textureId:n,textureSrc:o}}async exec(e,t){const{textureId:n,textureSrc:o}=e,a=this.scopedTextures.get(t.applicationKey)||{imagePromise:{},map:{}};this.scopedTextures.set(t.applicationKey,a);const[s,i]=o.endsWith(".svg")?this.loadSvgTexture(o):this.loadImageTexture(o);a.imagePromise[n]=i;try{const e=await i;s.image=e,s.needsUpdate=!0,a.map[n]=s}catch(t){throw delete a.imagePromise[n],Error(`Failed to load ${e.textureSrc}`)}}loadImageTexture(e){const t=new de,n=this.loadImage(e,(()=>t.resolve(n.image)),(e=>t.reject(e)));return[n,t.nativePromise()]}loadSvgTexture(e){return[new this.THREE.Texture,this.svgLoader.load(e)]}}class pe{constructor(e){this.queue=e}async load(e){const t=await this.queue.get(e,{responseType:"text"}),n=document.createElement("div");n.innerHTML=t;const o=n.querySelector("svg");if(!o)throw Error("Failed trying to load "+e+"as an svg.");const a=o.getAttribute("width"),s=o.getAttribute("height");return a||s?(s&&!a&&(le.warn(e,"does not have a defined width. Defaulting width equal to height"),o.setAttribute("width",s)),a&&!s&&(le.warn(e,"does not have a defined height. Defaulting height equal to width"),o.setAttribute("height",a))):(le.warn(e,"does not have a defined size. Defaulting to a 128x128 resolution"),o.setAttribute("width",pe.defaultResolution),o.setAttribute("height",pe.defaultResolution)),new Promise((e=>{const t=new Image;t.onload=()=>e(t),t.src=URL.createObjectURL(new Blob([o.outerHTML],{type:"image/svg+xml"}))}))}}pe.defaultResolution="128";class me{constructor(...e){this.dependencies=e}async getDependencies(){return Promise.all(this.dependencies)}static extend(e,...t){return new me(...e.dependencies,...t)}static combine(e,t){return new me(...e.dependencies,...t.dependencies)}}(()=>{const e={}})();const ge=["dev-app.matterport.com","dev-app.matterportvr.cn","qa3-app.matterport.com","qa3-app.matterportvr.cn","my.matterport.com","my.matterportvr.cn","static.matterport.com","static.matterportvr.cn","matterport.github.io","localhost"];class we{constructor(e,t,n){this.apiPromise=e,this.floorData=t,this.modelData=n}validateInput(){return{}}async exec(e,t){const n=await this.apiPromise,o=`${n.getApi().baseUrl}${`/api/player/models/${this.modelData.model.sid}/files?type=3`}`,a=await n.getApi().get(o).then((e=>JSON.parse(e))).catch((e=>this.throw(e))),s=e=>a.templates[0].replace("{{filename}}",e),i=this.floorData.getFloorCount(),r=n.getApi().get(s("render/vr_colorplan.json")).then((e=>JSON.parse(e))),c=new Array(i).fill(void 0).map(((e,t)=>fetch(s(`render/vr_colorplan_${t.toString().padStart(3,"0")}.png`)).then((e=>e.arrayBuffer())))),[d,...h]=await Promise.all([r,...c]).catch((e=>this.throw(e)));return{imageDataUrls:h.map((e=>(e=>{const t=[];for(let n=0;n<e.length;n+=8192)t.push(String.fromCharCode.apply(null,e.subarray(n,n+8192)));return btoa(t.join(""))})(new Uint8Array(e)))),data:{height:d.height,imageOriginX:d.image_origin_x,imageOriginY:d.image_origin_y,resolutionPpm:d.resolution_ppm,width:d.width}}}throw(e){throw Error("Asset.getVrColorplans: "+e)}}function fe(e,t,n,o,a,s){const{floorData:i,modelData:r}=s;return{getVrColorplans:function(e,t,n){const o=ne.create(n,new F(we,t));return e.addAsyncCommandToInterface({namespace:"Asset",name:"getVrColorplans",args:[],origins:ge},o),o}(e,a,new me(i,r)),registerTexture:function(e,t,n,o){const a=ne.create(o,new F(ue,t,n.loadImage));return e.addAsyncCommandToInterface({namespace:"Asset",name:"registerTexture",args:["textureId","textureSrc"]},a),a}(e,t,n,new me(o))}}class Te extends j{constructor(){super(),this.id="GET_POSE"}}const Ie=40*Math.PI/180/1e3;class Ee extends j{constructor(e){super(),this.payload=e}}const ye=new ee("broadcast.move");function ve(e,t){return Object.values(e).includes(t)}class Ae extends j{constructor(e){super(),this.id="MOVE_DIRECTION",this.payload=e}}class Ce extends j{constructor(e){super(),this.id="PAN",this.payload={x:e.x,z:e.z}}}class Se{constructor(...e){this.subs=e}renew(){for(const e of this.subs)e.renew()}cancel(){for(const e of this.subs)e.cancel()}}function De(e,t){e.x=t.x,e.y=t.y}function be(e,t){De(e,t),e.z=t.z}class Oe extends Error{constructor(e,t){var n;super(e instanceof Error?e.message:e),this.name="BaseException",t&&(this.code=t),e instanceof Error&&(this.originalError=e,(n=e)&&n instanceof Error&&n.isMock&&(this.isMock=!0))}}function Me(e,t){const n=t.length;e.length=n;for(let o=0;o<n;++o)e[o]=t[o];return e}class Ne extends Oe{constructor(){super("Cannot copy into an array of a different size"),this.name="ArraySizeMismatch"}}const Re=(e,t,n=1e-5)=>Math.abs(e-t)<=n,Pe=(e,t,n=1e-5)=>Re(e.x,t.x,n)&&Re(e.y,t.y,n),Le=(e,t,n=1e-5)=>Pe(e,t,n)&&Re(e.z,t.z,n);class xe{create(e,t,n,o){const a=()=>e.onChanged();return new Se(t.onChanged(a),n.onChanged(a),o.onChanged(a))}}class ke{constructor(e,t){this._data={position:{x:0,y:0,z:0},rotation:{x:0,y:0},projection:new Float32Array(16),sweep:"",mode:r.Mode.TRANSITIONING},this.THREE=e,this.viewmodeConverter=t,this.tempEuler=new e.Euler}get data(){return this._data}equals(e){const t=1e-5;return Le(e._data.position,this._data.position,t)&&Pe(e._data.rotation,this._data.rotation,t)&&((e,t,n=1e-5)=>e.length===t.length&&!Array.prototype.some.call(e,((e,o)=>!Re(e,t[o],n))))(e._data.projection,this._data.projection,t)&&e._data.sweep===this._data.sweep&&e._data.mode===this._data.mode}update(e,t,n,o){const a=this.tempEuler.setFromQuaternion(e.pose.rotation,"YXZ"),s=t.currentSweep&&t.isSweepUnaligned(t.currentSweep);be(this._data.position,e.pose.position),this._data.rotation.x=this.THREE.MathUtils.radToDeg(a.x),this._data.rotation.y=this.THREE.MathUtils.radToDeg(a.y),this._data.projection=Float32Array.from(e.pose.projection.asThreeMatrix4().transpose().elements),this._data.sweep=t.currentSweepObject?o.getIdForSweep(t.currentSweepObject):"",this._data.mode=this.viewmodeConverter.toSdk(n.currentMode,!s)}copy(e){be(this._data.position,e.data.position),De(this._data.rotation,e.data.rotation),function(e,t){if(e.byteLength!==t.byteLength)throw new Ne;const n=t.length;for(let o=0;o<n;++o)e[o]=t[o]}(this._data.projection,e.data.projection),this._data.sweep=e.data.sweep,this._data.mode=e.data.mode}}class _e extends j{constructor(e){super(),this.id="ROTATE",this.payload={xAngle:e.xAngle,yAngle:e.yAngle,zAngle:e.zAngle,rotationSpeed:e.rotationSpeed}}}function Ue(e,t,n){const o=new e.Euler,a=new e.Euler;return async function(e,s,i,r){if(i.currentMode!==t.Panorama)throw Error("Camera.setRotation is only available in Panorama mode");const c=r.xAngle%(.5*Math.PI),d=r.yAngle%(2*Math.PI),h=e.pose.rotation;o.setFromQuaternion(h,"YXZ");let l=d-o.y;return Math.abs(l)>Math.PI&&(l-=2*Math.sign(l)*Math.PI),a.set(c-o.x,l,0,"YXZ"),a.y%=2*Math.PI,n(s,{xAngle:-a.y,yAngle:a.x,zAngle:0,rotationSpeed:r.rotationSpeed})}}class Fe extends _e{}const Ve=.7,Ge=3,He=function(e,t,n){return Math.max(t,Math.min(e,n))};const ze=new ee("command.zoom");class Be{constructor(e,t,n,o){this.cameraData=n,this.viewmodeData=o,this.Viewmode=e.Viewmode,this.ZoomSetCommand=e.ZoomSetCommand,this.issueCommand=t.issueCommand}validateInput(e){const t=e.zoomPct-0;if(isNaN(t))throw Error(t+" is not a valid zoom level");return t<Ve&&Ge<t&&(e.zoomPct=He(t,Ve,Ge),ze.warn(t,`is outside the valid zoom range of [${Ve}, ${Ge}]`)),e}async exec(e,t){return qe(this.Viewmode,this.viewmodeData.currentMode),await this.issueCommand(new this.ZoomSetCommand(e.zoomPct)),this.cameraData.zoom()}}class je{constructor(e,t,n,o){this.cameraData=n,this.viewmodeData=o,this.Viewmode=e.Viewmode,this.ZoomInCommand=e.ZoomInCommand,this.issueCommand=t.issueCommand}validateInput(e){const t=e.zoomDelta-0;if(isNaN(t))throw Error(t+" is not a valid zoom delta");return e.zoomDelta=t||0,e}async exec(e,t){return qe(this.Viewmode,this.viewmodeData.currentMode),await this.issueCommand(new this.ZoomInCommand(e.zoomDelta)),this.cameraData.zoom()}}class We{constructor(e,t,n,o){this.viewmodeData=o,this.Viewmode=e.Viewmode,this.ZoomResetCommand=e.ZoomResetCommand,this.issueCommand=t.issueCommand}validateInput(e){return e}async exec(e,t){qe(this.Viewmode,this.viewmodeData.currentMode),await this.issueCommand(new this.ZoomResetCommand)}}function qe(e,t){if(t!==e.Panorama)throw Error("Zoom controls are currently only supported in Panorama mode")}class $e{create(e,t){return t.onChanged((()=>e.onChanged()))}}class Ke{constructor(e){this._data={level:1}}get data(){return this._data}equals(e){return this._data.level===e.data.level}copy(e){this._data.level=e.data.level}update(e,t){t.isInside()&&(this._data.level=e.zoom())}}function Ye(e,t){const n=new e.Euler;return function(o,a,s,i,r){const c=n.setFromQuaternion(a.pose.rotation,"YXZ"),d=s.currentSweep&&s.isSweepUnaligned(s.currentSweep);return o.position.x=a.pose.position.x,o.position.y=a.pose.position.y,o.position.z=a.pose.position.z,o.rotation.x=e.MathUtils.radToDeg(c.x),o.rotation.y=e.MathUtils.radToDeg(c.y),o.projection=Float32Array.from(a.pose.projection.asThreeMatrix4().transpose().elements),o.sweep=s.currentSweepObject?r.getIdForSweep(s.currentSweepObject):"",o.mode=t.toSdk(i.currentMode,!d),o}}class Xe{constructor(){this.wasInTransition=!1,this.currentFloor=""}create(e,t,n,o){return new Se(t.makeFloorChangeSubscription((()=>this.throttleCurrentFloorChanges(e,t))),o.onChanged((()=>this.throttleCameraTranstionChanges(e,o,n))),n.onChanged((()=>this.throttleCameraTranstionChanges(e,o,n))))}throttleCameraTranstionChanges(e,t,n){const o=t.transition.active||n.transition.active;o!==this.wasInTransition&&(this.wasInTransition=o,e.onChanged())}throttleCurrentFloorChanges(e,t){const n=t.currentFloorId;n!==this.currentFloor&&(this.currentFloor=n,e.onChanged())}}class Ze{constructor(e){this._data={id:void 0,sequence:void 0,name:""},this.SweepAlignmentType=e.SweepAlignmentType,this.SweepPlacementType=e.SweepPlacementType}get data(){return this._data}equals(e){const t=this.data,n=e.data;return t.id===n.id&&t.sequence===n.sequence&&t.name===n.name}copy(e){this._data.id=e.data.id,this._data.sequence=e.data.sequence,this._data.name=e.data.name}update(e,t,n,o){const a=e.currentFloor,s=t.currentSweep&&t.getSweep(t.currentSweep);n.transition.active&&!t.transitionActive||function(){if(t.transitionActive&&t.transition.to&&t.transition.from){const e=t.getSweep(t.transition.to),n=t.getSweep(t.transition.from);return e.floorId!==n.floorId}return!1}()?(this._data.id="",this._data.sequence=void 0,this._data.name=""):s&&s.alignmentType===this.SweepAlignmentType.UNALIGNED&&s.placementType===this.SweepPlacementType.UNPLACED?(this._data.id=void 0,this._data.sequence=void 0,this._data.name=""):a?(this._data.id=o.getIdFromCwfId(a.id),this._data.sequence=a.index,this._data.name=a.name):(this._data.id="",this._data.sequence=-1,this._data.name="all")}}class Qe{constructor(e,t,n){this.dependencies=e,this.subscriptionFactory=t,this.dataFactory=n,this.dirty=!0,this.observers=new Set,this.currentData=n.create(...e);this.changeSubscription=this.subscriptionFactory.create(new class{constructor(e){this.collection=e}onChanged(){this.collection.dirty=!0;for(const e of this.collection.observers)e.onChanged()}}(this),...this.dependencies),this.changeSubscription.cancel()}static async create(e,t,n){const o=await e.getDependencies();return new Qe(o,t,n)}getData(){return this.currentData.data}subscribe(e){const t=this.dependencies;const n=new class{constructor(e){this.sdkCollection=e,this.needsUpdate=!0,this.diffRecord={added:new Map,removed:new Map,updated:new Map},this.dataView=e.dataFactory.create(...t)}get dirty(){return this.needsUpdate}readDiff(){const{added:e,removed:t,updated:n}=this.diffRecord;if(e.clear(),t.clear(),n.clear(),!this.dirty)return this.diffRecord;this.sdkCollection.update();const o=this.sdkCollection.currentData;for(const t in o.data)this.dataView.data.hasOwnProperty(t)?this.dataView.isItemEqual(o,t)||n.set(t,o.data[t]):e.set(t,o.data[t]);for(const e in this.dataView.data)o.data.hasOwnProperty(e)||t.set(e,this.dataView.data[e]);return this.dataView.update(),this.needsUpdate=!1,this.diffRecord}onChanged(){this.needsUpdate=!0}renew(){this.sdkCollection.addObserver(this)}cancel(){this.sdkCollection.removeObserver(this)}}(this);return this.addObserver(n),n}update(){this.dirty&&(this.currentData.update(),this.dirty=!1)}addObserver(e){0===this.observers.size&&(this.changeSubscription.renew(),this.dirty=!0),this.observers.add(e)}removeObserver(e){this.observers.delete(e),0===this.observers.size&&(this.changeSubscription.cancel(),this.currentData.clear())}}class Je{create(e,t){return t.onChanged((()=>e.onChanged()))}}class et{constructor(e,t){this.floorData=e,this.floorIdMap=t,this._data={}}get data(){return this._data}isItemEqual(e,t){const n=this.data[t],o=e.data[t];return n.id===o.id&&n.name===o.name&&n.sequence===o.sequence}update(){for(const e of this.floorData.getCollection()){const t=this.floorIdMap.getIdFromCwfId(e.id),n=this._data[t]||{};n.id=t,n.sequence=e.index,n.name=e.name,this._data[t]=n}for(const e in this.data){this.floorIdMap.getFloorForId(e)||delete this._data[e]}}clear(){this._data={}}}class tt extends j{constructor(){super(...arguments),this.id="GET_FLOORS_DATA"}}async function nt(e){try{const{currentFloor:t,totalFloors:n}=e,o=e.getFloorNames();return{currentFloor:t?t.index:-1,floorNames:o,totalFloors:n}}catch(e){throw Error("no floors currently loaded")}}class ot extends j{constructor(e){super(),this.id="MOVE_TO_FLOOR",this.payload=e}}class at{constructor(e,t,n){this.floorsViewData=n,this.issueCommand=t.issueCommand,this.ShowAllFloorsCommand=e.ShowAllFloorsCommand}validateInput(e){return e}async exec(e,t){try{await this.issueCommand(new this.ShowAllFloorsCommand({moveCamera:!0}));const e=this.floorsViewData.currentFloor;return e?e.index:-1}catch(e){throw Error("Could not show all floors")}}}class st extends j{constructor(){super(...arguments),this.id="LABEL_GET"}}function it(e,t){return function(n,o,a,s){const i=a.getCollection(),r=[],c=new e.Vector2;for(const a of i){t(n,a.position,c);const{id:i,index:d}=o.getFloor(a.floorId),h=s.getIdFromCwfId(i),l=G(a);r.push(Object.assign(Object.assign({},l),{position:(new e.Vector3).copy(a.position),screenPosition:c,floor:d,floorInfo:{id:h,sequence:d}}))}return r}}class rt{create(e,t){return t.onChanged((()=>e.onChanged()))}}class ct{constructor(e,t,n){this.labelData=e,this.floorsData=t,this.floorIdMap=n,this._data={}}get data(){return this._data}isItemEqual(e,t){return!H(this.data[t],e.data[t])}update(){var e;for(const t of this.labelData.getCollection()){const n=null!==(e=this.data[t.sid])&&void 0!==e?e:{};n.position=t.position,n.sid=t.sid,n.text=t.text,n.visible=t.visible;const o=this.floorsData.getFloor(t.floorId);n.floorInfo={id:this.floorIdMap.getIdFromCwfId(o.id),sequence:o.index},this.data[n.sid]=n}for(const e in this.data){this.labelData.getLabel(e)||delete this.data[e]}}clear(){this._data={}}}class dt{constructor(e){this.deepLinker=e}validateInput(e){return e}async exec(e,t){const n=this.deepLinker.creator.createLink();return decodeURIComponent(n.href)}}class ht{constructor(e){this.deepLinker=e}validateInput(e){return e}async exec(e,t){const n=this.deepLinker.creator.createDeepLink();return decodeURIComponent(n.href)}}function lt(e){return!!e&&"object"==typeof e}function ut(e){return"boolean"==typeof e}function pt(e,t,n,o){switch(e){case s.OpenPolicy.DEFAULT:n.handler.resetPolicy(t);break;case s.OpenPolicy.NEW_WINDOW:n.handler.setPolicy(t,n.handler.HandlingPolicy.NEW_WINDOW);break;case s.OpenPolicy.SAME_FRAME:n.handler.setPolicy(t,n.handler.HandlingPolicy.IN_FRAME);break;case s.OpenPolicy.CURRENT_WINDOW:n.handler.setPolicy(t,n.handler.HandlingPolicy.CUSTOM,(e=>{o.sendPrivateMessage("open link",{href:e})}))}}class mt{constructor(e,t){this.sdk=e,this.deepLinker=t}validateInput(e){if(!ve(s.OpenPolicy,e.policy))throw Error(`Link.setModelLinkPolicy: ${e.policy} is not a valid Link.OpenPolicy`);if(!re(e.baseHref))throw Error("Link.setModelLinkPolicy: could not determine window.location");const t=lt(e.options)?e.options.templateHref:void 0;if(void 0!==t&&!re(t)||re(t)&&new URL(e.baseHref).origin!==new URL(t).origin)throw Error("Link.setModelLinkPolicy: setting the policy to a different domain is not supported");return{policy:e.policy,baseHref:e.baseHref,options:{templateHref:t}}}async exec(e,t){const n=e.options.templateHref;e.policy!==s.OpenPolicy.NEW_WINDOW&&e.policy!==s.OpenPolicy.CURRENT_WINDOW||!n?pt(e.policy,this.deepLinker.LinkType.MODEL,this.deepLinker,this.sdk):this.deepLinker.handler.setPolicy(this.deepLinker.LinkType.MODEL,this.deepLinker.handler.HandlingPolicy.CUSTOM,(t=>{const o=new URLSearchParams(window.location.search),a=new URL(Tt(n,o)),i=new URLSearchParams(t);a.searchParams.set("m",i.get("m")||i.get("model")||""),this.sdk.sendPrivateMessage("open link",{newWindow:e.policy===s.OpenPolicy.NEW_WINDOW,href:decodeURIComponent(a.href)})}))}}class gt{constructor(e,t){this.sdk=e,this.deepLinker=t}validateInput(e){if(!ve(s.OpenPolicy,e.policy))throw Error(`${e.policy} is not a valid Link.OpenPolicy`);if(!re(e.baseHref))throw Error("Link.setNavigationLinkPolicy: could not determine window.location");const t=lt(e.options)?e.options.templateHref:void 0;if(void 0!==t&&!re(t)||re(t)&&new URL(e.baseHref).origin!==new URL(t).origin)throw Error("Link.setNavigationLinkPolicy: setting the policy to a different domain is not supported");return{policy:e.policy,baseHref:e.baseHref,options:{templateHref:t}}}async exec(e,t){const n=e.options.templateHref;e.policy!==s.OpenPolicy.NEW_WINDOW&&e.policy!==s.OpenPolicy.CURRENT_WINDOW||!n?pt(e.policy,this.deepLinker.LinkType.NAVIGATION,this.deepLinker,this.sdk):this.deepLinker.handler.setPolicy(this.deepLinker.LinkType.NAVIGATION,this.deepLinker.handler.HandlingPolicy.CUSTOM,(t=>{const o=new URLSearchParams(window.location.search),a=new URL(Tt(n,o)),i=new URLSearchParams(t);!function(e,t){const[n,o,a,s,i,r,c]=[t.get("sm"),t.get("sp"),t.get("sq"),t.get("sr"),t.get("ss"),t.get("sz"),t.get("start")];re(n)&&e.set("sm",n);re(o)&&e.set("sp",o);re(a)&&e.set("sq",a);re(s)&&e.set("sr",s);re(i)&&e.set("ss",i);re(r)&&e.set("sz",r);re(c)&&e.set("start",c)}(a.searchParams,i),a.searchParams.set("m",i.get("m")||i.get("model")||""),this.sdk.sendPrivateMessage("open link",{newWindow:e.policy===s.OpenPolicy.NEW_WINDOW,href:decodeURIComponent(a.href)})}))}}class wt{constructor(e,t){this.sdk=e,this.deepLinker=t}validateInput(e){if(!ve(s.OpenPolicy,e.policy))throw Error(`${e.policy} is not a valid Link.OpenPolicy`);return{policy:e.policy}}async exec(e,t){pt(e.policy,this.deepLinker.LinkType.SAME_ORIGIN,this.deepLinker,this.sdk)}}class ft{constructor(e,t){this.sdk=e,this.deepLinker=t}validateInput(e){const{openInNewWindow:t}=e;if(!ut(t))throw Error(`${e.openInNewWindow} is expected to strictly be a boolean to avoid confusion about truth-y and false-y values.`);return{openInNewWindow:t}}async exec(e,t){e.openInNewWindow?this.deepLinker.handler.setPolicy(this.deepLinker.LinkType.EXTERNAL,this.deepLinker.handler.HandlingPolicy.NEW_WINDOW):this.deepLinker.handler.setPolicy(this.deepLinker.LinkType.EXTERNAL,this.deepLinker.handler.HandlingPolicy.CUSTOM,(e=>{this.sdk.sendPrivateMessage("open link",{href:e})}))}}function Tt(e,t){const n=/\$\{([a-zA-Z]+)\}/,o=new URL(e);let a,s=decodeURI(o.pathname);for(;a=s.match(n);){const e=t.get(a[1]);s=s.replace(a[0],`${e}`)}for(o.pathname=s;a=o.search.match(n);){const e=t.get(a[1]);o.search=null!==e||""===e?o.search.replace(a[0],`${a[1]}=${e}`):o.search.replace(a[0],`${a[1]}`)}return o.href}function It(e,t){return!!Array.isArray(e)&&e.every(t)}class Et{constructor(e){this.deepLinks=e}validateInput(e){const{policy:t,baseHref:n}=e;if(!ve(s.CreationPolicy,t))throw Error(`Link.setShareLinkPolicy: ${e.policy} is not a valid Link.ShareLinkPolicy`);if(!re(n))throw Error("Link.setShareLinkPolicy: Could not determine window.location");const o=lt(e.options)&&e.options.includeParams?e.options.includeParams:[];if(!It(o,re))throw Error("Link.setShareLinkPolicy: 'includeParams' expects an array of strings");return{policy:t,baseHref:this.validateBaseHref(t,n),options:{includeParams:o}}}validateBaseHref(e,t){const n=/^https:\/\/([a-z0-9\-]*\.)*(matterport\.com|matterportvr\.cn)$/,o=/^https:\/\/static\.(matterport\.com|matterportvr\.cn)$/;return{[s.CreationPolicy.MATTERPORT]:function(){if(window.location.origin.match(n)&&!window.location.origin.match(o))return window.location.href;const e=decodeURIComponent(new URLSearchParams(window.location.search.toLowerCase()).get("apihost")||"");return e.match(n)?e+"/show/":"https://my.matterport.com/show/"},[s.CreationPolicy.REFERRER]:function(){return t},[s.CreationPolicy.WINDOW]:function(){return window.location.href}}[e]()}async exec(e,t){this.deepLinks.creator.setDefaultBaseHref(e.baseHref,e.options.includeParams)}}class yt{constructor(e,t){this.toSdkMediaMap={[e.PHOTO]:i.MediaType.PHOTO,[e.VIDEO]:i.MediaType.VIDEO,[e.RICH]:i.MediaType.RICH},this.toSdkMediaFromChunk={[t.error]:i.MediaType.NONE,[t.link]:i.MediaType.NONE,[t.none]:i.MediaType.NONE,[t.photo]:i.MediaType.PHOTO,[t.rich]:i.MediaType.RICH,[t.text]:i.MediaType.NONE,[t.video]:i.MediaType.VIDEO}}toSdkMedia(e){return this.toSdkMediaMap[e]}fromTagChunkType(e){return this.toSdkMediaFromChunk[e]}}class vt{constructor(e){this.toSdkChunkTypeMap={[e.error]:i.DescriptionChunkType.NONE,[e.link]:i.DescriptionChunkType.LINK,[e.none]:i.DescriptionChunkType.NONE,[e.photo]:i.DescriptionChunkType.NONE,[e.rich]:i.DescriptionChunkType.NONE,[e.text]:i.DescriptionChunkType.TEXT,[e.video]:i.DescriptionChunkType.NONE}}toSdkChunkType(e){return this.toSdkChunkTypeMap[e]}}class At{constructor(e){this.toSdkLinkTypeMap={[e.NAVIGATION]:i.LinkType.NAVIGATION,[e.MODEL]:i.LinkType.MODEL,[e.EXT_LINK]:i.LinkType.EXT_LINK}}toSdkLinkType(e){return this.toSdkLinkTypeMap[e]}}class Ct{constructor(){this.observers=new Set}observe(e){this.observers.add(e);const t=this;return{renew(){t.observers.add(e)},cancel(){t.removeObserver(e)}}}removeObserver(e){this.observers.delete(e)}notify(){for(const e of this.observers)e.notify()}}var St,Dt,bt,Ot,Mt,Nt,Rt,Pt,Lt,xt,kt,_t,Ut,Ft,Vt,Gt,Ht,zt,Bt,jt,Wt,qt,$t,Kt,Yt,Xt,Zt,Qt,Jt,en,tn,nn,on,an,sn,rn,cn,dn,hn,ln,un,pn,mn,gn,wn,fn,Tn,In,En,yn,vn,An,Cn,Sn,Dn,bn,On,Mn,Nn,Rn,Pn,Ln,xn,kn,_n,Un,Fn,Vn,Gn,Hn,zn,Bn,jn,Wn,qn,$n,Kn,Yn,Xn,Zn,Qn,Jn;!function(e){e.ROLE="ROLE",e.TYPE="TYPE",e.USER_EMAIL="USER_EMAIL"}(St||(St={})),function(e){e.EMPTY="empty",e.PARSED="parsed",e.RAW="raw",e.VERIFIED="verified"}(Dt||(Dt={})),function(e){e.FULL="full",e.NONE="none",e.PARTIAL="partial"}(bt||(bt={})),function(e){e.IMPRESSION="impression",e.MODELLOADED="modelLoaded"}(Ot||(Ot={})),function(e){e.LAST7DAYS="last7Days",e.LAST30DAYS="last30Days",e.LIFETIME="lifetime"}(Mt||(Mt={})),function(e){e.LZMA="lzma",e.NONE="none"}(Nt||(Nt={})),function(e){e.AVAILABLE="available",e.LOCKED="locked",e.UNAVAILABLE="unavailable"}(Rt||(Rt={})),function(e){e.EXTERNAL="external",e.UPLOAD="upload"}(Pt||(Pt={})),function(e){e.IMAGE="image",e.PDF="pdf",e.RICH="rich",e.VIDEO="video",e.ZIP="zip"}(Lt||(Lt={})),function(e){e.DELETED="deleted",e.PROVISIONED="provisioned",e.TRASHED="trashed",e.UPLOADED="uploaded"}(xt||(xt={})),function(e){e.LOCKED="locked",e.UNAVAILABLE="unavailable",e.UNLOCKED="unlocked"}(kt||(kt={})),function(e){e.COMPLETED="completed",e.FAILED="failed",e.INPROGRESS="inprogress",e.ORDERED="ordered",e.PLACED="placed",e.PREVIEWABLE="previewable"}(_t||(_t={})),function(e){e.DOLLHOUSE="dollhouse",e.FLOORPLAN="floorplan",e.OUTDOOR="outdoor",e.PANORAMA="panorama",e.TRANSITION="transition",e.UNKNOWN="unknown"}(Ut||(Ut={})),function(e){e.WALL="wall",e.WINDOW="window"}(Ft||(Ft={})),function(e){e.HANDHELD="handheld",e.OTHER="other",e.PRO="pro",e.SPHERICAL="spherical"}(Vt||(Vt={})),function(e){e.DUPLICATE="duplicate",e.FAIL="fail",e.REPLACE="replace",e.SKIP="skip"}(Gt||(Gt={})),function(e){e.CREATED="created",e.MODIFIED="modified"}(Ht||(Ht={})),function(e){e.FAST="fast",e.NORMAL="normal",e.URGENT="urgent"}(zt||(zt={})),function(e){e.KILOMETERS="kilometers",e.MILES="miles"}(Bt||(Bt={})),function(e){e.MATTERTAGS="Mattertags",e.NOTECOMMENTS="NoteComments",e.NOTES="Notes"}(jt||(jt={})),function(e){e.BLOCKED="blocked",e.DISABLED="disabled",e.GATED="gated",e.UNLOCKED="unlocked"}(Wt||(Wt={})),function(e){e.MAY="may",e.MUST="must",e.MUST_NOT="must_not"}(qt||(qt={})),function(e){e.ALPHA="alpha",e.COLORED_ROOMS="colored_rooms",e.MEASUREMENTS="measurements",e.PHOTOGRAMY="photogramy",e.SCHEMATIC="schematic"}($t||($t={})),function(e){e.ADMIN="Admin",e.FOLDERCREATOR="FolderCreator",e.FOLDERSHARES="FolderShares",e.USERGROUPFOLDERSHARES="UserGroupFolderShares"}(Kt||(Kt={})),function(e){e.ALL="all",e.ID="id",e.NAME="name"}(Yt||(Yt={})),function(e){e.CREATED="created",e.MODIFIED="modified",e.NAME="name"}(Xt||(Xt={})),function(e){e.COMPLETE="COMPLETE",e.ERROR="ERROR",e.PENDING="PENDING"}(Zt||(Zt={})),function(e){e.REEL="reel",e.STORY="story"}(Qt||(Qt={})),function(e){e.COMPLETED="completed",e.CREATED="created",e.FAILED="failed",e.INPROGRESS="inprogress"}(Jt||(Jt={})),function(e){e.ANCHORLOCATION="AnchorLocation",e.HIGHLIGHTREEL="HighlightReel",e.LABEL="Label",e.MATTERTAG="Mattertag",e.MEASUREMENTPATH="MeasurementPath",e.MODELFLOOR="ModelFloor",e.MODELROOM="ModelRoom",e.NOTE="Note",e.OBJECTANNOTATION="ObjectAnnotation",e.ORDEREDLIST="OrderedList",e.PANORAMICIMAGELOCATION="PanoramicImageLocation",e.PHOTO="Photo"}(en||(en={})),function(e){e.SHOWCASE="showcase"}(tn||(tn={})),function(e){e.PHOTO="photo",e.RICH="rich",e.VIDEO="video"}(nn||(nn={})),function(e){e.LINETYPE_2D="linetype_2D",e.LINETYPE_3D="linetype_3D"}(on||(on={})),function(e){e.DISABLED="disabled",e.MEASURE="measure",e.MEASUREANDVIEW="measureAndView"}(an||(an={})),function(e){e.FLOORS="floors",e.HIGHLIGHTREEL="highlightReel",e.IMAGE="image",e.LABELS="labels",e.MATTERTAGS="mattertags",e.MEASUREMENTPATHS="measurementPaths",e.ORDEREDLISTS="orderedLists",e.PLAYEROPTIONS="playerOptions",e.SWEEPS="sweeps"}(sn||(sn={})),function(e){e.FULL="full",e.PUBLIC="public",e.VIEWER="viewer"}(rn||(rn={})),function(e){e.ADMIN="Admin",e.MODELCREATOR="ModelCreator",e.MODELSHARES="ModelShares",e.USERGROUPMODELSHARES="UserGroupModelShares"}(cn||(cn={})),function(e){e.BLACK="black",e.GREY="grey",e.WHITE="white"}(dn||(dn={})),function(e){e.DEFAULT="default",e.MLS="mls",e.UNBRANDED="unbranded"}(hn||(hn={})),function(e){e.BUNDLE_COMPLETED="bundle_completed",e.BUNDLE_REQUESTED="bundle_requested",e.DELETED="deleted",e.INSERTED="inserted",e.PROCESSED="processed",e.REPLACED="replaced",e.UPDATED="updated",e.UPLOADED="uploaded"}(ln||(ln={})),function(e){e.ACTIVE="active",e.ARCHIVED="archived"}(un||(un={})),function(e){e.ID="id",e.INTERNALID="internalId",e.MLSID="mlsId"}(pn||(pn={})),function(e){e.DEFAULT="default",e.VR="vr"}(mn||(mn={})),function(e){e.ADDRESS="address",e.CAMERA="camera",e.CAMERAMANUFACTURER="cameraManufacturer",e.CAMERAMODEL="cameraModel",e.EXTENSIONTAG="extensiontag",e.GEODISTANCE="geoDistance",e.GEOREGION="geoRegion",e.ID="id",e.NAME="name",e.STANDARD="standard",e.SUMMARY="summary"}(gn||(gn={})),function(e){e.CREATED="created",e.LAST7IMPRESSIONSEVENTCOUNT="last7ImpressionsEventCount",e.LAST7MODELSLOADEDEVENTCOUNT="last7ModelsLoadedEventCount",e.LAST7MODELSLOADEDUSERCOUNT="last7ModelsLoadedUserCount",e.LAST30IMPRESSIONSEVENTCOUNT="last30ImpressionsEventCount",e.LAST30MODELSLOADEDEVENTCOUNT="last30ModelsLoadedEventCount",e.LAST30MODELSLOADEDUSERCOUNT="last30ModelsLoadedUserCount",e.LIFETIMEIMPRESSIONSEVENTCOUNT="lifetimeImpressionsEventCount",e.LIFETIMEMODELSLOADEDEVENTCOUNT="lifetimeModelsLoadedEventCount",e.LIFETIMEMODELSLOADEDUSERCOUNT="lifetimeModelsLoadedUserCount",e.MODIFIED="modified",e.SCORE="score"}(wn||(wn={})),function(e){e.COPY="copy",e.EDITED="edited",e.ORIGINAL="original",e.UNKNOWN="unknown"}(fn||(fn={})),function(e){e.ACTIVATING="activating",e.ACTIVATION_PENDING="activation_pending",e.ACTIVE="active",e.FAILED="failed",e.INACTIVATING="inactivating",e.INACTIVATION_PENDING="inactivation_pending",e.INACTIVE="inactive",e.PENDING="pending",e.PROCESSING="processing",e.STAGING="staging"}(Tn||(Tn={})),function(e){e.ACTIVE="active",e.INACTIVE="inactive"}(In||(In={})),function(e){e.PRIVATE="private",e.PUBLIC="public"}(En||(En={})),function(e){e.SERIAL="serial"}(yn||(yn={})),function(e){e.AUTO="auto",e.LEFT="left",e.RIGHT="right"}(vn||(vn={})),function(e){e.AUTO="auto",e.MANUAL="manual",e.UNPLACED="unplaced"}(An||(An={})),function(e){e.UPLOAD="upload",e.VISION="vision"}(Cn||(Cn={})),function(e){e.CYLINDRICAL="cylindrical",e.EQUIRECTANGULAR="equirectangular",e.SKYBOX="skybox"}(Sn||(Sn={})),function(e){e.COMMENT="comment",e.MATTERTAG="mattertag"}(Dn||(Dn={})),function(e){e.FOLDER="folder",e.GRANT="grant",e.MODEL="model",e.ORGANIZATION="organization",e.USER="user"}(bn||(bn={})),function(e){e.SNAPSHOT="snapshot",e.TOUR="tour"}(On||(On={})),function(e){e.USER="user",e.VISION="vision"}(Mn||(Mn={})),function(e){e.ICON="icon",e.ORIGINAL="original",e.PRESENTATION="presentation",e.PREVIEW="preview",e.THUMBNAIL="thumbnail",e.WEB="web"}(Nn||(Nn={})),function(e){e.EQUIRECTANGULAR="equirectangular",e.PHOTO2D="photo2D"}(Rn||(Rn={})),function(e){e.AVAILABILITY="availability",e.FLAG="flag",e.QUOTA="quota",e.VALUE="value"}(Pn||(Pn={})),function(e){e.COMPLETE="complete",e.FAILED="failed",e.INPROGRESS="inprogress",e.STAGING="staging"}(Ln||(Ln={})),function(e){e.OPEN="open",e.RESOLVED="resolved"}(xn||(xn={})),function(e){e.ALIGNED="aligned",e.FAILED="failed",e.UNALIGNED="unaligned"}(kn||(kn={})),function(e){e.ANCHOR="anchor",e.ID="id",e.LOCATION="location"}(_n||(_n={})),function(e){e.FACE_BLURRING="face_blurring",e.FIDUCIAL_DETECTION="fiducial_detection",e.FIDUCIAL_REMOVAL="fiducial_removal"}(Un||(Un={})),function(e){e.DEMO="demo",e.DISCOVERABLE="discoverable",e.FLAGGED="flagged",e.INACTIVE="inactive"}(Fn||(Fn={})),function(e){e.DEFAULT="default",e.DISABLED="disabled",e.ENABLED="enabled"}(Vn||(Vn={})),function(e){e.FOLDER="Folder",e.MODEL="Model",e.ORGANIZATION="Organization"}(Gn||(Gn={})),function(e){e.ASC="asc",e.DESC="desc"}(Hn||(Hn={})),function(e){e.ACCEPTED="accepted",e.DISMISSED="dismissed",e.REJECTED="rejected",e.UNREVIEWED="unreviewed"}(zn||(zn={})),function(e){e.HIGH="high",e.LOW="low"}(Bn||(Bn={})),function(e){e.AFTERNOON="afternoon",e.DAWN="dawn",e.DUSK="dusk",e.MORNING="morning",e.NIGHT="night"}(jn||(jn={})),function(e){e.FADE_TO_BLACK="fade_to_black",e.INSTANT="instant",e.INTERPOLATE="interpolate"}(Wn||(Wn={})),function(e){e.IMPERIAL="imperial",e.METRIC="metric"}(qn||(qn={})),function(e){e.CREATED="created",e.EMAIL="email",e.FIRST_NAME="first_name",e.LAST_NAME="last_name",e.MODIFIED="modified"}($n||($n={})),function(e){e.DOLLHOUSE="dollhouse",e.FLOORPLAN="floorplan",e.MESH="mesh",e.PANORAMA="panorama"}(Kn||(Kn={})),function(e){e.BASIC="basic",e.NONE="none",e.TOKEN="token"}(Yn||(Yn={})),function(e){e.FILE_TOO_LARGE="oversize",e.EMPTY_FILE="empty",e.OVER_QUOTA="overQuota",e.UPLOAD_FAILED="failed",e.PERMISSION_DENIED="permission"}(Xn||(Xn={})),function(e){e.EMBED_FAIL="embedFail",e.EMBED_SUCCESS="success"}(Zn||(Zn={})),function(e){e.IMAGE="image",e.PDF="pdf",e.VIDEO="video",e.RICH="rich",e.ZIP="zip",e.TEXT="text",e.AUDIO="audio",e.MODEL="model",e.APPLICATION="application"}(Qn||(Qn={})),function(e){e.EXTERNAL="external",e.UPLOAD="upload",e.SANDBOX="sandbox"}(Jn||(Jn={}));const eo=new ee("expiring-resource"),to=new WeakMap;class no{constructor(e,t){this.value=e,this.validUntil=t}refreshFrom(e){this.value=e.value,this.validUntil=e.validUntil;const t=to.get(this);t&&(t.resolve(),to.delete(this))}async get(){if(this.validUntil&&this.onStale){const e=Date.now();if(e+6e4+1e4>this.validUntil.getTime()){let t=to.get(this);t||(t=new de,to.set(this,t),this.onStale()),e+6e4+1e3>this.validUntil.getTime()&&(eo.info("Stale resource, waiting for refresh"),await t.nativePromise(),eo.info("Refreshed resource"))}}return this.value}getCurrentValue(){return this.value}}function oo(e=11){let t="";const n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let o=0;o<e;o++)t+=n.charAt(Math.floor(Math.random()*n.length));return t}var ao,so;!function(e){e.Behance="behance",e.DailyMotion="dailymotion",e.FaceBook="facebook",e.Flickr="flickr",e.Giphy="giphy",e.GoogleMaps="google maps",e.Instagram="instagram",e.LinkedIn="linkedin",e.Matterport="matterport",e.MixCloud="mixcloud",e.Pinterest="pinterest",e.Reddit="reddit",e.SoundCloud="soundcloud",e.SketchFab="sketchfab",e.Spotify="spotify",e.Tenor="tenor",e.TikTok="tiktok",e.Twitch="twitch",e.Twitter="twitter",e.Tumblr="tumblr",e.Vimeo="vimeo",e.YouTube="youtube"}(ao||(ao={})),function(e){e.PHOTO="photo",e.VIDEO="video",e.LINK="link",e.RICH="rich"}(so||(so={}));Error;ao.GoogleMaps;ao.Behance,ao.FaceBook,ao.GoogleMaps,ao.Instagram,ao.LinkedIn,ao.MixCloud,ao.Pinterest,ao.Reddit,ao.TikTok,ao.Twitter,ao.Twitch;var io;!function(e){e.IMAGE="tag.attachment.image",e.RICH="tag.attachment.rich",e.VIDEO="tag.attachment.video"}(io||(io={}));class ro{constructor(e,t){this.globalAttachments=new Map,this.perClientAttachments=new Map,this.clientAttachments=new Map,this.clientIds=new Set,this.attachmentDescriptors=new Map,this.observable=new Ct,this.oEmbed=t;for(const t of e.getTagList()){const n=e.getTag(t);for(const e of n.fileAttachments)this.globalAttachments.set(e.id,e),this.autoRefreshExpiringAttachment(e);for(const e of n.externalAttachments)this.globalAttachments.set(e.id,e),this.setDescriptorUrl(e,e.src)}}get(e,t){return this.globalAttachments.get(t)||this.clientAttachments.get(t)}add(e,t){const n=this.createIAttachment({src:t.src,type:t.type});return this.clientAttachments.set(n.id,n),this.setDescriptorUrl(n,t.src),this.clientIds.add(n.id),this.observable.notify(),n.id}async addBySrc(e,t){const n=await this.createOEmbedIAttachment(t);return this.clientAttachments.set(n.id,n),this.setDescriptorUrl(n,t),this.clientIds.add(n.id),this.observable.notify(),n.id}addSandbox(e,t){const n=this.getUniqueId(),o=t.name||"sandbox-"+n,a={id:n,src:o,srcDoc:t.srcDoc,onLoad:t.sandboxLoadedHandler,category:Jn.SANDBOX,mediaType:Qn.RICH,parentType:Dn.MATTERTAG,thumbnailUrl:new no("",null),url:new no("",null),created:new Date,height:t.size.h,width:t.size.w};return this.clientAttachments.set(n,a),this.setDescriptorUrl(a,o),this.clientIds.add(n),this.observable.notify(),[n,a]}has(e){return this.globalAttachments.has(e)||this.clientIds.has(e)}*[Symbol.iterator](e){for(const e of this.globalAttachments)yield e;for(const e of this.clientAttachments)yield e;if(e){const t=this.perClientAttachments.get(e)||[];for(const e of t)yield e}}*descriptors(){for(const e of this.attachmentDescriptors)yield e}onChanged(e){return this.observable.observe(e)}getUniqueId(){const e=oo(10);return this.globalAttachments.has(e)||this.clientIds.has(e)?this.getUniqueId():e}async autoRefreshExpiringAttachment(e){const t=e.url,n=async()=>{if(t.validUntil){const o=t.validUntil.getTime()-Date.now(),a=o<=0;if(a){const n=await t.get();this.setDescriptorUrl(e,n),this.observable.notify()}setTimeout(n,a?0:o)}},o=await t.get();this.setDescriptorUrl(e,o),n(),this.observable.notify()}setDescriptorUrl(e,t){this.attachmentDescriptors.set(e.id,{id:e.id,src:t,type:this.getAttachmentType(e.mediaType)})}getAttachmentType(e){return{[Qn.APPLICATION]:u.AttachmentType.APPLICATION,[Qn.AUDIO]:u.AttachmentType.AUDIO,[Qn.IMAGE]:u.AttachmentType.IMAGE,[Qn.MODEL]:u.AttachmentType.MODEL,[Qn.PDF]:u.AttachmentType.PDF,[Qn.RICH]:u.AttachmentType.RICH,[Qn.TEXT]:u.AttachmentType.TEXT,[Qn.VIDEO]:u.AttachmentType.VIDEO,[Qn.ZIP]:u.AttachmentType.ZIP}[e]}createIAttachment(e){const t={[io.IMAGE]:Qn.IMAGE,[io.RICH]:Qn.RICH,[io.VIDEO]:Qn.VIDEO};return{id:this.getUniqueId(),mediaType:t[e.type],category:Jn.EXTERNAL,src:e.src,parentType:Dn.MATTERTAG,created:new Date,height:0,width:0,thumbnailUrl:new no("",null),url:new no("",null),mimeType:""}}async createOEmbedIAttachment(e){const t={[so.PHOTO]:Qn.IMAGE,[so.RICH]:Qn.RICH,[so.VIDEO]:Qn.VIDEO},n=this.getUniqueId(),o=t[(await this.oEmbed.getOEmbedData(e)).type];if(!o)throw Error("unable to determine media type");return{id:n,mediaType:o,category:Jn.EXTERNAL,src:e,parentType:Dn.MATTERTAG,created:new Date,height:0,width:0,thumbnailUrl:new no("",null),url:new no("",null),mimeType:""}}}const co={[i.MediaType.PHOTO]:io.IMAGE,[i.MediaType.RICH]:io.RICH,[i.MediaType.VIDEO]:io.VIDEO};class ho{constructor(e,t,n,o){this.tagAdd=e,this.tagEditIcon=t,this.tagAttach=n,this.attachmentRegistry=o}validateInput(e,t){return{descriptors:ae(this.tagAdd,{descriptors:Array.isArray(e.descriptors)?e.descriptors:[e.descriptors]},t).descriptors}}async exec(e,t){const n=Array.isArray(e.descriptors)?e.descriptors:[e.descriptors],o=new Map;for(const e of n)if(e.media&&e.media.type!==i.MediaType.NONE){const n=this.attachmentRegistry.add(t.applicationKey,{src:e.media.src,type:co[e.media.type]});o.set(e.media.src,n)}const a=async e=>{for(let o=0;o<e.length;++o){const a=n[o];a.iconId&&await se(this.tagEditIcon,{id:e[o],iconId:a.iconId},t)}},s=async e=>{for(let a=0;a<e.length;++a){const s=n[a];if(s.media&&s.media.type!==i.MediaType.NONE){const n=o.get(s.media.src);n&&se(this.tagAttach,{tagId:e[a],attachmentIds:[n]},t)}}};return se(this.tagAdd,{descriptors:n},t).then((async e=>(await a(e),await s(e),e)))}}function lo(e,t,n){return(n=n||{}).x=e[t].x,n.y=e[t].y,n.z=e[t].z,n}function uo(e,t,n){return(n=n||{}).r=e[t].r,n.g=e[t].g,n.b=e[t].b,n}function po(e,t,n,o){o=o||{};try{const a=t.getFloor(e);o.id=n.getIdFromCwfId(a.id),o.sequence=a.index}catch(e){o.id="",o.sequence=-1}return o}class mo{create(e,t){return t.onChanged((()=>e.onChanged()))}}class go{constructor(e,t,n,o){this.mattertagData=t,this.floorsData=n,this.floorIdMap=o,this._data={},this.mediaConverter=e.mediaConverter}get data(){return this._data}isItemEqual(e,t){return!H(this.data[t],e.data[t])}update(){for(const e of this.mattertagData.getTagList()){const t=this.mattertagData.getTag(e),n=this.floorsData.getFloor(t.floorId),o=this.data[t.sid]||{};o.sid=t.sid,o.enabled=t.enabled,o.anchorPosition=lo(t,"anchorPosition",o.anchorPosition),o.stemVector=lo(t,"stemVector",o.stemVector),o.stemVisible=t.stemVisible,o.label=t.label,o.description=t.description,o.media=this.getMedia(t,o.media),o.color=uo(t,"color",o.color),o.floorIndex=n?n.index:-1,o.floorInfo=o.floorInfo||{},o.floorInfo.id=this.floorIdMap.getIdFromCwfId(n.id),o.floorInfo.sequence=n.index,this._data[t.sid]=o}for(const e in this.data){this.mattertagData.getTag(e)||delete this._data[e]}}clear(){this._data={}}getMedia(e,t){const n=e.externalAttachments.get(0),o=n?this.mediaConverter.toSdkMedia(n.mediaType):i.MediaType.NONE,a=n&&o!==i.MediaType.NONE?n.src:"";return(t=t||{}).src=a,t.type=o,t}}class wo{constructor(e,t,n){this.tagEditBillboard=t,this.tagAttach=n,[this.mattertagData,this.attachmentRegistry]=e}validateInput(e,t){if(!lt(e.properties))throw Error("Mattertag.editBillboard: editable properties is not an object");const n=ae(this.tagEditBillboard,e,t),o=e.properties.media;if(o){if(!lt(o)||!ve(i.MediaType,o.type))throw Error("Mattertag.editBillboard: media was not a valid media descriptor");if(o.type!==i.MediaType.NONE){if(!re(o.src))throw Error(`Mattertag.editBillboard: media was of type "${o.type}" but has no src value`);return{id:n.id,properties:Object.assign(Object.assign({},n.properties),{media:{src:o.src,type:o.type}})}}n.properties.media={src:"",type:i.MediaType.NONE}}return n}async exec(e,t){const n=this.mattertagData.getTag(e.id),o=(()=>{if(e.properties.media&&e.properties.media.type!==i.MediaType.NONE)return this.attachmentRegistry.add(t.applicationKey,{src:e.properties.media.src,type:co[e.properties.media.type]})})(),a=this.mattertagData;return se(this.tagEditBillboard,e,t).then((()=>{e.properties.media&&(n.fileAttachments.replace([]),n.externalAttachments.replace([])),o&&se(this.tagAttach,{tagId:n.sid,attachmentIds:[o]},t),a.commit()}))}}function fo(e,t,n){function o(e){if(!e)return;return{label:e.label,type:n.toSdkLinkType(e.type),url:e.url,navigationData:e.navigationData}}const a=[];for(const n of e)a.push({type:t.toSdkChunkType(n.type),link:o(n.link),text:n.text});return a}class To{constructor(e,t,n,o){this.commands=e,this.tagData=t,this.floorData=n,this.floorIdMap=o}validateInput(e,t){return e}async exec(e,t){return function(e,t,n,o){const a=[];return e.iterate((e=>{const{id:s,index:r}=t.getFloor(e.floorId),c=n.getIdFromCwfId(s),d=e.externalAttachments.get(0),h=d?o.mediaConverter.toSdkMedia(d.mediaType):i.MediaType.NONE,l=d&&h!==i.MediaType.NONE?d.src:"";a.push({sid:e.sid,label:e.label,description:e.description,parsedDescription:fo(e.parsedDescription,o.chunkTypeConverter,o.linkTypeConverter),mediaSrc:l,mediaType:h,media:{type:h,src:l},anchorPosition:{x:e.anchorPosition.x,y:e.anchorPosition.y,z:e.anchorPosition.z},anchorNormal:{x:e.anchorNormal.x,y:e.anchorNormal.y,z:e.anchorNormal.z},color:{r:e.color.r,g:e.color.g,b:e.color.b},enabled:e.enabled,floorId:r,floorIndex:r,floorInfo:{id:c,sequence:r},stemVector:{x:e.stemVector.x,y:e.stemVector.y,z:e.stemVector.z},stemHeight:e.stemHeight,stemVisible:e.stemVisible})})),a}(this.tagData,this.floorData,this.floorIdMap,this.commands)}}var Io,Eo,yo,vo;!function(e){e.LOADED="inject.loaded",e.SETUP="inject.setup",e.RESOLVE="inject.resolve"}(Io||(Io={}));Symbol.iterator;class Ao{constructor(){this.usedIds=new Set,this.usedIds.add(0)}generate(){let e;do{e=Math.floor(1e6*Math.random())}while(this.usedIds.has(e));return this.usedIds.add(e),e}isInUse(e){return this.usedIds.has(e)}}function Co(e){return"number"==typeof e&&!isNaN(e)}function So(e){return e-0}class Do extends Oe{constructor(e){super("Expected tagId parameter to be of type string; got "+(Array.isArray(e)?"Array":typeof e))}}!function(e){e[e.POSTMESSAGE=1]="POSTMESSAGE"}(Eo||(Eo={}));class bo{constructor(e,t,n){this.mattertagData=e,this.annotationsViewData=t,this.iframeSrcDoc=n,this.idGenerator=new Ao,this.usedSids=new Set}validateInput(e){const t=e.tagId;if(!re(t))throw new Do(t);if(!this.mattertagData.getTag(t))throw Error(e.tagId+" is not a valid tagId");if(!e.html||"string"!=typeof e.html)throw Error(e.html+" is not valid html");if(!Co(e.clientId))throw Error("Unexpected error: unable to create iframe");const n=e.options||{};let o="string"==typeof n.windowPath?n.windowPath:"";if(o&&o.split(".").filter((e=>"parent"!==e&&"opener"!==e)).length>0)throw Error(o+" is an unsupported window path");o.length>0&&"."!==o[0]&&(o="."+o);try{if(!Function("return window"+o)().postMessage)throw Error("invalid window")}catch(e){throw Error("problem finding a valid window with path: "+o)}const a={on:"on",off:"off",send:"send",tag:"tag",docked:"docked"};n.globalVariableMap&&(re(n.globalVariableMap.on)&&(a.on=n.globalVariableMap.on),re(n.globalVariableMap.off)&&(a.off=n.globalVariableMap.off),re(n.globalVariableMap.send)&&(a.send=n.globalVariableMap.send),re(n.globalVariableMap.tag)&&(a.tag=n.globalVariableMap.tag));const s={w:0,h:0};if(n.size){const e=So(n.size.w+""),t=So(n.size.h+"");isNaN(e)||isNaN(t)||(s.w=e,s.h=t)}return{tagId:t,clientId:e.clientId,html:e.html,options:{name:"",size:s,windowPath:o,globalVariableMap:a}}}async exec(e,t){const n=this.idGenerator.generate();return new Promise((t=>{const o=this.getUniqueSid();this.mattertagData.getTag(e.tagId).sandboxAttachments.replace([{id:o,src:"sandbox-"+o,srcDoc:this.iframeSrcDoc,onLoad:o=>{var a;o.contentWindow.postMessage({type:Io.SETUP,id:n,targetId:e.clientId,customHTML:e.html,windowPath:e.options.windowPath,parentTag:e.tagId,docked:(null===(a=this.annotationsViewData.dockedAnnotation)||void 0===a?void 0:a.id)===e.tagId,globalVariableMap:e.options.globalVariableMap},"*"),t({messengerType:Eo.POSTMESSAGE,iframeId:n})},category:Jn.SANDBOX,created:new Date,mediaType:Qn.RICH,parentType:Dn.MATTERTAG,thumbnailUrl:new no("",null),url:new no("",null),height:e.options.size.h,width:e.options.size.w}]),this.mattertagData.commit()}))}getUniqueSid(){const e=oo();return this.usedSids.has(e)?this.getUniqueSid():(this.usedSids.add(e),e)}}class Oo{constructor(e){this.tagRemove=e}validateInput(e,t){return{ids:ae(this.tagRemove,{ids:Array.isArray(e.ids)?e.ids:[e.ids]},t).ids}}async exec(e,t){return se(this.tagRemove,{ids:Array.isArray(e.ids)?e.ids:[e.ids]},t)}}!function(e){e.NOTE="note",e.TAG="tag",e.OBJECT="object"}(yo||(yo={})),function(e){e[e.Instant=0]="Instant",e[e.FadeToBlack=1]="FadeToBlack",e[e.Interpolate=2]="Interpolate",e[e.MoveToBlack=3]="MoveToBlack"}(vo||(vo={}));const Mo={[i.Transition.FLY]:vo.Interpolate,[i.Transition.FADEOUT]:vo.FadeToBlack,[i.Transition.INSTANT]:vo.Instant};class No{constructor(e,t,n,o){this.FocusOnPinInsideCommand=e,this.SelectAnnotationCommand=t,this.issueCommand=n,this.mattertagData=o}validateInput(e,t){if(!re(e.id)||!this.mattertagData.getTag(e.id))throw Error(`${e.id} does not map to a valid Tag`);if(void 0!==e.transitionType&&!ve(i.Transition,e.transitionType))throw Error(`${e.transitionType} does not match valid transition type`);return{id:e.id,transitionType:e.transitionType}}async exec(e,t){const n=this.mattertagData.getTag(e.id);let o=Mo[e.transitionType];return void 0===o&&(o=vo.Interpolate),await this.issueCommand(new this.FocusOnPinInsideCommand({pinPosition:Object.assign(Object.assign({},n),{stemLength:n.stemHeight,stemNormal:n.stemVector}),transition:o})),await this.issueCommand(new this.SelectAnnotationCommand(e.id,yo.TAG)),e.id}}class Ro{constructor(e,t){this.tagAllowAction=e,this.annotationsViewData=t}validateInput(e,t){const n=ae(this.tagAllowAction,{id:e.tagId,allow:{}},t),o={navigating:!1,opening:!1};return lt(e.prevent)&&(o.navigating=!!e.prevent.navigating,o.opening=!!e.prevent.opening),{tagId:n.id,prevent:o}}exec(e,t){const n=this.annotationsViewData.getCapabilities(e.tagId);return se(this.tagAllowAction,{id:e.tagId,allow:{navigating:!e.prevent.navigating,opening:!e.prevent.opening,docking:n.dock}},t)}}function Po(e,t,n,o,a,s){e.addEnumToInterface({namespace:"Mattertag",name:"DescriptionChunkType",values:i.DescriptionChunkType}),e.addEnumToInterface({namespace:"Mattertag",name:"Event",values:i.Event}),e.addEnumToInterface({namespace:"Mattertag",name:"LinkType",values:i.LinkType}),e.addEnumToInterface({namespace:"Mattertag",name:"MediaType",values:i.MediaType}),e.addEnumToInterface({namespace:"Mattertag",name:"Transition",values:i.Transition});const r=Object.assign(Object.assign({},n),{mediaConverter:new Lo(t.MediaType)}),[c,d,h,l,u]=s;!function(e,t,n){const o=["",!1],a=e=>(o[0]=e.id,o[1]=e.hovering,o);n.subscribe(t.PinHoverChangeMessage,(n=>{n.pinType===t.PinType.MATTERTAG&&e.broadcast(i.Event.HOVER,a,n)}));const s=[""],r=e=>(s[0]=e.id,s);n.subscribe(t.PinClickedMessage,(n=>{n.pinType===t.PinType.MATTERTAG&&e.broadcast(i.Event.CLICK,r,n)}))}(e,t,n),function(e,t,n,o){o.getDependencies().then((([o])=>{const a=["",""],s=e=>{var t;return a[0]=(null===(t=o.billboardAnnotation)||void 0===t?void 0:t.id)||"",a[1]=e.url,a};n.subscribe(t.MattertagLinkOpenedMessage,(t=>{e.broadcast(i.Event.LINK_OPEN,s,t)}))}))}(e,t,n,new me(d)),function(e,t,n){const o=ne.create(new me(t.add,t.editIcon,t.attach,n),new F(ho));e.addAsyncCommandToInterface({namespace:"Mattertag",name:"add",args:["descriptors"]},ie(o,"`Mattertag.add` is deprecated; use `Tag.add` instead"))}(e,a,u),function(e,t,n){const o=Qe.create(n,new mo,new F(go,t));e.addCollectionToInterface({namespace:"Mattertag",name:"data"},o)}(e,r,new me(c,h,l)),function(e,t,n){const o=ne.create(new me(n.getDependencies(),t.editBillboard,t.attach),new F(wo));e.addAsyncCommandToInterface({namespace:"Mattertag",name:"editBillboard",args:["id","properties"]},ie(o,"`Mattertag.editBillboard` is deprecated; use `Tag.editBillboard` or `Tag.registerAttachment` and `Tag.attach` for media instead"))}(e,a,new me(c,u)),function(e,t){e.addAsyncCommandToInterface({namespace:"Mattertag",name:"editColor",args:["id","color"]},ie(t,"`Mattertag.editColor` is deprecated; use `Tag.editColor` instead"))}(e,a.editColor),function(e,t){e.addAsyncCommandToInterface({namespace:"Mattertag",name:"editIcon",args:["id","iconId"]},ie(t,"`Mattertag.editIcon` is deprecated; use `Tag.editIcon` instead"))}(e,a.editIcon),function(e,t){e.addAsyncCommandToInterface({namespace:"Mattertag",name:"editOpacity",args:["id","opacity"]},ie(t,"`Mattertag.editOpacity` is deprecated; use `Tag.editOpacity` instead"))}(e,a.editOpacity),function(e,t){e.addAsyncCommandToInterface({namespace:"Mattertag",name:"editPosition",args:["id","options"]},ie(t,"`Mattertag.editPosition` is deprecated; use `Tag.editPosition` instead"))}(e,a.editPosition),function(e,t){e.addAsyncCommandToInterface({namespace:"Mattertag",name:"editStem",args:["id","stemParams"]},ie(t,"`Mattertag.editStem` is deprecated; use `Tag.editStem` instead"))}(e,a.editStem),function(e,t,n){const o=ne.create(n,new F(To,t));e.addAsyncCommandToInterface({namespace:"Mattertag",name:"getData",args:[]},ie(o,"`Mattertag.getData` is deprecated; subscribe to `Tag.data` instead"))}(e,r,new me(c,h,l)),function(e,t){const n=ne.create(t,new F(bo));e.addCommandToInterface({namespace:"Mattertag",name:"injectHTML",subRoutine:"mattertag.inject",args:["tagId","html","options"]},ie(n,"`Mattertag.injectHTML` is deprecated; use `Tag.registerSandbox` and `Tag.attach` instead"))}(e,new me(c,d,n.getIframeSrcDoc)),function(e,t,n,o){const a=ne.create(o,new F(No,t.FocusOnPinInsideCommand,t.SelectAnnotationCommand,n.issueCommand));e.addAsyncCommandToInterface({namespace:"Mattertag",name:"navigateToTag",args:["id","transitionType"]},a)}(e,t,n,new me(c)),function(e,t){const n=ne.create(t,new F(Ro));e.addAsyncCommandToInterface({namespace:"Mattertag",name:"preventAction",args:["tagId","prevent"]},ie(n,"`Mattertag.preventAction` is deprecated; use `Tag.allowAction` instead"))}(e,new me(a.allowAction,d)),function(e,t){e.addAsyncCommandToInterface({namespace:"Mattertag",name:"registerIcon",args:["textureId","textureSrc"]},ie(t,"`Mattertag.registerIcon` is deprecated; use `Asset.registerTexture` instead"))}(e,o.registerTexture),function(e,t){const n=ne.create(new me(t),new F(Oo));e.addAsyncCommandToInterface({namespace:"Mattertag",name:"remove",args:["ids"]},ie(n,"`Mattertag.remove` is deprecated; use `Tag.remove` instead"))}(e,a.remove),function(e,t){e.addAsyncCommandToInterface({namespace:"Mattertag",name:"resetIcon",args:["id"]},ie(t,"`Mattertag.resetIcon` is deprecated; use `Tag.resetIcon` instead"))}(e,a.resetIcon)}class Lo{constructor(e){this.toSdkMediaMap={[e.IMAGE]:i.MediaType.PHOTO,[e.VIDEO]:i.MediaType.VIDEO,[e.RICH]:i.MediaType.RICH,[e.APPLICATION]:i.MediaType.NONE,[e.AUDIO]:i.MediaType.NONE,[e.MODEL]:i.MediaType.NONE,[e.PDF]:i.MediaType.NONE,[e.TEXT]:i.MediaType.NONE,[e.ZIP]:i.MediaType.NONE}}toSdkMedia(e){return this.toSdkMediaMap[e]}}class xo extends j{constructor(){super(...arguments),this.id="MEASUREMENTS_GET"}}const ko=async(e,t)=>{const n=[];for(const o of e.groups()){const e=o.info,a=t.getFloor(e.floorId);for(let t=1;t<o.count;t++){const s=o.get(t-1),i=o.get(t);n.push({sid:e.sid,label:e.text,floor:a.index,start:{x:s.x,y:s.y,z:s.z},end:{x:i.x,y:i.y,z:i.z}})}}return n};class _o{constructor(e){this.CwfMeasuringPhase=e}create(e,t){let n=t.groupCount,o=t.phase;const a=()=>{const a=t.groupCount,s=t.phase;n===a&&o!==this.CwfMeasuringPhase.EDITING||s!==this.CwfMeasuringPhase.IDLE||(e.onChanged(),n=a),o=s};return new Se(t.onPhaseChanged(a),t.onSelectedGroupIndexChanged(a))}}class Uo{constructor(e){this.measurementModeData=e,this.data={}}update(){for(const e of this.measurementModeData.groups())this.createMeasurement(e);for(const e in this.data){this.measurementModeData.getGroupInfoBySid(e)||delete this.data[e]}}isItemEqual(e,t){return!H(this.data[t],e.data[t])}clear(){this.data={}}createMeasurement(e){const t=e.info.sid,n=this.data[t]||{},o=n.points||[];!function(e,t){let n=0;for(const o of t){const t=e[n]||{};t.x=o.x,t.y=o.y,t.z=o.z,e[n]=t,++n}e.length=n}(o,e),n.sid=t,n.points=o,this.data[t]=n}}class Fo{create(e,t){return t.onChanged((()=>e.onChanged()))}}class Vo{constructor(){this._data={active:!1}}get data(){return this._data}equals(e){return this._data.active===e.data.active}copy(e){this._data.active=e.data.active}update(e){this._data.active=e.modeActive()}}class Go extends j{constructor(e){super(),this.id="SDK_MEASUREMENT_TOGGLE",this.payload={active:e}}}class Ho extends Oe{constructor(e="Unhandled Transition Exception"){super(e),this.name="TransitionException"}}class zo extends Ho{constructor(e="Unhandled Viewmode Exception",t){super(e),this.originalError=t,this.name="ViewmodeException"}}class Bo extends zo{constructor(e="Tried to start view-mode transition while another transition was active"){super(e),this.name="ViewmodeActiveTransition"}}function jo(e){if(e&&"object"==typeof e&&"x"in e&&"y"in e&&"z"in e){const t=e;return Co(t.x)&&Co(t.y)&&Co(t.z)}return!1}const Wo=new ee("move-to-mode-command");class qo extends j{constructor(e){super(),this.id="MOVE_TO_MODE",this.payload=e}}class $o{constructor(e,t,n,o){this.THREE=e,this.CmdViewmode=t,this.conversion=n,this.transitionTypeConverter=o}validateMoveToModeInput(e){if(!e)throw Error("Mode.moveTo -> no arguments provided -- mode is required");e.options||(e.options={});const t=e.mode;if(!ve(this.CmdViewmode,e.mode))throw Error(`Mode.moveTo -> ${e.mode} is not a valid viewmode`);if(t===this.CmdViewmode.TRANSITIONING)throw Error(`Mode.moveTo -> ${e.mode} is not a valid viewmode`);e.options&&e.options.rotation&&(e.options.rotation.z=e.options.rotation.z||0);const n=this.validatePayloadOptions(e.options);return{mode:t,options:{transition:n.transition,position:n.position,rotation:n.rotation,zoom:n.zoom}}}validatePayloadOptions(e){let t,n,o,a;if(e){if(e.transition&&(o=this.transitionTypeConverter.fromSdkTransition(e.transition),void 0===o))throw Error(`Mode.moveTo -> ${e.transition} is not a valid transition style`);e.rotation&&jo(e.rotation)&&(t=this.conversion.rotationToQuaternion(e.rotation)),e.position&&jo(e.position)&&(n=new this.THREE.Vector3(parseFloat(e.position.x),parseFloat(e.position.y),parseFloat(e.position.z))),e.zoom&&!isNaN(e.zoom)&&(a=He(e.zoom,1,30))}return{rotation:t,position:n,transition:o,zoom:a}}}class Ko{create(e,t,n){const o=()=>e.onChanged();return new Se(n.onChanged(o),t.onChanged(o))}}class Yo{constructor(e,t){this._data=r.Mode.INSIDE,this.viewmodeConverter=t.viewmodeConverter}get data(){return this._data}equals(e){return this._data===e.data}copy(e){this._data=e.data}update(e,t){const n=t.currentSweep&&t.isSweepAligned(t.currentSweep);this._data=this.viewmodeConverter.toSdk(e.currentMode,!!n)}}class Xo extends j{constructor(){super(...arguments),this.id="GET_MODEL_DATA"}}function Zo(e,t,n){t.addBinding(Xo,(async()=>{const e=await n.getDependencies();return await async function(e,n,o,a){const s={sid:"",sweeps:[],modelSupportsVr:!1};try{const i=n.getSweepList(),r=e.model;return await t.makeModelData(r.sid,r.options.isVR,i,o,a,s),s}catch(e){throw Error("no model currently loaded")}}(...e)})),e.addCommandCreator({namespace:"Model",name:"getData",args:[]},(()=>new Xo))}class Qo extends j{constructor(){super(...arguments),this.id="GET_MODEL_DETAILS"}}function Jo(e,t,n,o){o.getDependencies().then((e=>n.addBinding(Qo,(async()=>function(e,n){function o(e,t){if(n.tryGetProperty(e,!0))return t}const a=e.model;return{sid:a.sid,name:o(t.OptionsKey.DetailsModelName,a.details.name),presentedBy:o(t.OptionsKey.PresentedBy,a.details.presentedBy),summary:o(t.OptionsKey.DetailsSummary,a.details.summary),formattedAddress:o(t.OptionsKey.DetailsAddress,a.details.formattedAddress),contactEmail:o(t.OptionsKey.DetailsEmail,a.details.contact.email),contactName:o(t.OptionsKey.DetailsName,a.details.contact.name),phone:o(t.OptionsKey.DetailsPhone,a.details.contact.phone),formattedContactPhone:o(t.OptionsKey.DetailsPhone,a.details.contact.formattedPhone),externalUrl:o(t.OptionsKey.DetailsExternalUrl,a.details.externalUrl)}}(...e))))),e.addCommandCreator({namespace:"Model",name:"getDetails",args:[]},(()=>new Qo))}function ea(e,t){return async function(n,o,a,s,i,r){r.sweeps=[];for(const n of a){const o=n.floorId?s.getFloor(n.floorId).index:-1;r.sweeps.push({uuid:i.getIdForSweep(n),sid:i.getIdForSweep(n),alignmentType:t.toSdkAlignment(n.alignmentType),placementType:t.toSdkPlacement(n.placementType),neighbors:await Promise.all(n.neighbours.map((async e=>await i.getIdFromCwfId(e)))),position:(c=n,null!==c.position?{x:c.position.x,y:c.position.y,z:c.position.z}:null),rotation:e.quaternionToRotation(n.rotation),floor:o})}var c;return r.sid=n,r.modelSupportsVr=o,r}}class ta{constructor(e){this.tokenUpdater=e}validateInput(e){const{token:t}=e;if(!re(t))throw Error();return{token:t}}async exec(e,t){this.tokenUpdater.setToken(e.token)}}var na;!function(e){e.POSTMESSAGE="postmessage",e.DIRECT="direct",e.WEBSOCKET="websocket"}(na||(na={}));class oa{constructor(e){this.pluginRegistry=e}validateInput(e){if(!lt(e.key))throw Error(e.key+" is not a valid object");const t=e.key;if(!ce(t.applicationKey))throw Error(t.applicationKey+" is not a valid string");if(!ce(t.id))throw Error(t.id+"is not a valid string");if(!ce(e.path))throw Error(e.path+" is not a valid string");return e}async exec(e){return this.pluginRegistry.load({applicationKey:e.key.applicationKey,id:e.key.id||"default",src:e.path,strict:!1,config:e.config||{}})}}class aa{constructor(e){this.pluginRegistry=e}validateInput(e){if(!lt(e.key))throw Error(e.key+" is not a valid object");if(!ce(e.key.applicationKey))throw Error(e.key+" is not a valid string");return e}async exec(e){return this.pluginRegistry.unload(e.key)}}class sa{create(e,t){return t.onChanged((()=>e.onChanged()))}}class ia{constructor(e,t){this.colliderTypes=t,this.ZERO=new e.Vector3(0,0,0),this.tempVec=new e.Vector3,this._data={position:{x:0,y:0,z:0},normal:{x:0,y:0,z:0},object:d.Colliders.NONE,floorId:void 0,floorIndex:void 0}}get data(){return this._data}equals(e){const t=1e-5,n=e.data.position,o=this._data.position,a=e.data.normal,s=this._data.normal;return Le(n,o,t)&&Le(a,s,t)&&e.data.object===this._data.object}update(e,t,n,o,a){const s=e.hit;s?(be(this._data.position,s.point),be(this._data.normal,s.face.normal),this._data.floorId=void 0,s.object instanceof this.colliderTypes.ModelColliderTarget?(this._data.object=d.Colliders.MODEL,this._data.floorId=function(e,t,n,o,a,s){let i;const r=a.floorIdFromObject(e.object);if(r)return i=t.getFloor(r),i.index;s.copy(e.point);const c=o.meshSubGroupsFromPoint(s);if(!c.length)return;const d=n.getByMeshSubgroup(c[0]);if(!d)return;return i=t.getFloor(d.floorId),i.index}(s,t,n,o,a,this.tempVec)):s.object instanceof this.colliderTypes.PinHeadMesh||s.object instanceof this.colliderTypes.InstancedPinHeads?this._data.object=d.Colliders.TAG:s.object instanceof this.colliderTypes.PuckCollider?this._data.object=d.Colliders.SWEEP:this._data.object=d.Colliders.UNKNOWN):(be(this._data.position,this.ZERO),be(this._data.normal,this.ZERO),this._data.object=d.Colliders.NONE,this._data.floorId=void 0),this._data.floorIndex=this._data.floorId}copy(e){be(this._data.position,e.data.position),be(this._data.normal,e.data.normal),this._data.object=e.data.object,this._data.floorId=e.data.floorId,this._data.floorIndex=e.data.floorIndex}}class ra{constructor(e,t){this.cursorController=e,this.textureAaps=t}validateInput(e){if(!re(e.textureId))throw Error("textureId is not a valid string");return{textureId:e.textureId}}async exec(e,t){const{textureId:n}=e,o=this.textureAaps.get(t.applicationKey).map[n];this.cursorController.setTexture(o)}}class ca{constructor(e){this.cursorController=e}validateInput(e){return e}async exec(e,t){this.cursorController.setTexture(null)}}class da{constructor(e){this.cursorController=e}validateInput(e){(e=e||{}).props=e.props||{};const t=e.props;if(t.fadeIn){const e=t.fadeIn;if(e.duration&&(!Co(e.duration)||e.duration<=0))throw Error(`Pointer.setFadeProps: fadeIn.duration was specified but was not a valid duration; got ${e.duration}`)}if(t.fadeOut){const e=t.fadeOut;if(e.duration&&(!Co(e.duration)||e.duration<=0))throw Error(`Pointer.setFadeProps: fadeOut.duration was specified but was not a valid duration; got ${e.duration}`);if(e.delay&&(!Co(e.delay)||e.delay<=0))throw Error(`Pointer.setFadeProps: fadeOut.delay was specified but was not a valid delay; got ${e.delay}`)}return e}async exec(e,t){this.cursorController.setFadeProps(e.props)}}class ha{constructor(e){this.cursorController=e,this.visible=!0,this.ruleAdded=!1}isVisible(){return this.visible}validateInput(e){if(!ut(e.visible))throw Error(`Pointer.setVisible: visible was specified but was not a valid boolean; got ${e.visible}`);return e}async exec(e,t){this.ruleAdded||(this.isVisible=this.isVisible.bind(this),this.cursorController.addVisibilityRule(this.isVisible),this.ruleAdded=!0),this.visible=e.visible}}class la{constructor(e){this.r3fModule=e}validateInput(e){return e}async exec(e,t){return this.r3fModule.registerExternalR3F(e.callbacks)}}const ua=new ee("mpSdk.R3F.navigationToggle");class pa{constructor(e){this.enabled=!0,this.userNavigationEnabled=()=>this.enabled,e.addNavigationRule(this.userNavigationEnabled.bind(this))}validateInput(e){return e}async exec(e,t){this.enabled=e.enabled,ua.debug(e)}}class ma{constructor(e,t,n,o,a){this.THREE=e,this.cwfTypes=t,this.commands=n,this.navigation=o,this.viewmodeData=a}validateInput(e){if(!e)throw Error('focus: no arguments provided -- "target" point|box is required');const t=e.target;if(!function(e){if(e&&"object"==typeof e&&"min"in e&&"max"in e){const t=e;if(jo(t.min)&&jo(t.max))return!0}return!1}(t)&&!jo(t))throw new Error('focus: invalid "target"');const n=e.options;if(n){const{from:e,mode:t,transition:o}=n;if(e&&!jo(e))throw new Error('focus: "options.from" must be a Vector3|undefined');if(t){if(void 0===this.commands.viewmodeConverter.fromSdk(t))throw Error(`focus: ${t} is not a valid "options.mode"`)}let a=this.cwfTypes.CameraTransitionType.Interpolate;if(o&&(a=this.commands.cameraTransitionConverter.fromSdkTransition(o),void 0===a))throw Error(`focus: ${o} is not a valid "options.transition"`)}return e}async exec(e,t){const n=e.target,o=this.convertOptions(e);try{await this.navigation.focus(n,o)}catch(e){console.warn("focus: unable to focus",e)}}convertOptions(e){var t,n,o,a;const s=null===(t=e.options)||void 0===t?void 0:t.mode,i=s?this.commands.viewmodeConverter.fromSdk(s):null!==(n=this.viewmodeData.currentMode)&&void 0!==n?n:void 0,r=null===(o=e.options)||void 0===o?void 0:o.from,c=r&&jo(r)?new this.THREE.Vector3(r.x,r.y,r.z):void 0,d=null===(a=e.options)||void 0===a?void 0:a.transition;return{from:c,mode:i,transition:d?this.commands.cameraTransitionConverter.fromSdkTransition(d):this.cwfTypes.CameraTransitionType.Interpolate}}}const ga=new ee("mpSdk.R3F.controlsToggle");class wa{constructor(e){this.controls=e,this.sub=null}validateInput(e){return e}async exec(e,t){if(ga.debug(e),this.sub&&e.enabled&&(this.sub.cancel(),this.sub=null),!this.sub&&!e.enabled){const e=this.controls.cameraPoseProxy;this.sub=e.newSession(new fa)}}}class fa{constructor(){}onAccessGranted(e){ga.debug("controls-block granted")}onAccessRevoked(e){ga.debug("controls-block revoked")}}class Ta{constructor(e,t){this.captureCamera=e,this.encodeRenderTarget=t}async capture(e,t,n,o){const{camera:a,scene:s}=t.getScene();return a.getWorldPosition(this.captureCamera.position),a.getWorldQuaternion(this.captureCamera.quaternion),this.captureCamera.projectionMatrix.copy(a.projectionMatrix),this.captureCamera.layers.mask=e.visibleObjects.mask,o.setSize(e.resolution.width,e.resolution.height),n.render(o.target,s,this.captureCamera),await this.encodeRenderTarget(o)}}function Ia(e){return Co(e)&&e%1==0}const Ea=new ee("command.takeScreenshot");var ya,va;!function(e){e.Base64JPG="screenshot.base64.jpg",e.ArrayBufferJPG="screenshot.arraybuffer.jpg"}(ya||(ya={}));class Aa{constructor(e,t,n,o,a,s){this.canvasData=o,this.rendererModule=a,this.renderToTexture=s,this.RenderLayers=t.RenderLayers,this.screenCapturer=e,this.requestTarget=n.requestTarget,this.getRenderLayer=n.getRenderLayer,this.jpegAsBase64=n.jpegAsBase64}validateInput(e){return{resolution:this.validateResolution(e.resolution,this.canvasData,this.rendererModule),visibleObjects:this.buildVisibilityOptions(e.visibleObjects),returnType:e.returnType===ya.ArrayBufferJPG?ya.ArrayBufferJPG:ya.Base64JPG}}async exec(e,t){const n=await this.requestTarget(),o=await this.screenCapturer.capture({resolution:e.resolution,visibleObjects:this.buildVisibilityLayers(e.visibleObjects)},this.rendererModule,this.renderToTexture,n);return e.returnType===ya.ArrayBufferJPG?o.buffer:this.jpegAsBase64(o)}validateResolution(e,t,n){const o={width:0,height:0};if(!e)return o.width=t.width,o.height=t.height,o;if(!function(e){const t=e;return!!t&&("number"==typeof t.width&&"number"==typeof t.height)}(e))throw Error('"resolution" provided was not valid. Expected .width and .height to be numbers.');o.width=e.width,o.height=e.height;const a=n.maxTextureSize;if(e.width<=0||e.width>a)throw Error('"resolution.width" provided was outside the valid range of [0, '+a+"]");if(e.height<=0||e.height>a)throw Error('"resolution.height" provided was outside the valid range of [0, '+a+"]");if(!Ia(o.width)){const e=Math.round(o.width);Ea.info(`Integer width expected. Rounding from ${o.width} to ${e}`),o.width=e}if(!Ia(o.height)){const e=Math.round(o.height);Ea.info(`Integer width expected. Rounding from ${o.height} to ${e}`),o.height=e}return o}buildVisibilityOptions(e){const t=e||{};return{measurements:!!t.measurements,mattertags:!!t.mattertags,sweeps:!!t.sweeps,views:!!t.views}}buildVisibilityLayers(e){const t=this.RenderLayers.ALL;return e.mattertags||t.removeLayers(this.getRenderLayer("pins")),e.measurements||t.removeLayers(this.getRenderLayer("measurements")),e.sweeps||t.removeLayers(this.getRenderLayer("sweep-pucks")),e.views||(t.removeLayers(this.getRenderLayer("sweep-portal-mesh")),t.removeLayers(this.getRenderLayer("sweep-pin-mesh"))),t}}class Ca{constructor(e,t,n,o,a,s,i,r){this.renderer=o,this.renderToTexture=a,this.viewmodeData=s,this.sweepData=i,this.sweepTextureLoader=r,this.Viewmode=t.Viewmode,this.requestTarget=n.requestTarget,this.encodeRenderTarget=n.encodeRenderTarget,this.jpegAsBase64=n.jpegAsBase64,this.getXmp=n.getXmp,this.getOrientedAngleTo=n.getOrientedAngleTo,this.forward=new e.Vector3(0,0,-1),this.sweepForward=new e.Vector3,this.viewForward=new e.Vector3}validateInput(e){return e}async exec(e,t){if(!this.sweepData.currentSweep||this.viewmodeData.currentMode!==this.Viewmode.Panorama)throw new Error("Can only capture equirectangular projections while stationary in a sweep");const n=this.renderer.getScene().camera,o=this.sweepData.getSweep(this.sweepData.currentSweep),a=await this.sweepTextureLoader.load(o);this.sweepForward.copy(this.forward),this.sweepForward.copy(this.forward).applyQuaternion(o.rotation).setY(0);const s=this.getOrientedAngleTo(this.sweepForward,n.getWorldDirection(this.viewForward).setY(0))+Math.PI,i=await this.requestTarget();i.setSize(Ca.equirectangularRes.width,Ca.equirectangularRes.height),this.renderToTexture.renderEquirectangular(a,i.target,s);const r=await this.encodeRenderTarget(i,this.getXmp(i.width,i.height,0,0));return this.jpegAsBase64(r)}}Ca.equirectangularRes={width:4096,height:2048};class Sa{constructor(e,t){this.issueCommand=t.issueCommand,this.GetScreenPositionCommand=e.GetScreenPositionCommand}validateInput(e){if(!jo(e.worldPosition))throw Error(`Renderer.getScreenPosition: 'worldPosition' was specified but was not a valid Vector3; got ${e.worldPosition}`);return e}async exec(e,t){return await this.issueCommand(new this.GetScreenPositionCommand(e))}}class Da{constructor(e,t,n){this.floorsData=n,this.GetFloorIntersectCommand=e.GetFloorIntersectCommand,this.issueCommand=t.issueCommand}validateInput(e){if(!function(e){if(e&&"object"==typeof e&&"x"in e&&"y"in e){const t=e;return Co(t.x)&&Co(t.y)}return!1}(e.screenPosition))throw Error(`Renderer.getWorldPositionData: 'screenPosition' was not a valid Vector2; got ${e.screenPosition}`);return e}async exec(e,t){const n=await this.issueCommand(new this.GetFloorIntersectCommand(e)),o=this.floorsData.getFloorAtIndex(n.floorIndex);return o?{position:n.position,floorInfo:{id:o.id,sequence:o.index},floor:n.floorIndex}:{position:n.position,floorInfo:{id:"",sequence:-1},floor:-1}}}class ba{constructor(){this.wasTransitioning360=!1,this.cameraPosition={x:0,y:0,z:0}}create(e,t,n,o,a){return new Se(o.onChanged((()=>this.throttleCameraPositionChanges(e,o))),a.onChanged((()=>this.throttleSweepChanges(e,a))))}throttleCameraPositionChanges(e,t){const n=t.pose.position;n.x===this.cameraPosition.x&&n.y===this.cameraPosition.y&&n.z===this.cameraPosition.z||(this.cameraPosition.x=n.x,this.cameraPosition.y=n.y,this.cameraPosition.z=n.z,e.onChanged())}throttleSweepChanges(e,t){const n=t.transition;t.transitionActive?(t.isSweepUnaligned(n.from)||t.isSweepUnaligned(n.to))&&(this.wasTransitioning360=!0):this.wasTransitioning360&&!t.isSweepUnaligned(t.currentSweep)&&(e.onChanged(),this.wasTransitioning360=!1)}}class Oa{constructor(){this.currentRooms={rooms:[]}}get data(){return this.currentRooms}equals(e){return this.data.rooms.length===e.data.rooms.length&&this.currentRooms.rooms.every((t=>e.data.rooms.findIndex((e=>e.id===t.id))>-1))}copy(e){this.currentRooms.rooms.length=e.data.rooms.length,Me(this.currentRooms.rooms,e.data.rooms)}update(e,t,n,o,a,s,i,r){if(a.isInside()&&o.isSweepUnaligned(o.currentSweep)||o.transitionActive&&(o.isSweepUnaligned(o.transition.to)||o.isSweepUnaligned(o.transition.from)))return void(this.currentRooms.rooms.length=0);const c=s.meshSubGroupsFromPoint(n.pose.position);this.currentRooms.rooms.length=c.length;for(let n=0;n<c.length;++n){const o=c[n],a=e.getByMeshSubgroup(o),d=s.meshGroups.rooms.get(o);if(!a||!d)continue;const h=this.currentRooms.rooms[n]||{};h.id=i.getIdFromCwfId(a.id),h.bounds=h.bounds||{},h.bounds.min=lo(d.boundingBox,"min",h.bounds.min),h.bounds.max=lo(d.boundingBox,"max",h.bounds.max),h.floorInfo=po(a.floorId,t,r,h.floorInfo),this.currentRooms.rooms[n]=h}}}class Ma{create(e,t){return{renew(){},cancel(){}}}}class Na{constructor(e,t,n,o,a){this.roomData=e,this.floorData=t,this.roomIdMap=n,this.floorIdMap=o,this.meshData=a,this._data={}}get data(){return this._data}isItemEqual(e,t){const n=this.data[t],o=e.data[t];return n.id===o.id&&Le(n.bounds.min,o.bounds.min)&&Le(n.bounds.max,o.bounds.max)}update(){for(const e of this.roomData.rooms()){const t=this.meshData.meshGroups.rooms.get(e.meshSubgroup);if(!t)continue;const n=this.roomIdMap.getIdFromCwfId(e.id),o=this._data[n]||{};o.id=n,o.bounds=o.bounds||{},o.bounds.min=lo(t.boundingBox,"min",o.bounds.min),o.bounds.max=lo(t.boundingBox,"max",o.bounds.max),o.floorInfo=po(e.floorId,this.floorData,this.floorIdMap,o.floorInfo),this._data[n]=o}for(const e in this.data){this.roomIdMap.getRoomForId(e)||delete this._data[e]}}clear(){this._data={}}}!function(e){e.OUTPUT="output",e.INPUT="input",e.EVENT="event",e.EMIT="emit"}(va||(va={}));class Ra{constructor(e){this.sceneModule=e}validateInput(e){if(!re(e.name))throw Error(`Scene.register name ${e.name} is not a string`);if(!e.factory||"function"!=typeof e.factory)throw Error("Scene.register factory is not a function");return e}async exec(e,t){if(this.sceneModule.registerFactory({scope:t.applicationKey,name:e.name},e.factory))return{dispose:()=>{this.sceneModule.unregisterFactory(e.name,e.factory)}};throw Error("There was an error registering the scene component")}}class Pa{constructor(e){this.sceneModule=e}validateInput(e){return e}async exec(e,t){return this.sceneModule.createNode(t.applicationKey).publicFacade()}}class La extends j{constructor(e){super(),this.id="SCENE_QUERY",this.payload=e}}class xa extends j{constructor(e){super(),this.id="SCENE_CONFIGURE",this.payload=e}}class ka extends j{constructor(e){super(),this.id="SCENE_GETIMAGE",this.payload=e}}class _a{constructor(e){this.sceneModule=e}validateInput(e){return e}async exec(e,t){return this.sceneModule.deserialize(t.applicationKey,e.text).object}}const Ua=new ee("serialize");class Fa{constructor(e){this.sceneModule=e}validateInput(e){return e}async exec(e,t){Array.isArray(e.objects)&&Ua.warn("Serializing an array of ISceneNodes is deprecated and may produce an unexpected result. Serialization of the ISceneObject container should be done instead.");return Array.isArray(e.objects)?this.sceneModule.serializeNodeList(e.objects):this.sceneModule.serialize(e.objects)}}class Va{constructor(e){this.sceneModule=e}validateInput(e){if(!Co(e.count))throw Error("count is not a valid number");return e}async exec(e,t){const n=[];for(let o=0;o<e.count;o++){const e=this.sceneModule.createNode(t.applicationKey);n.push(e.publicFacade())}return n}}class Ga{constructor(e){this.sceneModule=e}validateInput(e){if(!It(e.components,lt))throw Error("Scene.registerComponents array elements must be objects");for(const t of e.components){if(!re(t.name))throw Error(`Scene.registerComponents name ${t.name} is not a string`);if(!t.factory||"function"!=typeof t.factory)throw Error("Scene.registerComponents factory is not a function")}return e}async exec(e,t){const n=[];for(const o of e.components){if(!this.sceneModule.registerFactory({scope:t.applicationKey,name:o.name},o.factory))throw Error("There was an error registering a scene component");{const e=this.sceneModule,t=function(t,n){return{dispose:function(){e.unregisterFactory(t,n)}}}(o.name,o.factory);n.push(t)}}return n}}class Ha{constructor(e){this.sceneModule=e}validateInput(e){if(!Co(e.count))throw Error("count is not a valid number");return e}async exec(e,t){const n=[];for(let o=0;o<e.count;o++)n.push(this.sceneModule.createObject(t.applicationKey).publicFacade());return n}}class za{constructor(e){this.sceneModule=e}validateInput(e){if(e=e||{},!Array.isArray(e.components))throw Error("components must be an array");return e.components=e.components||[],e}async exec(e,t){for(const t of e.components)this.sceneModule.unregisterFactory(t.name,t.factory)}}class Ba{constructor(e,t){this.sensorModule=e,this.sensorMap=t}validateInput(e){if(!re(e.sensorId)||!this.sensorMap.has(e.sensorId))throw Error("dev error: this should not occur unless the sdk was not setup properly");if(!ut(e.show))throw Error(`Sensor.showDebug: 'show' was not a boolean; got ${e.show}`);return{sensorId:e.sensorId,show:e.show}}async exec(e,t){if(e.show){const t=this.sensorMap.get(e.sensorId);this.sensorModule.setDebugSensor(t)}else this.sensorModule.setDebugSensor(null)}}class ja{constructor(e){this.sensor=e,this.sourceMap=new Map,this.reverseSourceLookup=new Map,this.sourceId=0,this._data={}}get data(){return this._data}isItemEqual(e,t){return e.data[t].inRange===this.data[t].inRange&&e.data[t].inView===this.data[t].inView}update(){for(const[e,t]of this.sensor.readings){const n=this.addOrGetSourceId(e),o=this._data[n]||{};o.inRange=t.inRange,o.inView=t.inView,o.distanceSquared=t.distanceSq,o.direction=lo(t,"direction",o.direction),this._data[n]=o}for(const e in this.data){const t=this.reverseSourceLookup.get(e);t&&!this.sensor.readings.get(t)&&(this.sourceMap.delete(t),this.reverseSourceLookup.delete(e),delete this._data[e])}}clear(){this._data={}}addOrGetSourceId(e){const t=this.sourceMap.get(e);if(t)return t;const n="source-"+ ++this.sourceId;return this.sourceMap.set(e,n),this.reverseSourceLookup.set(n,e),n}}class Wa{constructor(){this._data={origin:{x:0,y:0,z:0},forward:{x:0,y:0,z:-1}}}get data(){return this._data}equals(e){const t=1e-5;return Le(this.data.origin,e.data.origin,t)&&Le(this.data.forward,e.data.forward,t)}copy(e){be(this._data.origin,e.data.origin),be(this._data.forward,e.data.forward)}update(e){be(this._data.origin,e.frustum.origin),be(this._data.forward,e.frustum.forward)}}class qa{constructor(e,t,n,o,a){this.sdkModule=e,this.sensorFactories=t,this.sensors=n,this.sensorMap=o,this.removerMap=a}validateInput(e){if(!ve(h.SensorType,e.type))throw Error(e.type+" is not a valid sensor type");return this.sensorFactories[e.type].validateInput(e)}async exec(e,t){const n=this.sensorFactories[e.type].create(e,this.sensors),o="sensor-"+ ++qa.nextSensorId;this.sensorMap.set(o,n);const a=U.create(new me(n),new Ka,new F(Wa)),s=this.sdkModule.addObservable(o,a),i=Qe.create(new me(n),new Ya,new F(ja)),r=this.sdkModule.addCollection(o,i);return this.removerMap.set(o,{dispose(){s.dispose(),r.dispose()}}),{sensorId:o}}}qa.nextSensorId=0;class $a{validateInput(e){return e}create(e,t){return t.createCameraBoundSensor()}}class Ka{create(e,t){return t.frustum.observe(new Xa(e))}}class Ya{create(e,t){return t.onReadingsUpdated(new Xa(e))}}class Xa{constructor(e){this.dependencyObserver=e}notify(){this.dependencyObserver.onChanged()}}class Za{constructor(e,t){this.sensorMap=e,this.sourceMap=t}validateInput(e){if(!re(e.sensorId)||!this.sensorMap.has(e.sensorId))throw Error("dev error: this should not occur unless the sdk was not setup properly");if(!It(e.sourceIds,re))throw Error("dev error: this should not occur unless the sdk was not setup properly");for(const t of e.sourceIds)if(!this.sourceMap.has(t))throw Error("dev error: this should not occur unless the sdk was not setup properly");return{sensorId:e.sensorId,sourceIds:e.sourceIds}}async exec(e,t){const n=this.sensorMap.get(e.sensorId),o=e.sourceIds.map(this.sourceMap.get,this.sourceMap);n.addSource(...o)}}class Qa{constructor(e,t){this.sensorMap=e,this.removerMap=t}validateInput(e){if(!re(e.sensorId)||!this.sensorMap.has(e.sensorId))throw Error("dev error: this should not occur unless the sdk was not setup properly");return{sensorId:e.sensorId}}async exec(e,t){this.removerMap.get(e.sensorId).dispose();this.sensorMap.get(e.sensorId).dispose()}}const Ja={namespace:"Sensor",name:"createSensor",subRoutine:"sensor.create",args:[]},es={namespace:"Sensor",name:"createSource",subRoutine:"source.create",args:["type","options"]};class ts{constructor(e,t,n){this.radius=1/0,this.type=e.SPHERE,this._volume=t}get origin(){return this._volume.origin}get volume(){return this._volume}describeVolume(){return{origin:this._volume.origin,radius:this._volume.radius}}}const ns=Math.PI/180;class os{constructor(e,t,n){this.type=e.BOX,this._volume=t,this.eulerCache=new n.Euler,this.quaternionCache=new n.Quaternion}get origin(){return this._volume.origin}get volume(){return this._volume}describeVolume(){return{center:this._volume.center,size:this._volume.size,orientation:this.convertQuaternionToOrientation(this._volume.orientation)}}updateOrientation(e){this.eulerCache.set(e.pitch*ns,e.yaw*ns,e.roll*ns,"YXZ"),this.quaternionCache.setFromEuler(this.eulerCache),this._volume.updateOrientation(this.quaternionCache)}convertQuaternionToOrientation(e){return this.eulerCache.setFromQuaternion(this.quaternionCache.set(e.x,e.y,e.z,e.w)).reorder("YXZ"),{yaw:this.eulerCache.y*ns,pitch:this.eulerCache.x*ns,roll:this.eulerCache.z*ns}}}class as{constructor(e,t,n){this.type=e.CYLINDER,this._volume=t}get origin(){return this._volume.origin}get volume(){return this._volume}describeVolume(){return{basePoint:this._volume.basePoint,height:this._volume.height,radius:this._volume.radius}}}function ss(e){if(e&&"object"==typeof e&&"yaw"in e&&"pitch"in e&&"roll"in e){const t=e;return Co(t.yaw)&&Co(t.pitch)&&Co(t.roll)}return!1}class is{constructor(e,t){this.sourceFactories=e,this.sourceMap=t}validateInput(e){if(!ve(h.SourceType,e.type))throw Error(e.type+" is not a valid source type");return this.sourceFactories[e.type].validateInput(e)}async exec(e,t){const n=this.sourceFactories[e.type].create(e),o="source-"+ ++is.nextSourceId;return this.sourceMap.set(o,n),{sourceId:o,type:e.type,volume:n.describeVolume()}}}is.nextSourceId=0;class rs{constructor(e,t,n){this.sourceType=e,this.sphereVolumeFactory=t,this.THREE=n}validateInput(e){if(lt(e.options)){if(e.options.origin&&!jo(e.options.origin))throw Error(`Source.Box: 'origin' was specified but was not a valid Vector3; got ${e.options.origin}`);if(e.options.radius&&(!Co(e.options.radius)||e.options.radius<0))throw Error(`Source.Sphere: 'radius' was specified but was not a positive number or Infinity; got ${e.options.radius}`)}const t=e.options||{};return{type:e.type,options:{origin:t.origin||{x:0,y:0,z:0},radius:t.hasOwnProperty("radius")?t.radius:1/0}}}create(e){const t=new ts(this.sourceType,new this.sphereVolumeFactory,this.THREE),n=t.volume;return n.updateOrigin(e.options.origin),n.updateRadius(e.options.radius),t}}class cs{constructor(e,t,n){this.sourceType=e,this.boxVolumeFactory=t,this.THREE=n}validateInput(e){if(lt(e.options)){if(e.options.center&&!jo(e.options.center))throw Error(`Source.Box: 'center' was specified but was not a valid Vector3; got ${e.options.center}`);if(e.options.size&&(!jo(e.options.size)||e.options.size.x<0||e.options.size.y<0||e.options.size.z<0))throw Error(`Source.Box: 'size' was specified but was not a valid Vector3; got ${e.options.size}`);if(e.options.orientation&&!ss(e.options.orientation))throw Error(`Source.Box: 'orientation' was specified but was not a valid Orientation; got ${e.options.orientation}`)}const t=e.options||{};return{type:e.type,options:{center:t.center||{x:0,y:0,z:0},size:t.size||{x:1/0,y:1/0,z:1/0},orientation:t.orientation||{yaw:0,pitch:0,roll:0}}}}create(e){const t=new os(this.sourceType,new this.boxVolumeFactory,this.THREE),n=t.volume;return n.updateCenter(e.options.center),n.updateDimensions(e.options.size),t.updateOrientation(e.options.orientation),t}}class ds{constructor(e,t,n){this.sourceType=e,this.cylinderVolumeFactory=t,this.THREE=n}validateInput(e){if(lt(e.options)){if(e.options.basePoint&&!jo(e.options.basePoint))throw Error(`Source.Cylinder: 'basePoint' was specified but was not a valid Vector3; got ${e.options.basePoint}`);if(e.options.hasOwnProperty("height")&&(!Co(e.options.height)||e.options.height<0))throw Error(`Source.Cylinder: 'height' was specified but was not a positive number or Infinity; got ${e.options.height}`);if(e.options.hasOwnProperty("radius")&&(!Co(e.options.radius)||e.options.radius<0))throw Error(`Source.Cylinder: 'radius' was specified but was not a positive number or Infinity; got ${e.options.radius}`)}const t=e.options||{};return{type:e.type,options:{basePoint:t.basePoint||{x:0,y:0,z:0},height:t.hasOwnProperty("height")?t.height:1/0,radius:t.hasOwnProperty("radius")?t.radius:1/0}}}create(e){const t=new as(this.sourceType,new this.cylinderVolumeFactory,this.THREE),n=t.volume;return n.updateBasePoint(e.options.basePoint),n.updateHeight(e.options.height),n.updateRadius(e.options.radius),t}}class hs{constructor(e,t){this.sourceUpdaters=e,this.sourceMap=t}validateInput(e){if(!re(e.sourceId)||!this.sourceMap.has(e.sourceId))throw Error("dev error: this should not occur unless the sdk was not setup properly");const t=this.sourceMap.get(e.sourceId);return this.sourceUpdaters[t.type].validateInput(e)}async exec(e,t){const n=this.sourceMap.get(e.sourceId);this.sourceUpdaters[n.type].update(e,n)}}class ls{validateInput(e){if(!lt(e.options))throw Error("Source.Sphere.update: invalid options provided to .update");if(!jo(e.options.origin))throw Error(`Source.Sphere.update: 'origin' was specified but was not a valid Vector3; got ${e.options.origin}`);if(!Co(e.options.radius)||e.options.radius<0)throw Error(`Source.Sphere.update: 'radius' was specified but was not a positive number or Infinity; got ${e.options.radius}`);return e}update(e,t){const n=t.volume;n.updateOrigin(e.options.origin),n.updateRadius(e.options.radius),n.notify()}}class us{validateInput(e){if(!lt(e.options))throw Error("Source.Box.update: invalid options provided to .update");if(e.options.center&&!jo(e.options.center))throw Error(`Source.Box.update: 'center' was specified but was not a valid Vector3; got ${e.options.center}`);if(e.options.size&&!(jo(e.options.size)&&e.options.size.x>=0&&e.options.size.y>=0&&e.options.size.z>=0))throw Error(`Source.Box.update: 'size' was specified but was not a valid Vector3; got ${JSON.stringify(e.options.size)}\n ${"object"==typeof e}`);if(e.options.orientation&&!ss(e.options.orientation))throw Error(`Source.Box.update: 'orientation' was specified but was not a valid Orientation; got ${e.options.orientation}`);return e}update(e,t){const n=t.volume;n.updateCenter(e.options.center),n.updateDimensions(e.options.size),t.updateOrientation(e.options.orientation),n.notify()}}class ps{validateInput(e){if(!lt(e.options))throw Error("Source.Cylinder.update: invalid options provided to .update");if(e.options.basePoint&&!jo(e.options.basePoint))throw Error(`Source.Cylinder.update: 'basePoint' was specified but was not a valid Vector3; got ${e.options.basePoint}`);if(e.options.hasOwnProperty("height")&&(!Co(e.options.height)||e.options.height<0))throw Error(`Source.Cylinder.update: 'height' was specified but was not a positive number or Infinity; got ${e.options.height}`);if(e.options.hasOwnProperty("radius")&&(!Co(e.options.radius)||e.options.radius<0))throw Error(`Source.Cylinder: 'radius' was specified but was not a positive number or Infinity; got ${e.options.radius}`);return e}update(e,t){const n=t.volume;n.updateBasePoint(e.options.basePoint),n.updateHeight(e.options.height),n.updateRadius(e.options.radius),n.notify()}}function ms(e,t,n){const o=new Map,a=new Map;return function(s,i){!function(e,t,n,o){const a=new Map,s=ne.create(new me(t,n),new F(Za)),i=ne.create(new me(t,a),new F(Qa)),r=ne.create(me.extend(o,t),new F(Ba));e.addCommand("Sensor.addSource",s),e.addCommand("sensor.dispose",i),e.addCommand("sensor.showDebug",r);const c={[h.SensorType.CAMERA]:new $a},d=ne.create(me.extend(o,t,a),new F(qa,e,c));e.addCommandToInterface(Object.assign({},Ja),d),e.addEnumToInterface({namespace:"Sensor",name:"SensorType",values:h.SensorType})}(s,o,a,i),function(e,t,n,o,a){const s=new me(t),i={[o.SPHERE]:new ls,[o.BOX]:new us,[o.CYLINDER]:new ps},r=ne.create(s,new F(hs,i));e.addCommand("Sensor.updateSource",r);const c={[h.SourceType.SPHERE]:new rs(o,a.sphere,n),[h.SourceType.BOX]:new cs(o,a.box,n),[h.SourceType.CYLINDER]:new ds(o,a.cylinder,n)},d=ne.create(s,new F(is,c));e.addCommandToInterface(Object.assign({},es),d),e.addEnumToInterface({namespace:"Sensor",name:"SourceType",values:h.SourceType})}(s,a,e,t,n)}}var gs;!function(e){e.FPS="stat.fps"}(gs||(gs={}));class ws{constructor(e,t){this.perfStatInterval=1e3,this.elapsedTime=0,this.frameCount=0,this.lastCalcTime=0,this.fps=[0],this.waitForUpdate=e,this.perfStatInterval=t.tryGetProperty("perfInterval",this.perfStatInterval)}async calcAndBroadcast(e){await this.waitForUpdate();const t=Date.now(),n=t-this.lastCalcTime;this.lastCalcTime=t,this.elapsedTime+=n,this.frameCount++,this.elapsedTime>=this.perfStatInterval&&(this.fps[0]=1e3*this.frameCount/this.elapsedTime,this.elapsedTime=0,this.frameCount=0,e.broadcast(gs.FPS,(()=>this.fps))),this.calcAndBroadcast(e)}}function fs(e,t="",n=""){let o="sdkStorage/";return t&&t.length>0&&(o=o+t+"/"),n&&n.length>0&&(o=o+n+"/"),o+e}class Ts{constructor(e){this.modelData=e}validateInput(e){const t=null==e?void 0:e.key;if(!t||"string"!=typeof t)throw Error(t+" is not a valid key");return e}async exec(e){localStorage.setItem(fs(e.key,this.modelData.model.sid),JSON.stringify(e.data))}}class Is{constructor(e){this.modelData=e}validateInput(e){const t=null==e?void 0:e.key;if(!t||"string"!=typeof t)throw Error(t+" is not a valid key");return{key:e.key}}async exec(e){const t=localStorage.getItem(fs(e.key,this.modelData.model.sid));return t?JSON.parse(t):null}}class Es{constructor(e){this.modelData=e}validateInput(e){let t=null==e?void 0:e.modelId;if(null==t)t=this.modelData.model.sid;else if("*"===t)t="";else if("string"!=typeof t)throw Error(t+" is not a valid key");return{modelId:t}}async exec(e){const t=fs("",e.modelId),n={};for(const[e,o]of Object.entries(localStorage))e.startsWith(t)&&(n[e.slice(t.length)]=JSON.parse(o));return n}}class ys{constructor(e){this.modelData=e}validateInput(e){const t=null==e?void 0:e.key;if(!t||"string"!=typeof t)throw Error(t+" is not a valid key");return{key:e.key}}async exec(e){localStorage.removeItem(fs(e.key,this.modelData.model.sid))}}class vs{constructor(e,t){this.toSdkAlignmentMap={[e.ALIGNED]:l.Alignment.ALIGNED,[e.UNALIGNED]:l.Alignment.UNALIGNED},this.toSdkPlacementMap={[t.UNPLACED]:l.Placement.UNPLACED,[t.AUTO]:l.Placement.AUTO,[t.MANUAL]:l.Placement.MANUAL}}toSdkAlignment(e){return this.toSdkAlignmentMap[e]}toSdkPlacement(e){return this.toSdkPlacementMap[e]}}const As=Object.freeze({signedUrlDefaultExpireTime:24e4,signedUrlCheckInterval:1e4,signedUrlRefreshBuffer:15e3,visionTilingStartDate:new Date("8/26/2016"),visionTilingStartVersion:"1.1.407.13667",epsilon:1e-5,skyboxMeshGroup:"_group_skybox_",skysphereMeshGroup:"_group_skysphere_"});class Cs{constructor(){this.currentSweep="",this.sweepTransitionActive=!1,this.currentMode=null,this.modeTransitionActive=!1}create(e,t,n){return new Se(t.onChanged((()=>this.throttleSweepDataChanges(e,t))),n.onChanged((()=>this.throttleViewmodeDataChanges(e,n))))}throttleSweepDataChanges(e,t){const n=t.currentSweep||"",o=t.transition.active&&t.transition.to!==t.transition.from;this.currentSweep===n&&this.sweepTransitionActive===o||(this.currentSweep=n,this.sweepTransitionActive=o,e.onChanged())}throttleViewmodeDataChanges(e,t){const n=t.currentMode,o=t.transition.active;this.currentMode===n&&this.modeTransitionActive===o||(this.currentMode=n,this.modeTransitionActive=o,e.onChanged())}}class Ss{constructor(e,t){this.currentSweep=Object.assign(Object.assign({},Ss.empty),{floorInfo:Object.assign({},Ss.empty.floorInfo),neighbors:[],position:Object.assign({},Ss.empty.position),rotation:Object.assign({},Ss.empty.rotation)}),this.Viewmode=e.Viewmode,this.sweepPlacementConverter=t.sweepPlacementConverter}get data(){return this.currentSweep}equals(e){const t=As.epsilon;return this.currentSweep.id===e.data.id&&this.currentSweep.enabled===e.data.enabled&&this.currentSweep.alignmentType===e.data.alignmentType&&this.currentSweep.placementType===e.data.placementType&&this.currentSweep.floorInfo.id===e.data.floorInfo.id&&this.currentSweep.floorInfo.sequence===e.data.floorInfo.sequence&&this.compareNeighbors(e.currentSweep)&&Le(this.currentSweep.position,e.data.position,t)&&Le(this.currentSweep.rotation,e.data.rotation,t)}copy(e){this.copySweep(e.data)}update(e,t,n,o,a){const s=e.currentSweepObject;if(!s||e.transition.active||t.transition.active||!t.isInside()&&t.currentMode!==this.Viewmode.Outdoor)return void this.copySweep(Ss.empty);let i;try{i=n.getFloor(s.floorId||"")}catch(e){i={id:void 0,index:void 0}}const r=o.getIdForSweep(s);this.currentSweep.uuid=s.uuid,this.currentSweep.sid=r,this.currentSweep.id=r,this.currentSweep.enabled=s.enabled,this.currentSweep.alignmentType=this.sweepPlacementConverter.toSdkAlignment(s.alignmentType),this.currentSweep.placementType=this.sweepPlacementConverter.toSdkPlacement(s.placementType),this.currentSweep.neighbors=[...s.neighbours],be(this.currentSweep.position,s.position),be(this.currentSweep.rotation,s.rotation),this.currentSweep.alignmentType===l.Alignment.UNALIGNED&&this.currentSweep.placementType===l.Placement.UNPLACED?(this.currentSweep.floorInfo.id=void 0,this.currentSweep.floorInfo.sequence=void 0):(this.currentSweep.floorInfo.id=i.id?a.getIdFromCwfId(i.id):i.id,this.currentSweep.floorInfo.sequence=i.index)}copySweep(e){this.currentSweep.uuid=e.uuid,this.currentSweep.sid=e.sid,this.currentSweep.id=e.id,this.currentSweep.enabled=e.enabled,this.currentSweep.alignmentType=e.alignmentType,this.currentSweep.placementType=e.placementType,this.currentSweep.floorInfo.id=e.floorInfo.id,this.currentSweep.floorInfo.sequence=e.floorInfo.sequence,this.currentSweep.neighbors=[...e.neighbors],be(this.currentSweep.position,e.position),be(this.currentSweep.rotation,e.rotation)}compareNeighbors(e){const t=this.currentSweep.neighbors.length;for(let n=0;n<t;++n)if(this.currentSweep.neighbors[n]!==e.neighbors[n])return!1;return t===e.neighbors.length}}Ss.empty={uuid:"",sid:"",id:"",enabled:!1,alignmentType:l.Alignment.ALIGNED,placementType:l.Placement.UNPLACED,floorInfo:{id:void 0,sequence:void 0},neighbors:[],position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}};class Ds{constructor(e,t,n,o){this.sweepData=n,this.sweepIdMap=o,this.NavigateToSweepCommand=e.NavigateToSweepCommand,this.issueCommand=t.issueCommand,this.cameraTransitionConverter=t.cameraTransitionConverter,this.conversion=t.conversionUtils}validateInputSweepId(e,t,n){if(!e||!re(e))throw Error(`Sweep.moveTo: 'sweep' was not a valid sweep id; got ${e}`);const o=n.getSweepForId(e);if(!o)throw Error(e+" does not map to a valid sweep in this model");return o.id}validateInputRotation(e){if(!e)return;const t=Error(`Sweep.moveTo: 'options.rotation' was specified but was not a valid Rotation; got ${e}`);if(e&&!lt(e))throw t;const n=e||{},o={x:So(n.x),y:So(n.y)};if(n.z&&(o.z=So(n.z)),!function(e){const t=e;return!!t&&!("object"!=typeof t||"z"in t&&!Co(t.z))&&Co(t.x)&&Co(t.y)}(o))throw t;return o}validateTransitionTime(e){if(!e)return;const t=Error(`Sweep.moveTo: options.transitionTime was specified but was not a valid, positive time; got ${e}`);if(!Co(e)&&!re(e))throw t;const n="number"==typeof e?e:So(e);if(!Co(n)||n<=0)throw t;return n}validateInput(e){const t=this.validateInputSweepId(e.sweep,this.sweepData,this.sweepIdMap),n=e.options||{},o=this.validateInputRotation(n.rotation),a=this.validateTransitionTime(n.transitionTime);if(n.transition&&!ve(I,n.transition))throw Error(`Sweep.moveTo: options.transition was specified but was not a valid transition type; got ${n.transition}`);return{sweep:t,options:{rotation:o,transition:n.transition,transitionTime:a}}}async exec(e,t){const n=e.options.rotation?this.conversion.rotationToQuaternion(e.options.rotation):void 0,o=e.options.transition,a=e.options.transition?this.cameraTransitionConverter.fromSdkTransition(o):void 0,s=e.options.transitionTime;return await this.issueCommand(new this.NavigateToSweepCommand({sweep:e.sweep,rotation:n,transition:a,transitionTime:s}))}}class bs{create(e,t){return t.onChanged((()=>e.onChanged()))}}class Os{constructor(e,t,n,o,a,s){this.sweepData=n,this.floorsData=o,this.sweepIdMap=a,this.floorIdMap=s,this._data={},this.conversionUtils=e,this.sweepPlacementConverter=t}get data(){return this._data}isItemEqual(e,t){return!H(this.data[t],e.data[t])}update(){for(const e of this.sweepData.sweeps()){const{id:t,index:n}=e.floorId?this.floorsData.getFloor(e.floorId):{id:"",index:-1},o=t?this.floorIdMap.getIdFromCwfId(t):void 0,a=this.sweepIdMap.getIdFromCwfId(e.id),s=this.data[a]||{};s.uuid=e.uuid,s.sid=a,s.id=a,s.enabled=e.enabled,s.alignmentType=this.sweepPlacementConverter.toSdkAlignment(e.alignmentType),s.neighbors=e.neighbours.map((e=>this.sweepIdMap.getIdFromCwfId(e))),s.position=Ms(e,s.position),s.rotation=this.conversionUtils.quaternionToRotation(e.rotation,s.rotation),s.floorInfo=o?{id:o,sequence:n}:{id:"",sequence:-1},this.data[s.id]=s}for(const e in this.data){this.sweepIdMap.getSweepForId(e)||delete this.data[e]}}clear(){this._data={}}}function Ms(e,t){return(t=t||{}).x=e.position.x,t.y=e.position.y,t.z=e.position.z,t}class Ns{constructor(e,t,n){this.sweepData=e,this.sweepViewData=t,this.sweepIdMap=n}validateInput(e){return{sweepIds:Ps(e.sweepIds,this.sweepData,this.sweepIdMap)}}async exec(e,t){for(const t of e.sweepIds)Ls(t,!0,this.sweepData,this.sweepViewData)}}class Rs{constructor(e,t,n){this.sweepData=e,this.sweepViewData=t,this.sweepIdMap=n}validateInput(e){return{sweepIds:Ps(e.sweepIds,this.sweepData,this.sweepIdMap)}}async exec(e,t){for(const t of e.sweepIds)Ls(t,!1,this.sweepData,this.sweepViewData)}}function Ps(e,t,n){if(!Array.isArray(e))throw Error();return e.map((e=>function(e,t,n){if(!re(e))throw Error(e+" is not a valid string input");const o=n.getSweepForId(e);if(!o)throw Error(e+" does not map to a valid sweep in this model");return o.id}(e,0,n)))}function Ls(e,t,n,o){o.setVisible(e,t);const a=n.getSweep(e);a.enabled=t,a.commit()}class xs{create(e,t){return t.onChanged({notify(){e.onChanged()}})}}class ks{constructor(e){this.attachmentRegistry=e,this._data={}}get data(){return this._data}isItemEqual(e,t){return this.data[t].id===e.data[t].id&&this.data[t].src===e.data[t].src&&this.data[t].type===e.data[t].type}update(){for(const[,e]of this.attachmentRegistry.descriptors()){const t=this._data[e.id]||{};t.id=e.id,t.src=e.src,t.type=e.type,this._data[e.id]=t}for(const e in this.data){this.attachmentRegistry.has(e)||delete this._data[e]}}clear(){this._data={}}}class _s{constructor(e,t){this.mattertagData=e,this.attachmentRegistry=t,this.attachmentCounts=new Map}validateInput(e,t){re(e.tagId)||this.throw(oe("tagId","string",e.tagId)),this.mattertagData.getTag(e.tagId)||this.throw(`${e.tagId} does not map to a valid tag`),It(e.attachmentIds,re)||this.throw(oe("attachmentId","string or strings",e.tagId));for(const n of e.attachmentIds)this.attachmentRegistry.get(t.applicationKey,n)||this.throw(`${n} does not map to a valid attachment`);return{tagId:e.tagId,attachmentIds:e.attachmentIds}}async exec(e,t){for(const n of e.attachmentIds){const o=this.attachmentRegistry.get(t.applicationKey,n);o||this.throw(`${n} does not map to a valid attachment`);const a=this.attachmentCounts.get(o)||0;this.attachmentCounts.set(o,a+1);const s=this.mattertagData.getTag(e.tagId);o.category===Jn.UPLOAD?s.fileAttachments.push(o):o.category===Jn.EXTERNAL?s.externalAttachments.push(o):o.category===Jn.SANDBOX&&s.sandboxAttachments.push(Object.assign(Object.assign({},o),{src:o.src+`?id=${o.id}&parent=${e.tagId}&${a}`}))}this.mattertagData.commit()}throw(e){throw Error("Tag.attach: "+e)}}class Us{constructor(e,t){this.mattertagData=e,this.attachmentRegistry=t}validateInput(e,t){re(e.tagId)||this.throw(oe("tagId","string",e.tagId)),this.mattertagData.getTag(e.tagId)||this.throw(`${e.tagId} does not map to a valid tag`),It(e.attachmentIds,re)||this.throw(oe("attachmentId","string or strings",e.tagId));for(const n of e.attachmentIds)this.attachmentRegistry.get(t.applicationKey,n)||this.throw(`${n} does not map to a valid attachment`);return{tagId:e.tagId,attachmentIds:e.attachmentIds}}async exec(e,t){for(const n of e.attachmentIds){const o=this.attachmentRegistry.get(t.applicationKey,n);if(!o)return void this.throw(`${n} does not map to a valid attachment`);const a=this.mattertagData.getTag(e.tagId);o.category===Jn.UPLOAD?Fs(a.fileAttachments,o.id):o.category===Jn.EXTERNAL?Fs(a.externalAttachments,o.id):o.category===Jn.SANDBOX&&Fs(a.sandboxAttachments,o.id)}this.mattertagData.commit()}throw(e){throw Error("Tag.detach: "+e)}}function Fs(e,t){const n=e.findIndex((e=>e.id===t));n>=0&&e.splice(n,1)}class Vs{constructor(e){this.attachmentRegistry=e,this.log=new ee("tag.registerAttachment")}validateInput(e,t){const n=e.srcs;return It(n,ce)||(It(n,this.validateDescriptor)&&this.log.warn("Using attachment descriptors is deprecated and will be removed when Early Access closes."),this.throw(oe("descriptors","Array of AttachmentDescriptors or strings",n))),{srcs:n}}validateDescriptor(e,t){return lt(e)||this.throw(`descriptor #${t} is not an object`),re(e.src)||this.throw(`descriptor[${t}].src is not a string`),ve(u.AttachmentType,e.type)&&e.type!==u.AttachmentType.UNKNOWN||this.throw(`descriptor[${t}].type is not a valid attachment type`),e.type===u.AttachmentType.SANDBOX&&this.throw(`descriptor[${t}] has type ${u.AttachmentType.SANDBOX} and should be registered using 'Tag.registerSandbox' instead`),!0}async exec(e,t){const n=[];for(const o of e.srcs){const e="string"==typeof o?await this.attachmentRegistry.addBySrc(t.applicationKey,o):this.attachmentRegistry.add(t.applicationKey,o);n.push(e)}return n}throw(e){throw Error("Tag.registerAttachment: "+e)}}class Gs{create(e,t){return t.onChanged((()=>e.onChanged()))}}class Hs{constructor(e,t,n,o,a){this.THREE=e,this.mattertagData=t,this.roomIdMap=n,this.roomData=o,this.meshData=a,this._data={}}get data(){return this._data}isItemEqual(e,t){return!H(this.data[t],e.data[t])}update(){const e=e=>{const t=(new this.THREE.Vector3).set(e.x,e.y,e.z);for(const e of this.roomData.rooms()){const n=this.meshData.meshGroups.rooms.get(e.meshSubgroup);if(n&&n.boundingBox.containsPoint(t))return e}};for(const t of this.mattertagData.getTagList()){const n=this.mattertagData.getTag(t),o=this.data[n.sid]||{};if(o.id=n.sid,o.anchorPosition=lo(n,"anchorPosition",o.anchorPosition),o.stemVector=lo(n,"stemVector",o.stemVector),o.stemVisible=n.stemVisible,o.label=n.label,o.description=n.description,o.color=uo(n,"color",o.color),o.keywords=Me(o.keywords||[],n.keywords),n.roomId)o.roomId=this.roomIdMap.getIdFromCwfId(n.roomId);else{const t=e(o.anchorPosition);t&&t.id&&(o.roomId=this.roomIdMap.getIdFromCwfId(t.id))}const a=n.fileAttachments.map((e=>e.id)),s=n.externalAttachments.map((e=>e.id)),i=n.sandboxAttachments.map((e=>e.id));o.attachments=[...a,...s,...i],this._data[n.sid]=o}for(const e in this.data){this.mattertagData.getTag(e)||delete this._data[e]}}clear(){this._data={}}}function zs(e){if(e&&"object"==typeof e&&"r"in e&&"g"in e&&"b"in e){const t=e;return Co(t.r)&&Co(t.g)&&Co(t.b)}return!1}const Bs=new ee("mattertag-util");function js(e,t,n,o){const a=o.meshSubGroupsFromPoint(e);let s=1/0,i="";for(const t of n.rooms())if(a.includes(t.meshSubgroup)){const n=o.meshGroups.rooms.get(t.meshSubgroup),a=e.y-((null==n?void 0:n.boundingBox.min.y)||-1/0);a<s&&(s=a,i=t.floorId)}try{return t.getFloor(i).index}catch(e){return Bs.debug("Unable to deduce floor index from position; defaulting to floor 0"),0}}const Ws=new ee("command.add");class qs{constructor(e,t,n,o,a,s,i,r,c,d,h,l,u){this.THREE=e,this.AddMattertagCommand=t.AddMattertagCommand,this.issueCommand=n.issueCommand,this.mattertagsData=o,this.tagAttach=a,this.tagEditIcon=s,this.tagEditOpacity=i,this.attachmentRegistry=r,this.iconMaps=c,this.floorsData=h,this.roomData=l,this.meshData=u}validateInput(e,t){const{descriptors:n}=e;return It(n,((e,n)=>this.validateDescriptor(e,n,t)))||this.throw("descriptors is not an array"),{descriptors:n}}validateDescriptor(e,t,n){var o,a,s;if(lt(e)||this.throw(`descriptor #${t} is not an object`),jo(e.anchorPosition)||this.throw(`descriptor[${t}].anchorPosition is not vector`),jo(e.stemVector)||this.throw(`descriptor[${t}].stemVector is not vector`),void 0===e.id||re(e.id)||this.throw(`descriptor[${t}].id is not a valid string`),void 0===e.stemVisible||ut(e.stemVisible)||this.throw(`descriptor[${t}].stemVisible is not a boolean`),void 0===e.label||ce(e.label)||this.throw(`descriptor[${t}].label is not a string`),void 0===e.description||ce(e.description)||this.throw(`descriptor[${t}].description is not a string`),void 0!==e.attachments){It(e.attachments,ce)||this.throw(`descriptor[${t}].attachments is not an array of strings`);for(let o=0;o<e.attachments.length;++o){const a=e.attachments[o];this.attachmentRegistry.get(n.applicationKey,a)||this.throw(`descriptor[${t}].attachment[${o}] does not map to a valid attachment`)}}return void 0===e.color||zs(e.color)||this.throw(`descriptor[${t}].color is not a Color`),void 0!==e.opacity&&(Co(e.opacity)||this.throw(`descriptor[${t}].opacity is not a number`),a=e.opacity,s=1,0<=a&&a<=s||(Ws.warn(`descriptor[${t}].opacity was clamped from ${e.opacity} to the range [0, 1]`),e.opacity=function(e,t,n){return Math.max(t,Math.min(e,n))}(e.opacity,0,1))),void 0===e.iconId||re(e.iconId)||this.throw(`descriptor[${t}].iconId is not a valid string`),e.id&&this.mattertagsData.getTag(e.id)&&this.throw(`descriptor[${t}].id (${e.id}) is already in use`),e.iconId&&!(null===(o=this.iconMaps.get(n.applicationKey))||void 0===o?void 0:o.imagePromise[e.iconId])&&this.throw(`descriptor[${t}].iconId (${e.iconId}) does not map to a registered icon`),!0}async exec(e,t){const n=[],o=[];for(let t=0;t<e.descriptors.length;t++){const a=new this.THREE.Vector3,s=new this.THREE.Vector3,i=e.descriptors[t];a.set(i.anchorPosition.x,i.anchorPosition.y,i.anchorPosition.z),s.set(i.stemVector.x,i.stemVector.y,i.stemVector.z);const r=s.length();s.normalize();const c=js(a,this.floorsData,this.roomData,this.meshData),d=this.floorsData.getFloorAtIndex(c);d||this.throw(`Could not add Tag on invalid floor with index: ${c}`),n.push({id:i.id,positionOptions:{position:a,normal:s,floorId:d.id},standardOptions:{label:i.label,description:i.description,stemVisible:i.stemVisible,stemHeight:r,color:i.color}}),i.attachments&&o.push(t)}const a=await this.issueCommand(new this.AddMattertagCommand(n));for(let n=0;n<e.descriptors.length;n++){const o=a[n],s=e.descriptors[n];void 0!==s.opacity&&await this.tagEditOpacity.exec({id:o,opacity:s.opacity},t),void 0!==s.iconId&&se(this.tagEditIcon,{id:o,iconId:s.iconId},t),s.attachments&&se(this.tagAttach,{tagId:o,attachmentIds:s.attachments},t)}return a}throw(e){throw Error("Tag.add: "+e)}}function $s(e,t){return re(e)&&!!t.getTag(e)}class Ks{constructor(e,t){this.externals=e,this.mattertagsData=t}validateInput(e,t){var n;if(!$s(e.id,this.mattertagsData))throw Error(`${e.id} does not map to a valid Tag`);if(void 0!==e.options&&!lt(e.options))throw Error(oe("options","object",e.options));return{id:e.id,options:{force:!!(null===(n=e.options)||void 0===n?void 0:n.force)}}}async exec(e,t){await this.externals.issueCommand(new this.externals.OpenTagCommand(e.id,{forceOpen:e.options.force}))}}class Ys{constructor(e,t){this.externals=e,this.mattertagsData=t}validateInput(e,t){var n;if(!$s(e.id,this.mattertagsData))throw Error(`${e.id} does not map to a valid Tag`);if(void 0!==e.options&&!lt(e.options))throw Error(oe("options","object",e.options));return{id:e.id,options:{force:!!(null===(n=e.options)||void 0===n?void 0:n.force)}}}async exec(e,t){await this.externals.issueCommand(new this.externals.DockAnnotationCommand(e.id,yo.TAG,e.options.force))}}class Xs{constructor(e,t,n){this.externals=e,this.mattertagsData=t,this.tagsViewData=n}validateInput(e,t){if(!$s(e.id,this.mattertagsData))throw Error(`${e.id} does not map to a valid Tag`);return{id:e.id}}async exec(e,t){var n;(null===(n=this.tagsViewData.openTagView)||void 0===n?void 0:n.id)===e.id&&await this.externals.issueCommand(new this.externals.CloseTagCommand)}}var Zs;!function(e){e.MATTERTAG="mattertag",e.NOTE="note",e.OBJECT="object"}(Zs||(Zs={}));Zs.MATTERTAG,Zs.NOTE,Zs.OBJECT;var Qs,Js,ei;!function(e){e.DEFAULT="default",e.HIGHLIGHTED="highlighted",e.DIMMED="dimmed"}(Qs||(Qs={})),function(e){e.IDLE="idle",e.CREATING="creating",e.PRESSING="pressing",e.PLACING="placing",e.PLACED="placed"}(Js||(Js={})),function(e){e.UP="up",e.UP_LEFT="up-left",e.UP_RIGHT="up-right",e.DOWN="down",e.DOWN_LEFT="down-left",e.DOWN_RIGHT="down-right",e.LEFT="left",e.RIGHT="right"}(ei||(ei={}));class ti{constructor(){this.focusedPin=null,this.selectedPin=null,this.dockedAnnotation=null}create(e,t,n){return new Se(t.onChanged((()=>this.throttlePinChanges(e,t))),n.onChanged((()=>this.throttleAnnotationChanges(e,n))))}throttlePinChanges(e,t){var n,o;const a=null!==(o=null===(n=t.focusedPin)||void 0===n?void 0:n.id)&&void 0!==o?o:null,s=t.selectedPinId;this.focusedPin===a&&this.selectedPin===s||(this.focusedPin=a,this.selectedPin=s,e.onChanged())}throttleAnnotationChanges(e,t){var n,o;const a=null!==(o=null===(n=t.dockedAnnotation)||void 0===n?void 0:n.id)&&void 0!==o?o:null;this.dockedAnnotation!==a&&(this.dockedAnnotation=a,e.onChanged())}}class ni{constructor(){this._data={hovered:null,selected:new Set,docked:null}}get data(){return this._data}equals(e){return this.data.hovered===e.data.hovered&&this.data.docked===e.data.docked&&(t=this.data.selected,n=e.data.selected,t.size===n.size&&[...t].every((e=>n.has(e))));var t,n}update(e,t){var n,o;const a=e.focusedPin,s=e.selectedPinId?e.getPin(e.selectedPinId):null,i=null!==(o=null===(n=t.dockedAnnotation)||void 0===n?void 0:n.id)&&void 0!==o?o:null;this._data.hovered=(null==a?void 0:a.pinType)===Zs.MATTERTAG?a.id:null,this._data.selected.clear(),s&&s.pinType===Zs.MATTERTAG&&this._data.selected.add(s.id),this._data.docked=i}copy(e){this._data.hovered=e.data.hovered,this._data.docked=e.data.docked,function(e,t){e.clear();for(const n of t)e.add(n)}(this._data.selected,e.data.selected)}}class oi{constructor(e,t,n){this.attachmentRegistry=e,this.tagViewData=t,this.iframeSrcDoc=n,this.idGenerator=new Ao}validateInput(e){if(!e.html||"string"!=typeof e.html)throw Error(e.html+" is not valid html");if(!Co(e.clientId))throw Error("Unexpected error: unable to create iframe");const t=e.options||{},n={on:"on",off:"off",send:"send",tag:"tag",docked:"docked"};t.globalVariableMap&&(re(t.globalVariableMap.on)&&(n.on=t.globalVariableMap.on),re(t.globalVariableMap.off)&&(n.off=t.globalVariableMap.off),re(t.globalVariableMap.send)&&(n.send=t.globalVariableMap.send),re(t.globalVariableMap.tag)&&(n.tag=t.globalVariableMap.tag),re(t.globalVariableMap.docked)&&(n.docked=t.globalVariableMap.docked));const o={w:0,h:0};if(t.size){if(!(Co(t.size.w)&&t.size.w>=0&&Co(t.size.h)&&t.size.h>=0))throw Error(oe("options.size","Size",t.size));o.w=t.size.w,o.h=t.size.h}return{clientId:e.clientId,html:e.html,options:{name:t.name||"",globalVariableMap:n,size:o}}}async exec(e,t){const n=this.idGenerator.generate(),[o]=this.attachmentRegistry.addSandbox(t.applicationKey,{name:e.options.name,srcDoc:this.iframeSrcDoc,sandboxLoadedHandler:(t,o)=>{var a;t.contentWindow.postMessage({type:Io.SETUP,id:n,targetId:e.clientId,customHTML:e.html,windowPath:"",parentTag:o,docked:(null===(a=this.tagViewData.dockedAnnotation)||void 0===a?void 0:a.id)===o,globalVariableMap:e.options.globalVariableMap},"*")},size:e.options.size});return{messengerType:Eo.POSTMESSAGE,iframeId:n,attachmentId:o}}}class ai{constructor(e,t,n,o,a){this.externalTypes=e,this.externalCommands=t,this.pinViewData=n,this.tagsViewData=o,this.annotationsViewData=a}validateInput(e,t){const n=e.id;re(n)&&this.pinViewData.getPin(n)||this.throw(`${e.id} does not map to a valid tag`);const o={opening:!1,navigating:!1,docking:!1,sharing:!1};return lt(e.allow)&&(o.opening=!!e.allow.opening,o.navigating=!!e.allow.navigating,o.docking=!!e.allow.docking,o.sharing=!!e.allow.sharing),{id:n,allow:o}}async exec(e,t){var n,o;const a=this.pinViewData.getPin(e.id);a?(this.annotationsViewData.updateCapabilities(a.id,{dock:e.allow.docking,preview:e.allow.opening,select:e.allow.navigating,share:e.allow.sharing}),this.tagsViewData.updateCapabilities(a.id,{focus:!!e.allow.navigating}),(!e.allow.docking&&(null===(n=this.annotationsViewData.dockedAnnotation)||void 0===n?void 0:n.id)===e.id||!e.allow.opening&&(null===(o=this.annotationsViewData.selectedAnnotation)||void 0===o?void 0:o.id)===e.id)&&this.externalCommands.issueCommand(new this.externalTypes.CloseAnnotationCommand(a.id,yo.TAG))):this.throw(`${e.id} does not map to a valid tag`)}throw(e){throw Error("Tag.allowAction: "+e)}}class si{constructor(e,t,n){this.mattertagData=n,this.EditMattertagCommand=e.EditMattertagCommand,this.issueCommand=t.issueCommand}validateInput(e,t){const{id:n}=e;return re(n)||this.throw(oe("id","string",n)),this.mattertagData.getTag(n)||this.throw(`${n} does not map to a valid tag`),{id:n,properties:this.validateProperties(e.properties)}}validateProperties(e){lt(e)||this.throw("'properties' input is not an object");const{label:t,description:n}=e;return void 0===t||ce(t)||this.throw(oe("label","string (or undefined)",t)),void 0===n||ce(n)||this.throw(oe("description","string (or undefined)",n)),{label:t,description:n}}async exec(e,t){try{await this.issueCommand(new this.EditMattertagCommand(e.id,{label:e.properties.label,description:e.properties.description}))}catch(e){this.throw(e)}}throw(e){throw Error("Tag.editBillboard: "+e)}}class ii{constructor(e,t,n,o){this.THREE=e,this.EditMattertagCommand=t.EditMattertagCommand,this.issueCommand=n.issueCommand,this.mattertagData=o}validateInput(e,t){return re(e.id)||this.throw(oe("id","string",e.id)),this.mattertagData.getTag(e.id)||this.throw(`${e.id} does not map to a valid tag`),zs(e.color)||this.throw(oe("color","Color",e.color)),{id:e.id,color:e.color}}async exec(e,t){try{const t=(new this.THREE.Color).setRGB(e.color.r,e.color.g,e.color.b);await this.issueCommand(new this.EditMattertagCommand(e.id,{color:t}))}catch(e){this.throw(e)}}throw(e){throw Error("Tag.editColor: "+e)}}class ri{constructor(e,t,n,o){this.THREE=e,this.mattertagData=t,this.pinsModule=n,this.iconMaps=o}validateInput(e,t){var n;return re(e.id)||this.throw(oe("id","string",e.id)),this.mattertagData.getTag(e.id)||this.throw(`${e.id} does not map to a valid tag`),re(e.iconId)||this.throw(oe("iconId","string",e.iconId)),(null===(n=this.iconMaps.get(t.applicationKey))||void 0===n?void 0:n.imagePromise[e.iconId])||this.throw(`${e.iconId} does not map to a registered icon`),{id:e.id,iconId:e.iconId}}async exec(e,t){const{id:n,iconId:o}=e,a=this.iconMaps.get(t.applicationKey);let s;try{s=await a.imagePromise[o]}catch(e){this.throw(e)}const i=a.map[o],r=s.naturalWidth/s.naturalHeight,c=new this.THREE.Vector3;r>1?c.set(r,1,1):c.set(1,1/r,1),this.pinsModule.pinRenderer.setPinRenderOverrides(n,i,c)}throw(e){throw Error("Tag.editIcon: "+e)}}class ci{constructor(e,t,n,o,a){this.cwfTypes=e,this.closeTag=n,this.mattertagData=o,this.annotationsViewData=a,this.issueCommand=t.issueCommand}validateInput(e,t){ce(e.id)&&this.mattertagData.getTag(e.id)||this.throw(`${e.id} does not map to a valid tag`),e.stemParams&<(e.stemParams)||this.throw("invalid stem parameters objeect");const{stemHeight:n,stemVisible:o}=e.stemParams;return void 0===n||Co(n)||this.throw(oe("stemHeight","number",e.id)),void 0===o||ut(o)||this.throw(oe("stemVisibility","boolean",e.id)),{id:e.id,stemParams:{stemHeight:n,stemVisible:o}}}async exec(e,t){var n;const{stemHeight:o,stemVisible:a}=e.stemParams,s={};void 0!==o&&(s.stemHeight=o,(null===(n=this.annotationsViewData.dockedAnnotation)||void 0===n?void 0:n.id)!==e.id&&this.closeTag.exec({id:e.id},t)),void 0!==a&&(s.stemVisible=a),await this.issueCommand(new this.cwfTypes.EditMattertagCommand(e.id,s))}throw(e){throw Error("Tag.editStem: "+e)}}class di{constructor(e,t,n,o){this.ChangePinOpacityScaleCommand=e.ChangePinOpacityScaleCommand,this.PinType=e.PinType,this.issueCommand=t.issueCommand,this.mattertagData=n,this.pinsViewData=o}validateInput(e,t){return re(e.id)||this.throw(oe("id","string",e.id)),this.mattertagData.getTag(e.id)||this.throw(`${e.id} does not map to a valid tag`),(!Co(e.opacity)||e.opacity<0||e.opacity>1)&&this.throw("'opacity' should be a number in the range of [0, 1]"),{id:e.id,opacity:e.opacity}}async exec(e,t){await this.waitForTagView(e.id),await this.issueCommand(new this.ChangePinOpacityScaleCommand(e.id,this.PinType.MATTERTAG,e.opacity))}async waitForTagView(e){if(!this.pinsViewData.getPin(e))return new Promise((t=>{const n=this.pinsViewData.onPinUpdate({onAdded(o,a){a===e&&(n.cancel(),t())}})}))}throw(e){throw Error("Tag.editOpacity: "+e)}}class hi{constructor(e,t,n,o,a,s){this.closeTag=n,this.mattertagData=o,this.annotationsViewData=a,this.roomIdMap=s,this.cwfTypes=e,this.issueCommand=t.issueCommand}validateInput(e){return re(e.id)&&this.mattertagData.getTag(e.id)||this.throw(`${e.id} does not map to a valid tag`),{id:e.id,options:this.validateOptions(e.options)}}validateOptions(e){return e&<(e)||this.throw("invalid options provided"),{anchorPosition:this.validateVector3(e.anchorPosition,"`anchorPosition` was provided but not a valid Vector3"),stemVector:this.validateVector3(e.stemVector,"`stemVector` was provided, but not a valid Vector3"),roomId:this.validateRoomId(e.roomId)}}validateVector3(e,t){return void 0===e||jo(e)||this.throw(t),e}validateRoomId(e){return void 0===e||re(e)||this.throw(oe("roomId","string (or undefined)",e)),e&&!this.roomIdMap.getRoomForId(e)&&this.throw(`${e} does not map to a valid room`),e}async exec(e,t){var n;const{anchorPosition:o,stemVector:a}=e.options,s=this.mattertagData.getTag(e.id),i=e.options.roomId&&this.roomIdMap.getRoomForId(e.options.roomId),r=i?i.floorId:s.floorId,c=o?s.anchorPosition.clone().set(o.x,o.y,o.z):s.anchorPosition,d=a?s.stemVector.clone().set(a.x,a.y,a.z):s.stemVector,h=a?d.length():s.stemHeight;d.normalize();const l={stemHeight:h},u={position:c,normal:d,floorId:r};(o||a)&&(null===(n=this.annotationsViewData.dockedAnnotation)||void 0===n?void 0:n.id)!==e.id&&await this.closeTag.exec({id:e.id},t),await this.issueCommand(new this.cwfTypes.EditMattertagCommand(e.id,l,void 0,u))}throw(e){throw Error("Tag.editPosition: "+e)}}class li{constructor(e,t){this.cwfTypes=e,this.issueCommand=t.issueCommand}validateInput(e){const t=e.ids;return It(t,re)||this.throw("'ids' is expected to be a series of strings"),{ids:t}}async exec(e){const t=[];for(const n of e.ids)await this.issueCommand(new this.cwfTypes.CloseAnnotationCommand(n,yo.TAG)),await this.issueCommand(new this.cwfTypes.RemoveMattertagCommand(n)),t.push(n);return t}throw(e){throw Error("Tag.remove: "+e)}}class ui{constructor(e,t){this.mattertagData=e,this.pinsModule=t}validateInput(e,t){return re(e.id)||this.throw(oe("id","string",e.id)),this.mattertagData.getTag(e.id)||this.throw(`${e.id} does not map to a valid tag`),{id:e.id}}async exec(e,t){const{id:n}=e;this.pinsModule.pinRenderer.setPinRenderOverrides(n,null,null)}throw(e){throw Error(`Tag.resetIcon: ${e}`)}}Object.freeze({colors:["#d44441","#f44336","#e91e63","#f78da7","#9c4b92","#673ab7","#03687d","#03a9f4","#00bcd4","#417505","#51a868","#37d67a","#cddc39","#fbcd00","#ffac17","#ff6900","#abb8c3","#607d8b"]});class pi{constructor(e,t){this.setting=e,this.settingsData=t}validateInput(e,t){if(void 0===e.enable&&(e.enable=!this.settingsData.tryGetProperty(this.setting,!0)),!ut(e.enable))throw Error(oe("enable","boolean or undefined",e.enable));return{enable:e.enable}}async exec(e,t){this.settingsData.setProperty(this.setting,e.enable)}}function mi(e,t,n,o,a,s,i,r){const{mattertagData:c,pinsModule:d,meshData:h,floorData:l,pinViewData:p,annotationsViewData:m,tagsViewData:g,roomData:w,roomIdMap:f,settingsData:T}=r;e.addEnumToInterface({namespace:"Tag",name:"AttachmentType",values:u.AttachmentType});const I=function(e,t){const n=Qe.create(t,new xs,new F(ks));return e.addCollectionToInterface({namespace:"Tag",name:"attachments"},n),n}(e,new me(s)),E=function(e,t){const n=ne.create(t,new F(Vs));return e.addAsyncCommandToInterface({namespace:"Tag",name:"registerAttachment",args:["srcs"],varArg:!0},n),n}(e,new me(s)),y=function(e,t){const n=ne.create(t,new F(oi));return e.addAsyncCommandToInterface({namespace:"Tag",name:"registerSandbox",args:["html","options"],subRoutine:"tag.registerSandbox"},n),n}(e,new me(s,m,i)),v=function(e,t){const n=ne.create(t,new F(_s));return e.addAsyncCommandToInterface({namespace:"Tag",name:"attach",args:["tagId","attachmentIds"],varArg:!0},n),n}(e,new me(c,s)),A=function(e,t){const n=ne.create(t,new F(Us));return e.addAsyncCommandToInterface({namespace:"Tag",name:"detach",args:["tagId","attachmentIds"],varArg:!0},n),n}(e,new me(c,s)),C=function(e,t){const n=U.create(t,new ti,new F(ni));return e.addObservableToInterface({namespace:"Tag",name:"openTags"},n),n}(e,new me(p,m)),S=function(e,t,n){const o=Qe.create(n,new Gs,new F(Hs,t));return e.addCollectionToInterface({namespace:"Tag",name:"data",elementFactory:"Tag.data"},o),o}(e,t,new me(c,f,w,h)),D=function(e,t,n,o){const a=ne.create(o,new F(Ks,Object.assign(Object.assign({},t),n)));return e.addAsyncCommandToInterface({namespace:"Tag",name:"open",args:["id","options"]},a),a}(e,n,o,new me(c,g)),b=function(e,t,n,o){const a=ne.create(o,new F(Ys,Object.assign(Object.assign({},t),n)));return e.addAsyncCommandToInterface({namespace:"Tag",name:"dock",args:["id","options"]},a),a}(e,n,o,new me(c,g)),O=function(e,t,n,o){const a=ne.create(o,new F(Xs,Object.assign(Object.assign({},t),n)));return e.addAsyncCommandToInterface({namespace:"Tag",name:"close",args:["id"]},a),a}(e,n,o,new me(c,g)),M=function(e,t,n,o){const a=ne.create(o,new F(ai,t,n));return e.addAsyncCommandToInterface({namespace:"Tag",name:"allowAction",args:["id","allow"]},a),a}(e,n,o,new me(p,g,m)),N=function(e,t,n,o){const a=ne.create(o,new F(si,t,n));return e.addAsyncCommandToInterface({namespace:"Tag",name:"editBillboard",args:["id","properties"]},a),a}(e,n,o,new me(c)),R=function(e,t,n,o,a){const s=ne.create(a,new F(ii,t,n,o));return e.addAsyncCommandToInterface({namespace:"Tag",name:"editColor",args:["id","color"]},s),s}(e,t,n,o,new me(c)),P=function(e,t,n){const o=ne.create(n,new F(ri,t));return e.addAsyncCommandToInterface({namespace:"Tag",name:"editIcon",args:["id","iconId"]},o),o}(e,t,new me(c,d,a,g)),L=function(e,t,n,o){const a=ne.create(o,new F(di,t,n));return e.addAsyncCommandToInterface({namespace:"Tag",name:"editOpacity",args:["id","opacity"]},a),a}(e,n,o,new me(c,p)),x=function(e,t,n,o){const a=ne.create(o,new F(ci,t,n));return e.addAsyncCommandToInterface({namespace:"Tag",name:"editStem",args:["id","stemParams"]},a),a}(e,n,o,new me(O,c,m)),k=function(e,t,n,o){const a=ne.create(o,new F(hi,t,n));return e.addAsyncCommandToInterface({namespace:"Tag",name:"editPosition",args:["id","options"]},a),a}(e,n,o,new me(O,c,m,f)),_=function(e,t,n,o){const a=ne.create(o,new F(li,t,n));return e.addAsyncCommandToInterface({namespace:"Tag",name:"remove",args:["ids"],varArg:!0},a),a}(e,n,o,new me),V=function(e,t){const n=ne.create(t,new F(ui));return e.addAsyncCommandToInterface({namespace:"Tag",name:"resetIcon",args:["id"]},n),n}(e,new me(c,d)),G=function(e,t,n,o,a){const s=ne.create(a,new F(qs,t,n,o));return e.addAsyncCommandToInterface({namespace:"Tag",name:"add",args:["descriptors"],varArg:!0},s),s}(e,t,n,o,new me(c,v,P,L,s,a,g,l,w,h)),H=new me(T);return{attachments:I,registerAttachment:E,registerSandbox:y,attach:v,detach:A,data:S,openTags:C,add:G,open:D,dock:b,close:O,allowAction:M,editBillboard:N,editColor:R,editIcon:P,editOpacity:L,editStem:x,editPosition:k,remove:_,resetIcon:V,toggleDocking:function(e,t){const n=ne.create(t,new F(pi,"TAG_BILLBOARD_DOCK"));return e.addAsyncCommandToInterface({namespace:"Tag",name:"toggleDocking",args:["enable"]},n),n}(e,H),toggleNavControls:function(e,t){const n=ne.create(t,new F(pi,"TAG_NAV_OVERLAY"));return e.addAsyncCommandToInterface({namespace:"Tag",name:"toggleNavControls",args:["enable"]},n),n}(e,H),toggleSharing:function(e,t){const n=ne.create(t,new F(pi,"TAG_BILLBOARD_SHARE"));return e.addAsyncCommandToInterface({namespace:"Tag",name:"toggleSharing",args:["enable"]},n),n}(e,H)}}class gi{validateInput(e){if(!re(e.arg0))throw Error(`Stat.test: arg0 was specified but was not a valid string; got ${e.arg0}`);return e}async exec(e,t){return e.arg0}}class wi{validateInput(e){return e}async exec(e,t){}}var fi;!function(e){e.ENUM1="test.enum1",e.ENUM2="test.enum2"}(fi||(fi={}));const Ti=new ee("Subscription");class Ii{constructor(e,t,n=!1,o=""){this.startSubscription=e,this.endSubscription=t,this.id=o,this.isSubbed=!1,n&&this.renew()}renew(){this.isSubbed?Ti.debugWarn(`Duplicate subscription renew ${this.id}`):(this.startSubscription(),this.isSubbed=!0)}cancel(){this.isSubbed&&(this.endSubscription(),this.isSubbed=!1)}get active(){return this.isSubbed}}function Ei(e,t,n=!0,o=""){return new Ii(e,t,n,o)}class yi{create(){return Ei((()=>{}),(()=>{}))}}class vi{constructor(){this._data={}}get data(){return this._data}isItemEqual(e,t){const n=this.data[t],o=e.data[t];return n.test===o.test}update(){}clear(){this._data={}}}class Ai{create(e){return Ei((()=>{}),(()=>{}))}}class Ci{constructor(){this._data={testString:"hello"}}get data(){return this._data}equals(e){return this._data.testString===e.data.testString}copy(e){this._data.testString=e.data.testString}update(){}}const Si=new ee("sdk: tours");class Di{constructor(e,t){this.tourControls=e,this.tourData=t}validateInput(e){return void 0!==e.index&&isNaN(e.index)&&(Si.warn(e.index,"is not a valid number"),e.index=void 0),void 0!==e.steps&&isNaN(e.steps)&&(Si.warn(e.steps,"is not a valid number"),e.steps=void 0),e}async exec(e,t){if(0===this.tourData.getSnapshotCount())throw Error("No tour data found");if(!this.tourControls.canChangeTourLocation())throw Error("TourStart ignored, cannot change location at this time, another transition is active");try{this.tourControls.startTour(e.index,e.steps,e.loop)}catch(e){throw Error(`Error occurred while starting tour - ${e}`)}}}class bi{constructor(e){this.tourControls=e}validateInput(e){return e}async exec(e,t){try{await this.tourControls.stopTour()}catch(e){throw Error(`Error occurred while stopping tour - ${e}`)}}}class Oi{constructor(e,t){this.tourControls=e,this.tourData=t}validateInput(e){const t=e.index;if(!Co(t))throw Error(t+" is not a valid tour snapshot index");if(t<0||t>this.tourData.getSnapshotCount())throw Error(`${t} is outside of the range of tour snapshots: [0 , ${this.tourData.getSnapshotCount()-1}]`);return{index:t}}async exec(e,t){if(0===this.tourData.getSnapshotCount())throw Error("No tour data found");if(!this.tourControls.canChangeTourLocation())throw Error("TourStep ignored, cannot change location at this time, another transition is active");try{this.tourControls.tourGoTo(e.index)}catch(e){throw Error(`Error occurred while jumping to new tour location - ${e}`)}}}class Mi{constructor(e,t,n){this.forward=e,this.tourControls=t,this.tourData=n}validateInput(e){return e}async exec(e,t){if(0===this.tourData.getSnapshotCount())throw Error("No tour data found");if(!this.tourControls.canChangeTourLocation())throw Error("TourStep ignored, cannot change location at this time, another transition is active");try{this.forward?this.tourControls.tourGoNext(!1):this.tourControls.tourGoPrevious(!1)}catch(e){throw Error(`Error while trying to travel to the next tour snapshot - ${e}`)}}}function Ni(e,t,n,o){!function(e,t,n){t.addBinding(Ri,(async()=>n.getDependencies().then((async([n,o])=>{const a=await Promise.all(o.getEnabledSnapshots().map((n=>async function(e,t,n){const o=!e.is360,a=n.viewmodeConverter.toSdk(e.metadata.cameraMode,o);if(!a||a===n.commandModeConverter.toSdk(t.CommandViewmode.TRANSITIONING))throw Error("Failed to convert snapshot, invalid viewmode");return{sid:e.sid,thumbnailUrl:await e.thumbnailUrl.get(),imageUrl:await e.imageUrl.get(),is360:e.is360,name:e.name,mode:a,zoom:e.metadata.ssZoom,position:e.metadata.cameraPosition,rotation:n.conversionUtils.quaternionToRotation(e.metadata.cameraQuaternion)}}(n,e,t))));if(0===a.length)throw Error("No tour data found");return a}))))}(t,n,o),e.addCommandCreator({namespace:"Tour",name:"getData",args:[]},(()=>new Ri));const a=o,s=ne.create(a,new F(Di)),i=ne.create(a,new F(bi)),r=ne.create(a,new F(Oi)),c=ne.create(a,new F(Mi,!0)),d=ne.create(a,new F(Mi,!1));e.addAsyncCommandToInterface({namespace:"Tour",name:"start",args:["index"]},s),e.addCommandToInterface({namespace:"Tour",name:"stop",args:[]},i),e.addCommandToInterface({namespace:"Tour",name:"step",args:["index"]},r),e.addCommandToInterface({namespace:"Tour",name:"prev",args:[]},c),e.addCommandToInterface({namespace:"Tour",name:"next",args:[]},d)}class Ri extends j{constructor(){super(...arguments),this.id="GET_TOUR_DATA"}}class Pi{create(e,t){return t.onChanged((()=>e.onChanged()))}}class Li{constructor(){this._data={step:null}}get data(){return this._data}equals(e){return this._data.step===e.data.step}copy(e){this._data.step=e.data.step}update(e){var t;this._data.step=e.isTourActive()&&null!==(t=e.getTourCurrentSnapshotSid())&&void 0!==t?t:null}}class xi{create(e,t){return t.onChanged((()=>e.onChanged()))}}class ki{constructor(e){this._data={current:p.PlayState.INACTIVE},this.tourStateConverter=e.tourStateConverter}get data(){return this._data}equals(e){return this._data.current===e.data.current}copy(e){this._data.current=e.data.current}update(e){this._data.current=this.tourStateConverter.toSdkTourState(e.getTourState())}}class _i{constructor(e){this.toSdkTourStateMap={[e.Inactive]:p.PlayState.INACTIVE,[e.Active]:p.PlayState.ACTIVE,[e.StopScheduled]:p.PlayState.STOP_SCHEDULED}}toSdkTourState(e){return this.toSdkTourStateMap[e]}}class Ui{create(e,t){return t.onChanged((()=>e.onChanged()))}}class Fi{constructor(){this._data={from:null,to:null}}get data(){return this._data}equals(e){return this._data.from===e.data.from&&this._data.to===e.data.to}copy(e){this._data.from=e.data.from,this._data.to=e.data.to}update(e){const t=this.hasEnded;if(this.hasEnded=e.tourEnded,!t&&this.hasEnded)return this._data.from=null,void(this._data.to=null);const n=-1===e.tourCurrentSnapshot?null:e.getTourSnapshotSid(e.tourCurrentSnapshot),o=-1===e.transition.toIndex?null:e.getTourSnapshotSid(e.transition.toIndex);null!==o&&(n===o?(this._data.from=null,this._data.to=null):(this._data.from=n,this._data.to=o))}}class Vi{create(e,t,n){const o=()=>e.onChanged();return new Se(n.onChanged(o),t.onChanged(o))}}class Gi{constructor(e){this._data={from:null,to:null},this.viewmodeConverter=e.viewmodeConverter}get data(){return this._data}equals(e){return this._data.from===e._data.from&&this._data.to===e._data.to}copy(e){this._data={from:e._data.from,to:e._data.to}}update(e,t){const n=t.currentSweep&&t.isSweepAligned(t.currentSweep),o=t.transition.to&&t.isSweepAligned(t.transition.to);this._data=e.transition.active?{from:this.viewmodeConverter.toSdk(e.transition.from,!!n),to:this.viewmodeConverter.toSdk(e.transition.to,!!o)}:{from:null,to:null}}}class Hi{create(e,t){return t.onChanged((()=>e.onChanged()))}}class zi{constructor(e){this.pluginData=e,this._data={}}get data(){return this._data}isItemEqual(e,t){const n=this.data[t],o=e.data[t];return n.applicationKey===o.applicationKey&&n.id===o.id}update(){for(const e of this.pluginData.plugins.entries())this._data[e[0]]={applicationKey:e[1].applicationKey,id:e[1].id};for(const e in this.data)this.pluginData.plugins.has(e)||delete this._data[e]}clear(){this._data={}}}function Bi(o,i,h,u,g,w,f){const{THREE:T}=i,{appPhaseModule:y,applicationData:v,cameraData:V,canvasData:G,deepLinks:H,floorData:j,floorViewData:$,labelData:K,mattertagData:Y,measurementModeData:X,meshData:Z,modelData:Q,annotationsViewData:J,raycasterData:ee,roomData:te,settingsData:oe,sweepData:ae,sweepViewData:se,tourData:re,viewmodeData:ce,commonControlsModule:de,floorCasterModule:he,meshQuery:le,modelDataModule:ue,modelMeshModule:pe,navigationModule:we,plugin:Se,renderToTextureModule:De,sceneModule:be,sensorModule:Oe,settingsModule:Me,tourControlsModule:Ne,webglRendererModule:Re,zoomControlModule:Pe,sweepTextureLoader:Le,cursorController:Ve,pluginData:Ge,externalR3FModule:He}=g;f.idOption=f.idOption||E.LEGACY;const ze=new b(T),qe=new C(h.Viewmode),lt=function(e){return async function(t,n){const o=n.rotationSpeed;let a=0;const s=Math.abs(n.xAngle),i=Math.abs(n.yAngle),r=Math.max(s,i);if(r>=Math.PI){const e=r/Math.PI,t=Math.floor(e),n=s/e,o=i/e,c=s-n*t,d=i-o*t;a=Math.acos(Math.cos(n)*Math.cos(o))*t+Math.acos(Math.cos(c)*Math.cos(d))}else a=Math.acos(Math.cos(Math.abs(n.xAngle))*Math.cos(Math.abs(n.yAngle)));if(a){const s=new e.Vector2(-n.xAngle,n.yAngle);return s.multiplyScalar(o/a),t.startRotateTransition(a/o,s,!1)}}}(T),ut=new vs(h.SweepAlignmentType,h.SweepPlacementType),pt=Object.assign(Object.assign({},u),{conversionUtils:new b(T),directionConverter:new A(h.Vectors),getPose:Ye(T,qe),rotateCamera:lt,orientCamera:Ue(T,h.Viewmode,lt),appPhaseConverter:new k(h.AppPhase),applicationConverter:new _(h.Application),mediaConverter:new yt(h.MattertagMediaType,h.TagDescriptionChunkType),chunkTypeConverter:new vt(h.TagDescriptionChunkType),linkTypeConverter:new At(h.TagLinkType),sweepPlacementConverter:ut,viewmodeConverter:qe,commandModeConverter:new S(h.CommandViewmode),cameraTransitionConverter:new D(h.CameraTransitionType),makeLabelData:it(T,u.worldToScreenPosition),makeModelData:ea(ze,ut),sweepUtils:new O(h.SweepAlignmentType),tourStateConverter:new _i(h.TourState)}),Tt=async function(e,t){const n=await e;return t===E.LEGACY?new M(n):new N(n)}(ae,f.idOption),It=async function(e,t){const n=await e;return t===E.LEGACY?new R(n):new P(n)}(j,f.idOption),Ct=async function(e,t,n){const o=await e,a=await t;return n===E.LEGACY?new L(o,a):new x(o)}(te,j,f.idOption),St=async function(e,t){const n=await e;return new ro(n,t)}(Y,i.oEmbed),Dt=new Map;var bt;(bt=o).addEnumToInterface({namespace:"App",name:"Phase",values:e.Phase}),bt.addEnumToInterface({namespace:"App",name:"Event",values:e.Event}),bt.addEnumToInterface({namespace:"App",name:"Application",values:e.Application}),function(t,n,o){const a=[void 0],s=e=>(a[0]=o.appPhaseConverter.toSdkAppPhase(e.phase),a);o.subscribe(n.AppPhaseChangeMessage,(n=>{t.broadcast(e.Event.PHASE_CHANGE,s,n)}))}(o,h,pt),function(e,t,n){n.getDependencies().then((([e])=>{t.addBinding(W,(async()=>{try{const n=e.getData();return{phase:t.appPhaseConverter.toSdkAppPhase(n.phase),application:t.applicationConverter.toSdkApplication(n.application)}}catch(e){throw Error("Error: Can't get application data at this time")}}))})),e.addCommandCreator({namespace:"App",name:"getState",args:[]},(()=>new W))}(o,pt,new me(y)),function(t,n,o){n.addBinding(q,(async()=>{const t={[e.Phase.WAITING]:null,[e.Phase.LOADING]:null,[e.Phase.STARTING]:null,[e.Phase.PLAYING]:null,[e.Phase.ERROR]:null},[a]=await o.getDependencies();for(const e in a.phaseTimes){const o=Number(e);t[n.appPhaseConverter.toSdkAppPhase(o)]=a.phaseTimes[o]}return t})),t.addCommandCreator({namespace:"App",name:"getLoadTimes",args:[]},(()=>new q))}(o,pt,new me(v)),function(e,t,n,o){const a=U.create(o,new z,new F(B,t,n));e.addObservableToInterface({namespace:"App",name:"state"},a)}(o,h,pt,new me(v));const Ot=fe(o,T,pt,Dt,w,g);!function(e,t,n){n.getDependencies().then((([e,n,o,a])=>{const s={position:{x:0,y:0,z:0},rotation:{x:0,y:0},projection:new Float32Array(16),sweep:"",mode:r.Mode.TRANSITIONING};t.addBinding(Te,(async()=>t.getPose(s,e,n,o,a)))})),e.addCommandCreator({namespace:"Camera",name:"getPose",args:[]},(()=>new Te))}(o,pt,new me(V,ae,ce,Tt)),function(e,t,n,o){o.getDependencies().then((([e,o,a])=>{n.addBinding(Ee,(async function(s={}){if(!a.isInside())throw Error("Camera.lookAtScreenCoords must be called from Inside mode");const i=n.screenPositionToNDC(s.x,s.y,o.width,o.height),r=new t.Vector3(0,0,-1).applyQuaternion(o.pose.rotation),c=n.ndcToWorldPosition(o,new t.Vector2(i.x,i.y),1).normalize(),d=r.clone().setY(0).angleTo(c.clone().setY(0)),h=Math.asin(c.y-r.y),l=d*Math.sign(i.x),u=h;return n.rotateCamera(e,{xAngle:l,yAngle:u,zAngle:0,rotationSpeed:Ie})}))})),e.addCommandCreator({namespace:"Camera",name:"lookAtScreenCoords",args:["x","y"]},(function(e={}){if(e.x=e.x||0,e.y=e.y||0,isNaN(e.x)||isNaN(e.y))throw new Error(`${JSON.stringify(e)} does not contain valid screen coordinates`);return new Ee({x:e.x,y:e.y})}))}(o,T,pt,new me(de,V,ce)),function(e,n,o){o.getDependencies().then((([o,a,s,i])=>{const c=[{position:{x:0,y:0,z:0},rotation:{x:0,y:0},projection:new Float32Array(16),sweep:"",mode:r.Mode.TRANSITIONING}],d=(()=>{let r=0,h=!1;const l=()=>(n.getPose(c[0],o,a,s,i),c);return()=>{const n=Date.now(),o=r+100;if(n>o){h=!1,r=n;try{e.broadcast(t.Event.MOVE,l)}catch(e){ye.debug("failed to broadcast pose, one of the module dependencies are probably not loaded yet")}}else h||(setTimeout((()=>d()),o-n),h=!0)}})();o.onChanged(d),s.onChanged(d)})),e.addEnumToInterface({namespace:"Camera",name:"Event",values:t.Event})}(o,pt,new me(V,ae,ce,Tt)),function(e,n,o){o.getDependencies().then((([e])=>n.addBinding(Ae,(async o=>{const a=o.direction;if(!ve(t.Direction,o.direction))throw new Error(`${o.direction} is not a valid direction`);await e.navigateInLocalDirection(n.directionConverter.toVector(a))})))),e.addEnumToInterface({namespace:"Camera",name:"Direction",values:t.Direction}),e.addCommandCreator({namespace:"Camera",name:"moveInDirection",args:["direction"]},(e=>new Ae(e||{})))}(o,pt,new me(we)),function(e,t,n,o){o.getDependencies().then((([e,o])=>{n.addBinding(Ce,(async n=>{const a=o.pose.position,s=n.x-a.x,i=n.z-a.z,r=new t.Vector2(s,i),c=r.length();r.setLength(.005),await e.startTranslateTransition(c/.005,r,!1)}))})),e.addCommandCreator({namespace:"Camera",name:"pan",args:["position"]},(e=>{if((e=e||{}).position=e.position||{},e.position.x=e.position.x-0,e.position.z=e.position.z-0,isNaN(e.position.x)||isNaN(e.position.z))throw new Error(`${JSON.stringify(e)} does not contain a valid position to pan`);return new Ce({x:e.position.x,z:e.position.z})}))}(o,T,pt,new me(de,V)),function(e,t,n,o){const a=U.create(o,new xe,new F(ke,t,n.viewmodeConverter));e.addObservableToInterface({namespace:"Camera",name:"pose"},a)}(o,T,pt,new me(V,ae,ce,Tt)),function(e,t,n,o){const a=t.MathUtils.degToRad(80)/1e3;o.getDependencies().then((([e,t,o])=>{n.addBinding(_e,(async t=>await n.rotateCamera(e,t))),n.addBinding(Fe,(async a=>await n.orientCamera(t,e,o,a)))}));const s=e=>{const n=(e=e||{}).options||{},o=t.MathUtils.degToRad(e.xAngle||0),s=t.MathUtils.degToRad(e.yAngle||0),i=t.MathUtils.degToRad(e.zAngle||0);let r=a;if(n.speed){if(isNaN(n.speed)||n.speed<=0)throw new Error(`${JSON.stringify(n)} does not contain valid rotation speed`);r=t.MathUtils.degToRad(n.speed)/1e3}if(isNaN(o)||isNaN(s)||isNaN(i))throw new Error(`${JSON.stringify(e)} does not contain valid rotation angles`);return{xAngle:o,yAngle:s,zAngle:i,rotationSpeed:r}};e.addCommandCreator({namespace:"Camera",name:"rotate",args:["xAngle","yAngle","options"]},(e=>new _e(s(e)))),e.addCommandCreator({namespace:"Camera",name:"setRotation",args:["rotation","options"]},(e=>{const t=(e=e||{}).rotation||{};return new Fe(s({xAngle:t.x,yAngle:t.y,zAngle:t.z,options:e.options}))}))}(o,T,pt,new me(de,V,ce)),function(e,t,n,o){const a=o,s=ne.create(a,new F(Be,t,n)),i=ne.create(a,new F(je,t,n)),r=ne.create(a,new F(We,t,n));e.addCommandToInterface({namespace:"Camera",name:"zoomTo",args:["zoomPct"]},s),e.addCommandToInterface({namespace:"Camera",name:"zoomBy",args:["zoomDelta"]},i),e.addCommandToInterface({namespace:"Camera",name:"zoomReset",args:[]},r)}(o,h,pt,new me(V,ce,Pe)),function(e,t,n){const o=U.create(n,new $e,new F(Ke,t));e.addObservableToInterface({namespace:"Camera",name:"zoom"},o)}(o,h,new me(V,ce)),function(e,t,n){const o=U.create(n,new Xe,new F(Ze,t));e.addObservableToInterface({namespace:"Floor",name:"current"},o)}(o,h,new me($,ae,V,It)),function(e,t,o,a){e.addEnumToInterface({namespace:"Floor",name:"Event",values:n.Event}),a.getDependencies().then((([a])=>{const s=[-1,-1];function i(e){if(a){const t=e.to?a.getFloor(e.to):null,n=e.from?a.getFloor(e.from):null;t&&(s[0]=t.index),n&&(s[1]=n.index)}return s}const r=[-1,""];function c(e){if(a){const t=e.floorId?a.getFloor(e.floorId):null;t&&(r[0]=t.index)}return r[1]=e.floorName,r}o.subscribe(t.StartMoveToFloorMessage,(t=>e.broadcast(n.Event.CHANGE_START,i,t))),o.subscribe(t.EndMoveToFloorMessage,(t=>e.broadcast(n.Event.CHANGE_END,c,t)))}))}(o,h,pt,new me(j)),function(e,t){const n=Qe.create(t,new Je,new F(et));e.addCollectionToInterface({namespace:"Floor",name:"data"},n)}(o,new me(j,It)),function(e,t,n){t.addBinding(tt,(async()=>{const[e]=await n.getDependencies();return nt(e)})),e.addCommandCreator({namespace:"Floor",name:"getData",args:[]},(()=>new tt))}(o,pt,new me($)),function(e,t,n,o){o.getDependencies().then((([e])=>n.addBinding(ot,(async o=>{if("number"!=typeof o.floorIndex||o.floorIndex<0)throw Error("floor index must be a non-negative number");try{const a="boolean"==typeof o.moveCamera&&!o.moveCamera,s=a?250:void 0;await n.issueCommand(new t.MoveToFloorIndexCommand(o.floorIndex,a,s));const i=e.currentFloor;return i?i.index:-1}catch(e){throw Error(`Could not move to floor at index ${o.floorIndex}`)}})))),e.addCommandCreator({namespace:"Floor",name:"moveTo",args:["floorIndex","moveCamera"]},(e=>new ot(e)))}(o,h,pt,new me($)),function(e,t,n,o){const a=ne.create(o,new F(at,t,n));e.addCommandToInterface({namespace:"Floor",name:"showAll",args:["moveCamera"]},a)}(o,h,pt,new me($)),function(e,t,n){t.addBinding(st,(async()=>t.makeLabelData(...await n.getDependencies()))),e.addCommandCreator({namespace:"Label",name:"getData",args:[]},(()=>new st))}(o,pt,new me(V,j,K,It)),function(e,t,n,o){e.addEnumToInterface({namespace:"Label",name:"Event",values:a.Event}),o.getDependencies().then((([o,s,i,r,c])=>{const d=()=>[n.makeLabelData(o,i,s,c)];o.onChanged((n=>{r.currentMode===t.Viewmode.Floorplan&&e.broadcast(a.Event.POSITION_UPDATED,d,n)}))}))}(o,h,pt,new me(V,K,j,ce,It)),function(e,t){const n=Qe.create(t,new rt,new F(ct));e.addCollectionToInterface({namespace:"Label",name:"data"},n)}(o,new me(K,j,It)),function(e,t){const n=ne.create(t,new F(dt));e.addAsyncCommandToInterface({namespace:"Link",name:"createLink",args:[]},n)}(o,new me(H)),function(e,t){const n=ne.create(t,new F(ht));e.addAsyncCommandToInterface({namespace:"Link",name:"createDeepLink",args:[]},n)}(o,new me(H)),function(e,t){const n=ne.create(t,new F(mt,e)),o=ne.create(t,new F(gt,e)),a=ne.create(t,new F(wt,e)),i=ne.create(t,new F(ft,e));e.addEnumToInterface({namespace:"Link",name:"OpenPolicy",values:s.OpenPolicy}),e.addAsyncCommandToInterface({namespace:"Link",name:"setModelLinkPolicy",args:["policy","baseHref"],subRoutine:"link.setopenpolicy"},n),e.addAsyncCommandToInterface({namespace:"Link",name:"setNavigationLinkPolicy",args:["policy","baseHref"],subRoutine:"link.setopenpolicy"},o),e.addAsyncCommandToInterface({namespace:"Link",name:"setSameOriginLinkPolicy",args:["policy"]},a),e.addAsyncCommandToInterface({namespace:"Link",name:"setExternalLinkPolicy",args:["openInNewWindow"]},i)}(o,new me(H)),function(e,t){const n=ne.create(t,new F(Et));e.addEnumToInterface({namespace:"Link",name:"CreationPolicy",values:s.CreationPolicy}),e.addAsyncCommandToInterface({namespace:"Link",name:"setShareLinkPolicy",args:["policy","baseHref","options"],subRoutine:"link.setsharepolicy"},n)}(o,new me(H));const Mt=async function(){const e=f.sandboxPath;return(await fetch(e)).text()}(),Nt=mi(o,T,h,pt,Dt,St,Mt,Object.assign(Object.assign({},g),{roomIdMap:Ct}));Po(o,h,Object.assign(Object.assign({},pt),{getIframeSrcDoc:Mt}),Ot,Nt,[Y,J,j,It,St]),function(e,t,n){t.addBinding(xo,(async()=>{const[e,t]=await n.getDependencies();return ko(e,t)})),e.addCommandCreator({namespace:"Measurements",name:"getData",args:[]},(()=>new xo))}(o,pt,new me(X,j)),function(e,t,n){const o=Qe.create(n,new _o(t.MeasuringPhase),new F(Uo));e.addCollectionToInterface({namespace:"Measurements",name:"data"},o)}(o,h,new me(X)),function(e,t){const n=U.create(t,new Fo,new F(Vo));e.addObservableToInterface({namespace:"Measurements",name:"mode"},n)}(o,new me(X)),function(e,t,n){n.addBinding(Go,(async e=>n.issueCommand(new t.ToggleToolCommand(t.Tools.MEASUREMENTS,e.active)))),e.addCommandCreator({namespace:"Measurements",name:"toggleMode",args:["active"]},(e=>new Go(e.active)))}(o,h,pt),function(e,t,n,o){e.addEnumToInterface({namespace:"Mode",name:"Event",values:r.Event}),o.getDependencies().then((([o,a])=>{const s=[void 0,void 0],i=e=>{const t=a.currentMode,i=n.sweepUtils.isSweepAligned(o,e.fromSweep),r=n.sweepUtils.isSweepAligned(o,e.toSweep);return s[0]=n.viewmodeConverter.toSdk(t,i),s[1]=n.viewmodeConverter.toSdk(t,r),s};n.subscribe(t.EndMoveToSweepMessage,(t=>{n.sweepUtils.isSweepAligned(o,t.fromSweep)!==n.sweepUtils.isSweepAligned(o,t.toSweep)&&e.broadcast(r.Event.CHANGE_END,i,t)}));const c=[void 0,void 0],d=e=>{const t=n.sweepUtils.isCurrentSweepAligned(o);return c[0]=n.viewmodeConverter.toSdk(e.fromMode,t),c[1]=n.viewmodeConverter.toSdk(e.toMode,t),c};n.subscribe(t.BeginSwitchViewmodeMessage,(t=>e.broadcast(r.Event.CHANGE_START,d,t)));const h=[void 0,void 0],l=e=>{const t=n.sweepUtils.isCurrentSweepAligned(o);return h[0]=n.viewmodeConverter.toSdk(e.fromMode,t),h[1]=n.viewmodeConverter.toSdk(e.toMode,t),h};n.subscribe(t.EndSwitchViewmodeMessage,(t=>e.broadcast(r.Event.CHANGE_END,l,t)))}))}(o,h,pt,new me(ae,ce)),function(e,t,n,o,a){o.addBinding(qo,(async e=>{try{e.options=e.options||{};let t=n.CameraTransitionType.Interpolate;const a=e.options.transition;return void 0===a||isNaN(a)||(t=a),await o.issueCommand(new n.ChangeViewmodeCommand(e.mode,t,{position:e.options.position,rotation:e.options.rotation,zoom:e.options.zoom})),e.mode}catch(t){const n=t instanceof Bo?`Mode.moveTo -> Cannot move to ${e.mode} during a mode transition`:`Mode.moveTo -> Could not move to ${e.mode}`;if(Wo.info(t,n),t instanceof Bo)throw Error(`Mode.moveTo -> Cannot move to ${e.mode} during a mode transition`);throw Error(`Mode.moveTo -> Could not move to ${e.mode}`)}}));const s=new $o(t,n.CommandViewmode,o.conversionUtils,o.cameraTransitionConverter);e.addCommandCreator({namespace:"Mode",name:"moveTo",args:["mode","options"]},(e=>new qo(s.validateMoveToModeInput(e)))),e.addEnumToInterface({namespace:"Mode",name:"Mode",values:n.CommandViewmode}),e.addEnumToInterface({namespace:"Mode",name:"TransitionType",values:I})}(o,T,h,pt,new me),function(e,t,n,o){const a=U.create(o,new Ko,new F(Yo,t,n));e.addObservableToInterface({namespace:"Mode",name:"current"},a)}(o,h,pt,new me(ce,ae)),function(e,t,n){const o=U.create(n,new Vi,new F(Gi,t));e.addObservableToInterface({namespace:"Mode",name:"transition"},o)}(o,pt,new me(ce,ae)),Zo(o,pt,new me(Q,ae,j,Tt)),Jo(o,h,pt,new me(Q,oe)),function(e,t,n,o){e.addEnumToInterface({namespace:"Model",name:"Event",values:c.Event});const a={sid:"",sweeps:[],modelSupportsVr:!1},s=[a];o.getDependencies().then((o=>{n.subscribe(t.ModelDataLoadedMessage,(async t=>{const[i,r,d]=o;await n.makeModelData(t.sid,t.vrSupported,i.getSweepList(),r,d,a),e.broadcast(c.Event.MODEL_LOADED,(()=>s))}))}))}(o,h,pt,new me(ae,j,Tt)),function(e,t){const n=ne.create(t,new F(ta));e.addCommand("OAuth.updateToken",n)}(o,new me(h.MpSdkAuthentication)),function(e,t){const n=Qe.create(t,new Hi,new F(zi));e.addCollectionToInterface({namespace:"Plugin",name:"data",sdkTypes:[na.POSTMESSAGE],origins:ge},n)}(o,new me(Ge)),function(e,t){const n=ne.create(t,new F(oa));e.addAsyncCommandToInterface({namespace:"Plugin",name:"load",args:["key","path","config"],varArg:!1,sdkTypes:[na.POSTMESSAGE],origins:ge},n)}(o,new me(Se)),function(e,t){const n=ne.create(t,new F(aa));e.addAsyncCommandToInterface({namespace:"Plugin",name:"unload",args:["key"],varArg:!1,sdkTypes:[na.POSTMESSAGE],origins:ge},n)}(o,new me(Se)),function(e,t,n,o){const a=U.create(o,new sa,new F(ia,t,n));e.addEnumToInterface({namespace:"Pointer",name:"Colliders",values:d.Colliders}),e.addObservableToInterface({namespace:"Pointer",name:"intersection"},a)}(o,T,h,new me(ee,j,te,Z,le)),function(e,t,n){const o=ne.create(n,new F(ra)),a=ne.create(n,new F(ca));e.addCommandToInterface({namespace:"Pointer",name:"registerTexture",args:["textureId","textureSrc"],varArg:!1},t),e.addCommandToInterface({namespace:"Pointer",name:"editTexture",args:["textureId"],varArg:!1},o),e.addCommandToInterface({namespace:"Pointer",name:"resetTexture",args:[],varArg:!1},a)}(o,Ot.registerTexture,new me(Ve,Dt)),function(e,t){const n=ne.create(t,new F(da));e.addCommandToInterface({namespace:"Pointer",name:"setFadeProps",args:["props"],varArg:!1},n)}(o,new me(Ve)),function(e,t){const n=ne.create(t,new F(ha));e.addCommandToInterface({namespace:"Pointer",name:"setVisible",args:["visible"],varArg:!1},n)}(o,new me(Ve)),function(e,t,n,o,a){const s=new Ta(new t.Camera,o.encodeRenderTarget),i=new F(Aa,s,n,o),r=ne.create(a,i),c=ne.create(a,i);e.addCommandToInterface({namespace:"Renderer",name:"takeScreenShot",args:["resolution","visibleObjects","returnType"]},r),e.addCommandToInterface({namespace:"Camera",name:"takeScreenShot",args:["resolution","visibleObjects","returnType"]},ie(c,"`Camera.takeScreenshot` is deprecated; use `Renderer.takeScreenshot` instead"))}(o,T,h,pt,new me(G,Re,De)),function(e,t,n,o,a){const s=ne.create(a,new F(Ca,t,n,o));e.addCommandToInterface({namespace:"Renderer",name:"takeEquirectangular",args:[]},s)}(o,T,h,pt,new me(Re,De,ce,ae,Le)),function(e,t,n,o){const a=ne.create(o,new F(Sa,t,n));e.addCommandToInterface({namespace:"Renderer",name:"getScreenPosition",args:["worldPosition"]},a)}(o,h,pt,new me(Re)),function(e,t,n,o){const a=ne.create(o,new F(Da,t,n));e.addCommandToInterface({namespace:"Renderer",name:"getWorldPositionData",args:["screenPosition","height","includeHiddenFloors"]},a)}(o,h,pt,new me(j,he)),function(e,t){const n=ne.create(t,new F(la));e.addAsyncCommandToInterface({namespace:"R3F",name:"registerR3F",args:["callbacks"],sdkTypes:[na.DIRECT]},n)}(o,new me(He)),function(e,t,n,o,a){e.addAsyncCommandToInterface({namespace:"R3F",name:"focus",args:["target","options"],sdkTypes:[na.DIRECT]},ne.create(a,new F(ma,t,n,o)))}(o,T,h,pt,new me(we,ce)),function(e,t){const n=ne.create(t,new F(wa));e.addAsyncCommandToInterface({namespace:"R3F",name:"controlsToggle",args:["enabled"],sdkTypes:[na.DIRECT]},n)}(o,new me(de)),function(e,t){const n=ne.create(t,new F(pa));e.addAsyncCommandToInterface({namespace:"R3F",name:"navigationToggle",args:["enabled"],sdkTypes:[na.DIRECT]},n)}(o,new me(we)),function(e,t){const n=U.create(t,new ba,new F(Oa));e.addObservableToInterface({namespace:"Room",name:"current",objectFactory:"current.room"},n)}(o,new me(te,j,V,ae,ce,Z,Ct,It)),function(e,t){const n=Qe.create(t,new Ma,new F(Na));e.addCollectionToInterface({namespace:"Room",name:"data",elementFactory:"collection.room"},n)}(o,new me(te,j,Ct,It,Z)),function(e,t,n,o,a,s,i){(function(e){e.addEnumToInterface({namespace:"Scene",name:"InteractionType",values:m.InteractionType,sdkTypes:[na.DIRECT]}),e.addEnumToInterface({namespace:"Scene",name:"Component",values:m.Component,sdkTypes:[na.DIRECT]}),e.addEnumToInterface({namespace:"Scene",name:"PathType",values:va,sdkTypes:[na.DIRECT]})})(e),function(e,t){const n=ne.create(t,new F(Ra));e.addAsyncCommandToInterface({namespace:"Scene",name:"register",args:["name","factory"],sdkTypes:[na.DIRECT]},n),t.getDependencies().then((([t])=>{e.addEnumToInterface({namespace:"Scene",name:"Component",values:t.componentMap(),sdkTypes:[na.DIRECT]})}))}(e,new me(o)),function(e,t){const n=ne.create(t,new F(Pa));e.addAsyncCommandToInterface({namespace:"Scene",name:"createNode",args:[],varArg:!1,sdkTypes:[na.DIRECT]},n)}(e,new me(o)),function(e,t,n){t.addBinding(La,(async e=>{const[t]=await n.getDependencies();return t.sceneTags().getObjects(e.tags)})),e.addCommandCreator({namespace:"Scene",name:"query",args:["tags"],sdkTypes:[na.DIRECT]},(e=>new La(e)))}(e,t,new me(o,a)),function(e,t,n,o){o.getDependencies().then((([e])=>{n.addBinding(xa,(async n=>{n.callback(e.threeRenderer,t,e.getScene().effectComposer)}))})),e.addCommandCreator({namespace:"Scene",name:"configure",args:["callback"],sdkTypes:[na.DIRECT]},(e=>new xa(e)))}(e,n,t,new me(s)),function(e,t,n){n.getDependencies().then((([e])=>{t.addBinding(ka,(async t=>e.getSignedUrls().getImageBitmap(t.path,t.width,t.height,t.options)))})),e.addCommandCreator({namespace:"Scene",name:"getImage",args:["path","width","height","options"],sdkTypes:[na.DIRECT]},(e=>new ka(e)))}(e,t,new me(i)),function(e,t){const n=ne.create(t,new F(_a));e.addAsyncCommandToInterface({namespace:"Scene",name:"deserialize",args:["text"],varArg:!1,sdkTypes:[na.DIRECT]},n)}(e,new me(o)),function(e,t){const n=ne.create(t,new F(Fa));e.addCommandToInterface({namespace:"Scene",name:"serialize",args:["objects"],varArg:!1,sdkTypes:[na.DIRECT]},n)}(e,new me(o)),function(e,t){const n=ne.create(t,new F(Va));e.addAsyncCommandToInterface({namespace:"Scene",name:"createNodes",args:["count","userContext"],varArg:!1,sdkTypes:[na.DIRECT]},n)}(e,new me(o)),function(e,t){const n=ne.create(t,new F(Ga));e.addAsyncCommandToInterface({namespace:"Scene",name:"registerComponents",args:["components"],sdkTypes:[na.DIRECT]},n)}(e,new me(o)),function(e,t){const n=ne.create(t,new F(Ha));e.addAsyncCommandToInterface({namespace:"Scene",name:"createObjects",args:["count"],varArg:!1,sdkTypes:[na.DIRECT]},n)}(e,new me(o)),function(e,t,n){const o=ne.create(n,new F(za));e.addCommandToInterface({namespace:"Scene",name:"unregisterComponents",args:["components"],varArg:!1,sdkTypes:[na.DIRECT]},o)}(e,0,new me(o))}(o,pt,T,be,pe,Re,ue),ms(T,h.SourceType,h.sensorVolumes)(o,new me(Oe)),function(e,t,n,o){n.addBinding(t.SettingGetCommand,(async e=>{const[t]=await o.getDependencies();return t.tryGetProperty(e.key,t.settingsData.getOverrideParam(e.key,void 0))})),e.addCommandCreator({namespace:"Settings",name:"get",args:["key"]},(e=>new t.SettingGetCommand(e.key)))}(o,h,pt,new me(Me)),function(e,t,n,o){n.addBinding(t.SettingUpdateCommand,(async e=>{if(!e.key||"string"!=typeof e.key)throw Error("Settings: invalid key");const[t]=await o.getDependencies();return t.updateSetting(e.key,e.value),t.tryGetProperty(e.key,void 0)})),e.addCommandCreator({namespace:"Settings",name:"update",args:["key","value"]},(e=>new t.SettingUpdateCommand(e.key,e.value)))}(o,h,pt,new me(Me)),function(e,t,n){n.getDependencies().then((([n])=>{new ws(t.waitForUpdate,n).calcAndBroadcast(e)})),e.addEnumToInterface({namespace:"Stat",name:"Event",values:gs})}(o,pt,new me(oe)),function(e,t){const n=ne.create(t,new F(Ts));e.addAsyncCommandToInterface({namespace:"XStorage",name:"setItem",args:["key","data"],origins:ge},n)}(o,new me(Q)),function(e,t){const n=ne.create(t,new F(Is));e.addAsyncCommandToInterface({namespace:"XStorage",name:"getItem",args:["key"],origins:ge},n)}(o,new me(Q)),function(e,t){const n=ne.create(t,new F(Es));e.addAsyncCommandToInterface({namespace:"XStorage",name:"getAllItems",args:["modelId"],origins:ge},n)}(o,new me(Q)),function(e,t){const n=ne.create(t,new F(ys));e.addAsyncCommandToInterface({namespace:"XStorage",name:"removeItem",args:["key"],origins:ge},n)}(o,new me(Q)),function(e){e.addEnumToInterface({namespace:"Sweep",name:"Transition",values:I}),e.addEnumToInterface({namespace:"Sweep",name:"Alignment",values:l.Alignment}),e.addEnumToInterface({namespace:"Sweep",name:"Placement",values:l.Placement})}(o),function(e,t,n,o){const a=U.create(o,new Cs,new F(Ss,t,n));e.addObservableToInterface({namespace:"Sweep",name:"current"},a)}(o,h,pt,new me(ae,ce,j,Tt,It)),function(e,t,n,o){e.addEnumToInterface({namespace:"Sweep",name:"Event",values:l.Event});const a=["",""],s=()=>a;n.subscribe(t.BeginMoveToSweepMessage,(async t=>{const n=await o;t.fromSweep&&t.fromSweep!==t.toSweep&&(a[0]=t.fromSweep?n.getIdFromCwfId(t.fromSweep):t.fromSweep,a[1]=n.getIdFromCwfId(t.toSweep),e.broadcast(l.Event.EXIT,s,t))})),n.subscribe(t.BeginSwitchViewmodeMessage,(n=>{n.fromMode===t.Viewmode.Panorama&&n.toMode!==t.Viewmode.Panorama&&(a[0]=i[1],a[1]=void 0,e.broadcast(l.Event.EXIT,s))}));const i=["",""],r=()=>i;n.subscribe(t.EndMoveToSweepMessage,(async t=>{const n=await o;i[0]=t.fromSweep?n.getIdFromCwfId(t.fromSweep):t.fromSweep,i[1]=n.getIdFromCwfId(t.toSweep),e.broadcast(l.Event.ENTER,r)}))}(o,h,pt,Tt),function(e,t,n,o){const a=ne.create(o,new F(Ds,t,n));e.addEnumToInterface({namespace:"Sweep",name:"Transition",values:I}),e.addCommandToInterface({namespace:"Sweep",name:"moveTo",args:["sweep","options"]},a)}(o,h,pt,new me(ae,Tt,we)),function(e,t,n){const o=Qe.create(n,new bs,new F(Os,t.conversionUtils,t.sweepPlacementConverter));e.addCollectionToInterface({namespace:"Sweep",name:"data"},o)}(o,pt,new me(ae,j,Tt,It)),function(e,t){const n=ne.create(t,new F(Ns)),o=ne.create(t,new F(Rs));e.addCommandToInterface({namespace:"Sweep",name:"enable",args:["sweepIds"],varArg:!0},n),e.addCommandToInterface({namespace:"Sweep",name:"disable",args:["sweepIds"],varArg:!0},o)}(o,new me(ae,se,Tt)),function(e){(function(e,t){const n=ne.create(t,new F(gi));e.addCommandToInterface({namespace:"Test",name:"echo",args:["arg0"],varArg:!1,origins:ge},n),e.addAsyncCommandToInterface({namespace:"Test",name:"echoAsync",args:["arg0"],origins:ge},n)})(e,new me),function(e,t){const n=ne.create(t,new F(wi));e.addCommandToInterface({namespace:"Test",name:"directCommand",args:[],sdkTypes:[na.DIRECT],varArg:!1,origins:ge},n),e.addCommandToInterface({namespace:"Test",name:"postMessageCommand",args:[],sdkTypes:[na.POSTMESSAGE],varArg:!1,origins:ge},n)}(e,new me),function(e){e.addEnumToInterface({namespace:"Test",name:"directEnum",values:fi,sdkTypes:[na.DIRECT],origins:ge}),e.addEnumToInterface({namespace:"Test",name:"postMessageEnum",values:fi,sdkTypes:[na.POSTMESSAGE],origins:ge})}(e),function(e,t){const n=Qe.create(t,new yi,new F(vi));e.addCollectionToInterface({namespace:"Test",name:"directCollection",sdkTypes:[na.DIRECT],origins:ge},n),e.addCollectionToInterface({namespace:"Test",name:"postMessageCollection",sdkTypes:[na.POSTMESSAGE],origins:ge},n)}(e,new me),function(e,t){const n=U.create(t,new Ai,new F(Ci));e.addObservableToInterface({namespace:"Test",name:"directObservable",sdkTypes:[na.DIRECT],origins:ge},n),e.addObservableToInterface({namespace:"Test",name:"postMessageObservable",sdkTypes:[na.POSTMESSAGE],origins:ge},n)}(e,new me)}(o),function(e){e.addEnumToInterface({namespace:"Tour",name:"PlayState",values:p.PlayState})}(o),function(e,t,n){e.addEnumToInterface({namespace:"Tour",name:"Event",values:p.Event}),n.subscribe(t.TourStartedMessage,(()=>e.broadcast(p.Event.STARTED))),n.subscribe(t.TourStoppedMessage,(()=>e.broadcast(p.Event.STOPPED))),n.subscribe(t.TourEndedMessage,(()=>e.broadcast(p.Event.ENDED)));const o=[-1],a=e=>(o[0]=e.index,o);n.subscribe(t.TourSteppedMessage,(t=>e.broadcast(p.Event.STEPPED,a,t)))}(o,h,pt),Ni(o,h,pt,new me(Ne,re)),function(e,t){const n=U.create(t,new Pi,new F(Li));e.addObservableToInterface({namespace:"Tour",name:"currentStep"},n)}(o,new me(re)),function(e,t,n){const o=U.create(n,new xi,new F(ki,t));e.addObservableToInterface({namespace:"Tour",name:"state"},o)}(o,pt,new me(re)),function(e,t){const n=U.create(t,new Ui,new F(Fi));e.addObservableToInterface({namespace:"Tour",name:"transition"},n)}(o,new me(re))}new ee("SDK interface").info("Showcase SDK interface version","23.5.1_webgl-85-ga5dcafc4f6");var ji=v.w,Wi=v.c;export{ji as IdOption,Wi as setup};
|