Production vite build copies assets/MenuScene.glb and bundled chunks into dist/. Made-with: Cursor
2 lines
4.5 KiB
JavaScript
2 lines
4.5 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./register_types.C6IEiUJa.js","./needle-engine-webxr.DiiWSXeh.js","./materialx.CnHmG--Y.js","./rolldown-runtime.CYVBeYYp.js","./three@0.169.19.js","./needle-engine-ui.D3ZoIJG5.js","./gltf-progressive.BBJGcb3s.js","./three-examples@0.169.19.js","./three-mesh-ui.CgGzZ3ml.js","./needle-engine@5.0.3.js","./needle-engine.extras.B9pwA3ET.js","./needle-engine-particles.Ce6eiXqY.js","./three-quarks.DALdLWPD.js","./needle-engine.extras.dI9yZHT7.js","./postprocessing.Wy71DpiM.js","./three-mesh-bvh.B-oXEGo2.js","./needle-engine.DZYzd-GQ.js"])))=>i.map(i=>d[i]);
|
|
import{d as e}from"./materialx.CnHmG--Y.js";import{_t as t,fn as n,wi as r}from"./needle-engine-ui.D3ZoIJG5.js";import{A as i}from"./three-examples@0.169.19.js";import"./needle-engine@5.0.3.js";import{x as a}from"./needle-engine-webxr.DiiWSXeh.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),globalThis[`needle:dependencies:ready`]=e(()=>import(`./register_types.C6IEiUJa.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url);var o=[];globalThis[`needle:codegen_files`]=o,o.push(`./assets/MenuScene.glb`),document.addEventListener(`DOMContentLoaded`,()=>{let e=document.querySelector(`needle-engine`);e&&e.getAttribute(`src`)===null&&(e.setAttribute(`hash`,`1776632959714`),e.setAttribute(`src`,JSON.stringify(o)))}),console.log(`Made with ♥ by 🌵 Needle - https://needle.tools — Version 5.0.3`);var s={"cc0_-_pizza_salami":`include/dishes/cc0_-_pizza_salami.glb`};function c(e){let t=0;return e.traverse(e=>{e.isMesh&&(t+=1)}),t}function l(e){let t=`./`.endsWith(`/`)?`./`:`.//`;return new URL(e,new URL(t,window.location.href)).href}async function u(e){let t=new i;for(let n of e.dishes){if(!n)continue;let e=s[n.name];if(!e||c(n)>0)continue;let r=l(e),i=await t.loadAsync(r);i.scene.name=`${n.name}_mesh`,n.add(i.scene)}}function d(){let e=document.querySelector(`needle-engine`);if(!e)return;let n=async()=>{try{let n=await e.getContext(),r=t(MenuController,n);r&&await u(r)}catch(e){console.warn(`[dishMeshFallback] Could not inject dish meshes:`,e)}};e.addEventListener(`loadfinished`,()=>void n())}d(),r(e=>{let t=e.scene.getComponentInChildren(a);t||(t=e.scene.addComponent(a),t.createARButton=!0,t.createVRButton=!0),t.autoPlace=!0,t.autoCenter=!0,t.arScale=1});function f(e){document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>e(),{once:!0}):e()}function p(){let e=document.querySelector(`needle-engine`),r=document.querySelector(`#asset-picker-prev`),i=document.querySelector(`#asset-picker-next`),a=document.querySelector(`#asset-picker-ar`),o=document.querySelector(`#asset-picker-label`),s=document.querySelector(`#asset-picker-index`);if(!e||!r||!i||!a||!o||!s)return;let c=null,l=!1,u=!1,d=!1,p=()=>{c&&c.getDishSlotCount()>0?(o.textContent=c.getPickerLabel(),s.textContent=``):c?(o.textContent=`Menu (assign dishes in Unity)`,s.textContent=``):(o.textContent=`Menu scene`,s.textContent=`—`);let e=c!==null&&c.getDishSlotCount()>1;r.disabled=!e,i.disabled=!e,a.disabled=!u||d||l},m=async()=>{try{let n=await e.getContext();c=t(MenuController,n)}catch{c=null}p()};n.isARSupported().then(e=>{u=e,p()});let h=e=>{!c||c.getDishSlotCount()<=1||(e<0?c.selectPreviousDish():c.selectNextDish(),p())},g=async()=>{if(!(!u||d||l)){d=!0,p();try{let t=await e.getContext();await n.start(`immersive-ar`,void 0,t)}catch(e){console.warn(`[assetPicker] Failed to start AR session:`,e)}finally{d=!1,p()}}};r.addEventListener(`click`,()=>h(-1)),i.addEventListener(`click`,()=>h(1)),a.addEventListener(`click`,()=>void g()),e.addEventListener(`enter-ar`,()=>{l=!0,p()}),e.addEventListener(`exit-ar`,()=>{l=!1,p()}),e.addEventListener(`enter-vr`,()=>{l=!0,p()}),e.addEventListener(`exit-vr`,()=>{l=!1,p()}),e.addEventListener(`loadfinished`,()=>void m()),f(()=>{requestAnimationFrame(()=>void m())})}p(),e(()=>import(`./needle-engine.DZYzd-GQ.js`),__vite__mapDeps([16,10,2,3,4,1,5,6,7,8,11,12,13,14,9,15]),import.meta.url); |