1import{a as m,n as f,o as p,r,u as w,p as x,j as e,L as d,W as j,A as y,O as b}from"./index-A42Nt5u3.js";import{k as v,l as S,s as g}from"./siteApi--dK-CJhq.js";import{u as k}from"./useHurricaneStatus-IbDJh54o.js";import"./weatherProxyFetch-C9PzXxhl.js";function D(){const{user:s}=m(),t=w(),{plan:n,isEmpty:a,updatePlan:o}=f(),h=p(),l=r.useRef(!1);r.useEffect(()=>{!s||l.current||(l.current=!0,(async()=>{if(localStorage.getItem("wedding_claim_pending")==="1"){localStorage.removeItem("wedding_claim_pending");try{await v(n,t.islandCode),h("/wedding-planner")}catch{}return}try{const c=await S();c.exists&&c.plan&&a?o(c.plan):!c.exists&&!a&&await g(n)}catch{}})())},[s]);const i=r.useRef(null),u=r.useRef(!0);r.useEffect(()=>{if(!(!s||a)){if(u.current){u.current=!1;return}return i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{g(n).catch(()=>{})},1200),()=>{i.current&&clearTimeout(i.current)}}},[n,s])}function N(){const{pathname:s}=x(),t=s.replace(/\/+$/,"");return t==="/wedding-planner"||t===""||t==="/wedding-planner/signin"?null:e.jsx("div",{className:"wbb",children:e.jsxs(d,{to:"/wedding-planner",className:"wbb-link",children:[e.jsx("span",{"aria-hidden":"true",children:"ð "})," My Wedding Dashboard"]})})}function T(s){const t=new Date(s+"T00:00:00"),n=new Date;return n.setHours(0,0,0,0),Math.round((t.getTime()-n.getTime())/(1e3*60*60*24))}function W(){const{plan:s}=f(),t=k(),n=s.weddingDate?T(s.weddingDate):null,a=n!==null&&n>=0&&n<=14,o=n!==null&&n>=0&&n<=7;return t.status==="approaching"&&a?e.jsxs("div",{className:"wsf-banner wsf-banner-high",role:"alert",children:[e.jsxs("strong",{children:["â ï¸ Tropical storm warning â your wedding is in ",n," day",n===1?"":"s","."]}),e.jsx(d,{to:"/emergency#hurricane-dashboard",className:"wsf-link",children:"See the Hurricane Dashboard â"})]}):t.status==="watching"&&a?e.jsxs("div",{className:"wsf-banner wsf-banner-medium",role:"status",children:[e.jsxs("strong",{children:["ð Tropical system being monitored â your wedding is in ",n," days."]}),e.jsx(d,{to:"/emergency#hurricane-dashboard",className:"wsf-link",children:"Check the Hurricane Dashboard â"})]}):o&&t.status==="clear"?e.jsxs("div",{className:"wsf-banner wsf-banner-info",role:"status",children:[e.jsxs("strong",{children:["ð
Your wedding is in ",n===0?"TODAY":`${n} day${n===1?"":"s"}`,"."]}),e.jsx(d,{to:"/weather",className:"wsf-link",children:"Open the 7-day forecast â"})]}):null}function A(){return D(),null}function R(){return e.jsx(j,{children:e.jsxs(y,{children:[e.jsx(A,{}),e.jsxs("div",{className:"wed-editorial",children:[e.jsx(N,{}),e.jsx(W,{}),e.jsx(r.Suspense,{fallback:e.jsx("div",{style:{padding:40,textAlign:"center"},children:"Loadingâ¦"}),children:e.jsx(b,{})})]})]})})}export{R 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.