PageSourceSearch

https://wedraw.kr/assets/ProLanding.kRyX6KJi.js

js wedraw.kr collected 2026-10-04 07:42:31 UTC 155,799 bytes, 4 lines download raw bytes

1import{j as t}from"./vendor-ui.BwPBmVwt.js";import{u as Xr,a as pn,b as mn}from"./index.86ltQqcV.js";import{r as e,b as Cr,u as xn}from"./vendor-react.kR8tqwKZ.js";import{p as hn,d as gn,I as yn,B as _n,m as Jr,L as bn}from"./index.CS4NKBxN.js";import{P as wn,R as vn}from"./RejectedApprovalModal.BPhOBE7I.js";import{C as Sn,A as Mn,E as Rn,O as jn,P as zn,G as En,b as Qr,u as ur,R as Ar,d as Zr,V as j,e as Lr,B as $r,f as fr,M as Pn,L as Vt,g as dr,h as Et,i as Mr,j as lr,k as ir,l as He,m as cr,n as br,o as wr,q as $t,r as Yt,F as Kt,s as rr,t as Br,v as tr,x as _r,T as vr,S as nr,y as or,z as Pr,D as Wn,H as Tn,I as Cn,J as Bn,K as kn}from"./vendor-three.C5-HLXBy.js";import{u as An}from"./useSketchupExtensionManifest.CSjGBmyE.js";import"./vendor-utils.D2q0l15H.js";const Ln=["#8_Wood_Screw_2in","#8_Wood_Screw_2in_1","#8_Wood_Screw_2in_10","#8_Wood_Screw_2in_11","#8_Wood_Screw_2in_12","#8_Wood_Screw_2in_13","#8_Wood_Screw_2in_14","#8_Wood_Screw_2in_15","#8_Wood_Screw_2in_16","#8_Wood_Screw_2in_17","#8_Wood_Screw_2in_18","#8_Wood_Screw_2in_19","#8_Wood_Screw_2in_2","#8_Wood_Screw_2in_3","#8_Wood_Screw_2in_4","#8_Wood_Screw_2in_5","#8_Wood_Screw_2in_6","#8_Wood_Screw_2in_7","#8_Wood_Screw_2in_8","#8_Wood_Screw_2in_9","Part_42","Part_43","Part_44","Part_45","Part_46","Part_47","Part_66","Part_67","Part_69","Part_70","Part_72","Part_73","Part_75","Part_76","bau0016962400_v(71B959M01)","bau0016962400_v(71B959M01)_1","bau0016962400_v(71B959M01)_2","bau0016962400_v(71B959M01)_3","bau0016992030_v(78A908-T202)","bau0016992030_v(78A908-T202)_1","bau0016992030_v(78A908-T202)_2","bau0016992030_v(78A908-T202)_3","bau0019426112_v(74T110M1401)","bau0019426112_v(74T110M1401)_1","bau0019426112_v(74T110M1401)_2","bau0019426112_v(74T110M1401)_3","screw_18","screw_18_1","screw_18_2","screw_18_3","screw_18_4","screw_18_5","screw_18_6","screw_18_7"],Wr=.001,Vr={heightMm:720,depthMm:560},In=[.1,.28,.46,.64,.82],Ir={current:0},Jt={current:{x:0,y:0,z:0}},qr={current:0},en={current:0},Gt={current:{x:0,y:0,z:0}},tn={current:null},pr={current:NaN},rn={current:40},Dr={current:0},mr={current:0},xr={current:0},Tr={current:0},Rr={current:0},sr={current:-1},Qt={current:0},Or={current:!1},Dn={current:0},Fr={current:!1},yr={current:{lower:null,upper:null,doorEdge:null}};function Sr(i,n){n.geometry.boundingBox||n.geometry.computeBoundingBox();const _=n.geometry.boundingBox;if(!_||!i.image)return;const d=new j;_.getSize(d);const x=[d.x,d.y,d.z].sort((z,A)=>A-z),L=x[0],B=x[1];if(L<.001||B<.001)return;const q=L/B,w=i.image.width/i.image.height;if(q<w){const z=q/w;i.repeat.set(z,1),i.offset.set((1-z)/2,0)}else{const z=w/q;i.repeat.set(1,z),i.offset.set(0,(1-z)/2)}}const ar={carcass:"#F5F2ED",door:"#EDE9E1",leg:"#1A1A1A",edge:"#D0CCC4"},Ce=(i,n,_)=>Math.max(n,Math.min(_,i)),U=(i,n,_)=>i+(n-i)*_,lt=i=>i<.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2,kr=i=>1-Math.pow(1-i,3);Mr.preload("/models/Sink_Render_Mode_V2.glb");lr.preload("/models/1.avif");lr.preload("/stone-texture.webp");Cn.preload(Bn,"/hdr/monochrome_studio_02_1k.hdr");function nn(i){const n=i.toLowerCase();return n.includes("bottom")?"bottom":n.includes("top")&&!n.includes("channel")?"top":(n.includes("left")||n.includes("lhs"))&&(n.includes("side")||n.includes("panel"))?"left":(n.includes("right")||n.includes("rhs"))&&(n.includes("side")||n.includes("panel"))?"right":n.includes("back")?"back":n.includes("shelf")?"shelf":n.includes("door")&&n.includes("left")?"door_left":n.includes("door")&&n.includes("right")?"door_right":n.includes("door")?"door_left":n.includes("drawer")&&(n.includes("0")||n.includes("bot"))?"drawer_0":n.includes("drawer")?"drawer_1":n.includes("kick")?"kickboard":n.includes("hinge")||n.includes("경첩")?"door_left":i}function On({doorOpenProgress:i,panelOpacity:n,useDepthTest:_,isInitialState:d,explodeProgress:x,drawingModeProgress:L=0,widthMm:B=1e3,edgeColorProgress:q=0,hideDoor:w=!1,showAnnotations:z=!1,card3ExplodeP:A=0,card4DoorFocusMode:Be=!1,card4ZoomP:re=0,wireframeMode:at=!1,scanLineY:ce=-1,cabinetTotalH:ut=.82,outerEdgesOnly:ne=!1,doorTexturePath:vt=null,doorTextureParts:it,doorTextureRotations:Tt,bodyTexturePath:bt=null,bodyTextureParts:zt,bodyTextureRotations:je,onMeshNamesReady:ee,solidPartNames:Ct}
1){const Y=Mr("/models/Sink_Render_Mode_V2.glb"),f=lr("/models/1.avif"),Ze=lr("/stone-texture.webp"),S=e.useMemo(()=>{const b=Y.scene.clone(!0);f.wrapS=f.wrapT=ir,f.repeat.set(1,1),f.needsUpdate=!0;const u=f.clone();u.rotation=Math.PI/2,u.center.set(.5,.5),u.wrapS=u.wrapT=ir,u.repeat.set(1,1),u.matrixAutoUpdate=!1,u.updateMatrix(),u.needsUpdate=!0;const E=new Set(["Part_10","Part_11"]),s=new Set(["Part_2","Part_9","Part_12","Part_13"]);return Ze.wrapS=Ze.wrapT=ir,Ze.repeat.set(1,1),Ze.needsUpdate=!0,b.traverse(a=>{if(!(a instanceof He))return;const m=nn(a.name),k=m==="left"||m==="right",v=E.has(a.name)||s.has(a.name)||k||m==="kickboard",V=a.name==="Part_14";if(!v&&!V)return;(Array.isArray(a.material)?a.material:[a.material]).forEach((Ae,Je)=>{if(!(Ae instanceof Et))return;const ye=Ae.clone();if(v){const Oe=k||s.has(a.name)?u:f;ye.map=Oe,ye.color.set("#ffffff"),ye.roughness=.72,ye.metalness=0}else ye.map=Ze,ye.color.set("#f8f5f0"),ye.roughness=.04,ye.metalness=.06,ye.envMapIntensity=3.5;ye.needsUpdate=!0,Array.isArray(a.material)?a.material[Je]=ye:a.material=ye})}),b},[Y.scene,f,Ze]),le=e.useMemo(()=>new Vt({color:"#484848",transparent:!0,depthTest:!1,depthWrite:!1}),[]),xe=e.useMemo(()=>new Vt({color:"#ffffff",transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}),[]),St=e.useMemo(()=>new Vt({color:"#ffffff",transparent:!0,opacity:.9,depthTest:!1,depthWrite:!1}),[]),Ue=e.useRef(null),T=e.useRef(null),ue=e.useRef([]),tt=e.useRef(0),rt=e.useRef([]),Ee=e.useRef([]),De=e.useRef([]),_e=e.useRef([]),Ye=e.useRef([]),we=e.useRef([]),ke=e.useRef([]),dt=e.useRef([]),{scene:be}=ur(),oe=e.useMemo(()=>new cr({color:16777215,dashSize:.008,gapSize:.006,opacity:.28,transparent:!0}),[]),G=e.useMemo(()=>new cr({color:16777215,dashSize:.008,gapSize:.006,opacity:.85,transparent:!0,depthTest:!1}),[]),gt=e.useMemo(()=>{const m=document.createElement("canvas");m.width=m.height=64;const k=m.getContext("2d");return k.strokeStyle="white",k.lineWidth=6,k.lineCap="round",k.beginPath(),k.moveTo(10,32),k.lineTo(54,32),k.stroke(),k.beginPath(),k.moveTo(32,10),k.lineTo(32,54),k.stroke(),new br({map:new wr(m),size:.024,sizeAttenuation:!0,depthTest:!1,transparent:!0,alphaTest:.1})},[]),Ft=e.useMemo(()=>new cr({color:16777215,dashSize:.003,gapSize:.002,opacity:.85,transparent:!0,depthTest:!1}),[]),Lt=e.useMemo(()=>{const m=document.createElement("canvas");m.width=m.height=64;const k=m.getContext("2d");return k.strokeStyle="white",k.lineWidth=6,k.lineCap="round",k.beginPath(),k.moveTo(10,32),k.lineTo(54,32),k.stroke(),k.beginPath(),k.moveTo(32,10),k.lineTo(32,54),k.stroke(),new br({map:new wr(m),size:.012,sizeAttenuation:!0,depthTest:!1,transparent:!0,alphaTest:.1})},[]),It=e.useMemo(()=>new Vt({color:4890367,opacity:.22,transparent:!0}),[]),Ut=e.useMemo(()=>new Vt({color:16777215,opacity:.5,transparent:!0}),[]),de=e.useMemo(()=>new j,[]),fe=e.useMemo(()=>new j,[]),Pe=e.useMemo(()=>new j,[]),ve=e.useMemo(()=>new j,[]),yt=e.useRef({lower:null,upper:null,doorLocalPt:null,doorMesh:null}),nt=e.useRef([]),_t=e.useRef([]),Xe=e.useRef(0),qe=e.useRef(0),Bt=e.useRef(0),$e=e.useRef(0),Ge=e.useRef(0),et=e.useRef(!1),ct=e.useRef(!1),Nt=e.useRef(!0),Pt=e.useRef([]),ft=e.useRef(null),We=e.useRef(0),ot=e.useRef(0),xt=e.useRef([]),wt=e.useRef([]),J=e.useRef([]),ge=e.useRef([]),Ht=e.useRef(!1),H=e.useRef(null),Se=e.useRef([]),Wt=e.useRef(!1),st=e.useRef([]);e.useEffect(()=>{S.updateMatrixWorld(!0);const b=r=>{const p=S.getObjectByName(r);if(!p)return null;const g=p.position.clone(),W=p instanceof He?p:p.getObjectByProperty("type","Mesh");if(!W?.geometry)return null;W.geometry.computeBoundingBox();const N=W.geometry.boundingBox,me=W!==p?W.position.x:0,Te=W!==p?W.position.y:0,Ne=W!==p?W.position.z:0;return{cx:g.x+(N.min.x+N.max.x)/2+me,cz_min:g.z+N.min.z+Ne,cz_max:g.z+N.max.z+Ne,fy:g.y+N.max.y+Te+2}};b("Part_10"),b("Part_11");const u=/^bau|[Ss]crew|637_76|body_guide|[Ll]eg|[Cc]ylinder|[Pp]ipe|[Tt]ube|[Ff]oot|[Ff]aucet|[Ss]ink|[Pp]lug|[Hh]inge/,E=new Set(["Part_10","Part_11"]);nt.current=[],S.traverse(r=>{if(!(r instanceof He))return;r.castShadow=!0,r.receiveShadow=!0;const p=Array.isArray(r.material)?r.material:[r.material];for(const g of p)if(g instanceof Et&&!nt.current.includes(g)){if(g.transparent=!0,/^6?37_76_333_2|^Part_(66|67|69|70|72|73|75|76)$/.test(r.name))g.color.set("#505050"),g.roughness=.45,g.metalness=.3;else{const N=g.color.r+g.color.g+g.color.b,me=u.test(r.name);N>2&&g.metalness<.2&&!me&&(g.color.set("#C8C4BC"),g.roughness=.5,g.metalness=0)}g.envMapIntensity=1.2,nt.current.push(g)}});const s=(r,p)=>{const g=S.getObjectByName(r);if(!g)return null;const W=new $t;g instanceof He&&g.geometry?(g.geometry.computeBoundingBox(),W.copy(g.geometry.boundingBox)):g.traverse(Ie=>{Ie instanceof He&&Ie.geometry&&(Ie.geometry.computeBoundingBox(),Ie.geometry.boundingBox&&W.union(Ie.geometry.boundingBox))});const N=new j(p==="left"?W.min.x:W.max.x,(W.min.y+W.max.y)/2,(W.min.z+W.max.z)/2);g.updateWorldMatrix(!0,!1);const me=S.matrixWorld.clone().invert(),Te=N.clone().applyMatrix4(g.matrixWorld).applyMatrix4(me),Ne=new Tn;return S.add(Ne),Ne.position.copy(Te),Ne.attach(g),Ne};Ue.current=s("Part_10","left"),T.current=s("Part_11","right");const a=S.getObjectByName("Part_10")??S.getObjectByName("Part 10");a instanceof He&&(a.geometry.computeBoundingBox(),H.current={origGeom:a.geometry.clone(),hingeMinX:a.geometry.boundingBox.min.x});const m={"bau0016962400_v(71B959M01)_1":Ue.current,"bau0016962400_v(71B959M01)_2":Ue.current,"bau0016962400_v(71B959M01)":T.current,"bau0016962400_v(71B959M01)_3":T.current};for(const[r,p]of Object.entries(m)){const g=S.getObjectByName(r);!g||!p||p.attach(g)}const k=/^bau0016992030|^bau0019426112|^body_guide/;Pt.current=[],S.traverse(r=>{k.test(r.name)&&(r.name,r.position.toArray(),Pt.current.push({obj:r,basePosZ:r.position.z,side:"left"}))}),Pt.current.length,ft.current&&ft.current.parent?.remove(ft.current);const v=Pt.current[0]?.obj??S,V=new Qr(.15);V.visible=!1,V.renderOrder=999,V.material.depthTest=!1,v.add(V),ft.current=V,xt.current=[];const Q=r=>{const p=r instanceof He?r:r.getObjectByProperty("type","Mesh");let g=0,W=0;if(p?.geometry){p.geometry.computeBoundingBox();const Ne=new j;
1p.geometry.boundingBox.getCenter(Ne),p!==r&&Ne.applyMatrix4(p.matrix),g=Ne.y,W=Ne.z}const N=r.rotation.x,me=g*Math.cos(N)-W*Math.sin(N),Te=g*Math.sin(N)+W*Math.cos(N);xt.current.push({obj:r,basePos:r.position.clone(),baseRot:r.rotation.clone(),cy:g,cz:W,bpy:me,bpz:Te})};for(const r of["screw_18_7","screw_18_4"]){const p=S.getObjectByName(r);p&&Q(p)}wt.current.forEach(({line:r,dots:p})=>{be.remove(r),r.geometry.dispose(),be.remove(p),p.geometry.dispose()}),wt.current=[];for(const r of xt.current){const p=new j;{const Te=new $t().setFromObject(r.obj);Te.isEmpty()||(Te.getCenter(p),r.obj.updateWorldMatrix(!0,!1),p.applyMatrix4(r.obj.matrixWorld.clone().invert()))}const g=new Yt;g.setAttribute("position",new Kt([0,0,0,0,0,0],3));const W=new rr(g,Ft);W.visible=!1,W.renderOrder=998,W.frustumCulled=!1,be.add(W);const N=new Yt;N.setAttribute("position",new Kt([0,0,0],3));const me=new Br(N,Lt);me.visible=!1,me.renderOrder=999,me.frustumCulled=!1,be.add(me),wt.current.push({screwObj:r.obj,line:W,dots:me,screwLocalCenter:p})}J.current=[];const Ae=[{name:"Part_45",dx:0,dy:240,dz:0},{name:"Part_46",dx:0,dy:240,dz:0},{name:"Part_47",dx:0,dy:240,dz:0},{name:"Part_14",dx:0,dy:300,dz:0},{name:"Part_42",dx:0,dy:360,dz:0},{name:"Part_43",dx:0,dy:360,dz:0},{name:"Part_44",dx:0,dy:360,dz:0},{name:"Part_4",dx:0,dy:0,dz:-350},{name:"Part_5",dx:0,dy:0,dz:-600},{name:"Part_6",dx:0,dy:60,dz:300},{name:"Part_7",dx:0,dy:60,dz:300},{name:"Part_8",dx:0,dy:120,dz:300},{name:"Part_9",dx:0,dy:180,dz:300},{name:"Part_0",dx:0,dy:-150,dz:0},{name:"Part_15",dx:0,dy:0,dz:300},{name:"#8_Wood_Screw_2in_16",dx:0,dy:100,dz:300},{name:"#8_Wood_Screw_2in_17",dx:0,dy:0,dz:300},{name:"#8_Wood_Screw_2in_18",dx:0,dy:0,dz:300},{name:"#8_Wood_Screw_2in_19",dx:0,dy:100,dz:300},{name:"Part_2",dx:0,dy:0,dz:550},{name:"Part_12",dx:400,dy:0,dz:0},{name:"#8_Wood_Screw_2in",dx:300,dy:0,dz:0},{name:"#8_Wood_Screw_2in_9",dx:300,dy:0,dz:0},{name:"#8_Wood_Screw_2in_10",dx:300,dy:0,dz:0},{name:"#8_Wood_Screw_2in_11",dx:300,dy:0,dz:0},{name:"#8_Wood_Screw_2in_12",dx:300,dy:0,dz:0},{name:"#8_Wood_Screw_2in_13",dx:300,dy:0,dz:0},{name:"#8_Wood_Screw_2in_14",dx:300,dy:0,dz:0},{name:"#8_Wood_Screw_2in_15",dx:300,dy:0,dz:0},{name:"Part_1",dx:200,dy:0,dz:0},{name:"bau0016992030_v(78A908-T202)",dx:100,dy:0,dz:0},{name:"bau0016992030_v(78A908-T202)_1",dx:100,dy:0,dz:0},{name:"bau0019426112_v(74T110M1401)",dx:100,dy:0,dz:0},{name:"bau0019426112_v(74T110M1401)_1",dx:100,dy:0,dz:0},{name:"body_guide_2",dx:100,dy:0,dz:0},{name:"body_guide_3",dx:100,dy:0,dz:0},{name:"screw_18",dx:50,dy:0,dz:0},{name:"screw_18_1",dx:50,dy:0,dz:0},{name:"screw_18_2",dx:50,dy:0,dz:0},{name:"screw_18_3",dx:50,dy:0,dz:0},{name:"Part_13",dx:-400,dy:0,dz:0},{name:"#8_Wood_Screw_2in_1",dx:-300,dy:0,dz:0},{name:"#8_Wood_Screw_2in_2",dx:-300,dy:0,dz:0},{name:"#8_Wood_Screw_2in_3",dx:-300,dy:0,dz:0},{name:"#8_Wood_Screw_2in_4",dx:-300,dy:0,dz:0},{name:"#8_Wood_Screw_2in_5",dx:-300,dy:0,dz:0},{name:"#8_Wood_Screw_2in_6",dx:-300,dy:0,dz:0},{name:"#8_Wood_Screw_2in_7",dx:-300,dy:0,dz:0},{name:"#8_Wood_Screw_2in_8",dx:-300,dy:0,dz:0},{name:"Part_3",dx:-200,dy:0,dz:0},{name:"bau0016992030_v(78A908-T202)_3",dx:-100,dy:0,dz:0},{name:"bau0019426112_v(74T110M1401)_3",dx:-100,dy:0,dz:0},{name:"body_guide_1",dx:-100,dy:0,dz:0},{name:"bau0016992030_v(78A908-T202)_2",dx:-100,dy:0,dz:0},{name:"bau0019426112_v(74T110M1401)_2",dx:-100,dy:0,dz:0},{name:"body_guide",dx:-100,dy:0,dz:0},{name:"screw_18_4",dx:-50,dy:0,dz:0},{name:"screw_18_5",dx:-50,dy:0,dz:0},{name:"screw_18_6",dx:-50,dy:0,dz:0},{name:"screw_18_7",dx:-50,dy:0,dz:0},{name:"Part_66",dx:0,dy:-250,dz:0},{name:"Part_67",dx:0,dy:-250,dz:0},{name:"Part_69",dx:0,dy:-250,dz:0},{name:"Part_70",dx:0,dy:-250,dz:0},{name:"Part_72",dx:0,dy:-250,dz:0},{name:"Part_73",dx:0,dy:-250,dz:0},{name:"Part_75",dx:0,dy:-250,dz:0},{name:"Part_76",dx:0,dy:-250,dz:0},{name:"637_76_333_2",dx:0,dy:-250,dz:0},{name:"637_76_333_2_0",dx:0,dy:-250,dz:0},{name:"637_76_333_2_1",dx:0,dy:-250,dz:0},{name:"637_76_333_2_2",dx:0,dy:-250,dz:0},{name:"637_76_333_2_3",dx:0,dy:-250,dz:0}];for(const{name:r,dx:p,dy:g,dz:W}of Ae){const N=S.getObjectByName(r);N&&J.current.push({obj:N,basePos:N.position.clone(),dx:p,dy:g,dz:W})}Ue.current&&J.current.push({obj:Ue.current,basePos:Ue.current.position.clone(),dx:30,dy:580,dz:0}),T.current&&J.current.push({obj:T.current,basePos:T.current.position.clone(),dx:30,dy:580,dz:0});const Je=new Set(J.current.map(r=>r.obj.name)),ye=Ae.filter(r=>!Je.has(r.name)).map(r=>r.name);ye.length?console.warn("[Card3Assembly] MISSING:",ye.join(", ")):J.current.length,window.__scene=S,ge.current=[],Ht.current=!1;const Oe=[{headName:"bau0016962400_v(71B959M01)_2",repName:"body_guide_1"},{headName:"bau0016962400_v(71B959M01)_1",repName:"body_guide"},{headName:"bau0016962400_v(71B959M01)",repName:"body_guide_2"},{headName:"bau0016962400_v(71B959M01)_3",repName:"body_guide_3"}];for(const{headName:r,repName:p}of Oe){const g=S.getObjectByName(r),W=S.getObjectByName(p);g&&W&&ge.current.push({obj:g,origLocalPos:g.position.clone(),worldBasePos:new j,repObj:W,initialized:!1})}De.current.forEach(({line:r,dots:p})=>{be.remove(r),r.geometry.dispose(),be.remove(p),p.geometry.dispose()}),De.current=[];const Fe=[{rep:"body_guide_2",members:["bau0016992030_v(78A908-T202)_1","bau0019426112_v(74T110M1401)_1"]},{rep:"body_guide_3",members:["bau0016992030_v(78A908-T202)","bau0019426112_v(74T110M1401)"]},{rep:"body_guide_1",members:["bau0016992030_v(78A908-T202)_3","bau0019426112_v(74T110M1401)_3"]},{rep:"body_guide",members:["bau0016992030_v(78A908-T202)_2","bau0019426112_v(74T110M1401)_2"]}];for(const{rep:r,members:p}of Fe){const g=J.current.find(Te=>Te.obj.name===r);if(!g)continue;const W=g.basePos.x+g.dx,N=g.basePos.y+g.dy,me=g.basePos.z+g.dz;for(const Te of p){const Ne=J.current.find(Ie=>Ie.obj.name===Te);Ne&&(Ne.dx=W-Ne.basePos.x,Ne.dy=N-Ne.basePos.y,Ne.dz=me-Ne.basePos.z)}}const o=new Set(["screw_18_3","screw_18","screw_18_1","screw_18_2","screw_18_4","screw_18_5","screw_18_6","screw_18_7","#8_Wood_Screw_2in_9","#8_Wood_Screw_2in_11","#8_Wood_Screw_2in_13","#8_Wood_Screw_2in_15","#8_Wood_Screw_2in_14","#8_Wood_Screw_2in_10","#8_Wood_Screw_2in_12","#8_Wood_Screw_2in","#8_Wood_Screw_2in_1","#8_Wood_Screw_2in_2","#8_Wood_Screw_2in_3","#8_Wood_Screw_2in_4","#8_Wood_Screw_2in_5","#8_Wood_Screw_2in_6","#8_Wood_Screw_2in_7","#8_Wood_Screw_2in_8","#8_Wood_Screw_2in_18","#8_Wood_Screw_2in_17","#8_Wood_Screw_2in_16","#8_Wood_Screw_2in_19","637_76_333_2_2","637_76_333_2","637_76_333_2_3","637_76_333_2_1"]),y=new Set(["#8_Wood_Screw_2in_1","#8_Wood_Screw_2in_2","#8_Wood_Screw_2in_3","#8_Wood_Screw_2in_4","#8_Wood_Screw_2in_5","#8_Wood_Screw_2in_6","#8_Wood_Screw_2in_7","#8_Wood_Screw_2in_8"]),O=new Set(["#8_Wood_Screw_2in","#8_Wood_Screw_2in_9","#8_Wood_Screw_2in_10","#8_Wood_Screw_2in_11","#8_Wood_Screw_2in_12","#8_Wood_Screw_2in_13","#8_Wood_Screw_2in_14","#8_Wood_Screw_2in_15"]),$=new Set(["screw_18","screw_18_1","screw_18_2","screw_18_3"]),I=new Set(["screw_18_4","screw_18_5","screw_18_6","screw_18_7"]),ie=new Set(["#8_Wood_Screw_2in_17","#8_Wood_Screw_2in_18"]),Ve=new Set(["#8_Wood_Screw_2in_16","#8_Wood_Screw_2in_19"]),Ke=J.current.find(r=>r.obj.name==="Part_3"),Mt=J.current.find(r=>r.obj.name==="body_guide_2"),c=J.current.find(r=>r.obj.name==="body_guide_1"),F=J.current.find(r=>r.obj.name==="Part_7"),se=J.current.find(r=>r.obj.name==="Part_8");for(const r of J.current){if(!o.has(r.obj.name))continue;const p=new j;{const qt=new $t().setFromObject(r.obj);qt.isEmpty()||(qt.getCenter(p),r.obj.updateWorldMatrix(!0,!1),p.applyMatrix4(r.obj.matrixWorld.clone().invert()))}const g=new Yt;
1g.setAttribute("position",new Kt([0,0,0,0,0,0],3));const W=new rr(g,G);W.visible=!1,W.renderOrder=998,W.frustumCulled=!1,be.add(W);const N=new Yt;N.setAttribute("position",new Kt([0,0,0],3));const me=new Br(N,gt);me.visible=!1,me.renderOrder=999,me.frustumCulled=!1,be.add(me);const Te=Math.abs(r.dx),Ne=Math.abs(r.dy),Ie=Math.abs(r.dz);let Ot;["#8_Wood_Screw_2in_16","#8_Wood_Screw_2in_17","#8_Wood_Screw_2in_18","#8_Wood_Screw_2in_19"].includes(r.obj.name)?Ot=new j(0,1,0):Te>=Ne&&Te>=Ie?Ot=new j(1,0,0):Ie>=Te&&Ie>=Ne?Ot=new j(0,0,1):Ot=new j(0,1,0);let Qe;y.has(r.obj.name)?Qe=Ke:$.has(r.obj.name)?Qe=Mt:I.has(r.obj.name)?Qe=c:ie.has(r.obj.name)?Qe=F:Ve.has(r.obj.name)&&(Qe=se),De.current.push({hwObj:r.obj,line:W,dots:me,hwLocalCenter:p,basePos:r.basePos,primaryAxis:Ot,targetEntry:Qe})}ue.current=[],_e.current=[],Ye.current=[],we.current.forEach(r=>{r.parent?.remove(r),r.geometry.dispose()}),we.current=[];const he=/[Ll]eg|[Ff]oot|[Ss]upport|[Bb]ase_leg/,pe=/^bau0016962400|^bau0016992030|^bau0019426112|^body_guide/,Re=/^6?37_76_333_2|^Part_(66|67|69|70|72|73|75|76)$/,Le=[],mt=[];S.traverse(r=>{if(!(r instanceof He)||E.has(r.name)||he.test(r.name))return;r.geometry.computeBoundingBox();const p=r.geometry.boundingBox.getCenter(new j);u.test(r.name)?mt.push({mesh:r,center:p}):Le.push({mesh:r,center:p})});const pt=new $t;for(const{center:r}of Le)pt.expandByPoint(r);const jt=pt.isEmpty()?new j(0,363,0):pt.getCenter(new j);dt.current=[],ke.current=[];const Rt=[];for(const{mesh:r,center:p}of Le){const g=!!(Ct&&Ct.has(r.name)),W=new fr(r.geometry,15),N=new tr(W,le);if(N.visible=!1,N.renderOrder=999,r.add(N),_e.current.push(N),g){dt.current.push(N);const qt=Array.isArray(r.material)?r.material:[r.material];for(const er of qt)er instanceof Et&&!ke.current.includes(er)&&ke.current.push(er)}const me=new tr(W,xe);me.visible=!1,me.renderOrder=997,r.add(me),Ye.current.push(me);const Te=p.clone().sub(jt);Te.lengthSq()<1&&Te.set(0,1,0);const Ne=Math.abs(Te.x),Ie=Math.abs(Te.y),Ot=Math.abs(Te.z),Qe=new j;Ne>=Ie&&Ne>=Ot?Qe.set(Te.x>0?1:-1,0,0):Ie>=Ne&&Ie>=Ot?Qe.set(0,Te.y>0?1:-1,0):Qe.set(0,0,Te.z>0?1:-1),Rt.push({mesh:r,center:p,dir:Qe})}const At=(r,p,g)=>{let W=null,N=1/0;for(const me of Rt){if(Math.sign(me.dir[p])!==g)continue;const Te=r.distanceTo(me.center.clone().applyMatrix4(me.mesh.matrixWorld));Te<N&&(N=Te,W=me)}return W},Xt=280,Zt=45,zr=.45,Er=new Map;function Nr(r){return`${r.x},${r.y},${r.z}`}Rt.sort((r,p)=>p.center.y-r.center.y),Rt.forEach(({mesh:r,dir:p},g)=>{const W=Rt.length>1?g/(Rt.length-1)*zr:0;if(Re.test(r.name)){ue.current.push({obj:r,dir:new j(0,-1,0),basePos:r.position.clone(),delay:.55,dist:120});return}const N=Nr(p),me=(Er.get(N)??Xt-Zt)+Zt;Er.set(N,me),ue.current.push({obj:r,dir:p.clone(),basePos:r.position.clone(),delay:W,dist:me})}),Ee.current.forEach(r=>{be.remove(r.line),r.line.geometry.dispose()}),Ee.current=[];for(let r=0;r<Rt.length;r++)for(let p=r+1;p<Rt.length;p++){const{mesh:g,dir:W}=Rt[r],{mesh:N,dir:me}=Rt[p];if(Math.abs(W.dot(me))>.3)continue;g.updateWorldMatrix(!0,!1),N.updateWorldMatrix(!0,!1);const Te=new $t().setFromObject(g),Ne=new $t().setFromObject(N);if(!Te.clone().expandByScalar(.006).intersectsBox(Ne))continue;const Ie=Te.getCenter(new j),Ot=Ne.getCenter(new j),Qe=Ot.clone().sub(Ie).normalize(),qt=Te.getSize(new j).multiplyScalar(.5),er=Ne.getSize(new j).multiplyScalar(.5),ln=Math.min(Math.abs(Qe.x)>1e-6?qt.x/Math.abs(Qe.x):1/0,Math.abs(Qe.y)>1e-6?qt.y/Math.abs(Qe.y):1/0,Math.abs(Qe.z)>1e-6?qt.z/Math.abs(Qe.z):1/0),un=Math.min(Math.abs(Qe.x)>1e-6?er.x/Math.abs(Qe.x):1/0,Math.abs(Qe.y)>1e-6?er.y/Math.abs(Qe.y):1/0,Math.abs(Qe.z)>1e-6?er.z/Math.abs(Qe.z):1/0),dn=g.worldToLocal(Ie.clone().addScaledVector(Qe,ln)),fn=N.worldToLocal(Ot.clone().addScaledVector(Qe,-un)),Gr=new Yt;Gr.setAttribute("position",new Kt([0,0,0,0,0,0],3));const gr=new rr(Gr,It);gr.visible=!1,gr.renderOrder=997,be.add(gr),Ee.current.push({meshA:g,meshB:N,line:gr,anchorA:dn,anchorB:fn})}const sn={Part_42:"Part_43",Part_46:"Part_47"};for(const r of ue.current){const p=sn[r.obj.name];if(!p)continue;const g=ue.current.find(W=>W.obj.name===p);g&&(r.dir=g.dir.clone(),r.delay=g.delay)}const an=/[Ss]ink|[Ff]aucet|[Pp]lug/;rt.current.forEach(r=>{be.remove(r.line),r.line.geometry.dispose()}),rt.current=[];const Hr=Rt.find(r=>r.mesh.name==="Part_1")??null,Ur=Rt.find(r=>r.mesh.name==="Part_3")??null,Yr=[];for(const{mesh:r,center:p}of mt){const g=p.clone().applyMatrix4(r.matrixWorld);let W=new j(0,0,1),N=null,me=1/0,Te=new j;for(const{mesh:Ie,center:Ot,dir:Qe}of Rt){const qt=Ot.clone().applyMatrix4(Ie.matrixWorld),er=g.distanceTo(qt);er<me&&(me=er,W=Qe,N=Ie,Te=Ot.clone())}{let Ie=null;(y.has(r.name)||I.has(r.name))&&Ur?Ie=Ur:(O.has(r.name)||$.has(r.name))&&Hr?Ie=Hr:(Ve.has(r.name)||ie.has(r.name))&&(Ie=At(g,"z",1)),Ie&&(W=Ie.dir,N=Ie.mesh,Te=Ie.center.clone())}if(!N)continue;const Ne=pe.test(r.name)||Re.test(r.name)||an.test(r.name);Yr.push({mesh:r,center:p,nearestDir:W,nearestPanel:N,panelLocalCenter:Te,skipExplode:Ne})}
1const hr=new Map;for(const r of Yr)hr.has(r.nearestPanel)||hr.set(r.nearestPanel,[]),hr.get(r.nearestPanel).push(r);for(const[,r]of hr)for(const p of r){const g=new j;p.mesh.geometry.computeBoundingBox(),p.mesh.geometry.boundingBox&&p.mesh.geometry.boundingBox.getCenter(g);const W=(Er.get(Nr(p.nearestDir))??Xt)+50;if(ue.current.push({obj:p.mesh,dir:p.nearestDir.clone(),basePos:p.mesh.position.clone(),delay:0,skipExplode:p.skipExplode,dist:W}),!p.skipExplode){const N=new Yt;N.setAttribute("position",new Kt([0,0,0,0,0,0],3));const me=new rr(N,oe);if(me.visible=!1,me.renderOrder=998,be.add(me),rt.current.push({hwObj:p.mesh,panelObj:p.nearestPanel,line:me,hwLocalCenter:g,panelLocalCenter:p.panelLocalCenter,panelExpDir:p.nearestDir.clone()}),p.nearestDir.y!==0)continue;const Te=g.clone().applyMatrix4(p.mesh.matrixWorld);p.nearestPanel.updateWorldMatrix(!0,!1);const Ne=p.nearestPanel.worldToLocal(Te),Ie=12,Ot=new Yt;Ot.setAttribute("position",new Kt([-Ie,0,0,Ie,0,0,0,-Ie,0,0,Ie,0,0,0,-Ie,0,0,Ie],3));const Qe=new tr(Ot,Ut);Qe.position.copy(Ne),Qe.visible=!1,Qe.renderOrder=997,p.nearestPanel.add(Qe),we.current.push(Qe)}}for(const r of E){const p=S.getObjectByName(r);if(!(p instanceof He))continue;const g=new fr(p.geometry,15),W=new tr(g,le);W.visible=!1,W.renderOrder=999,p.add(W),_e.current.push(W);const N=new tr(g,xe);N.visible=!1,N.renderOrder=997,p.add(N),Ye.current.push(N)}Ue.current&&ue.current.push({obj:Ue.current,dir:new j(-1,0,1).normalize(),basePos:Ue.current.position.clone(),delay:0,skipExplode:!0}),T.current&&ue.current.push({obj:T.current,dir:new j(1,0,1).normalize(),basePos:T.current.position.clone(),delay:0,skipExplode:!0});const cn=/^637_76_333_2|^Part_(42|43|44|66|67|69|70|72|73|75|76)$/;_t.current=[],S.traverse(r=>{if(!(r instanceof He)||!cn.test(r.name))return;r.geometry.computeBoundingBox();const p=r.geometry.boundingBox?.getCenter(new j).x??0;_t.current.push({node:r,origScaleX:r.scale.x,origPosX:r.position.x,geomOffsetX:p})});{const r=1e3/B;for(const{node:p,origScaleX:g,origPosX:W,geomOffsetX:N}of _t.current){p.scale.x=g*r;const me=W+N*(1-r);p.position.x=me;const Te=ue.current.find(Ie=>Ie.obj===p);Te&&(Te.basePos.x=me);const Ne=J.current.find(Ie=>Ie.obj===p);Ne&&(Ne.basePos.x=me)}}{const r=new Set,p=W=>W.traverse(N=>r.add(N));for(const W of["Part_10","Part 10","Part_3","Part 3","bau0016962400_v(71B959M01)_1","bau0016992030_v(78A908-T202)_2","bau0019426112_v(74T110M1401)_2","body_guide","screw_18_7","screw_18_4"]){const N=S.getObjectByName(W);N&&p(N)}S.traverse(W=>{(W.name==="Part_11"||W.name==="Part 11")&&(W.traverse(N=>r.delete(N)),r.delete(W))});const g=[];S.traverse(W=>{W instanceof He&&(r.has(W)||g.push(W))}),Se.current=g}st.current=[];for(const r of["Part_10","Part 10","Part_3","Part 3"]){const p=S.getObjectByName(r);p&&p.traverse(g=>{g instanceof He&&st.current.push(g)})}{const r=S.getObjectByName("body_guide")??null,p=S.getObjectByName("body_guide_1")??null,g=S.getObjectByName("Part_10")??S.getObjectByName("Part 10")??null;let W=null;if(g instanceof He&&g.geometry){g.geometry.computeBoundingBox();const N=g.geometry.boundingBox;N&&(W=new j(N.max.x,(N.min.y+N.max.y)/2,N.max.z))}yt.current={lower:r,upper:p,doorLocalPt:W,doorMesh:g}}},[S,le]),e.useEffect(()=>{if(!S)return;const b=[],u=[];S.traverse(E=>{if(!(E instanceof He)||!Ct||!Ct.has(E.name))return;const s=Array.isArray(E.material)?E.material:[E.material];for(const a of s)a instanceof Et&&!b.includes(a)&&b.push(a);E.traverse(a=>{a instanceof tr&&_e.current.includes(a)&&(u.includes(a)||u.push(a))})}),ke.current=b,dt.current=u},[S,Ct]),e.useEffect(()=>()=>{rt.current.forEach(b=>{be.remove(b.line),b.line.geometry.dispose()}),rt.current=[],Ee.current.forEach(b=>{be.remove(b.line),b.line.geometry.dispose()}),Ee.current=[],De.current.forEach(({line:b,dots:u})=>{be.remove(b),b.geometry.dispose(),be.remove(u),u.geometry.dispose()}),De.current=[],wt.current.forEach(({line:b,dots:u})=>{be.remove(b),b.geometry.dispose(),be.remove(u),u.geometry.dispose()}),wt.current=[],we.current.forEach(b=>{b.parent?.remove(b),b.geometry.dispose()}),we.current=[]},[be]),e.useEffect(()=>{const b=1e3/B;for(const{node:u,origScaleX:E,origPosX:s,geomOffsetX:a}of _t.current){u.scale.x=E*b;const m=s+a*(1-b);u.position.x=m;const k=ue.current.find(V=>V.obj===u);k&&(k.basePos.x=m);const v=J.current.find(V=>V.obj===u);v&&(v.basePos.x=m)}},[B]),e.useEffect(()=>{const b=B<=700,u=S.getObjectByName("Part_7")??S.getObjectByName("Part 7");u&&(u.visible=!b);const E=S.getObjectByName("Part_10")??S.getObjectByName("Part 10");if(E instanceof He&&H.current){const{origGeom:s,hingeMinX:a}=H.current,m=s.clone();b&&m.applyMatrix4(new _r().makeTranslation(a,0,0).multiply(new _r().makeScale(2,1,1)).multiply(new _r().makeTranslation(-a,0,0))),E.geometry.dispose(),E.geometry=m,E.traverse(k=>{k instanceof tr&&(k.geometry.dispose(),k.geometry=new fr(m,15))})}},[S,B]),dr((b,u)=>{!window.__scene&&S&&(window.__scene=S);const s=d?1:Math.min(n,Math.max(0,1-L)),a=L>=.97,m=d?!0:_&&s>.5;for(const c of nt.current)c.opacity=s,c.transparent=!a,c.depthTest=a?!0:m,c.depthWrite=a?!0:m,c.colorWrite=!a,c.needsUpdate=!0;if(ce>.01){const c=ut*(1-ce),F=ut*.22;S.traverse(he=>{if(!(he instanceof He))return;const pe=Array.isArray(he.material)?he.material:[he.material];he.geometry.boundingBox||he.geometry.computeBoundingBox();const Re=he.geometry.boundingBox;if(!Re)return;const Le=(Re.min.y+Re.max.y)/2;he.updateWorldMatrix(!0,!1);const pt=(he.matrixWorld.elements[13]+Le*he.matrixWorld.elements[5]-c)/F,jt=Ce(pt*.5+.5,0,1),Rt=U(s,.15,jt),At=1-Ce(Math.abs(pt),0,1),Xt=At*At*.4;for(const Zt of pe)Zt instanceof Et&&(Zt.wireframe=!1,Zt.opacity=Ce(Rt,.1,s),Zt.emissive.setRGB(Xt,Xt,Xt*1.2),Zt.needsUpdate=!0)});const se=ut*.12;for(const he of _e.current){const pe=he.parent;
1if(!pe||!(pe instanceof He))continue;pe.geometry.boundingBox||pe.geometry.computeBoundingBox();const Re=pe.geometry.boundingBox;if(!Re)continue;const Le=(Re.min.y+Re.max.y)/2;pe.updateWorldMatrix(!0,!1);const mt=pe.matrixWorld.elements[13]+Le*pe.matrixWorld.elements[5],pt=Math.abs(mt-c);he.material=pt<se?St:le}}else if(at){for(const c of nt.current)c.wireframe=!0,c.needsUpdate=!0;for(const c of _e.current)c.material=le}else{for(const c of nt.current){let F=!1;c.wireframe&&(c.wireframe=!1,F=!0),c.emissiveIntensity>0&&(c.emissive.setRGB(0,0,0),c.emissiveIntensity=0,F=!0),F&&(c.needsUpdate=!0)}for(const c of _e.current)c.material=le}const k=re>0||Be;for(const c of Se.current)c.visible=!k;if(k){for(const c of st.current)c.visible=!0;for(const c of st.current){const F=Array.isArray(c.material)?c.material:[c.material];for(const se of F)se instanceof Et&&(se.opacity=.3,se.depthTest=!0,se.depthWrite=!1,se.needsUpdate=!0)}}Wt.current=k;const v=Ce((L-.9)/.07,0,1),V=d||w||k||s>.02&&s<.85||v>0,Q=d?.35:w||k?.45:v>0?.98:Math.min(.52,(.85-s)/.45);le.opacity=V?Q+q*.25:0,le.depthTest=v>=1?!1:d||w||k;const Ae=d?96/255:U(56,176,q)/255,Je=U(Ae,1,v);le.color.setRGB(Je,Je,Je),le.needsUpdate=!0,St.opacity=V?Math.max(le.opacity,.9):0,St.depthTest=le.depthTest,St.needsUpdate=!0;for(const c of _e.current)c.visible=ne?!1:V;ne&&(le.opacity=0,le.needsUpdate=!0,St.opacity=0,St.needsUpdate=!0);const ye=v>=1;for(const c of Ye.current)c.visible=ye;if(xe.opacity=0,xe.needsUpdate=!0,v>0){for(const c of ke.current)c.opacity=1,c.transparent=!1,c.depthTest=!0,c.depthWrite=!0,c.colorWrite=!0,c.needsUpdate=!0;for(const c of dt.current)c.visible=!1}const Oe=x>tt.current?.18:.22;tt.current=U(tt.current,x,Oe),Math.abs(tt.current-x)<.001&&(tt.current=x);const Fe=tt.current,o=300;for(const{obj:c,dir:F,basePos:se,delay:he,skipExplode:pe,dist:Re,sideOffset:Le}
1of ue.current){const mt=he<1?Ce((Fe-he)/(1-he),0,1):Fe>0?1:0,pt=pe?0:mt,jt=Re??o;c.position.set(se.x+F.x*jt*pt+(Le?.x??0)*pt,se.y+F.y*jt*pt+(Le?.y??0)*pt,se.z+F.z*jt*pt+(Le?.z??0)*pt)}if(!window.__screwLogged){const c=ue.current.filter(F=>F.obj.name.includes("screw_18"));c.length>0&&(c.map(F=>`${F.obj.name} y:${F.obj.position.y.toFixed(1)}`).join(", "),window.__screwLogged=!0)}for(const c of we.current)c.visible=z&&(Fe>0||Xe.current>0);for(const{hwObj:c,panelObj:F,line:se,hwLocalCenter:he,panelLocalCenter:pe,panelExpDir:Re}of rt.current){if(!z||Fe===0){se.visible=!1;continue}c.updateWorldMatrix(!0,!1),F.updateWorldMatrix(!0,!1),de.copy(he).applyMatrix4(c.matrixWorld),fe.copy(pe).applyMatrix4(F.matrixWorld);const Le=Re.dot(fe.clone().sub(de));fe.copy(de).addScaledVector(Re,Le);const mt=se.geometry.attributes.position.array;mt[0]=de.x,mt[1]=de.y,mt[2]=de.z,mt[3]=fe.x,mt[4]=fe.y,mt[5]=fe.z,se.geometry.attributes.position.needsUpdate=!0,se.computeLineDistances(),se.visible=!0}for(const{line:c}of Ee.current)c.visible=!1;!Nt.current&&d&&(et.current=!1,ct.current=!1,Bt.current=0,Ge.current=0),Nt.current=d,!d&&i<=0&&!et.current&&(Bt.current=0,Ge.current=0,qe.current=0,$e.current=0);const y=Bt.current>qe.current?.08:.14,O=Ge.current>$e.current?.08:.14;qe.current+=(Bt.current-qe.current)*y,$e.current+=(Ge.current-$e.current)*O;const $=Math.PI/2,I=et.current?qe.current:Math.max(qe.current,i),ie=et.current?$e.current:Math.max($e.current,i);if(Ue.current){if(Ue.current.visible=!0,!k){const c=Ue.current.getObjectByName("Part_10")??Ue.current.getObjectByName("Part 10");c&&(c.visible=!w)}Ue.current.rotation.x=0,Ue.current.rotation.y=0,Ue.current.rotation.z=k?0:$*I}if(T.current){T.current.visible=!k&&B>700;const c=T.current.getObjectByName("Part_11")??T.current.getObjectByName("Part 11");c&&(c.visible=!w&&!k&&B>700),T.current.rotation.x=0,T.current.rotation.y=0,T.current.rotation.z=-$*ie}if(Ue.current&&H.current){const c=Ue.current.getObjectByName("Part_10")??Ue.current.getObjectByName("Part 10");if(c instanceof He){const F=-H.current.hingeMinX;if(B<=700){const se=.8*B/1e3,he=.8,pe=Ue.current.rotation.z,Re=Math.cos(pe),Le=Math.sin(pe),mt=Math.sqrt((Re*se)**2+(Le*he)**2),pt=mt>1e-10?se/mt:1;c.scale.x=pt,c.position.x=pt*F}else c.scale.x=1,c.position.x=F}}A>=.99?(Xe.current<.01&&(Xe.current=.5),Xe.current=Math.min(1,Xe.current+u/.7)):A<.1&&!z&&!_&&(Xe.current=0);const Ve=Xe.current;if(A>.5&&J.current.length===0?S.visible=!1:S.visible||(S.visible=!0),A>=.5&&!Ht.current){for(const c of ge.current)c.obj.updateWorldMatrix(!0,!1),c.obj.getWorldPosition(c.worldBasePos),c.initialized=!0;Ht.current=!0}else if(A<.1){Ht.current=!1;for(const c of ge.current)c.initialized=!1}if(x<=0){const c=Ve*A*(1-lt(Math.min(1,re)));for(const{obj:F,basePos:se,dx:he,dy:pe,dz:Re}of J.current)F.position.set(se.x+he*c,se.y+pe*c,se.z+Re*c);for(const F of ge.current){if(!F.obj.parent)continue;if(!F.initialized||c<=0){F.obj.position.copy(F.origLocalPos);continue}F.repObj.updateWorldMatrix(!0,!1);const se=new j;F.repObj.getWorldPosition(se);const he=new j().lerpVectors(F.worldBasePos,se,c);F.obj.parent.updateWorldMatrix(!0,!1),F.obj.parent.worldToLocal(he),F.obj.position.copy(he)}}const Ke=.05;for(const{hwObj:c,line:F,dots:se,hwLocalCenter:he,basePos:pe,primaryAxis:Re,targetEntry:Le}of De.current){if(Ve<=0||A<.1){F.visible=!1,se.visible=!1;continue}c.updateWorldMatrix(!0,!1),de.copy(he).applyMatrix4(c.matrixWorld);const mt=Re.clone().transformDirection(c.matrixWorld).normalize();let pt;if(Le){const At=Ve*A*(1-lt(Math.min(1,re)));Pe.set(Le.basePos.x+Le.dx*At,Le.basePos.y+Le.dy*At,Le.basePos.z+Le.dz*At);const Xt=Le.obj.parent;Xt&&(Xt.updateWorldMatrix(!0,!1),Pe.applyMatrix4(Xt.matrixWorld)),pt=Math.sign(Pe.clone().sub(de).dot(mt))}else fe.copy(c.position),c.position.copy(pe),c.updateWorldMatrix(!0,!1),Pe.copy(he).applyMatrix4(c.matrixWorld),c.position.copy(fe),c.updateWorldMatrix(!0,!1),pt=Math.sign(Pe.clone().sub(de).dot(mt));pt===0&&(pt=1),Pe.copy(de).addScaledVector(mt,pt*Ke);const jt=F.geometry.attributes.position.array;jt[0]=de.x,jt[1]=de.y,jt[2]=de.z,jt[3]=Pe.x,jt[4]=Pe.y,jt[5]=Pe.z,F.geometry.attributes.position.needsUpdate=!0,F.computeLineDistances(),F.visible=!0;const Rt=se.geometry.attributes.position.array;Rt[0]=Pe.x,Rt[1]=Pe.y,Rt[2]=Pe.z,se.geometry.attributes.position.needsUpdate=!0,se.visible=!0}for(const{obj:c,basePosZ:F,side:se}of Pt.current){const he=k?0:se==="left"?I:ie;c.position.z=F+he*20}const Mt=re;if(ft.current&&(ft.current.visible=!1),Mt>0){if(Mt>=.85&&(ot.current+=u,ot.current>=.5&&(We.current=Math.min(1,We.current+u/1.5))),Tr.current=We.current,xt.current.length>0){const F=lt(Tr.current),se=(1-F)*20,he=Math.PI*2;for(const{obj:pe,basePos:Re,baseRot:Le,cy:mt,cz:pt,bpy:jt,bpz:Rt}of xt.current){pe.visible=!0,pe.traverse(zr=>{zr.visible=!0});const At=Le.x+F*he,Xt=mt*Math.cos(At)-pt*Math.sin(At),Zt=mt*Math.sin(At)+pt*Math.cos(At);pe.position.set(Re.x+se,Re.y+jt-Xt,Re.z+Rt-Zt),pe.rotation.x=At,pe.rotation.y=Le.y,pe.rotation.z=Le.z}}const c=.03;for(const{screwObj:F,line:se,dots:he,screwLocalCenter:pe}of wt.current){if(Mt<.5){se.visible=!1,he.visible=!1;continue}F.updateWorldMatrix(!0,!1),de.copy(pe).applyMatrix4(F.matrixWorld),fe.set(-1,0,0).transformDirection(F.matrixWorld).normalize(),Pe.copy(de).addScaledVector(fe,c);const Re=se.geometry.attributes.position.array;Re[0]=de.x,Re[1]=de.y,Re[2]=de.z,Re[3]=Pe.x,Re[4]=Pe.y,Re[5]=Pe.z,se.geometry.attributes.position.needsUpdate=!0,se.computeLineDistances(),se.visible=!0;const Le=he.geometry.attributes.position.array;Le[0]=Pe.x,Le[1]=Pe.y,Le[2]=Pe.z,he.geometry.attributes.position.needsUpdate=!0,he.visible=!0}{const F=b.camera,{lower:se,upper:he,doorLocalPt:pe,doorMesh:Re}=yt.current;se&&(se.getWorldPosition(ve),ve.project(F),yr.current.lower={x:(ve.x+1)/2*100,y:(1-(ve.y+1)/2)*100}),he&&(he.getWorldPosition(ve),ve.project(F),yr.current.upper={x:(ve.x+1)/2*100,y:(1-(ve.y+1)/2)*100}),Re&&pe&&(Re.updateWorldMatrix(!0,!1),ve.copy(pe).applyMatrix4(Re.matrixWorld),ve.project(F),yr.current.doorEdge={x:(ve.x+1)/2*100,y:(1-(ve.y+1)/2)*100})}}else{if(We.current=0,ot.current=0,Tr.current=0,yr.current={lower:null,upper:null,doorEdge:null},xt.current.length>0)for(const{obj:c,basePos:F,baseRot:se}of xt.current)c.visible=!0,c.traverse(he=>{he.visible=!0}),c.position.copy(F),c.rotation.copy(se);for(const{line:c,dots:F}of wt.current)c.visible=!1,F.visible=!1}});const ze=e.useRef(null),Dt=b=>{b.stopPropagation();const u=b.object;ze.current&&ze.current.mat!==u.material&&(ze.current.mat.color.copy(ze.current.origColor),ze.current.mat.emissive.set(0,0,0),ze.current=null),!ze.current&&u.material instanceof Et&&(ze.current={mat:u.material,origColor:u.material.color.clone()},u.material.emissive.set(.08,.08,.09))},h=()=>{ze.current&&(ze.current.mat.color.copy(ze.current.origColor),ze.current.mat.emissive.set(0,0,0),ze.current=null)},te=b=>{if(b.stopPropagation(),n<.95||x>.05)return;(et.current?qe.current:Math.max(qe.current,i))>.5?(et.current=!0,Bt.current=0,Ge.current=0):(et.current=!1,Bt.current=1,Ge.current=1)},X=e.useRef(!1);e.useEffect(()=>{if(X.current||!ee)return;const b=[];S.traverse(u=>{u instanceof He&&u.name&&b.push(u.name)}),b.length>0&&(X.current=!0,ee(b))},[S,ee]);const M=e.useRef(null),P=e.useRef(null),C=e.useRef(new Map),D=e.useRef(new Map),K=e.useRef(it??new Set(["Part_10","Part_11"]));K.current=it??new Set(["Part_10","Part_11"]);const R=()=>{const b=K.current,u=[];return S.traverse(E=>{if(!(E instanceof He))return;const s=E.name.replace(/ /g,"_");
1if(!b.has(E.name)&&!b.has(s))return;const a=Array.isArray(E.material)?E.material:[E.material];for(const m of a)m instanceof Et&&(C.current.has(m)||C.current.set(m,{map:m.map,color:m.color.clone()}),u.push({name:s,mat:m,mesh:E}))}),u};e.useEffect(()=>{const b=vt!==P.current;P.current=vt;const u=R();if(!vt){for(const[,a]of D.current)a.dispose();D.current.clear(),M.current&&(M.current.dispose(),M.current=null);for(const{mat:a}of u){const m=C.current.get(a);m&&(a.map=m.map,a.color.copy(m.color)),a.needsUpdate=!0}return}const E=Tt??{},s=a=>{for(const[,m]of D.current)m.dispose();D.current.clear();for(const{name:m,mat:k,mesh:v}of u){const V=E[m]??0,Q=a.clone();Q.colorSpace=nr,Q.wrapS=Q.wrapT=or,Q.rotation=V*Math.PI/180,Q.center.set(.5,.5),Sr(Q,v),Q.needsUpdate=!0,D.current.set(m,Q),k.map=Q,k.color.set("#ffffff"),k.needsUpdate=!0}};!b&&M.current?s(M.current):new vr().load(vt,a=>{a.colorSpace=nr,a.wrapS=a.wrapT=or,M.current&&M.current.dispose(),M.current=a,s(a)})},[vt,S,it]),e.useEffect(()=>{if(!M.current||D.current.size===0)return;const b=Tt??{},u=R();for(const{name:E,mat:s}of u){const a=b[E]??0,m=D.current.get(E);m&&(m.rotation=a*Math.PI/180,m.center.set(.5,.5),m.needsUpdate=!0,s.needsUpdate=!0)}},[Tt]);const l=e.useRef(null),ae=e.useRef(null),Z=e.useRef(new Map),Me=e.useRef(new Map),ht=e.useRef(zt??new Set);ht.current=zt??new Set;const kt=()=>{const b=ht.current,u=[];return S.traverse(E=>{if(!(E instanceof He))return;const s=E.name.replace(/ /g,"_");if(!b.has(E.name)&&!b.has(s))return;const a=Array.isArray(E.material)?E.material:[E.material];for(const m of a)m instanceof Et&&(Z.current.has(m)||Z.current.set(m,{map:m.map,color:m.color.clone()}),u.push({name:s,mat:m,mesh:E}))}),u};return e.useEffect(()=>{const b=bt!==ae.current;ae.current=bt;const u=kt();if(!bt||ht.current.size===0){for(const[,a]of Me.current)a.dispose();Me.current.clear(),l.current&&(l.current.dispose(),l.current=null);for(const{mat:a}of u){const m=Z.current.get(a);m&&(a.map=m.map,a.color.copy(m.color)),a.needsUpdate=!0}return}const E=je??{},s=a=>{for(const[,m]of Me.current)m.dispose();Me.current.clear();for(const{name:m,mat:k,mesh:v}of u){const V=E[m]??0,Q=a.clone();Q.colorSpace=nr,Q.wrapS=Q.wrapT=or,Q.rotation=V*Math.PI/180,Q.center.set(.5,.5),Sr(Q,v),Q.needsUpdate=!0,Me.current.set(m,Q),k.map=Q,k.color.set("#ffffff"),k.needsUpdate=!0}};!b&&l.current?s(l.current):new vr().load(bt,a=>{a.colorSpace=nr,a.wrapS=a.wrapT=or,l.current&&l.current.dispose(),l.current=a,s(a)})},[bt,S,zt]),e.useEffect(()=>{if(!l.current||Me.current.size===0)return;const b=je??{},u=kt();for(const{name:E,mat:s}of u){const a=b[E]??0,m=Me.current.get(E);m&&(m.rotation=a*Math.PI/180,m.center.set(.5,.5),m.needsUpdate=!0,s.needsUpdate=!0)}},[je]),t.jsx("group",{position:[0,-.363,0],scale:.001,rotation:[Math.PI/2,0,0],onPointerMove:Dt,onPointerOut:h,onClick:te,children:t.jsx("primitive",{object:S})})}Mr.preload("/models/2Drawer_Render_Mode_V2.glb");function Fn({drawerOpenProgress:i,panelOpacity:n,useDepthTest:_,isInitialState:d,explodeProgress:x,drawingModeProgress:L=0,widthMm:B=1e3,edgeColorProgress:q=0,hideDoor:w=!1,showAnnotations:z=!1,scanLineY:A=-1,outerEdgesOnly:Be=!1,doorTexturePath:re=null,doorTextureParts:at,doorTextureRotations:ce,bodyTexturePath:ut=null,bodyTextureParts:ne,bodyTextureRotations:vt,onMeshNamesReady:it}){const Tt=Mr("/models/2Drawer_Render_Mode_V2.glb"),bt=lr("/models/1.avif"),zt=lr("/stone-texture.webp"),je=e.useMemo(()=>{const M=Tt.scene.clone(!0);bt.wrapS=bt.wrapT=ir,bt.repeat.set(1,1),bt.needsUpdate=!0;const P=bt.clone();P.rotation=Math.PI/2,P.center.set(.5,.5),P.wrapS=P.wrapT=ir,P.repeat.set(1,1),P.matrixAutoUpdate=!1,P.updateMatrix(),P.needsUpdate=!0;const C=new Set(["Part_2","Part_8","Part_9","Part_10","Part_13","Part_14","Part 2","Part 8","Part 9","Part 10","Part 13","Part 14"]);return zt.wrapS=zt.wrapT=ir,zt.repeat.set(1,1),zt.needsUpdate=!0,M.traverse(D=>{if(!(D instanceof He))return;const K=D.name.replace(/ /g,"_"),R=nn(D.name),l=R==="left"||R==="right",ae=C.has(D.name)||C.has(K)||l||R==="kickboard",Z=D.name==="Part_11";if(!ae&&!Z)return;
1(Array.isArray(D.material)?D.material:[D.material]).forEach((ht,kt)=>{if(!(ht instanceof Et))return;const b=ht.clone();ae?(b.map=P,b.color.set("#ffffff"),b.roughness=.72,b.metalness=0):(b.map=zt,b.color.set("#f8f5f0"),b.roughness=.04,b.metalness=.06,b.envMapIntensity=3.5),b.needsUpdate=!0,Array.isArray(D.material)?D.material[kt]=b:D.material=b})}),M},[Tt.scene,bt,zt]),ee=e.useMemo(()=>new Vt({color:"#484848",transparent:!0,depthTest:!1,depthWrite:!1}),[]),Ct=e.useMemo(()=>new Vt({color:"#ffffff",transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}),[]),Y=e.useMemo(()=>new Vt({color:"#ffffff",transparent:!0,opacity:.9,depthTest:!1,depthWrite:!1}),[]),f=e.useMemo(()=>new cr({color:16777215,dashSize:.008,gapSize:.006,opacity:.85,transparent:!0,depthTest:!1}),[]);e.useMemo(()=>{const R=document.createElement("canvas");R.width=R.height=64;const l=R.getContext("2d");return l.strokeStyle="white",l.lineWidth=6,l.lineCap="round",l.beginPath(),l.moveTo(10,32),l.lineTo(54,32),l.stroke(),l.beginPath(),l.moveTo(32,10),l.lineTo(32,54),l.stroke(),new br({map:new wr(R),size:.024,sizeAttenuation:!0,depthTest:!1,transparent:!0,alphaTest:.1})},[]);const{scene:Ze}=ur(),S=e.useMemo(()=>new j,[]),le=e.useMemo(()=>new j,[]),xe=e.useMemo(()=>new j,[]),St=e.useMemo(()=>new Vt({color:16777215,opacity:.5,transparent:!0,depthTest:!1}),[]),Ue=e.useMemo(()=>new cr({color:16777215,dashSize:.003,gapSize:.002,opacity:.85,transparent:!0,depthTest:!1}),[]),T=e.useMemo(()=>{const R=document.createElement("canvas");R.width=R.height=64;const l=R.getContext("2d");return l.strokeStyle="white",l.lineWidth=6,l.lineCap="round",l.beginPath(),l.moveTo(10,32),l.lineTo(54,32),l.stroke(),l.beginPath(),l.moveTo(32,10),l.lineTo(32,54),l.stroke(),new br({map:new wr(R),size:.012,sizeAttenuation:!0,depthTest:!1,transparent:!0,alphaTest:.1})},[]),ue=e.useRef([]),tt=e.useRef([]),rt=e.useRef(0),Ee=e.useRef([]),De=e.useRef([]),_e=e.useRef([]),Ye=e.useRef([]),we=e.useRef({minY:0,maxY:726}),ke=e.useRef([]),dt=e.useRef([]),be=e.useRef([]),oe=e.useRef([]),G=e.useRef([]),gt=e.useRef(0),Ft=e.useRef(!1),Lt=e.useRef(0),It=e.useRef([]),Ut=e.useRef([]),de=e.useRef([]),fe=e.useRef([]),Pe=e.useRef(0),ve=e.useRef(0),yt=e.useRef(0),nt=e.useRef(0),_t=e.useRef(0),Xe=e.useRef([]),qe=e.useRef(!1),Bt=e.useRef(!0),$e=e.useRef(!1),Ge=e.useRef(!1),et=e.useRef(0),ct=e.useRef(0),Nt=e.useRef(d),Pt=e.useRef(i);e.useEffect(()=>{const M=/^bau|[Ss]crew|637_76|[Ll]eg|[Cc]ylinder|[Pp]ipe|[Tt]ube|[Ff]oot|[Ff]aucet|[Ss]ink|[Pp]lug|[Hh]inge/,P="decal_BLUMpng",C=o=>o.startsWith(P);ue.current=[],je.traverse(o=>{if(!(o instanceof He))return;if(o.castShadow=!0,o.receiveShadow=!0,C(o.name)){if(!Array.isArray(o.material)&&o.material instanceof Et){const I=o.material.clone();I.transparent=!0,I.depthWrite=!1,I.alphaTest=.01,I.side=Wn,I.needsUpdate=!0,o.material=I}return}const y=Array.isArray(o.material)?o.material:[o.material],O=M.test(o.name),$=/^6?37_76_333_2|^Part_(39|40|57|58|60|61|63|64)$/.test(o.name);for(const I of y)I instanceof Et&&!ue.current.includes(I)&&(I.transparent=!0,$?(I.color.set("#505050"),I.roughness=.45,I.metalness=.3):I.color.r+I.color.g+I.color.b>2&&I.metalness<.2&&!O&&(I.color.set("#C8C4BC"),I.roughness=.5,I.metalness=0),I.envMapIntensity=2.2,ue.current.push(I))});const D=new $t;je.traverse(o=>{o instanceof He&&D.expandByObject(o)});const K=D.isEmpty()?new j(0,363,0):D.getCenter(new j);D.isEmpty()||(we.current={minY:D.min.y,maxY:D.max.y}),tt.current=[],_e.current=[],Ye.current=[];const R=[["637_76_333_2_3","Part_63","Part_64"],["637_76_333_2_2","Part_60","Part_61"],["637_76_333_2","Part_39","Part_40"],["637_76_333_2_1","Part_57","Part_58"],["Part_14","Part_29","Part_30","Part_31","Part_32","Part_33","Part_34","Part_35","Part_36","Part_37","Part_38","rail_upper","rail_upper_5"],["Part_13","Part_15","Part_16","Part_17","Part_18","Part_19","Part_20","rail_upper_2","rail_upper_3"],["Part_21","Part_22","Part_23","Part_24","Part_25","Part_26","Part_27","rail_upper_1","rail_upper_4"],["#8_Wood_Screw_2in_8","#8_Wood_Screw_2in_3","#8_Wood_Screw_2in_5","#8_Wood_Screw_2in_4","#8_Wood_Screw_2in_6","#8_Wood_Screw_2in_1","#8_Wood_Screw_2in","#8_Wood_Screw_2in_2"],["Part_9"],["Part_4"],["Part_5"],["Part_6"],["Part_11"],["Part_7"],["Part_8"],["rail_bottom_2_2","rail_bottom","screw_18_17","screw_18_2","screw_18_3","screw_18_4","screw_18_22","screw_18_8","screw_18_23","screw_18_13"],["Part_0"],["Part_2"],["Part_12"],["Part_1"],["Part_3"],["Part_10"],["#8_Wood_Screw_2in_13","#8_Wood_Screw_2in_10","#8_Wood_Screw_2in_12","#8_Wood_Screw_2in_11","#8_Wood_Screw_2in_9","#8_Wood_Screw_2in_15","#8_Wood_Screw_2in_14","#8_Wood_Screw_2in_7"],["rail_bottom_2","rail_bottom_2.001","rail_bottom_1","rail_bottom_2_1","screw_18_1","screw_18_10","screw_18_11","screw_18_12","screw_18_9","screw_18_18","screw_18_19","screw_18_20","screw_18_6","screw_18_16","screw_18_7","screw_18_21","screw_18_14","screw_18","screw_18_15","screw_18_5"]],l=new Map;R.forEach((o,y)=>{o.forEach(O=>{l.set(O,y),l.set(O.replace(/_/g," "),y)})});const ae=[],Z=R.map(()=>new j),Me=R.map(()=>0),ht=/^bau0016962400|^bau0016992030|^body_guide/;je.updateMatrixWorld(!0),je.traverse(o=>{if(!(o instanceof He)||C(o.name))return;o.geometry.computeBoundingBox();const y=o.geometry.boundingBox,O=new $t().setFromObject(o).getCenter(new j),$=O.clone().sub(K);$.lengthSq()<1&&$.set(0,0,1),$.normalize();const I=l.get(o.name)??-1;ae.push({mesh:o,center:O,dir:$,groupIdx:I}),I>=0&&(Z[I].add(O),Me[I]++);const ie=y.getSize(new j),Ve=Math.max(ie.x,ie.y,ie.z);if(!M.test(o.name)&&Ve>=30){const Ke=/[Ss]ink|[Ff]aucet|[Pp]lug/.test(o.name)?1:15,Mt=new fr(o.geometry,Ke),c=new tr(Mt,ee);
1c.visible=!1,c.renderOrder=999,o.add(c),_e.current.push(c);const F=new tr(Mt,Ct);F.visible=!1,F.renderOrder=997,o.add(F),Ye.current.push(F)}});const kt=R.map((o,y)=>{if(Me[y]===0)return new j(0,0,1);const $=Z[y].clone().divideScalar(Me[y]).clone().sub(K);$.lengthSq()<1&&$.set(0,0,1),$.normalize();const I=Math.abs($.x),ie=Math.abs($.y),Ve=Math.abs($.z);return I>=ie&&I>=Ve?new j(Math.sign($.x),0,0):ie>=I&&ie>=Ve?new j(0,Math.sign($.y),0):new j(0,0,Math.sign($.z))}),b={4:{dir:new j(0,0,1),dist:350,delay:0},5:{dir:new j(0,0,1),dist:250,delay:.12},6:{dir:new j(0,0,1),dist:150,delay:.24},9:{dir:new j(0,0,-1),dist:420,delay:0},10:{dir:new j(0,0,-1),dist:270,delay:0},11:{dir:new j(0,0,-1),dist:130,delay:0},12:{dir:new j(0,1,0),dist:220,delay:0},13:{dir:new j(0,1,0),dist:180,delay:0},14:{dir:new j(0,1,0),dist:80,delay:0},15:{dir:new j(0,1,0),dist:5,delay:0},16:{dir:new j(0,-1,0),dist:170,delay:0},17:{dir:new j(0,-1,0),dist:260,delay:0},18:{dir:new j(0,-1,0),dist:350,delay:0},19:{dir:new j(1,0,0),dist:150,delay:0},7:{dir:new j(1,0,0),dist:260,delay:0},8:{dir:new j(1,0,0),dist:340,delay:0},20:{dir:new j(-1,0,0),dist:150,delay:0},22:{dir:new j(-1,0,0),dist:260,delay:0},21:{dir:new j(-1,0,0),dist:340,delay:0},0:{dir:new j(0,-1,0),dist:260,delay:0},1:{dir:new j(0,-1,0),dist:260,delay:0},2:{dir:new j(0,-1,0),dist:260,delay:0},3:{dir:new j(0,-1,0),dist:260,delay:0},23:{dir:new j(0,-1,0),dist:0,delay:0}};ae.sort((o,y)=>y.center.y-o.center.y);const u=.4,E=ae.map((o,y)=>ae.length>1?y/(ae.length-1)*u:0),s=R.map(()=>1/0);ae.forEach(({groupIdx:o},y)=>{o>=0&&E[y]<s[o]&&(s[o]=E[y])}),ae.forEach(({mesh:o,dir:y,groupIdx:O},$)=>{const I=O>=0?b[O]:void 0,ie=I?I.delay:O>=0&&s[O]!==1/0?s[O]:E[$],Ve=ht.test(o.name),Ke=I?I.dir:O>=0?kt[O]:y,Mt=I?.dist;tt.current.push({obj:o,dir:Ke,basePos:o.position.clone(),delay:ie,skipExplode:Ve,dist:Mt})}),Ee.current.forEach(({line:o})=>{Ze.remove(o),o.geometry.dispose()}),Ee.current=[],De.current.forEach(o=>{o.parent?.remove(o),o.geometry.dispose()}),De.current=[];const a=/^screw_18|^rail_upper|^#8_Wood_Screw_2in|^637_76_333_2/,m=o=>{const y=je.getObjectByName(o)??je.getObjectByName(o.replace(/_/g," "));return y instanceof He?y:null},k=new Set(["screw_18_5","screw_18_15","screw_18","screw_18_14","screw_18_21","screw_18_7","screw_18_16","screw_18_6","screw_18_13","screw_18_23","screw_18_8","screw_18_22"]),v=new Set(["screw_18_17","screw_18_2","screw_18_3","screw_18_4","screw_18_1","screw_18_10","screw_18_11","screw_18_12","screw_18_9","screw_18_18","screw_18_19","screw_18_20"]);je.updateMatrixWorld(!0);const V=je.parent,Q=new _r;V&&(V.updateWorldMatrix(!0,!1),Q.copy(V.matrixWorld).invert());for(const o of tt.current){if(!(o.obj instanceof He)||!a.test(o.obj.name))continue;const y=new j,O=new $t().setFromObject(o.obj);O.isEmpty()||(O.getCenter(y),o.obj.updateWorldMatrix(!0,!1),y.applyMatrix4(o.obj.matrixWorld.clone().invert()));const $=new Yt;$.setAttribute("position",new Kt([0,0,0,0,0,0],3));const I=new rr($,f);I.visible=!1,I.renderOrder=998,I.frustumCulled=!1,Ze.add(I);let ie;const Ve=Math.abs(o.dir.x),Ke=Math.abs(o.dir.y),Mt=Math.abs(o.dir.z),c=Ke>=Ve&&Ke>=Mt,F=/^screw_18/.test(o.obj.name)||/^rail_upper/.test(o.obj.name)||/^#8_Wood_Screw_2in/.test(o.obj.name);let se;if(F){const pe=new $t().setFromObject(o.obj).getCenter(new j);let Re;if(/^screw_18/.test(o.obj.name)){const Le=o.obj.name;Re=k.has(Le)?1:v.has(Le)?-1:(V?pe.clone().applyMatrix4(Q).x>=0:pe.x>=K.x)?1:-1}else Re=(V?pe.clone().applyMatrix4(Q).x>=0:pe.x>=K.x)?1:-1;se=new j(Re,0,0),ie=se.clone()}else{let pe;c?pe=new j(0,o.dir.y>=0?1:-1,0):Ve>=Mt?pe=new j(o.dir.x>=0?1:-1,0,0):pe=new j(0,0,o.dir.z>=0?1:-1),ie=pe.negate()}o.obj.updateWorldMatrix(!0,!1);const he=ie.clone().transformDirection(o.obj.matrixWorld.clone().invert()).normalize();if(/^#8_Wood_Screw_2in/.test(o.obj.name)){const pe=y.clone().applyMatrix4(o.obj.matrixWorld),Re=pe.x>K.x,Le=m(Re?"Part_1":"Part_3");if(Le){Le.updateWorldMatrix(!0,!1);const mt=pe.clone();Re?mt.x+=.015:mt.x-=.015;const pt=Le.worldToLocal(mt),jt=12,Rt=new Yt;Rt.setAttribute("position",new Kt([-jt,0,0,jt,0,0,0,-jt,0,0,jt,0,0,0,-jt,0,0,jt],3));const At=new tr(Rt,St);At.position.copy(pt),At.visible=!1,At.renderOrder=997,Le.add(At),De.current.push(At)}}Ee.current.push({obj:o.obj,line:I,hwLocalCenter:y,basePos:o.basePos,primaryAxis:he,worldDir:se})}const Ae=o=>je.getObjectByName(o)??je.getObjectByName(o.replace(/ /g,"_")),Je=o=>o.flatMap(y=>{const O=Ae(y);return O?[{obj:O,basePos:O.position.clone()}]:[]});Ut.current=Je(["Part 14","Part 29","Part 30","Part 31","Part 32","Part 33","Part 34","Part 35","Part 36","Part 37","Part 38","rail_upper","rail_upper_5"]),de.current=Je(["Part 13","Part 15","Part 16","Part 17","Part 18","Part 19","Part 20","rail_upper_2","rail_upper_3"]),fe.current=Je(["Part 21","Part 22","Part 23","Part 24","Part 25","Part 26","Part 27","rail_upper_1","rail_upper_4"]);{const o=[];if(je.traverse(y=>{y instanceof He&&C(y.name)&&o.push(y)}),o.length>0){je.updateMatrixWorld(!0);const y=[{partNames:["Part 26","Part 27"],dir:new j(0,0,1),dist:150,delay:.24},{partNames:["Part 19","Part 20"],dir:new j(0,0,1),dist:250,delay:.12},{partNames:["Part 33","Part 37","Part 34","Part 38"],dir:new j(0,0,1),dist:350,delay:0}],O=[];for(const $ of y)for(const I of $.partNames){const ie=Ae(I);if(!ie)continue;const Ve=new j;ie.getWorldPosition(Ve),O.push({worldPos:Ve,group:$})}for(const $ of o){$.updateWorldMatrix(!0,!1);const I=new j;$.getWorldPosition(I);let ie=O[0],Ve=1/0;for(const Mt of O){const c=I.distanceTo(Mt.worldPos);c<Ve&&(Ve=c,ie=Mt)}
1const Ke=$.position.clone();tt.current.push({obj:$,dir:ie.group.dir.clone().negate(),basePos:Ke.clone(),delay:ie.group.delay,dist:0})}}}const ye=new Set(["Part_14","Part 14","Part_30","Part 30","Part_31","Part 31","Part_32","Part 32","Part_34","Part 34","Part_35","Part 35","Part_38","Part 38"]),Oe="decal_BLUMpng";ke.current=[],je.traverse(o=>{(ye.has(o.name)||o.name.startsWith(Oe))&&ke.current.push(o)});{const o=new Set,y=O=>O.traverse($=>o.add($));for(const O of["Part_14","Part 14","rail_bottom","rail_upper","screw_18_22","screw_18_8","Part_3","Part 3","screw_18_13","screw_18_23"]){const $=Ae(O);$&&y($)}for(const O of["Part_30","Part 30"]){const $=Ae(O);$&&$.traverse(I=>o.delete(I))}be.current=[],je.traverse(O=>{O instanceof He&&(o.has(O)||be.current.push(O))})}dt.current=[];for(const o of["Part_14","Part 14"]){const y=Ae(o);y&&!dt.current.includes(y)&&dt.current.push(y)}oe.current=[];for(const o of["rail_bottom","rail_upper","screw_18_22","screw_18_8","Part_3","Part 3","screw_18_13","screw_18_23"]){const y=Ae(o);y&&y.traverse(O=>{O instanceof He&&oe.current.push(O)})}G.current=[];for(const o of["screw_18_22","screw_18_8","screw_18_13","screw_18_23"]){const y=Ae(o);if(!y)continue;const O=y instanceof He?y:y.getObjectByProperty("type","Mesh"),$=O?(O.geometry.computeBoundingBox(),(O.geometry.boundingBox.min.y+O.geometry.boundingBox.max.y)/2):0,I=O?(O.geometry.boundingBox.min.z+O.geometry.boundingBox.max.z)/2:0,ie=y.rotation.x;G.current.push({obj:y,basePos:y.position.clone(),baseRot:y.rotation.clone(),cy:$,cz:I,bpy:$*Math.cos(ie)-I*Math.sin(ie),bpz:$*Math.sin(ie)+I*Math.cos(ie),delay:0})}G.current.sort((o,y)=>y.basePos.z-o.basePos.z),G.current.forEach((o,y)=>{o.delay=y<2?0:.5}),It.current.forEach(({line:o,dots:y})=>{Ze.remove(o),o.geometry.dispose(),Ze.remove(y),y.geometry.dispose()}),It.current=[];for(const o of G.current){const y=new j;{const Ve=new $t().setFromObject(o.obj);Ve.isEmpty()||(Ve.getCenter(y),o.obj.updateWorldMatrix(!0,!1),y.applyMatrix4(o.obj.matrixWorld.clone().invert()))}const O=new Yt;O.setAttribute("position",new Kt([0,0,0,0,0,0],3));const $=new rr(O,Ue);$.visible=!1,$.renderOrder=998,$.frustumCulled=!1,Ze.add($);const I=new Yt;I.setAttribute("position",new Kt([0,0,0],3));const ie=new Br(I,T);ie.visible=!1,ie.renderOrder=999,ie.frustumCulled=!1,Ze.add(ie),It.current.push({screwObj:o.obj,line:$,dots:ie,screwLocalCenter:y})}const Fe=/^637_76_333_2|^Part_(39|40|57|58|60|61|63|64)$/;Xe.current=[],je.traverse(o=>{if(!(o instanceof He)||!Fe.test(o.name))return;o.geometry.computeBoundingBox();const y=o.geometry.boundingBox?.getCenter(new j).x??0;Xe.current.push({node:o,origScaleX:o.scale.x,origPosX:o.position.x,geomOffsetX:y})});{const o=1e3/B;for(const{node:y,origScaleX:O,origPosX:$,geomOffsetX:I}of Xe.current){y.scale.x=O*o;const ie=$+I*(1-o);y.position.x=ie;const Ve=tt.current.find(Ke=>Ke.obj===y);Ve&&(Ve.basePos.x=ie)}}},[je,ee]),e.useEffect(()=>{const M=1e3/B;for(const{node:P,origScaleX:C,origPosX:D,geomOffsetX:K}of Xe.current){P.scale.x=C*M;const R=D+K*(1-M);P.position.x=R;const l=tt.current.find(ae=>ae.obj===P);l&&(l.basePos.x=R)}},[B]),Nt.current=d,Pt.current=i,dr((M,P)=>{const C=Nt.current,D=Pt.current,R=C?1:Math.min(n,Math.max(0,1-L)),l=L>=.97,ae=C?!0:_&&R>.5;for(const v of ue.current)v.opacity=R,v.transparent=!l,v.depthTest=l?!0:ae,v.depthWrite=l?!0:ae,v.colorWrite=!l,v.needsUpdate=!0;if(A>.01){const{minY:v,maxY:V}=we.current,Q=V-v,Ae=v+Q*(1-A),Je=Q*.22;je.traverse(Oe=>{if(!(Oe instanceof He))return;Oe.geometry.boundingBox||Oe.geometry.computeBoundingBox();const Fe=Oe.geometry.boundingBox;if(!Fe)return;const y=((Fe.min.y+Fe.max.y)/2-Ae)/Je,O=Ce(y*.5+.5,0,1),$=U(R,.15,O),I=1-Ce(Math.abs(y),0,1),ie=I*I*.4,Ve=Array.isArray(Oe.material)?Oe.material:[Oe.material];for(const Ke of Ve)Ke instanceof Et&&(Ke.wireframe=!1,Ke.opacity=Ce($,.1,R),Ke.emissive.setRGB(ie,ie,ie*1.2),Ke.needsUpdate=!0)});const ye=Q*.12;for(const Oe of _e.current){const Fe=Oe.parent;if(!Fe||!(Fe instanceof He))continue;Fe.geometry.boundingBox||Fe.geometry.computeBoundingBox();const o=Fe.geometry.boundingBox;if(!o)continue;const y=(o.min.y+o.max.y)/2,O=Math.abs(y-Ae);Oe.material=O<ye?Y:ee}}else{for(const v of ue.current)v.emissiveIntensity>0&&(v.emissive.setRGB(0,0,0),v.emissiveIntensity=0,v.needsUpdate=!0);for(const v of _e.current)v.material=ee}if(!w)for(const v of ke.current)v.visible=!0;if(w){for(const v of be.current)v.visible=!1;for(const v of dt.current)v.traverse(V=>{if(!(V instanceof He))return;V.visible=!0;const Q=Array.isArray(V.material)?V.material:[V.material];for(const Ae of Q)Ae instanceof Et&&(Ae.opacity=.25,Ae.depthTest=!1,Ae.depthWrite=!1,Ae.needsUpdate=!0)});for(const v of oe.current){v.visible=!0;const V=Array.isArray(v.material)?v.material:[v.material];for(const Q of V)Q instanceof Et&&(Q.opacity=1,Q.depthTest=!0,Q.depthWrite=!0,Q.needsUpdate=!0)}}else for(const v of be.current)v.visible=!0;const Z=Ce((L-.9)/.07,0,1),Me=C||w||R>.02&&R<.85||Z>0,ht=C?.35:w?.45:Z>0?.98:Math.min(.52,(.85-R)/.45);ee.opacity=Me?ht+q*.25:0,ee.depthTest=Z>=1?!1:C||w;const kt=C?96/255:U(56,176,q)/255,b=U(kt,1,Z);ee.color.setRGB(b,b,b),ee.needsUpdate=!0,Y.opacity=Me?Math.max(ee.opacity,.9):0,Y.depthTest=ee.depthTest,Y.needsUpdate=!0;for(const v of _e.current)v.visible=Be?!1:Me;Be&&(ee.opacity=0,ee.needsUpdate=!0,Y.opacity=0,Y.needsUpdate=!0);const u=Z>=1;for(const v of Ye.current)v.visible=u;Ct.opacity=0,Ct.needsUpdate=!0;const E=x>rt.current?.18:.22;rt.current=U(rt.current,x,E),Math.abs(rt.current-x)<.001&&(rt.current=x);const s=rt.current,a=300;for(const{obj:v,dir:V,basePos:Q,delay:Ae,skipExplode:Je,dist:ye}of tt.current){const Oe=Ae<1?Ce((s-Ae)/(1-Ae),0,1):s>0?1:0,Fe=Je?0:Oe,o=ye??a;v.position.set(Q.x+V.x*o*Fe,Q.y+V.y*o*Fe,Q.z+V.z*o*Fe)}const m=.05;for(const{obj:v,line:V,hwLocalCenter:Q,basePos:Ae,primaryAxis:Je,worldDir:ye}of Ee.current){if(!(z&&s>0)){V.visible=!1;continue}v.updateWorldMatrix(!0,!1),S.copy(Q).applyMatrix4(v.matrixWorld);let Fe,o;
1if(ye){const O=je.parent;Fe=O?ye.clone().transformDirection(O.matrixWorld).normalize():ye.clone(),o=1}else Fe=Je.clone().transformDirection(v.matrixWorld).normalize(),le.copy(v.position),v.position.copy(Ae),v.updateWorldMatrix(!0,!1),xe.copy(Q).applyMatrix4(v.matrixWorld),v.position.copy(le),v.updateWorldMatrix(!0,!1),o=Math.sign(xe.clone().sub(S).dot(Fe))||1;const y=V.geometry.attributes.position.array;y[0]=S.x,y[1]=S.y,y[2]=S.z,y[3]=S.x+o*m*Fe.x,y[4]=S.y+o*m*Fe.y,y[5]=S.z+o*m*Fe.z,V.geometry.attributes.position.needsUpdate=!0,V.computeLineDistances(),V.visible=!0}for(const v of De.current)v.visible=z&&s>0;if(s<.01){!Bt.current&&C&&(qe.current=!1,ve.current=0,nt.current=0,$e.current=!1,Ge.current=!1),Bt.current=C,!C&&!qe.current&&D>.05&&(ve.current=1,qe.current=!0),!C&&qe.current&&!Ge.current&&Pe.current>.5&&nt.current<1&&(nt.current=1),!C&&qe.current&&D<=0&&(ve.current=0,nt.current=0),D<=0&&ve.current<=0&&nt.current<=0&&(Pe.current=0,yt.current=0,_t.current=0,et.current=0,ct.current=0);const v=ve.current>Pe.current?.05:.055,V=nt.current>yt.current?.05:.055;Pe.current+=(ve.current-Pe.current)*v,yt.current+=(nt.current-yt.current)*V;const Q=Pe.current,Ae=yt.current,Je=Ce(D/.7,0,1),ye=Ce((D-.35)/.65,0,1);if($e.current)et.current=Q;else{const Ke=Je>et.current?.15:.2;et.current+=(Je-et.current)*Ke,Math.abs(Je-et.current)<.01&&(et.current=Je)}if(Ge.current)ct.current=Ae;else{const Ke=ye>ct.current?.15:.2;ct.current+=(ye-ct.current)*Ke,Math.abs(ye-ct.current)<.01&&(ct.current=ye)}const Oe=370,Fe=lt(Q),o=lt(Ae),y=$e.current?Fe:Math.max(Fe,et.current),O=Ge.current?o:Math.max(o,ct.current),$=O>.6&&(nt.current>.5||!Ge.current&&ye>.5)?1:0,I=$>_t.current?.1:.14;_t.current+=($-_t.current)*I,Math.abs($-_t.current)<.01&&(_t.current=$);const ie=Math.min(_t.current,O),Ve=(Ke,Mt)=>{for(const{obj:c,basePos:F}of Ke)c.position.set(F.x,F.y,F.z+Oe*Mt)};Ve(Ut.current,y),Ve(de.current,O);for(const{obj:Ke,basePos:Mt}of fe.current){const c=Ke.name.startsWith("rail_upper")?-30:Oe;Ke.position.set(Mt.x,Mt.y,Mt.z+c*ie)}}const k=xr.current;if(k>0&&G.current.length>0){const v=k>=.85;v?Ft.current||(Ft.current=!0,gt.current=0,Lt.current=0):(Ft.current=!1,gt.current=0,Lt.current=0),v&&(Lt.current+=P,Lt.current>=.5&&(gt.current=Math.min(1,gt.current+P/2.5)));const V=gt.current,Q=Math.PI*2;for(const{obj:Je,basePos:ye,baseRot:Oe,cy:Fe,cz:o,bpy:y,bpz:O,delay:$}of G.current){const I=$<1?Math.max(0,Math.min(1,(V-$)/(1-$))):V>=1?1:0,ie=lt(I),Ve=(1-ie)*20,Ke=Oe.x+ie*Q,Mt=Fe*Math.cos(Ke)-o*Math.sin(Ke),c=Fe*Math.sin(Ke)+o*Math.cos(Ke);Je.position.set(ye.x+Ve,ye.y+y-Mt,ye.z+O-c),Je.rotation.x=Ke,Je.rotation.y=Oe.y,Je.rotation.z=Oe.z}const Ae=.03;for(const{screwObj:Je,line:ye,dots:Oe,screwLocalCenter:Fe}of It.current){if(k<.5){ye.visible=!1,Oe.visible=!1;continue}Je.updateWorldMatrix(!0,!1),S.copy(Fe).applyMatrix4(Je.matrixWorld),le.set(-1,0,0).transformDirection(Je.matrixWorld).normalize(),xe.copy(S).addScaledVector(le,Ae);const o=ye.geometry.attributes.position.array;o[0]=S.x,o[1]=S.y,o[2]=S.z,o[3]=xe.x,o[4]=xe.y,o[5]=xe.z,ye.geometry.attributes.position.needsUpdate=!0,ye.computeLineDistances(),ye.visible=!0;const y=Oe.geometry.attributes.position.array;y[0]=xe.x,y[1]=xe.y,y[2]=xe.z,Oe.geometry.attributes.position.needsUpdate=!0,Oe.visible=!0}}else if(G.current.length>0){Ft.current=!1,gt.current=0;for(const{obj:v,basePos:V,baseRot:Q}of G.current)v.position.copy(V),v.rotation.copy(Q);for(const{line:v,dots:V}of It.current)v.visible=!1,V.visible=!1}});const ft=e.useRef(null),We=M=>{M.stopPropagation();const P=M.object;ft.current&&ft.current.mat!==P.material&&(ft.current.mat.color.copy(ft.current.origColor),ft.current.mat.emissive.set(0,0,0),ft.current=null),!ft.current&&P.material instanceof Et&&(ft.current={mat:P.material,origColor:P.material.color.clone()},P.material.emissive.set(.08,.08,.09))},ot=()=>{ft.current&&(ft.current.mat.color.copy(ft.current.origColor),ft.current.mat.emissive.set(0,0,0),ft.current=null)},xt=M=>{if(M.stopPropagation(),n<.95||x>.05)return;const C=nt.current>.5||ve.current>.5?0:1;nt.current=C,ve.current=C,Ge.current=C===0,$e.current=C===0},wt=e.useRef(!1);e.useEffect(()=>{if(wt.current||!it)return;const M=[];je.traverse(P=>{P instanceof He&&P.name&&M.push(P.name)}),M.length>0&&(wt.current=!0,it(M))},[je,it]);const J=e.useRef(null),ge=e.useRef(null),Ht=e.useRef(new Map),H=e.useRef(new Map),Se=e.useRef(at??new Set);Se.current=at??new Set;const Wt=()=>{const M=Se.current,P=[];return je.traverse(C=>{if(!(C instanceof He))return;const D=C.name.replace(/ /g,"_");
1if(!M.has(C.name)&&!M.has(D))return;const K=Array.isArray(C.material)?C.material:[C.material];for(const R of K)R instanceof Et&&(Ht.current.has(R)||Ht.current.set(R,{map:R.map,color:R.color.clone()}),P.push({name:D,mat:R,mesh:C}))}),P};e.useEffect(()=>{const M=re!==ge.current;ge.current=re;const P=Wt();if(!re){for(const[,K]of H.current)K.dispose();H.current.clear(),J.current&&(J.current.dispose(),J.current=null);for(const{mat:K}of P){const R=Ht.current.get(K);R&&(K.map=R.map,K.color.copy(R.color)),K.needsUpdate=!0}return}const C=ce??{},D=K=>{for(const[,R]of H.current)R.dispose();H.current.clear();for(const{name:R,mat:l,mesh:ae}of P){const Z=K.clone();Z.colorSpace=nr,Z.wrapS=Z.wrapT=or,Z.rotation=(C[R]??0)*Math.PI/180,Z.center.set(.5,.5),Sr(Z,ae),Z.needsUpdate=!0,H.current.set(R,Z),l.map=Z,l.color.set("#ffffff"),l.needsUpdate=!0}};!M&&J.current?D(J.current):new vr().load(re,K=>{K.colorSpace=nr,K.wrapS=K.wrapT=or,J.current&&J.current.dispose(),J.current=K,D(K)})},[re,je,at]),e.useEffect(()=>{if(!J.current||H.current.size===0)return;const M=ce??{};for(const{name:P,mat:C}of Wt()){const D=H.current.get(P);D&&(D.rotation=(M[P]??0)*Math.PI/180,D.center.set(.5,.5),D.needsUpdate=!0,C.needsUpdate=!0)}},[ce]);const st=e.useRef(null),ze=e.useRef(null),Dt=e.useRef(new Map),h=e.useRef(new Map),te=e.useRef(ne??new Set);te.current=ne??new Set;const X=()=>{const M=te.current,P=[];return je.traverse(C=>{if(!(C instanceof He))return;const D=C.name.replace(/ /g,"_");if(!M.has(C.name)&&!M.has(D))return;const K=Array.isArray(C.material)?C.material:[C.material];for(const R of K)R instanceof Et&&(Dt.current.has(R)||Dt.current.set(R,{map:R.map,color:R.color.clone()}),P.push({name:D,mat:R,mesh:C}))}),P};return e.useEffect(()=>{const M=ut!==ze.current;ze.current=ut;const P=X();if(!ut||te.current.size===0){for(const[,K]of h.current)K.dispose();h.current.clear(),st.current&&(st.current.dispose(),st.current=null);for(const{mat:K}of P){const R=Dt.current.get(K);R&&(K.map=R.map,K.color.copy(R.color)),K.needsUpdate=!0}return}const C=vt??{},D=K=>{for(const[,R]of h.current)R.dispose();h.current.clear();for(const{name:R,mat:l,mesh:ae}of P){const Z=K.clone();Z.colorSpace=nr,Z.wrapS=Z.wrapT=or,Z.rotation=(C[R]??0)*Math.PI/180,Z.center.set(.5,.5),Sr(Z,ae),Z.needsUpdate=!0,h.current.set(R,Z),l.map=Z,l.color.set("#ffffff"),l.needsUpdate=!0}};!M&&st.current?D(st.current):new vr().load(ut,K=>
1{K.colorSpace=nr,K.wrapS=K.wrapT=or,st.current&&st.current.dispose(),st.current=K,D(K)})},[ut,je,ne]),e.useEffect(()=>{if(!st.current||h.current.size===0)return;const M=vt??{};for(const{name:P,mat:C}of X()){const D=h.current.get(P);D&&(D.rotation=(M[P]??0)*Math.PI/180,D.center.set(.5,.5),D.needsUpdate=!0,C.needsUpdate=!0)}},[vt]),t.jsx("group",{position:[0,-.36,0],scale:.001,rotation:[Math.PI/2,0,0],onPointerMove:We,onPointerOut:ot,onClick:xt,children:t.jsx("primitive",{object:je})})}function on({centerY:i,enabled:n=!0}){const d=e.useRef(null),{hLine:x,vLine:L,dLine:B}=e.useMemo(()=>{const q=new Yt;q.setAttribute("position",new Pr(new Float32Array([-.55,0,0,.55,0,0]),3));const w=new Yt;w.setAttribute("position",new Pr(new Float32Array([0,-.55,0,0,.55,0]),3));const z=new Yt;z.setAttribute("position",new Pr(new Float32Array([0,0,-.55,0,0,.55]),3));const A=()=>new cr({color:16777215,opacity:0,transparent:!0,dashSize:.008,gapSize:.006,depthTest:!1,depthWrite:!1}),Be=new rr(q,A());Be.computeLineDistances();const re=new rr(w,A());re.computeLineDistances();const at=new rr(z,A());return at.computeLineDistances(),{hLine:Be,vLine:re,dLine:at}},[]);return dr(()=>{const q=Rr.current,w=n?Math.min(Ce((q-.5)/.05,0,1),Ce((.75-q)/.05,0,1))*.18:0;x.material.opacity=w,L.material.opacity=w,B.material.opacity=w}),t.jsxs("group",{ref:d,children:[t.jsx("primitive",{object:x}),t.jsx("primitive",{object:L}),t.jsx("primitive",{object:B})]})}function Nn({widthMm:i,sequenceProgress:n,disableGhosts:_,drawingModeProgress:d=0,detailModeProgress:x=0,cameraDetailModeP:L,card4ZoomP:B=0,externalRotY:q,showAxes:w=!1,freeRotate:z=!1,allowFreePos:A=!1,positionOffset:Be,worldOffset:re,worldScale:at,rotationPivot:ce,exitSpin:ut=!1,heroAnimation:ne=!1,outerEdgesOnly:vt=!1,doorTexturePath:it=null,doorTextureParts:Tt,doorTextureRotations:bt,bodyTexturePath:zt=null,bodyTextureParts:je,bodyTextureRotations:ee,onMeshNamesReady:Ct,solidPartNames:Y}){const f=e.useRef(null),[Ze,S]=e.useState(0),[le,xe]=e.useState(0),St=e.useRef(!1),Ue=e.useRef(!1),T=e.useRef(!0),ue=e.useRef(.4);e.useLayoutEffect(()=>{f.current&&(f.current.rotation.y=.4)},[]);const tt=e.useRef(0),rt=e.useRef(!1),Ee=e.useRef(0),De=e.useRef(0),_e=e.useRef(0),Ye=e.useRef(0),we=e.useRef(0),ke=e.useRef(0),dt=e.useRef(z),be=e.useRef(0);e.useRef(0);const oe=e.useRef(-1),G=e.useRef(0),gt=e.useRef(0),Ft=2e3;e.useEffect(()=>{dt.current=z,z||(ke.current=0,we.current=0,f.current&&(f.current.rotation.x=0))},[z]);const{gl:Lt,camera:It}=ur(),Ut=e.useRef(It);Ut.current=It,e.useEffect(()=>{const l=Lt.domElement,ae=ht=>{Pe.current||!dt.current&&mr.current<=0&&xr.current<=0||(rt.current=!0,Ee.current=ht.clientX,_e.current=ht.clientY,tt.current=ue.current,De.current=ue.current,Ye.current=ke.current,l.setPointerCapture(ht.pointerId))},Z=ht=>{rt.current&&(tt.current=De.current+(ht.clientX-Ee.current)*.008,dt.current&&(we.current=Math.max(-Math.PI/2,Math.min(Math.PI/2,Ye.current+(ht.clientY-_e.current)*.008))))},Me=()=>{rt.current=!1};return l.addEventListener("pointerdown",ae),l.addEventListener("pointermove",Z),l.addEventListener("pointerup",Me),()=>{l.removeEventListener("pointerdown",ae),l.removeEventListener("pointermove",Z),l.removeEventListener("pointerup",Me)}},[Lt]);const de=e.useRef(null),fe=e.useRef({x:0,y:0}),Pe=e.useRef(A),ve=e.useRef(!1),yt=e.useRef({x:0,y:0});e.useEffect(()=>{Pe.current=A,!A&&!Be&&(fe.current={x:0,y:0},Jt.current={x:0,y:0,z:0})},[A,Be]);const nt=e.useRef(Be);nt.current=Be;const _t=e.useRef(!!Be);_t.current=!!Be;const Xe=e.useRef(re);Xe.current=re;const qe=e.useRef(at);qe.current=at,e.useEffect(()=>{const l=Lt.domElement,ae=new Ar,Z=new Zr(new j(0,0,1),0),Me=new j,ht=new Lr,kt=(s,a)=>{const m=l.getBoundingClientRect();return ht.set((s-m.left)/m.width*2-1,-((a-m.top)/m.height)*2+1),ae.setFromCamera(ht,Ut.current),ae.ray.intersectPlane(Z,Me)?{x:Me.x,y:Me.y}:null},b=s=>{if(s.button!==0||!Pe.current)return;const a=kt(s.clientX,s.clientY);a&&(ve.current=!0,yt.current={x:a.x-fe.current.x,y:a.y-fe.current.y},l.setPointerCapture(s.pointerId))},u=s=>{if(!ve.current)return;const a=kt(s.clientX,s.clientY);a&&(fe.current={x:a.x-yt.current.x,y:a.y-yt.current.y},Jt.current={...fe.current,z:0})},E=()=>{ve.current=!1};return l.addEventListener("pointerdown",b),l.addEventListener("pointermove",u),l.addEventListener("pointerup",E),()=>{l.removeEventListener("pointerdown",b),l.removeEventListener("pointermove",u),l.removeEventListener("pointerup",E)}},[Lt]);const Bt=e.useRef([0,0,0,0,0]),$e=e.useRef([0,0,0,0,0]),Ge=e.useRef([!1,
1!1,!1,!1,!1]),et=i*Wr,ct=Vr.heightMm*Wr,Nt=Vr.depthMm*Wr,ft=ct+.1;e.useMemo(()=>{const l=new $r(et,ct,Nt),ae=new fr(l,1);return l.dispose(),ae},[et,ct,Nt]),e.useMemo(()=>new $r(et,ct,Nt),[et,ct,Nt]),e.useMemo(()=>{const l=new Pn({colorWrite:!1});return l.depthWrite=!0,l},[]),e.useMemo(()=>new Vt({color:16777215,depthTest:!0}),[]);let We=1,ot=!1,xt=0,wt=0,J=0,ge=!1;const Ht=!1;let H=-1,Se=-1;if(ne){const l=n;if(l<=.01)We=1,ot=!1,ge=!0,J=.4;else if(l<.08)We=1,ot=l>.05,ge=!0,J=.4;else if(l<.22){const ae=lt(Ce((l-.08)/.12,0,1));We=1-ae*.65,ot=!0,Se=ae*.6,ge=!1,J=.4,wt=lt(Ce((l-.08)/.12,0,1))}else if(l<.42)H=lt(Ce((l-.23)/.12,0,1)),We=.35,ot=!0,Se=.6,ge=H>.8,J=.4,wt=1-lt(Ce((l-.36)/.05,0,1));else if(l<.6)We=.35,ot=!0,Se=.6,ge=!1,xt=lt(Ce((l-.42)/.16,0,1)),J=.4;else if(l<1){const ae=lt(Ce((l-.6)/.12,0,1));xt=1-ae,We=.35+.65*ae,ot=ae<.8,Se=.6*(1-ae),ge=ae>.5,J=.4+Math.PI*2*lt(Ce((l-.6)/.38,0,1))}else We=1,xt=0,ot=!1,ge=!0,J=.4+Math.PI*2}else if(n<=0)We=1,ot=!1,ge=!1;else if(n<.08){ot=!0;const l=n/.08;We=1-lt(l)*.6,J=-.2}else if(n<.22)ot=!0,We=.4,wt=lt(Ce((n-.08)/.14,0,1)),J=-.2;else if(n<.5){ot=!0,We=.4,wt=0,J=n<.28?-.2:.4;const l=Ce((n-.35)/.15,0,1);if(xt=lt(l),d>0&&n>.42){const ae=Ce((n-.42)/.08,0,1);J=lt(ae)*.4}}else n<.75?(ot=!0,We=.4,xt=0,wt=0,J=.4+(-Math.PI*.25-.4)*x):n<.87?(ot=!0,We=1,xt=0,wt=1,ge=!0,J=265*(Math.PI/180)):n<.94?(ot=!0,We=1,xt=0,wt=1-lt(Ce((n-.87)/.04,0,1)),J=Math.PI*2,ge=!0):(We=1,xt=0,wt=0,J=Math.PI*2,ot=!0,ge=!0);const Wt=0,st=Wt*xt,ze=xt*Math.max(0,1-d*1.5),Dt=Math.max(0,wt-d*2),h=Wt*ze;B>
10&&(We=We+(1-We)*B,ge=!0),Ir.current=d>0?h:st,Dr.current=d,mr.current=x,xr.current=B,Rr.current=n;const te=e.useRef(n);e.useEffect(()=>{const l=te.current;te.current=n,(n===0||l<1&&n>=1)&&(ue.current=.4,f.current&&(f.current.rotation.y=.4))},[n]),dr(l=>{const Z=(n<=0||n>=1)&&d<=0?Math.sin(l.clock.elapsedTime*1.2)*.02:0;if(S(u=>{const E=Z-u;return Math.abs(E)<5e-4?Z:u+E*.15}),vt&&!St.current&&f.current){let u=0;f.current.traverse(E=>{E.isMesh&&u++}),u>5&&(St.current=!0,xe(E=>E+1))}if(!Ue.current&&f.current){let u=0;if(f.current.traverse(E=>{E.isMesh&&u++}),u>5){const E=f.current.rotation.y,s=f.current.rotation.x,a=f.current.rotation.z;f.current.rotation.set(0,0,0),f.current.updateMatrixWorld(!0);const m=new $t().setFromObject(f.current);f.current.rotation.set(s,E,a);const k=m.getCenter(new j),v=new j;f.current.getWorldPosition(v);const V=de.current?.scale.x??1,Q={x:(k.x-v.x)/V,y:(k.y-v.y)/V,z:(k.z-v.z)/V},Ae=Math.abs(Q.x)<=50&&Math.abs(Q.y)<=500&&Math.abs(Q.z)<=50;tn.current=Ae?Q:{x:0,y:0,z:0},Ue.current=!0}}const Me=u=>{ue.current=u,f.current&&(f.current.rotation.y=u,f.current.rotation.x=qr.current*(Math.PI/180),f.current.rotation.z=en.current*(Math.PI/180))};if(ne&&performance.now()-Dn.current<100&&(tt.current=ue.current,we.current=ke.current,rt.current=!1),de.current){const u=Xe.current,E=qe.current,s=!Pe.current&&_t.current;if(ne===!0&&(Fr.current=!!u&&!rt.current&&!s),s){const a=nt.current;if(B>0&&be.current<=0)fe.current.x=a.x,fe.current.y=a.y,Qt.current=performance.now();
1else{const k=performance.now()-Qt.current<100?1:.12;fe.current.x=U(fe.current.x,a.x,k),fe.current.y=U(fe.current.y,a.y,k)}Jt.current={...fe.current,z:0},de.current.position.x=fe.current.x,de.current.position.y=fe.current.y,de.current.position.z=0,de.current.scale.setScalar(1)}else if(u)de.current.position.set(u.x,u.y,u.z),de.current.scale.setScalar(E??1),fe.current.x=u.x,fe.current.y=u.y,Jt.current={x:u.x,y:u.y,z:u.z};else if(Pe.current)de.current.position.x=fe.current.x,de.current.position.y=fe.current.y,de.current.position.z=0,de.current.scale.setScalar(1);else{if(B>0)fe.current.x=U(fe.current.x,-.2,.15),fe.current.y=U(fe.current.y,-.28,.15);else if(n<.65){const a=performance.now()-Qt.current<100?1:.07;fe.current.x=U(fe.current.x,0,a),fe.current.y=U(fe.current.y,0,a)}Jt.current={...fe.current,z:0},de.current.position.x=fe.current.x,de.current.position.y=fe.current.y,de.current.position.z=0,de.current.scale.setScalar(1)}}const ht=performance.now()-Qt.current<100,kt=q,b=B>0&&be.current<=0;if(be.current=B,kt!==void 0&&!z){const u=b?1:.9;Me(U(ue.current,kt*(Math.PI/180),u));return}if(rt.current&&(z||x>0||B>0)){Me(tt.current),z&&f.current&&(ke.current=we.current,f.current.rotation.x=ke.current);return}if(d>0)Me(U(ue.current,0,.05+d*.04));else if(n<=0||n>=1){if(T.current=!0,!z&&!Pe.current&&!Or.current){const u=.4+l.pointer.x*.55;let s=(ue.current%(2*Math.PI)+2*Math.PI)%(2*Math.PI);s>Math.PI&&(s-=2*Math.PI);const a=u-s,m=Math.abs(s-.4)<.8?.35:.18;if(Me(Math.abs(a)>Math.PI?u:U(s,u,m)),f.current){const k=Math.min(l.pointer.y*-.15,0);f.current.rotation.x=U(f.current.rotation.x,k,.2)}}Ge.current=[!1,!1,!1,!1,!1]}else{if(!ne&&n<.28){z||Me(.35);return}if(!z)if(ut){if(oe.current<0){const m=(ue.current%(2*Math.PI)+2*Math.PI)%(2*Math.PI),k=(Math.PI-m+2*Math.PI)%(2*Math.PI);ue.current=m,f.current&&(f.current.rotation.y=m),G.current=m,gt.current=k+Math.PI,oe.current=performance.now()}const u=performance.now()-oe.current,E=Math.min(1,u/Ft),s=lt(E);Me(G.current+gt.current*s),sr.current=E}else{if(oe.current>=0){oe.current=-1,sr.current=-1;const a=(ue.current%(2*Math.PI)+2*Math.PI)%(2*Math.PI);ue.current=a,f.current&&(f.current.rotation.y=a)}if(sr.current=-1,ne&&T.current){T.current=!1,Me(.4);return}const u=ht?1:ne?.12:B>0?.15:n>=.29&&n<=.5?1:.15,E=J-ue.current,s=Math.abs(E)<.005?J:U(ue.current,J,u);Me(s),_||In.forEach((a,m)=>{xt>=a&&!Ge.current[m]&&(Bt.current[m]=s,$e.current[m]=st,Ge.current[m]=!0)})}}});const X=n<=0||n>=1,M=X?1:ge?We:Math.min(We,.4);e.useMemo(()=>new Et({color:ar.carcass,roughness:.82,metalness:0,envMapIntensity:.35,transparent:!X&&!ge,opacity:M,depthTest:X?!0:ge,depthWrite:X?!0:ge}),[M,ge,X]),e.useMemo(()=>new Et({color:ar.carcass,roughness:.82,metalness:0,envMapIntensity:.35,transparent:!X&&!ge,opacity:M,depthTest:X?!0:ge,depthWrite:X?!0:ge}),[M,ge,X]);const P=X?1:ge?We:Math.min(We,.5);e.useMemo(()=>new Et({color:ar.door,roughness:.78,metalness:0,envMapIntensity:.3,transparent:!X&&!ge,opacity:P,depthTest:X?!0:ge,depthWrite:X?!0:ge}),[P,ge,X]);const C=X?1:We;e.useMemo(()=>new Et({color:ar.leg,roughness:.22,metalness:.68,envMapIntensity:1.6,transparent:!X&&!ge,opacity:C,depthTest:X?!0:ge,depthWrite:X?!0:ge}),[C,ge,X]),e.useMemo(()=>new Vt({color:ar.edge,opacity:ot?.5:0,transparent:!0,depthTest:!1,depthWrite:!1}),[ot]),e.useMemo(()=>new Vt({color:ar.edge,opacity:X?.5:0,transparent:!0,depthTest:!0,depthWrite:!1}),[X]);const D=Math.abs(n-.22),K=Se>=0?Se:Ce(1-D/.015,0,1),R=ne?0:Ce(n/.04,0,1)*Ce((.28-n)/.04,0,1)*.15;return t.jsx(t.Fragment,{children:t.jsx(Jr,{enabled:!1,children:t.jsx("group",{ref:de,children:t.jsx("group",{position:[ne===!0&&re?0:(ce??Gt.current).x,ft/2+.1+Ze-h-x*.08+R+(ne===!0&&re?0:(ce??Gt.current).y),ne===!0&&re?0:(ce??Gt.current).z],children:t.jsx("group",{ref:f,scale:[.8*((B>0?1e3:i)/1e3),.8,.8],children:t.jsxs("group",{position:[ne===!0&&re?0:-(ce??Gt.current).x/(.8*((B>0?1e3:i)/1e3)),ne===!0&&re?0:-(ce??Gt.current).y/.8,ne===!0&&re?0:-(ce??Gt.current).z/.8],children:[t.jsx(e.Suspense,{fallback:null,children:t.jsx(On,{doorOpenProgress:Dt,panelOpacity:We,useDepthTest:ge,isInitialState:X,explodeProgress:ze,drawingModeProgress:d,widthMm:B>0?1e3:i,edgeColorProgress:K,card4DoorFocusMode:!ne&&n>=.75&&n<.87,card4ZoomP:B,showAnnotations:!ne&&n>=.5&&n<.7,card3ExplodeP:ne?0:x,wireframeMode:Ht,scanLineY:H,cabinetTotalH:ft,outerEdgesOnly:vt,doorTexturePath:it,doorTextureParts:Tt,doorTextureRotations:bt,bodyTexturePath:zt,bodyTextureParts:je,bodyTextureRotations:ee,onMeshNamesReady:Ct,solidPartNames:Y})}),w&&t.jsx("axesHelper",{position:[0,0,0],args:[5]}),t.jsx(on,{centerY:0,enabled:x>0})]})})})})},le)})}function Hn({widthMm:i,sequenceProgress:n,drawingModeProgress:_=0,detailModeProgress:d=0,card4ZoomP:x=0,externalRotY:L,showAxes:B=!1,freeRotate:q=!1,allowFreePos:w=!1,positionOffset:z,worldOffset:A,worldScale:Be,rotationPivot:re,exitSpin:at=!1,heroAnimation:ce=!1,outerEdgesOnly:ut=!1,doorTexturePath:ne=null,doorTextureParts:vt,doorTextureRotations:it,bodyTexturePath:Tt=null,bodyTextureParts:bt,bodyTextureRotations:zt,onMeshNamesReady:je}){const ee=e.useRef(null),[Ct,Y]=e.useState(0),[f,Ze]=e.useState(0),S=e.useRef(!1),le=e.useRef(!0),xe=e.useRef(.4);e.useLayoutEffect(()=>{ee.current&&(ee.current.rotation.y=.4)},[]);const St=e.useRef(0),Ue=e.useRef(!1),T=e.useRef(0),ue=e.useRef(0),tt=e.useRef(0),rt=e.useRef(0),Ee=e.useRef(0),De=e.useRef(0),_e=e.useRef(q),Ye=e.useRef(0);e.useRef(0);const we=e.useRef(-1),ke=e.useRef(0),dt=e.useRef(0),be=2e3;e.useEffect(()=>{_e.current=q,q||(De.current=0,Ee.current=0,ee.current&&(ee.current.rotation.x=0))},[q]);const oe=e.useRef(null),G=e.useRef({x:0,y:0}),gt=e.useRef(w),Ft=e.useRef(!1),Lt=e.useRef({x:0,y:0});e.useEffect(()=>{gt.current=w,!w&&!z&&(G.current={x:0,y:0},Jt.current={x:0,y:0,z:0})},[w,z]);const It=e.useRef(z);It.current=z;const Ut=e.useRef(!!z);Ut.current=!!z;const de=e.useRef(A);de.current=A;const fe=e.useRef(Be);fe.current=Be;const{gl:Pe,camera:ve}=ur(),yt=e.useRef(ve);yt.current=ve,e.useMemo(()=>new j,[]),e.useEffect(()=>{const H=Pe.domElement,Se=ze=>{gt.current||!_e.current&&mr.current<=0&&xr.current<=0||(Ue.current=!0,T.current=ze.clientX,tt.current=ze.clientY,St.current=xe.current,ue.current=xe.current,rt.current=De.current,H.setPointerCapture(ze.pointerId))}
1,Wt=ze=>{Ue.current&&(St.current=ue.current+(ze.clientX-T.current)*.008,_e.current&&(Ee.current=Math.max(-Math.PI/2,Math.min(Math.PI/2,rt.current+(ze.clientY-tt.current)*.008))))},st=()=>{Ue.current=!1};return H.addEventListener("pointerdown",Se),H.addEventListener("pointermove",Wt),H.addEventListener("pointerup",st),()=>{H.removeEventListener("pointerdown",Se),H.removeEventListener("pointermove",Wt),H.removeEventListener("pointerup",st)}},[Pe]),e.useEffect(()=>{const H=Pe.domElement,Se=new Ar,Wt=new Zr(new j(0,0,1),0),st=new j,ze=new Lr,Dt=(M,P)=>{const C=H.getBoundingClientRect();return ze.set((M-C.left)/C.width*2-1,-((P-C.top)/C.height)*2+1),Se.setFromCamera(ze,yt.current),Se.ray.intersectPlane(Wt,st)?{x:st.x,y:st.y}:null},h=M=>{if(M.button!==0||!gt.current)return;const P=Dt(M.clientX,M.clientY);P&&(Ft.current=!0,Lt.current={x:P.x-G.current.x,y:P.y-G.current.y},H.setPointerCapture(M.pointerId))},te=M=>{if(!Ft.current)return;const P=Dt(M.clientX,M.clientY);P&&(G.current={x:P.x-Lt.current.x,y:P.y-Lt.current.y},Jt.current={...G.current,z:0})},X=()=>{Ft.current=!1};return H.addEventListener("pointerdown",h),H.addEventListener("pointermove",te),H.addEventListener("pointerup",X),()=>{H.removeEventListener("pointerdown",h),H.removeEventListener("pointermove",te),H.removeEventListener("pointerup",X)}},[Pe]);const nt=e.useRef(null),_t=e.useRef(null);e.useEffect(()=>{if(!_t.current)return;const H=_t.current.material;(Array.isArray(H)?H:[H]).forEach(Wt=>{Wt.depthTest=!1}),_t.current.renderOrder=999},[]);let Xe=1,qe=0,Bt=0,$e=0,Ge=!1,et=-1,ct=-1;if(ce){const H=n;if(H<=.01)Xe=1,Ge=!0,$e=.4;else if(H<.08)Xe=1,Ge=!0,$e=.4;else if(H<.22){const Se=lt(Ce((H-.08)/.12,0,1));Xe=1-Se*.65,et=Se*.6,Ge=!1,$e=.4,Bt=kr(Ce((H-.08)/.12,0,1))}else if(H<.42)ct=lt(Ce((H-.23)/.12,0,1)),Xe=.35,et=.6,Ge=ct>.8,$e=.4,Bt=1-lt(Ce((H-.36)/.05,0,1));else if(H<.6)Xe=.35,et=.6,Ge=!1,qe=lt(Ce((H-.42)/.16,0,1)),$e=.4;else if(H<1){const Se=lt(Ce((H-.6)/.12,0,1));qe=1-Se,Xe=.35+.65*Se,et=.6*(1-Se),Ge=Se>.5,$e=.4+Math.PI*2*lt(Ce((H-.6)/.38,0,1))}else Xe=1,qe=0,Ge=!0,$e=.4+Math.PI*2}else if(n<=0)Xe=1,Ge=!1;else if(n<.08){const H=n/.08;Xe=1-lt(H)*.6,$e=-.2}else if(n<.22)Xe=.4,$e=-.2;else if(n<.5){Xe=.4,$e=n<.28?-.2:.4;const H=Ce((n-.35)/.15,0,1);if(qe=lt(H),_>0&&n>.42){const Se=Ce((n-.42)/.08,0,1);$e=lt(Se)*.4}}else n<.75?(Xe=.4,qe=d,$e=.4+(-Math.PI*.25-.4)*d):n<.87?(Xe=1,qe=0,Ge=!0,$e=265*(Math.PI/180)):(n<.94,Xe=1,qe=0,$e=Math.PI*2,Ge=!0);const Nt=0,Pt=Nt*qe,ft=qe*Math.max(0,1-_*1.5),We=Math.max(0,Bt-_*2),ot=Nt*ft;Ir.current=_>0?ot:Pt,Dr.current=_,mr.current=d,xr.current=x,Rr.current=n;const xt=e.useRef(n);e.useEffect(()=>{const H=xt.current;xt.current=n,(n===0||H<1&&n>=1)&&(xe.current=.4,ee.current&&(ee.current.rotation.y=.4))},[n]),dr(H=>{const Wt=(n<=0||n>=1)&&_<=0?Math.sin(H.clock.elapsedTime*1.2)*.02:0;if(Y(h=>{const te=Wt-h;return Math.abs(te)<5e-4?Wt:h+te*.15}),ut&&!S.current&&ee.current){let h=0;ee.current.traverse(te=>{te.isMesh&&h++}),h>5&&(S.current=!0,Ze(te=>te+1))}if(oe.current){const h=de.current,te=fe.current,X=!gt.current&&Ut.current;if(ce===!0&&(Fr.current=!!h&&!Ue.current&&!X),X){const M=It.current;if(x>0&&Ye.current<=0)G.current.x=M.x,G.current.y=M.y,Qt.current=performance.now();else{const C=performance.now()-Qt.current<100?1:.12;G.current.x=U(G.current.x,M.x,C),G.current.y=U(G.current.y,M.y,C)}Jt.current={...G.current,z:0},Ye.current=x,oe.current.position.x=G.current.x,oe.current.position.y=G.current.y,oe.current.position.z=0,oe.current.scale.setScalar(1)}else if(h)oe.current.position.set(h.x,h.y,h.z),oe.current.scale.setScalar(te??1),G.current.x=h.x,G.current.y=h.y,Jt.current={x:h.x,y:h.y,z:h.z},Ye.current=x;else if(gt.current)oe.current.position.x=G.current.x,oe.current.position.y=G.current.y,oe.current.position.z=0,oe.current.scale.setScalar(1);else{if(x>0)G.current.x=U(G.current.x,-.14,.15),G.current.y=U(G.current.y,-.2,.15);else if(n<.65){const M=performance.now()-Qt.current<100?1:.07;G.current.x=U(G.current.x,0,M),G.current.y=U(G.current.y,0,M)}Jt.current={...G.current,z:0},Ye.current=x,oe.current.position.x=G.current.x,oe.current.position.y=G.current.y,oe.current.position.z=0,oe.current.scale.setScalar(1)}}const st=performance.now()-Qt.current<100,ze=h=>{xe.current=h,ee.current&&(ee.current.rotation.y=h,ee.current.rotation.x=qr.current*(Math.PI/180),ee.current.rotation.z=en.current*(Math.PI/180)
1),nt.current&&x<=0&&(nt.current.rotation.y=h)};nt.current&&ee.current&&(nt.current.position.set(0,ee.current.position.y+.82*.363,0),nt.current.visible=B,x>0&&nt.current.quaternion.copy(ve.quaternion));const Dt=L;if(Dt!==void 0&&!q){ze(U(xe.current,Dt*(Math.PI/180),.9));return}if(Ue.current&&(q||d>0||x>0)){ze(St.current),q&&ee.current&&(De.current=Ee.current,ee.current.rotation.x=De.current);return}if(_>0)ze(U(xe.current,0,.05+_*.04));else if(n<=0||n>=1){if(le.current=!0,!q&&!gt.current&&!Or.current){const h=.4+H.pointer.x*.55;let X=(xe.current%(2*Math.PI)+2*Math.PI)%(2*Math.PI);X>Math.PI&&(X-=2*Math.PI);const M=h-X,P=Math.abs(X-.4)<.8?.35:.18;if(ze(Math.abs(M)>Math.PI?h:U(X,h,P)),ee.current){const C=Math.min(H.pointer.y*-.15,0);ee.current.rotation.x=U(ee.current.rotation.x,C,.2)}}}else{if(!ce&&n<.28){q||ze(.35);return}if(!q)if(at){if(we.current<0){const P=(xe.current%(2*Math.PI)+2*Math.PI)%(2*Math.PI),C=(Math.PI-P+2*Math.PI)%(2*Math.PI);xe.current=P,ee.current&&(ee.current.rotation.y=P),ke.current=P,dt.current=C+Math.PI,we.current=performance.now()}const h=performance.now()-we.current,te=Math.min(1,h/be),X=lt(te);ze(ke.current+dt.current*X),sr.current=te}else{if(we.current>=0){we.current=-1,sr.current=-1;const X=(xe.current%(2*Math.PI)+2*Math.PI)%(2*Math.PI);xe.current=X,ee.current&&(ee.current.rotation.y=X)}if(sr.current=-1,ce&&le.current){le.current=!1,ze(.4);return}const h=st?1:ce?.12:x>0?.15:n>=.29&&n<=.5?1:.15,te=$e-xe.current;ze(Math.abs(te)<.005?$e:U(xe.current,$e,h))}}});const wt=n<=0||n>=1,J=Math.abs(n-.22),ge=et>=0?et:Ce(1-J/.015,0,1),Ht=ce?0:Ce(n/.04,0,1)*Ce((.28-n)/.04,0,1)*.15;return t.jsx(t.Fragment,{children:t.jsx(Jr,{enabled:ut,children:t.jsxs("group",{ref:oe,children:[t.jsx("group",{ref:ee,position:[ce===!0&&A?0:(re??Gt.current).x,.51+Ct-ot+Ht+(ce===!0&&A?0:(re??Gt.current).y),ce===!0&&A?0:(re??Gt.current).z],scale:[.82*((x>0?1e3:i)/1e3),.82,.82],children:t.jsxs("group",{position:[ce===!0&&A?0:-(re??Gt.current).x/(.82*((x>0?1e3:i)/1e3)),ce===!0&&A?0:-(re??Gt.current).y/.82,ce===!0&&A?0:-(re??Gt.current).z/.82],children:[t.jsx(Fn,{drawerOpenProgress:We,panelOpacity:Xe,useDepthTest:Ge,isInitialState:wt,explodeProgress:ft,drawingModeProgress:_,widthMm:x>0?1e3:i,edgeColorProgress:ge,hideDoor:!ce&&n>=.75&&n<.87,showAnnotations:!ce&&n>=.5&&n<.7,scanLineY:ct,outerEdgesOnly:ut,doorTexturePath:ne,doorTextureParts:vt,doorTextureRotations:it,bodyTexturePath:Tt,bodyTextureParts:bt,bodyTextureRotations:zt,onMeshNamesReady:je}),t.jsx(on,{centerY:0,enabled:d>0})]})}),t.jsx("group",{ref:nt,visible:!1,children:t.jsx("axesHelper",{ref:_t,args:[4]})})]})},f)})}function Un({allowFreeZoom:i}){const n=e.useRef(i);return n.current=i,e.useEffect(()=>{const _=d=>{if(!n.current||d.key!=="+"&&d.key!=="="&&d.key!=="-")return;const x=isNaN(pr.current)?rn.current:pr.current,L=d.key==="-"?2:-2;pr.current=Math.max(2,Math.min(80,x+L))};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[]),null}function Yn({controlsRef:i,card4ZoomP:n=0,cabinetMode:_="door",allowFreeZoom:d=!1,card4Fov:x,positionOffset:L,allowFreePos:B=!1,animPaused:q=!1,sequenceProgress:w,drawingModeProgress:z,detailModeProgress:A,drawingCameraProgress:Be}){const ce=e.useRef(0),ut=e.useRef(!1),ne=e.useRef(!1),vt=e.useRef({px:1.8,py:2.2,pz:1,tx:0,ty:.52,tz:0,fov:40}),it=e.useRef(!1),Tt=e.useRef({px:1.8,py:2.2,pz:1,tx:0,ty:.52,tz:0,fov:40}),bt=e.useRef(!1),zt=e.useRef({px:1.8,py:2.2,pz:1,tx:0,ty:.52}),je=e.useRef(!1),ee=e.useRef({px:1.8,py:2.2,pz:1,tx:0,ty:.52,fov
1:40}),{camera:Ct}=ur();return e.useEffect(()=>{const Y=f=>{if(f.key!=="p"&&f.key!=="P")return;const Ze=i.current;if(!Ze)return;const S=Ct.position,le=Ze.target,xe=`pos:(${S.x.toFixed(3)},${S.y.toFixed(3)},${S.z.toFixed(3)}) tgt:(${le.x.toFixed(3)},${le.y.toFixed(3)},${le.z.toFixed(3)})`;console.warn("📷 Camera:",xe),navigator.clipboard?.writeText(xe)};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[Ct,i]),dr(({camera:Y})=>{const f=i.current;if(!f)return;const Ze=A??mr.current,S=Be??z??Dr.current,le=n,xe=B&&le>0?1:le,St=Ir.current,Ue=ce.current,T=le>0?3:Ze>=1?2:0,ue=T!==Ue;if(ce.current=T,S<=0&&(je.current=!1),S>0){je.current||(ee.current={px:Y.position.x,py:Y.position.y,pz:Y.position.z,tx:f.target.x,ty:f.target.y,fov:Y.fov??40},je.current=!0);const Ee=.84,De=ee.current;Y.position.x=U(De.px,0,S),Y.position.y=U(De.py,Ee,S),Y.position.z=U(De.pz,3.6,S),f.target.x=U(De.tx,0,S),f.target.y=U(De.ty,Ee,S)}else if(le>0){ue&&(ut.current=!1);const Ee=le>=1,De=ut.current&&le<.95,_e=_==="drawer"?.6:.28,Ye=_==="drawer"?.7:.43,we=_==="drawer"?-.65:.21,ke=_==="drawer"?.4:.06,dt=_==="drawer"?.36:.33,be=_==="drawer"?-.15:0;if(ne.current||(vt.current={px:_e,py:Ye,pz:we,tx:ke,ty:dt,tz:be,fov:x??12},ne.current=!0),De){ne.current=!1,it.current||(Tt.current={px:Y.position.x,py:Y.position.y,pz:Y.position.z,tx:f.target.x,ty:f.target.y,tz:f.target.z,fov:Y.fov??40},it.current=!0);const oe=kr(1-Math.max(0,le/.95)),G=Tt.current;Ze>0?(Y.position.x=U(G.px,.15,oe),Y.position.y=U(G.py,.7,oe),Y.position.z=U(G.pz,2.5,oe),f.target.x=U(G.tx,.1,oe),f.target.y=U(G.ty,.35,oe)):(Y.position.x=U(G.px,1.8,oe),Y.position.y=U(G.py,2.2,oe),Y.position.z=U(G.pz,1,oe),f.target.x=U(G.tx,0,oe),f.target.y=U(G.ty,.52,oe))}else if(it.current=!1,!(ut.current&&Ee)){const oe=vt.current;Y.position.x=U(oe.px,_e,xe),Y.position.y=U(oe.py,Ye,xe),Y.position.z=U(oe.pz,we,xe),f.target.x=U(oe.tx,ke,xe),f.target.y=U(oe.ty,dt,xe),f.target.z=U(oe.tz,be,xe),Ee&&(ut.current=!0)}}else if(Ze>0)Ze>=1&&(Y.position.x=.15,Y.position.y=.7,Y.position.z=2.5,f.target.x=.1,f.target.y=.35);else if(q){f.update();return}else{const Ee=.52-St,De=w??Rr.current,_e=sr.current;if(_e>=0){bt.current||(zt.current={px:Y.position.x,py:Y.position.y,pz:Y.position.z,tx:f.target.x,ty:f.target.y},bt.current=!0);const Ye=lt(Math.min(1,_e)),we=zt.current;Y.position.x=U(we.px,1.8,Ye),Y.position.y=U(we.py,2.2,Ye),Y.position.z=U(we.pz,1,Ye),f.target.x=U(we.tx,0,Ye),f.target.y=U(we.ty,Ee,Ye)}else{bt.current=!1,ne.current=!1;const Ye=performance.now()-Qt.current<100,we=De>=.29&&De<=.5,ke=Ye||we?1:.2;if(Fr.current)f.target.x=U(f.target.x,0,ke),f.target.y=U(f.target.y,Ee,ke),f.target.z=U(f.target.z,0,ke);else{const dt=Jt.current,be=Gt.current,oe=dt.x+be.x,G=dt.y+Ee+be.y,gt=dt.z+be.z;f.target.x=U(f.target.x,oe,ke),f.target.y=U(f.target.y,G,ke),f.target.z=U(f.target.z,gt,ke)}Y.position.y=U(Y.position.y,2.2-St*.88,ke),De>0&&De<1&&(Y.position.x=U(Y.position.x,1.8,ke),Y.position.z=U(Y.position.z,1,ke))}}if(Y instanceof kn){const Ee=Math.min(1,xe*1.05),De=ne.current?vt.current.fov:40,_e=S>0&&je.current?U(ee.current.fov,30,S):null,Ye=_e!==null?_e:le>0?U(De,x??1.8,Ee):Ze>=1?36.2:40,ke=!isNaN(pr.current)&&S<=0&&(le<=0||d)?pr.current:Ye,dt=Ze>=1,be=performance.now()-Qt.current<100;if(le>0&&it.current){const oe=kr(1-Math.max(0,le/.95)),G=Ze>=1?36.2:40;Y.fov=U(Tt.current.fov,G,oe)}else _e!==null?Y.fov=_e:Y.fov=U(Y.fov,ke,le>0||ue||dt||be?1:.15);Y.updateProjectionMatrix(),rn.current=Y.fov}f.update();const tt=Y.position,rt=Math.sqrt((tt.x-f.target.x)**2+(tt.z-f.target.z)**2);Math.atan2(tt.y-f.target.y,rt)}),null}function Gn(){const i=e.useMemo(()=>{const _=new En(10,10,16777215,16777215);return(Array.isArray(_.material)?_.material:[_.material]).forEach(x=>{x.depthWrite=!1,x.transparent=!0,x.opacity=.5}),_},[]),n=e.useMemo(()=>{const _=new Qr(3);return(Array.isArray(_.material)?_.material:[_.material]).forEach(x=>{x.depthWrite=!1,x.transparent=!0}),_},[]);return e.useEffect(()=>()=>{i.geometry.dispose(),n.geometry.dispose()},[i,n]),t.jsxs(t.Fragment,{children:[t.jsx("primitive",{object:i}),t.jsx("primitive",{object:n})]})}function Xn({onHover:i}){const{camera:n,scene:_,gl:d}=ur(),x=e.useMemo(()=>new Ar,[]),L=e.useRef(!1),B=e.useRef(i);B.current=i;const q=e.useRef(0);return e.useEffect(()=>{const w=d.domElement,z=new Lr,A=re=>{const at=performance.now();if(at-q.current<50)return;if(q.current=at,document.elementFromPoint(re.clientX,re.clientY)!==w){L.current&&(L.current=!1,B.current(!1));return}const ce=w.getBoundingClientRect();z.set((re.clientX-ce.left)/ce.width*2-1,-((re.clientY-ce.top)/ce.height)*2+1),x.setFromCamera(z,n);const ne=x.intersectObjects(_.children,!0).some(vt=>{const it=vt.object;return it.isMesh&&it.visible&&it.castShadow});ne!==L.current&&(L.current=ne,B.current(ne))},Be=()=>{L.current&&(L.current=!1,B.current(!1))};return w.addEventListener("pointermove",A,{passive:!0}),w.addEventListener("pointerleave",Be,{passive:!0}),()=>{w.removeEventListener("pointermove",A),w.removeEventListener("pointerleave",Be)}},[n,_,d,x]),null}function $n({fullscreen:i=!1,scrollProgress:n,showSlider:_,sliderStyle:d,onSliderInteract:x,darkSlider:L,globalCursor:B=!1,darkBg:q=!1,transparentSlider:w=!1,disableGhosts:z=!1,drawingModeProgress:A=0,drawingCameraProgress:Be,worldOffset:re,worldScale:at,rotationPivot:ce,showWorldGrid:ut=!1,detailModeProgress:ne=0,cameraDetailModeP:vt,card4ZoomP:it=0,onWidthChange:Tt,onModeChange:bt,initialWidthMm:zt,initialMode:je,sceneRotationY:ee,hideShadow:Ct=!1,allowHoverShow:Y=!1,onCanvasHover:f,showAxisLines:Ze=!1,allowFreeRotate:S=!1,allowFreePos:le=!1,positionOffset:xe,allowFreeZoom:St=!1,
1card4Fov:Ue,exitSpin:T=!1,heroAnimation:ue=!1,outerEdgesOnly:tt=!1,doorTexturePath:rt=null,interactionDisabled:Ee=!1}){const De=e.useRef(null),[_e,Ye]=e.useState(zt??1e3),[we,ke]=e.useState(je??"door"),[dt,be]=e.useState(0),[oe,G]=e.useState(!1),gt=!1,[Ft,Lt]=e.useState(!1),[It,Ut]=e.useState([]),[de,fe]=e.useState(()=>{try{const s=localStorage.getItem("doorTextureParts");return s?new Set(JSON.parse(s)):new Set(["Part_10","Part_11"])}catch{return new Set(["Part_10","Part_11"])}}),[Pe,ve]=e.useState(()=>{try{const s=localStorage.getItem("doorTextureRotations");return s?JSON.parse(s):{}}catch{return{}}}),[yt,nt]=e.useState(()=>{try{const s=localStorage.getItem("bodyTextureParts");return s?new Set(JSON.parse(s)):new Set}catch{return new Set}}),[_t,Xe]=e.useState(()=>{try{const s=localStorage.getItem("bodyTextureRotations");return s?JSON.parse(s):{}}catch{return{}}}),qe="/textures/body/mosi-white.png",[Bt,$e]=e.useState(()=>{try{const s=localStorage.getItem("drawerDoorTexParts");return s?new Set(JSON.parse(s)):new Set}catch{return new Set}}),[Ge,et]=e.useState(()=>{try{const s=localStorage.getItem("drawerDoorTexRotations");return s?JSON.parse(s):{}}catch{return{}}}),[ct,Nt]=e.useState(()=>{try{const s=localStorage.getItem("drawerBodyTexParts");return s?new Set(JSON.parse(s)):new Set}catch{return new Set}}),[Pt,ft]=e.useState(()=>{try{const s=localStorage.getItem("drawerBodyTexRotations");return s?JSON.parse(s):{}}catch{return{}}}),[We,ot]=e.useState([]),[xt,wt]=e.useState(!1),[J,ge]=e.useState(()=>{try{const s=localStorage.getItem("cpt.solidParts");if(s)return new Set(JSON.parse(s))}catch{}return new Set(Ln)});e.useEffect(()=>{try{localStorage.setItem("cpt.solidParts",JSON.stringify(Array.from(J)))}catch{}},[J]);const[Ht,H]=e.useState("idle");e.useCallback(async()=>{H("saving");try{const s=await fetch("/api/dev/save-cpt-solid-parts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({names:Array.from(J)})});if(!s.ok)throw new Error(`HTTP ${s.status}`);H("ok"),setTimeout(()=>H("idle"),1800)}catch(s){console.error("save-cpt-solid-parts failed:",s),H("err"),setTimeout(()=>H("idle"),2500)}},[J]),e.useEffect(()=>{},[gt]);const Se=e.useRef(null),[Wt,st]=e.useState(!1),[ze,Dt]=e.useState(!1),h=e.useRef(null),[te,X]=e.useState(!1),M=e.useRef(null),P=e.useRef(null),C=e.useRef(null);e.useEffect(()=>{Tt?.(_e)},[_e,Tt]),e.useEffect(()=>{bt?.(we)},[we,bt]),e.useEffect(()=>{const s=a=>{const m=a.detail;ke(m)};return window.addEventListener("cabinet-mode",s),()=>window.removeEventListener("cabinet-mode",s)},[]),e.useEffect(()=>{const s=a=>{Ye(a.detail)};return window.addEventListener("cabinet-width",s),()=>window.removeEventListener("cabinet-width",s)},[]);const D=n!==void 0&&n>.01,K=D?n:dt,R=e.useRef(!1),l=e.useCallback((s=!1)=>{if(R.current&&!s)return;Se.current&&cancelAnimationFrame(Se.current),be(0),G(!0),R.current=!0,X(!1);const a=performance.now(),m=8e3,k=()=>{const v=performance.now()-a,V=Ce(v/m,0,1);be(V),V<1?Se.current=requestAnimationFrame(k):(G(!1),R.current=!1,Se.current=null,Qt.current=performance.now())};Se.current=requestAnimationFrame(k)},[]),ae=e.useCallback(()=>{Se.current&&(cancelAnimationFrame(Se.current),Se.current=null),G(!1),R.current=!1},[]),Z=()=>{Dt(!0),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>Dt(!1),1400)},Me=s=>{x?.(),D||R.current&&ae(),Ye(Number(s.target.value)),Z()},ht=()=>{D||l(!0)};e.useEffect(()=>()=>{Se.current&&cancelAnimationFrame(Se.current)},[]),e.useEffect(()=>{const s=a=>{P.current&&(P.current.style.left=`${a.clientX}px`,P.current.style.top=`${a.clientY}px`)};if(B){const a=document.body.style.cursor;document.body.style.cursor="none";const m=Oe=>{C.current&&(C.current.style.width=C.current.style.height=Oe)},k='button, a, input, select, label, [role="button"], [data-interactive]';let v=!1,V=!1;const Q=Oe=>{Oe.target.closest?.(k)&&(v=!0,m("10px"))},Ae=Oe=>{Oe.relatedTarget?.closest?.(k)||(v=!1,V||m("200px"))},Je=()=>{V=!0,m("25px")},ye=()=>{V=!1,v||m("200px")};return document.addEventListener("mouseover",Q),document.addEventListener("mouseout",Ae),window.addEventListener("mousedown",Je),window.addEventListener("mouseup",ye),window.addEventListener("mousemove",s),()=>{window.removeEventListener("mousemove",s),window.removeEventListener("mousedown",Je),window.removeEventListener("mouseup",ye),document.removeEventListener("mouseover",Q),document.removeEventListener("mouseout",Ae),document.body.style.cursor=a}}else{const a=M.current;return a?(a.addEventListener("mousemove",s),()=>a.removeEventListener("mousemove",s)):void 0}},[B]);const kt=i?{position:"absolute",inset:0,width:"100%",height:"100%",...Ee?{pointerEvents:"none"}:{}}:{position:"relative",width:"100%",height:"100%",minHeight:"400px",...Ee?{pointerEvents:"none"}:{}},b=(_!==void 0?_:!0)||Y&&Wt,E={...{position:"absolute",left:"50%",bottom:i?"80px":"40px",transform:"translateX(-50%)",width:"min(320px, calc(100% - 48px))"},...d};return t.jsxs("div",{ref:M,style:{...kt},children:[Cr.createPortal(t.jsx("div",{ref:P,style:{position:"fixed",pointerEvents:"none",zIndex:B?3:9999,transform:"translate(-50%, -50%)",display:"none",alignItems:"center",justifyContent:"center",left:0,top:0},children:t.jsxs("div",{ref:C,style:{width:200,height:200,borderRadius:"50%",transition:"width 0.12s ease, height 0.12s ease",background:"rgba(255,255,255,0.04)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",border:"1px solid rgba(255,255,255,0.45)",boxShadow:["inset 0 1px 0 rgba(255,255,255,0.55)","inset 0 -1px 0 rgba(255,255,255,0.08)"].join(", "),position:"relative",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"1px",background:"linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent)"}}),t.jsx("div",{style:{position:"absolute",top:0,left:0,width:"1px",height:"100%",background:"linear-gradient(180deg, rgba(255,255,255,0.7), transparent, rgba(255,255,255,0.2))"}})]})}),document.body),t.jsx(Sn,{shadows:!0,camera:{position:[1.8,2.2,1],fov:40},dpr:[1,1.5],style:{background:"transparent",touchAction:"pan-y",...Ee?{pointerEvents:"none"}:{}},onPointerDown:()=>{R.current&&(ae(),X(!0))},onDoubleClick:()=>{},gl:{alpha:!0,antialias:!0,toneMapping:Mn,toneMappingExposure:.78},children:t.jsxs(hn,{children:[t.jsx("ambientLight",{intensity:.06,color:"#fff8f2"}),t.jsx("hemisphereLight",{intensity:.08,color:"#fff4e8",groundColor:"#8a7060"}),t.jsx("spotLight",{position:[5,6,4],intensity:2.4,angle:.42,penumbra:.8,color:"#fff5e8",castShadow:!0,"shadow-mapSize-width":1024,"shadow-mapSize-height":1024,"shadow-camera-near":.5,"shadow-camera-far":16,"shadow-bias":-3e-4,"shadow-radius":4}),t.jsx("spotLight",{position:[-4,6,2],intensity:.3,angle:.5,penumbra:.9,color:"#ffeedd"}),t.jsx("spotLight",{position:[.5,5,8],intensity:.25,angle:.5,penumbra:.9,color:"#fff8f0"}),t.jsx("directionalLight",{position:[-3,5,-4],intensity:.15,color:"#e8ddd0"}),t.jsx("pointLight",{position:[0,4,0],intensity:3.2,color:"#ffffff",decay:1.4}),t.jsx("directionalLight",{position:[0,8,0],intensity:1.6,color:"#ffffff"}),t.jsx("directionalLight",{position:[0,6,-2],intensity:.5,color:"#ffffff"}),t.jsx(e.Suspense,{fallback:null,children:t.jsx(Rn,{files:"/hdr/monochrome_studio_02_1k.hdr",backgroundIntensity:0,environmentIntensity:.48})}),!Ct&&t.jsxs("mesh",{receiveShadow:!0,rotation:[-Math.PI/2,0,0],position:[0,.005,0],children:[t.jsx("planeGeometry",{args:[10,10]}),t.jsx("shadowMaterial",{transparent:!0,opacity:.28,depthWrite:!1})]}),ut&&t.jsx(Gn,{}),we==="door"?t.jsx(Nn,{widthMm:_e,sequenceProgress:K,initSmall:n!==void 0,disableGhosts:z,drawingModeProgress:A,detailModeProgress:ne,cameraDetailModeP:vt,card4ZoomP:it,externalRotY:ee,showAxes:Ze,freeRotate:S||te,allowFreePos:le,positionOffset:xe,worldOffset:re,worldScale:at,rotationPivot:ce,exitSpin:T,heroAnimation:ue,outerEdgesOnly:tt,doorTexturePath:rt,doorTextureParts:de,doorTextureRotations:Pe,bodyTexturePath:qe,bodyTextureParts:yt,bodyTextureRotations:_t,onMeshNamesReady:s=>
1Ut(s),solidPartNames:J},"door"):t.jsx(Hn,{widthMm:_e,sequenceProgress:K,initSmall:n!==void 0,drawingModeProgress:A,detailModeProgress:ne,card4ZoomP:it,externalRotY:ee,showAxes:Ze,freeRotate:S||te,allowFreePos:le,positionOffset:xe,worldOffset:re,worldScale:at,rotationPivot:ce,exitSpin:T,heroAnimation:ue,outerEdgesOnly:tt,doorTexturePath:rt,doorTextureParts:Bt,doorTextureRotations:Ge,bodyTexturePath:qe,bodyTextureParts:ct,bodyTextureRotations:Pt,onMeshNamesReady:s=>ot(s)},"drawer"),t.jsx(jn,{ref:De,enableDamping:!0,enabled:!le&&!Ee,enableRotate:!le&&!Ee&&A<.1&&ne<.1&&(it<.1||it>=.99)&&(K<=0||K>=1||te),enableZoom:!1,enablePan:!1,minDistance:.5,maxDistance:4,target:[0,.52,0],minPolarAngle:it>=.99?0:ue?.15:.8,maxPolarAngle:it>=.99?Math.PI:ue?Math.PI*.85:Math.PI*.48,minAzimuthAngle:ue?-1/0:-Math.PI,maxAzimuthAngle:ue?1/0:Math.PI}),t.jsx(Un,{allowFreeZoom:St}),t.jsx(Yn,{controlsRef:De,card4ZoomP:it,cabinetMode:we,allowFreeZoom:St,card4Fov:Ue,positionOffset:xe,allowFreePos:le,animPaused:te,sequenceProgress:K,drawingModeProgress:A,detailModeProgress:ne,drawingCameraProgress:Be}),(Y||f)&&t.jsx(Xn,{onHover:s=>{st(s),f?.(s)}}),t.jsx(zn,{all:!0}),t.jsxs(gn,{children:[t.jsx(yn,{radius:.35,intensity:100,luminanceInfluence:.2,bias:.008,samples:16}),tt?t.jsx(_n,{visibleEdgeColor:16777215,edgeStrength:100,width:2e3}):t.jsx(t.Fragment,{})]})]})}),n===void 0&&t.jsx("button",{onClick:()=>{ke(we==="door"?"drawer":"door"),window.scrollTo({top:0,behavior:"instant"}),n===void 0&&l(!0)},style:{position:"absolute",top:"50%",right:"20px",transform:"translateY(-50%)",zIndex:10,padding:"10px 18px",borderRadius:"28px",fontSize:"14px",fontWeight:600,cursor:"pointer",border:"none",background:L?"rgba(255,255,255,0.12)":"rgba(0,0,0,0.08)",color:L?"#fff":"#111",backdropFilter:"blur(3px)"},children:we==="door"?"서랍형으로":"도어형으로"}),t.jsxs("div",{style:{...E,zIndex:10,display:"flex",alignItems:"center",gap:"24px",opacity:b?1:0,pointerEvents:Y||b?"auto":"none",transition:"opacity 0.3s ease"},onMouseEnter:()=>{M.current?._leaveTimer&&(clearTimeout(M.current._leaveTimer),M.current._leaveTimer=null),st(!0)},onMouseLeave:()=>{M.current._leaveTimer=setTimeout(()=>st(!1),200)},children:[n!==void 0&&t.jsxs("div",{style:{display:"flex",gap:"6px",flexShrink:0},children:[t.jsx("button",{onClick:()=>ke("door"),title:"도어형",style:{width:"34px",height:"34px",padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:"none",background:"none",color:L?"#fff":"#111",opacity:we==="door"?1:.35,cursor:"pointer",flexShrink:0,transition:"opacity 0.15s ease"},children:t.jsxs("svg",{width:"34",height:"34",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("rect",{x:"1.5",y:"1.5",width:"33",height:"33",rx:"7",stroke:"currentColor",strokeWidth:"2"}),t.jsx("line",{x1:"18",y1:"1.5",x2:"18",y2:"34.5",stroke:"currentColor",strokeWidth:"1.6"}),t.jsx("line",{x1:"13",y1:"16",x2:"13",y2:"20",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round"}),t.jsx("line",{x1:"23",y1:"16",x2:"23",y2:"20",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round"})]})}),t.jsx("button",{onClick:()=>ke("drawer"),title:"서랍형",style:{width:"34px",height:"34px",padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:"none",background:"none",color:L?"#fff":"#111",opacity:we==="drawer"?1:.35,cursor:"pointer",flexShrink:0,transition:"opacity 0.15s ease"},children:t.jsxs("svg",{width:"34",height:"34",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("rect",{x:"1.5",y:"1.5",width:"33",height:"33",rx:"3",stroke:"currentColor",strokeWidth:"2"}),t.jsx("line",{x1:"1.5",y1:"18",x2:"34.5",y2:"18",stroke:"currentColor",strokeWidth:"1.6"}),t.jsx("line",{x1:"16",y1:"10.5",x2:"20",y2:"10.5",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round"}),t.jsx("line",{x1:"16",y1:"25.5",x2:"20",y2:"25.5",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round"})]})})]}),t.jsxs("div",{style:{flex:1,position:"relative",height:"48px",display:"flex",alignItems:"center"},children:[t.jsx("input",{type:"range",min:"900",max:"1200",step:"10",value:_e,onChange:Me,onMouseUp:ht,onPointerUp:ht,onTouchEnd:ht,style:{position:"absolute",inset:0,width:"100%",height:"100%",opacity:0,cursor:"pointer",zIndex:2}}),t.jsx("div",{style:{width:"100%",height:"2px",background:L?"rgba(255,255,255,0.30)":"rgba(0,0,0,0.20)",borderRadius:"1px"}}),t.jsx("div",{style:{position:"absolute",left:0,width:`${(_e-900)/300*100}%`,height:"2px",background:L?"rgba(255,255,255,0.75)":"#111",borderRadius:"1px"}}),t.jsxs("div",{style:{position:"absolute",left:`${(_e-900)/300*100}%`,transform:"translateX(-50%)",display:"flex",flexDirection:"column",alignItems:"center",pointerEvents:"none",zIndex:1},children:[t.jsxs("div",{style:{position:"absolute",bottom:"20px",background:L?"rgba(20,20,20,0.82)":"rgba(255,255,255,0.92)",backdropFilter:"blur(2px)",border:`1px solid ${L?"rgba(255,255,255,0.18)":"rgba(0,0,0,0.12)"}`,borderRadius:"5px",padding:"4px 10px",fontSize:"14px",fontWeight:500,color:L?"#fff":"#111",whiteSpace:"nowrap",letterSpacing:"-0.01em",opacity:ze?1:0,transition:"opacity 0.2s ease",pointerEvents:"none"},children:[_e,t.jsx("span",{style:{fontSize:"12px",opacity:.6,marginLeft:"2px"},children:"mm"}),t.jsx("div",{style:{position:"absolute",bottom:"-5px",left:"50%",transform:"translateX(-50%)",borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:`5px solid ${L?"rgba(255,255,255,0.18)":"rgba(0,0,0,0.12)"}`}})]}),t.jsx("div",{style:{width:"17px",height:"17px",borderRadius:"50%",background:L?"#fff":"#111",boxShadow:L?"0 0 0 5px rgba(255,255,255,0.12)":"0 0 0 5px rgba(0,0,0,0.08)"}})]})]}),t.jsx("button",{onClick:()=>{Ye(s=>Math.max(900,s-10)),Z(),D||l(!0)},style:{background:"none",border:"none",color:L?"rgba(255,255,255,0.7)":"rgba(0,0,0,0.6)",cursor:"pointer",fontSize:"32px",lineHeight:1,padding:"0 2px",flexShrink:0,position:"relative",top:"-4px"},children:"−"}),t.jsx("button",{onClick:()=>{Ye(s=>Math.min(1200,s+10)),Z(),D||l(!0)},style:{background:"none",border:"none",color:L?"rgba(255,255,255,0.7)":"rgba(0,0,0,0.6)",cursor:"pointer",fontSize:"32px",lineHeight:1,padding:"0 2px",flexShrink:0,position:"relative",top:"-4px"},children:"+"})]}),gt,gt]})}
1const Kr=e.memo($n),Vn=.11,Kn=[{start:.08,end:.28,title:`이것이 당신의
2캐비넷`,subtitle:"팔레트와 슬라이더로 완성한 그 모습 그대로"},{start:.36,end:.56,title:`모든 각도에서
3살아 있는 형태`,subtitle:"도면 너머, 실제로 감상하듯 회전"},{start:.56,end:.96,title:`이제,
4제작으로 이어집니다`,subtitle:"설계가 곧 견적·도면·발주로 연결되는 순간"}];function Jn(i,n,_,d=.3){if(i<=n||i>=_)return 0;const x=_-n,L=n+x*d,B=_-x*d,q=w=>w*w*(3-2*w);return i<L?q((i-n)/(x*d)):i>B?q((_-i)/(x*d)):1}function ho(){const i=xn(),n=e.useRef(null),_=e.useRef(null),[d,x]=e.useState(0),[L,B]=e.useState(0);e.useLayoutEffect(()=>{if("scrollRestoration"in history&&(history.scrollRestoration="manual"),window.scrollTo(0,0),_.current){const h=_.current.offsetHeight-window.innerHeight,te=Math.max(0,Math.min(1,window.scrollY/Math.max(1,h)));te!==0&&(x(te),B(te))}A.current&&(A.current.style.opacity="1")},[]);const q=e.useRef(null);e.useEffect(()=>{const h=new bn({duration:1.1,easing:M=>Math.min(1,1.001-Math.pow(2,-10*M)),smoothWheel:!0,wheelMultiplier:1.8,touchMultiplier:1});q.current=h;let te=0;const X=M=>{h.raf(M),te=requestAnimationFrame(X)};return te=requestAnimationFrame(X),()=>{cancelAnimationFrame(te),h.destroy(),q.current=null}},[]);const[w,z]=e.useState({x:0,y:0,z:0});e.useEffect(()=>{Gt.current={...w}},[w]),e.useEffect(()=>{let h=!1;const te=()=>{if(h)return;const X=tn.current;if(X&&(Math.abs(X.x)>1e-6||Math.abs(X.y)>1e-6||Math.abs(X.z)>1e-6)){z({x:X.x,y:X.y,z:X.z});return}requestAnimationFrame(te)};return requestAnimationFrame(te),()=>{h=!0}},[]);const A=e.useRef(null);e.useRef(!0);const[Be,re]=e.useState(!0),at=e.useRef(null),ce=e.useRef(null),ut=e.useRef(!1),[ne,vt]=e.useState(!1),it=e.useRef(0),[Tt,bt]=e.useState(0),[zt,je]=e.useState(1e3),[ee,Ct]=e.useState("door"),Y=e.useRef(ee);Y.current=ee,e.useEffect(()=>{window.dispatchEvent(new CustomEvent("cabinet-mode",{detail:ee}))},[ee]);const[f,Ze]=e.useState(()=>window.innerWidth<=1024),S=e.useRef(window.innerWidth<=1024),[le,xe]=e.useState(()=>window.innerWidth>1440);e.useEffect(()=>{const h=()=>{const te=window.innerWidth<=1024;Ze(te),S.current=te,xe(window.innerWidth>1440)};return window.addEventListener("resize",h,{passive:!0}),()=>window.removeEventListener("resize",h)},[]);const[St,Ue]=e.useState(()=>window.innerWidth/Math.max(1,window.innerHeight));e.useEffect(()=>{const h=()=>Ue(window.innerWidth/Math.max(1,window.innerHeight));return window.addEventListener("resize",h,{passive:!0}),()=>window.removeEventListener("resize",h)},[]);const[T,ue]=e.useState(()=>window.innerWidth<=1024),tt=e.useRef(window.innerWidth<=1024);e.useEffect(()=>{const h=()=>{const te=window.innerWidth<=1024;ue(te),tt.current=te};return window.addEventListener("resize",h,{passive:!0}),()=>window.removeEventListener("resize",h)},[]);const rt=Xr(h=>h.setSectionHeaderDark),Ee=Xr(h=>h.setIsHeaderVisible);e.useEffect(()=>(rt(!0),Ee(!0),()=>{rt(!1),Ee(!0)}),[rt,Ee]),e.useEffect(()=>{const h=()=>{q.current?q.current.scrollTo(0,{duration:1}):window.scrollTo({top:0,behavior:"smooth"})};return window.addEventListener("pro-nav-point",h),()=>window.removeEventListener("pro-nav-point",h)},[]),e.useEffect(()=>{Or.current=L>=Vn},[L]),e.useEffect(()=>{let h=null,te=-1,X=-1,M=-1,P=-1,C=-1;const D=()=>{if(h=null,_.current){const R=_.current.getBoundingClientRect(),l=Math.max(1,_.current.offsetHeight-window.innerHeight),Z=Math.max(0,Math.min(1,-R.top/l));(Math.abs(Z-te)>.002||Z===1&&te!==1||Z===0&&te!==0)&&(te=Z,x(Z)),Math.abs(Z-X)>.002&&(X=Z,B(Z))}{const R=window.innerHeight,l=b=>Math.max(0,Math.min(1,b));let ae=R,Z=R*5;if(at.current){const b=at.current.getBoundingClientRect();ae=b.top,Z=b.height;const u=Math.max(1,Z-R),E=l(-ae/u);it.current=E,(Math.abs(E-C)>.005||E===0||E===1)&&(C=E,bt(E))}const Me=l((R-ae)/R);(Math.abs(Me-M)>.001||Me===0||Me===1)&&A.current&&(A.current.style.opacity=String(1-Me),A.current.style.visibility=Me>=.999?"hidden":"visible",A.current.style.pointerEvents=Me<.05?"auto":"none");const kt=ae<R*1.5&&ae+Z>-R*5;if(kt!==ut.current&&(ut.current=kt,vt(kt)),ce.current){const b=l((it.current-.84)/.08),u=Me*(1-b);(Math.abs(u-P)>.001||u===0||u===1)&&(ce.current.style.opacity=String(u),ce.current.style.visibility=u<=.001?"hidden":"visible",P=u)}M=Me}},K=()=>{h===null&&(h=requestAnimationFrame(D))};return window.addEventListener("scroll",K,{passive:!0}),window.addEventListener("resize",K,{passive:!0}),D(),()=>{window.removeEventListener("scroll",K),window.removeEventListener("resize",K),h!==null&&cancelAnimationFrame(h)}},[]);const{user:De,isB2B:_e,isApproved:Ye,isPending:we,isRejected:ke,b2bProfile:dt}=pn(),{isTeamMember:be}=mn(),[oe,G]=e.useState(!1),[gt,Ft]=e.useState(!1),[Lt,It]=e.useState(!1),[Ut,de]=e.useState(!1),[fe,Pe]=e.useState(null),[ve,yt]=e.useState(null),nt=[{name:"Misty Grey",path:"/textures/door/misty-grey.webp",color:"#C8C4BE"},{name:"Vanilla Cream",path:"/textures/door/vanilla-cream.webp",color:"#F0E8D8"},{name:"Herbtea Green",path:"/textures/door/herbtea-green.webp",color:"#A8B89A"},{name:"Hazy Green",path:"/textures/door/hazy-green.webp",color:"#B8C4AA"},{name:"Tender Oak",path:"/textures/door/tender-oak.webp",color:"#C4A882"},{name:"Deep Brown Walnut",path:"/textures/door/deep-brown-walnut.webp",color:"#5C4033"},{name:"Basso Oak",path:"/textures/door/basso-oak.webp",color:"#B89A78"}],[_t,Xe]=e.useState("/textures/door/deep-brown-walnut.webp"),[qe,Bt]=e.useState(null),{manifest:$e}=An(),Ge=()=>{window.open($e.url,"_blank"),setTimeout(()=>It(!0),1e3)},et=()=>{if(T){de(!0);return}De?_e&&Ye||be?i("/pro/library"):_e&&we?G(!0):_e&&ke?Ft(!0):i("/signup?type=business"):i("/login")},ct=h=>
4Math.max(0,Math.min(1,h)),Pt=ct(L/.11),ft=e.useMemo(()=>f?{left:"50%",transform:"translateX(-50%)",bottom:"-190px",top:"auto",right:"auto",width:"180px"}:{left:"50%",transform:"translateX(-50%)",top:"calc(9 * (min(100vw, 1710px) - 2 * var(--grid-pad) - 11 * var(--grid-gap)) / 12)",bottom:"auto",right:"auto",width:"400px"},[f]),We=Tt,ot=h=>h*h*(3-2*h),xt=ct((We-.08)/.52),wt=0+ot(xt)*360;let J=1;if(We<.08)J=.55+ot(We/.08)*.45;else if(We<.7){const h=(We-.08)/.62;J=1+Math.sin(h*Math.PI*2)*.025}else J=1;const ge=Math.max(.6,Math.min(1,St/1.78));J=J*ge;const Ht=.15,H=(1-ge)*.9,Se={x:0,y:Ht+H,z:0},Wt=ot(ct((We-.4)/.22)),st=0,ze=0,Dt=0;return e.useEffect(()=>{Ee(!0)},[]),t.jsxs("div",{className:"app-v2",style:{background:"#121212",width:"100%",maxWidth:"100vw",overflowX:"clip"},children:[t.jsxs("main",{style:{scrollSnapType:"y proximity",background:"#121212"},children:[t.jsx("div",{ref:_,id:"pro-hero",style:{height:"100vh",position:"relative",zIndex:T?20:void 0,pointerEvents:T?"none":void 0},children:t.jsx("div",{style:{height:"100vh",position:"relative"},children:t.jsxs("div",{ref:n,style:{position:"sticky",top:0,height:"100vh",background:T?"transparent":"#121212",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",top:T?"160px":f?"8%":"14%",bottom:T?"auto":f?"20%":"auto",left:0,right:0,zIndex:T?15:2,opacity:1,pointerEvents:"none",textAlign:"center",display:T?"block":f?"flex":"block",alignItems:"center",justifyContent:"center"},children:T?t.jsxs("div",{style:{margin:0,padding:0,fontFamily:"'Helvetica Neue', Arial, sans-serif",fontWeight:900,fontSize:"110px",lineHeight:.9,letterSpacing:"-0.05em",color:"#FFFFFF",textAlign:"center",textShadow:"0 4px 32px rgba(0,0,0,0.85), 0 0 18px rgba(0,0,0,0.65)"},children:["EASY",t.jsx("br",{}),"TO",t.jsx("br",{}),"BUILD"]}):t.jsx("h1",{style:{margin:0,padding:0,fontFamily:"'Helvetica Neue', Arial, sans-serif",fontWeight:900,fontSize:f?"25vw":"13.0vw",lineHeight:f?.92:1,letterSpacing:"-0.07em",color:"#FFFFFF",whiteSpace:f?"normal":"nowrap",userSelect:"none",textAlign:"center",textShadow:T?"0 4px 32px rgba(0,0,0,0.85), 0 0 18px rgba(0,0,0,0.65)":"none"},children:f?t.jsxs(t.Fragment,{children:["EASY",t.jsx("br",{}),"TO",t.jsx("br",{}),"BUILD"]}):"EASY TO BUILD"})}),!f&&Cr.createPortal(t.jsxs("div",{style:{position:"fixed",left:"calc((100vw - min(100vw, 1710px)) / 2 + var(--grid-pad) + 100px)",bottom:"calc(100vh - 9 * (min(100vw, 1710px) - 2 * var(--grid-pad) - 11 * var(--grid-gap)) / 12 + 140px)",zIndex:9998,opacity:ct(1-Pt*2),pointerEvents:Pt>.3?"none":"auto"},children:[t.jsxs("div",{style:{width:"160px",height:"160px",borderRadius:"50%",background:"#1a1a1a",border:"2px solid rgba(255,255,255,0.25)",display:"flex",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",zIndex:2,overflow:"hidden"},children:[t.jsxs("svg",{className:"palette-rotating-text-cpt",viewBox:"0 0 160 160",width:"160",height:"160",children:[t.jsx("defs",{children:t.jsx("path",{id:"palette-circle",d:"M 80,80 m -58,0 a 58,58 0 1,1 116,0 a 58,58 0 1,1 -116,0",fill:"none"})}),t.jsx("text",{fontSize:"16",fontWeight:600,textLength:"363",lengthAdjust:"spacing",style:{fill:qe??"#ffffff"},fontFamily:"'Helvetica Neue', Arial, sans-serif",children:t.jsx("textPath",{href:"#palette-circle",startOffset:"0%",children:"COLOR · PALETTE · COLOR · PALETTE ·"})})]}),t.jsxs("svg",{className:"palette-screw-spin-cpt",viewBox:"0 0 160 160",width:"160",height:"160",children:[t.jsx("circle",{cx:"80",cy:"80",r:"13",fill:"#ffffff"}),t.jsxs("g",{stroke:"#1a1a1a",strokeLinecap:"round",fill:"none",children:[t.jsx("line",{x1:"80",y1:"71",x2:"80",y2:"89",strokeWidth:"1.4"}),t.jsx("line",{x1:"71",y1:"80",x2:"89",y2:"80",strokeWidth:"1.4"})]})]})]}),nt.map((h,te)=>{const C=(-60+180*(te/(nt.length-1)))*Math.PI/180,D=Math.cos(C)*145,K=Math.sin(C)*145,R=_t===h.path;return t.jsx("div",{onClick:()=>Xe(R?null:h.path),title:h.name,onMouseEnter:l=>{l.currentTarget.style.transform="scale(1.15)",Bt(h.color)},onMouseLeave:l=>{l.currentTarget.style.transform="scale(1)",Bt(null)},style:{position:"absolute",left:`${80+D-32}px`,top:`${80+K-32}px`,width:"64px",height:"64px",borderRadius:"50%",overflow:"hidden",border:R?"2.5px solid #fff":"2px s
4olid rgba(255,255,255,0.3)",boxShadow:R?"0 0 0 2px rgba(255,255,255,0.5)":"none",cursor:"pointer",transition:"border 0.15s, transform 0.2s ease",zIndex:1},children:t.jsx("img",{src:h.path,alt:h.name,draggable:!1,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})},h.name)})]}),document.body),t.jsxs("div",{className:"grid-overlay",style:{zIndex:16,"--grid-max":"1710px",pointerEvents:T?"none":void 0},children:[f&&t.jsxs("div",{style:{...T?{position:"absolute",top:"513px",left:0,right:0,zIndex:17}:{gridColumn:"1 / -1",alignSelf:"end",paddingBottom:"60px"},opacity:ct(1-Pt),display:"flex",flexDirection:"column",alignItems:"center",gap:T?"16px":"20px",paddingLeft:"20px",paddingRight:"20px"},children:[T&&t.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"6px 14px",background:"rgba(255,255,255,0.1)",border:"1px solid rgba(255,255,255,0.25)",borderRadius:"999px",backdropFilter:"blur(6px)"},children:[t.jsx("img",{src:"/images/brand/sketchup-logo.png",alt:"SketchUp",style:{height:"14px",width:"auto",filter:"brightness(0) invert(1)"},draggable:!1}),t.jsx("span",{style:{fontSize:"11px",fontWeight:700,letterSpacing:"0.08em",color:"rgba(255,255,255,0.9)"},children:"SKETCHUP EXTENSION"})]}),t.jsxs("p",{style:{margin:0,fontSize:T?"clamp(0.95rem, 3.8vw, 1.1rem)":"clamp(0.75rem, 2.2vw, 1rem)",fontWeight:500,color:"#FFFFFF",lineHeight:1.55,letterSpacing:"-0.03em",textAlign:"center",whiteSpace:T?"normal":"nowrap",textShadow:T?"0 1px 12px rgba(0,0,0,0.55)":"none",maxWidth:T?"340px":"none"},children:["가구 선택부터 배치, 도면 작업, 발주까지!",t.jsx("br",{}),"이제 하나의 플랫폼에서 쉽고 빠르게 처리하세요."]}),t.jsxs("div",{style:{display:"flex",gap:"10px",pointerEvents:Pt>.5?"none":"auto",width:T?"100%":"auto",justifyContent:"center"},children:[t.jsxs("button",{onClick:et,onMouseEnter:()=>yt("design"),onMouseLeave:()=>yt(null),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"8px",background:T||ve==="design"?"#fff":"none",border:"1.5px solid #fff",borderRadius:T?"12px":"4px",padding:T?"12px 20px":"8px 18px",minHeight:T?"56px":void 0,cursor:"pointer",userSelect:"none",color:T||ve==="design"?"#000":"#fff",fontSize:T?"1.05rem":"0.95rem",fontWeight:T?700:500,letterSpacing:"-0.02em",whiteSpace:"nowrap",transition:"background 0.2s, color 0.2s",width:T?"100%":"auto",maxWidth:T?"240px":"none",boxShadow:T?"0 6px 20px rgba(0,0,0,0.35)":"none"},children:["설계 시작하기",t.jsx("span",{style:{fontSize:"0.72em",fontWeight:700,padding:"3px 7px",borderRadius:"3px",background:T||ve==="design"?"#000":"#fff",color:T||ve==="design"?"#fff":"#000",letterSpacing:"0.05em",lineHeight:1,transform:"translateY(1px)"},children:"BETA"})]}),!T&&t.jsx("button",{onClick:Ge,title:"스케치업 전용 루비(.rbz) 파일이 다운로드됩니다.",onMouseEnter:()=>yt("download"),onMouseLeave:()=>yt(null),style:{background:ve==="download"?"#fff":"none",border:"1.5px solid #fff",borderRadius:"4px",padding:"8px 18px",cursor:"pointer",userSelect:"none",color:ve==="download"?"#000":"#fff",fontSize:"0.95rem",fontWeight:500,letterSpacing:"-0.02em",whiteSpace:"nowrap",transition:"background 0.2s, color 0.2s"},children:"Get SketchUp Extension"})]})]}),!f&&t.jsx("div",{style:{gridColumn:"1 / 8",gridRow:1,alignSelf:"start",paddingTop:"calc(9 * (min(100vw, 1710px) - 2 * var(--grid-pad) - 11 * var(--grid-gap)) / 12)",opacity:ct(1-Pt),pointerEvents:"none"},children:t.jsxs("p",{style:{margin:0,fontSize:"22px",fontWeight:400,color:"#FFFFFF",lineHeight:1.5,letterSpacing:"-0.05em",textAlign:"left",whiteSpace:"nowrap"},children:["가구 선택부터 배치, 도면 작업, 발주까지!",t.jsx("br",{}),"이제 하나의 플랫폼에서 쉽고 빠르게 처리하세요."]})}),!f&&Cr.createPortal(t.jsxs("div",{style:{position:"fixed",top:"calc(9 * (min(100vw, 1710px) - 2 * var(--grid-pad) - 11 * var(--grid-gap)) / 12)",left:"calc((100vw - min(100vw, 1710px)) / 2 + var(--grid-pad) + 8 * (min(100vw, 1710px) - 2 * var(--grid-pad) - 11 * var(--grid-gap)) / 12 + 8 * var(--grid-gap))",zIndex:9999,opacity:ct(1-Pt),display:"flex",gap:"12px",pointerEvents:Pt>.5?"none":"auto"},children:[t.jsxs("button",{onClick:et,draggable:!1,onMouseEnter:()=>yt("design"),onMouseLeave:()=>yt(null),style:{display:"inline-flex",alignItems:"center",gap:"8px",background:ve==="design"?"#fff":"none",border:"1.5px solid #fff",borderRadius:"6px",padding:"14px 36px",cursor:"pointer",userSelect:"none",color:ve==="design"?"#000":"#fff",fontSize:"1.1rem",fontWeight:500,letterSpacing:"-0.02em",whiteSpace:"nowrap",transition:"background 0.2s, color 0.2s"},children:["설계 시작하기",t.jsx("span",{style:{fontSize:"0.75em",fontWeight:700,padding:"3px 8px",borderRadius:"3px",background:ve==="design"?"#000":"#fff",color:ve==="design"?"#fff":"#000",letterSpacing:"0.05em",lineHeight:1,transform:"translateY(1px)"},children:"BETA"})]}),t.jsx("button",{onClick:Ge,title:"스케치업 전용 루비(.rbz) 파일이 다운로드됩니다.",draggable:!1,onMouseEnter:()=>yt("download"),onMouseLeave:()=>yt(null),style:{background:ve==="download"?"#fff":"none",border:"1.5px solid #fff",borderRadius:"6px",padding:"14px 36px",cursor:"pointer",userSelect:"none",color:ve==="download"?"#000":"#fff",fontSize:"1.1rem",fontWeight:500,letterSpacing:"-0.02em",whiteSpace:"nowrap",transition:"background 0.2s, color 0.2s"},children:"Get SketchUp Extension"})]}),document.body)]}),t.jsx("div",{className:"cabinet-hover-area",style:{position:"absolute",top:0,bottom:0,left:0,right:0,zIndex:13,pointerEvents:"none"}})]})})}),!T&&t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:at,id:"pro-s1",style:{height:T?"400vh":"700vh",position:"relative",background:"#121212"},children:t.jsx("div",{style:{position:"sticky",top:0,height:"100vh",overflow:"hidden"},children:!f&&Kn.map((h,te)=>{const X=Jn(Tt,h.start,h.end),M=(1-X)*18,P=Math.max(4,Math.min(18,(St-1)*18));return t.jsxs("div",{style:{position:"absolute",...T?{left:"16px",right:"16px",top:"5%"}:{right:f?"6%":`${P}%`,top:"50%"},transform:T?`translateY(${M}px)`:`translateY(calc(-50% + ${M}
4px))`,maxWidth:T?"none":"clamp(260px, 28vw, 480px)",color:"#fff",zIndex:2,pointerEvents:"none",opacity:X,willChange:"opacity, transform",textAlign:T?"center":"left"},children:[t.jsx("p",{style:{margin:T?"0 0 12px 0":"0 0 18px 0",fontSize:T?"clamp(1.75rem, 7vw, 2.4rem)":f?"2rem":"3.2rem",fontWeight:700,lineHeight:1.2,letterSpacing:"-0.04em",whiteSpace:"pre-line",color:"#fff",textShadow:T?"0 2px 16px rgba(0,0,0,0.7)":"none"},children:h.title}),t.jsx("p",{style:{margin:0,fontSize:T?"clamp(0.95rem, 3.2vw, 1.1rem)":f?"1rem":"1.2rem",color:T?"rgba(255,255,255,0.92)":"rgba(255,255,255,0.65)",lineHeight:1.55,letterSpacing:"-0.02em",fontWeight:T?500:400,textShadow:T?"0 1px 10px rgba(0,0,0,0.6)":"none"},children:h.subtitle})]},te)})})}),t.jsx(so,{isNarrow:f}),t.jsx(ao,{isNarrow:f}),t.jsx(qn,{}),t.jsx(to,{}),t.jsx(no,{}),t.jsx(oo,{onStartDesign:et,onDownload:Ge,isMobile:T})]})]}),!T&&t.jsx(Qn,{}),t.jsxs("div",{style:{position:"fixed",inset:0,zIndex:10,perspective:"1200px",pointerEvents:"none"},children:[t.jsx("div",{ref:A,style:{position:"absolute",left:"50%",top:"50%",width:"100vw",height:"100vh",transformOrigin:"50% 50%",transform:T?"translate3d(-50%, -55%, 0) scale(1)":"translate3d(-50%, -50%, 0) scale(1)",backfaceVisibility:"visible"},children:Be&&t.jsx(Kr,{scrollProgress:0,showSlider:!f,sliderStyle:ft,darkBg:!1,darkSlider:!0,transparentSlider:!0,disableGhosts:T,drawingModeProgress:0,detailModeProgress:0,card4ZoomP:0,hideShadow:!1,initialWidthMm:zt,initialMode:ee,onWidthChange:je,onModeChange:Ct,heroAnimation:!0,doorTexturePath:_t,rotationPivot:w})}),t.jsx("div",{ref:ce,style:{position:"absolute",left:"50%",top:"50%",width:"100vw",height:"100vh",transformOrigin:"50% 50%",transform:T?"translate3d(-50%, -55%, 0) scale(1)":"translate3d(-50%, -50%, 0) scale(1)",opacity:0,visibility:"hidden",pointerEvents:"none",backfaceVisibility:"visible"},children:ne&&!T&&t.jsx(Kr,{scrollProgress:Dt,showSlider:!1,allowHoverShow:!1,darkBg:!0,darkSlider:!0,transparentSlider:!0,disableGhosts:!0,drawingModeProgress:Wt,detailModeProgress:st,card4ZoomP:ze,sceneRotationY:wt,worldOffset:Se,worldScale:J,hideShadow:!1,initialWidthMm:zt,initialMode:ee,heroAnimation:!1,doorTexturePath:_t,rotationPivot:w,interactionDisabled:!0})})]}),t.jsx(wn,{isOpen:oe,onClose:()=>G(!1)}),t.jsx(vn,{isOpen:gt,onClose:()=>Ft(!1),reason:dt?.approval_note}),Ut&&t.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[t.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>de(!1)}),t.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl max-w-md w-full mx-4 overflow-hidden animate-in fade-in zoom-in duration-200",children:[t.jsxs("div",{style:{background:"linear-gradient(135deg, #005F9E 0%, #0097E6 100%)",padding:"32px 24px 28px",textAlign:"center",color:"#fff"},children:[t.jsx("img",{src:"/images/brand/sketchup-logo.png",alt:"SketchUp",style:{height:"38px",width:"auto",display:"block",margin:"0 auto 14px",filter:"brightness(0) invert(1)"},draggable:!1}),t.jsx("div",{style:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"4px 12px",background:"rgba(255,255,255,0.18)",borderRadius:"999px",fontSize:"12px",fontWeight:700,letterSpacing:"0.08em",marginBottom:"8px"},children:"EXCLUSIVE EXTENSION"}),t.jsxs("h3",{style:{margin:0,fontSize:"20px",fontWeight:800,letterSpacing:"-0.02em",lineHeight:1.3},children:["SketchUp에서",t.jsx("br",{}),"Wedraw Pro를 사용해보세요"]})]}),t.jsxs("div",{style:{padding:"24px"},children:[t.jsxs("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:"14px"},children:[t.jsxs("li",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[t.jsx("div",{style:{flexShrink:0,width:28,height:28,borderRadius:"50%",background:"#E0F2FE",color:"#0369A1",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:800},children:"1"}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"15px",fontWeight:700,color:"#111827",marginBottom:"2px"},children:"확장 프로그램 설치 (30초)"}),t.jsxs("div",{style:{fontSize:"13px",color:"#6B7280",lineHeight:1.55},children:[".rbz 파일 다운로드 후 SketchUp에서 Extension Manager로 로드",t.jsx("span",{style:{display:"inline-block",marginLeft:"6px",padding:"1px 7px",background:"#FEF3C7",color:"#92400E",fontSize:"11px",fontWeight:700,borderRadius:"4px",letterSpacing:"-0.01em"},children:"PC 전용"})]})]})]}
4),t.jsxs("li",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[t.jsx("div",{style:{flexShrink:0,width:28,height:28,borderRadius:"50%",background:"#E0F2FE",color:"#0369A1",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:800},children:"2"}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"15px",fontWeight:700,color:"#111827",marginBottom:"2px"},children:"설계한 가구를 SketchUp에서 바로 불러오기"}),t.jsx("div",{style:{fontSize:"13px",color:"#6B7280",lineHeight:1.55},children:"위드로우에서 구성한 내용이 스케치업 씬에 즉시 반영"})]})]}),t.jsxs("li",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[t.jsx("div",{style:{flexShrink:0,width:28,height:28,borderRadius:"50%",background:"#E0F2FE",color:"#0369A1",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:800},children:"3"}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"15px",fontWeight:700,color:"#111827",marginBottom:"2px"},children:"발주 도면(.pdf) 다운로드"}),t.jsx("div",{style:{fontSize:"13px",color:"#6B7280",lineHeight:1.55},children:"도면 스튜디오에서 원하는 형태로 설정해서 다운로드"})]})]})]}),t.jsx("button",{onClick:()=>de(!1),style:{width:"100%",minHeight:"48px",marginTop:"20px",padding:"12px 20px",background:"#111827",color:"#fff",border:"none",borderRadius:"12px",fontSize:"16px",fontWeight:700,letterSpacing:"-0.01em",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:"확인"})]})]})]}),Lt&&t.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[t.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>It(!1)}),t.jsxs("div",{className:"relative bg-white rounded-2xl shadow-xl max-w-md w-full mx-4 p-8 animate-in fade-in zoom-in duration-200",children:[t.jsx("div",{className:"flex justify-center mb-6",children:t.jsx("img",{src:"/images/brand/sketchup-logo.png",alt:"SketchUp",style:{height:"40px",width:"auto",display:"block"},draggable:!1})}),t.jsxs("div",{className:"text-center",children:[t.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-3",children:"SketchUp에서 사용해 보세요"}),t.jsxs("p",{className:"text-gray-600 leading-relaxed",children:["다운로드한 .rbz 파일을 SketchUp",t.jsx("br",{}),"확장 프로그램으로 등록하시면 됩니다."]}),t.jsx("p",{style:{marginTop:"16px",fontSize:"14px",color:"#2563eb",letterSpacing:"-0.01em",fontWeight:500},children:"* 지원 버전: SketchUp 2021 ~ 2026"})]}),t.jsx("div",{className:"mt-8",children:t.jsx("button",{onClick:()=>It(!1),className:"w-full py-3 px-4 bg-[#111827] hover:bg-[#1f2937] text-white font-semibold rounded-lg transition-colors cursor-pointer",children:"확인"})})]})]})]})}function Qn(){const i={color:"rgba(255,255,255,0.88)",fontWeight:600},n={color:"rgba(255,255,255,0.22)",margin:"0 6px"},_={width:"36px",height:"36px",borderRadius:"50%",background:"rgba(255,255,255,0.08)",display:"flex",alignItems:"center",justifyContent:"center",color:"rgba(255,255,255,0.85)",transition:"background 0.2s"};return t.jsx("footer",{style:{background:"#0a0a0a",padding:"clamp(48px, 7vh, 72px) clamp(24px, 6vw, 64px)",borderTop:"1px solid rgba(255,255,255,0.08)",fontFamily:"'Helvetica Neue', Arial, sans-serif"},children:t.jsxs("div",{style:{maxWidth:"1400px",margin:"0 auto"},children:[t.jsx("div",{style:{marginBottom:"28px"},children:t.jsx("img",{src:"/images/brand/wedraw-b.png",alt:"WEDRAW",style:{height:"24px",width:"auto",filter:"brightness(0) invert(1)",display:"block"},draggable:!1})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"space-between",alignItems:"flex-start",gap:"40px",color:"rgba(255,255,255,0.58)",fontSize:"15px",lineHeight:1.75},children:[t.jsxs("div",{style:{minWidth:"280px"},children:[t.jsx("p",{style:{margin:0,...i},children:"이비오(주)"}),t.jsxs("p",{style:{margin:0},children:[t.jsx("span",{style:i,children:"대표자"})," 윤진원",t.jsx("span",{style:n,children:"|"}),t.jsx("span",{style:i,children:"사업자등록번호"})," 372-81-02047",t.jsx("span",{style:n,children:"|"}),t.jsx("span",{style:i,children:"통신판매신고번호"})," 제2024-대전동구-0450호"]}),t.jsxs("p",{style:{margin:0},children:[t.jsx("span",{style:i,children:"주소"})," 대전광역시 동구 물류로14번길 73-19 (구도동)"]}),t.jsxs("div",{style:{marginTop:"20px",display:"flex",gap:"8px",alignItems:"center"},children:[t.jsx("a",{href:"https://cx.wedraw.kr/f2b9a305-0b23-4cd1-9430-7c0d5a724d6c",target:"_blank",rel:"noopener noreferrer",style:{color:"rgba(255,255,255,0.58)",textDecoration:"none"},onMouseEnter:d=>{d.currentTarget.style.color="rgba(255,255,255,0.95)"},onMouseLeave:d=>{d.currentTarget.style.color="rgba(255,255,255,0.58)"},children:"개인정보처리방침"}),t.jsx("span",{style:{color:"rgba(255,255,255,0.22)"},children:"|"}),t.jsx("a",{href:"https://cx.wedraw.kr/c62f9d6c-e1c0-485c-93d4-6e675784d319",target:"_blank",rel:"noopener noreferrer",style:{color:"rgba(255,255,255,0.58)",textDecoration:"none"},onMouseEnter:d=>{d.currentTarget.style.color="rgba(255,255,255,0.95)"},onMouseLeave:d=>{d.currentTarget.style.color="rgba(255,255,255,0.58)"},children:"사이트 이용 약관"})]}),t.jsx("p",{style:{margin:"12px 0 0 0",color:"rgba(255,255,255,0.4)"},children:"© 2025, EVIO inc. All rights reserved."})]}),t.jsxs("div",{children:[t.jsx("p",{style:{margin:0,...i},children:"고객센터"}),t.jsx("p",{style:{margin:0,color:"#fff",fontSize:"26px",fontWeight:700,letterSpacing:"-0.01em",whiteSpace:"nowrap"},children:"1668-0984"}),t.jsx("p",{style:{margin:"4px 0 0 0",whiteSpace:"nowrap"},children:"평일 : 10:00~17:00 (주말,공휴일 휴무)"}),t.jsx("p",{style:{margin:0,whiteSpace:"nowrap"},children:"점심시간: 12:00 ~ 13:00"}),t.jsx("a",{href:"https://wedraw.channel.io",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",marginTop:"14px",padding:"10px 32px",background:"transparent",color:"rgba(255,255,255,0.9)",border:"1px solid rgba(255,255,255,0.25)",borderRadius:"8px",fontWeight:500,fontSize:"14px",textDecoration:"none",transition:"background 0.2s, border-color 0.2s"},onMouseEnter:d=>{d.currentTarget.style.background="rgba(255,255,255,0.08)",d.currentTarget.style.borderColor="rgba(255,255,255,0.45)"},onMouseLeave:d=>{d.currentTarget.style.background="transparent",d.currentTarget.style.borderColor="rgba(255,255,255,0.25)"},children:"채팅 상담"}),t.jsxs("div",{style:{display:"flex",gap:"10px",marginTop:"14px"},children:[t.jsx("a",{href:"https://blog.naver.com/wedraw_official",target:"_blank",rel:"noopener noreferrer",style:_,onMouseEnter:d=>{d.currentTarget.style.background="rgba(255,255,255,0.18)"},onMouseLeave:d=>{d.currentTarget.style.background="rgba(255,255,255,0.08)"},children:t.jsxs("svg",{style:{width:"20px",height:"20px"}
4,viewBox:"0 0 24 24",fill:"currentColor",children:[t.jsx("path",{d:"M3 2C1.34 2 0 3.34 0 5v11c0 1.66 1.34 3 3 3h6l3 3 3-3h6c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3H3z"}),t.jsx("text",{x:"12",y:"13",textAnchor:"middle",fill:"#0a0a0a",fontSize:"6",fontWeight:"bold",fontFamily:"Arial, sans-serif",children:"blog"})]})}),t.jsx("a",{href:"https://www.youtube.com/@wedraw.official",target:"_blank",rel:"noopener noreferrer",style:_,onMouseEnter:d=>{d.currentTarget.style.background="rgba(255,255,255,0.18)"},onMouseLeave:d=>{d.currentTarget.style.background="rgba(255,255,255,0.08)"},children:t.jsx("svg",{style:{width:"20px",height:"20px"},fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M19.615 3.184c-3.604-.246-11.631-.245-15.23 0-3.897.266-4.356 2.62-4.385 8.816.029 6.185.484 8.549 4.385 8.816 3.6.245 11.626.246 15.23 0 3.897-.266 4.356-2.62 4.385-8.816-.029-6.185-.484-8.549-4.385-8.816zm-10.615 12.816v-8l8 3.993-8 4.007z"})})}),t.jsx("a",{href:"https://www.instagram.com/wedraw.official/",target:"_blank",rel:"noopener noreferrer",style:_,onMouseEnter:d=>{d.currentTarget.style.background="rgba(255,255,255,0.18)"},onMouseLeave:d=>{d.currentTarget.style.background="rgba(255,255,255,0.08)"},children:t.jsxs("svg",{style:{width:"20px",height:"20px"},fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:[t.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"5",ry:"5"}),t.jsx("circle",{cx:"12",cy:"12",r:"4"}),t.jsx("circle",{cx:"18",cy:"6",r:"1.5",fill:"currentColor"})]})})]})]})]})]})})}function Zn(i){const[n,_]=e.useState(0);return e.useEffect(()=>{let d=null,x=-1;const L=()=>
4{if(d=null,!i.current)return;const q=window.innerHeight,w=i.current.getBoundingClientRect(),z=Math.max(1,w.height-q),A=Math.max(0,Math.min(1,-w.top/z));(Math.abs(A-x)>.003||A===0||A===1)&&(x=A,_(A))},B=()=>{d===null&&(d=requestAnimationFrame(L))};return window.addEventListener("scroll",B,{passive:!0}),window.addEventListener("resize",B,{passive:!0}),L(),()=>{window.removeEventListener("scroll",B),window.removeEventListener("resize",B),d!==null&&cancelAnimationFrame(d)}},[i]),n}function jr(i){const[n,_]=e.useState(0);return e.useEffect(()=>{let d=null,x=-1;const L=()=>{if(d=null,!i.current)return;const q=window.innerHeight,w=i.current.getBoundingClientRect(),z=Math.max(0,Math.min(1,(q-w.top)/q));(Math.abs(z-x)>.005||z===0||z===1)&&(x=z,_(z))},B=()=>{d===null&&(d=requestAnimationFrame(L))};return window.addEventListener("scroll",B,{passive:!0}),window.addEventListener("resize",B,{passive:!0}),L(),()=>{window.removeEventListener("scroll",B),window.removeEventListener("resize",B),d!==null&&cancelAnimationFrame(d)}},[i]),n}function qn(){const i=e.useRef(null),[n,_]=e.useState(0),d=["/pro_2.mp4","/pro_3.mp4"],[x,L]=e.useState(0),B=e.useRef(null);e.useEffect(()=>{const z=B.current;if(!z)return;z.load(),(()=>{z.play().catch(()=>{})})()},[x]),e.useEffect(()=>{let z=null,A=-1;const Be=()=>{if(z=null,!i.current)return;const at=window.innerHeight,ce=i.current.getBoundingClientRect(),ne=Math.max(0,Math.min(1,(at-ce.top)/at));(Math.abs(ne-A)>.005||ne===0||ne===1)&&(A=ne,_(ne))},re=()=>{z===null&&(z=requestAnimationFrame(Be))};return window.addEventListener("scroll",re,{passive:!0}),window.addEventListener("resize",re,{passive:!0}),Be(),()=>{window.removeEventListener("scroll",re),window.removeEventListener("resize",re),z!==null&&cancelAnimationFrame(z)}},[]);const w=(z=>{const A=Math.max(0,Math.min(1,z));return A*A*(3-2*A)})(n);return t.jsx("div",{ref:i,style:{height:"150vh",position:"relative",background:"#0a0a0a"},children:t.jsxs("div",{style:{position:"sticky",top:0,height:"100vh",overflow:"hidden"},children:[t.jsx("div",{style:{position:"absolute",inset:0,background:"#1a1a1a",overflow:"hidden",transform:`scale(${1.04-w*.04})`,opacity:w,willChange:"transform, opacity"},children:t.jsx("video",{ref:B,src:d[x],autoPlay:!0,muted:!0,playsInline:!0,onEnded:()=>L(z=>(z+1)%d.length),style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}},x)}),t.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(180deg, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.25) 35%, rgba(0,0,0,0.25) 65%, rgba(0,0,0,0.72) 100%)",pointerEvents:"none"}}),t.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"0 6vw",textAlign:"center",opacity:w,transform:`translateY(${(1-w)*24}px)`},children:[t.jsx("div",{style:{fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(16px, 1.4vw, 22px)",fontWeight:700,letterSpacing:"0.3em",color:"#fff",marginBottom:"clamp(20px, 2.4vh, 28px)"},children:"CONNECTED WORKFLOW"}),t.jsx("h2",{style:{margin:0,fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(2.8rem, 7vw, 6.4rem)",fontWeight:700,color:"#fff",letterSpacing:"-0.04em",lineHeight:1},children:"새로운 툴은 필요 없습니다"}),t.jsxs("p",{style:{margin:"clamp(20px, 2.4vh, 32px) 0 0",fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(1.2rem, 1.5vw, 1.75rem)",color:"rgba(255,255,255,0.95)",letterSpacing:"-0.015em",lineHeight:1.5,fontWeight:500},children:["위드로우에서 설계한 내용 그대로,",t.jsx("br",{}),"스케치업에서 바로 3D로 불러옵니다."]})]})]})})}const eo=[{tag:"INTERIOR",title:"인테리어 업체 대표님",tagline:["가구 내부까지","상세하게 보여드리세요"],desc:"제작 가능한 설계 안에서만 구성되어, 확정과 동시에 발주로 바로 이어집니다.",accent:"#A8B89A",img:"/realtime-design.webp"},{tag:"FACTORY",title:"가구 공장 대표님",tagline:["정제된 도면이","그대로 들어옵니다"],desc:"반복되는 설계 작업 시간을 줄이고, 제작에 더 집중할 수 있습니다.",accent:"#C4A882",img:"/가구공장.webp"}];function to(){const i=e.useRef(null),n=jr(i),_=x=>{const L=Math.max(0,Math.min(1,x));return L*L*(3-2*L)},d=_(n);return t.jsxs("div",{ref:i,style:{padding:"14vh 3vw 16vh",background:"#0a0a0a"},children:[t.jsxs("div",{style:{textAlign:"center",opacity:d,transform:`translateY(${(1-d)*24}px)`,marginBottom:"clamp(40px, 6vh, 64px)"},children:[t.jsx("div",{style:{fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(16px, 1.4vw, 22px)",fontWeight:700,letterSpacing:"0.3em",color:"#fff",marginBottom:"clamp(20px, 2.4vh, 28px)"},children:"WHO USES WEDRAW PRO"}),t.jsxs("h2",{style:{margin:0,fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(2.2rem, 5vw, 4.6rem)",fontWeight:700,color:"#fff",letterSpacing:"-0.04em",lineHeight:1.08},children:["당신이 잘하는 일에",t.jsx("br",{}),"집중하도록"]}),t.jsx("p",{style:{margin:"clamp(20px, 2.4vh, 28px) auto 0",maxWidth:"540px",fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(1rem, 1.2vw, 1.25rem)",color:"rgba(255,255,255,0.62)",letterSpacing:"-0.015em",lineHeight:1.6,fontWeight:500},children:"반복되는 시간 소모를 줄이고, 필요한 곳에 더 집중하세요!"})]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(420px, 1fr))",gap:"clamp(20px, 2.4vw, 40px)",maxWidth:"1800px",margin:"0 auto"},children:eo.map((x,L)=>{const B=Math.max(0,n-L*.08),q=_(Math.min(1,B*1.5));return t.jsxs("div",{style:{opacity:q,transform:`translateY(${(1-q)*30}px)`,position:"relative",borderRadius:"16px",overflow:"hidden",aspectRatio:"5 / 4",background:"#141414"},children:[t.jsx("img",{src:x.img,alt:x.title,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",filter:"saturate(0.9) brightness(0.68)"}}),t.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(180deg, rgba(10,10,10,0.15) 0%, rgba(10,10,10,0) 30%, rgba(10,10,10,0.92) 95%)"}}),t.jsxs("div",{style:{position:"absolute",left:0,right:0,top:"52%",bottom:0,padding:"clamp(32px, 4vh, 48px) clamp(32px, 3.4vw, 44px)",display:"flex",flexDirection:"column",justifyContent:"flex-start"},children:[t.jsx("div",{style:{fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(14px, 1.05vw, 16px)",fontWeight:700,letterSpacing:"0.3em",color:"rgba(255,255,255,0.88)",marginBottom:"14px"},children:x.tag}),t.jsx("div",{style:{fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(1.3rem, 1.55vw, 1.6rem)",fontWeight:500,color:"rgba(255,255,255,0.85)",letterSpacing:"-0.015em",marginBottom:"18px"},children:x.title}),t.jsx("div",{style:{fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(1.75rem, 2.4vw, 2.4rem)",fontWeight:700,color:"#fff",letterSpacing:"-0.03em",lineHeight:1.25,marginBottom:"20px"},children:x.tagline.map((w,z)=>t.jsx("span",{style:{display:"block"},children:w},z))}),t.jsx("div",{style:{fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(1.1rem, 1.25vw, 1.3rem)",fontWeight:500,color:"rgba(255,255,255,0.92)",letterSpacing:"-0.015em",lineHeight:1.6},children:x.desc})]})]},x.tag)})})]})}const ro=[{value:80,suffix:"%",label:"설계 시간 단축"},{value:95,suffix:"%",label:"제작 오류 감소"}];function no(){const i=e.useRef(null),n=jr(i),_=w=>{const z=Math.max(0,Math.min(1,w));return z*z*(3-2*z)},[d,x]=e.useState(()=>typeof window<"u"?window.scrollY:0);e.useEffect(()=>{let w=0;const z=()=>{w||(w=requestAnimationFrame(()=>{x(window.scrollY),w=0}))};return window.addEventListener("scroll",z,{passive:!0}),()=>{window.removeEventListener("scroll",z),w&&cancelAnimationFrame(w)}},[]);const L=(d*.005%50+50)%50,[B,q]=e.useState(0);return e.useEffect(()=>{const w=i.current;if(!w)return;let z=!1;const A=()=>
4{const at=performance.now(),ce=ut=>{if(z)return;const ne=Math.min(1,(ut-at)/2e3);q(ne*ne*(3-2*ne)),ne<1&&requestAnimationFrame(ce)};requestAnimationFrame(ce)},Be=new IntersectionObserver(re=>{re.some(at=>at.isIntersecting)&&(Be.disconnect(),A())},{threshold:.3});return Be.observe(w),()=>{z=!0,Be.disconnect()}},[]),t.jsxs("div",{ref:i,style:{minHeight:"100vh",background:"#0a0a0a",position:"relative",display:"flex",flexDirection:"column"},children:[t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",padding:"14vh 6vw clamp(380px, 40vh, 480px)"},children:[t.jsxs("div",{style:{textAlign:"center",marginBottom:"clamp(60px, 8vh, 96px)",opacity:_(n),transform:`translateY(${(1-_(n))*24}px)`},children:[t.jsx("div",{style:{fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(16px, 1.4vw, 22px)",fontWeight:700,letterSpacing:"0.3em",color:"#fff",marginBottom:"clamp(20px, 2.4vh, 28px)"},children:"BY THE NUMBERS"}),t.jsxs("h2",{style:{margin:0,fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(2.2rem, 5vw, 4.6rem)",fontWeight:700,color:"#fff",letterSpacing:"-0.04em",lineHeight:1.08},children:["설계는 빠르게,",t.jsx("br",{}),"제작은 정확하게"]}),t.jsx("p",{style:{margin:"clamp(20px, 2.4vh, 28px) auto 0",maxWidth:"560px",fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(1rem, 1.2vw, 1.25rem)",color:"rgba(255,255,255,0.62)",letterSpacing:"-0.015em",lineHeight:1.6,fontWeight:500},children:"위드로우 프로가 만든 변화입니다."})]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:"48px",maxWidth:"1200px",margin:"0 auto",textAlign:"center"},children:ro.map((w,z)=>{const A=Math.max(0,n-z*.05),Be=_(Math.min(1,A*1.5)),re=Math.round(w.value*B);return t.jsxs("div",{style:{opacity:Be,transform:`translateY(${(1-Be)*30}px)`},children:[t.jsxs("div",{style:{fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(5rem, 9vw, 9rem)",fontWeight:700,color:"#fff",letterSpacing:"-0.04em",lineHeight:1,marginBottom:"20px",fontVariantNumeric:"tabular-nums"},children:[re,t.jsx("span",{style:{color:"#22E36B"},children:w.suffix})]}),t.jsx("div",{style:{fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(1.1rem, 1.25vw, 1.3rem)",fontWeight:500,color:"rgba(255,255,255,0.78)",letterSpacing:"-0.015em"},children:w.label})]},z)})})]}),t.jsx("div",{style:{overflow:"hidden",padding:"18px 0",opacity:_(n)},children:t.jsx("div",{style:{display:"inline-flex",transform:`translateX(-${L}%)`,willChange:"transform",whiteSpace:"nowrap"},children:[0,1].map(w=>t.jsx("div",{style:{display:"inline-flex",alignItems:"center"},"aria-hidden":w===1,children:Array.from({length:8}).map((z,A)=>t.jsx("span",{style:{display:"inline-block",fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(3rem, 6vw, 6.5rem)",fontWeight:800,letterSpacing:"-0.02em",color:"#22E36B",padding:"0 clamp(40px, 4.5vw, 72px)",textTransform:"uppercase"},children:"EASY TO BUILD"},A))},w))})})]})}function oo({onStartDesign:i,onDownload:n,isMobile:_=!1}){const d=e.useRef(null),x=jr(d),[L,B]=e.useState(null),w=(z=>{const A=Math.max(0,Math.min(1,z));return A*A*(3-2*A)})(x);return t.jsx("div",{ref:d,style:{minHeight:"100vh",background:"#000",position:"relative",display:"flex",alignItems:"flex-start",justifyContent:"center",overflow:"hidden",padding:"40vh 6vw 10vh"},children:t.jsxs("div",{style:{textAlign:"center",position:"relative",zIndex:1,maxWidth:"1000px"},children:[t.jsx("div",{style:{fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(16px, 1.4vw, 22px)",fontWeight:700,letterSpacing:"0.3em",color:"#22E36B",marginBottom:"clamp(20px, 2.4vh, 28px)",opacity:w,transform:`translateY(${(1-w)*20}px)`},children:"READY TO START"}),t.jsx("h2",{style:{margin:0,fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(2.2rem, 5vw, 4.6rem)",fontWeight:700,color:"#fff",letterSpacing:"-0.04em",lineHeight:1.08,opacity:w,transform:`translateY(${(1-w)*30}px)`},children:"지금, 시작하세요"}),t.jsx("p",{style:{margin:"clamp(20px, 2.4vh, 28px) auto clamp(44px, 6vh, 64px)",maxWidth:"560px",fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:"clamp(1rem, 1.2vw, 1.25rem)",fontWeight:500,color:"rgba(255,255,255,0.62)",letterSpacing:"-0.015em",lineHeight:1.6,opacity:w,transform:`translateY(${(1-w)*24}px)`}
4,children:"가구 설계부터 발주까지, 이제 하나의 플랫폼에서 쉽고 빠르게."}),t.jsxs("div",{style:{display:"flex",gap:"16px",justifyContent:"center",flexWrap:"wrap",opacity:w,transform:`translateY(${(1-w)*20}px)`},children:[t.jsxs("button",{onClick:i,onMouseEnter:()=>B("primary"),onMouseLeave:()=>B(null),style:{display:"inline-flex",alignItems:"center",gap:"10px",padding:"20px 48px",fontSize:"1.2rem",fontWeight:600,color:"#000",background:L==="primary"?"#22E36B":"#fff",border:"none",borderRadius:"8px",cursor:"pointer",letterSpacing:"-0.02em",transition:"background 0.2s ease, transform 0.15s ease",transform:L==="primary"?"translateY(-2px)":"translateY(0)",boxShadow:L==="primary"?"0 12px 32px rgba(34,227,107,0.35)":"0 4px 16px rgba(255,255,255,0.1)"},children:["설계 시작하기",t.jsx("span",{style:{fontSize:"0.72em",fontWeight:700,padding:"3px 8px",borderRadius:"3px",background:"#000",color:"#fff",letterSpacing:"0.05em",lineHeight:1,transform:"translateY(1px)"},children:"BETA"})]}),!_&&t.jsx("button",{onClick:n,onMouseEnter:()=>B("ghost"),onMouseLeave:()=>B(null),style:{padding:"20px 48px",fontSize:"1.2rem",fontWeight:500,color:"#fff",background:L==="ghost"?"rgba(255,255,255,0.1)":"transparent",border:"1.5px solid rgba(255,255,255,0.35)",borderRadius:"8px",cursor:"pointer",letterSpacing:"-0.02em",transition:"background 0.2s ease, transform 0.15s ease",transform:L==="ghost"?"translateY(-2px)":"translateY(0)"},children:"Get SketchUp Extension"})]})]})})}function so({isNarrow:i}){const n=e.useRef(null),_=Zn(n),d=Be=>{const re=Math.max(0,Math.min(1,Be));return re*re*(3-2*re)},x=Be=>Math.max(0,Math.min(1,Be)),L=18+d(_)*242,B=_<.06?0:x((_-.06)/.24)*.58,q=L*B,w=Math.min(d(x((_-.1)/.12)),d(x((.55-_)/.1))),z=Math.min(d(x((_-.52)/.12)),d(x((.94-_)/.1))),A=d(x((1-_)/.08));return t.jsx("div",{ref:n,style:{height:"500vh",position:"relative",background:"#000"},children:t.jsxs("div",{style:{position:"sticky",top:0,height:"100vh",width:"100%",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx("div",{style:{position:"absolute",width:`${L}vmin`,height:`${L}vmin`,borderRadius:"50%",background:"#22E36B",opacity:A,willChange:"width, height"}}),t.jsx("div",{style:{position:"absolute",width:`${q}vmin`,height:`${q}vmin`,borderRadius:"50%",background:"#000",opacity:A,willChange:"width, height"}}),t.jsxs("div",{style:{position:"absolute",zIndex:2,textAlign:"center",maxWidth:"80vw",opacity:w,transform:`translateY(${(1-w)*16}px)`},children:[t.jsxs("div",{style:{display:"flex",alignItems:"flex-end",justifyContent:"center",gap:i?"12px":"18px",marginBottom:"32px"},children:[t.jsx("img",{src:"/images/brand/wedraw-b.png",alt:"WEDRAW",style:{height:i?"44px":"64px",width:"auto",display:"block",filter:"brightness(0) invert(1)"}}),t.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:i?"6px 14px":"10px 22px",marginBottom:i?"8px":"14px",background:"#22E36B",color:"#000",borderRadius:"999px",fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:i?"18px":"28px",fontWeight:800,letterSpacing:"0.02em",lineHeight:1},children:"Pro"})]}),t.jsxs("div",{style:{fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:i?"2.2rem":"3.6rem",fontWeight:700,color:"#fff",lineHeight:1.15,letterSpacing:"-0.04em"},children:["설계 그대로,",t.jsx("br",{}),"제품이 됩니다"]})]}),t.jsxs("div",{style:{position:"absolute",zIndex:2,textAlign:"center",maxWidth:"80vw",opacity:z,transform:`translateY(${(1-z)*16}px)`},children:[t.jsxs("div",{style:{display:"flex",alignItems:"flex-end",justifyContent:"center",gap:i?"10px":"14px",marginBottom:"32px"},children:[t.jsx("img",{src:"/images/brand/wedraw-b.png",alt:"WEDRAW",style:{height:i?"44px":"64px",width:"auto",display:"block",filter:"brightness(0) invert(1)"}}),t.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:i?"6px 14px":"10px 22px",marginBottom:i?"8px":"14px",background:"#22E36B",color:"#000",borderRadius:"999px",fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:i?"18px":"28px",fontWeight:800,letterSpacing:"0.02em",lineHeight:1},children:"Pro"})]}),t.jsxs("div",{style:{fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:i?"2.2rem":"3.6rem",fontWeight:700,color:"#fff",lineHeight:1.15,letterSpacing:"-0.04em"},children:["가구 제작의",t.jsx("br",{}),"새로운 표준"]}),t.jsx("div",{style:{marginTop:"20px",fontSize:i?"1rem":"1.1rem",color:"rgba(255,255,255,0.65)",letterSpacing:"-0.02em"},children:"위드로우 프로가 만드는 새로운 방식"})]})]})})}function ao({isNarrow:i}){const n=e.useRef(null),_=jr(n),x=(L=>{const B=Math.max(0,Math.min(1,L));return B*B*(3-2*B)})(_);return t.jsxs("div",{ref:n,style:{height:"100vh",position:"relative",overflow:"hidden",background:"#000"},children:[t.jsx("video",{src:"/pro_1.mp4",autoPlay:!0,muted:!0,loop:!0,playsInl
4ine:!0,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",opacity:.78,transform:`scale(${1.04-x*.04})`,filter:"saturate(0.9) brightness(0.72) contrast(1.05)",willChange:"transform"}}),t.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 40%, rgba(0,0,0,0.25) 70%, rgba(0,0,0,0.65) 100%)"}}),t.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",padding:"0 6vw",textAlign:"center",opacity:x,transform:`translateY(${(1-x)*20}px)`},children:[t.jsxs("h2",{className:"cpt-start-designing",style:{margin:0,fontFamily:"'Helvetica Neue', Arial, sans-serif",fontWeight:700,fontSize:i?"clamp(3rem, 13vw, 4.2rem)":"clamp(4.5rem, 10vw, 10rem)",letterSpacing:"-0.045em",lineHeight:.92},children:[t.jsx("span",{className:"cpt-shine","data-text":"START",children:"START"}),t.jsx("br",{}),t.jsx("span",{className:"cpt-shine","data-text":"DESIGNING",children:"DESIGNING"})]}),t.jsx("div",{style:{marginTop:i?"32px":"44px",width:i?"52px":"64px",height:i?"52px":"64px",borderRadius:"50%",background:"#fff",display:"flex",alignItems:"center",justifyContent:"center",animation:"bounce 2.4s ease-in-out infinite",boxShadow:"0 6px 24px rgba(0,0,0,0.35)"},children:t.jsx("svg",{width:i?20:24,height:i?24:28,viewBox:"0 0 18 22",fill:"none",children:t.jsx("path",{d:"M9 1V20M9 20L2 13M9 20L16 13",stroke:"#0a0a0a",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsxs("p",{style:{margin:i?"28px 0 0":"40px 0 0",fontFamily:"'Helvetica Neue', Arial, sans-serif",fontSize:i?"1.35rem":"1.75rem",fontWeight:500,color:"rgba(255,255,255,0.95)",letterSpacing:"-0.015em",lineHeight:1.5},children:["가구 설계를 지금 바로,",t.jsx("br",{}),"한 플랫폼 안에서 끝까지."]})]})]})}export{ho as default};

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.