js-cloudimage-360-view 4.0.0-beta.3 → 4.0.0-beta.4
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var De = Object.defineProperty;
|
|
1
|
+
import './js-cloudimage-360-view.min.css';var De = Object.defineProperty;
|
|
2
2
|
var Ne = (e, t, i) => t in e ? De(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
|
|
3
3
|
var ee = (e, t, i) => Ne(e, typeof t != "symbol" ? t + "" : t, i);
|
|
4
4
|
var Et = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "js-cloudimage-360-view",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.4",
|
|
4
4
|
"main": "dist/js-cloudimage-360-view.umd.js",
|
|
5
5
|
"module": "dist/js-cloudimage-360-view.es.js",
|
|
6
6
|
"description": "",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@popperjs/core": "^2.11.2",
|
|
39
|
+
"js-cloudimage-360-view": "4.0.0-beta.3",
|
|
39
40
|
"lodash.debounce": "^4.0.8",
|
|
40
41
|
"lodash.throttle": "^4.1.1"
|
|
41
42
|
},
|
|
@@ -69,4 +70,4 @@
|
|
|
69
70
|
"webpack-cli": "^5.0.1",
|
|
70
71
|
"webpack-dev-server": "^4.13.3"
|
|
71
72
|
}
|
|
72
|
-
}
|
|
73
|
+
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
(function(A,H){typeof exports=="object"&&typeof module<"u"?module.exports=H():typeof define=="function"&&define.amd?define(H):(A=typeof globalThis<"u"?globalThis:A||self,A.JsCloudimage360View=H())})(this,function(){"use strict";var yo=Object.defineProperty;var bo=(A,H,oe)=>H in A?yo(A,H,{enumerable:!0,configurable:!0,writable:!0,value:oe}):A[H]=oe;var Ht=(A,H,oe)=>bo(A,typeof H!="symbol"?H+"":H,oe);var A=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function H(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var oe="Expected a function",Ue=NaN,Bt="[object Symbol]",Zt=/^\s+|\s+$/g,Dt=/^[-+]0x[0-9a-f]+$/i,Nt=/^0b[01]+$/i,$t=/^0o[0-7]+$/i,Vt=parseInt,jt=typeof A=="object"&&A&&A.Object===Object&&A,Ft=typeof self=="object"&&self&&self.Object===Object&&self,Gt=jt||Ft||Function("return this")(),zt=Object.prototype,Ut=zt.toString,Kt=Math.max,qt=Math.min,ke=function(){return Gt.Date.now()};function Jt(t,e,i){var n,o,s,a,r,c,l=0,h=!1,u=!1,f=!0;if(typeof t!="function")throw new TypeError(oe);e=Ke(e)||0,Ye(i)&&(h=!!i.leading,u="maxWait"in i,s=u?Kt(Ke(i.maxWait)||0,e):s,f="trailing"in i?!!i.trailing:f);function d(m){var I=n,E=o;return n=o=void 0,l=m,a=t.apply(E,I),a}function y(m){return l=m,r=setTimeout(x,e),h?d(m):a}function g(m){var I=m-c,E=m-l,S=e-I;return u?qt(S,s-E):S}function v(m){var I=m-c,E=m-l;return c===void 0||I>=e||I<0||u&&E>=s}function x(){var m=ke();if(v(m))return C(m);r=setTimeout(x,g(m))}function C(m){return r=void 0,f&&n?d(m):(n=o=void 0,a)}function O(){r!==void 0&&clearTimeout(r),l=0,n=c=o=r=void 0}function b(){return r===void 0?a:C(ke())}function w(){var m=ke(),I=v(m);if(n=arguments,o=this,c=m,I){if(r===void 0)return y(c);if(u)return r=setTimeout(x,e),d(c)}return r===void 0&&(r=setTimeout(x,e)),a}return w.cancel=O,w.flush=b,w}function Qt(t,e,i){var n=!0,o=!0;if(typeof t!="function")throw new TypeError(oe);return Ye(i)&&(n="leading"in i?!!i.leading:n,o="trailing"in i?!!i.trailing:o),Jt(t,e,{leading:n,maxWait:e,trailing:o})}function Ye(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function _t(t){return!!t&&typeof t=="object"}function ei(t){return typeof t=="symbol"||_t(t)&&Ut.call(t)==Bt}function Ke(t){if(typeof t=="number")return t;if(ei(t))return Ue;if(Ye(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ye(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Zt,"");var i=Nt.test(t);return i||$t.test(t)?Vt(t.slice(2),i?2:8):Dt.test(t)?Ue:+t}var ti=Qt;const qe=H(ti),T={SPIN_X:"spin-x",SPIN_Y:"spin-y",SPIN_XY:"spin-xy",SPIN_YX:"spin-yx"},ii=[!1,0,null,void 0,"false","0","null","undefined"],k={X:"x-axis",Y:"y-axis",CENTER:"center"},ni=["folder","folderX","folderY","filenameX","filenameY","imageListX","imageListY","indexZeroBase","amountX","amountY"],oi=[37,39],si=[38,40],Je=10,p={folder:"/",apiVersion:"v7",filenameX:"image-{index}.jpg",filenameY:null,imageListX:null,imageListY:null,indexZeroBase:0,amountX:0,amountY:0,speed:80,dragSpeed:150,draggable:!0,swipeable:!0,keys:!1,keysReverse:!1,autoplay:!1,autoplayBehavior:T.SPIN_X,playOnce:!1,autoplayReverse:!1,pointerZoom:0,fullscreen:!1,magnifier:null,bottomCircle:!0,bottomCircleOffset:5,ciToken:null,ciFilters:null,ciTransformation:null,lazyload:!0,dragReverse:!1,stopAtEdges:!1,imageInfo:!1,initialIconShown:!0,hotspots:null},ri=t=>({folder:R(t,"folder",p.folder),apiVersion:R(t,"api-version",p.apiVersion),filenameX:R(t,"filename")||R(t,"filename-x")||p.filenameX,filenameY:R(t,"filename-y",p.filenameY),imageListX:R(t,"image-list-x",p.imageListX),imageListY:R(t,"image-list-y",p.imageListY),indexZeroBase:parseInt(R(t,"index-zero-base",p.indexZeroBase),10),amountX:parseInt(R(t,"amount-x",p.amountX),10),amountY:parseInt(R(t,"amount-y",p.amountY),10),speed:parseInt(R(t,"speed",p.speed),10),dragSpeed:parseInt(R(t,"drag-speed",p.dragSpeed),10),draggable:B(t,"draggable",p.draggable),swipeable:B(t,"swipeable",p.swipeable),keys:B(t,"keys",p.keys),keysReverse:B(t,"keys-reverse",p.keysReverse),autoplay:B(t,"autoplay",p.autoplay),autoplayBehavior:R(t,"autoplay-behavior",p.autoplayBehavior),playOnce:B(t,"play-once",p.playOnce),autoplayReverse:B(t,"autoplay-reverse",p.autoplayReverse),pointerZoom:parseFloat(R(t,"pointer-zoom",p.pointerZoom),10),fullscreen:B(t,"fullscreen")||B(t,"full-screen",p.fullscreen),magnifier:parseFloat(R(t,"magnifier",p.magnifier),10),bottomCircleOffset:parseInt(R(t,"bottom-circle-offset",p.bottomCircleOffset),10),ciToken:R(t,"responsive",p.ciToken),ciFilters:R(t,"filters",p.ciFilters),ciTransformation:R(t,"transformation",p.ciTransformation),lazyload:B(t,"lazyload",p.lazyload),dragReverse:B(t,"drag-reverse",p.dragReverse),stopAtEdges:B(t,"stop-at-edges",p.stopAtEdges),imageInfo:B(t,"info",p.imageInfo),initialIconShown:!Qe(t,"initial-icon"),bottomCircle:!Qe(t,"bottom-circle")}),ai=t=>({folder:t.folder||p.folder,apiVersion:t.apiVersion||p.apiVersion,filenameX:t.filenameX||t.filename||p.filenameX,filenameY:t.filenameY||p.filenameY,imageListX:t.imageListX||p.imageListX,imageListY:t.imageListY||p.imageListY,indexZeroBase:parseInt(t.indexZeroBase??p.indexZeroBase,10),amountX:parseInt(t.amountX??p.amountX,10),amountY:parseInt(t.amountY??p.amountY,10),speed:parseInt(t.speed??p.speed,10),draggable:t.draggable??p.draggable,swipeable:t.swipeable??p.swipeable,dragSpeed:parseInt(t.dragSpeed??p.dragSpeed,10),keys:t.keys??p.keys,keysReverse:t.keysReverse??p.keysReverse,autoplay:t.autoplay??p.autoplay,autoplayBehavior:t.autoplayBehavior||p.autoplayBehavior,playOnce:t.playOnce??p.playOnce,autoplayReverse:t.autoplayReverse??p.autoplayReverse,pointerZoom:parseFloat(t.pointerZoom??p.pointerZoom,10),fullscreen:t.fullscreen??p.fullscreen,magnifier:parseFloat(t.magnifier??p.magnifier,10),bottomCircleOffset:parseInt(t.bottomCircleOffset??p.bottomCircleOffset,10),ciToken:t.ciToken||p.ciToken,ciFilters:t.ciFilters||p.ciFilters,ciTransformation:t.ciTransformation||p.ciTransformation,lazyload:t.lazyload??p.lazyload,dragReverse:t.dragReverse??p.dragReverse,stopAtEdges:t.stopAtEdges??p.stopAtEdges,imageInfo:t.imageInfo??p.imageInfo,initialIconShown:t.initialIconShown??p.initialIconShown,bottomCircle:t.bottomCircle??p.bottomCircle,hotspots:t.hotspots??p.hotspots}),R=(t,e,i)=>t.getAttribute(e)||t.getAttribute(`data-${e}`)||i,B=(t,e,i)=>t.hasAttribute(e)||t.hasAttribute(`data-${e}`)||i,Qe=(t,e)=>R(t,e,null)==="false",ci=(t,e,i=ni)=>i.some(n=>n in e&&e[n]!==t[n]),li=(t=1)=>{const e=Math.round(window.devicePixelRatio||1);return parseInt(t)*e},hi=(t,e,i)=>new URL(t).origin.includes("cloudimg")?t:`https://${e}.cloudimg.io/${i}${t}`,di=({ciTransformation:t,responsiveWidth:e,ciFilters:i})=>{const n=`width=${e}`,o=t||n,s=i?`&f=${i}`:"";return`${o}${s}`},me=(t,e)=>{const{folder:i,apiVersion:n,filename:o="",ciParams:s}=t,{ciToken:a,ciFilters:r,ciTransformation:c}=s||{},l=`${i}${o}`;if(!a)return l;const h=ii.includes(n)?null:n,u=h?`${h}/`:"",f=li(e),d=hi(l,a,u),y=di({ciTransformation:c,responsiveWidth:f,ciFilters:r});return`${d}${y?"?":""}${y}`},ui=(t,e,i)=>{const[n,o]=t.split("?"),s=`${e}=${encodeURIComponent(i)}`;if(!o)return`${n}?${s}`;const a=new URLSearchParams(o);return a.set(e,i),`${n}?${a.toString()}`},pi=(t,e)=>ui(t,"width",e),_e=(t,e=0)=>(t+="",t.length>=e?t:new Array(e-t.length+1).join("0")+t),fi=(t,{amount:e=0,indexZeroBase:i=0}={})=>Array.from({length:e},(n,o)=>t.replace("{index}",_e(o+1,i))),mi=({imagesUrls:t,onFirstImageLoad:e,onImageLoad:i,onAllImagesLoad:n,autoplayReverse:o})=>{let s=0;const a=t.length,r=[],c=(u,f)=>{const d=new Image;d.crossOrigin="anonymous",d.src=u,d.onload=async()=>{const y=await createImageBitmap(d),g={src:u,bitmapImage:y,naturalWidth:l.naturalWidth,naturalHeight:l.naturalHeight};s++,r[f]=g,i==null||i(g,f),s===a&&(n==null||n(r))},d.onerror=()=>{console.error(`Failed to load image: ${u}`),s++,s===a&&(n==null||n(r))}},l=new Image,h=t[o?t.length-1:0];l.crossOrigin="anonymous",l.src=h,l.onload=async()=>{const u=await createImageBitmap(l),f={src:h,bitmapImage:u,naturalWidth:l.naturalWidth,naturalHeight:l.naturalHeight};r[0]=f,s++,e==null||e(f),i==null||i(f,0);for(let d=1;d<t.length;d++)c(t[d],d)},l.onerror=()=>{console.error(`Failed to load first image: ${t[0]}`),s++;for(let u=1;u<t.length;u++)c(t[u],u)}},et=({cdnPathX:t,cdnPathY:e,configX:i,configY:n,onFirstImageLoad:o,onImageLoad:s,onAllImagesLoad:a})=>{let r={x:!1,y:!1},c=[],l=[];const h=t||i.imageList.length,u=e||n.imageList.length,f=()=>{r.x&&r.y&&a(c,l)},d=({cdnPath:y,config:g,orientation:v,loadedImages:x,onFirstImageLoad:C})=>{const O=v===k.X,b=g.imageList.length?g.imageList:fi(y,g);mi({imagesUrls:b,onFirstImageLoad:C,onImageLoad:(w,m)=>{s==null||s(w,m,v),x[m]=w},onAllImagesLoad:w=>{x=w,r[O?"x":"y"]=!0,f()},autoplayReverse:g.autoplayReverse})};h?d({cdnPath:t,config:i,orientation:k.X,loadedImages:c,onFirstImageLoad:o}):r.x=!0,u?d({cdnPath:e,config:n,orientation:k.Y,loadedImages:l,onFirstImageLoad:h?void 0:o}):r.y=!0},vi=t=>{const e=new Image;return e.src="https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/assets/img/360.svg",e.style.bottom=`${t}%`,e.className="cloudimage-360-view-360-circle",e},gi=()=>{const t=document.createElement("div");return t.className="cloudimage-initial-icon",t.innerText="360°",t},yi=(t,e)=>{const{width:i,height:n}=e,o=document.createElement("canvas");return o.width=i,o.height=n,o.style.width="100%",o.style.height="auto",t.appendChild(o),o},bi="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='20px'%20viewBox='0%20-960%20960%20960'%20width='20px'%20fill='%235f6368'%3e%3cpath%20d='m147-96-51-51%20261-261H192v-72h288v288h-72v-165L147-96Zm333-384v-288h72v165l261-261%2051%2051-261%20261h165v72H480Z'/%3e%3c/svg%3e",wi=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-close-icon",t.innerHTML=`<img alt="close icon" src=${bi}>`,t},xi="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='20px'%20viewBox='0%20-960%20960%20960'%20width='20px'%20fill='%235f6368'%3e%3cpath%20d='M144-144v-192h72v120h120v72H144Zm480%200v-72h120v-120h72v192H624ZM144-624v-192h192v72H216v120h-72Zm600%200v-120H624v-72h192v192h-72Z'/%3e%3c/svg%3e",Ii=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-fullscreen-button",t.innerHTML=`<img alt="fullscreen icon" src=${xi}>`,t},tt=t=>{const e=document.createElement("div");return e.className="cloudimage-360-icons-container",t.appendChild(e),e},Ci=t=>{const e=document.createElement("div");return e.className="cloudimage-360-inner-box",t.appendChild(e),e},Oi="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='20px'%20viewBox='0%20-960%20960%20960'%20width='20px'%20fill='%235f6368'%3e%3cpath%20d='M765-144%20526-383q-30%2022-65.79%2034.5-35.79%2012.5-76.18%2012.5Q284-336%20214-406t-70-170q0-100%2070-170t170-70q100%200%20170%2070t70%20170.03q0%2040.39-12.5%2076.18Q599-464%20577-434l239%20239-51%2051ZM384-408q70%200%20119-49t49-119q0-70-49-119t-119-49q-70%200-119%2049t-49%20119q0%2070%2049%20119t119%2049Z'/%3e%3c/svg%3e",Ei=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-magnifier-button",t.innerHTML=`<img alt="magnifier icon" src=${Oi}>`,t},Si=t=>{const e=document.createElement("div");e.className="cloudimage-initial-icon";const i=document.createElement("span");return i.className="percentage",i.innerText="0%",e.appendChild(i),t.appendChild(e),e},Yi=t=>{const e=document.createElement("div");e.className="cloudimage-360-fullscreen-modal";const i=t.cloneNode();return i.style.height="100vh",i.style.maxHeight="100%",e.appendChild(i),window.document.body.appendChild(e),i},Me=(t,e)=>{const i=t.querySelector(e);i&&i.parentNode.removeChild(i)},Ri=()=>{const t=document.createElement("div");return t.className="cloudimage-loading-spinner",t},Xi=()=>{const t=document.createElement("div");return t.className="cloudimage-360-transition-overlay",t},Li=t=>{const e=document.createElement("div");return e.className="cloudimage-360-hotspot-container",t.appendChild(e),e},Pi=(t,e)=>{const[i,n]=t.split("?");if(!n)return t;const o=new RegExp(`^${e}=|&${e}=`),s=n.split("&").filter(a=>!o.test(a)).join("&");return s?`${i}?${s}`:i},Ti=t=>{const e=Pi(t,"width"),i=e.includes("?")?"&":"?";return`${e}${i}width=${150*devicePixelRatio}`},Ai=t=>{const e={root:null,rootMargin:"0px",threshold:.1},i=o=>{const s=o.getAttribute("data-src");s&&(o.src=s)};new IntersectionObserver((o,s)=>{o.forEach(a=>{a.isIntersecting&&(i(a.target),s.unobserve(a.target))})},e).observe(t)},ki=(t,e)=>{const i=_e(1,e);return t.replace("{index}",i)},Mi=(t,e)=>{const[i]=t,n=/(https?):\/\//i.test(i);return me({...e,folder:n?"":e.folder,filename:i})},Wi=(t,e)=>{const{imageList:i,indexZeroBase:n}=e;if(i.length)try{const o=JSON.parse(i);return Mi(o,e)}catch(o){console.error(`Wrong format in image-list attribute: ${o.message}`)}return ki(t,n)},it=(t,e,i)=>{const n=new Image;return n.setAttribute(e?"data-src":"src",t),n.className=i,n.style.cssText=`
|
|
2
|
-
position: ${e?"absolute":"static"};
|
|
3
|
-
width: 100%;
|
|
4
|
-
inset: 0;
|
|
5
|
-
height: 100%;
|
|
6
|
-
object-fit: contain;
|
|
7
|
-
object-position: center;
|
|
8
|
-
filter: blur(10px);
|
|
9
|
-
`,n},nt=(t,e,i)=>{const{innerBox:n,imageList:o,lazyload:s}=e||{},[a]=o,r=a||Wi(t,e),c=Ti(r),l=it(c,s,"cloudimage-lazy"),h=it(c,!1,"cloudimage-360-placeholder"),u=f=>{Me(n,".cloudimage-lazy"),i&&i({event:f,width:l.width,height:l.height,naturalWidth:l.naturalWidth,naturalHeight:l.naturalHeight,src:c})};l.onload=u,n.appendChild(l),n.appendChild(h),Ai(l)},Hi=(t,e)=>{const i=new Image;i.src=t,i.onload=n=>{e&&e({event:n,width:i.width,height:i.height,naturalWidth:i.naturalWidth,naturalHeight:i.naturalHeight,src:t})},i.onerror=function(){}},Bi=(t,e)=>{const i=e.getBoundingClientRect(),n=t.touches?t.touches[0].clientX:t.clientX,o=t.touches?t.touches[0].clientY:t.clientY;return{x:n-i.left,y:o-i.top}},We=(t,e,i)=>{const{container:n,w:o,h:s,zoom:a,bw:r,offsetX:c,offsetY:l}=e,h=Bi(t,n);let u=h.x,f=h.y;u=Math.max(o/a,Math.min(u,n.offsetWidth-o/a)),f=Math.max(s/a,Math.min(f,n.offsetHeight-s/a)),i.style.left=`${u-o}px`,i.style.top=`${f-s}px`;const d=(u-c)*a-o+r,y=(f-l)*a-s+r;i.style.backgroundPosition=`-${d}px -${y}px`},Zi=(t,e,i,n,o,s)=>{const{x:a=0,y:r=0}=i||{},c=(e.offsetWidth-a*2)*s,l=(e.offsetHeight-r*2)*s;if(!o)return;o.setAttribute("class","cloudimage-360-img-magnifier-glass"),e.prepend(o),o.style.backgroundImage=`url('${n.src}')`,o.style.backgroundSize=`${c}px ${l}px`;const h=3,u=o.offsetWidth/2,f=o.offsetHeight/2,d={container:e,w:u,h:f,zoom:s,bw:h,offsetX:a,offsetY:r};We(t,d,o);const y=v=>{We(v,d,o)},g=v=>{v.preventDefault(),We(v,d,o)};o.addEventListener("mousemove",y),e.addEventListener("mousemove",y),e.addEventListener("touchmove",g)},Di=(t,e,i)=>{const{clientX:n,clientY:o}=t,s=e.getBoundingClientRect(),a=e.width/(s.width*i),r=e.height/(s.height*i),c=(n-s.left)*a,l=(o-s.top)*r;return{offsetX:c,offsetY:l}},ot=(t,{bottom:e,top:i})=>{t?e():i()},st=(t,{left:e,right:i})=>{t?e():i()},Ni=({autoplayBehavior:t,spinY:e,reversed:i,loopTriggers:n})=>{switch(t){case T.SPIN_XY:case T.SPIN_YX:e?ot(i,n):st(i,n);break;case T.SPIN_Y:ot(i,n);break;case T.SPIN_X:default:st(i,n)}},$i=({autoplayBehavior:t,activeImageX:e,activeImageY:i,amountX:n,amountY:o,autoplayReverse:s})=>{const a=(r,c)=>{const l=c-1;return s?r===0:r===l};switch(t){case T.SPIN_XY:case T.SPIN_Y:return a(i,o);case T.SPIN_X:case T.SPIN_YX:default:return a(e,n)}},Vi=({autoplayBehavior:t,activeImageX:e,activeImageY:i,amountX:n,amountY:o,autoplayReverse:s,spinDirection:a})=>{const r=e===(s?0:n-1),c=i===(s?0:o-1);return t===T.SPIN_XY||t===T.SPIN_YX?a==="x"&&r||a==="y"&&c:!1},ji=(t,e,i)=>{if(!i)return"x";if(!e)return"y";switch(t){case T.SPIN_XY:return"x";case T.SPIN_YX:return"y";case T.SPIN_Y:return"y";case T.SPIN_X:default:return"x"}},Fi=t=>t==="x"?"y":"x",rt=(t,e)=>{const i=[...oi];return e?[...i,...si].includes(t):i.includes(t)},Gi=({deltaX:t,deltaY:e,reversed:i,allowSpinX:n,allowSpinY:o,threshold:s=1})=>{const a=Math.abs(t),r=Math.abs(e);return n&&a-s>r?i?t>0?"left":"right":t>0?"right":"left":o&&r-s>a?i?e>0?"up":"down":e>0?"down":"up":null},zi=()=>"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,Ui=(t,e=150)=>{let i;return function(...n){clearTimeout(i),i=setTimeout(()=>{t.apply(this,n)},e)}},at="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHg9KGEsdCxlKT0+e2NvbnN0IHM9YS9lLG49dC9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sTz0oe3BvaW50ZXJYOmEscG9pbnRlclk6dCxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOnIsbmF0dXJhbEhlaWdodDpsfT1lO2xldCBnPWEvaSpyLXMvMix1PXQvYypsLW4vMjtjb25zdCBwPU1hdGgubWF4KDAsci1zKSxJPU1hdGgubWF4KDAsbC1uKTtyZXR1cm4gZz1NYXRoLm1heCgwLE1hdGgubWluKGcscCkpLHU9TWF0aC5tYXgoMCxNYXRoLm1pbih1LEkpKSx7em9vbU9mZnNldFg6Zyx6b29tT2Zmc2V0WTp1fX07bGV0IG8sbSxmLGgsZCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIGE9Pntjb25zdHthY3Rpb246dCxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpyLGltYWdlQXNwZWN0UmF0aW86bCxjb250YWluZXJXaWR0aDpnLGNvbnRhaW5lckhlaWdodDp1fT1hLmRhdGE7c3dpdGNoKHQpe2Nhc2UiaW5pdENhbnZhcyI6dihlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjp6KGwsZyx1KTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpDKG4saSxjLHIpO2JyZWFrfX07Y29uc3Qgdj0oYSx0KT0+e289YSxtPW8uZ2V0Q29udGV4dCgiMmQiKSxmPXR9LHo9KGEsdCxlKT0+e2NvbnN0IHM9dC9lO3c9YT5zLG8ud2lkdGg9dCpmLG8uaGVpZ2h0PWUqZixtLnNjYWxlKGYsZiksdz8oaD10LGQ9dC9hKTooZD1lLGg9ZSphKSxtLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxtLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEM9KGE9e30sdD0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09YTtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L2YtZCkvMik6KGk9KG8ud2lkdGgvZi1oKS8yLGM9MCksbS5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLHQhPT0xKXtjb25zdHt6b29tZWRXaWR0aDpyLHpvb21lZEhlaWdodDpsfT14KGgsZCx0KSx7em9vbU9mZnNldFg6Zyx6b29tT2Zmc2V0WTp1fT1PKHtwb2ludGVyWDplLHBvaW50ZXJZOnMsaW1hZ2VEYXRhOmEsem9vbWVkV2lkdGg6cix6b29tZWRIZWlnaHQ6bCxkcmF3V2lkdGg6aCxkcmF3SGVpZ2h0OmR9KTttLmRyYXdJbWFnZShuLGcsdSxyLGwsaSxjLGgsZCl9ZWxzZSBtLmRyYXdJbWFnZShuLGksYyxoLGQpfX0pKCk7Cg==",Ki=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),ct=typeof self<"u"&&self.Blob&&new Blob([Ki(at)],{type:"text/javascript;charset=utf-8"});function qi(t){let e;try{if(e=ct&&(self.URL||self.webkitURL).createObjectURL(ct),!e)throw"";const i=new Worker(e,{name:t==null?void 0:t.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),i}catch{return new Worker("data:text/javascript;base64,"+at,{name:t==null?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}const Ji=t=>t==="x"?k.X:k.Y,Qi=(t,e,i)=>t.filter(n=>Ji(n.orientation)===i&&e in n.positions),_i=t=>{const e=document.createElement("span");return e.id=t,e.className="cloudimage-360-hotspot",e.dataset.hotspotId=t,e},en=t=>{const e=Object.entries(t).sort(([s],[a])=>Number(s)-Number(a));let i=null,n=null;const o={};for(const[s,a]of e)if(!a)o[s]={x:i,y:n};else{const{x:r,y:c}=a;r!=null&&(i=r),c!=null&&(n=c),o[s]={x:r||i,y:c||n}}return o},tn=t=>[{name:"offset",options:{offset:[0,10]}},{name:"preventOverflow",options:{boundary:t}}],nn=(t,e)=>{const i=document.createElement("div");return i.className="cloudimage-360-popper",i.id=`cloudimage-360-popper-${e}`,i.dataset.popperId=e,typeof t=="string"&&/<\/?[a-z][\s\S]*>/i.test(t)?i.innerHTML=t:i.textContent=t,document.body.appendChild(i),i},on=t=>{const e=[...t];return e.forEach((i,n)=>{const o={...en(i.positions)};e[n].initialPositions=o,e[n].positions=o}),e},sn=({newWidth:t,newHeight:e,initialContainerSize:i,imageAspectRatio:n,hotspotsConfig:o})=>{const[s,a]=i;let r=t,c=e,l=0,h=0;const u=t/e;n>u?(c=t/n,h=(e-c)/2):(r=e*n,l=(t-r)/2);const d=r/s,y=c/a;return o.map(g=>{const v={};return Object.entries(g.initialPositions).forEach(([x,C])=>{v[x]={x:C.x*d+l,y:C.y*y+h}}),{...g,positions:v}})};var M="top",$="bottom",V="right",W="left",He="auto",ve=[M,$,V,W],le="start",ge="end",rn="clippingParents",lt="viewport",ye="popper",an="reference",ht=ve.reduce(function(t,e){return t.concat([e+"-"+le,e+"-"+ge])},[]),dt=[].concat(ve,[He]).reduce(function(t,e){return t.concat([e,e+"-"+le,e+"-"+ge])},[]),cn="beforeRead",ln="read",hn="afterRead",dn="beforeMain",un="main",pn="afterMain",fn="beforeWrite",mn="write",vn="afterWrite",gn=[cn,ln,hn,dn,un,pn,fn,mn,vn];function G(t){return t?(t.nodeName||"").toLowerCase():null}function Z(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function se(t){var e=Z(t).Element;return t instanceof e||t instanceof Element}function j(t){var e=Z(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Be(t){if(typeof ShadowRoot>"u")return!1;var e=Z(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function yn(t){var e=t.state;Object.keys(e.elements).forEach(function(i){var n=e.styles[i]||{},o=e.attributes[i]||{},s=e.elements[i];!j(s)||!G(s)||(Object.assign(s.style,n),Object.keys(o).forEach(function(a){var r=o[a];r===!1?s.removeAttribute(a):s.setAttribute(a,r===!0?"":r)}))})}function bn(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(n){var o=e.elements[n],s=e.attributes[n]||{},a=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:i[n]),r=a.reduce(function(c,l){return c[l]="",c},{});!j(o)||!G(o)||(Object.assign(o.style,r),Object.keys(s).forEach(function(c){o.removeAttribute(c)}))})}}const wn={name:"applyStyles",enabled:!0,phase:"write",fn:yn,effect:bn,requires:["computeStyles"]};function z(t){return t.split("-")[0]}var re=Math.max,Re=Math.min,he=Math.round;function Ze(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function ut(){return!/^((?!chrome|android).)*safari/i.test(Ze())}function de(t,e,i){e===void 0&&(e=!1),i===void 0&&(i=!1);var n=t.getBoundingClientRect(),o=1,s=1;e&&j(t)&&(o=t.offsetWidth>0&&he(n.width)/t.offsetWidth||1,s=t.offsetHeight>0&&he(n.height)/t.offsetHeight||1);var a=se(t)?Z(t):window,r=a.visualViewport,c=!ut()&&i,l=(n.left+(c&&r?r.offsetLeft:0))/o,h=(n.top+(c&&r?r.offsetTop:0))/s,u=n.width/o,f=n.height/s;return{width:u,height:f,top:h,right:l+u,bottom:h+f,left:l,x:l,y:h}}function De(t){var e=de(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function pt(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Be(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function q(t){return Z(t).getComputedStyle(t)}function xn(t){return["table","td","th"].indexOf(G(t))>=0}function ee(t){return((se(t)?t.ownerDocument:t.document)||window.document).documentElement}function Xe(t){return G(t)==="html"?t:t.assignedSlot||t.parentNode||(Be(t)?t.host:null)||ee(t)}function ft(t){return!j(t)||q(t).position==="fixed"?null:t.offsetParent}function In(t){var e=/firefox/i.test(Ze()),i=/Trident/i.test(Ze());if(i&&j(t)){var n=q(t);if(n.position==="fixed")return null}var o=Xe(t);for(Be(o)&&(o=o.host);j(o)&&["html","body"].indexOf(G(o))<0;){var s=q(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function be(t){for(var e=Z(t),i=ft(t);i&&xn(i)&&q(i).position==="static";)i=ft(i);return i&&(G(i)==="html"||G(i)==="body"&&q(i).position==="static")?e:i||In(t)||e}function Ne(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function we(t,e,i){return re(t,Re(e,i))}function Cn(t,e,i){var n=we(t,e,i);return n>i?i:n}function mt(){return{top:0,right:0,bottom:0,left:0}}function vt(t){return Object.assign({},mt(),t)}function gt(t,e){return e.reduce(function(i,n){return i[n]=t,i},{})}var On=function(e,i){return e=typeof e=="function"?e(Object.assign({},i.rects,{placement:i.placement})):e,vt(typeof e!="number"?e:gt(e,ve))};function En(t){var e,i=t.state,n=t.name,o=t.options,s=i.elements.arrow,a=i.modifiersData.popperOffsets,r=z(i.placement),c=Ne(r),l=[W,V].indexOf(r)>=0,h=l?"height":"width";if(!(!s||!a)){var u=On(o.padding,i),f=De(s),d=c==="y"?M:W,y=c==="y"?$:V,g=i.rects.reference[h]+i.rects.reference[c]-a[c]-i.rects.popper[h],v=a[c]-i.rects.reference[c],x=be(s),C=x?c==="y"?x.clientHeight||0:x.clientWidth||0:0,O=g/2-v/2,b=u[d],w=C-f[h]-u[y],m=C/2-f[h]/2+O,I=we(b,m,w),E=c;i.modifiersData[n]=(e={},e[E]=I,e.centerOffset=I-m,e)}}function Sn(t){var e=t.state,i=t.options,n=i.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||pt(e.elements.popper,o)&&(e.elements.arrow=o))}const Yn={name:"arrow",enabled:!0,phase:"main",fn:En,effect:Sn,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ue(t){return t.split("-")[1]}var Rn={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Xn(t,e){var i=t.x,n=t.y,o=e.devicePixelRatio||1;return{x:he(i*o)/o||0,y:he(n*o)/o||0}}function yt(t){var e,i=t.popper,n=t.popperRect,o=t.placement,s=t.variation,a=t.offsets,r=t.position,c=t.gpuAcceleration,l=t.adaptive,h=t.roundOffsets,u=t.isFixed,f=a.x,d=f===void 0?0:f,y=a.y,g=y===void 0?0:y,v=typeof h=="function"?h({x:d,y:g}):{x:d,y:g};d=v.x,g=v.y;var x=a.hasOwnProperty("x"),C=a.hasOwnProperty("y"),O=W,b=M,w=window;if(l){var m=be(i),I="clientHeight",E="clientWidth";if(m===Z(i)&&(m=ee(i),q(m).position!=="static"&&r==="absolute"&&(I="scrollHeight",E="scrollWidth")),m=m,o===M||(o===W||o===V)&&s===ge){b=$;var S=u&&m===w&&w.visualViewport?w.visualViewport.height:m[I];g-=S-n.height,g*=c?1:-1}if(o===W||(o===M||o===$)&&s===ge){O=V;var Y=u&&m===w&&w.visualViewport?w.visualViewport.width:m[E];d-=Y-n.width,d*=c?1:-1}}var X=Object.assign({position:r},l&&Rn),D=h===!0?Xn({x:d,y:g},Z(i)):{x:d,y:g};if(d=D.x,g=D.y,c){var L;return Object.assign({},X,(L={},L[b]=C?"0":"",L[O]=x?"0":"",L.transform=(w.devicePixelRatio||1)<=1?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",L))}return Object.assign({},X,(e={},e[b]=C?g+"px":"",e[O]=x?d+"px":"",e.transform="",e))}function Ln(t){var e=t.state,i=t.options,n=i.gpuAcceleration,o=n===void 0?!0:n,s=i.adaptive,a=s===void 0?!0:s,r=i.roundOffsets,c=r===void 0?!0:r,l={placement:z(e.placement),variation:ue(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,yt(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,yt(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Pn={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ln,data:{}};var Le={passive:!0};function Tn(t){var e=t.state,i=t.instance,n=t.options,o=n.scroll,s=o===void 0?!0:o,a=n.resize,r=a===void 0?!0:a,c=Z(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&l.forEach(function(h){h.addEventListener("scroll",i.update,Le)}),r&&c.addEventListener("resize",i.update,Le),function(){s&&l.forEach(function(h){h.removeEventListener("scroll",i.update,Le)}),r&&c.removeEventListener("resize",i.update,Le)}}const An={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Tn,data:{}};var kn={left:"right",right:"left",bottom:"top",top:"bottom"};function Pe(t){return t.replace(/left|right|bottom|top/g,function(e){return kn[e]})}var Mn={start:"end",end:"start"};function bt(t){return t.replace(/start|end/g,function(e){return Mn[e]})}function $e(t){var e=Z(t),i=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:i,scrollTop:n}}function Ve(t){return de(ee(t)).left+$e(t).scrollLeft}function Wn(t,e){var i=Z(t),n=ee(t),o=i.visualViewport,s=n.clientWidth,a=n.clientHeight,r=0,c=0;if(o){s=o.width,a=o.height;var l=ut();(l||!l&&e==="fixed")&&(r=o.offsetLeft,c=o.offsetTop)}return{width:s,height:a,x:r+Ve(t),y:c}}function Hn(t){var e,i=ee(t),n=$e(t),o=(e=t.ownerDocument)==null?void 0:e.body,s=re(i.scrollWidth,i.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=re(i.scrollHeight,i.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),r=-n.scrollLeft+Ve(t),c=-n.scrollTop;return q(o||i).direction==="rtl"&&(r+=re(i.clientWidth,o?o.clientWidth:0)-s),{width:s,height:a,x:r,y:c}}function je(t){var e=q(t),i=e.overflow,n=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+o+n)}function wt(t){return["html","body","#document"].indexOf(G(t))>=0?t.ownerDocument.body:j(t)&&je(t)?t:wt(Xe(t))}function xe(t,e){var i;e===void 0&&(e=[]);var n=wt(t),o=n===((i=t.ownerDocument)==null?void 0:i.body),s=Z(n),a=o?[s].concat(s.visualViewport||[],je(n)?n:[]):n,r=e.concat(a);return o?r:r.concat(xe(Xe(a)))}function Fe(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Bn(t,e){var i=de(t,!1,e==="fixed");return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}function xt(t,e,i){return e===lt?Fe(Wn(t,i)):se(e)?Bn(e,i):Fe(Hn(ee(t)))}function Zn(t){var e=xe(Xe(t)),i=["absolute","fixed"].indexOf(q(t).position)>=0,n=i&&j(t)?be(t):t;return se(n)?e.filter(function(o){return se(o)&&pt(o,n)&&G(o)!=="body"}):[]}function Dn(t,e,i,n){var o=e==="clippingParents"?Zn(t):[].concat(e),s=[].concat(o,[i]),a=s[0],r=s.reduce(function(c,l){var h=xt(t,l,n);return c.top=re(h.top,c.top),c.right=Re(h.right,c.right),c.bottom=Re(h.bottom,c.bottom),c.left=re(h.left,c.left),c},xt(t,a,n));return r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function It(t){var e=t.reference,i=t.element,n=t.placement,o=n?z(n):null,s=n?ue(n):null,a=e.x+e.width/2-i.width/2,r=e.y+e.height/2-i.height/2,c;switch(o){case M:c={x:a,y:e.y-i.height};break;case $:c={x:a,y:e.y+e.height};break;case V:c={x:e.x+e.width,y:r};break;case W:c={x:e.x-i.width,y:r};break;default:c={x:e.x,y:e.y}}var l=o?Ne(o):null;if(l!=null){var h=l==="y"?"height":"width";switch(s){case le:c[l]=c[l]-(e[h]/2-i[h]/2);break;case ge:c[l]=c[l]+(e[h]/2-i[h]/2);break}}return c}function Ie(t,e){e===void 0&&(e={});var i=e,n=i.placement,o=n===void 0?t.placement:n,s=i.strategy,a=s===void 0?t.strategy:s,r=i.boundary,c=r===void 0?rn:r,l=i.rootBoundary,h=l===void 0?lt:l,u=i.elementContext,f=u===void 0?ye:u,d=i.altBoundary,y=d===void 0?!1:d,g=i.padding,v=g===void 0?0:g,x=vt(typeof v!="number"?v:gt(v,ve)),C=f===ye?an:ye,O=t.rects.popper,b=t.elements[y?C:f],w=Dn(se(b)?b:b.contextElement||ee(t.elements.popper),c,h,a),m=de(t.elements.reference),I=It({reference:m,element:O,strategy:"absolute",placement:o}),E=Fe(Object.assign({},O,I)),S=f===ye?E:m,Y={top:w.top-S.top+x.top,bottom:S.bottom-w.bottom+x.bottom,left:w.left-S.left+x.left,right:S.right-w.right+x.right},X=t.modifiersData.offset;if(f===ye&&X){var D=X[o];Object.keys(Y).forEach(function(L){var J=[V,$].indexOf(L)>=0?1:-1,Q=[M,$].indexOf(L)>=0?"y":"x";Y[L]+=D[Q]*J})}return Y}function Nn(t,e){e===void 0&&(e={});var i=e,n=i.placement,o=i.boundary,s=i.rootBoundary,a=i.padding,r=i.flipVariations,c=i.allowedAutoPlacements,l=c===void 0?dt:c,h=ue(n),u=h?r?ht:ht.filter(function(y){return ue(y)===h}):ve,f=u.filter(function(y){return l.indexOf(y)>=0});f.length===0&&(f=u);var d=f.reduce(function(y,g){return y[g]=Ie(t,{placement:g,boundary:o,rootBoundary:s,padding:a})[z(g)],y},{});return Object.keys(d).sort(function(y,g){return d[y]-d[g]})}function $n(t){if(z(t)===He)return[];var e=Pe(t);return[bt(t),e,bt(e)]}function Vn(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var o=i.mainAxis,s=o===void 0?!0:o,a=i.altAxis,r=a===void 0?!0:a,c=i.fallbackPlacements,l=i.padding,h=i.boundary,u=i.rootBoundary,f=i.altBoundary,d=i.flipVariations,y=d===void 0?!0:d,g=i.allowedAutoPlacements,v=e.options.placement,x=z(v),C=x===v,O=c||(C||!y?[Pe(v)]:$n(v)),b=[v].concat(O).reduce(function(U,F){return U.concat(z(F)===He?Nn(e,{placement:F,boundary:h,rootBoundary:u,padding:l,flipVariations:y,allowedAutoPlacements:g}):F)},[]),w=e.rects.reference,m=e.rects.popper,I=new Map,E=!0,S=b[0],Y=0;Y<b.length;Y++){var X=b[Y],D=z(X),L=ue(X)===le,J=[M,$].indexOf(D)>=0,Q=J?"width":"height",P=Ie(e,{placement:X,boundary:h,rootBoundary:u,altBoundary:f,padding:l}),N=J?L?V:W:L?$:M;w[Q]>m[Q]&&(N=Pe(N));var pe=Pe(N),_=[];if(s&&_.push(P[D]<=0),r&&_.push(P[N]<=0,P[pe]<=0),_.every(function(U){return U})){S=X,E=!1;break}I.set(X,_)}if(E)for(var fe=y?3:1,Ce=function(F){var ne=b.find(function(ae){var K=I.get(ae);if(K)return K.slice(0,F).every(function(Oe){return Oe})});if(ne)return S=ne,"break"},te=fe;te>0;te--){var ie=Ce(te);if(ie==="break")break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}}const jn={name:"flip",enabled:!0,phase:"main",fn:Vn,requiresIfExists:["offset"],data:{_skip:!1}};function Ct(t,e,i){return i===void 0&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Ot(t){return[M,V,$,W].some(function(e){return t[e]>=0})}function Fn(t){var e=t.state,i=t.name,n=e.rects.reference,o=e.rects.popper,s=e.modifiersData.preventOverflow,a=Ie(e,{elementContext:"reference"}),r=Ie(e,{altBoundary:!0}),c=Ct(a,n),l=Ct(r,o,s),h=Ot(c),u=Ot(l);e.modifiersData[i]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:h,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":u})}const Gn={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Fn};function zn(t,e,i){var n=z(t),o=[W,M].indexOf(n)>=0?-1:1,s=typeof i=="function"?i(Object.assign({},e,{placement:t})):i,a=s[0],r=s[1];return a=a||0,r=(r||0)*o,[W,V].indexOf(n)>=0?{x:r,y:a}:{x:a,y:r}}function Un(t){var e=t.state,i=t.options,n=t.name,o=i.offset,s=o===void 0?[0,0]:o,a=dt.reduce(function(h,u){return h[u]=zn(u,e.rects,s),h},{}),r=a[e.placement],c=r.x,l=r.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=l),e.modifiersData[n]=a}const Kn={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Un};function qn(t){var e=t.state,i=t.name;e.modifiersData[i]=It({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Jn={name:"popperOffsets",enabled:!0,phase:"read",fn:qn,data:{}};function Qn(t){return t==="x"?"y":"x"}function _n(t){var e=t.state,i=t.options,n=t.name,o=i.mainAxis,s=o===void 0?!0:o,a=i.altAxis,r=a===void 0?!1:a,c=i.boundary,l=i.rootBoundary,h=i.altBoundary,u=i.padding,f=i.tether,d=f===void 0?!0:f,y=i.tetherOffset,g=y===void 0?0:y,v=Ie(e,{boundary:c,rootBoundary:l,padding:u,altBoundary:h}),x=z(e.placement),C=ue(e.placement),O=!C,b=Ne(x),w=Qn(b),m=e.modifiersData.popperOffsets,I=e.rects.reference,E=e.rects.popper,S=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,Y=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),X=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,D={x:0,y:0};if(m){if(s){var L,J=b==="y"?M:W,Q=b==="y"?$:V,P=b==="y"?"height":"width",N=m[b],pe=N+v[J],_=N-v[Q],fe=d?-E[P]/2:0,Ce=C===le?I[P]:E[P],te=C===le?-E[P]:-I[P],ie=e.elements.arrow,U=d&&ie?De(ie):{width:0,height:0},F=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:mt(),ne=F[J],ae=F[Q],K=we(0,I[P],U[P]),Oe=O?I[P]/2-fe-K-ne-Y.mainAxis:Ce-K-ne-Y.mainAxis,Ee=O?-I[P]/2+fe+K+ae+Y.mainAxis:te+K+ae+Y.mainAxis,Se=e.elements.arrow&&be(e.elements.arrow),Ge=Se?b==="y"?Se.clientTop||0:Se.clientLeft||0:0,Rt=(L=X==null?void 0:X[b])!=null?L:0,fo=N+Oe-Rt-Ge,mo=N+Ee-Rt,Xt=we(d?Re(pe,fo):pe,N,d?re(_,mo):_);m[b]=Xt,D[b]=Xt-N}if(r){var Lt,vo=b==="x"?M:W,go=b==="x"?$:V,ce=m[w],Ae=w==="y"?"height":"width",Pt=ce+v[vo],Tt=ce-v[go],ze=[M,W].indexOf(x)!==-1,At=(Lt=X==null?void 0:X[w])!=null?Lt:0,kt=ze?Pt:ce-I[Ae]-E[Ae]-At+Y.altAxis,Mt=ze?ce+I[Ae]+E[Ae]-At-Y.altAxis:Tt,Wt=d&&ze?Cn(kt,ce,Mt):we(d?kt:Pt,ce,d?Mt:Tt);m[w]=Wt,D[w]=Wt-ce}e.modifiersData[n]=D}}const eo={name:"preventOverflow",enabled:!0,phase:"main",fn:_n,requiresIfExists:["offset"]};function to(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function io(t){return t===Z(t)||!j(t)?$e(t):to(t)}function no(t){var e=t.getBoundingClientRect(),i=he(e.width)/t.offsetWidth||1,n=he(e.height)/t.offsetHeight||1;return i!==1||n!==1}function oo(t,e,i){i===void 0&&(i=!1);var n=j(e),o=j(e)&&no(e),s=ee(e),a=de(t,o,i),r={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!i)&&((G(e)!=="body"||je(s))&&(r=io(e)),j(e)?(c=de(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):s&&(c.x=Ve(s))),{x:a.left+r.scrollLeft-c.x,y:a.top+r.scrollTop-c.y,width:a.width,height:a.height}}function so(t){var e=new Map,i=new Set,n=[];t.forEach(function(s){e.set(s.name,s)});function o(s){i.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(r){if(!i.has(r)){var c=e.get(r);c&&o(c)}}),n.push(s)}return t.forEach(function(s){i.has(s.name)||o(s)}),n}function ro(t){var e=so(t);return gn.reduce(function(i,n){return i.concat(e.filter(function(o){return o.phase===n}))},[])}function ao(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}function co(t){var e=t.reduce(function(i,n){var o=i[n.name];return i[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,i},{});return Object.keys(e).map(function(i){return e[i]})}var Et={placement:"bottom",modifiers:[],strategy:"absolute"};function St(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function lo(t){t===void 0&&(t={});var e=t,i=e.defaultModifiers,n=i===void 0?[]:i,o=e.defaultOptions,s=o===void 0?Et:o;return function(r,c,l){l===void 0&&(l=s);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},Et,s),modifiersData:{},elements:{reference:r,popper:c},attributes:{},styles:{}},u=[],f=!1,d={state:h,setOptions:function(x){var C=typeof x=="function"?x(h.options):x;g(),h.options=Object.assign({},s,h.options,C),h.scrollParents={reference:se(r)?xe(r):r.contextElement?xe(r.contextElement):[],popper:xe(c)};var O=ro(co([].concat(n,h.options.modifiers)));return h.orderedModifiers=O.filter(function(b){return b.enabled}),y(),d.update()},forceUpdate:function(){if(!f){var x=h.elements,C=x.reference,O=x.popper;if(St(C,O)){h.rects={reference:oo(C,be(O),h.options.strategy==="fixed"),popper:De(O)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(Y){return h.modifiersData[Y.name]=Object.assign({},Y.data)});for(var b=0;b<h.orderedModifiers.length;b++){if(h.reset===!0){h.reset=!1,b=-1;continue}var w=h.orderedModifiers[b],m=w.fn,I=w.options,E=I===void 0?{}:I,S=w.name;typeof m=="function"&&(h=m({state:h,options:E,name:S,instance:d})||h)}}}},update:ao(function(){return new Promise(function(v){d.forceUpdate(),v(h)})}),destroy:function(){g(),f=!0}};if(!St(r,c))return d;d.setOptions(l).then(function(v){!f&&l.onFirstUpdate&&l.onFirstUpdate(v)});function y(){h.orderedModifiers.forEach(function(v){var x=v.name,C=v.options,O=C===void 0?{}:C,b=v.effect;if(typeof b=="function"){var w=b({state:h,name:x,instance:d,options:O}),m=function(){};u.push(w||m)}})}function g(){u.forEach(function(v){return v()}),u=[]}return d}}var ho=[An,Jn,Pn,wn,Kn,jn,eo,Yn,Gn],uo=lo({defaultModifiers:ho});class po{constructor(e,i,n){Ht(this,"updateHotspotPosition",(e,i)=>{this.currentActiveIndex=e,this.currentOrientation=i;const n=Qi(this.hotspotsConfig,e,i);this.hideHotspots(),n.forEach(o=>this.updateAndShowHotspot(o,e))});this.container=i,this.popper=null,this.popperInstance=null,this.hotspotsContainer=Li(this.container),this.hotspotsConfig=on(e),this.shouldHidePopper=!0,this.hidePopper=this.hidePopper.bind(this),this.imageAspectRatio=n;const{containerSize:o}=e[0];this.initialContainerSize=o||[i.offsetWidth,i.offsetHeight],this.initHotspots(),this.observeContainerResize()}observeContainerResize(){this.resizeObserver=new ResizeObserver(()=>{const e=this.container.offsetWidth,i=this.container.offsetHeight;this.updateHotspotsForResize(e,i)}),this.resizeObserver.observe(this.container)}updateHotspotsForResize(e,i){this.hotspotsConfig=sn({newWidth:e,newHeight:i,initialContainerSize:this.initialContainerSize,imageAspectRatio:this.imageAspectRatio,hotspotsConfig:this.hotspotsConfig}),this.updateHotspotPosition(this.currentActiveIndex,this.currentOrientation)}showPopper({hotspotElement:e,content:i,id:n,keepOpen:o}){this.popperInstance&&this.popperInstance.instanceId!==n&&this.hidePopper();const s={placement:"top",modifiers:tn(this.container)};this.popper=nn(i,n),this.popper.setAttribute("data-show",""),this.popper.addEventListener("mouseenter",()=>{this.shouldHidePopper=!1}),this.popper.addEventListener("mouseleave",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()}),e.addEventListener("mouseleave",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()}),e.addEventListener("mouseenter",()=>{this.shouldHidePopper=!1,this.hidePopperTimeout&&clearTimeout(this.hidePopperTimeout)}),this.popperInstance={...uo(e,this.popper,s),keepOpen:o,instanceId:n}}checkAndHidePopper(){var e;this.shouldHidePopper&&!((e=this.popperInstance)!=null&&e.keepOpen)&&(this.hidePopperTimeout=setTimeout(()=>{this.shouldHidePopper&&this.hidePopper()},150))}hidePopper(){this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=null),this.popper&&(this.popper.removeAttribute("data-show"),setTimeout(()=>{this.popper&&this.popper.remove(),this.popper=null},200))}createHotspot(e){const{id:i,content:n,keepOpen:o,onClick:s}=e,a=_i(i);s&&(a.style.cursor="pointer"),a.onclick=r=>{r.stopPropagation(),s==null||s(r,this.popperInstance,i)},n&&a.addEventListener("mouseenter",()=>this.showPopper({hotspotElement:a,content:n,id:i,keepOpen:o})),this.hotspotsContainer.appendChild(a)}hideHotspots(){this.hotspotsContainer.querySelectorAll(".cloudimage-360-hotspot").forEach(e=>{e.style.opacity=0,e.style.pointerEvents="none"})}updateAndShowHotspot(e,i){const{positions:n,id:o}=e,{x:s,y:a}=n[i]??{},r=this.hotspotsContainer.querySelector(`[data-hotspot-id="${o}"]`);r&&(r.style.translate=`${s}px ${a}px`,r.style.opacity=1,r.style.pointerEvents="all")}createAllHotspots(){this.hotspotsConfig.forEach(e=>this.createHotspot(e))}initHotspots(){this.createAllHotspots()}destroy(){this.resizeObserver.disconnect(),this.hidePopper(),this.hotspotsContainer.innerHTML=""}}class Te{constructor(e,i,n){this.container=e,this.isClicked=!1,this.fullscreenView=!!n,this.imagesX=[],this.imagesY=[],this.devicePixelRatio=Math.round(window.devicePixelRatio||1),this.id=e.id,this.movementStart={x:0,y:0},this.draggingDirection=null,this.isReady=!1,this.currentZoomScale=1,this.touchDevice=zi(),this.canvasWorker=new qi,this.onMoveHandler=this.onMoveHandler.bind(this),this.destroy=this.destroy.bind(this),this.init(this.container,i)}mouseDown(e){if(!this.isReady||this.glass)return;const{pageX:i,pageY:n}=e;(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),this.movementStart={x:i,y:n},this.isClicked=!0,this.isDragging=!1}mouseUp(){this.isReady&&(this.isZoomed||this.showAllIcons(),this.movementStart={x:0,y:0},this.isClicked=!1,this.innerBox.style.cursor="grab")}drag(e,i){if(!this.isReady||!this.isClicked)return;const n=e-this.movementStart.x,o=i-this.movementStart.y;this.draggingDirection=Gi({deltaX:n,deltaY:o,reversed:this.dragReverse,allowSpinX:this.allowSpinX,allowSpinY:this.allowSpinY})||this.draggingDirection;const s=this.fullscreenView?document.body:this.container,a=this.dragSpeed/50,r=a*(this.amountX/s.offsetWidth),c=a*(this.amountY/s.offsetHeight),l=this.allowSpinX?Math.abs(Math.round(n*r)):0,h=this.allowSpinY?Math.abs(Math.round(o*c)):0;(this.allowSpinX&&l!==0||this.allowSpinY&&h!==0)&&(this.hideHotspotPopper(),this.onMoveHandler(this.draggingDirection,l,h),this.movementStart={x:e,y:i},setTimeout(()=>{this.isDragging=!0},150))}mouseMove(e){!this.isReady||!this.isClicked&&!this.isZoomed||this.glass||(this.hideAllIcons(),this.drag(e.pageX,e.pageY),this.isZoomed&&this.applyZoom(e))}mouseClick(e){if(!(!this.isReady||this.isDragging)){if(this.glass&&this.magnified){this.removeGlass();return}this.pointerZoom&&!this.glass&&!this.touchDevice&&this.toggleZoom(e)}}loadHigherQualityImages(e,i){const n=me(this.srcXConfig,e),o=this.allowSpinY?me(this.srcYConfig,e):null;et({cdnPathX:n,cdnPathY:o,configX:this.srcXConfig,configY:this.srcYConfig,onAllImagesLoad:(s,a)=>{this.imagesX=s,this.imagesY=a,i()}})}hideHotspots(){this.hotspotsInstance&&this.hotspotsInstance.hideHotspots()}hideHotspotPopper(){this.hotspotsInstance&&this.hotspotsInstance.hidePopper()}toggleZoom(e){if(this.isZoomed)this.showTransitionOverlay(),setTimeout(()=>{this.removeZoom()},800);else{let i=(this.fullscreenView||this.pointerZoom?document.body:this.container).offsetWidth;this.hideHotspots(),this.showLoadingSpinner(),this.loadHigherQualityImages(i,()=>{this.showTransitionOverlay(),setTimeout(()=>{this.applyZoom(e)},800)})}}removeZoom(){this.isZoomed=!1,this.updateView(),this.showAllIcons(),this.hideTransitionOverlay()}applyZoom(e){const{offsetX:i,offsetY:n}=Di(e,this.canvas,this.devicePixelRatio);this.isZoomed=!0,this.hideAllIcons(),this.hideLoadingSpinner(),this.hideTransitionOverlay(),this.updateView(this.pointerZoom,i,n)}touchOutside(e){if(!this.glass)return;!this.canvas.contains(e.target)&&this.removeGlass()}touchStart(e){if(!this.isReady||e.touches.length>1||this.glass)return;const{pageX:i,pageY:n}=e.touches[0];(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),this.hideAllIcons(),this.movementStart={x:i,y:n},this.isClicked=!0}touchEnd(){this.isReady&&(this.showAllIcons(),this.movementStart={x:0,y:0},this.isClicked=!1)}touchMove(e){if(!this.isReady||!this.isClicked||this.glass)return;const{pageX:i,pageY:n}=e.touches[0];e.preventDefault(),this.drag(i,n)}keyDown(e){if(!this.isReady)return;const{keyCode:i}=e,n=this.keysReverse;switch(rt(i,this.allowSpinY)&&this.hideAllIcons(),i){case 37:n?this.moveLeft():this.moveRight();break;case 39:n?this.moveRight():this.moveLeft();break;case 38:this.allowSpinY&&(e.preventDefault(),n?this.moveTop():this.moveBottom());break;case 40:this.allowSpinY&&(e.preventDefault(),n?this.moveBottom():this.moveTop());break}}keyUp(e){const{keyCode:i}=e;rt(i,this.allowSpinY)&&this.showAllIcons()}moveActiveXIndexUp(e){this.orientation=k.X,this.activeImageX=(this.activeImageX+e)%this.amountX}moveActiveXIndexDown(e){this.orientation=k.X,this.activeImageX=(this.activeImageX-e+this.amountX)%this.amountX}moveActiveYIndexUp(e){this.orientation=k.Y,this.activeImageY=(this.activeImageY+e)%this.amountY}moveActiveYIndexDown(e){this.orientation=k.Y,this.activeImageY=(this.activeImageY-e+this.amountY)%this.amountY}moveRight(e,i=1){e&&this.activeImageX>=this.imagesX.length-1||(this.moveActiveXIndexUp(i),this.isZoomed||this.updateView())}moveLeft(e,i=1){e&&this.activeImageX<=0||(this.moveActiveXIndexDown(i),this.isZoomed||this.updateView())}moveTop(e,i=1){e&&this.activeImageY>=this.imagesY.length-1||(this.moveActiveYIndexUp(i),this.isZoomed||this.updateView())}moveBottom(e,i=1){e&&this.activeImageY<=0||(this.moveActiveYIndexDown(i),this.isZoomed||this.updateView())}onMoveHandler(e,i=1,n=1){e==="right"?this.moveRight(this.stopAtEdges,i):e==="left"?this.moveLeft(this.stopAtEdges,i):e==="up"?this.moveTop(this.stopAtEdges,n):e==="down"&&this.moveBottom(this.stopAtEdges,n)}updateView(e,i,n){const o=this.orientation===k.X?this.activeImageX:this.activeImageY,s=this.orientation===k.X?this.imagesX[this.activeImageX]:this.imagesY[this.activeImageY];this.hotspotsInstance&&!this.isZoomed&&!this.autoplay&&this.hotspotsInstance.updateHotspotPosition(o,this.orientation),this.drawImageOnCanvas(s,e,i,n)}updatePercentageInLoader(e=0){this.loader&&(this.loader.innerText=e+"%")}adaptCanvasSize(e){const{naturalWidth:i,naturalHeight:n}=e;this.imageAspectRatio=i/n;const o=this.fullscreenView?window.innerWidth:this.canvas.clientWidth,s=this.fullscreenView?window.innerHeight:this.canvas.clientHeight;this.canvasWorker.postMessage({action:"adaptCanvasSize",devicePixelRatio:this.devicePixelRatio,imageAspectRatio:this.imageAspectRatio,containerWidth:o,containerHeight:s})}drawImageOnCanvas(e,i=1,n=0,o=0){this.canvasWorker.postMessage({action:"drawImageOnCanvas",imageData:e,zoomScale:i,pointerX:n,pointerY:o})}pushImageToSet(e,i,n){n===k.X?this.imagesX[i]=e:this.imagesY[i]=e}calculatePercentage(){const e=this.amountX+this.amountY,i=this.imagesX.length+this.imagesY.length;return Math.round(i/e*100)}onImageLoad(e,i,n){this.pushImageToSet(e,i,n),this.updatePercentageInLoader(this.calculatePercentage())}onFirstImageLoaded(e,i){this.createContainers(e),this.adaptCanvasSize(i),this.drawImageOnCanvas(i)}onAllImagesLoaded(){this.addAllIcons(),this.hotspots&&(this.hotspotsInstance=new po(this.hotspots,this.innerBox,this.imageAspectRatio)),this.isReady=!0,this.amountX=this.imagesX.length,this.amountY=this.imagesY.length,this.activeImageX=this.autoplayReverse?this.amountX-1:0,this.activeImageY=this.autoplayReverse?this.amountY-1:0,this.autoplay&&(this.hideAllIcons(),Ui(this.play.bind(this))())}magnify(e){e.stopPropagation();const{src:i}=this.orientation===k.Y?this.imagesY[this.activeImageY]:this.imagesX[this.activeImageX],o=(this.fullscreenView?document.body:this.container).offsetWidth*this.magnifier,s=pi(i,o);this.showLoadingSpinner(),this.createGlass(),Hi(s,r=>{this.hideLoadingSpinner(),this.magnified=!0,Zi(e,this.innerBox,this.offset,r,this.glass,this.magnifier)})}openFullscreenModal(e){e.stopPropagation();const i=Yi(this.container);new Te(i,this.viewerConfig,!0)}closeFullscreenModal(e){e.stopPropagation(),document.body.removeChild(this.container.parentNode),window.document.body.style.overflow="visible"}play(){if(this.isClicked)return;this.hide360ViewCircleIcon();const e=this.speed*36/(this.amountX+this.amountY),i={left:this.moveLeft.bind(this),right:this.moveRight.bind(this),top:this.moveTop.bind(this),bottom:this.moveBottom.bind(this)};this.loopTimeoutId=window.setInterval(()=>{if(this.playOnce&&$i({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse})){this.stopAutoplay();return}Vi({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse,spinDirection:this.spinDirection})&&(this.spinDirection=Fi(this.spinDirection));const s=this.spinDirection==="y";Ni({autoplayBehavior:this.autoplayBehavior,spinY:s,reversed:this.autoplayReverse,loopTriggers:i})},e)}stopAutoplay(){this.showAllIcons(),this.autoplay=!1,window.clearTimeout(this.loopTimeoutId)}destroy(){this.stopAutoplay(),this.hotspotsInstance&&this.hotspotsInstance.destroy();const e=this.container,i=e.cloneNode(!0),n=i.querySelector(".cloudimage-360-inner-box");i.removeChild(n),e.parentNode.replaceChild(i,e)}addInitialIcon(){this.initialIcon||(this.initialIcon=gi(),this.innerBox.appendChild(this.initialIcon))}showInitialIcon(){this.initialIcon&&(this.initialIcon.style.opacity=1)}hideInitialIcon(){this.initialIcon&&(this.initialIcon.style.opacity=0)}createGlass(){this.hideAllIcons(),this.glass=document.createElement("div"),this.innerBox.appendChild(this.glass),this.innerBox.style.cursor="default"}removeGlass(){this.showAllIcons(),this.innerBox.removeChild(this.glass),this.glass=null,this.magnified=!1}addMagnifierIcon(){this.magnifier&&(this.magnifierIcon=Ei(),this.magnifierIcon.onclick=this.magnify.bind(this),this.iconsContainer.appendChild(this.magnifierIcon))}showMagnifierIcon(){this.magnifierIcon&&(this.magnifierIcon.style.visibility="visible",this.magnifierIcon.style.opacity=1)}hideMagnifierIcon(){this.magnifierIcon&&(this.magnifierIcon.style.visibility="hidden",this.magnifierIcon.style.opacity=0)}addFullscreenIcon(){this.fullscreen&&(this.fullscreenIcon=Ii(),this.fullscreenIcon.onclick=this.openFullscreenModal.bind(this),this.iconsContainer.appendChild(this.fullscreenIcon))}addCloseFullscreenIcon(){this.fullscreenCloseIcon=wi(),this.fullscreenCloseIcon.onclick=this.closeFullscreenModal.bind(this),this.iconsContainer.appendChild(this.fullscreenCloseIcon)}showFullscreenIcon(){this.fullscreenIcon&&(this.fullscreenIcon.style.opacity=1)}hideFullscreenIcon(){this.fullscreenIcon&&(this.fullscreenIcon.style.opacity=0)}add360ViewCircleIcon(){this.view360CircleIcon||(this.view360CircleIcon=vi(this.bottomCircleOffset),this.innerBox.appendChild(this.view360CircleIcon))}show360ViewCircleIcon(){this.view360CircleIcon&&(this.view360CircleIcon.style.opacity=1)}hide360ViewCircleIcon(){this.view360CircleIcon&&(this.view360CircleIcon.style.opacity=0)}addLoadingSpinner(){this.loadingSpinner=Ri(),this.innerBox.appendChild(this.loadingSpinner)}showLoadingSpinner(){this.loadingSpinner&&(this.hideAllIcons(),this.loadingSpinner.style.opacity=1)}createTransitionOverlay(){this.transitionOverlay=Xi(),this.innerBox.appendChild(this.transitionOverlay)}showTransitionOverlay(){this.transitionOverlay&&(this.hideAllIcons(),this.transitionOverlay.style.opacity=1)}hideTransitionOverlay(){this.transitionOverlay&&(this.transitionOverlay.style.opacity=0)}hideLoadingSpinner(){this.loadingSpinner&&(this.loadingSpinner.style.opacity=0)}remove360ViewCircleIcon(){this.view360CircleIcon&&(this.innerBox.removeChild(this.view360CircleIcon),this.view360CircleIcon=null)}addAllIcons(){this.removeLoader(),this.innerBox.style.cursor="grab",this.pointerZoom&&(this.createTransitionOverlay(),this.addLoadingSpinner()),!this.fullscreenView&&!this.touchDevice&&this.addMagnifierIcon(),this.fullscreenView||this.addFullscreenIcon(),this.initialIconShown&&this.addInitialIcon(),this.bottomCircle||this.add360ViewCircleIcon()}showAllIcons(){this.showInitialIcon(),this.show360ViewCircleIcon(),this.showMagnifierIcon(),this.showFullscreenIcon()}hideAllIcons(){this.hideInitialIcon(),this.hide360ViewCircleIcon(),this.hideMagnifierIcon(),this.hideFullscreenIcon()}removeLoader(){this.loader&&(this.innerBox.removeChild(this.loader),this.loader=null)}attachEvents(e,i,n){e&&this.addMouseEvents(),i&&this.addTouchEvents(),n&&this.addKeyboardEvents()}removeEvents(){this.removeMouseEvents(),this.removeTouchEvents(),this.removeKeyboardEvents()}addMouseEvents(){this.boundMouseClick=this.mouseClick.bind(this),this.boundMouseDown=this.mouseDown.bind(this),this.boundMouseMove=qe(this.mouseMove.bind(this),Je),this.boundMouseUp=this.mouseUp.bind(this),this.innerBox.addEventListener("click",this.boundMouseClick),this.innerBox.addEventListener("mousedown",this.boundMouseDown),document.addEventListener("mousemove",this.boundMouseMove),document.addEventListener("mouseup",this.boundMouseUp)}addTouchEvents(){this.boundTouchOutside=this.touchOutside.bind(this),this.boundTouchStart=this.touchStart.bind(this),this.boundTouchEnd=this.touchEnd.bind(this),this.boundTouchMove=qe(this.touchMove.bind(this),Je),document.addEventListener("touchstart",this.boundTouchOutside),this.container.addEventListener("touchstart",this.boundTouchStart),this.container.addEventListener("touchend",this.boundTouchEnd),this.container.addEventListener("touchmove",this.boundTouchMove)}addKeyboardEvents(){this.boundKeyDown=this.keyDown.bind(this),this.boundKeyUp=this.keyUp.bind(this),document.addEventListener("keydown",this.boundKeyDown),document.addEventListener("keyup",this.boundKeyUp)}removeMouseEvents(){this.innerBox.removeEventListener("click",this.boundMouseClick),this.innerBox.removeEventListener("mousedown",this.boundMouseDown),document.removeEventListener("mousemove",this.boundMouseMove),document.removeEventListener("mouseup",this.boundMouseUp)}removeTouchEvents(){document.removeEventListener("touchstart",this.boundTouchOutside),this.container.removeEventListener("touchstart",this.boundTouchStart),this.container.removeEventListener("touchend",this.boundTouchEnd),this.container.removeEventListener("touchmove",this.boundTouchMove)}removeKeyboardEvents(){document.removeEventListener("keydown",this.boundKeyDown),document.removeEventListener("keyup",this.boundKeyUp)}createContainers(e){this.iconsContainer=tt(this.innerBox),this.canvas=yi(this.innerBox,e),this.loader=Si(this.innerBox);const i=this.canvas.transferControlToOffscreen();this.canvasWorker.postMessage({action:"initCanvas",offscreen:i,devicePixelRatio:this.devicePixelRatio},[i]),this.fullscreenView&&this.addCloseFullscreenIcon(),Me(this.innerBox,".cloudimage-360-placeholder")}update(e){this.isReady&&(this.stopAutoplay(),Me(this.innerBox,".cloudimage-360-icons-container"),this.init(this.container,e,!0),this.iconsContainer=tt(this.innerBox),this.onAllImagesLoaded())}init(e,i,n){const o=i?ai(i):ri(e),{folder:s,apiVersion:a,filenameX:r,filenameY:c,imageListX:l,imageListY:h,indexZeroBase:u,amountX:f,amountY:d,draggable:y=!0,swipeable:g=!0,keys:v,keysReverse:x,bottomCircleOffset:C,autoplay:O,autoplayBehavior:b,playOnce:w,speed:m,autoplayReverse:I,fullscreen:E,magnifier:S,ciToken:Y,ciFilters:X,ciTransformation:D,lazyload:L,dragSpeed:J,stopAtEdges:Q,pointerZoom:P,imageInfo:N="black",initialIconShown:pe,bottomCircle:_,hotspots:fe,dragReverse:Ce}=o,te={ciToken:Y,ciFilters:X,ciTransformation:D},ie=l?JSON.parse(l):[],U=h?JSON.parse(h):[];if(this.viewerConfig=o,this.amountX=ie.length||f,this.amountY=U.length||d,this.allowSpinX=!!this.amountX,this.allowSpinY=!!this.amountY,this.activeImageX=I?this.amountX-1:0,this.activeImageY=I?this.amountY-1:0,this.bottomCircleOffset=C,this.autoplay=O,this.autoplayBehavior=b,this.playOnce=w,this.speed=m,this.autoplayReverse=I,this.fullscreen=E,this.magnifier=S>1?Math.min(S,5):0,this.dragSpeed=Math.max(J,50),this.stopAtEdges=Q,this.ciParams=te,this.apiVersion=a,this.pointerZoom=P>1?Math.min(P,5):null,this.keysReverse=x,this.info=N,this.keys=v,this.innerBox=this.innerBox??Ci(this.container),this.initialIconShown=pe,this.bottomCircle=_,this.spinDirection=ji(this.autoplayBehavior,this.allowSpinX,this.allowSpinY),this.dragReverse=Ce,this.hotspots=fe,this.srcXConfig={folder:s,filename:r,imageList:ie,container:e,innerBox:this.innerBox,apiVersion:a,ciParams:te,lazyload:L,amount:this.amountX,indexZeroBase:u,autoplayReverse:I},this.srcYConfig={...this.srcXConfig,filename:c,imageList:U,orientation:k.Y,amount:this.amountY},n&&this.removeEvents(),this.attachEvents(y,g,v),n)return;const F=(this.fullscreenView?document.body:this.container).offsetWidth,ne=this.allowSpinX&&!ie.length?me(this.srcXConfig,F):null,ae=this.allowSpinY&&!U.length?me(this.srcYConfig,F):null,K=Oe=>{et({cdnPathX:ne,cdnPathY:ae,configX:this.srcXConfig,configY:this.srcYConfig,onImageLoad:(Ee,Se,Ge)=>this.onImageLoad(Ee,Se,Ge),onFirstImageLoad:Ee=>this.onFirstImageLoaded(Oe,Ee),onAllImagesLoad:this.onAllImagesLoaded.bind(this)})};this.allowSpinX?nt(ne,this.srcXConfig,K):this.allowSpinY&&nt(ae,this.srcYConfig,K)}}class Yt{constructor(){this.views=new Map,this.initAll=this.initAll.bind(this),this.getViews=this.getViews.bind(this)}generateId(){return`ci360-${Math.random().toString(36).slice(2,11)}`}init(e,i,n){if(!e)return;const o=e.id||this.generateId();e.id||(e.id=o);const s=new Te(e,i,n);return this.views.set(o,s),s}initAll(e="cloudimage-360"){[...document.querySelectorAll(`.${e}`)].filter(Boolean).forEach(n=>{const o=n.id||this.generateId();n.id||(n.id=o);const s=new Te(n);this.views.set(o,s)})}destroy(e){const i=this.getViewById(e);i&&(i.destroy(),this.views.delete(e))}destroyAll(){this.views.forEach(e=>{e.destroy()}),this.views.clear()}getViewById(e){return this.views.get(e)}getViews(){return Array.from(this.views.values())}updateView(e,i){const n=this.getViewById(e),o={...n.viewerConfig,...i};if(ci(n.viewerConfig,i)){n.destroy();const a=document.getElementById(e);this.init(a,o)}else n.update(o);return n}}return window.CI360=Yt,Yt});
|
|
File without changes
|