>>13,d=8191&u,p=(1<7e3||S>24576)&&T>423){l=a2(e,o,0,B,y,Q,v,S,x,h-x,l),S=w=v=0,x=h;for(var L=0;L<286;++L)y[L]=0;for(var L=0;L<30;++L)Q[L]=0}var F=2,k=0,_=d,U=R-D&32767;if(T>2&&M==C(h-U))for(var N=Math.min(g,T)-1,G=Math.min(32767,h),P=Math.min(258,T);U<=G&&--_&&R!=D;){if(e[h+F]==e[h+F-U]){for(var O=0;OF){if(F=O,k=U,O>N)break;for(var H=Math.min(U,O-2),q=0,L=0;Lq&&(q=J,D=K)}}}D=m[R=D],U+=R-D+32768&32767}if(k){B[S++]=268435456|aT[F]<<18|ak[k];var Y=31&aT[F],j=31&ak[k];v+=aS[Y]+ab[j],++y[257+Y],++Q[j],b=h+F,++w}else B[S++]=e[h],++y[e[h]]}}l=a2(e,o,n,B,y,Q,v,S,x,h-x,l),!n&&7&l&&(l=a1(o,l+1,a4))}return aj(A,0,s+aY(l)+r)},a5=function(){for(var e=new av(256),t=0;t<256;++t){for(var i=t,s=9;--s;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e}(),a6=function(){var e=-1;return{p:function(t){for(var i=e,s=0;s>>8;e=i},d:function(){return~e}}},a9=function(e,t){var i={};for(var s in e)i[s]=e[s];for(var s in t)i[s]=t[s];return i},a7=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},Ae=function(e,t,i,s){for(var r in e){var n=e[r],a=t+r;n instanceof aQ?i[a]=[n,s]:Array.isArray(n)?i[a]=[n[0],a9(s,n[1])]:Ae(n,a+"/",i,s)}},At="undefined"!=typeof TextEncoder&&new TextEncoder,Ai="undefined"!=typeof TextDecoder&&new TextDecoder;try{Ai.decode(a4,{stream:!0})}catch(As){}function Ar(e,t){if(t){for(var i=new aQ(e.length),s=0;s>1)),a=0,A=function(e){n[a++]=e},s=0;sn.length){var o=new aQ(a+8+(r-s<<1));o.set(n),n=o}var l=e.charCodeAt(s);l<128||t?A(l):l<2048?(A(192|l>>6),A(128|63&l)):l>55295&&l<57344?(A(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++s))>>18),A(128|l>>12&63),A(128|l>>6&63),A(128|63&l)):(A(224|l>>12),A(128|l>>6&63),A(128|63&l))}return aj(n,0,a)}var An=function(e){var t=0;if(e)for(var i in e){var s=e[i].length;if(s>65535)throw"extra field too long";t+=s+4}return t},Aa=function(e,t,i,s,r,n,a,A){var o=s.length,l=i.extra,h=A&&A.length,c=An(l);a7(e,t,null!=a?33639248:67324752),t+=4,null!=a&&(e[t++]=20,e[t++]=i.os),e[t]=20,t+=2,e[t++]=i.flag<<1|(null==n&&8),e[t++]=r&&8,e[t++]=255&i.compression,e[t++]=i.compression>>8;var u=new Date(null==i.mtime?Date.now():i.mtime),g=u.getFullYear()-1980;if(g<0||g>119)throw"date not in range 1980-2099";if(a7(e,t,g<<25|u.getMonth()+1<<21|u.getDate()<<16|u.getHours()<<11|u.getMinutes()<<5|u.getSeconds()>>>1),t+=4,null!=n&&(a7(e,t,i.crc),a7(e,t+4,n),a7(e,t+8,i.size)),a7(e,t+12,o),a7(e,t+14,c),t+=16,null!=a&&(a7(e,t,h),a7(e,t+6,i.attrs),a7(e,t+10,a),t+=14),e.set(s,t),t+=o,c)for(var d in l){var p=l[d],m=p.length;a7(e,t,+d),a7(e,t+2,m),e.set(p,t+4),t+=4+m}return h&&(e.set(A,t),t+=h),t},AA=function(e,t,i,s,r){a7(e,t,101010256),a7(e,t+8,i),a7(e,t+10,i),a7(e,t+12,s),a7(e,t+16,r)};class Ao{async parse(e){let t={},i="model.usda";t[i]=null;let s=Al(),r={},n={};for(let a in e.traverseVisible(e=>{if(e.isMesh){let i=e.geometry,n=e.material;if(n.isMeshStandardMaterial){let a="geometries/Geometry_"+i.id+".usd";if(!(a in t)){var A;let o;let l=function(e){let t=function(e){let t=e.attributes,i=t.position.count;return`
def Mesh "Geometry"
{
int[] faceVertexCounts = [${function(e){let t=null!==e.index?e.index.count:e.attributes.position.count;return Array(t/3).fill(3).join(", ")}(e)}]
int[] faceVertexIndices = [${function(e){let t=e.index,i=[];if(null!==t)for(let s=0;se.matrixWorld.determinant()&&console.warn("THREE.USDZExporter: USDZ does not support negative scales",e),`def Xform "${s}" (
prepend references = @./geometries/Geometry_${t.id}.usd@
)
{
matrix4d xformOp:transform = ${r}
uniform token[] xformOpOrder = ["xformOp:transform"]
rel material:binding =
}
`}(e,i,n)}else console.warn("THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",e)}else e.isCamera&&(s+=function(e){let t=e.name?e.name:"Camera_"+e.id,i=Ah(e.matrixWorld);return(0>e.matrixWorld.determinant()&&console.warn("THREE.USDZExporter: USDZ does not support negative scales",e),e.isOrthographicCamera)?`def Camera "${t}"
{
matrix4d xformOp:transform = ${i}
uniform token[] xformOpOrder = ["xformOp:transform"]
float2 clippingRange = (${e.near}, ${e.far})
float horizontalAperture = ${(Math.abs(e.left)+Math.abs(e.right))*10}
float verticalAperture = ${(Math.abs(e.top)+Math.abs(e.bottom))*10}
token projection = "orthographic"
}
`:`def Camera "${t}"
{
matrix4d xformOp:transform = ${i}
uniform token[] xformOpOrder = ["xformOp:transform"]
float2 clippingRange = (${e.near}, ${e.far})
float focalLength = ${e.getFocalLength()}
float focusDistance = ${e.focus}
float horizontalAperture = ${e.getFilmWidth()}
token projection = "perspective"
float verticalAperture = ${e.getFilmHeight()}
}
`}(e))}),s+=function(e,t){let i=[];for(let s in e){let r=e[s];i.push(function(e,t){let i=" ",s=[],r=[];function n(i,s,r){let n=i.id+(r?"_"+r.getHexString():""),a=1023===i.format;return t[n]=i,`
def Shader "Transform2d_${s}" (
sdrMetadata = {
string role = "math"
}
)
{
uniform token info:id = "UsdTransform2d"
float2 inputs:in.connect =
float2 inputs:scale = ${Ad(i.repeat)}
float2 inputs:translation = ${Ad(i.offset)}
float2 outputs:result
}
def Shader "Texture_${i.id}_${s}"
{
uniform token info:id = "UsdUVTexture"
asset inputs:file = @textures/Texture_${n}.${a?"png":"jpg"}@
float2 inputs:st.connect =
token inputs:wrapS = "repeat"
token inputs:wrapT = "repeat"
float outputs:r
float outputs:g
float outputs:b
float3 outputs:rgb
${e.transparent||e.alphaTest>0?"float outputs:a":""}
}`}return e.side===el.ehD&&console.warn("THREE.USDZExporter: USDZ does not support double sided materials",e),null!==e.map?(s.push(`${i}color3f inputs:diffuseColor.connect = `),e.transparent?s.push(`${i}float inputs:opacity.connect = `):e.alphaTest>0&&(s.push(`${i}float inputs:opacity.connect = `),s.push(`${i}float inputs:opacityThreshold = ${e.alphaTest}`)),r.push(n(e.map,"diffuse",e.color))):s.push(`${i}color3f inputs:diffuseColor = ${Ag(e.color)}`),null!==e.emissiveMap?(s.push(`${i}color3f inputs:emissiveColor.connect = `),r.push(n(e.emissiveMap,"emissive"))):e.emissive.getHex()>0&&s.push(`${i}color3f inputs:emissiveColor = ${Ag(e.emissive)}`),null!==e.normalMap&&(s.push(`${i}normal3f inputs:normal.connect = `),r.push(n(e.normalMap,"normal"))),null!==e.aoMap&&(s.push(`${i}float inputs:occlusion.connect = `),r.push(n(e.aoMap,"occlusion"))),null!==e.roughnessMap&&1===e.roughness?(s.push(`${i}float inputs:roughness.connect = `),r.push(n(e.roughnessMap,"roughness"))):s.push(`${i}float inputs:roughness = ${e.roughness}`),null!==e.metalnessMap&&1===e.metalness?(s.push(`${i}float inputs:metallic.connect = `),r.push(n(e.metalnessMap,"metallic"))):s.push(`${i}float inputs:metallic = ${e.metalness}`),null!==e.alphaMap?(s.push(`${i}float inputs:opacity.connect = `),s.push(`${i}float inputs:opacityThreshold = 0.0001`),r.push(n(e.alphaMap,"opacity"))):s.push(`${i}float inputs:opacity = ${e.opacity}`),e.isMeshPhysicalMaterial&&(s.push(`${i}float inputs:clearcoat = ${e.clearcoat}`),s.push(`${i}float inputs:clearcoatRoughness = ${e.clearcoatRoughness}`),s.push(`${i}float inputs:ior = ${e.ior}`)),`
def Material "Material_${e.id}"
{
def Shader "PreviewSurface"
{
uniform token info:id = "UsdPreviewSurface"
${s.join("\n")}
int inputs:useSpecularWorkflow = 0
token outputs:surface
}
token outputs:surface.connect =
token inputs:frame:stPrimvarName = "st"
def Shader "uvReader_st"
{
uniform token info:id = "UsdPrimvarReader_float2"
token inputs:varname.connect =
float2 inputs:fallback = (0.0, 0.0)
float2 outputs:result
}
${r.join("\n")}
}
`}(r,t))}return`def "Materials"
{
${i.join("")}
}
`}(r,n),t[i]=Ar(s),s=null,n){let A=n[a],o=a.split("_")[1],l=1023===A.format,h=function(e,t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){let i=1024/Math.max(e.width,e.height),s=document.createElement("canvas");s.width=e.width*Math.min(1,i),s.height=e.height*Math.min(1,i);let r=s.getContext("2d");if(r.drawImage(e,0,0,s.width,s.height),void 0!==t){let n=parseInt(t,16),a=(n>>16&255)/255,A=(n>>8&255)/255,o=(255&n)/255,l=r.getImageData(0,0,s.width,s.height),h=l.data;for(let c=0;ch.toBlob(e,l?"image/png":"image/jpeg",1));t[`textures/Texture_${a}.${l?"png":"jpg"}`]=new Uint8Array(await c.arrayBuffer())}let u=0;for(let g in t){let d=t[g],p=34+g.length;u+=p;let m=63&u;if(4!==m){let I=64-m,f=new Uint8Array(I);t[g]=[d,{extra:{12345:f}}]}u=d.length}return function(e,t){t||(t={});var i={},s=[];Ae(e,"",i,t);var r=0,n=0;for(var a in i){var A=i[a],o=A[0],l=A[1],h=0==l.level?0:8,c=Ar(a),u=c.length,g=l.comment,d=g&&Ar(g),p=d&&d.length,m=An(l.extra);if(u>65535)throw"filename too long";var I=h?function(e,t){var i;return a8(e,null==(i=t||{}).level?6:i.level,null==i.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+i.mem,0,0,!0)}(o,l):o,f=I.length,E=a6();E.p(o),s.push(a9(l,{size:o.length,crc:E.d(),c:I,f:c,m:d,u:u!=a.length||d&&g.length!=p,o:r,compression:h})),r+=30+u+m+f,n+=76+2*(u+m)+(p||0)+f}for(var C=new aQ(n+22),B=r,y=n-r,Q=0;Q=0;A--)(r=e[A])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let Am=!1,AI=!1,Af="#model-viewer-no-ar-fallback",AE=(m=["quick-look","scene-viewer","webxr","none"],e=>{try{let t=no(e),i=(t.length?t[0].terms:[]).filter(e=>e&&"ident"===e.type).map(e=>e.value).filter(e=>m.indexOf(e)>-1),s=new Set;for(let r of i)s.add(r);return s}catch(n){}return new Set}),AC={QUICK_LOOK:"quick-look",SCENE_VIEWER:"scene-viewer",WEBXR:"webxr",NONE:"none"},AB=Symbol("arButtonContainer"),Ay=Symbol("enterARWithWebXR"),AQ=Symbol("openSceneViewer"),Aw=Symbol("openIOSARQuickLook"),Av=Symbol("canActivateAR"),AS=Symbol("arMode"),Ab=Symbol("arModes"),Ax=Symbol("arAnchor"),AM=Symbol("preload"),AR=Symbol("onARButtonContainerClick"),AD=Symbol("onARStatus"),AT=Symbol("onARTracking"),AL=Symbol("onARTap"),AF=Symbol("selectARMode"),Ak=Symbol("triggerLoad"),A_=Symbol("evaluate"),AU=Symbol("lastValue");class AN{constructor(){this[ei]=null}static evaluatableFor(e,t=nm){if(e instanceof AN)return e;if("number"===e.type)return"%"===e.unit?new AO(e,t):e;switch(e.name.value){case"calc":return new AJ(e,t);case"env":return new Aq(e)}return nm}static evaluate(e){return e instanceof AN?e.evaluate():e}static isConstant(e){return!(e instanceof AN)||e.isConstant}static applyIntrinsics(e,t){let{basis:i,keywords:s}=t,{auto:r}=s;return i.map((t,i)=>{let n=null==r[i]?t:r[i],a=e[i]?e[i]:n;if("ident"===a.type){let A=a.value;A in s&&(a=s[A][i])}return((null==a||"ident"===a.type)&&(a=n),"%"===a.unit)?nA(a.number/100*t.number,t.unit):(a=nE(a,t)).unit!==t.unit?t:a})}get isConstant(){return!1}evaluate(){return this.isConstant&&null!=this[AU]||(this[AU]=this[A_]()),this[AU]}}ei=AU;let AG=Symbol("percentage"),AP=Symbol("basis");class AO extends AN{constructor(e,t){super(),this[AG]=e,this[AP]=t}get isConstant(){return!0}[A_](){return nA(this[AG].number/100*this[AP].number,this[AP].unit)}}let AH=Symbol("identNode");class Aq extends AN{constructor(e){super(),this[es]=null;let t=e.arguments.length?e.arguments[0].terms[0]:null;null!=t&&"ident"===t.type&&(this[AH]=t)}get isConstant(){return!1}[(es=AH,A_)](){if(null!=this[AH]&&"window-scroll-y"===this[AH].value){let e=window.pageYOffset,t=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight),i=e/(t-window.innerHeight)||0;return{type:"number",number:i,unit:null}}return nm}}let AK=/[\*\/]/,AV=Symbol("evaluator");class AJ extends AN{constructor(e,t=nm){if(super(),this[er]=null,1!==e.arguments.length)return;let i=e.arguments[0].terms.slice(),s=[];for(;i.length;){let r=i.shift();if(s.length>0){let n=s[s.length-1];if("operator"===n.type&&AK.test(n.value)){let a=s.pop(),A=s.pop();if(null==A)return;s.push(new A$(a,AN.evaluatableFor(A,t),AN.evaluatableFor(r,t)));continue}}s.push("operator"===r.type?r:AN.evaluatableFor(r,t))}for(;s.length>2;){let[o,l,h]=s.splice(0,3);if("operator"!==l.type)return;s.unshift(new A$(l,AN.evaluatableFor(o,t),AN.evaluatableFor(h,t)))}1===s.length&&(this[AV]=s[0])}get isConstant(){return null==this[AV]||AN.isConstant(this[AV])}[(er=AV,A_)](){return null!=this[AV]?AN.evaluate(this[AV]):nm}}let AY=Symbol("operator"),Aj=Symbol("left"),Az=Symbol("right");class A$ extends AN{constructor(e,t,i){super(),this[AY]=e,this[Aj]=t,this[Az]=i}get isConstant(){return AN.isConstant(this[Aj])&&AN.isConstant(this[Az])}[A_](){let e;let t=nE(AN.evaluate(this[Aj])),i=nE(AN.evaluate(this[Az])),{number:s,unit:r}=t,{number:n,unit:a}=i;if(null!=a&&null!=r&&a!=r)return nm;switch(this[AY].value){case"+":e=s+n;break;case"-":e=s-n;break;case"/":e=s/n;break;case"*":e=s*n;break;default:return nm}return{type:"number",number:e,unit:r||a}}}let AW=Symbol("evaluatables"),AX=Symbol("intrinsics");class AZ extends AN{constructor(e,t){super(),this[AX]=t;let i=e[0],s=null!=i?i.terms:[];this[AW]=t.basis.map((e,t)=>{let i=s[t];return null==i?{type:"ident",value:"auto"}:"ident"===i.type?i:AN.evaluatableFor(i,e)})}get isConstant(){for(let e of this[AW])if(!AN.isConstant(e))return!1;return!0}[A_](){let e=this[AW].map(e=>AN.evaluate(e));return AN.applyIntrinsics(e,this[AX]).map(e=>e.number)}}let A0=Symbol("instances"),A1=Symbol("activateListener"),A2=Symbol("deactivateListener"),A3=Symbol("notifyInstances"),A4=Symbol("notify"),A8=Symbol("callback");class A5{constructor(e){this[A8]=e}static[A3](){for(let e of A5[A0])e[A4]()}static[(en=A0,A1)](){window.addEventListener("scroll",this[A3],{passive:!0})}static[A2](){window.removeEventListener("scroll",this[A3])}observe(){0===A5[A0].size&&A5[A1](),A5[A0].add(this)}disconnect(){A5[A0].delete(this),0===A5[A0].size&&A5[A2]()}[A4](){this[A8]()}}A5[en]=new Set;let A6=Symbol("computeStyleCallback"),A9=Symbol("astWalker"),A7=Symbol("dependencies"),oe=Symbol("onScroll");class ot{constructor(e){this[ea]={},this[eA]=new np(["function"]),this[eo]=()=>{this[A6]({relatedState:"window-scroll"})},this[A6]=e}observeEffectsFor(e){let t={},i=this[A7];for(let s in this[A9].walk(e,e=>{let{name:s}=e,r=e.arguments[0],n=r.terms[0];if("env"===s.value&&null!=n&&"ident"===n.type&&"window-scroll-y"===n.value&&null==t["window-scroll"]){let a="window-scroll"in i?i["window-scroll"]:new A5(this[oe]);a.observe(),delete i["window-scroll"],t["window-scroll"]=a}}),i){let r=i[s];r.disconnect()}this[A7]=t}dispose(){for(let e in this[A7]){let t=this[A7][e];t.disconnect()}}}ea=A7,eA=A9,eo=oe;/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ let oi=e=>{let t=e.observeEffects||!1,i=e.intrinsics instanceof Function?e.intrinsics:()=>e.intrinsics;return(s,r)=>{let n=s.updated,a=s.connectedCallback,A=s.disconnectedCallback,o=Symbol(`${r}StyleEffector`),l=Symbol(`${r}StyleEvaluator`),h=Symbol(`${r}UpdateEvaluator`),c=Symbol(`${r}EvaluateAndSync`);Object.defineProperties(s,{[o]:{value:null,writable:!0},[l]:{value:null,writable:!0},[h]:{value:function(){let e=no(this[r]);this[l]=new AZ(e,i(this)),null==this[o]&&t&&(this[o]=new ot(()=>this[c]())),null!=this[o]&&this[o].observeEffectsFor(e)}},[c]:{value:function(){if(null==this[l])return;let t=this[l].evaluate();this[e.updateHandler](t)}},updated:{value:function(e){e.has(r)&&(this[h](),this[c]()),n.call(this,e)}},connectedCallback:{value:function(){a.call(this),this.requestUpdate(r,this[r])}},disconnectedCallback:{value:function(){A.call(this),null!=this[o]&&(this[o].dispose(),this[o]=null)}}})}},os=new el.FM8,or=new el.Pa4,on=Object.freeze({minimumRadius:0,maximumRadius:1/0,minimumPolarAngle:Math.PI/8,maximumPolarAngle:Math.PI-Math.PI/8,minimumAzimuthalAngle:-1/0,maximumAzimuthalAngle:1/0,minimumFieldOfView:10,maximumFieldOfView:45,touchAction:"none"}),oa=Math.PI/8,oA={USER_INTERACTION:"user-interaction",NONE:"none",AUTOMATIC:"automatic"};class oo extends el.pBf{constructor(e,t,i){super(),this.camera=e,this.element=t,this.scene=i,this.orbitSensitivity=1,this.inputSensitivity=1,this.changeSource=oA.NONE,this._interactionEnabled=!1,this._disableZoom=!1,this.isUserPointing=!1,this.enablePan=!0,this.enableTap=!0,this.panProjection=new el.Vkp,this.panPerPixel=0,this.spherical=new el.$V,this.goalSpherical=new el.$V,this.thetaDamper=new sf,this.phiDamper=new sf,this.radiusDamper=new sf,this.logFov=Math.log(on.maximumFieldOfView),this.goalLogFov=this.logFov,this.fovDamper=new sf,this.touchMode=null,this.pointers=[],this.startTime=0,this.startPointerPosition={clientX:0,clientY:0},this.lastSeparation=0,this.touchDecided=!1,this.onContext=e=>{if(this.enablePan)e.preventDefault();else for(let t of this.pointers)this.onPointerUp(new PointerEvent("pointercancel",Object.assign(Object.assign({},this.startPointerPosition),{pointerId:t.id})))},this.touchModeZoom=(e,t)=>{if(!this._disableZoom){let i=this.twoTouchDistance(this.pointers[0],this.pointers[1]),s=.04*(this.lastSeparation-i)*50/this.scene.height;this.lastSeparation=i,this.userAdjustOrbit(0,0,s)}this.panPerPixel>0&&this.movePan(e,t)},this.disableScroll=e=>{e.preventDefault()},this.touchModeRotate=(e,t)=>{let{touchAction:i}=this._options;if(!this.touchDecided&&"none"!==i){this.touchDecided=!0;let s=Math.abs(e),r=Math.abs(t);if(this.changeSource===oA.USER_INTERACTION&&("pan-y"===i&&r>s||"pan-x"===i&&s>r)){this.touchMode=null;return}this.element.addEventListener("touchmove",this.disableScroll,{passive:!1})}this.handleSinglePointerMove(e,t)},this.onPointerDown=e=>{if(this.pointers.length>2)return;let{element:t}=this;0===this.pointers.length&&(t.addEventListener("pointermove",this.onPointerMove),t.addEventListener("pointerup",this.onPointerUp),this.touchMode=null,this.touchDecided=!1,this.startPointerPosition.clientX=e.clientX,this.startPointerPosition.clientY=e.clientY,this.startTime=performance.now());try{t.setPointerCapture(e.pointerId)}catch(i){}this.pointers.push({clientX:e.clientX,clientY:e.clientY,id:e.pointerId}),this.isUserPointing=!1,"touch"===e.pointerType?(this.changeSource=e.altKey?oA.AUTOMATIC:oA.USER_INTERACTION,this.onTouchChange(e)):(this.changeSource=oA.USER_INTERACTION,this.onMouseDown(e))},this.onPointerMove=e=>{let t=this.pointers.find(t=>t.id===e.pointerId);if(null==t)return;let i=this.pointers.length,s=(e.clientX-t.clientX)/i,r=(e.clientY-t.clientY)/i;(0!==s||0!==r)&&(t.clientX=e.clientX,t.clientY=e.clientY,"touch"===e.pointerType?(this.changeSource=e.altKey?oA.AUTOMATIC:oA.USER_INTERACTION,null!==this.touchMode&&this.touchMode(s,r)):(this.changeSource=oA.USER_INTERACTION,this.panPerPixel>0?this.movePan(s,r):this.handleSinglePointerMove(s,r)))},this.onPointerUp=e=>{let{element:t}=this,i=this.pointers.findIndex(t=>t.id===e.pointerId);-1!==i&&this.pointers.splice(i,1),this.panPerPixel>0&&!e.altKey&&this.resetRadius(),0===this.pointers.length?(t.removeEventListener("pointermove",this.onPointerMove),t.removeEventListener("pointerup",this.onPointerUp),t.removeEventListener("touchmove",this.disableScroll),this.enablePan&&this.enableTap&&this.recenter(e)):null!==this.touchMode&&this.onTouchChange(e),this.scene.element[oL].style.opacity=0,t.style.cursor="grab",this.panPerPixel=0,this.isUserPointing&&this.dispatchEvent({type:"pointer-change-end"})},this.onWheel=e=>{this.changeSource=oA.USER_INTERACTION;let t=e.deltaY*(1==e.deltaMode?18:1)*.04/30;this.userAdjustOrbit(0,0,t),e.preventDefault()},this.onKeyDown=e=>{let{changeSource:t}=this;this.changeSource=oA.USER_INTERACTION;let i=e.shiftKey&&this.enablePan?this.panKeyCodeHandler(e):this.orbitZoomKeyCodeHandler(e);i?e.preventDefault():this.changeSource=t},this._options=Object.assign({},on),this.setOrbit(0,Math.PI/2,1),this.setFieldOfView(100),this.jumpToGoal()}get interactionEnabled(){return this._interactionEnabled}enableInteraction(){if(!1===this._interactionEnabled){let{element:e}=this;e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointercancel",this.onPointerUp),this._disableZoom||e.addEventListener("wheel",this.onWheel),e.addEventListener("keydown",this.onKeyDown),e.addEventListener("touchmove",()=>{},{passive:!1}),e.addEventListener("contextmenu",this.onContext),this.element.style.cursor="grab",this._interactionEnabled=!0,this.updateTouchActionStyle()}}disableInteraction(){if(!0===this._interactionEnabled){let{element:e}=this;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),e.removeEventListener("pointercancel",this.onPointerUp),e.removeEventListener("wheel",this.onWheel),e.removeEventListener("keydown",this.onKeyDown),e.removeEventListener("contextmenu",this.onContext),e.style.cursor="",this.touchMode=null,this._interactionEnabled=!1,this.updateTouchActionStyle()}}get options(){return this._options}set disableZoom(e){this._disableZoom!=e&&(this._disableZoom=e,!0===e?this.element.removeEventListener("wheel",this.onWheel):this.element.addEventListener("wheel",this.onWheel),this.updateTouchActionStyle())}getCameraSpherical(e=new el.$V){return e.copy(this.spherical)}getFieldOfView(){return this.camera.fov}applyOptions(e){Object.assign(this._options,e),this.setOrbit(),this.setFieldOfView(Math.exp(this.goalLogFov))}updateNearFar(e,t){this.camera.near=Math.max(e,t/1e3),this.camera.far=t,this.camera.updateProjectionMatrix()}updateAspect(e){this.camera.aspect=e,this.camera.updateProjectionMatrix()}setOrbit(e=this.goalSpherical.theta,t=this.goalSpherical.phi,i=this.goalSpherical.radius){let{minimumAzimuthalAngle:s,maximumAzimuthalAngle:r,minimumPolarAngle:n,maximumPolarAngle:a,minimumRadius:A,maximumRadius:o}=this._options,{theta:l,phi:h,radius:c}=this.goalSpherical,u=tI(e,s,r);isFinite(s)||isFinite(r)||(this.spherical.theta=this.wrapAngle(this.spherical.theta-u)+u);let g=tI(t,n,a),d=tI(i,A,o);return(u!==l||g!==h||d!==c)&&(this.goalSpherical.theta=u,this.goalSpherical.phi=g,this.goalSpherical.radius=d,this.goalSpherical.makeSafe(),!0)}setRadius(e){this.goalSpherical.radius=e,this.setOrbit()}setFieldOfView(e){let{minimumFieldOfView:t,maximumFieldOfView:i}=this._options;e=tI(e,t,i),this.goalLogFov=Math.log(e)}setDamperDecayTime(e){this.thetaDamper.setDecayTime(e),this.phiDamper.setDecayTime(e),this.radiusDamper.setDecayTime(e),this.fovDamper.setDecayTime(e)}adjustOrbit(e,t,i){let{theta:s,phi:r,radius:n}=this.goalSpherical,{minimumRadius:a,maximumRadius:A,minimumFieldOfView:o,maximumFieldOfView:l}=this._options,h=this.spherical.theta-s,c=Math.PI-.001,u=s-tI(e,-c-h,c-h),g=0===i?0:((i>0?A:a)-n)/(Math.log(i>0?l:o)-this.goalLogFov),d=n+i*(isFinite(g)?g:(A-a)*2);if(this.setOrbit(u,r-t,d),0!==i){let p=this.goalLogFov+i;this.setFieldOfView(Math.exp(p))}}jumpToGoal(){this.update(0,1e4)}update(e,t){if(this.isStationary())return;let{maximumPolarAngle:i,maximumRadius:s}=this._options,r=this.spherical.theta-this.goalSpherical.theta;!(Math.abs(r)>Math.PI)||isFinite(this._options.minimumAzimuthalAngle)||isFinite(this._options.maximumAzimuthalAngle)||(this.spherical.theta-=2*Math.sign(r)*Math.PI),this.spherical.theta=this.thetaDamper.update(this.spherical.theta,this.goalSpherical.theta,t,Math.PI),this.spherical.phi=this.phiDamper.update(this.spherical.phi,this.goalSpherical.phi,t,i),this.spherical.radius=this.radiusDamper.update(this.spherical.radius,this.goalSpherical.radius,t,s),this.logFov=this.fovDamper.update(this.logFov,this.goalLogFov,t,1),this.moveCamera()}updateTouchActionStyle(){let{style:e}=this.element;if(this._interactionEnabled){let{touchAction:t}=this._options;this._disableZoom&&"none"!==t?e.touchAction="manipulation":e.touchAction=t}else e.touchAction=""}isStationary(){return this.goalSpherical.theta===this.spherical.theta&&this.goalSpherical.phi===this.spherical.phi&&this.goalSpherical.radius===this.spherical.radius&&this.goalLogFov===this.logFov}dispatchChange(){this.dispatchEvent({type:"change",source:this.changeSource})}moveCamera(){this.spherical.makeSafe(),this.camera.position.setFromSpherical(this.spherical),this.camera.setRotationFromEuler(new el.USm(this.spherical.phi-Math.PI/2,this.spherical.theta,0,"YXZ")),this.camera.fov!==Math.exp(this.logFov)&&(this.camera.fov=Math.exp(this.logFov),this.camera.updateProjectionMatrix()),this.dispatchChange()}userAdjustOrbit(e,t,i){this.adjustOrbit(e*this.orbitSensitivity*this.inputSensitivity,t*this.orbitSensitivity*this.inputSensitivity,i*this.inputSensitivity),this.dispatchChange()}wrapAngle(e){let t=(e+Math.PI)/(2*Math.PI);return 2*(t-Math.floor(t))*Math.PI-Math.PI}pixelLengthToSphericalAngle(e){return 2*Math.PI*e/this.element.clientHeight}twoTouchDistance(e,t){let{clientX:i,clientY:s}=e,{clientX:r,clientY:n}=t,a=r-i,A=n-s;return Math.sqrt(a*a+A*A)}handleSinglePointerMove(e,t){let i=this.pixelLengthToSphericalAngle(e),s=this.pixelLengthToSphericalAngle(t);!1===this.isUserPointing&&(this.isUserPointing=!0,this.dispatchEvent({type:"pointer-change-start"})),this.userAdjustOrbit(i,s,0)}initializePan(){let{theta:e,phi:t}=this.spherical,i=e-this.scene.yaw;this.panPerPixel=.018/this.scene.height,this.panProjection.set(-Math.cos(i),-Math.cos(t)*Math.sin(i),0,0,Math.sin(t),0,Math.sin(i),-Math.cos(t)*Math.cos(i),0)}movePan(e,t){let{scene:i}=this,s=or.set(e,t,0).multiplyScalar(this.inputSensitivity),r=this.spherical.radius*Math.exp(this.logFov)*this.panPerPixel;s.multiplyScalar(r);let n=i.getTarget();n.add(s.applyMatrix3(this.panProjection)),i.boundingSphere.clampPoint(n,n),i.setTarget(n.x,n.y,n.z),this.dispatchChange()}recenter(e){if(performance.now()>this.startTime+300||Math.abs(e.clientX-this.startPointerPosition.clientX)>2||Math.abs(e.clientY-this.startPointerPosition.clientY)>2)return;let{scene:t}=this,i=t.positionAndNormalFromPoint(t.getNDC(e.clientX,e.clientY));if(null==i){let{cameraTarget:s}=t.element;t.element.cameraTarget="",t.element.cameraTarget=s,this.userAdjustOrbit(0,0,1)}else t.target.worldToLocal(i.position),t.setTarget(i.position.x,i.position.y,i.position.z)}resetRadius(){let{scene:e}=this,t=e.positionAndNormalFromPoint(os.set(0,0));if(null==t)return;e.target.worldToLocal(t.position);let i=e.getTarget(),{theta:s,phi:r}=this.spherical,n=s-e.yaw,a=or.set(Math.sin(r)*Math.sin(n),Math.cos(r),Math.sin(r)*Math.cos(n)),A=a.dot(t.position.sub(i));i.add(a.multiplyScalar(A)),e.setTarget(i.x,i.y,i.z),this.setOrbit(void 0,void 0,this.goalSpherical.radius-A)}onTouchChange(e){if(1===this.pointers.length)this.touchMode=this.touchModeRotate;else{if(this._disableZoom){this.touchMode=null,this.element.removeEventListener("touchmove",this.disableScroll);return}this.touchMode=this.touchDecided&&null===this.touchMode?null:this.touchModeZoom,this.touchDecided=!0,this.element.addEventListener("touchmove",this.disableScroll,{passive:!1}),this.lastSeparation=this.twoTouchDistance(this.pointers[0],this.pointers[1]),this.enablePan&&null!=this.touchMode&&(this.initializePan(),e.altKey||(this.scene.element[oL].style.opacity=1))}}onMouseDown(e){this.panPerPixel=0,this.enablePan&&(2===e.button||e.ctrlKey||e.metaKey||e.shiftKey)&&(this.initializePan(),this.scene.element[oL].style.opacity=1),this.element.style.cursor="grabbing"}orbitZoomKeyCodeHandler(e){let t=!0;switch(e.key){case"PageUp":this.userAdjustOrbit(0,0,.04);break;case"PageDown":this.userAdjustOrbit(0,0,-.04);break;case"ArrowUp":this.userAdjustOrbit(0,-oa,0);break;case"ArrowDown":this.userAdjustOrbit(0,oa,0);break;case"ArrowLeft":this.userAdjustOrbit(-oa,0,0);break;case"ArrowRight":this.userAdjustOrbit(oa,0,0);break;default:t=!1}return t}panKeyCodeHandler(e){this.initializePan();let t=!0;switch(e.key){case"ArrowUp":this.movePan(0,-10);break;case"ArrowDown":this.movePan(0,10);break;case"ArrowLeft":this.movePan(-10,0);break;case"ArrowRight":this.movePan(10,0);break;default:t=!1}return t}}/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ let ol=e=>e<.5?2*e*e:-1+(4-2*e)*e,oh=(e,t,i=ol)=>s=>e+(t-e)*i(s),oc=(e,t)=>{var i;let s=t.map((i=0,e=>i+=e));return t=>{t=tI(t,0,1)*s[s.length-1];let i=s.findIndex(e=>e>=t),r=i<1?0:s[i-1],n=s[i];return e[i]((t-r)/(n-r))}},ou=e=>{let t=[],i=[],s=e.initialValue;for(let r=0;r=0;A--)(r=e[A])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let od=ou({initialValue:0,keyframes:[{frames:5,value:-1},{frames:1,value:-1},{frames:8,value:1},{frames:1,value:1},{frames:5,value:0},{frames:18,value:0}]}),op=ou({initialValue:0,keyframes:[{frames:1,value:1},{frames:5,value:1},{frames:1,value:0},{frames:6,value:0}]}),om="0deg 75deg 105%",oI=["front","right","back","left"],of=["upper-","","lower-"],oE={AUTO:"auto",NONE:"none"},oC={BASIC:"basic",WIGGLE:"wiggle"},oB={PAN_Y:"pan-y",PAN_X:"pan-x",NONE:"none"},oy=()=>({basis:[nI(nA(30,"deg"))],keywords:{auto:[null]}}),oQ=()=>({basis:[nI(nA(12,"deg"))],keywords:{auto:[null]}}),ow=(()=>{let e=no(om)[0].terms,t=nE(e[0]),i=nE(e[1]);return e=>{let s=e[n8].idealCameraDistance();return{basis:[t,i,nA(s,"m")],keywords:{auto:[null,null,nA(105,"%")]}}}})(),ov=e=>{let t=2.2*e[n8].boundingSphere.radius;return{basis:[nA(-1/0,"rad"),nA(Math.PI/8,"rad"),nA(t,"m")],keywords:{auto:[null,null,null]}}},oS=e=>{let t=ow(e),i=new AZ([],t),s=i.evaluate()[2];return{basis:[nA(1/0,"rad"),nA(Math.PI-Math.PI/8,"rad"),nA(s,"m")],keywords:{auto:[null,null,null]}}},ob=e=>{let t=e[n8].boundingBox.getCenter(new el.Pa4);return{basis:[nA(t.x,"m"),nA(t.y,"m"),nA(t.z,"m")],keywords:{auto:[null,null,null]}}},ox=Math.PI/2,oM=Math.PI/3,oR=ox/2,oD=2*Math.PI,oT=Symbol("controls"),oL=Symbol("panElement"),oF=Symbol("promptElement"),ok=Symbol("promptAnimatedContainer"),o_=Symbol("fingerAnimatedContainers"),oU=Symbol("deferInteractionPrompt"),oN=Symbol("updateAria"),oG=Symbol("updateCameraForRadius"),oP=Symbol("onChange"),oO=Symbol("onPointerChange"),oH=Symbol("waitingToPromptUser"),oq=Symbol("userHasInteracted"),oK=Symbol("promptElementVisibleTime"),oV=Symbol("lastPromptOffset"),oJ=Symbol("lastSpherical"),oY=Symbol("jumpCamera"),oj=Symbol("initialized"),oz=Symbol("maintainThetaPhi"),o$=Symbol("syncCameraOrbit"),oW=Symbol("syncFieldOfView"),oX=Symbol("syncCameraTarget"),oZ=Symbol("syncMinCameraOrbit"),o0=Symbol("syncMaxCameraOrbit"),o1=Symbol("syncMinFieldOfView"),o2=Symbol("syncMaxFieldOfView");/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ var o3=function(e,t,i,s){var r,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let o4={AUTO:"auto",MANUAL:"manual"},o8={AUTO:"auto",LAZY:"lazy",EAGER:"eager"},o5=Symbol("defaultProgressBarElement"),o6=Symbol("posterContainerElement"),o9=Symbol("defaultPosterElement"),o7=Symbol("shouldDismissPoster"),le=Symbol("hidePoster"),lt=Symbol("modelIsRevealed"),li=Symbol("updateProgressBar"),ls=Symbol("ariaLabelCallToAction"),lr=Symbol("onProgress");/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ var ln=function(e,t,i,s){var r,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var A=e.length-1;A>=0;A--)(r=e[A])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let la={basis:[nI(nA(Math.PI/32,"rad"))],keywords:{auto:[null]}},lA=Symbol("autoRotateStartTime"),lo=Symbol("radiansPerSecond"),ll=Symbol("syncRotationRate"),lh=Symbol("onCameraChange"),lc=(e=>{var t,i,s;class r extends e{constructor(){super(...arguments),this[t]=new Map,this[i]=e=>{e.forEach(e=>{e instanceof MutationRecord&&"childList"!==e.type||(e.addedNodes.forEach(e=>{this[ap](e)}),e.removedNodes.forEach(e=>{this[am](e)}),this[n5]())})},this[s]=new MutationObserver(this[ag])}connectedCallback(){super.connectedCallback();for(let e=0;e{var t,i,s,r;class n extends e{constructor(){super(...arguments),this[t]=void 0,this[i]=null,this[s]=new el.dpR,this[r]=null,this.variantName=null,this.orientation="0 0 0",this.scale="1 1 1"}get model(){return this[nr]}get availableVariants(){return this.model?this.model[r5]():[]}get originalGltfJson(){return this[ns]}[(t=nr,i=ni,s=na,r=ns,nn)](){return()=>{this[n5]()}}async createTexture(e,t="image/png"){let i=this[ni],s=await new Promise(t=>this[na].load(e,t));return i&&s?(s.encoding=el.knz,s.wrapS=el.rpg,s.wrapT=el.rpg,s.flipY=!1,s.userData.mimeType=t,new rg(this[nn](),s)):null}async updated(e){if(super.updated(e),e.has("variantName")){let t=this[at].beginActivity();t(.1);let i=this[nr],{variantName:s}=this;null!=i&&(await i[r1](s),this[n5](),this.dispatchEvent(new CustomEvent("variant-applied"))),t(1)}if(e.has("orientation")||e.has("scale")){if(!this.loaded)return;let r=this[n8];r.applyTransform(),r.updateBoundingBox(),r.updateShadow(),this[ae].arRenderer.onUpdateScene(),this[n5]()}}[n9](){super[n9]();let{currentGLTF:e}=this[n8];if(null!=e){let{correlatedSceneGraph:t}=e;null!=t&&e!==this[ni]&&(this[nr]=new ne(t,this[nn]()),this[ns]=JSON.parse(JSON.stringify(t.gltf))),"variants"in e.userData&&this.requestUpdate("variantName")}this[ni]=e}async exportScene(e){let t=this[n8];return new Promise(async(i,s)=>{let r={binary:!0,onlyVisible:!0,maxTextureSize:1/0,includeCustomExtensions:!1,forceIndices:!1};Object.assign(r,e),r.animations=t.animations,r.truncateDrawRange=!0;let n=t.shadow,a=!1;null!=n&&(a=n.visible,n.visible=!1),await this[nr][r0]();let A=new i5().register(e=>new sp(e));A.parse(t.model,e=>i(new Blob([r.binary?e:JSON.stringify(e)],{type:r.binary?"application/octet-stream":"application/json"})),()=>s("glTF export failed"),r),null!=n&&(n.visible=a)})}materialFromPoint(e,t){let i=this[n8],s=i.getNDC(e,t);return i.raycaster.setFromCamera(s,i.getCamera()),this[nr][r4](i.raycaster)}}return nt([u({type:String,attribute:"variant-name"})],n.prototype,"variantName",void 0),nt([u({type:String,attribute:"orientation"})],n.prototype,"orientation",void 0),nt([u({type:String,attribute:"scale"})],n.prototype,"scale",void 0),n})((e=>{var t,i,s;class r extends e{constructor(){super(...arguments),this.autoRotate=!1,this.autoRotateDelay=3e3,this.rotationPerSecond="auto",this[t]=performance.now(),this[i]=0,this[s]=e=>{this.autoRotate&&"user-interaction"===e.detail.source&&(this[lA]=performance.now())}}connectedCallback(){super.connectedCallback(),this.addEventListener("camera-change",this[lh]),this[lA]=performance.now()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("camera-change",this[lh]),this[lA]=performance.now()}updated(e){super.updated(e),e.has("autoRotate")&&(this[lA]=performance.now())}[(t=lA,i=lo,ll)](e){this[lo]=e[0]}[n6](e,t){if(super[n6](e,t),!this.autoRotate||!this[as]()||this[ae].isPresenting)return;let i=Math.min(t,e-this[lA]-this.autoRotateDelay);i>0&&(this[n8].yaw=this.turntableRotation+this[lo]*i*.001)}get turntableRotation(){return this[n8].yaw}resetTurntableRotation(e=0){this[n8].yaw=e}}return s=lh,ln([u({type:Boolean,attribute:"auto-rotate"})],r.prototype,"autoRotate",void 0),ln([u({type:Number,attribute:"auto-rotate-delay"})],r.prototype,"autoRotateDelay",void 0),ln([oi({intrinsics:la,updateHandler:ll}),u({type:String,attribute:"rotation-per-second"})],r.prototype,"rotationPerSecond",void 0),r})((e=>{var t,i,s;class r extends e{constructor(){super(...arguments),this.environmentImage=null,this.skyboxImage=null,this.shadowIntensity=0,this.shadowSoftness=1,this.exposure=1,this[t]=null,this[i]=null,this[s]=null}updated(e){super.updated(e),e.has("shadowIntensity")&&(this[n8].setShadowIntensity(.5*this.shadowIntensity),this[n5]()),e.has("shadowSoftness")&&(this[n8].setShadowSoftness(this.shadowSoftness),this[n5]()),e.has("exposure")&&(this[n8].exposure=this.exposure,this[n5]()),(e.has("environmentImage")||e.has("skyboxImage"))&&this[ar]()&&this[tv]()}hasBakedShadow(){return this[n8].bakedShadows.size>0}async [(t=tQ,i=tw,s=tS,tv)](){let{skyboxImage:e,environmentImage:t}=this;null!=this[tS]&&(this[tS](),this[tS]=null);let{textureUtils:i}=this[ae];if(null==i)return;let s=this[at].beginActivity();try{let{environmentMap:r,skybox:n}=await i.generateEnvironmentMapAndSkybox(tu(e),t,e=>s(tI(e,0,1)));this[tQ]!==r&&(this[tQ]=r,this.dispatchEvent(new CustomEvent("environment-change"))),null!=n?this[tw]=n.name===r.name?r:n:this[tw]=null,this[n8].setEnvironmentAndSkybox(this[tQ],this[tw]),this[n8].dispatchEvent({type:"envmap-update"})}catch(a){if(a instanceof Error)throw this[n8].setEnvironmentAndSkybox(null,null),a}finally{s(1)}}}return ty([u({type:String,attribute:"environment-image"})],r.prototype,"environmentImage",void 0),ty([u({type:String,attribute:"skybox-image"})],r.prototype,"skyboxImage",void 0),ty([u({type:Number,attribute:"shadow-intensity"})],r.prototype,"shadowIntensity",void 0),ty([u({type:Number,attribute:"shadow-softness"})],r.prototype,"shadowSoftness",void 0),ty([u({type:Number})],r.prototype,"exposure",void 0),r})((e=>{var t,i,s,r,n,a,A,o,l,h,c,g,d,p,m;class I extends e{constructor(){super(...arguments),this.cameraControls=!1,this.cameraOrbit=om,this.cameraTarget="auto auto auto",this.fieldOfView="auto",this.minCameraOrbit="auto",this.maxCameraOrbit="auto",this.minFieldOfView="auto",this.maxFieldOfView="auto",this.interactionPromptThreshold=3e3,this.interactionPrompt=oE.AUTO,this.interactionPromptStyle=oC.WIGGLE,this.orbitSensitivity=1,this.touchAction=oB.NONE,this.disableZoom=!1,this.disablePan=!1,this.disableTap=!1,this.interpolationDecay=50,this[t]=this.shadowRoot.querySelector(".interaction-prompt"),this[i]=this.shadowRoot.querySelector("#prompt"),this[s]=[this.shadowRoot.querySelector("#finger0"),this.shadowRoot.querySelector("#finger1")],this[r]=this.shadowRoot.querySelector(".pan-target"),this[n]=0,this[a]=1/0,this[A]=!1,this[o]=!1,this[l]=new oo(this[n8].camera,this[n3],this[n8]),this[h]=new el.$V,this[c]=!1,this[g]=!1,this[d]=!1,this[p]=({source:e})=>{this[oN](),this[n5](),e===oA.USER_INTERACTION&&(this[oq]=!0,this[oU]()),this.dispatchEvent(new CustomEvent("camera-change",{detail:{source:e}}))},this[m]=e=>{"pointer-change-start"===e.type?this[n2].classList.add("pointer-tumbling"):this[n2].classList.remove("pointer-tumbling")}}get inputSensitivity(){return this[oT].inputSensitivity}set inputSensitivity(e){this[oT].inputSensitivity=e}getCameraOrbit(){let{theta:e,phi:t,radius:i}=this[oJ];return{theta:e,phi:t,radius:i,toString(){return`${this.theta}rad ${this.phi}rad ${this.radius}m`}}}getCameraTarget(){return an(this[ae].isPresenting?this[ae].arRenderer.target:this[n8].getTarget())}getFieldOfView(){return this[oT].getFieldOfView()}getMinimumFieldOfView(){return this[oT].options.minimumFieldOfView}getMaximumFieldOfView(){return this[oT].options.maximumFieldOfView}getIdealAspect(){return this[n8].idealAspect}jumpCameraToGoal(){this[oY]=!0,this.requestUpdate(oY,!1)}resetInteractionPrompt(){this[oV]=0,this[oK]=1/0,this[oq]=!1,this[oH]=this.interactionPrompt===oE.AUTO&&this.cameraControls}zoom(e){let t=new WheelEvent("wheel",{deltaY:-30*e});this[n3].dispatchEvent(t)}connectedCallback(){super.connectedCallback(),this[oT].addEventListener("change",this[oP]),this[oT].addEventListener("pointer-change-start",this[oO]),this[oT].addEventListener("pointer-change-end",this[oO])}disconnectedCallback(){super.disconnectedCallback(),this[oT].removeEventListener("change",this[oP]),this[oT].removeEventListener("pointer-change-start",this[oO]),this[oT].removeEventListener("pointer-change-end",this[oO])}updated(e){super.updated(e);let t=this[oT],i=this[n8];if(e.has("cameraControls")&&(this.cameraControls?(t.enableInteraction(),this.interactionPrompt===oE.AUTO&&(this[oH]=!0)):(t.disableInteraction(),this[oU]()),this[n3].setAttribute("aria-label",this[nz])),e.has("disableZoom")&&(t.disableZoom=this.disableZoom),e.has("disablePan")&&(t.enablePan=!this.disablePan),e.has("disableTap")&&(t.enableTap=!this.disableTap),(e.has("interactionPrompt")||e.has("cameraControls")||e.has("src"))&&(this.interactionPrompt===oE.AUTO&&this.cameraControls&&!this[oq]?this[oH]=!0:this[oU]()),e.has("interactionPromptStyle")&&(this[ok].style.opacity=this.interactionPromptStyle==oC.BASIC?"1":"0"),e.has("touchAction")){let s=this.touchAction;t.applyOptions({touchAction:s}),t.updateTouchActionStyle()}e.has("orbitSensitivity")&&(t.orbitSensitivity=this.orbitSensitivity),e.has("interpolationDecay")&&(t.setDamperDecayTime(this.interpolationDecay),i.setTargetDamperDecayTime(this.interpolationDecay)),!0===this[oY]&&Promise.resolve().then(()=>{t.jumpToGoal(),i.jumpToGoal(),this[oY]=!1})}async updateFraming(){let e=this[n8],t=e.adjustedFoV(e.framedFoVDeg);await e.updateFraming();let i=e.adjustedFoV(e.framedFoVDeg),s=this[oT].getFieldOfView()/t;this[oT].setFieldOfView(i*s),this[oz]=!0,this.requestUpdate("maxFieldOfView"),this.requestUpdate("fieldOfView"),this.requestUpdate("minCameraOrbit"),this.requestUpdate("maxCameraOrbit"),this.requestUpdate("cameraOrbit"),await this.updateComplete}interact(e,t,i){let s=this[n3],r=this[o_];if("1"===r[0].style.opacity){console.warn("interact() failed because an existing interaction is running.");return}let n=[];n.push({x:ou(t.x),y:ou(t.y)});let a=[{x:n[0].x(0),y:n[0].y(0)}];null!=i&&(n.push({x:ou(i.x),y:ou(i.y)}),a.push({x:n[1].x(0),y:n[1].y(0)}));let A=performance.now(),{width:o,height:l}=this[n8],h=e=>{for(let[t,i]of a.entries()){let{style:n}=r[t];n.transform=`translateX(${o*i.x}px) translateY(${l*i.y}px)`,"pointerdown"===e?n.opacity="1":"pointerup"===e&&(n.opacity="0");let A={pointerId:t-5678,pointerType:"touch",target:s,clientX:o*i.x,clientY:l*i.y,altKey:!0};s.dispatchEvent(new PointerEvent(e,A))}},c=()=>{let{changeSource:t}=this[oT];if(t!==oA.AUTOMATIC||!s.isConnected){for(let i of this[o_])i.style.opacity="0";h("pointercancel"),this.dispatchEvent(new CustomEvent("interact-stopped",{detail:{source:t}})),document.removeEventListener("visibilitychange",u);return}let r=Math.min(1,(performance.now()-A)/e);for(let[o,l]of a.entries())l.x=n[o].x(r),l.y=n[o].y(r);h("pointermove"),r<1?requestAnimationFrame(c):(h("pointerup"),this.dispatchEvent(new CustomEvent("interact-stopped",{detail:{source:t}})),document.removeEventListener("visibilitychange",u))},u=()=>{let e=0;"hidden"===document.visibilityState?e=performance.now()-A:A=performance.now()-e};document.addEventListener("visibilitychange",u),h("pointerdown"),requestAnimationFrame(c)}[(t=oF,i=ok,s=o_,r=oL,n=oV,a=oK,A=oq,o=oH,l=oT,h=oJ,c=oY,g=oj,d=oz,oW)](e){let t=this[n8];t.framedFoVDeg=180*e[0]/Math.PI,this[oT].setFieldOfView(t.adjustedFoV(t.framedFoVDeg))}[o$](e){let t=this[oT];if(this[oz]){let{theta:i,phi:s}=this.getCameraOrbit();e[0]=i,e[1]=s,this[oz]=!1}t.changeSource=oA.NONE,t.setOrbit(e[0],e[1],e[2])}[oZ](e){this[oT].applyOptions({minimumAzimuthalAngle:e[0],minimumPolarAngle:e[1],minimumRadius:e[2]}),this.jumpCameraToGoal()}[o0](e){this[oT].applyOptions({maximumAzimuthalAngle:e[0],maximumPolarAngle:e[1],maximumRadius:e[2]}),this[oG](e[2]),this.jumpCameraToGoal()}[o1](e){this[oT].applyOptions({minimumFieldOfView:180*e[0]/Math.PI}),this.jumpCameraToGoal()}[o2](e){let t=this[n8].adjustedFoV(180*e[0]/Math.PI);this[oT].applyOptions({maximumFieldOfView:t}),this.jumpCameraToGoal()}[oX](e){let[t,i,s]=e;this[ae].arRenderer.isPresenting||this[n8].setTarget(t,i,s),this[oT].changeSource=oA.NONE,this[ae].arRenderer.updateTarget()}[n6](e,t){if(super[n6](e,t),this[ae].isPresenting||!this[as]())return;let i=this[oT],s=this[n8],r=performance.now();if(this[oH]&&this.loaded&&r>this[nZ]+this.interactionPromptThreshold&&(this[oH]=!1,this[oK]=r,this[oF].classList.add("visible")),isFinite(this[oK])&&this.interactionPromptStyle===oC.WIGGLE){let n=(r-this[oK])/5e3%1,a=od(n),A=op(n);if(this[ok].style.opacity=`${A}`,a!==this[oV]){let o=a*s.width*.05,l=(a-this[oV])*Math.PI/16;this[ok].style.transform=`translateX(${o}px)`,i.changeSource=oA.AUTOMATIC,i.adjustOrbit(l,0,0),this[oV]=a}}i.update(e,t),s.updateTarget(t)&&this[oP]({type:"change",source:i.changeSource})}[oU](){this[oH]=!1,this[oF].classList.remove("visible"),this[oK]=1/0}[oG](e){let t=Math.max(this[n8].boundingSphere.radius,e);this[oT].updateNearFar(0,2*t)}[oN](){let{theta:e,phi:t}=this[oT].getCameraSpherical(this[oJ]),i=oI[(4+Math.floor((e%oD+oR)/ox))%4],s=of[Math.floor(t/oM)];this[nX](`View from stage ${s}${i}`)}get[nz](){return super[nz]+(this.cameraControls?". Use mouse, touch or arrow keys to move.":"")}async [n7](e){let t=this[oT],i=this[n8],s=i.adjustedFoV(i.framedFoVDeg);super[n7](e);let r=i.adjustedFoV(i.framedFoVDeg)/s,n=t.getFieldOfView()*(isFinite(r)?r:1);t.updateAspect(this[n8].aspect),this.requestUpdate("maxFieldOfView",this.maxFieldOfView),await this.updateComplete,this[oT].setFieldOfView(n),this.jumpCameraToGoal()}[n9](){super[n9](),this[oj]?this[oz]=!0:this[oj]=!0,this.requestUpdate("maxFieldOfView",this.maxFieldOfView),this.requestUpdate("fieldOfView",this.fieldOfView),this.requestUpdate("minCameraOrbit",this.minCameraOrbit),this.requestUpdate("maxCameraOrbit",this.maxCameraOrbit),this.requestUpdate("cameraOrbit",this.cameraOrbit),this.requestUpdate("cameraTarget",this.cameraTarget),this.jumpCameraToGoal()}}return p=oP,m=oO,og([u({type:Boolean,attribute:"camera-controls"})],I.prototype,"cameraControls",void 0),og([oi({intrinsics:ow,observeEffects:!0,updateHandler:o$}),u({type:String,attribute:"camera-orbit",hasChanged:()=>!0})],I.prototype,"cameraOrbit",void 0),og([oi({intrinsics:ob,observeEffects:!0,updateHandler:oX}),u({type:String,attribute:"camera-target",hasChanged:()=>!0})],I.prototype,"cameraTarget",void 0),og([oi({intrinsics:oy,observeEffects:!0,updateHandler:oW}),u({type:String,attribute:"field-of-view",hasChanged:()=>!0})],I.prototype,"fieldOfView",void 0),og([oi({intrinsics:ov,updateHandler:oZ}),u({type:String,attribute:"min-camera-orbit",hasChanged:()=>!0})],I.prototype,"minCameraOrbit",void 0),og([oi({intrinsics:oS,updateHandler:o0}),u({type:String,attribute:"max-camera-orbit",hasChanged:()=>!0})],I.prototype,"maxCameraOrbit",void 0),og([oi({intrinsics:oQ,updateHandler:o1}),u({type:String,attribute:"min-field-of-view",hasChanged:()=>!0})],I.prototype,"minFieldOfView",void 0),og([oi({intrinsics:oy,updateHandler:o2}),u({type:String,attribute:"max-field-of-view",hasChanged:()=>!0})],I.prototype,"maxFieldOfView",void 0),og([u({type:Number,attribute:"interaction-prompt-threshold"})],I.prototype,"interactionPromptThreshold",void 0),og([u({type:String,attribute:"interaction-prompt"})],I.prototype,"interactionPrompt",void 0),og([u({type:String,attribute:"interaction-prompt-style"})],I.prototype,"interactionPromptStyle",void 0),og([u({type:Number,attribute:"orbit-sensitivity"})],I.prototype,"orbitSensitivity",void 0),og([u({type:String,attribute:"touch-action"})],I.prototype,"touchAction",void 0),og([u({type:Boolean,attribute:"disable-zoom"})],I.prototype,"disableZoom",void 0),og([u({type:Boolean,attribute:"disable-pan"})],I.prototype,"disablePan",void 0),og([u({type:Boolean,attribute:"disable-tap"})],I.prototype,"disableTap",void 0),og([u({type:Number,attribute:"interpolation-decay"})],I.prototype,"interpolationDecay",void 0),I})((e=>{var t,i,s,r,n,a,A,o,l,h;class c extends e{constructor(){super(...arguments),this.ar=!1,this.arScale="auto",this.arPlacement="floor",this.arModes="webxr scene-viewer quick-look",this.iosSrc=null,this.xrEnvironment=!1,this[t]=!1,this[i]=this.shadowRoot.querySelector(".ar-button"),this[s]=document.createElement("a"),this[r]=new Set,this[n]=AC.NONE,this[a]=!1,this[A]=e=>{e.preventDefault(),this.activateAR()},this[o]=({status:e})=>{(e===sQ.NOT_PRESENTING||this[ae].arRenderer.presentedScene===this[n8])&&(this.setAttribute("ar-status",e),this.dispatchEvent(new CustomEvent("ar-status",{detail:{status:e}})),e===sQ.NOT_PRESENTING?this.removeAttribute("ar-tracking"):e===sQ.SESSION_STARTED&&this.setAttribute("ar-tracking",sw.TRACKING))},this[l]=({status:e})=>{this.setAttribute("ar-tracking",e),this.dispatchEvent(new CustomEvent("ar-tracking",{detail:{status:e}}))},this[h]=e=>{"_apple_ar_quicklook_button_tapped"==e.data&&this.dispatchEvent(new CustomEvent("quick-look-button-tapped"))}}get canActivateAR(){return this[AS]!==AC.NONE}connectedCallback(){super.connectedCallback(),this[ae].arRenderer.addEventListener("status",this[AD]),this.setAttribute("ar-status",sQ.NOT_PRESENTING),this[ae].arRenderer.addEventListener("tracking",this[AT]),this[Ax].addEventListener("message",this[AL])}disconnectedCallback(){super.disconnectedCallback(),this[ae].arRenderer.removeEventListener("status",this[AD]),this[ae].arRenderer.removeEventListener("tracking",this[AT]),this[Ax].removeEventListener("message",this[AL])}update(e){super.update(e),e.has("arScale")&&(this[n8].canScale="fixed"!==this.arScale),e.has("arPlacement")&&(this[n8].updateShadow(),this[n5]()),e.has("arModes")&&(this[Ab]=AE(this.arModes)),(e.has("ar")||e.has("arModes")||e.has("src")||e.has("iosSrc"))&&this[AF]()}async activateAR(){switch(this[AS]){case AC.QUICK_LOOK:this[Aw]();break;case AC.WEBXR:await this[Ay]();break;case AC.SCENE_VIEWER:this[AQ]();break;default:console.warn("No AR Mode can be activated. This is probably due to missing configuration or device capabilities")}}async [(t=Av,i=AB,s=Ax,r=Ab,n=AS,a=AM,A=AR,o=AD,l=AT,h=AL,AF)](){let e=AC.NONE;if(this.ar){if(null!=this.src)for(let t of this[Ab]){if("webxr"===t&&ti&&!Am&&await this[ae].arRenderer.supportsPresentation()){e=AC.WEBXR;break}if("scene-viewer"===t&&tl&&!AI){e=AC.SCENE_VIEWER;break}if("quick-look"===t&&tc){e=AC.QUICK_LOOK;break}}e===AC.NONE&&null!=this.iosSrc&&tc&&(e=AC.QUICK_LOOK)}if(e!==AC.NONE)this[AB].classList.add("enabled"),this[AB].addEventListener("click",this[AR]);else if(this[AB].classList.contains("enabled")){this[AB].removeEventListener("click",this[AR]),this[AB].classList.remove("enabled");let i=sQ.FAILED;this.setAttribute("ar-status",i),this.dispatchEvent(new CustomEvent("ar-status",{detail:{status:i}}))}this[AS]=e}async [Ay](){console.log("Attempting to present in AR with WebXR..."),await this[Ak]();try{this[AB].removeEventListener("click",this[AR]);let{arRenderer:e}=this[ae];e.placeOnWall="wall"===this.arPlacement,await e.present(this[n8],this.xrEnvironment)}catch(t){console.warn("Error while trying to present in AR with WebXR"),console.error(t),await this[ae].arRenderer.stopPresenting(),Am=!0,console.warn("Falling back to next ar-mode"),await this[AF](),this.activateAR()}finally{this[AF]()}}async [Ak](){this.loaded||(this[AM]=!0,this[n0](),await tB(this,"load"),this[AM]=!1)}[ar](){return super[ar]()||this[AM]}[AQ](){let e=self.location.toString(),t=new URL(e),i=new URL(this.src,e),s=new URLSearchParams(i.search);if(t.hash=Af,s.set("mode","ar_preferred"),s.has("disable_occlusion")||s.set("disable_occlusion","true"),"fixed"===this.arScale&&s.set("resizable","false"),"wall"===this.arPlacement&&s.set("enable_vertical_placement","true"),s.has("sound")){let r=new URL(s.get("sound"),e);s.set("sound",r.toString())}if(s.has("link")){let n=new URL(s.get("link"),e);s.set("link",n.toString())}let a=`intent://arvr.google.com/scene-viewer/1.0?${s.toString()+"&file="+encodeURIComponent(i.toString())}#Intent;scheme=https;package=com.google.ar.core;action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(t.toString())};end;`,A=()=>{self.location.hash===Af&&(AI=!0,self.history.back(),console.warn("Error while trying to present in AR with Scene Viewer"),console.warn("Falling back to next ar-mode"),this[AF]())};self.addEventListener("hashchange",A,{once:!0}),this[Ax].setAttribute("href",a),console.log("Attempting to present in AR with Scene Viewer..."),this[Ax].click()}async [Aw](){let e=!this.iosSrc;this[AB].classList.remove("enabled");let t=e?await this.prepareUSDZ():this.iosSrc,i=new URL(t,self.location.toString());if(e){let s=self.location.toString(),r=new URL(s),n=new URL(this.src,r);n.hash&&(i.hash=n.hash)}"fixed"===this.arScale&&(i.hash&&(i.hash+="&"),i.hash+="allowsContentScaling=0");let a=this[Ax];a.setAttribute("rel","ar");let A=document.createElement("img");a.appendChild(A),a.setAttribute("href",i.toString()),e&&a.setAttribute("download","model.usdz"),a.style.display="none",a.isConnected||this.shadowRoot.appendChild(a),console.log("Attempting to present in AR with Quick Look..."),a.click(),a.removeChild(A),e&&URL.revokeObjectURL(t),this[AB].classList.add("enabled")}async prepareUSDZ(){let e=this[at].beginActivity();await this[Ak]();let{model:t,shadow:i}=this[n8];if(null==t)return"";let s=!1;null!=i&&(s=i.visible,i.visible=!1),e(.2);let r=new Ao,n=await r.parse(t),a=new Blob([n],{type:"model/vnd.usdz+zip"}),A=URL.createObjectURL(a);return e(1),null!=i&&(i.visible=s),A}}return Ap([u({type:Boolean,attribute:"ar"})],c.prototype,"ar",void 0),Ap([u({type:String,attribute:"ar-scale"})],c.prototype,"arScale",void 0),Ap([u({type:String,attribute:"ar-placement"})],c.prototype,"arPlacement",void 0),Ap([u({type:String,attribute:"ar-modes"})],c.prototype,"arModes",void 0),Ap([u({type:String,attribute:"ios-src"})],c.prototype,"iosSrc",void 0),Ap([u({type:Boolean,attribute:"xr-environment"})],c.prototype,"xrEnvironment",void 0),c})((e=>{var t,i,s,r,n,a,A,o;class l extends e{constructor(...e){super(...e),this.poster=null,this.reveal=o4.AUTO,this.loading=o8.AUTO,this[t]=!1,this[i]=!1,this[s]=this.shadowRoot.querySelector(".slot.poster"),this[r]=this.shadowRoot.querySelector("#default-poster"),this[n]=this.shadowRoot.querySelector("#default-progress-bar > .bar"),this[a]=this[o9].getAttribute("aria-label"),this[A]=tp(e=>{let t=this[o5].parentNode;requestAnimationFrame(()=>{this[o5].style.transform=`scaleX(${e})`,0===e&&(t.removeChild(this[o5]),t.appendChild(this[o5])),1===e?this[o5].classList.add("hide"):this[o5].classList.remove("hide")})},100),this[o]=e=>{let t=e.detail.totalProgress;1===t&&(this[li].flush(),this.loaded&&(this[o7]||this.reveal===o4.AUTO)&&this[le]()),this[li](t),this.dispatchEvent(new CustomEvent("progress",{detail:{totalProgress:t}}))};let l=self.ModelViewerElement||{},h=l.dracoDecoderLocation||"https://www.gstatic.com/draco/versioned/decoders/1.4.1/";iX.setDRACODecoderLocation(h);let c=l.ktx2TranscoderLocation||"https://www.gstatic.com/basis-universal/versioned/2021-04-15-ba1c3e4/";iX.setKTX2TranscoderLocation(c),l.meshoptDecoderLocation&&iX.setMeshoptDecoderLocation(l.meshoptDecoderLocation)}static set dracoDecoderLocation(e){iX.setDRACODecoderLocation(e)}static get dracoDecoderLocation(){return iX.getDRACODecoderLocation()}static set ktx2TranscoderLocation(e){iX.setKTX2TranscoderLocation(e)}static get ktx2TranscoderLocation(){return iX.getKTX2TranscoderLocation()}static set meshoptDecoderLocation(e){iX.setMeshoptDecoderLocation(e)}static get meshoptDecoderLocation(){return iX.getMeshoptDecoderLocation()}static mapURLs(e){s3.singleton.loader[iz].manager.setURLModifier(e)}dismissPoster(){this.loaded?this[le]():(this[o7]=!0,this[n0]())}showPoster(){let e=this[o6];if(e.classList.contains("show"))return;e.classList.add("show"),this[n3].classList.remove("show");let t=this[o9];t.removeAttribute("tabindex"),t.removeAttribute("aria-hidden");let i=this.modelIsVisible;this[lt]=!1,this[nj](i)}getDimensions(){return an(this[n8].size)}getBoundingBoxCenter(){return an(this[n8].boundingBox.getCenter(new el.Pa4))}connectedCallback(){super.connectedCallback(),this.showPoster(),this[at].addEventListener("progress",this[lr])}disconnectedCallback(){super.disconnectedCallback(),this[at].removeEventListener("progress",this[lr])}async updated(e){super.updated(e),e.has("poster")&&null!=this.poster&&(this[o9].style.backgroundImage=`url(${this.poster})`),e.has("alt")&&this[o9].setAttribute("aria-label",this[n$]),(e.has("reveal")||e.has("loading"))&&this[n0]()}[(t=lt,i=o7,s=o6,r=o9,n=o5,a=ls,A=li,o=lr,ar)](){return!!this.src&&(this[o7]||this.loading===o8.EAGER||this.reveal===o4.AUTO&&this[nY])}[le](){this[o7]=!1;let e=this[o6];if(!e.classList.contains("show"))return;e.classList.remove("show"),this[n3].classList.add("show");let t=this.modelIsVisible;this[lt]=!0,this[nj](t);let i=this.getRootNode();i&&i.activeElement===this&&this[n3].focus();let s=this[o9];s.setAttribute("aria-hidden","true"),s.tabIndex=-1,this.dispatchEvent(new CustomEvent("poster-dismissed"))}[as](){return super[as]()&&this[lt]}}return o3([u({type:String})],l.prototype,"poster",void 0),o3([u({type:String})],l.prototype,"reveal",void 0),o3([u({type:String})],l.prototype,"loading",void 0),l})((e=>{var t;class i extends e{constructor(...e){super(e),this.autoplay=!1,this.animationName=void 0,this.animationCrossfadeDuration=300,this[t]=!0,this[n8].subscribeMixerEvent("loop",e=>{let t=e.action._loopCount;this.dispatchEvent(new CustomEvent("loop",{detail:{count:t}}))}),this[n8].subscribeMixerEvent("finished",()=>{this[ah]=!0,this.dispatchEvent(new CustomEvent("finished"))})}get availableAnimations(){return this.loaded?this[n8].animationNames:[]}get duration(){return this[n8].duration}get paused(){return this[ah]}get currentTime(){return this[n8].animationTime}set currentTime(e){this[n8].animationTime=e,this[n5]()}get timeScale(){return this[n8].animationTimeScale}set timeScale(e){this[n8].animationTimeScale=e}pause(){this[ah]||(this[ah]=!0,this.dispatchEvent(new CustomEvent("pause")))}play(e){this.availableAnimations.length>0&&(this[ah]=!1,this[al](e),this.dispatchEvent(new CustomEvent("play")))}[(t=ah,n9)](){super[n9](),this[ah]=!0,this.autoplay&&this.play()}[n6](e,t){super[n6](e,t),!this[ah]&&(this[as]()||this[ae].isPresenting)&&(this[n8].updateAnimation(t/1e3),this[n5]())}updated(e){super.updated(e),e.has("autoplay")&&this.autoplay&&this.play(),e.has("animationName")&&this[al]()}[al](e=ac){var t;let i=null!==(t=e.repetitions)&&void 0!==t?t:1/0,s=e.pingpong?el.uEv:1===i?el.jAl:el.YKA;this[n8].playAnimation(this.animationName,this.animationCrossfadeDuration/1e3,s,i),this[ah]&&(this[n8].updateAnimation(0),this[n5]())}}return ao([u({type:Boolean})],i.prototype,"autoplay",void 0),ao([u({type:String,attribute:"animation-name"})],i.prototype,"animationName",void 0),ao([u({type:Number,attribute:"animation-crossfade-duration"})],i.prototype,"animationCrossfadeDuration",void 0),i})((e=>{let t=e=>{if(null==e.shadowRoot||e.hasAttribute("data-js-focus-visible"))return()=>{};if(self.applyFocusVisiblePolyfill)self.applyFocusVisiblePolyfill(e.shadowRoot);else{let t=()=>{self.applyFocusVisiblePolyfill(e.shadowRoot)};return self.addEventListener("focus-visible-polyfill-ready",t,{once:!0}),()=>{self.removeEventListener("focus-visible-polyfill-ready",t)}}return()=>{}},i=Symbol("endPolyfillCoordination");return class extends e{constructor(){super(...arguments),this[i]=null}connectedCallback(){super.connectedCallback&&super.connectedCallback(),null==this[i]&&(this[i]=t(this))}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),null!=this[i]&&(this[i](),this[i]=null)}}})(aA)))))))));customElements.define("model-viewer",lc)}}]);
//# sourceMappingURL=258.53d25aa602c4d686.js.map