Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@archilogic/embed-api

Package Overview
Dependencies
Maintainers
6
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@archilogic/embed-api - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

1

dist/embed.d.ts

@@ -27,2 +27,3 @@ import { CallSender } from 'penpal/lib/types';

units: boolean;
exportImage: boolean;
};

@@ -29,0 +30,0 @@ export declare type EmbedOptions = {

2

dist/embed.js

@@ -1,1 +0,1 @@

function e(){return(e=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}const r={"http:":"80","https:":"443"},t=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,n=["file:","data:"];var o,i,s,a,c;!function(e){e.Call="call",e.Reply="reply",e.Syn="syn",e.SynAck="synAck",e.Ack="ack"}(o||(o={})),function(e){e.Fulfilled="fulfilled",e.Rejected="rejected"}(i||(i={})),function(e){e.ConnectionDestroyed="ConnectionDestroyed",e.ConnectionTimeout="ConnectionTimeout",e.NotInIframe="NotInIframe",e.NoIframeSrc="NoIframeSrc"}(s||(s={})),function(e){e.DataCloneError="DataCloneError"}(a||(a={})),function(e){e.Message="message"}(c||(c={}));const l=({name:e,message:r,stack:t})=>({name:e,message:r,stack:t});let d=0;var u,m=()=>++d,h=window.__A_EMBED_API_VERSION__||"v1_2_0",v=(window.__A_VIEWER_URL__||"https://viewer.archilogic.com")+"/"+h+"?embedType=api",g=0,f=function(e){return JSON.parse(JSON.stringify(e))};(u=exports.PresentationMode||(exports.PresentationMode={}))[u.none=0]="none",u[u.goToCameraDefault=1]="goToCameraDefault",u[u.goToFirstBookmark=2]="goToFirstBookmark",u[u.jumpToCameraDefault=3]="jumpToCameraDefault",u[u.jumpToFirstBookmark=4]="jumpToFirstBookmark",u[u.tourOnce=5]="tourOnce",u[u.tourOnceAndGoBack=6]="tourOnceAndGoBack",u[u.tourLoop=7]="tourLoop";var p={accessToken:void 0,transparentBackground:!0,presentationMode:exports.PresentationMode.jumpToCameraDefault,showTitle:!1,showLogo:!1,minimap:!1,lowResTexturesOnly:!1,bookmarksActive:!1,uiButtons:{birdMode:!1,personMode:!1,fullscreen:!1,bookmarkStrip:!1,share:!1,help:!1,presentation:!1,units:!1}};exports.default=function(){function d(d,u){var h=this,g=this,w=this;void 0===u&&(u={}),this.listeners=new Map,this.onFullscreenChange=function(){w.viewer.onFullscreenChange&&w.viewer.onFullscreenChange(w.getIsFullscreen())},this.toggleFullscreen=function(){try{var e=function(){return h.getIsFullscreen()},r=h.getIsFullscreen()?Promise.resolve(document.exitFullscreen()).then(function(){}):Promise.resolve(h.containerEl.requestFullscreen()).then(function(){});return Promise.resolve(r&&r.then?r.then(e):e())}catch(e){return Promise.reject(e)}},this.handleEvent=function(e,r){var t=w.listeners.get(e);if(t)return t(r);console.warn("Listener not found")},this.getIsFullscreen=function(){return Boolean(document.fullscreenElement&&document.fullscreenElement===w.containerEl)},this.options=f(e({},p,u)),this.containerEl=d,this.viewerEl=function(e){void 0===e&&(e=document.body);var r=document.createElement("iframe");return Object.assign(r,{src:v,width:"100%",height:"100%",title:"Archilogic Embed",frameBorder:"0",scrolling:"no",allowTransparency:"true",allowFullscreen:"true",style:"border: 0;"}),e.appendChild(r),r}(d),this.viewerConnection=(e=>{let{iframe:d,methods:u={},childOrigin:h,timeout:v,debug:g=!1}=e;const f=(e=>(...r)=>{e&&console.log("[Penpal]",...r)})(g),p=(()=>{const e=[];let r=!1;return{destroy(t){r=!0,e.forEach(e=>{e(t)})},onDestroy(t){r?t():e.push(t)}}})(),{onDestroy:w,destroy:y}=p;h||((e=>{if(!e.src&&!e.srcdoc){const e=new Error("Iframe must have src or srcdoc property defined.");throw e.code=s.NoIframeSrc,e}})(d),h=(e=>{if(e&&n.find(r=>e.startsWith(r)))return"null";const o=document.location,i=t.exec(e);let s,a,c;return i?(s=i[1]?i[1]:o.protocol,a=i[2],c=i[4]):(s=o.protocol,a=o.hostname,c=o.port),`${s}//${a}${c&&c!==r[s]?":"+c:""}`})(d.src));const k="null"===h?"*":h,P=((e,r,t,n)=>i=>{if(i.origin!==t)return void e(`Parent: Handshake - Received SYN message from origin ${i.origin} which did not match expected origin ${t}`);e("Parent: Handshake - Received SYN, responding with SYN-ACK");const s={penpal:o.SynAck,methodNames:Object.keys(r)};i.source.postMessage(s,n)})(f,u,h,k),E=((e,r,t,n,d)=>{const{destroy:u,onDestroy:h}=n;let v,g;const f={};return n=>{if(n.origin!==r)return void d(`Parent: Handshake - Received ACK message from origin ${n.origin} which did not match expected origin ${r}`);d("Parent: Handshake - Received ACK");const p={localName:"Parent",local:window,remote:n.source,originForSending:t,originForReceiving:r};v&&v(),v=((e,r,t)=>{const{localName:n,local:s,remote:d,originForSending:u,originForReceiving:m}=e;let h=!1;const v=e=>{if(e.source!==d||e.data.penpal!==o.Call)return;if(e.origin!==m)return void t(`${n} received message from origin ${e.origin} which did not match expected origin ${m}`);const s=e.data,{methodName:c,args:v,id:g}=s;t(`${n}: Received ${c}() call`);const f=e=>r=>{if(t(`${n}: Sending ${c}() reply`),h)return void t(`${n}: Unable to send ${c}() reply due to destroyed connection`);const s={penpal:o.Reply,id:g,resolution:e,returnValue:r};e===i.Rejected&&r instanceof Error&&(s.returnValue=l(r),s.returnValueIsError=!0);try{d.postMessage(s,u)}catch(e){if(e.name===a.DataCloneError){const r={penpal:o.Reply,id:g,resolution:i.Rejected,returnValue:l(e),returnValueIsError:!0};d.postMessage(r,u)}throw e}};new Promise(e=>e(r[c].apply(r,v))).then(f(i.Fulfilled),f(i.Rejected))};return s.addEventListener(c.Message,v),()=>{h=!0,s.removeEventListener(c.Message,v)}})(p,e,d),h(v),g&&g.forEach(e=>{delete f[e]}),g=n.data.methodNames;const w=((e,r,t,n,a)=>{const{localName:l,local:d,remote:u,originForSending:h,originForReceiving:v}=r;let g=!1;return a(l+": Connecting call sender"),t.reduce((e,r)=>(e[r]=(e=>(...r)=>{let t;a(`${l}: Sending ${e}() call`);try{u.closed&&(t=!0)}catch(e){t=!0}if(t&&n(),g){const r=new Error(`Unable to send ${e}() call due to destroyed connection`);throw r.code=s.ConnectionDestroyed,r}return new Promise((t,n)=>{const s=m(),g=r=>{if(r.source!==u||r.data.penpal!==o.Reply||r.data.id!==s)return;if(r.origin!==v)return void a(`${l} received message from origin ${r.origin} which did not match expected origin ${v}`);const m=r.data;a(`${l}: Received ${e}() reply`),d.removeEventListener(c.Message,g);let h=m.returnValue;m.returnValueIsError&&(h=(e=>{const r=new Error;return Object.keys(e).forEach(t=>r[t]=e[t]),r})(h)),(m.resolution===i.Fulfilled?t:n)(h)};d.addEventListener(c.Message,g),u.postMessage({penpal:o.Call,id:s,methodName:e,args:r},h)})})(r),e),e),()=>{g=!0}})(f,p,g,u,d);return h(w),f}})(u,h,k,p,f);return{promise:new Promise((e,r)=>{const t=((e,r)=>{let t;return void 0!==e&&(t=window.setTimeout(()=>{const t=new Error(`Connection timed out after ${e}ms`);t.code=s.ConnectionTimeout,r(t)},e)),()=>{clearTimeout(t)}})(v,y),n=r=>{if(r.source===d.contentWindow&&r.data)if(r.data.penpal!==o.Syn)if(r.data.penpal!==o.Ack);else{const n=E(r);n&&(t(),e(n))}else P(r)};window.addEventListener(c.Message,n),f("Parent: Awaiting handshake"),((e,r)=>{const{destroy:t,onDestroy:n}=r,o=setInterval(()=>{document.contains(e)||(clearInterval(o),t())},6e4);n(()=>{clearInterval(o)})})(d,p),w(e=>{window.removeEventListener(c.Message,n),e||((e=new Error("Connection destroyed")).code=s.ConnectionDestroyed),r(e)})}),destroy(){y()}}})({timeout:1e4,iframe:this.viewerEl,methods:{handleEvent:this.handleEvent,getIsFullscreen:this.getIsFullscreen,toggleFullscreen:this.toggleFullscreen}}),this.viewerReadyPromise=this.viewerConnection.promise.then(function(e){try{return g.viewerInstance=e,Promise.resolve(function(e){var r=e.token,t=e.origin,n=e.viewer;try{if(!r)throw new Error("Error: You need to include a valid access token, to create a new access token visit https://developers.archilogic.com");return Promise.resolve(n.validateAccessToken({token:r,origin:t})).then(function(e){if(!e.isValid)throw new Error("string"==typeof e.message?"Access token: "+(o={reason:e.message,token:r}).token+" is not valid: "+o.reason:"Access token: "+(n={origin:t,token:r}).token+" is not valid for origin "+n.origin);var n,o;return!0})}catch(e){return Promise.reject(e)}}({token:g.options.accessToken,origin:window.location.origin,viewer:e})).then(function(){return document.addEventListener("fullscreenchange",g.onFullscreenChange),g.viewer.set(g.options),!0})}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),!1})}var u,h=d.prototype;return h.loadScene=function(e){try{var r=this;return Promise.resolve(r.viewerReadyPromise).then(function(){return r.viewer.loadScene(e)})}catch(e){return Promise.reject(e)}},h.listBookmarks=function(){try{return Promise.resolve(this.viewer.listBookmarks())}catch(e){return Promise.reject(e)}},h.listSpaces=function(){try{return Promise.resolve(this.viewer.listSpaces())}catch(e){return Promise.reject(e)}},h.startPresentation=function(){try{var e=this;return Promise.resolve(e.viewerReadyPromise).then(function(){return e.viewer.startPresentation()})}catch(e){return Promise.reject(e)}},h.goToBookmark=function(e){var r=e.bookmarkId,t=e.animate,n=void 0===t||t;try{return Promise.resolve(this.viewer.goToBookmark({bookmarkId:r,animate:n}))}catch(e){return Promise.reject(e)}},h.goToBirdMode=function(e){var r=(void 0===e?{}:e).animate,t=void 0===r||r;try{return Promise.resolve(this.viewer.goToBirdMode({animate:t}))}catch(e){return Promise.reject(e)}},h.goToPersonMode=function(e){var r=void 0===e?{}:e,t=r.findSafeLanding,n=void 0===t||t,o=r.animate,i=void 0===o||o;try{return Promise.resolve(this.viewer.goToPersonMode({findSafeLanding:n,animate:i}))}catch(e){return Promise.reject(e)}},h.zoomExtents=function(e){var r=void 0===e?{}:e,t=r.spaceId,n=void 0===t?void 0:t,o=r.animate,i=void 0===o||o,s=r.zoomMin,a=void 0!==s&&s,c=r.zoomMax,l=void 0!==c&&c;try{var d=this.viewerEl.getBoundingClientRect();return Promise.resolve(this.viewer.zoomExtents({spaceId:n,animate:i,aspect:d.width/d.height,zoomMin:a,zoomMax:l}))}catch(e){return Promise.reject(e)}},h.set=function(e){this.viewer.set(f(e))},h.on=function(e,r){return g++,this.listeners.set(g,r),this.viewer.addListener(e,g),g},h.off=function(e){return this.viewer.removeListener(e)},h.destroy=function(){try{return document.removeEventListener("fullscreenchange",this.onFullscreenChange),Promise.resolve(this.viewerConnection.destroy())}catch(e){return Promise.reject(e)}},(u=[{key:"viewer",get:function(){if(!this.viewerInstance)throw new Error("Method called before viewer initialization. Wait for viewerReadyPromise to resolve before performing this action");return this.viewerInstance}}])&&function(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(d.prototype,u),d}(),exports.defaultEmbedOptions=p;
function e(){return(e=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}const r={"http:":"80","https:":"443"},t=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,n=["file:","data:"];var o,i,s,a,c;!function(e){e.Call="call",e.Reply="reply",e.Syn="syn",e.SynAck="synAck",e.Ack="ack"}(o||(o={})),function(e){e.Fulfilled="fulfilled",e.Rejected="rejected"}(i||(i={})),function(e){e.ConnectionDestroyed="ConnectionDestroyed",e.ConnectionTimeout="ConnectionTimeout",e.NotInIframe="NotInIframe",e.NoIframeSrc="NoIframeSrc"}(s||(s={})),function(e){e.DataCloneError="DataCloneError"}(a||(a={})),function(e){e.Message="message"}(c||(c={}));const l=({name:e,message:r,stack:t})=>({name:e,message:r,stack:t});let d=0;var u,m=()=>++d,h=window.__A_EMBED_API_VERSION__||"v1_2_0",v=(window.__A_VIEWER_URL__||"https://viewer.archilogic.com")+"/"+h+"?embedType=api",g=0,f=function(e){return JSON.parse(JSON.stringify(e))};(u=exports.PresentationMode||(exports.PresentationMode={}))[u.none=0]="none",u[u.goToCameraDefault=1]="goToCameraDefault",u[u.goToFirstBookmark=2]="goToFirstBookmark",u[u.jumpToCameraDefault=3]="jumpToCameraDefault",u[u.jumpToFirstBookmark=4]="jumpToFirstBookmark",u[u.tourOnce=5]="tourOnce",u[u.tourOnceAndGoBack=6]="tourOnceAndGoBack",u[u.tourLoop=7]="tourLoop";var p={accessToken:void 0,transparentBackground:!0,presentationMode:exports.PresentationMode.jumpToCameraDefault,showTitle:!1,showLogo:!1,minimap:!1,lowResTexturesOnly:!1,bookmarksActive:!1,uiButtons:{birdMode:!1,personMode:!1,fullscreen:!1,bookmarkStrip:!1,share:!1,help:!1,presentation:!1,units:!1,exportImage:!1}};exports.default=function(){function d(d,u){var h=this,g=this,w=this;void 0===u&&(u={}),this.listeners=new Map,this.onFullscreenChange=function(){w.viewer.onFullscreenChange&&w.viewer.onFullscreenChange(w.getIsFullscreen())},this.toggleFullscreen=function(){try{var e=function(){return h.getIsFullscreen()},r=h.getIsFullscreen()?Promise.resolve(document.exitFullscreen()).then(function(){}):Promise.resolve(h.containerEl.requestFullscreen()).then(function(){});return Promise.resolve(r&&r.then?r.then(e):e())}catch(e){return Promise.reject(e)}},this.handleEvent=function(e,r){var t=w.listeners.get(e);if(t)return t(r);console.warn("Listener not found")},this.getIsFullscreen=function(){return Boolean(document.fullscreenElement&&document.fullscreenElement===w.containerEl)},this.options=f(e({},p,u)),this.containerEl=d,this.viewerEl=function(e){void 0===e&&(e=document.body);var r=document.createElement("iframe");return Object.assign(r,{src:v,width:"100%",height:"100%",title:"Archilogic Embed",frameBorder:"0",scrolling:"no",allowTransparency:"true",allowFullscreen:"true",style:"border: 0;"}),e.appendChild(r),r}(d),this.viewerConnection=(e=>{let{iframe:d,methods:u={},childOrigin:h,timeout:v,debug:g=!1}=e;const f=(e=>(...r)=>{e&&console.log("[Penpal]",...r)})(g),p=(()=>{const e=[];let r=!1;return{destroy(t){r=!0,e.forEach(e=>{e(t)})},onDestroy(t){r?t():e.push(t)}}})(),{onDestroy:w,destroy:y}=p;h||((e=>{if(!e.src&&!e.srcdoc){const e=new Error("Iframe must have src or srcdoc property defined.");throw e.code=s.NoIframeSrc,e}})(d),h=(e=>{if(e&&n.find(r=>e.startsWith(r)))return"null";const o=document.location,i=t.exec(e);let s,a,c;return i?(s=i[1]?i[1]:o.protocol,a=i[2],c=i[4]):(s=o.protocol,a=o.hostname,c=o.port),`${s}//${a}${c&&c!==r[s]?":"+c:""}`})(d.src));const k="null"===h?"*":h,P=((e,r,t,n)=>i=>{if(i.origin!==t)return void e(`Parent: Handshake - Received SYN message from origin ${i.origin} which did not match expected origin ${t}`);e("Parent: Handshake - Received SYN, responding with SYN-ACK");const s={penpal:o.SynAck,methodNames:Object.keys(r)};i.source.postMessage(s,n)})(f,u,h,k),E=((e,r,t,n,d)=>{const{destroy:u,onDestroy:h}=n;let v,g;const f={};return n=>{if(n.origin!==r)return void d(`Parent: Handshake - Received ACK message from origin ${n.origin} which did not match expected origin ${r}`);d("Parent: Handshake - Received ACK");const p={localName:"Parent",local:window,remote:n.source,originForSending:t,originForReceiving:r};v&&v(),v=((e,r,t)=>{const{localName:n,local:s,remote:d,originForSending:u,originForReceiving:m}=e;let h=!1;const v=e=>{if(e.source!==d||e.data.penpal!==o.Call)return;if(e.origin!==m)return void t(`${n} received message from origin ${e.origin} which did not match expected origin ${m}`);const s=e.data,{methodName:c,args:v,id:g}=s;t(`${n}: Received ${c}() call`);const f=e=>r=>{if(t(`${n}: Sending ${c}() reply`),h)return void t(`${n}: Unable to send ${c}() reply due to destroyed connection`);const s={penpal:o.Reply,id:g,resolution:e,returnValue:r};e===i.Rejected&&r instanceof Error&&(s.returnValue=l(r),s.returnValueIsError=!0);try{d.postMessage(s,u)}catch(e){if(e.name===a.DataCloneError){const r={penpal:o.Reply,id:g,resolution:i.Rejected,returnValue:l(e),returnValueIsError:!0};d.postMessage(r,u)}throw e}};new Promise(e=>e(r[c].apply(r,v))).then(f(i.Fulfilled),f(i.Rejected))};return s.addEventListener(c.Message,v),()=>{h=!0,s.removeEventListener(c.Message,v)}})(p,e,d),h(v),g&&g.forEach(e=>{delete f[e]}),g=n.data.methodNames;const w=((e,r,t,n,a)=>{const{localName:l,local:d,remote:u,originForSending:h,originForReceiving:v}=r;let g=!1;return a(l+": Connecting call sender"),t.reduce((e,r)=>(e[r]=(e=>(...r)=>{let t;a(`${l}: Sending ${e}() call`);try{u.closed&&(t=!0)}catch(e){t=!0}if(t&&n(),g){const r=new Error(`Unable to send ${e}() call due to destroyed connection`);throw r.code=s.ConnectionDestroyed,r}return new Promise((t,n)=>{const s=m(),g=r=>{if(r.source!==u||r.data.penpal!==o.Reply||r.data.id!==s)return;if(r.origin!==v)return void a(`${l} received message from origin ${r.origin} which did not match expected origin ${v}`);const m=r.data;a(`${l}: Received ${e}() reply`),d.removeEventListener(c.Message,g);let h=m.returnValue;m.returnValueIsError&&(h=(e=>{const r=new Error;return Object.keys(e).forEach(t=>r[t]=e[t]),r})(h)),(m.resolution===i.Fulfilled?t:n)(h)};d.addEventListener(c.Message,g),u.postMessage({penpal:o.Call,id:s,methodName:e,args:r},h)})})(r),e),e),()=>{g=!0}})(f,p,g,u,d);return h(w),f}})(u,h,k,p,f);return{promise:new Promise((e,r)=>{const t=((e,r)=>{let t;return void 0!==e&&(t=window.setTimeout(()=>{const t=new Error(`Connection timed out after ${e}ms`);t.code=s.ConnectionTimeout,r(t)},e)),()=>{clearTimeout(t)}})(v,y),n=r=>{if(r.source===d.contentWindow&&r.data)if(r.data.penpal!==o.Syn)if(r.data.penpal!==o.Ack);else{const n=E(r);n&&(t(),e(n))}else P(r)};window.addEventListener(c.Message,n),f("Parent: Awaiting handshake"),((e,r)=>{const{destroy:t,onDestroy:n}=r,o=setInterval(()=>{document.contains(e)||(clearInterval(o),t())},6e4);n(()=>{clearInterval(o)})})(d,p),w(e=>{window.removeEventListener(c.Message,n),e||((e=new Error("Connection destroyed")).code=s.ConnectionDestroyed),r(e)})}),destroy(){y()}}})({timeout:1e4,iframe:this.viewerEl,methods:{handleEvent:this.handleEvent,getIsFullscreen:this.getIsFullscreen,toggleFullscreen:this.toggleFullscreen}}),this.viewerReadyPromise=this.viewerConnection.promise.then(function(e){try{return g.viewerInstance=e,Promise.resolve(function(e){var r=e.token,t=e.origin,n=e.viewer;try{if(!r)throw new Error("Error: You need to include a valid access token, to create a new access token visit https://developers.archilogic.com");return Promise.resolve(n.validateAccessToken({token:r,origin:t})).then(function(e){if(!e.isValid)throw new Error("string"==typeof e.message?"Access token: "+(o={reason:e.message,token:r}).token+" is not valid: "+o.reason:"Access token: "+(n={origin:t,token:r}).token+" is not valid for origin "+n.origin);var n,o;return!0})}catch(e){return Promise.reject(e)}}({token:g.options.accessToken,origin:window.location.origin,viewer:e})).then(function(){return document.addEventListener("fullscreenchange",g.onFullscreenChange),g.viewer.set(g.options),!0})}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),!1})}var u,h=d.prototype;return h.loadScene=function(e){try{var r=this;return Promise.resolve(r.viewerReadyPromise).then(function(){return r.viewer.loadScene(e)})}catch(e){return Promise.reject(e)}},h.listBookmarks=function(){try{return Promise.resolve(this.viewer.listBookmarks())}catch(e){return Promise.reject(e)}},h.listSpaces=function(){try{return Promise.resolve(this.viewer.listSpaces())}catch(e){return Promise.reject(e)}},h.startPresentation=function(){try{var e=this;return Promise.resolve(e.viewerReadyPromise).then(function(){return e.viewer.startPresentation()})}catch(e){return Promise.reject(e)}},h.goToBookmark=function(e){var r=e.bookmarkId,t=e.animate,n=void 0===t||t;try{return Promise.resolve(this.viewer.goToBookmark({bookmarkId:r,animate:n}))}catch(e){return Promise.reject(e)}},h.goToBirdMode=function(e){var r=(void 0===e?{}:e).animate,t=void 0===r||r;try{return Promise.resolve(this.viewer.goToBirdMode({animate:t}))}catch(e){return Promise.reject(e)}},h.goToPersonMode=function(e){var r=void 0===e?{}:e,t=r.findSafeLanding,n=void 0===t||t,o=r.animate,i=void 0===o||o;try{return Promise.resolve(this.viewer.goToPersonMode({findSafeLanding:n,animate:i}))}catch(e){return Promise.reject(e)}},h.zoomExtents=function(e){var r=void 0===e?{}:e,t=r.spaceId,n=void 0===t?void 0:t,o=r.animate,i=void 0===o||o,s=r.zoomMin,a=void 0!==s&&s,c=r.zoomMax,l=void 0!==c&&c;try{var d=this.viewerEl.getBoundingClientRect();return Promise.resolve(this.viewer.zoomExtents({spaceId:n,animate:i,aspect:d.width/d.height,zoomMin:a,zoomMax:l}))}catch(e){return Promise.reject(e)}},h.set=function(e){this.viewer.set(f(e))},h.on=function(e,r){return g++,this.listeners.set(g,r),this.viewer.addListener(e,g),g},h.off=function(e){return this.viewer.removeListener(e)},h.destroy=function(){try{return document.removeEventListener("fullscreenchange",this.onFullscreenChange),Promise.resolve(this.viewerConnection.destroy())}catch(e){return Promise.reject(e)}},(u=[{key:"viewer",get:function(){if(!this.viewerInstance)throw new Error("Method called before viewer initialization. Wait for viewerReadyPromise to resolve before performing this action");return this.viewerInstance}}])&&function(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(d.prototype,u),d}(),exports.defaultEmbedOptions=p;

@@ -1,1 +0,1 @@

const e={"http:":"80","https:":"443"},n=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,t=["file:","data:"];var o,r,i,s,a;!function(e){e.Call="call",e.Reply="reply",e.Syn="syn",e.SynAck="synAck",e.Ack="ack"}(o||(o={})),function(e){e.Fulfilled="fulfilled",e.Rejected="rejected"}(r||(r={})),function(e){e.ConnectionDestroyed="ConnectionDestroyed",e.ConnectionTimeout="ConnectionTimeout",e.NotInIframe="NotInIframe",e.NoIframeSrc="NoIframeSrc"}(i||(i={})),function(e){e.DataCloneError="DataCloneError"}(s||(s={})),function(e){e.Message="message"}(a||(a={}));const c=({name:e,message:n,stack:t})=>({name:e,message:n,stack:t});let l=0;var d=()=>++l;const u=window.__A_EMBED_API_VERSION__||"v1_2_0",m=`${window.__A_VIEWER_URL__||"https://viewer.archilogic.com"}/${u}?embedType=api`;let h=0;const g=e=>JSON.parse(JSON.stringify(e));var w;!function(e){e[e.none=0]="none",e[e.goToCameraDefault=1]="goToCameraDefault",e[e.goToFirstBookmark=2]="goToFirstBookmark",e[e.jumpToCameraDefault=3]="jumpToCameraDefault",e[e.jumpToFirstBookmark=4]="jumpToFirstBookmark",e[e.tourOnce=5]="tourOnce",e[e.tourOnceAndGoBack=6]="tourOnceAndGoBack",e[e.tourLoop=7]="tourLoop"}(w||(w={}));const p={accessToken:void 0,transparentBackground:!0,presentationMode:w.jumpToCameraDefault,showTitle:!1,showLogo:!1,minimap:!1,lowResTexturesOnly:!1,bookmarksActive:!1,uiButtons:{birdMode:!1,personMode:!1,fullscreen:!1,bookmarkStrip:!1,share:!1,help:!1,presentation:!1,units:!1}};export default class{constructor(l,u={}){var h=this;this.listeners=new Map,this.onFullscreenChange=()=>{this.viewer.onFullscreenChange&&this.viewer.onFullscreenChange(this.getIsFullscreen())},this.toggleFullscreen=async function(){return h.getIsFullscreen()?await document.exitFullscreen():await h.containerEl.requestFullscreen(),h.getIsFullscreen()},this.handleEvent=(e,n)=>{const t=this.listeners.get(e);if(t)return t(n);console.warn("Listener not found")},this.getIsFullscreen=()=>Boolean(document.fullscreenElement&&document.fullscreenElement===this.containerEl),this.options=g({...p,...u}),this.containerEl=l,this.viewerEl=function(e=document.body){const n=document.createElement("iframe");return Object.assign(n,{src:m,width:"100%",height:"100%",title:"Archilogic Embed",frameBorder:"0",scrolling:"no",allowTransparency:"true",allowFullscreen:"true",style:"border: 0;"}),e.appendChild(n),n}(l),this.viewerConnection=(l=>{let{iframe:u,methods:m={},childOrigin:h,timeout:g,debug:w=!1}=l;const p=(e=>(...n)=>{e&&console.log("[Penpal]",...n)})(w),v=(()=>{const e=[];let n=!1;return{destroy(t){n=!0,e.forEach(e=>{e(t)})},onDestroy(t){n?t():e.push(t)}}})(),{onDestroy:f,destroy:y}=v;h||((e=>{if(!e.src&&!e.srcdoc){const e=new Error("Iframe must have src or srcdoc property defined.");throw e.code=i.NoIframeSrc,e}})(u),h=(o=>{if(o&&t.find(e=>o.startsWith(e)))return"null";const r=document.location,i=n.exec(o);let s,a,c;return i?(s=i[1]?i[1]:r.protocol,a=i[2],c=i[4]):(s=r.protocol,a=r.hostname,c=r.port),`${s}//${a}${c&&c!==e[s]?":"+c:""}`})(u.src));const k="null"===h?"*":h,E=((e,n,t,r)=>i=>{if(i.origin!==t)return void e(`Parent: Handshake - Received SYN message from origin ${i.origin} which did not match expected origin ${t}`);e("Parent: Handshake - Received SYN, responding with SYN-ACK");const s={penpal:o.SynAck,methodNames:Object.keys(n)};i.source.postMessage(s,r)})(p,m,h,k),C=((e,n,t,l,u)=>{const{destroy:m,onDestroy:h}=l;let g,w;const p={};return l=>{if(l.origin!==n)return void u(`Parent: Handshake - Received ACK message from origin ${l.origin} which did not match expected origin ${n}`);u("Parent: Handshake - Received ACK");const v={localName:"Parent",local:window,remote:l.source,originForSending:t,originForReceiving:n};g&&g(),g=((e,n,t)=>{const{localName:i,local:l,remote:d,originForSending:u,originForReceiving:m}=e;let h=!1;const g=e=>{if(e.source!==d||e.data.penpal!==o.Call)return;if(e.origin!==m)return void t(`${i} received message from origin ${e.origin} which did not match expected origin ${m}`);const a=e.data,{methodName:l,args:g,id:w}=a;t(`${i}: Received ${l}() call`);const p=e=>n=>{if(t(`${i}: Sending ${l}() reply`),h)return void t(`${i}: Unable to send ${l}() reply due to destroyed connection`);const a={penpal:o.Reply,id:w,resolution:e,returnValue:n};e===r.Rejected&&n instanceof Error&&(a.returnValue=c(n),a.returnValueIsError=!0);try{d.postMessage(a,u)}catch(e){if(e.name===s.DataCloneError){const n={penpal:o.Reply,id:w,resolution:r.Rejected,returnValue:c(e),returnValueIsError:!0};d.postMessage(n,u)}throw e}};new Promise(e=>e(n[l].apply(n,g))).then(p(r.Fulfilled),p(r.Rejected))};return l.addEventListener(a.Message,g),()=>{h=!0,l.removeEventListener(a.Message,g)}})(v,e,u),h(g),w&&w.forEach(e=>{delete p[e]}),w=l.data.methodNames;const f=((e,n,t,s,c)=>{const{localName:l,local:u,remote:m,originForSending:h,originForReceiving:g}=n;let w=!1;return c(l+": Connecting call sender"),t.reduce((e,n)=>(e[n]=(e=>(...n)=>{let t;c(`${l}: Sending ${e}() call`);try{m.closed&&(t=!0)}catch(e){t=!0}if(t&&s(),w){const n=new Error(`Unable to send ${e}() call due to destroyed connection`);throw n.code=i.ConnectionDestroyed,n}return new Promise((t,i)=>{const s=d(),w=n=>{if(n.source!==m||n.data.penpal!==o.Reply||n.data.id!==s)return;if(n.origin!==g)return void c(`${l} received message from origin ${n.origin} which did not match expected origin ${g}`);const d=n.data;c(`${l}: Received ${e}() reply`),u.removeEventListener(a.Message,w);let h=d.returnValue;d.returnValueIsError&&(h=(e=>{const n=new Error;return Object.keys(e).forEach(t=>n[t]=e[t]),n})(h)),(d.resolution===r.Fulfilled?t:i)(h)};u.addEventListener(a.Message,w),m.postMessage({penpal:o.Call,id:s,methodName:e,args:n},h)})})(n),e),e),()=>{w=!0}})(p,v,w,m,u);return h(f),p}})(m,h,k,v,p);return{promise:new Promise((e,n)=>{const t=((e,n)=>{let t;return void 0!==e&&(t=window.setTimeout(()=>{const t=new Error(`Connection timed out after ${e}ms`);t.code=i.ConnectionTimeout,n(t)},e)),()=>{clearTimeout(t)}})(g,y),r=n=>{if(n.source===u.contentWindow&&n.data)if(n.data.penpal!==o.Syn)if(n.data.penpal!==o.Ack);else{const o=C(n);o&&(t(),e(o))}else E(n)};window.addEventListener(a.Message,r),p("Parent: Awaiting handshake"),((e,n)=>{const{destroy:t,onDestroy:o}=n,r=setInterval(()=>{document.contains(e)||(clearInterval(r),t())},6e4);o(()=>{clearInterval(r)})})(u,v),f(e=>{window.removeEventListener(a.Message,r),e||((e=new Error("Connection destroyed")).code=i.ConnectionDestroyed),n(e)})}),destroy(){y()}}})({timeout:1e4,iframe:this.viewerEl,methods:{handleEvent:this.handleEvent,getIsFullscreen:this.getIsFullscreen,toggleFullscreen:this.toggleFullscreen}}),this.viewerReadyPromise=this.viewerConnection.promise.then(async function(e){return h.viewerInstance=e,await async function({token:e,origin:n,viewer:t}){if(!e)throw new Error("Error: You need to include a valid access token, to create a new access token visit https://developers.archilogic.com");const o={token:e,origin:n},r=await t.validateAccessToken(o);if(!r.isValid)throw new Error("string"==typeof r.message?(({token:e,reason:n})=>`Access token: ${e} is not valid: ${n}`)({reason:r.message,token:e}):(({token:e,origin:n})=>`Access token: ${e} is not valid for origin ${n}`)({origin:n,token:e}));return!0}({token:h.options.accessToken,origin:window.location.origin,viewer:e}),document.addEventListener("fullscreenchange",h.onFullscreenChange),h.viewer.set(h.options),!0}).catch(e=>(console.error(e),!1))}get viewer(){if(!this.viewerInstance)throw new Error("Method called before viewer initialization. Wait for viewerReadyPromise to resolve before performing this action");return this.viewerInstance}async loadScene(e){return await this.viewerReadyPromise,this.viewer.loadScene(e)}async listBookmarks(){return this.viewer.listBookmarks()}async listSpaces(){return this.viewer.listSpaces()}async startPresentation(){return await this.viewerReadyPromise,this.viewer.startPresentation()}async goToBookmark({bookmarkId:e,animate:n=!0}){return this.viewer.goToBookmark({bookmarkId:e,animate:n})}async goToBirdMode({animate:e=!0}={}){return this.viewer.goToBirdMode({animate:e})}async goToPersonMode({findSafeLanding:e=!0,animate:n=!0}={}){return this.viewer.goToPersonMode({findSafeLanding:e,animate:n})}async zoomExtents({spaceId:e,animate:n=!0,zoomMin:t=!1,zoomMax:o=!1}={}){const r=this.viewerEl.getBoundingClientRect();return this.viewer.zoomExtents({spaceId:e,animate:n,aspect:r.width/r.height,zoomMin:t,zoomMax:o})}set(e){this.viewer.set(g(e))}on(e,n){return h++,this.listeners.set(h,n),this.viewer.addListener(e,h),h}off(e){return this.viewer.removeListener(e)}async destroy(){return document.removeEventListener("fullscreenchange",this.onFullscreenChange),this.viewerConnection.destroy()}}export{w as PresentationMode,p as defaultEmbedOptions};
const e={"http:":"80","https:":"443"},n=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,t=["file:","data:"];var o,r,i,s,a;!function(e){e.Call="call",e.Reply="reply",e.Syn="syn",e.SynAck="synAck",e.Ack="ack"}(o||(o={})),function(e){e.Fulfilled="fulfilled",e.Rejected="rejected"}(r||(r={})),function(e){e.ConnectionDestroyed="ConnectionDestroyed",e.ConnectionTimeout="ConnectionTimeout",e.NotInIframe="NotInIframe",e.NoIframeSrc="NoIframeSrc"}(i||(i={})),function(e){e.DataCloneError="DataCloneError"}(s||(s={})),function(e){e.Message="message"}(a||(a={}));const c=({name:e,message:n,stack:t})=>({name:e,message:n,stack:t});let l=0;var d=()=>++l;const u=window.__A_EMBED_API_VERSION__||"v1_2_0",m=`${window.__A_VIEWER_URL__||"https://viewer.archilogic.com"}/${u}?embedType=api`;let h=0;const g=e=>JSON.parse(JSON.stringify(e));var w;!function(e){e[e.none=0]="none",e[e.goToCameraDefault=1]="goToCameraDefault",e[e.goToFirstBookmark=2]="goToFirstBookmark",e[e.jumpToCameraDefault=3]="jumpToCameraDefault",e[e.jumpToFirstBookmark=4]="jumpToFirstBookmark",e[e.tourOnce=5]="tourOnce",e[e.tourOnceAndGoBack=6]="tourOnceAndGoBack",e[e.tourLoop=7]="tourLoop"}(w||(w={}));const p={accessToken:void 0,transparentBackground:!0,presentationMode:w.jumpToCameraDefault,showTitle:!1,showLogo:!1,minimap:!1,lowResTexturesOnly:!1,bookmarksActive:!1,uiButtons:{birdMode:!1,personMode:!1,fullscreen:!1,bookmarkStrip:!1,share:!1,help:!1,presentation:!1,units:!1,exportImage:!1}};export default class{constructor(l,u={}){var h=this;this.listeners=new Map,this.onFullscreenChange=()=>{this.viewer.onFullscreenChange&&this.viewer.onFullscreenChange(this.getIsFullscreen())},this.toggleFullscreen=async function(){return h.getIsFullscreen()?await document.exitFullscreen():await h.containerEl.requestFullscreen(),h.getIsFullscreen()},this.handleEvent=(e,n)=>{const t=this.listeners.get(e);if(t)return t(n);console.warn("Listener not found")},this.getIsFullscreen=()=>Boolean(document.fullscreenElement&&document.fullscreenElement===this.containerEl),this.options=g({...p,...u}),this.containerEl=l,this.viewerEl=function(e=document.body){const n=document.createElement("iframe");return Object.assign(n,{src:m,width:"100%",height:"100%",title:"Archilogic Embed",frameBorder:"0",scrolling:"no",allowTransparency:"true",allowFullscreen:"true",style:"border: 0;"}),e.appendChild(n),n}(l),this.viewerConnection=(l=>{let{iframe:u,methods:m={},childOrigin:h,timeout:g,debug:w=!1}=l;const p=(e=>(...n)=>{e&&console.log("[Penpal]",...n)})(w),v=(()=>{const e=[];let n=!1;return{destroy(t){n=!0,e.forEach(e=>{e(t)})},onDestroy(t){n?t():e.push(t)}}})(),{onDestroy:f,destroy:y}=v;h||((e=>{if(!e.src&&!e.srcdoc){const e=new Error("Iframe must have src or srcdoc property defined.");throw e.code=i.NoIframeSrc,e}})(u),h=(o=>{if(o&&t.find(e=>o.startsWith(e)))return"null";const r=document.location,i=n.exec(o);let s,a,c;return i?(s=i[1]?i[1]:r.protocol,a=i[2],c=i[4]):(s=r.protocol,a=r.hostname,c=r.port),`${s}//${a}${c&&c!==e[s]?":"+c:""}`})(u.src));const k="null"===h?"*":h,E=((e,n,t,r)=>i=>{if(i.origin!==t)return void e(`Parent: Handshake - Received SYN message from origin ${i.origin} which did not match expected origin ${t}`);e("Parent: Handshake - Received SYN, responding with SYN-ACK");const s={penpal:o.SynAck,methodNames:Object.keys(n)};i.source.postMessage(s,r)})(p,m,h,k),C=((e,n,t,l,u)=>{const{destroy:m,onDestroy:h}=l;let g,w;const p={};return l=>{if(l.origin!==n)return void u(`Parent: Handshake - Received ACK message from origin ${l.origin} which did not match expected origin ${n}`);u("Parent: Handshake - Received ACK");const v={localName:"Parent",local:window,remote:l.source,originForSending:t,originForReceiving:n};g&&g(),g=((e,n,t)=>{const{localName:i,local:l,remote:d,originForSending:u,originForReceiving:m}=e;let h=!1;const g=e=>{if(e.source!==d||e.data.penpal!==o.Call)return;if(e.origin!==m)return void t(`${i} received message from origin ${e.origin} which did not match expected origin ${m}`);const a=e.data,{methodName:l,args:g,id:w}=a;t(`${i}: Received ${l}() call`);const p=e=>n=>{if(t(`${i}: Sending ${l}() reply`),h)return void t(`${i}: Unable to send ${l}() reply due to destroyed connection`);const a={penpal:o.Reply,id:w,resolution:e,returnValue:n};e===r.Rejected&&n instanceof Error&&(a.returnValue=c(n),a.returnValueIsError=!0);try{d.postMessage(a,u)}catch(e){if(e.name===s.DataCloneError){const n={penpal:o.Reply,id:w,resolution:r.Rejected,returnValue:c(e),returnValueIsError:!0};d.postMessage(n,u)}throw e}};new Promise(e=>e(n[l].apply(n,g))).then(p(r.Fulfilled),p(r.Rejected))};return l.addEventListener(a.Message,g),()=>{h=!0,l.removeEventListener(a.Message,g)}})(v,e,u),h(g),w&&w.forEach(e=>{delete p[e]}),w=l.data.methodNames;const f=((e,n,t,s,c)=>{const{localName:l,local:u,remote:m,originForSending:h,originForReceiving:g}=n;let w=!1;return c(l+": Connecting call sender"),t.reduce((e,n)=>(e[n]=(e=>(...n)=>{let t;c(`${l}: Sending ${e}() call`);try{m.closed&&(t=!0)}catch(e){t=!0}if(t&&s(),w){const n=new Error(`Unable to send ${e}() call due to destroyed connection`);throw n.code=i.ConnectionDestroyed,n}return new Promise((t,i)=>{const s=d(),w=n=>{if(n.source!==m||n.data.penpal!==o.Reply||n.data.id!==s)return;if(n.origin!==g)return void c(`${l} received message from origin ${n.origin} which did not match expected origin ${g}`);const d=n.data;c(`${l}: Received ${e}() reply`),u.removeEventListener(a.Message,w);let h=d.returnValue;d.returnValueIsError&&(h=(e=>{const n=new Error;return Object.keys(e).forEach(t=>n[t]=e[t]),n})(h)),(d.resolution===r.Fulfilled?t:i)(h)};u.addEventListener(a.Message,w),m.postMessage({penpal:o.Call,id:s,methodName:e,args:n},h)})})(n),e),e),()=>{w=!0}})(p,v,w,m,u);return h(f),p}})(m,h,k,v,p);return{promise:new Promise((e,n)=>{const t=((e,n)=>{let t;return void 0!==e&&(t=window.setTimeout(()=>{const t=new Error(`Connection timed out after ${e}ms`);t.code=i.ConnectionTimeout,n(t)},e)),()=>{clearTimeout(t)}})(g,y),r=n=>{if(n.source===u.contentWindow&&n.data)if(n.data.penpal!==o.Syn)if(n.data.penpal!==o.Ack);else{const o=C(n);o&&(t(),e(o))}else E(n)};window.addEventListener(a.Message,r),p("Parent: Awaiting handshake"),((e,n)=>{const{destroy:t,onDestroy:o}=n,r=setInterval(()=>{document.contains(e)||(clearInterval(r),t())},6e4);o(()=>{clearInterval(r)})})(u,v),f(e=>{window.removeEventListener(a.Message,r),e||((e=new Error("Connection destroyed")).code=i.ConnectionDestroyed),n(e)})}),destroy(){y()}}})({timeout:1e4,iframe:this.viewerEl,methods:{handleEvent:this.handleEvent,getIsFullscreen:this.getIsFullscreen,toggleFullscreen:this.toggleFullscreen}}),this.viewerReadyPromise=this.viewerConnection.promise.then(async function(e){return h.viewerInstance=e,await async function({token:e,origin:n,viewer:t}){if(!e)throw new Error("Error: You need to include a valid access token, to create a new access token visit https://developers.archilogic.com");const o={token:e,origin:n},r=await t.validateAccessToken(o);if(!r.isValid)throw new Error("string"==typeof r.message?(({token:e,reason:n})=>`Access token: ${e} is not valid: ${n}`)({reason:r.message,token:e}):(({token:e,origin:n})=>`Access token: ${e} is not valid for origin ${n}`)({origin:n,token:e}));return!0}({token:h.options.accessToken,origin:window.location.origin,viewer:e}),document.addEventListener("fullscreenchange",h.onFullscreenChange),h.viewer.set(h.options),!0}).catch(e=>(console.error(e),!1))}get viewer(){if(!this.viewerInstance)throw new Error("Method called before viewer initialization. Wait for viewerReadyPromise to resolve before performing this action");return this.viewerInstance}async loadScene(e){return await this.viewerReadyPromise,this.viewer.loadScene(e)}async listBookmarks(){return this.viewer.listBookmarks()}async listSpaces(){return this.viewer.listSpaces()}async startPresentation(){return await this.viewerReadyPromise,this.viewer.startPresentation()}async goToBookmark({bookmarkId:e,animate:n=!0}){return this.viewer.goToBookmark({bookmarkId:e,animate:n})}async goToBirdMode({animate:e=!0}={}){return this.viewer.goToBirdMode({animate:e})}async goToPersonMode({findSafeLanding:e=!0,animate:n=!0}={}){return this.viewer.goToPersonMode({findSafeLanding:e,animate:n})}async zoomExtents({spaceId:e,animate:n=!0,zoomMin:t=!1,zoomMax:o=!1}={}){const r=this.viewerEl.getBoundingClientRect();return this.viewer.zoomExtents({spaceId:e,animate:n,aspect:r.width/r.height,zoomMin:t,zoomMax:o})}set(e){this.viewer.set(g(e))}on(e,n){return h++,this.listeners.set(h,n),this.viewer.addListener(e,h),h}off(e){return this.viewer.removeListener(e)}async destroy(){return document.removeEventListener("fullscreenchange",this.onFullscreenChange),this.viewerConnection.destroy()}}export{w as PresentationMode,p as defaultEmbedOptions};

@@ -1,1 +0,1 @@

function e(){return(e=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}const r={"http:":"80","https:":"443"},t=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,n=["file:","data:"];var o,i,s,a,c;!function(e){e.Call="call",e.Reply="reply",e.Syn="syn",e.SynAck="synAck",e.Ack="ack"}(o||(o={})),function(e){e.Fulfilled="fulfilled",e.Rejected="rejected"}(i||(i={})),function(e){e.ConnectionDestroyed="ConnectionDestroyed",e.ConnectionTimeout="ConnectionTimeout",e.NotInIframe="NotInIframe",e.NoIframeSrc="NoIframeSrc"}(s||(s={})),function(e){e.DataCloneError="DataCloneError"}(a||(a={})),function(e){e.Message="message"}(c||(c={}));const l=({name:e,message:r,stack:t})=>({name:e,message:r,stack:t});let u=0;var d,m=()=>++u,h=window.__A_EMBED_API_VERSION__||"v1_2_0",v=(window.__A_VIEWER_URL__||"https://viewer.archilogic.com")+"/"+h+"?embedType=api",g=0,f=function(e){return JSON.parse(JSON.stringify(e))};!function(e){e[e.none=0]="none",e[e.goToCameraDefault=1]="goToCameraDefault",e[e.goToFirstBookmark=2]="goToFirstBookmark",e[e.jumpToCameraDefault=3]="jumpToCameraDefault",e[e.jumpToFirstBookmark=4]="jumpToFirstBookmark",e[e.tourOnce=5]="tourOnce",e[e.tourOnceAndGoBack=6]="tourOnceAndGoBack",e[e.tourLoop=7]="tourLoop"}(d||(d={}));var p={accessToken:void 0,transparentBackground:!0,presentationMode:d.jumpToCameraDefault,showTitle:!1,showLogo:!1,minimap:!1,lowResTexturesOnly:!1,bookmarksActive:!1,uiButtons:{birdMode:!1,personMode:!1,fullscreen:!1,bookmarkStrip:!1,share:!1,help:!1,presentation:!1,units:!1}},w=function(){function u(u,d){var h=this,g=this,w=this;void 0===d&&(d={}),this.listeners=new Map,this.onFullscreenChange=function(){w.viewer.onFullscreenChange&&w.viewer.onFullscreenChange(w.getIsFullscreen())},this.toggleFullscreen=function(){try{var e=function(){return h.getIsFullscreen()},r=h.getIsFullscreen()?Promise.resolve(document.exitFullscreen()).then(function(){}):Promise.resolve(h.containerEl.requestFullscreen()).then(function(){});return Promise.resolve(r&&r.then?r.then(e):e())}catch(e){return Promise.reject(e)}},this.handleEvent=function(e,r){var t=w.listeners.get(e);if(t)return t(r);console.warn("Listener not found")},this.getIsFullscreen=function(){return Boolean(document.fullscreenElement&&document.fullscreenElement===w.containerEl)},this.options=f(e({},p,d)),this.containerEl=u,this.viewerEl=function(e){void 0===e&&(e=document.body);var r=document.createElement("iframe");return Object.assign(r,{src:v,width:"100%",height:"100%",title:"Archilogic Embed",frameBorder:"0",scrolling:"no",allowTransparency:"true",allowFullscreen:"true",style:"border: 0;"}),e.appendChild(r),r}(u),this.viewerConnection=(e=>{let{iframe:u,methods:d={},childOrigin:h,timeout:v,debug:g=!1}=e;const f=(e=>(...r)=>{e&&console.log("[Penpal]",...r)})(g),p=(()=>{const e=[];let r=!1;return{destroy(t){r=!0,e.forEach(e=>{e(t)})},onDestroy(t){r?t():e.push(t)}}})(),{onDestroy:w,destroy:y}=p;h||((e=>{if(!e.src&&!e.srcdoc){const e=new Error("Iframe must have src or srcdoc property defined.");throw e.code=s.NoIframeSrc,e}})(u),h=(e=>{if(e&&n.find(r=>e.startsWith(r)))return"null";const o=document.location,i=t.exec(e);let s,a,c;return i?(s=i[1]?i[1]:o.protocol,a=i[2],c=i[4]):(s=o.protocol,a=o.hostname,c=o.port),`${s}//${a}${c&&c!==r[s]?":"+c:""}`})(u.src));const k="null"===h?"*":h,E=((e,r,t,n)=>i=>{if(i.origin!==t)return void e(`Parent: Handshake - Received SYN message from origin ${i.origin} which did not match expected origin ${t}`);e("Parent: Handshake - Received SYN, responding with SYN-ACK");const s={penpal:o.SynAck,methodNames:Object.keys(r)};i.source.postMessage(s,n)})(f,d,h,k),P=((e,r,t,n,u)=>{const{destroy:d,onDestroy:h}=n;let v,g;const f={};return n=>{if(n.origin!==r)return void u(`Parent: Handshake - Received ACK message from origin ${n.origin} which did not match expected origin ${r}`);u("Parent: Handshake - Received ACK");const p={localName:"Parent",local:window,remote:n.source,originForSending:t,originForReceiving:r};v&&v(),v=((e,r,t)=>{const{localName:n,local:s,remote:u,originForSending:d,originForReceiving:m}=e;let h=!1;const v=e=>{if(e.source!==u||e.data.penpal!==o.Call)return;if(e.origin!==m)return void t(`${n} received message from origin ${e.origin} which did not match expected origin ${m}`);const s=e.data,{methodName:c,args:v,id:g}=s;t(`${n}: Received ${c}() call`);const f=e=>r=>{if(t(`${n}: Sending ${c}() reply`),h)return void t(`${n}: Unable to send ${c}() reply due to destroyed connection`);const s={penpal:o.Reply,id:g,resolution:e,returnValue:r};e===i.Rejected&&r instanceof Error&&(s.returnValue=l(r),s.returnValueIsError=!0);try{u.postMessage(s,d)}catch(e){if(e.name===a.DataCloneError){const r={penpal:o.Reply,id:g,resolution:i.Rejected,returnValue:l(e),returnValueIsError:!0};u.postMessage(r,d)}throw e}};new Promise(e=>e(r[c].apply(r,v))).then(f(i.Fulfilled),f(i.Rejected))};return s.addEventListener(c.Message,v),()=>{h=!0,s.removeEventListener(c.Message,v)}})(p,e,u),h(v),g&&g.forEach(e=>{delete f[e]}),g=n.data.methodNames;const w=((e,r,t,n,a)=>{const{localName:l,local:u,remote:d,originForSending:h,originForReceiving:v}=r;let g=!1;return a(l+": Connecting call sender"),t.reduce((e,r)=>(e[r]=(e=>(...r)=>{let t;a(`${l}: Sending ${e}() call`);try{d.closed&&(t=!0)}catch(e){t=!0}if(t&&n(),g){const r=new Error(`Unable to send ${e}() call due to destroyed connection`);throw r.code=s.ConnectionDestroyed,r}return new Promise((t,n)=>{const s=m(),g=r=>{if(r.source!==d||r.data.penpal!==o.Reply||r.data.id!==s)return;if(r.origin!==v)return void a(`${l} received message from origin ${r.origin} which did not match expected origin ${v}`);const m=r.data;a(`${l}: Received ${e}() reply`),u.removeEventListener(c.Message,g);let h=m.returnValue;m.returnValueIsError&&(h=(e=>{const r=new Error;return Object.keys(e).forEach(t=>r[t]=e[t]),r})(h)),(m.resolution===i.Fulfilled?t:n)(h)};u.addEventListener(c.Message,g),d.postMessage({penpal:o.Call,id:s,methodName:e,args:r},h)})})(r),e),e),()=>{g=!0}})(f,p,g,d,u);return h(w),f}})(d,h,k,p,f);return{promise:new Promise((e,r)=>{const t=((e,r)=>{let t;return void 0!==e&&(t=window.setTimeout(()=>{const t=new Error(`Connection timed out after ${e}ms`);t.code=s.ConnectionTimeout,r(t)},e)),()=>{clearTimeout(t)}})(v,y),n=r=>{if(r.source===u.contentWindow&&r.data)if(r.data.penpal!==o.Syn)if(r.data.penpal!==o.Ack);else{const n=P(r);n&&(t(),e(n))}else E(r)};window.addEventListener(c.Message,n),f("Parent: Awaiting handshake"),((e,r)=>{const{destroy:t,onDestroy:n}=r,o=setInterval(()=>{document.contains(e)||(clearInterval(o),t())},6e4);n(()=>{clearInterval(o)})})(u,p),w(e=>{window.removeEventListener(c.Message,n),e||((e=new Error("Connection destroyed")).code=s.ConnectionDestroyed),r(e)})}),destroy(){y()}}})({timeout:1e4,iframe:this.viewerEl,methods:{handleEvent:this.handleEvent,getIsFullscreen:this.getIsFullscreen,toggleFullscreen:this.toggleFullscreen}}),this.viewerReadyPromise=this.viewerConnection.promise.then(function(e){try{return g.viewerInstance=e,Promise.resolve(function(e){var r=e.token,t=e.origin,n=e.viewer;try{if(!r)throw new Error("Error: You need to include a valid access token, to create a new access token visit https://developers.archilogic.com");return Promise.resolve(n.validateAccessToken({token:r,origin:t})).then(function(e){if(!e.isValid)throw new Error("string"==typeof e.message?"Access token: "+(o={reason:e.message,token:r}).token+" is not valid: "+o.reason:"Access token: "+(n={origin:t,token:r}).token+" is not valid for origin "+n.origin);var n,o;return!0})}catch(e){return Promise.reject(e)}}({token:g.options.accessToken,origin:window.location.origin,viewer:e})).then(function(){return document.addEventListener("fullscreenchange",g.onFullscreenChange),g.viewer.set(g.options),!0})}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),!1})}var d,h=u.prototype;return h.loadScene=function(e){try{var r=this;return Promise.resolve(r.viewerReadyPromise).then(function(){return r.viewer.loadScene(e)})}catch(e){return Promise.reject(e)}},h.listBookmarks=function(){try{return Promise.resolve(this.viewer.listBookmarks())}catch(e){return Promise.reject(e)}},h.listSpaces=function(){try{return Promise.resolve(this.viewer.listSpaces())}catch(e){return Promise.reject(e)}},h.startPresentation=function(){try{var e=this;return Promise.resolve(e.viewerReadyPromise).then(function(){return e.viewer.startPresentation()})}catch(e){return Promise.reject(e)}},h.goToBookmark=function(e){var r=e.bookmarkId,t=e.animate,n=void 0===t||t;try{return Promise.resolve(this.viewer.goToBookmark({bookmarkId:r,animate:n}))}catch(e){return Promise.reject(e)}},h.goToBirdMode=function(e){var r=(void 0===e?{}:e).animate,t=void 0===r||r;try{return Promise.resolve(this.viewer.goToBirdMode({animate:t}))}catch(e){return Promise.reject(e)}},h.goToPersonMode=function(e){var r=void 0===e?{}:e,t=r.findSafeLanding,n=void 0===t||t,o=r.animate,i=void 0===o||o;try{return Promise.resolve(this.viewer.goToPersonMode({findSafeLanding:n,animate:i}))}catch(e){return Promise.reject(e)}},h.zoomExtents=function(e){var r=void 0===e?{}:e,t=r.spaceId,n=void 0===t?void 0:t,o=r.animate,i=void 0===o||o,s=r.zoomMin,a=void 0!==s&&s,c=r.zoomMax,l=void 0!==c&&c;try{var u=this.viewerEl.getBoundingClientRect();return Promise.resolve(this.viewer.zoomExtents({spaceId:n,animate:i,aspect:u.width/u.height,zoomMin:a,zoomMax:l}))}catch(e){return Promise.reject(e)}},h.set=function(e){this.viewer.set(f(e))},h.on=function(e,r){return g++,this.listeners.set(g,r),this.viewer.addListener(e,g),g},h.off=function(e){return this.viewer.removeListener(e)},h.destroy=function(){try{return document.removeEventListener("fullscreenchange",this.onFullscreenChange),Promise.resolve(this.viewerConnection.destroy())}catch(e){return Promise.reject(e)}},(d=[{key:"viewer",get:function(){if(!this.viewerInstance)throw new Error("Method called before viewer initialization. Wait for viewerReadyPromise to resolve before performing this action");return this.viewerInstance}}])&&function(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(u.prototype,d),u}();export default w;export{d as PresentationMode,p as defaultEmbedOptions};
function e(){return(e=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}const r={"http:":"80","https:":"443"},t=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,n=["file:","data:"];var o,i,s,a,c;!function(e){e.Call="call",e.Reply="reply",e.Syn="syn",e.SynAck="synAck",e.Ack="ack"}(o||(o={})),function(e){e.Fulfilled="fulfilled",e.Rejected="rejected"}(i||(i={})),function(e){e.ConnectionDestroyed="ConnectionDestroyed",e.ConnectionTimeout="ConnectionTimeout",e.NotInIframe="NotInIframe",e.NoIframeSrc="NoIframeSrc"}(s||(s={})),function(e){e.DataCloneError="DataCloneError"}(a||(a={})),function(e){e.Message="message"}(c||(c={}));const l=({name:e,message:r,stack:t})=>({name:e,message:r,stack:t});let u=0;var d,m=()=>++u,h=window.__A_EMBED_API_VERSION__||"v1_2_0",v=(window.__A_VIEWER_URL__||"https://viewer.archilogic.com")+"/"+h+"?embedType=api",g=0,f=function(e){return JSON.parse(JSON.stringify(e))};!function(e){e[e.none=0]="none",e[e.goToCameraDefault=1]="goToCameraDefault",e[e.goToFirstBookmark=2]="goToFirstBookmark",e[e.jumpToCameraDefault=3]="jumpToCameraDefault",e[e.jumpToFirstBookmark=4]="jumpToFirstBookmark",e[e.tourOnce=5]="tourOnce",e[e.tourOnceAndGoBack=6]="tourOnceAndGoBack",e[e.tourLoop=7]="tourLoop"}(d||(d={}));var p={accessToken:void 0,transparentBackground:!0,presentationMode:d.jumpToCameraDefault,showTitle:!1,showLogo:!1,minimap:!1,lowResTexturesOnly:!1,bookmarksActive:!1,uiButtons:{birdMode:!1,personMode:!1,fullscreen:!1,bookmarkStrip:!1,share:!1,help:!1,presentation:!1,units:!1,exportImage:!1}},w=function(){function u(u,d){var h=this,g=this,w=this;void 0===d&&(d={}),this.listeners=new Map,this.onFullscreenChange=function(){w.viewer.onFullscreenChange&&w.viewer.onFullscreenChange(w.getIsFullscreen())},this.toggleFullscreen=function(){try{var e=function(){return h.getIsFullscreen()},r=h.getIsFullscreen()?Promise.resolve(document.exitFullscreen()).then(function(){}):Promise.resolve(h.containerEl.requestFullscreen()).then(function(){});return Promise.resolve(r&&r.then?r.then(e):e())}catch(e){return Promise.reject(e)}},this.handleEvent=function(e,r){var t=w.listeners.get(e);if(t)return t(r);console.warn("Listener not found")},this.getIsFullscreen=function(){return Boolean(document.fullscreenElement&&document.fullscreenElement===w.containerEl)},this.options=f(e({},p,d)),this.containerEl=u,this.viewerEl=function(e){void 0===e&&(e=document.body);var r=document.createElement("iframe");return Object.assign(r,{src:v,width:"100%",height:"100%",title:"Archilogic Embed",frameBorder:"0",scrolling:"no",allowTransparency:"true",allowFullscreen:"true",style:"border: 0;"}),e.appendChild(r),r}(u),this.viewerConnection=(e=>{let{iframe:u,methods:d={},childOrigin:h,timeout:v,debug:g=!1}=e;const f=(e=>(...r)=>{e&&console.log("[Penpal]",...r)})(g),p=(()=>{const e=[];let r=!1;return{destroy(t){r=!0,e.forEach(e=>{e(t)})},onDestroy(t){r?t():e.push(t)}}})(),{onDestroy:w,destroy:y}=p;h||((e=>{if(!e.src&&!e.srcdoc){const e=new Error("Iframe must have src or srcdoc property defined.");throw e.code=s.NoIframeSrc,e}})(u),h=(e=>{if(e&&n.find(r=>e.startsWith(r)))return"null";const o=document.location,i=t.exec(e);let s,a,c;return i?(s=i[1]?i[1]:o.protocol,a=i[2],c=i[4]):(s=o.protocol,a=o.hostname,c=o.port),`${s}//${a}${c&&c!==r[s]?":"+c:""}`})(u.src));const k="null"===h?"*":h,E=((e,r,t,n)=>i=>{if(i.origin!==t)return void e(`Parent: Handshake - Received SYN message from origin ${i.origin} which did not match expected origin ${t}`);e("Parent: Handshake - Received SYN, responding with SYN-ACK");const s={penpal:o.SynAck,methodNames:Object.keys(r)};i.source.postMessage(s,n)})(f,d,h,k),P=((e,r,t,n,u)=>{const{destroy:d,onDestroy:h}=n;let v,g;const f={};return n=>{if(n.origin!==r)return void u(`Parent: Handshake - Received ACK message from origin ${n.origin} which did not match expected origin ${r}`);u("Parent: Handshake - Received ACK");const p={localName:"Parent",local:window,remote:n.source,originForSending:t,originForReceiving:r};v&&v(),v=((e,r,t)=>{const{localName:n,local:s,remote:u,originForSending:d,originForReceiving:m}=e;let h=!1;const v=e=>{if(e.source!==u||e.data.penpal!==o.Call)return;if(e.origin!==m)return void t(`${n} received message from origin ${e.origin} which did not match expected origin ${m}`);const s=e.data,{methodName:c,args:v,id:g}=s;t(`${n}: Received ${c}() call`);const f=e=>r=>{if(t(`${n}: Sending ${c}() reply`),h)return void t(`${n}: Unable to send ${c}() reply due to destroyed connection`);const s={penpal:o.Reply,id:g,resolution:e,returnValue:r};e===i.Rejected&&r instanceof Error&&(s.returnValue=l(r),s.returnValueIsError=!0);try{u.postMessage(s,d)}catch(e){if(e.name===a.DataCloneError){const r={penpal:o.Reply,id:g,resolution:i.Rejected,returnValue:l(e),returnValueIsError:!0};u.postMessage(r,d)}throw e}};new Promise(e=>e(r[c].apply(r,v))).then(f(i.Fulfilled),f(i.Rejected))};return s.addEventListener(c.Message,v),()=>{h=!0,s.removeEventListener(c.Message,v)}})(p,e,u),h(v),g&&g.forEach(e=>{delete f[e]}),g=n.data.methodNames;const w=((e,r,t,n,a)=>{const{localName:l,local:u,remote:d,originForSending:h,originForReceiving:v}=r;let g=!1;return a(l+": Connecting call sender"),t.reduce((e,r)=>(e[r]=(e=>(...r)=>{let t;a(`${l}: Sending ${e}() call`);try{d.closed&&(t=!0)}catch(e){t=!0}if(t&&n(),g){const r=new Error(`Unable to send ${e}() call due to destroyed connection`);throw r.code=s.ConnectionDestroyed,r}return new Promise((t,n)=>{const s=m(),g=r=>{if(r.source!==d||r.data.penpal!==o.Reply||r.data.id!==s)return;if(r.origin!==v)return void a(`${l} received message from origin ${r.origin} which did not match expected origin ${v}`);const m=r.data;a(`${l}: Received ${e}() reply`),u.removeEventListener(c.Message,g);let h=m.returnValue;m.returnValueIsError&&(h=(e=>{const r=new Error;return Object.keys(e).forEach(t=>r[t]=e[t]),r})(h)),(m.resolution===i.Fulfilled?t:n)(h)};u.addEventListener(c.Message,g),d.postMessage({penpal:o.Call,id:s,methodName:e,args:r},h)})})(r),e),e),()=>{g=!0}})(f,p,g,d,u);return h(w),f}})(d,h,k,p,f);return{promise:new Promise((e,r)=>{const t=((e,r)=>{let t;return void 0!==e&&(t=window.setTimeout(()=>{const t=new Error(`Connection timed out after ${e}ms`);t.code=s.ConnectionTimeout,r(t)},e)),()=>{clearTimeout(t)}})(v,y),n=r=>{if(r.source===u.contentWindow&&r.data)if(r.data.penpal!==o.Syn)if(r.data.penpal!==o.Ack);else{const n=P(r);n&&(t(),e(n))}else E(r)};window.addEventListener(c.Message,n),f("Parent: Awaiting handshake"),((e,r)=>{const{destroy:t,onDestroy:n}=r,o=setInterval(()=>{document.contains(e)||(clearInterval(o),t())},6e4);n(()=>{clearInterval(o)})})(u,p),w(e=>{window.removeEventListener(c.Message,n),e||((e=new Error("Connection destroyed")).code=s.ConnectionDestroyed),r(e)})}),destroy(){y()}}})({timeout:1e4,iframe:this.viewerEl,methods:{handleEvent:this.handleEvent,getIsFullscreen:this.getIsFullscreen,toggleFullscreen:this.toggleFullscreen}}),this.viewerReadyPromise=this.viewerConnection.promise.then(function(e){try{return g.viewerInstance=e,Promise.resolve(function(e){var r=e.token,t=e.origin,n=e.viewer;try{if(!r)throw new Error("Error: You need to include a valid access token, to create a new access token visit https://developers.archilogic.com");return Promise.resolve(n.validateAccessToken({token:r,origin:t})).then(function(e){if(!e.isValid)throw new Error("string"==typeof e.message?"Access token: "+(o={reason:e.message,token:r}).token+" is not valid: "+o.reason:"Access token: "+(n={origin:t,token:r}).token+" is not valid for origin "+n.origin);var n,o;return!0})}catch(e){return Promise.reject(e)}}({token:g.options.accessToken,origin:window.location.origin,viewer:e})).then(function(){return document.addEventListener("fullscreenchange",g.onFullscreenChange),g.viewer.set(g.options),!0})}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),!1})}var d,h=u.prototype;return h.loadScene=function(e){try{var r=this;return Promise.resolve(r.viewerReadyPromise).then(function(){return r.viewer.loadScene(e)})}catch(e){return Promise.reject(e)}},h.listBookmarks=function(){try{return Promise.resolve(this.viewer.listBookmarks())}catch(e){return Promise.reject(e)}},h.listSpaces=function(){try{return Promise.resolve(this.viewer.listSpaces())}catch(e){return Promise.reject(e)}},h.startPresentation=function(){try{var e=this;return Promise.resolve(e.viewerReadyPromise).then(function(){return e.viewer.startPresentation()})}catch(e){return Promise.reject(e)}},h.goToBookmark=function(e){var r=e.bookmarkId,t=e.animate,n=void 0===t||t;try{return Promise.resolve(this.viewer.goToBookmark({bookmarkId:r,animate:n}))}catch(e){return Promise.reject(e)}},h.goToBirdMode=function(e){var r=(void 0===e?{}:e).animate,t=void 0===r||r;try{return Promise.resolve(this.viewer.goToBirdMode({animate:t}))}catch(e){return Promise.reject(e)}},h.goToPersonMode=function(e){var r=void 0===e?{}:e,t=r.findSafeLanding,n=void 0===t||t,o=r.animate,i=void 0===o||o;try{return Promise.resolve(this.viewer.goToPersonMode({findSafeLanding:n,animate:i}))}catch(e){return Promise.reject(e)}},h.zoomExtents=function(e){var r=void 0===e?{}:e,t=r.spaceId,n=void 0===t?void 0:t,o=r.animate,i=void 0===o||o,s=r.zoomMin,a=void 0!==s&&s,c=r.zoomMax,l=void 0!==c&&c;try{var u=this.viewerEl.getBoundingClientRect();return Promise.resolve(this.viewer.zoomExtents({spaceId:n,animate:i,aspect:u.width/u.height,zoomMin:a,zoomMax:l}))}catch(e){return Promise.reject(e)}},h.set=function(e){this.viewer.set(f(e))},h.on=function(e,r){return g++,this.listeners.set(g,r),this.viewer.addListener(e,g),g},h.off=function(e){return this.viewer.removeListener(e)},h.destroy=function(){try{return document.removeEventListener("fullscreenchange",this.onFullscreenChange),Promise.resolve(this.viewerConnection.destroy())}catch(e){return Promise.reject(e)}},(d=[{key:"viewer",get:function(){if(!this.viewerInstance)throw new Error("Method called before viewer initialization. Wait for viewerReadyPromise to resolve before performing this action");return this.viewerInstance}}])&&function(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(u.prototype,d),u}();export default w;export{d as PresentationMode,p as defaultEmbedOptions};

@@ -1,1 +0,1 @@

!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e=e||self).embedApi={})}(this,function(e){function r(){return(r=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}const t={"http:":"80","https:":"443"},n=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,o=["file:","data:"];var i,s,a,c,l;!function(e){e.Call="call",e.Reply="reply",e.Syn="syn",e.SynAck="synAck",e.Ack="ack"}(i||(i={})),function(e){e.Fulfilled="fulfilled",e.Rejected="rejected"}(s||(s={})),function(e){e.ConnectionDestroyed="ConnectionDestroyed",e.ConnectionTimeout="ConnectionTimeout",e.NotInIframe="NotInIframe",e.NoIframeSrc="NoIframeSrc"}(a||(a={})),function(e){e.DataCloneError="DataCloneError"}(c||(c={})),function(e){e.Message="message"}(l||(l={}));const d=({name:e,message:r,stack:t})=>({name:e,message:r,stack:t});let u=0;var m,h=()=>++u,v=window.__A_EMBED_API_VERSION__||"v1_2_0",f=(window.__A_VIEWER_URL__||"https://viewer.archilogic.com")+"/"+v+"?embedType=api",g=0,p=function(e){return JSON.parse(JSON.stringify(e))};(m=e.PresentationMode||(e.PresentationMode={}))[m.none=0]="none",m[m.goToCameraDefault=1]="goToCameraDefault",m[m.goToFirstBookmark=2]="goToFirstBookmark",m[m.jumpToCameraDefault=3]="jumpToCameraDefault",m[m.jumpToFirstBookmark=4]="jumpToFirstBookmark",m[m.tourOnce=5]="tourOnce",m[m.tourOnceAndGoBack=6]="tourOnceAndGoBack",m[m.tourLoop=7]="tourLoop";var w={accessToken:void 0,transparentBackground:!0,presentationMode:e.PresentationMode.jumpToCameraDefault,showTitle:!1,showLogo:!1,minimap:!1,lowResTexturesOnly:!1,bookmarksActive:!1,uiButtons:{birdMode:!1,personMode:!1,fullscreen:!1,bookmarkStrip:!1,share:!1,help:!1,presentation:!1,units:!1}};e.default=function(){function e(e,u){var m=this,v=this,g=this;void 0===u&&(u={}),this.listeners=new Map,this.onFullscreenChange=function(){g.viewer.onFullscreenChange&&g.viewer.onFullscreenChange(g.getIsFullscreen())},this.toggleFullscreen=function(){try{var e=function(){return m.getIsFullscreen()},r=m.getIsFullscreen()?Promise.resolve(document.exitFullscreen()).then(function(){}):Promise.resolve(m.containerEl.requestFullscreen()).then(function(){});return Promise.resolve(r&&r.then?r.then(e):e())}catch(e){return Promise.reject(e)}},this.handleEvent=function(e,r){var t=g.listeners.get(e);if(t)return t(r);console.warn("Listener not found")},this.getIsFullscreen=function(){return Boolean(document.fullscreenElement&&document.fullscreenElement===g.containerEl)},this.options=p(r({},w,u)),this.containerEl=e,this.viewerEl=function(e){void 0===e&&(e=document.body);var r=document.createElement("iframe");return Object.assign(r,{src:f,width:"100%",height:"100%",title:"Archilogic Embed",frameBorder:"0",scrolling:"no",allowTransparency:"true",allowFullscreen:"true",style:"border: 0;"}),e.appendChild(r),r}(e),this.viewerConnection=(e=>{let{iframe:r,methods:u={},childOrigin:m,timeout:v,debug:f=!1}=e;const g=(e=>(...r)=>{e&&console.log("[Penpal]",...r)})(f),p=(()=>{const e=[];let r=!1;return{destroy(t){r=!0,e.forEach(e=>{e(t)})},onDestroy(t){r?t():e.push(t)}}})(),{onDestroy:w,destroy:y}=p;m||((e=>{if(!e.src&&!e.srcdoc){const e=new Error("Iframe must have src or srcdoc property defined.");throw e.code=a.NoIframeSrc,e}})(r),m=(e=>{if(e&&o.find(r=>e.startsWith(r)))return"null";const r=document.location,i=n.exec(e);let s,a,c;return i?(s=i[1]?i[1]:r.protocol,a=i[2],c=i[4]):(s=r.protocol,a=r.hostname,c=r.port),`${s}//${a}${c&&c!==t[s]?":"+c:""}`})(r.src));const k="null"===m?"*":m,P=((e,r,t,n)=>o=>{if(o.origin!==t)return void e(`Parent: Handshake - Received SYN message from origin ${o.origin} which did not match expected origin ${t}`);e("Parent: Handshake - Received SYN, responding with SYN-ACK");const s={penpal:i.SynAck,methodNames:Object.keys(r)};o.source.postMessage(s,n)})(g,u,m,k),E=((e,r,t,n,o)=>{const{destroy:u,onDestroy:m}=n;let v,f;const g={};return n=>{if(n.origin!==r)return void o(`Parent: Handshake - Received ACK message from origin ${n.origin} which did not match expected origin ${r}`);o("Parent: Handshake - Received ACK");const p={localName:"Parent",local:window,remote:n.source,originForSending:t,originForReceiving:r};v&&v(),v=((e,r,t)=>{const{localName:n,local:o,remote:a,originForSending:u,originForReceiving:m}=e;let h=!1;const v=e=>{if(e.source!==a||e.data.penpal!==i.Call)return;if(e.origin!==m)return void t(`${n} received message from origin ${e.origin} which did not match expected origin ${m}`);const o=e.data,{methodName:l,args:v,id:f}=o;t(`${n}: Received ${l}() call`);const g=e=>r=>{if(t(`${n}: Sending ${l}() reply`),h)return void t(`${n}: Unable to send ${l}() reply due to destroyed connection`);const o={penpal:i.Reply,id:f,resolution:e,returnValue:r};e===s.Rejected&&r instanceof Error&&(o.returnValue=d(r),o.returnValueIsError=!0);try{a.postMessage(o,u)}catch(e){if(e.name===c.DataCloneError){const r={penpal:i.Reply,id:f,resolution:s.Rejected,returnValue:d(e),returnValueIsError:!0};a.postMessage(r,u)}throw e}};new Promise(e=>e(r[l].apply(r,v))).then(g(s.Fulfilled),g(s.Rejected))};return o.addEventListener(l.Message,v),()=>{h=!0,o.removeEventListener(l.Message,v)}})(p,e,o),m(v),f&&f.forEach(e=>{delete g[e]}),f=n.data.methodNames;const w=((e,r,t,n,o)=>{const{localName:c,local:d,remote:u,originForSending:m,originForReceiving:v}=r;let f=!1;return o(c+": Connecting call sender"),t.reduce((e,r)=>(e[r]=(e=>(...r)=>{let t;o(`${c}: Sending ${e}() call`);try{u.closed&&(t=!0)}catch(e){t=!0}if(t&&n(),f){const r=new Error(`Unable to send ${e}() call due to destroyed connection`);throw r.code=a.ConnectionDestroyed,r}return new Promise((t,n)=>{const a=h(),f=r=>{if(r.source!==u||r.data.penpal!==i.Reply||r.data.id!==a)return;if(r.origin!==v)return void o(`${c} received message from origin ${r.origin} which did not match expected origin ${v}`);const m=r.data;o(`${c}: Received ${e}() reply`),d.removeEventListener(l.Message,f);let h=m.returnValue;m.returnValueIsError&&(h=(e=>{const r=new Error;return Object.keys(e).forEach(t=>r[t]=e[t]),r})(h)),(m.resolution===s.Fulfilled?t:n)(h)};d.addEventListener(l.Message,f),u.postMessage({penpal:i.Call,id:a,methodName:e,args:r},m)})})(r),e),e),()=>{f=!0}})(g,p,f,u,o);return m(w),g}})(u,m,k,p,g);return{promise:new Promise((e,t)=>{const n=((e,r)=>{let t;return void 0!==e&&(t=window.setTimeout(()=>{const t=new Error(`Connection timed out after ${e}ms`);t.code=a.ConnectionTimeout,r(t)},e)),()=>{clearTimeout(t)}})(v,y),o=t=>{if(t.source===r.contentWindow&&t.data)if(t.data.penpal!==i.Syn)if(t.data.penpal!==i.Ack);else{const r=E(t);r&&(n(),e(r))}else P(t)};window.addEventListener(l.Message,o),g("Parent: Awaiting handshake"),((e,r)=>{const{destroy:t,onDestroy:n}=r,o=setInterval(()=>{document.contains(e)||(clearInterval(o),t())},6e4);n(()=>{clearInterval(o)})})(r,p),w(e=>{window.removeEventListener(l.Message,o),e||((e=new Error("Connection destroyed")).code=a.ConnectionDestroyed),t(e)})}),destroy(){y()}}})({timeout:1e4,iframe:this.viewerEl,methods:{handleEvent:this.handleEvent,getIsFullscreen:this.getIsFullscreen,toggleFullscreen:this.toggleFullscreen}}),this.viewerReadyPromise=this.viewerConnection.promise.then(function(e){try{return v.viewerInstance=e,Promise.resolve(function(e){var r=e.token,t=e.origin,n=e.viewer;try{if(!r)throw new Error("Error: You need to include a valid access token, to create a new access token visit https://developers.archilogic.com");return Promise.resolve(n.validateAccessToken({token:r,origin:t})).then(function(e){if(!e.isValid)throw new Error("string"==typeof e.message?"Access token: "+(o={reason:e.message,token:r}).token+" is not valid: "+o.reason:"Access token: "+(n={origin:t,token:r}).token+" is not valid for origin "+n.origin);var n,o;return!0})}catch(e){return Promise.reject(e)}}({token:v.options.accessToken,origin:window.location.origin,viewer:e})).then(function(){return document.addEventListener("fullscreenchange",v.onFullscreenChange),v.viewer.set(v.options),!0})}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),!1})}var u,m=e.prototype;return m.loadScene=function(e){try{var r=this;return Promise.resolve(r.viewerReadyPromise).then(function(){return r.viewer.loadScene(e)})}catch(e){return Promise.reject(e)}},m.listBookmarks=function(){try{return Promise.resolve(this.viewer.listBookmarks())}catch(e){return Promise.reject(e)}},m.listSpaces=function(){try{return Promise.resolve(this.viewer.listSpaces())}catch(e){return Promise.reject(e)}},m.startPresentation=function(){try{var e=this;return Promise.resolve(e.viewerReadyPromise).then(function(){return e.viewer.startPresentation()})}catch(e){return Promise.reject(e)}},m.goToBookmark=function(e){var r=e.bookmarkId,t=e.animate,n=void 0===t||t;try{return Promise.resolve(this.viewer.goToBookmark({bookmarkId:r,animate:n}))}catch(e){return Promise.reject(e)}},m.goToBirdMode=function(e){var r=(void 0===e?{}:e).animate,t=void 0===r||r;try{return Promise.resolve(this.viewer.goToBirdMode({animate:t}))}catch(e){return Promise.reject(e)}},m.goToPersonMode=function(e){var r=void 0===e?{}:e,t=r.findSafeLanding,n=void 0===t||t,o=r.animate,i=void 0===o||o;try{return Promise.resolve(this.viewer.goToPersonMode({findSafeLanding:n,animate:i}))}catch(e){return Promise.reject(e)}},m.zoomExtents=function(e){var r=void 0===e?{}:e,t=r.spaceId,n=void 0===t?void 0:t,o=r.animate,i=void 0===o||o,s=r.zoomMin,a=void 0!==s&&s,c=r.zoomMax,l=void 0!==c&&c;try{var d=this.viewerEl.getBoundingClientRect();return Promise.resolve(this.viewer.zoomExtents({spaceId:n,animate:i,aspect:d.width/d.height,zoomMin:a,zoomMax:l}))}catch(e){return Promise.reject(e)}},m.set=function(e){this.viewer.set(p(e))},m.on=function(e,r){return g++,this.listeners.set(g,r),this.viewer.addListener(e,g),g},m.off=function(e){return this.viewer.removeListener(e)},m.destroy=function(){try{return document.removeEventListener("fullscreenchange",this.onFullscreenChange),Promise.resolve(this.viewerConnection.destroy())}catch(e){return Promise.reject(e)}},(u=[{key:"viewer",get:function(){if(!this.viewerInstance)throw new Error("Method called before viewer initialization. Wait for viewerReadyPromise to resolve before performing this action");return this.viewerInstance}}])&&function(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,u),e}(),e.defaultEmbedOptions=w});
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e=e||self).embedApi={})}(this,function(e){function r(){return(r=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}const t={"http:":"80","https:":"443"},n=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,o=["file:","data:"];var i,s,a,c,l;!function(e){e.Call="call",e.Reply="reply",e.Syn="syn",e.SynAck="synAck",e.Ack="ack"}(i||(i={})),function(e){e.Fulfilled="fulfilled",e.Rejected="rejected"}(s||(s={})),function(e){e.ConnectionDestroyed="ConnectionDestroyed",e.ConnectionTimeout="ConnectionTimeout",e.NotInIframe="NotInIframe",e.NoIframeSrc="NoIframeSrc"}(a||(a={})),function(e){e.DataCloneError="DataCloneError"}(c||(c={})),function(e){e.Message="message"}(l||(l={}));const d=({name:e,message:r,stack:t})=>({name:e,message:r,stack:t});let u=0;var m,h=()=>++u,v=window.__A_EMBED_API_VERSION__||"v1_2_0",f=(window.__A_VIEWER_URL__||"https://viewer.archilogic.com")+"/"+v+"?embedType=api",g=0,p=function(e){return JSON.parse(JSON.stringify(e))};(m=e.PresentationMode||(e.PresentationMode={}))[m.none=0]="none",m[m.goToCameraDefault=1]="goToCameraDefault",m[m.goToFirstBookmark=2]="goToFirstBookmark",m[m.jumpToCameraDefault=3]="jumpToCameraDefault",m[m.jumpToFirstBookmark=4]="jumpToFirstBookmark",m[m.tourOnce=5]="tourOnce",m[m.tourOnceAndGoBack=6]="tourOnceAndGoBack",m[m.tourLoop=7]="tourLoop";var w={accessToken:void 0,transparentBackground:!0,presentationMode:e.PresentationMode.jumpToCameraDefault,showTitle:!1,showLogo:!1,minimap:!1,lowResTexturesOnly:!1,bookmarksActive:!1,uiButtons:{birdMode:!1,personMode:!1,fullscreen:!1,bookmarkStrip:!1,share:!1,help:!1,presentation:!1,units:!1,exportImage:!1}};e.default=function(){function e(e,u){var m=this,v=this,g=this;void 0===u&&(u={}),this.listeners=new Map,this.onFullscreenChange=function(){g.viewer.onFullscreenChange&&g.viewer.onFullscreenChange(g.getIsFullscreen())},this.toggleFullscreen=function(){try{var e=function(){return m.getIsFullscreen()},r=m.getIsFullscreen()?Promise.resolve(document.exitFullscreen()).then(function(){}):Promise.resolve(m.containerEl.requestFullscreen()).then(function(){});return Promise.resolve(r&&r.then?r.then(e):e())}catch(e){return Promise.reject(e)}},this.handleEvent=function(e,r){var t=g.listeners.get(e);if(t)return t(r);console.warn("Listener not found")},this.getIsFullscreen=function(){return Boolean(document.fullscreenElement&&document.fullscreenElement===g.containerEl)},this.options=p(r({},w,u)),this.containerEl=e,this.viewerEl=function(e){void 0===e&&(e=document.body);var r=document.createElement("iframe");return Object.assign(r,{src:f,width:"100%",height:"100%",title:"Archilogic Embed",frameBorder:"0",scrolling:"no",allowTransparency:"true",allowFullscreen:"true",style:"border: 0;"}),e.appendChild(r),r}(e),this.viewerConnection=(e=>{let{iframe:r,methods:u={},childOrigin:m,timeout:v,debug:f=!1}=e;const g=(e=>(...r)=>{e&&console.log("[Penpal]",...r)})(f),p=(()=>{const e=[];let r=!1;return{destroy(t){r=!0,e.forEach(e=>{e(t)})},onDestroy(t){r?t():e.push(t)}}})(),{onDestroy:w,destroy:y}=p;m||((e=>{if(!e.src&&!e.srcdoc){const e=new Error("Iframe must have src or srcdoc property defined.");throw e.code=a.NoIframeSrc,e}})(r),m=(e=>{if(e&&o.find(r=>e.startsWith(r)))return"null";const r=document.location,i=n.exec(e);let s,a,c;return i?(s=i[1]?i[1]:r.protocol,a=i[2],c=i[4]):(s=r.protocol,a=r.hostname,c=r.port),`${s}//${a}${c&&c!==t[s]?":"+c:""}`})(r.src));const k="null"===m?"*":m,P=((e,r,t,n)=>o=>{if(o.origin!==t)return void e(`Parent: Handshake - Received SYN message from origin ${o.origin} which did not match expected origin ${t}`);e("Parent: Handshake - Received SYN, responding with SYN-ACK");const s={penpal:i.SynAck,methodNames:Object.keys(r)};o.source.postMessage(s,n)})(g,u,m,k),E=((e,r,t,n,o)=>{const{destroy:u,onDestroy:m}=n;let v,f;const g={};return n=>{if(n.origin!==r)return void o(`Parent: Handshake - Received ACK message from origin ${n.origin} which did not match expected origin ${r}`);o("Parent: Handshake - Received ACK");const p={localName:"Parent",local:window,remote:n.source,originForSending:t,originForReceiving:r};v&&v(),v=((e,r,t)=>{const{localName:n,local:o,remote:a,originForSending:u,originForReceiving:m}=e;let h=!1;const v=e=>{if(e.source!==a||e.data.penpal!==i.Call)return;if(e.origin!==m)return void t(`${n} received message from origin ${e.origin} which did not match expected origin ${m}`);const o=e.data,{methodName:l,args:v,id:f}=o;t(`${n}: Received ${l}() call`);const g=e=>r=>{if(t(`${n}: Sending ${l}() reply`),h)return void t(`${n}: Unable to send ${l}() reply due to destroyed connection`);const o={penpal:i.Reply,id:f,resolution:e,returnValue:r};e===s.Rejected&&r instanceof Error&&(o.returnValue=d(r),o.returnValueIsError=!0);try{a.postMessage(o,u)}catch(e){if(e.name===c.DataCloneError){const r={penpal:i.Reply,id:f,resolution:s.Rejected,returnValue:d(e),returnValueIsError:!0};a.postMessage(r,u)}throw e}};new Promise(e=>e(r[l].apply(r,v))).then(g(s.Fulfilled),g(s.Rejected))};return o.addEventListener(l.Message,v),()=>{h=!0,o.removeEventListener(l.Message,v)}})(p,e,o),m(v),f&&f.forEach(e=>{delete g[e]}),f=n.data.methodNames;const w=((e,r,t,n,o)=>{const{localName:c,local:d,remote:u,originForSending:m,originForReceiving:v}=r;let f=!1;return o(c+": Connecting call sender"),t.reduce((e,r)=>(e[r]=(e=>(...r)=>{let t;o(`${c}: Sending ${e}() call`);try{u.closed&&(t=!0)}catch(e){t=!0}if(t&&n(),f){const r=new Error(`Unable to send ${e}() call due to destroyed connection`);throw r.code=a.ConnectionDestroyed,r}return new Promise((t,n)=>{const a=h(),f=r=>{if(r.source!==u||r.data.penpal!==i.Reply||r.data.id!==a)return;if(r.origin!==v)return void o(`${c} received message from origin ${r.origin} which did not match expected origin ${v}`);const m=r.data;o(`${c}: Received ${e}() reply`),d.removeEventListener(l.Message,f);let h=m.returnValue;m.returnValueIsError&&(h=(e=>{const r=new Error;return Object.keys(e).forEach(t=>r[t]=e[t]),r})(h)),(m.resolution===s.Fulfilled?t:n)(h)};d.addEventListener(l.Message,f),u.postMessage({penpal:i.Call,id:a,methodName:e,args:r},m)})})(r),e),e),()=>{f=!0}})(g,p,f,u,o);return m(w),g}})(u,m,k,p,g);return{promise:new Promise((e,t)=>{const n=((e,r)=>{let t;return void 0!==e&&(t=window.setTimeout(()=>{const t=new Error(`Connection timed out after ${e}ms`);t.code=a.ConnectionTimeout,r(t)},e)),()=>{clearTimeout(t)}})(v,y),o=t=>{if(t.source===r.contentWindow&&t.data)if(t.data.penpal!==i.Syn)if(t.data.penpal!==i.Ack);else{const r=E(t);r&&(n(),e(r))}else P(t)};window.addEventListener(l.Message,o),g("Parent: Awaiting handshake"),((e,r)=>{const{destroy:t,onDestroy:n}=r,o=setInterval(()=>{document.contains(e)||(clearInterval(o),t())},6e4);n(()=>{clearInterval(o)})})(r,p),w(e=>{window.removeEventListener(l.Message,o),e||((e=new Error("Connection destroyed")).code=a.ConnectionDestroyed),t(e)})}),destroy(){y()}}})({timeout:1e4,iframe:this.viewerEl,methods:{handleEvent:this.handleEvent,getIsFullscreen:this.getIsFullscreen,toggleFullscreen:this.toggleFullscreen}}),this.viewerReadyPromise=this.viewerConnection.promise.then(function(e){try{return v.viewerInstance=e,Promise.resolve(function(e){var r=e.token,t=e.origin,n=e.viewer;try{if(!r)throw new Error("Error: You need to include a valid access token, to create a new access token visit https://developers.archilogic.com");return Promise.resolve(n.validateAccessToken({token:r,origin:t})).then(function(e){if(!e.isValid)throw new Error("string"==typeof e.message?"Access token: "+(o={reason:e.message,token:r}).token+" is not valid: "+o.reason:"Access token: "+(n={origin:t,token:r}).token+" is not valid for origin "+n.origin);var n,o;return!0})}catch(e){return Promise.reject(e)}}({token:v.options.accessToken,origin:window.location.origin,viewer:e})).then(function(){return document.addEventListener("fullscreenchange",v.onFullscreenChange),v.viewer.set(v.options),!0})}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),!1})}var u,m=e.prototype;return m.loadScene=function(e){try{var r=this;return Promise.resolve(r.viewerReadyPromise).then(function(){return r.viewer.loadScene(e)})}catch(e){return Promise.reject(e)}},m.listBookmarks=function(){try{return Promise.resolve(this.viewer.listBookmarks())}catch(e){return Promise.reject(e)}},m.listSpaces=function(){try{return Promise.resolve(this.viewer.listSpaces())}catch(e){return Promise.reject(e)}},m.startPresentation=function(){try{var e=this;return Promise.resolve(e.viewerReadyPromise).then(function(){return e.viewer.startPresentation()})}catch(e){return Promise.reject(e)}},m.goToBookmark=function(e){var r=e.bookmarkId,t=e.animate,n=void 0===t||t;try{return Promise.resolve(this.viewer.goToBookmark({bookmarkId:r,animate:n}))}catch(e){return Promise.reject(e)}},m.goToBirdMode=function(e){var r=(void 0===e?{}:e).animate,t=void 0===r||r;try{return Promise.resolve(this.viewer.goToBirdMode({animate:t}))}catch(e){return Promise.reject(e)}},m.goToPersonMode=function(e){var r=void 0===e?{}:e,t=r.findSafeLanding,n=void 0===t||t,o=r.animate,i=void 0===o||o;try{return Promise.resolve(this.viewer.goToPersonMode({findSafeLanding:n,animate:i}))}catch(e){return Promise.reject(e)}},m.zoomExtents=function(e){var r=void 0===e?{}:e,t=r.spaceId,n=void 0===t?void 0:t,o=r.animate,i=void 0===o||o,s=r.zoomMin,a=void 0!==s&&s,c=r.zoomMax,l=void 0!==c&&c;try{var d=this.viewerEl.getBoundingClientRect();return Promise.resolve(this.viewer.zoomExtents({spaceId:n,animate:i,aspect:d.width/d.height,zoomMin:a,zoomMax:l}))}catch(e){return Promise.reject(e)}},m.set=function(e){this.viewer.set(p(e))},m.on=function(e,r){return g++,this.listeners.set(g,r),this.viewer.addListener(e,g),g},m.off=function(e){return this.viewer.removeListener(e)},m.destroy=function(){try{return document.removeEventListener("fullscreenchange",this.onFullscreenChange),Promise.resolve(this.viewerConnection.destroy())}catch(e){return Promise.reject(e)}},(u=[{key:"viewer",get:function(){if(!this.viewerInstance)throw new Error("Method called before viewer initialization. Wait for viewerReadyPromise to resolve before performing this action");return this.viewerInstance}}])&&function(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,u),e}(),e.defaultEmbedOptions=w});
{
"name": "@archilogic/embed-api",
"version": "1.2.0",
"version": "1.2.1",
"description": "",

@@ -5,0 +5,0 @@ "source": "src/embed.ts",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc