算力台灣
<!DOCTYPE html><html lang="zh-Hant"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><title>算力台灣 AITaiwan · 自動駕駛巴士車內</title><link rel="preconnect" href="https://custom-images.strikinglycdn.com" crossorigin><style>*,:after,:before{box-sizing:border-box!important}html{background:#000!important;color-scheme:dark!important}body,html{margin:0!important;padding:0!important;width:100%!important;height:100%!important;min-height:100%!important;overflow:hidden!important;background:#000!important;border:0!important;outline:0!important;box-shadow:none!important}body{position:fixed!important;inset:0!important}#canvas-container{position:fixed!important;inset:0!important;width:100vw!important;height:100vh!important;height:100dvh!important;display:block!important;margin:0!important;padding:0!important;overflow:hidden!important;border:0!important;outline:0!important;box-shadow:none!important;background:#000!important;touch-action:none!important;-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important}canvas{display:block!important;width:100%!important;height:100%!important;margin:0!important;padding:0!important;border:0!important;outline:0!important;box-shadow:none!important;background:#000!important;vertical-align:top!important;touch-action:none!important}#canvas-container:after{content:"";position:absolute;inset:0;z-index:55;pointer-events:none;background:radial-gradient(circle at 50% 46%,#34eaff0b 0,#0000 40%,#0003095c),linear-gradient(to bottom,#03101d57 0,#0000 15% 84%,#01081261)}#flash{position:fixed;inset:0;z-index:60;pointer-events:none;opacity:0;visibility:hidden;display:none;background:radial-gradient(circle at 50% 48%,#fff 0,#f2fff7 26%,#b9ffd9 48%,#e8fff2 72%,#fff)}#arrival-dialog[hidden]{display:none!important}#arrival-dialog{position:fixed;inset:0;z-index:72;display:grid;place-items:center;padding:max(18px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));pointer-events:auto;background:radial-gradient(circle at 50% 54%,rgba(45,238,255,.12),transparent 54%);opacity:0;transform:translateY(12px) scale(.975);transition:opacity .22s ease,transform .32s cubic-bezier(.2,.85,.25,1)}#arrival-dialog.is-visible{opacity:1;transform:translateY(0) scale(1)}#arrival-dialog.is-closing{pointer-events:none}.arrival-card{position:relative;width:min(760px,100%);max-height:100%;overflow-y:auto;min-height:174px;display:grid;grid-template-columns:126px 1fr;align-items:center;gap:24px;padding:58px 34px 26px 38px;border:1px solid rgba(154,247,255,.58);border-radius:28px;pointer-events:auto;color:#f5feff;background:linear-gradient(135deg,#0c1f32c7,#030c1a9e),radial-gradient(circle at 18% 20%,rgba(64,231,255,.18),transparent 34%);box-shadow:0 0 0 1px #ffffff14 inset,0 0 34px #24e3ff57,0 18px 70px #00000094;backdrop-filter:blur(18px) saturate(145%);-webkit-backdrop-filter:blur(18px) saturate(145%)}.arrival-card:before{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(115deg,transparent 18%,rgba(255,255,255,.1) 42%,transparent 64%);transform:translate(-100%);animation:arrivalSheen 2.8s ease-in-out infinite}@keyframes arrivalSheen{to,52%{transform:translate(100%)}}.arrival-close{position:absolute;left:auto;right:8px;top:8px;z-index:2;width:44px;height:44px;display:grid;place-items:center;padding:0;border:1px solid rgba(178,247,255,.46);border-radius:50%;color:#dffcff;background:#010c198a;font:300 23px/1 Arial,sans-serif;cursor:pointer;box-shadow:0 0 16px #36e4ff33;transition:background .18s ease,transform .18s ease}.arrival-close:focus-visible,.arrival-close:hover{background:#26c0da61;transform:scale(1.08);outline:0}.arrival-avatar-wrap{width:116px;height:116px;padding:4px;border-radius:50%;background:conic-gradient(from 180deg,#80f7ff,#8a7dff,#ff8de8,#ffe27a,#80f7ff);box-shadow:0 0 28px #48e8ff75}.arrival-avatar{width:100%;height:100%;display:block;border:3px solid rgba(4,15,29,.88);border-radius:50%;object-fit:cover;background:#071323}.arrival-avatar-wrap.image-failed{display:grid;place-items:center;color:#eaffff;font:900 30px/1 system-ui,sans-serif}.arrival-avatar-wrap.image-failed:after{content:"AI"}.arrival-avatar-wrap.image-failed .arrival-avatar{display:none}.arrival-copy{min-width:0;font-family:PingFang TC,Microsoft JhengHei,system-ui,sans-serif}.arrival-kicker{margin:0 0 8px;color:#85f4ff;font-size:12px;font-weight:800;letter-spacing:.22em;text-transform:uppercase}.arrival-text{margin:0;min-height:4.9em;color:#f7feff;font-size:clamp(16px,2.2vw,22px);font-weight:700;line-height:1.65;letter-spacing:.035em;text-shadow:0 0 16px rgba(142,247,255,.3)}.arrival-cursor{display:inline-block;width:2px;height:1.15em;margin-left:3px;vertical-align:-.18em;background:#a7fbff;box-shadow:0 0 10px #53edff;animation:arrivalBlink .55s steps(1,end) infinite}@keyframes arrivalBlink{50%{opacity:0}}.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}#runtime-status[hidden]{display:none!important}#runtime-status{position:fixed;inset:0;z-index:90;display:grid;place-items:center;padding:24px;background:#01070ee0;color:#f3feff;font-family:PingFang TC,Microsoft JhengHei,system-ui,sans-serif;text-align:center;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}.runtime-card{width:min(100%,520px);max-height:100%;overflow:auto;overflow-wrap:anywhere;padding:28px;border:1px solid rgba(130,238,255,.5);border-radius:22px;background:#061422f0;box-shadow:0 0 40px #2dddff2e}#runtime-message{margin:0 0 18px;font-weight:700;line-height:1.7}#runtime-retry{min-height:44px;padding:10px 20px;border:1px solid rgba(170,246,255,.72);border-radius:999px;color:#ecfeff;background:#1c8ba67a;font-family:inherit;font-size:15px;font-weight:800;line-height:1.4;cursor:pointer}#runtime-retry:focus-visible{outline:3px solid #fff;outline-offset:3px}@media(max-width:620px){#arrival-dialog{padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}.arrival-card{grid-template-columns:82px 1fr;gap:15px;min-height:150px;padding:58px 18px 22px 28px;border-radius:22px}.arrival-avatar-wrap{width:78px;height:78px}.arrival-kicker{margin-bottom:5px;font-size:10px}.arrival-text{font-size:clamp(14px,4vw,18px);line-height:1.55}}@media(pointer:coarse){.arrival-card{backdrop-filter:none;-webkit-backdrop-filter:none;background:linear-gradient(135deg,#0c1f32ed,#030c1ae0),radial-gradient(circle at 18% 20%,rgba(64,231,255,.18),transparent 34%)}#runtime-status{backdrop-filter:none;-webkit-backdrop-filter:none}}@media(prefers-reduced-motion:reduce){.arrival-card:before,.arrival-cursor{animation:none}#arrival-dialog{transition-duration:0s}}#arrival-dialog,#runtime-status{min-height:0;overflow:auto}.arrival-close:focus-visible{outline:3px solid #fff;outline-offset:-4px}@media(pointer:coarse){.arrival-card:before{animation:none}}</style><script type="importmap">{"imports":{"three":"__AITW_THREE_BASE__build/three.module.js","three/addons/":"__AITW_THREE_BASE__examples/jsm/"}}</script><link rel="modulepreload" href="__AITW_THREE_BASE__build/three.module.js" crossorigin fetchpriority="high"><link rel="modulepreload" href="__AITW_THREE_BASE__examples/jsm/geometries/RoundedBoxGeometry.js" crossorigin><link rel="modulepreload" href="__AITW_THREE_BASE__examples/jsm/utils/BufferGeometryUtils.js" crossorigin></head><body><div id="canvas-container"></div><div id="flash"></div><div id="runtime-status" hidden role="alertdialog" aria-modal="true" aria-labelledby="runtime-message"><div class="runtime-card"><p id="runtime-message"></p><button id="runtime-retry" type="button">重新載入場景</button></div></div><section id="arrival-dialog" hidden role="dialog" aria-modal="true" aria-label="AI BUS 到站通知" aria-describedby="arrival-message-a11y"><div class="arrival-card"><button id="arrival-close" class="arrival-close" type="button" aria-label="關閉到站通知">×</button><div class="arrival-avatar-wrap"><img class="arrival-avatar" src="https://custom-images.strikinglycdn.com/res/hrscywv4p/image/upload/c_fill,fl_lossy,h_240,w_240,f_auto,q_auto/238199/877057_194815.jpeg" width="120" height="120" alt="AI BUS 服務機器人頭像" decoding="async" referrerpolicy="no-referrer"></div><div class="arrival-copy"><p class="arrival-kicker">AI BUS · ARRIVAL MESSAGE</p><p id="arrival-message-a11y" class="sr-only">歡迎進入算力台灣城市商圈站 感謝您的搭乘</p><p class="arrival-text" aria-hidden="true"><span id="arrival-typewriter"></span><span class="arrival-cursor" aria-hidden="true"></span></p></div></div></section><script type="module" onerror="try{parent.postMessage({aitwBusError:!0,code:'MODULE_LOAD_FAILED',stage:'module',message:'3D module load failed',buildVersion:'__AITW_BUILD_VERSION__',aitwNonce:'__AITW_SESSION_NONCE__'},'*')}catch(e){}">import*as t from"three";import{RoundedBoxGeometry as e}from"three/addons/geometries/RoundedBoxGeometry.js";import{mergeGeometries as i}from"three/addons/utils/BufferGeometryUtils.js";const s=navigator.maxTouchPoints||0,a=Boolean(window.matchMedia&&window.matchMedia("(pointer: coarse)").matches),o=s>0||a||/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent),r=Number(navigator.deviceMemory||8),n=navigator.hardwareConcurrency||4;let aAG=!1,aT=(()=>{const t=navigator.userAgent,e=/iPad|iPhone|iPod/.test(t)||"MacIntel"===navigator.platform&&s>1,i=Boolean(navigator.connection&&navigator.connection.saveData);if(!o)return i||r<=4||n<=4?1:2;if(i||!e&&(r<=4||n<=4))return 0;if(e){const e=Math.max(screen.width||0,screen.height||0),i=window.devicePixelRatio||1;return/iPad/.test(t)||"MacIntel"===navigator.platform?e>=1133?2:1:i>=3&&e>=844&&896!==e?2:1}return aAG=!0,1})(),aP=o&&Math.min(innerWidth||0,innerHeight||0)<768,h,aC,aF,l,d,c;function aSet(t){aT=t,h=t>=2?"high":t>=1?"balanced":"low",aC=o?t>=2?aP?[2,1.75,1.5,1.25]:[1.5,1.35,1.2,1]:t>=1?[1.25,1.1,1,.85]:[1,.9,.8,.75]:t>=2?[1.5,1.25,1,1]:[1.25,1.1,1,.85],aF=o?t>=2?[60,45,30,24]:[30,24,20,20]:[60,40,30,24],l=aC[0],d=o?t>=2?26e5:t>=1?13e5:75e4:t>=2?42e5:18e5,c=aF[0]}aSet(aT);const p=Boolean(window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches),m="__AITW_SESSION_NONCE__",u="__AITW_BUILD_VERSION__",g=__AITW_SCENE_HOUR_OVERRIDE__;function f(){const t=Number.isFinite(g)?g:(new Date).getHours();return t>=6&&t<18?"day":"night"}function y(t){try{window.parent.postMessage({...t,aitwNonce:m},"*")}catch{}}const w=(()=>{const e=document.createElement("canvas");e.width=5,e.height=1;const i=e.getContext("2d");["#1b2129","#56606c","#9fa5ab","#d6d9dc","#fff"].forEach((t,e)=>(i.fillStyle=t,i.fillRect(e,0,1,1)));const s=new t.CanvasTexture(e);return s.minFilter=t.LinearFilter,s.generateMipmaps=!1,s})(),M=(e,i={})=>new t.MeshToonMaterial({color:e,gradientMap:w,...i}),_=e=>new t.MeshBasicMaterial({color:e}),v=Object.freeze(["map","alphaMap","aoMap","bumpMap","normalMap","displacementMap","emissiveMap","metalnessMap","roughnessMap","lightMap","specularMap","gradientMap"]),T=new t.PlaneGeometry(.6,.85),x=new t.MeshBasicMaterial({color:16767370,userData:{live:1},polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-4}),b=new t.MeshBasicMaterial({color:10477823,userData:{live:1},polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-4}),S=(()=>{const e=document.createElement("canvas");e.width=32,e.height=32;const i=e.getContext("2d");i.fillStyle="#ffffff",i.fillRect(0,0,32,32);for(let t=0;t<32;t++)for(let e=0;e<32;e++){const s=(t+e)%4;0===s?(i.fillStyle="rgba(0,0,0,0.07)",i.fillRect(t,e,1,1)):2===s&&(i.fillStyle="rgba(255,255,255,0.18)",i.fillRect(t,e,1,1))}const s=new t.CanvasTexture(e);return s.wrapS=s.wrapT=t.RepeatWrapping,s.repeat.set(3,3),s.minFilter=t.NearestFilter,s.magFilter=t.NearestFilter,s.generateMipmaps=!1,s.colorSpace=t.SRGBColorSpace,s})(),E=(()=>{const e=document.createElement("canvas");e.width=64,e.height=64;const i=e.getContext("2d");i.fillStyle="#ffffff",i.fillRect(0,0,64,64),i.fillStyle="rgba(0,0,0,0.22)";for(let t=0;t<64;t+=8)i.fillRect(t,0,2,64);i.fillStyle="rgba(255,255,255,0.25)";for(let t=0;t<90;t++)i.fillRect(37*t%64,53*t%64,1,1);const s=new t.CanvasTexture(e);return s.wrapS=s.wrapT=t.RepeatWrapping,s.repeat.set(3,16),s.minFilter=t.NearestFilter,s.magFilter=t.NearestFilter,s.generateMipmaps=!1,s.colorSpace=t.SRGBColorSpace,s})();let R=4;function C(e,i,s,a){const o=document.createElement("canvas");o.width=e,o.height=i*s;const r=o.getContext("2d");for(let t=0;t<s;t++)r.save(),r.translate(0,t*i),r.beginPath(),r.rect(0,0,e,i),r.clip(),a(r,t),r.restore();const n=new t.CanvasTexture(o);return n.anisotropy=R,n.colorSpace=t.SRGBColorSpace,{mat:new t.MeshBasicMaterial({map:n,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-4}),geo(t,e){const a=t.attributes.uv;for(let t=0;t<a.count;t++)a.setY(t,(a.getY(t)*(i-4)+2+(s-1-e)*i)/(i*s));return t}}}function P(e,i){const s=document.createElement("canvas");s.width=e,s.height=i;const a=s.getContext("2d"),o=new t.CanvasTexture(s);return o.minFilter=t.LinearFilter,o.magFilter=t.LinearFilter,o.generateMipmaps=!1,o.colorSpace=t.SRGBColorSpace,{ctx:a,texture:o,width:e,height:i,bgLayer:null}}function A(t,e,i){const s=document.createElement("canvas");return s.width=t,s.height=e,i(s.getContext("2d")),s}function I(t,e,i,s,a="#bafcff",o=22,r="700"){t.fillStyle=a,t.font=`${r} ${o}px "Courier New", monospace`,t.fillText(e,i,s)}const D='"PingFang TC","Microsoft JhengHei","Noto Sans CJK TC","Heiti TC",sans-serif',L="886-"+String(1e3+Math.floor(9e3*Math.random())),k=58,G=1.2,F=69.6+18.85,B=new Set(["stopping","standing","walking","advancing","arrivalmessage","turning","dooropen","exiting"]),O=new Set(["standing","walking","advancing","arrivalmessage","turning","dooropen","exiting"]),H=t=>Math.min(1,Math.max(0,t)),N=t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,z=Object.freeze(["算力航廈站","城市商圈站"]),W=z[1];class U{constructor(e){this.group=new t.Group,e.add(this.group),this.width=2.8,this.length=15,this.deckHeight=2.5,this.realLights=[],this.routeProg=.5,this.roundedGeometries=new Map,this.panelRateReduced=!1,this.displayUpdateInterval="high"===h?.18:"balanced"===h?.34:.5,this.build()}roundedGeometry(t,i,s,a){const o="high"===h?4:"balanced"===h?3:2,r=`${t}|${i}|${s}|${a}|${o}`;let n=this.roundedGeometries.get(r);return n||(n=new e(t,i,s,o,a),this.roundedGeometries.set(r,n)),n}pillow(e,i,s,a,o){return new t.Mesh(this.roundedGeometry(e,i,s,a),o)}composeMatrix(e,i,s,a=0,o=0,r=0){const n=new t.Vector3(e,i,s),h=(new t.Quaternion).setFromEuler(new t.Euler(a,o,r));return(new t.Matrix4).compose(n,h,new t.Vector3(1,1,1))}mergeGeometryCopies(t,e){if(!t||!e||0===e.length)return null;const s=e.map(e=>{const i=t.clone();return i.applyMatrix4(e),i}),a=i(s,!1);return s.forEach(t=>t.dispose()),a}addMergedMesh(e,i,s,a=0){const o=this.mergeGeometryCopies(e,s);if(!o)return null;const r=new t.Mesh(o,i);return r.renderOrder=a,this.group.add(r),r}build(){const e=M(12170922,{emissive:3157804,emissiveIntensity:.06}),i=M(3687755,{map:E,emissive:2105631,emissiveIntensity:.04}),s=M(14209731,{emissive:4013112,emissiveIntensity:.05}),a=M(2698030,{emissive:2434342,emissiveIntensity:.22}),o=M(2707032,{map:S,emissive:1908257,emissiveIntensity:.04});this.seatAssets={trimTopGeo:new t.BoxGeometry(.697,.026,.03),trimFrontGeo:new t.BoxGeometry(.697,.02,.025),legGeo:new t.CylinderGeometry(.045,.07,.32,10),footGeo:new t.CylinderGeometry(.12,.12,.025,12),trimTopMat:_(14208956),trimFrontMat:_(16250609),legMat:M(6316383),footMat:_(12103062)};const r=this.width/2,n=this.length/2,l=this.deckHeight,d=this.pillow(this.width-.1,.2,this.length-.1,.05,i);d.position.y=0,this.group.add(d);const c=this.pillow(this.width-.1,.2,this.length-.1,.05,s);c.position.y=l,this.group.add(c);const p=2.05;[-1,1].forEach(t=>{if(1===t){const i=-5.02- -n,s=this.pillow(.16,1,i,.05,e);s.position.set(t*(r-.08),.5,i/2-n),this.group.add(s);const a=n- -3.58,o=this.pillow(.16,1,a,.05,e);o.position.set(t*(r-.08),.5,n-a/2),this.group.add(o)}else{const i=this.pillow(.16,1,this.length,.05,e);i.position.set(t*(r-.08),.5,0),this.group.add(i)}const i=this.pillow(.16,l-p,this.length,.05,e);i.position.set(t*(r-.08),(p+l)/2,0),this.group.add(i)});const m=[];for(let t=1.6-n;t<=n-1;t+=1.5)[-1,1].forEach(e=>{1===e&&Math.abs(t- -4.3)<.84||m.push(this.composeMatrix(e*(r-.1),1.525,t))});this.addMergedMesh(this.roundedGeometry(.12,p-1-.04,.12,.02),e,m);const u=new t.MeshBasicMaterial({color:14214891,transparent:!0,opacity:.04,depthWrite:!1,side:t.DoubleSide}),g=(e,i,s)=>{const a=new t.Mesh(new t.PlaneGeometry(s-i,p-1-.04),u);a.rotation.y=Math.PI/2,a.position.set(e*(r-.13),1.525,(i+s)/2),this.group.add(a)};g(-1,.25-n,n-.25),g(1,.25-n,-5.02),g(1,-3.58,n-.25);const f=this.pillow(this.width,l,.2,.05,e);f.position.set(0,l/2,n-.1),this.group.add(f);const y=.15-n,w=this.pillow(this.width,.5,.3,.05,e);w.position.set(0,l-.25,y),this.group.add(w);const v=this.pillow(this.width,.4,.3,.05,e);v.position.set(0,.6,y),this.group.add(v),[-1,1].forEach(t=>{const i=this.pillow(.18,l,.18,.03,e);i.position.set(t*(r-.1),l/2,y),this.group.add(i)}),this.lastDisplayT=-999,this.lastDisplayPhase="";const T=this.pillow(this.width-.45,.42,.86,.1,a);T.position.set(0,.92,y+.55),this.group.add(T);const x=P(512,256);this.statusDisplay=x;const b=new t.Mesh(new t.PlaneGeometry(1.34,.67),new t.MeshBasicMaterial({map:x.texture,transparent:!0,opacity:.95,side:t.FrontSide}));b.position.set(0,1.29,y+.68),b.rotation.x=-.72,b.renderOrder=8,this.group.add(b);const R=(()=>{const e=document.createElement("canvas");e.width=128,e.height=128;const i=e.getContext("2d");i.clearRect(0,0,128,128),i.beginPath(),i.arc(64,64,60,0,2*Math.PI),i.fillStyle="#04141d",i.fill(),i.lineWidth=5,i.strokeStyle="#34eaff",i.stroke(),i.beginPath(),i.arc(64,64,48,0,2*Math.PI),i.lineWidth=2,i.strokeStyle="rgba(58,226,255,0.5)",i.stroke(),i.save(),i.beginPath(),i.arc(64,64,46,0,2*Math.PI),i.clip(),i.fillStyle="#2bd6ff";for(let t=20;t<=108;t+=11)for(let e=20;e<=108;e+=11)i.beginPath(),i.arc(e,t,2.3,0,2*Math.PI),i.fill();i.restore(),i.beginPath(),i.arc(64,64,12,0,2*Math.PI),i.fillStyle="#0a2a38",i.fill(),i.lineWidth=2,i.strokeStyle="#9bf0ff",i.stroke();const s=new t.CanvasTexture(e);return s.minFilter=t.LinearFilter,s.magFilter=t.LinearFilter,s.generateMipmaps=!1,s.colorSpace=t.SRGBColorSpace,s})(),C=new t.Mesh(new t.CircleGeometry(.11,32),new t.MeshBasicMaterial({map:R,transparent:!0,side:t.FrontSide}));C.position.set(.98,1.22,y+.7),C.rotation.x=-.72,C.renderOrder=9,this.group.add(C);const A=new t.Mesh(new t.PlaneGeometry(this.width-.55,1.16),new t.MeshBasicMaterial({color:15265264,transparent:!0,opacity:.035,depthWrite:!1,side:t.FrontSide}));A.position.set(0,1.55,y+.045),A.renderOrder=4,this.group.add(A),this.updateTechDisplays(0,k,"riding"),this.passengerSeats=[];for(let t=4.5-n;t<=n-1.2;t+=1.25)this.passengerSeats.push({x:-.8,z:t},{x:.8,z:t});this.buildMergedSeats(o);const I=M(16777215,{emissive:16250608,emissiveIntensity:.96}),D=new t.CylinderGeometry(.15,.15,.04,20),L=M(5592659),G=new t.CylinderGeometry(.12,.12,.02,20),F=[],B=[];for(let t=2-n;t<=n-1;t+=2)[-.7,.7].forEach(e=>{F.push(this.composeMatrix(e,l-.12,t)),B.push(this.composeMatrix(e,l-.14,t))});this.addMergedMesh(D,L,F),this.addMergedMesh(G,I,B),D.dispose(),G.dispose();const O="high"===h?[-4.5,-.5,3.5]:[-3,3];this.cabinLightScale="high"===h?1:1.24,O.forEach(e=>{const i=new t.PointLight(16770749,1.7,14,2);i.position.set(0,l-.7,e),this.group.add(i),this.realLights.push(i)}),this.makeDoor(-4.3),this.addTechCabin(),this.addPilotRobot(y)}addTechCabin(){const e=this.width/2,i=this.length/2,s=this.deckHeight,a=this.doorZ,o=15261642,r=10919305;this.aisleSegs=[];const n=new t.BoxGeometry(.05,.02,.64),h=new t.BoxGeometry(.06,.02,.32),l=new t.MeshBasicMaterial({color:16767050,transparent:!0,userData:{live:1}}),d=new t.MeshBasicMaterial({color:14259456,transparent:!0,userData:{live:1}}),c=[],p=[];for(let t=.6-i;t<=i-.6;t+=.7)c.push(this.composeMatrix(-.5,.11,t),this.composeMatrix(.5,.11,t)),p.push(this.composeMatrix(0,.11,t));this.addMergedMesh(n,l,c),this.addMergedMesh(h,d,p),n.dispose(),h.dispose(),this.aisleSegs.push({m:l,az:0},{m:d,az:.7}),this.aisleMaxZ=i-.6;const m=.72+.2,u=(i,s,a,o,r,n)=>{const h=n-r;if(h<=.06)return;const l=new t.Mesh(new t.BoxGeometry(.03,a,h),_(o));l.position.set(i*(e-.16),s,(r+n)/2),this.group.add(l)};[-1,1].forEach(t=>{1===t?(u(t,1.02,.04,o,.2-i,a-m),u(t,1.02,.04,o,a+m,i-.2),u(t,.18,.03,r,.2-i,a-m),u(t,.18,.03,r,a+m,i-.2)):(u(t,1.02,.04,o,.2-i,i-.2),u(t,.18,.03,r,.2-i,i-.2))});const g=new t.Mesh(new t.BoxGeometry(.08,.03,this.length-1.2),_(3532477));g.position.set(0,s-.18,0),this.group.add(g)}addPilotRobot(e){const s=.47,a=new t.Group;this.pilotBaseY=.1,this.pilotYaw=Math.PI,this.pilotT=0,this.pilotTurnT=0,this.pilotHeadYaw=0,this.pilotBlinkT=-1,this.pilotNextBlink=1.4,a.position.set(-.8,this.pilotBaseY,e+1.42),a.rotation.y=this.pilotYaw,a.scale.setScalar(1.5),this.group.add(a),this.pilotRobot=a;const o=M(16054266,{emissive:3955304,emissiveIntensity:.4}),r=M(1054237,{emissive:928281,emissiveIntensity:.45}),n=M(198155,{emissive:467215,emissiveIntensity:.55}),h=_(7667517),l=_(10222149),d=new t.Matrix4,c=new t.Quaternion,p=new t.Euler,m=new t.Vector3,u=new t.Vector3(1,1,1),g=(t,e,i,s,a=0,o=0,r=0)=>{let n=t.clone();if(t.userData.aitwShared||t.dispose(),n.index){const t=n.toNonIndexed();n.dispose(),n=t}return p.set(a,o,r),c.setFromEuler(p),m.set(e,i,s),n.applyMatrix4(d.compose(m,c,u)),n},f=(t,e,i,s)=>{const a=this.roundedGeometry(t,e,i,s);return a.userData.aitwShared=!0,a},y=(e,s,a)=>{if(!e.length)return null;const o=i(e,!1);if(e.forEach(t=>t.dispose()),!o)return null;const r=new t.Mesh(o,s);return a.add(r),r},w=[],v=t=>(t.userData.aitwShared=!0,w.push(t),t),T=f(.072,.165,.078,.034),x=f(.092,.175,.1,.044),b=f(.082,.082,.084,.038),S=f(.125,.092,.205,.044),E=v(new t.SphereGeometry(.056,14,10)),R=v(new t.CylinderGeometry(.046,.046,.088,12)),C=v(new t.CylinderGeometry(.058,.058,.104,12)),P=v(new t.CylinderGeometry(.052,.052,.104,12)),A=v(new t.TorusGeometry(.05,.008,6,16)),I=v(new t.CylinderGeometry(.052,.064,.09,14)),D=v(new t.CylinderGeometry(.08,.08,.032,16)),L=v(new t.CylinderGeometry(.066,.066,.058,18)),k=v(new t.CylinderGeometry(.022,.022,.022,12)),G=v(new t.CylinderGeometry(.05,.05,.06,20)),F=[g(f(.25,.11,.21,.05),0,s,0)],B=[],O=[];[-1,1].forEach(t=>{F.push(g(x,.085*t,.362,0)),F.push(g(x,.085*t,.18,0)),F.push(g(S,.085*t,.052,.028)),B.push(g(C,.085*t,.272,0,0,0,Math.PI/2)),B.push(g(P,.085*t,.115,0,0,0,Math.PI/2)),O.push(g(A,.139*t,.272,0,0,Math.PI/2,0))}),y(F,o,a),y(B,r,a),y(O,h,a);const H=new t.Mesh(new t.RingGeometry(.08,.19,26),new t.MeshBasicMaterial({color:7667517,transparent:!0,opacity:.13,depthWrite:!1}));H.rotation.x=-Math.PI/2,H.position.y=.006,H.renderOrder=3,a.add(H);const N=new t.Group;N.position.y=s,a.add(N),this.pilotUpper=N;const z=t=>t-s,W=[g(f(.3,.33,.25,.115),0,z(.645),0)],U=[g(I,0,z(.83),0)],Y=[];[-1,1].forEach(t=>{W.push(g(T,.194*t,z(.66),.008,0,0,.09*-t)),W.push(g(T,.21*t,z(.492),.018,0,0,.03*-t)),W.push(g(b,.218*t,z(.376),.024)),U.push(g(E,.176*t,z(.742),.006)),U.push(g(R,.204*t,z(.578),.012,0,0,Math.PI/2)),U.push(g(R,.214*t,z(.424),.02,0,0,Math.PI/2)),Y.push(g(A,.202*t,z(.742),.006,0,Math.PI/2,0))}),y(W,o,N),y(U,r,N),y(Y,h,N);const V=new t.Group;V.position.set(0,z(.965),0),N.add(V),this.pilotHead=V,y([g(f(.38,.348,.345,.15),0,0,0)],o,V);const X=new t.Mesh(this.roundedGeometry(.314,.286,.278,.103),n);X.position.set(0,.01,.05),V.add(X);const K=[],$=[];[-1,1].forEach(t=>{K.push(g(D,.182*t,.005,-.015,0,0,Math.PI/2)),K.push(g(k,.228*t,.005,-.015,0,0,Math.PI/2)),$.push(g(L,.194*t,.005,-.015,0,0,Math.PI/2))}),y(K,r,V),y($,h,V);const Z=new t.Group;Z.position.set(0,.018,.168),V.add(Z),this.pilotEyes=Z,y([g(G,-.074,0,0,Math.PI/2,0,0),g(G,.074,0,0,Math.PI/2,0,0)],l,Z),w.forEach(t=>t.dispose())}updatePilotRobot(t,e,i,s){const a=this.pilotRobot;if(!a)return;const o=p?.22:1;this.pilotT+=t;const r=this.pilotT,n=t=>Math.atan2(Math.sin(t),Math.cos(t)),h=O.has(e),l=Math.max(.35,s);this.pilotTurnT=h?Math.min(l,this.pilotTurnT+t):0;let d=.09*Math.sin(.52*r)*o,c=0;if(this.pilotTurnT<=0)this.pilotYaw=Math.PI;else if(this.pilotTurnT<l){const t=this.pilotTurnT/l,e=N(H((t-.14)/.86)),i=N(H(t/.62));this.pilotYaw=Math.PI*(1-e),d=Math.max(-.75,Math.PI*(e-i)),c=.012*Math.abs(Math.sin(e*Math.PI*3))*o}else if(i){const e=Math.atan2(i.x-a.position.x,i.z-a.position.z);this.pilotYaw+=n(e-this.pilotYaw)*(1-Math.exp(2.2*-t)),d=Math.max(-.7,Math.min(.7,n(e-this.pilotYaw)))}if(a.rotation.y=this.pilotYaw,this.pilotHeadYaw+=(d-this.pilotHeadYaw)*(1-Math.exp(9*-t)),a.position.y=this.pilotBaseY+.006*Math.sin(1.5*r)*o+c,this.pilotUpper&&(this.pilotUpper.rotation.x=.012*Math.sin(1.5*r+.6)*o,this.pilotUpper.rotation.z=.02*Math.sin(.7*r)*o),this.pilotHead&&(this.pilotHead.rotation.y=this.pilotHeadYaw,this.pilotHead.rotation.x=.03*Math.sin(.83*r)*o),this.pilotEyes&&(this.pilotBlinkT<0&&r>=this.pilotNextBlink&&(this.pilotBlinkT=0,this.pilotNextBlink=r+2.2+2.8*Math.random()),this.pilotBlinkT>=0)){this.pilotBlinkT+=t;const e=this.pilotBlinkT/.16;this.pilotEyes.scale.y=e>=1?1:1-.88*Math.sin(Math.PI*e),e>=1&&(this.pilotBlinkT=-1)}}drawLidarSweep(t,e,i,s,a){t.strokeStyle="rgba(58,226,255,0.55)",t.lineWidth=1.5,t.beginPath(),t.arc(e,i,s,0,2*Math.PI),t.stroke(),t.strokeStyle="rgba(58,226,255,0.28)",t.beginPath(),t.arc(e,i,.55*s,0,2*Math.PI),t.stroke();const o=2.4*a%(2*Math.PI);t.fillStyle="rgba(58,226,255,0.16)",t.beginPath(),t.moveTo(e,i),t.arc(e,i,s,o-.9,o),t.closePath(),t.fill(),t.strokeStyle="#7dfcff",t.lineWidth=2,t.beginPath(),t.moveTo(e,i),t.lineTo(e+Math.cos(o)*s,i+Math.sin(o)*s),t.stroke(),t.fillStyle="#82ffbd",[[.42,1.1],[.72,3.9],[.55,5.2]].forEach(a=>{t.beginPath(),t.arc(e+Math.cos(a[1])*s*a[0],i+Math.sin(a[1])*s*a[0],2.4,0,2*Math.PI),t.fill()})}drawPanelBackground(t){const{ctx:e,width:i,height:s}=t;t.bgLayer||(t.bgLayer=A(i,s,t=>{t.fillStyle="rgba(0, 12, 18, 0.92)",t.fillRect(0,0,i,s),t.strokeStyle="rgba(62, 239, 255, 0.82)",t.lineWidth=3,t.strokeRect(8,8,i-16,s-16),t.strokeStyle="rgba(62, 239, 255, 0.14)",t.lineWidth=1,t.beginPath();for(let e=54;e<s;e+=54)t.moveTo(18,e),t.lineTo(i-18,e);t.stroke(),I(t,"AITAIWAN DIRECT SERVICE",26,38,"#eaffff",19,"900"),I(t,`DIRECT ${W}`,26,212,"#82ffbd",19,"800"),I(t,"SENSOR FUSION · V2X LINK · PATH LOCK",26,240,"#a9f7ff",16,"800")})),e.clearRect(0,0,i,s),e.drawImage(t.bgLayer,0,0)}updateTechDisplays(t,e=0,i="riding"){if(!this.statusDisplay)return;const s=Math.max(0,Math.round(e/k*117)),a=B.has(i)?"ARRIVAL":"CRUISE";if(a===this.lastDisplayPhase&&t-this.lastDisplayT<this.displayUpdateInterval)return;this.lastDisplayT=t,this.lastDisplayPhase=a;const o=this.statusDisplay,r=o.ctx,n=D,h=Math.sin(6*t)>-.2;this.drawPanelBackground(o),this.drawRouteStrip(r,58,454,104,t,128,15,n,h),I(r,`SPEED ${String(s).padStart(3,"0")} KM/H`,26,178,"#ffffff",26,"900"),this.drawLidarSweep(r,452,200,34,t),r.fillStyle="ARRIVAL"===a?"#ffeaa0":"#39ff8a",r.fillRect(434,18,38,38),r.strokeStyle="rgba(255,255,255,0.52)",r.lineWidth=3,r.strokeRect(430,14,46,46),o.texture.needsUpdate=!0}makeDoor(e){this.doorZ=e;const i=new t.Group,s=this.width/2-.08,a=M(5067608,{emissive:1382169,emissiveIntensity:.16}),o=M(3159611,{emissive:725012,emissiveIntensity:.28}),r=M(1914176,{emissive:860200,emissiveIntensity:.34}),n=1.18;[-1,1].forEach(t=>{const o=this.pillow(.12,2,.1,.03,a);o.position.set(s-.02,1.08,e+t*n/2),i.add(o)});const h=this.pillow(.12,.14,n+.12,.03,a);h.position.set(s-.02,2.05,e),i.add(h);const l=this.pillow(.16,.06,n+.12,.02,a);l.position.set(s-.03,.12,e),i.add(l),this.doorLeaves=[],[-1,1].forEach(h=>{const l=new t.Group;l.position.set(s-.06,0,e+h*(n/2)),l.userData.side=h;const d=this.pillow(.06,1.8,n/2-.04,.02,o);d.position.set(0,1,n/4*-h);const c=this.pillow(.03,1.3,n/2-.16,.02,r);c.position.set(-.03,1.1,n/4*-h);const p=this.pillow(.07,1.8,.05,.02,a);p.position.set(0,1,-h*(n/2-.03)),l.add(d,c,p),i.add(l),this.doorLeaves.push(l)});const d=(()=>{const e=document.createElement("canvas");e.width=256,e.height=64;const i=e.getContext("2d"),s=new t.CanvasTexture(e);s.minFilter=t.NearestFilter,s.magFilter=t.NearestFilter,s.generateMipmaps=!1,s.colorSpace=t.SRGBColorSpace;let a="直達",o=!0;const r=()=>{if(i.fillStyle="#062b16",i.fillRect(0,0,256,64),i.strokeStyle="#39ff8a",i.lineWidth=4,i.strokeRect(4,4,248,56),o){const t=Array.from(a).some(t=>t.codePointAt(0)>127);i.fillStyle="#ffffff",i.font=t?"900 34px "+D:'bold 34px "Courier New", monospace',i.textAlign="center",i.textBaseline="middle",i.fillText(a,128,34)}s.needsUpdate=!0};return r(),{texture:s,draw(t){o=t,r()},setLabel(t){a=t,r()}}})();this.signDraw=d.draw,this.signSetLabel=d.setLabel,this.signTextOn=!0;const c=new t.Mesh(new t.PlaneGeometry(1,.25),new t.MeshBasicMaterial({map:d.texture}));c.position.set(s-.12,2.24,e),c.rotation.y=-Math.PI/2,i.add(c);const p=new t.Mesh(new t.BoxGeometry(.02,.04,n),_(16777215));p.position.set(s-.12,2.02,e),i.add(p),this.exitLight=new t.PointLight(16777215,.6,3.2,2),this.exitLight.position.set(s-.4,1.8,e),i.add(this.exitLight);const m=document.createElement("canvas");m.width=m.height=128;const u=m.getContext("2d"),g=u.createRadialGradient(64,64,0,64,64,64);g.addColorStop(0,"rgba(255,255,255,1)"),g.addColorStop(.35,"rgba(255,255,255,0.82)"),g.addColorStop(.7,"rgba(255,255,255,0.20)"),g.addColorStop(1,"rgba(255,255,255,0)"),u.fillStyle=g,u.fillRect(0,0,128,128);const f=new t.CanvasTexture(m);this.doorGlow=new t.Sprite(new t.SpriteMaterial({map:f,transparent:!0,opacity:0,blending:t.AdditiveBlending,depthWrite:!1,fog:!1})),this.doorGlow.position.set(s+.8,1.45,e),this.doorGlow.scale.setScalar(.1),i.add(this.doorGlow),this.group.add(i)}setSignText(t){this.signTextOn!==t&&(this.signTextOn=t,this.signDraw&&this.signDraw(t))}setDoorDest(t){this.signSetLabel&&this.signSetLabel(t)}setDoorOpen(t){this.doorLeaves.forEach(e=>{e.rotation.y=-e.userData.side*t*1.62}),this.exitLight&&(this.exitLight.intensity=.6+1.6*t)}updateAisleFlash(t,e){if(!this.aisleSegs||0===this.aisleSegs.length)return;if(!e&&!1===this._aisleActive)return;if(e&&t-(this._lastAisleUpdateT||0)<.05)return;this._aisleActive=e,this._lastAisleUpdateT=t;const i=p?2:5,s=p?.42:.16,a=p?.3:.84;for(const o of this.aisleSegs)o.m.opacity=e?s+a*(.5+.5*Math.sin(t*i-1.35*(this.aisleMaxZ-o.az))):1}buildMergedSeats(t){const e=.85,i=.5,s=this.seatAssets,a={base:[],back:[],head:[],trimTop:[],trimFront:[],leg:[],foot:[]};for(const t of this.passengerSeats){const{x:e,z:s}=t;a.base.push(this.composeMatrix(e,i,s)),a.back.push(this.composeMatrix(e,i+.43,s+.35,-.1)),a.head.push(this.composeMatrix(e,i+.93,s+.3,-.1)),a.trimTop.push(this.composeMatrix(e,i+.84,s+.27,-.1)),a.trimFront.push(this.composeMatrix(e,.545,s-.425+.05)),a.leg.push(this.composeMatrix(e,.25,s)),a.foot.push(this.composeMatrix(e,i-.41,s))}this.addMergedMesh(this.roundedGeometry(e,.16,e,.05),t,a.base),this.addMergedMesh(this.roundedGeometry(e,.86,.16,.05),t,a.back),this.addMergedMesh(this.roundedGeometry(.442,.2,.14,.05),t,a.head),this.addMergedMesh(s.trimTopGeo,s.trimTopMat,a.trimTop),this.addMergedMesh(s.trimFrontGeo,s.trimFrontMat,a.trimFront),this.addMergedMesh(s.legGeo,s.legMat,a.leg),this.addMergedMesh(s.footGeo,s.footMat,a.foot)}buildSeatScreens(){this.seatScreenTex=P(512,336),this.lastPanelT=-1,this._lastPanelPhase="",this._lastPanelSecond=-1,this._lastPanelJourneyBucket=-1;const e=this.passengerSeats||[];this.seatScreenAssets={frameMat:M(330771,{emissive:202015,emissiveIntensity:.45}),bezelTopMat:_(16767050),bezelBottomMat:_(2072527),panelMat:new t.MeshBasicMaterial({map:this.seatScreenTex.texture,transparent:!0,opacity:.99,side:t.FrontSide}),bezelTopGeo:new t.BoxGeometry(.52,.018,.018),bezelBottomGeo:new t.BoxGeometry(.52,.014,.018),panelGeo:new t.PlaneGeometry(.5,.33),postGeo:new t.CylinderGeometry(.022,.03,1,8),postMat:M(1253676)};const i=[],s=[],a=[],o=[],r=[],n=new Map;e.forEach(t=>n.set(t.x,Math.min(n.get(t.x)??1/0,t.z)));const h=(e,i,s,a,o)=>{const r=this.composeMatrix(s,a,o);e.push((new t.Matrix4).multiplyMatrices(i,r))};e.forEach(t=>{const e=t.z-.78,l=this.composeMatrix(t.x,1.04,e,-.12);h(i,l,0,0,-.018),h(s,l,0,.205,.004),h(a,l,0,-.205,.004),h(o,l,0,0,.006),Math.abs(t.z-n.get(t.x))<.01&&h(r,l,0,-.55,-.02)});const l=this.seatScreenAssets;this.addMergedMesh(this.roundedGeometry(.58,.42,.04,.02),l.frameMat,i),this.addMergedMesh(l.bezelTopGeo,l.bezelTopMat,s),this.addMergedMesh(l.bezelBottomGeo,l.bezelBottomMat,a),this.addMergedMesh(l.panelGeo,l.panelMat,o,7),this.addMergedMesh(l.postGeo,l.postMat,r)}setReducedPanelRate(t){this.panelRateReduced=Boolean(t),this.displayUpdateInterval=this.panelRateReduced?.65:"high"===h?.18:"balanced"===h?.34:.5,this.lastDisplayT=-999,this.lastPanelT=-1}updateSeatScreens(t,e,i){if(!this.seatScreenTex)return;const s=Math.min(1,Math.max(0,i)),a="riding"===e||"stopping"===e,o=a?this.panelRateReduced?.5:"high"===h?.12:"balanced"===h?.28:.4:this.panelRateReduced?1:"high"===h?.5:.75,r=Math.floor(Date.now()/1e3),n=Math.round(100*s);!a&&e===this._lastPanelPhase&&r===this._lastPanelSecond&&n===this._lastPanelJourneyBucket||this.lastPanelT>=0&&t-this.lastPanelT<o||(this.lastPanelT=t,this._lastPanelPhase=e,this._lastPanelSecond=r,this._lastPanelJourneyBucket=n,this.routeProg=s,this.drawRoutePanel(t,e))}drawRouteStrip(t,e,i,s,a,o,r,n,h){const l=z.length,d=e+(i-e)*(l>1?1/(l-1):1)*Math.min(1,Math.max(0,this.routeProg));t.lineCap="round",t.strokeStyle="rgba(120,150,170,0.45)",t.lineWidth=6,t.beginPath(),t.moveTo(e,s),t.lineTo(i,s),t.stroke(),t.beginPath(),t.moveTo(e,s),t.lineTo(d,s),t.strokeStyle="rgba(52,234,255,0.28)",t.lineWidth=14,t.stroke(),t.strokeStyle="#34eaff",t.lineWidth=6,t.stroke();const c=e+.5*a%1*(d-e);t.fillStyle="#eaffff",t.beginPath(),t.arc(c,s,4,0,2*Math.PI),t.fill(),t.textAlign="center";for(let a=0;a<l;a++){const c=e+a/(l-1)*(i-e),p=1===a,m=c<=d+2;t.beginPath(),t.arc(c,s,p?9:6,0,2*Math.PI),t.fillStyle=p?"#82ffbd":m?"#34eaff":"#46606e",t.fill(),p&&(t.strokeStyle="rgba(130,255,189,"+(h?.95:.4)+")",t.lineWidth=3,t.beginPath(),t.arc(c,s,14,0,2*Math.PI),t.stroke()),t.fillStyle=p?"#aeffd6":m?"#bafcff":"#7f97a4",t.font=(p?"800":"600")+" "+r+"px "+n,t.fillText(z[a],c,o)}const p=8+2*Math.sin(5*a);t.strokeStyle="#ffd76a",t.lineWidth=3,t.beginPath(),t.arc(d,s,p,0,2*Math.PI),t.stroke(),t.fillStyle="#ffd76a",t.beginPath(),t.moveTo(d,s-p-4),t.lineTo(d-5,s-p-12),t.lineTo(d+5,s-p-12),t.closePath(),t.fill(),t.textAlign="left"}drawRoutePanel(t,e){const i=this.seatScreenTex,s=i.ctx,a=i.width,o=i.height,r=D,n=new Date,h=t=>String(t).padStart(2,"0"),l=n.getFullYear()+"/"+h(n.getMonth()+1)+"/"+h(n.getDate()),d=h(n.getHours())+":"+h(n.getMinutes())+":"+h(n.getSeconds()),c=Math.sin(6*t)>-.2;i.bgLayer||(i.bgLayer=A(a,o,t=>{const e=t.createLinearGradient(0,0,0,o);e.addColorStop(0,"#04141d"),e.addColorStop(1,"#020a10"),t.fillStyle=e,t.fillRect(0,0,a,o),t.strokeStyle="rgba(58,226,255,0.07)",t.lineWidth=1,t.beginPath();for(let e=0;e<a;e+=32)t.moveTo(e,0),t.lineTo(e,o);for(let e=0;e<o;e+=32)t.moveTo(0,e),t.lineTo(a,e);t.stroke(),t.strokeStyle="rgba(58,226,255,0.85)",t.lineWidth=4,t.strokeRect(7,7,a-14,o-14),t.textBaseline="alphabetic",t.textAlign="left",t.fillStyle="#9bf0ff",t.font="800 24px "+r,t.fillText("AITaiwan",24,44),t.fillStyle="#ffd76a",t.font="700 18px "+r,t.fillText("車次 "+L,160,44),t.strokeStyle="rgba(58,226,255,0.35)",t.lineWidth=2,t.beginPath(),t.moveTo(20,76),t.lineTo(a-20,76),t.stroke()})),s.drawImage(i.bgLayer,0,0),s.textBaseline="alphabetic",s.textAlign="right",s.fillStyle="#bafcff",s.font='700 22px "Courier New", monospace',s.fillText(d,a-24,42),s.fillStyle="#7fc8dd",s.font='600 15px "Courier New", monospace',s.fillText(l,a-24,62),s.textAlign="left",this.drawRouteStrip(s,56,a-56,134,t,164,15,r,c);const p=!["riding","stopping"].includes(e);s.textAlign="center",s.fillStyle="rgba(20,80,45,0.55)",s.fillRect(20,196,a-40,56),s.strokeStyle="#82ffbd",s.lineWidth=2,s.strokeRect(20,196,a-40,56),s.fillStyle="#aeffd6",s.font="900 27px "+r,s.fillText(p?W:"下一站 "+W,a/2,233),s.textAlign="left",s.fillStyle="#82ffbd",s.font="800 24px "+r,s.fillText(p?W:"下一站 "+W,24,o-26),i.texture.needsUpdate=!0}}let Y=null,V=!1;function X(t,e=!0,i="重新載入場景"){const s=document.getElementById("runtime-status"),a=document.getElementById("runtime-message"),o=document.getElementById("runtime-retry");a&&(a.textContent=t),o&&(o.hidden=!e,o.textContent=i),s&&(s.hidden=!1),e&&o&&requestAnimationFrame(()=>o.focus())}function K(){const t=document.getElementById("runtime-status");t&&(t.hidden=!0)}function $(t,e,i){if(V)return;V=!0,Y&&(Y._fatal=!0,Y.dispose());const s=(t=>{const e=t&&(t.message||t.reason||t);return String(e||"Unknown error").slice(0,300)})(e);try{console.error(`[AITaiwan Bus ${u}] ${t} at ${i}:`,e)}catch{}X("3D 場景暫時無法繼續,請按下方按鈕重新載入。"),y({aitwBusError:!0,code:t,stage:i,message:s,buildVersion:u})}const Z=document.getElementById("runtime-retry");Z&&Z.addEventListener("click",()=>{!Y||"complete"!==Y.phase||Y._fatal?y({aitwReloadRequest:!0,buildVersion:u}):Y.retryNavigation()}),addEventListener("error",t=>$("UNCAUGHT_RUNTIME_ERROR",t.error||t.message,"window.error")),addEventListener("unhandledrejection",t=>$("UNHANDLED_PROMISE_REJECTION",t.reason,"unhandledrejection"));const q=t=>t.emissive&&Math.max(t.emissive.r,t.emissive.g,t.emissive.b)*t.emissiveIntensity>.02,j=(e,s=[])=>{e.updateMatrixWorld(!0);const a=e.matrixWorld.clone().invert(),o=new Map,r=new t.Matrix4,n=t=>{if(s.includes(t))return;if(t.children.forEach(n),!t.isMesh||t.isInstancedMesh)return;const e=t.material,i=e.userData.live?e.uuid:[e.type,e.map&&e.map.uuid,q(e)&&e.emissive.getHex()+"*"+e.emissiveIntensity,e.transparent,e.opacity,e.side,e.depthWrite,e.polygonOffset,e.blending,t.renderOrder].join();o.has(i)||o.set(i,[]),o.get(i).push(t)};n(e);for(const s of o.values()){if(s.length<2)continue;const o=s[0].material,n=s.every(t=>t.material===o),h=s.map(e=>{const i=e.geometry.index?e.geometry.toNonIndexed():e.geometry.clone();for(const t in i.attributes)/^(position|normal|uv)$/.test(t)||i.deleteAttribute(t);if(i.applyMatrix4(r.multiplyMatrices(a,e.matrixWorld)),!n){const s=e.material.color,a=i.attributes.position.count,o=new Float32Array(3*a);for(let t=0;t<3*a;t+=3)o[t]=s.r,o[t+1]=s.g,o[t+2]=s.b;i.setAttribute("color",new t.BufferAttribute(o,3))}return i}),l=i(h,!1);if(h.forEach(t=>t.dispose()),!l)continue;s.forEach(t=>t.removeFromParent());const d=n?o:o.clone();n||(d.color.set(16777215),d.vertexColors=!0,q(d)||!d.emissive||d.emissive.set(0));const c=new t.Mesh(l,d);c.renderOrder=s[0].renderOrder,e.add(c)}};class J{constructor(){this.container=document.getElementById("canvas-container"),this.clock=new t.Clock,this.scenePhase=f(),this._daySkyNight=new t.Color(133140),this._daySkyDay=new t.Color(10206412),this._dayFogNight=new t.Color(330516),this._dayFogDay=new t.Color(12833495),this._dayTmpColor=new t.Color,this.busSpeed=k,this.phase="riding",this.phaseT=0,this.totalT=0,this.STAND_TIME=.95,this.WALK_TIME=1.15,this.ADVANCE_TIME=2.7,this.TURN_TIME=.95,this.DOOR_TIME=1.05,this.ARRIVAL_MESSAGE_TIME=3,this.EXIT_TIME=1.9,this.EXIT_END_X=3.6,this.seatPos=new t.Vector3(.8,1.4,5.75),this.standY=1.62,this.streetEyeY=1.22,this.inertiaLean=0,this.inertiaLeanVel=0,this.flashing=!1,this.flashOpacity=0,this.navigationAttempted=!1,this.signBlinking=!1,this.signT=0,this.rideElapsed=0,this._navigationStartTimer=0,this._navigationRecoveryTimer=0,this._completeHeartbeatTimer=0,this.arrivalMessage="歡迎進入算力台灣城市商圈站 感謝您的搭乘",this._arrivalTypedCount=-1,this._arrivalDialogRaf=0,this._arrivalHideTimer=0,this._previousFocus=null,this.arrivalDistrict=null,this.lookYaw=0,this.lookPitch=0,this.lookTargetYaw=0,this.lookTargetPitch=0,this._frameInterval=1e3/c,this._pixelRatioCap=l,this._lastFrame=0,this._paused=document.hidden,this._startupReady=!1,this._startupTimer=0,this._disposed=!1,this._gov={t0:0,lv:0,bad:0,good:0,k:0,ck:0,lr:0,ema:0,bat:!1,cd:0,up:-1e9,rema:0},this._appliedLv=0,this._rafPrev=0,this._navFailedShown=!1,this._lastRenderAt=0,this._awaitRestoreFrame=!1,this._batteryOff=null,this._sceneSwitchTimer=0,this.motionScale=p?.2:1,this._raf=this.animate.bind(this),this._rafId=0,this._firstFrameRendered=!1,this._lastHeartbeatAt=0,this._renderCount=0,this._fatal=!1,this._contextRestoreTimer=0;try{this.init(),this.buildLighting(),this.bus=new U(this.scene),this.pickPlayerSeat(),this.buildCity(),this.buildArrivalDistrict(),this.bus.buildSeatScreens(),this.setupLook(),this.prepareDirectRide(),this.bus.doorLeaves.forEach(t=>j(t)),j(this.bus.group,[...this.bus.doorLeaves,this.bus.pilotRobot]),j(this.scroll),j(this.arrivalDistrict),j(this.scene,[this.bus.group,this.scroll,this.arrivalDistrict,this.moon,this.sun]),this.freezeStaticMeshes(this.scene),this.bindEvents(),this.bindBattery(),this.scheduleNextScenePhaseSwitch()}catch(t){try{this.dispose()}catch{}throw t}}init(){this.scene=new t.Scene,this.scene.background=new t.Color(0),this.scene.fog=new t.FogExp2(0,.008),this.camera=new t.PerspectiveCamera(70,Math.max(1,innerWidth)/Math.max(1,innerHeight),.1,700),this.camera.rotation.order="YXZ",this.camera.position.copy(this.seatPos),this.camera.rotation.set(0,0,0),this.renderer=new t.WebGLRenderer({alpha:!1,antialias:aAG||"low"!==h,depth:!0,stencil:!1,preserveDrawingBuffer:!1,precision:aAG||"high"===h?"highp":"mediump",powerPreference:aAG?"default":"high"===h?o?"default":"high-performance":"low-power"}),this.renderer.setClearColor(0,1),this.refineTier(),R=Math.min(aT>=2?8:aT>=1?4:2,this.renderer.capabilities.getMaxAnisotropy()),t.SRGBColorSpace&&(this.renderer.outputColorSpace=t.SRGBColorSpace),this.renderer.toneMapping=t.ACESFilmicToneMapping,this.container.appendChild(this.renderer.domElement),this._contextLost=!1;const e=this.renderer.domElement;this._onContextLost=t=>{t.preventDefault(),this._disposed||this._contextLost||(this._contextLost=!0,this.stopAnimationLoop(),X("顯示晶片正在恢復 3D 畫面,請稍候…",!1),y({aitwContextStatus:"lost",buildVersion:u}),this._contextRestoreTimer&&clearTimeout(this._contextRestoreTimer),this._contextRestoreTimer=window.setTimeout(()=>{this._contextRestoreTimer=0,this._contextLost&&!this._disposed&&$("WEBGL_CONTEXT_RESTORE_TIMEOUT","WebGL context did not recover in time","webglcontextlost")},1e4))},this._onContextRestored=()=>{if(!this._disposed){this._contextRestoreTimer&&clearTimeout(this._contextRestoreTimer),this._contextRestoreTimer=0,this._contextLost=!1,this._awaitRestoreFrame=!0;try{this.renderer&&this.renderer.resetState()}catch(t){return void $("WEBGL_CONTEXT_RESTORE_FAILED",t,"webglcontextrestored")}this.clock.getDelta(),this._lastFrame=performance.now(),this.resetGovSamples(),"complete"===this.phase?this.finishRestoreFrame():(this.armRestoreGuard(),this._paused||this.startAnimationLoop())}},e.addEventListener("webglcontextlost",this._onContextLost,!1),e.addEventListener("webglcontextrestored",this._onContextRestored),this.resizeRenderer(),this.flashEl=document.getElementById("flash"),this.hideFlashOverlay(),this.arrivalDialogEl=document.getElementById("arrival-dialog"),this.arrivalTypewriterEl=document.getElementById("arrival-typewriter"),this.arrivalCloseEl=document.getElementById("arrival-close"),this.arrivalAvatarEl=document.querySelector(".arrival-avatar"),this._onArrivalClose=()=>this.closeArrivalDialog(),this._onArrivalKeyDown=t=>{"Escape"===t.key?(t.preventDefault(),this.closeArrivalDialog()):"Tab"===t.key&&(t.preventDefault(),this.arrivalCloseEl&&this.arrivalCloseEl.focus())},this._onAvatarError=()=>{const t=this.arrivalAvatarEl&&this.arrivalAvatarEl.parentElement;t&&t.classList.add("image-failed")},this.arrivalCloseEl&&this.arrivalCloseEl.addEventListener("click",this._onArrivalClose),this.arrivalDialogEl&&this.arrivalDialogEl.addEventListener("keydown",this._onArrivalKeyDown),this.arrivalAvatarEl&&(this.arrivalAvatarEl.addEventListener("error",this._onAvatarError,{once:!0}),this.arrivalAvatarEl.complete&&!this.arrivalAvatarEl.naturalWidth&&this._onAvatarError()),this.hideArrivalDialog(!0)}showArrivalDialog(){this.arrivalDialogEl&&(this._arrivalDialogRaf&&cancelAnimationFrame(this._arrivalDialogRaf),this._arrivalHideTimer&&clearTimeout(this._arrivalHideTimer),this._arrivalHideTimer=0,this._previousFocus=document.activeElement,this._arrivalTypedCount=-1,this.arrivalTypewriterEl&&(this.arrivalTypewriterEl.textContent=""),this.arrivalDialogEl.classList.remove("is-closing"),this.arrivalDialogEl.hidden=!1,this.container&&(this.container.inert=!0),this._arrivalDialogRaf=requestAnimationFrame(()=>{this._arrivalDialogRaf=0,this.arrivalDialogEl&&(this.arrivalDialogEl.classList.add("is-visible"),this.arrivalCloseEl&&this.arrivalCloseEl.focus())}))}hideArrivalDialog(t=!1){if(!this.arrivalDialogEl)return;this._arrivalDialogRaf&&cancelAnimationFrame(this._arrivalDialogRaf),this._arrivalHideTimer&&clearTimeout(this._arrivalHideTimer),this._arrivalDialogRaf=0,this._arrivalHideTimer=0,this.arrivalDialogEl.classList.remove("is-visible"),this.arrivalDialogEl.classList.toggle("is-closing",!t),this.container&&(this.container.inert=!1);const e=()=>{this._arrivalHideTimer=0,this.arrivalDialogEl&&(this.arrivalDialogEl.hidden=!0,this.arrivalDialogEl.classList.remove("is-closing"),this._previousFocus&&"function"==typeof this._previousFocus.focus&&this._previousFocus.focus(),this._previousFocus=null)};t||p?e():this._arrivalHideTimer=window.setTimeout(e,340)}beginArrivalMessage(){this.phase="arrivalmessage",this.phaseT=0,this.showArrivalDialog()}closeArrivalDialog(){this.hideArrivalDialog(),"arrivalmessage"===this.phase&&(this.phase="turning",this.phaseT=0)}updateArrivalTypewriter(){if(!this.arrivalTypewriterEl)return;const t=Math.min(this.arrivalMessage.length,Math.floor(34*this.phaseT));t!==this._arrivalTypedCount&&(this._arrivalTypedCount=t,this.arrivalTypewriterEl.textContent=this.arrivalMessage.slice(0,t))}showFlashOverlay(){this.flashEl&&!this._flashVisible&&(this.flashEl.style.display="block",this.flashEl.style.visibility="visible",this._flashVisible=!0)}hideFlashOverlay(){this.flashEl&&!1!==this._flashVisible&&(this.flashEl.style.opacity="0",this.flashEl.style.visibility="hidden",this.flashEl.style.display="none",this._flashVisible=!1)}startCompleteHeartbeat(){if(this._completeHeartbeatTimer||this._disposed||this._fatal||document.hidden||"complete"!==this.phase)return;const t=()=>{this._completeHeartbeatTimer=0,this._disposed||this._fatal||document.hidden||"complete"!==this.phase||(this._lastHeartbeatAt=performance.now(),y({aitwHeartbeat:!0,buildVersion:u,phase:this.phase,renderCount:this._renderCount}),this._completeHeartbeatTimer=window.setTimeout(t,3e3))};this._completeHeartbeatTimer=window.setTimeout(t,3e3)}stopCompleteHeartbeat(){this._completeHeartbeatTimer&&(clearTimeout(this._completeHeartbeatTimer),this._completeHeartbeatTimer=0)}finishExperience(t=!1){this.navigationAttempted||this._disposed||(this.navigationAttempted=!0,this.phase="complete",this.phaseT=0,this.flashing=!1,this.flashOpacity=1,this.showFlashOverlay(),this.flashEl&&(this.flashEl.style.opacity="1"),this.stopAnimationLoop(),this._sceneSwitchTimer&&clearTimeout(this._sceneSwitchTimer),this._sceneSwitchTimer=0,this.startCompleteHeartbeat(),this._navigationStartTimer&&clearTimeout(this._navigationStartTimer),this._navigationStartTimer=window.setTimeout(()=>{this._navigationStartTimer=0,y({aitwNavigate:!0,userRetry:t,buildVersion:u}),this._navigationRecoveryTimer&&clearTimeout(this._navigationRecoveryTimer),this._navigationRecoveryTimer=window.setTimeout(()=>{this._navigationRecoveryTimer=0,this._disposed||"complete"!==this.phase||(this.flashOpacity=0,this.hideFlashOverlay(),this._navFailedShown=!0,X("未能自動前往目的頁面,請按下方按鈕重試。",!0,"再次前往"))},4e3)},80))}retryNavigation(){this._disposed||"complete"!==this.phase||(this._navigationRecoveryTimer&&clearTimeout(this._navigationRecoveryTimer),this._navigationRecoveryTimer=0,this._navFailedShown=!1,K(),this.navigationAttempted=!1,this.finishExperience(!0))}freezeStaticMeshes(t){t&&t.traverse(t=>{t.isMesh&&(t.updateMatrix(),t.matrixAutoUpdate=!1)})}buildLighting(){this.ambient=new t.AmbientLight,this.scene.add(this.ambient),this.hemi=new t.HemisphereLight,this.scene.add(this.hemi),this.dir=new t.DirectionalLight,this.scene.add(this.dir),this.rim=new t.DirectionalLight(11978984,.3),this.rim.position.set(-6,6,-10),this.scene.add(this.rim),this.moon=new t.Mesh(new t.CircleGeometry(8,32),new t.MeshBasicMaterial({color:14284543,transparent:!0,opacity:1,depthWrite:!1})),this.moon.position.set(-70,60,-280),this.moon.material.fog=!1,this.scene.add(this.moon),this.sun=new t.Mesh(new t.CircleGeometry(10,32),new t.MeshBasicMaterial({color:16773823,transparent:!0,opacity:0,depthWrite:!1})),this.sun.position.set(78,66,-300),this.sun.material.fog=!1,this.scene.add(this.sun)}buildCity(){this.ROAD_HALF_W=11,this.scroll=new t.Group,this.scene.add(this.scroll);const e=600,s=this.ROAD_HALF_W,a=(i,s,a,o,r)=>{const n=new t.Mesh(new t.PlaneGeometry(i,2*e,1,80),M(o,r));n.rotation.x=-Math.PI/2,n.position.set(s,a,-300),this.scene.add(n)};a(2*s,0,-.3,3158840),[-1,1].forEach(t=>{a(160,t*(s+80),-.32,1382170),a(.25,t*(s-.5),-.285,13678959,{polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-4})}),new t.Matrix4;const o=(e,i,s)=>{const a=new t.InstancedMesh(e,i,s.length);return s.forEach((t,e)=>a.setMatrixAt(e,t)),a.frustumCulled=!1,this.scroll.add(a),a},r=(new t.Matrix4).makeRotationX(-Math.PI/2),n=this.bus.doorZ-F,l=[],d="high"===h?14:"balanced"===h?18:22;[-s/2,0,s/2].forEach(i=>{for(let s=0;s>-e;s-=d)i>0&&Math.abs(s-n)<3.4||l.push((new t.Matrix4).makeTranslation(i,-.275,s).multiply(r))}),o(new t.PlaneGeometry(.22,3.2),M(15196103,{polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-4}),l),this.streetlightAssets={metalMat:M(4018786),lampMat:_(12187391)};const c=[],p="high"===h?55:"balanced"===h?72:88,m=this.streetlightAssets;for(let i=0,a=0;i>-e;i-=p,a++)c.push((new t.Matrix4).makeRotationY(a%2?0:Math.PI).setPosition((a%2?1:-1)*(s+1.5),0,i));o(i([new t.CylinderGeometry(.12,.16,7,8).translate(0,2.9,0),new t.BoxGeometry(2.2,.12,.12).translate(-1,6.3,0)],!1),m.metalMat,c),o(new t.BoxGeometry(.7,.25,.4).translate(-2,6.2,0),m.lampMat,c);const u=[["#120015","#ff3da6","HOTEL"],["#151200","#ffd23d","BANK"],["#100010","#9d3dff","NEON"],["#001008","#3dff7a","EXIT"],["#150005","#ff6a3d","BAR"]],g=C(128,64,5,(t,e)=>((t,e,i,s)=>{t.fillStyle=e,t.fillRect(0,0,128,64),t.fillStyle=i,t.font='bold 22px "Courier New", monospace',t.textAlign="center",t.textBaseline="middle",t.fillText(s,64,32),t.fillStyle="rgba(0,0,0,0.35)";for(let e=0;e<64;e+=3)t.fillRect(0,e,128,1)})(t,...u[e])),f=u.map((e,i)=>[g.geo(new t.PlaneGeometry(4,2),i),g.mat]);let y=0;const w="high"===h?2:1;[-1,1].forEach(i=>{for(let a=0;a<w;a++){const o=s+8+18*a;for(let s=6*-a;s>-e;s-=0===a?84:116)Math.abs(s+F)<64||this.makeBuilding(i*(o+(4*Math.random()-2)),s,(new t.Color).setHSL(.61803398875*y%1,.5,.34).getHex(),f[y%f.length],0===a?1:1.6,a),y++}})}makeBuilding(e,i,s,a,o,r){const n=new t.Group,h=6+5*Math.random(),l=6+5*Math.random(),d=(8+22*Math.random())*o,c=new t.Mesh(new t.BoxGeometry(h,d,l),M(s));c.position.y=d/2,n.add(c);const p=Math.max(3,Math.floor(d/5)),m=e>0?-1:1,u=Math.max(2,Math.floor(l/3.2));for(let e=0;e<u;e++)for(let i=0;i<p;i++){if(Math.random()<.68)continue;const s=new t.Mesh(T,Math.random()<.3?b:x);s.position.set(m*(h/2+.05),1.2+i*(d-2.4)/Math.max(1,p-1),-l/2+.8+e*(l-1.6)/Math.max(1,u-1)),s.rotation.y=m*Math.PI/2,n.add(s)}if(0===r){const e=new t.Mesh(...a);e.position.set(0,d+1.4,0),e.rotation.y=-m*Math.PI/2,n.add(e)}n.position.set(e,-.3,i),this.scroll.add(n)}buildArrivalDistrict(){const e="day"===this.scenePhase,i=this.bus,s=new t.Group;this.arrivalDistrict=s,this.scene.add(s);const a=[["#14243a","#6f8ea6","#34eaff"],["#2d183c","#8c86a3","#ff7ae6"],["#302713","#a49a82","#ffd76a"]],o=C(256,512,3,(t,i)=>((t,e,i,s,a)=>{const o=t.createLinearGradient(0,0,0,512);o.addColorStop(0,i),o.addColorStop(1,a?"#3a4652":"#05080d"),t.fillStyle=o,t.fillRect(0,0,256,512);for(let i=0;i<16;i++)for(let s=0;s<5;s++){const o=18+47*s,r=24+29*i,n=(7*i+11*s+13*e)%6<(a?1:3);t.fillStyle=a?n?"#e6eef2":(i+s+e)%3==0?"#8fa7b8":"#a9bfcc":n?s%3==0?"#9fe0ff":"#ffd98a":"#101923",t.fillRect(o,r,27,14)}t.fillStyle=s,t.fillRect(0,0,256,8),t.fillRect(0,508,256,4)})(t,i,a[i][e?1:0],a[i][2],e)),r=C(384,132,3,(t,e)=>((t,e,i,s)=>{const a=t.createLinearGradient(0,0,0,132);a.addColorStop(0,i),a.addColorStop(1,"#05080d"),t.fillStyle=a,t.fillRect(0,0,384,132);for(let i=0;i<4;i++)for(let s=0;s<12;s++){const a=12+31*s,o=16+27*i,r=(7*i+11*s+13*e)%6<3;t.fillStyle=r?s%3==0?"#9fe0ff":"#ffd98a":"#101923",t.fillRect(a,o,19,11)}t.fillStyle=s,t.fillRect(0,0,384,5),t.fillRect(0,128,384,4)})(t,e,a[e][0],a[e][2])),n="high"===h?[-46,-29,-12,7,26,45]:[-46,-12,26,45],l="high"===h?11:7,d=100/(l-1),c=[[],[],[]],p=M(e?9079172:5592926),m=M(e?13223871:9342600),u=new t.BoxGeometry(11,.3,118),g=new t.BoxGeometry(.28,.34,118.2),f=[],y=[];[-1,1].forEach(a=>{f.push(i.composeMatrix(a*(this.ROAD_HALF_W+5.8),-.13,0)),y.push(i.composeMatrix(a*(this.ROAD_HALF_W+.4),-.12,0));const r=new t.Mesh(new t.BoxGeometry(9.5,4.8,112),M(a>0?2896196:3287616,{emissive:592660,emissiveIntensity:.18}));r.position.set(a*(this.ROAD_HALF_W+10.3),2.1,0),s.add(r);for(let t=0;t<l;t++)c[(t+(a>0?1:0))%3].push(i.composeMatrix(a*(this.ROAD_HALF_W+5.49),2.05,t*d-50,0,a>0?-Math.PI/2:Math.PI/2,0));n.forEach((t,i)=>{s.add(this.makeArrivalTower(a,a*(this.ROAD_HALF_W+10.7+i%2*3.1),t+(a>0?2:-2),8.2+i%3*1.3,18+(7*i+(a>0?3:0))%23,11.5+i%2*2.5,o,(i+1)%3,i,e))})});const w=(e,a,o)=>{const r=i.mergeGeometryCopies(e,o);e.dispose(),r&&s.add(new t.Mesh(r,a))};w(u,p,f),w(g,m,y),c.forEach((e,i)=>e.length&&w(r.geo(new t.PlaneGeometry(7.7,2.65),i),r.mat,e));const _=[];for(let t=0;t<10;t++)_.push(i.composeMatrix(1.975+.9*t,-.272,i.doorZ,-Math.PI/2));w(new t.PlaneGeometry(.45,3.2),M(15855850,{emissive:3026475,emissiveIntensity:.35,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2}),_),this.updateArrivalDistrict()}makeArrivalTower(e,i,s,a,o,r,n,h,l,d){const c=new t.Group,p=.173*(l+(e>0?2:0))%1,m=(new t.Color).setHSL(p,d?.22:.42,d?.52:.28).getHex(),u=new t.Mesh(new t.BoxGeometry(a,o,r),M(m));u.position.y=o/2,c.add(u);const g=new t.Mesh(n.geo(new t.PlaneGeometry(r-.7,o-1.5),h),n.mat);g.rotation.y=e>0?-Math.PI/2:Math.PI/2,g.position.set(e>0?-a/2-.05:a/2+.05,o/2,0),c.add(g);const f=new t.Mesh(new t.BoxGeometry(.16,.2,r+.5),_(l%2?16743142:3468031));return f.position.set(e>0?-a/2-.07:a/2+.07,o+.05,0),c.add(f),c.position.set(i,-.3,s),c}remainingRideDistance(){const t=this.rideElapsed;return t<G?k*(G-t)+18.85:18.85*Math.pow(1-H((t-G)/1.3),4)}updateArrivalDistrict(){const t=this.remainingRideDistance();this.arrivalDistrict.position.z=-t,this.scroll.position.z=F-t}setupLook(){const t=this.renderer.domElement;this._lookBindings=[];const e=(t,e,i)=>{t.addEventListener(e,i,{passive:!0}),this._lookBindings.push({target:t,type:e,handler:i})};let i=null,s=0,a=0;e(t,"pointerdown",e=>{if("mouse"!==e.pointerType&&null===i&&!1!==e.isPrimary){i=e.pointerId,s=e.clientX,a=e.clientY;try{t.setPointerCapture(i)}catch{}}}),e(t,"pointermove",t=>{const e=Math.max(1,innerWidth),o=Math.max(1,innerHeight);if("mouse"===t.pointerType)return this.lookTargetYaw=1.4*-(t.clientX/e*2-1),void(this.lookTargetPitch=.55*-(t.clientY/o*2-1));t.pointerId===i&&(this.lookTargetYaw=Math.max(-1.4,Math.min(1.4,this.lookTargetYaw+(t.clientX-s)/e*2.4)),this.lookTargetPitch=Math.max(-.55,Math.min(.55,this.lookTargetPitch+(t.clientY-a)/o*2.4*.6)),s=t.clientX,a=t.clientY)});const o=t=>{t.pointerId===i&&(i=null)};e(t,"pointerup",o),e(t,"pointercancel",o),e(t,"lostpointercapture",o),e(window,"blur",()=>{i=null})}applyLook(t){const e=Math.min(8*t,1);this.lookYaw+=(this.lookTargetYaw-this.lookYaw)*e,this.lookPitch+=(this.lookTargetPitch-this.lookPitch)*e,this.camera.rotation.y=this.lookYaw,this.camera.rotation.x=this.lookPitch,this.camera.rotation.z=0}resizeRenderer(){if(this._disposed||!this.renderer)return;const e=Math.max(1,window.innerWidth||document.documentElement.clientWidth||1),i=Math.max(1,window.innerHeight||document.documentElement.clientHeight||1),s=Math.sqrt(d/Math.max(1,e*i)),a=Math.min(4096/e,4096/i),o=Math.min(window.devicePixelRatio||1,this._pixelRatioCap,s,a);if(e===this._renderW&&i===this._renderH&&o===this._renderPixelRatio)return;this._renderW=e,this._renderH=i,this._renderPixelRatio=o;const r=e/i,n=t.MathUtils.radToDeg(2*Math.atan(Math.tan(t.MathUtils.degToRad(37))/r));this.camera.fov=Math.min(100,Math.max(70,n)),this.camera.aspect=r,this.camera.updateProjectionMatrix(),this.renderer.setPixelRatio(o),this.renderer.setSize(e,i,!1)}startAnimationLoop(){this._disposed||!this._startupReady||this._fatal||document.hidden||this._rafId||this._paused||this._contextLost||"complete"===this.phase||(this._rafId=requestAnimationFrame(this._raf))}stopAnimationLoop(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=0)}bindEvents(){this._onResize=()=>{this._disposed||this._fatal||document.hidden||this._contextLost||this._resizeRaf||(this._resizeRaf=requestAnimationFrame(()=>{this._resizeRaf=0,this.resizeRenderer()}))},this._onVisibilityChange=()=>{this._disposed||(this._paused=document.hidden,document.hidden?(this.stopAnimationLoop(),this.stopCompleteHeartbeat(),this._sceneSwitchTimer&&clearTimeout(this._sceneSwitchTimer),this._sceneSwitchTimer=0,this._resizeRaf&&cancelAnimationFrame(this._resizeRaf),this._resizeRaf=0):(this.clock.getDelta(),this._lastFrame=performance.now(),this.resetGovSamples(),this.syncScheduledScenePhase(),this.scheduleNextScenePhaseSwitch(),this.resizeRenderer(),this.startCompleteHeartbeat(),this.startAnimationLoop()))},this._onPageHide=t=>{this._paused=!0,this.stopAnimationLoop(),this._resizeRaf&&cancelAnimationFrame(this._resizeRaf),this._resizeRaf=0,t.persisted||this.dispose()},addEventListener("resize",this._onResize,{passive:!0}),addEventListener("orientationchange",this._onResize,{passive:!0}),addEventListener("pagehide",this._onPageHide,{passive:!0}),window.visualViewport&&window.visualViewport.addEventListener("resize",this._onResize,{passive:!0}),document.addEventListener("visibilitychange",this._onVisibilityChange)}pickPlayerSeat(){const t=this.bus&&this.bus.passengerSeats||[];if(!t.length)return;const e=t[Math.floor(Math.random()*t.length)];this.seatPos.set(e.x,1.4,e.z)}prepareDirectRide(){this.applyScenePhaseVisuals(),this.camera.position.copy(this.seatPos)}beginStanding(){this.startYaw=this.lookYaw,this.startPitch=this.lookPitch,this.phase="standing",this.phaseT=0}updateSequence(e){this.phaseT+=e;const i=this.camera,s="riding"===this.phase||"stopping"===this.phase;s?(this.rideElapsed=Math.min(2.5,this.rideElapsed+e),this.totalT=this.rideElapsed):this.totalT+=e;const a="stopping"===this.phase?H((this.rideElapsed-G)/1.3):1,o="stopping"===this.phase?.075*(1-a)*(1-a)*this.motionScale:0;if(this.inertiaLeanVel+=(42*(o-this.inertiaLean)-7.5*this.inertiaLeanVel)*e,this.inertiaLean+=this.inertiaLeanVel*e,s&&this.rideElapsed>=2.5&&(this.busSpeed=0,this.updateArrivalDistrict(),this.bus.routeProg=1,this.signBlinking=!0,this.signT=0,this.bus.setDoorDest(W),this.beginStanding()),"riding"===this.phase||"stopping"===this.phase){"riding"===this.phase&&this.rideElapsed>=G&&(this.phase="stopping",this.phaseT=this.rideElapsed-G);const t="stopping"===this.phase?H((this.rideElapsed-G)/1.3):0;this.busSpeed=k*Math.pow(1-t,3);const s=this.busSpeed/k;i.position.copy(this.seatPos),i.position.y+=(.005*Math.sin(8.3*this.totalT)+.0025*Math.sin(21.7*this.totalT))*s*this.motionScale,i.position.z-=.35*this.inertiaLean,this.applyLook(e),this.updateArrivalDistrict()}else if("standing"===this.phase){const e=N(Math.min(this.phaseT/this.STAND_TIME,1));i.position.set(this.seatPos.x,t.MathUtils.lerp(this.seatPos.y,this.standY,e),this.seatPos.z),i.rotation.set(t.MathUtils.lerp(this.startPitch,0,e),t.MathUtils.lerp(this.startYaw,0,e),0),this.phaseT>=this.STAND_TIME&&(this.phase="walking",this.phaseT=0,this.walkFrom=i.position.clone())}else if("walking"===this.phase){const e=N(Math.min(this.phaseT/this.WALK_TIME,1));i.position.x=t.MathUtils.lerp(this.walkFrom.x,0,e),i.position.z=this.walkFrom.z,i.position.y=this.standY+.025*Math.sin(7*this.phaseT)*this.motionScale,i.rotation.set(0,0,0),this.phaseT>=this.WALK_TIME&&(this.phase="advancing",this.phaseT=0,this.advFrom=i.position.clone())}else if("advancing"===this.phase){const e=N(Math.min(this.phaseT/this.ADVANCE_TIME,1));i.position.x=0,i.position.z=t.MathUtils.lerp(this.advFrom.z,this.bus.doorZ,e),i.position.y=this.standY+.025*Math.sin(7*this.phaseT)*this.motionScale,i.rotation.set(0,0,0),this.phaseT>=this.ADVANCE_TIME&&this.beginArrivalMessage()}else if("arrivalmessage"===this.phase)i.position.set(0,this.standY,this.bus.doorZ),i.rotation.set(0,0,0),this.updateArrivalTypewriter(),this.phaseT>=this.ARRIVAL_MESSAGE_TIME&&this.closeArrivalDialog();else if("turning"===this.phase){const t=N(Math.min(this.phaseT/this.TURN_TIME,1));i.position.set(0,this.standY,this.bus.doorZ),i.rotation.set(0,-Math.PI/2*t,0),this.phaseT>=this.TURN_TIME&&(this.phase="dooropen",this.phaseT=0)}else if("dooropen"===this.phase){i.position.set(0,this.standY,this.bus.doorZ);const t=N(Math.min(this.phaseT/this.DOOR_TIME,1));i.rotation.set(-.08*t,-Math.PI/2,0),this.bus.setDoorOpen(t),this.bus.doorGlow&&(this.bus.doorGlow.material.opacity=.18*t,this.bus.doorGlow.scale.setScalar(.3+.9*t)),this.phaseT>=this.DOOR_TIME&&(this.phase="exiting",this.phaseT=0)}else if("exiting"===this.phase){const e=N(Math.min(this.phaseT/this.EXIT_TIME,1)),s=t.MathUtils.lerp(0,this.EXIT_END_X,e),a=t.MathUtils.smoothstep(s,1.15,1.9),o=.022*Math.abs(Math.sin(8.5*this.phaseT))*this.motionScale;i.position.set(s,t.MathUtils.lerp(this.standY,this.streetEyeY,a)+o,this.bus.doorZ),i.rotation.set(-.08-.14*a,-Math.PI/2,0),this.bus.doorGlow&&(this.bus.doorGlow.material.opacity=.18*(1-a)),!this.flashing&&!this.navigationAttempted&&s>=1.87&&(this.flashing=!0,this.showFlashOverlay())}if(this.flashing){const t=p?.18:.55;this.flashOpacity=Math.min(1,this.flashOpacity+e/t),this.flashEl&&(this.flashEl.style.opacity=this.flashOpacity.toFixed(3)),this.flashOpacity>=1&&!this.navigationAttempted&&this.finishExperience()}}applyScenePhaseVisuals(){const e="day"===this.scenePhase,i=e?1:0;if(this.scene.background&&this.scene.background.isColor&&this.scene.background.copy(this._dayTmpColor.copy(this._daySkyNight).lerp(this._daySkyDay,i)),this.scene.fog&&this.scene.fog.color&&(this.scene.fog.color.copy(this._dayTmpColor.copy(this._dayFogNight).lerp(this._dayFogDay,i)),this.scene.fog.density=t.MathUtils.lerp(.01,.005,i)),this.renderer&&(this.renderer.setClearColor(this._dayTmpColor.copy(this._daySkyNight).lerp(this._daySkyDay,i),1),this.renderer.toneMappingExposure=t.MathUtils.lerp(1.08,1.12,i)),this.ambient.color.copy(this._dayTmpColor.set(11189200).lerp(new t.Color(16777215),i)),this.ambient.intensity=t.MathUtils.lerp(.1,.22,i),this.hemi.color.copy(this._dayTmpColor.set(7442094).lerp(new t.Color(15333375),i)),this.hemi.groundColor.copy(this._dayTmpColor.set(1382689).lerp(new t.Color(10195583),i)),this.hemi.intensity=t.MathUtils.lerp(.62,.85,i),this.dir.color.copy(this._dayTmpColor.set(11127295).lerp(new t.Color(16773323),i)),this.dir.intensity=t.MathUtils.lerp(.9,2.4,i),this.dir.position.set(e?18:-12,e?42:18,e?-8:-18),this.rim.intensity=e?.24:.34,this.moon&&this.moon.material&&(this.moon.material.opacity=e?0:1,this.moon.visible=!e),this.sun&&this.sun.material&&(this.sun.material.opacity=e?.92:0,this.sun.visible=e),this.streetlightAssets&&this.streetlightAssets.lampMat&&this.streetlightAssets.lampMat.color.setHex(e?14279397:12187391),x.color.setHex(e?13227742:16767370),b.color.setHex(e?10730699:10477823),this.bus&&this.bus.realLights){const t=this.bus.cabinLightScale||1;for(const i of this.bus.realLights)i.intensity=(e?1:1.8)*t}}syncScheduledScenePhase(t=!1){const e=f();return!(!t&&e===this.scenePhase||(this.scenePhase=e,this.applyScenePhaseVisuals(),0))}scheduleNextScenePhaseSwitch(){if(this._sceneSwitchTimer&&clearTimeout(this._sceneSwitchTimer),this._sceneSwitchTimer=0,this._disposed||this._fatal||document.hidden||"complete"===this.phase)return;const t=(()=>{if(Number.isFinite(g))return 0;const t=new Date,e=new Date(t);return"day"===f()?e.setHours(18,0,0,50):(e.setHours(6,0,0,50),e<=t&&e.setDate(e.getDate()+1)),Math.max(250,e.getTime()-t.getTime())})();t&&(this._sceneSwitchTimer=setTimeout(()=>{this._sceneSwitchTimer=0,this._disposed||this._fatal||document.hidden||"complete"===this.phase||(this.syncScheduledScenePhase(!0),this.scheduleNextScenePhaseSwitch())},t))}refineTier(){if(!aAG)return;let t="";try{const e=this.renderer.getContext(),i=e.getExtension("WEBGL_debug_renderer_info");t=String(e.getParameter(e.RENDERER)||"")+(i?" "+e.getParameter(i.UNMASKED_RENDERER_WEBGL):"")}catch{}aSet(/swiftshader|llvmpipe|software/i.test(t)?0:r>=6&&n>=8&&/Adreno[^0-9]*(6[4-9]\d|[7-9]\d\d)|Mali-G(7[6-9]|[6-9]\d\d)|Immortalis|Xclipse/i.test(t)?2:1),this._frameInterval=1e3/c,this._pixelRatioCap=l}restoreDone(){this._awaitRestoreFrame=!1,this._contextRestoreTimer&&clearTimeout(this._contextRestoreTimer),this._contextRestoreTimer=0,this._fatal||(this._navFailedShown?X("未能自動前往目的頁面,請按下方按鈕重試。",!0,"再次前往"):K()),y({aitwContextStatus:"restored",buildVersion:u})}finishRestoreFrame(){try{this.renderer.render(this.scene,this.camera)}catch(t){return void $("WEBGL_CONTEXT_RESTORE_FAILED",t,"complete")}this.restoreDone()}armRestoreGuard(){this._contextRestoreTimer&&clearTimeout(this._contextRestoreTimer);const t=()=>{this._contextRestoreTimer=0,!this._awaitRestoreFrame||this._disposed||this._fatal||(document.hidden?this._contextRestoreTimer=setTimeout(t,1e4):$("WEBGL_CONTEXT_RESTORE_TIMEOUT","No frame after context restore","webglcontextrestored"))};this._contextRestoreTimer=setTimeout(t,1e4)}qualityLevel(){return Math.max(this._gov.lv,this._gov.bat?2:0)}applyQualityLevel(){if(this._disposed)return;const t=this.qualityLevel();t!==this._appliedLv&&(this._appliedLv=t,this._pixelRatioCap=aC[t],this._frameInterval=1e3/aF[t],this.bus&&this.bus.setReducedPanelRate(t>=2),this._renderPixelRatio=-1,this.resizeRenderer())}resetGovSamples(){const t=this._gov;t.k=0,t.ema=0,t.ck=0,t.lr=0,t.bad=0,t.good=0,t.rema=0,this._lastRenderAt=0,this._rafPrev=0}rawFrame(t){const e=this._rafPrev;if(this._rafPrev=t,!e)return;const i=t-e,s=this._gov;i<250&&(s.rema=s.rema?.9*s.rema+.1*i:i)}govFrame(t,e){const i=this._gov;if(i.t0||(i.t0=e+1500),e<i.t0)return;const s=this._frameInterval;if(i.lr!==s&&(i.lr=s,i.k=0,i.ema=0),++i.k<4)return;if(i.ema=i.ema?.85*i.ema+.15*t:t,e-i.ck<400)return;i.ck=e,i.ema>1.4*s?(i.bad++,i.good=0):i.ema<1.15*s&&(i.good++,i.bad=Math.max(0,i.bad-1)),i.bad>=3&&i.lv<3?(i.cd=e-i.up<5e3?1/0:e+2500,i.lv++,i.bad=i.good=i.k=0,i.ema=0,this.applyQualityLevel()):i.good>=6&&i.lv>0&&e>=i.cd&&i.rema>0&&i.rema<1150/aF[i.lv-1]&&(i.lv--,i.up=e,i.bad=i.good=i.k=0,i.ema=0,this.applyQualityLevel())}bindBattery(){try{o&&navigator.getBattery&&navigator.getBattery().then(t=>{if(this._disposed)return;const e=()=>{const e=!t.charging&&t.level<=.2;e!==this._gov.bat&&(this._gov.bat=e,this.applyQualityLevel())};e(),t.addEventListener("levelchange",e),t.addEventListener("chargingchange",e),this._batteryOff=()=>{t.removeEventListener("levelchange",e),t.removeEventListener("chargingchange",e),this._batteryOff=null}}).catch(()=>{})}catch{}}dispose(){if(this._disposed)return;this._disposed=!0,this._paused=!0,this._batteryOff&&this._batteryOff(),this.stopAnimationLoop(),this.hideArrivalDialog(!0),this._resizeRaf&&cancelAnimationFrame(this._resizeRaf),this._resizeRaf=0,this._navigationStartTimer&&clearTimeout(this._navigationStartTimer),this._navigationStartTimer=0,this._navigationRecoveryTimer&&clearTimeout(this._navigationRecoveryTimer),this._navigationRecoveryTimer=0,this._contextRestoreTimer&&clearTimeout(this._contextRestoreTimer),this._contextRestoreTimer=0,this._sceneSwitchTimer&&clearTimeout(this._sceneSwitchTimer),this._sceneSwitchTimer=0,this.stopCompleteHeartbeat(),this._startupTimer&&clearTimeout(this._startupTimer),this._startupTimer=0,this._arrivalHideTimer&&clearTimeout(this._arrivalHideTimer),this._arrivalHideTimer=0,this._onResize&&(removeEventListener("resize",this._onResize),removeEventListener("orientationchange",this._onResize),window.visualViewport&&window.visualViewport.removeEventListener("resize",this._onResize)),this._onPageHide&&removeEventListener("pagehide",this._onPageHide),this._onVisibilityChange&&document.removeEventListener("visibilitychange",this._onVisibilityChange),this.arrivalCloseEl&&this._onArrivalClose&&this.arrivalCloseEl.removeEventListener("click",this._onArrivalClose),this.arrivalDialogEl&&this._onArrivalKeyDown&&this.arrivalDialogEl.removeEventListener("keydown",this._onArrivalKeyDown),this.arrivalAvatarEl&&this._onAvatarError&&this.arrivalAvatarEl.removeEventListener("error",this._onAvatarError);for(const t of this._lookBindings||[])t.target.removeEventListener(t.type,t.handler);this._lookBindings=[];const t=this.renderer&&this.renderer.domElement;t&&(this._onContextLost&&t.removeEventListener("webglcontextlost",this._onContextLost),this._onContextRestored&&t.removeEventListener("webglcontextrestored",this._onContextRestored));const e=new Set,i=new Set,s=new Set,a=t=>{if(t&&!i.has(t)){i.add(t);for(const e of v){const i=t[e];i&&i.isTexture&&s.add(i)}}};this.scene&&this.scene.traverse(t=>{if(t.isInstancedMesh)try{t.dispose()}catch{}t.geometry&&t.geometry.isBufferGeometry&&e.add(t.geometry),Array.isArray(t.material)?t.material.forEach(a):a(t.material)});const o=t=>{if(t)for(const i of Object.values(t))i&&i.isBufferGeometry?e.add(i):i&&i.isMaterial?a(i):i&&i.isTexture&&s.add(i)};if(e.add(T),a(x),a(b),s.add(w),s.add(S),s.add(E),this.bus){for(const t of this.bus.roundedGeometries.values())e.add(t);o(this.bus.seatAssets),o(this.bus.seatScreenAssets),this.bus.statusDisplay&&this.bus.statusDisplay.texture&&s.add(this.bus.statusDisplay.texture),this.bus.seatScreenTex&&this.bus.seatScreenTex.texture&&s.add(this.bus.seatScreenTex.texture),this.bus.roundedGeometries.clear()}if(o(this.streetlightAssets),e.forEach(t=>{try{t.dispose()}catch{}}),i.forEach(t=>{try{t.dispose()}catch{}}),s.forEach(t=>{try{t.dispose()}catch{}}),this.renderer){try{this.renderer.renderLists&&this.renderer.renderLists.dispose()}catch{}try{this.renderer.dispose()}catch{}try{this.renderer.forceContextLoss()}catch{}}t&&t.parentNode&&t.parentNode.removeChild(t),this.scene&&this.scene.clear(),this.renderer=null,this.scene=null,this.camera=null,this.bus=null}markFirstFrameReady(t){if(this._firstFrameRendered||this._renderCount<2)return;const e=this.renderer&&this.renderer.info&&this.renderer.info.render;!e||e.calls<1||e.triangles<1||(this._firstFrameRendered=!0,this._lastHeartbeatAt=t,y({aitwBusReady:!0,buildVersion:u,qualityMode:h,renderCount:this._renderCount}))}animate(){if(this._rafId=0,this._disposed||this._paused||this._contextLost||this._fatal)return;let t=!0;try{const t=performance.now(),e=t-this._lastFrame;if(this.rawFrame(t),e>=this._frameInterval-.5){this._lastFrame=e>2*this._frameInterval?t:this._lastFrame+this._frameInterval,this._renderCount>2&&this._lastRenderAt&&this.govFrame(Math.min(1e3,t-this._lastRenderAt),t),this._lastRenderAt=t;const i=Math.min(this.clock.getDelta(),.25);for(let t=i;t>1e-6&&"complete"!==this.phase;t-=.05)this.updateSequence(Math.min(t,.05));if("complete"===this.phase)return;const s=.001*t;this.bus.updateTechDisplays(s,this.busSpeed,this.phase);const a="riding"===this.phase||"stopping"===this.phase?.5+.5*(1-this.remainingRideDistance()/F):1;this.bus.updateSeatScreens(s,this.phase,a),this.bus.updateAisleFlash(s,"riding"!==this.phase&&"stopping"!==this.phase),this.bus.updatePilotRobot(i,this.phase,this.camera.position,this.STAND_TIME+this.WALK_TIME),this.signBlinking?(this.signT+=i,this.bus.setSignText(this.signT%1<.55)):this.bus.setSignText(!0),this.renderer.render(this.scene,this.camera),this._renderCount++,this._awaitRestoreFrame&&this.restoreDone(),this.markFirstFrameReady(t),this._firstFrameRendered&&t-this._lastHeartbeatAt>=3e3&&(this._lastHeartbeatAt=t,y({aitwHeartbeat:!0,buildVersion:u,phase:this.phase,renderCount:this._renderCount}))}}catch(e){t=!1,$("ANIMATION_FRAME_FAILED",e,this.phase||"animate")}finally{!t||"complete"===this.phase||this._disposed||this._paused||this._contextLost||this._fatal||this.startAnimationLoop()}}}function Q(){Y&&!Y._disposed&&(Y._paused=document.hidden,Y._paused||(Y.syncScheduledScenePhase(),Y.scheduleNextScenePhaseSwitch(),Y.resizeRenderer(),Y.clock&&Y.clock.getDelta(),Y._lastFrame=performance.now(),Y.resetGovSamples(),Y.startCompleteHeartbeat(),Y.startAnimationLoop()))}(()=>{try{Y=new J}catch(t){return void $("SCENE_STARTUP_FAILED",t,"bootGame")}const t=Y;let e=!1;const i=()=>{e||t!==Y||t._disposed||t._fatal||(e=!0,t._startupTimer&&clearTimeout(t._startupTimer),t._startupTimer=0,t._startupReady=!0,t.startAnimationLoop())};t._startupTimer=setTimeout(i,1500);try{const e=t.renderer.compileAsync(t.scene,t.camera);e&&"function"==typeof e.then?e.then(i,i):i()}catch{i()}})(),addEventListener("message",function t(e){if(e&&e.source===window.parent&&e.data&&e.data.aitwNonce===m){if(!0===e.data.aitwDispose)return removeEventListener("message",t),removeEventListener("pageshow",Q),Y&&"function"==typeof Y.dispose&&Y.dispose(),y({aitwDisposed:!0}),void(Y=null);!0!==e.data.aitwReadyProbe||!Y||!Y._firstFrameRendered||Y._fatal||Y._disposed||Y._contextLost||Y._awaitRestoreFrame||"complete"!==Y.phase&&performance.now()-Y._lastRenderAt>=3e3||y({aitwBusReady:!0,buildVersion:u,qualityMode:h,renderCount:Y._renderCount}),!0===e.data.aitwNavigationFailed&&Y&&"complete"===Y.phase&&(Y._navigationRecoveryTimer&&clearTimeout(Y._navigationRecoveryTimer),Y._navigationRecoveryTimer=0,Y.flashOpacity=0,Y.hideFlashOverlay(),Y._navFailedShown=!0,X("未能自動前往目的頁面,請按下方按鈕重試。",!0,"再次前往"))}}),addEventListener("pageshow",Q);</script></body></html>
此 3D 動畫需要 JavaScript。
略過動畫,前往目的頁面
Cookie的使用
我們使用cookies來確保流暢的瀏覽體驗。若繼續,我們會認爲你接受使用cookies。
確認
了解更多