PageSourceSearch

https://www.audemarspiguet.com/etc.clientlibs/ap-com/ui/clientlibs…2_dist_asset-1fdb82.13336b3241bd0cf4bc74.js

js audemarspiguet.com collected 2026-10-02 03:05:57 UTC 117,200 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkap_com=self.webpackChunkap_com||[]).push([["vendors-node_modules_audemarspiguet_needle-3d-players_players_26450CB_OO_1356CB_02_dist_asset-1fdb82"],{52892:function(e,t,n){n.d(t,{n:function(){return _e},r:function(){return se},t:function(){return Pe}});var i=n(91441),o=n(26993),r=n(28329),s=n(65045),a=n(19643),l=n(44779),c=n(54386),d=n(62806),u=n(91332);function p(){r.Mr.registerWaitForInteraction(()=>{let e=o.c.getContext();e.addEventListener("statechange",()=>{setTimeout(()=>{let t=e.state;("suspended"===t||"interrupted"===t)&&e.resume().then(()=>{console.log("AudioContext resumed successfully")}).catch(e=>{console.log("Failed to resume AudioContext: "+e)})},500)})})}var h,f,m,g,v=class{url;constructor(e){this.url=e}get isPlaying(){return void 0!==this._audioElement&&!this._audioElement.paused&&!this._audioElement.ended}getDuration(){return void 0===this._duration?this.ensureAudioElement().then(e=>(this._duration=e.duration,e.duration)):Promise.resolve(this._duration)}play(){return this.ensureAudioElement().then(e=>new Promise((t,n)=>{let i=()=>{s(),t()},o=()=>{s(),n(Error(`Playback error for ${this.url}`))},r=()=>{s(),t()},s=()=>{e.removeEventListener("ended",i),e.removeEventListener("error",o),e.removeEventListener("pause",r)};e.addEventListener("ended",i),e.addEventListener("error",o),e.addEventListener("pause",r),e.play().catch(e=>{s(),n(e)})}))}pause(){this._audioElement?.pause()}stop(){this._audioElement&&(this._audioElement.pause(),this._audioElement.currentTime=0)}get loop(){return this._loop}set loop(e){this._loop=e,this._audioElement&&(this._audioElement.loop=e)}get volume(){return this._volume}set volume(e){this._volume=e,this._audioElement&&(this._audioElement.volume=e)}get currentTime(){return this._audioElement?.currentTime??0}set currentTime(e){this._audioElement&&(this._audioElement.currentTime=e)}get progress(){return this._audioElement&&this._duration?this._audioElement.currentTime/this._duration:0}seek(e){this._audioElement&&this._duration&&(this._audioElement.currentTime=Math.max(0,Math.min(1,e))*this._duration)}get audioElement(){return this._audioElement}_audioElement;_duration;_loadPromise;_loop=!1;_volume=1;ensureAudioElement(){if(this._audioElement&&this._loadPromise)return this._loadPromise;let e=this._audioElement??new Audio(this.url);return this._audioElement=e,e.loop=this._loop,e.volume=this._volume,e.readyState>=HTMLMediaElement.HAVE_METADATA?(this._duration=e.duration,this._loadPromise=Promise.resolve(e),this._loadPromise):(this._loadPromise=new Promise((t,n)=>{let i=()=>{r(),this._duration=e.duration,t(e)},o=e=>{r(),n(Error(`Failed to load audio clip from ${this.url}: ${e}`))},r=()=>{e.removeEventListener("loadedmetadata",i),e.removeEventListener("error",o)};e.addEventListener("loadedmetadata",i),e.addEventListener("error",o)}),this._loadPromise)}},y=class extends r.Ur{constructor(){super([o.A,r.Sn],"ColorSerializer")}onDeserialize(e){if(null!=e)return void 0===e.a?void 0===e.alpha?new o.A(e.r,e.g,e.b):new r.Sn(e.r,e.g,e.b,e.alpha):new r.Sn(e.r,e.g,e.b,e.a)}onSerialize(e){if(null!=e)return void 0===e.a?{r:e.r,g:e.g,b:e.b}:{r:e.r,g:e.g,b:e.b,a:e.a}}},b=class extends r.Ur{constructor(){super([o.tt],"EulerSerializer")}onDeserialize(e,t){if(null!=e){if(e.order)return new o.tt(e.x,e.y,e.z,e.order);if(null!=e.x)return new o.tt(e.x,e.y,e.z)}}onSerialize(e,t){return{x:e.x,y:e.y,z:e.z,order:e.order}}},E=class extends r.Ur{constructor(){super(o.fn,"ObjectSerializer")}onSerialize(e,t){if(void 0!==t.objectToNode&&e.uuid){let n=t.objectToNode[e.uuid];return r.Zr&&console.log(n,e.name,e.uuid),{node:n}}}onDeserialize(e,t){if("string"!=typeof e){if(e){if(void 0!==e.node&&t.nodeToObject){let n=t.nodeToObject[e.node];return r.Zr&&console.log("Deserialized object reference?",e,n,t?.nodeToObject),n||console.warn("Did not find node: "+e.node,t.nodeToObject,t.object),n}if(e.guid){if(!t.context)return void console.error("Missing context");let n,i=t.gltf?.scene;return i&&(n=r.tt.findByGuid(e.guid,i)),n||=r.tt.findByGuid(e.guid,t.context.scene),n?(n&&!0===n.isComponent&&(r.Zr&&console.warn("Deserialized object reference is a component"),n=n.gameObject),r.Zr&&console.log("Deserialized object reference?",e,n,t?.nodeToObject)):(((0,r.ma)()||r.Zr)&&console.warn("Could not resolve object reference",t.path,e,t.target,t.context.scene),e.could_not_resolve=!0),n}}}else if(e.endsWith(".glb")||e.endsWith(".gltf")){if(t.serializable instanceof Array&&t.serializable.includes(r.Fr))return;(0,r.ma)()&&(0,r.Mi)("Detected wrong usage of @serializable with Object3D or GameObject. Instead you should use AssetReference here! Please see the console for details.");let e=t.target?.constructor?.name;console.warn(`Wrong usage of @serializable detected in your script "${e}"\n\nIt looks like you used @serializable(Object3D) or @serializable(GameObject) for a prefab or scene reference which is exported to a separate glTF file.\n\nTo fix this please change your co
1de to:\n\n@serializable(AssetReference)\n${t.path}! : AssetReference;\n\0`)}}},_=class extends r.Ur{constructor(){super([r.$,r.$],"ComponentSerializer")}onSerialize(e,t){if(e?.guid)return{guid:e.guid}}onDeserialize(e,t){if(e?.guid){if(e.___persistentAsset)return void(r.Zr&&console.log("Skipping component deserialization because it's a persistent asset",e));let n=t.path;r.Zr&&console.log(e.guid,t.root,t.object,t.target);let i=this.findObjectForGuid(e.guid,t.root);return i||t.context&&(i=this.findObjectForGuid(e.guid,t.context?.scene),i)?i:(((0,r.ma)()||r.Zr)&&console.warn('Could not resolve component reference: "'+n+'" using guid '+e.guid,t.target),void(e.could_not_resolve=!0))}}findObjectForGuid(e,t){if(t.guid===e)return t;let n=r.tt.foreachComponent(t,t=>{if(t.guid===e)return t},!1);if(void 0!==n)return n;for(let n=0;n<t.children.length;n++){let i=t.children[n],o=this.findObjectForGuid(e,i);if(o)return o}}},S=class extends r.Ur{constructor(){super([r.Y])}onSerialize(e,t){console.log("TODO: SERIALIZE EVENT")}onDeserialize(e,t){if("function"==typeof e)return new r.Y([new r.J(e,null,[],!0)]);if(e&&"EventList"===e.type){r.Zr&&console.log("DESERIALIZE EVENT",e);let n=[];if(e.calls&&Array.isArray(e.calls))for(let s of e.calls){r.Zr&&console.log(s);let a=m.findObjectForGuid(s.target,t.root);!a&&t.context?.scene&&(a=m.findObjectForGuid(s.target,t.context?.scene));let l=s.method?.length>0;if(a&&l){let d=()=>{let e=s.method[0].toUpperCase()+s.method.slice(1);if("function"==typeof a[e])return console.warn(`EventList method:\nCould not find method ${s.method} on object ${a.name}. Please rename ${s.method} to ${e}?\n`,a[e],"\n in script: ",a),void(0,r.Mi)("EventList methods must start with lowercase letter, see console for details");console.warn(`EventList method:\nCould not find method ${s.method} on object ${a.name}`,a,typeof a[s.method])};if("function"!=typeof a[s.method]){let u=!1,p=a;for(;p;){let h=Object.getOwnPropertyDescriptor(p,s.method);if(h&&(!0===h.writable||h.set)){u=!0;break}p=Object.getPrototypeOf(p)}!u&&((0,r.ma)()||r.Zr)&&d()}}function c(e){if("object"==typeof e){let n=f.onDeserialize(e,t);if(n||=m.onDeserialize(e,t),n)return n}return e}if(a){let g=s.argument;if(void 0===g?void 0!==s.arguments&&(g=s.arguments.map(c)):g=c(g),void 0===a[s.method])console.warn(`EventList method not found: "${s.method}" on ${a?.name}`);else{void 0!==g&&!Array.isArray(g)&&(g=[g]);let v=new r.J(a,s.method,g,s.enabled);n.push(v)}}else(0,r.ma)()&&console.warn(`[Dev] EventList: Could not find event listener in scene (${t.object?.name})`,s)}let i=new r.Y(n);r.Zr&&console.log(i);let o=t.target;return void 0!==o&&void 0!==t.path&&i.setEventTarget(t.path,o),i}}},C=new WeakMap,P=class extends r.Ur{constructor(){super([r.q,o.Fr])}onSerialize(e,t){}onDeserialize(e,t){if(e instanceof o.gr&&t.type===r.q){let t=e;C.has(t)&&(t=C.get(t)),t.isRenderTargetTexture=!0,t.flipY=!0,t.offset.y=1,t.repeat.y=-1,t.needsUpdate=!0,t.mipmaps=[],t instanceof o.F&&(t.isCompressedTexture=!1,t.format=o.On);let n=new r.q(t.image.width,t.image.height,{colorSpace:o.Bt});return n.texture=t,n}}},x=class extends r.Ur{constructor(){super([URL])}onSerialize(e,t){return null}onDeserialize(e,t){if("string"==typeof e&&e.length>0)return(0,r.ja)(t.gltfId,e)}},w=class extends r.Ur{constructor(){super([v])}onSerialize(e,t){return null}onDeserialize(e,t){if("string"==typeof e&&e.length>0){let n=(0,r.ja)(t.gltfId,e);if(n)return new v(n)}}};function O(){let e=o.gr.prototype.clone;o.gr.prototype.clone=function(){let t=e.call(this);return C.has(t)||C.set(t,this),t},h=new y,new b,f=new E,m=new _,g=new S,new P,new x,new w}var R=!1;var A=(0,r.Ta)("debugmissingcamera"),T=!1;function M(e,t){t??=e.mainCameraComponent;let n=t?.gameObject;if(A&&console.log("Creating default camera controls",t?.name),n){let i=(0,r.bn)(n,r.E);i.sourceId=t?.sourceId??"unknown";let o=e.domElement.getAttribute("auto-rotate");i.autoRotate="0"!=o&&"false"!=o?.toLowerCase();let s=Number.parseFloat(o||".5");i.autoRotateSpeed=isNaN(s)?.5:s,A&&console.log("Auto-rotate",i.autoRotate,"speed:",i.autoRotateSpeed);let a=e.domElement.getAttribute("auto-fit");i.autoFit="0"!==a&&"false"!=a?.toLowerCase(),i.autoTarget=!0}else console.warn("Missing camera object, can not add orbit controls")}var D=r.Zr;(0,r.Ta)("debugtypestore")&&console.log(r.Oi);var L=new r.Vr,I=Symbol("deserialize-queue");var k=Symbol("original-component-name"),N=new Map;function B(e,t,n,i){if(null===t||!e)return;let o=e.guid,s=e.guid;if(s?.length&&(N.has(s)||(D&&console.log('Creating InstanceIdProvi
1der with key "'+s+'" for object '+e.name),N.set(s,new r.mt(s)))),e.guid=(s&&N.get(s)||t).generateUUID(),o&&"invalid"!==o&&(n[o]=e.guid),e&&e.userData&&e.userData.components)for(let o of e.userData.components){if(null===o)continue;let e=o.guid;e?N.has(e)||(D&&console.log('Creating InstanceIdProvider with key "'+e+'" for component '+o[k]),N.set(e,new r.mt(e))):D&&console.warn("Can not create IdProvider: component "+o[k]+" has no guid",o.guid);let s=N.get(e)||t,a=o.guid;o.guid=s.generateUUID(),a&&"invalid"!==a&&(n[a]=o.guid),o.resolveGuids&&i.push(o)}if(e.children)for(let o of e.children)B(o,t,n,i)}var U=[];async function j(e,t,n,i,o){if(!t)return;let s=t.userData;if(s){let i=s.builtin_components;if(i&&i.length>0)for(let o of i)try{if(null===o)continue;let i=r.Oi.get(o.name);if(i||=await r.Oi.getAsync(o.name),i){let s=new i;s.sourceId=e.gltfId,(0,r.Wr)(s,o,e.implementationInformation),s.context=e.context,"guid"in o&&(s[r._i]=o.guid),s[k]=o.name,(0,r.un)(t,s,!1),n.push({instance:s,compData:o,obj:t}),s.isCamera&&e.context&&null===e.context.mainCamera&&"MainCamera"===s.tag&&e.context.setCurrentCamera(s),!1===e.context?.physics?.engine?.isInitialized&&(s.isCollider||s.isRigidbody)&&e.context?.physics.engine?.initialize()}else D&&console.debug("unknown component: "+o.name),U.includes(o.name)||U.push(o.name)}catch(e){console.error(o.name+" - "+e.message,e)}}if(t.children)for(let r of t.children)await j(e,r,n,i,o+1);if(U.length>0&&0===o){let e=U.join(", ");console.warn(`Unknown components in scene: ${e}`),U.length=0,(0,r.Va)()&&(0,r.ji)(`<strong>Unknown components in scene</strong>:\n\n${e}\n\nThis could mean you forgot to add a npmdef to your ExportInfo\n<a href="https://engine.needle.tools/docs/project_structure.html#creating-and-installing-a-npmdef" target="_blank">documentation</a>`,{type:r.ha.Warn})}}function F(e,t){let{instance:n,compData:i,obj:o}=e;t.object=o,t.target=n,(0,r.Gr)(n,i,t),D&&console.debug("add "+i.name,i,n)}var V=class{createBuiltinComponents(e,t,n,i,o){return async function(e,t,n,i=null,o){if(!n)return void console.debug("Can not create component instances: gltf is null");let s=[],a=i;"number"==typeof a&&(a=new r.mt(i));let l=t.indexOf("?");t=-1===l?t:t.substring(0,l);let c=new r.Hr(n.scene);c.gltfId=t,c.context=e,c.gltf=n,c.nodeToObject=o?.nodeToObjectMap,c.implementationInformation=L;let d=e[I];if(d||=e[I]=[],n.scenes)for(let e of n.scenes)await j(c,e,d,s,0);if(n.children)for(let e of n.children)await j(c,e,d,s,0);e.new_scripts_pre_setup_callbacks.push(()=>{let t=e[I];if(t){for(let e of t)F(e,c);t.length=0}if(a){let e={},t=[];B(n,a,e,t);for(let i of n.scenes)B(i,a,e,t);for(let n of t)n.resolveGuids(e)}})}(e,t,n,i,o)}writeBuiltinComponentData(e,t){return function(e,t){let n=(0,r.Kr)(e,t);return void 0===n?null:n}(e,t)}parseSync(e,t,n,i){return async function(e,t,n,i){"string"!=typeof n&&(console.warn("Parse gltf binary without path, this might lead to errors in resolving extensions. Please provide the source path of the gltf/glb file",n,typeof n),n=""),G&&console.log("Parse glTF",n);let o=await H(n,e,n);if(!o)return;let{componentsExtension:r}=$(o,e);if(o instanceof s.t){"string"!=typeof t&&(t=(new TextDecoder).decode(t));let s=o.parse(t);return await X(o,e,n,s,i,r)}if(!(o instanceof s.A)){if(!("parse"in o)||"function"!=typeof o.parse)return void console.error("Loader does not support parse");let s=o.parse(t,n);return await X(o,e,n,s,i,r)}return new Promise((s,a)=>{try{let a=n.split("?")[0].trimEnd(),l=a.split("/");l.length>0&&""!==l[l.length-1]&&l.pop(),a=l.join("/"),a.endsWith("/")||(a+="/"),o.resourcePath=a,o.parse(t,"",async t=>{s(await X(o,e,n,t,i,r))},e=>{console.error('Loading asset at "'+n+'" failed\n',e),s(void 0)})}catch(e){console.error(e),a(e)}})}(e,t,n,i)}loadSync(e,t,n,i,o){return W(e,t,n,i,o)}};var G=(0,r.Ta)("printGltf")||(0,r.Ta)("printgltf"),z=(0,r.Ta)("debugfileformat");async function H(e,t,n){let i=await(0,l.K)(e,{useExtension:!0})||"unknown";z&&console.debug(`Determined file type: '${i}' for url '${e}'`,{registeredModelLoaderCallbacks:l.q});for(let n of l.q){let{callback:o}=n,r=o({context:t,url:e,mimetype:i});if(r instanceof Promise&&await r,r)return console.debug(`Using custom loader (${n.name||"unnamed"}) for ${i} at '${e}'`),r}switch(i){case"unsupported":return null;default:case"unknown":{console.warn(`Unknown file type (${i}). Needle Engine will fallback to the GLTFLoader - To support more model formats please create a Needle loader plugin.\nUse import { NeedleEngineModelLoader } from "@needle-tools/engine" namespace to register your loader.`,e);let o=new s.A;return await(0,a.yt)(o,t,e,n),o}case"model/fbx":case"model/vnd.autodesk.fbx":return new s.n;case"model/obj":return new s.t;case"model/vnd.usdz+zip":case"model/vnd.usd+zip":case"model/vnd.usda+zip":return console.warn(i.toUpperCase()+" files are not supported."),null;case"model/gltf+json":case"model/gltf-binary":case"model/vrm":{let i=new s.A;return await(0,a.yt)(i,t,e,n),i}case"application/materialx+xml":return new a.bt}}
1async function W(e,t,n,i,o){!function(e){if(new URL(e,window.location.href).href.startsWith("file://")){let e='Hi - it looks like you are trying to load a local file which will not work. You need to use a webserver to serve your files.\nPlease refer to the documentation on <a href="https://fwd.needle.tools/needle-engine/docs/local-server">https://docs.needle.tools</a> or ask for help in our <a href="https://discord.needle.tools">discord community</a>';(0,r.ji)(e),console.warn(e)}}(t);let a=await H(t,e,n);if(!a)return;let{componentsExtension:l}=$(a,e);return a instanceof s.A?new Promise((r,s)=>{try{a.load(t,async t=>{r(await X(a,e,n,t,i,l))},e=>{o?.call(a,e)},e=>{console.error('Loading asset at "'+t+'" failed\n',e),r(void 0)})}catch(e){console.error(e),s(e)}}):await X(a,e,t,await a.loadAsync(t,o),i,l)}function $(e,t){let n=(0,a._t)(e);return e instanceof s.A&&(0,a.S)(e,t),{componentsExtension:n}}async function X(e,t,n,i,l,c){if(G&&console.warn("Loaded",n,i),null==i)return console.error(`Loaded model is null '${n}' - please make sure the loader is registered correctly`),{scene:new o.fn,animations:[],scenes:[]};if("object"!=typeof i)return console.error(`Loaded model is not an object '${n}' - please make sure the loader is registered correctly`),{scene:new o.fn,animations:[],scenes:[]};if(i instanceof o.fn)i={scene:i,animations:i.animations,scenes:[i]};else if(i instanceof o.S){let e=new o.in({color:new o.A(14540253)}),t=new o.Zt(i,e);i={scene:t,animations:[],scenes:[t]}}else!1===Array.isArray(i.scenes)&&console.error(`[Needle Engine] The loaded model object does not have a scenes property '${n}' - please make sure the loader is registered correctly and three.js is not imported multiple times.`);return n.includes("?")&&(n=n.split("?")[0]),function(e,t){if("scenes"in t)for(let e of t.scenes)if(e&&!e.animations?.length)for(let n of t.animations)e.animations.includes(n)||e.animations.push(n);if(e instanceof s.n||e instanceof s.t){let e=t;e instanceof o.fn||(e=t.scene||t.scenes.find(e=>e)),e.traverse(e=>{let t=e;t?.isMesh&&(0,r.Qi)(t,t.material)})}}(e,i),(0,r.Ci)(i)&&((0,a.gt)(n,i,t),await(0,r.vi)().createBuiltinComponents(t,n,i,l,c||void 0)),await async function(e,t,n){n||=t.mainCamera;try{n?await t.renderer.compileAsync(e,n,t.scene).catch(e=>{console.warn(e.message)}):(0,r.li)(e,t)}catch(e){console.warn(e?.message||e)}}(i.scene,t,t.mainCamera),i}var q=!1;var Z=!1;var Q=(0,r.ma)(),K=class extends HTMLElement{static observedAttributes=["ar","vr","quicklook","qrcode"];constructor(){super(),this.removeEventListener("click",this.#e),this.addEventListener("click",this.#e)}attributeChangedCallback(e,t,n){this.#t()}#n;#i;#o;#r;#s;#a;#l;#t(){if(this.#r?.remove(),null!=this.getAttribute("ar"))this.#s??=new a.I,this.#r=this.#s.createARButton(),this.setAttribute("aria-label","Enter augmented reality mode");else if(null!=this.getAttribute("vr"))this.#s??=new a.I,this.#r=this.#s.createVRButton(),this.setAttribute("aria-label","Enter virtual reality mode");else if(null!=this.getAttribute("quicklook"))this.#s??=new a.I,this.#r=this.#s.createQuicklookButton(),this.setAttribute("aria-label","View in AR with Apple Quick Look");else{if(null==this.getAttribute("qrcode"))return Q?console.warn("No button type specified for <needle-button>. Use either ar, vr or quicklook attribute."):console.debug("No button type specified for <needle-button>. Use either ar, vr or quicklook attribute."),void this.setAttribute("aria-label","Needle Button with no specified type");this.#a??=new r.Nn,this.#r=this.#a.createQRCode({anchorElement:this}),this.setAttribute("aria-label","Share application with QR code")}this.#n??=this.attachShadow({mode:"open"}),this.#i??=document.createElement("slot"),this.#o??=document.createElement("style"),this.#o.innerHTML="\n            button {\n                all: unset;\n            }\n        ",this.getAttribute("unstyled")??(this.#o.innerHTML+="\n            :host {\n                display: inline-flex;\n                align-items: center;\n                justify-content: center;\n                width: fit-content;\n\n                padding: 0.4rem .5rem;\n                border-radius: 100vw;\n                \n                background: rgba(245, 245, 245, .8);\n                backdrop-filter: blur(10px);\n\n                cursor: pointer;\n                color: black;\n                outline: rgba(0,0,0,.05) 1px solid;\n\n                transition: all .2s;\n            }\n            :host(:hover) {\n                background: rgba(255, 255, 255, 1);\n                transition: background .2s;\n            }\n            slot {\n                display: flex;\n                align-items: center;\n                justify-content: center;\n                gap: .5rem;\n            }\n"),this.#i.innerHTML=this.#r.innerHTML,this.#i.style.cssText="display: flex; align-items: center; justify-content: center;",this.#r.innerHTML=this.#i.outerHTML,this.#n.innerHTML=this.#r.outerHTML,this.#n.prepend(this.#o),(0,r.An)(r.jn,{element:this.#n}),this.#l?.disconnect(),this.#l??=new MutationObserver(()=>this.#c()),this.#l.observe(this.#r,{attributes:!0}),Q&&console.log("Needle Button updated",this)}#c(){this.#r&&("none"===this.#r.style.display?this.style.display="none":"none"===this.style.display&&(this.style.display=""))}#e=e=>{Q&&console.log("Needle Button clicked",{defaultPrevented:e.defaultPrevented,hasButton:!!this.#r}),!e.defaultPrevented&&this.#r&&this.#r.click()}},Y=(0,r.Ta)("debugoverlay"),J=class{get ARContainer(){return this.arContainer}arContainer=null;currentSession=null;_createdAROnlyElements=[];_reparentedObjects=[];contentElement=null;originalDomOverlayParent=null;requestEndAR=()=>{this.onRequestedEndAR()};onBegin(e,t,n){if(this.currentSession=n,this.arContainer=t,r._a.isMozillaXR()||r._a.isNeedleAppClip()){let n=e.domElement.children;for(let e=0;e<n?.length;e++){let t=n[e];if(!t||t===this.arContainer)return;this._reparentedObjects.push({el:t,previousParent:t.parentElement}),this.arContainer?.appendChild(t)}t?(this.originalDomOverlayParent=t.parentNode,this.originalDomOverlayParent&&(console.log("Reparent DOM Overlay to body",t,t.style.display),t.style.display="",t.style.visibility="",document.body.appendChild(t))):console.warn("WebXRViewer: No DOM Overlay found")}this.ensureQuitARButton(this.arContainer)}onEnd(e){for(let e of this._createdAROnlyElements)e.remove&&e.remove();for(let e of this._reparentedObjects){let t=e.el;e.previousParent?.appendChild(t)}this._reparentedObjects.length=0,r._a.isMozillaXR()&&setTimeout(()=>{let t=e.renderer.domElement;t&&e.domElement.shadowRoot?.prepend(t);let n=document.querySelectorAll("*");for(var i=0;i<n.length;i++){let e=n[i];e&&void 0!==e._displayChanged&&void 0!==e._displayWas&&(e.style.display=e._displayWas)}},10)}createOverlayContainer(e){if(this.contentElement)return this.contentElement;Y&&console.log("Setup overlay container");let t=e.shadowRoot.querySelector(".content");this.contentElement=t;let n=e.shadowRoot.querySelector(".overlay-content");return n&&t.appendChild(n),Y&&!r._a.isMobileDevice()&&this.ensureQuitARButton(t),t}onRequestedEndAR(){this.currentSession&&=(this.currentSession.end(),null)}ensureQuitARButton(e){let t=document.createElement("slot");if(t.style.display="contents",t.style.padding="10px",t.setAttribute("name","quit-ar"),this.appendElement(t,e),this._createdAROnlyElements.push(t),t.style.pointerEvents="auto",r._a.isNeedleAppClip()){globalThis.NEEDLE_ENGINE_APPCLIP_DISABLE_MENU=!0;let e=document.querySelector('meta[name="viewport"]');e&&!e.getAttribute("content")?.includes("viewport-fit=")&&e.setAttribute("content",e.getAttribute("content")+",viewport-fit=cover")}let n=document.querySelector(".quit-ar");if(n)return n.addEventListener("click",this.requestEndAR),void(Y&&n.addEventListener("click",()=>console.log("Clicked quit-ar button")));t.addEventListener("click",this.requestEndAR),Y&&t.addEventListener("click",()=>console.log("Clicked fallback close button"));let i=document.createElement("div");i.style.cssText="\n            position: fixed;\n            top: 0;\n            right: 0;\n            z-index: 600;\n            pointer-events: all;\n            padding-top: env(safe-area-inset-top, 0px);\n            padding-right: calc(env(safe-area-inset-right, 0px) + 10px);\n        ",this.appendElement(i,t);var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.classList.add("quit-ar-button"),o.setAttribute("width","40px"),o.setAttribute("height","40px"),o.style.cssText="\n            background: rgba(255, 255, 255, .4);\n            -webkit-backdrop-filter: blur(8px);\n            backdrop-filter: blur(8px);\n            border-radius: 50%;\n            box-shadow: 0 0 5px rgba(0,0,0,.3);\n            outline: 1px solid rgba(255, 255, 255, .6);\n            display: flex;\n            justify-content: center;\n            align-items: center;\n        ",i.appendChild(o);var s=document.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d","M 12,12 L 28,28 M 28,12 12,28"),s.setAttribute("stroke","#000000"),s.setAttribute("stroke-width","2px"),s.style.cssText="\n            /**filter: drop-shadow(0 0px 1.2px rgba(0,0,0,.7));**/\n        ",o.appendChild(s),Y&&console.log("Created fallback close button",o,e)}appendElement(e,t){return t.shadowRoot?t.shadowRoot.appendChild(e):t.appendChild(e)}},ee=(0,r.Ta)("debugloading"),te=(0,r.Ta)("debugloadingrendering");(0,r.Ta)("debuglicense");var ne,ie=0;function oe(e){ee&&console.log(e.progress.loaded.toFixed(0)+"/"+e.progress.total.toFixed(0),e);let t=e.count,n=e.progress.total;0===n||void 0===n?(ne!==e.name&&(ie=0),ne=e.name,ie+=.001*(1-ie),ee&&(0,r.Mi)("Loading "+e.name+" did not report total size")):ie=e.progress.loaded/n;let i=e.index/t+ie/t;return r.da.clamp01(i)}var re=class e{static LoadingContainerClassName="loading";loadingProgress=0;_element;_progress=0;_allowCustomLoadingElement=!0;_loadingElement;_loadingTextContainer=null;_loadingBar=null;_loadingBarFinishedColor=null;_messageContainer=null;_loadingElementOptions;constructor(e,t){this._element=e,this._loadingElementOptions=t}async onLoadingBegin(t){let n=this._element.shadowRoot||this._element;if(ee&&console.warn("Begin Loading"),!this._loadingElement){for(let t=0;t<n.children.length;t++){let i=n.children[t];if(i.classList.contains(e.LoadingContainerClassName)){if(!this._allowCustomLoadingElement){ee&&console.warn("Remove custom loading container"),n.removeChild(i);continue}this._loadingElement=this.createLoadingElement(i)}}this._loadingElement||=this.createLoadingElement()}this._progress=0,this.loadingProgress=0,this._loadingElement.style.display="flex",n.appendChild(this._loadingElement),this.smoothProgressLoop(),this.setMessage(t??"")}onLoadingUpdate(e,t){if(!this._loadingElement?.parentNode)return;let n=0;"number"==typeof e?n=e:("index"in e&&(n=oe(e)),!t&&"name"in e&&this.setMessage("loading "+e.name)),this.loadingProgress=n,t&&this.setMessage(t),this.updateDisplay()}onLoadingFinished(){ee&&console.warn("Finished Loading"),te||(this.loadingProgress=1,this.onDoneLoading())}setMessage(e){this._messageContainer&&(this._messageContainer.innerText=e)}_progressLoop;smoothProgressLoop(){if(this._progressLoop)return;let e=1/12;te&&(e=.002,"number"==typeof te&&(e*=te)),this._progressLoop=setInterval(()=>{this.loadingProgress>=.95&&!te&&(e=.9),this._progress=r.da.lerp(this._progress,this.loadingProgress,e*this.loadingProgress),this.updateDisplay()},e)}onDoneLoading(){if(this._loadingElement){ee&&console.log("Hiding loading element");let e=this._loadingElement;e.animate([{opacity:1},{opacity:0}
1],{duration:200,easing:"ease-in-out"}).addEventListener("finish",()=>{e.style.display="none",e.remove()})}this._progressLoop&&clearInterval(this._progressLoop),this._progressLoop=null}updateDisplay(){let e=this._progress,t=(100*e).toFixed(0)+"%";this._loadingBar&&(this._loadingBar.style.width=100*e+"%",e>=1&&this._loadingBarFinishedColor&&(this._loadingBar.style.background=this._loadingBarFinishedColor)),this._loadingTextContainer&&(this._loadingTextContainer.textContent=t)}createLoadingElement(t){ee&&!t&&console.log("Creating loading element"),this._loadingElement=t||document.createElement("div");let n=this._element.getAttribute("loading-style");(!n||"auto"===n)&&(n=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");let i=(0,r.ti)();if(!t){this._loadingElement.style.position="absolute",this._loadingElement.style.width="100%",this._loadingElement.style.height="100%",this._loadingElement.style.left="0",this._loadingElement.style.top="0",this._loadingElement.style.overflow="hidden";let e=this._element.getAttribute("loading-background");e?this._loadingElement.style.background=e:this._loadingElement.style.backgroundColor="transparent",this._loadingElement.style.display="flex",this._loadingElement.style.alignItems="center",this._loadingElement.style.justifyContent="center",this._loadingElement.style.zIndex="0",this._loadingElement.style.flexDirection="column",this._loadingElement.style.pointerEvents="none",this._loadingElement.style.color="white",this._loadingElement.style.fontFamily='system-ui, Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',this._loadingElement.style.fontSize="1rem",this._loadingElement.style.color="light"===n?"rgba(0,0,0,.6)":"rgba(255,255,255,.3)"}let o=this._loadingElementOptions?.className??e.LoadingContainerClassName;if(this._loadingElement.classList.add(o),this._loadingElementOptions?.additionalClasses)for(let e of this._loadingElementOptions.additionalClasses)this._loadingElement.classList.add(e);let s=document.createElement("div");s.style.cssText="\n            position: relative;\n            display: flex;\n            flex-direction: column;\n            align-items: center;\n            justify-content: center;\n            width: 100%;\n            height: 100%;\n            pointer-events: none;\n        ",this._loadingElement.appendChild(s);let a=this._element.getAttribute("poster");if(null!==a&&"0"!==a){let e=document.createElement("div"),t=a?.length?"0px":"50px";e.style.cssText=`\n            position: absolute;\n            left: 0;\n            top: 0;\n            bottom: 0;\n            right: 0;\n            z-index: -1;\n            overflow: hidden;\n\n            margin: -${t};\n            background: url('${a?.length?a:"/include/poster.webp"}') center center no-repeat;\n            background-size: cover;\n            filter: blur(${t});\n        `,this._loadingElement.appendChild(e)}let l=document.createElement("img");if(l.style.userSelect="none",l.style.objectFit="contain",l.style.transform="translateY(30px)",l.style.opacity="0.0000001",l.style.transition="transform 1s ease-out .2s, opacity .3s ease-in-out .2s",l.src=r.Ln,i&&this._element){let e=this._element.getAttribute("logo-src");e&&(l.src=e,setTimeout(()=>{l.style.opacity="1",l.style.transform="translateY(0px)"},1))}l.style.width="80%",l.style.height="min(1000px, max(15%, 50px))",s.appendChild(l);let c=document.createElement("div");c.style.cssText="\n        display: flex;\n        flex-direction: column;\n        align-items: center;\n        justify-content: center;\n        width: 100%;\n        opacity: 0;\n        transition: opacity 1s ease-in-out 4s;\n        ",setTimeout(()=>{c.style.opacity="1"},1),this._loadingElement.appendChild(c);let d=document.createElement("div");return d.style.display="flex",d.style.width="100%",d.style.height="5px",d.style.position="absolute",d.style.left="0",d.style.top="0px",d.style.opacity="0",d.style.transition="opacity 1s ease-in-out",d.style.backgroundColor="rgba(240,240,240,.5)",setTimeout(()=>{d.style.opacity="1"},1),this._loadingElement.appendChild(d),this._loadingBar=document.createElement("div"),d.appendChild(this._loadingBar),this._loadingBar.style.backgroundAttachment="fixed",this._loadingBar.style.background="#c4c4c4ab",this._loadingBarFinishedColor="#ddddddab",this._loadingBar.style.width="0%",this._loadingBar.style.height="100%",this._loadingElement}},se=(0,i.n)({NeedleEngineWebComponent:()=>he}),ae=(0,r.Ta)("debugwebcomponent"),le="desktop",ce=["ar","vr",le],de="ar-session-active",ue="desktop-session-active",pe=["src","hash","camera-controls","dracoDecoderPath","dracoDecoderType","ktx2DecoderPath","public-key","version","tone-mapping","tone-mapping-exposure","background-blurriness","background-color","environment-intensity","focus-rect","loadstart","progress","loadfinished"],he=class extends HTMLElement{static get observedAttributes(){return pe}get loadingProgress01(){return this._loadingProgress01}get loadingFinished(){return this.loadingProgress01>.999}get cameraControls(){let e=this.getAttribute("camera-controls");return null==e?null:!(null===e||"False"===e||"false"===e||"0"===e||"none"===e)}set cameraControls(e){null===e?this.removeAttribute("camera-controls"):this.setAttribute("camera-controls",e?"true":"false")}getContext(){return new Promise((e,t)=>
1{if(this._context&&this.loadingFinished)e(this._context);else{let t=()=>{this.removeEventListener("loadfinished",t),this._context&&this.loadingFinished&&e(this._context)};this.addEventListener("loadfinished",t)}})}get context(){return this._context}_context;_overlay_ar;_loadingProgress01=0;_loadingView;_previousSrc=null;_didFullyLoad=!1;_didInitialize=!1;constructor(){super(),this.attachShadow({mode:"open",delegatesFocus:!0});let e=document.createElement("template");e.innerHTML=`<style>\n    :host {\n        position: absolute;\n        display: block;\n        width: max(600px, 100%);\n        height: max(300px, 100%);\n        touch-action: none;\n\n        -webkit-tap-highlight-color: transparent;\n    }\n\n    @media (max-width: 600px) {\n        :host {\n            width: 100%;\n        }\n    }\n    @media (max-height: 300px) {\n        :host {\n            height: 100%;\n        }\n    }\n\n    :host > div.canvas-wrapper {\n        width: 100%;\n        height: 100%;\n    }\n\n    :host canvas {   \n        position: absolute;\n        user-select: none;\n        -webkit-user-select: none;\n\n        /** allow touch panning but no pinch zoom **/\n        /** but this doesnt work yet: \n         * touch-action: pan-x, pan-y;\n         **/\n        \n        -webkit-touch-callout: none;\n        -webkit-user-drag: none;\n        -webkit-user-modify: none;\n\n        left: 0;\n        top: 0;\n    }\n    :host .content {\n        position: absolute;\n        top: 0;\n        width: 100%;\n        height: 100%;\n        visibility: visible;\n        z-index: 500; /* < must be less than the webxr buttons element */\n        pointer-events: none;\n    }\n    :host .overlay-content {\n        position: absolute;\n        user-select: auto;\n        pointer-events: all;\n    }\n    :host slot[name="quit-ar"]:hover {\n        cursor: pointer;\n    }\n    :host .quit-ar-button {\n        position: absolute;\n        /** top: env(titlebar-area-y); this doesnt work **/\n        top: 60px; /** camera access needs a bit more space **/\n        right: 20px;\n        z-index: 9999;\n    }\n</style>\n<div class="canvas-wrapper"> \x3c!-- this wrapper is necessary for WebXR https://github.com/meta-quest/immersive-web-emulator/issues/55 --\x3e\n    <canvas data-needle-engine-version=${r.mi}></canvas>\n</div>\n<div class="content">\n    <slot class="overlay-content" style="display: contents;"></slot>\n</div>\n`,this.shadowRoot.appendChild(e.content.cloneNode(!0)),(0,r.An)(r.Mn,{element:this.shadowRoot}),this.addEventListener("ready",this.onReady),this.addEventListener("error",this.onError)}ensureInitialized(){this._didInitialize||(this._didInitialize=!0,this.initializeDom())}initializeDom(){(0,r.kn)(),this.setAttribute("role","application"),this.setAttribute("aria-label","Needle Engine 3D scene")}connectedCallback(){if(ae&&console.log("<needle-engine> connected"),this.ensureInitialized(),this.setPublicKey(),this.setVersion(),(null===this.getAttribute("tabindex")||void 0===this.getAttribute("tabindex"))&&this.setAttribute("tabindex","0"),this._overlay_ar=new J,this.getOrCreateContext(),this.addEventListener("xr-session-started",this.onXRSessionStarted),this.onSetupDesktop(),!this.getAttribute("src")){let e=globalThis["needle:codegen_files"];ae&&console.log('src is null, trying to load from globalThis["needle:codegen_files"]',e),e&&(ae&&console.log('globalThis["needle:codegen_files"]',e),this.setAttribute("src",e))}ae&&console.log("src",this.getAttribute("src"));let e=this._loadId;setTimeout(()=>{!1!==this.isConnected&&e===this._loadId&&this.onLoad()},1)}disconnectedCallback(){this.removeEventListener("xr-session-started",this.onXRSessionStarted),this._didFullyLoad=!1;let e=this.getAttribute("keep-alive"),t=null==e||e?.length>0&&"true"!==e&&"1"!==e;ae&&console.warn('<needle-engine> disconnected, keep-alive: "'+e+'"',typeof e,"Dispose=",t),t?(ae&&console.warn("<needle-engine> dispose"),this._context?.dispose(),this._context=null,this._lastSourceFiles=null,this._loadId+=1):ae&&console.warn("<needle-engine> is not disposed because keep-alive is set")}connectedMoveCallback(){}attributeChangedCallback(e,t,n){switch(ae&&console.log("attributeChangedCallback",e,t,n),e){case"src":ae&&console.warn('<needle-engine src>\nchanged from "',t,'" to "',n,'"'),this.onLoad();break;case"hash":this._context&&(this._context.hash=n);break;case"loadstart":case"progress":case"loadfinished":"string"==typeof n&&n.length>0&&(ae&&console.log(e+" attribute changed",n),this.registerEventFromAttribute(e,n));break;case"dracoDecoderPath":ae&&console.log("dracoDecoderPath",n),(0,a.C)(n);break;case"dracoDecoderType":"wasm"===n||"js"===n?(ae&&console.log("dracoDecoderType",n),(0,a.w)(n)):console.error("Invalid dracoDecoderType",n,"expected js or wasm");break;case"ktx2DecoderPath":ae&&console.log("ktx2DecoderPath",n),(0,a.T)(n);break;case"tonemapping":case"tone-mapping":case"tone-mapping-exposure":case"background-blurriness":case"background-color":case"environment-intensity":this.applyAttributes();break;case"public-key":"npk_f9b2a5f445a061a7c307b4f7605dabe14297615a77dd6f0810951e9bb1ada328"!=n&&this.setPublicKey();break;case"version":"5.0.8"!=n&&this.setVersion();break;case"focus-rect":{let e=this.getAttribute("focus-rect");if(e){let t=this.getOrCreateContext();
1if(null===e)t.setCameraFocusRect(null);else if("string"==typeof e&&e.length>0){let n=document.querySelector(e);n||console.warn(`No element found for focus-rect selector: ${e}`),t.setCameraFocusRect(n instanceof HTMLElement?n:null)}else e instanceof HTMLElement?t.setCameraFocusRect(e):console.warn("Invalid focus-rect value. Expected a CSS selector string or an HTMLElement.",e)}}}}get toneMapping(){return this.getAttribute("tonemapping")||this.getAttribute("tone-mapping")}_loadId=0;_abortController=null;_lastSourceFiles=null;_createContextPromise=null;getOrCreateContext(){return this._context||=(ae&&console.warn("Create new context"),new r.in({domElement:this})),this._context}async onLoad(){if(!this.isConnected)return;let e=this.getOrCreateContext(),t=this.getSourceFiles();if(!this.checkIfSourceHasChanged(t,this._lastSourceFiles))return;this._abortController&&=(ae&&console.warn("Abort previous loading process"),this._abortController.abort(),null),this._lastSourceFiles=t;let n=++this._loadId;if((null==t||t.length<=0)&&(ae&&console.warn("Clear scene",t),e.clear(),n!==this._loadId))return;let i=this.getAttribute("alias");this.classList.add("loading");let o=(0,r.ei)();this.ensureLoadStartIsRegistered();let s=this.dispatchEvent(new CustomEvent("loadstart",{detail:{context:e,alias:i},cancelable:!0}));if(o){let e=this.getAttribute("hide-loading-overlay");null!=e&&"0"!==e&&(s=!1)}!1===s&&!o&&((0,r.ma)()||(s=!0),console.warn("Needle Engine: You need a commercial license to override the default loading view. Visit https://needle.tools/pricing"),(0,r.ma)()&&(0,r.Mi)('You need a <a target="_blank" href="https://needle.tools/pricing">commercial license</a> to override the default loading view. This will not work in production.')),!this._loadingView&&s&&(this._loadingView=new re(this)),s&&(!0===this._didFullyLoad?setTimeout(()=>{this._loadingView&&this._loadingProgress01<.3&&this._loadId===n&&this._loadingView.onLoadingBegin("begin load")},300):this._loadingView?.onLoadingBegin("begin load")),ae&&console.warn("--------------\nNeedle Engine: Begin loading "+n+"\n",t),this.onBeforeBeginLoading();let a=[],l={context:this._context,name:"",progress:{},index:0,count:t.length,totalProgress01:this._loadingProgress01},c=new CustomEvent("progress",{detail:l}),d=[],u=new AbortController;this._abortController=u;let p={files:t,abortSignal:u.signal,onLoadingProgress:e=>{if(ae&&console.debug("Loading progress: ",e),u.signal.aborted)return;let t=e.index;!d[t]&&e.name&&(d[t]=function(e){if(e.startsWith("blob:"))return"blob";let t=e.split("/"),n=t[t.length-1],i=n.indexOf("?");i>0&&(n=n.substring(0,i));let o=n.indexOf("=");o>0&&(n=n.substring(o));let s=n.split(".").pop(),a=s?["glb","gltf","usdz","usd","fbx","obj","mtl"].indexOf(s.toLowerCase()):-1;if(s&&a>=0&&(n=n.substring(0,n.length-s.length-1)),n=decodeURIComponent(n),n.length>3){let e="",t=!1,i=["(",")","[","]","{","}",":",";",",",".","!","?"];for(let o=0;o<n.length;o++){let r=n[o];("_"===r||"-"===r)&&(r=" "),!(" "===r&&e.length<=0)&&(i.includes(r)||(0===e.length&&(r=r.toUpperCase()),(!t||" "!==r)&&(t&&(r=r.toUpperCase()),t=!1,e+=r," "===r&&(t=!0))))}return(0,r.ma)()&&n!==e&&console.debug('Generated display name: "'+n+'" → "'+e+'"'),e.trim()}return n}(e.name)),e.name=d[t],s&&this._loadingView?.onLoadingUpdate(e),l.name=e.name,l.progress=e.progress,this._loadingProgress01=oe(e),l.totalProgress01=this._loadingProgress01,this.dispatchEvent(c)},onLoadingFinished:(e,t,n)=>{ae&&console.debug(`Finished loading "${t}" (aborted? ${u.signal.aborted})`),!u.signal.aborted&&n&&a.push({src:t,file:n})}};!function(e){(0,r.si)(t=>{let n=e.getAttribute("loading-blur");if(null!==n&&"0"!==n&&t.domElement===e){let i=t.lodsManager.manager?.awaitLoading({frames:5,signal:AbortSignal.timeout(1e4),maxPromisesPerObject:1}).catch(e=>{}),o="20px";if(n.endsWith("px")&&(o=n),null===t.scene.background){let n=e,r=t.renderer.domElement,s=r.style.filter,a=r.style.overflow;r.style.filter+=`blur(${o})`,n.style.overflow="hidden",i?.then(()=>{r.animate([{filter:"blur(0px)"}],{duration:170,easing:"ease-in"}).onfinish=()=>{r.style.filter=s,n.style.overflow=a}})}else{let e=document.createElement("div");
1t.domElement.prepend(e),e.style.cssText="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none",e.style.backdropFilter=`blur(${o})`,i?.then(()=>{e.animate([{backdropFilter:"blur(0px)",opacity:0}],{duration:170,easing:"ease-in"}).onfinish=()=>{e.remove()}})}}},{once:!0})}(this);let h=this.getAttribute("hash");null!=h&&(e.hash=h),e.alias=i,this._createContextPromise=e.create(p);let f=await this._createContextPromise;this.applyAttributes(),ae&&console.warn("--------------\nNeedle Engine: finished loading "+n+"\n",t,`Aborted? ${u.signal.aborted}`),u.signal.aborted?console.log("Loading finished but aborted..."):this._loadId===n?(this._loadingProgress01=1,s&&f&&this._loadingView?.onLoadingUpdate(1,"creating scene"),this._didFullyLoad=!0,this.classList.remove("loading"),this.classList.add("loading-finished"),this.dispatchEvent(new CustomEvent("loadfinished",{detail:{context:this._context,src:i,loadedFiles:a}}))):console.log("Load id changed during loading process")}applyAttributes(){let e=this.getOrCreateContext();if(e.renderer){let t=(0,r.Hn)(this.toneMapping);void 0!==t&&(e.renderer.toneMapping=t);let n=this.getAttribute("tone-mapping-exposure");if(null!=n){let t=parseFloat(n);isNaN(t)||(e.renderer.toneMappingExposure=t)}}let t=this.getAttribute("background-blurriness");if(null!=t){let n=parseFloat(t);isNaN(n)||(e.scene.backgroundBlurriness=n)}let n=this.getAttribute("environment-intensity");if(null!=n){let t=parseFloat(n);isNaN(t)||(e.scene.environmentIntensity=t)}let i=this.getAttribute("background-color");if(e.renderer)if("string"==typeof i&&i.length>0){let t=r.Sn.fromColorRepresentation(i);ae&&console.debug("<needle-engine> background-color changed, str:",i,"→",t),e.renderer.setClearColor(t,t.alpha),e.scene.background=null}else this.getAttribute("background-image")&&this.setAttribute("background-image",this.getAttribute("background-image"))}onXRSessionStarted=()=>{let e=this.getOrCreateContext(),t=e.xrSessionMode;"immersive-ar"===t?this.onEnterAR(e.xrSession):"immersive-vr"===t&&this.onEnterVR(e.xrSession),e.xrSession?.addEventListener("end",()=>{this.dispatchEvent(new CustomEvent("xr-session-ended",{detail:{session:e.xrSession,context:this._context,sessionMode:t}})),"immersive-ar"===t?this.onExitAR(e.xrSession):"immersive-vr"===t&&this.onExitVR(e.xrSession)})};onReady=()=>this._loadingView?.onLoadingFinished();onError=()=>this._loadingView?.setMessage("Loading failed!");getSourceFiles(){let e,t=this.getAttribute("src");if(!t)return[];e=Array.isArray(t)?t:t.startsWith("[")&&t.endsWith("]")?JSON.parse(t):t.includes(",")?t.split(","):[t];for(let t=e.length-1;t>=0;t--){let n=e[t];("null"===n||"undefined"===n||n?.length<=0)&&e.splice(t,1)}return e}checkIfSourceHasChanged(e,t){if(e?.length!==t?.length||null==e&&null!==t||null!==e&&null==t)return!0;if(null!==e&&null!==t)for(let n=0;n<e?.length;n++)if(e[n]!==t[n])return!0;return!1}_previouslyRegisteredMap=new Map;ensureLoadStartIsRegistered(){let e=this.getAttribute("loadstart");e&&this.registerEventFromAttribute("loadstart",e)}registerEventFromAttribute(e,t){let n=this._previouslyRegisteredMap.get(e);if(n&&(this._previouslyRegisteredMap.delete(e),this.removeEventListener(e,n)),"string"==typeof t&&t.length>0)try{let n=(0,eval)(t);"function"==typeof n&&(this._previouslyRegisteredMap.set(e,n),this.addEventListener(e,e=>n?.call(globalThis,this.getOrCreateContext(),e)))}catch(n){console.error("Error registering event "+e+'="'+t+'" failed with the following error:\n',n)}}setPublicKey(){this.setAttribute("public-key",r.pi)}setVersion(){this.setAttribute("version",r.mi)}getAROverlayContainer(){return this._overlay_ar.createOverlayContainer(this)}getVROverlayContainer(){for(let e=0;e<this.children.length;e++){let t=this.children[e];if(t.classList.contains("vr"))return t}return null}onEnterAR(e){let t=this.getOrCreateContext();this.onSetupAR();let n=this.getAROverlayContainer();this._overlay_ar.onBegin(t,n,e),this.dispatchEvent(new CustomEvent("enter-ar",{detail:{session:e,context:t,htmlContainer:this._overlay_ar?.ARContainer}}))}onExitAR(e){let t=this.getOrCreateContext();this._overlay_ar.onEnd(t),this.onSetupDesktop(),this.dispatchEvent(new CustomEvent("exit-ar",{detail:{session:e,context:t,htmlContainer:this._overlay_ar?.ARContainer}}
1))}onEnterVR(e){let t=this.getOrCreateContext();this.onSetupVR(),this.dispatchEvent(new CustomEvent("enter-vr",{detail:{session:e,context:t}}))}onExitVR(e){let t=this.getOrCreateContext();this.onSetupDesktop(),this.dispatchEvent(new CustomEvent("exit-vr",{detail:{session:e,context:t}}))}onSetupAR(){this.classList.add(de),this.classList.remove(ue);let e=this.getAROverlayContainer();ae&&console.warn("onSetupAR:",e),e&&(e.classList.add(de),e.classList.remove(ue)),this.foreachHtmlElement(e=>this.setupElementsForMode(e,"ar"))}onSetupVR(){this.classList.remove(de),this.classList.remove(ue),this.foreachHtmlElement(e=>this.setupElementsForMode(e,"vr"))}onSetupDesktop(){this.classList.remove(de),this.classList.add(ue);let e=this.getAROverlayContainer();e&&(e.classList.remove(de),e.classList.add(ue)),this.foreachHtmlElement(e=>this.setupElementsForMode(e,le))}setupElementsForMode(e,t,n=null){if(e!==this._context?.renderer?.domElement&&"VRButton"!==e.id&&"ARButton"!==e.id)if(e.classList.contains(t))e.style.visibility="visible","none"===e.style.display&&(e.style.display="block");else for(let t of ce)e.classList.contains(t)&&(e.style.visibility="hidden",e.style.display="none")}foreachHtmlElement(e){for(let t=0;t<this.children.length;t++){let n=this.children[t];n.style&&e(n)}}onBeforeBeginLoading(){let e=this.getAttribute("dracoDecoderPath");e&&(ae&&console.log("using custom draco decoder path",e),(0,a.C)(e));let t=this.getAttribute("dracoDecoderType");t&&(ae&&console.log("using custom draco decoder type",t),(0,a.w)(t));let n=this.getAttribute("ktx2DecoderPath");n&&(ae&&console.log("using custom ktx2 decoder path",n),(0,a.T)(n))}setAttribute(e,t){super.setAttribute(e,"string"==typeof t?t:String(t))}getAttribute(e){return super.getAttribute(e)}addEventListener(e,t,n){return super.addEventListener(e,t,n)}};var fe=!1;var me=(0,r.Ta)("debugavatar"),ge=class{root;head;leftHand;rigthHand;get isValid(){return null!==this.head&&void 0!==this.head}constructor(e,t,n,i){this.root=e,this.head=t,this.leftHand=n,this.rigthHand=i,this.root?.traverse(e=>e.layers.set(2))}},ve=class{avatarRegistryUrl=null;async getOrCreateNewAvatarInstance(e,t){if(!t)return console.error("Can not create avatar: failed to provide id or root object"),null;let n=null;if("string"==typeof t){if(n=await this.loadAvatar(e,t),!n){let i=new r.Ct;n=r.tt.instantiate((0,r.La)(t,e.scene),i)}}else n=t;if(!n)return null;let i=this.findAvatar(n);return i.isValid?(me&&console.log("[Custom Avatar] valid config",t,me?i:""),i):(console.warn("[Custom Avatar] config isn't valid",t,me?i:""),null)}async loadAvatar(e,t){if(console.assert(null!=t&&"string"==typeof t,"Avatar id must not be null"),t.length<=0||!t)return null;if(me&&console.log("[Custom Avatar] "+t+", loading..."),t.endsWith(".glb")||(t+=".glb"),null===this.avatarRegistryUrl){let n=await fetch("./"+t),i=null;if(n.ok){let e=await n.blob();e&&(i=await e.arrayBuffer())}return i?(await(0,r.vi)().parseSync(e,i,null,0))?.scene??null:null}let n=new s.A;return(0,a.S)(n,e),new Promise((i,o)=>{let s=this.avatarRegistryUrl+"/"+t;n.load(s,async t=>{await(0,r.vi)().createBuiltinComponents(e,s,t,null,void 0),i(t.scene)},e=>{me&&console.log("[Custom Avatar] "+e.loaded/e.total*100+"% loaded of "+e.total/1024+"kB")},e=>{console.error("[Custom Avatar] Error when loading: "+e),i(null)})})}cacheModel(e,t){}findAvatar(e){let t=e,n=t;1==n.children.length&&(n=e.children[0]);let i=this.findAvatarPart(n,["head"]),r=this.findAvatarPart(n,["left","hand"]),s=this.findAvatarPart(n,["right","hand"]);if(!i){i=t;let e=new o.Ar;(new o._).setFromObject(i).getSize(e);let n=Math.max(e.x,e.y,e.z);console.warn("[Custom Avatar] Normalizing head scale, it's too big: "+n+" meters! Should be < 0.3m"),n>.3&&i.scale.multiplyScalar(1/n*.3)}return new ge(t,i,r,s)}findAvatarPart(e,t){let n=e.name.toLowerCase(),i=!0;for(let e of t){if(!i)break;-1===n.indexOf(e)&&(i=!1)}if(i)return e;if(e.children)for(let n of e.children){let e=this.findAvatarPart(n,t);if(e)return e}return null}handleCustomAvatarErrors(e){if(!e.ok)throw Error(e.statusText);return e}},ye=class{get extensionName(){return"DocumentExtension"}onAfterBuildDocument(e){}},be=(0,i.n)({ActionBuilder:()=>a.Q,ActionCollection:()=>l.L,ActionModel:()=>a.$,AlignmentConstraint:()=>l.ct,Animation:()=>a.$t,AnimationCurve:()=>d.w,AnimationExtension:()=>a.Y,AnimationTrackHandler:()=>l.ht,Animator:()=>r.Z,AnimatorController:()=>r.st,Antialiasing:()=>c.h,Attractor:()=>l.E,AudioExtension:()=>a.J,AudioListener:()=>a.Qt,AudioSource:()=>a.Zt,AudioTrackHandler:()=>l.gt,Avatar:()=>a.E,AvatarBlink_Simple:()=>a.jt,AvatarEyeLook_Rotation:()=>a.At,AvatarLoader:()=>ve,AvatarMarker:()=>a.Jt,AvatarModel:()=>ge,Avatar_Brain_LookAt:()=>a.Kt,Avatar_MouthShapes:()=>a.It,Avatar_MustacheShake:()=>a.Ft,Avatar_POI:()=>a.qt,AxesHelper:()=>l.st,BaseUIComponent:()=>r.x,BasicIKConstraint:()=>l.ot,BehaviorExtension:()=>a._,BehaviorModel:()=>a.et,BloomEffect:()=>c.m,BoxCollider:()=>a.Et,BoxGizmo:()=>a.l,BoxHelperComponent:()=>l.at,Button:()=>r.r,CallInfo:()=>r.J,Camera:()=>r.C,CameraTargetReachedEvent:()=>r.T,Canvas:()=>r.s,CanvasGroup:()=>r.o,CapsuleCollider:()=>a.Dt,ChangeMaterialOnClick:()=>a.L,ChangeTransformOnClick:()=>a.R,CharacterController:()=>l.rt,CharacterControllerInput:()=>l.it,ChromaticAberration:()=>c.p,ClickThrough:()=>l.o,ColorAdjustments:()=>c.d,ColorBySpeedModule:()=>d.a,ColorOverLifetimeModule:()=>d.o,ContactShadows:()=>a.wt,ControlTrackHandler:()=>l._t,CursorFollow:()=>l.a,CustomBranding:()=>a.u,Deletable:()=>l.Q,DeleteBox:()=>l.$,DepthOfField:()=>c.u,DeviceFlag:()=>l.Z,DocumentExtension:()=>ye,DragControls:()=>l.X,DropListener:()=>l.U,Duplicatable:()=>l.H,EffectWrapper:()=>c.l,EmissionModule:()=>d.s,EmphasizeOnClick:()=>a.z,EnvironmentScene:()=>l.pt,EventList:()=>r.Y,EventListEvent:()=>r.X,EventSystem:()=>r.D,EventTrigger:()=>l.V,FieldWithDefault:()=>a.lt,FixedJoint:()=>l.N,Fog:()=>l.I,GltfExport:()=>l.z,GltfExportBox:()=>l.B,Gradient:()=>d.c,Graphic:()=>r.h,GraphicRaycaster:()=>r.k,GridHelper:()=>l.F,GridLayoutGroup:()=>
1r.l,GroundProjectedEnv:()=>r.K,GroupActionModel:()=>a.tt,HideOnStart:()=>a.B,HingeJoint:()=>l.P,HorizontalLayoutGroup:()=>r.u,HoverAnimation:()=>l.i,Image:()=>r.i,InheritVelocityModule:()=>d.l,InputField:()=>r.n,InstanceHandle:()=>a.mt,InstancingHandler:()=>a.ht,Interactable:()=>l.et,Keyframe:()=>d.T,LODGroup:()=>l.A,LODModel:()=>l.j,Light:()=>l.M,LimitVelocityOverLifetimeModule:()=>d.u,LogStats:()=>l.nt,LookAt:()=>l.c,LookAtConstraint:()=>r.W,MainModule:()=>d.d,MarkerTrackHandler:()=>l.vt,MaskableGraphic:()=>r.g,MeshCollider:()=>a.Ot,MeshRenderer:()=>a.ut,MinMaxCurve:()=>d.f,MinMaxGradient:()=>d.p,NeedleMenu:()=>a.D,NestedGltf:()=>l.k,Networking:()=>l.O,NoiseModule:()=>d.m,ObjectRaycaster:()=>r.A,OffsetConstraint:()=>l.D,OpenURL:()=>l.s,OrbitControls:()=>r.E,Outline:()=>r._,Padding:()=>r.d,ParticleBurst:()=>d.h,ParticleSubEmitter:()=>d.i,ParticleSystem:()=>d.t,ParticleSystemRenderer:()=>d.n,PhysicsExtension:()=>a.g,PixelationEffect:()=>c.c,PlayAnimationOnClick:()=>a.V,PlayAudioOnClick:()=>a.H,PlayableDirector:()=>l.mt,PlayerColor:()=>l.T,PointerEventData:()=>r.M,PostProcessingHandler:()=>c.n,PreliminaryAction:()=>a.U,PreliminaryTrigger:()=>a.W,RawImage:()=>r.a,Rect:()=>r.v,RectTransform:()=>r.y,ReflectionProbe:()=>a.St,RegisteredAnimationInfo:()=>a.X,RemoteSkybox:()=>l.lt,Renderer:()=>a.dt,RendererLightmap:()=>a.pt,Rigidbody:()=>r.L,RotationBySpeedModule:()=>d.g,RotationOverLifetimeModule:()=>d._,SceneSwitcher:()=>l.dt,ScreenCapture:()=>l.C,ScreenSpaceAmbientOcclusion:()=>c.s,ScreenSpaceAmbientOcclusionN8:()=>c.o,ScrollFollow:()=>l.r,SeeThrough:()=>l.S,SetActiveOnClick:()=>a.G,ShadowCatcher:()=>l.x,ShapeModule:()=>d.v,SharpeningEffect:()=>c.a,SignalAsset:()=>l.wt,SignalReceiver:()=>l.Tt,SignalReceiverEvent:()=>l.Et,SignalTrackHandler:()=>l.yt,Size:()=>r.b,SizeBySpeedModule:()=>d.y,SizeOverLifetimeModule:()=>d.b,SkinnedMeshRenderer:()=>a.ft,SmoothFollow:()=>l.b,SpatialGrabRaycaster:()=>r.j,SpatialHtml:()=>r.t,SpatialTrigger:()=>l.v,SpatialTriggerReceiver:()=>l.y,SpectatorCamera:()=>l._,SphereCollider:()=>a.kt,SplineContainer:()=>l.h,SplineData:()=>l.g,SplineWalker:()=>l.m,Sprite:()=>a.M,SpriteData:()=>a.N,SpriteRenderer:()=>a.P,SpriteSheet:()=>a.F,SubEmitterSystem:()=>d.r,SyncedCamera:()=>l.p,SyncedRoom:()=>l.f,SyncedTransform:()=>r.P,TapGestureTrigger:()=>a.K,TeleportTarget:()=>a.b,TestRunner:()=>l.u,TestSimulateUserData:()=>l.d,Text:()=>r.p,TextBuilder:()=>a.p,TextExtension:()=>a.m,TextureSheetAnimationModule:()=>d.x,TiltShiftEffect:()=>c.i,ToneMappingEffect:()=>c.f,TrailModule:()=>d.S,TransformData:()=>a.Z,TransformGizmo:()=>l.l,TriggerBuilder:()=>a.nt,TriggerModel:()=>a.rt,UIRaycastUtils:()=>r.O,UIRootComponent:()=>r.S,USDZExporter:()=>a.d,USDZText:()=>a.h,USDZUIExtension:()=>a.f,UsageMarker:()=>l.tt,VariantAction:()=>l.R,VelocityOverLifetimeModule:()=>d.C,VerticalLayoutGroup:()=>r.f,VideoPlayer:()=>l.w,ViewBox:()=>l.n,Vignette:()=>c.r,VisibilityAction:()=>a.q,Voip:()=>a.Lt,Volume:()=>c.t,VolumeParameter:()=>c.y,VolumeProfile:()=>c.g,WebARCameraBackground:()=>a.o,WebARSessionRoot:()=>a.j,WebXR:()=>a.v,WebXRImageTracking:()=>a.r,WebXRImageTrackingModel:()=>a.i,WebXRPlaneTracking:()=>a.n,WebXRTrackedImage:()=>a.a,XRControllerFollow:()=>a.c,XRControllerModel:()=>a.x,XRControllerMovement:()=>a.y,XRFlag:()=>a.Mt,XRRig:()=>a.t,XRState:()=>a.Nt,__Ignore:()=>Ee}),Ee=class{},_e=(0,i.n)({$componentName:()=>r.bi,ActionBuilder:()=>a.Q,ActionCollection:()=>l.L,ActionModel:()=>a.$,Addressables:()=>r.Pr,AlignmentConstraint:()=>l.ct,AmbientMode:()=>r.Gn,Animation:()=>a.$t,AnimationCurve:()=>d.w,AnimationExtension:()=>a.Y,AnimationTrackHandler:()=>l.ht,Animator:()=>r.Z,AnimatorConditionMode:()=>r.lt,AnimatorController:()=>r.st,AnimatorControllerParameterType:()=>r.ut,AnimatorStateInfo:()=>r.dt,Antialiasing:()=>c.h,AssetDatabase:()=>r.Vt,AssetReference:()=>r.Fr,Attractor:()=>l.E,AudioExtension:()=>a.J,AudioListener:()=>a.Qt,AudioSource:()=>a.Zt,AudioTrackHandler:()=>l.gt,Avatar:()=>a.E,AvatarBlink_Simple:()=>a.jt,AvatarEyeLook_Rotation:()=>a.At,AvatarLoader:()=>ve,AvatarMarker:()=>a.Jt,AvatarModel:()=>ge,Avatar_Brain_LookAt:()=>a.Kt,Avatar_MouthShapes:()=>a.It,Avatar_MustacheShake:()=>a.Ft,Avatar_POI:()=>a.qt,Axes:()=>r.z,AxesHelper:()=>l.st,BUILD_TIME:()=>r.di,BaseUIComponent:()=>r.x,BasicIKConstraint:()=>l.ot,BehaviorExtension:()=>a._,BehaviorModel:()=>a.et,BlobStorage:()=>r.$r,BloomEffect:()=>c.m,BoxCollider:()=>a.Et,BoxGizmo:()=>a.l,BoxHelperComponent:()=>l.at,Button:()=>r.r,CallDirection:()=>a.zt,CallInfo:()=>r.J,Camera:()=>r.C,CameraTargetReachedEvent:()=>r.T,Canvas:()=>r.s,CanvasGroup:()=>r.o,CapsuleCollider:()=>a.Dt,ChangeMaterialOnClick:()=>a.L,ChangeTransformOnClick:()=>a.R,CharacterController:()=>l.rt,CharacterControllerInput:()=>l.it,ChromaticAberration:()=>c.p,CircularBuffer:()=>r.ga,ClickThrough:()=>l.o,ClipExtrapolation:()=>l.xt,CollisionDetectionMode:()=>r.B,ColorAdjustments:()=>c.d,ColorBySpeedModule:()=>d.a,ColorOverLifetimeModule:()=>d.o,ComponentLifecycleEvents:()=>r.Dn,ConnectionEvents:()=>r.rr,ContactShadows:()=>a.wt,Context:()=>r.in,ContextEvent:()=>r.Ha,ContextRegistry:()=>r.Ua,ControlTrackHandler:()=>l._t,CursorFollow:()=>l.a,CustomBranding:()=>a.u,DefaultReflectionMode:()=>r.Kn,Deletable:()=>l.Q,DeleteBox:()=>l.$,DepthOfField:()=>c.u,DeviceFlag:()=>l.Z,DeviceUtilities:()=>r._a,DocumentExtension:()=>ye,DragControls:()=>l.X,DropListener:()=>l.U,Duplicatable:()=>l.H,EffectWrapper:()=>c.l,EmissionModule:()=>d.s,EmphasizeOnClick:()=>a.z,EngineLoadingView:()=>re,EnvironmentScene:()=>l.pt,EventList:()=>r.Y,EventListEvent:()=>r.X,EventSystem:()=>r.D,EventTrigger:()=>l.V,FieldWithDefault:()=>a.lt,FileReference:()=>r.Ir,FileReferenceSerializer:()=>r.Lr,File_Event:()=>l.J,FixedJoint:()=>l.N,Fog:()=>l.I,FrameEvent:()=>r.an,GENERATOR:()=>r.fi,GltfExport:()=>l.z,GltfExportBox:()=>l.B,Gradient:()=>d.c,Graphic:()=>r.h,GraphicRaycaster:()=>r.k,Graphics:()=>r.Pi,GridHelper:()=>l.F,GridLayoutGroup:()=>
1r.l,GroundProjectedEnv:()=>r.K,GroupActionModel:()=>a.tt,HideFlags:()=>r.xi,HideOnStart:()=>a.B,HingeJoint:()=>l.P,HorizontalLayoutGroup:()=>r.u,HoverAnimation:()=>l.i,Image:()=>r.i,ImageReference:()=>r.Rr,ImageReferenceSerializer:()=>r.zr,InheritVelocityModule:()=>d.l,Input:()=>r.Sr,InputEventQueue:()=>r.Cr,InputEvents:()=>r.wr,InputField:()=>r.n,InstanceHandle:()=>a.mt,InstancingHandler:()=>a.ht,InstantiateEvent:()=>r.pt,InstantiateIdProvider:()=>r.mt,InstantiateOptions:()=>r.Ct,Interactable:()=>l.et,InternalScreenshotUtils:()=>a.s,Keyframe:()=>d.T,LODGroup:()=>l.A,LODModel:()=>l.j,Light:()=>l.M,LightData:()=>r.qn,LimitVelocityOverLifetimeModule:()=>d.u,LogStats:()=>l.nt,LogType:()=>r.ha,LookAt:()=>l.c,LookAtConstraint:()=>r.W,MainModule:()=>d.d,MarkerTrackHandler:()=>l.vt,MarkerType:()=>l.St,MaskableGraphic:()=>r.g,Mathf:()=>r.da,MeshCollider:()=>a.Ot,MeshRenderer:()=>a.ut,MinMaxCurve:()=>d.f,MinMaxGradient:()=>d.p,NEEDLE_ENGINE_FEATURE_FLAGS:()=>r.ui,NEKeyboardEvent:()=>r.Tr,NEPointerEvent:()=>r.Er,NeedleEngine:()=>r.Ua,NeedleEngineWebComponent:()=>he,NeedleMenu:()=>a.D,NeedlePatchesKey:()=>r.wi,NeedleXRController:()=>r.nn,NeedleXRSession:()=>r.$t,NeedleXRSync:()=>r.tn,NeedleXRUtils:()=>a.en,NestedGltf:()=>l.k,NetworkConnection:()=>r.ir,NetworkedStreamEvents:()=>a.Bt,NetworkedStreams:()=>a.Vt,Networking:()=>l.O,NewInstanceModel:()=>r.ht,NoiseModule:()=>d.m,ObjectRaycaster:()=>r.A,ObjectUtils:()=>r.Or,OffsetConstraint:()=>l.D,OneEuroFilter:()=>r.fa,OneEuroFilterXYZ:()=>r.pa,OpenURL:()=>l.s,OrbitControls:()=>r.E,Outline:()=>r._,OwnershipEvent:()=>r.ar,OwnershipModel:()=>r.or,PUBLIC_KEY:()=>r.pi,Padding:()=>r.d,ParticleBurst:()=>d.h,ParticleSubEmitter:()=>d.i,ParticleSystem:()=>d.t,ParticleSystemRenderer:()=>d.n,PeerHandle:()=>a.Ht,PeerNetworking:()=>r.dr,Physics:()=>r.Jt,PhysicsExtension:()=>a.g,PhysicsMaterialCombine:()=>r.V,PixelationEffect:()=>c.c,PlayAnimationOnClick:()=>a.V,PlayAudioOnClick:()=>a.H,PlayableDirector:()=>l.mt,PlayerColor:()=>l.T,PlayerState:()=>a.O,PlayerStateEvent:()=>a.k,PlayerSync:()=>a.A,PlayerView:()=>r.er,PlayerViewManager:()=>r.tr,PointerEventData:()=>r.M,PointerType:()=>r.Dr,PostProcessingEffect:()=>c.v,PostProcessingHandler:()=>c.n,PreliminaryAction:()=>a.U,PreliminaryTrigger:()=>a.W,PreviewHelper:()=>l.Y,PrimitiveType:()=>r.kr,Progress:()=>a.ot,PromiseAllWithErrors:()=>r.va,PromiseErrorResult:()=>r.ya,RGBAColor:()=>r.Sn,RawImage:()=>r.a,RaycastOptions:()=>r.Yt,Rect:()=>r.v,RectTransform:()=>r.y,ReflectionProbe:()=>a.St,RegisteredAnimationInfo:()=>a.X,RemoteSkybox:()=>l.lt,RenderTexture:()=>r.q,RenderTextureSerializer:()=>P,Renderer:()=>a.dt,RendererData:()=>r.Jn,RendererLightmap:()=>a.pt,Rigidbody:()=>r.L,RigidbodyConstraints:()=>r.H,RoomEvents:()=>r.sr,RotationBySpeedModule:()=>d.g,RotationOverLifetimeModule:()=>d._,SceneSwitcher:()=>l.dt,ScreenCapture:()=>l.C,ScreenSpaceAmbientOcclusion:()=>c.s,ScreenSpaceAmbientOcclusionN8:()=>c.o,ScrollFollow:()=>l.r,SeeThrough:()=>l.S,SendQueue:()=>r.ur,SetActiveOnClick:()=>a.G,ShadowCatcher:()=>l.x,ShapeModule:()=>d.v,SharpeningEffect:()=>c.a,SignalAsset:()=>l.wt,SignalReceiver:()=>l.Tt,SignalReceiverEvent:()=>l.Et,SignalTrackHandler:()=>l.yt,Size:()=>r.b,SizeBySpeedModule:()=>d.y,SizeOverLifetimeModule:()=>d.b,SkinnedMeshRenderer:()=>a.ft,SmoothFollow:()=>l.b,SpatialGrabRaycaster:()=>r.j,SpatialHtml:()=>r.t,SpatialTrigger:()=>l.v,SpatialTriggerReceiver:()=>l.y,SpectatorCamera:()=>l._,SphereCollider:()=>a.kt,SphereIntersection:()=>r.Xt,SplineContainer:()=>l.h,SplineData:()=>l.g,SplineWalker:()=>l.m,Sprite:()=>a.M,SpriteData:()=>a.N,SpriteRenderer:()=>a.P,SpriteSheet:()=>a.F,StreamEndedEvent:()=>a.Ut,StreamReceivedEvent:()=>a.Wt,SubEmitterSystem:()=>d.r,SyncedCamera:()=>l.p,SyncedRoom:()=>l.f,SyncedTransform:()=>r.P,TapGestureTrigger:()=>a.K,TeleportTarget:()=>a.b,TestRunner:()=>l.u,TestSimulateUserData:()=>l.d,Text:()=>r.p,TextBuilder:()=>a.p,TextExtension:()=>a.m,TextureSheetAnimationModule:()=>d.x,TiltShiftEffect:()=>c.i,Time:()=>r.Wn,ToneMappingEffect:()=>c.f,TrackHandler:()=>l.bt,TrackType:()=>l.Ct,TrailModule:()=>d.S,TransformData:()=>a.Z,TransformGizmo:()=>l.l,TriggerBuilder:()=>a.nt,TriggerModel:()=>a.rt,UIRaycastUtils:()=>r.O,UIRootComponent:()=>r.S,USDZExporter:()=>a.d,USDZText:()=>a.h,USDZUIExtension:()=>a.f,UriSerializer:()=>x,UsageMarker:()=>l.tt,VERSION:()=>r.mi,VariantAction:()=>l.R,VelocityOverLifetimeModule:()=>d.C,VerticalLayoutGroup:()=>r.f,VideoPlayer:()=>l.w,ViewBox:()=>l.n,ViewDevice:()=>r.nr,Vignette:()=>c.r,VisibilityAction:()=>a.q,Voip:()=>a.Lt,Volume:()=>c.t,VolumeParameter:()=>c.y,VolumeProfile:()=>c.g,WaitForPromise:()=>r.Ar,WaitForSeconds:()=>r.jr,Watch:()=>
1r.ba,WebARCameraBackground:()=>a.o,WebARSessionRoot:()=>a.j,WebXR:()=>a.v,WebXRImageTracking:()=>a.r,WebXRImageTrackingModel:()=>a.i,WebXRPlaneTracking:()=>a.n,WebXRTrackedImage:()=>a.a,XRControllerFollow:()=>a.c,XRControllerModel:()=>a.x,XRControllerMovement:()=>a.y,XRFlag:()=>a.Mt,XRRig:()=>a.t,XRState:()=>a.Nt,XRStateFlag:()=>a.Pt,__Ignore:()=>Ee,__internalNotifyObjectDestroyed:()=>r.Ht,activeInHierarchyFieldName:()=>r.hi,addAttributeChangeCallback:()=>r.xa,addComponent:()=>r.ln,addNewComponent:()=>r.un,addPatch:()=>r.Ti,applyPrototypeExtensions:()=>r.Tn,beginListenDestroy:()=>r.gt,beginListenInstantiate:()=>r._t,binaryIdentifierCasts:()=>r.mr,builtinComponentKeyName:()=>r.gi,calculateProgress01:()=>oe,colorSerializer:()=>h,componentSerializer:()=>m,copyTexture:()=>r.Fi,createMotion:()=>r.ft,debugNet:()=>r.cr,debugOwner:()=>r.lr,deepClone:()=>r.Sa,delay:()=>r.Ca,delayForFrames:()=>r.wa,destroy:()=>r.wt,destroyComponentInstance:()=>r.dn,determineMimeTypeFromExtension:()=>l.W,disposeObjectResources:()=>r.Ut,disposeStream:()=>a.Gt,editorGuidKeyName:()=>r._i,eventListSerializer:()=>g,findByGuid:()=>r.Tt,findObjectOfType:()=>r.fn,findObjectsOfType:()=>r.pn,findResourceUsers:()=>r.Wt,fitCamera:()=>r.G,fitObjectIntoVolume:()=>r.Ii,foreachComponent:()=>r.Et,foreachComponentEnumerator:()=>r.Dt,generateSeed:()=>r.vt,getBoundingBox:()=>r.Li,getComponent:()=>r.mn,getComponentInChildren:()=>r.hn,getComponentInParent:()=>r.gn,getComponents:()=>r._n,getComponentsInChildren:()=>r.vn,getComponentsInParent:()=>r.yn,getFormattedDate:()=>a.st,getIconElement:()=>r.Pn,getIconTexture:()=>r.Fn,getLoader:()=>r.vi,getOrAddComponent:()=>r.bn,getParam:()=>r.Ta,getPeerjsInstance:()=>r.fr,getTempColor:()=>r.Ri,getTempQuaternion:()=>r.zi,getTempVector:()=>r.Bi,getUrlParams:()=>r.Ea,getVisibleInCustomShadowRendering:()=>r.Vi,getWorldDirection:()=>r.Hi,getWorldEuler:()=>r.Ui,getWorldPosition:()=>r.Wi,getWorldQuaternion:()=>r.Gi,getWorldRotation:()=>r.Ki,getWorldScale:()=>r.qi,hasPointerEventComponent:()=>r.N,initAddressableSerializers:()=>r.Br,initBuiltinSerializers:()=>O,initVolumeParameterSerializer:()=>c.b,instantiate:()=>r.Ot,invokeLoadedImportPluginHooks:()=>a.gt,invokeXRSessionEnd:()=>r.Rn,invokeXRSessionStart:()=>r.zn,isActiveInHierarchy:()=>r.kt,isActiveSelf:()=>r.At,isAnimationAction:()=>r.Ji,isComponent:()=>r.Si,isDestroyed:()=>r.jt,isGLTFModel:()=>r.Ci,isHostedOnGlitch:()=>r.Ba,isHotReloadEnabled:()=>r.nt,isIconElement:()=>r.In,isLocalNetwork:()=>r.Va,isResourceTrackingEnabled:()=>r.Gt,isUsingInstancing:()=>r.Mt,logHierarchy:()=>r.Yi,lookAtObject:()=>r.Xi,makeIdFromRandomWords:()=>r.Da,markAsInstancedRendered:()=>r.Nt,objectSerializer:()=>f,onAfterRender:()=>r.ni,onBeforeRender:()=>r.ri,onClear:()=>r.ii,onDestroy:()=>r.ai,onInitialized:()=>r.oi,onStart:()=>r.si,onUpdate:()=>r.ci,onXRSessionEnd:()=>r.Bn,onXRSessionStart:()=>r.Vn,placeOnSurface:()=>r.Zi,postprocessFBXMaterials:()=>r.Qi,pushState:()=>r.Oa,registerBinaryType:()=>r.hr,registerComponent:()=>r.on,registerComponentExtension:()=>a._t,registerCustomEffectType:()=>c._,registerExportExtensions:()=>a.vt,registerExtensions:()=>a.yt,registerHotReloadType:()=>r.rt,registerLoader:()=>r.yi,registerPrefabProvider:()=>r.yt,registerPrototypeExtensions:()=>r.En,relativePathPrefix:()=>r.ka,removeAttributeChangeCallback:()=>r.Aa,removeComponent:()=>r.xn,resolveUrl:()=>r.ja,sanitizeString:()=>r.Ma,sendDestroyed:()=>r.bt,setActive:()=>r.Pt,setDestroyed:()=>r.Ft,setDisposable:()=>r.Kt,setDontDestroy:()=>r.It,setOrAddParamsToUrl:()=>r.Na,setParamWithoutReload:()=>r.Pa,setState:()=>r.Fa,setVisibleInCustomShadowRendering:()=>r.$i,setWorldEuler:()=>r.ea,setWorldPosition:()=>r.ta,setWorldPositionXYZ:()=>r.na,setWorldQuaternion:()=>r.ra,setWorldQuaternionXYZW:()=>r.ia,setWorldRotation:()=>r.aa,setWorldRotationXYZ:()=>r.oa,setWorldScale:()=>r.sa,showBalloonError:()=>r.Ai,showBalloonMessage:()=>r.ji,showBalloonWarning:()=>r.Mi,slerp:()=>r.ca,syncDestroy:()=>r.xt,syncInstantiate:()=>r.St,toSourceId:()=>r.Ia,tryCastBinary:()=>r.gr,tryDetermineMimetypeFromBinary:()=>l.G,tryDetermineMimetypeFromURL:()=>l.K,tryFindObject:()=>r.La,tryGetGuid:()=>r._r,unregisterHotReloadType:()=>r.it,unwatchWrite:()=>r.Ra,watchWrite:()=>r.za});fe||(fe=!0,typeof window>"u"||(window.customElements.get("needle-engine")||window.customElements.define("needle-engine",he),window.customElements.get("needle-button")||window.customElements.define("needle-button",K),window.customElements.get("needle-logo-element")||window.customElements.define("needle-logo-element",r.On),window.customElements.get("needle-menu")||window.customElements.define("needle-menu",r.cn)),(0,a.ct)(),O(),(0,r.Br)(),(0,r.ct)(),(0,c.b)(),(0,r.Un)(),(0,a.Tt)(),q||(q=!0,Object.defineProperty(o.gn.prototype,"fov",{get:function(){return this._fov},set:function(e){let t=e!==this._fov;this._fov=e,t&&void 0!==this.view&&this.updateProjectionMatrix()},configurable:!0}),Object.defineProperty(o.gn.prototype,"near",{get:function(){return this._near},set:function(e){let t=e!==this._near;this._near=e,t&&void 0!==this.view&&this.updateProjectionMatrix()},configurable:!0}),Object.defineProperty(o.gn.prototype,"far",{get:function(){return this._far},set:function(e){let t=e!==this._far;this._far=e,t&&void 0!==this.view&&this.updateProjectionMatrix()},configurable:!0})),(0,r.wn)(),Z||(Z=!0,o.Ar.prototype.slerp=function(e,t){return(0,r.ca)(this,e,t)},(0,r.En)(o.Ar)),(0,l.t)(),(0,r.yi)(V),setTimeout(p,1e3),T||(T=!0,r.Ua.registerCallback(r.Ha.MissingCamera,e=>{A&&console.warn("Creating missing camera");let t=e.context.scene,n=new o.gn;n.name="Default Fallback Camera",t.add(n);let i=new r.C;if(i.sourceId=e.files?.[0]?.src??"unknown",i.fieldOfView=35,null!=e.context.domElement.getAttribute("transparent"))i.clearFlags=r.w.Uninitialized;else if(e.context.domElement.getAttribute("background-image")?.length||e.context.lightmaps.tryGetSkybox(i.sourceId)
1)i.clearFlags=r.w.Skybox;else{if(i.clearFlags=r.w.SolidColor,!e.context.domElement.getAttribute("background-color")){let e="#efefef";window.matchMedia("(prefers-color-scheme: dark)").matches&&(e="#1f1f1f"),t.background=new o.A(e)}if(!t.environment){let n=new o.hn(e.context.renderer),i=new l.pt("neutral");t.environment=n.fromScene(i,.025).texture}}let s=(0,r.un)(n,i,!0);return n.position.x=0,n.position.y=1,n.position.z=2,0!=e.context.domElement?.cameraControls&&M(e.context,s),s}),r.Ua.registerCallback(r.Ha.ContextCreated,e=>{if(e.context.mainCamera){if(1==e.context.domElement?.cameraControls){if(1==(0,r.la)(e.context.mainCamera)?.isCameraController)return void(A&&console.log("Will not auto-fit because a camera controller exists"));M(e.context)}}else A&&console.log("Will not auto-fit because a default camera exists")})),R||(R=!0,r.Ua.registerCallback(r.Ha.ContextCreated,e=>{let t=e.context.domElement.getAttribute("autoplay");if(void 0!==t&&(""===t||"true"===t||"1"===t)&&e.files)for(let t of e.files)!0!==r.tt.foreachComponent(t.file.scene,e=>{if(!1!==e.enabled){if(e instanceof a.$t&&e.playAutomatically||e instanceof r.Z||e instanceof l.mt&&!0===e.playOnAwake)return!0;if(e instanceof a.$t)return e.playAutomatically=!0,!0;if(e instanceof l.mt)return e.playOnAwake=!0,!0}},!0)&&r.Di.autoplayAnimations(t.file)})),(0,l.ut)(),(0,l.ft)(),(0,r.Ni)());var Se={VERSION:r.mi,Context:r.in,NeedleXRSession:r.$t,assets:{loadFromURL:function(e,t){return W(t?.context||r.in.Current,e,e,t?.seed||null,t?.onprogress)}},types:r.Oi,onStart:r.si,onUpdate:r.ci,onBeforeRender:r.ri,onAfterRender:r.ni,onInitializedContext:r.oi,onDestroyContext:r.ai,onClearContext:r.ii};function Ce(e){for(let t in e)Se[t]=e[t]}void 0!==globalThis.Needle?.VERSION&&console.warn(`Needle Engine is already imported: ${globalThis.Needle.VERSION}`),Ce(r.et),Ce(be);for(let e of Object.getOwnPropertyNames(r.tt))switch(e){case"prototype":case"constructor":case"length":case"name":continue;default:Se[e]=r.tt[e]}if(globalThis.Needle)for(let e in Se)globalThis.Needle[e]=Se[e];else globalThis.Needle=Se;globalThis.THREE?console.warn("Three.js is already imported"):globalThis.THREE=o.Rr;var Pe=(0,i.n)({GenerateMeshBVHWorker:()=>xe}),xe=class extends u.t{constructor(){super(new Worker(new URL(""+new URL(n(21198),n.b).href,"file:///build_root/build/audemarspiguetprogram-p85452-uk93928/ap-com/ap-com-ui/ap-com-ui-app-package/node_modules/@audemarspiguet/needle-3d-players/players/26450CB_OO_1356CB_02/dist/assets/needle-engine.ByNVmY66.js"),{type:"module"})),this.name="GenerateMeshBVHWorker"}runTask(e,t,n={}){return new Promise((i,r)=>{if(t.getAttribute("position").isInterleavedBufferAttribute||t.index&&t.index.isInterleavedBufferAttribute)throw Error("GenerateMeshBVHWorker: InterleavedBufferAttribute are not supported for the geometry attributes.");e.onerror=e=>{r(Error(`[GenerateMeshBVHWorker] ${e.message||"Could not load worker."}`))},e.onmessage=s=>{let{data:a}=s;if(a.error)r(Error(a.error)),e.onmessage=null;else if(a.serialized){let{serialized:r,position:s}=a,l=u.r.deserialize(r,t,{setIndex:!1}),c=Object.assign({setBoundingBox:!0},n);if(t.attributes.position.array=s,r.index)if(t.index)t.index.array=r.index;else{let e=new o.x(r.index,1,!1);t.setIndex(e)}c.setBoundingBox&&(t.boundingBox=l.getBoundingBox(new o._)),n.onProgress&&n.onProgress(a.progress),i(l),e.onmessage=null}else n.onProgress&&n.onProgress(a.progress)};let s=t.index?t.index.array:null,a=t.attributes.position.array,l=[a];s&&l.push(s),e.postMessage({index:s,position:a,options:{...n,onProgress:null,includedProgressCallback:!!n.onProgress,groups:[...t.groups]}},l.map(e=>e.buffer).filter(e=>typeof SharedArrayBuffer>"u"||!(e instanceof SharedArrayBuffer)))})}}},54386:function(e,t,n){n.c[n.s];n.d(t,{_:function(){return L},a:function(){return de},b:function(){return d},c:function(){return ne},d:function(){return Q},f:function(){return q},g:function(){return I},h:function(){return U},i:function(){return pe},l:function(){return te},m:function(){return F},n:function(){return be},o:function(){return le},p:function(){return G},r:function(){return fe},s:function(){return oe},t:function(){return Se},u:function(){return ee},v:function(){return T},y:function(){return l}});var i=n(26993),o=n(28329),r=n(5100),s=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},a=(0,o.Ta)("debugpost"),l=class{isVolumeParameter=!0;constructor(e){void 0!==e&&this.initialize(e)}_isInitialized=!1;get isInitialized(){return this._isInitialized}initialize(e){void 0!==e&&(this._value=e,this._defaultValue=e,this._valueRaw=e,this._isInitialized=!0)}get overrideState(){return this._active}set overrideState(e){if(this._active===e)return;this._active=e;let t=e?this._valueRaw:this._defaultValue;this.processValue(t,!0)}_active=!0;get value(){return this._valueRaw}set value(e){this.isInitialized||this.initialize(e),this.processValue(e,!1)}_value;_valueRaw;set defaultValue(e){this._defaultValue=e}_defaultValue=void 0;__init(){this.processValue(this._valueRaw,!0)}valueProcessor;onValueChanged;processValue(e,t){if(null==e||!t&&!1===this.testIfValueChanged(e))return;let n=this._value;a&&"number"==typeof n&&"number"==typeof e&&(n?.toFixed(4),e?.toFixed(4)),this._active||void 0===this._defaultValue?(this._valueRaw=e,this._active&&this.valueProcessor&&(e=this.valueProcessor(e)),this._value=e):(this._value=this._defaultValue,e=this._defaultValue,this._valueRaw=e),this.onValueChanged&&this.onValueChanged(e,n,this)}
1testIfValueChanged(e){return this._valueRaw!==e}};s([(0,o.at)()],l.prototype,"overrideState",null),s([(0,o.at)()],l.prototype,"value",null);var c=class extends o.Ur{constructor(){super([l])}onSerialize(e,t){}onDeserialize(e,t){let n,i=t.target,o=t.path;if(i&&o&&(n=i[o]),("object"!=typeof n||"object"==typeof n&&!0!==n.isVolumeParameter)&&(n=new l),"object"==typeof e&&"value"in e){let t=e.value;n.initialize(t),n.overrideState=e.overrideState}else n.value=e;return n}};function d(){new c}var u=(0,o.Ta)("debugpost"),p=null;function h(e){let t=e.gameObject;for(;t;){for(let e of(0,o.Dt)(t))if(!0===e.isPostProcessingManager)return e;t=t.parent}return null}var f=0,m=10,g=20,v=30,y=40,b=50,E=60,_=70,S=80,C=90,P=100,x=110,w=120,O=130,R=null;var A=(0,o.Ta)("debugpost"),T=class extends o.${get isPostProcessingEffect(){return!0}order=void 0;constructor(e=void 0){if(super(),e)for(let t of Object.keys(e)){let n=e[t],i=this[t];i instanceof l?i.initialize(n):void 0!==i&&(this[t]=n)}}active=!0;_manager=null;onEnable(){super.onEnable(),A&&console.warn("Enable",this.constructor.name+(this.__internalDidAwakeAndStart?"":" (awake)")),this.__internalDidAwakeAndStart&&(this.active=!0),this.onEffectEnabled()}onDisable(){super.onDisable(),A&&console.warn("Disable",this.constructor.name),this._manager?.removeEffect(this),this.active=!1}onEffectEnabled(e){e&&!0===e.isPostProcessingManager?this._manager=e:this._manager||=function(e){let t=h(e);if(!t)if(p){u&&console.warn("Adding postprocessing manager to the scene.");let n=e.scene;t=(0,o.ln)(n,p)}else(0,o.ma)()&&console.warn("No post processing manager found");return t}(this),this._manager.addEffect(this),this._manager.dirty=!0}init(){}_result;_postprocessingContext=null;get postprocessingContext(){return this._postprocessingContext}apply(e){return this._postprocessingContext=e,this._result||=(this.initParameters(),this.onCreateEffect?.call(this)),this._result&&this.initParameters(),this._result}unapply(){}dispose(){A&&console.warn("DISPOSE",this),this._result&&(Array.isArray(this._result)?this._result.forEach(e=>e.dispose()):this._result.dispose()),this._result=void 0}initParameters(){let e=Object.keys(this);for(let t of e){let e=this[t];e instanceof l&&e.__init()}}onEditorModification(e){let t=e.propertyName;if(this[t]instanceof l){let n=e.value;return this[t].value=n,!0}}};!function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);r>3&&s&&Object.defineProperty(t,n,s)}([(0,o.at)()],T.prototype,"active",void 0);var M=(0,o.Ta)("debugpost"),D={};function L(e,t){D[e]=t}var I=class{components=[];__init(e){this.components?.forEach(t=>{void 0===t.gameObject&&e.gameObject.addComponent(t),t.init()})}addEffect(e){this.components.push(e)}removeEffect(e){let t=this.components.indexOf(e);t>=0&&this.components.splice(t,1)}};!function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);r>3&&s&&Object.defineProperty(t,n,s)}([(0,o.ot)([e=>function(e){return e.__type in D?D[e.__type]:(M&&e.__type&&console.warn("Unknown postprocessing type",e.__type,e),T)}(e),T])],I.prototype,"components",void 0);var k,N,B=(0,o.Ta)("debugpost");(N=k||={})[N.LOW=0]="LOW",N[N.MEDIUM=1]="MEDIUM",N[N.HIGH=2]="HIGH",N[N.ULTRA=3]="ULTRA";var U=class extends T{get typeName(){return"Antialiasing"}preset=new l(2);onCreateEffect(){let e=new o.pr.POSTPROCESSING.MODULE.SMAAEffect({preset:this.preset?.value??o.pr.POSTPROCESSING.MODULE.SMAAPreset.HIGH,edgeDetectionMode:o.pr.POSTPROCESSING.MODULE.EdgeDetectionMode.LUMA});return this.preset.onValueChanged=t=>{B&&console.log("Antialiasing preset changed to",t),e.applyPreset(t)},e}};(function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);r>3&&s&&Object.defineProperty(t,n,s)})([(0,o.at)(l)],U.prototype,"preset",void 0),L("Antialiasing",U);var j=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},F=class e extends T{static useSelectiveBloom=!1;get typeName(){return"Bloom"}threshold=new l(.9);intensity=new l(1);scatter=new l(.7);selectiveBloom;init(){this.threshold.valueProcessor=e=>e,this.intensity.valueProcessor=e=>e,this.scatter.valueProcessor=e=>e}
1onCreateEffect(){let t;if(this.selectiveBloom??=e.useSelectiveBloom,this.selectiveBloom){(t=new o.pr.POSTPROCESSING.MODULE.SelectiveBloomEffect(this.context.scene,this.context.mainCamera,{blendFunction:o.pr.POSTPROCESSING.MODULE.BlendFunction.ADD,mipmapBlur:!0,luminanceThreshold:this.threshold.value,luminanceSmoothing:this.scatter.value,radius:.85,intensity:this.intensity.value})).inverted=!0}else t=new o.pr.POSTPROCESSING.MODULE.BloomEffect({blendFunction:o.pr.POSTPROCESSING.MODULE.BlendFunction.ADD,mipmapBlur:!0,luminanceThreshold:this.threshold.value,luminanceSmoothing:this.scatter.value,radius:.85,intensity:this.intensity.value});return this.intensity.onValueChanged=e=>{t.intensity=e},this.threshold.onValueChanged=e=>{t.luminanceMaterial.threshold=e**2.2},this.scatter.onValueChanged=e=>{t.luminancePass.enabled=!0,t.luminanceMaterial.smoothing=e,t.mipmapBlurPass&&(t.mipmapBlurPass.radius=i.Jt.lerp(.1,.9,e))},t}};j([(0,o.at)(l)],F.prototype,"threshold",void 0),j([(0,o.at)(l)],F.prototype,"intensity",void 0),j([(0,o.at)(l)],F.prototype,"scatter",void 0),L("Bloom",F);var V,G=class extends T{get typeName(){return"ChromaticAberration"}intensity=new l(0);onCreateEffect(){let e=new o.pr.POSTPROCESSING.MODULE.ChromaticAberrationEffect;return e.offset=new i.kr(0,0),e.radialModulation=!0,e.modulationOffset=.15,this.intensity.valueProcessor=e=>.02*e,this.intensity.onValueChanged=t=>{e.offset.x=-t,e.offset.y=t},e}};(function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);r>3&&s&&Object.defineProperty(t,n,s)})([(0,o.at)(l)],G.prototype,"intensity",void 0),L("ChromaticAberration",G),function(e){e[e.None=0]="None",e[e.Neutral=1]="Neutral",e[e.ACES=2]="ACES",e[e.AgX=3]="AgX",e[e.KhronosNeutral=4]="KhronosNeutral"}(V||={});var z=new Map;function H(e){switch(e){case V.None:return 1;case V.Neutral:return 2;case V.ACES:return 4;case V.AgX:return 6;case V.KhronosNeutral:return 7;default:return z.has(e)||(z.set(e,!0),console.warn("[Postprocessing] Unknown tone mapping mode",e)),7}}function W(e){switch(e){case 1:default:return o.pr.POSTPROCESSING.MODULE.ToneMappingMode.LINEAR;case 4:return o.pr.POSTPROCESSING.MODULE.ToneMappingMode.ACES_FILMIC;case 6:return o.pr.POSTPROCESSING.MODULE.ToneMappingMode.AGX;case 7:return o.pr.POSTPROCESSING.MODULE.ToneMappingMode.NEUTRAL;case 2:return o.pr.POSTPROCESSING.MODULE.ToneMappingMode.REINHARD}}var $=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},X=(0,o.Ta)("debugpost"),q=class extends T{get typeName(){return"ToneMapping"}mode=new l(void 0);exposure=new l(1);setMode(e){let t=V[e];return void 0===t?(console.error("[PostProcessing] Invalid ToneMapping mode",e),this):(this.mode.value=t,this)}get isToneMapping(){return!0}onEffectEnabled(){let e=h(this);e&&super.onEffectEnabled(e)}_tonemappingEffect=null;onCreateEffect(){if(0==this.mode.isInitialized){let e=function(e){switch(e){case 1:default:return V.None;case 4:return V.ACES;case 6:return V.AgX;case 7:case 2:return V.Neutral}}(this.context.renderer.toneMapping);X&&console.log("[PostProcessing] Initializing ToneMapping mode to renderer.toneMapping",this.context.renderer.toneMapping+" → "+e),this.mode.initialize(e)}this._tonemappingEffect?.dispose();let e=H(this.mode.value),t=this._tonemappingEffect=new o.pr.POSTPROCESSING.MODULE.ToneMappingEffect({mode:W(e)});return this.mode.onValueChanged=n=>{"string"==typeof n?(n=(0,o.Hn)(n),t.mode=W(n)):t.mode=W(H(n)),t.name="ToneMapping ("+V[n]+")",X&&console.log("[PostProcessing] ToneMapping mode changed to",V[n],e,t.mode)},X&&console.log("[PostProcessing] Use ToneMapping",V[this.mode.value],e,t.mode,"renderer.tonemapping: "+this.context.renderer.toneMapping),t}
1onBeforeRender(){if(this._tonemappingEffect&&this.postprocessingContext?.handler.getEffectIsActive(this._tonemappingEffect)&&(this.mode.overrideState&&(this.context.renderer.toneMapping=H(this.mode.value)),this.exposure.overrideState&&void 0!==this.exposure.value)){let e=Math.max(0,this.exposure.value);this.context.renderer.toneMappingExposure=e}}};$([(0,o.at)(l)],q.prototype,"mode",void 0),$([(0,o.at)(l)],q.prototype,"exposure",void 0),L("Tonemapping",q);var Z=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},Q=class extends T{get typeName(){return"ColorAdjustments"}remap=!0;postExposure=new l(1);contrast=new l(0);hueShift=new l(0);saturation=new l(0);init(){this.postExposure.valueProcessor=e=>(this.remap&&(e=2**e),e),this.contrast.valueProcessor=e=>{if(!this.remap)return e;let t=1;return e>0?t=200:e<0&&(t=100),e/t},this.contrast.defaultValue=0,this.hueShift.valueProcessor=e=>this.remap?Math.PI*e/180:e,this.hueShift.defaultValue=0,this.saturation.valueProcessor=e=>this.remap?e<0?e/100:e/(100*Math.PI):e,this.saturation.defaultValue=0}onCreateEffect(){let e=[],t=this.postprocessingContext?.components.find(e=>e instanceof q);t||(t=new q,this.postprocessingContext?.components.push(t)),this.postExposure.onValueChanged=e=>{this.postExposure.overrideState&&t?t.exposure.value=e:console.warn("[PostProcessing] PostExposure is set to override but no ToneMappingEffect found in the postprocessing stack. Please add a ToneMappingEffect to your postprocessing stack to use PostExposure.")};let n=new o.pr.POSTPROCESSING.MODULE.BrightnessContrastEffect;this.contrast.onValueChanged=e=>n.contrast=e;let i=new o.pr.POSTPROCESSING.MODULE.HueSaturationEffect;return this.hueShift.onValueChanged=e=>i.hue=e,this.saturation.onValueChanged=e=>i.saturation=e,e.push(n),e.push(i),e}};Z([(0,o.at)(l)],Q.prototype,"postExposure",void 0),Z([(0,o.at)(l)],Q.prototype,"contrast",void 0),Z([(0,o.at)(l)],Q.prototype,"hueShift",void 0),Z([(0,o.at)(l)],Q.prototype,"saturation",void 0),L("ColorAdjustments",Q);var K,Y=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s};!function(e){e[e.Off=0]="Off",e[e.Gaussian=1]="Gaussian",e[e.Bokeh=2]="Bokeh"}(K||={});var J=(0,o.Ta)("debugpost"),ee=class extends T{get typeName(){return"DepthOfField"}mode;focusDistance=new l(1);focalLength=new l(.2);aperture=new l(20);gaussianMaxRadius=new l;resolutionScale=new l(1/window.devicePixelRatio);bokehScale=new l;init(){this.focalLength.valueProcessor=e=>{let t=e/300;return o.da.lerp(2,.01,t)},this.aperture.valueProcessor=e=>{let t=1-e/32;return o.da.lerp(1,20,t)}}onCreateEffect(){if(this.mode===K.Off)return void(J&&console.warn("DepthOfField: Mode is set to Off"));let e=new o.pr.POSTPROCESSING.MODULE.DepthOfFieldEffect(this.context.mainCamera,{worldFocusRange:.2,focalLength:1,bokehScale:20,resolutionScale:this.resolutionScale.value});return this.focusDistance.onValueChanged=t=>{e.cocMaterial.worldFocusDistance=t},this.focalLength.onValueChanged=t=>e.cocMaterial.worldFocusRange=t,this.aperture.onValueChanged=t=>e.bokehScale=t,this.resolutionScale&&(this.resolutionScale.onValueChanged=t=>e.resolution.scale=t),[e]}unapply(){}};Y([(0,o.at)()],ee.prototype,"mode",void 0),Y([(0,o.at)(l)],ee.prototype,"focusDistance",void 0),Y([(0,o.at)(l)],ee.prototype,"focalLength",void 0),Y([(0,o.at)(l)],ee.prototype,"aperture",void 0),Y([(0,o.at)(l)],ee.prototype,"gaussianMaxRadius",void 0),Y([(0,o.at)(l)],ee.prototype,"resolutionScale",void 0),Y([(0,o.at)(l)],ee.prototype,"bokehScale",void 0),L("DepthOfField",ee);var te=class extends T{effect;constructor(e){super(),this.effect=e}get typeName(){return this.effect.constructor.name}
1onCreateEffect(){return this.effect}},ne=class extends T{get typeName(){return"PixelationEffect"}granularity=new l(10);onCreateEffect(){let e=new o.pr.POSTPROCESSING.MODULE.PixelationEffect;return this.granularity.onValueChanged=t=>{e.granularity=t},e}};(function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);r>3&&s&&Object.defineProperty(t,n,s)})([(0,o.at)(l)],ne.prototype,"granularity",void 0),L("PixelationEffect",ne);var ie=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},oe=class extends T{get typeName(){return"ScreenSpaceAmbientOcclusion"}intensity=new l(2);falloff=new l(1);samples=new l(9);color=new l(new i.A(0,0,0));luminanceInfluence=new l(.7);
1onBeforeRender(){if(this._ssao&&this.context.mainCamera instanceof i.gn){let e=this.context.mainCamera.far-this.context.mainCamera.near;this._ssao.ssaoMaterial.worldDistanceFalloff=.01*e,this._ssao.ssaoMaterial.worldDistanceThreshold=this.context.mainCamera.far}}_ssao;onCreateEffect(){let e=this.context.mainCamera,t=new o.pr.POSTPROCESSING.MODULE.NormalPass(this.context.scene,e),n=new o.pr.POSTPROCESSING.MODULE.DepthDownsamplingPass({normalBuffer:t.texture,resolutionScale:.5}),r=this._ssao=new o.pr.POSTPROCESSING.MODULE.SSAOEffect(e,t.texture,{normalDepthBuffer:n.texture,worldDistanceThreshold:1,worldDistanceFalloff:1,worldProximityThreshold:.1,worldProximityFalloff:2,intensity:1,blendFunction:o.pr.POSTPROCESSING.MODULE.BlendFunction.MULTIPLY,luminanceInfluence:.5});this.intensity.onValueChanged=e=>{r.intensity=e},this.falloff.onValueChanged=e=>{r.ssaoMaterial.radius=.1*e},this.samples.onValueChanged=e=>{r.ssaoMaterial.samples=e},this.color.onValueChanged=e=>{r.color||=new i.A,r.color.copy(e)},this.luminanceInfluence.onValueChanged=e=>{r.luminanceInfluence=e};let s=[];return s.push(t),s.push(n),s.push(r),s}};ie([(0,o.at)(l)],oe.prototype,"intensity",void 0),ie([(0,o.at)(l)],oe.prototype,"falloff",void 0),ie([(0,o.at)(l)],oe.prototype,"samples",void 0),ie([(0,o.at)(l)],oe.prototype,"color",void 0),ie([(0,o.at)(l)],oe.prototype,"luminanceInfluence",void 0),L("ScreenSpaceAmbientOcclusion",oe);var re,se=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},ae=(0,o.Ta)("debugN8AO");!function(e){e[e.Performance=0]="Performance",e[e.Low=1]="Low",e[e.Medium=2]="Medium",e[e.High=3]="High",e[e.Ultra=4]="Ultra"}(re||={});var le=class extends T{get typeName(){return"ScreenSpaceAmbientOcclusionN8"}get pass(){return this._ssao}gammaCorrection=!0;aoRadius=new l(1);falloff=new l(1);intensity=new l(1);color=new l(new i.A(0,0,0));screenspaceRadius=!1;quality=re.Medium;_ssao;onValidate(){this._ssao&&(this._ssao.setQualityMode(re[this.quality]),this._ssao.configuration.gammaCorrection=this.gammaCorrection,this._ssao.configuration.screenSpaceRadius=this.screenspaceRadius)}onCreateEffect(){let e=this.context.mainCamera,t=this.context.domWidth,n=this.context.domHeight,r=this._ssao=new o.pr.POSTPROCESSING_AO.MODULE.N8AOPostPass(this.context.scene,e,t,n);r.name="SSAO_N8";let s=re[this.quality];if(r.setQualityMode(s),r.configuration.transparencyAware=!1,r.configuration.halfRes=window.devicePixelRatio>1,r.effectCompositerQuad?.material){let e=r.effectCompositerQuad.material;e.fragmentShader=e.fragmentShader.replace("if (depth == 1.0) {\n            texel = vec4(0.0, 0.0, 0.0, 1.0);","if (depth == 1.0) {\n            gl_FragColor = sceneTexel;\n            return;"),e.needsUpdate=!0}let a=new i.Fr(t,n);return r.configuration.beautyRenderTarget=a,r.configuration.autoRenderBeauty=!1,r.configuration.gammaCorrection=this.gammaCorrection,r.configuration.screenSpaceRadius=this.screenspaceRadius,ae&&(r.enableDebugMode(),console.log(r),setInterval(()=>{console.log("SSAO",r.lastTime)},1e3),setInterval(()=>{console.log("SSAO",r.enabled,{ssao:r,autoRenderBeauty:r.configuration.autoRenderBeauty})},4e3)),this.intensity.onValueChanged=e=>{r.configuration.intensity=e},this.falloff.onValueChanged=e=>{r.configuration.distanceFalloff=e},this.aoRadius.onValueChanged=e=>{r.configuration.aoRadius=e},this.color.onValueChanged=e=>{r.color||=new i.A,r.configuration.color.copy(e)},r}};se([(0,o.R)(),(0,o.at)()],le.prototype,"gammaCorrection",void 0),se([(0,o.at)(l)],le.prototype,"aoRadius",void 0),se([(0,o.at)(l)],le.prototype,"falloff",void 0),se([(0,o.at)(l)],le.prototype,"intensity",void 0),se([(0,o.at)(l)],le.prototype,"color",void 0),se([(0,o.R)(),(0,o.at)()],le.prototype,"screenspaceRadius",void 0),se([(0,o.R)(),(0,o.at)()],le.prototype,"quality",void 0),L("ScreenSpaceAmbientOcclusionN8",le);var ce=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},de=class extends T{get typeName(){return"Sharpening"}order=O;_effect;
1onCreateEffect(){return this._effect??=new(function(){class e extends o.pr.POSTPROCESSING.MODULE.Effect{constructor(){super("Sharpening","\n    uniform sampler2D tDiffuse;\n    uniform float amount;\n    uniform float radius;\n    \n    void mainImage(const in vec4 inputColor, const in vec2 uv, out vec4 outputColor) {\n        float tx = 1.0 / resolution.x;\n        float ty = 1.0 / resolution.y;\n        vec2 texelSize = vec2(tx, ty);\n    \n        vec4 blurred = vec4(0.0);\n        float total = 0.0;\n    \n        for (float x = -radius; x <= radius; x++) {\n            for (float y = -radius; y <= radius; y++) {\n                vec2 offset = vec2(x, y) * texelSize;\n                vec4 diffuse = texture2D(tDiffuse, uv + offset);\n                float weight = exp(-length(offset) * amount);\n                blurred += diffuse * weight;\n                total += weight;\n            }\n        }\n    \n        if (total > 0.0) {\n            blurred /= total;\n        }\n    \n        // Calculate the sharpened color using inputColor\n        vec4 sharp = inputColor + clamp(inputColor - blurred, 0.0, 1.0) * amount;\n        // Keep original alpha\n        sharp.a = inputColor.a;\n    \n        // Ensure the sharp color does not go below 0 or above 1\n        // This means: sharpening must happen AFTER tonemapping.\n        sharp = clamp(sharp, 0.0, 1.0);\n    \n        outputColor = sharp;\n    }\n    \n    ",{vertexShader:"\n      void mainSupport() {\n        vUv = uv;\n        gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n      }\n    ",blendFunction:o.pr.POSTPROCESSING.MODULE.BlendFunction.NORMAL,uniforms:new Map([["amount",new i.xr(1)],["radius",new i.xr(1)]]),attributes:r.t.CONVOLUTION})}}return e}()),this.effect}get effect(){return this._effect}set amount(e){this._amount=e,this._effect&&(this._effect.uniforms.get("amount").value=e)}get amount(){return this._effect?this._effect.uniforms.get("amount").value:this._amount}_amount=1;set radius(e){this._radius=e,this._effect&&(this._effect.uniforms.get("radius").value=e)}get radius(){return this._effect?this._effect.uniforms.get("radius").value:this._radius}_radius=1};ce([(0,o.at)()],de.prototype,"amount",null),ce([(0,o.at)()],de.prototype,"radius",null);var ue=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},pe=class extends T{get typeName(){return"TiltShiftEffect"}offset=new l(0);rotation=new l(0);focusArea=new l(.4);feather=new l(.3);kernelSize=new l(2);resolutionScale=new l(1/window.devicePixelRatio);init(){this.offset.defaultValue=0,this.rotation.defaultValue=0,this.focusArea.defaultValue=.4,this.feather.defaultValue=.3,this.kernelSize.defaultValue=o.pr.POSTPROCESSING.MODULE.KernelSize.MEDIUM,this.resolutionScale.defaultValue=1/window.devicePixelRatio}onCreateEffect(){let e=new o.pr.POSTPROCESSING.MODULE.TiltShiftEffect({kernelSize:o.pr.POSTPROCESSING.MODULE.KernelSize.VERY_LARGE,offset:this.offset.value,rotation:this.rotation.value,focusArea:this.focusArea.value,feather:this.feather.value});return this.offset.onValueChanged=t=>e.offset=t,this.rotation.onValueChanged=t=>e.rotation=t,this.focusArea.onValueChanged=t=>
1e.focusArea=t,this.feather.onValueChanged=t=>e.feather=t,this.kernelSize.onValueChanged=t=>e.blurPass.kernelSize=t,this.resolutionScale.onValueChanged=t=>e.resolution.scale=t/window.devicePixelRatio,e}};ue([(0,o.at)(l)],pe.prototype,"offset",void 0),ue([(0,o.at)(l)],pe.prototype,"rotation",void 0),ue([(0,o.at)(l)],pe.prototype,"focusArea",void 0),ue([(0,o.at)(l)],pe.prototype,"feather",void 0),ue([(0,o.at)(l)],pe.prototype,"kernelSize",void 0),ue([(0,o.at)(l)],pe.prototype,"resolutionScale",void 0),L("TiltShiftEffect",pe);var he=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},fe=class extends T{get typeName(){return"Vignette"}color=new l({r:0,g:0,b:0,a:1});intensity=new l(0);center=new l({x:.5,y:.5});init(){this.color.defaultValue={r:0,g:0,b:0,a:1},this.intensity.defaultValue=0,this.center.defaultValue={x:.5,y:.5}}onCreateEffect(){let e=new o.pr.POSTPROCESSING.MODULE.VignetteEffect;return this.intensity.onValueChanged=t=>{e.offset=t,this.updateDarkness(e)},this.color.onValueChanged=t=>{this.updateDarkness(e)},e}updateDarkness(e){e.darkness=this.intensity.value}};he([(0,o.at)(l)],fe.prototype,"color",void 0),he([(0,o.at)(l)],fe.prototype,"intensity",void 0),he([(0,o.at)(l)],fe.prototype,"center",void 0),L("Vignette",fe),globalThis.NEEDLE_USE_POSTPROCESSING=void 0===globalThis.NEEDLE_USE_POSTPROCESSING||globalThis.NEEDLE_USE_POSTPROCESSING;var me=(0,o.Ta)("debugpost"),ge=Symbol("needle:postprocessing-handler"),ve=Symbol("needle:previous-autoclear-state"),ye=Symbol("needle:previous-tone-mapping"),be=class e{_composer=null;_lastVolumeComponents;_effects=[];getEffectIsActive(e){return!!e&&(this._isActive&&this._effects.some(t=>t.effect===e))}get isActive(){return this._isActive}get composer(){return this._composer}_isActive=!1;context;constructor(e){this.context=e}apply(e){return this._isActive=!0,this.onApply(this.context,e)}unapply(e=!0){if(me&&console.log("Unapplying postprocessing effects"),this._isActive=!1,this._lastVolumeComponents){for(let e of this._lastVolumeComponents)e.unapply();this._lastVolumeComponents.length=0}let t=this.context;t[ge]===this&&(delete t[ge],"boolean"==typeof t.renderer[ve]&&(t.renderer.autoClear=t.renderer[ve]),"number"==typeof t.renderer[ye]&&(t.renderer.toneMapping=t.renderer[ye])),this._composer?.removeAllPasses(),e&&this._composer?.dispose(),t.composer===this._composer&&(t.composer=null),this._adaptiveDPR_OverrideActive&&(this._adaptiveDPR_OverrideActive=!1,t.devicePixelRatio="auto"),this.handleDevicePixelRatio()}dispose(){this.unapply(!0);for(let e of this._effects)e.effect.dispose();this._effects.length=0,this._composer=null}async onApply(e,t){if(!t)return;await Promise.all([o.pr.POSTPROCESSING.load(),o.pr.POSTPROCESSING_AO.load()]),e[ge]=this,me&&console.log("Apply Postprocessing Effects",t),this._lastVolumeComponents=[...t],this._effects.length=0;let n={handler:this,components:this._lastVolumeComponents};for(let i=0;i<this._lastVolumeComponents.length;i++){let r=this._lastVolumeComponents[i];if(r.context=e,r.apply){if(r.active){if(!e.mainCameraComponent)return void console.error("No camera in scene found or available yet - can not create postprocessing effects");let s=r.apply(n);if(!s)continue;let a=r.typeName||r.constructor.name;if(Array.isArray(s))for(let c of s)l(a,c)&&this._effects.push({effect:c,typeName:r.typeName,priority:r.order});else{if(!l(a,s))continue;this._effects.push({effect:s,typeName:r.typeName,priority:r.order})}function l(e,t){return!!t&&(t instanceof o.pr.POSTPROCESSING.MODULE.Effect||t instanceof o.pr.POSTPROCESSING.MODULE.Pass||console.warn(`PostprocessingEffect ${e} created neither Effect nor Pass - this might be caused by a bundler error or false import. Below you find some possible solutions:\n- If you create custom effect try creating it like this: 'new NEEDLE_ENGINE_MODULES.POSTPROCESSING.MODULE.Effect(...)' instead of 'new Effect(...)'`),!0)}}}else r.active&&(0,o.Mi)("Volume component is not a VolumeComponent: "+r.__type)}this.applyEffects(e)}_anyPassHasDepth=!1;_anyPassHasNormal=!1;_hasSmaaEffect=!1;get anyPassHasDepth(){return this._anyPassHasDepth}get anyPassHasNormal(){return this._anyPassHasNormal}get hasSmaaEffect(){return this._hasSmaaEffect}_customInputBuffer=null;_customInputBufferId=0;_multisampling=0;set multisampling(e){this._multisampling=e}get multisampling(){return this._multisampling}static _dprStep=.2;static _dprMinDelay=2;_adaptiveDPR_Enabled=!1;_adaptiveDPR_LastChangeTime=0;_adaptiveDPR_LastDecreaseTime=0;_adaptiveDPR_OverrideActive=!1;set adaptivePixelRatio(e){this._adaptiveDPR_Enabled=e,!e&&this._adaptiveDPR_OverrideActive&&(this._adaptiveDPR_OverrideActive=!1,this.context.devicePixelRatio="auto")}get adaptivePixelRatio(){return this._adaptiveDPR_Enabled}updateAdaptivePixelRatio(){if(!this._adaptiveDPR_Enabled||!this._isActive)return;if(!this._adaptiveDPR_OverrideActive&&"auto"!==this.context.devicePixelRatio)return void(me&&console.debug(`[PostProcessing] Adaptive DPR skipped: devicePixelRatio is "${this.context.devicePixelRatio}", not "auto"`));let t=this.context.time,n=t.realtimeSinceStartup,i=n-this._adaptiveDPR_LastChangeTime;if(n<3||i<e._dprMinDelay)return;let r=Math.min(2,window.devicePixelRatio),s=this.context.renderer.getPixelRatio(),a=e._dprStep;if(t.smoothedFps<=50&&s>1){let e=Math.max(1,Math.round(10*(s-a))/10);e<s&&(this._adaptiveDPR_LastChangeTime=n,this._adaptiveDPR_LastDecreaseTime=n,!this._adaptiveDPR_OverrideActive&&(me||(0,o.ma)())&&console.log(`[PostProcessing] Adaptively reducing pixel ratio for better performance (${s.toFixed(1)} → ${e}). Set context.devicePixelRatio to a fixed number to disable.`),this._adaptiveDPR_OverrideActive=!0,this.context.devicePixelRatio=e,me&&console.debug(`[PostProcessing] Reduced pixel ratio from ${s.toFixed(1)} to ${e}`))}else if(t.smoothedFps>=59&&i>1&&n-this._adaptiveDPR_LastDecreaseTime>10&&s<r){let e=Math.min(r,Math.round(10*(s+a))/10);e>s?(this._adaptiveDPR_LastChangeTime=n,this.context.devicePixelRatio=e,me&&console.debug(`[PostProcessing] Increased pixel ratio from ${s.toFixed(1)} to ${e}`)):this._adaptiveDPR_OverrideActive&&(this._adaptiveDPR_OverrideActive=!1,this._adaptiveDPR_LastChangeTime=n,this.context.devicePixelRatio="auto",me&&console.debug("[PostProcessing] Restored pixel ratio to auto"))}}applyEffects(e){if(this._anyPassHasDepth=!1,this._anyPassHasNormal=!1,this._hasSmaaEffect=!1,this._effects.length<=0)return;let t=e.mainCameraComponent,n=e.renderer,r=e.scene,s=t.threeCamera;if("boolean"==typeof n[ve]&&(n.autoClear=n[ve]),n[ve]=n.autoClear,"number"==typeof n[ye]&&(n.toneMapping=n[ye]),n[ye]=n.toneMapping,0!=n.toneMapping&&!this._effects.find(e=>e instanceof o.pr.POSTPROCESSING.MODULE.ToneMappingEffect)){let e=new o.pr.POSTPROCESSING.MODULE.ToneMappingEffect;e.name=`ToneMapping (${n.toneMapping})`,e.mode=W(n.toneMapping),this._effects.push({typeName:"ToneMapping",effect:e,priority:P})}this._composer||=new o.pr.POSTPROCESSING.MODULE.EffectComposer(n,{frameBufferType:i.ft,stencilBuffer:!0}),e.composer&&e.composer!==this._composer&&console.warn("There's already an active EffectComposer in your scene: replacing it with a new one. This might cause unexpected behaviour. Make sure to only use one PostprocessingManager/Volume in your scene."),e.composer=this._composer;let a=e.composer;a.setMainCamera(s),a.setRenderer(n),a.setMainScene(r),a.autoRenderToScreen=!0,a.multisampling=0;for(let e of a.passes)e.dispose();a.removeAllPasses();let l=new o.pr.POSTPROCESSING.MODULE.RenderPass(r,s);l.name="RenderPass",l.mainScene=r,a.addPass(l);let c=l.render;this._customInputBuffer?.dispose(),this._customInputBuffer=null,l.render=(e,t,n,r,s
1)=>{if(t){if(this._multisampling<=0)return void c.call(l,e,t,n,r,s);t.samples=0,n&&(n.samples=0),(!this._customInputBuffer||this._customInputBuffer.width!==t.width||this._customInputBuffer.height!==t.height||this._customInputBuffer.samples!==this._multisampling||this._customInputBuffer.texture.format!==t.texture.format||1016!==this._customInputBuffer.texture.type)&&(this._customInputBuffer?.dispose(),this._customInputBuffer=new i.Fr(t.width,t.height,{format:t.texture.format,type:i.ft,depthBuffer:t.depthBuffer,depthTexture:t.depthTexture?new i.X(t.width,t.height):void 0,stencilBuffer:t.stencilBuffer,samples:Math.max(0,this._multisampling),minFilter:t.texture.minFilter??1006,magFilter:t.texture.magFilter??1006,generateMipmaps:t.texture.generateMipmaps}),this._customInputBufferId++,this._customInputBuffer.texture.name=`CustomInputBuffer-${this._customInputBufferId}`,this._customInputBuffer.depthTexture&&t.depthTexture&&(this._customInputBuffer.depthTexture.format=t.depthTexture.format,this._customInputBuffer.depthTexture.type=t.depthTexture.type),me&&console.warn(`[PostProcessing] Input buffer created with size ${this._customInputBuffer.width}x${this._customInputBuffer.height} and samples ${this._customInputBuffer.samples}`)),c.call(l,e,this._customInputBuffer,n,r,s),e.setRenderTarget(t),o.Pi.blit(this._customInputBuffer.texture,t,{renderer:e,depthTexture:this._customInputBuffer.depthTexture,depthWrite:!0,depthTest:!0})}};try{!function(e){if("verbose"===u&&console.debug("Before ordering effects",[...e]),!R){(R=new Map).set(o.pr.POSTPROCESSING.MODULE.NormalPass,f),R.set(o.pr.POSTPROCESSING.MODULE.DepthDownsamplingPass,m),R.set(o.pr.POSTPROCESSING.MODULE.SMAAEffect,v),R.set(o.pr.POSTPROCESSING.MODULE.SSAOEffect,g);let e=o.pr.POSTPROCESSING_AO.MAYBEMODULE;e&&(R.set(e.N8AOPostPass,g),R.set(e.N8AOPass,g)),R.set(o.pr.POSTPROCESSING.MODULE.TiltShiftEffect,y),R.set(o.pr.POSTPROCESSING.MODULE.DepthOfFieldEffect,b),R.set(o.pr.POSTPROCESSING.MODULE.ChromaticAberrationEffect,E),R.set(o.pr.POSTPROCESSING.MODULE.BloomEffect,_),R.set(o.pr.POSTPROCESSING.MODULE.SelectiveBloomEffect,_),R.set(o.pr.POSTPROCESSING.MODULE.VignetteEffect,S),R.set(o.pr.POSTPROCESSING.MODULE.PixelationEffect,C),R.set(o.pr.POSTPROCESSING.MODULE.ToneMappingEffect,P),R.set(o.pr.POSTPROCESSING.MODULE.HueSaturationEffect,x),R.set(o.pr.POSTPROCESSING.MODULE.BrightnessContrastEffect,w)}e.sort((e,t)=>{let n="number"==typeof e.priority?e.priority:R.get(e.effect.constructor)??-1/0,i="number"==typeof t.priority?t.priority:R.get(t.effect.constructor)??-1/0;return n===-1/0?(u&&console.warn("Unknown effect found: ",e.constructor.name,e),1):i===-1/0?(u&&console.warn("Unknown effect found: ",t.constructor.name,t),-1):n-i}),"verbose"===u&&console.debug("After ordering effects",[...e])}(this._effects);let e=!1,t=null;for(let n=this._effects.length-1;n>=0;n--){let i=this._effects[n].effect;if(i instanceof o.pr.POSTPROCESSING.MODULE.ToneMappingEffect){if(e){me&&console.warn(`[PostProcessing] Found multiple tonemapping effects in the scene: ${i.name} and ${t?.name}. Only the last one added will be used.`),this._effects.splice(n,1);continue}t=i,e=!0}}let n=[],i=!1;for(let e=0;e<this._effects.length;e++){let l=this._effects[e].effect;l instanceof o.pr.POSTPROCESSING.MODULE.SMAAEffect?this._hasSmaaEffect=!0:l instanceof o.pr.POSTPROCESSING.MODULE.NormalPass&&(this._anyPassHasNormal=!0),!(l instanceof o.pr.POSTPROCESSING.MODULE.ToneMappingEffect&&t!==l)&&(l instanceof o.pr.POSTPROCESSING.MODULE.Effect?(l.getAttributes()&o.pr.POSTPROCESSING.MODULE.EffectAttribute.CONVOLUTION&&(me&&console.log("[PostProcessing] Convolution effect: "+l.name),i&&(me&&console.log("[PostProcessing] → Merging effects ["+n.map(e=>
1e.name).join(", ")+"]"),this.createPassForMergeableEffects(n,a,s,r)),i=!0),n.push(l)):l instanceof o.pr.POSTPROCESSING.MODULE.Pass?(i=!1,this.createPassForMergeableEffects(n,a,s,r),l.renderToScreen=!1,a.addPass(l)):(i=!1,this.createPassForMergeableEffects(n,a,s,r),a.addPass(l)))}this.createPassForMergeableEffects(n,a,s,r)}catch(e){console.error("Error while applying postprocessing effects",e),a.passes.forEach(e=>e.dispose()),a.removeAllPasses()}let d=!1;for(let e=a.passes.length-1;e>=0;e--){let t=a.passes[e],n=!1,i=!1;t.enabled&&(d||(n=!0,i=!0),d=!0),t.renderToScreen=i,void 0===t?.configuration?"autosetGamma"in t&&(t.autosetGamma=n):t.configuration.gammaCorrection=n,this._anyPassHasDepth||=t.needsDepthTexture}let p=a.depthTexture;p&&(p.source=new i.cr({width:0,height:0}),p.needsUpdate=!0),this.handleDevicePixelRatio(),me&&console.log("[PostProcessing] Passes →",[...a.passes],"\n---------------------------------\n• "+a.passes.map(e=>e.name||e.constructor.name+"*").join("\n• ")+"\n"),me&&this._onCreateEffectsDebug(this._composer,s)}
1createPassForMergeableEffects(e,t,n,i){if(e.length>0){let r=new o.pr.POSTPROCESSING.MODULE.EffectPass(n,...e);r.name=e.map(e=>e.name).join(", "),r.mainScene=i,r.enabled=!0,r.renderToScreen=!1,t.addPass(r),e.length=0}}handleDevicePixelRatio(){"number"==typeof this.context.devicePixelRatio&&this.context.requestSizeUpdate()}_menuEntry=null;_passIndices=null;_onCreateEffectsDebug(e,t){if("passes"===me){let n=new o.pr.POSTPROCESSING.MODULE.DepthEffect({blendFunction:o.pr.POSTPROCESSING.MODULE.BlendFunction.NORMAL,inverted:!0});n.name="Depth Effect";let i=new o.pr.POSTPROCESSING.MODULE.EffectPass(t,n);if(i.name="Depth Effect Pass",i.enabled=!1,e.passes.push(i),null!==this._passIndices){let t=[e.passes[0]];this._passIndices.length>0&&t.push(...this._passIndices.filter(e=>0!==e).map(t=>e.passes[t]).filter(e=>e)),t.length>0&&console.log("[PostProcessing] Passes (selected) →",t),e.passes.length=0;for(let n of t)n.enabled=!0,n.renderToScreen=!1,e.addPass(n)}let r=this.context.menu;if(r&&null===this._passIndices){this._menuEntry&&this._menuEntry.remove();let t=document.createElement("select");t.multiple=!0;let n=document.createElement("option");n.innerText="Final Output",n.value="-1",t.appendChild(n);for(let n of e.passes){let i=document.createElement("option");i.innerText=n.name,i.value=`${e.passes.indexOf(n)}`,i.title=n.name,t.appendChild(i)}r.appendChild(t),this._menuEntry=t,t.addEventListener("change",()=>{let e=Array.from(t.selectedOptions).map(e=>parseInt(e.value));1===e.length&&-1===e[0]?this._passIndices=null:this._passIndices=e,this.applyEffects(this.context)})}}}},Ee=function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},_e=(0,o.Ta)("debugpost"),Se=class extends o.${get isPostProcessingManager(){return!0}get effects(){return this._activeEffects}get dirty(){return this._isDirty}set dirty(e){this._isDirty=e}sharedProfile;multisampling="auto";adaptiveResolution=!0;addEffect(e){let t=e;return t instanceof T||(t=new te(t),"number"==typeof e.order&&(t.order=e.order)),void 0===t.gameObject&&this.gameObject.addComponent(t),this._effects.includes(t)||(this._effects.push(t),this._isDirty=!0),e}removeEffect(e){let t=-1;if(t=e instanceof T?this._effects.indexOf(e):this._effects.findIndex(t=>t instanceof te&&t.effect===e),-1!==t)return this._effects.splice(t,1),this._isDirty=!0,e;if(e instanceof T){let t=this.sharedProfile?.components?.indexOf(e);void 0!==t&&-1!==t&&(this._isDirty=!0,this.sharedProfile?.components?.splice(t,1))}return e}_postprocessing;_activeEffects=[];_effects=[];markDirty(){this._isDirty=!0}awake(){_e&&(console.log("PostprocessingManager Awake",this),console.log("Press P to toggle post processing"),window.addEventListener("keydown",e=>{"p"===e.key&&(this.enabled=!this.enabled,(0,o.ji)("Toggle PostProcessing "+this.name+": Enabled="+this.enabled),this.markDirty())})),this.sharedProfile?.__init(this)}_componentEnabledTime=-1;_multisampleAutoChangeTime=0;_multisampleAutoDecreaseTime=0;onEnable(){this._componentEnabledTime=this.context.time.realtimeSinceStartup,this._isDirty=!0}onDisable(){this._postprocessing?.unapply(),this._isDirty=!1}
1onBeforeRender(){if(!this.context.isInXR&&(this.context.mainCamera&&this._isDirty&&this.apply(),this.context.composer&&this._postprocessing&&this._postprocessing.composer===this.context.composer)){if(this.context.renderer.getContext().isContextLost()&&this.context.renderer.forceContextRestore(),this.context.composer.getRenderer()!==this.context.renderer&&this.context.composer.setRenderer(this.context.renderer),this.context.composer.setMainScene(this.context.scene),"auto"===this.multisampling)if(this._postprocessing&&this._postprocessing.hasSmaaEffect)0!==this._postprocessing.multisampling&&(this._postprocessing.multisampling=0,(_e||(0,o.ma)())&&console.log("[PostProcessing] multisampling is disabled because it's set to 'auto' on your PostprocessingManager/Volume component that also has an SMAA effect.\n\nIf you need multisampling consider changing 'auto' to a fixed value (e.g. 4)."));else{let e=this.context.time.realtimeSinceStartup-this._multisampleAutoChangeTime;if(this.context.time.realtimeSinceStartup-this._componentEnabledTime>2&&e>.5){let t=this._postprocessing.multisampling;if(this._postprocessing.multisampling>0&&this.context.time.smoothedFps<=50){this._multisampleAutoChangeTime=this.context.time.realtimeSinceStartup,this._multisampleAutoDecreaseTime=this.context.time.realtimeSinceStartup;let e=.5*this._postprocessing.multisampling;e=Math.floor(e),e!=this._postprocessing.multisampling&&(this._postprocessing.multisampling=e),_e&&console.debug(`[PostProcessing] Reduced multisampling from ${t} to ${this._postprocessing.multisampling}`)}else if(e>1&&this.context.time.smoothedFps>=59&&this._postprocessing.multisampling<this.context.renderer.capabilities.maxSamples&&this.context.time.realtimeSinceStartup-this._multisampleAutoDecreaseTime>10){this._multisampleAutoChangeTime=this.context.time.realtimeSinceStartup;let e=this._postprocessing.multisampling<=0?1:2*this._postprocessing.multisampling;e=Math.floor(e),e!==this._postprocessing.multisampling&&(this._postprocessing.multisampling=e),_e&&console.debug(`[PostProcessing] Increased multisampling from ${t} to ${this._postprocessing.multisampling}`)}}}else{let e=Math.max(0,Math.min(this.multisampling,this.context.renderer.capabilities.maxSamples));e!==this._postprocessing.multisampling&&(this._postprocessing.multisampling=e)}if(this._postprocessing.adaptivePixelRatio=this.adaptiveResolution,this._postprocessing.updateAdaptivePixelRatio(),this.context.mainCamera){let e=this.context.composer.passes;for(let t of e)if(t.mainCamera&&t.mainCamera!==this.context.mainCamera){this.context.composer.setMainCamera(this.context.mainCamera);break}}}}onDestroy(){this._postprocessing?.dispose()}_lastApplyTime;_rapidApplyCount=0;_isDirty=!1;apply(){if(_e&&console.log(`Apply PostProcessing "${this.name||"unnamed"}"`),(0,o.ma)()&&(void 0!==this._lastApplyTime&&Date.now()-this._lastApplyTime<100&&(this._rapidApplyCount++,5===this._rapidApplyCount&&console.warn("Detected rapid post processing modifications - this might be a bug",this)),this._lastApplyTime=Date.now()),this._isDirty=!1,this._activeEffects.length=0,this.sharedProfile?.components){let e=this.sharedProfile.components;for(let t of e)t.active&&t.enabled&&!this._activeEffects.includes(t)&&this._activeEffects.push(t)}for(let e of this._effects)e.active&&e.enabled&&!this._activeEffects.includes(e)&&this._activeEffects.push(e);this._activeEffects.length>0?(this._postprocessing||=new be(this.context),this._postprocessing.apply(this._activeEffects)?.then(()=>{this.activeAndEnabled&&(this._applyPostQueue(),this._postprocessing?("auto"===this.multisampling?this._postprocessing.multisampling=o._a.isMobileDevice()?2:4:this._postprocessing.multisampling=Math.max(0,Math.min(this.multisampling,this.context.renderer.capabilities.maxSamples)),_e&&console.debug(`[PostProcessing] Set multisampling to ${this._postprocessing.multisampling} (Is Mobile: ${o._a.isMobileDevice()})`)):_e&&console.warn("[PostProcessing] No composer found"))})):this._postprocessing?.unapply(!1)}_applyPostQueue(){if(this._modificationQueue){for(let e of this._modificationQueue.values())this.onEditorModification(e);this._modificationQueue.clear()}}onEditorModification(e){if(e.propertyName.startsWith("postprocessing.")){if(!this._postprocessing)return this._modificationQueue||=new Map,this._modificationQueue.set(e.propertyName,e),!0;if(!this._activeEffects?.length)return;let t=e.propertyName.split(".");if(3===t.length||4===t.length){let n=t[1],i=t[2];for(let o of this._activeEffects)if(o.typeName?.toLowerCase()===n.toLowerCase()){if("active"===i)return o.active=e.value,void this.scheduleRecreate();if(!Ce.has(n)){let e=[];Ce.set(n,e);let t=Object.keys(o);for(let n of t)o[n]instanceof l&&e.push(n)}if(Ce.has(n)){let r=i.toLowerCase(),s=Ce.get(n);for(let n of s)if(n.toLowerCase()===r){let i=o[n];return void(i instanceof l&&(4===t.length&&"active"===t[3]?(i.overrideState=e.value,this.scheduleRecreate()):i&&void 0!==i.value&&(i.value=e.value)))}}return void console.warn("Unknown modification",i)}}return!0}return!1}_modificationQueue;_recreateId=-1;scheduleRecreate(){let e=++this._recreateId;setTimeout(()=>{e===this._recreateId&&(this.onDisable(),this.onEnable())},200)}};Ee([(0,o.ot)(I)],Se.prototype,"sharedProfile",void 0),Ee([(0,o.ot)()],Se.prototype,"multisampling",void 0),Ee([(0,o.ot)()],Se.prototype,"adaptiveResolution",void 0);var Ce=new Map;!function(e){p=e}(Se)}}]);

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.