PageSourceSearch

https://www.hallowell.org/_next/static/chunks/app/page-f37cc3fe1cf…?dpl=dpl_4J26V1ffwU6TEYmNiYGvctqS8gR3

js hallowell.org collected 2026-10-02 10:54:18 UTC 46,568 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{9374:function(e,t,n){Promise.resolve().then(n.bind(n,5690))},5690:function(e,t,n){"use strict";n.d(t,{default:function(){return eO}});var a=n(7437),s=n(2265),r=n(5780),o=n(7585),i=n(7840),l=n(7954),c=n(359),d=n(8063),u=n(7776);function p(){let e=(0,s.useRef)(null),t=(0,s.useRef)(null),n=(0,i.L)("/models/world.glb"),o=n.scene;return(0,s.useEffect)(()=>{if(o){t.current=new u.AnimationMixer(o);let e=n.animations.filter(e=>/boat/i.test(e.name));if(e.length>0&&t.current){let n=t.current;e.forEach(e=>{let t=n.clipAction(e);t.setLoop(u.LoopRepeat,1/0),t.clampWhenFinished=!0,t.enabled=!0,t.setEffectiveTimeScale(.25),t.setEffectiveWeight(1),t.zeroSlopeAtStart=!0,t.zeroSlopeAtEnd=!0,t.play()})}let a=n.animations.filter(e=>/cloud/i.test(e.name)),s=t.current;a.length>0&&s&&a.forEach(e=>{let t=s.clipAction(e);t.setLoop(u.LoopRepeat,1/0),t.clampWhenFinished=!1,t.enabled=!0,t.setEffectiveTimeScale(.35),t.setEffectiveWeight(1),t.play()});let r=n.animations.filter(e=>/otherCrowds/i.test(e.name));r.length>0&&s&&r.forEach(e=>{let t=s.clipAction(e);t.setLoop(u.LoopRepeat,1/0),t.enabled=!0,t.setEffectiveWeight(1),t.play()});let i=n.animations.filter(e=>/characters?/i.test(e.name));i.length>0&&s&&i.forEach(e=>{let t=s.clipAction(e);t.setLoop(u.LoopRepeat,1/0),t.enabled=!0,t.setEffectiveWeight(1),t.play()})}e.current&&e.current.traverse(e=>{e instanceof u.Mesh&&(e.receiveShadow=!0,"ground"===e.material.name&&(e.material.color.setHex(3100463),e.material.metalness=0,e.material.roughness=1),"water"===e.material.name&&(e.material.color.setHex(102),e.material.transparent=!0,e.material.opacity=.95,e.material.roughness=.9,e.material.metalness=.4))})},[]),o.scale.set(.21,.21,.21),o.position.set(0,0,-15),o.rotation.set(0,0*Math.PI/180,0),(0,r.F)((e,n)=>{t.current&&t.current.update(n)}),(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("group",{ref:e,receiveShadow:!0,children:(0,a.jsx)("primitive",{object:o,receiveShadow:!0})})})}function m(){return(0,a.jsxs)("mesh",{children:[(0,a.jsx)("sphereGeometry",{args:[800,60,40]}),(0,a.jsx)("meshBasicMaterial",{color:new u.Color("#4A90E2"),opacity:.9,transparent:!0,side:u.BackSide})]})}var h=n(3742),x=n(9910);(0,x.cn)("none");let f=(0,x.cn)(!1),g=(0,x.cn)(!0),b=(0,x.cn)(!1),w=(0,x.cn)([0,0,0]),v=(0,x.cn)("none"),j={none:{name:"No Effect",date:void 0},christmas:{name:"Christmas",date:"12/25"},mardigras:{name:"Mardi Gras",date:"3/15/26"},halloween:{name:"Halloween",date:"10/31"},pride:{name:"Pride",date:"6/15"},artwalk:{name:"Artwalk",date:"7/20"},hallowellDay:{name:"Hallowell Day",date:"8/15"},oldHallowellDay:{name:"Old Hallowell Day",date:"7/4"}},y=(0,x.cn)({christmas:{position:[0,0,-15],rotation:[0,0,0],scale:[.21,.21,.21]},mardigras:{position:[0,0,-15],rotation:[0,0,0],scale:[.21,.21,.21]},halloween:{position:[0,0,-15],rotation:[0,0,0],scale:[.21,.21,.21]},pride:{position:[0,0,-15],rotation:[0,0,0],scale:[.21,.21,.21]},artwalk:{position:[0,0,-15],rotation:[0,0,0],scale:[.21,.21,.21]},hallowellDay:{position:[0,0,-15],rotation:[0,0,0],scale:[.21,.21,.21]},oldHallowellDay:{position:[0,0,-15],rotation:[0,0,0],scale:[.21,.21,.21]}});(0,x.cn)(null);let _=(0,x.cn)(!1),N=(0,x.cn)(!0),k=(0,x.cn)(null);(0,x.cn)(null);let C=(0,x.cn)(null),E=(0,x.cn)([-17,22,41]),z=(0,x.cn)("idle");var M=n(3027),F=n(3274),L=n(7398);let S=(0,M.j)("justify-center px-4 text-sm font-medium items-center transition-[box-shadow,background-color] disabled:cursor-not-allowed disabled:opacity-50 flex active:transition-none",{variants:{intent:{default:["bg-[#36322F]","text-[#fff]","hover:enabled:bg-[#4a4542]","disabled:bg-[#8c8885]","[box-shadow:inset_0px_-2.108433723449707px_0px_0px_#171310,_0px_1.2048193216323853px_6.325301647186279px_0px_rgba(58,_33,_8,_58%)]","hover:enabled:[box-shadow:inset_0px_-2.53012px_0px_0px_#171310,_0px_1.44578px_7.59036px_0px_rgba(58,_33,_8,_64%)]","disabled:shadow-none","active:bg-[#2A2724]","active:[box-shadow:inset_0px_-1.5px_0px_0px_#171310,_0px_0.5px_2px_0px_rgba(58,_33,_8,_70%)]"],primary:["bg-[#2C7BE5]","text-[#fff]","hover:enabled:bg-[#3D8DF5]","disabled:bg-[#9FC3F5]","[box-shadow:inset_0px_-2.108433723449707px_0px_0px_#1A68D1,_0px_1.2048193216323853px_6.325301647186279px_0px_rgba(28,_100,_242,_58%)]","hover:enabled:[box-shadow:inset_0px_-2.53012px_0px_0px_#2C7
1BE5,_0px_1.44578px_7.59036px_0px_rgba(28,_100,_242,_64%)]","disabled:shadow-none","active:bg-[#1A68D1]","active:[box-shadow:inset_0px_-1.5px_0px_0px_#1554AB,_0px_0.5px_2px_0px_rgba(28,_100,_242,_70%)]"],secondary:["bg-[#FFFFFF]","text-[#36322F]","hover:enabled:bg-[#F8F8F8]","disabled:bg-[#F0F0F0]","[box-shadow:inset_0px_-2.108433723449707px_0px_0px_#E0E0E0,_0px_1.2048193216323853px_6.325301647186279px_0px_rgba(0,_0,_0,_10%)]","hover:enabled:[box-shadow:inset_0px_-2.53012px_0px_0px_#E8E8E8,_0px_1.44578px_7.59036px_0px_rgba(0,_0,_0,_12%)]","disabled:shadow-none","border","border-[#E0E0E0]","active:bg-[#F0F0F0]","active:[box-shadow:inset_0px_-1.5px_0px_0px_#D8D8D8,_0px_0.5px_2px_0px_rgba(0,_0,_0,_15%)]"],danger:["bg-[#E6492D]","text-[#fff]","hover:enabled:bg-[#F05B41]","disabled:bg-[#F5A799]","[box-shadow:inset_0px_-2.108433723449707px_0px_0px_#D63A1F,_0px_1.2048193216323853px_6.325301647186279px_0px_rgba(214,_58,_31,_58%)]","hover:enabled:[box-shadow:inset_0px_-2.53012px_0px_0px_#E6492D,_0px_1.44578px_7.59036px_0px_rgba(214,_58,_31,_64%)]","disabled:shadow-none","active:bg-[#D63A1F]","active:[box-shadow:inset_0px_-1.5px_0px_0px_#B22E17,_0px_0.5px_2px_0px_rgba(214,_58,_31,_70%)]"]},size:{small:["text-xs","py-1","px-2","h-9","rounded-[8px]"],medium:["text-base","py-2","px-4","h-11","rounded-[9px]"],large:["text-lg","py-3","px-6","h-14","rounded-[11px]"]},fullWidth:{true:"w-full"}},compoundVariants:[{intent:["default","primary","secondary","danger"],size:"medium",className:"uppercase"}],defaultVariants:{intent:"default",size:"medium"}});var D=e=>{let{className:t,intent:n,size:s,fullWidth:r,children:o,loading:i=!1,disabled:l,...c}=e;return(0,a.jsxs)(L.E.button,{className:S({intent:n,size:s,fullWidth:r,className:t}),disabled:l||i,whileTap:{scale:.98},whileHover:{scale:1.02},transition:{type:"spring",stiffness:400,damping:10},...c,children:[i?(0,a.jsx)(F.Z,{className:"mr-2 h-4 w-4 animate-spin"}):null,(0,a.jsx)(L.E.span,{initial:{opacity:1},animate:{opacity:i?.7:1},transition:{duration:.2},children:o})]})};function T(e){let{className:t}=e,[n]=(0,h.KO)(C),r=(0,s.useRef)(null),o=(0,s.useRef)(null),i=(0,s.useCallback)(e=>{o.current=e;let t=()=>{if(o.current&&"stop"!==o.current){let e=window.orbitControls;if(!e){r.current=requestAnimationFrame(t);return}let n=e.object,a=e.target,s=n.position.clone().sub(a),i=s.length(),l=Math.atan2(s.x,s.z),c=Math.acos(s.y/i);switch(o.current){case"left":let d=l-.02;n.position.x=a.x+i*Math.sin(c)*Math.sin(d),n.position.y=a.y+i*Math.cos(c),n.position.z=a.z+i*Math.sin(c)*Math.cos(d);break;case"right":let u=l+.02;n.position.x=a.x+i*Math.sin(c)*Math.sin(u),n.position.y=a.y+i*Math.cos(c),n.position.z=a.z+i*Math.sin(c)*Math.cos(u);break;case"up":let p=Math.max(5,i-.5);n.position.x=a.x+p*Math.sin(c)*Math.sin(l),n.position.y=a.y+p*Math.cos(c),n.position.z=a.z+p*Math.sin(c)*Math.cos(l);break;case"down":let m=i+.5;n.position.x=a.x+m*Math.sin(c)*Math.sin(l),n.position.y=a.y+m*Math.cos(c),n.position.z=a.z+m*Math.sin(c)*Math.cos(l)}n.lookAt(a),e.update(),r.current=requestAnimationFrame(t)}};r.current||(r.current=requestAnimationFrame(t))},[n]),l=(0,s.useCallback)(()=>{o.current="stop",r.current&&(cancelAnimationFrame(r.current),r.current=null)},[]);return(0,a.jsx)("div",{className:"fixed bottom-4 left-4 z-50 ".concat(t||""),style:{pointerEvents:"auto"},children:(0,a.jsxs)("div",{className:"relative w-32 h-32",children:[(0,a.jsx)(D,{intent:"secondary",size:"small",className:"absolute top-0 left-1/2 transform -translate-x-1/2 w-10 h-10 p-0 flex items-center justify-center",onMouseDown:()=>i("up"),onMouseUp:l,onMouseLeave:l,onTouchStart:()=>i("up"),onTouchEnd:l,whileHover:{},whileTap:{},children:(0,a.jsx)("div",{className:"w-0 h-0 border-l-[6px] border-r-[6px] border-b-[8px] border-l-transparent border-r-transparent border-b-current"})}),(0,a.jsx)(D,{intent:"secondary",size:"small",className:"absolute top-1/2 left-0 transform -translate-y-1/2 w-10 h-10 p-0 flex items-center justify-center",onMouseDown:()=>i("left"),onMouseUp:l,onMouseLeave:l,onTouchStart:()=>i("left"),onTouchEnd:l,whileHover:{},whileTap:{},children:(0,a.jsx)("div",{className:"w-0 h-0 border-t-[6px] border-b-[6px] border-r-[8px] border-t-transparent border-b-transparent border-r-current"})}),(0,a.jsx)(D,{intent:"secondary",size:"small",className:"absolute top-1/2 right-0 transform -translate-y-1/2 w-10 h-10 p-0 flex items-center justify-center",onMouseDown:()=>i("right"),onMouseUp:l,onMouseLeave:l,onTouchStart:()=>i("right"),onTouchEnd:l,whileHover:{},whileTap:{},children:(0,a.jsx)("div",{className:"w-0 h-0 border-t-[6px] border-b-[6px] border-l-[8px] border-t-transparent border-b-transparent border-l-current"})}),(0,a.jsx)(D,{intent:"secondary",size:"small",className:"absolute bottom-0 left-1/2 transform -translate-x-1/2 w-10 h-10 p-0 flex items-center justify-center",onMouseDown:()=>i("down"),onMouseUp:l,onMouseLeave:l,onTouchStart:()=>i("down"),onTouchEnd:l,whileHover:{},whileTap:{},children:(0,a.jsx)("div",{className:"w-0 h-0 border-l-[6px] border-r-[6px] border-t-[8px] border-l-transparent border-r-transparent border-t-current"})}),(0,a.jsx)("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-6 h-6 bg-gray-300 rounded-full border-2 border-gray-400"})]})})}function A(){let{scene:e,gl:t}=(0,r.D)();return(0,s.useEffect)(()=>{setTimeout(()=>{t.shadowMap.enabled=!0,t.shadowMap.type=u.PCFSoftShadowMap,e.traverse(e=>{e instanceof u.Mesh&&(e.castShadow=!0,e.receiveShadow=!0)})},2e3)},[e,t]),null}var P=n(3579),R=n(4837),I=e=>{let{position:t,buildingInfo:n}=e,o=(0,s.useRef)(null),[i,l]=(0,h.KO)(k),[c,d]=(0,h.KO)(_);(0,r.F)(e=>{let{clock:t}=e;o.current&&(o.current.position.y=.1*Math.sin(2*t.getElapsedTime()))});let u=(null==i?void 0:i.buildingId)===n.id,{scale:p}=(0,R.q_)({scale:u?1.5:1,config:{tension:300,friction:10}});return(0,a.jsx)("group",{position:t,children:(0,a.jsxs)(R.q.group,{ref:o,onClick:()=>{d(!0),n.businesses.length>0&&l({businessId:n.businesses[0].id,buildingId:n.id,buildingName:n.name})},scale:p,children:[(0,a.jsxs)("mesh",{children:[(0,a.jsx)("sphereGeometry",{args:[.8,16,16]}),(0,a.jsx)("meshBasicMaterial",{color:u?"#eab308":"#ffffff",transparent:!0,opacity:.15,depthWrite:!1})]}),(0,a.jsxs)("mesh",{children:[(0,a.jsx)("sphereGeometry",{args:[.5,16,16]}),(0,a.jsx)("meshBasicMaterial",{color:u?"#eab308":"#ffffff",transparent:!0,opacity:.3,depthWrite:!1})]}),(0,a.jsxs)("mesh",{children:[(0,a.jsx)("sphereGeometry",{args:[.3,32,32]}),(0,a.jsx)("meshBasicMaterial",{color:u?"#eab308":"#ffffff",transparent:!0,opacity:1,toneMapped:!1})]})]})})};let O=e=>{let{buildings:t,positions:n,onPositionChange:s,originOffset:r=[0,0,0],selectedBuildingId:o}=e;return(0,a.jsx)("group",{children:t.map(e=>{try{var t;let s=n[e.id]||e.position,o=void 0!==s.z?s.z:2.75,i=[s.x+r[0],o+r[1],s.y+r[2]];return(0,a.jsx)(I,{position:i,buildingInfo:{id:e.id,name:e.name,address:e.description,businesses:(null===(t=e.expand)||void 0===t?void 0:t.businesses)||[]}},e.id)}catch(t){return console.error("Error parsing coordinates for building ".concat(e.id,":"),t),null}})})},Z=e=>{var t;let{buildings:n,positions:r,onPositionChange:o,onSave:i,hasUnsavedChanges:l,selectedBuildingId:c="",onSelectedBuildingChange:d}=e,[u,p]=s.useState(""),[m,h]=s.useState(!1),[x,f]=s.useState({x:20,y:20}),[g,b]=s.useState(!1),[w,v]=s.useState({x:0,y:0}),j=s.useRef(null),y=d?c:u,_=d||p,N=y?r[y]||(null===(t=n.find(e=>e.id===y))||void 0===t?void 0:t.position):null,k=async()=>{h(!0);try{await i()}finally{h(!1)}},C=s.useCallback(e=>{g&&f({x:e.clientX-w.x,y:e.clientY-w.y})},[g,w]),E=s.useCallback(()=>{b(!1)},[]);return s.useEffect(()=>{if(g)return document.addEventListener("mousemove",C),document.addEventListener("mouseup",E),()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",E)}},[g,C,E]),(0,a.jsxs)("div",{className:"fixed bg-black/70 rounded-lg text-white w-[250px]",style:{zIndex:1e3,left:"".concat(x.x,"px"),top:"".concat(x.y,"px"),cursor:g?"grabbing":"default"},children:[(0,a.jsx)("div",{ref:j,className:"px-4 py-2 bg-black/50 rounded-t-lg cursor-grab select-none",onMouseDown:e=>{var t;(e.target===j.current||(null===(t=j.current)||void 0===t?void 0:t.contains(e.target)))&&(b(!0),v({x:e.clientX-x.x,y:e.clientY-x.y}))},children:(0,a.jsx)("div",{className:"text-xs text-gray-300 text-center",children:"⋮⋮ Drag to move"})}),(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("label",{className:"block mb-1",children:"Select Building:"}),(0,a.jsxs)("select",{value:y,onChange:e=>_(e.target.value),className:"w-full p-1.5 bg-white/90 border-none rounded text-black",children:[(0,a.jsx)("option",{value:"",children:"Choose a building..."}),n.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),N&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)("label",{className:"block mb-1",children:"X Position:"}),(0,a.jsx)("input",{type:"range",min:"-300",max:"300",step:"0.1",value:N.x,onChange:e=>{y&&o(y,{...N,x:parseFloat(e.target.value)})},className:"w-full"}),(0,a.jsx)("span",{className:"text-sm",children:N.x.toFixed(1)})]}),(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)("label",{className:"block mb-1",children:"Y Position:"}),(0,a.jsx)("input",{type:"range",min:"-150",max:"150",step:"0.1",value:N.y,onChange:e=>{y&&o(y,{...N,y:parseFloat(e.target.value)})},className:"w-full"}),(0,a.jsx)("span",{className:"text-sm",children:N.y.toFixed(1)})]}),(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)("label",{className:"block mb-1",children:"Z Position (Height):"}),(0,a.jsx)("input",{type:"range",min:"0",max:"50",step:"0.1",value:void 0!==N.z?N.z:2.75,onChange:e=>{y&&o(y,{...N,z:parseFloat(e.target.value)})},className:"w-full"}),(0,a.jsx)("span",{className:"text-sm",children:(void 0!==N.z?N.z:2.75).toFixed(1)})]}),(0,a.jsx)("button",{onClick:()=>{y&&o(y,{x:5,y:10,z:5})},className:"w-full py-2 px-4 mb-3 rounded bg-gray-600 hover:bg-gray-700 transition-colors text-sm",children:"Reset Position"})]}),l&&(0,a.jsx)("button",{onClick:k,disabled:m,className:"w-full py-2 px-4 roun
1ded bg-blue-500 hover:bg-blue-600 transition-colors ".concat(m?"opacity-50 cursor-not-allowed":""),children:m?"Saving...":"Save Changes"})]})]})},B=new P.ZP("https://hallowell.pockethost.io"),V={mardigras:"mardigras",mardi_gras:"mardigras","mardi-gras":"mardigras",oldhallowellday:"oldHallowellDay",old_hallowell_day:"oldHallowellDay","old-hallowell-day":"oldHallowellDay",hallowellday:"hallowellDay",hallowell_day:"hallowellDay","hallowell-day":"hallowellDay",christmas:"christmas",halloween:"halloween",pride:"pride",artwalk:"artwalk"},K=e=>e.toLowerCase().trim().replace(/[^a-z0-9_-]/g,""),W=e=>e.toLowerCase().trim().replace(/[^a-z0-9]/g,"");async function H(){try{let t=await B.collection("Events").getFullList({sort:"-updated",$autoCancel:!1}),n={};for(let a of t){var e;let t=null!==(e=a.Event)&&void 0!==e?e:"",s=K(t),r=W(t),o=V[s]||V[r]||t;if(!o)continue;let i=a.Date?new Date(a.Date).toLocaleDateString("en-US",{month:"numeric",day:"numeric"}):void 0;i&&void 0===n[o]&&(n[o]=i)}return n}catch(e){return console.error("Failed to fetch event dates from PocketBase:",e),{}}}var U=n(495),G=n(3149),q=n(4863),X=n(3852),Y=n(3377),$=n(4232),J=n(2022),Q=n(500),ee=n(5430),et=n(518),en=n(4697),ea=n(4241),es=n(4817),er=n(4436),eo=n(9832),ei=n(4086),el=n(3953),ec=n(4908),ed=n(7440);function eu(e){let{isOpen:t,onClose:n,eventDates:s,onEffectChange:r,position:o="floating"}=e,[i]=(0,h.KO)(v);return t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-[100] bg-black/20",onClick:n}),(0,a.jsx)("div",{className:"fixed ".concat("floating"===o?"bottom-[140px] right-6":"bottom-24 right-4 md:right-6 md:top-32"," z-[110] bg-white/95 backdrop-blur-md border border-gray-200/50 rounded-lg shadow-xl w-64 max-h-96 overflow-auto"),children:(0,a.jsx)("div",{className:"py-2",children:["christmas","mardigras","halloween","pride","artwalk","oldHallowellDay"].map(e=>{let t=s[e]||j[e].date,n=i===e;return(0,a.jsx)("button",{onClick:()=>r(e),className:"block w-full text-left px-4 py-3 text-sm hover:bg-gray-100 transition-colors ".concat(n?"bg-gray-100 font-semibold":""),children:(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("span",{children:j[e].name}),t&&(0,a.jsx)("span",{className:"text-xs opacity-70",children:t})]})},e)})})})]}):null}let ep=e=>{let{type:t}=e;switch(null==t?void 0:t.toLowerCase().trim()){case"retail":case"office":default:return(0,a.jsx)(G.Z,{className:"w-4 h-4"});case"salon":return(0,a.jsx)(q.Z,{className:"w-4 h-4"});case"residential":return(0,a.jsx)(X.Z,{className:"w-4 h-4"});case"restaurant":return(0,a.jsx)(Y.Z,{className:"w-4 h-4"});case"real estate":case"real_estate":return(0,a.jsx)($.Z,{className:"w-4 h-4"});case"personal services":case"personal_services":return(0,a.jsx)(J.Z,{className:"w-4 h-4"});case"insurance":return(0,a.jsx)(Q.Z,{className:"w-4 h-4"});case"energy & utilities":case"energy utilities":case"energy_utilities":return(0,a.jsx)(ee.Z,{className:"w-4 h-4"})}};function em(e){let{buildings:t,onBusinessClick:n,onResetCamera:r}=e,[o,i]=(0,h.KO)(_),[l,c]=(0,h.KO)(N),[d,p]=(0,h.KO)(k),[m,x]=(0,s.use
1State)(null),[w,j]=(0,s.useState)(!1),[y,C]=(0,s.useState)(""),[E,z]=(0,s.useState)(!1),[M,F]=(0,s.useState)({}),[,L]=(0,h.KO)(v),[,S]=(0,h.KO)(f),[,D]=(0,h.KO)(g),[,T]=(0,h.KO)(b),A=(0,s.useRef)(null),R=t.flatMap(e=>{var t,n;return(null===(n=e.expand)||void 0===n?void 0:null===(t=n.businesses)||void 0===t?void 0:t.map(t=>({...t,buildingName:e.name,buildingAddress:e.description})))||[]}),I=R.filter(e=>e.name.toLowerCase().includes(y.toLowerCase())||e.buildingName.toLowerCase().includes(y.toLowerCase())).sort((e,t)=>(e.name||"").localeCompare(t.name||"",void 0,{sensitivity:"base"}));s.useEffect(()=>{if(d&&(o||l)){let e=R.find(e=>e.id===d.businessId);e&&e.id!==(null==m?void 0:m.id)&&(x(e),n&&n(d.buildingId))}},[d,o,l]),(0,s.useEffect)(()=>{if(d&&A.current){let e=A.current.querySelector('[data-business-id="'.concat(d.businessId,'"]'));e&&e.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})}},[d]),(0,s.useEffect)(()=>{(async()=>{try{let e=await H();F(e)}catch(e){console.error("Error loading event dates:",e)}})()},[]);let O=()=>{i(!o),o||(p(null),x(null))},Z=e=>{let a=t.find(t=>{var n,a;return null===(a=t.expand)||void 0===a?void 0:null===(n=a.businesses)||void 0===n?void 0:n.some(t=>t.id===e.id)});a&&(p({businessId:e.id,buildingId:a.id,buildingName:e.buildingName}),n&&n(a.id)),x(e),c(!1)},B=()=>{x(null),p(null),r&&r()},V=e=>e.Logo?new P.ZP("https://hallowell.pockethost.io/").files.getUrl(e,e.Logo):null;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:(0,ed.cn)("fixed bg-white/90 backdrop-blur-md shadow-lg z-40 transition-all duration-300","md:right-0 md:top-14 md:h-[calc(100vh-3.5rem)] md:w-96 md:border-l md:border-gray-200/50 md:overflow-y-auto","bottom-0 left-0 right-0 md:left-auto max-h-[70vh] md:max-h-none rounded-t-2xl md:rounded-none border-t md:border-t-0 overflow-hidden md:overflow-y-auto",o?"md:translate-x-0":"md:translate-x-full","md:translate-y-0",l?"translate-y-0":"translate-y-[calc(100%-4rem)]"),children:[(0,a.jsx)("button",{onClick:()=>c(!l),className:"md:hidden flex justify-center pt-2 pb-1 w-full cursor-pointer active:opacity-50 transition-opacity","aria-label":"Toggle business panel",children:(0,a.jsx)("div",{className:"w-12 h-1 bg-gray-300 rounded-full"})}),(0,a.jsxs)("div",{className:"p-3 md:p-6 overflow-y-auto md:overflow-visible max-h-[calc(70vh-3rem)] md:max-h-none",children:[m?(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)(U.z,{variant:"outline",className:"text-left",onClick:B,children:[(0,a.jsx)(et.Z,{className:"w-4 h-4 mr-1"}),"Back to all businesses"]}),(0,a.jsx)(U.z,{variant:"outline",size:"icon",onClick:O,className:"hidden md:flex",children:(0,a.jsx)(en.Z,{className:"h-4 w-4"})})]}),m.Location_Image?(0,a.jsxs)("div",{className:"relative rounded-lg overflow-hidden mb-4",children:[(0,a.jsxs)("div",{className:"w-full h-40",children:[(0,a.jsx)("img",{src:(m.Location_Image?new P.ZP("https://hallowell.pockethost.io/").files.getUrl(m,m.Location_Image):null)||"",alt:"".concat(m.name," location"),className:"w-full h-full object-cover"}),(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-trans
1parent to-transparent"})]}),(0,a.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 p-3 flex items-end gap-3",children:[m.Logo?(0,a.jsx)("div",{className:"w-14 h-14 rounded-lg overflow-hidden bg-white shrink-0 shadow-lg border-2 border-white",children:(0,a.jsx)("img",{src:V(m)||"",alt:"".concat(m.name," logo"),className:"w-full h-full object-cover"})}):(0,a.jsx)("div",{className:"p-3 bg-white rounded-lg shrink-0 shadow-lg",children:(0,a.jsx)(ep,{type:m.type})}),(0,a.jsx)("h2",{className:"text-xl font-bold text-white drop-shadow-lg pb-1",children:m.name})]})]}):(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 flex-1",children:[(0,a.jsxs)(U.z,{variant:"outline",className:"text-left w-fit",onClick:B,children:[(0,a.jsx)(et.Z,{className:"w-4 h-4 mr-1"}),"Back to all businesses"]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[m.Logo?(0,a.jsx)("div",{className:"w-12 h-12 rounded-lg overflow-hidden bg-white shrink-0 border border-gray-200",children:(0,a.jsx)("img",{src:V(m)||"",alt:"".concat(m.name," logo"),className:"w-full h-full object-cover"})}):(0,a.jsx)("div",{className:"p-2 bg-gray-100 rounded-lg shrink-0",children:(0,a.jsx)(ep,{type:m.type})}),(0,a.jsx)("h2",{className:"text-xl font-bold",children:m.name})]})]}),(0,a.jsx)(U.z,{variant:"outline",size:"icon",onClick:O,className:"self-start hidden md:flex",children:(0,a.jsx)(en.Z,{className:"h-4 w-4"})})]})]}):(0,a.jsxs)("div",{className:"mb-4 flex gap-2 items-center",children:[(0,a.jsx)("button",{onClick:()=>z(!E),className:"flex items-center justify-center w-10 h-10 rounded-lg border border-gray-200 bg-white/80 hover:bg-gray-50 transition-colors shrink-0",children:(0,a.jsx)(ea.Z,{className:"h-4 w-4 text-gray-600"})}),(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)(es.Z,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),(0,a.jsx)("input",{type:"text",placeholder:"Search businesses...",value:y,onChange:e=>C(e.target.value),className:"w-full pl-10 pr-4 py-2 rounded-lg border border-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white/80"})]}),(0,a.jsx)("button",{onClick:O,className:"hidden md:flex items-center justify-center w-10 h-10 rounded-lg border border-gray-200 bg-white/80 hover:bg-gray-50 transition-colors shrink-0",children:(0,a.jsx)(en.Z,{className:"h-4 w-4 text-gray-600"})})]}),!m&&!w&&(0,a.jsxs)("div",{className:"mb-4 p-3 bg-blue-50 border border-blue-200 rounded-lg relative",children:[(0,a.jsx)(U.z,{variant:"ghost",size:"icon",onClick:()=>j(!0),className:"absolute top-1 right-1 h-6 w-6",children:(0,a.jsx)(en.Z,{className:"h-3 w-3"})}),(0,a.jsx)("p",{className:"text-sm text-blue-900 pr-6",children:"\uD83D\uDCA1 Click on a glowing orb on the map to focus on that business, or select from the list below."})]}),m?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"p-4 bg-white/80 rounded-lg border border-gray-200",children:[(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)("p",{className:"text-sm text-gray-600",children:m.buildingName}),m.unit&&(0,a.jsxs)("p",{className:"text-sm text-gray-600",children:["Unit ",m.unit]})]}),m.description&&(0,a.jsx)("div",{className:"text-sm leading-relaxed text-gray-700",dangerouslySetInnerHTML:{__html:m.description}})]}),(m.website||m.phone||m.Email||m.Instagram||m.Facebook||m.TikTok)&&(0,a.jsxs)("div",{className:"space-y-3",children:[m.website&&(0,a.jsx)(U.z,{variant:"outline",className:"w-full justify-start",asChild:!0,children:(0,a.jsxs)("a",{href:m.website,target:"_blank",rel:"noopener noreferrer",children:[(0,a.jsx)(er.Z,{className:"w-4 h-4 mr-2"}),"Visit Website"]})}),m.phone&&(0,a.jsx)(U.z,{variant:"outline",className:"w-full justify-start",asChild:!0,children:(0,a.jsxs)("a",{href:"tel:".concat(m.phone),children:[(0,a.jsx)(eo.Z,{className:"w-4 h-4 mr-2"}),m.phone]})}),m.Email&&(0,a.jsx)(U.z,{variant:"outline",className:"w-full justify-start",asChild:!0,children:(0,a.jsxs)("a",{href:"mailto:".concat(m.Email),children:[(0,a.jsx)(ei.Z,{className:"w-4 h-4 mr-2"}),m.Email]})}),(m.Instagram||m.Facebook||m.TikTok)&&(0,a.jsxs)("div",{className:"flex gap-2",children:[m.Instagram&&(0,a.jsx)(U.z,{variant:"outline",size:"sm",asChild:!0,children:(0,a.jsx)("a",{href:m.Instagram.startsWith("http")?m.Instagram:"https://instagram.com/".concat(m.Instagram),target:"_blank",rel:"noopener noreferrer",children:(0,a.jsx)(el.Z,{className:"w-4 h-4"})})}),m.Facebook&&(0,a.jsx)(U.z,{variant:"outline",size:"sm",asChild:!0,children:(0,a.jsx)("a",{href:m.Facebook.startsWith("http")?m.Facebook:"https://facebook.com/".concat(m.Facebook),target:"_blank",rel:"noopener noreferrer",children:(0,a.jsx)(ec.Z,{className:"w-4 h-4"})})}),m.TikTok&&(0,a.jsx)(U.z,{variant:"outline",size:"sm",asChild:!0,children:(0,a.jsx)("a",{href:m.TikTok.startsWith("http")?m.TikTok:"https://tiktok.com/@".concat(m.TikTok),target:"_blank",rel:"noopener noreferrer",children:(0,a.jsx)("span",{className:"w-4 h-4 text-xs font-bold",children:"TT"})})})]})]})]}):(0,a.jsx)("div",{ref:A,className:(0,ed.cn)("flex md:block overflow-x-auto md:overflow-x-visible snap-x snap-mandatory md:snap-none gap-4 md:gap-0 pb-4 md:pb-0","md:space-y-3"),children:I.map(e=>(0,a.jsxs)("div",{"data-business-id":e.id,onClick:()=>Z(e),className:(0,ed.cn)("flex items-start gap-3 p-4 rounded-lg cursor-pointer border transition-colors","hover:bg-white/60 border-gray-200 bg-white/40","w-[280px] md:w-full flex-shrink-0 md:flex-shrink snap-start md:snap-align-none",(null==d?void 0:d.businessId)===e.id&&"bg-yellow-50/80 border-yellow-200"),children:[e.Logo?(0,a.jsx)("div",{className:"w-10 h-10 rounded-lg overflow-hidden bg-white shrink-0 mt-1 border border-gray-200",children:(0,a.jsx)("img",{src:V(e)||"",alt:"".concat(e.name," logo"),className:"w-full h-full object-cover"})}):(0,a.jsx)("div",{className:"p-2 bg-gray-100 rounded-lg shrink-0 mt-1",children:(0,a.jsx)(ep,{type:e.type})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("h3",{className:"font-semibold text-base md:text-lg mb-1 truncate",children:e.name}),(0,a.jsx)("p",{className:"text-sm text-gray-600 mb-1 truncate",children:e.buildingName}),e.unit&&(0,a.jsxs)("p",{className:"text-sm text-gray-600 mb-2",children:["Unit ",e.unit]}),e.description&&(0,a.jsx)("div",{className:"text-sm text-gray-700 leading-relaxed line-clamp-2",dangerouslySetInnerHTML:{__html:e.description}}),(0,a.jsxs)("div",{className:"flex items-center gap-4 mt-2 text-xs text-gray-500",children:[e.website&&(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(er.Z,{className:"w-3 h-3"}),"Website"]}),e.phone&&(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(eo.Z,{className:"w-3 h-3"}),"Phone"]})]})]})]},e.id))})]})]}),(0,a.jsx)(eu,{isOpen:E,onClose:()=>z(!1),eventDates:M,onEffectChange:e=>{L(e),"artwalk"===e?(T(!0),S(!1),D(!1)):"none"===e?(T(!1),S(!1),D(!1)):(T(!0),S(!0),D(!0)),z(!1),"n
1one"!==e&&window.panCameraToPosition&&setTimeout(()=>{let e=new u.Vector3(18.2,2.75,4.7);window.panCameraToPosition(e,{duration:1500,easing:"event"})},1e3)},position:"sidebar"})]})}var eh=n(7251);function ex(e){let{isLoading:t,progress:n=0,message:r="Loading Hallowell..."}=e,[o,i]=(0,s.useState)(""),[l,c]=(0,s.useState)(0),[d,u]=(0,s.useState)(!1);return((0,s.useEffect)(()=>{if(t)u(!0),c(0);else{c(100);let e=setTimeout(()=>{u(!1)},1500);return()=>clearTimeout(e)}},[t]),(0,s.useEffect)(()=>{if(!d)return;let e=t?n:100,a=Math.max(1,(e-l)/10);if(l<e){let t=setTimeout(()=>{c(t=>Math.min(t+a,e))},50);return()=>clearTimeout(t)}},[l,n,t,d]),(0,s.useEffect)(()=>{if(!d)return;let e=setInterval(()=>{i(e=>e.length>=3?"":e+".")},500);return()=>clearInterval(e)},[d]),d)?(0,a.jsxs)("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(240, 240, 240, 0.95)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:9999,color:"#333333",fontFamily:"Arial, sans-serif"},children:[(0,a.jsx)("div",{style:{width:"200px",height:"200px",marginBottom:"40px",marginTop:"60px",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,a.jsx)(eh.nI,{src:"/city.lottie",loop:!0,autoplay:!0,style:{width:"100%",height:"100%"}})}),(0,a.jsxs)("div",{style:{fontSize:"24px",fontWeight:"bold",marginBottom:"15px",textAlign:"center",color:"#333333"},children:[r,o]}),(0,a.jsx)("div",{style:{width:"300px",height:"6px",backgroundColor:"rgba(200, 200, 200, 0.5)",borderRadius:"3px",overflow:"hidden",marginBottom:"15px"},children:(0,a.jsx)("div",{style:{width:"".concat(l,"%"),height:"100%",backgroundColor:"#666666",transition:"width 0.3s ease",borderRadius:"3px"}})}),(0,a.jsxs)("div",{style:{fontSize:"16px",opacity:.7,color:"#555555"},children:[Math.round(l),"%"]})]}):null}function ef(e){let{position:t=[0,0,0],rotation:n=[0,0,0],scale:s=[1,1,1]}=e,r=(0,i.L)("/effects/christmas.glb");return(0,a.jsx)("primitive",{object:r.scene,position:t,rotation:n,scale:s})}function eg(e){let{position:t=[0,0,0],rotation:n=[0,0,0],scale:s=[1,1,1]}=e,r=(0,i.L)("/effects/halloween.glb");return(0,a.jsx)("primitive",{object:r.scene,position:t,rotation:n,scale:s})}function eb(e){let{position:t=[0,0,0],rotation:n=[0,0,0],scale:r=[1,1,1]}=e,o=(0,i.L)("/effects/mardiGras.glb"),[l]=(0,h.KO)(w);return(0,s.useEffect)(()=>{if(!o.scene)return;let e=o.scene.getObjectByName("MardiGras_Bus");if(e){let t=new u.Vector3(l[0]+1.4,l[1]+.6,l[2]-22),n=e.parent;n&&n.worldToLocal(t),e.position.copy(t),e.visible=!0}},[o.scene,l]),(0,a.jsx)("primitive",{object:o.scene,position:t,rotation:n,scale:r})}function ew(e){let{position:t=[0,0,0],rotation:n=[0,0,0],scale:s=[1,1,1]}=e,r=(0,i.L)("/effects/pride.glb");return(0,a.jsx)("primitive",{object:r.scene,position:t,rotation:n,scale:s})}function ev(e){let{position:t=[0,0,0],rotation:n=[0,0,0],scale:s=[1,1,1]}=e,r=(0,i.L)("/effects/artWalk.glb");return(0,a.jsx)("primitive",{object:r.scene,position:t,rotation:n,scale:s})}function ej(e){let{position:t=[0,0,0],rotation:n=[0,0,0],scale:s=[1,1,1]}=e,r=(0,i.L)("/effects/hallowellDay.glb");return(0,a.jsx)("primitive",{object:r.scene,position:t,rotation:n,scale:s})}function ey(e){let{position:t=[0,0,0],rotation:n=[0,0,0],scale:s=[1,1,1]}=e,r=(0,i.L)("/effects/hallowellDay.glb");return(0,a.jsx)("primitive",{object:r.scene,position:t,rotation:n,scale:s})}function e_(e){let{children:t,onFadeOutComplete:n}=e,o=s.useRef(null),i=s.useRef(0),[l,c]=(0,h.KO)(z),d=s.useRef(!1);return(0,s.useEffect)(()=>(c("in"),d.current=!1,()=>{c("idle")}),[c]),(0,r.F)(()=>{o.current&&("in"===l?(i.current=Math.min(i.current+.06,1),d.current=!1):"out"!==l||(i.current=Math.max(i.current-.06,0),0!==i.current||d.current||(d.current=!0,null==n||n())),o.current.traverse(e=>{if(e instanceof u.Mesh&&e.material){if(Array.isArray(e.material))e.material.forEach(e=>{e.transparent=!0,e.opacity=i.current});else{let t=e.material;t.transparent=!0,t.opacity=i.current}}}))}),(0,a.jsx)("group",{ref:o,children:t})}function eN(e){let{position:t=[0,0,0],rotation:n=[0,0,0],scale:r=[1,1,1]}
1=e,[o]=(0,h.KO)(v),[i]=(0,h.KO)(y),[l,c]=(0,s.useState)(o),[,d]=(0,h.KO)(z),u=s.useRef(o);return(0,s.useEffect)(()=>{u.current!==o&&("none"===o?d("out"):(c(o),d("in")),u.current=o)},[o,d]),(0,a.jsx)(a.Fragment,{children:(()=>{let e="none"===l?o:l,s="none"!==e?i[e]:null;if(!s)return null;let d="christmas"===e?(0,a.jsx)(ef,{position:s.position,rotation:s.rotation,scale:s.scale}):"halloween"===e?(0,a.jsx)(eg,{position:s.position,rotation:s.rotation,scale:s.scale}):"mardigras"===e?(0,a.jsx)(eb,{position:s.position,rotation:s.rotation,scale:s.scale}):"pride"===e?(0,a.jsx)(ew,{position:s.position,rotation:s.rotation,scale:s.scale}):"artwalk"===e?(0,a.jsx)(ev,{position:s.position,rotation:s.rotation,scale:s.scale}):"hallowellDay"===e?(0,a.jsx)(ej,{position:s.position,rotation:s.rotation,scale:s.scale}):"oldHallowellDay"===e?(0,a.jsx)(ey,{position:s.position,rotation:s.rotation,scale:s.scale}):null;return(0,a.jsx)("group",{position:t,rotation:n,scale:r,children:(0,a.jsx)(e_,{onFadeOutComplete:()=>"none"===o&&c("none"),children:d})})})()})}i.L.preload("/effects/christmas.glb"),i.L.preload("/effects/halloween.glb"),i.L.preload("/effects/mardiGras.glb"),i.L.preload("/effects/pride.glb"),i.L.preload("/effects/artWalk.glb"),i.L.preload("/effects/hallowellDay.glb"),i.L.preload("/effects/hallowellDay.glb");var ek=n(5574);function eC(e){let{onClick:t}=e;return(0,a.jsxs)("button",{onClick:t,className:"hidden md:flex fixed bottom-6 right-6 z-50 items-center gap-2 bg-white/80 backdrop-blur-md hover:bg-white/90 text-gray-900 px-5 py-3 rounded-full shadow-lg hover:shadow-xl transition-all duration-200 border border-gray-200/50",children:[(0,a.jsx)(ek.Z,{className:"w-5 h-5"}),(0,a.jsx)("span",{className:"font-medium",children:"Business Directory"})]})}function eE(){let[e,t]=(0,h.KO)(v),[,n]=(0,h.KO)(f),[,r]=(0,h.KO)(g),[,o]=(0,h.KO)(b),[i,l]=(0,s.useState)(!1),[c,d]=(0,s.useState)({});(0,s.useEffect)(()=>{(async()=>{try{let e=await H();d(e)}catch(e){console.error("Error loading event dates:",e)}})()},[]);let p=e=>{t(e),"artwalk"===e?(o(!0),n(!1),r(!1)):"none"===e?(o(!1),n(!1),r(!1)):(o(!0),n(!0),r(!0)),l(!1),"none"!==e&&window.panCameraToPosition&&setTimeout(()=>{let e=new u.Vector3(18.2,2.75,4.7);window.panCameraToPosition(e,{duration:1500,easing:"event"})},1e3)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("button",{onClick:()=>l(!i),className:"hidden md:flex fixed bottom-20 right-6 z-50 items-center gap-2 bg-white/80 backdrop-blur-md hover:bg-white/90 text-gray-900 px-5 py-3 rounded-full shadow-lg hover:shadow-xl transition-all duration-200 border border-gray-200/50",children:[(0,a.jsx)(ea.Z,{className:"w-5 h-5"}),(0,a.jsx)("span",{className:"font-medium",children:"none"!==e?j[e].name:"Events"}),"none"!==e&&(0,a.jsx)("button",{onClick:e=>{e.stopPropagation(),p("none")},className:"hover:bg-gray-200 rounded-full p-0.5 transition-colors","aria-label":"Clear event",children:(0,a.jsx)(en.Z,{className:"h-3 w-3"})})]}),(0,a.jsx)(eu,{isOpen:i,onClose:()=>l(!1),eventDates:c,onEffectChange:p,position:"floating"})]})}var ez=()=>{let e=(0,i.L)("/models/MidCharacters.glb"),t=(0,i.L)("/models/SideCharacters.glb"),n=(0,i.L)("/models/cars.glb"),o=(0,s.useRef)(null),l=(0,s.useRef)(null),c=(0,s.useRef)(null),d=(0,s.useRef)(null),p=(0,s.useRef)(new u.Vector3(10,3.4,-70)),m=(0,s.useRef)(new u.Vector3(0,0,0)),[,x]=(0,h.KO)(w),[f]=(0,h.KO)(v),g=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(e.scene&&e.animations&&e.animations.length>0){let t=new u.AnimationMixer(e.scene);o.current=t,e.animations.forEach(e=>{let n=t.clipAction(e);n.setLoop(u.LoopRepeat,1/0),n.enabled=!0,n.clampWhenFinished=!1,n.play()})}if(d.current&&d.current.position.copy(m.current),t.scene&&t.animations&&t.animations.length>0){let e=new u.AnimationMixer(t.scene);l.current=e,t.animations.forEach(t=>{let n=e.clipAction(t);n.setLoop(u.LoopRepeat,1/0),n.enabled=!0,n.clampWhenFinished=!1,n.play()})}if("none"===f&&n.scene&&n.animations&&n.animations.length>0){let e=new u.AnimationMixer(n.scene);c.current=e,n.animations.forEach(t=>{let n=e.clipAction(t);n.setLoop(u.LoopRepeat,1/0),n.enabled=!0,n.clampWhenFinished=!1,n.play(),n.timeScale=.3})}return()=>{o.current&&(o.current.stopAllAction(),o.current.uncacheRoot(e.scene),o.current=null),l.current&&(l.current.stopAllAction(),l.current.uncacheRoot(t.sce
1ne),l.current=null),c.current&&(c.current.stopAllAction(),c.current.uncacheRoot(n.scene),c.current=null)}},[e.scene,e.animations,t.scene,t.animations,n.scene,n.animations,f]),(0,r.F)((e,t)=>{if(o.current&&o.current.update(t),l.current&&l.current.update(t),"none"===f&&c.current&&c.current.update(t),d.current){let e=d.current.position,n=p.current,a=new u.Vector3().subVectors(n,e),s=a.length();if(s>.001){if(a.normalize().multiplyScalar(Math.min(s,2*t)),e.add(a),g.current){let e=new u.Vector3;d.current.getWorldPosition(e);let t=new u.Vector3;d.current.getWorldDirection(t),e.add(t.multiplyScalar(5)),x([e.x,e.y,e.z])}else x([e.x,e.y,e.z])}else if(e.copy(m.current),g.current){let e=new u.Vector3;d.current.getWorldPosition(e);let t=new u.Vector3;d.current.getWorldDirection(t),e.add(t.multiplyScalar(5)),x([e.x,e.y,e.z])}else x([e.x,e.y,e.z])}}),(0,a.jsxs)("group",{ref:g,scale:.21,position:[-.6,-.2,-10],children:["none"!==f&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("primitive",{ref:d,object:e.scene}),(0,a.jsx)("primitive",{object:t.scene,position:[2.5,1,-25]})]}),"none"===f&&(0,a.jsx)("primitive",{object:n.scene,position:[2,1,-25]})]})},eM=()=>{let e=(0,i.L)("/models/otherCrowd.glb"),t=(0,i.L)("/models/market.glb"),n=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(e.scene&&e.animations&&e.animations.length>0){let t=new u.AnimationMixer(e.scene);n.current=t,e.animations.forEach(e=>{let n=t.clipAction(e);n.setLoop(u.LoopRepeat,1/0),n.enabled=!0,n.clampWhenFinished=!1,n.play()})}return()=>{n.current&&(n.current.stopAllAction(),n.current.uncacheRoot(e.scene),n.current=null)}},[e.scene,e.animations]),(0,r.F)((e,t)=>{n.current&&n.current.update(t)}),(0,a.jsxs)("group",{scale:.21,position:[-7,-3,26.5],children:[(0,a.jsx)("primitive",{object:t.scene,position:[0,0,0]}),(0,a.jsx)("primitive",{object:e.scene,position:[0,0,0]})]})};i.L.preload("/models/otherCrowd.glb"),i.L.preload("/models/market.glb");let eF=new P.ZP("https://hallowell.pockethost.io/"),eL="[email protected]",eS="xvp.eug8ZBP8gta.kxr";async function eD(){if(!eL||!eS)throw Error("Admin credentials not configured");try{return await eF.admins.authWithPassword(eL,eS)}catch(e){throw console.error("Admin authentication failed:",e),e}}async function eT(e){let t=new URL("/api/admin-pin-controls",window.location.origin);e&&t.searchParams.set("pw",e);let n=await fetch(t.toString(),{method:"GET",credentials:"include"});if(!n.ok)return!1;let a=await n.json();return!!(null==a?void 0:a.enabled)}function eA(){let{scene:e,camera:t}=(0,r.D)();return s.useEffect(()=>{e.fog=new u.FogExp2("#b3d9ff",.004),t instanceof u.PerspectiveCamera&&(t.far=2e3,t.updateProjectionMatrix())},[e,t]),null}function eP(e){let{isVisible:t,position:n,rotation:o}=e,i=s.useRef(null),l=s.useRef(t?1:0);return(0,r.F)(()=>{i.current&&(t?l.current=Math.min(l.current+.06,1):l.current=Math.max(l.current-.06,0),i.current.traverse(e=>{if(e instanceof u.Mesh&&e.material){if(Array.isArray(e.material))e.material.forEach(e=>{e.transparent=!0,e.opacity=l.current});else{let t=e.material;t.transparent=!0,t.opacity=l.current}}}))}),(0,a.jsx)("group",{ref:i,position:n,rotation:[o[0]*Math.PI/180,o[1]*Math.PI/180,o[2]*Math.PI/180],children:(0,a.jsx)(eM,{})})}function eR(){let{camera:e}=(0,r.D)(),t=s.useRef(null);return s.useEffect(()=>{let n=()=>{window.orbitControls?(t.current=window.orbitControls,t.current.object!==e&&(t.current.object=e),t.current.update(),a()):setTimeout(n,100)},a=()=>{window.panCameraToPosition=function(e){var n,a;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t.current){console.error("Controls not found!");return}let r=t.current,o=r.object,i=new u.Vector3().copy(r.target),l=e.clone(),c=new u.Vector3().subVectors(l,i),d=o.position.clone(),p=new u.Vector3().addVectors(d,c),m=null!==(n=s.duration)&&void 0!==n?n:1500,h=Date.now(),x=null!==(a=s.easing)&&void 0!==a?a:"building",f=()=>{let e;let t=Math.min((Date.now()-h)/m,1);e="event"===x?t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2:1-Math.pow(1-t,3);let n=new u.Vector3().lerpVectors(i,l,e),a=new u.Vector3().lerpVectors(d,p,e);
1r.target.copy(n),o.position.copy(a),r.update(),t<1&&requestAnimationFrame(f)};setTimeout(()=>{f()},0)},window.resetCameraToDefault=e=>{if(!t.current)return;let n=t.current,a=n.object,s=new u.Vector3().copy(n.target),r=new u.Vector3(0,0,0),o=a.position.clone(),i=new u.Vector3(e[0],e[1],e[2]),l=Date.now(),c=()=>{let e=Math.min((Date.now()-l)/1500,1),t=1-Math.pow(1-e,3),d=new u.Vector3().lerpVectors(s,r,t);n.target.copy(d),a.position.lerpVectors(o,i,t),n.update(),e<1&&requestAnimationFrame(c)};c()}};return n(),()=>{delete window.panCameraToPosition,delete window.resetCameraToDefault}},[e]),null}function eI(e){let{sunPosition:t}=e,n=(0,s.useRef)(null);return s.useEffect(()=>{n.current&&(n.current.shadow.mapSize.width=8192,n.current.shadow.mapSize.height=8192,n.current.shadow.camera.far=2e3,n.current.shadow.camera.left=-100,n.current.shadow.camera.right=100,n.current.shadow.camera.top=100,n.current.shadow.camera.bottom=-100,n.current.shadow.bias=-.0001,n.current.shadow.normalBias=.005,n.current.shadow.radius=1.5)},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("ambientLight",{intensity:1.8}),(0,a.jsx)("directionalLight",{ref:n,castShadow:!0,position:t,intensity:6.5,color:"#FDB813"}),(0,a.jsx)("hemisphereLight",{intensity:1,color:"#87CEEB",groundColor:"#8B4513"})]})}function eO(){let e=[0,0,0],[t,n]=(0,s.useState)([]),[r]=(0,h.KO)(b),[i]=(0,h.KO)(f),[x]=(0,h.KO)(g),[w,v]=(0,h.KO)(C),[j]=(0,h.KO)(E),[y,N]=(0,h.KO)(_),[k,z]=(0,s.useState)(!0),[M,F]=(0,s.use
1State)(0),[L,S]=(0,s.useState)("Initializing..."),[D,P]=(0,s.useState)([25,8,-5.5]),[R]=(0,s.useState)([]),[I,B]=(0,s.useState)({}),[V,K]=(0,s.useState)(!1),[W,H]=(0,s.useState)(""),[U,G]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=new URLSearchParams(window.location.search),t=e.get("admin"),n=e.get("pw")||void 0;if("1"===t&&n){eT(n).then(e=>G(e)).catch(()=>G(!1));return}eT().then(e=>G(e)).catch(()=>G(!1))},[]);let[q,X]=(0,s.useState)([7,3,-41.5]),[Y,$]=(0,s.useState)([0,0,0]);(0,s.useEffect)(()=>{!async function(){try{S("Initializing..."),F(15),await new Promise(e=>setTimeout(e,800)),S("Fetching building data..."),F(35);let e=await eF.collection("buildings").getFullList({expand:"businesses"});n(e),F(55),S("Setting up building positions...");let t={};e.forEach(e=>{t[e.id]={x:e.position.x,y:e.position.y,...void 0!==e.position.z&&{z:e.position.z}}}),B(t),F(75),S("Preparing 3D environment..."),await new Promise(e=>setTimeout(e,1200)),F(85),S("Finalizing scene..."),await new Promise(e=>setTimeout(e,800)),F(95),S("Ready!"),await new Promise(e=>setTimeout(e,1500)),z(!1)}catch(e){F(95),S("Ready!"),setTimeout(()=>{z(!1)},1e3)}}()},[]);let J=(e,t)=>{B(n=>({...n,[e]:t})),K(!0)},Q=async()=>{try{await eD();let e=t.map(async e=>{let t=I[e.id];t&&(t.x!==e.position.x||t.y!==e.position.y||t.z!==e.position.z)&&await eF.collection("buildings").update(e.id,{position:t})});await Promise.all(e),K(!1)}catch(e){console.error("Error saving positions:",e),e instanceof Error&&e.message.includes("credentials")&&console.error("Admin credentials not properly configured")}};return(0,a.jsxs)("div",{style:{width:"100vw",height:"100vh",margin:0,padding:0},children:[(0,a.jsx)(ex,{isLoading:k,progress:M,message:L}),(0,a.jsxs)(o.Xz,{shadows:!0,camera:{far:2e3},children:[(0,a.jsx)(eA,{}),(0,a.jsx)(l.c,{makeDefault:!0,position:[-17,22,41]}),(0,a.jsxs)("group",{rotation:[0,-1.4,0],children:[(0,a.jsx)(c.z,{ref:e=>{e&&(window.orbitControls=e)},target:[0,0,0],enableDamping:!0,dampingFactor:.05,enablePan:!1,enableZoom:!0,minDistance:20,maxDistance:100,minPolarAngle:0,maxPolarAngle:Math.PI/2}),(0,a.jsx)(eR,{}),(0,a.jsx)(eI,{sunPosition:D}),(0,a.jsx)(d.q,{sunPosition:D,turbidity:8,rayleigh:2,mieCoefficient:.1,mieDirectionalG:.8,inclination:.6,azimuth:.25}),(0,a.jsx)(m,{}),(0,a.jsx)(eN,{position:[0,0,0],rotation:[0,0,0],scale:[1,1,1]}),(0,a.jsx)(O,{buildings:t,positions:I,onPositionChange:J,originOffset:e,selectedBuildingId:W}),(0,a.jsx)(p,{}),(i||x)&&(0,a.jsx)(ez,{}),(r||i||x)&&(0,a.jsx)(eP,{isVisible:r,position:q,rotation:Y}),(0,a.jsx)(A,{})]})]}),U&&(0,a.jsx)(Z,{buildings:t,positions:I,onPositionChange:J,onSave:Q,hasUnsavedChanges:V,selectedBuildingId:W,onSelectedBuildingChange:H}),(0,a.jsx)(em,{buildings:t,onBusinessClick:n=>{let a=t.find(e=>e.id===n);if(a&&window.panCameraToPosition){v(n);let t=-(a.position.y+e[0]),s=(void 0!==a.position.z?a.position.z:2.75)+e[1],r=a.position.x+e[2],o=new u.Vector3(t,s,r);window.focusedBusinessPosition=o,window.panCameraToPosition(o)}},onResetCamera:()=>{window.resetCameraToDefault&&(v(null),delete window.focusedBusinessPosition,window.resetCameraToDefault(j))}}),(0,a.jsx)(T,{className:"hidden md:block"}),!y&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eC,{onClick:()=>N(!0)}),(0,a.jsx)(eE,{})]})]})}},495:function(e,t,n){"use strict";n.d(t,{z:function(){return c}});
1var a=n(7437),s=n(2265),r=n(2974),o=n(3027),i=n(7440);let l=(0,o.j)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),c=s.forwardRef((e,t)=>{let{className:n,variant:s,size:o,asChild:c=!1,...d}=e,u=c?r.g7:"button";return(0,a.jsx)(u,{className:(0,i.cn)(l({variant:s,size:o,className:n})),ref:t,...d})});c.displayName="Button"},7440:function(e,t,n){"use strict";n.d(t,{cn:function(){return r}});var a=n(4839),s=n(6164);function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,s.m6)((0,a.W)(t))}}},function(e){e.O(0,[689,842,671,204,971,23,744],function(){return e(e.s=9374)}),_N_E=e.O()}]);

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.