1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/viewer-spark-xT08c6M2.js","assets/vendor-three-ack9QSlZ.js","assets/vendor-spark-COzpysEA.js","assets/vendor-mediabunny-JLdngBVS.js","assets/CameraTrajectory-iFleZC8r.js","assets/vendor-react-2W1ZdoTw.js","assets/vendor-statsig-CxKPGZ0g.js","assets/viewer-gaussian-BYSTs3vg.js","assets/vendor-gaussian-splats-BGJ9y4eX.js","assets/vendor-tween-BLUQoTjF.js"])))=>i.map(i=>d[i]); 2import{r as v,g as hr,R as et,a as vr,j as r,b as gr}from"./vendor-react-2W1ZdoTw.js";import{s as br,a as yr}from"./vendor-statsig-CxKPGZ0g.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&o(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function o(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();const xr="modulepreload",wr=function(e){return"/viewer/"+e},Pn={},Ln=function(t,n,o){let s=Promise.resolve();if(n&&n.length>0){let i=function(p){return Promise.all(p.map(l=>Promise.resolve(l).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));s=i(n.map(p=>{if(p=wr(p),p in Pn)return;Pn[p]=!0;const l=p.endsWith(".css"),m=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${m}`))return;const f=document.createElement("link");if(f.rel=l?"stylesheet":xr,l||(f.as="script"),f.crossOrigin="",f.href=p,u&&f.setAttribute("nonce",u),document.head.appendChild(f),l)return new Promise((x,C)=>{f.addEventListener("load",x),f.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${p}`)))})}))}function a(i){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=i,window.dispatchEvent(c),!c.defaultPrevented)throw i}return s.then(i=>{for(const c of i||[])c.status==="rejected"&&a(c.reason);return t().catch(a)})};var bn=function(){return bn=Object.assign||function(t){for(var n,o=1,s=arguments.length;o<s;o++){n=arguments[o];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},bn.apply(this,arguments)};function qe(e,t,n,o){function s(a){return a instanceof n?a:new n(function(i){i(a)})}return new(n||(n=Promise))(function(a,i){function c(l){try{p(o.next(l))}catch(m){i(m)}}function u(l){try{p(o.throw(l))}catch(m){i(m)}}function p(l){l.done?a(l.value):s(l.value).then(c,u)}p((o=o.apply(e,t||[])).next())})}function Qe(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,s,a,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=c(0),i.throw=c(1),i.return=c(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(p){return function(l){return u([p,l])}}function u(p){if(o)throw new TypeError("Generator is already executing.");for(;i&&(i=0,p[0]&&(n=0)),n;)try{if(o=1,s&&(a=p[0]&2?s.return:p[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,p[1])).done)return a;switch(s=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,s=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]<a[3])){n.label=p[1];break}if(p[0]===6&&n.label<a[1]){n.label=a[1],a=p;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(p);break}a[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(l){p=[6,l],s=0}finally{o=a=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function _o(e,t,n){if(n||arguments.length===2)for(var o=0,s=t.length,a;o<s;o++)(a||!(o in t))&&(a||(a=Array.prototype.slice.call(t,0,o)),a[o]=t[o
2]);return e.concat(a||Array.prototype.slice.call(t))}var Co="4.6.2";function Kt(e,t){return new Promise(function(n){return setTimeout(n,e,t)})}function Sr(){return new Promise(function(e){var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(null)})}function _r(e,t){t===void 0&&(t=1/0);var n=window.requestIdleCallback;return n?new Promise(function(o){return n.call(window,function(){return o()},{timeout:t})}):Kt(Math.min(e,t))}function jo(e){return!!e&&typeof e.then=="function"}function Tn(e,t){try{var n=e();jo(n)?n.then(function(o){return t(!0,o)},function(o){return t(!1,o)}):t(!0,n)}catch(o){t(!1,o)}}function In(e,t,n){return n===void 0&&(n=16),qe(this,void 0,void 0,function(){var o,s,a,i;return Qe(this,function(c){switch(c.label){case 0:o=Array(e.length),s=Date.now(),a=0,c.label=1;case 1:return a<e.length?(o[a]=t(e[a],a),i=Date.now(),i>=s+n?(s=i,[4,Sr()]):[3,3]):[3,4];case 2:c.sent(),c.label=3;case 3:return++a,[3,1];case 4:return[2,o]}})})}function It(e){return e.then(void 0,function(){}),e}function Cr(e,t){for(var n=0,o=e.length;n<o;++n)if(e[n]===t)return!0;return!1}function jr(e,t){return!Cr(e,t)}function _n(e){return parseInt(e)}function Ye(e){return parseFloat(e)}function tt(e,t){return typeof e=="number"&&isNaN(e)?t:e}function Ne(e){return e.reduce(function(t,n){return t+(n?1:0)},0)}function ko(e,t){if(t===void 0&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function kr(e){for(var t,n,o="Unexpected syntax '".concat(e,"'"),s=/^\s*([a-z-]*)(.*)$/i.exec(e),a=s[1]||void 0,i={},c=/([.:#][\w-]+|\[.+?\])/gi,u=function(f,x){i[f]=i[f]||[],i[f].push(x)};;){var p=c.exec(s[2]);if(!p)break;var l=p[0];switch(l[0]){case".":u("class",l.slice(1));break;case"#":u("id",l.slice(1));break;case"[":{var m=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(l);if(m)u(m[1],(n=(t=m[4])!==null&&t!==void 0?t:m[5])!==null&&n!==void 0?n:"");else throw new Error(o);break}default:throw new Error(o)}}return[a,i]}function Er(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++){var o=e.charCodeAt(n);if(o>127)return new TextEncoder().encode(e);t[n]=o}return t}function st(e,t){var n=e[0]>>>16,o=e[0]&65535,s=e[1]>>>16,a=e[1]&65535,i=t[0]>>>16,c=t[0]&65535,u=t[1]>>>16,p=t[1]&65535,l=0,m=0,f=0,x=0;x+=a+p,f+=x>>>16,x&=65535,f+=s+u,m+=f>>>16,f&=65535,m+=o+c,l+=m>>>16,m&=65535,l+=n+i,l&=65535,e[0]=l<<16|m,e[1]=f<<16|x}function He(e,t){var n=e[0]>>>16,o=e[0]&65535,s=e[1]>>>16,a=e[1]&65535,i=t[0]>>>16,c=t[0]&65535,u=t[1]>>>16,p=t[1]&65535,l=0,m=0,f=0,x=0;x+=a*p,f+=x>>>16,x&=65535,f+=s*p,m+=f>>>16,f&=65535,f+=a*u,m+=f>>>16,f&=65535,m+=o*p,l+=m>>>16,m&=65535,m+=s*u,l+=m>>>16,m&=65535,m+=a*c,l+=m>>>16,m&=65535,l+=n*p+o*u+s*c+a*i,l&=65535,e[0]=l<<16|m,e[1]=f<<16|x}function yt(e,t){var n=e[0];t%=64,t===32?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function Fe(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function ne(e,t){e[0]^=t[0],e[1]^=t[1]}var Mr=[4283543511,3981806797],Nr=[3301882366,444984403];function Rn(e){var t=[0,e[0]>>>1];ne(e,t),He(e,Mr),t[1]=e[0]>>>1,ne(e,t),He(e,Nr),t[1]=e[0]>>>1,ne(e,t)}var Vt=[2277735313,289559509],Dt=[1291169091,658871167],An=[0,5],Pr=[0,1390208809],Lr=[0,944331445];function Tr(e,t){var n=Er(e);t=t||0;var o=[0,n.length],s=o[1]%16,a=o[1]-s,i=[0,t],c=[0,t],u=[0,0],p=[0,0],l;for(l=0;l<a;l=l+16)u[0]=n[l+4]|n[l+5]<<8|n[l+6]<<16|n[l+7]<<24,u[1]=n[l]|n[l+1]<<8|n[l+2]<<16|n[l+3]<<24,p[0]=n[l+12]|n[l+13]<<8|n[l+14]<<16|n[l+15]<<24,p[1]=n[l+8]|n[l+9]<<8|n[l+10]<<16|n[l+11]<<24,He(u,Vt),yt(u,31),He(u,Dt),ne(i,u),yt(i,27),st(i,c),He(i,An),st(i,Pr),He(p,Dt),yt(p,33),He(p,Vt),ne(c,p),yt(c,31),st(c,i),He(c,An),st(c,Lr);u[0]=0,u[1]=0,p[0]=0,p[1]=0;var m=[0,0];switch(s){case 15:m[1]=n[l+14],Fe(m,48),ne(p,m);case 14:m[1]=n[l+13],Fe(m,40),ne(p,m);case 13:m[1]=n[l+12],Fe(m,32),ne(p,m);case 12:m[1]=n[l+11],Fe(m,24),ne(p,m);case 11:m[1]=n[l+10],Fe(m,16),ne(p,m);case 10:m[1]=n[l+9],Fe(m,8),ne(p,m);case 9:m[1]=n[l+8],ne(p,m),He(p,Dt),yt(p,33),He(p,Vt),ne(c,p);case 8:m[1]=n[l+7],Fe(m,56),ne(u,m);case 7:m[1]=n[l+6],Fe(m,48),ne(u,m);case 6:m[1]=n[l+5],Fe(m,40),ne(u,m);case 5:m[1]=n[l+4],Fe(m,32),ne(u,m);case 4:m[1]=n[l+3],Fe(m,24),ne(u,m);case 3:m[1]=n[l+2],Fe(m,16),ne(u,m);case 2:m[1]=n[l+1],Fe(m,8),ne(u,m);case 1:m[1]=n[l],ne(u,m),He(u,Vt),yt(u,31),He(u,Dt),ne(i,u)}return ne(i,o),ne(c,o),st(i,c),st(c,i),Rn(i),Rn(c),st(i,c),st(c,i),("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)+("00000000"+(c[0]>>>0).toString(16)).slice(-8)+("00000000"+(c[1]>>>0).toString(16)).slice(-8)}function Ir(e){var t;return bn({name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(` 3`)},e)}function Rr(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function Ar(e){return typeof e!="function"}function Fr(e,t){var n=It(new Promise(function(o){var s=Date.now();Tn(e.bind(null,t),function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var c=Date.now()-s;if(!a[0])return o(function(){return{error:a[1],duration:c}});var u=a[1];if(Ar(u))return o(function(){return{value:u,duration:c}});o(function(){return new Promise(function(p){var l=Date.now();Tn(u,function(){for(var m=[],f=0;f<arguments.length;f++)m[f]=arguments[f];var x=c+Date.now()-l;if(!m[0])return p({error:m[1],duration:x});p({value:m[1],duration:x})})})})})}));return function(){return n.then(function(s){return s()})}}function Or(e,t,n,o){var s=Object.keys(e).filter(function(i){return jr(n,i)}),a=It(In(s,function(i){return Fr(e[i],t)},o));return function(){return qe(this,void 0,void 0,function(){var c,u,p,l,m;return Qe(this,function(f){switch(f.label){case 0:return[4,a];case 1:return c=f.sent(),[4,In(c,function(x){return It(x())},o)];case 2:return u=f.sent(),[4,Promise.all(u)];case 3:for(p=f.sent(),l={},m=0;m<s.length;++m)l[s[m]]=p[m];return[2,l]}})})}}function Eo(){var e=window,t=navigator;return Ne(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Vr(){var e=window,t=navigator;return Ne(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Eo()}function Rt(){var e=window,t=navigator;return Ne(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>
3=5}function $e(){var e=window,t=navigator;return Ne(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function Cn(){var e=window,t=e.HTMLElement,n=e.Document;return Ne(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function At(){var e=window;return Rr(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function Mo(){var e,t,n=window;return Ne(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function Dr(){var e=window;return Ne([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function Br(){var e=window,t=e.URLPattern;return Ne(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function Hr(){var e=window;return Ne(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function Ft(){var e=window,t=navigator,n=e.CSS,o=e.HTMLButtonElement;return Ne([!("getStorageUpdates"in t),o&&"popover"in o.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function Ur(){if(navigator.platform==="iPad")return!0;var e=screen,t=e.width/e.height;return Ne(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function zr(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function Wr(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function jn(){var e=Rt(),t=Mo(),n=window,o=navigator,s="connection";return e?Ne([!("SharedWorker"in n),o[s]&&"ontypechange"in o[s],!("sinkId"in new Audio)])>=2:t?Ne(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2:!1}function Gr(){var e=navigator,t=window,n=Audio.prototype,o=t.visualViewport;return Ne(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,o&&"segments"in o,"getTextInformation"in Image.prototype])>=3}function Yr(){return Zr()?-4:Xr()}function Xr(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if($r())return-1;var n=4500,o=5e3,s=new t(1,o,44100),a=s.createOscillator();a.type="triangle",a.frequency.value=1e4;var i=s.createDynamicsCompressor();i.threshold.value=-50,i.knee.value=40,i.ratio.value=12,i.attack.value=0,i.release.value=.25,a.connect(i),i.connect(s.destination),a.start(0);var c=Kr(s),u=c[0],p=c[1],l=It(u.then(function(m){return Jr(m.getChannelData(0).subarray(n))},function(m){if(m.name==="timeout"||m.name==="suspended")return-3;throw m}));return function(){return p(),l}}function $r(){return $e()&&!Cn()&&!Hr()}function Zr(){return $e()&&Ft()&&At()||Rt()&&Gr()&&Br()}function Kr(e){var t=3,n=500,o=500,s=5e3,a=function(){},i=new Promise(function(c,u){var p=!1,l=0,m=0;e.oncomplete=function(C){return c(C.renderedBuffer)};var f=function(){setTimeout(function(){return u(Fn("timeout"))},Math.min(o,m+s-Date.now()))},x=function(){try{var C=e.startRendering();switch(jo(C)&&It(C),e.state){case"running":m=Date.now(),p&&f();break;case"suspended":document.hidden||l++,p&&l>=t?u(Fn("suspended")):setTimeout(x,n);break}}catch(w){u(w)}};x(),a=function(){p||(p=!0,m>0&&f())}});return[i,a]}function Jr(e){for(var t=0,n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function Fn(e){var t=new Error(e);return t.name=e,t}function No(e,t,n){var o,s,a;return n===void 0&&(n=50),qe(this,void 0,void 0,function(){var i,c;return Qe(this,function(u){switch(u.label){case 0:i=document,u.label=1;case 1:return i.body?[3,3]:[4,Kt(n)];case 2:return u.sent(),[3,1];case 3:c=i.createElement("iframe"),u.label=4;case 4:return u.trys.push([4,,10,11]),[4,new Promise(function(p,l){var m=!1,f=function(){m=!0,p()},x=function(j){m=!0,l(j)};c.onload=f,c.onerror=x;var C=c.style;C.setProperty("display","block","important"),C.position="absolute",C.top="0",C.left="0",C.visibility="hidden",t&&"srcdoc"in c?c.srcdoc=t:c.src="about:blank",i.body.appendChild(c);var w=function(){var j,_;m||(((_=(j=c.contentWindow)===null||j===void 0?void 0:j.document)===null||_===void 0?void 0:_.readyState)==="complete"?f():setTimeout(w,10))};w()})];case 5:u.sent(),u.label=6;case 6:return!((s=(o=c.contentWindow)===null||o===void 0?void 0:o.document)===null||s===void 0)&&s.body?[3,8]:[4,Kt(n)];case 7:return u.sent(),[3,6];case 8:return[4,e(c,c.contentWindow)];case 9:return[2,u.sent()];case 10:return(a=c.parentNode)===null||a===void 0||a.removeChild(c),[7];case 11:return[2]}})})}function qr(e){for(var t=kr(e),n=t[0],o=t[1],s=document.createElement(n??"div"),a=0,i=Object.keys(o);a<i.length;a++){var c=i[a],u=o[c].join(" ");c==="style"?Qr(s.style,u):s.setAttribute(c,u)}return s}function Qr(e,t){for(var n=0,o=t.split(";");n<o.length;n++){var s=o[n],a=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(s);if(a){var i=a[1],c=a[2],u=a[4];e.setProperty(i,c,u||"")}}}function es(){for(var e=window;;){var t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(n){if(n instanceof Error&&n.name==="SecurityError")return!0;throw n}e=t}}var ts="mmMwWLliI0O&1",ns="48px",xt=["monospace","sans-serif","serif"],On=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera S
3ans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function os(){var e=this;return No(function(t,n){var o=n.document;return qe(e,void 0,void 0,function(){var s,a,i,c,u,p,l,m,f,x,C,w;return Qe(this,function(j){for(s=o.body,s.style.fontSize=ns,a=o.createElement("div"),a.style.setProperty("visibility","hidden","important"),i={},c={},u=function(_){var M=o.createElement("span"),k=M.style;return k.position="absolute",k.top="0",k.left="0",k.fontFamily=_,M.textContent=ts,a.appendChild(M),M},p=function(_,M){return u("'".concat(_,"',").concat(M))},l=function(){return xt.map(u)},m=function(){for(var _={},M=function(D){_[D]=xt.map(function(Y){return p(D,Y)})},k=0,T=On;k<T.length;k++){var U=T[k];M(U)}return _},f=function(_){return xt.some(function(M,k){return _[k].offsetWidth!==i[M]||_[k].offsetHeight!==c[M]})},x=l(),C=m(),s.appendChild(a),w=0;w<xt.length;w++)i[xt[w]]=x[w].offsetWidth,c[xt[w]]=x[w].offsetHeight;return[2,On.filter(function(_){return f(C[_])})]})})})}function rs(){var e=navigator.plugins;if(e){for(var t=[],n=0;n<e.length;++n){var o=e[n];if(o){for(var s=[],a=0;a<o.length;++a){var i=o[a];s.push({type:i.type,suffixes:i.suffixes})}t.push({name:o.name,description:o.description,mimeTypes:s})}}return t}}function ss(){return as(ms())}function as(e){var t,n=!1,o,s,a=is(),i=a[0],c=a[1];return ls(i,c)?(n=cs(c),e?o=s="skipped":(t=us(i,c),o=t[0],s=t[1])):o=s="unsupported",{winding:n,geometry:o,text:s}}function is(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function ls(e,t){return!!(t&&e.toDataURL)}function cs(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function us(e,t){ds(e,t);var n=an(e),o=an(e);if(n!==o)return["unstable","unstable"];ps(e,t);var s=an(e);return[s,n]}function ds(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var n="Cwm fjordbank gly ".concat("ð");t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}function ps(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var n=0,o=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];n<o.length;n++){var s=o[n],a=s[0],i=s[1],c=s[2];t.fillStyle=a,t.beginPath(),t.arc(i,c,40,0,Math.PI*2,!0),t.closePath(),t.fill()}t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function an(e){return e.toDataURL()}function ms(){return $e()&&Ft()&&At()}function fs(){var e=navigator,t=0,n;e.maxTouchPoints!==void 0?t=_n(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}var o="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:n,touchStart:o}}function hs(){return navigator.oscpu}function vs(){var e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(n!==void 0&&t.push([n]),Array.isArray(e.languages))Rt()&&Dr()||t.push(e.languages);else if(typeof e.languages=="string"){var o=e.languages;o&&t.push(o.split(","))}return t}function gs(){return window.screen.colorDepth}function bs(){return tt(Ye(navigator.deviceMemory),void 0)}function ys(){if(!($e()&&Ft()&&At()))return xs()}function xs(){var e=screen,t=function(o){return tt(_n(o),null)},n=[t(e.width),t(e.height)];return n.sort().reverse(),n}var ws=2500,Ss=10,Yt,ln;function _s(){if(ln===void 0){var e=function(){var t=yn();xn(t)?ln=setTimeout(e,ws):(Yt=t,ln=void 0)};e()}}function Cs(){var e=this;return _s(),function(){return qe(e,void 0,void 0,function(){var t;return Qe(this,function(n){switch(n.label){case 0:return t=yn(),xn(t)?Yt?[2,_o([],Yt,!0)]:zr()?[4,Wr()]:[3,2]:[3,2];case 1:n.sent(),t=yn(),n.label=2;case 2:return xn(t)||(Yt=t),[2,t]}})})}}function js(){var e=this;if($e()&&Ft()&&At())return function(){return Promise.resolve(void 0)};var t=Cs();return function(){return qe(e,void 0,void 0,function(){var n,o;return Qe(this,function(s){switch(s.label){case 0:return[4,t()];case 1:return n=s.sent(),o=function(a){return a===null?null:ko(a,Ss)},[2,[o(n[0]),o(n[1]),o(n[2]),o(n[3])]]}})})}}function yn(){var e=screen;return[tt(Ye(e.availTop),null),tt(Ye(e.width)-Ye(e.availWidth)-tt(Ye(e.avail
vendor: 4,417 bytes, line 3
3Left),0),null),tt(Ye(e.height)-Ye(e.availHeight)-tt(Ye(e.availTop),0),null),tt(Ye(e.availLeft),null)]}function xn(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function ks(){return tt(_n(navigator.hardwareConcurrency),void 0)}function Es(){var e,t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){var n=new t().resolvedOptions().timeZone;if(n)return n}var o=-Ms();return"UTC".concat(o>=0?"+":"").concat(o)}function Ms(){var e=new Date().getFullYear();return Math.max(Ye(new Date(e,0,1).getTimezoneOffset()),Ye(new Date(e,6,1).getTimezoneOffset()))}function Ns(){try{return!!window.sessionStorage}catch{return!0}}function Ps(){try{return!!window.localStorage}catch{return!0}}function Ls(){if(!(Eo()||Vr()))try{return!!window.indexedDB}catch{return!0}}function Ts(){return!!window.openDatabase}function Is(){return navigator.cpuClass}function Rs(){var e=navigator.platform;return e==="MacIntel"&&$e()&&!Cn()?Ur()?"iPad":"iPhone":e}function As(){return navigator.vendor||""}function Fs(){for(var e=[],t=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<n.length;t++){var o=n[t],s=window[o];s&&typeof s=="object"&&e.push(o)}return e.sort()}function Os(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function Vs(){var e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie
vendor: 3,598 bytes, line 3
3:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiX
3Q=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}function Ds(e){var t=e===void 0?{}:e,n=t.debug;return qe(this,void 0,void 0,function(){var o,s,a,i,c,u;return Qe(this,function(p){switch(p.label){case 0:return Bs()?(o=Vs(),s=Object.keys(o),a=(u=[]).concat.apply(u,s.map(function(l){return o[l]})),[4,Hs(a)]):[2,void 0];case 1:return i=p.sent(),n&&Us(o,i),c=s.filter(function(l){var m=o[l],f=Ne(m.map(function(x){return i[x]}));return f>m.length*.6}),c.sort(),[2,c]}})})}function Bs(){return $e()||jn()}function Hs(e){var t;return qe(this,void 0,void 0,function(){var n,o,s,a,u,i,c,u;return Qe(this,function(p){switch(p.label){case 0:for(n=document,o=n.createElement("div"),s=new Array(e.length),a={},Vn(o),u=0;u<e.length;++u)i=qr(e[u]),i.tagName==="DIALOG"&&i.show(),c=n.createElement("div"),Vn(c),c.appendChild(i),o.appendChild(c),s[u]=i;p.label=1;case 1:return n.body?[3,3]:[4,Kt(50)];case 2:return p.sent(),[3,1];case 3:n.body.appendChild(o);try{for(u=0;u<e.length;++u)s[u].offsetParent||(a[e[u]]=!0)}finally{(t=o.parentNode)===null||t===void 0||t.removeChild(o)}return[2,a]}})})}function Vn(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Us(e,t){for(var n="DOM blockers debug:\n```",o=0,s=Object.keys(e);o<s.length;o++){var a=s[o];n+=` 4`.concat(a,":");for(var i=0,c=e[a];i<c.length;i++){var u=c[i];n+=` 5 `.concat(t[u]?"ð«":"â¡ï¸"," ").concat(u)}}console.log("".concat(n,"\n```"))}function zs(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var n=t[e];if(matchMedia("(color-gamut: ".concat(n,")")).matches)return n}}function Ws(){if(Dn("inverted"))return!0;if(Dn("none"))return!1}function Dn(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function Gs(){if(Bn("active"))return!0;if(Bn("none"))return!1}function Bn(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}var Ys=100;function Xs(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=Ys;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}}function $s(){if(wt("no-preference"))return 0;if(wt("high")||wt("more"))return 1;if(wt("low")||wt("less"))return-1;if(wt("forced"))return 10}function wt(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function Zs(){if(Hn("reduce"))return!0;if(Hn("no-preference"))return!1}function Hn(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function Ks(){if(Un("reduce"))return!0;if(Un("no-preference"))return!1}function Un(e){return matchMedia("(prefers-reduced-transparency: ".concat(e,")")).matches}function Js(){if(zn("high"))return!0;if(zn("standard"))return!1}function zn(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var K=Math,Ee=function(){return 0};function qs(){var e=K.acos||Ee,t=K.acosh||Ee,n=K.asin||Ee,o=K.asinh||Ee,s=K.atanh||Ee,a=K.atan||Ee,i=K.sin||Ee,c=K.sinh||Ee,u=K.cos||Ee,p=K.cosh||Ee,l=K.tan||Ee,m=K.tanh||Ee,f=K.exp||Ee,x=K.expm1||Ee,C=K.log1p||Ee,w=function(N){return K.pow(K.PI,N)},j=function(N){return K.log(N+K.sqrt(N*N-1))},_=function(N){return K.log(N+K.sqrt(N*N+1))},M=function(N){return K.log((1+N)/(1-N))/2},k=function(N){return K.exp(N)-1/K.exp(N)/2},T=function(N){return(K.exp(N)+1/K.exp(N))/2},U=function(N){return K.exp(N)-1},D=function(N){return(K.exp(2*N)-1)/(K.exp(2*N)+1)},Y=function(N){return K.log(1+N)};return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:j(1e154),asin:n(.12312423423423424),asinh:o(1),asinhPf:_(1),atanh:s(.5),atanhPf:M(.5),atan:a(.5),sin:i(-1e300),sinh:c(1),sinhPf:k(1),cos:u(10.000000000123),cosh:p(1),coshPf:T(1),tan:l(-1e300),tanh:m(1),tanhPf:D(1),exp:f(1),expm1:x(1),expm1Pf:U(1),log1p:C(10),log1pPf:Y(10),powPI:w(-100)}}var Qs="mmMwWLliI0fiflO&1",cn={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function ea(){return ta(function(e,t){for(var n={},o={},s=0,a=Object.keys(cn);s<a.length;s++){var i=a[s],c=cn[i],u=c[0],p=u===void 0?{}:u,l=c[1],m=l===void 0?Qs:l,f=e.createElement("span");f.textContent=m,f.style.whiteSpace="nowrap";for(var x=0,C=Object.keys(p);x<C.length;x++){var w=C[x],j=p[w];j!==void 0&&(f.style[w]=j)}n[i]=f,t.append(e.createElement("br"),f)}for(var _=0,M=Object.keys(cn);_<M.length;_++){var i=M[_];o[i]=n[i].getBoundingClientRect().width}return o}
5)}function ta(e,t){return t===void 0&&(t=4e3),No(function(n,o){var s=o.document,a=s.body,i=a.style;i.width="".concat(t,"px"),i.webkitTextSizeAdjust=i.textSizeAdjust="none",Rt()?a.style.zoom="".concat(1/o.devicePixelRatio):$e()&&(a.style.zoom="reset");var c=s.createElement("div");return c.textContent=_o([],Array(t/20<<0),!0).map(function(){return"word"}).join(" "),a.appendChild(c),e(s,a)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function na(){return navigator.pdfViewerEnabled}function oa(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function ra(){var e=window.ApplePaySession;if(typeof(e==null?void 0:e.canMakePayments)!="function")return-1;if(sa())return-3;try{return e.canMakePayments()?1:0}catch(t){return aa(t)}}var sa=es;function aa(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function ia(){var e,t=document.createElement("a"),n=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return n===void 0?void 0:String(n)}var Po=-1,Lo=-2,la=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),ca=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),ua=["FRAGMENT_SHADER","VERTEX_SHADER"],da=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],To="WEBGL_debug_renderer_info",pa="WEBGL_polygon_mode";function ma(e){var t,n,o,s,a,i,c=e.cache,u=Io(c);if(!u)return Po;if(!Ao(u))return Lo;var p=Ro()?null:u.getExtension(To);return{version:((t=u.getParameter(u.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((n=u.getParameter(u.VENDOR))===null||n===void 0?void 0:n.toString())||"",vendorUnmasked:p?(o=u.getParameter(p.UNMASKED_VENDOR_WEBGL))===null||o===void 0?void 0:o.toString():"",renderer:((s=u.getParameter(u.RENDERER))===null||s===void 0?void 0:s.toString())||"",rendererUnmasked:p?(a=u.getParameter(p.UNMASKED_RENDERER_WEBGL))===null||a===void 0?void 0:a.toString():"",shadingLanguageVersion:((i=u.getParameter(u.SHADING_LANGUAGE_VERSION))===null||i===void 0?void 0:i.toString())||""}}function fa(e){var t=e.cache,n=Io(t);if(!n)return Po;if(!Ao(n))return Lo;var o=n.getSupportedExtensions(),s=n.getContextAttributes(),a=[],i=[],c=[],u=[],p=[];if(s)for(var l=0,m=Object.keys(s);l<m.length;l++){var f=m[l];i.push("".concat(f,"=").concat(s[f]))}for(var x=Wn(n),C=0,w=x;C<w.length;C++){var j=w[C],_=n[j];c.push("".concat(j,"=").concat(_).concat(la.has(_)?"=".concat(n.getParameter(_)):""))}if(o)for(var M=0,k=o;M<k.length;M++){var T=k[M];if(!(T===To&&Ro()||T===pa&&ga())){var U=n.getExtension(T);if(!U){a.push(T);continue}for(var D=0,Y=Wn(U);D<Y.length;D++){var j=Y[D],_=U[j];u.push("".concat(j,"=").concat(_).concat(ca.has(_)?"=".concat(n.getParameter(_)):""))}}}for(var N=0,z=ua;N<z.length;N++)for(var A=z[N],W=0,O=da;W<O.length;W++){var q=O[W],Q=ha(n,A,q);p.push("".concat(A,".").concat(q,"=").concat(Q.join(",")))}return u.sort(),c.sort(),{contextAttributes:i,parameters:c,shaderPrecisions:p,extensions:o,extensionParameters:u,unsupportedExtensions:a}}function Io(e){if(e.webgl)return e.webgl.context;var t=document.createElement("canvas"),n;t.addEventListener("webglCreateContextError",function(){return n=void 0});for(var o=0,s=["webgl","experimental-webgl"];o<s.length;o++){var a=s[o];try{n=t.getContext(a)}catch{}if(n)break}return e.webgl={context:n},n}function ha(e,t,n){var o=e.getShaderPrecisionFormat(e[t],e[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function Wn(e){var t=Object.keys(e.__proto__);return t.filter(va)}function va(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function Ro(){return Mo()}function ga(){return Rt()||$e()}function Ao(e){return typeof e.getParameter=="function"}function ba(){var e=jn()||$e();if(!e)return-2;if(!window.AudioContext)return-1;var t=new AudioContext().baseLatency;return t==null?-1:isFinite(t)?t:-3}function ya(){if(!window.Intl)return-1;var e=window.Intl.DateTimeFormat;if(!e)return-2;var t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}var xa={fonts:os,domBlockers:Ds,fontPreferences:ea,audio:Yr,screenFrame:js,canvas:ss,osCpu:hs,languages:vs,colorDepth:gs,deviceMemory:bs,screenResolution:ys,hardwareConcurrency:ks,timezone:Es,sessionStorage:Ns,localStorage:Ps,indexedDB:Ls,openD
5atabase:Ts,cpuClass:Is,platform:Rs,plugins:rs,touchSupport:fs,vendor:As,vendorFlavors:Fs,cookiesEnabled:Os,colorGamut:zs,invertedColors:Ws,forcedColors:Gs,monochrome:Xs,contrast:$s,reducedMotion:Zs,reducedTransparency:Ks,hdr:Js,math:qs,pdfViewerEnabled:na,architecture:oa,applePay:ra,privateClickMeasurement:ia,audioBaseLatency:ba,dateTimeLocale:ya,webGlBasics:ma,webGlExtensions:fa};function wa(e){return Or(xa,e,[])}var Sa="$ if upgrade to Pro: https://fpjs.dev/pro";function _a(e){var t=Ca(e),n=ja(t);return{score:t,comment:Sa.replace(/\$/g,"".concat(n))}}function Ca(e){if(jn())return .4;if($e())return Cn()&&!(Ft()&&At())?.5:.3;var t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function ja(e){return ko(.99+.01*e,1e-4)}function ka(e){for(var t="",n=0,o=Object.keys(e).sort();n<o.length;n++){var s=o[n],a=e[s],i="error"in a?"error":JSON.stringify(a.value);t+="".concat(t?"|":"").concat(s.replace(/([:|\\])/g,"\\$1"),":").concat(i)}return t}function Fo(e){return JSON.stringify(e,function(t,n){return n instanceof Error?Ir(n):n},2)}function Oo(e){return Tr(ka(e))}function Ea(e){var t,n=_a(e);return{get visitorId(){return t===void 0&&(t=Oo(this.components)),t},set visitorId(o){t=o},confidence:n,components:e,version:Co}}function Ma(e){return e===void 0&&(e=50),_r(e,e*2)}function Na(e,t){var n=Date.now();return{get:function(o){return qe(this,void 0,void 0,function(){var s,a,i;return Qe(this,function(c){switch(c.label){case 0:return s=Date.now(),[4,e()];case 1:return a=c.sent(),i=Ea(a),(t||o!=null&&o.debug)&&console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(i.version,` 6userAgent: `).concat(navigator.userAgent,` 7timeBetweenLoadAndGet: `).concat(s-n,` 8visitorId: `).concat(i.visitorId,` 9components: `).concat(Fo(a),"\n```")),[2,i]}})})}}}function Pa(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(Co,"/npm-monitoring"),!0),e.send()}catch(t){console.error(t)}}function La(e){var t;return e===void 0&&(e={}),qe(this,void 0,void 0,function(){var n,o,s;return Qe(this,function(a){switch(a.label){case 0:return(!((t=e.monitoring)!==null&&t!==void 0)||t)&&Pa(),n=e.delayFallback,o=e.debug,[4,Ma(n)];case 1:return a.sent(),s=wa({cache:{},debug:o}),[2,Na(s,o)]}})})}var Ta={load:La,hashComponents:Oo,componentsToDebugString:Fo};let gt=null,jt=null;const Xt=[],Ia=50,Gn="splatica_statsig_fallback_visitor_id";let at=null;const Ra=()=>`fallback-${typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}`,Yn=()=>
9{if(at)return at;at=Ra();try{if(typeof window>"u"||!window.localStorage)return at;const e=window.localStorage.getItem(Gn);if(e)return at=e,at;window.localStorage.setItem(Gn,at)}catch{}return at},Aa=async()=>{try{const e=await Ta.load(),{visitorId:t}=await e.get();return t||Yn()}catch(e){return console.warn("Failed to get FingerprintJS visitor ID; using Statsig fallback ID:",e),Yn()}},Fa=()=>{var e;try{return typeof window<"u"&&((e=window.localStorage)==null?void 0:e.getItem("isAuth"))==="true"?"user":"anon"}catch{return"anon"}},Oa=async(e,t)=>jt||(jt=(async()=>{try{const n=await Aa(),o={userID:`${Fa()}-${n}`},s={plugins:[new br.StatsigAutoCapturePlugin],environment:{tier:t}},a=new yr.StatsigClient(e,o,s);await a.initializeAsync(),gt=a,Xt.splice(0).forEach(({eventName:i,value:c,metadata:u})=>{a.logEvent(i,c,Vo(u))}),console.log("Statsig initialized successfully")}catch(n){console.error("Failed to initialize Statsig:",n)}})(),jt),Vo=(e={})=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>[t,String(n)])),Va=()=>{var e;if(!(typeof window>"u"||!((e=window.location)!=null&&e.href)))return window.location.href},Da=(e,t={})=>{const n=Va();if(!gt){Xt.push({eventName:e,value:n,metadata:t}),Xt.length>Ia&&Xt.shift();return}try{gt.logEvent(e,n,Vo(t))}catch(o){console.error("Failed to log Statsig event:",o)}},Ba=async()=>{try{if(!gt&&jt&&await jt,!gt||typeof gt.flush!="function")return;await gt.flush()}catch(e){console.error("Failed to flush Statsig events:",e)}},Xe=e=>Array.isArray(e)&&e.length>=3&&Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(e[2]),kn=e=>Array.isArray(e)&&e.length>=4&&e.slice(0,4).every(t=>Number.isFinite(t)),Xn=e=>{const t=Math.hypot(e[0],e[1],e[2]);return t===0?[0,0,0]:[e[0]/t,e[1]/t,e[2]/t]},Ha=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2],Ua=e=>Array.isArray(e)&&e.length>=3&&Xe(e[0])&&Xe(e[1])&&Xe(e[2]),za=e=>{const t=e[0][0],n=e[0][1],o=e[0][2],s=e[1][0],a=e[1][1],i=e[1][2],c=e[2][0],u=e[2][1],p=e[2][2],l=t+a+p;let m,f,x,C;if(l>0){const w=.5/Math.sqrt(l+1);C=.25/w,m=(u-i)*w,f=(o-c)*w,x=(s-n)*w}else if(t>a&&t>p){const w=2*Math.sqrt(1+t-a-p);C=(u-i)/w,m=.25*w,f=(n+s)/w,x=(o+c)/w}else if(a>p){const w=2*Math.sqrt(1+a-t-p);C=(o-c)/w,m=(n+s)/w,f=.25*w,x=(i+u)/w}else{const w=2*Math.sqrt(1+p-t-a);C=(s-n)/w,m=(o+c)/w,f=(i+u)/w,x=.25*w}return[m,f,x,C]},Wa=(e,t)=>{const[n,o,s]=e,[a,i,c,u]=t,p=u*n+i*s-c*o,l=u*o+c*n-a*s,m=u*s+a*o-i*n,f=-a*n-i*o-c*s;return[p*u+f*-a+l*-c-m*-i,l*u+f*-i+m*-a-p*-c,m*u+f*-c+p*-i-l*-a]},Ga=e=>{if(!Ua(e))return null;const t=za(e);return kn(t)?t:null},Ya=(e,t)=>{if(!Xe(e)||!kn(t))return null;const n=Wa([0,0,-1],t);return[e[0]+n[0],e[1]+n[1],e[2]+n[2]]},$t=(e="")=>{const t=(e||"").split("?")[0].split("#")[0].toLowerCase();return t.includes(".")?t.split(".").pop():""},Xa=(e={})=>{if(!Xe(e.position))return null;const t={position:e.position.slice(0,3)};if(kn(e.quaternion))t.quaternion=e.quaternion.slice(0,4);else{const o=Ga(e.rotation);o&&(t.quaternion=o)}const n=Xe(e.target)?e.target:Xe(e.lookAt)?e.lookAt:Xe(e.look_at)?e.look_at:null;return n&&(t.target=n.slice(0,3)),t},Do=(e="")=>{const t=/^.*\/pipeline-[0-9a-f\-]+\//.exec(e||"");return t?t[0]:void 0},Pt=(e,t,n)=>{const o=n.get(e);return!o||/^https?\:\/\/.*/.exec(o)?o:t?`${t}${o}`:o},Jt=Object.freeze(["sd","hd","ply"]),$n=Object.freeze({sd:["hd","ply"],hd:["sd","ply"],ply:["hd","sd"]}),En=(e={})=>{const t={},n=new Map;return Jt.forEach(o=>{const s=e[o];if(!s)return;const a=n.get(s);a&&delete t[a],n.set(s,o),t[o]=s}),t},$a=(e,t)=>Object.fromEntries(Jt.filter(n=>!t.includes(n)&&e[n]).map(n=>[n,e[n]])),Za=e=>{const t=e.get("model.url"),n=Do(t);return En({sd:Pt("model.kmobile",n,e),hd:Pt("model.kdesktop",n,e),ply:t})},Ka=(e,t)=>{var i;const n=Jt.filter(c=>e[c]);if(n.length===0)throw new Error("No scene formats available");const o=Jt.includes(t)?t:"sd",s=e[o]?o:$n[o].find(c=>e[c])||n[0],a=((i=$n[s])==null?void 0:i.find(c=>e[c]))||s;return{sceneFormat:s,modelUrl:e[s],modelFallbackUrl:e[a]||e[s]}},Ja=({sceneFormats:e={},formatPreference:t,isMobile:n=!1,excludePly:o=!1})=>{const s=En(e),a=o?$a(s,["ply"]):s,i=Object.keys(a).length>0?a:s;return{sceneFormats:a,...Ka(i,n?"sd":o&&t==="ply"?"hd":t)}},qa=e=>{const t=String(e||"").match("pipeline-(.*?)/");return t?t[1]:""},Qa=()=>{const e=localStorage.getItem("queryModelFormatPreference");return e==="sd"||e==="hd"||e==="ply"?e:"sd"},ei=e=>{const t=e.get("model.url"),n=Do(t),o=e.get("id"),s=Za(e);if(Object.keys(s).length===0)throw new Error("Invalid viewer URL format");const a=Pt("model.cameras",n,e),i=Pt("model.camera",n,e),c=Pt("model.normal",n,e),u=parseInt(e.get("shDegree"))||0;return{sceneFormats:s,modelCameras:a,modelCamera:i,modelNormal:c,resultId:o,isPublic:!0,shDegree:u}},qt=Object.freeze({GAUSSIAN_SPLATS_3D:"gaussian_splats_3d",SPARK:"spark"}),ti=()=>{const e=new URLSearchParams(window.location.search);if(!e.has("loadScene"))return!1;const t=e.get("loadScene");return t==null?!1:t==="0"||t.toLowerCase()==="false"},Zn=/\/viewer(?:\/([a-z\-_]+))?(?:\/([a-f0-9-]+))?(\/index\.html)?(\/pipe)?\/?$/,Bo=()=>{const e=window.location.pathname,t=new URLSearchParams(window.location.search);let n=e.match(Zn);var o=qt.SPARK;const s=n&&n[1]&&e.startsWith(`/viewer/${n[1]}`);let a=e;if(n&&n[3]&&(a=a.replace(n[3],"")),s&&n[1]==="old"?o=qt.GAUSSIAN_SPLATS_3D:s&&n[1]&&(a=a.replace(`/viewer/${n[1]}`,"/viewer")),a!==e&&(a.endsWith("/")||(a=`${a}/`),window.history.replaceState(window.history.state,"",`${a}${window.location.search}${window.location.hash}`),n=a.match(Zn)),t.has("model.url")||t.has("model.kdesktop")||t.has("model.kmobile"))return{viewerUuid:null,isPipePath:!1,isQueryFormat:!0,viewerType:o};if(n)return{viewerUuid:n[2]||t.get("viewerUuid")||n[1],isPipePath:!!n[4],isQueryFormat:!1,viewerType:o};if(t.get("viewerUuid"))return{viewerUuid:t.get("viewerUuid"),isPipePath:!1,isQueryFormat:!1,viewerType:o};throw new Error("Invalid viewer URL format")},Ho=async e=>{var n;const t=()=>new Promise((o,s)=>{const a=document.createElement("textarea");a.value=e,document.body.appendChild(a),a.focus(),a.select(),a.setSelectionRange(0,e.length);try{const i=document.execCommand("copy");document.body.removeChild(a),i?o():s(new Error("execCommand copy failed"))}catch(i){document.body.removeChild(a),s(i)}});if((n=navigator.clipboard)!=null&&n.writeText)try{await navigator.clipboard.writeText(e)}catch{await t()}else await t()},Uo=()=>"/api";async function ni({signal:e}={}){const t=Uo(),n=await fetch(`${t}/user`,{headers:{Accept:"application/json"},credentials:"include",signal:e});if(!n.ok)throw new Error(`Failed to fetch current user: ${n.status}`);return n.json()}async function oi(e){try{const t=Uo(),n=await fetch(`${t}/viewer/${e}`,{headers:{Accept:"application/json","Content-Type":"application/json"},credentials:"include",secure:!1});if(!n.ok){if(n.status===403){const i=new Error("Scene access forbidden");throw i.status=403,i}if(n.status===404){const i=new Error("Scene not found");throw i.status=404,i}const a=new Error(`Server error: ${n.statusText||n.status}`);throw a.status=n.status,a}const o=await n.json(),s=En({sd:o.ksplat_mobile,hd:o.ksplat_desktop,ply:o.gaussian_file});if(Object.keys(s).length===0){const a=new Error("Invalid scene data received");throw a.status=500,a}return{sceneFormats:s,modelCameras:o.cameras_json,modelCamera:o.single_c
9amera_json,modelNormal:o.earth_normal,pipelineUuid:o.pipeline_uuid,resultId:o.result_id,isPublic:o.isPublic}}catch(t){throw console.error("Failed to fetch viewer data:",t),t}}const ve=Object.freeze({SCENE_LOAD_START:"viewer_scene_load_start",SCENE_LOAD_COMPLETE:"viewer_scene_load_complete",SCENE_LOAD_FAILED:"viewer_scene_load_failed",DEFERRED_LOAD_CLICKED:"viewer_deferred_load_clicked",SCENE_FORMAT_CHANGED:"viewer_scene_format_changed",VIDEO_EXPORT_OPEN:"viewer_video_export_open",CAMERA_POSE_SAVED:"viewer_camera_pose_saved",CAMERA_POSE_DELETED:"viewer_camera_pose_deleted",CAMERA_ANIMATION_PLAYED:"viewer_camera_animation_played",SHARE_LINK_COPIED:"viewer_share_link_copied",EMBED_CODE_COPIED:"viewer_embed_code_copied",CTA_CLICKED:"viewer_cta_clicked"}),zo=(e={})=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null)),ht=e=>e==null?void 0:e?1:0,Wo=()=>typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),Bt=e=>Math.max(0,Math.round(Wo()-e)),Ht=e=>String((e==null?void 0:e.message)||e).slice(0,180);let Mn={};const ri=(e={})=>{Mn=zo(e)},si=()=>{Mn={}},ae=(e,t={},n={})=>{const o=zo({...Mn,...t}),{callback:s,timeoutMs:a=300}=n,i=typeof s=="function";let c=!1;const u=()=>{c||!i||(c=!0,s())},p=typeof window<"u"?window.setTimeout:setTimeout;let l=null;const m=i?new Promise(C=>{l=C}):null,f=()=>{l&&l()};let x=!1;try{typeof window<"u"&&typeof window.gtag=="function"&&(x=!0,window.gtag("event",e,i?{...o,event_callback:f,event_timeout:a}:o))}catch(C){console.error("Failed to log GA event:",C)}if(i&&!x&&f(),Da(e,o),i){const C=Ba(),w=new Promise(j=>p(j,a));Promise.race([Promise.allSettled([m,C]),w]).then(u)}},Go=({sceneId:e,viewerUuid:t,resultId:n,pipelineUuid:o,sceneFormat:s,viewerType:a,modelFormat:i,isMobile:c,deferredLoad:u,source:p}={})=>({scene_id:e,viewer_uuid:t,result_id:n,pipeline_uuid:o,scene_format:s,viewer_type:a,model_format:i,is_mobile:ht(c),deferred_load:ht(u),source:p}),ai=({sceneAnalytics:e={},renderer:t,viewerOptions:n={},hasFallback:o=!1,extra:s={}}={})=>({...e,renderer:t,progressive_load:ht(n.progressiveLoad),lod:ht(n.lod),non_lod:ht(n.nonLod),ext_splats:ht(n.extSplats),has_fallback:ht(o),...s}),Sc=async({sceneAnalytics:e,renderer:t,viewerOptions:n,hasFallback:o,loadPrimaryScene:s,loadFallbackScene:a})=>{const i=Wo(),c=(u={})=>ai({sceneAnalytics:e,renderer:t,viewerOptions:n,hasFallback:o,extra:u});ae(ve.SCENE_LOAD_START,c());try{return await s(),ae(ve.SCENE_LOAD_COMPLETE,c({duration_ms:Bt(i),used_fallback:0})),!0}catch(u){if(typeof a=="function")try{return await a(),ae(ve.SCENE_LOAD_COMPLETE,c({duration_ms:Bt(i),used_fallback:1,primary_error_message:Ht(u)})),!0}catch(p){return ae(ve.SCENE_LOAD_FAILED,c({duration_ms:Bt(i),primary_error_message:Ht(u),error_message:Ht(p)})),!1}return ae(ve.SCENE_LOAD_FAILED,c({duration_ms:Bt(i),error_message:Ht(u)})),!1}},Kn={position:[0,0,0],lookAt:[0,0,1]},wn=[0,-1,0];function Yo(e){const t=$t(e);return t?["splat","ksplat","ply"].includes(t):!1}async function ii(e,t){return!e&&!t?null:t?fetch(t).then(n=>n.json()).catch(n=>(console.error("Error fetching camera",n),null)):fetch(e).then(n=>n.json()).then(n=>{const o=n.filter(i=>i.img_name.indexOf("00/front")!==-1),s=o.length>0?o:n;return s[Math.floor(s.length/10)]||s[0]||null}).catch(n=>(console.error("Error fetching cameras",n),null))}async function li(e){return e?fetch(e).then(t=>t.json()).then(t=>{const[n,o,s]=t;return[n,-o,s]}).catch(t=>(console.error("Error fetching earth normal",t),wn)):wn}function ci(e,t){var a;const n=(Xe(e==null?void 0:e.position)?e.position:Kn.position).slice(0,3),o=(Xe((a=e==null?void 0:e.rotation)==null?void 0:a[2])?e.rotation[2]:Kn.lookAt).slice(0,3),s=Xe(t)?t.slice(0,3):wn.slice(0,3);return{initialCameraPosition:n,initialCameraLookAt:o,earthNormal:s}}function ui(e){const t=Xn(e.initialCameraLookAt),n=Xn(e.earthNormal),o=Ha(t,n);return{initialCameraPosition:e.initialCameraPosition,initialCameraLookAt:[t[0]-n[0]*o,t[1]-n[1]*o,t[2]-n[2]*o],earthNormal:e.earthNormal,initialCameraQuaternion:null}}function di(e,t){if(!e)return{...t,initialCameraQuaternion:null};const n=e.position.slice(0,3),o=e.quaternion?e.quaternion.slice(0,4):null,s=e.target||Ya(n,o)||t.initialCameraLookAt;return{initialCameraPosition:n,initialCameraLookAt:s,earthNormal:t.earthNormal,initialCameraQuaternion:o}}async function pi(e,t,n,o){const[s,a]=await Promise.all([ii(t,o),li(n)]),i=s||{},c=Xa(i),u=ci(i,a);return Yo(e)?ui(u):di(c,u)}async function mi(e,t){switch(console.log("ViewerType",e),e){case qt.SPARK:{const{initSparkViewer:n}=await Ln(async()=>{const{initSparkViewer:o}=await import("./viewer-spark-xT08c6M2.js");return{initSparkViewer:o}},__vite__mapDeps([0,1,2,3,4,5,6]));return n(t)}case qt.GAUSSIAN_SPLATS_3D:{const{initGaussianSplats3DViewer:n}=await Ln(async()=>{const{initGaussianSplats3DViewer:o}=await import("./viewer-gaussian-BYSTs3vg.js");return{initGaussianSplats3DViewer:o}},__vite__mapDeps([7,8,1,9,4,5,6]));return n(t)}default:throw new Error(`Unsupported viewer type: ${e}`)}}async function fi(){const e="client-KBxtg4R3xgSE1khmIC9GGd4eAnxTDyusVGvrzipt1iZ",t="production";window.mobileAndTabletCheck=function(){let w=!1;return(function(j){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(j)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
9sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(j.substr(0,4)))&&(w=!0)})(navigator.userAgent||navigator.vendor||window.opera),w};const n=window.mobileAndTabletCheck(),{viewerUuid:o,isPipePath:s,isQueryFormat:a,viewerType:i}=Bo(),c=new URLSearchParams(window.location.search),u=ti(),p=Qa();let l;a?l=ei(c):o!==null&&(l=await oi(o));const m=!!(l!=null&&l.resultId),f=Ja({sceneFormats:(l==null?void 0:l.sceneFormats)??{},formatPreference:p,isMobile:n,excludePly:m});l={...l,...f,pipelineUuid:(l==null?void 0:l.pipelineUuid)||qa(f.modelUrl)},console.log("isMobile",n);const x=$t(l==null?void 0:l.modelUrl)||null,C={viewerUuid:o,isMobile:n,resultId:(l==null?void 0:l.resultId)??null,pipelineUuid:(l==null?void 0:l.pipelineUuid)??null,sceneFormat:(l==null?void 0:l.sceneFormat)??null,sceneFormats:(l==null?void 0:l.sceneFormats)??{},viewerType:i,modelFormat:x,modelCameras:(l==null?void 0:l.modelCameras)??null,deferredLoad:u,analyticsSource:a?"query":"viewer_uuid"};if(s){const w=`https://hdm.road.ly/pipelines?uuid=${l.pipelineUuid}`,j=document.createElement("div");j.style.position="absolute",j.style.top="10px",j.style.left="10px",j.style.color="white",j.style.backgroundColor="rgba(0, 0, 0, 0.5)",j.style.padding="5px",j.style.borderRadius="5px",j.style.display="flex",j.style.flexDirection="column";const _=document.createElement("span");_.textContent=`Pipeline UUID: ${l.pipelineUuid}`,_.style.cursor="pointer",_.title="Click to copy",_.addEventListener("click",()=>{Ho(l.pipelineUuid).then(()=>{const k=_.textContent;_.textContent="Pipeline UUID: Copied!",setTimeout(()=>{_.textContent=k},1500)}).catch(()=>{})});const M=document.createElement("a");return M.href=w,M.textContent="Open pipeline",M.target="_blank",M.rel="noopener noreferrer",M.style.color="#7facea",j.appendChild(_),j.appendChild(M),document.body.appendChild(j),{viewer:null,appProps:C}}else{Oa(e,t).catch(N=>console.error("Failed to init statsig:",N));const{modelUrl:w,modelFallbackUrl:j,modelCameras:_,modelNormal:M,modelCamera:k,shDegree:T,smoothedTraj:U}=l,D=async()=>{const N=await pi(w,_,M,k),{initialCameraPosition:z,initialCameraLookAt:A,initialCameraQuaternion:W,earthNormal:O}=N;console.log("Initial camera state",{initialCameraPosition:z,initialCameraLookAt:A,initialCameraQuaternion:W,earthNormal:O,modelFormat:$t(w),isProgressivelyLoadable:Yo(w)});const q=$t(w)||null,$={rootElement:document.getElementById("viewer"),modelUrl:w,modelFallbackUrl:j,modelCameras:_,modelNormal:M,modelCamera:k,shDegree:T,smoothedTraj:U,initialCameraPosition:z,initialCameraLookAt:A,initialCameraQuaternion:W,earthNormal:O,isMobile:n,shortId:o,viewerUuid:o,pipelineUuid:(l==null?void 0:l.pipelineUuid)??null,deferSceneLoad:!1,sceneAnalytics:Go({sceneId:o||(l==null?void 0:l.resultId),viewerUuid:o,resultId:(l==null?void 0:l.resultId)??null,pipelineUuid:l==null?void 0:l.pipelineUuid,sceneFormat:(l==null?void 0:l.sceneFormat)??null,viewerType:i,modelFormat:q,isMobile:n,deferredLoad:u,source:a?"query":"viewer_uuid"})};return mi(i,$)};return u?{viewer:null,appProps:{...C,loadDeferredViewer:D}}:{viewer:await D(),appProps:C}}}const Jn="https://app.splatica.com",hi="/?register",vi="social_launch",un="Create Your Own Scene",dn="Turn Insta360 / Antigravity videos into Gaussian Splatting scenes";function gi(e){const t=`scene_${e}`,n=new URL(hi,Jn);n.searchParams.set("utm_source","viewer"),n.searchParams.set("utm_medium","upload_btn_cta"),n.searchParams.set("utm_campaign",vi),n.searchParams.set("utm_content",t);const o=new URL("/",Jn);return o.searchParams.set("utm_source","viewer"),o.searchParams.set("utm_medium","splatica_logo"),o.searchParams.set("utm_content",t),{ctaUrl:n.toString(),logoUrl:o.toString()}}var mt="__joysticks_identifiers__",it="__active_joysticks__",qn={ALL:-1,LEFT:0,MIDDLE:1,RIGHT:2},Qn=(function(){function e(t,n){var o=this;this.JOYSTICK_TRANSITION="border-radius 0.2s ease-in-out",this.options={maxRange:100,level:10,radius:50,joystickRadius:30,opacity:.8,leftToRight:!0,bottomToUp:!0,containerClass:"",controllerClass:"",joystickClass:"",x:"50%",y:"50%",distortion:!1,dynamicPosition:!1,dynamicPositionTarget:null,mouseClickButton:-1,hideContextMenu:!1},this.x=0,this.y=0,this.leveledX=0,this.leveledY=0,this.angle=0,this.distance=0,this.started=!1,this.identifier=null,this.mouseButton=-1,this.addEventListeners=function(){var s=o.options.mouseClickButton;if((typeof s=="string"&&Object.keys(qn).includes(s)||typeof s=="number"&&s<6&&s>-2)&&(o.mouseButton=typeof s=="string"?qn[s]:s),o.options.dynamicPosition){var a=o.options.dynamicPositionTarget||document;a.addEventListener("mousedown",o.dynamicPositioningMouse),document.addEventListener("mouseup",o.removeDynamicPositioning),a.addEventListener("touchstart",o.dynamicPositioningTouch),document.addEventListener("touchmove",o.onTouchEvent,{passive:!1}),document.addEventListener("touchend",o.removeDynamicPositioning),o.options.hideContextMenu&&(a.addEventListener("contextmenu",function(i){return i.preventDefault()}),o.joystick.addEventListener("contextmenu",function(i){return i.preventDefault()}))}else o.joystick.addEventListener("touchstart",o.onStartEvent),o.joystick.addEventListener("touchmove",o.onTouchEvent),o.joystick.addEventListener("touchend",o.onStopEvent),o.joystick.addEventListener("mousedown",o.onStartEvent),o.options.hideContextMenu&&(o.container.addEventListener("contextmenu",function(i){return i.preventDefault()}),o.joystick.addEventListener("contextmenu",function(i){return i.preventDefault()}));window.addEventListener("resize",o.recenterJoystick)},this.dynamicPositioningMouse=function(s){if(o.identifier===null&&!(o.mouseButton!==-1&&s.button!==o.mouseButton)){var a=s.x+"-"+s.y;if(!window[mt].has(a)){o.identifier=a,window[mt].add(o.identifier);var i=s.clientX,c=s.clientY;o.container.style.left=i+"px",o.container.style.top=c+"px",o.container.style.bottom="unset",o.container.style.right="unset",document.body.appendChild(o.container),o.recenterJoystick(),o.onStartEvent(s,!1)}}},this.dynamicPositioningTouch=function(s){if(o.identifier===null){var a=s.changedTouches[0].identifier;if(!window[mt].has(a)){o.identifier=a,window[mt].add(a);for(var i,c=0;c<s.touches.length;c++){var u=s.touches.item(c);if(o.identifier===(u==null?void 0:u.identifier)){i=u;break}}if(i){var p=i.clientX,l=i.clientY;o.container.style.left=p+"px",o.container.style.top=l+"px",o.container.style.bottom="unset",o.container.style.right="unset",document.body.appendChild(o.container),o.recenterJoystick(),o.onStartEvent(s,!1)}}}},this.removeDynamicPositioning=function(s){if(o.identifier!==null){if(s.type==="touchend"){var a=s.changedTouches[0].identifier;if(o.identifier!==a)return}else if(o.mouseButton!==-1&&s.button!==o.mouseButton)return;window[mt].delete(o.identifier),o.identifier=null,o.onStopEvent(s),o.container.remove()}},this.updateCoordinates=function(s,a){o.distance=+Math.sqrt(Math.pow(s-o.centerX,2)+Math.pow(a-o.centerY,2)).toFixed(4),o.angle=+Math.atan2(a-o.centerY,s-o.centerX).toFixed(4);var i=o.distance>o.options.maxRange?o.options.maxRange:o.distance;o.x=Math.round(Math.cos(o.angle)*i),o.y=-Math.round(Math.sin(o.angle)*i),o.leveledX=Math.round(o.x/o.options.maxRange*o.options.level),o.leveledY=Math.round(o.y/o.options.maxRange*o.options.level),o.joystick.style.left=o.options.radius+o.x+"px",o.joystick.style.bottom=o.options.radius+o.y+"px",o.options.distortion&&o.distortJoystick(),o.onMove&&o.onMove({x:o.x,y:o.y,leveledX:o.leveledX,leveledY:o.leveledY,distance:o.distance,angle:o.angle})},this.resetCoordinates=function(){o.x=0,o.y=0,o.leveledX=0,o.leveledY=0,o.angle=0,o.distance=0,o.joystick.style.left=o.options.radius+"px",o.joystick.style.bottom=o.options.radius+"px",o.options.distortion&&o.distortJoystick(),o.onMove&&o.onMove({x:o.x,y:o.y,leveledX:o.leveledX,leveledY:o.leveledY,distance:o.distance,angle:o.angle})},this.distortJoystick=function(){o.distance>o.options.maxRange*.7?(o.joystick.style.borderRadius="70% 80% 70% 15%",o.joystick.style.transform="translate(-50%, 50%) rotate(".concat(+o.angle+Math.PI/4,"rad)")):(o.joystick.style.borderRadius="50%",o.joystick.style.transform="translate(-50%, 50%) rotate(".concat(Math.PI/4,"rad})"))},this.onStartEvent=function(s,a){if(a===void 0&&(a=!0),s.type==="mousedown"){if(o.mouseButton!==-1&&s.button!==o.mouseButton)return;window.addEventListener("mousemove",o.onMouseEvent),window.addEventListener("mouseup",o.onStopEvent)}else if(a){var i=s.changedTouches[0].identifier;o.identifier=i}o.started=!0,o.joystick.style.transition=o.JOYSTICK_TRANSITION,o.joystick.style.cursor="grabbing"},this.onStopEvent=function(s){if(s.type==="mouseup"){if(o.mouseButton!==-1&&s.button!==o.mouseButton)return;window.removeEventListener("mousemove",o.onMouseEvent),window.removeEventListener("mouseup",o.onStopEvent)}else o.identifier=null;o.started=!1,o.joystick.style.transition="all 0.2s ease-in-out",o.joystick.style.cursor="grab",o.resetCoordinates()},this.onTouchEvent=function(s){for(var a,i=0;i<s.touches.length;i++){var c=s.touches.item(i);if(o.identifier===(c==null?void 0:c.identifier)){a=c;break}}if(a){s.preventDefault();var u=a.clientX,p=a.clientY;o.updateCoordinates(u,p)}},this.onMouseEvent=function(s){if(o.started){s.preventDefault();var a=s.clientX,i=s.clientY;o.updateCoordinates(a,i)}},this.recenterJoystick=function(){o.centerX=o.controller.getBoundingClientRect().left+o.options.radius,o.centerY=o.controller.getBoundingClientRect().top+o.options.radius},this.options=Object.assign(this.options,t),this.onMove=n,this.validate(),this.init()}return e.prototype.validate=function(){var t=this;window[it]&&window[it].length>0&&window[it].some(function(n){return n.options.dynamicPosition&&(n.options.dynamicPositionTarget||document)===(t.o
9ptions.dynamicPositionTarget||document)})&&console.error("Multiple dynamicPosition should be used with different target elements (dynamicPositionTarget) to prevent event collision.")},e.prototype.init=function(){window[mt]||(window[mt]=new Set),this.id=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),window[it]=Object.assign(window[it]||[],[this]),this.style=document.createElement("style"),this.style.setAttribute("id","style-"+this.id),this.style.innerHTML=` 10 .joystick-container-`.concat(this.id,` { 11 box-sizing: border-box; 12 position: fixed; 13 outline: none; 14 `).concat(this.options.leftToRight?"left":"right",": ").concat(this.options.x,`; 15 `).concat(this.options.bottomToUp?"bottom":"top",": ").concat(this.options.y,`; 16 transform: translate(`).concat(this.options.dynamicPosition||this.options.leftToRight?"-50%":"50%",", ").concat(this.options.dynamicPosition||!this.options.bottomToUp?"-50%":"50%",`); 17 } 18 19 .joystick-controller-`).concat(this.id,` { 20 box-sizing: border-box; 21 outline: none; 22 opacity: `).concat(this.options.opacity,`; 23 width: `).concat(this.options.radius*2,`px; 24 height: `).concat(this.options.radius*2,`px; 25 border-radius: 50%; 26 position: relative; 27 outline: 2px solid #4c4c4c77; 28 background: radial-gradient(circle,#ebebeb55, #5c5c5c55); 29 } 30 31 .joystick-`).concat(this.id,` { 32 box-sizing: border-box; 33 outline: none; 34 position: absolute; 35 cursor: grab; 36 width: `).concat(this.options.joystickRadius*2,`px; 37 height: `).concat(this.options.joystickRadius*2,`px; 38 z-index: 1; 39 border-radius: 50%; 40 left: 50%; 41 bottom: 50%; 42 transform: translate(-50%, 50%); 43 background: radial-gradient(#000c, #3e3f46aa); 44 transition: `).concat(this.JOYSTICK_TRANSITION,`; 45 } 46 `),this.container=document.createElement("div"),this.container.setAttribute("id","joystick-container-"+this.id),this.container.setAttribute("class","joystick-container-"+this.id+" "+this.options.containerClass),this.controller=document.createElement("div"),this.controller.setAttribute("id","joystick-controller-"+this.id),this.controller.setAttribute("class","joystick-controller-"+this.id+" "+this.options.controllerClass),this.joystick=document.createElement("div"),this.joystick.setAttribute("id","joystick-"+this.id),this.joystick.setAttribute("class","joystick-"+this.id+" "+this.options.joystickClass),this.controller.appendChild(this.joystick),this.container.appendChild(this.controller),document.head.appendChild(this.style),this.options.dynamicPosition||document.body.appendChild(this.container),this.addEventListeners(),this.recenterJoystick(),this.resetCoordinates()},e.prototype.destroy=function(){var t=this;if(this.options.dynamicPosition){var n=this.options.dynamicPositionTarget||document;n.removeEventListener("mousedown",this.dynamicPositioningMouse),document.removeEventListener("mouseup",this.removeDynamicPositioning),n.removeEventListener("touchstart",this.dynamicPositioningTouch),document.removeEventListener("touchmove",this.onTouchEvent),document.removeEventListener("touchend",this.removeDynamicPositioning)}else this.joystick.removeEventListener("touchstart",this.onStartEvent),this.joystick.removeEventListener("touchmove",this.onTouchEvent),this.joystick.removeEventListener("touchend",this.onStopEvent),this.joystick.removeEventListener("mousedown",this.onStartEvent);window.removeEventListener("resize",this.recenterJoystick),this.style.remove(),this.container.remove(),Array.isArray(window[it])&&(window[it]=window[it].filter(function(o){return o!==t}))},e})();function bi(){const e=(t,n,o)=>{const s=new KeyboardEvent(t,{code:n});Object.defineProperty(s,"speedRate",{value:Math.abs(o),enumerable:!0}),window.dispatchEvent(s)};return v.useEffect(()=>{const n=(a,i,c)=>{const u=Math.min(Math.sqrt(a*a+i*i)/70,1),p=Math.abs(a),l=Math.abs(i),m=a==0&&i==0?0:Math.min(p,l)/Math.max(p,l),f=Math.sign(a)*u*(p>l?1:m),x=Math.sign(i)*u*(l>p?1:m);return[c*f,c*x]},o=new Qn({maxRange:70,level:10,radius:50,joystickRadius:30,opacity:.5,leftToRight:!0,bottomToUp:!0,containerClass:"joystick-container-position",controllerClass:"joystick-controller-position",joystickClass:"joystick-position",distortion:!0,x:"20%",y:"10%",mouseClickButton:"ALL",hideContextMenu:!1},({x:a,y:i,leveledX:c,leveledY:u,distance:p,angle:l})=>{const[f,x]=n(a,i,7);f>0?e("keydown","KeyD",f):e("keyup","KeyD",f),f<0?e("keydown","KeyA",f):e("keyup","KeyA",f),x>0?e("keydown","KeyW",x):e("keyup","KeyW",x),x<0?e("keydown","KeyS",x):e("keyup","KeyS",x)}),s=new Qn({maxRange:70,level:10,radius:50,joystickRadius:30,opacity:.5,leftToRight:!1,bottomToUp:!0,containerClass:"joystick-container-camera",controllerClass:"joystick-controller-camera",joystickClass:"joystick-camera",distortion:!0,x:"20%",y:"10%",mouseClickButton:"ALL",hideContextMenu:!1},({x:a,y:i,leveledX:c,leveledY:u,distance:p,angle:l})=>{const[f,x]=n(a,i,10);f>0?e("keydown","F22",f):e("keyup","F22",f),f<0?e("keydown","F23",f):e("keyup","F23",f),x>0?e("keydown","F20",x):e("keyup","F20",x),x<0?e("keydown","F21",x):e("keyup","F21",x)});return()=>{o.destroy(),s.destroy()}},[]),null}var pn={exports:{}};/*! 47 Copyright (c) 2018 Jed Watson. 48 Licensed under the MIT License (MIT), see 49 http://jedwatson.github.io/classnames 50*/var eo;function yi(){return eo||(eo=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var a="",i=0;i<arguments.length;i++){var c=arguments[i];c&&(a=s(a,o(c)))}return a}
50function o(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return n.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var i="";for(var c in a)t.call(a,c)&&a[c]&&(i=s(i,c));return i}function s(a,i){return i?a?a+" "+i:a+i:a}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(pn)),pn.exports}var xi=yi();const te=hr(xi);function Lt(){return Lt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Lt.apply(this,arguments)}var wi=function(t,n){n===void 0&&(n=!0),v.useEffect(function(){if(n){var o=function(a){a.key==="Escape"&&t(a)};return document.addEventListener("keyup",o),function(){n&&document.removeEventListener("keyup",o)}}},[t,n])},Si=function(t,n){n===void 0&&(n=!0),v.useEffect(function(){if(n){var o=function(){t()};return window.addEventListener("resize",o),function(){n&&window.removeEventListener("resize",o)}}},[t,n])},_i=function(t,n,o){o===void 0&&(o=!0),v.useEffect(function(){if(o){var s=function(i){var c=Array.isArray(t)?t:[t],u=!1;
50c.forEach(function(p){if(!p.current||p.current.contains(i.target)){u=!0;return}}),i.stopPropagation(),u||n(i)};return document.addEventListener("mousedown",s),document.addEventListener("touchstart",s),function(){o&&(document.removeEventListener("mousedown",s),document.removeEventListener("touchstart",s))}}},[t,n,o])},Ci=function(t,n){n===void 0&&(n=!0),v.useEffect(function(){if(n){var o=function(a){if(a.keyCode===9){var i,c=t==null||(i=t.current)===null||i===void 0?void 0:i.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),u=Array.prototype.slice.call(c);if(u.length===1){a.preventDefault();return}var p=u[0],l=u[u.length-1];a.shiftKey&&document.activeElement===p?(a.preventDefault(),l.focus()):document.activeElement===l&&(a.preventDefault(),p.focus())}};return document.addEventListener("keydown",o),function(){n&&document.removeEventListener("keydown",o)}}},[t,n])},ji=typeof window<"u"?v.useLayoutEffect:v.useEffect,Mt={popupContent:{tooltip:{position:"absolute",zIndex:999},modal:{position:"relative",margin:"auto"}},popupArrow:{height:"8px",width:"16px",position:"absolute",background:"transparent",color:"#FFF",zIndex:-1},overlay:{tooltip:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0",zIndex:999},modal:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0",display:"flex",zIndex:999}}},ki=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],Ei=function(t,n,o,s,a){var i=a.offsetX,c=a.offsetY,u=s?8:0,p=o.split(" "),l=t.top+t.height/2,m=t.left+t.width/2,f=n.height,x=n.width,C=l-f/2,w=m-x/2,j="",_="0%",M="0%";switch(p[0]){case"top":C-=f/2+t.height/2+u,j="rotate(180deg) translateX(50%)",_="100%",M="50%";break;case"bottom":C+=f/2+t.height/2+u,j="rotate(0deg) translateY(-100%) translateX(-50%)",M="50%";break;case"left":w-=x/2+t.width/2+u,j=" rotate(90deg) translateY(50%) translateX(-25%)",M="100%",_="50%";break;case"right":w+=x/2+t.width/2+u,j="rotate(-90deg) translateY(-150%) translateX(25%)",_="50%";break}switch(p[1]){case"top":C=t.top,_=t.height/2+"px";break;case"bottom":C=t.top-f+t.height,_=f-t.height/2+"px";break;case"left":w=t.left,M=t.width/2+"px";break;case"right":w=t.left-x+t.width,M=x-t.width/2+"px";break}return C=p[0]==="top"?C-c:C+c,w=p[0]==="left"?w-i:w+i,{top:C,left:w,transform:j,arrowLeft:M,arrowTop:_}},Mi=function(t){var n={top:0,left:0,width:window.innerWidth,height:window.innerHeight};if(typeof t=="string"){var o=document.querySelector(t);o!==null&&(n=o.getBoundingClientRect())}return n},Ni=function(t,n,o,s,a,i){var c=a.offsetX,u=a.offsetY,p={arrowLeft:"0%",arrowTop:"0%",left:0,top:0,transform:"rotate(135deg)"},l=0,m=Mi(i),f=Array.isArray(o)?o:[o];for((i||Array.isArray(o))&&(f=[].concat(f,ki));l<f.length;){p=Ei(t,n,f[l],s,{offsetX:c,offsetY:u});var x={top:p.top,left:p.left,width:n.width,height:n.height};if(x.top<=m.top||x.left<=m.left||x.top+x.height>=m.top+m.height||x.left+x.width>=m.left+m.width)l++;else break}return p},Pi=0,Li=function(){var t=document.getElementById("popup-root");return t===null&&(t=document.createElement("div"),t.setAttribute("id","popup-root"),document.body.appendChild(t)),t},on=v.forwardRef(function(e,t){var n=e.trigger,o=n===void 0?null:n,s=e.onOpen,a=s===void 0?function(){}:s,i=e.onClose,c=i===void 0?function(){}:i,u=e.defaultOpen,p=u===void 0?!1:u,l=e.open,m=l===void 0?void 0:l,f=e.disabled,x=f===void 0?!1:f,C=e.nested,w=C===void 0?!1:C,j=e.closeOnDocumentClick,_=j===void 0?!0:j,M=e.repositionOnResize,k=M===void 0?!0:M,T=e.closeOnEscape,U=T===void 0?!0:T,D=e.on,Y=D===void 0?["click"]:D,N=e.contentStyle,z=N===void 0?{}:N,A=e.arrowStyle,W=A===void 0?{}:A,O=e.overlayStyle,q=O===void 0?{}:O,Q=e.className,$=Q===void 0?"":Q,ge=e.position,Se=ge===void 0?"bottom center"
50:ge,G=e.modal,Pe=G===void 0?!1:G,_e=e.lockScroll,Ce=_e===void 0?!1:_e,be=e.arrow,ye=be===void 0?!0:be,ze=e.offsetX,J=ze===void 0?0:ze,re=e.offsetY,Le=re===void 0?0:re,se=e.mouseEnterDelay,xe=se===void 0?100:se,je=e.mouseLeaveDelay,Ae=je===void 0?100:je,me=e.keepTooltipInside,Oe=me===void 0?!1:me,Ve=e.children,We=v.useState(m||p),ee=We[0],De=We[1],B=v.useRef(null),F=v.useRef(null),Te=v.useRef(null),fe=v.useRef(null),Ze=v.useRef("popup-"+ ++Pi),le=Pe?!0:!o,Ie=v.useRef(0);ji(function(){return ee?(fe.current=document.activeElement,g(),h(),Ke()):d(),function(){clearTimeout(Ie.current)}},[ee]),v.useEffect(function(){typeof m=="boolean"&&(m?b():E())},[m,x]);var b=function(V){ee||x||(De(!0),setTimeout(function(){return a(V)},0))},E=function(V){var we;!ee||x||(De(!1),le&&((we=fe.current)===null||we===void 0||we.focus()),setTimeout(function(){return c(V)},0))},R=function(V){V==null||V.stopPropagation(),ee?E(V):b(V)},X=function(V){clearTimeout(Ie.current),Ie.current=setTimeout(function(){return b(V)},xe)},nt=function(V){V==null||V.preventDefault(),R()},ct=function(V){clearTimeout(Ie.current),Ie.current=setTimeout(function(){return E(V)},Ae)},Ke=function(){le&&Ce&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},d=function(){le&&Ce&&(document.getElementsByTagName("body")[0].style.overflow="auto")},h=function(){var V,we=F==null||(V=F.current)===null||V===void 0?void 0:V.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),oe=Array.prototype.slice.call(we)[0];oe==null||oe.focus()};v.useImperativeHandle(t,function(){return{open:function(){b()},close:function(){E()},toggle:function(){R()}}});var g=function(){if(!(le||!ee)&&!(!(B!=null&&B.current)||!(B!=null&&B.current)||!(F!=null&&F.current))){var V=B.current.getBoundingClientRect(),we=F.current.getBoundingClientRect(),oe=Ni(V,we,Se,ye,{offsetX:J,offsetY:Le},Oe);if(F.current.style.top=oe.top+window.scrollY+"px",F.current.style.left=oe.left+window.scrollX+"px",ye&&Te.current){var Ge,ut;Te.current.style.transform=oe.transform,Te.current.style.setProperty("-ms-transform",oe.transform),Te.current.style.setProperty("-webkit-transform",oe.transform),Te.current.style.top=((Ge=W.top)===null||Ge===void 0?void 0:Ge.toString())||oe.arrowTop,Te.current.style.left=((ut=W.left)===null||ut===void 0?void 0:ut.toString())||oe.arrowLeft}}};wi(E,U),Ci(F,ee&&le),Si(g,k),_i(o?[F,B]:[F],E,_&&!w);var P=function(){for(var V={key:"T",ref:B,"aria-describedby":Ze.current},we=Array.isArray(Y)?Y:[Y],oe=0,Ge=we.length;oe<Ge;oe++)switch(we[oe]){case"click":V.onClick=R;break;case"right-click":V.onContextMenu=nt;break;case"hover":V.onMouseEnter=X,V.onMouseLeave=ct;break;case"focus":V.onFocus=X,V.onBlur=ct;break}if(typeof o=="function"){var ut=o(ee);return!!o&&et.cloneElement(ut,V)}return!!o&&et.cloneElement(o,V)},L=function(){var V=le?Mt.popupContent.modal:Mt.popupContent.tooltip,we={className:"popup-content "+($!==""?$.split(" ").map(function(oe){return oe+"-content"}).join(" "):""),style:Lt({},V,z,{pointerEvents:"auto"}),ref:F,onClick:function(Ge){Ge.stopPropagation()}};return!Pe&&Y.indexOf("hover")>=0&&(we.onMouseEnter=X,we.onMouseLeave=ct),we},ue=function(){return et.createElement("div",Object.assign({},L(),{key:"C",role:le?"dialog":"tooltip",id:Ze.current}),ye&&!le&&et.createElement("div",{ref:Te,style:Mt.popupArrow},et.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+($!==""?$.split(" ").map(function(V){return V+"-arrow"}).join(" "):""),viewBox:"0 0 32 16",style:Lt({position:"absolute"},W)},et.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),Ve&&typeof Ve=="function"?Ve(E,ee):Ve)},Be=!(Y.indexOf("hover")>=0),kt=le?Mt.overlay.modal:Mt.overlay.tooltip,Ot=[Be&&et.createElement("div",{key:"O","data-testid":"overlay","data-
50popup":le?"modal":"tooltip",className:"popup-overlay "+($!==""?$.split(" ").map(function(ce){return ce+"-overlay"}).join(" "):""),style:Lt({},kt,q,{pointerEvents:_&&w||le?"auto":"none"}),onClick:_&&w?E:void 0,tabIndex:-1},le&&ue()),!le&&ue()];return et.createElement(et.Fragment,null,P(),ee&&vr.createPortal(Ot,Li()))});const ie={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,focusable:"false"};function Ti(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"}),r.jsx("path",{d:"M3.6 9h16.8"}),r.jsx("path",{d:"M3.6 15h16.8"}),r.jsx("path",{d:"M11.5 3a17 17 0 0 0 0 18"}),r.jsx("path",{d:"M12.5 3a17 17 0 0 1 0 18"})]})}function Ii(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M9 15l6 -6"}),r.jsx("path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"}),r.jsx("path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"})]})}function Ri(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M7 8l-4 4l4 4"}),r.jsx("path",{d:"M17 8l4 4l-4 4"}),r.jsx("path",{d:"M14 4l-4 16"})]})}function Ai(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"}),r.jsx("path",{d:"M12 9h.01"}),r.jsx("path",{d:"M11 12h1v4h1"})]})}function Xo(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M4 7l16 0"}),r.jsx("path",{d:"M10 11l0 6"}),r.jsx("path",{d:"M14 11l0 6"}),r.jsx("path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"}),r.jsx("path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"})]})}function Fi(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M4 17l13 -13l3 3l-13 13z"}),r.jsx("path",{d:"M14 7l3 3"}),r.jsx("path",{d:"M11.5 9.5l2 2"}),r.jsx("path",{d:"M9 12l3 3"}),r.jsx("path",{d:"M6.5 14.5l2 2"})]})}function Oi(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M5 17l14 -10"}),r.jsx("path",{d:"M5 17h.01"}),r.jsx("path",{d:"M19 7h.01"})]})}function Vi(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M4 17l5 -8l5 5l6 -8"}),r.jsx("path",{d:"M4 17h.01"}),r.jsx("path",{d:"M9 9h.01"}),r.jsx("path",{d:"M14 14h.01"}),r.jsx("path",{d:"M20 6h.01"})]})}function Di(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M6 8l7 -4l6 6l-3 8l-9 1l-3 -7z"}),r.jsx("path",{d:"M6 8h.01"}),r.jsx("path",{d:"M13 4h.01"}),r.jsx("path",{d:"M19 10h.01"}),r.jsx("path",{d:"M16 18h.01"}),r.jsx("path",{d:"M7 19h.01"}),r.jsx("path",{d:"M4 12h.01"})]})}function Bi(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M12 3l8 4.5v9l-8 4.5l-8 -4.5v-9z"}),r.jsx("path",{d:"M12 12l8 -4.5"}),r.jsx("path",{d:"M12 12v9"}),r.jsx("path",{d:"M12 12l-8 -4.5"})]})}function Hi(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M2 12s3.5 -7 10 -7s10 7 10 7s-3.5 7 -10 7s-10 -7 -10 -7z"}),r.jsx("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"})]})}function Ui(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M3 3l18 18"}),r.jsx("path",{d:"M10.6 10.6a2 2 0 0 0 2.8 2.8"}),r.jsx("path",{d:"M9.5 5.4a9.7 9.7 0 0 1 2.5 -.4c6.5 0 10 7 10 7a18.5 18.5 0 0 1 -2.4 3.4"}),r.jsx("path",{d:"M6.5 6.6c-2.8 1.8 -4.5 5.4 -4.5 5.4s3.5 7 10 7c1.8 0 3.4 -.5 4.8 -1.3"})]})}function zi(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"}),r.jsx("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"})]})}function Wi(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M3 5a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),r.jsx("path",{d:"M7 5h9.5a3.5 3.5 0 0 1 0 7h-9a3.5 3.5 0 0 0 0 7h13.5"}),r.jsx("path",{d:"M18 16l3 3l-3 3"})]})}function Gi(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M3 5a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),r.jsx("path",{d:"M7 5h9.5a3.5 3.5 0 0 1 0 7h-9a3.5 3.5 0 0 0 0 7h13.5"}),r.jsx("path",{d:"M18 16l3 3l-3 3"}),r.jsx("path",{d:"M21 3l-18 18"})]})}function $o(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M12 3a9 9 0 1 0 9 9"})]})}function Yi(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M5 12l-2 0l9 -9l9 9l-2 0"}),r.jsx("path",{d:"M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7"}),r.jsx("path",{d:"M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6"})]})}function to(){return r.jsxs("svg",{...ie,strokeWidth:3,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M12 5l0 14"}),r.jsx("path",{d:"M5 12l14 0"})]})}function Xi(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),r.jsx("path",{d:"M21 3v5h-5"}),r.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),r.jsx("path",{d:"M8 16H3v5"})]})}function $i(){return r.jsxs("svg",{...ie,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"m12.296 3.464 3.02 3.956"}),r.jsx("path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z"}),r.jsx("path",{d:"M3 11h18v8a2 2 0 0 1 -2 2H5a2 2 0 0 1 -2 -2z"}),r.jsx("path",{d:"m6.18 5.276 3.1 3.899"}
50),r.jsx("path",{d:"M10.5 13l5 3l-5 3z",fill:"currentColor",stroke:"none"})]})}const Ue=e=>{e.stopPropagation()};function Zi(){const[e,t]=v.useState(!1),[n,o]=v.useState(!0),[s,a]=v.useState(!0),c=(()=>{const{viewerUuid:p}=Bo(),l=p?new URLSearchParams({viewerUuid:p}):new URLSearchParams(window.location.search);n?l.delete("no_ui"):l.set("no_ui","1"),s?l.delete("loadScene"):l.set("loadScene","0");const m=l.toString();return`<iframe src="${`${window.location.origin}/viewer/iframe_tpl.html${m?`?${m}`:""}`}" width="1200px" height="600px" frameborder="0"></iframe>`})(),u=async()=>{await navigator.clipboard.writeText(c),ae(ve.EMBED_CODE_COPIED,{show_ui:n?1:0,load_scene_immediately:s?1:0}),t(!0),setTimeout(()=>t(!1),1200)};return r.jsx(on,{trigger:r.jsx("button",{className:"viewer-icon-btn","aria-label":"Show embed code",title:"Show embed code",children:r.jsx(Ri,{})}),modal:!0,children:p=>r.jsxs("div",{className:"embed-popup",onKeyDown:Ue,onKeyUp:Ue,children:[r.jsx("button",{type:"button",className:"embed-popup__close","aria-label":"Close embed popup",onClick:p,children:"x"}),r.jsx("h3",{className:"embed-popup__title",children:"Embed this scene"}),r.jsxs("label",{className:"embed-popup__toggle",children:[r.jsx("input",{type:"checkbox",checked:n,onChange:l=>o(l.target.checked)}),r.jsx("span",{className:"embed-popup__toggle-switch"}),r.jsx("span",{className:"embed-popup__toggle-label",children:n?"Show Navigation UI":"Hide Navigation UI"})]}),r.jsxs("label",{className:"embed-popup__toggle",children:[r.jsx("input",{type:"checkbox",checked:s,onChange:l=>a(l.target.checked)}),r.jsx("span",{className:"embed-popup__toggle-switch"}),r.jsx("span",{className:"embed-popup__toggle-label",children:s?"Load scene immediately":"Tap to load scene (saves bandwidth)"})]}),r.jsx("p",{className:"embed-popup__hint",children:"Copy this snippet into your website:"}),r.jsx("pre",{className:"embed-popup__code",children:c}),r.jsx("button",{className:"embed-popup__copy-btn",disabled:e,onClick:u,children:e?"Copied!":"Copy embed code"})]})})}function mn({text:e}){const[t,n]=v.useState(!1),o=new KeyboardEvent("keydown",{code:`Key${e}`}),s=new KeyboardEvent("keyup",{code:`Key${e}`});function a(p){p.code===`Key${e}`&&n(!0)}function i(p){p.code===`Key${e}`&&n(!1)}function c(){window.dispatchEvent(o),n(!0)}function u(){window.dispatchEvent(s),n(!1)}return v.useEffect(()=>(document.addEventListener("keydown",a),document.addEventListener("keyup",i),()=>{document.removeEventListener("keydown",a),document.removeEventListener("keyup",i)}),[]),r.jsx("button",{onMouseDown:c,onMouseUp:u,className:`button button__text ${t?"button_active":""}`,children:e})}const Ki=()=>r.jsxs("svg",{width:"23",height:"20",viewBox:"0 0 23 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("path",{d:"M17.7712 10H5.22949",stroke:"white",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("path",{d:"M11.5003 15.8332L5.22949 9.99984L11.5003 4.1665",stroke:"white",strokeLinecap:"round",strokeLinejoin:"round"})]}),Ji=()=>r.jsxs("svg",{width:"23",height:"20",viewBox:"0 0 23 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("path",{d:"M5.22884 10H17.7705",stroke:"white",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("path",{d:"M11.4997 15.8332L17.7705 9.99984L11.4997 4.1665",stroke:"white",strokeLinecap:"round",strokeLinejoin:"round"})]}),Zo=()=>r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"23",height:"20",viewBox:"0 0 24 24",fill:"white",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-play-icon lucide-play",children:r.jsx("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})}
50),qi=1e-9,fn=1e3,no=0,Ct=.01,Qi=.01,Zt=2,el=600,tl=350,oo=28,Me={TIME:"time",SPEED:"speed"},nl={[Me.TIME]:"s",[Me.SPEED]:"m/s"},ol={[Me.TIME]:Qi,[Me.SPEED]:Ct},rl=Array.from({length:10},(e,t)=>t+1);function Ut(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.tagName==="SELECT"||e.isContentEditable)}function hn(e){return Number.isFinite(e)?String(Math.round(e*100)/100).replace(/\.0+$/,"").replace(/(\.\d*[1-9])0+$/,"$1"):""}function ro(e,t,n,o){return e>=n.left-o&&e<=n.right+o&&t>=n.top-o&&t<=n.bottom+o}function so(e,t){if(!e||!t)return null;if(typeof e.distanceTo=="function")return e.distanceTo(t);const n=Number(e.x)-Number(t.x),o=Number(e.y)-Number(t.y),s=Number(e.z)-Number(t.z);return[n,o,s].every(Number.isFinite)?Math.sqrt(n*n+o*o+s*s):null}function ao(e){return Number.isInteger(e)&&e>=1&&e<=10}const sl=({viewer:e=null})=>{const[t,n]=v.useState([]),[o,s]=v.useState(null),[a,i]=v.useState(null),[c,u]=v.useState(null),[p,l]=v.useState(null),[m,f]=v.useState(null),[x,C]=v.useState(Me.SPEED),[w,j]=v.useState({}),[,_]=v.useState(0),M=v.useRef(null),k=v.useRef(null),T=v.useRef(!1),U=v.useRef("mouse"),D=v.useRef(null),Y=v.useRef(new Map),N=d=>d===10?"Digit0":`Digit${d}`,z=c??p,A=d=>{var h;return(h=e==null?void 0:e.cameraPoses)==null?void 0:h[d]},W=()=>Object.keys((e==null?void 0:e.cameraPoses)||{}).map(d=>Number(d)).filter(ao).sort((d,h)=>d-h),O=(d,h,g={})=>{ae(d,{pose_slot:h,saved_pose_count:W().length,...g})},q=d=>{const h=W(),g=h.indexOf(d);return g>0?A(h[g-1]):null},Q=d=>W()[0]===d,$=d=>{if(!d)return!1;const h=d.transitionMs!==0||Object.prototype.hasOwnProperty.call(d,"transitionSpeed");return delete d.transitionSpeed,d.transitionMs=0,h},ge=(d,h={})=>{const g=new KeyboardEvent("keydown",{code:d,...h});window.dispatchEvent(g)},Se=d=>{j(h=>{const g={...h};return delete g[d],g})},G=(d,h)=>{if(u(null),h){l(d),D.current=null;return}l(null),D.current=d},Pe=d=>{Array.isArray(e==null?void 0:e.cameraPosesIAOrder)&&(e.cameraPosesIAOrder=[d,...e.cameraPosesIAOrder.filter(h=>Number(h)!==d)])},_e=d=>{if(typeof(e==null?void 0:e.addCameraPose)=="function"){e.addCameraPose(d),Pe(d),b();return}ge(N(d),{shiftKey:!0}),b()},Ce=d=>{if(typeof(e==null?void 0:e.goToCameraPose)=="function"){e.goToCameraPose(d);return}ge(N(d))},be=(d,{updateViewer:h=!0,source:g="scene_switcher"}={})=>{const P=t.includes(d);n(L=>L.includes(d)?L:[...L,d].sort((ue,Be)=>ue-Be)),s(d),_(L=>L+1),h?_e(d):typeof window<"u"&&window.setTimeout(()=>{b()&&_(L=>L+1)},0),O(ve.CAMERA_POSE_SAVED,d,{source:g,replaced_existing:P?1:0})},ye=(d,{updateViewer:h=!0,saveIfMissing:g=!0}={})=>{t.includes(d)?(s(d),h&&Ce(d)):g&&be(d,{updateViewer:h})},ze=(d,h)=>{const g=U.current==="mouse";if(T.current){d.preventDefault(),d.stopPropagation(),T.current=!1;return}if(d.shiftKey){be(h,{source:d.shiftKey?"shift_click":"click_empty_slot"}),G(h,g);return}ye(h),G(h,g)},J=()=>{if(ae(ve.CAMERA_ANIMATION_PLAYED,{saved_pose_count:W().length}),typeof(e==null?void 0:e.playCameraPoses)=="function"){e.playCameraPoses();return}ge("Space")},re=()=>{M.current&&(window.clearTimeout(M.current),M.current=null),T.current&&!k.current&&(k.current=window.setTimeout(()=>{T.current=!1,k.current=null},tl)),f(null)},Le=(d,h)=>{U.current=d.pointerType,!(d.pointerType==="mouse"||!t.includes(h))&&(T.current=!1,f(h),M.current=window.setTimeout(()=>{T.current=!0,D.current=null,l(null),u(h),f(null),M.current=null},el))},se=d=>{d.preventDefault()},xe=d=>h=>{h?Y.current.set(d,h):Y.current.delete(d)},je=d=>{if(typeof Element>"u"||!(d instanceof Element))return null;const h=d.closest("[data-pose-slot]");if(!h)return null;const g=Number(h.getAttribute("data-pose-slot"));return Number.isInteger(g)?g:null},Ae=(d,h)=>{const g=Y.current.get(d);if(!g)return!1;if(g.contains(document.activeElement))return!0;const{clientX:P,clientY:L}=h;if(ro(P,L,g.getBoundingClientRect(),oo))return!0;const ue=g.querySelector(".userControls__pose-menu");return!!(ue&&ro(P,L,ue.getBoundingClientRect(),oo))},me=d=>{D.current!==d&&(D.current!==null&&D.current!==d&&(D.current=null),t.includes(d)?(u(null),l(d)):(u(null),l(null)))},Oe=(d,h)=>{d.pointerType==="mouse"&&me(h)},Ve=d=>{D.current===d&&(D.current=null)},We=(d,h=null)=>{const g=h||A(d);if(!g||Q(d))return g?0:null;if(typeof(e==null?void 0:e._transitionMsForSegment)=="function"){const ue=q(d);if(ue)return e._transitionMsForSegment(g,ue)/fn}
50const P=ee(d,g),L=Number.isFinite(g.transitionSpeed)&&g.transitionSpeed>0?g.transitionSpeed:F(d);return Number.isFinite(P)&&Number.isFinite(L)&&L>0?P/L:Number.isFinite(g.transitionMs)?g.transitionMs/fn:null},ee=(d,h=null)=>{const g=h||A(d),P=q(d);if(!g||!P)return null;if(typeof(e==null?void 0:e._poseMotionDistance)=="function")return e._poseMotionDistance(P,g);const L=so(P.position,g.position),ue=so(P.target,g.target);return Number.isFinite(L)&&Number.isFinite(ue)?Math.max(L,ue):null},De=(d,h,g=null)=>{if(!Number.isFinite(h)||h<=0)return null;const P=ee(d,g);if(!Number.isFinite(P)||P<qi)return null;const L=P/h;return!Number.isFinite(L)||L<Ct?null:L},B=(d,h)=>{const g=A(d);if(!g||Q(d))return g&&h===0?($(g),!0):!1;const P=De(d,h);return Number.isFinite(P)?(g.transitionSpeed=P,delete g.transitionMs,!0):!1},F=d=>{const h=A(d);return!h||Q(d)?null:Number.isFinite(h.transitionSpeed)&&h.transitionSpeed>0?h.transitionSpeed:Number.isFinite(e==null?void 0:e.defaultPoseTransitionSpeed)&&e.defaultPoseTransitionSpeed>0?e.defaultPoseTransitionSpeed:Zt},Te=d=>Q(d)?hn(0):Object.prototype.hasOwnProperty.call(w,d)?w[d]:x===Me.TIME?hn(We(d)):hn(F(d)),fe=(d,h)=>{!A(d)||Q(d)||(C(h),j({}),Ie(d),_(P=>P+1))},Ze=(d,h)=>{const g=A(d);if(!g)return;if(Q(d)){$(g),Se(d),_(L=>L+1);return}if(j(L=>({...L,[d]:h})),h===""){delete g.transitionMs,delete g.transitionSpeed,_(L=>L+1);return}const P=Number(h);if(Number.isFinite(P)){if(x===Me.TIME){if(P<=no||!B(d,P))return}else{if(P<Ct)return;g.transitionSpeed=P,delete g.transitionMs}_(L=>L+1)}},le=d=>{Se(d)},Ie=(d,h=null)=>{const g=h||A(d);if(!g)return!1;if(Q(d))return $(g);if(Number.isFinite(g.transitionSpeed)&&g.transitionSpeed>0)return Object.prototype.hasOwnProperty.call(g,"transitionMs")?(delete g.transitionMs,!0):!1;if(Number.isFinite(g.transitionMs)&&g.transitionMs>0){const L=De(d,g.transitionMs/fn,g);if(Number.isFinite(L))return g.transitionSpeed=L,delete g.transitionMs,!0}const P=F(d)||Zt;return g.transitionSpeed=Math.max(P,Ct),delete g.transitionMs,!0},b=()=>{const d=W();let h=$(A(d[0]));return d.slice(1).forEach(g=>{h=Ie(g)||h}),h},E=(d,h)=>{d&&(Number.isFinite(h)&&h>0?d.transitionSpeed=Math.max(h,Ct):delete d.transitionSpeed,delete d.transitionMs)},R=d=>{e!=null&&e.cameraPoses&&delete e.cameraPoses[d],Array.isArray(e==null?void 0:e.cameraPosesIAOrder)&&(e.cameraPosesIAOrder=e.cameraPosesIAOrder.filter(h=>Number(h)!==d)),b(),n(h=>h.filter(g=>g!==d)),Se(d),u(null),l(null),_(h=>h+1),s(h=>h===d?null:h),O(ve.CAMERA_POSE_DELETED,d)},X=d=>{const h=A(d),g=Q(d);Ie(d,h);const P=g?null:Number.isFinite(h==null?void 0:h.transitionSpeed)&&h.transitionSpeed>0?h.transitionSpeed:F(d)||Zt;if(typeof(e==null?void 0:e._getCameraPose)=="function"&&(e!=null&&e.cameraPoses)){const L=e._getCameraPose();if(!L)return;E(L,P),e.cameraPoses[d]=L,Pe(d)}else{_e(d);const L=A(d);E(L,P)}b(),n(L=>L.includes(d)?L:[...L,d].sort((ue,Be)=>ue-Be)),s(d),_(L=>L+1),O(ve.CAMERA_POSE_SAVED,d,{source:"replace_pose",replaced_existing:h?1:0})};v.useEffect(()=>{const d=W(),h=b();n(d),h&&_(g=>g+1)},[e]),v.useEffect(()=>{const d=h=>{if(!h.isTrusted||Ut(h.target)||!h.code.startsWith("Digit"))return;const g=h.code==="Digit0"?10:Number(h.code.slice(5));ao(g)&&(h.shiftKey?be(g,{updateViewer:!1,source:"keyboard_shift"}):t.includes(g)?ye(g,{updateViewer:!1,saveIfMissing:!1}):be(g,{source:"keyboard_empty_slot"}))};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[t,o,e]),v.useEffect(()=>{const d=h=>{Ut(h.target)||(h.key==="ArrowLeft"?nt(-1):h.key==="ArrowRight"&&nt(1))};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[t,o]),v.useEffect(()=>{const d=g=>{g.isTrusted&&(Ut(g.target)||(g.key==="ArrowLeft"?i("prev"):g.key==="ArrowRight"?i("next"):g.code==="Space"&&(g.preventDefault(),i("space"))))},h=g=>{g.isTrusted&&(Ut(g.target)||(g.key==="ArrowLeft"||g.key==="ArrowRight"||g.code==="Space")&&i(null))};return window.addEventListener("keydown",d,{passive:!1}),window.addEventListener("keyup",h),()=>{window.removeEventListener("keydown",d),window.removeEventListener("keyup",h)}},[]),v.useEffect(()=>{if(z===null)return;const d=P=>{const L=je(P.target);if(L!==null&&L!==z){me(L);return}c===null&&!Ae(z,P)&&l(null)},h=P=>{const L=P.target;
50typeof Element<"u"&&L instanceof Element&&L.closest(`[data-pose-slot="${z}"]`)||(u(null),l(null))},g=P=>{P.key==="Escape"&&(u(null),l(null))};return window.addEventListener("pointermove",d,!0),window.addEventListener("pointerdown",h,!0),window.addEventListener("keydown",g),()=>{window.removeEventListener("pointermove",d,!0),window.removeEventListener("pointerdown",h,!0),window.removeEventListener("keydown",g)}},[z,c,t]),v.useEffect(()=>()=>{re(),k.current&&window.clearTimeout(k.current)},[]);const nt=d=>{if(!t.length)return;const h=t.indexOf(o);if(h===-1)return;const g=(h+d+t.length)%t.length;s(t[g]),Ce(t[g])},ct=d=>{const h=nl[x];return r.jsxs("div",{className:"userControls__pose-menu-main",children:[r.jsxs("div",{className:"userControls__pose-mode-toggle","aria-label":`Transition mode for pose ${d}`,children:[r.jsx("button",{type:"button",className:te("userControls__pose-mode-button",{"userControls__pose-mode-button--active":x===Me.TIME}),"aria-pressed":x===Me.TIME,onClick:()=>fe(d,Me.TIME),children:"Time"}),r.jsx("button",{type:"button",className:te("userControls__pose-mode-button",{"userControls__pose-mode-button--active":x===Me.SPEED}),"aria-pressed":x===Me.SPEED,onClick:()=>fe(d,Me.SPEED),children:"Speed"})]}),r.jsxs("label",{className:"userControls__pose-value-field",children:[r.jsx("input",{type:"number",min:x===Me.TIME?no:Ct,step:ol[x],value:Te(d),placeholder:"auto","aria-label":x===Me.TIME?`Transition time for pose ${d} in seconds`:`Transition speed for pose ${d} in units per second`,onChange:g=>Ze(d,g.target.value),onBlur:()=>le(d)}),r.jsx("span",{className:"userControls__pose-value-unit",children:h})]})]})},Ke=t[0]??null;return r.jsxs("div",{className:"userControls__scenes__container",children:[r.jsx("div",{className:"userControls__scene-buttons-container",children:rl.map(d=>{const h=t.includes(d),g=h&&d===Ke;return r.jsxs("div",{ref:xe(d),className:te("userControls__scene-slot",{"userControls__scene-slot--saved":h,"userControls__scene-slot--menu-open":z===d,"userControls__scene-slot--long-pressing":m===d}),"data-pose-slot":d,onPointerEnter:P=>Oe(P,d),onPointerLeave:()=>Ve(d),onContextMenu:se,children:[r.jsxs("button",{type:"button",onClick:P=>ze(P,d),onPointerDown:P=>Le(P,d),onPointerUp:re,onPointerCancel:re,onPointerLeave:re,className:te("button",{button_active:o===d},{button_saved:h}),children:[r.jsx("span",{className:"userControls__pose-long-press-fill","aria-hidden":"true"}),r.jsx("span",{className:"userControls__pose-label",children:d})]}),h?r.jsxs("div",{className:"userControls__pose-menu",onClick:P=>P.stopPropagation(),onPointerDown:P=>P.stopPropagation(),onContextMenu:se,onKeyDown:P=>P.stopPropagation(),children:[r.jsxs("div",{className:"userControls__pose-menu-header",children:[g?null:r.jsx("div",{className:"userControls__pose-menu-heading",children:"Transition"}),r.jsxs("div",{className:"userControls__pose-menu-actions",children:[r.jsx("button",{type:"button",className:"userControls__pose-icon-button userControls__pose-save-button","aria-label":`Save current camera to pose ${d}`,title:`Save current camera to pose ${d}`,onClick:()=>X(d),children:r.jsx(zi,{})}),r.jsx("button",{type:"button",className:"userControls__pose-icon-button userControls__pose-delete-button","aria-label":`Delete pose ${d}`,title:`Delete pose ${d}`,onClick:()=>R(d),children:r.jsx(Xo,{})})]})]}),g?null:ct(d)]}):null]},d)})}),r.jsxs("div",{className:"userControls__scenes-view",children:[r.jsxs("button",{className:te("userControls__scene-button","userControls__scenes-view-button",{button_active:a==="prev"}),onClick:()=>nt(-1),children:[r.jsx(Ki,{}),"Prev View"]}),r.jsxs("button",{onClick:()=>J(),className:te("userControls__scene-view-text","userControls__scenes-view-button",{button_active:a==="space"}),children:[r.jsx(Zo,{}),"Play Animation (Space)"]}),r.jsxs("button",{className:te("userControls__scene-button","userControls__scenes-view-button",{button_active:a==="next"}),onClick:()=>nt(1),children:["Next View",r.jsx(Ji,{})]})]})]})};function al({text:e}){const[t,n]=v.useState(!1),o=new KeyboardEvent("keydown",{code:`Key${e}`});function s(i){i.code===`Key${e}`&&(n(c=>!c),console.log(t))}function a(){n(i=>!i),window.dispatchEvent(o)}return v.useEffect(()=>(document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}),[]),r.jsx("button",{onClick:a,className:`button button__text ${t?"button_active":""}`,children:e})}const il=500,ll=350,cl=300,ul=600,dl=1080,pl=800;function ml({barMounted:e}){const t=v.useRef(null),[n,o]=v.useState(()=>typeof window<"u"?window.innerWidth:1200);v.useLayoutEffect(()=>{const c=t.current;if(!c||!e)return;const u=new ResizeObserver(p=>{var m,f;const l=(f=(m=p[0])==null?void 0:m.contentRect)==null?void 0:f.width;typeof l=="number"&&l>0&&o(l)});return u.observe(c),o(c.getBoundingClientRect().width),()=>u.disconnect()},[e]);const s=n>=ul,i=n>=(s?dl:pl);return{containerRef:t,showSides:s,showCenterScene:i}}function fl(){const[e,t]=v.useState(()=>({w:typeof window<"u"?window.innerWidth:1200,h:typeof window<"u"?window.innerHeight:800}));return v.useLayoutEffect(()=>{const n=()=>{t({w:window.innerWidth,h:window.innerHeight})};
50return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}function hl({viewer:e=null,exportControl:t=null}){const{w:n,h:o}=fl(),s=o>=il,a=!!t,{containerRef:i,showSides:c,showCenterScene:u}=ml({barMounted:s}),p=s&&a&&u,[l,m]=v.useState(!1),f=["Q","W","E","A","S","D"],x=["Z","X","C","V"],C=["U","I","O","J","K","L"],w=[{type:"Movement",controls:[{keys:"W A S D",action:"Move around"},{keys:"Q E",action:"Go up / down"},{keys:"Shift / Caps Lock",action:"Increase speed"},{keys:"R",action:"Reset to start position"}]},{type:"Camera",controls:[{keys:"U I O J K L",action:"Camera rotation"},{keys:"C",action:"Change camera mode"},{keys:"Shift + (+ / -)",action:"Change camera FOV"}]},{type:"Camera animation",controls:[{keys:"Click camera pose",action:"Save pose (if empty) or move to saved pose"},{keys:"Shift + click camera pose",action:"Save pose"},{keys:"0 - 9",action:"Move to saved pose"},{keys:"Space",action:"Play animation from first pose to last"},{keys:"Left / Right arrow",action:"Go to previous / next pose"}]},{type:"Viewer",controls:[{keys:"+ / -",action:"Change splats size"},{keys:"Z",action:"Toggle debug info"},{keys:"X",action:"Toggle point cloud mode"},{keys:"V",action:"Toggle camera look-at plane"},{keys:"T",action:"Toggle camera trajectory"}]},{type:"Measurements",controls:[{keys:"Ruler button",action:"Open measurements panel"},{keys:"Line / Box",action:"Start or stop creating that measurement type"},{keys:"Click surface",action:"Place line points or create a box"},{keys:"Enter / Esc",action:"Finish active measurement creation"},{keys:"Click on measurement or label",action:"Select measurement for editing"},{keys:"Drag line point",action:"Move point on the picked surface"},{keys:"Ctrl + drag line point",action:"Move point with TransformControls"},{keys:"Drag box axis",action:"Move selected box"},{keys:"Shift + drag box axis / face",action:"Resize selected box"},{keys:"Alt + drag box axis / ring",action:"Rotate selected box"},{keys:"Delete",action:"Delete selected measurement"}]},{type:"Help",controls:[{keys:"/ or ?",action:"Toggle this window"}]}],j=()=>m(!1),_=()=>m(!0);v.useEffect(()=>{const k=T=>{if(T.code!=="Slash"||T.repeat||T.ctrlKey||T.metaKey||T.altKey)return;const U=T.target;U instanceof HTMLElement&&(U.tagName==="INPUT"||U.tagName==="TEXTAREA"||U.tagName==="SELECT"||U.isContentEditable)||(T.preventDefault(),m(Y=>!Y))};return window.addEventListener("keydown",k,!0),()=>window.removeEventListener("keydown",k,!0)},[]);const M=o<ll||n<cl;return v.useLayoutEffect(()=>{const k=document.getElementById("vr-button");if(!k)return;k.classList.toggle("splats-vr--hidden",M);const T=document.getElementById("vr-button-anchor");T&&k.parentElement!==T&&T.appendChild(k)},[M,s,o,n]),r.jsx("div",{className:te("userControls__container",{"userControls__container--collapsed":!s}),ref:i,children:r.jsxs("div",{className:te("userControls",{"userControls--no-sides":!s||!c,"userControls--collapsed":!s}),"aria-hidden":!s,children:[s&&c?r.jsx("div",{className:"userControls__left-block",children:r.jsxs("div",{className:"userControls__left-controls",children:[r.jsx(on,{open:l,modal:!0,onOpen:_,onClose:j,trigger:r.jsx("button",{type:"button",className:`button button__text userControls__help-button ${l?"button_active":""}`,"aria-haspopup":"dialog","aria-expanded":l,"aria-label":l?"Hide controls help":"Show controls help",title:l?"Hide controls help (/)":"Show controls help (/)",children:r.jsx(Ai,{})}),children:k=>r.jsxs("div",{className:"embed-popup controls-help-popup",onKeyDown:Ue,onKeyUp:Ue,children:[r.jsx("button",{type:"button",className:"embed-popup__close","aria-label":"Close controls help",onClick:k,children:"x"}),r.jsx("h3",{className:"embed-popup__title",children:"Viewer Controls"}),r.jsx("div",{className:"controls-help-popup__groups",children:w.map(({type:T,controls:U})=>r.jsxs("section",{className:"controls-help-popup__group",children:[r.jsx("h4",{className:"controls-help-popup__group-title",children:T}),r.jsx("ul",{className:"controls-help-popup__list",children:U.map(({keys:D,action:Y})=>r.jsxs("li",{className:"controls-help-popup__item",children:[r.jsx("span",{className:"controls-help-popup__keys",children:D}),r.jsx("span",{className:"controls-help-popup__action",children:Y})]},`${T}-${D}`))})]},T))})]})}),r.jsxs("div",{className:"userControls__left-row",children:[r.jsx("div",{className:"userControls__movement-buttons",children:f.map((k,T)=>r.jsx(mn,{text:k},T))}),r.jsxs("div",{className:"userControls__mode-buttons-container",children:[r.jsx(mn,{text:"R"}),r.jsx("div",{className:"userControls__mode-buttons",children:x.map((k,T)=>r.jsx(al,{text:k},T))})]})]})]})}):null,r.jsxs("div",{className:"userControls__center-block",children:[s&&u?r.jsx("div",{className:"userControls__center-side-spacer","aria-hidden":"true"}):null,r.jsxs("div",{className:"userControls__center-block-main",children:[r.jsx("div",{id:"vr-button-anchor",className:"userControls__vr-button-anchor"}
50),s&&u?r.jsx("div",{className:"userControls__center-controls",children:r.jsx(sl,{viewer:e})}):null,p?r.jsx("div",{className:"userControls__export-control",children:t}):null]}),s&&u?r.jsx("div",{className:"userControls__center-side-spacer","aria-hidden":"true"}):null]}),s&&c?r.jsx("div",{className:"userControls__right-block",children:r.jsx("div",{className:"userControls__movement-buttons",children:C.map((k,T)=>r.jsx(mn,{text:k},T))})}):null]})})}const Ko="0 0 158 40",Jo=["M121.024 27.9994V10.1812H122.325V27.9994H121.024Z","M54.4317 13.2209C54.1428 12.9079 53.8195 12.636 53.4627 12.4053C53.106 12.1582 52.7237 11.9605 52.3156 11.8122C51.9079 11.6475 51.4658 11.5239 50.9903 11.4415C50.5143 11.3592 50.0043 11.318 49.4604 11.318C47.693 11.318 46.4017 11.6475 45.5858 12.3065C44.787 12.9491 44.3878 13.8222 44.3878 14.9261C44.3878 15.6675 44.566 16.2606 44.9232 16.7054C45.2969 17.1338 45.8747 17.4798 46.6566 17.7434C47.4381 18.007 48.4495 18.2624 49.69 18.5095C50.9987 18.7731 52.1289 19.0862 53.0805 19.4487C54.0321 19.7946 54.763 20.2724 55.273 20.882C55.7995 21.4916 56.0629 22.3154 56.0629 23.3533C56.0629 24.1277 55.9102 24.8114 55.6043 25.4045C55.2984 25.9812 54.8564 26.459 54.2786 26.8379C53.7007 27.2168 53.0126 27.5051 52.2138 27.7029C51.4319 27.9006 50.5567 27.9994 49.5881 27.9994C48.6535 27.9994 47.7609 27.9006 46.9116 27.7029C46.0618 27.5051 45.263 27.2168 44.515 26.8379C43.7675 26.459 43.0705 25.9729 42.4248 25.3798L43.1129 24.3666C43.4871 24.762 43.9033 25.1162 44.3623 25.4292C44.8379 25.7258 45.3478 25.9812 45.8917 26.1954C46.4526 26.4095 47.0473 26.5825 47.6761 26.7144C48.3048 26.8297 48.9594 26.8873 49.639 26.8873C51.2193 26.8873 52.4518 26.6072 53.3355 26.0471C54.2361 25.4704 54.6863 24.6219 54.6863 23.5016C54.6863 22.7273 54.4826 22.1012 54.0745 21.6234C53.6668 21.1456 53.0381 20.7584 52.1883 20.4619C51.3386 20.1488 50.2763 19.8605 49.0018 19.5969C47.727 19.3333 46.6397 19.0368 45.7386 18.7072C44.8549 18.3777 44.1837 17.9329 43.7251 17.3727C43.283 16.8126 43.062 16.0547 43.062 15.0991C43.062 14.0447 43.3255 13.155 43.8524 12.4301C44.3963 11.6887 45.1523 11.1285 46.1212 10.7496C47.0898 10.3706 48.203 10.1812 49.4604 10.1812C50.2423 10.1812 50.9648 10.2553 51.6275 10.4036C52.3071 10.5519 52.9274 10.7825 53.4882 11.0955C54.066 11.3921 54.6014 11.7711 55.0944 12.2324L54.4317 13.2209Z","M149.049 10.1812H150.171L157.818 27.9994H156.442L153.561 21.0729L149.61 11.7371L145.582 21.0729L142.753 27.9994H141.351L149.049 10.1812Z","M125.698 18.9418C125.698 17.8859 125.885 16.8465 126.259 15.8236C126.65 14.7842 127.211 13.8438 127.941 13.0024C128.672 12.1445 129.564 11.4598 130.618 10.9483C131.689 10.4369 132.904 10.1812 134.263 10.1812C135.878 10.1812 137.255 10.5441 138.393 11.2701C139.532 11.9795 140.381 12.8951 140.942 14.017L139.872 14.611C139.447 13.8025 138.92 13.1591 138.291 12.6807C137.679 12.2022 137.017 11.864 136.303 11.666C135.589 11.4515 134.875 11.3443 134.161 11.3443C133.023 11.3443 132.003 11.567 131.102 12.0125C130.219 12.4579 129.471 13.0519 128.859 13.7943C128.247 14.5367 127.78 15.3616 127.457 16.2691C127.151 17.1765 126.998 18.0921 126.998 19.0161C126.998 20.0555 127.185 21.0453 127.559 21.9858C127.933 22.9097 128.443 23.7346 129.088 24.4605C129.751 25.1864 130.516 25.7639 131.383 26.1929C132.266 26.6218 133.218 26.8363 134.238 26.8363C134.969 26.8363 135.708 26.7208 136.456 26.4898C137.221 26.2423 137.934 25.8711 138.597 25.3762C139.26 24.8647 139.795 24.2048 140.203 23.3964L141.325 23.9161C140.934 24.7905 140.347 25.5329 139.566 26.1434C138.784 26.7538 137.917 27.2158 136.966 27.5292C136.014 27.8427 135.071 27.9994 134.136 27.9994C132.912 27.9994 131.782 27.7437 130.745 27.2323C129.709 26.7043 128.808 26.0114 128.043 25.1535C127.296 24.2791 126.718 23.3056 126.31 22.2332C125.902 21.1444 125.698 20.0472 125.698 18.9418Z","M117.771 11.3356H111.143V27.9994H109.843V11.3356H103.215V10.1812H117.771V11.3356Z","M94.3091 10.1812H95.4308L103.078 27.9994H101.702L98.8209 21.0729L94.8699 11.7371L90.8422 21.0729L88.0125 27.9994H86.6104L94.3091 10.1812Z","M75.5645 27.9994V10.1812H76.8643V26.845H87.6732V27.9994H75.5645Z","M59.4189 27.9994V10.1812H66.8775C67.6437 10.1812 68.342 10.3401 68.972 10.658C69.619 10.9758 70.1811 11.4025 70.658 11.9379C71.1348 12.4565 71.5009 13.0421 71.7563 13.6946C72.0287 14.3471 72.1649 15.0164 72.1649 15.7023C72.1649 16.656 71.9434 17.5594 71.5009 18.4127C71.075 19.2492 70.4789 19.9352 69.7128 20.4706C68.9635 21.006 68.0697 21.2737 67.0307 21.2737H60.7218V27.9994H59.4189ZM59.4189 20.0941H66.9798C67.7799 20.0941 68.4697 19.885 69.0488 19.4667C69.6275 19.0485 70.0704 18.5047 70.3767 17.8355C70.6834 17.1663 70.8366 16.4552 70.8366 15.7023C70.8366 14.916 70.6495 14.1965 70.2749 13.5441C69.9172 12.8748 69.4319 12.3394 68.8189 11.9379C68.2228 11.5364 67.5585 11.3356 66.8262 11.3356H59.4189V20.0941Z","M0 11.0436L24.8041 0L28.9455 9.30161L6.90221 26.5463L0 11.0436Z","M3.87695 30.6983L25.9202 13.4536L32.8224 28.9563L8.01827 39.9998L3.87695 30.6983Z"],qo=e=>e||"white",vl=({color:e="white",opacity:t=.64}={})=>{const n=qo(e),o=Number.isFinite(Number(t))?Number(t):.64,s=Jo.map(a=>`<path d="${a}" fill="${n}"/>`).join("");return`<svg viewBox="${Ko}" fill="${n}" xmlns="http://www.w3.org/2000/svg"><g opacity="${o}">${s}</g></svg>`},gl=e=>`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(vl(e))}
50`,io=({className:e,color:t,opacity:n=.64})=>{const o=qo(t);return r.jsx("svg",{className:e,viewBox:Ko,fill:o,xmlns:"http://www.w3.org/2000/svg",children:r.jsx("g",{opacity:n,children:Jo.map(s=>r.jsx("path",{d:s,fill:o},s))})})},vt=[{value:"960x540",label:"960x540 (qHD)",width:960,height:540},{value:"1280x720",label:"1280x720 (HD)",width:1280,height:720},{value:"1920x1080",label:"1920x1080 (Full HD)",width:1920,height:1080},{value:"2560x1440",label:"2560x1440 (QHD)",width:2560,height:1440},{value:"3840x2160",label:"3840x2160 (4K)",width:3840,height:2160}],bl=[{value:"mp4",label:"MP4"},{value:"webm",label:"WebM"},{value:"mov",label:"MOV"},{value:"mkv",label:"MKV"}],zt={mp4:[{value:"h264",label:"H.264"},{value:"h265",label:"H.265 / HEVC"}],webm:[{value:"vp9",label:"VP9"},{value:"av1",label:"AV1"}],mov:[{value:"h264",label:"H.264"},{value:"h265",label:"H.265 / HEVC"}],mkv:[{value:"h264",label:"H.264"},{value:"h265",label:"H.265 / HEVC"},{value:"vp9",label:"VP9"},{value:"av1",label:"AV1"}]},yl=["12","15","24","25","30","48","60","120"],Tt=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"ultra",label:"Ultra"}],Qt=[{value:"shorts-vertical",label:"Shorts / TikTok / Reels",shortLabel:"Shorts",description:"Vertical preset for mobile-first social video.",icon:"shorts",slug:"shorts",width:1080,height:1920,frameRate:30,bitrateMode:"ultra",format:"mp4",codec:"h264"},{value:"youtube-landscape-4k",label:"YouTube 16:9 4K",shortLabel:"YouTube",description:"16:9 export for high-resolution YouTube uploads.",icon:"youtube-4k",slug:"youtube-4k",width:3840,height:2160,frameRate:60,bitrateMode:"high",format:"mp4",codec:"h264"},{value:"instagram-square",label:"Instagram square",shortLabel:"Square",description:"1:1 post format with square framing. Perfect for Instagram post.",icon:"instagram-square",slug:"instagram-square",width:1080,height:1080,frameRate:30,bitrateMode:"ultra",format:"mp4",codec:"h264"},{value:"instagram-feed-portrait",label:"Instagram feed portrait",shortLabel:"Portrait",description:"4:5 feed format with taller framing. Perfect for Instagram post.",icon:"instagram-feed",slug:"instagram-feed",width:1080,height:1350,frameRate:30,bitrateMode:"ultra",format:"mp4",codec:"h264"}],xl="youtube-landscape-4k",lt=Qt.find(e=>e.value===xl)||Qt[0],wl=[{value:"youtube",label:"YouTube",url:"https://www.youtube.com/upload"},{value:"tiktok",label:"TikTok",url:"https://www.tiktok.com/tiktokstudio/upload"},{value:"instagram",label:"Instagram",url:"https://www.instagram.com"},{value:"reddit",label:"Reddit",url:"https://www.reddit.com/submit"},{value:"x",label:"X",url:"https://x.com/compose/post"},{value:"threads",label:"Threads",url:"https://www.threads.com/"},{value:"facebook",label:"Facebook",url:"https://www.facebook.com/"}],Sl={12:12,15:15,24:24,25:25,30:30,48:48,60:60,120:120},lo={low:.55,medium:.75,high:1,ultra:1.35},vn=[{minShortEdge:2160,standard:4e7,highFrameRate:6e7},{minShortEdge:1440,standard:16e6,highFrameRate:24e6},{minShortEdge:1080,standard:8e6,highFrameRate:12e6},{minShortEdge:720,standard:5e6,highFrameRate:75e5},{minShortEdge:540,standard:4e6,highFrameRate:4e6}],en="bitrate:",tn=60,_l=tn*60+59,Cl=.2,jl=160,kl=Object.freeze({icon:gl({color:"#ffffff",opacity:1}),position:"bottom-right",margin:24,opacity:.64}),El=({width:e,height:t})=>({...kl,size:Math.max(jl,Math.round(Math.min(e,t)*Cl))}),Nt=10,St=e=>{const t=(e==null?void 0:e.cameraPoses)||{};return Object.keys(t).map(n=>parseInt(n,10)).filter(n=>Number.isFinite(n)).sort((n,o)=>n-o)},Ml=(e,t)=>t.map((n,o)=>{const s=e.cameraPoses[n],a={slot:n,position:s.position,target:s.target,up:s.up,quaternion:s.quaternion,fov:s.fov};if(o>0){const i=Number.isFinite(e==null?void 0:e.defaultPoseTransitionSpeed)&&e.defaultPoseTransitionSpeed>0?e.defaultPoseTransitionSpeed:Zt,c=Number.isFinite(s.transitionSpeed)&&s.transitionSpeed>0?s.transitionSpeed:i;a.transitionSpeed=c}else a.transitionMs=0;return a}),_t=e=>{const t=e.length,n=t>0?e[0]:1,o=t>0?e[t-1]:1,s=t>=2&&o>n;return{poseMin:n,poseMax:o,hasTwoPlusPoses:s,startMin:n,startMax:s?o-1:n,endMin:s?n+1:o,endMax:o}},ft=(e,t,n)=>{const{hasTwoPlusPoses:o,startMin:s,startMax:a,endMin:i,endMax:c,poseMin:u,poseMax:p}=n;
50if(!o)return{start:u,end:p};let l=parseInt(e,10);Number.isFinite(l)||(l=s),l=Math.min(Math.max(l,s),a);let m=parseInt(t,10);return Number.isFinite(m)||(m=c),m=Math.min(Math.max(m,i),c),m<=l&&(m=Math.min(l+1,c)),{start:l,end:m}},Wt=(e,t,n)=>{if(!t||t.length<2||!n||n.length<2||!e||typeof e.getTransitionMsBetweenOrderedPoseIndices!="function")return Nt;const o=n[0],s=n[n.length-1],a=t.indexOf(o),i=t.indexOf(s);if(a<0||i<a)return Nt;const c=e.getTransitionMsBetweenOrderedPoseIndices(a,i);return c>0?Math.max(1,Math.round(c/1e3)):Nt},co=e=>{const t=Math.max(0,Math.min(Math.floor(e),_l));return{minutes:String(Math.floor(t/60)),seconds:String(t%60)}},uo=e=>e===""||e===void 0?0:Math.min(tn,Math.max(0,parseInt(e,10)||0)),po=e=>e===""||e===void 0?0:Math.min(59,Math.max(0,parseInt(e,10)||0)),Nl=e=>String(Number((e/1e6).toFixed(3))),Sn=({width:e,height:t})=>`${e}x${t}`,mo=({width:e,height:t})=>({width:t>e?t:e,height:t>e?e:t,portraitMode:t>e}),fo=({width:e,height:t})=>({value:Sn({width:e,height:t}),label:`${e}x${t}`,width:e,height:t}),Pl=(e,t)=>vt.find(n=>n.value===e)||((t==null?void 0:t.value)===e?t:null)||vt[2],Ll=({width:e,height:t,frameRate:n})=>{const o=Math.min(e,t),s=vn.find(a=>o>=a.minShortEdge)||vn[vn.length-1];return n>30?s.highFrameRate:s.standard},nn=(e,{width:t,height:n,frameRate:o})=>{const s=lo[e]||lo.high;return Math.round(Ll({width:t,height:n,frameRate:o})*s)},Tl=e=>`${en}${e}`,Il=e=>({value:Tl(e),label:`${Nl(e)} Mbps`,bitrate:e}),Rl=(e,t,n)=>e!=null&&e.startsWith(en)?((n==null?void 0:n.value)===e?n.bitrate:null)||parseInt(e.slice(en.length),10)||nn(lt.bitrateMode||"high",lt):nn(e,t),ho=({width:e,height:t,frameRate:n,bitrate:o,bitrateMode:s})=>{if(s&&Tt.some(c=>c.value===s))return{value:s,temporaryOption:null};const a=Tt.find(c=>nn(c.value,{width:e,height:t,frameRate:n})===o);if(a)return{value:a.value,temporaryOption:null};if(!Number.isFinite(o))return{value:"high",temporaryOption:null};const i=Il(o);return{value:i.value,temporaryOption:i}},Al=e=>e.bitrateMode?nn(e.bitrateMode,e):e.bitrate,Fl=(e,t)=>e.width===t.width&&e.height===t.height&&e.frameRate===t.frameRate&&e.bitrate===Al(t)&&e.bitrateMode===(t.bitrateMode||null)&&e.format===t.format&&e.codec===t.codec,Ol=({type:e})=>e==="shorts"?r.jsxs("svg",{viewBox:"0 0 32 32","aria-hidden":"true",focusable:"false",children:[r.jsx("rect",{x:"6.5",y:"2.25",width:"19",height:"27.5",rx:"4.25",strokeWidth:"1.55"}),r.jsx("path",{d:"M13.25 12.8 18.9 16l-5.65 3.2z",fill:"currentColor",stroke:"none"}),r.jsx("path",{d:"M10 24.1h6.5M10 26.15h4.3",strokeWidth:"1.15"}),r.jsx("circle",{cx:"22.25",cy:"10.5",r:"1.1",fill:"currentColor",stroke:"none"}),r.jsx("circle",{cx:"22.25",cy:"16",r:"1.1",fill:"currentColor",stroke:"none"}),r.jsx("circle",{cx:"22.25",cy:"21.5",r:"1.1",fill:"currentColor",stroke:"none"}),r.jsx("path",{d:"M21.15 26.25h2.2",strokeWidth:"1.15"})]}):e==="vertical"?r.jsxs("svg",{viewBox:"0 0 32 32","aria-hidden":"true",focusable:"false",children:[r.jsx("rect",{x:"10",y:"3",width:"12",height:"26",rx:"3"}),r.jsx("path",{d:"M14 8h4M14 24h4"})]}):e==="landscape"?r.jsxs("svg",{viewBox:"0 0 32 32","aria-hidden":"true",focusable:"false",children:[r.jsx("rect",{x:"3",y:"8",width:"26",height:"16",rx:"3"}),r.jsx("path",{d:"M9 14h14M9 18h9"})]}):e==="youtube-1080"||e==="youtube-4k"?r.jsxs("svg",{viewBox:"0 0 32 32","aria-hidden":"true",focusable:"false",children:[r.jsx("rect",{x:"1.75",y:"5.7",width:"28.5",height:"20.6",rx:"4",strokeWidth:"1.45"}),r.jsx("path",{d:"M13.35 12.4 20.25 16l-6.9 3.6z",fill:"currentColor",stroke:"none"}),r.jsx("rect",{x:"20.7",y:"20.75",width:"6.8",height:"4.25",rx:"1.35",fill:"currentColor",stroke:"none"}),r.jsx("text",{x:"24.1",y:"23.8",textAnchor:"middle",fontSize:"3.05",fontWeight:"800",fill:"#202a5c",stroke:"none",children:e==="youtube-4k"?"4K":"HD"})]}):e==="square"?r.jsxs("svg",{viewBox:"0 0 32 32","aria-hidden":"true",focusable:"false",children:[r.jsx("rect",{x:"6",y:"6",width:"20",height:"20",rx:"4"}),r.jsx("path",{d:"M12 16h8M16 12v8"})]}):e==="instagram-square"?r.jsxs("span",{className:"video-export-format-icon video-export-format-icon--square","aria-hidden":"true",children:[r.jsx("span",{className:"video-export-format-icon__frame",children:r.jsx("span",{className:"video-export-format-icon__aspect",children:"1:1"})}),r.jsx("span",{className:"video-export-format-icon__line"}),r.jsx("span",{className:"video-export-format-icon__line video-export-format-icon__line--short"})]}):e==="portrait"?r.jsxs("svg",{viewBox:"0 0 32 32","aria-hidden":"true",focusable:"false",children:[r.jsx("rect",{x:"8",y:"4",width:"16",height:"24",rx:"3"}),r.jsx("path",{d:"M12 12h8M12 17h8M12 22h5"})]}):e==="instagram-feed"?r.jsxs("span",{className:"video-export-format-icon video-export-format-icon--portrait","aria-hidden":"true",children:[r.jsx("span",{className:"video-export-format-icon__frame",children:r.jsx("span",{className:"video-export-format-icon__aspect",children:"4:5"})}),r.jsx("span",{className:"video-export-format-icon__line"}),r.jsx("span",{className:"video-export-format-icon__line video-export-format-icon__line--short"})]}):r.jsxs("svg",{viewBox:"0 0 32 32","aria-hidden":"true",focusable:"false",children:[r.jsx("rect",{x:"5",y:"5",width:"22",height:"22",rx:"5"}),r.jsx("path",{d:"M11 16h10M16 11v10"})]}),Vl=()=>r.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",children:[r.jsx("path",{d:"M7 7.5 13 4M7 12.5l6 3.5"}),r.jsx("circle",{cx:"5",cy:"10",r:"2.2"}),r.jsx("circle",{cx:"15",cy:"3",r:"2.2"}),r.jsx("circle",{cx:"15",cy:"17",r:"2.2"})]}),Dl=({value:e})=>{const t={className:"video-export-social-icon__svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"};let n=null;return e==="youtube"?n=r.jsxs("svg",{...t,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8"}),r.jsx("path",{d:"M10 9l5 3l-5 3l0 -6"})]}):e==="instagram"?n=r.jsxs("svg",{...t,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M4 8a4 4 0 0 1 4 -4h8a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-8a4 4 0 0 1 -4 -4l0 -8"}),r.jsx("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"}),r.jsx("path",{d:"M16.5 7.5v.01"})]}):e==="tiktok"?n=r.jsxs("svg",{...t,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M21 7.917v4.034a9.948 9.948 0 0 1 -5 -1.951v4.5a6.5 6.5 0 1 1 -8 -6.326v4.326a2.5 2.5 0 1 0 4 2v-11.5h4.083a6.005 6.005 0 0 0 4.917 4.917"})]}):e==="facebook"?n=r.jsxs("svg",{...t,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M7 10v4h3v7h4v-7h3l1 -4h-4v-2a1 1 0 0 1 1 -1h3v-4h-3a5 5 0 0 0 -5 5v2h-3"})]}):e==="reddit"?n=r.jsxs("svg",{...t,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M12 8c2.648 0 5.028 .826 6.675 2.14a2.5 2.5 0 0 1 2.326 4.36c0 3.59 -4.03 6.5 -9 6.5c-4.875 0 -8.845 -2.8 -9 -6.294l-1 -.206a2.5 2.5 0 0 1 2.326 -4.36c1.646
50-1.313 4.026 -2.14 6.674 -2.14l.999 0"}),r.jsx("path",{d:"M12 8l1 -5l6 1"}),r.jsx("path",{d:"M18 4a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),r.jsx("path",{d:"M8.5 13a.5 .5 0 1 0 1 0a.5 .5 0 1 0 -1 0",fill:"currentColor"}),r.jsx("path",{d:"M14.5 13a.5 .5 0 1 0 1 0a.5 .5 0 1 0 -1 0",fill:"currentColor"}),r.jsx("path",{d:"M10 17c.667 .333 1.333 .5 2 .5s1.333 -.167 2 -.5"})]}):e==="x"?n=r.jsxs("svg",{...t,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M4 4l11.733 16h4.267l-11.733 -16l-4.267 0"}),r.jsx("path",{d:"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"})]}):e==="threads"&&(n=r.jsxs("svg",{...t,children:[r.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),r.jsx("path",{d:"M19 7.5c-1.333 -3 -3.667 -4.5 -7 -4.5c-5 0 -8 2.5 -8 9s3.5 9 8 9s7 -3 7 -5s-1 -5 -7 -5c-2.5 0 -3 1.25 -3 2.5c0 1.5 1 2.5 2.5 2.5c2.5 0 3.5 -1.5 3.5 -5s-2 -4 -3 -4s-1.833 .333 -2.5 1"})]})),r.jsx("span",{className:`video-export-social-icon video-export-social-icon--${e}`,"aria-hidden":"true",children:n})};function Bl({viewer:e,disabled:t,triggerClassName:n,triggerLabel:o}){const s=mo(lt),a=Sn(s),i=vt.some(S=>S.value===a),c=ho(lt),[u,p]=v.useState(a),[l,m]=v.useState(i?null:fo(s)),[f,x]=v.useState(lt.format),[C,w]=v.useState(lt.codec),[j,_]=v.useState(String(lt.frameRate)),[M,k]=v.useState(c.value),[T,U]=v.useState(c.temporaryOption),[D,Y]=v.useState(s.portraitMode),[N,z]=v.useState("1"),[A,W]=v.useState("10"),[O,q]=v.useState("0"),[Q,$]=v.useState("10"),[ge,Se]=v.useState(!0),[G,Pe]=v.useState(!1),[_e,Ce]=v.useState(!1),[be,ye]=v.useState({progress:0,frameIndex:0,totalFrames:0}),[ze,J]=v.useState(""),[re,Le]=v.useState(null),se=v.useRef(null),xe=v.useRef(null),je=v.useRef(null),Ae=v.useRef(null),me=()=>{je.current=null,Le(null),J(""),ye({progress:0,frameIndex:0,totalFrames:0})},Oe=()=>{se.current=null,xe.current=null},Ve=()=>{if(G){Ce(!0),J("Cancelling render...");try{se.current&&typeof se.current.cancel=="function"?se.current.cancel():e&&typeof e.cancelVideoExport=="function"?e.cancelVideoExport():xe.current&&xe.current.abort()}catch(S){J(`Unable to cancel render: ${(S==null?void 0:S.message)||S}`),Ce(!1)}}};v.useEffect(()=>()=>{try{se.current&&typeof se.current.cancel=="function"?se.current.cancel():xe.current&&xe.current.abort()}catch{}},[]);const We=S=>{const I=(zt[S]||zt.mp4).map(H=>H.value);w(H=>I.includes(H)?H:S==="webm"?"vp9":"h264")},ee=Pl(u,l),De=Sl[j]||lt.frameRate,B=D&&ee.height!==ee.width?ee.height:ee.width,F=D&&ee.height!==ee.width?ee.width:ee.height,Te={width:B,height:F,frameRate:De,bitrate:Rl(M,{width:B,height:F,frameRate:De},T),bitrateMode:M!=null&&M.startsWith(en)?null:M,format:f,codec:C},fe=Qt.find(S=>Fl(Te,S)),Ze={...Te,label:(fe==null?void 0:fe.label)||"Custom",slug:(fe==null?void 0:fe.slug)||"custom"},le=l&&!vt.some(S=>S.value===l.value)?[l,...vt]:vt,Ie=T&&!Tt.some(S=>S.value===T.value)?[T,...Tt]:Tt,b=S=>{if(G)return;const y=mo(S),I=Sn(y);p(I),m(vt.some(he=>he.value===I)?null:fo(y)),Y(y.portraitMode),x(S.format),w(S.codec),_(String(S.frameRate));const H=ho(S);k(H.value),U(H.temporaryOption),me()},E=S=>{p(S.target.value),m(null),me()},R=S=>{k(S.target.value),U(null),me()},X=S=>{Y(S.target.checked),me()},nt=uo(O),ct=po(Q),Ke=nt*60+ct,d=St(e),h=_t(d),{hasTwoPlusPoses:g,startMin:P,startMax:L,endMin:ue,endMax:Be}=h,{start:kt,end:Ot}=ft(N,A,h),ce=d.filter(S=>S>=kt&&S<=Ot),V=Wt(e,d,ce),we=Ke!==V,oe=g,Ge=(S,y)=>{const I=St(e),H=_t(I),{start:he,end:de}=ft(S!=null?String(S):N,y!=null?String(y):A,H),pe=I.filter(pt=>pt>=he&&pt<=de),Z=Wt(e,I,pe),{minutes:Re,seconds:ot}=co(Z);q(Re),$(ot)},ut=S=>{const y=S.target.value,I=parseInt(y,10);if(y!==""&&!Number.isFinite(I))return;if(y===""){z("");return}const H=Math.min(Math.max(I,P),L);z(String(H));const he=parseInt(A,10);let de=Number.isFinite(he)?he:Be;de<=H?de=Math.min(H+1,Be):de=Math.min(Math.max(de,H+1),Be),W(String(de))},er=()=>{if(N===""){const{start:S,end:y}=ft(String(P),A,h);z(String(S)),String(y)!==A&&W(String(y))}},tr=S=>{const y=S.target.value,I=parseInt(y,10);if(y!==""&&!Number.isFinite(I))return;if(y===""){W("");return}const H=parseInt(N,10),he=Number.isFinite(H)?Math.min(Math.max(H,P),L):P,de=Math.max(ue,he+1),pe=Math.min(Math.max(I,de),Be);W(String(pe))},nr=()=>{if(A===""){const{start:S,end:y}
50=ft(N,String(Be),h);W(String(y)),String(S)!==N&&z(String(S))}},dt=d.join(",");v.useEffect(()=>{const S=St(e),y=_t(S);if(!y.hasTwoPlusPoses)return;const{start:I,end:H}=ft(N,A,y);(String(I)!==N||String(H)!==A)&&(z(String(I)),W(String(H)))},[dt]),v.useEffect(()=>{const S=St(e),y=_t(S);if(!y.hasTwoPlusPoses){Ae.current={poseStart:N,poseEnd:A,poseListKey:dt,totalSec:Ke,precalcSec:V};return}const I=Ae.current;if(!I){Ae.current={poseStart:N,poseEnd:A,poseListKey:dt,totalSec:Ke,precalcSec:V};return}if((I.poseStart!==N||I.poseEnd!==A||I.poseListKey!==dt)&&I.totalSec===I.precalcSec){const{start:he,end:de}=ft(N,A,y),pe=S.filter(pt=>pt>=he&&pt<=de),Z=Wt(e,S,pe),{minutes:Re,seconds:ot}=co(Z);q(Re),$(ot),Ae.current={poseStart:N,poseEnd:A,poseListKey:dt,totalSec:Z,precalcSec:Z};return}Ae.current={poseStart:N,poseEnd:A,poseListKey:dt,totalSec:Ke,precalcSec:V}},[N,A,dt,Ke,V,e]);const or=S=>{const y=S.target.value;if(y===""){q("");return}const I=parseInt(y,10);if(!Number.isFinite(I)){q(y);return}q(String(Math.min(tn,Math.max(0,I))))},rr=()=>{O===""&&q("0")},sr=S=>{const y=S.target.value;if(y===""){$("");return}const I=parseInt(y,10);if(!Number.isFinite(I)){$(y);return}$(String(Math.min(59,Math.max(0,I))))},ar=()=>{Q===""&&$("0")},ir=(S,y)=>{const I=new Date().toISOString().replace(/[:.]/g,"-");return`splatica-${(y==null?void 0:y.slug)||"render"}-${I}.${S||(y==null?void 0:y.format)||"mp4"}`},lr=(S,y,I)=>{const H=new Blob([S],{type:I||"application/octet-stream"});return typeof File!="function"?H:new File([H],y,{type:H.type,lastModified:Date.now()})},cr=S=>typeof navigator>"u"||typeof navigator.share!="function"||typeof navigator.canShare!="function"||typeof File!="function"||!(S instanceof File)?!1:navigator.canShare({files:[S]}),ur=(S,y)=>{const I=URL.createObjectURL(S),H=document.createElement("a");H.href=I,H.download=y,H.click(),URL.revokeObjectURL(I)},dr=()=>{if(!(typeof window>"u"))return window.location.href},bt=({exportOutput:S,durationTotalSeconds:y,requestedFrames:I,startNumber:H,endNumber:he,filteredPoseNumbers:de,result:pe,error:Z})=>{var Re;return{preset:S.slug,preset_label:S.label,format:S.format,codec:S.codec,width:S.width,height:S.height,frame_rate:S.frameRate,bitrate:S.bitrate,bitrate_mode:S.bitrateMode||"custom",duration_seconds:y,requested_frames:I,encoded_frames:pe==null?void 0:pe.encodedFrames,output_bytes:(Re=pe==null?void 0:pe.buffer)==null?void 0:Re.byteLength,pose_start:H,pose_end:he,pose_count:de.length,include_logo:ge?1:0,portrait:S.height>S.width?1:0,error_name:Z==null?void 0:Z.name,error_message:Z!=null&&Z.message?String(Z.message).slice(0,180):void 0}},pr=(S,y)=>{const I=y.hasTwoPlusPoses?y.poseMin:kt,H=y.hasTwoPlusPoses?y.poseMax:Ot,he=S.filter(Z=>Z>=I&&Z<=H),de=y.hasTwoPlusPoses?Wt(e,S,he):Ke,pe=Math.max(1,Math.round(de*Ze.frameRate));ae(ve.VIDEO_EXPORT_OPEN,bt({exportOutput:Ze,durationTotalSeconds:de,requestedFrames:pe,startNumber:I,endNumber:H,filteredPoseNumbers:he}))},mr=async()=>{const S=je.current;if(!(re!=null&&re.canShare)||!S){J("File sharing is not available in this browser.");return}try{await navigator.share({files:[S],title:"Splatica video",url:dr()}),J("Share sheet opened.")}catch(y){(y==null?void 0:y.name)==="AbortError"?J("Share cancelled."):J(`Share failed: ${(y==null?void 0:y.message)||y}`)}},fr=async()=>{if(!e||typeof e.exportVideo!="function"){J("Video export is not available for this viewer.");return}const S=St(e);if(S.length===0){J("No saved camera poses found. Add poses first (Shift + number keys).");return}const y=_t(S);if(!y.hasTwoPlusPoses){J("Add at least two saved camera poses to export a video.");return}const{start:I,end:H}=ft(N,A,y),he=uo(O),de=po(Q),pe=he*60+de;if(pe<=0){J("Total length must be greater than zero.");return}const Z=Ze,Re=Math.max(1,Math.round(pe*Z.frameRate)),ot=S.filter(ke=>ke>=I&&ke<=H);if(ot.length===0){J("No poses in the selected range.");return}if(ot.length<2){J("Select at least two poses in range for video interpolation.");return}const pt=Ml(e,ot);Pe(!0),Ce(!1),je.current=null,Le(null),ye({progress:0,frameIndex:0,totalFrames:Re}),J("Starting render...");const Et={exportOutput:Z,durationTotalSeconds:pe,requestedFrames:Re,startNumber:I,endNumber:H,filteredPoseNumbers:ot};ae("viewer_video_render_start",bt(Et));try{const ke=new AbortController;xe.current=ke;const Nn=e.exportVideo({output:{width:Z.width,height:Z.height,frameRate:Z.frameRate,bitrate:Z.bitrate,format:Z.format,codec:Z.codec},timeline:{startFrame:0,endFrame:Math.max(Re-1,0),animFrameRate:Z.frameRate},animation:{cameraKeyframes:pt,useViewerPoses:!1,loop:!1},branding:ge?El({width:Z.width,height:Z.height}):void 0,onProgress:rt=>{ye({progress:rt.progress||0,frameIndex:rt.frameIndex||0,totalFrames:rt.totalFrames||Re}),J(`Rendering ${Math.round((rt.progress||0)*100)}%`)},signal:ke.signal});se.current=Nn;const Je=await Nn;
50if(Je.cancelled){J("Render cancelled."),ae("viewer_video_render_cancelled",bt({...Et,result:Je}));return}if(Je.buffer){const rt=ir(Je.extension,Z),sn=lr(Je.buffer,rt,Je.mimeType);ur(sn,rt),je.current=sn,Le({filename:rt,presetLabel:Z.label,canShare:cr(sn)})}ye({progress:1,frameIndex:Je.encodedFrames||Re,totalFrames:Je.encodedFrames||Re}),J(`Render complete (${Je.encodedFrames||Re} frames).`),ae("viewer_video_render_complete",bt({...Et,result:Je}))}catch(ke){(ke==null?void 0:ke.name)==="AbortError"?(J("Render cancelled."),ae("viewer_video_render_cancelled",bt({...Et,error:ke}))):(J(`Render failed: ${(ke==null?void 0:ke.message)||ke}`),ae("viewer_video_render_failed",bt({...Et,error:ke}))),je.current=null,Le(null)}finally{Oe(),Ce(!1),Pe(!1)}};return r.jsx(on,{trigger:r.jsxs("button",{className:`viewer-icon-btn${n?` ${n}`:""}`,"aria-label":"Video export settings",title:t?"Video export not available in this viewer":"Video export settings",disabled:t,children:[r.jsx($i,{}),o?r.jsx("span",{className:"viewer-icon-btn__label",children:o}):null]}),modal:!0,className:"video-export-modal",onOpen:()=>{me(),We(f);const S=St(e),y=_t(S);pr(S,y),y.hasTwoPlusPoses?(z(String(y.poseMin)),W(String(y.poseMax)),Ge(y.poseMin,y.poseMax)):Ge()},children:S=>r.jsxs("div",{className:"embed-popup video-export-popup",onKeyDown:Ue,onKeyUp:Ue,children:[r.jsx("button",{type:"button",className:"embed-popup__close","aria-label":"Close video export popup",onClick:S,disabled:G,children:"x"}),r.jsx("div",{className:"video-export-header",children:r.jsx("h3",{className:"embed-popup__title video-export-title",children:"Export video"})}),r.jsxs("div",{className:"video-export-screen video-export-screen--settings",children:[r.jsx("div",{className:"video-export-preset-list video-export-preset-list--compact","aria-label":"Video export presets",children:Qt.map(y=>{const I=(fe==null?void 0:fe.value)===y.value;return r.jsxs("button",{type:"button",className:`video-export-preset-card video-export-preset-card--compact${I?" video-export-preset-card--selected":""}`,onClick:()=>b(y),disabled:G,"aria-pressed":I,title:y.description,children:[r.jsx("span",{className:"video-export-preset-card__icon",children:r.jsx(Ol,{type:y.icon})}),r.jsx("span",{className:"video-export-preset-card__body",children:r.jsx("span",{className:"video-export-preset-card__title",children:y.shortLabel})})]},y.value)})}),r.jsxs("div",{className:"video-export-grid",children:[r.jsxs("label",{className:"video-export-row",children:[r.jsx("span",{className:"video-export-label",children:"Resolution"}),r.jsx("select",{value:u,onChange:E,disabled:G,children:le.map(y=>r.jsx("option",{value:y.value,children:y.label},y.value))})]}),r.jsxs("label",{className:"video-export-row",children:[r.jsx("span",{className:"video-export-label",children:"Format"}),r.jsx("select",{value:f,onChange:y=>{const I=y.target.value;x(I),We(I),me()},disabled:G,children:bl.map(y=>r.jsx("option",{value:y.value,children:y.label},y.value))})]}),r.jsxs("label",{className:"video-export-row",children:[r.jsx("span",{className:"video-export-label",children:"Codec"}),r.jsx("select",{value:C,onChange:y=>{w(y.target.value),me()},disabled:G,children:(zt[f]||zt.mp4).map(y=>r.jsx("option",{value:y.value,children:y.label},y.value))})]}),r.jsxs("label",{className:"video-export-row",children:[r.jsx("span",{className:"video-export-label",children:"Frame rate"}),r.jsx("select",{value:j,onChange:y=>{_(y.target.value),me()},disabled:G,children:yl.map(y=>r.jsxs("option",{value:y,children:[y," fps"]},y))})]}),r.jsxs("label",{className:"video-export-row",children:[r.jsx("span",{className:"video-export-label",children:"Bitrate"}),r.jsx("select",{value:M,onChange:R,disabled:G,children:Ie.map(y=>r.jsx("option",{value:y.value,children:y.label},y.value))})]}),r.jsxs("div",{className:"video-export-row video-export-row--double",children:[r.jsx("span",{className:"video-export-label",children:"Camera poses"}),r.jsxs("div",{className:"video-export-two-fields",children:[r.jsxs("label",{className:"video-export-input-with-hint",children:[r.jsx("input",{type:"number",min:g?P:void 0,max:g?L:void 0,step:1,value:N,onChange:ut,onBlur:er,disabled:G||!g,"aria-label":"Start camera pose"}),r.jsx("span",{className:"video-export-input-hint","aria-hidden":"true",children:"Start"})]}),r.jsxs("label",{className:"video-export-input-with-hint",children:[r.jsx("input",{type:"number",min:g?Math.max(ue,kt+1):void 0,max:g?Be:void 0,step:1,value:A,onChange:tr,onBlur:nr,disabled:G||!g,"aria-label":"End camera pose"}),r.jsx("span",{className:"video-export-input-hint","aria-hidden":"true",children:"End"})]})]})]}),r.jsxs("div",{className:"video-export-row video-export-row--double",children:[r.jsx("span",{className:"video-export-label",children:"Total length"}),r.jsx("div",{className:"video-export-duration-stack",children:r.jsxs("div",{className:"video-export-duration-fields-row",children:[r.jsxs("div",{className:"video-export-two-fields",children:[r.jsxs("label",{className:"video-export-input-with-hint",children:[r.jsx("input",{type:"number",min:0,max:tn,value:O,onChange:or,onBlur:rr,disabled:G,"aria-label":"Duration minutes"}),r.jsx("span",{className:"video-export-input-hint","aria-hidden":"true",children:"Min"})]}),r.jsxs("label",{className:"video-export-input-with-hint",children:[r.jsx("input",{type:"number",min:0,max:59,value:Q,onChange:sr,onBlur:ar,disabled:G,"aria-label":"Duration seconds"}),r.jsx("span",{className:"video-export-input-hint","aria-hidden":"true",children:"Sec"})]})]}),r.jsx("button",{type:"button",className:"video-export-duration-reset-icon-btn",onClick:()=>Ge(),disabled:G||!we,"aria-label":"Reset to suggested duration",title:"Restore duration to match pose preview timing, scaled for the pose range above",children:r.jsx(Xi,{})})]})})]}),r.jsxs("div",{className:"video-export-row video-export-row--toggle",children:[r.jsx("span",{className:"video-export-label",children:"Portrait mode"}),r.jsxs("label",{className:`embed-popup__toggle video-export-toggle-control${G?" embed-popup__toggle--disabled":""}`,children:[r.jsx("input",{type:"checkbox",checked:D,onChange:X,disabled:G}),r.jsx("span",{className:"embed-popup__toggle-switch"})]})]}),r.jsxs("div",{className:"video-export-row video-export-row--toggle",children:[r.jsx("span",{className:"video-export-label",children:"Splatica logo"}),r.jsxs("label",{className:`embed-popup__toggle video-export-toggle-control${G?" embed-popup__toggle--disabled":""}`,children:[r.jsx("input",{type:"checkbox",checked:ge,onChange:y=>Se(y.target.checked),disabled:G}),r.jsx("span",{className:"embed-popup__toggle-switch"})]})]})]}),ze?r.jsx("p",{className:"video-export-status",children:ze}):null,G?r.jsxs("div",{className:"video-export-progress-wrap","aria-live":"polite",children:[r.jsx("div",{className:"video-export-progress-track",children:r.jsx("div",{className:"video-export-progress-bar",style:{width:`${Math.round((be.progress||0)*100)}%`}})}),r.jsxs("div",{className:"video-export-progress-text",children:[Math.round((be.progress||0)*100),"% (",be.frameIndex,"/",be.totalFrames||0,")"]})]}):null,!G&&re?r.jsxs("div",{className:"video-export-upload-panel",children:[r.jsxs("div",{className:"video-export-upload-file",title:re.filename,children:["Downloaded: ",re.filename]}),r.jsx("p",{className:"video-export-post-render-copy",children:"Your video is ready to go. Pick a platform and upload it!"}),r.jsxs("div",{className:"video-export-upload-links","aria-label":"Open upload page",children:[r.jsxs("button",{type:"button",className:"video-export-share-btn",onClick:mr,disabled:!re.canShare,title:re.canShare?"Open native share sheet":"Native file sharing is not available in this browser",children:[r.jsx(Vl,{}),r.jsx("span",{children:"Native share"})]}),wl.map(y=>r.jsxs("a",{className:"video-export-upload-link",href:y.url,target:"_blank",rel:"noopener noreferrer",children:[r.jsx(Dl,{value:y.value}),r.jsx("span",{children:y.label})]},y.value))]})]}):null,r.jsx("div",{className:`video-export-actions${!G&&!oe?" video-export-actions--reminder":""}`,children:G?r.jsx("button",{className:"embed-popup__copy-btn video-export-cancel-btn",onClick:Ve,disabled:_e,children:_e?"Cancelling...":"Cancel"}):oe?r.jsx("button",{className:"embed-popup__copy-btn share-popup__visibility-btn video-export-render-btn",onClick:fr,children:"Render and Download"}):r.jsxs("div",{className:"video-export-no-poses-reminder",role:"status",children:[r.jsx("p",{className:"video-export-no-poses-reminder__lead",children:"Save at least two camera poses first, then you can render a video from this dialog."}),r.jsxs("ul",{className:"video-export-no-poses-reminder__list",children:[r.jsx("li",{children:"Hold Shift and press a number key (1-9 or 0) to save the current view to that pose slot."}),r.jsx("li",{children:"Add at least two poses so the export can interpolate a smooth camera path between them."})]})]})})]})]})})}function Hl({isPublic:e,isPublicInProgress:t,defaultShowUi:n,onToggleVisibility:o}){const[s,a]=v.useState(!1),[i,c]=v.useState(n),u=()=>{const l=new URL(window.location.href);return i?l.searchParams.delete("no_ui"):l.searchParams.set("no_ui","1"),l.toString()},p=async()=>{await Ho(u()),ae(ve.SHARE_LINK_COPIED,{is_public:e?1:0,show_ui:i?1:0}),a(!0),setTimeout(()=>a(!1),1200)};return r.jsx(on,{trigger:r.jsx("button",{className:te({"viewer-icon-btn":!0,publicBtn:!0,publicDoneBtn:e}),disabled:t,"aria-label":"Scene visibility settings",title:"Scene visibility settings",children:e?r.jsx(Ti,{}):r.jsx(Ii,{})}),modal:!0,onOpen:()=>{c(n),a(!1)},children:l=>r.jsxs("div",{className:"embed-popup",onKeyDown:Ue,onKeyUp:Ue,children:[r.jsx("button",{type:"button",className:"embed-popup__close","aria-label":"Close sharing popup",onClick:l,children:"x"}),r.jsx("h3",{className:"embed-popup__title",children:"Share this scene"}),r.jsxs("p",{className:"share-popup__status",children:["Visibility: ",r.jsx("strong",{children:e?"Public":"Unlisted"})]}),r.jsxs("p",{className:"share-popup__definition",children:[r.jsx("strong",{children:"Public"})," - scene will be featured to everyone ",r.jsx("a",{href:"https://app.splatica.com/public",target:"_blank",rel:"noopener noreferrer",children:"here"})]}),r.jsxs("p",{className:"share-popup__definition",children:[r.jsx("strong",{children:"Unlisted"})," - anyone with the link can see this scene"]}
50),r.jsxs("label",{className:"embed-popup__toggle",children:[r.jsx("input",{type:"checkbox",checked:i,onChange:m=>c(m.target.checked)}),r.jsx("span",{className:"embed-popup__toggle-switch"}),r.jsx("span",{className:"embed-popup__toggle-label",children:i?"Show Navigation UI":"Hide Navigation UI"})]}),r.jsx("p",{className:"embed-popup__hint",children:"Share link:"}),r.jsx("pre",{className:"embed-popup__code",children:u()}),r.jsxs("div",{className:"share-popup__actions",children:[r.jsx("button",{className:"embed-popup__copy-btn",disabled:s,onClick:p,children:s?"Copied!":"Copy link"}),r.jsx("button",{className:"embed-popup__copy-btn share-popup__visibility-btn",disabled:t,onClick:o,children:t?"Updating...":e?"Make unlisted":"Make public"})]})]})})}const Ul="1",zl=180,Wl=1e-6,Gl=new Set(["none","line","bbox"]),Yl=new Set(["translate","scale","rotate"]),Xl=[{value:"translate",label:"Translate"},{value:"scale",label:"Resize"},{value:"rotate",label:"Rotate"}],$l=e=>Number.isFinite(Number(e)),gn=e=>Gl.has(e)?e:"none",vo=e=>Yl.has(e)?e:"translate",rn=(e,t=2)=>{const n=Number(e);return Number.isFinite(n)?n.toFixed(t):"-"},Gt=(e,t="m")=>`${rn(e)} ${t}`,Zl=(e,t="m")=>`${rn(e)} ${t}2`,Kl=(e,t="m")=>`${rn(e)} ${t}3`,Jl=e=>{var t,n;return Array.isArray((t=e.raw)==null?void 0:t.segmentLengths)?e.raw.segmentLengths.length:Array.isArray((n=e.display)==null?void 0:n.segmentLengths)?e.display.segmentLengths.length:0},ql=e=>{var t;return e.kind==="bbox"?{label:"Box",variant:"box",Icon:Bi}:(t=e.raw)!=null&&t.closed?{label:"Polygon",variant:"polygon",Icon:Di}:Jl(e)>1?{label:"Polyline",variant:"polyline",Icon:Vi}:{label:"Line",variant:"line",Icon:Oi}},Ql=e=>{var o,s,a,i,c,u,p,l;const t=((o=e.display)==null?void 0:o.unit)||"m";if(e.kind==="bbox")return[`W ${Gt((s=e.display)==null?void 0:s.width,t)}`,`D ${Gt((a=e.display)==null?void 0:a.depth,t)}`,`H ${Gt((i=e.display)==null?void 0:i.height,t)}`,`V ${Kl((c=e.display)==null?void 0:c.volume,t)}`].join(" | ");const n=`L ${Gt((u=e.display)==null?void 0:u.totalLength,t)}`;return(p=e.raw)!=null&&p.closed?`${n} | A ${Zl((l=e.display)==null?void 0:l.area,t)}`:n},ec=e=>{var n,o;if(!e)return[];if(e.kind==="bbox")return[{value:"width",label:"Width"},{value:"depth",label:"Depth"},{value:"height",label:"Height"},{value:"volume",label:"Volume"}];const t=Array.isArray((n=e.display)==null?void 0:n.segmentLengths)?e.display.segmentLengths:[];return[{value:"total",label:"Total length"},...(o=e.raw)!=null&&o.closed?[{value:"area",label:"Area"}]:[],...t.map((s,a)=>({value:`segment:${a}`,label:`Segment ${a+1}`}))]},go=e=>(e==null?void 0:e.kind)==="bbox"?"width":"total",tc=e=>e==="area"?"m2":e==="volume"?"m3":"m",nc=e=>{const t=e.find(n=>{var o;return Number.isFinite(Number((o=n.display)==null?void 0:o.scaleFactor))});return t?Number(t.display.scaleFactor):1},oc=e=>`${rn(e,3)}x original`,rc=e=>{var t,n;return!!((n=(t=e.target)==null?void 0:t.closest)!=null&&n.call(t,"input, select, textarea, button"))};function sc({viewer:e=null}){const[t,n]=v.useState([]),[o,s]=v.useState("none"),[a,i]=v.useState("translate"),[c,u]=v.useState(Ul),[p,l]=v.useState("total"),[m,f]=v.useState(null),[x,C]=v.useState(null),[w,j]=v.useState(null),[_,M]=v.useState("inside"),[k,T]=v.useState(!1),[U,D]=v.useState(!1),[Y,N]=v.useState(!1),[z,A]=v.useState(!1),W=!!(e&&typeof e.subscribeMeasurements=="function"&&typeof e.getMeasurements=="function");v.useEffect(()=>{if(!W){n([]);return}return e.subscribeMeasurements(E=>{var R;n(Array.isArray(E)?E:[]),f(((R=e.getMeasurementCalibration)==null?void 0:R.call(e))??null)})},[W,e]),v.useEffect(()=>{var E;if(!e){s("none");return}const b=R=>s(gn(R));if(typeof e.subscribeMeasurementMode=="function")return e.subscribeMeasurementMode(b);b(((E=e.getMeasurementMode)==null?void 0:E.call(e))??"none")},[e]),v.useEffect(()=>{var b;i(vo(((b=e==null?void 0:e.getBboxGizmoMode)==null?void 0:b.call(e))??"translate"))},[e]),v.useEffect(()=>(document.body.classList.toggle("measurements-panel-open",z),()=>document.body.classList.remove("measurements-panel-open")),[z]),v.useEffect(()=>{if(U){N(!0);const E=window.requestAnimationFrame(()=>A(!0));return()=>window.cancelAnimationFrame(E)}if(A(!1),!Y)return;const b=window.setTimeout(()=>N(!1),zl);return()=>window.clearTimeout(b)},[U,Y]),v.useEffect(()=>{(!e||!W)&&(D(!1),N(!1),A(!1),f(null))},[W,e]),v.useEffect(()=>{U||j(null)},[U]);const O=v.useMemo(()=>t.find(b=>b.selected)||null,[t]),q=v.useMemo(()=>ec(O),[O]),Q=q.some(b=>b.value===p)?p:go(O),$=tc(Q),ge=Number.isFinite(Number(m==null?void 0:m.scaleFactor))?Number(m.scaleFactor):nc(t),Se=Math.abs(ge-1)<=Wl,G=!Se;if(v.useEffect(()=>{if(!O){l("total");return}new Set(q.map(E=>
50E.value)).has(p)||l(go(O))},[p,q,O]),!e||!W)return null;const Pe=async(b,E)=>{C(null),T(!0);try{const R=await b();return E&&C({type:"info",text:E(R)}),R}catch(R){return C({type:"error",text:(R==null?void 0:R.message)||String(R)}),null}finally{T(!1)}},_e=b=>{var X;const E=gn(b);((X=e.setMeasurementMode)==null?void 0:X.call(e,E))!==!1&&s(E),C(null)},Ce=b=>{_e(o===b?"none":b)},be=b=>{var X;const E=vo(b);((X=e.setBboxGizmoMode)==null?void 0:X.call(e,E))!==!1&&i(E),C(null)},ye=b=>{b.key==="Escape"&&w?(b.preventDefault(),j(null)):b.key==="Escape"&&o!=="none"&&(b.preventDefault(),_e("none")),Ue(b)},ze=b=>{b.key==="Escape"&&(b.preventDefault(),j(null)),Ue(b)},J=()=>{var E,R;const b=((E=e.getMeasurements)==null?void 0:E.call(e))||[];gn(((R=e.getMeasurementMode)==null?void 0:R.call(e))??o),b.length||_e("none"),D(!1)},re=()=>{var E,R;if(U){J();return}const b=((E=e.getMeasurements)==null?void 0:E.call(e))||[];n(b),f(((R=e.getMeasurementCalibration)==null?void 0:R.call(e))??null),C(null),b.length||_e("line"),D(!0)},Le=b=>{var E;(E=e.selectMeasurement)==null||E.call(e,b),C(null)},se=(b,E)=>{var R;(R=e.updateMeasurement)==null||R.call(e,b,E)},xe=(b,E)=>{var R;b.stopPropagation(),(R=e.deleteMeasurement)==null||R.call(e,E)},je=(b,E)=>{b.stopPropagation(),se(E.id,{visible:!E.visible})},Ae=()=>{var b,E,R;(b=e.clearMeasurements)==null||b.call(e),n(((E=e.getMeasurements)==null?void 0:E.call(e))||[]),f(((R=e.getMeasurementCalibration)==null?void 0:R.call(e))??null),C({type:"info",text:"Measurements cleared."})},me=()=>{var R,X;const b=Number(c);if(!O||!$l(b)||b<=0){C({type:"error",text:"Enter a positive reference value."});return}const E=(R=e.setMeasurementCalibration)==null?void 0:R.call(e,{measurementId:O.id,component:Q,realValue:b,unit:"m"});C(E?{type:"info",text:"Reference scale applied."}:{type:"error",text:"Selected measurement cannot be used for calibration."}),f(((X=e.getMeasurementCalibration)==null?void 0:X.call(e))??null)},Oe=()=>{var b,E;(b=e.clearMeasurementCalibration)==null||b.call(e),f(((E=e.getMeasurementCalibration)==null?void 0:E.call(e))??null),C({type:"info",text:"Reference scale reset."})},Ve=()=>Pe(()=>{var b;return(b=e.downloadSplatsWithMeasurementBox)==null?void 0:b.call(e,O.id)},b=>`Downloaded ${(b==null?void 0:b.exportedCount)??0} splats.`),We=(b,E="inside")=>{Pe(()=>{var R;return(R=e.cutSplatsWithMeasurementBox)==null?void 0:R.call(e,b,{region:E})},R=>`Cut ${(R==null?void 0:R.cutCount)??0} splats ${E==="outside"?"outside":"inside"} the box.`)},ee=()=>{j({type:"clearAll"})},De=()=>{O!=null&&O.id&&j({type:"cutBox",measurementId:O.id,measurementName:O.name||"selected box"})},B=()=>{j(null)},F=()=>{const b=w;if(j(null),(b==null?void 0:b.type)==="clearAll"){Ae();return}(b==null?void 0:b.type)==="cutBox"&&b.measurementId&&We(b.measurementId,_)},Te=(w==null?void 0:w.type)==="clearAll"?"Clear all measurements?":"Cut splats?",fe=(w==null?void 0:w.type)==="clearAll"?"This removes every measurement saved for the current scene.":`This removes splats ${_==="outside"?"outside":"inside"} ${(w==null?void 0:w.measurementName)||"the selected box"} from the current scene.`,Ze=(w==null?void 0:w.type)==="clearAll"?"Clear all":"Cut",le=(O==null?void 0:O.kind)==="bbox"&&typeof e.setBboxGizmoMode=="function",Ie=(O==null?void 0:O.kind)==="bbox"&&typeof e.downloadSplatsWithMeasurementBox=="function"&&typeof e.cutSplatsWithMeasurementBox=="function";return r.jsxs("div",{className:"measurements-panel-shell",children:[r.jsx("button",{type:"button",className:te("viewer-icon-btn",{"measurements-panel-trigger--active":U}),"aria-label":U?"Close measurements":"Measurements","aria-expanded":U,"aria-controls":"measurements-drawer",title:"Measurements",onClick:re,children:r.jsx(Fi,{})}),Y?r.jsxs("aside",{id:"measurements-drawer",className:te("measurements-drawer__panel",{"measurements-drawer__panel--visible":z}),onKeyDown:ye,onKeyUp:Ue,children:[r.jsxs("header",{className:"measurements-drawer__header",children:[r.jsxs("div",{className:"measurements-drawer__heading",children:[r.jsx("h3",{className:"measurements-drawer__title",children:"Measurements"}),r.jsxs("span",{className:"measurements-drawer__count",children:[t.length," ",t.length===1?"item":"items"]})]}),r.jsx("button",{type:"button",className:"measurements-drawer__close","aria-label":"Close measurements",onClick:J,children:"x"})]}),r.jsxs("div",{className:"measurements-drawer__body",children:[r.jsxs("div",{className:"measurements-panel__toolbar",children:[r.jsxs("div",{className:"measurements-panel__create-control",children:[r.jsx("span",{className:"measurements-panel__toolbar-label",children:"Create"}),r.jsxs("div",{className:"measurements-panel__mode-group","aria-label":"Measurement creation mode",children:[r.jsx("button",{type:"button",className:te("measurements-panel__mode-btn",{"measurements-panel__mode-btn--active":o==="line"}),onClick:()=>Ce("line"),"aria-pressed":o==="line",children:"Line"}),r.jsx("button",{type:"button",className:te("measurements-panel__mode-btn",{"measurements-panel__mode-btn--active":o==="bbox"}),onClick:()=>Ce("bbox"),"aria-pressed":o==="bbox",children:"Box"})]})]}),r.jsx("button",{type:"button",className:"measurements-panel__danger-btn",disabled:!t.length,onClick:ee,children:"Clear all"})]}),r.jsx("div",{className:"measurements-panel__list",children:t.length?t.map(b=>{const E=ql(b),R=E.Icon;return r.jsxs("div",{className:te("measurements-panel__item",`measurements-panel__item--${E.variant}`,{"measurements-panel__item--selected":b.selected}),role:"button",tabIndex:0,onClick:()=>Le(b.id),onKeyDown:X=>{rc(X)||(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),Le(b.id))},children:[r.jsxs("div",{className:"measurements-panel__item-main",children:[r.jsxs("div",{className:"measurements-panel__item-heading",children:[r.jsx("span",{className:te("measurements-panel__type-icon",`measurements-panel__type-icon--${E.variant}`),title:E.label,"aria-label":E.label,children:r.jsx(R,{})}),r.jsx("input",{className:"measurements-panel__name-field",value:b.name||"",onClick:X=>X.stopPropagation(),onChange:X=>se(b.id,{name:X.target.value}),"aria-label":`${b.name||E.label} name`})]}),r.jsx("div",{className:"measurements-panel__summary",children:Ql(b)})]}),r.jsxs("div",{className:"measurements-panel__row-actions",onClick:X=>X.stopPropagation(),children:[r.jsx("button",{type:"button",className:"measurements-panel__icon-btn","aria-label":b.visible?"Hide measurement":"Show measurement",title:b.visible?"Hide measurement":"Show measurement",onClick:X=>je(X,b),children:b.visible?r.jsx(Hi,{}):r.jsx(Ui,{})}),r.jsx("button",{type:"button",className:"measurements-panel__icon-btn measurements-panel__icon-btn--danger","aria-label":"Delete measurement",title:"Delete measurement",onClick:X=>xe(X,b.id),children:r.jsx(Xo,{})})]})]},b.id)}):r.jsx("p",{className:"measurements-panel__empty",children:"No measurements yet."})}),r.jsxs("section",{className:"measurements-panel__section",children:[r.jsx("h4",{className:"measurements-panel__section-title",children:"Reference Scale"}),O?r.jsxs("div",{className:"measurements-panel__calibration-grid",children:[r.jsx("select",{className:"measurements-panel__field measurements-panel__field--select",value:Q,onChange:b=>l(b.target.value),children:q.map(b=>r.jsx("option",{value:b.value,children:b.label},b.value))}),r.jsxs("label",{className:"measurements-panel__reference-input",children:[r.jsx("input",{className:"measurements-panel__field measurements-panel__field--number",type:"number",min:"0.001",step:"0.001",value:c,onChange:b=>u(b.target.value),"aria-label":`Reference value in ${$}`}),r.jsx("span",{className:"measurements-panel__unit-label",children:$})]}),r.jsx("button",{type:"button",className:"measurements-panel__text-btn measurements-panel__text-btn--primary",onClick:me,children:"Apply"}),r.jsx("button",{type:"button",className:"measurements-panel__text-btn",disabled:Se,onClick:Oe,children:"Reset"})]}):G?r.jsxs("div",{className:"measurements-panel__calibration-current",children:[r.jsxs("p",{className:"measurements-panel__section-subtle",children:["Current scale: ",oc(ge)]}),r.jsx("button",{type:"button",className:"measurements-panel__text-btn",disabled:Se,onClick:Oe,children:"Reset"})]}):r.jsx("p",{className:"measurements-panel__section-subtle",children:"Select a measurement to set a reference scale."})]}),le?r.jsxs("section",{className:"measurements-panel__section",children:[r.jsx("h4",{className:"measurements-panel__section-title",children:"Box Edit"}),r.jsx("div",{className:"measurements-panel__edit-mode-group","aria-label":"Box edit mode",role:"group",children:Xl.map(b=>r.jsx("button",{type:"button",className:te("measurements-panel__edit-mode-btn",{"measurements-panel__edit-mode-btn--active":a===b.value}),"aria-pressed":a===b.value,onClick:()=>be(b.value),children:b.label},b.value))})]}):null,(O==null?void 0:O.kind)==="bbox"?r.jsxs("section",{className:"measurements-panel__section",children:[r.jsx("h4",{className:"measurements-panel__section-title",children:"Box Splats"}),r.jsxs("div",{className:"measurements-panel__splat-actions",children:[r.jsx("button",{type:"button",className:"measurements-panel__text-btn",disabled:k||!Ie,onClick:Ve,children:"Download PLY"}),r.jsx("button",{type:"button",className:"measurements-panel__danger-btn",disabled:k||!Ie,onClick:De,children:"Cut"})]})]}):null,x?r.jsx("p",{className:te("measurements-panel__status",{"measurements-panel__status--error":x.type==="error"}),children:x.text}):null]})]}):null,w?r.jsx("div",{className:"measurements-panel__confirm-layer",role:"presentation",onKeyDown:ze,onKeyUp:Ue,children:r.jsxs("div",{className:"measurements-panel__confirm-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"measurements-confirm-title","aria-describedby":"measurements-confirm-message",children:[r.jsx("h4",{id:"measurements-confirm-title",className:"measurements-panel__confirm-title",children:Te}),r.jsx("p",{id:"measurements-confirm-message",className:"measurements-panel__confirm-message",children:fe}),w.type==="cutBox"?r.jsxs("div",{className:"measurements-panel__cut-region","aria-label":"Cut region",role:"group",children:[r.jsx("button",{type:"button",className:te("measurements-panel__cut-region-btn",{"measurements-panel__cut-region-btn--active":_==="inside"}),onClick:()=>M("inside"),children:"Inside"}),r.jsx("button",{type:"button",className:te("measurements-panel__cut-region-btn",{"measurements-panel__cut-region-btn--active":_==="outside"}),onClick:()=>M("outside"),children:"Outside"})]}):null,r.jsxs("div",{className:"measurements-panel__confirm-actions",children:[r.jsx("button",{type:"button",className:"measurements-panel__text-btn",onClick:B,autoFocus:!0,children:"Cancel"}),r.jsx("button",{type:"button",className:"measurements-panel__danger-btn",onClick:F,children:Ze})]})]})}):null]})}const bo={404:{eyebrow:"Route Lost",code:"404",title:"This scene drifted out of view.",description:"The page you were looking for does not exist here anymore, or the link was never valid to begin with.",actionType:"link",actionLabel:"Go home",actionHref:"https://app.splatica.com/gallery"},403:{eyebrow:"Access Restricted",code:"403",title:"This scene is private.",description:"You do not have permission to view this
50scene. Sign in with an account that has access, or ask the owner to make it public.",actionType:"link",actionLabel:"Sign in",actionHref:"https://app.splatica.com/login"},500:{eyebrow:"Viewer Error",code:"500",title:"Something went wrong while loading this scene.",description:"Our server hit an unexpected issue. Please refresh the page or try again later.",actionType:"reload",actionLabel:"Reload"}};function yo({status:e=500}){const t=bo[e]||bo[500];return r.jsx("div",{className:"not-found-page-shell",children:r.jsxs("div",{className:"not-found-page-panel",children:[r.jsx("p",{className:"not-found-page-eyebrow",children:t.eyebrow}),r.jsx("p",{className:"not-found-page-code",children:t.code}),r.jsx("h1",{className:"not-found-page-title",children:t.title}),r.jsx("p",{className:"not-found-page-description",children:t.description}),r.jsx("div",{className:"not-found-page-actions",children:t.actionType==="link"?r.jsx("a",{className:"not-found-page-action-link",href:t.actionHref,children:t.actionLabel}):r.jsx("button",{className:"not-found-page-action-link",type:"button",onClick:()=>window.location.reload(),children:t.actionLabel})})]})})}function ac(e,t){const n=v.useRef(t);n.current=t,v.useEffect(()=>{if(!e)return;const o=s=>{if(s.code!=="KeyT"||s.repeat||s.ctrlKey||s.metaKey||s.altKey)return;const a=s.target;a instanceof HTMLElement&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.tagName==="SELECT"||a.isContentEditable)||(s.preventDefault(),n.current())};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[e])}const ic=[{fmt:"sd",label:"SD"},{fmt:"hd",label:"HD"},{fmt:"ply",label:"PLY"}];function lc({availableFormats:e,format:t,onSelect:n}){const o=ic.filter(({fmt:a})=>e.has(a)),s=o.length>2?"triple":"dual";return o.length<2?null:r.jsx("div",{className:te("ksplat-toggle",`ksplat-toggle--${s}`),role:"radiogroup","aria-label":`Switch between ${o.map(({label:a})=>a).join(", ")} splat formats`,children:r.jsx("div",{className:te("ksplat-toggle__control",`ksplat-toggle__control--${s}`),children:o.map(({fmt:a,label:i})=>r.jsx("button",{type:"button",role:"radio","aria-checked":t===a,className:te("ksplat-toggle__segment-btn",{"ksplat-toggle__segment-btn--active":t===a}),onClick:()=>t!==a&&n(a),children:i},a))})})}function cc({open:e,loading:t=!1,onStart:n}){return e?r.jsx("div",{className:"tap-to-load-scene",children:r.jsx("button",{type:"button",className:"viewer-cta-link viewer-cta-link-mobile tap-to-load-scene__btn",onClick:n,disabled:t,"aria-label":"Load scene",children:r.jsx("span",{className:t?"tap-to-load-scene__icon viewer-icon-spin":"tap-to-load-scene__icon",children:t?r.jsx($o,{}):r.jsx(Zo,{})})})}):null}const uc="This scene is not used for AI training",dc="splatica:ai-training-notice-shown:",Qo=e=>e==null||e===""?null:`${dc}${encodeURIComponent(String(e))}`,pc=e=>{const t=Qo(e);if(!t||typeof window>"u")return!1;try{return window.localStorage.getItem(t)==="true"}catch{return!1}};function mc({sceneId:e}){const[t,n]=v.useState(()=>pc(e));return v.useEffect(()=>{const o=Qo(e);if(o)try{window.localStorage.setItem(o,"true")}catch{}},[e]),r.jsx("aside",{className:te("organization-privacy-notice",{"organization-privacy-notice--collapsed":t}),"aria-label":"Data privacy notice",children:r.jsxs("button",{type:"button",className:"organization-privacy-notice__toggle","aria-controls":"organization-privacy-notice-message","aria-expanded":!t,"aria-label":t?"Show data privacy notice":"Collapse data privacy notice",title:t?uc:"Collapse data privacy notice",onClick:()=>n(o=>!o),children:[r.jsxs("svg",{className:"organization-privacy-notice__shield",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M12 3l7 3v5c0 4.6-2.8 8.1-7 10-4.2-1.9-7-5.4-7-10V6z"}),r.jsx("path",{d:"M9 12l2 2 4-4"})]}),r.jsxs("span",{id:"organization-privacy-notice-message",className:"organization-privacy-notice__message",hidden:t,children:["This scene is ",r.jsx("strong",{children:"not"})," used for AI training"]}),r.jsx("svg",{className:"organization-privacy-notice__chevron",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r.jsx("path",{d:"M6 8l4 4 4-4"})})]})})}const xo=690,fc=new Set([1637,1792,2528,2356,3149]);function hc(e){return e?typeof e=="string"?e.trim().length>0:typeof e=="object"?Object.keys(e).length>0:!0:!1}function wo(e){const t=Number(e==null?void 0:e.status);if(t===403||t===404)return t;const n=String((e==null?void 0:e.message)||"").toLowerCase();return n.includes("forbidden")||n.includes("access denied")||n.includes("permission")?403:n.includes("not found")?404:500}function vc(e){const t=fc.has(e);return e==null||e===""?Promise.resolve({isMy:!1,isPublic:!1,isPublicallyExportable:t}):fetch(`/api/results?id=${e}&isMy=true`).then(n=>{if(n.status===204)return[{isMy:!1,isPublic:!1,isPublicallyExportable:t}];if(n.ok)return n.json();throw new Error("Failed to fetch result info")}).then(n=>({...n[0],isPublicallyExportable:t})).catch(n=>(console.error("Failed to get result info:",n),{isMy:!1,isPublic:!1,isPublicallyExportable:t}))}function gc(e,t){return fetch(`/api/results/${t?"unpublish":"publish"}/${e}`,{method:"POST"})}function bc({viewer:e,initError:t=null,viewerUuid:n=null,isMobile:o=!1,resultId:s=null,pipelineUuid:a=null,sceneFormat:i=null,sceneFormats:c={},viewerType:u=null,modelFormat:p=null,modelCameras:l=null,deferredLoad:m=!1,analyticsSource:f=null,loadDeferredViewer:x=null}){const w=new URLSearchParams(window.location.search).get("no_ui"),j=w!==null&&w!=="0"&&w.toLowerCase()!=="false",_=!!s,M=n||s;if(t)return r.jsx(yo,{status:wo(t)});const[k,T]=v.useState(()=>e??null),[U,D]=v.useState(!1),[Y,N]=v.useState(null),[z,A]=v.useState({isMy:void 0,isPublic:void 0,isPublicallyExportable:!1,isPublicInProgress:void 0}),[W,O]=v.useState(!1),[q,Q]=v.useState(!1),[$,ge]=v.useState(!1),[Se,G]=v.useState(()=>typeof x=="function");v.useEffect(()=>{e&&T(e)},[e]),v.useEffect(()=>{vc(s).then(F=>A({...F,isPublicInProgress:!1}));const B=document.querySelector(".progressBarBox");B&&B.style.setProperty("bottom","45%","important")},[s]),v.useEffect(()=>{const B=new AbortController;return ni({signal:B.signal}).then(F=>{O(hc(F==null?void 0:F.organization))}).catch(F=>{F.name!=="AbortError"&&console.error("Failed to get current user:",F)}),()=>B.abort()},[]);const[Pe,_e]=v.useState(()=>typeof window<"u"&&window.innerWidth<xo);v.useEffect(()=>{const B=window.matchMedia(`(max-width: ${xo-1}px)`),F=()=>{_e(B.matches)};return F(),B.addEventListener("change",F),()=>B.removeEventListener("change",F)},[]);const Ce=async()=>
50{if(!s)return;A(F=>({...F,isPublicInProgress:!0}));const B=z.isPublic;try{await gc(s,B),A(F=>({...F,isPublic:!F.isPublic,isPublicInProgress:!1}))}catch{A(F=>({...F,isPublicInProgress:!1}))}},be=()=>{if(k&&typeof k.resetCamera=="function"){k.resetCamera();return}window.dispatchEvent(new KeyboardEvent("keydown",{code:"KeyR",key:"r",bubbles:!0}))},ye=v.useMemo(()=>({...Go({sceneId:M,resultId:s,viewerUuid:n,pipelineUuid:a,sceneFormat:i,viewerType:u,modelFormat:p,isMobile:o,deferredLoad:m,source:f}),no_ui:j?1:0}),[f,m,j,o,p,a,s,i,M,u,n]);v.useEffect(()=>(ri(ye),si),[ye]);const ze=async()=>{if(!(U||typeof x!="function")){ae(ve.DEFERRED_LOAD_CLICKED),D(!0);try{const B=await x();T(B),G(!1)}catch(B){console.error("Failed to initialize deferred viewer:",B),N(B)}finally{D(!1)}}},J=()=>{if(!(!k||$))if(q)k.hidePoses(),Q(!1);else{const B=!k._posesMesh;B&&ge(!0),k.showPoses(F=>{B&&ge(!1),F||Q(!0)})}},re=B=>{localStorage.setItem("queryModelFormatPreference",B),ae(ve.SCENE_FORMAT_CHANGED,{previous_scene_format:i,next_scene_format:B,available_scene_formats:Object.keys(c||{}).join(",")},{callback:()=>location.reload()})},Le=new Set(Object.keys(c)),se=!!l;ac(!!(k&&se),J);const{ctaUrl:xe,logoUrl:je}=gi(M);if(Y)return r.jsx(yo,{status:wo(Y)});const Ae=W&&z.isMy===!0;if(!k)return Se?r.jsxs(r.Fragment,{children:[r.jsx("a",{href:je,target:"_blank",rel:"noopener noreferrer",children:r.jsx(io,{color:"white",className:"logo"})}),r.jsx(cc,{open:Se,loading:U,onStart:ze})]}):null;const Oe=_&&z.isMy===!1&&!Se,Ve=!o&&Pe&&Oe,We=o&&Oe,ee=!o&&!Pe&&Oe,De=!o&&Le.size>1;return r.jsxs(r.Fragment,{children:[r.jsx("a",{href:je,target:"_blank",rel:"noopener noreferrer",children:r.jsx(io,{color:"white",className:"logo"})}),r.jsxs("div",{className:te("ui",{"ui-mobile":o}),children:[De?r.jsx(lc,{availableFormats:Le,format:i,onSelect:re}):null,Ve?r.jsx("div",{className:"ui__toolbar-cta",children:r.jsx("a",{className:"viewer-cta-link viewer-cta-link-mobile",href:xe,target:"_blank",rel:"noopener noreferrer","aria-label":un,title:dn,onClick:()=>ae(ve.CTA_CLICKED,{placement:"toolbar"}),children:r.jsx(to,{})})},"toolbarCta"):null,r.jsxs("div",{className:"card",children:[Ae?r.jsx(mc,{sceneId:M},M):null,We?r.jsx("div",{className:"mobile-cta-btn-wrap",children:r.jsx("a",{className:"viewer-cta-link viewer-cta-link-mobile",href:xe,target:"_blank",rel:"noopener noreferrer","aria-label":un,title:dn,onClick:()=>ae(ve.CTA_CLICKED,{placement:"mobile_card"}),children:r.jsx(to,{})})},"mobileCtaBtn"):null,!z.isMy||!_?null:r.jsx("div",{children:r.jsx(Hl,{isPublic:z.isPublic,isPublicInProgress:z.isPublicInProgress,defaultShowUi:!j,onToggleVisibility:Ce})},"privateBtn"),z.isMy?r.jsx(r.Fragment,{children:r.jsx("div",{className:"embed",children:r.jsx(Zi,{})},"embedBtn")}):null,!j&&!o?r.jsx("div",{children:r.jsx(sc,{viewer:k})},"measurementsBtn"):null,o?r.jsx("button",{type:"button",onClick:be,className:"viewer-icon-btn","aria-label":"Reset to start position",title:"Reset to start position",children:r.jsx(Yi,{})}):null,se?r.jsx("div",{children:r.jsx("button",{onClick:J,disabled:$,className:"viewer-icon-btn","aria-label":$?"Loading camera trajectory":q?"Hide camera trajectory (T)":"Show camera trajectory (T)",title:$?"Loading camera trajectory":q?"Hide camera trajectory (T)":"Show camera trajectory (T)",children:r.jsx("span",{className:te({"viewer-icon-spin":$}),children:$?r.jsx($o,{}):q?r.jsx(Wi,{}):r.jsx(Gi,{})})})}):null]})]}),ee?r.jsx("div",{className:"viewer-cta",children:r.jsx("a",{className:"viewer-cta-link",href:xe,target:"_blank",rel:"noopener noreferrer",title:dn,onClick:()=>ae(ve.CTA_CLICKED,{placement:"top_center"}),children:un})}):null,j?null:o?r.jsx(bi,{}):r.jsx(hl,{viewer:k,exportControl:z.isMy||z.isPublicallyExportable?r.jsx(Bl,{viewer:k,disabled:!k||typeof k.exportVideo!="function",triggerClassName:"userControls__export-trigger",triggerLabel:"Export video"}):null})]})}const yc=gr.createRoot(document.getElementById("ui")),So=({viewer:e=null,appProps:t={}}={},n=null)=>{yc.render(r.jsx(v.StrictMode,{children:r.jsx(bc,{viewer:e,initError:n,...t})}))};fi().then(So).catch(e=>{console.error("Failed to initialize viewer:",e),So(void 0,e)});export{qa as a,$t as g,Sc as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.