diff --git a/assets/index-49ZK8EAw.js b/assets/index-49ZK8EAw.js deleted file mode 100644 index ae31bd7..0000000 --- a/assets/index-49ZK8EAw.js +++ /dev/null @@ -1,9 +0,0 @@ -var qt=Object.defineProperty;var _t=(t,e,i)=>e in t?qt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var ot=(t,e,i)=>_t(t,typeof e!="symbol"?e+"":e,i);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function i(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(o){if(o.ep)return;o.ep=!0;const s=i(o);fetch(o.href,s)}})();var Re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Tt="Expected a function",st=NaN,Qt="[object Symbol]",ei=/^\s+|\s+$/g,ti=/^[-+]0x[0-9a-f]+$/i,ii=/^0b[01]+$/i,ni=/^0o[0-7]+$/i,oi=parseInt,si=typeof Re=="object"&&Re&&Re.Object===Object&&Re,ri=typeof self=="object"&&self&&self.Object===Object&&self,ai=si||ri||Function("return this")(),li=Object.prototype,ci=li.toString,di=Math.max,ui=Math.min,Me=function(){return ai.Date.now()};function hi(t,e,i){var n,o,s,a,r,l,c=0,d=!1,h=!1,f=!0;if(typeof t!="function")throw new TypeError(Tt);e=rt(e)||0,Xe(i)&&(d=!!i.leading,h="maxWait"in i,s=h?di(rt(i.maxWait)||0,e):s,f="trailing"in i?!!i.trailing:f);function u(m){var I=n,E=o;return n=o=void 0,c=m,a=t.apply(E,I),a}function y(m){return c=m,r=setTimeout(x,e),d?u(m):a}function g(m){var I=m-l,E=m-c,S=e-I;return h?ui(S,s-E):S}function v(m){var I=m-l,E=m-c;return l===void 0||I>=e||I<0||h&&E>=s}function x(){var m=Me();if(v(m))return C(m);r=setTimeout(x,g(m))}function C(m){return r=void 0,f&&n?u(m):(n=o=void 0,a)}function O(){r!==void 0&&clearTimeout(r),c=0,n=l=o=r=void 0}function b(){return r===void 0?a:C(Me())}function w(){var m=Me(),I=v(m);if(n=arguments,o=this,l=m,I){if(r===void 0)return y(l);if(h)return r=setTimeout(x,e),u(l)}return r===void 0&&(r=setTimeout(x,e)),a}return w.cancel=O,w.flush=b,w}function pi(t,e,i){var n=!0,o=!0;if(typeof t!="function")throw new TypeError(Tt);return Xe(i)&&(n="leading"in i?!!i.leading:n,o="trailing"in i?!!i.trailing:o),hi(t,e,{leading:n,maxWait:e,trailing:o})}function Xe(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function fi(t){return!!t&&typeof t=="object"}function mi(t){return typeof t=="symbol"||fi(t)&&ci.call(t)==Qt}function rt(t){if(typeof t=="number")return t;if(mi(t))return st;if(Xe(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Xe(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(ei,"");var i=ii.test(t);return i||ni.test(t)?oi(t.slice(2),i?2:8):ti.test(t)?st:+t}var vi=pi;const at=Jt(vi),T={SPIN_X:"spin-x",SPIN_Y:"spin-y",SPIN_XY:"spin-xy",SPIN_YX:"spin-yx"},gi=[!1,0,null,void 0,"false","0","null","undefined"],k={X:"x-axis",Y:"y-axis",CENTER:"center"},yi=["folder","folderX","folderY","filenameX","filenameY","imageListX","imageListY","indexZeroBase","amountX","amountY"],bi=[37,39],wi=[38,40],lt=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},xi=t=>({folder:Y(t,"folder",p.folder),apiVersion:Y(t,"api-version",p.apiVersion),filenameX:Y(t,"filename")||Y(t,"filename-x")||p.filenameX,filenameY:Y(t,"filename-y",p.filenameY),imageListX:Y(t,"image-list-x",p.imageListX),imageListY:Y(t,"image-list-y",p.imageListY),indexZeroBase:parseInt(Y(t,"index-zero-base",p.indexZeroBase),10),amountX:parseInt(Y(t,"amount-x",p.amountX),10),amountY:parseInt(Y(t,"amount-y",p.amountY),10),speed:parseInt(Y(t,"speed",p.speed),10),dragSpeed:parseInt(Y(t,"drag-speed",p.dragSpeed),10),draggable:W(t,"draggable",p.draggable),swipeable:W(t,"swipeable",p.swipeable),keys:W(t,"keys",p.keys),keysReverse:W(t,"keys-reverse",p.keysReverse),autoplay:W(t,"autoplay",p.autoplay),autoplayBehavior:Y(t,"autoplay-behavior",p.autoplayBehavior),playOnce:W(t,"play-once",p.playOnce),autoplayReverse:W(t,"autoplay-reverse",p.autoplayReverse),pointerZoom:parseFloat(Y(t,"pointer-zoom",p.pointerZoom),10),fullscreen:W(t,"fullscreen")||W(t,"full-screen",p.fullscreen),magnifier:parseFloat(Y(t,"magnifier",p.magnifier),10),bottomCircleOffset:parseInt(Y(t,"bottom-circle-offset",p.bottomCircleOffset),10),ciToken:Y(t,"responsive",p.ciToken),ciFilters:Y(t,"filters",p.ciFilters),ciTransformation:Y(t,"transformation",p.ciTransformation),lazyload:W(t,"lazyload",p.lazyload),dragReverse:W(t,"drag-reverse",p.dragReverse),stopAtEdges:W(t,"stop-at-edges",p.stopAtEdges),imageInfo:W(t,"info",p.imageInfo),initialIconShown:!ct(t,"initial-icon"),bottomCircle:!ct(t,"bottom-circle")}),Ii=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}),Y=(t,e,i)=>t.getAttribute(e)||t.getAttribute(`data-${e}`)||i,W=(t,e,i)=>t.hasAttribute(e)||t.hasAttribute(`data-${e}`)||i,ct=(t,e)=>Y(t,e,null)==="false",Ci=(t,e,i=yi)=>i.some(n=>n in e&&e[n]!==t[n]),Oi=(t=1)=>{const e=Math.round(window.devicePixelRatio||1);return parseInt(t)*e},Ei=(t,e,i)=>new URL(t).origin.includes("cloudimg")?t:`https://${e}.cloudimg.io/${i}${t}`,Si=({ciTransformation:t,responsiveWidth:e,ciFilters:i})=>{const n=`width=${e}`,o=t||n,s=i?`&f=${i}`:"";return`${o}${s}`},be=(t,e)=>{const{folder:i,apiVersion:n,filename:o="",ciParams:s}=t,{ciToken:a,ciFilters:r,ciTransformation:l}=s||{},c=`${i}${o}`;if(!a)return c;const d=gi.includes(n)?null:n,h=d?`${d}/`:"",f=Oi(e),u=Ei(c,a,h),y=Si({ciTransformation:l,responsiveWidth:f,ciFilters:r});return`${u}${y?"?":""}${y}`},Ri=(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()}`},Yi=(t,e)=>Ri(t,"width",e),kt=(t,e=0)=>(t+="",t.length>=e?t:new Array(e-t.length+1).join("0")+t),Li=(t,{amount:e=0,indexZeroBase:i=0}={})=>Array.from({length:e},(n,o)=>t.replace("{index}",kt(o+1,i))),Xi=({imagesUrls:t,onFirstImageLoad:e,onImageLoad:i,onAllImagesLoad:n,autoplayReverse:o})=>{let s=0;const a=t.length,r=[],l=(h,f)=>{const u=new Image;u.crossOrigin="anonymous",u.src=h,u.onload=async()=>{const y=await createImageBitmap(u),g={src:h,bitmapImage:y,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight};s++,r[f]=g,i==null||i(g,f),s===a&&(n==null||n(r))},u.onerror=()=>{console.error(`Failed to load image: ${h}`),s++,s===a&&(n==null||n(r))}},c=new Image,d=t[o?t.length-1:0];c.crossOrigin="anonymous",c.src=d,c.onload=async()=>{const h=await createImageBitmap(c),f={src:d,bitmapImage:h,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight};r[0]=f,s++,e==null||e(f),i==null||i(f,0);for(let u=1;u{console.error(`Failed to load first image: ${t[0]}`),s++;for(let h=1;h{let r={x:!1,y:!1},l=[],c=[];const d=t||i.imageList.length,h=e||n.imageList.length,f=()=>{r.x&&r.y&&a(l,c)},u=({cdnPath:y,config:g,orientation:v,loadedImages:x,onFirstImageLoad:C})=>{const O=v===k.X,b=g.imageList.length?g.imageList:Li(y,g);Xi({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})};d?u({cdnPath:t,config:i,orientation:k.X,loadedImages:l,onFirstImageLoad:o}):r.x=!0,h?u({cdnPath:e,config:n,orientation:k.Y,loadedImages:c,onFirstImageLoad:d?void 0:o}):r.y=!0},Pi=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},Ti=()=>{const t=document.createElement("div");return t.className="cloudimage-initial-icon",t.innerText="360°",t},ki=(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},Ai="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",Bi=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-close-icon",t.innerHTML=`close icon`,t},Mi="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",Hi=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-fullscreen-button",t.innerHTML=`fullscreen icon`,t},ut=t=>{const e=document.createElement("div");return e.className="cloudimage-360-icons-container",t.appendChild(e),e},Wi=t=>{const e=document.createElement("div");return e.className="cloudimage-360-inner-box",t.appendChild(e),e},Zi="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",Di=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-magnifier-button",t.innerHTML=`magnifier icon`,t},Vi=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},Ni=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},We=(t,e)=>{const i=t.querySelector(e);i&&i.parentNode.removeChild(i)},$i=()=>{const t=document.createElement("div");return t.className="cloudimage-loading-spinner",t},ji=()=>{const t=document.createElement("div");return t.className="cloudimage-360-transition-overlay",t},Fi=t=>{const e=document.createElement("div");return e.className="cloudimage-360-hotspot-container",t.appendChild(e),e},Gi=(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},Ui=t=>{const e=Gi(t,"width"),i=e.includes("?")?"&":"?";return`${e}${i}width=${150*devicePixelRatio}`},zi=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=kt(1,e);return t.replace("{index}",i)},qi=(t,e)=>{const[i]=t,n=/(https?):\/\//i.test(i);return be({...e,folder:n?"":e.folder,filename:i})},_i=(t,e)=>{const{imageList:i,indexZeroBase:n}=e;if(i.length)try{const o=JSON.parse(i);return qi(o,e)}catch(o){console.error(`Wrong format in image-list attribute: ${o.message}`)}return Ki(t,n)},ht=(t,e,i)=>{const n=new Image;return n.setAttribute(e?"data-src":"src",t),n.className=i,n.style.cssText=` - position: ${e?"absolute":"static"}; - width: 100%; - inset: 0; - height: 100%; - object-fit: contain; - object-position: center; - filter: blur(10px); - `,n},pt=(t,e,i)=>{const{innerBox:n,imageList:o,lazyload:s}=e||{},[a]=o,r=a||_i(t,e),l=Ui(r),c=ht(l,s,"cloudimage-lazy"),d=ht(l,!1,"cloudimage-360-placeholder"),h=f=>{We(n,".cloudimage-lazy"),i&&i({event:f,width:c.width,height:c.height,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight,src:l})};c.onload=h,n.appendChild(c),n.appendChild(d),zi(c)},Ji=(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(){}},Qi=(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}},He=(t,e,i)=>{const{container:n,w:o,h:s,zoom:a,bw:r,offsetX:l,offsetY:c}=e,d=Qi(t,n);let h=d.x,f=d.y;h=Math.max(o/a,Math.min(h,n.offsetWidth-o/a)),f=Math.max(s/a,Math.min(f,n.offsetHeight-s/a)),i.style.left=`${h-o}px`,i.style.top=`${f-s}px`;const u=(h-l)*a-o+r,y=(f-c)*a-s+r;i.style.backgroundPosition=`-${u}px -${y}px`},en=(t,e,i,n,o,s)=>{const{x:a=0,y:r=0}=i||{},l=(e.offsetWidth-a*2)*s,c=(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=`${l}px ${c}px`;const d=3,h=o.offsetWidth/2,f=o.offsetHeight/2,u={container:e,w:h,h:f,zoom:s,bw:d,offsetX:a,offsetY:r};He(t,u,o);const y=v=>{He(v,u,o)},g=v=>{v.preventDefault(),He(v,u,o)};o.addEventListener("mousemove",y),e.addEventListener("mousemove",y),e.addEventListener("touchmove",g)},tn=(t,e,i)=>{const{clientX:n,clientY:o}=t,s=e.getBoundingClientRect(),a=e.width/(s.width*i),r=e.height/(s.height*i),l=(n-s.left)*a,c=(o-s.top)*r;return{offsetX:l,offsetY:c}},ft=(t,{bottom:e,top:i})=>{t?e():i()},mt=(t,{left:e,right:i})=>{t?e():i()},nn=({autoplayBehavior:t,spinY:e,reversed:i,loopTriggers:n})=>{switch(t){case T.SPIN_XY:case T.SPIN_YX:e?ft(i,n):mt(i,n);break;case T.SPIN_Y:ft(i,n);break;case T.SPIN_X:default:mt(i,n)}},on=({autoplayBehavior:t,activeImageX:e,activeImageY:i,amountX:n,amountY:o,autoplayReverse:s})=>{const a=(r,l)=>{const c=l-1;return s?r===0:r===c};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)}},sn=({autoplayBehavior:t,activeImageX:e,activeImageY:i,amountX:n,amountY:o,autoplayReverse:s,spinDirection:a})=>{const r=e===(s?0:n-1),l=i===(s?0:o-1);return t===T.SPIN_XY||t===T.SPIN_YX?a==="x"&&r||a==="y"&&l:!1},rn=(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"}},an=t=>t==="x"?"y":"x",vt=(t,e)=>{const i=[...bi];return e?[...i,...wi].includes(t):i.includes(t)},ln=({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},cn=()=>"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,dn=(t,e=150)=>{let i;return function(...n){clearTimeout(i),i=setTimeout(()=>{t.apply(this,n)},e)}},At="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHg9KGEsdCxlKT0+e2NvbnN0IHM9YS9lLG49dC9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sTz0oe3BvaW50ZXJYOmEscG9pbnRlclk6dCxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOnIsbmF0dXJhbEhlaWdodDpsfT1lO2xldCBnPWEvaSpyLXMvMix1PXQvYypsLW4vMjtjb25zdCBwPU1hdGgubWF4KDAsci1zKSxJPU1hdGgubWF4KDAsbC1uKTtyZXR1cm4gZz1NYXRoLm1heCgwLE1hdGgubWluKGcscCkpLHU9TWF0aC5tYXgoMCxNYXRoLm1pbih1LEkpKSx7em9vbU9mZnNldFg6Zyx6b29tT2Zmc2V0WTp1fX07bGV0IG8sbSxmLGgsZCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIGE9Pntjb25zdHthY3Rpb246dCxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpyLGltYWdlQXNwZWN0UmF0aW86bCxjb250YWluZXJXaWR0aDpnLGNvbnRhaW5lckhlaWdodDp1fT1hLmRhdGE7c3dpdGNoKHQpe2Nhc2UiaW5pdENhbnZhcyI6dihlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjp6KGwsZyx1KTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpDKG4saSxjLHIpO2JyZWFrfX07Y29uc3Qgdj0oYSx0KT0+e289YSxtPW8uZ2V0Q29udGV4dCgiMmQiKSxmPXR9LHo9KGEsdCxlKT0+e2NvbnN0IHM9dC9lO3c9YT5zLG8ud2lkdGg9dCpmLG8uaGVpZ2h0PWUqZixtLnNjYWxlKGYsZiksdz8oaD10LGQ9dC9hKTooZD1lLGg9ZSphKSxtLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxtLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEM9KGE9e30sdD0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09YTtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L2YtZCkvMik6KGk9KG8ud2lkdGgvZi1oKS8yLGM9MCksbS5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLHQhPT0xKXtjb25zdHt6b29tZWRXaWR0aDpyLHpvb21lZEhlaWdodDpsfT14KGgsZCx0KSx7em9vbU9mZnNldFg6Zyx6b29tT2Zmc2V0WTp1fT1PKHtwb2ludGVyWDplLHBvaW50ZXJZOnMsaW1hZ2VEYXRhOmEsem9vbWVkV2lkdGg6cix6b29tZWRIZWlnaHQ6bCxkcmF3V2lkdGg6aCxkcmF3SGVpZ2h0OmR9KTttLmRyYXdJbWFnZShuLGcsdSxyLGwsaSxjLGgsZCl9ZWxzZSBtLmRyYXdJbWFnZShuLGksYyxoLGQpfX0pKCk7Cg==",un=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),gt=typeof self<"u"&&self.Blob&&new Blob([un(At)],{type:"text/javascript;charset=utf-8"});function hn(t){let e;try{if(e=gt&&(self.URL||self.webkitURL).createObjectURL(gt),!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 pn=t=>t==="x"?k.X:k.Y,fn=(t,e,i)=>t.filter(n=>pn(n.orientation)===i&&e in n.positions),mn=t=>{const e=document.createElement("span");return e.id=t,e.className="cloudimage-360-hotspot",e.dataset.hotspotId=t,e},vn=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:l}=a;r!=null&&(i=r),l!=null&&(n=l),o[s]={x:r||i,y:l||n}}return o},gn=t=>[{name:"offset",options:{offset:[0,10]}},{name:"preventOverflow",options:{boundary:t}}],yn=(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},bn=t=>{const e=[...t];return e.forEach((i,n)=>{const o={...vn(i.positions)};e[n].initialPositions=o,e[n].positions=o}),e},wn=({newWidth:t,newHeight:e,initialContainerSize:i,imageAspectRatio:n,hotspotsConfig:o})=>{const[s,a]=i;let r=t,l=e,c=0,d=0;const h=t/e;n>h?(l=t/n,d=(e-l)/2):(r=e*n,c=(t-r)/2);const u=r/s,y=l/a;return o.map(g=>{const v={};return Object.entries(g.initialPositions).forEach(([x,C])=>{v[x]={x:C.x*u+c,y:C.y*y+d}}),{...g,positions:v}})};var A="top",V="bottom",N="right",B="left",Ne="auto",Oe=[A,V,N,B],de="start",Ie="end",xn="clippingParents",Bt="viewport",ye="popper",In="reference",yt=Oe.reduce(function(t,e){return t.concat([e+"-"+de,e+"-"+Ie])},[]),Mt=[].concat(Oe,[Ne]).reduce(function(t,e){return t.concat([e,e+"-"+de,e+"-"+Ie])},[]),Cn="beforeRead",On="read",En="afterRead",Sn="beforeMain",Rn="main",Yn="afterMain",Ln="beforeWrite",Xn="write",Pn="afterWrite",Tn=[Cn,On,En,Sn,Rn,Yn,Ln,Xn,Pn];function U(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 ae(t){var e=Z(t).Element;return t instanceof e||t instanceof Element}function D(t){var e=Z(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function $e(t){if(typeof ShadowRoot>"u")return!1;var e=Z(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function kn(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];!D(s)||!U(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 An(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(l,c){return l[c]="",l},{});!D(o)||!U(o)||(Object.assign(o.style,r),Object.keys(s).forEach(function(l){o.removeAttribute(l)}))})}}const Bn={name:"applyStyles",enabled:!0,phase:"write",fn:kn,effect:An,requires:["computeStyles"]};function G(t){return t.split("-")[0]}var re=Math.max,Pe=Math.min,ue=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 Ht(){return!/^((?!chrome|android).)*safari/i.test(Ze())}function he(t,e,i){e===void 0&&(e=!1),i===void 0&&(i=!1);var n=t.getBoundingClientRect(),o=1,s=1;e&&D(t)&&(o=t.offsetWidth>0&&ue(n.width)/t.offsetWidth||1,s=t.offsetHeight>0&&ue(n.height)/t.offsetHeight||1);var a=ae(t)?Z(t):window,r=a.visualViewport,l=!Ht()&&i,c=(n.left+(l&&r?r.offsetLeft:0))/o,d=(n.top+(l&&r?r.offsetTop:0))/s,h=n.width/o,f=n.height/s;return{width:h,height:f,top:d,right:c+h,bottom:d+f,left:c,x:c,y:d}}function je(t){var e=he(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 Wt(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&$e(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function J(t){return Z(t).getComputedStyle(t)}function Mn(t){return["table","td","th"].indexOf(U(t))>=0}function ie(t){return((ae(t)?t.ownerDocument:t.document)||window.document).documentElement}function ke(t){return U(t)==="html"?t:t.assignedSlot||t.parentNode||($e(t)?t.host:null)||ie(t)}function bt(t){return!D(t)||J(t).position==="fixed"?null:t.offsetParent}function Hn(t){var e=/firefox/i.test(Ze()),i=/Trident/i.test(Ze());if(i&&D(t)){var n=J(t);if(n.position==="fixed")return null}var o=ke(t);for($e(o)&&(o=o.host);D(o)&&["html","body"].indexOf(U(o))<0;){var s=J(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 Ee(t){for(var e=Z(t),i=bt(t);i&&Mn(i)&&J(i).position==="static";)i=bt(i);return i&&(U(i)==="html"||U(i)==="body"&&J(i).position==="static")?e:i||Hn(t)||e}function Fe(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function we(t,e,i){return re(t,Pe(e,i))}function Wn(t,e,i){var n=we(t,e,i);return n>i?i:n}function Zt(){return{top:0,right:0,bottom:0,left:0}}function Dt(t){return Object.assign({},Zt(),t)}function Vt(t,e){return e.reduce(function(i,n){return i[n]=t,i},{})}var Zn=function(e,i){return e=typeof e=="function"?e(Object.assign({},i.rects,{placement:i.placement})):e,Dt(typeof e!="number"?e:Vt(e,Oe))};function Dn(t){var e,i=t.state,n=t.name,o=t.options,s=i.elements.arrow,a=i.modifiersData.popperOffsets,r=G(i.placement),l=Fe(r),c=[B,N].indexOf(r)>=0,d=c?"height":"width";if(!(!s||!a)){var h=Zn(o.padding,i),f=je(s),u=l==="y"?A:B,y=l==="y"?V:N,g=i.rects.reference[d]+i.rects.reference[l]-a[l]-i.rects.popper[d],v=a[l]-i.rects.reference[l],x=Ee(s),C=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0,O=g/2-v/2,b=h[u],w=C-f[d]-h[y],m=C/2-f[d]/2+O,I=we(b,m,w),E=l;i.modifiersData[n]=(e={},e[E]=I,e.centerOffset=I-m,e)}}function Vn(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)||Wt(e.elements.popper,o)&&(e.elements.arrow=o))}const Nn={name:"arrow",enabled:!0,phase:"main",fn:Dn,effect:Vn,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function pe(t){return t.split("-")[1]}var $n={top:"auto",right:"auto",bottom:"auto",left:"auto"};function jn(t,e){var i=t.x,n=t.y,o=e.devicePixelRatio||1;return{x:ue(i*o)/o||0,y:ue(n*o)/o||0}}function wt(t){var e,i=t.popper,n=t.popperRect,o=t.placement,s=t.variation,a=t.offsets,r=t.position,l=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,h=t.isFixed,f=a.x,u=f===void 0?0:f,y=a.y,g=y===void 0?0:y,v=typeof d=="function"?d({x:u,y:g}):{x:u,y:g};u=v.x,g=v.y;var x=a.hasOwnProperty("x"),C=a.hasOwnProperty("y"),O=B,b=A,w=window;if(c){var m=Ee(i),I="clientHeight",E="clientWidth";if(m===Z(i)&&(m=ie(i),J(m).position!=="static"&&r==="absolute"&&(I="scrollHeight",E="scrollWidth")),m=m,o===A||(o===B||o===N)&&s===Ie){b=V;var S=h&&m===w&&w.visualViewport?w.visualViewport.height:m[I];g-=S-n.height,g*=l?1:-1}if(o===B||(o===A||o===V)&&s===Ie){O=N;var R=h&&m===w&&w.visualViewport?w.visualViewport.width:m[E];u-=R-n.width,u*=l?1:-1}}var L=Object.assign({position:r},c&&$n),M=d===!0?jn({x:u,y:g},Z(i)):{x:u,y:g};if(u=M.x,g=M.y,l){var X;return Object.assign({},L,(X={},X[b]=C?"0":"",X[O]=x?"0":"",X.transform=(w.devicePixelRatio||1)<=1?"translate("+u+"px, "+g+"px)":"translate3d("+u+"px, "+g+"px, 0)",X))}return Object.assign({},L,(e={},e[b]=C?g+"px":"",e[O]=x?u+"px":"",e.transform="",e))}function Fn(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,l=r===void 0?!0:r,c={placement:G(e.placement),variation:pe(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,wt(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,wt(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Gn={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Fn,data:{}};var Ye={passive:!0};function Un(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,l=Z(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(d){d.addEventListener("scroll",i.update,Ye)}),r&&l.addEventListener("resize",i.update,Ye),function(){s&&c.forEach(function(d){d.removeEventListener("scroll",i.update,Ye)}),r&&l.removeEventListener("resize",i.update,Ye)}}const zn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Un,data:{}};var Kn={left:"right",right:"left",bottom:"top",top:"bottom"};function Le(t){return t.replace(/left|right|bottom|top/g,function(e){return Kn[e]})}var qn={start:"end",end:"start"};function xt(t){return t.replace(/start|end/g,function(e){return qn[e]})}function Ge(t){var e=Z(t),i=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:i,scrollTop:n}}function Ue(t){return he(ie(t)).left+Ge(t).scrollLeft}function _n(t,e){var i=Z(t),n=ie(t),o=i.visualViewport,s=n.clientWidth,a=n.clientHeight,r=0,l=0;if(o){s=o.width,a=o.height;var c=Ht();(c||!c&&e==="fixed")&&(r=o.offsetLeft,l=o.offsetTop)}return{width:s,height:a,x:r+Ue(t),y:l}}function Jn(t){var e,i=ie(t),n=Ge(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+Ue(t),l=-n.scrollTop;return J(o||i).direction==="rtl"&&(r+=re(i.clientWidth,o?o.clientWidth:0)-s),{width:s,height:a,x:r,y:l}}function ze(t){var e=J(t),i=e.overflow,n=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+o+n)}function Nt(t){return["html","body","#document"].indexOf(U(t))>=0?t.ownerDocument.body:D(t)&&ze(t)?t:Nt(ke(t))}function xe(t,e){var i;e===void 0&&(e=[]);var n=Nt(t),o=n===((i=t.ownerDocument)==null?void 0:i.body),s=Z(n),a=o?[s].concat(s.visualViewport||[],ze(n)?n:[]):n,r=e.concat(a);return o?r:r.concat(xe(ke(a)))}function De(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Qn(t,e){var i=he(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 It(t,e,i){return e===Bt?De(_n(t,i)):ae(e)?Qn(e,i):De(Jn(ie(t)))}function eo(t){var e=xe(ke(t)),i=["absolute","fixed"].indexOf(J(t).position)>=0,n=i&&D(t)?Ee(t):t;return ae(n)?e.filter(function(o){return ae(o)&&Wt(o,n)&&U(o)!=="body"}):[]}function to(t,e,i,n){var o=e==="clippingParents"?eo(t):[].concat(e),s=[].concat(o,[i]),a=s[0],r=s.reduce(function(l,c){var d=It(t,c,n);return l.top=re(d.top,l.top),l.right=Pe(d.right,l.right),l.bottom=Pe(d.bottom,l.bottom),l.left=re(d.left,l.left),l},It(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 $t(t){var e=t.reference,i=t.element,n=t.placement,o=n?G(n):null,s=n?pe(n):null,a=e.x+e.width/2-i.width/2,r=e.y+e.height/2-i.height/2,l;switch(o){case A:l={x:a,y:e.y-i.height};break;case V:l={x:a,y:e.y+e.height};break;case N:l={x:e.x+e.width,y:r};break;case B:l={x:e.x-i.width,y:r};break;default:l={x:e.x,y:e.y}}var c=o?Fe(o):null;if(c!=null){var d=c==="y"?"height":"width";switch(s){case de:l[c]=l[c]-(e[d]/2-i[d]/2);break;case Ie:l[c]=l[c]+(e[d]/2-i[d]/2);break}}return l}function Ce(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,l=r===void 0?xn:r,c=i.rootBoundary,d=c===void 0?Bt:c,h=i.elementContext,f=h===void 0?ye:h,u=i.altBoundary,y=u===void 0?!1:u,g=i.padding,v=g===void 0?0:g,x=Dt(typeof v!="number"?v:Vt(v,Oe)),C=f===ye?In:ye,O=t.rects.popper,b=t.elements[y?C:f],w=to(ae(b)?b:b.contextElement||ie(t.elements.popper),l,d,a),m=he(t.elements.reference),I=$t({reference:m,element:O,strategy:"absolute",placement:o}),E=De(Object.assign({},O,I)),S=f===ye?E:m,R={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},L=t.modifiersData.offset;if(f===ye&&L){var M=L[o];Object.keys(R).forEach(function(X){var K=[N,V].indexOf(X)>=0?1:-1,q=[A,V].indexOf(X)>=0?"y":"x";R[X]+=M[q]*K})}return R}function io(t,e){e===void 0&&(e={});var i=e,n=i.placement,o=i.boundary,s=i.rootBoundary,a=i.padding,r=i.flipVariations,l=i.allowedAutoPlacements,c=l===void 0?Mt:l,d=pe(n),h=d?r?yt:yt.filter(function(y){return pe(y)===d}):Oe,f=h.filter(function(y){return c.indexOf(y)>=0});f.length===0&&(f=h);var u=f.reduce(function(y,g){return y[g]=Ce(t,{placement:g,boundary:o,rootBoundary:s,padding:a})[G(g)],y},{});return Object.keys(u).sort(function(y,g){return u[y]-u[g]})}function no(t){if(G(t)===Ne)return[];var e=Le(t);return[xt(t),e,xt(e)]}function oo(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,l=i.fallbackPlacements,c=i.padding,d=i.boundary,h=i.rootBoundary,f=i.altBoundary,u=i.flipVariations,y=u===void 0?!0:u,g=i.allowedAutoPlacements,v=e.options.placement,x=G(v),C=x===v,O=l||(C||!y?[Le(v)]:no(v)),b=[v].concat(O).reduce(function(j,$){return j.concat(G($)===Ne?io(e,{placement:$,boundary:d,rootBoundary:h,padding:c,flipVariations:y,allowedAutoPlacements:g}):$)},[]),w=e.rects.reference,m=e.rects.popper,I=new Map,E=!0,S=b[0],R=0;R=0,q=K?"width":"height",P=Ce(e,{placement:L,boundary:d,rootBoundary:h,altBoundary:f,padding:c}),H=K?X?N:B:X?V:A;w[q]>m[q]&&(H=Le(H));var le=Le(H),_=[];if(s&&_.push(P[M]<=0),r&&_.push(P[H]<=0,P[le]<=0),_.every(function(j){return j})){S=L,E=!1;break}I.set(L,_)}if(E)for(var ce=y?3:1,fe=function($){var te=b.find(function(oe){var F=I.get(oe);if(F)return F.slice(0,$).every(function(me){return me})});if(te)return S=te,"break"},Q=ce;Q>0;Q--){var ee=fe(Q);if(ee==="break")break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}}const so={name:"flip",enabled:!0,phase:"main",fn:oo,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[A,N,V,B].some(function(e){return t[e]>=0})}function ro(t){var e=t.state,i=t.name,n=e.rects.reference,o=e.rects.popper,s=e.modifiersData.preventOverflow,a=Ce(e,{elementContext:"reference"}),r=Ce(e,{altBoundary:!0}),l=Ct(a,n),c=Ct(r,o,s),d=Ot(l),h=Ot(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const ao={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ro};function lo(t,e,i){var n=G(t),o=[B,A].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,[B,N].indexOf(n)>=0?{x:r,y:a}:{x:a,y:r}}function co(t){var e=t.state,i=t.options,n=t.name,o=i.offset,s=o===void 0?[0,0]:o,a=Mt.reduce(function(d,h){return d[h]=lo(h,e.rects,s),d},{}),r=a[e.placement],l=r.x,c=r.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=a}const uo={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:co};function ho(t){var e=t.state,i=t.name;e.modifiersData[i]=$t({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const po={name:"popperOffsets",enabled:!0,phase:"read",fn:ho,data:{}};function fo(t){return t==="x"?"y":"x"}function mo(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,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,h=i.padding,f=i.tether,u=f===void 0?!0:f,y=i.tetherOffset,g=y===void 0?0:y,v=Ce(e,{boundary:l,rootBoundary:c,padding:h,altBoundary:d}),x=G(e.placement),C=pe(e.placement),O=!C,b=Fe(x),w=fo(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,R=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),L=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,M={x:0,y:0};if(m){if(s){var X,K=b==="y"?A:B,q=b==="y"?V:N,P=b==="y"?"height":"width",H=m[b],le=H+v[K],_=H-v[q],ce=u?-E[P]/2:0,fe=C===de?I[P]:E[P],Q=C===de?-E[P]:-I[P],ee=e.elements.arrow,j=u&&ee?je(ee):{width:0,height:0},$=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Zt(),te=$[K],oe=$[q],F=we(0,I[P],j[P]),me=O?I[P]/2-ce-F-te-R.mainAxis:fe-F-te-R.mainAxis,ve=O?-I[P]/2+ce+F+oe+R.mainAxis:Q+F+oe+R.mainAxis,ge=e.elements.arrow&&Ee(e.elements.arrow),Ae=ge?b==="y"?ge.clientTop||0:ge.clientLeft||0:0,Ke=(X=L==null?void 0:L[b])!=null?X:0,Gt=H+me-Ke-Ae,Ut=H+ve-Ke,qe=we(u?Pe(le,Gt):le,H,u?re(_,Ut):_);m[b]=qe,M[b]=qe-H}if(r){var _e,zt=b==="x"?A:B,Kt=b==="x"?V:N,se=m[w],Se=w==="y"?"height":"width",Je=se+v[zt],Qe=se-v[Kt],Be=[A,B].indexOf(x)!==-1,et=(_e=L==null?void 0:L[w])!=null?_e:0,tt=Be?Je:se-I[Se]-E[Se]-et+R.altAxis,it=Be?se+I[Se]+E[Se]-et-R.altAxis:Qe,nt=u&&Be?Wn(tt,se,it):we(u?tt:Je,se,u?it:Qe);m[w]=nt,M[w]=nt-se}e.modifiersData[n]=M}}const vo={name:"preventOverflow",enabled:!0,phase:"main",fn:mo,requiresIfExists:["offset"]};function go(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function yo(t){return t===Z(t)||!D(t)?Ge(t):go(t)}function bo(t){var e=t.getBoundingClientRect(),i=ue(e.width)/t.offsetWidth||1,n=ue(e.height)/t.offsetHeight||1;return i!==1||n!==1}function wo(t,e,i){i===void 0&&(i=!1);var n=D(e),o=D(e)&&bo(e),s=ie(e),a=he(t,o,i),r={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&((U(e)!=="body"||ze(s))&&(r=yo(e)),D(e)?(l=he(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=Ue(s))),{x:a.left+r.scrollLeft-l.x,y:a.top+r.scrollTop-l.y,width:a.width,height:a.height}}function xo(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 l=e.get(r);l&&o(l)}}),n.push(s)}return t.forEach(function(s){i.has(s.name)||o(s)}),n}function Io(t){var e=xo(t);return Tn.reduce(function(i,n){return i.concat(e.filter(function(o){return o.phase===n}))},[])}function Co(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}function Oo(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{this.currentActiveIndex=e,this.currentOrientation=i;const n=fn(this.hotspotsConfig,e,i);this.hideHotspots(),n.forEach(o=>this.updateAndShowHotspot(o,e))});this.container=i,this.popper=null,this.popperInstance=null,this.hotspotsContainer=Fi(this.container),this.hotspotsConfig=bn(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=wn({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:gn(this.container)};this.popper=yn(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={...Ro(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=mn(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=cn(),this.canvasWorker=new hn,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=ln({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),l=a*(this.amountY/s.offsetHeight),c=this.allowSpinX?Math.abs(Math.round(n*r)):0,d=this.allowSpinY?Math.abs(Math.round(o*l)):0;(this.allowSpinX&&c!==0||this.allowSpinY&&d!==0)&&(this.hideHotspotPopper(),this.onMoveHandler(this.draggingDirection,c,d),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=be(this.srcXConfig,e),o=this.allowSpinY?be(this.srcYConfig,e):null;dt({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}=tn(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(vt(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;vt(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 Yo(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(),dn(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=Yi(i,o);this.showLoadingSpinner(),this.createGlass(),Ji(s,r=>{this.hideLoadingSpinner(),this.magnified=!0,en(e,this.innerBox,this.offset,r,this.glass,this.magnifier)})}openFullscreenModal(e){e.stopPropagation();const i=Ni(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&&on({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse})){this.stopAutoplay();return}sn({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse,spinDirection:this.spinDirection})&&(this.spinDirection=an(this.spinDirection));const s=this.spinDirection==="y";nn({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=Ti(),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=Di(),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=Hi(),this.fullscreenIcon.onclick=this.openFullscreenModal.bind(this),this.iconsContainer.appendChild(this.fullscreenIcon))}addCloseFullscreenIcon(){this.fullscreenCloseIcon=Bi(),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=Pi(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=$i(),this.innerBox.appendChild(this.loadingSpinner)}showLoadingSpinner(){this.loadingSpinner&&(this.hideAllIcons(),this.loadingSpinner.style.opacity=1)}createTransitionOverlay(){this.transitionOverlay=ji(),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=at(this.mouseMove.bind(this),lt),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=at(this.touchMove.bind(this),lt),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=ut(this.innerBox),this.canvas=ki(this.innerBox,e),this.loader=Vi(this.innerBox);const i=this.canvas.transferControlToOffscreen();this.canvasWorker.postMessage({action:"initCanvas",offscreen:i,devicePixelRatio:this.devicePixelRatio},[i]),this.fullscreenView&&this.addCloseFullscreenIcon(),We(this.innerBox,".cloudimage-360-placeholder")}update(e){this.isReady&&(this.stopAutoplay(),We(this.innerBox,".cloudimage-360-icons-container"),this.init(this.container,e,!0),this.iconsContainer=ut(this.innerBox),this.onAllImagesLoaded())}init(e,i,n){const o=i?Ii(i):xi(e),{folder:s,apiVersion:a,filenameX:r,filenameY:l,imageListX:c,imageListY:d,indexZeroBase:h,amountX:f,amountY:u,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:R,ciFilters:L,ciTransformation:M,lazyload:X,dragSpeed:K,stopAtEdges:q,pointerZoom:P,imageInfo:H="black",initialIconShown:le,bottomCircle:_,hotspots:ce,dragReverse:fe}=o,Q={ciToken:R,ciFilters:L,ciTransformation:M},ee=c?JSON.parse(c):[],j=d?JSON.parse(d):[];if(this.viewerConfig=o,this.amountX=ee.length||f,this.amountY=j.length||u,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(K,50),this.stopAtEdges=q,this.ciParams=Q,this.apiVersion=a,this.pointerZoom=P>1?Math.min(P,5):null,this.keysReverse=x,this.info=H,this.keys=v,this.innerBox=this.innerBox??Wi(this.container),this.initialIconShown=le,this.bottomCircle=_,this.spinDirection=rn(this.autoplayBehavior,this.allowSpinX,this.allowSpinY),this.dragReverse=fe,this.hotspots=ce,this.srcXConfig={folder:s,filename:r,imageList:ee,container:e,innerBox:this.innerBox,apiVersion:a,ciParams:Q,lazyload:X,amount:this.amountX,indexZeroBase:h,autoplayReverse:I},this.srcYConfig={...this.srcXConfig,filename:l,imageList:j,orientation:k.Y,amount:this.amountY},n&&this.removeEvents(),this.attachEvents(y,g,v),n)return;const $=(this.fullscreenView?document.body:this.container).offsetWidth,te=this.allowSpinX&&!ee.length?be(this.srcXConfig,$):null,oe=this.allowSpinY&&!j.length?be(this.srcYConfig,$):null,F=me=>{dt({cdnPathX:te,cdnPathY:oe,configX:this.srcXConfig,configY:this.srcYConfig,onImageLoad:(ve,ge,Ae)=>this.onImageLoad(ve,ge,Ae),onFirstImageLoad:ve=>this.onFirstImageLoaded(me,ve),onAllImagesLoad:this.onAllImagesLoaded.bind(this)})};this.allowSpinX?pt(te,this.srcXConfig,F):this.allowSpinY&&pt(oe,this.srcYConfig,F)}}class jt{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}}window.CI360=jt;const Lo=[{id:"hotspot-1",orientation:"x",containerSize:[1170,663],positions:{0:{x:527,y:319},1:{x:527,y:319},2:{x:527,y:null},3:{x:498,y:null},4:{x:470,y:null},5:{x:441,y:null},73:{x:555,y:null},72:{x:586,y:null},71:{x:614,y:null},70:{x:641,y:null},69:{x:668,y:null},68:{x:692,y:null},67:{x:715,y:null},66:{x:736,y:null},65:{x:756,y:null},64:{x:773,y:null},63:{x:787,y:null}},content:'
Info about Hotspot 1
'},{id:"hotspot-2",orientation:"x",containerSize:[1220,680],positions:{73:{x:355,y:474},74:{x:355,y:null},72:{x:341,y:479},71:{x:336,y:null},70:{x:332,y:null},69:{x:327,y:null},68:{x:326,y:null},67:{x:327,y:null},66:{x:331,y:null},65:{x:334,y:null},64:{x:336,y:null},63:{x:347,y:474}},content:'
Info about Hotspot 2
'},{id:"hotspot-3",orientation:"x",containerSize:[1220,680],positions:{11:{x:683,y:151},12:{x:683,y:null},13:{x:683,y:null},14:{x:683,y:null},15:{x:683,y:null},16:{x:683,y:null},17:{x:681,y:152},18:{x:677,y:156},19:{x:671,y:159},20:{x:665,y:163},21:{x:656,y:168},22:{x:650,y:171},23:{x:643,y:176},24:{x:635,y:178},25:{x:628,y:181},26:{x:621,y:null},27:{x:610,y:null},28:{x:598,y:null},29:{x:588,y:null},30:{x:578,y:null},31:{x:570,y:176},32:{x:560,y:173}},content:'
Info about Hotspot 3
'},{id:"hotspot-4",orientation:"x",containerSize:[1220,680],positions:{6:{x:607,y:246},7:{x:619,y:null},8:{x:630,y:null},9:{x:637,y:null},10:{x:642,y:null}},content:'
Info about Hotspot 4
'}],Xo={folder:"https://scaleflex.cloudimg.io/v7/demo/360-nike/",filenameX:"nike-{index}.jpg",filenameY:"nike-y-{index}.jpg",amountX:"35",amountY:"36",autoplayBehavior:"spin-xy"},Po={folder:"https://scaleflex.cloudimg.io/v7/demo/earbuds/",filenameX:"{index}.jpg",amountX:"233",amountY:void 0,filenameY:void 0},Rt={folder:{label:"data-folder",value:"https://scaleflex.cloudimg.io/v7/demo/earbuds/",isRequired:!0,isUrl:!0},filenameX:{label:"data-filename-x",value:"{index}.jpg"},filenameY:{label:"data-filename-y"},amountY:{label:"data-amount-y",isRequired:!1},amountX:{label:"data-amount-x",value:233,isRequired:!0},speed:{label:"data-speed",value:100,isRequired:!1},dragSpeed:{label:"data-drag-speed",value:120,isRequired:!1},autoplay:{label:"data-autoplay",isRequired:!1},pointerZoom:{label:"data-pointer-zoom",value:1.5,isRequired:!1},autoplayBehavior:{label:"data-autoplay-behavior",value:"spin-xy",isRequired:!1},magnifier:{label:"data-magnifier",value:1.5,isRequired:!1},autoplayReverse:{label:"data-autoplay-reverse",isRequired:!1},playOnce:{label:"data-play-once",isRequired:!1},keys:{label:"data-keys",isRequired:!1},keysReverse:{label:"data-keys-reverse",isRequired:!1},draggable:{label:"data-draggable",isRequired:!1},swipeable:{label:"data-swipeable",isRequired:!1},fullscreen:{label:"data-fullscreen",isRequired:!1}},Yt={NAME:"#7B9200",URL:"#2D88CB"},To=["folder","class"],ko=document.getElementById("spin-directions"),Lt=document.getElementById("copy-text"),Xt=document.getElementById("code-block"),Pt=document.getElementById("code-wrapper"),Ve=document.getElementById("pointer-zoom-selector"),Ao=document.querySelector(".copy-button"),Bo=document.querySelector(".output-code"),Mo=document.getElementById("pointer-checkbox"),Ho=document.querySelectorAll(".plugin-option"),Ft=document.getElementById("x-images-selector"),Wo=document.getElementById("images-y"),Zo=document.getElementById("spin-speed"),Do=document.getElementById("drag-speed"),z=new jt;function Vo(t){const i=t.target.value==="Y",n=i?Xo:Po,o=z.updateView("demo-generator",n);Ft.value=i?35:233,Wo.style.display=i?"block":"none",ne(o.viewerConfig)}function No(t){const{value:e}=t.target,i=z.updateView("demo-generator",{dragSpeed:parseInt(e,10)});ne(i.viewerConfig)}function $o(t){const{value:e}=t.target,i=z.updateView("demo-generator",{speed:parseInt(e,10)});ne(i.viewerConfig)}function jo(){navigator.clipboard.writeText(Bo.innerText),Lt.innerHTML="Copied",setTimeout(()=>{Lt.innerHTML="Copy"},500)}function Fo(t){const{value:e}=t.target,i=z.updateView("demo-generator",{amountX:parseInt(e,10)});ne(i.viewerConfig)}function Go(t){const e=t.target.checked,i=parseFloat(Ve.value,10),n=z.updateView("demo-generator",{pointerZoom:e?i:!1});Ve.disabled=!e,ne(n.viewerConfig)}function Uo(t){const{value:e}=t.target,i=z.updateView("demo-generator",{pointerZoom:parseFloat(e,10)});ne(i.viewerConfig)}function zo(t){const e=t.target.checked,i=t.target.getAttribute("data-plugin-property"),n=t.target.getAttribute("data-plugin-value");let o=e;n&&(o=e?JSON.parse(n):void 0);const s=z.updateView("demo-generator",{[i]:o});ne(s.viewerConfig)}function ne(t){Xt.innerText="",Object.keys(t).filter(n=>Rt[n]&&!!t[n]).forEach(n=>{const{label:o}=Rt[n],s=document.createElement("div"),a=document.createElement("span"),r=document.createElement("span");a.innerText=o,a.style.color=Yt.NAME,To.includes(n)&&(r.style.color=Yt.URL),s.appendChild(a),r.innerText=`"${t[n]}"`,s.innerHTML+="=",s.appendChild(r),Xt.appendChild(s),Pt.scrollTop=Pt.scrollHeight})}Do.addEventListener("change",No);Zo.addEventListener("change",$o);Mo.addEventListener("change",Go);Ft.addEventListener("change",Fo);Ve.addEventListener("change",Uo);ko.addEventListener("change",Vo);Ao.addEventListener("click",jo);Ho.forEach(t=>{t.addEventListener("change",zo)});const Ko=document.getElementById("gurkha-suv"),qo={folder:"https://scaleflex.cloudimg.io/v7/demo/suv-orange-car-360/",filenameX:"orange-{index}.jpg",amountX:73,lazyload:!0,speed:120,pointerZoom:2,responsive:"scaleflex",autoplay:!0,fullscreen:!0,magnifier:3,playOnce:!0,hotspots:Lo};z.init(Ko,qo);z.initAll();const _o=z.getViewById("demo-generator");ne(_o.viewerConfig); diff --git a/assets/index-B1wV20tU.js b/assets/index-B1wV20tU.js new file mode 100644 index 0000000..5a7fa5c --- /dev/null +++ b/assets/index-B1wV20tU.js @@ -0,0 +1,17 @@ +var En=Object.defineProperty;var Yn=(t,e,i)=>e in t?En(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var ii=(t,e,i)=>Yn(t,typeof e!="symbol"?e+"":e,i);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const r of s.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function i(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(o){if(o.ep)return;o.ep=!0;const s=i(o);fetch(o.href,s)}})();var pt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ji="Expected a function",ni=NaN,Xn="[object Symbol]",Ln=/^\s+|\s+$/g,Rn=/^[-+]0x[0-9a-f]+$/i,Tn=/^0b[01]+$/i,kn=/^0o[0-7]+$/i,Pn=parseInt,An=typeof pt=="object"&&pt&&pt.Object===Object&&pt,Mn=typeof self=="object"&&self&&self.Object===Object&&self,Wn=An||Mn||Function("return this")(),Bn=Object.prototype,Hn=Bn.toString,Zn=Math.max,Dn=Math.min,Tt=function(){return Wn.Date.now()};function Nn(t,e,i){var n,o,s,r,a,l,c=0,d=!1,u=!1,p=!0;if(typeof t!="function")throw new TypeError(Ji);e=oi(e)||0,bt(i)&&(d=!!i.leading,u="maxWait"in i,s=u?Zn(oi(i.maxWait)||0,e):s,p="trailing"in i?!!i.trailing:p);function h(m){var x=n,Y=o;return n=o=void 0,c=m,r=t.apply(Y,x),r}function g(m){return c=m,a=setTimeout(w,e),d?h(m):r}function f(m){var x=m-l,Y=m-c,S=e-x;return u?Dn(S,s-Y):S}function v(m){var x=m-l,Y=m-c;return l===void 0||x>=e||x<0||u&&Y>=s}function w(){var m=Tt();if(v(m))return O(m);a=setTimeout(w,f(m))}function O(m){return a=void 0,p&&n?h(m):(n=o=void 0,r)}function E(){a!==void 0&&clearTimeout(a),c=0,n=l=o=a=void 0}function y(){return a===void 0?r:O(Tt())}function b(){var m=Tt(),x=v(m);if(n=arguments,o=this,l=m,x){if(a===void 0)return g(l);if(u)return a=setTimeout(w,e),h(l)}return a===void 0&&(a=setTimeout(w,e)),r}return b.cancel=E,b.flush=y,b}function Vn(t,e,i){var n=!0,o=!0;if(typeof t!="function")throw new TypeError(Ji);return bt(i)&&(n="leading"in i?!!i.leading:n,o="trailing"in i?!!i.trailing:o),Nn(t,e,{leading:n,maxWait:e,trailing:o})}function bt(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function jn(t){return!!t&&typeof t=="object"}function Fn(t){return typeof t=="symbol"||jn(t)&&Hn.call(t)==Xn}function oi(t){if(typeof t=="number")return t;if(Fn(t))return ni;if(bt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=bt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Ln,"");var i=Tn.test(t);return i||kn.test(t)?Pn(t.slice(2),i?2:8):Rn.test(t)?ni:+t}var $n=Vn;const si=Sn($n),z={SPIN_X:"spin-x",SPIN_Y:"spin-y",SPIN_XY:"spin-xy",SPIN_YX:"spin-yx"},Gn=[!1,0,null,void 0,"false","0","null","undefined"],K={X:"x-axis",Y:"y-axis",CENTER:"center"},zn=["folder","folderX","folderY","filenameX","filenameY","imageListX","imageListY","indexZeroBase","amountX","amountY"],Un=[37,39],Kn=[38,40],ai=10,I={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:z.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},qn=t=>({folder:B(t,"folder",I.folder),apiVersion:B(t,"api-version",I.apiVersion),filenameX:B(t,"filename")||B(t,"filename-x")||I.filenameX,filenameY:B(t,"filename-y",I.filenameY),imageListX:B(t,"image-list-x",I.imageListX),imageListY:B(t,"image-list-y",I.imageListY),indexZeroBase:parseInt(B(t,"index-zero-base",I.indexZeroBase),10),amountX:parseInt(B(t,"amount-x",I.amountX),10),amountY:parseInt(B(t,"amount-y",I.amountY),10),speed:parseInt(B(t,"speed",I.speed),10),dragSpeed:parseInt(B(t,"drag-speed",I.dragSpeed),10),draggable:ne(t,"draggable",I.draggable),swipeable:ne(t,"swipeable",I.swipeable),keys:ne(t,"keys",I.keys),keysReverse:ne(t,"keys-reverse",I.keysReverse),autoplay:ne(t,"autoplay",I.autoplay),autoplayBehavior:B(t,"autoplay-behavior",I.autoplayBehavior),playOnce:ne(t,"play-once",I.playOnce),autoplayReverse:ne(t,"autoplay-reverse",I.autoplayReverse),pointerZoom:parseFloat(B(t,"pointer-zoom",I.pointerZoom),10),fullscreen:ne(t,"fullscreen")||ne(t,"full-screen",I.fullscreen),magnifier:parseFloat(B(t,"magnifier",I.magnifier),10),bottomCircleOffset:parseInt(B(t,"bottom-circle-offset",I.bottomCircleOffset),10),ciToken:B(t,"responsive",I.ciToken),ciFilters:B(t,"filters",I.ciFilters),ciTransformation:B(t,"transformation",I.ciTransformation),lazyload:ne(t,"lazyload",I.lazyload),dragReverse:ne(t,"drag-reverse",I.dragReverse),stopAtEdges:ne(t,"stop-at-edges",I.stopAtEdges),imageInfo:ne(t,"info",I.imageInfo),initialIconShown:!ri(t,"initial-icon"),bottomCircle:!ri(t,"bottom-circle")}),_n=t=>({folder:t.folder||I.folder,apiVersion:t.apiVersion||I.apiVersion,filenameX:t.filenameX||t.filename||I.filenameX,filenameY:t.filenameY||I.filenameY,imageListX:t.imageListX||I.imageListX,imageListY:t.imageListY||I.imageListY,indexZeroBase:parseInt(t.indexZeroBase??I.indexZeroBase,10),amountX:parseInt(t.amountX??I.amountX,10),amountY:parseInt(t.amountY??I.amountY,10),speed:parseInt(t.speed??I.speed,10),draggable:t.draggable??I.draggable,swipeable:t.swipeable??I.swipeable,dragSpeed:parseInt(t.dragSpeed??I.dragSpeed,10),keys:t.keys??I.keys,keysReverse:t.keysReverse??I.keysReverse,autoplay:t.autoplay??I.autoplay,autoplayBehavior:t.autoplayBehavior||I.autoplayBehavior,playOnce:t.playOnce??I.playOnce,autoplayReverse:t.autoplayReverse??I.autoplayReverse,pointerZoom:parseFloat(t.pointerZoom??I.pointerZoom,10),fullscreen:t.fullscreen??I.fullscreen,magnifier:parseFloat(t.magnifier??I.magnifier,10),bottomCircleOffset:parseInt(t.bottomCircleOffset??I.bottomCircleOffset,10),ciToken:t.ciToken||I.ciToken,ciFilters:t.ciFilters||I.ciFilters,ciTransformation:t.ciTransformation||I.ciTransformation,lazyload:t.lazyload??I.lazyload,dragReverse:t.dragReverse??I.dragReverse,stopAtEdges:t.stopAtEdges??I.stopAtEdges,imageInfo:t.imageInfo??I.imageInfo,initialIconShown:t.initialIconShown??I.initialIconShown,bottomCircle:t.bottomCircle??I.bottomCircle,hotspots:t.hotspots??I.hotspots}),B=(t,e,i)=>t.getAttribute(e)||t.getAttribute(`data-${e}`)||i,ne=(t,e,i)=>t.hasAttribute(e)||t.hasAttribute(`data-${e}`)||i,ri=(t,e)=>B(t,e,null)==="false",Jn=(t,e,i=zn)=>i.some(n=>n in e&&e[n]!==t[n]),Qn=(t=1)=>{const e=Math.round(window.devicePixelRatio||1);return parseInt(t)*e},eo=(t,e,i)=>new URL(t).origin.includes("cloudimg")?t:`https://${e}.cloudimg.io/${i}${t}`,to=({ciTransformation:t,responsiveWidth:e,ciFilters:i})=>{const n=`width=${e}`,o=t||n,s=i?`&f=${i}`:"";return`${o}${s}`},Qe=(t,e)=>{const{folder:i,apiVersion:n,filename:o="",ciParams:s}=t,{ciToken:r,ciFilters:a,ciTransformation:l}=s||{},c=`${i}${o}`;if(!r)return c;const d=Gn.includes(n)?null:n,u=d?`${d}/`:"",p=Qn(e),h=eo(c,r,u),g=to({ciTransformation:l,responsiveWidth:p,ciFilters:a});return`${h}${g?"?":""}${g}`},io=(t,e,i)=>{const[n,o]=t.split("?"),s=`${e}=${encodeURIComponent(i)}`;if(!o)return`${n}?${s}`;const r=new URLSearchParams(o);return r.set(e,i),`${n}?${r.toString()}`},no=(t,e)=>io(t,"width",e),Qi=(t,e=0)=>(t+="",t.length>=e?t:new Array(e-t.length+1).join("0")+t),oo=(t,{amount:e=0,indexZeroBase:i=0}={})=>Array.from({length:e},(n,o)=>t.replace("{index}",Qi(o+1,i))),so=({imagesUrls:t,onFirstImageLoad:e,onImageLoad:i,onAllImagesLoad:n,autoplayReverse:o})=>{let s=0;const r=t.length,a=[],l=(u,p)=>{const h=new Image;h.crossOrigin="anonymous",h.src=u,h.onload=async()=>{const g=await createImageBitmap(h),f={src:u,bitmapImage:g,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight};s++,a[p]=f,i==null||i(f,p),s===r&&(n==null||n(a))},h.onerror=()=>{console.error(`Failed to load image: ${u}`),s++,s===r&&(n==null||n(a))}},c=new Image,d=t[o?t.length-1:0];c.crossOrigin="anonymous",c.src=d,c.onload=async()=>{const u=await createImageBitmap(c),p={src:d,bitmapImage:u,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight};a[0]=p,s++,e==null||e(p),i==null||i(p,0);for(let h=1;h{console.error(`Failed to load first image: ${t[0]}`),s++;for(let u=1;u{let a={x:!1,y:!1},l=[],c=[];const d=t||i.imageList.length,u=e||n.imageList.length,p=()=>{a.x&&a.y&&r(l,c)},h=({cdnPath:g,config:f,orientation:v,loadedImages:w,onFirstImageLoad:O})=>{const E=v===K.X,y=f.imageList.length?f.imageList:oo(g,f);so({imagesUrls:y,onFirstImageLoad:O,onImageLoad:(b,m)=>{s==null||s(b,m,v),w[m]=b},onAllImagesLoad:b=>{w=b,a[E?"x":"y"]=!0,p()},autoplayReverse:f.autoplayReverse})};d?h({cdnPath:t,config:i,orientation:K.X,loadedImages:l,onFirstImageLoad:o}):a.x=!0,u?h({cdnPath:e,config:n,orientation:K.Y,loadedImages:c,onFirstImageLoad:d?void 0:o}):a.y=!0},ao=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},ro=()=>{const t=document.createElement("div");return t.className="cloudimage-initial-icon",t.innerText="360°",t},lo=(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},co="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",ho=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-close-icon",t.innerHTML=`close icon`,t},uo="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",po=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-fullscreen-button",t.innerHTML=`fullscreen icon`,t},ci=t=>{const e=document.createElement("div");return e.className="cloudimage-360-icons-container",t.appendChild(e),e},fo=t=>{const e=document.createElement("div");return e.className="cloudimage-360-inner-box",t.appendChild(e),e},mo="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",vo=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-magnifier-button",t.innerHTML=`magnifier icon`,t},go=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},yo=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},Mt=(t,e)=>{const i=t.querySelector(e);i&&i.parentNode.removeChild(i)},bo=()=>{const t=document.createElement("div");return t.className="cloudimage-loading-spinner",t},wo=()=>{const t=document.createElement("div");return t.className="cloudimage-360-transition-overlay",t},xo=t=>{const e=document.createElement("div");return e.className="cloudimage-360-hotspot-container",t.appendChild(e),e},Io=(t,e)=>{const[i,n]=t.split("?");if(!n)return t;const o=new RegExp(`^${e}=|&${e}=`),s=n.split("&").filter(r=>!o.test(r)).join("&");return s?`${i}?${s}`:i},Co=t=>{const e=Io(t,"width"),i=e.includes("?")?"&":"?";return`${e}${i}width=${150*devicePixelRatio}`},Oo=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(r=>{r.isIntersecting&&(i(r.target),s.unobserve(r.target))})},e).observe(t)},Eo=(t,e)=>{const i=Qi(1,e);return t.replace("{index}",i)},Yo=(t,e)=>{const[i]=t,n=/(https?):\/\//i.test(i);return Qe({...e,folder:n?"":e.folder,filename:i})},So=(t,e)=>{const{imageList:i,indexZeroBase:n}=e;if(i.length)try{const o=JSON.parse(i);return Yo(o,e)}catch(o){console.error(`Wrong format in image-list attribute: ${o.message}`)}return Eo(t,n)},di=(t,e,i)=>{const n=new Image;return n.setAttribute(e?"data-src":"src",t),n.className=i,n.style.cssText=` + position: ${e?"absolute":"static"}; + width: 100%; + inset: 0; + height: 100%; + object-fit: contain; + object-position: center; + filter: blur(10px); + `,n},hi=(t,e,i)=>{const{innerBox:n,imageList:o,lazyload:s}=e||{},[r]=o,a=r||So(t,e),l=Co(a),c=di(l,s,"cloudimage-lazy"),d=di(l,!1,"cloudimage-360-placeholder"),u=p=>{Mt(n,".cloudimage-lazy"),i&&i({event:p,width:c.width,height:c.height,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight,src:l})};c.onload=u,n.appendChild(c),n.appendChild(d),Oo(c)},Xo=(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(){}},Lo=(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}},kt=(t,e,i)=>{const{container:n,w:o,h:s,zoom:r,bw:a,offsetX:l,offsetY:c}=e,d=Lo(t,n);let u=d.x,p=d.y;u=Math.max(o/r,Math.min(u,n.offsetWidth-o/r)),p=Math.max(s/r,Math.min(p,n.offsetHeight-s/r)),i.style.left=`${u-o}px`,i.style.top=`${p-s}px`;const h=(u-l)*r-o+a,g=(p-c)*r-s+a;i.style.backgroundPosition=`-${h}px -${g}px`},Ro=(t,e,i,n,o,s)=>{const{x:r=0,y:a=0}=i||{},l=(e.offsetWidth-r*2)*s,c=(e.offsetHeight-a*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=`${l}px ${c}px`;const d=3,u=o.offsetWidth/2,p=o.offsetHeight/2,h={container:e,w:u,h:p,zoom:s,bw:d,offsetX:r,offsetY:a};kt(t,h,o);const g=v=>{kt(v,h,o)},f=v=>{v.preventDefault(),kt(v,h,o)};o.addEventListener("mousemove",g),e.addEventListener("mousemove",g),e.addEventListener("touchmove",f)},To=(t,e,i)=>{const{clientX:n,clientY:o}=t,s=e.getBoundingClientRect(),r=e.width/(s.width*i),a=e.height/(s.height*i),l=(n-s.left)*r,c=(o-s.top)*a;return{offsetX:l,offsetY:c}},ui=(t,{bottom:e,top:i})=>{t?e():i()},pi=(t,{left:e,right:i})=>{t?e():i()},ko=({autoplayBehavior:t,spinY:e,reversed:i,loopTriggers:n})=>{switch(t){case z.SPIN_XY:case z.SPIN_YX:e?ui(i,n):pi(i,n);break;case z.SPIN_Y:ui(i,n);break;case z.SPIN_X:default:pi(i,n)}},Po=({autoplayBehavior:t,activeImageX:e,activeImageY:i,amountX:n,amountY:o,autoplayReverse:s})=>{const r=(a,l)=>{const c=l-1;return s?a===0:a===c};switch(t){case z.SPIN_XY:case z.SPIN_Y:return r(i,o);case z.SPIN_X:case z.SPIN_YX:default:return r(e,n)}},Ao=({autoplayBehavior:t,activeImageX:e,activeImageY:i,amountX:n,amountY:o,autoplayReverse:s,spinDirection:r})=>{const a=e===(s?0:n-1),l=i===(s?0:o-1);return t===z.SPIN_XY||t===z.SPIN_YX?r==="x"&&a||r==="y"&&l:!1},Mo=(t,e,i)=>{if(!i)return"x";if(!e)return"y";switch(t){case z.SPIN_XY:return"x";case z.SPIN_YX:return"y";case z.SPIN_Y:return"y";case z.SPIN_X:default:return"x"}},Wo=t=>t==="x"?"y":"x",fi=(t,e)=>{const i=[...Un];return e?[...i,...Kn].includes(t):i.includes(t)},Bo=({deltaX:t,deltaY:e,reversed:i,allowSpinX:n,allowSpinY:o,threshold:s=1})=>{const r=Math.abs(t),a=Math.abs(e);return n&&r-s>a?i?t>0?"left":"right":t>0?"right":"left":o&&a-s>r?i?e>0?"up":"down":e>0?"down":"up":null},Ho=()=>"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,Zo=(t,e=150)=>{let i;return function(...n){clearTimeout(i),i=setTimeout(()=>{t.apply(this,n)},e)}},en="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHg9KGEsdCxlKT0+e2NvbnN0IHM9YS9lLG49dC9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sTz0oe3BvaW50ZXJYOmEscG9pbnRlclk6dCxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOnIsbmF0dXJhbEhlaWdodDpsfT1lO2xldCBnPWEvaSpyLXMvMix1PXQvYypsLW4vMjtjb25zdCBwPU1hdGgubWF4KDAsci1zKSxJPU1hdGgubWF4KDAsbC1uKTtyZXR1cm4gZz1NYXRoLm1heCgwLE1hdGgubWluKGcscCkpLHU9TWF0aC5tYXgoMCxNYXRoLm1pbih1LEkpKSx7em9vbU9mZnNldFg6Zyx6b29tT2Zmc2V0WTp1fX07bGV0IG8sbSxmLGgsZCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIGE9Pntjb25zdHthY3Rpb246dCxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpyLGltYWdlQXNwZWN0UmF0aW86bCxjb250YWluZXJXaWR0aDpnLGNvbnRhaW5lckhlaWdodDp1fT1hLmRhdGE7c3dpdGNoKHQpe2Nhc2UiaW5pdENhbnZhcyI6dihlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjp6KGwsZyx1KTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpDKG4saSxjLHIpO2JyZWFrfX07Y29uc3Qgdj0oYSx0KT0+e289YSxtPW8uZ2V0Q29udGV4dCgiMmQiKSxmPXR9LHo9KGEsdCxlKT0+e2NvbnN0IHM9dC9lO3c9YT5zLG8ud2lkdGg9dCpmLG8uaGVpZ2h0PWUqZixtLnNjYWxlKGYsZiksdz8oaD10LGQ9dC9hKTooZD1lLGg9ZSphKSxtLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxtLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEM9KGE9e30sdD0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09YTtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L2YtZCkvMik6KGk9KG8ud2lkdGgvZi1oKS8yLGM9MCksbS5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLHQhPT0xKXtjb25zdHt6b29tZWRXaWR0aDpyLHpvb21lZEhlaWdodDpsfT14KGgsZCx0KSx7em9vbU9mZnNldFg6Zyx6b29tT2Zmc2V0WTp1fT1PKHtwb2ludGVyWDplLHBvaW50ZXJZOnMsaW1hZ2VEYXRhOmEsem9vbWVkV2lkdGg6cix6b29tZWRIZWlnaHQ6bCxkcmF3V2lkdGg6aCxkcmF3SGVpZ2h0OmR9KTttLmRyYXdJbWFnZShuLGcsdSxyLGwsaSxjLGgsZCl9ZWxzZSBtLmRyYXdJbWFnZShuLGksYyxoLGQpfX0pKCk7Cg==",Do=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),mi=typeof self<"u"&&self.Blob&&new Blob([Do(en)],{type:"text/javascript;charset=utf-8"});function No(t){let e;try{if(e=mi&&(self.URL||self.webkitURL).createObjectURL(mi),!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,"+en,{name:t==null?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}const Vo=t=>t==="x"?K.X:K.Y,jo=(t,e,i)=>t.filter(n=>Vo(n.orientation)===i&&e in n.positions),Fo=t=>{const e=document.createElement("span");return e.id=t,e.className="cloudimage-360-hotspot",e.dataset.hotspotId=t,e},$o=t=>{const e=Object.entries(t).sort(([s],[r])=>Number(s)-Number(r));let i=null,n=null;const o={};for(const[s,r]of e)if(!r)o[s]={x:i,y:n};else{const{x:a,y:l}=r;a!=null&&(i=a),l!=null&&(n=l),o[s]={x:a||i,y:l||n}}return o},Go=t=>[{name:"offset",options:{offset:[0,10]}},{name:"preventOverflow",options:{boundary:t}}],zo=(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},Uo=t=>{const e=[...t];return e.forEach((i,n)=>{const o={...$o(i.positions)};e[n].initialPositions=o,e[n].positions=o}),e},Ko=({newWidth:t,newHeight:e,initialContainerSize:i,imageAspectRatio:n,hotspotsConfig:o})=>{const[s,r]=i;let a=t,l=e,c=0,d=0;const u=t/e;n>u?(l=t/n,d=(e-l)/2):(a=e*n,c=(t-a)/2);const h=a/s,g=l/r;return o.map(f=>{const v={};return Object.entries(f.initialPositions).forEach(([w,O])=>{v[w]={x:O.x*h+c,y:O.y*g+d}}),{...f,positions:v}})};var _="top",ce="bottom",de="right",J="left",Vt="auto",ct=[_,ce,de,J],Ae="start",st="end",qo="clippingParents",tn="viewport",_e="popper",_o="reference",vi=ct.reduce(function(t,e){return t.concat([e+"-"+Ae,e+"-"+st])},[]),nn=[].concat(ct,[Vt]).reduce(function(t,e){return t.concat([e,e+"-"+Ae,e+"-"+st])},[]),Jo="beforeRead",Qo="read",es="afterRead",ts="beforeMain",is="main",ns="afterMain",os="beforeWrite",ss="write",as="afterWrite",rs=[Jo,Qo,es,ts,is,ns,os,ss,as];function ye(t){return t?(t.nodeName||"").toLowerCase():null}function se(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function ke(t){var e=se(t).Element;return t instanceof e||t instanceof Element}function re(t){var e=se(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function jt(t){if(typeof ShadowRoot>"u")return!1;var e=se(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function ls(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];!re(s)||!ye(s)||(Object.assign(s.style,n),Object.keys(o).forEach(function(r){var a=o[r];a===!1?s.removeAttribute(r):s.setAttribute(r,a===!0?"":a)}))})}function cs(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]||{},r=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:i[n]),a=r.reduce(function(l,c){return l[c]="",l},{});!re(o)||!ye(o)||(Object.assign(o.style,a),Object.keys(s).forEach(function(l){o.removeAttribute(l)}))})}}const ds={name:"applyStyles",enabled:!0,phase:"write",fn:ls,effect:cs,requires:["computeStyles"]};function ve(t){return t.split("-")[0]}var Re=Math.max,wt=Math.min,Me=Math.round;function Wt(){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 on(){return!/^((?!chrome|android).)*safari/i.test(Wt())}function We(t,e,i){e===void 0&&(e=!1),i===void 0&&(i=!1);var n=t.getBoundingClientRect(),o=1,s=1;e&&re(t)&&(o=t.offsetWidth>0&&Me(n.width)/t.offsetWidth||1,s=t.offsetHeight>0&&Me(n.height)/t.offsetHeight||1);var r=ke(t)?se(t):window,a=r.visualViewport,l=!on()&&i,c=(n.left+(l&&a?a.offsetLeft:0))/o,d=(n.top+(l&&a?a.offsetTop:0))/s,u=n.width/o,p=n.height/s;return{width:u,height:p,top:d,right:c+u,bottom:d+p,left:c,x:c,y:d}}function Ft(t){var e=We(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 sn(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&jt(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ce(t){return se(t).getComputedStyle(t)}function hs(t){return["table","td","th"].indexOf(ye(t))>=0}function Ee(t){return((ke(t)?t.ownerDocument:t.document)||window.document).documentElement}function Et(t){return ye(t)==="html"?t:t.assignedSlot||t.parentNode||(jt(t)?t.host:null)||Ee(t)}function gi(t){return!re(t)||Ce(t).position==="fixed"?null:t.offsetParent}function us(t){var e=/firefox/i.test(Wt()),i=/Trident/i.test(Wt());if(i&&re(t)){var n=Ce(t);if(n.position==="fixed")return null}var o=Et(t);for(jt(o)&&(o=o.host);re(o)&&["html","body"].indexOf(ye(o))<0;){var s=Ce(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 dt(t){for(var e=se(t),i=gi(t);i&&hs(i)&&Ce(i).position==="static";)i=gi(i);return i&&(ye(i)==="html"||ye(i)==="body"&&Ce(i).position==="static")?e:i||us(t)||e}function $t(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function tt(t,e,i){return Re(t,wt(e,i))}function ps(t,e,i){var n=tt(t,e,i);return n>i?i:n}function an(){return{top:0,right:0,bottom:0,left:0}}function rn(t){return Object.assign({},an(),t)}function ln(t,e){return e.reduce(function(i,n){return i[n]=t,i},{})}var fs=function(e,i){return e=typeof e=="function"?e(Object.assign({},i.rects,{placement:i.placement})):e,rn(typeof e!="number"?e:ln(e,ct))};function ms(t){var e,i=t.state,n=t.name,o=t.options,s=i.elements.arrow,r=i.modifiersData.popperOffsets,a=ve(i.placement),l=$t(a),c=[J,de].indexOf(a)>=0,d=c?"height":"width";if(!(!s||!r)){var u=fs(o.padding,i),p=Ft(s),h=l==="y"?_:J,g=l==="y"?ce:de,f=i.rects.reference[d]+i.rects.reference[l]-r[l]-i.rects.popper[d],v=r[l]-i.rects.reference[l],w=dt(s),O=w?l==="y"?w.clientHeight||0:w.clientWidth||0:0,E=f/2-v/2,y=u[h],b=O-p[d]-u[g],m=O/2-p[d]/2+E,x=tt(y,m,b),Y=l;i.modifiersData[n]=(e={},e[Y]=x,e.centerOffset=x-m,e)}}function vs(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)||sn(e.elements.popper,o)&&(e.elements.arrow=o))}const gs={name:"arrow",enabled:!0,phase:"main",fn:ms,effect:vs,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Be(t){return t.split("-")[1]}var ys={top:"auto",right:"auto",bottom:"auto",left:"auto"};function bs(t,e){var i=t.x,n=t.y,o=e.devicePixelRatio||1;return{x:Me(i*o)/o||0,y:Me(n*o)/o||0}}function yi(t){var e,i=t.popper,n=t.popperRect,o=t.placement,s=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,u=t.isFixed,p=r.x,h=p===void 0?0:p,g=r.y,f=g===void 0?0:g,v=typeof d=="function"?d({x:h,y:f}):{x:h,y:f};h=v.x,f=v.y;var w=r.hasOwnProperty("x"),O=r.hasOwnProperty("y"),E=J,y=_,b=window;if(c){var m=dt(i),x="clientHeight",Y="clientWidth";if(m===se(i)&&(m=Ee(i),Ce(m).position!=="static"&&a==="absolute"&&(x="scrollHeight",Y="scrollWidth")),m=m,o===_||(o===J||o===de)&&s===st){y=ce;var S=u&&m===b&&b.visualViewport?b.visualViewport.height:m[x];f-=S-n.height,f*=l?1:-1}if(o===J||(o===_||o===ce)&&s===st){E=de;var X=u&&m===b&&b.visualViewport?b.visualViewport.width:m[Y];h-=X-n.width,h*=l?1:-1}}var L=Object.assign({position:a},c&&ys),k=d===!0?bs({x:h,y:f},se(i)):{x:h,y:f};if(h=k.x,f=k.y,l){var R;return Object.assign({},L,(R={},R[y]=O?"0":"",R[E]=w?"0":"",R.transform=(b.devicePixelRatio||1)<=1?"translate("+h+"px, "+f+"px)":"translate3d("+h+"px, "+f+"px, 0)",R))}return Object.assign({},L,(e={},e[y]=O?f+"px":"",e[E]=w?h+"px":"",e.transform="",e))}function ws(t){var e=t.state,i=t.options,n=i.gpuAcceleration,o=n===void 0?!0:n,s=i.adaptive,r=s===void 0?!0:s,a=i.roundOffsets,l=a===void 0?!0:a,c={placement:ve(e.placement),variation:Be(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,yi(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,yi(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const xs={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ws,data:{}};var ft={passive:!0};function Is(t){var e=t.state,i=t.instance,n=t.options,o=n.scroll,s=o===void 0?!0:o,r=n.resize,a=r===void 0?!0:r,l=se(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(d){d.addEventListener("scroll",i.update,ft)}),a&&l.addEventListener("resize",i.update,ft),function(){s&&c.forEach(function(d){d.removeEventListener("scroll",i.update,ft)}),a&&l.removeEventListener("resize",i.update,ft)}}const Cs={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Is,data:{}};var Os={left:"right",right:"left",bottom:"top",top:"bottom"};function gt(t){return t.replace(/left|right|bottom|top/g,function(e){return Os[e]})}var Es={start:"end",end:"start"};function bi(t){return t.replace(/start|end/g,function(e){return Es[e]})}function Gt(t){var e=se(t),i=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:i,scrollTop:n}}function zt(t){return We(Ee(t)).left+Gt(t).scrollLeft}function Ys(t,e){var i=se(t),n=Ee(t),o=i.visualViewport,s=n.clientWidth,r=n.clientHeight,a=0,l=0;if(o){s=o.width,r=o.height;var c=on();(c||!c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:r,x:a+zt(t),y:l}}function Ss(t){var e,i=Ee(t),n=Gt(t),o=(e=t.ownerDocument)==null?void 0:e.body,s=Re(i.scrollWidth,i.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),r=Re(i.scrollHeight,i.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-n.scrollLeft+zt(t),l=-n.scrollTop;return Ce(o||i).direction==="rtl"&&(a+=Re(i.clientWidth,o?o.clientWidth:0)-s),{width:s,height:r,x:a,y:l}}function Ut(t){var e=Ce(t),i=e.overflow,n=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+o+n)}function cn(t){return["html","body","#document"].indexOf(ye(t))>=0?t.ownerDocument.body:re(t)&&Ut(t)?t:cn(Et(t))}function it(t,e){var i;e===void 0&&(e=[]);var n=cn(t),o=n===((i=t.ownerDocument)==null?void 0:i.body),s=se(n),r=o?[s].concat(s.visualViewport||[],Ut(n)?n:[]):n,a=e.concat(r);return o?a:a.concat(it(Et(r)))}function Bt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Xs(t,e){var i=We(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 wi(t,e,i){return e===tn?Bt(Ys(t,i)):ke(e)?Xs(e,i):Bt(Ss(Ee(t)))}function Ls(t){var e=it(Et(t)),i=["absolute","fixed"].indexOf(Ce(t).position)>=0,n=i&&re(t)?dt(t):t;return ke(n)?e.filter(function(o){return ke(o)&&sn(o,n)&&ye(o)!=="body"}):[]}function Rs(t,e,i,n){var o=e==="clippingParents"?Ls(t):[].concat(e),s=[].concat(o,[i]),r=s[0],a=s.reduce(function(l,c){var d=wi(t,c,n);return l.top=Re(d.top,l.top),l.right=wt(d.right,l.right),l.bottom=wt(d.bottom,l.bottom),l.left=Re(d.left,l.left),l},wi(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function dn(t){var e=t.reference,i=t.element,n=t.placement,o=n?ve(n):null,s=n?Be(n):null,r=e.x+e.width/2-i.width/2,a=e.y+e.height/2-i.height/2,l;switch(o){case _:l={x:r,y:e.y-i.height};break;case ce:l={x:r,y:e.y+e.height};break;case de:l={x:e.x+e.width,y:a};break;case J:l={x:e.x-i.width,y:a};break;default:l={x:e.x,y:e.y}}var c=o?$t(o):null;if(c!=null){var d=c==="y"?"height":"width";switch(s){case Ae:l[c]=l[c]-(e[d]/2-i[d]/2);break;case st:l[c]=l[c]+(e[d]/2-i[d]/2);break}}return l}function at(t,e){e===void 0&&(e={});var i=e,n=i.placement,o=n===void 0?t.placement:n,s=i.strategy,r=s===void 0?t.strategy:s,a=i.boundary,l=a===void 0?qo:a,c=i.rootBoundary,d=c===void 0?tn:c,u=i.elementContext,p=u===void 0?_e:u,h=i.altBoundary,g=h===void 0?!1:h,f=i.padding,v=f===void 0?0:f,w=rn(typeof v!="number"?v:ln(v,ct)),O=p===_e?_o:_e,E=t.rects.popper,y=t.elements[g?O:p],b=Rs(ke(y)?y:y.contextElement||Ee(t.elements.popper),l,d,r),m=We(t.elements.reference),x=dn({reference:m,element:E,strategy:"absolute",placement:o}),Y=Bt(Object.assign({},E,x)),S=p===_e?Y:m,X={top:b.top-S.top+w.top,bottom:S.bottom-b.bottom+w.bottom,left:b.left-S.left+w.left,right:S.right-b.right+w.right},L=t.modifiersData.offset;if(p===_e&&L){var k=L[o];Object.keys(X).forEach(function(R){var Z=[de,ce].indexOf(R)>=0?1:-1,D=[_,ce].indexOf(R)>=0?"y":"x";X[R]+=k[D]*Z})}return X}function Ts(t,e){e===void 0&&(e={});var i=e,n=i.placement,o=i.boundary,s=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=l===void 0?nn:l,d=Be(n),u=d?a?vi:vi.filter(function(g){return Be(g)===d}):ct,p=u.filter(function(g){return c.indexOf(g)>=0});p.length===0&&(p=u);var h=p.reduce(function(g,f){return g[f]=at(t,{placement:f,boundary:o,rootBoundary:s,padding:r})[ve(f)],g},{});return Object.keys(h).sort(function(g,f){return h[g]-h[f]})}function ks(t){if(ve(t)===Vt)return[];var e=gt(t);return[bi(t),e,bi(e)]}function Ps(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,r=i.altAxis,a=r===void 0?!0:r,l=i.fallbackPlacements,c=i.padding,d=i.boundary,u=i.rootBoundary,p=i.altBoundary,h=i.flipVariations,g=h===void 0?!0:h,f=i.allowedAutoPlacements,v=e.options.placement,w=ve(v),O=w===v,E=l||(O||!g?[gt(v)]:ks(v)),y=[v].concat(E).reduce(function(M,A){return M.concat(ve(A)===Vt?Ts(e,{placement:A,boundary:d,rootBoundary:u,padding:c,flipVariations:g,allowedAutoPlacements:f}):A)},[]),b=e.rects.reference,m=e.rects.popper,x=new Map,Y=!0,S=y[0],X=0;X=0,D=Z?"width":"height",T=at(e,{placement:L,boundary:d,rootBoundary:u,altBoundary:p,padding:c}),P=Z?R?de:J:R?ce:_;b[D]>m[D]&&(P=gt(P));var te=gt(P),N=[];if(s&&N.push(T[k]<=0),a&&N.push(T[P]<=0,T[te]<=0),N.every(function(M){return M})){S=L,Y=!1;break}x.set(L,N)}if(Y)for(var ie=g?3:1,pe=function(A){var F=y.find(function($){var W=x.get($);if(W)return W.slice(0,A).every(function(xe){return xe})});if(F)return S=F,"break"},V=ie;V>0;V--){var j=pe(V);if(j==="break")break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}}const As={name:"flip",enabled:!0,phase:"main",fn:Ps,requiresIfExists:["offset"],data:{_skip:!1}};function xi(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 Ii(t){return[_,de,ce,J].some(function(e){return t[e]>=0})}function Ms(t){var e=t.state,i=t.name,n=e.rects.reference,o=e.rects.popper,s=e.modifiersData.preventOverflow,r=at(e,{elementContext:"reference"}),a=at(e,{altBoundary:!0}),l=xi(r,n),c=xi(a,o,s),d=Ii(l),u=Ii(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}const Ws={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ms};function Bs(t,e,i){var n=ve(t),o=[J,_].indexOf(n)>=0?-1:1,s=typeof i=="function"?i(Object.assign({},e,{placement:t})):i,r=s[0],a=s[1];return r=r||0,a=(a||0)*o,[J,de].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}function Hs(t){var e=t.state,i=t.options,n=t.name,o=i.offset,s=o===void 0?[0,0]:o,r=nn.reduce(function(d,u){return d[u]=Bs(u,e.rects,s),d},{}),a=r[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}const Zs={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Hs};function Ds(t){var e=t.state,i=t.name;e.modifiersData[i]=dn({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Ns={name:"popperOffsets",enabled:!0,phase:"read",fn:Ds,data:{}};function Vs(t){return t==="x"?"y":"x"}function js(t){var e=t.state,i=t.options,n=t.name,o=i.mainAxis,s=o===void 0?!0:o,r=i.altAxis,a=r===void 0?!1:r,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,u=i.padding,p=i.tether,h=p===void 0?!0:p,g=i.tetherOffset,f=g===void 0?0:g,v=at(e,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),w=ve(e.placement),O=Be(e.placement),E=!O,y=$t(w),b=Vs(y),m=e.modifiersData.popperOffsets,x=e.rects.reference,Y=e.rects.popper,S=typeof f=="function"?f(Object.assign({},e.rects,{placement:e.placement})):f,X=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),L=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,k={x:0,y:0};if(m){if(s){var R,Z=y==="y"?_:J,D=y==="y"?ce:de,T=y==="y"?"height":"width",P=m[y],te=P+v[Z],N=P-v[D],ie=h?-Y[T]/2:0,pe=O===Ae?x[T]:Y[T],V=O===Ae?-Y[T]:-x[T],j=e.elements.arrow,M=h&&j?Ft(j):{width:0,height:0},A=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:an(),F=A[Z],$=A[D],W=tt(0,x[T],M[T]),xe=E?x[T]/2-ie-W-F-X.mainAxis:pe-W-F-X.mainAxis,fe=E?-x[T]/2+ie+W+$+X.mainAxis:V+W+$+X.mainAxis,me=e.elements.arrow&&dt(e.elements.arrow),Xe=me?y==="y"?me.clientTop||0:me.clientLeft||0:0,Ve=(R=L==null?void 0:L[y])!=null?R:0,St=P+xe-Ve-Xe,Xt=P+fe-Ve,je=tt(h?wt(te,St):te,P,h?Re(N,Xt):N);m[y]=je,k[y]=je-P}if(a){var Fe,Lt=y==="x"?_:J,Rt=y==="x"?ce:de,G=m[b],Ie=b==="y"?"height":"width",$e=G+v[Lt],Ge=G-v[Rt],Le=[_,J].indexOf(w)!==-1,ze=(Fe=L==null?void 0:L[b])!=null?Fe:0,Ue=Le?$e:G-x[Ie]-Y[Ie]-ze+X.altAxis,Ke=Le?G+x[Ie]+Y[Ie]-ze-X.altAxis:Ge,qe=h&&Le?ps(Ue,G,Ke):tt(h?Ue:$e,G,h?Ke:Ge);m[b]=qe,k[b]=qe-G}e.modifiersData[n]=k}}const Fs={name:"preventOverflow",enabled:!0,phase:"main",fn:js,requiresIfExists:["offset"]};function $s(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Gs(t){return t===se(t)||!re(t)?Gt(t):$s(t)}function zs(t){var e=t.getBoundingClientRect(),i=Me(e.width)/t.offsetWidth||1,n=Me(e.height)/t.offsetHeight||1;return i!==1||n!==1}function Us(t,e,i){i===void 0&&(i=!1);var n=re(e),o=re(e)&&zs(e),s=Ee(e),r=We(t,o,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&((ye(e)!=="body"||Ut(s))&&(a=Gs(e)),re(e)?(l=We(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=zt(s))),{x:r.left+a.scrollLeft-l.x,y:r.top+a.scrollTop-l.y,width:r.width,height:r.height}}function Ks(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 r=[].concat(s.requires||[],s.requiresIfExists||[]);r.forEach(function(a){if(!i.has(a)){var l=e.get(a);l&&o(l)}}),n.push(s)}return t.forEach(function(s){i.has(s.name)||o(s)}),n}function qs(t){var e=Ks(t);return rs.reduce(function(i,n){return i.concat(e.filter(function(o){return o.phase===n}))},[])}function _s(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}function Js(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 Ci={placement:"bottom",modifiers:[],strategy:"absolute"};function Oi(){for(var t=arguments.length,e=new Array(t),i=0;i{this.currentActiveIndex=e,this.currentOrientation=i;const n=jo(this.hotspotsConfig,e,i);this.hideHotspots(),n.forEach(o=>this.updateAndShowHotspot(o,e))});this.container=i,this.popper=null,this.popperInstance=null,this.hotspotsContainer=xo(this.container),this.hotspotsConfig=Uo(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=Ko({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:Go(this.container)};this.popper=zo(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={...ta(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,r=Fo(i);s&&(r.style.cursor="pointer"),r.onclick=a=>{a.stopPropagation(),s==null||s(a,this.popperInstance,i)},n&&r.addEventListener("mouseenter",()=>this.showPopper({hotspotElement:r,content:n,id:i,keepOpen:o})),this.hotspotsContainer.appendChild(r)}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:r}=n[i]??{},a=this.hotspotsContainer.querySelector(`[data-hotspot-id="${o}"]`);a&&(a.style.translate=`${s}px ${r}px`,a.style.opacity=1,a.style.pointerEvents="all")}createAllHotspots(){this.hotspotsConfig.forEach(e=>this.createHotspot(e))}initHotspots(){this.createAllHotspots()}destroy(){this.resizeObserver.disconnect(),this.hidePopper(),this.hotspotsContainer.innerHTML=""}}class xt{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=Ho(),this.canvasWorker=new No,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=Bo({deltaX:n,deltaY:o,reversed:this.dragReverse,allowSpinX:this.allowSpinX,allowSpinY:this.allowSpinY})||this.draggingDirection;const s=this.fullscreenView?document.body:this.container,r=this.dragSpeed/50,a=r*(this.amountX/s.offsetWidth),l=r*(this.amountY/s.offsetHeight),c=this.allowSpinX?Math.abs(Math.round(n*a)):0,d=this.allowSpinY?Math.abs(Math.round(o*l)):0;(this.allowSpinX&&c!==0||this.allowSpinY&&d!==0)&&(this.hideHotspotPopper(),this.onMoveHandler(this.draggingDirection,c,d),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=Qe(this.srcXConfig,e),o=this.allowSpinY?Qe(this.srcYConfig,e):null;li({cdnPathX:n,cdnPathY:o,configX:this.srcXConfig,configY:this.srcYConfig,onAllImagesLoad:(s,r)=>{this.imagesX=s,this.imagesY=r,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}=To(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(fi(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;fi(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 ia(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(),Zo(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=no(i,o);this.showLoadingSpinner(),this.createGlass(),Xo(s,a=>{this.hideLoadingSpinner(),this.magnified=!0,Ro(e,this.innerBox,this.offset,a,this.glass,this.magnifier)})}openFullscreenModal(e){e.stopPropagation();const i=yo(this.container);new xt(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&&Po({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse})){this.stopAutoplay();return}Ao({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse,spinDirection:this.spinDirection})&&(this.spinDirection=Wo(this.spinDirection));const s=this.spinDirection==="y";ko({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=ro(),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=vo(),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=po(),this.fullscreenIcon.onclick=this.openFullscreenModal.bind(this),this.iconsContainer.appendChild(this.fullscreenIcon))}addCloseFullscreenIcon(){this.fullscreenCloseIcon=ho(),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=ao(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=bo(),this.innerBox.appendChild(this.loadingSpinner)}showLoadingSpinner(){this.loadingSpinner&&(this.hideAllIcons(),this.loadingSpinner.style.opacity=1)}createTransitionOverlay(){this.transitionOverlay=wo(),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=si(this.mouseMove.bind(this),ai),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=si(this.touchMove.bind(this),ai),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=ci(this.innerBox),this.canvas=lo(this.innerBox,e),this.loader=go(this.innerBox);const i=this.canvas.transferControlToOffscreen();this.canvasWorker.postMessage({action:"initCanvas",offscreen:i,devicePixelRatio:this.devicePixelRatio},[i]),this.fullscreenView&&this.addCloseFullscreenIcon(),Mt(this.innerBox,".cloudimage-360-placeholder")}update(e){this.isReady&&(this.stopAutoplay(),Mt(this.innerBox,".cloudimage-360-icons-container"),this.init(this.container,e,!0),this.iconsContainer=ci(this.innerBox),this.onAllImagesLoaded())}init(e,i,n){const o=i?_n(i):qn(e),{folder:s,apiVersion:r,filenameX:a,filenameY:l,imageListX:c,imageListY:d,indexZeroBase:u,amountX:p,amountY:h,draggable:g=!0,swipeable:f=!0,keys:v,keysReverse:w,bottomCircleOffset:O,autoplay:E,autoplayBehavior:y,playOnce:b,speed:m,autoplayReverse:x,fullscreen:Y,magnifier:S,ciToken:X,ciFilters:L,ciTransformation:k,lazyload:R,dragSpeed:Z,stopAtEdges:D,pointerZoom:T,imageInfo:P="black",initialIconShown:te,bottomCircle:N,hotspots:ie,dragReverse:pe}=o,V={ciToken:X,ciFilters:L,ciTransformation:k},j=c?JSON.parse(c):[],M=d?JSON.parse(d):[];if(this.viewerConfig=o,this.amountX=j.length||p,this.amountY=M.length||h,this.allowSpinX=!!this.amountX,this.allowSpinY=!!this.amountY,this.activeImageX=x?this.amountX-1:0,this.activeImageY=x?this.amountY-1:0,this.bottomCircleOffset=O,this.autoplay=E,this.autoplayBehavior=y,this.playOnce=b,this.speed=m,this.autoplayReverse=x,this.fullscreen=Y,this.magnifier=S>1?Math.min(S,5):0,this.dragSpeed=Math.max(Z,50),this.stopAtEdges=D,this.ciParams=V,this.apiVersion=r,this.pointerZoom=T>1?Math.min(T,5):null,this.keysReverse=w,this.info=P,this.keys=v,this.innerBox=this.innerBox??fo(this.container),this.initialIconShown=te,this.bottomCircle=N,this.spinDirection=Mo(this.autoplayBehavior,this.allowSpinX,this.allowSpinY),this.dragReverse=pe,this.hotspots=ie,this.srcXConfig={folder:s,filename:a,imageList:j,container:e,innerBox:this.innerBox,apiVersion:r,ciParams:V,lazyload:R,amount:this.amountX,indexZeroBase:u,autoplayReverse:x},this.srcYConfig={...this.srcXConfig,filename:l,imageList:M,orientation:K.Y,amount:this.amountY},n&&this.removeEvents(),this.attachEvents(g,f,v),n)return;const A=(this.fullscreenView?document.body:this.container).offsetWidth,F=this.allowSpinX&&!j.length?Qe(this.srcXConfig,A):null,$=this.allowSpinY&&!M.length?Qe(this.srcYConfig,A):null,W=xe=>{li({cdnPathX:F,cdnPathY:$,configX:this.srcXConfig,configY:this.srcYConfig,onImageLoad:(fe,me,Xe)=>this.onImageLoad(fe,me,Xe),onFirstImageLoad:fe=>this.onFirstImageLoaded(xe,fe),onAllImagesLoad:this.onAllImagesLoaded.bind(this)})};this.allowSpinX?hi(F,this.srcXConfig,W):this.allowSpinY&&hi($,this.srcYConfig,W)}}class hn{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 xt(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 xt(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(Jn(n.viewerConfig,i)){n.destroy();const r=document.getElementById(e);this.init(r,o)}else n.update(o);return n}}window.CI360=hn;var na=Object.defineProperty,oa=(t,e,i)=>e in t?na(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,sa=(t,e,i)=>oa(t,e+"",i),mt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function aa(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var un="Expected a function",Ei=NaN,ra="[object Symbol]",la=/^\s+|\s+$/g,ca=/^[-+]0x[0-9a-f]+$/i,da=/^0b[01]+$/i,ha=/^0o[0-7]+$/i,ua=parseInt,pa=typeof mt=="object"&&mt&&mt.Object===Object&&mt,fa=typeof self=="object"&&self&&self.Object===Object&&self,ma=pa||fa||Function("return this")(),va=Object.prototype,ga=va.toString,ya=Math.max,ba=Math.min,Pt=function(){return ma.Date.now()};function wa(t,e,i){var n,o,s,r,a,l,c=0,d=!1,u=!1,p=!0;if(typeof t!="function")throw new TypeError(un);e=Yi(e)||0,It(i)&&(d=!!i.leading,u="maxWait"in i,s=u?ya(Yi(i.maxWait)||0,e):s,p="trailing"in i?!!i.trailing:p);function h(m){var x=n,Y=o;return n=o=void 0,c=m,r=t.apply(Y,x),r}function g(m){return c=m,a=setTimeout(w,e),d?h(m):r}function f(m){var x=m-l,Y=m-c,S=e-x;return u?ba(S,s-Y):S}function v(m){var x=m-l,Y=m-c;return l===void 0||x>=e||x<0||u&&Y>=s}function w(){var m=Pt();if(v(m))return O(m);a=setTimeout(w,f(m))}function O(m){return a=void 0,p&&n?h(m):(n=o=void 0,r)}function E(){a!==void 0&&clearTimeout(a),c=0,n=l=o=a=void 0}function y(){return a===void 0?r:O(Pt())}function b(){var m=Pt(),x=v(m);if(n=arguments,o=this,l=m,x){if(a===void 0)return g(l);if(u)return a=setTimeout(w,e),h(l)}return a===void 0&&(a=setTimeout(w,e)),r}return b.cancel=E,b.flush=y,b}function xa(t,e,i){var n=!0,o=!0;if(typeof t!="function")throw new TypeError(un);return It(i)&&(n="leading"in i?!!i.leading:n,o="trailing"in i?!!i.trailing:o),wa(t,e,{leading:n,maxWait:e,trailing:o})}function It(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Ia(t){return!!t&&typeof t=="object"}function Ca(t){return typeof t=="symbol"||Ia(t)&&ga.call(t)==ra}function Yi(t){if(typeof t=="number")return t;if(Ca(t))return Ei;if(It(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=It(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(la,"");var i=da.test(t);return i||ha.test(t)?ua(t.slice(2),i?2:8):ca.test(t)?Ei:+t}var Oa=xa;const Si=aa(Oa),U={SPIN_X:"spin-x",SPIN_Y:"spin-y",SPIN_XY:"spin-xy",SPIN_YX:"spin-yx"},Ea=[!1,0,null,void 0,"false","0","null","undefined"],q={X:"x-axis",Y:"y-axis",CENTER:"center"},Ya=["folder","folderX","folderY","filenameX","filenameY","imageListX","imageListY","indexZeroBase","amountX","amountY"],Sa=[37,39],Xa=[38,40],Xi=10,C={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:U.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},La=t=>({folder:H(t,"folder",C.folder),apiVersion:H(t,"api-version",C.apiVersion),filenameX:H(t,"filename")||H(t,"filename-x")||C.filenameX,filenameY:H(t,"filename-y",C.filenameY),imageListX:H(t,"image-list-x",C.imageListX),imageListY:H(t,"image-list-y",C.imageListY),indexZeroBase:parseInt(H(t,"index-zero-base",C.indexZeroBase),10),amountX:parseInt(H(t,"amount-x",C.amountX),10),amountY:parseInt(H(t,"amount-y",C.amountY),10),speed:parseInt(H(t,"speed",C.speed),10),dragSpeed:parseInt(H(t,"drag-speed",C.dragSpeed),10),draggable:oe(t,"draggable",C.draggable),swipeable:oe(t,"swipeable",C.swipeable),keys:oe(t,"keys",C.keys),keysReverse:oe(t,"keys-reverse",C.keysReverse),autoplay:oe(t,"autoplay",C.autoplay),autoplayBehavior:H(t,"autoplay-behavior",C.autoplayBehavior),playOnce:oe(t,"play-once",C.playOnce),autoplayReverse:oe(t,"autoplay-reverse",C.autoplayReverse),pointerZoom:parseFloat(H(t,"pointer-zoom",C.pointerZoom),10),fullscreen:oe(t,"fullscreen")||oe(t,"full-screen",C.fullscreen),magnifier:parseFloat(H(t,"magnifier",C.magnifier),10),bottomCircleOffset:parseInt(H(t,"bottom-circle-offset",C.bottomCircleOffset),10),ciToken:H(t,"responsive",C.ciToken),ciFilters:H(t,"filters",C.ciFilters),ciTransformation:H(t,"transformation",C.ciTransformation),lazyload:oe(t,"lazyload",C.lazyload),dragReverse:oe(t,"drag-reverse",C.dragReverse),stopAtEdges:oe(t,"stop-at-edges",C.stopAtEdges),imageInfo:oe(t,"info",C.imageInfo),initialIconShown:!Li(t,"initial-icon"),bottomCircle:!Li(t,"bottom-circle")}),Ra=t=>({folder:t.folder||C.folder,apiVersion:t.apiVersion||C.apiVersion,filenameX:t.filenameX||t.filename||C.filenameX,filenameY:t.filenameY||C.filenameY,imageListX:t.imageListX||C.imageListX,imageListY:t.imageListY||C.imageListY,indexZeroBase:parseInt(t.indexZeroBase??C.indexZeroBase,10),amountX:parseInt(t.amountX??C.amountX,10),amountY:parseInt(t.amountY??C.amountY,10),speed:parseInt(t.speed??C.speed,10),draggable:t.draggable??C.draggable,swipeable:t.swipeable??C.swipeable,dragSpeed:parseInt(t.dragSpeed??C.dragSpeed,10),keys:t.keys??C.keys,keysReverse:t.keysReverse??C.keysReverse,autoplay:t.autoplay??C.autoplay,autoplayBehavior:t.autoplayBehavior||C.autoplayBehavior,playOnce:t.playOnce??C.playOnce,autoplayReverse:t.autoplayReverse??C.autoplayReverse,pointerZoom:parseFloat(t.pointerZoom??C.pointerZoom,10),fullscreen:t.fullscreen??C.fullscreen,magnifier:parseFloat(t.magnifier??C.magnifier,10),bottomCircleOffset:parseInt(t.bottomCircleOffset??C.bottomCircleOffset,10),ciToken:t.ciToken||C.ciToken,ciFilters:t.ciFilters||C.ciFilters,ciTransformation:t.ciTransformation||C.ciTransformation,lazyload:t.lazyload??C.lazyload,dragReverse:t.dragReverse??C.dragReverse,stopAtEdges:t.stopAtEdges??C.stopAtEdges,imageInfo:t.imageInfo??C.imageInfo,initialIconShown:t.initialIconShown??C.initialIconShown,bottomCircle:t.bottomCircle??C.bottomCircle,hotspots:t.hotspots??C.hotspots}),H=(t,e,i)=>t.getAttribute(e)||t.getAttribute(`data-${e}`)||i,oe=(t,e,i)=>t.hasAttribute(e)||t.hasAttribute(`data-${e}`)||i,Li=(t,e)=>H(t,e,null)==="false",Ta=(t,e,i=Ya)=>i.some(n=>n in e&&e[n]!==t[n]),ka=(t=1)=>{const e=Math.round(window.devicePixelRatio||1);return parseInt(t)*e},Pa=(t,e,i)=>new URL(t).origin.includes("cloudimg")?t:`https://${e}.cloudimg.io/${i}${t}`,Aa=({ciTransformation:t,responsiveWidth:e,ciFilters:i})=>{const n=`width=${e}`,o=t||n,s=i?`&f=${i}`:"";return`${o}${s}`},et=(t,e)=>{const{folder:i,apiVersion:n,filename:o="",ciParams:s}=t,{ciToken:r,ciFilters:a,ciTransformation:l}=s||{},c=`${i}${o}`;if(!r)return c;const d=Ea.includes(n)?null:n,u=d?`${d}/`:"",p=ka(e),h=Pa(c,r,u),g=Aa({ciTransformation:l,responsiveWidth:p,ciFilters:a});return`${h}${g?"?":""}${g}`},Ma=(t,e,i)=>{const[n,o]=t.split("?"),s=`${e}=${encodeURIComponent(i)}`;if(!o)return`${n}?${s}`;const r=new URLSearchParams(o);return r.set(e,i),`${n}?${r.toString()}`},Wa=(t,e)=>Ma(t,"width",e),pn=(t,e=0)=>(t+="",t.length>=e?t:new Array(e-t.length+1).join("0")+t),Ba=(t,{amount:e=0,indexZeroBase:i=0}={})=>Array.from({length:e},(n,o)=>t.replace("{index}",pn(o+1,i))),Ha=({imagesUrls:t,onFirstImageLoad:e,onImageLoad:i,onAllImagesLoad:n,autoplayReverse:o})=>{let s=0;const r=t.length,a=[],l=(u,p)=>{const h=new Image;h.crossOrigin="anonymous",h.src=u,h.onload=async()=>{const g=await createImageBitmap(h),f={src:u,bitmapImage:g,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight};s++,a[p]=f,i==null||i(f,p),s===r&&(n==null||n(a))},h.onerror=()=>{console.error(`Failed to load image: ${u}`),s++,s===r&&(n==null||n(a))}},c=new Image,d=t[o?t.length-1:0];c.crossOrigin="anonymous",c.src=d,c.onload=async()=>{const u=await createImageBitmap(c),p={src:d,bitmapImage:u,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight};a[0]=p,s++,e==null||e(p),i==null||i(p,0);for(let h=1;h{console.error(`Failed to load first image: ${t[0]}`),s++;for(let u=1;u{let a={x:!1,y:!1},l=[],c=[];const d=t||i.imageList.length,u=e||n.imageList.length,p=()=>{a.x&&a.y&&r(l,c)},h=({cdnPath:g,config:f,orientation:v,loadedImages:w,onFirstImageLoad:O})=>{const E=v===q.X,y=f.imageList.length?f.imageList:Ba(g,f);Ha({imagesUrls:y,onFirstImageLoad:O,onImageLoad:(b,m)=>{s==null||s(b,m,v),w[m]=b},onAllImagesLoad:b=>{w=b,a[E?"x":"y"]=!0,p()},autoplayReverse:f.autoplayReverse})};d?h({cdnPath:t,config:i,orientation:q.X,loadedImages:l,onFirstImageLoad:o}):a.x=!0,u?h({cdnPath:e,config:n,orientation:q.Y,loadedImages:c,onFirstImageLoad:d?void 0:o}):a.y=!0},Za=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},Da=()=>{const t=document.createElement("div");return t.className="cloudimage-initial-icon",t.innerText="360°",t},Na=(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},Va="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",ja=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-close-icon",t.innerHTML=`close icon`,t},Fa="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",$a=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-fullscreen-button",t.innerHTML=`fullscreen icon`,t},Ti=t=>{const e=document.createElement("div");return e.className="cloudimage-360-icons-container",t.appendChild(e),e},Ga=t=>{const e=document.createElement("div");return e.className="cloudimage-360-inner-box",t.appendChild(e),e},za="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",Ua=()=>{const t=document.createElement("div");return t.className="cloudimage-360-button cloudimage-360-magnifier-button",t.innerHTML=`magnifier icon`,t},Ka=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},qa=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},Ht=(t,e)=>{const i=t.querySelector(e);i&&i.parentNode.removeChild(i)},_a=()=>{const t=document.createElement("div");return t.className="cloudimage-loading-spinner",t},Ja=()=>{const t=document.createElement("div");return t.className="cloudimage-360-transition-overlay",t},Qa=t=>{const e=document.createElement("div");return e.className="cloudimage-360-hotspot-container",t.appendChild(e),e},er=(t,e)=>{const[i,n]=t.split("?");if(!n)return t;const o=new RegExp(`^${e}=|&${e}=`),s=n.split("&").filter(r=>!o.test(r)).join("&");return s?`${i}?${s}`:i},tr=t=>{const e=er(t,"width"),i=e.includes("?")?"&":"?";return`${e}${i}width=${150*devicePixelRatio}`},ir=t=>{const e={root:null,rootMargin:"0px",threshold:.1},i=n=>{const o=n.getAttribute("data-src");o&&(n.src=o)};new IntersectionObserver((n,o)=>{n.forEach(s=>{s.isIntersecting&&(i(s.target),o.unobserve(s.target))})},e).observe(t)},nr=(t,e)=>{const i=pn(1,e);return t.replace("{index}",i)},or=(t,e)=>{const[i]=t,n=/(https?):\/\//i.test(i);return et({...e,folder:n?"":e.folder,filename:i})},sr=(t,e)=>{const{imageList:i,indexZeroBase:n}=e;if(i.length)try{const o=JSON.parse(i);return or(o,e)}catch(o){console.error(`Wrong format in image-list attribute: ${o.message}`)}return nr(t,n)},ki=(t,e,i)=>{const n=new Image;return n.setAttribute(e?"data-src":"src",t),n.className=i,n.style.cssText=` + position: ${e?"absolute":"static"}; + width: 100%; + inset: 0; + height: 100%; + object-fit: contain; + object-position: center; + filter: blur(10px); + `,n},Pi=(t,e,i)=>{const{innerBox:n,imageList:o,lazyload:s}=e||{},[r]=o,a=r||sr(t,e),l=tr(a),c=ki(l,s,"cloudimage-lazy"),d=ki(l,!1,"cloudimage-360-placeholder"),u=p=>{Ht(n,".cloudimage-lazy"),i&&i({event:p,width:c.width,height:c.height,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight,src:l})};c.onload=u,n.appendChild(c),n.appendChild(d),ir(c)},ar=(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(){}},rr=(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}},At=(t,e,i)=>{const{container:n,w:o,h:s,zoom:r,bw:a,offsetX:l,offsetY:c}=e,d=rr(t,n);let u=d.x,p=d.y;u=Math.max(o/r,Math.min(u,n.offsetWidth-o/r)),p=Math.max(s/r,Math.min(p,n.offsetHeight-s/r)),i.style.left=`${u-o}px`,i.style.top=`${p-s}px`;const h=(u-l)*r-o+a,g=(p-c)*r-s+a;i.style.backgroundPosition=`-${h}px -${g}px`},lr=(t,e,i,n,o,s)=>{const{x:r=0,y:a=0}=i||{},l=(e.offsetWidth-r*2)*s,c=(e.offsetHeight-a*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=`${l}px ${c}px`;const d=3,u=o.offsetWidth/2,p=o.offsetHeight/2,h={container:e,w:u,h:p,zoom:s,bw:d,offsetX:r,offsetY:a};At(t,h,o);const g=v=>{At(v,h,o)},f=v=>{v.preventDefault(),At(v,h,o)};o.addEventListener("mousemove",g),e.addEventListener("mousemove",g),e.addEventListener("touchmove",f)},cr=(t,e,i)=>{const{clientX:n,clientY:o}=t,s=e.getBoundingClientRect(),r=e.width/(s.width*i),a=e.height/(s.height*i),l=(n-s.left)*r,c=(o-s.top)*a;return{offsetX:l,offsetY:c}},Ai=(t,{bottom:e,top:i})=>{t?e():i()},Mi=(t,{left:e,right:i})=>{t?e():i()},dr=({autoplayBehavior:t,spinY:e,reversed:i,loopTriggers:n})=>{switch(t){case U.SPIN_XY:case U.SPIN_YX:e?Ai(i,n):Mi(i,n);break;case U.SPIN_Y:Ai(i,n);break;case U.SPIN_X:default:Mi(i,n)}},hr=({autoplayBehavior:t,activeImageX:e,activeImageY:i,amountX:n,amountY:o,autoplayReverse:s})=>{const r=(a,l)=>{const c=l-1;return s?a===0:a===c};switch(t){case U.SPIN_XY:case U.SPIN_Y:return r(i,o);case U.SPIN_X:case U.SPIN_YX:default:return r(e,n)}},ur=({autoplayBehavior:t,activeImageX:e,activeImageY:i,amountX:n,amountY:o,autoplayReverse:s,spinDirection:r})=>{const a=e===(s?0:n-1),l=i===(s?0:o-1);return t===U.SPIN_XY||t===U.SPIN_YX?r==="x"&&a||r==="y"&&l:!1},pr=(t,e,i)=>{if(!i)return"x";if(!e)return"y";switch(t){case U.SPIN_XY:return"x";case U.SPIN_YX:return"y";case U.SPIN_Y:return"y";case U.SPIN_X:default:return"x"}},fr=t=>t==="x"?"y":"x",Wi=(t,e)=>{const i=[...Sa];return e?[...i,...Xa].includes(t):i.includes(t)},mr=({deltaX:t,deltaY:e,reversed:i,allowSpinX:n,allowSpinY:o,threshold:s=1})=>{const r=Math.abs(t),a=Math.abs(e);return n&&r-s>a?i?t>0?"left":"right":t>0?"right":"left":o&&a-s>r?i?e>0?"up":"down":e>0?"down":"up":null},vr=()=>"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,gr=(t,e=150)=>{let i;return function(...n){clearTimeout(i),i=setTimeout(()=>{t.apply(this,n)},e)}},fn="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHg9KGEsdCxlKT0+e2NvbnN0IHM9YS9lLG49dC9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sTz0oe3BvaW50ZXJYOmEscG9pbnRlclk6dCxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOnIsbmF0dXJhbEhlaWdodDpsfT1lO2xldCBnPWEvaSpyLXMvMix1PXQvYypsLW4vMjtjb25zdCBwPU1hdGgubWF4KDAsci1zKSxJPU1hdGgubWF4KDAsbC1uKTtyZXR1cm4gZz1NYXRoLm1heCgwLE1hdGgubWluKGcscCkpLHU9TWF0aC5tYXgoMCxNYXRoLm1pbih1LEkpKSx7em9vbU9mZnNldFg6Zyx6b29tT2Zmc2V0WTp1fX07bGV0IG8sbSxmLGgsZCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIGE9Pntjb25zdHthY3Rpb246dCxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpyLGltYWdlQXNwZWN0UmF0aW86bCxjb250YWluZXJXaWR0aDpnLGNvbnRhaW5lckhlaWdodDp1fT1hLmRhdGE7c3dpdGNoKHQpe2Nhc2UiaW5pdENhbnZhcyI6dihlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjp6KGwsZyx1KTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpDKG4saSxjLHIpO2JyZWFrfX07Y29uc3Qgdj0oYSx0KT0+e289YSxtPW8uZ2V0Q29udGV4dCgiMmQiKSxmPXR9LHo9KGEsdCxlKT0+e2NvbnN0IHM9dC9lO3c9YT5zLG8ud2lkdGg9dCpmLG8uaGVpZ2h0PWUqZixtLnNjYWxlKGYsZiksdz8oaD10LGQ9dC9hKTooZD1lLGg9ZSphKSxtLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxtLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEM9KGE9e30sdD0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09YTtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L2YtZCkvMik6KGk9KG8ud2lkdGgvZi1oKS8yLGM9MCksbS5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLHQhPT0xKXtjb25zdHt6b29tZWRXaWR0aDpyLHpvb21lZEhlaWdodDpsfT14KGgsZCx0KSx7em9vbU9mZnNldFg6Zyx6b29tT2Zmc2V0WTp1fT1PKHtwb2ludGVyWDplLHBvaW50ZXJZOnMsaW1hZ2VEYXRhOmEsem9vbWVkV2lkdGg6cix6b29tZWRIZWlnaHQ6bCxkcmF3V2lkdGg6aCxkcmF3SGVpZ2h0OmR9KTttLmRyYXdJbWFnZShuLGcsdSxyLGwsaSxjLGgsZCl9ZWxzZSBtLmRyYXdJbWFnZShuLGksYyxoLGQpfX0pKCk7Cg==",yr=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),Bi=typeof self<"u"&&self.Blob&&new Blob([yr(fn)],{type:"text/javascript;charset=utf-8"});function br(t){let e;try{if(e=Bi&&(self.URL||self.webkitURL).createObjectURL(Bi),!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,"+fn,{name:t==null?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}const wr=t=>t==="x"?q.X:q.Y,xr=(t,e,i)=>t.filter(n=>wr(n.orientation)===i&&e in n.positions),Ir=t=>{const e=document.createElement("span");return e.id=t,e.className="cloudimage-360-hotspot",e.dataset.hotspotId=t,e},Cr=t=>{const e=Object.entries(t).sort(([s],[r])=>Number(s)-Number(r));let i=null,n=null;const o={};for(const[s,r]of e)if(!r)o[s]={x:i,y:n};else{const{x:a,y:l}=r;a!=null&&(i=a),l!=null&&(n=l),o[s]={x:a||i,y:l||n}}return o},Or=t=>[{name:"offset",options:{offset:[0,10]}},{name:"preventOverflow",options:{boundary:t}}],Er=(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},Yr=t=>{const e=[...t];return e.forEach((i,n)=>{const o={...Cr(i.positions)};e[n].initialPositions=o,e[n].positions=o}),e},Sr=({newWidth:t,newHeight:e,initialContainerSize:i,imageAspectRatio:n,hotspotsConfig:o})=>{const[s,r]=i;let a=t,l=e,c=0,d=0;const u=t/e;n>u?(l=t/n,d=(e-l)/2):(a=e*n,c=(t-a)/2);const p=a/s,h=l/r;return o.map(g=>{const f={};return Object.entries(g.initialPositions).forEach(([v,w])=>{f[v]={x:w.x*p+c,y:w.y*h+d}}),{...g,positions:f}})};var Q="top",he="bottom",ue="right",ee="left",Kt="auto",ht=[Q,he,ue,ee],He="start",rt="end",Xr="clippingParents",mn="viewport",Je="popper",Lr="reference",Hi=ht.reduce(function(t,e){return t.concat([e+"-"+He,e+"-"+rt])},[]),vn=[].concat(ht,[Kt]).reduce(function(t,e){return t.concat([e,e+"-"+He,e+"-"+rt])},[]),Rr="beforeRead",Tr="read",kr="afterRead",Pr="beforeMain",Ar="main",Mr="afterMain",Wr="beforeWrite",Br="write",Hr="afterWrite",Zr=[Rr,Tr,kr,Pr,Ar,Mr,Wr,Br,Hr];function be(t){return t?(t.nodeName||"").toLowerCase():null}function ae(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Pe(t){var e=ae(t).Element;return t instanceof e||t instanceof Element}function le(t){var e=ae(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function qt(t){if(typeof ShadowRoot>"u")return!1;var e=ae(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Dr(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];!le(s)||!be(s)||(Object.assign(s.style,n),Object.keys(o).forEach(function(r){var a=o[r];a===!1?s.removeAttribute(r):s.setAttribute(r,a===!0?"":a)}))})}function Nr(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]||{},r=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:i[n]),a=r.reduce(function(l,c){return l[c]="",l},{});!le(o)||!be(o)||(Object.assign(o.style,a),Object.keys(s).forEach(function(l){o.removeAttribute(l)}))})}}const Vr={name:"applyStyles",enabled:!0,phase:"write",fn:Dr,effect:Nr,requires:["computeStyles"]};function ge(t){return t.split("-")[0]}var Te=Math.max,Ct=Math.min,Ze=Math.round;function Zt(){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 gn(){return!/^((?!chrome|android).)*safari/i.test(Zt())}function De(t,e,i){e===void 0&&(e=!1),i===void 0&&(i=!1);var n=t.getBoundingClientRect(),o=1,s=1;e&&le(t)&&(o=t.offsetWidth>0&&Ze(n.width)/t.offsetWidth||1,s=t.offsetHeight>0&&Ze(n.height)/t.offsetHeight||1);var r=Pe(t)?ae(t):window,a=r.visualViewport,l=!gn()&&i,c=(n.left+(l&&a?a.offsetLeft:0))/o,d=(n.top+(l&&a?a.offsetTop:0))/s,u=n.width/o,p=n.height/s;return{width:u,height:p,top:d,right:c+u,bottom:d+p,left:c,x:c,y:d}}function _t(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 yn(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&qt(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Oe(t){return ae(t).getComputedStyle(t)}function jr(t){return["table","td","th"].indexOf(be(t))>=0}function Ye(t){return((Pe(t)?t.ownerDocument:t.document)||window.document).documentElement}function Yt(t){return be(t)==="html"?t:t.assignedSlot||t.parentNode||(qt(t)?t.host:null)||Ye(t)}function Zi(t){return!le(t)||Oe(t).position==="fixed"?null:t.offsetParent}function Fr(t){var e=/firefox/i.test(Zt()),i=/Trident/i.test(Zt());if(i&&le(t)){var n=Oe(t);if(n.position==="fixed")return null}var o=Yt(t);for(qt(o)&&(o=o.host);le(o)&&["html","body"].indexOf(be(o))<0;){var s=Oe(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 ut(t){for(var e=ae(t),i=Zi(t);i&&jr(i)&&Oe(i).position==="static";)i=Zi(i);return i&&(be(i)==="html"||be(i)==="body"&&Oe(i).position==="static")?e:i||Fr(t)||e}function Jt(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function nt(t,e,i){return Te(t,Ct(e,i))}function $r(t,e,i){var n=nt(t,e,i);return n>i?i:n}function bn(){return{top:0,right:0,bottom:0,left:0}}function wn(t){return Object.assign({},bn(),t)}function xn(t,e){return e.reduce(function(i,n){return i[n]=t,i},{})}var Gr=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,wn(typeof t!="number"?t:xn(t,ht))};function zr(t){var e,i=t.state,n=t.name,o=t.options,s=i.elements.arrow,r=i.modifiersData.popperOffsets,a=ge(i.placement),l=Jt(a),c=[ee,ue].indexOf(a)>=0,d=c?"height":"width";if(!(!s||!r)){var u=Gr(o.padding,i),p=_t(s),h=l==="y"?Q:ee,g=l==="y"?he:ue,f=i.rects.reference[d]+i.rects.reference[l]-r[l]-i.rects.popper[d],v=r[l]-i.rects.reference[l],w=ut(s),O=w?l==="y"?w.clientHeight||0:w.clientWidth||0:0,E=f/2-v/2,y=u[h],b=O-p[d]-u[g],m=O/2-p[d]/2+E,x=nt(y,m,b),Y=l;i.modifiersData[n]=(e={},e[Y]=x,e.centerOffset=x-m,e)}}function Ur(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)||yn(e.elements.popper,o)&&(e.elements.arrow=o))}const Kr={name:"arrow",enabled:!0,phase:"main",fn:zr,effect:Ur,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ne(t){return t.split("-")[1]}var qr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function _r(t,e){var i=t.x,n=t.y,o=e.devicePixelRatio||1;return{x:Ze(i*o)/o||0,y:Ze(n*o)/o||0}}function Di(t){var e,i=t.popper,n=t.popperRect,o=t.placement,s=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,u=t.isFixed,p=r.x,h=p===void 0?0:p,g=r.y,f=g===void 0?0:g,v=typeof d=="function"?d({x:h,y:f}):{x:h,y:f};h=v.x,f=v.y;var w=r.hasOwnProperty("x"),O=r.hasOwnProperty("y"),E=ee,y=Q,b=window;if(c){var m=ut(i),x="clientHeight",Y="clientWidth";if(m===ae(i)&&(m=Ye(i),Oe(m).position!=="static"&&a==="absolute"&&(x="scrollHeight",Y="scrollWidth")),m=m,o===Q||(o===ee||o===ue)&&s===rt){y=he;var S=u&&m===b&&b.visualViewport?b.visualViewport.height:m[x];f-=S-n.height,f*=l?1:-1}if(o===ee||(o===Q||o===he)&&s===rt){E=ue;var X=u&&m===b&&b.visualViewport?b.visualViewport.width:m[Y];h-=X-n.width,h*=l?1:-1}}var L=Object.assign({position:a},c&&qr),k=d===!0?_r({x:h,y:f},ae(i)):{x:h,y:f};if(h=k.x,f=k.y,l){var R;return Object.assign({},L,(R={},R[y]=O?"0":"",R[E]=w?"0":"",R.transform=(b.devicePixelRatio||1)<=1?"translate("+h+"px, "+f+"px)":"translate3d("+h+"px, "+f+"px, 0)",R))}return Object.assign({},L,(e={},e[y]=O?f+"px":"",e[E]=w?h+"px":"",e.transform="",e))}function Jr(t){var e=t.state,i=t.options,n=i.gpuAcceleration,o=n===void 0?!0:n,s=i.adaptive,r=s===void 0?!0:s,a=i.roundOffsets,l=a===void 0?!0:a,c={placement:ge(e.placement),variation:Ne(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,Di(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Di(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Qr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Jr,data:{}};var vt={passive:!0};function el(t){var e=t.state,i=t.instance,n=t.options,o=n.scroll,s=o===void 0?!0:o,r=n.resize,a=r===void 0?!0:r,l=ae(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(d){d.addEventListener("scroll",i.update,vt)}),a&&l.addEventListener("resize",i.update,vt),function(){s&&c.forEach(function(d){d.removeEventListener("scroll",i.update,vt)}),a&&l.removeEventListener("resize",i.update,vt)}}const tl={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:el,data:{}};var il={left:"right",right:"left",bottom:"top",top:"bottom"};function yt(t){return t.replace(/left|right|bottom|top/g,function(e){return il[e]})}var nl={start:"end",end:"start"};function Ni(t){return t.replace(/start|end/g,function(e){return nl[e]})}function Qt(t){var e=ae(t),i=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:i,scrollTop:n}}function ei(t){return De(Ye(t)).left+Qt(t).scrollLeft}function ol(t,e){var i=ae(t),n=Ye(t),o=i.visualViewport,s=n.clientWidth,r=n.clientHeight,a=0,l=0;if(o){s=o.width,r=o.height;var c=gn();(c||!c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:r,x:a+ei(t),y:l}}function sl(t){var e,i=Ye(t),n=Qt(t),o=(e=t.ownerDocument)==null?void 0:e.body,s=Te(i.scrollWidth,i.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),r=Te(i.scrollHeight,i.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-n.scrollLeft+ei(t),l=-n.scrollTop;return Oe(o||i).direction==="rtl"&&(a+=Te(i.clientWidth,o?o.clientWidth:0)-s),{width:s,height:r,x:a,y:l}}function ti(t){var e=Oe(t),i=e.overflow,n=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+o+n)}function In(t){return["html","body","#document"].indexOf(be(t))>=0?t.ownerDocument.body:le(t)&&ti(t)?t:In(Yt(t))}function ot(t,e){var i;e===void 0&&(e=[]);var n=In(t),o=n===((i=t.ownerDocument)==null?void 0:i.body),s=ae(n),r=o?[s].concat(s.visualViewport||[],ti(n)?n:[]):n,a=e.concat(r);return o?a:a.concat(ot(Yt(r)))}function Dt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function al(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 Vi(t,e,i){return e===mn?Dt(ol(t,i)):Pe(e)?al(e,i):Dt(sl(Ye(t)))}function rl(t){var e=ot(Yt(t)),i=["absolute","fixed"].indexOf(Oe(t).position)>=0,n=i&&le(t)?ut(t):t;return Pe(n)?e.filter(function(o){return Pe(o)&&yn(o,n)&&be(o)!=="body"}):[]}function ll(t,e,i,n){var o=e==="clippingParents"?rl(t):[].concat(e),s=[].concat(o,[i]),r=s[0],a=s.reduce(function(l,c){var d=Vi(t,c,n);return l.top=Te(d.top,l.top),l.right=Ct(d.right,l.right),l.bottom=Ct(d.bottom,l.bottom),l.left=Te(d.left,l.left),l},Vi(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Cn(t){var e=t.reference,i=t.element,n=t.placement,o=n?ge(n):null,s=n?Ne(n):null,r=e.x+e.width/2-i.width/2,a=e.y+e.height/2-i.height/2,l;switch(o){case Q:l={x:r,y:e.y-i.height};break;case he:l={x:r,y:e.y+e.height};break;case ue:l={x:e.x+e.width,y:a};break;case ee:l={x:e.x-i.width,y:a};break;default:l={x:e.x,y:e.y}}var c=o?Jt(o):null;if(c!=null){var d=c==="y"?"height":"width";switch(s){case He:l[c]=l[c]-(e[d]/2-i[d]/2);break;case rt:l[c]=l[c]+(e[d]/2-i[d]/2);break}}return l}function lt(t,e){e===void 0&&(e={});var i=e,n=i.placement,o=n===void 0?t.placement:n,s=i.strategy,r=s===void 0?t.strategy:s,a=i.boundary,l=a===void 0?Xr:a,c=i.rootBoundary,d=c===void 0?mn:c,u=i.elementContext,p=u===void 0?Je:u,h=i.altBoundary,g=h===void 0?!1:h,f=i.padding,v=f===void 0?0:f,w=wn(typeof v!="number"?v:xn(v,ht)),O=p===Je?Lr:Je,E=t.rects.popper,y=t.elements[g?O:p],b=ll(Pe(y)?y:y.contextElement||Ye(t.elements.popper),l,d,r),m=De(t.elements.reference),x=Cn({reference:m,element:E,strategy:"absolute",placement:o}),Y=Dt(Object.assign({},E,x)),S=p===Je?Y:m,X={top:b.top-S.top+w.top,bottom:S.bottom-b.bottom+w.bottom,left:b.left-S.left+w.left,right:S.right-b.right+w.right},L=t.modifiersData.offset;if(p===Je&&L){var k=L[o];Object.keys(X).forEach(function(R){var Z=[ue,he].indexOf(R)>=0?1:-1,D=[Q,he].indexOf(R)>=0?"y":"x";X[R]+=k[D]*Z})}return X}function cl(t,e){e===void 0&&(e={});var i=e,n=i.placement,o=i.boundary,s=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=l===void 0?vn:l,d=Ne(n),u=d?a?Hi:Hi.filter(function(g){return Ne(g)===d}):ht,p=u.filter(function(g){return c.indexOf(g)>=0});p.length===0&&(p=u);var h=p.reduce(function(g,f){return g[f]=lt(t,{placement:f,boundary:o,rootBoundary:s,padding:r})[ge(f)],g},{});return Object.keys(h).sort(function(g,f){return h[g]-h[f]})}function dl(t){if(ge(t)===Kt)return[];var e=yt(t);return[Ni(t),e,Ni(e)]}function hl(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,r=i.altAxis,a=r===void 0?!0:r,l=i.fallbackPlacements,c=i.padding,d=i.boundary,u=i.rootBoundary,p=i.altBoundary,h=i.flipVariations,g=h===void 0?!0:h,f=i.allowedAutoPlacements,v=e.options.placement,w=ge(v),O=w===v,E=l||(O||!g?[yt(v)]:dl(v)),y=[v].concat(E).reduce(function(M,A){return M.concat(ge(A)===Kt?cl(e,{placement:A,boundary:d,rootBoundary:u,padding:c,flipVariations:g,allowedAutoPlacements:f}):A)},[]),b=e.rects.reference,m=e.rects.popper,x=new Map,Y=!0,S=y[0],X=0;X=0,D=Z?"width":"height",T=lt(e,{placement:L,boundary:d,rootBoundary:u,altBoundary:p,padding:c}),P=Z?R?ue:ee:R?he:Q;b[D]>m[D]&&(P=yt(P));var te=yt(P),N=[];if(s&&N.push(T[k]<=0),a&&N.push(T[P]<=0,T[te]<=0),N.every(function(M){return M})){S=L,Y=!1;break}x.set(L,N)}if(Y)for(var ie=g?3:1,pe=function(M){var A=y.find(function(F){var $=x.get(F);if($)return $.slice(0,M).every(function(W){return W})});if(A)return S=A,"break"},V=ie;V>0;V--){var j=pe(V);if(j==="break")break}e.placement!==S&&(e.modifiersData[n]._skip=!0,e.placement=S,e.reset=!0)}}const ul={name:"flip",enabled:!0,phase:"main",fn:hl,requiresIfExists:["offset"],data:{_skip:!1}};function ji(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 Fi(t){return[Q,ue,he,ee].some(function(e){return t[e]>=0})}function pl(t){var e=t.state,i=t.name,n=e.rects.reference,o=e.rects.popper,s=e.modifiersData.preventOverflow,r=lt(e,{elementContext:"reference"}),a=lt(e,{altBoundary:!0}),l=ji(r,n),c=ji(a,o,s),d=Fi(l),u=Fi(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}const fl={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:pl};function ml(t,e,i){var n=ge(t),o=[ee,Q].indexOf(n)>=0?-1:1,s=typeof i=="function"?i(Object.assign({},e,{placement:t})):i,r=s[0],a=s[1];return r=r||0,a=(a||0)*o,[ee,ue].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}function vl(t){var e=t.state,i=t.options,n=t.name,o=i.offset,s=o===void 0?[0,0]:o,r=vn.reduce(function(d,u){return d[u]=ml(u,e.rects,s),d},{}),a=r[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}const gl={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:vl};function yl(t){var e=t.state,i=t.name;e.modifiersData[i]=Cn({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const bl={name:"popperOffsets",enabled:!0,phase:"read",fn:yl,data:{}};function wl(t){return t==="x"?"y":"x"}function xl(t){var e=t.state,i=t.options,n=t.name,o=i.mainAxis,s=o===void 0?!0:o,r=i.altAxis,a=r===void 0?!1:r,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,u=i.padding,p=i.tether,h=p===void 0?!0:p,g=i.tetherOffset,f=g===void 0?0:g,v=lt(e,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),w=ge(e.placement),O=Ne(e.placement),E=!O,y=Jt(w),b=wl(y),m=e.modifiersData.popperOffsets,x=e.rects.reference,Y=e.rects.popper,S=typeof f=="function"?f(Object.assign({},e.rects,{placement:e.placement})):f,X=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),L=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,k={x:0,y:0};if(m){if(s){var R,Z=y==="y"?Q:ee,D=y==="y"?he:ue,T=y==="y"?"height":"width",P=m[y],te=P+v[Z],N=P-v[D],ie=h?-Y[T]/2:0,pe=O===He?x[T]:Y[T],V=O===He?-Y[T]:-x[T],j=e.elements.arrow,M=h&&j?_t(j):{width:0,height:0},A=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:bn(),F=A[Z],$=A[D],W=nt(0,x[T],M[T]),xe=E?x[T]/2-ie-W-F-X.mainAxis:pe-W-F-X.mainAxis,fe=E?-x[T]/2+ie+W+$+X.mainAxis:V+W+$+X.mainAxis,me=e.elements.arrow&&ut(e.elements.arrow),Xe=me?y==="y"?me.clientTop||0:me.clientLeft||0:0,Ve=(R=L==null?void 0:L[y])!=null?R:0,St=P+xe-Ve-Xe,Xt=P+fe-Ve,je=nt(h?Ct(te,St):te,P,h?Te(N,Xt):N);m[y]=je,k[y]=je-P}if(a){var Fe,Lt=y==="x"?Q:ee,Rt=y==="x"?he:ue,G=m[b],Ie=b==="y"?"height":"width",$e=G+v[Lt],Ge=G-v[Rt],Le=[Q,ee].indexOf(w)!==-1,ze=(Fe=L==null?void 0:L[b])!=null?Fe:0,Ue=Le?$e:G-x[Ie]-Y[Ie]-ze+X.altAxis,Ke=Le?G+x[Ie]+Y[Ie]-ze-X.altAxis:Ge,qe=h&&Le?$r(Ue,G,Ke):nt(h?Ue:$e,G,h?Ke:Ge);m[b]=qe,k[b]=qe-G}e.modifiersData[n]=k}}const Il={name:"preventOverflow",enabled:!0,phase:"main",fn:xl,requiresIfExists:["offset"]};function Cl(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Ol(t){return t===ae(t)||!le(t)?Qt(t):Cl(t)}function El(t){var e=t.getBoundingClientRect(),i=Ze(e.width)/t.offsetWidth||1,n=Ze(e.height)/t.offsetHeight||1;return i!==1||n!==1}function Yl(t,e,i){i===void 0&&(i=!1);var n=le(e),o=le(e)&&El(e),s=Ye(e),r=De(t,o,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!i)&&((be(e)!=="body"||ti(s))&&(a=Ol(e)),le(e)?(l=De(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=ei(s))),{x:r.left+a.scrollLeft-l.x,y:r.top+a.scrollTop-l.y,width:r.width,height:r.height}}function Sl(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 r=[].concat(s.requires||[],s.requiresIfExists||[]);r.forEach(function(a){if(!i.has(a)){var l=e.get(a);l&&o(l)}}),n.push(s)}return t.forEach(function(s){i.has(s.name)||o(s)}),n}function Xl(t){var e=Sl(t);return Zr.reduce(function(i,n){return i.concat(e.filter(function(o){return o.phase===n}))},[])}function Ll(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}function Rl(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 $i={placement:"bottom",modifiers:[],strategy:"absolute"};function Gi(){for(var t=arguments.length,e=new Array(t),i=0;i{this.currentActiveIndex=s,this.currentOrientation=r;const a=xr(this.hotspotsConfig,s,r);this.hideHotspots(),a.forEach(l=>this.updateAndShowHotspot(l,s))}),this.container=i,this.popper=null,this.popperInstance=null,this.hotspotsContainer=Qa(this.container),this.hotspotsConfig=Yr(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=Sr({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:Or(this.container)};this.popper=Er(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={...Pl(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,r=Ir(i);s&&(r.style.cursor="pointer"),r.onclick=a=>{a.stopPropagation(),s==null||s(a,this.popperInstance,i)},n&&r.addEventListener("mouseenter",()=>this.showPopper({hotspotElement:r,content:n,id:i,keepOpen:o})),this.hotspotsContainer.appendChild(r)}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:r}=n[i]??{},a=this.hotspotsContainer.querySelector(`[data-hotspot-id="${o}"]`);a&&(a.style.translate=`${s}px ${r}px`,a.style.opacity=1,a.style.pointerEvents="all")}createAllHotspots(){this.hotspotsConfig.forEach(e=>this.createHotspot(e))}initHotspots(){this.createAllHotspots()}destroy(){this.resizeObserver.disconnect(),this.hidePopper(),this.hotspotsContainer.innerHTML=""}}class Ot{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=vr(),this.canvasWorker=new br,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=mr({deltaX:n,deltaY:o,reversed:this.dragReverse,allowSpinX:this.allowSpinX,allowSpinY:this.allowSpinY})||this.draggingDirection;const s=this.fullscreenView?document.body:this.container,r=this.dragSpeed/50,a=r*(this.amountX/s.offsetWidth),l=r*(this.amountY/s.offsetHeight),c=this.allowSpinX?Math.abs(Math.round(n*a)):0,d=this.allowSpinY?Math.abs(Math.round(o*l)):0;(this.allowSpinX&&c!==0||this.allowSpinY&&d!==0)&&(this.hideHotspotPopper(),this.onMoveHandler(this.draggingDirection,c,d),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=et(this.srcXConfig,e),o=this.allowSpinY?et(this.srcYConfig,e):null;Ri({cdnPathX:n,cdnPathY:o,configX:this.srcXConfig,configY:this.srcYConfig,onAllImagesLoad:(s,r)=>{this.imagesX=s,this.imagesY=r,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}=cr(e,this.canvas,this.devicePixelRatio);this.isZoomed=!0,this.hideAllIcons(),this.hideLoadingSpinner(),this.hideTransitionOverlay(),this.updateView(this.pointerZoom,i,n)}touchOutside(e){this.glass&&!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(Wi(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;Wi(i,this.allowSpinY)&&this.showAllIcons()}moveActiveXIndexUp(e){this.orientation=q.X,this.activeImageX=(this.activeImageX+e)%this.amountX}moveActiveXIndexDown(e){this.orientation=q.X,this.activeImageX=(this.activeImageX-e+this.amountX)%this.amountX}moveActiveYIndexUp(e){this.orientation=q.Y,this.activeImageY=(this.activeImageY+e)%this.amountY}moveActiveYIndexDown(e){this.orientation=q.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===q.X?this.activeImageX:this.activeImageY,s=this.orientation===q.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===q.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 Al(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(),gr(this.play.bind(this))())}magnify(e){e.stopPropagation();const{src:i}=this.orientation===q.Y?this.imagesY[this.activeImageY]:this.imagesX[this.activeImageX],n=(this.fullscreenView?document.body:this.container).offsetWidth*this.magnifier,o=Wa(i,n);this.showLoadingSpinner(),this.createGlass(),ar(o,s=>{this.hideLoadingSpinner(),this.magnified=!0,lr(e,this.innerBox,this.offset,s,this.glass,this.magnifier)})}openFullscreenModal(e){e.stopPropagation();const i=qa(this.container);new Ot(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&&hr({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse})){this.stopAutoplay();return}ur({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse,spinDirection:this.spinDirection})&&(this.spinDirection=fr(this.spinDirection));const n=this.spinDirection==="y";dr({autoplayBehavior:this.autoplayBehavior,spinY:n,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=Da(),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=Ua(),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=$a(),this.fullscreenIcon.onclick=this.openFullscreenModal.bind(this),this.iconsContainer.appendChild(this.fullscreenIcon))}addCloseFullscreenIcon(){this.fullscreenCloseIcon=ja(),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=Za(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=_a(),this.innerBox.appendChild(this.loadingSpinner)}showLoadingSpinner(){this.loadingSpinner&&(this.hideAllIcons(),this.loadingSpinner.style.opacity=1)}createTransitionOverlay(){this.transitionOverlay=Ja(),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=Si(this.mouseMove.bind(this),Xi),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=Si(this.touchMove.bind(this),Xi),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=Ti(this.innerBox),this.canvas=Na(this.innerBox,e),this.loader=Ka(this.innerBox);const i=this.canvas.transferControlToOffscreen();this.canvasWorker.postMessage({action:"initCanvas",offscreen:i,devicePixelRatio:this.devicePixelRatio},[i]),this.fullscreenView&&this.addCloseFullscreenIcon(),Ht(this.innerBox,".cloudimage-360-placeholder")}update(e){this.isReady&&(this.stopAutoplay(),Ht(this.innerBox,".cloudimage-360-icons-container"),this.init(this.container,e,!0),this.iconsContainer=Ti(this.innerBox),this.onAllImagesLoaded())}init(e,i,n){const o=i?Ra(i):La(e),{folder:s,apiVersion:r,filenameX:a,filenameY:l,imageListX:c,imageListY:d,indexZeroBase:u,amountX:p,amountY:h,draggable:g=!0,swipeable:f=!0,keys:v,keysReverse:w,bottomCircleOffset:O,autoplay:E,autoplayBehavior:y,playOnce:b,speed:m,autoplayReverse:x,fullscreen:Y,magnifier:S,ciToken:X,ciFilters:L,ciTransformation:k,lazyload:R,dragSpeed:Z,stopAtEdges:D,pointerZoom:T,imageInfo:P="black",initialIconShown:te,bottomCircle:N,hotspots:ie,dragReverse:pe}=o,V={ciToken:X,ciFilters:L,ciTransformation:k},j=c?JSON.parse(c):[],M=d?JSON.parse(d):[];if(this.viewerConfig=o,this.amountX=j.length||p,this.amountY=M.length||h,this.allowSpinX=!!this.amountX,this.allowSpinY=!!this.amountY,this.activeImageX=x?this.amountX-1:0,this.activeImageY=x?this.amountY-1:0,this.bottomCircleOffset=O,this.autoplay=E,this.autoplayBehavior=y,this.playOnce=b,this.speed=m,this.autoplayReverse=x,this.fullscreen=Y,this.magnifier=S>1?Math.min(S,5):0,this.dragSpeed=Math.max(Z,50),this.stopAtEdges=D,this.ciParams=V,this.apiVersion=r,this.pointerZoom=T>1?Math.min(T,5):null,this.keysReverse=w,this.info=P,this.keys=v,this.innerBox=this.innerBox??Ga(this.container),this.initialIconShown=te,this.bottomCircle=N,this.spinDirection=pr(this.autoplayBehavior,this.allowSpinX,this.allowSpinY),this.dragReverse=pe,this.hotspots=ie,this.srcXConfig={folder:s,filename:a,imageList:j,container:e,innerBox:this.innerBox,apiVersion:r,ciParams:V,lazyload:R,amount:this.amountX,indexZeroBase:u,autoplayReverse:x},this.srcYConfig={...this.srcXConfig,filename:l,imageList:M,orientation:q.Y,amount:this.amountY},n&&this.removeEvents(),this.attachEvents(g,f,v),n)return;const A=(this.fullscreenView?document.body:this.container).offsetWidth,F=this.allowSpinX&&!j.length?et(this.srcXConfig,A):null,$=this.allowSpinY&&!M.length?et(this.srcYConfig,A):null,W=xe=>{Ri({cdnPathX:F,cdnPathY:$,configX:this.srcXConfig,configY:this.srcYConfig,onImageLoad:(fe,me,Xe)=>this.onImageLoad(fe,me,Xe),onFirstImageLoad:fe=>this.onFirstImageLoaded(xe,fe),onAllImagesLoad:this.onAllImagesLoaded.bind(this)})};this.allowSpinX?Pi(F,this.srcXConfig,W):this.allowSpinY&&Pi($,this.srcYConfig,W)}}class Ml{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 Ot(e,i,n);return this.views.set(o,s),s}initAll(e="cloudimage-360"){[...document.querySelectorAll(`.${e}`)].filter(Boolean).forEach(i=>{const n=i.id||this.generateId();i.id||(i.id=n);const o=new Ot(i);this.views.set(n,o)})}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(Ta(n.viewerConfig,i)){n.destroy();const s=document.getElementById(e);this.init(s,o)}else n.update(o);return n}}window.CI360=Ml;const Wl=[{id:"hotspot-1",orientation:"x",containerSize:[1170,663],positions:{0:{x:527,y:319},1:{x:527,y:319},2:{x:527,y:null},3:{x:498,y:null},4:{x:470,y:null},5:{x:441,y:null},73:{x:555,y:null},72:{x:586,y:null},71:{x:614,y:null},70:{x:641,y:null},69:{x:668,y:null},68:{x:692,y:null},67:{x:715,y:null},66:{x:736,y:null},65:{x:756,y:null},64:{x:773,y:null},63:{x:787,y:null}},content:'
Info about Hotspot 1
'},{id:"hotspot-2",orientation:"x",containerSize:[1220,680],positions:{73:{x:355,y:474},74:{x:355,y:null},72:{x:341,y:479},71:{x:336,y:null},70:{x:332,y:null},69:{x:327,y:null},68:{x:326,y:null},67:{x:327,y:null},66:{x:331,y:null},65:{x:334,y:null},64:{x:336,y:null},63:{x:347,y:474}},content:'
Info about Hotspot 2
'},{id:"hotspot-3",orientation:"x",containerSize:[1220,680],positions:{11:{x:683,y:151},12:{x:683,y:null},13:{x:683,y:null},14:{x:683,y:null},15:{x:683,y:null},16:{x:683,y:null},17:{x:681,y:152},18:{x:677,y:156},19:{x:671,y:159},20:{x:665,y:163},21:{x:656,y:168},22:{x:650,y:171},23:{x:643,y:176},24:{x:635,y:178},25:{x:628,y:181},26:{x:621,y:null},27:{x:610,y:null},28:{x:598,y:null},29:{x:588,y:null},30:{x:578,y:null},31:{x:570,y:176},32:{x:560,y:173}},content:'
Info about Hotspot 3
'},{id:"hotspot-4",orientation:"x",containerSize:[1220,680],positions:{6:{x:607,y:246},7:{x:619,y:null},8:{x:630,y:null},9:{x:637,y:null},10:{x:642,y:null}},content:'
Info about Hotspot 4
'}],Bl={folder:"https://scaleflex.cloudimg.io/v7/demo/360-nike/",filenameX:"nike-{index}.jpg",filenameY:"nike-y-{index}.jpg",amountX:"35",amountY:"36",autoplayBehavior:"spin-xy"},Hl={folder:"https://scaleflex.cloudimg.io/v7/demo/earbuds/",filenameX:"{index}.jpg",amountX:"233",amountY:void 0,filenameY:void 0},zi={folder:{label:"data-folder",value:"https://scaleflex.cloudimg.io/v7/demo/earbuds/",isRequired:!0,isUrl:!0},filenameX:{label:"data-filename-x",value:"{index}.jpg"},filenameY:{label:"data-filename-y"},amountY:{label:"data-amount-y",isRequired:!1},amountX:{label:"data-amount-x",value:233,isRequired:!0},speed:{label:"data-speed",value:100,isRequired:!1},dragSpeed:{label:"data-drag-speed",value:120,isRequired:!1},autoplay:{label:"data-autoplay",isRequired:!1},pointerZoom:{label:"data-pointer-zoom",value:1.5,isRequired:!1},autoplayBehavior:{label:"data-autoplay-behavior",value:"spin-xy",isRequired:!1},magnifier:{label:"data-magnifier",value:1.5,isRequired:!1},autoplayReverse:{label:"data-autoplay-reverse",isRequired:!1},playOnce:{label:"data-play-once",isRequired:!1},keys:{label:"data-keys",isRequired:!1},keysReverse:{label:"data-keys-reverse",isRequired:!1},draggable:{label:"data-draggable",isRequired:!1},swipeable:{label:"data-swipeable",isRequired:!1},fullscreen:{label:"data-fullscreen",isRequired:!1}},Ui={NAME:"#7B9200",URL:"#2D88CB"},Zl=["folder","class"];console.log(test);const Dl=document.getElementById("spin-directions"),Ki=document.getElementById("copy-text"),qi=document.getElementById("code-block"),_i=document.getElementById("code-wrapper"),Nt=document.getElementById("pointer-zoom-selector"),Nl=document.querySelector(".copy-button"),Vl=document.querySelector(".output-code"),jl=document.getElementById("pointer-checkbox"),Fl=document.querySelectorAll(".plugin-option"),On=document.getElementById("x-images-selector"),$l=document.getElementById("images-y"),Gl=document.getElementById("spin-speed"),zl=document.getElementById("drag-speed"),we=new hn;function Ul(t){const i=t.target.value==="Y",n=i?Bl:Hl,o=we.updateView("demo-generator",n);On.value=i?35:233,$l.style.display=i?"block":"none",Se(o.viewerConfig)}function Kl(t){const{value:e}=t.target,i=we.updateView("demo-generator",{dragSpeed:parseInt(e,10)});Se(i.viewerConfig)}function ql(t){const{value:e}=t.target,i=we.updateView("demo-generator",{speed:parseInt(e,10)});Se(i.viewerConfig)}function _l(){navigator.clipboard.writeText(Vl.innerText),Ki.innerHTML="Copied",setTimeout(()=>{Ki.innerHTML="Copy"},500)}function Jl(t){const{value:e}=t.target,i=we.updateView("demo-generator",{amountX:parseInt(e,10)});Se(i.viewerConfig)}function Ql(t){const e=t.target.checked,i=parseFloat(Nt.value,10),n=we.updateView("demo-generator",{pointerZoom:e?i:!1});Nt.disabled=!e,Se(n.viewerConfig)}function ec(t){const{value:e}=t.target,i=we.updateView("demo-generator",{pointerZoom:parseFloat(e,10)});Se(i.viewerConfig)}function tc(t){const e=t.target.checked,i=t.target.getAttribute("data-plugin-property"),n=t.target.getAttribute("data-plugin-value");let o=e;n&&(o=e?JSON.parse(n):void 0);const s=we.updateView("demo-generator",{[i]:o});Se(s.viewerConfig)}function Se(t){qi.innerText="",Object.keys(t).filter(n=>zi[n]&&!!t[n]).forEach(n=>{const{label:o}=zi[n],s=document.createElement("div"),r=document.createElement("span"),a=document.createElement("span");r.innerText=o,r.style.color=Ui.NAME,Zl.includes(n)&&(a.style.color=Ui.URL),s.appendChild(r),a.innerText=`"${t[n]}"`,s.innerHTML+="=",s.appendChild(a),qi.appendChild(s),_i.scrollTop=_i.scrollHeight})}zl.addEventListener("change",Kl);Gl.addEventListener("change",ql);jl.addEventListener("change",Ql);On.addEventListener("change",Jl);Nt.addEventListener("change",ec);Dl.addEventListener("change",Ul);Nl.addEventListener("click",_l);Fl.forEach(t=>{t.addEventListener("change",tc)});const ic=document.getElementById("gurkha-suv"),nc={folder:"https://scaleflex.cloudimg.io/v7/demo/suv-orange-car-360/",filenameX:"orange-{index}.jpg",amountX:73,lazyload:!0,speed:120,pointerZoom:2,responsive:"scaleflex",autoplay:!0,fullscreen:!0,magnifier:3,playOnce:!0,hotspots:Wl};we.init(ic,nc);we.initAll();const oc=we.getViewById("demo-generator");Se(oc.viewerConfig); diff --git a/index.html b/index.html index c486627..a7bf493 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,7 @@ rel="stylesheet" /> JS-Cloudimage-360-view - + diff --git a/style.css b/js-cloudimage-360-view.min.css similarity index 100% rename from style.css rename to js-cloudimage-360-view.min.css diff --git a/js-cloudimage-360-view.es.js b/js-cloudimage-360-view.min.js similarity index 99% rename from js-cloudimage-360-view.es.js rename to js-cloudimage-360-view.min.js index 29fc429..9df9fbf 100644 --- a/js-cloudimage-360-view.es.js +++ b/js-cloudimage-360-view.min.js @@ -1,4 +1,4 @@ -var De = Object.defineProperty; +import './js-cloudimage-360-view.min.css';var De = Object.defineProperty; var Ne = (e, t, i) => t in e ? De(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i; var ee = (e, t, i) => Ne(e, typeof t != "symbol" ? t + "" : t, i); var Et = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; diff --git a/js-cloudimage-360-view.umd.js b/js-cloudimage-360-view.umd.js deleted file mode 100644 index 962f9df..0000000 --- a/js-cloudimage-360-view.umd.js +++ /dev/null @@ -1,9 +0,0 @@ -(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{console.error(`Failed to load first image: ${t[0]}`),s++;for(let u=1;u{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=`close icon`,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=`fullscreen icon`,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=`magnifier icon`,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=` - position: ${e?"absolute":"static"}; - width: 100%; - inset: 0; - height: 100%; - object-fit: contain; - object-position: center; - filter: blur(10px); - `,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=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{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});