PageSourceSearch

https://ai.engineer/_next/static/chunks/2151-0551204d29de21d6.js

js ai.engineer collected 2026-09-24 09:51:35 UTC 12,526 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2151],{12151:(e,t,n)=>{n.d(t,{_:()=>u,d:()=>d});var r=n(4930),l=n(65162),i=n(88049),o=n(67635),s=n(34763),a=n(53441);let c={entrance:"#16a34a",room:"#2563eb",booth:"#9333ea",amenity:"#0891b2",stairs:"#c2410c",elevator:"#c2410c",waypoint:"#6b7280"};function u(e){return c[e]??"#2563eb"}function d({level:e,nodes:t,edges:n,pathNodeIds:c=[],selectedNodeId:h=null,selectedEdgeId:f=null,editable:x=!1,interactive:p=!1,zoomable:m=!1,nodeOverlay:g,showLabels:b=!0,hideBaseEdges:y=!1,animatePath:v=!1,showGrid:w=!1,gridPx:j=24,showCompass:k=!1,onStageClick:M,onNodeClick:E,onNodeDrag:N,onEdgeClick:L,className:$}){let C=(0,l.useRef)(null),[Y,W]=(0,l.useState)({w:0,h:0}),[X,R]=(0,l.useState)(1),[S,z]=(0,l.useState)({x:0,y:0}),P=(0,l.useRef)(null),A=(0,l.useRef)(null),B=(0,l.useRef)(1),I=(0,l.useRef)({x:0,y:0}),D=(0,l.useRef)(!1),_=p||m,[H,O]=(0,l.useState)(null);(0,l.useEffect)(()=>{let e=C.current;if(!e)return;let t=()=>W({w:e.clientWidth,h:e.clientHeight});t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,l.useEffect)(()=>{B.current=X},[X]),(0,l.useEffect)(()=>{I.current=S},[S]),(0,l.useEffect)(()=>{R(1),z({x:0,y:0})},[e.id]);let U=(0,l.useMemo)(()=>(function(e,t,n,r,l,i=0){if(!e||!t||!n||!r)return null;let o=n/r,s=l*Math.PI/180,a=Math.abs(Math.cos(s)),c=Math.abs(Math.sin(s)),u=Math.min((e-2*i)/(o*a+c),(t-2*i)/(o*c+a)),d=o*u,h=d*a+u*c,f=d*c+u*a;return{fw:h,fh:f,uw:d,uh:u,left:(e-h)/2,top:(t-f)/2,centerX:e/2,centerY:t/2}})(Y.w,Y.h,e.naturalWidth,e.naturalHeight,e.rotation,16),[Y,e.naturalWidth,e.naturalHeight,e.rotation]),G=(0,l.useMemo)(()=>{let e=new Set;for(let t=0;t+1<c.length;t++)e.add(`${c[t]}::${c[t+1]}`),e.add(`${c[t+1]}::${c[t]}`);return e},[c]),Z=(0,l.useMemo)(()=>{let n=[],r=[];for(let l of c){let i=t.find(e=>e.id===l);i&&i.levelId===e.id?r.push({x:100*i.x,y:100*i.y}):(r.length>1&&n.push(r),r=[])}return r.length>1&&n.push(r),n},[c,t,e.id]),Q=(0,l.useMemo)(()=>{if(!U||!h)return null;let n=t.find(t=>t.id===h&&t.levelId===e.id);if(!n)return null;let r=(n.x-.5)*U.uw,l=(n.y-.5)*U.uh,i=e.rotation*Math.PI/180,o=Math.cos(i),s=Math.sin(i);return{x:U.centerX+S.x+(r*o-l*s)*X,y:U.centerY+S.y+(r*s+l*o)*X}},[U,h,t,e.id,e.rotation,X,S]),T=(0,l.useCallback)((t,n)=>{let r=C.current;if(!r||!U)return null;let l=r.getBoundingClientRect(),i=t-l.left-U.centerX-S.x,o=n-l.top-U.centerY-S.y,s=i/X,a=o/X,c=-e.rotation*Math.PI/180,u=Math.cos(c),d=Math.sin(c);return{x:(s*u-a*d)/U.uw+.5,y:(s*d+a*u)/U.uh+.5}},[U,e.rotation,X,S]),q=(0,l.useCallback)(e=>{if(D.current){D.current=!1;return}if(!x||!M)return;let t=T(e.clientX,e.clientY);!t||t.x<0||t.x>1||t.y<0||t.y>1||M(t)},[x,M,T]),F=(0,l.useCallback)((e,t,n)=>{let r=C.current;if(!r||!U)return;let l=Math.min(Math.max(e,1),8);if(1===l){R(1),z({x:0,y:0});return}let i=r.getBoundingClientRect(),o=(t??i.left+i.width/2)-i.left,s=(n??i.top+i.height/2)-i.top,a=o-U.centerX,c=s-U.centerY,u=B.current,d=I.current;R(l),z({x:a-(a-d.x)*l/u,y:c-(c-d.y)*l/u})},[U]),J=(0,l.useCallback)(e=>F(B.current*e),[F]),K=(0,l.useCallback)(()=>{R(1),z({x:0,y:0})},[]),V=(0,l.useCallback)(e=>{_&&(e.preventDefault(),F(B.current*Math.exp(-(.0015*e.deltaY)),e.clientX,e.clientY))},[_,F]);(0,l.useEffect)(()=>{let e=C.current;if(e&&_)return e.addEventListener("wheel",V,{passive:!1}),()=>e.removeEventListener("wheel",V)},[V,_]);let ee=(0,l.useRef)(null),et=(0,l.useRef)(null);(0,l.useEffect)(()=>{let e=C.current;if(!e||!_)return;let t=e=>Math.hypot(e[0].clientX-e[1].clientX,e[0].clientY-e[1].clientY),n=e=>{2===e.touches.length?(ee.current={dist:t(e.touches),scale:B.current},et.current=null):1===e.touches.length&&B.current>1&&(et.current={x:e.touches[0].clientX-I.current.x,y:e.touches[0].clientY-I.current.y})},r=e=>{if(2===e.touches.length&&ee.current){e.preventDefault();let n=(e.touches[0].clientX+e.touches[1].clientX)/2,r=(e.touches[0].clientY+e.touches[1].clientY)/2;F(ee.current.scale*t(e.touches)/ee.current.dist,n,r)}else 1===e.touches.length&&et.current&&(e.preventDefault(),D.current=!0,z({x:e.touches[0].clientX-et.current.x,y:e.touches[0].clientY-et.current.y}))},l=()=>{ee.current=null,et.current=null};return e.addEventListener("touchstart",n,{passive:!1}),e.addEventListener("touchmove",r,{passive:!1}),e.addEventListener("touchend",l),e.addEventListener("touchcancel",l),()=>{e.removeEventListener("touchstart",n),e.removeEventListener("touchmove",r),e.removeEventListener("touchend",l),e.removeEventListener("touchcancel",l)}},[_,F]);let en=()=>
1{if(P.current&&(P.current.active=!1),A.current){let e=A.current;setTimeout(()=>{A.current===e&&(A.current=null)},0)}},er=U?`translate(${S.x}px, ${S.y}px) scale(${X}) rotate(${e.rotation}deg)`:void 0;return(0,r.jsxs)("div",{ref:C,className:(0,a.cn)("relative h-full w-full overflow-hidden",$),style:{cursor:_&&X>1?"grab":x?"crosshair":"default",touchAction:"none"},onClick:q,onMouseDown:e=>{_&&!(X<=1)&&(P.current={active:!0,sx:e.clientX-S.x,sy:e.clientY-S.y})},onMouseMove:e=>{if(A.current&&x&&N){let t=T(e.clientX,e.clientY);t&&(A.current.moved=!0,N(A.current.id,{x:Math.min(1,Math.max(0,t.x)),y:Math.min(1,Math.max(0,t.y))}));return}P.current?.active&&(D.current=!0,z({x:e.clientX-P.current.sx,y:e.clientY-P.current.sy}))},onMouseUp:en,onMouseLeave:en,children:[U&&(0,r.jsxs)("div",{className:"absolute",style:{width:U.uw,height:U.uh,left:U.centerX-U.uw/2,top:U.centerY-U.uh/2,transform:er,transformOrigin:"center center"},children:[(0,r.jsx)("img",{src:e.image,alt:e.name,draggable:!1,className:"pointer-events-none absolute inset-0 h-full w-full select-none object-fill"}),w&&(0,r.jsxs)("svg",{className:"pointer-events-none absolute inset-0 h-full w-full",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:[(0,r.jsx)("defs",{children:(0,r.jsx)("pattern",{id:"map-grid",width:j/e.naturalWidth*100,height:j/e.naturalHeight*100,patternUnits:"userSpaceOnUse",children:(0,r.jsx)("path",{d:`M ${j/e.naturalWidth*100} 0 L 0 0 0 ${j/e.naturalHeight*100}`,fill:"none",stroke:"rgba(37,99,235,0.35)",strokeWidth:.15,vectorEffect:"non-scaling-stroke"})})}),(0,r.jsx)("rect",{x:0,y:0,width:100,height:100,fill:"url(#map-grid)"})]}),!y&&(0,r.jsx)("svg",{className:(0,a.cn)("absolute inset-0 h-full w-full",x&&L?"":"pointer-events-none"),viewBox:"0 0 100 100",preserveAspectRatio:"none",children:n.map(n=>{let l=t.find(e=>e.id===n.from),i=t.find(e=>e.id===n.to);if(!l||!i||l.levelId!==e.id||i.levelId!==e.id)return null;let o=G.has(`${l.id}::${i.id}`),s=n.id===f,a=x&&!!L;return(0,r.jsxs)("g",{children:[a&&(0,r.jsx)("line",{x1:100*l.x,y1:100*l.y,x2:100*i.x,y2:100*i.y,stroke:"transparent",strokeLinecap:"round",vectorEffect:"non-scaling-stroke",style:{strokeWidth:14,cursor:"pointer"},onClick:e=>{e.stopPropagation(),L(n.id,T(e.clientX,e.clientY)??void 0)}}),(0,r.jsx)("line",{x1:100*l.x,y1:100*l.y,x2:100*i.x,y2:100*i.y,stroke:s?"#f97316":o?"#2563eb":"rgba(37,99,235,0.45)",strokeLinecap:"round",vectorEffect:"non-scaling-stroke",className:"pointer-events-none",style:{strokeWidth:s?4:o?3:1.5}})]},n.id)})}),Z.length>0&&(0,r.jsxs)("svg",{className:"pointer-events-none absolute inset-0 h-full w-full",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:[(0,r.jsx)("defs",{children:(0,r.jsxs)("filter",{id:"map-route-glow",x:"-30%",y:"-30%",width:"160%",height:"160%",children:[(0,r.jsx)("feGaussianBlur",{stdDeviation:"1.4",result:"blur"}),(0,r.jsxs)("feMerge",{children:[(0,r.jsx)("feMergeNode",{in:"blur"}),(0,r.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})}),Z.map((e,t)=>{let n=e.map((e,t)=>`${0===t?"M":"L"} ${e.x} ${e.y}`).join(" "),l=`${Math.max(2,.7*e.length)}s`;return(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:n,fill:"none",stroke:"rgba(37,99,235,0.30)",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke",style:{strokeWidth:16}}),(0,r.jsx)("path",{d:n,fill:"none",stroke:"#2563eb",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke",style:{strokeWidth:7}}),v&&[{color:"#ffffff",dash:"38 62",w:7},{color:"rgba(191,219,254,0.75)",dash:"26 74",w:7},{color:"rgba(147,197,253,0.45)",dash:"15 85",w:7},{color:"rgba(96,165,250,0.2)",dash:"7 93",w:7}].map((e,t)=>(0,r.jsx)("path",{d:n,fill:"none",stroke:e.color,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke",pathLength:100,filter:"url(#map-route-glow)",style:{strokeWidth:e.w},strokeDasharray:e.dash,children:(0,r.jsx)("animate",{attributeName:"stroke-dashoffset",from:100,to:0,dur:l,repeatCount:"indefinite"})},t))]},t)})]}),t.filter(t=>t.levelId===e.id).filter(e=>!(y&&"waypoint"===e.type&&!c.includes(e.id))).map(t=>{let n=c.includes(t.id),l=c.length>0&&(t.id===c[0]||t.id===c[c.length-1]),i=t.id===h,o="waypoint"===t.type,s=o?null:t.icon||null,a=o?8:s?24:14,d=null===H||H===t.id;return(0,r.jsxs)("div",{className:"absolute",style:{left:`${100*t.x}%`,top:`${100*t.y}%`,transform:`scale(${1/X})`,transformOrigin:"0 0",zIndex:H===t.id?20:void 0},onMouseEnter:()=>!o&&O(t.id),onMouseLeave:()=>O(e=>e===t.id?null:e),children:[(0,r.jsx)("button",{type:"button",onMouseDown:e=>
1{x&&N&&(e.stopPropagation(),A.current={id:t.id,moved:!1})},onClick:e=>{e.stopPropagation(),A.current?.id===t.id&&A.current.moved||E?.(t.id)},className:"absolute flex -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full border-2 border-white shadow-md transition",style:{left:0,top:0,width:a,height:a,background:l?"#2563eb":t.color??u(t.type),outline:i?"2px solid #111":"none",outlineOffset:2,cursor:E?"pointer":"default",opacity:!(c.length>0)||n||o?1:.55},"aria-label":t.name,children:s&&(0,r.jsx)("span",{className:"material-icons",style:{fontSize:Math.round(.7*a),lineHeight:1,color:"#fff"},children:s})}),b&&!o&&d&&(0,r.jsx)("span",{className:"pointer-events-none absolute whitespace-nowrap rounded-full bg-white px-2 py-0.5 text-[11px] font-semibold leading-tight text-black shadow-[0_2px_6px_rgba(0,0,0,0.25)]",style:{left:0,top:a/2+5,transform:`translate(-50%, 0) rotate(${-e.rotation}deg)`,transformOrigin:"center top"},children:t.name})]},t.id)})]}),k&&U&&(0,r.jsx)("div",{className:"pointer-events-none absolute right-3 top-3 flex h-14 w-14 items-center justify-center rounded-full border border-black/10 bg-white/90 shadow-md backdrop-blur-sm",children:(0,r.jsxs)("svg",{viewBox:"0 0 40 40",className:"h-11 w-11",style:{transform:`rotate(${e.rotation+(e.north??0)}deg)`,transition:"transform 0.2s ease"},children:[[45,135,225,315].map(e=>(0,r.jsx)("line",{x1:"20",y1:"20",x2:"20",y2:"6.5",stroke:"#d1d5db",strokeWidth:"0.8",transform:`rotate(${e} 20 20)`},e)),(0,r.jsx)("polygon",{points:"20,8.5 23.5,20 20,17 16.5,20",fill:"#dc2626"}),(0,r.jsx)("polygon",{points:"20,31.5 23.5,20 20,23 16.5,20",fill:"#9ca3af"}),(0,r.jsx)("circle",{cx:"20",cy:"20",r:"1.8",fill:"#111827"}),(0,r.jsx)("text",{x:"20",y:"4",textAnchor:"middle",dominantBaseline:"middle",fontSize:"5.5",fontWeight:"700",fill:"#dc2626",children:"N"}),(0,r.jsx)("text",{x:"20",y:"37",textAnchor:"middle",dominantBaseline:"middle",fontSize:"5",fontWeight:"600",fill:"#374151",children:"S"}),(0,r.jsx)("text",{x:"36.5",y:"20.3",textAnchor:"middle",dominantBaseline:"middle",fontSize:"5",fontWeight:"600",fill:"#374151",children:"E"}),(0,r.jsx)("text",{x:"3.5",y:"20.3",textAnchor:"middle",dominantBaseline:"middle",fontSize:"5",fontWeight:"600",fill:"#374151",children:"W"})]})}),g&&Q&&(0,r.jsx)("div",{className:"absolute z-40",style:{left:Q.x,top:Q.y,transform:"translate(-50%, calc(-100% - 18px))"},onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:g}),m&&U&&(0,r.jsxs)("div",{className:"absolute bottom-3 right-3 flex flex-col overflow-hidden rounded-lg border border-black/10 bg-white/95 shadow-md",children:[(0,r.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),J(1.4)},"aria-label":"Zoom in",className:"flex h-9 w-9 items-center justify-center text-neutral-700 transition hover:bg-neutral-100",children:(0,r.jsx)(i.A,{size:16})}),(0,r.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),J(1/1.4)},"aria-label":"Zoom out",className:"flex h-9 w-9 items-center justify-center border-t border-black/10 text-neutral-700 transition hover:bg-neutral-100",children:(0,r.jsx)(o.A,{size:16})}),(0,r.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),K()},"aria-label":"Reset zoom",className:"flex h-9 w-9 items-center justify-center border-t border-black/10 text-neutral-700 transition hover:bg-neutral-100",children:(0,r.jsx)(s.A,{size:14})})]})]})}},53441:(e,t,n)=>{n.d(t,{cn:()=>i});var r=n(3638),l=n(79330);function i(...e){return(0,l.QP)((0,r.$)(e))}}}]);

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.