1(globalThis.webpackChunkui_js_core||=[]).push([[2060],{64764(e,t,a){"use strict";var n,s=a(96540),i=a(74848);const r={sm:18,md:32,lg:50},Spinner=({size:e="lg",className:t=""})=>{const a="number"==typeof e?e:r[e];return(0,i.jsx)("svg",{className:`shrink-0 text-green-500 ${t}`,width:a,height:a,"aria-hidden":"true",focusable:"false",children:n||(n=(0,i.jsx)("use",{href:"#loading-spinner--inline"}))})};Spinner.displayName="Spinner";const LoadingState=({ariaLabel:e="Loading",showLabel:t=!1,delayMs:a=0,size:n="lg",className:r="",containerClassName:l=""})=>{const[o,c]=s.useState(0===a);return s.useEffect((()=>{if(0===a)return;const e=setTimeout((()=>c(!0)),a);return()=>clearTimeout(e)}),[a]),o?(0,i.jsxs)("div",{className:`flex flex-col items-center justify-center gap-2 ${l}`,role:"status",children:[(0,i.jsx)(Spinner,{size:n,className:r}),t&&(0,i.jsx)("span",{className:"text-sm text-gray-600",children:e}),(0,i.jsx)("span",{className:"sr-only",children:e})]}):null};LoadingState.displayName="LoadingState";a.d(t,["Gu",0,LoadingState])},63308(e,t,a){"use strict";a.d(t,{e:()=>useAsyncData});var n=a(96540);function useAsyncData(e,t,a){const s=(0,n.useRef)(a),i=(0,n.useRef)(e);i.current=e;const[r,l]=(0,n.useState)({data:s.current,error:void 0,isLoading:Boolean(e)}),o=(0,n.useRef)(!0);return(0,n.useEffect)((()=>{const e=i.current;if(o.current||l({data:s.current,error:void 0,isLoading:Boolean(e)}),o.current=!1,!e)return;let t=!0;return e().then((e=>{t&&l({data:e,error:void 0,isLoading:!1})}),(e=>{t&&l({data:s.current,error:e,isLoading:!1})})),()=>{t=!1}}),t),r}},10676(e,t,a){"use strict";function ensureCommServiceBase(e,t="communication-service"){if(!e)return`/api/${t}/`;let a=e.endsWith("/")?e:e+"/";if(/:\/\/(localhost|127\.0\.0\.1)(:\d+)?\//i.test(a)){const e=a.toLowerCase().indexOf("/api/");return-1!==e?a.substring(0,e+5):a}return`/api/${t}/`}function buildHref(e,t){const a=t.replace(/^\/+/,"");return e?`${e.replace(/\/+$/,"")}/${a}`:`/${a}`}a.d(t,{B:()=>ensureCommServiceBase,k:()=>buildHref})},20140(e,t,a){"use strict";var n=a(62051),s=a(74848);const i=(0,n.tv)({slots:{base:"w-full flex flex-col",content:""},variants:{isExpanded:{true:{content:"flex flex-col gap-1 mt-1"},false:{content:"hidden"}}},defaultVariants:{isExpanded:!1}});a.d(t,["iV",0,e=>{const{children:t,className:a,contentClassName:n,header:r,id:l,isExpanded:o,keepContentMounted:c=!1}=e,d=`collapsible-section-${l}`,u=i();return(0,s.jsxs)("section",{className:`${u.base()} ${a??""}`,children:[r({contentId:d}),(0,s.jsx)("div",{id:d,children:(o||c)&&(0,s.jsx)("div",{className:`${u.content({isExpanded:o})} ${n??""}`,children:t})})]})}])},79025(e,t,a){"use strict";a.d(t,{h:()=>CollapsibleSectionHeader});const n=(0,a(62051).tv)({slots:{base:"",headerButton:"flex w-full items-center justify-between gap-3 bg-white rounded-lg text-base/5 font-bold text-left cursor-pointer border-1 border-solid border-white hover:border-gray-100 focus:shadow-outline",title:"min-w-0 m-0 text-base/5",caretIcon:"size-5 shrink-0 text-gray-600 transition-transform duration-300 ease-in-out"},variants:{expanded:{true:{caretIcon:"rotate-180"}},headerSize:{small:{headerButton:"py-1 px-2"},medium:{headerButton:"p-2"}}}});var s,i=a(74848);const CollapsibleSectionHeader=e=>{const{className:t,headerSize:a="medium",isExpanded:r,onToggle:l,title:o,contentId:c}=e,d=n({headerSize:a});return(0,i.jsxs)("button",{"aria-controls":c,"aria-expanded":r,className:`${d.headerButton()} ${t??""}`,onClick:l,type:"button",children:[(0,i.jsx)("h2",{className:d.title(),children:o}),(0,i.jsx)("svg",{"aria-hidden":"true",className:d.caretIcon({expanded:r}),"data-testid":"collapsible-section-caret",children:s||(s=(0,i.jsx)("use",{href:"#chevron-small--inline"}))})]})}},40123(e,t,a){"use strict";a.d(t,["c",0,{quickAccess:{settingKey:"collapseQuickAccessSection"},geocaches:{settingKey:"collapseGeocachesSection"},yourHides:{settingKey:"collapseHidesSection"},plan:{settingKey:"collapsePlanSection"},community:{settingKey:"collapseCommunitySection"},shareables:{settingKey:"collapseShareablesSection"},trackables:{settingKey:"collapseTrackablesSection"},viewedFeed:{collapseOnMobile:!0,defaultExpanded:!1,settingKey:"displayRecentlyViewed",usesIsCollapsedPattern:!1},activityFeed:{settingKey:"displayRecentActivity",usesIsCollapsedPattern:!1},trackableInventory:{settingKey:"collapseTrackableInventoryDisplay",collapseOnMobile:!0},profileSummary:{settingKey:"collapseProfileSection"},quickLinksJumpBar:{settingKey:"hideJumpBar"},useCompactLayout:{settingKey:"useCompactLayout"},useCompactSettingsButton:{settingKey:"useCompactSettingsButton"},eventsWidget:{settingKey:"displayEvents",usesIsCollapsedPattern:!1},campaigns:{settingKey:"collapseCampaign"},yourCacheNotes:{settingKey:"displayYourCacheNotes",usesIsCollapsedPattern:!1}}])},78832(e,t,a){"use strict";a.d(t,{p:()=>useDashboardExpandedState});var n=a(96540);const hasAttributes=e=>"object"==typeof e&&null!==e&&"object"==typeof e.attributes&&null!==e.attributes,hasSetter=e=>"object"==typeof e&&null!==e&&"function"==typeof e.set,hasSave=e=>"object"==typeof e&&null!==e&&"function"==typeof e.save,readDashboardSettingValue=(e,t)=>
1{var a;if(e)return"object"==typeof(a=e)&&null!==a&&"function"==typeof a.get?e.get(t):hasAttributes(e)?e.attributes[t]:e[t]},getExpandedStateFromSetting=({defaultExpanded:e,settingValue:t,usesIsCollapsedPattern:a})=>null==t?e:a?!Boolean(t):Boolean(t);function useDashboardExpandedState({dashboardSettings:e,settingKey:t,isMobileDevice:a=!1,collapseOnMobile:s=!1,defaultExpanded:i=!0,usesIsCollapsedPattern:r=!0}){const[l,o]=(0,n.useState)((()=>(!s||!a)&&getExpandedStateFromSetting({defaultExpanded:i,settingValue:readDashboardSettingValue(e,t),usesIsCollapsedPattern:r}))),c=(0,n.useRef)(l),d=(0,n.useRef)(!0),u=(0,n.useRef)(void 0);(0,n.useEffect)((()=>{u.current=readDashboardSettingValue(e,t);const n=(!s||!a)&&getExpandedStateFromSetting({defaultExpanded:i,settingValue:readDashboardSettingValue(e,t),usesIsCollapsedPattern:r});d.current=!0,c.current=n,o(n)}),[e,t,a,s,i,r]),(0,n.useEffect)((()=>{if(s&&a)return;if(d.current)return void(d.current=!1);if(c.current===l)return;c.current=l;const n=(({isExpanded:e,usesIsCollapsedPattern:t})=>t?!e:e)({isExpanded:l,usesIsCollapsedPattern:r});Promise.resolve(((e,t,a)=>{if(e&&t){if(hasSetter(e)){const n=e.set(t,a);if(hasSave(n))return n.save();if(hasSave(e))return e.save()}hasAttributes(e)?e.attributes[t]=a:e[t]=a}})(e,t,n)).then((()=>{u.current=n}),(()=>{readDashboardSettingValue(e,t)===n&&hasSetter(e)&&e.set(t,u.current)}))}),[e,t,l,a,s,r]);const m=(0,n.useCallback)((()=>{o((e=>!e))}),[]);return{isExpanded:l,setIsExpanded:o,toggleExpanded:m}}a.d(t,["I",0,readDashboardSettingValue])},30005(e,t,a){"use strict";a.d(t,{render:()=>render});var n=a(96540),s=a(5338),i=a(40961),r=a(17988),l=a(13205),o=a(91304),c=a(54028),d=a(10676),u=a(34743),m=a(83505),h=a(7315),p=a(62051),g=a(74848);const alignTopEdgeToElement=e=>({name:"alignTopEdgeToElement",options:e,async fn(t){const a=(e=>{if(!e)return null;const t=Array.isArray(e)?e:[e];for(const e of t){if("string"!=typeof e)return e;if("undefined"==typeof document)continue;let t=null;try{t=document.querySelector(e)}catch{t=null}if(t)return t}return null})(e);if(!a)return{};const{reference:n}=await t.platform.getElementRects({reference:a,floating:t.elements.floating,strategy:t.strategy});return{y:n.y}}}),f=(0,p.tv)({slots:{base:"z-[2000]"},variants:{defaultStyles:{true:{base:"bg-white rounded-lg p-5 break-words shadow-[0_8px_32px_0_rgba(0,0,0,0.08)]"}}}}),Popover=e=>{const{anchor:t,allowFlip:a=!1,allowShift:s=!1,alignTopEdgeTo:i,arrowFill:r="white",autoUpdateOptions:l,boundary:o,children:c,className:d,hasArrow:p=!0,offset:x=10,onOpenChange:y,open:b,portal:v=!1,portalRoot:w=document?.body??null,placement:j="auto",strategy:k="absolute",unstyled:C=!1,updateOnAncestorScroll:N=!0,x:L,y:T,...S}=e,I=void 0!==L&&void 0!==T,A=n.useRef(null),P=[a&&(0,u.UU)({boundary:o,fallbackAxisSideDirection:"start"}),s&&(0,u.BN)(),(0,u.cY)(x),"auto"===j&&(0,u.RK)(),i&&alignTopEdgeToElement(i),p&&(0,u.UE)({element:A})].filter(Boolean),{context:D,floatingStyles:E,refs:M}=(0,m.we)({middleware:P,open:b,onOpenChange:y,placement:(()=>{let e="auto"!==j?j:void 0;return I&&(e=void 0),e})(),strategy:k,whileElementsMounted:(e,t,a)=>(0,h.ll)(e,t,a,{ancestorScroll:N,...l})}),$=(0,m.ju)(D,{enabled:I,x:L,y:T}),F=(0,m.s9)(D,{bubbles:!1,capture:!0}),R=[(0,m.It)(D,{role:"dialog"}),F];I&&R.push($);const{getReferenceProps:O,getFloatingProps:B}=(0,m.bv)(R),U=n.useMemo((()=>(0,g.jsxs)("div",{className:f({defaultStyles:!C}).base({className:d}),ref:M.setFloating,"data-testid":"gc-popover",style:E,...B(),...S,children:[c,p&&(0,g.jsx)(m.ie,{ref:A,context:D,fill:r})]})),[r,c,d,D,E,B,p,M,S,C]),K=(0,g.jsx)(m.XF,{root:w??document?.body,children:U}),z=v?K:U;return(0,g.jsxs)(g.Fragment,{children:[t(M.setReference,O),b&&z]})};Popover.displayName="Popover";var x=a(73965),y=a(43427),b=a(49586);const v=(0,p.tv)({slots:{base:"",topContainer:"",headerRow:"flex flex-col gap-x-2 gap-y-4 mb-4 tablet:flex-row tablet:items-center tablet:justify-between",pageHeading:"text-lg/6 tablet:text-5/8 m-0",settingsBtn:"bg-white rounded-lg flex gap-2 items-center leading-[20px] justify-center",settingsBtnIcon:"block my-[1px]",settingsPopoverContent:"flex flex-col gap-4",settingsPopoverHeading:"m-0 text-4/6 font-bold text-gray-600",settingsRow:"flex items-center justify-between gap-2",settingsLabel:"text-sm/5 text-gray-600 m-0",playerTagContainer:"h-5 flex items-center",playerTag:"py-[2px] px-2 text-gray-600 bg-gray-100 rounded text-base/5 font-bold",playerTagIcon:"block",mainContentArea:"flex flex-col min-w-0 max-w-full",leftColumn:"flex flex-col min-w-0 max-w-full",leftColumnInner:"flex flex-col",centerColumn:"flex flex-col min-w-0",rightColumn:"flex flex-col gap-5 min-w-0 max-w-full"},variants:{numberOfColumns:{one:{mainContentArea:"gap-4",leftColumn:"gap-4",centerColumn:"gap-4 max-w-full"},two:{mainContentArea:"gap-5 flex-row",leftColumn:"gap-5 w-[288px] shrink-0",centerColumn:"gap-5 flex-1",rightColumn:"gap-5 mt-5"},three:{mainContentArea:"gap-5 flex-row",leftColumn:"gap-5 w-[288px] shrink-0",centerColumn:"gap-5 flex-1",rightColumn:"gap-5 w-[288px] shrink-0"}},isPremium:{true:{playerTag:""}},isLackey:{true:{playerTag:"bg-green-100 text-green-600"}},isCharter:{true:{playerTag:"bg-blue-100 text-blue-600"}},stackContent:{true:{settingsRow:"flex-col items-start"}},useCompactLayout:{true:{leftColumnInner:"gap-1"},false:{leftColumnInner:"gap-2"}}},defaultVariants:{useCompactLayout:!1}});var w=a(36947),j=a(95466),k=a(63308);const C=["disabledPublishedCaches","disabledPublishedEvents","needsMaintenance","publishedReviewerNoteCaches","publishedReviewerNoteEvents","publishedLowHealthCaches","unpublishedReviewerNoteCaches","unpublishedReviewerNoteEvents"],N=["unpublishedSubmittedCaches","unpublishedSubmittedEvents"],L=[...C,...N],T=L.reduce(((e,t)=>(e[t]=0,e)),{}),useCodAlert=e=>{const{data:t}=(0,k.e)((()=>(async e=>{try{const t=await fetch(`${e??""}${j.i}/cacheowner/geocaches/counts?properties=${L.join(",")}`,{credentials:"include"});return t.ok?{...T,...await t.json()}:T}catch(e){return console.error(e),T}}
1)(e)),[e],T),a=n.useMemo((()=>({needsAttention:C.reduce(((e,a)=>e+t[a]),0),unpublishedSubmitted:N.reduce(((e,a)=>e+t[a]),0)})),[t]);return{bannerCounts:a,counts:t,hasNeedsAttentionAlert:a.needsAttention>0,hasUnpublishedSubmittedAlert:a.unpublishedSubmitted>0}},S=(0,p.tv)({slots:{base:["flex flex-wrap items-start gap-x-3 gap-y-2 px-4 py-3 text-base/5","bg-blue-50 border-blue-300 border-solid border-1 rounded-lg","transition-all ease-in-out duration-250"].join(" "),iconTextWrapper:"flex items-center gap-3",icon:"shrink-0 size-[20px] text-blue-500",text:"p-0 m-0",linkWrapper:"ml-auto",ctaLink:"inline-block text-blue-500 underline hover:no-underline focus:shadow-outline"}}),I={needsAttention:{defaultAnalyticsLabel:"Cache owner - review hides that need attention",defaultHrefPath:"/play/owner",defaultLinkText:"Review your hides",defaultText:"Some of your hides may need attention.",iconName:"bell-notification-filled"},unpublishedSubmitted:{defaultAnalyticsLabel:"Cache owner - view unpublished hides",defaultHrefPath:"/play/owner/unpublished",defaultLinkText:"View unpublished hides",defaultText:"{0} of your hides are {1}in review{2}",iconName:"clock-filled"}},formatBannerText=(e,t)=>e?e.replace("{0}",String(t)):e,BannerIcon=({iconName:e})=>(0,g.jsx)("svg",{"aria-hidden":"true",className:S().icon(),height:"20",viewBox:"0 0 20 20",width:"20",children:(0,g.jsx)("use",{href:`#${e}--inline`})}),Banner=({analyticsLabel:e,count:t,href:a,iconName:n,linkText:s,text:i})=>(0,g.jsxs)("div",{className:S().base(),role:"alert","aria-live":"polite",children:[(0,g.jsxs)("div",{className:S().iconTextWrapper(),children:[(0,g.jsx)(BannerIcon,{iconName:n}),(0,g.jsx)("p",{className:S().text(),children:formatBannerText(i,t)})]}),(0,g.jsx)("div",{className:S().linkWrapper(),children:(0,g.jsx)("a",{className:S().ctaLink(),"data-event-action":"cta","data-event-category":"data","data-event-label":e,href:a,children:s})})]}),CacheOwnerFeed=e=>{const{analyticsPageTitle:t,className:a,host:n="",codUrl:s="",resources:i,supportedBanners:r=["needsAttention","unpublishedSubmitted"]}=e,l=s||"",{bannerCounts:o,hasNeedsAttentionAlert:c,hasUnpublishedSubmittedAlert:d}=useCodAlert(n),u={needsAttention:c,unpublishedSubmitted:d},m=r.map((e=>{const a=I[e],n=o[e]??0;if(!a||!u[e]||n<1)return null;const s="needsAttention"===e?"needsAttention":"unpublishedSubmitted";return{analyticsLabel:t?`${t} - ${a.defaultAnalyticsLabel}`:a.defaultAnalyticsLabel,count:n,href:`${l}${a.defaultHrefPath}`,iconName:a.iconName,key:e,linkText:i?.[`${s}Link`]??i?.[`${s}LinkText`]??a.defaultLinkText??void 0,text:i?.[`${s}Text`]??i?.[`${s}AlertText`]??a.defaultText??void 0}})).filter((e=>Boolean(e&&void 0!==e.linkText&&void 0!==e.text)));return m.length?(0,g.jsx)("div",{className:a,"data-testid":"cod-alert",children:m.map((({analyticsLabel:e,count:t,href:a,iconName:n,key:s,linkText:i,text:r})=>(0,g.jsx)(Banner,{analyticsLabel:e,count:t,href:a,iconName:n,linkText:i,text:r},s)))}):null};CacheOwnerFeed.displayName="CacheOwnerFeed";var A=a(40123),P=a(20140),D=a(79025),E=a(78832);const M=(0,p.tv)({slots:{base:["flex items-center flex-nowrap justify-between gap-4","mx-1 py-2 px-4 rounded-lg bg-gray-50 text-xs/4"].join(" "),settingsBtn:"bg-transparent border-0 p-0 rounded cursor-pointer focus:shadow-outline",settingsIcon:"flex size-[18px]"}}),$=(0,p.tv)({slots:{base:"event-list-item border-0 border-b-1 border-solid border-gray-100",detailsBlock:"relative flex flex-nowrap justify-start items-center max-w-full gap-2 py-3 pl-2 pr-3",eventIcon:"shrink-0 size-6",ownedIcon:"size-4 absolute -top-[4px] -left-[4px]",detailsText:"flex flex-col grow shrink min-w-0 gap-1",eventHeader:"text-base/5 m-0 flex min-w-0",eventName:"block text-gray-600 no-underline border-none bg-transparent p-0 text-left font-bold cursor-pointer focus:shadow-outline",detailsList:"m-0 p-0 list-none text-xs flex flex-nowrap gap-2",detailsOwner:"shrink min-w-0",detailsOwnerText:"truncate text-gray-600 no-underline",detailsTimeAndDistance:"shrink-0 items-center",collapsedAttendedOrRsvpIcon:"size-5 shrink-0",mapContainer:"h-[90px]",attendanceInfoAndActions:"flex flex-col items-center gap-2 py-4",expandedAttendedOrRsvpIcon:"py-[10px] px-4 border border-solid border-green-300 rounded m-0 flex gap-2 items-center bg-green-50",friendsText:"block"},compoundSlots:[{slots:["detailsOwner","detailsTimeAndDistance"],class:["flex","gap-1"]}],variants:{selected:{true:{collapsedAttendedOrRsvpIcon:"hidden"},false:{detailsBlock:"cursor-pointer",eventName:"truncate"}},isArchivedOrDisabled:{true:{eventHeader:"line-through",expandedAttendedOrRsvpIcon:"border-gray-200 bg-gray-50 text-gray-200"}},isEmpty:{true:{attendanceInfoAndActions:"py-0"}}}});var F=a(28975),R=a(41437);const O="6,13,453,1304,3653,3774,4738,7005",getUserInfo=e=>window.App?.Settings?.get?.("user:info")??e??{},getApiSettingsRoot=()=>window.App?.Settings?.get?.("api:settings"),getApiSetting=(e,t)=>
1getApiSettingsRoot()?.get?.(e)?.get?.(t),saveApiSetting=(e,t,a)=>{const n=getApiSettingsRoot()?.get?.(e);if(!n||n.get?.(t)===a)return;const s=n.set?.(t,a)?.save?.();s?.catch?.((e=>{console.error(`Error saving ${t}: `,e)}))},getFetchRadiusInMiles=e=>e.isMetric?(0,R.qR)(e.radius):e.radius,getEventText=(e,t,a)=>{const n=e?.[t];return"string"==typeof n&&n.length?n:a},getCardinalText=(e,t)=>{const a=window.cardinals?.[e];return"string"==typeof a&&a.length?a:t};var B;const EventHeaderMeta=({i18n:e,preferences:t,shouldFocusSettingsButton:a,onFocusTransferred:s,onOpenSettings:i})=>{const r=(0,n.useRef)(null),l=M(),o=t.isMetric?getCardinalText("Km","km"):getCardinalText("Mi","mi"),c=getEventText(e,"RadiusToHome","Events within {0} of home"),[d,u=""]=c.split("{0}");return(0,n.useEffect)((()=>{a&&(r.current?.focus(),s())}),[s,a]),(0,g.jsxs)("div",{className:l.base(),children:[(0,g.jsxs)("p",{className:"m-0",children:[d,(0,g.jsxs)("strong",{children:[t.radius," ",o]}),u]}),(0,g.jsx)("button",{"aria-label":getEventText(e,"Settings","Settings"),"aria-expanded":"false","aria-controls":"eventsWidgetSettings",className:l.settingsBtn(),id:"eventsSettingsMenuBtn",onClick:i,ref:r,title:getEventText(e,"Settings","Settings"),type:"button",children:(0,g.jsx)("svg",{className:l.settingsIcon(),children:B||(B=(0,g.jsx)("use",{href:"#settings--inline"}))})})]})};var U,K;const EventsLoadingState=()=>U||(U=(0,g.jsx)("div",{className:"loading"})),EventsErrorState=({i18n:e})=>(0,g.jsx)("div",{className:"bg-orange-50 border border-solid border-orange-300 text-gray-600 p-4 m-2 mt-0 rounded-lg",children:(0,g.jsx)("p",{className:"m-0",children:getEventText(e,"LoadError","Unable to load events.")})}),EmptyEventsState=({i18n:e,preferences:t,shouldFocusSettingsButton:a,onFocusTransferred:n,onOpenSettings:s})=>{const i=t.isMetric?getCardinalText("Km","km"):getCardinalText("Mi","mi"),r=getEventText(e,"NoEventsDetails","No events within {0}").replace("{0}",`${t.radius} ${i}`);return(0,g.jsxs)("div",{className:"empty flex flex-col",children:[(0,g.jsx)("div",{id:"EventsMeta",className:"w-full",children:(0,g.jsx)(EventHeaderMeta,{i18n:e,onFocusTransferred:n,onOpenSettings:s,preferences:t,shouldFocusSettingsButton:a})}),(0,g.jsxs)("div",{className:"flex flex-col items-center text-center gap-4 px-5 pt-3 pb-6",children:[K||(K=(0,g.jsx)("svg",{className:"m-auto h-[100px] w-[141px]",children:(0,g.jsx)("use",{href:"#dnf-moment--inline"})})),(0,g.jsx)("p",{className:"m-0",children:r}),(0,g.jsx)("a",{href:`/play/search/?origin=home&radius=100mi&types=${O}&pe=1&sort=PlaceDate&asc=True`,className:"btn btn-primary",children:getEventText(e,"SearchEvents","Search events")})]})]})};var z=a(53481),H=a.n(z),W=a(52653),G=a.n(W),V=a(75360);const _={getFormattedDistance:function(e,t){let a=App.Settings.get("user:info").distanceUnit;const n="number"==typeof t?t:2;let s;if(a||(a="Imperial",console.warn("No distanceUnit defined in Settings->user:info. Defaulting to Imperial"),console.trace()),"number"!=typeof e&&Number.isNaN(Number(e))){if(null===e||"object"!=typeof e)return console.error("getFormattedDistance takes a number or an object with 'Imperial' and 'Metric' keys."),console.trace(),!1;try{s=e[a]}catch(e){return console.error("getFormattedDistance takes a number or an object with 'Imperial' and 'Metric' keys.",e),console.trace(),!1}}else s=e;return Number(!1===t?s:s.toFixed(n))}},Y=_;var q,J;const{GeocacheTypeLabels:Q}=V.dc,Z=$(),formatEventStartTime=e=>{let t=(e=>{const t=e.get("dateTimeStartLuxon");return F.A.isDateTime(t)?t:F.A.fromISO(e.get("dateTimeStart"))})(e).setLocale(window.App?.Settings?.get?.("user:info")?.locale).toLocaleString(F.A.TIME_SIMPLE).toLowerCase();if(t.includes(" ")){const e=t.split(/[ :]+/);if(3===e.length&&"00"===e[1])return`${e[0]}${e[2]}`;t=t.split(" ").join("")}return t},renderTextWithContent=(e,t)=>{const a=e.split("{0}");return 1===a.length?e:(0,g.jsxs)(g.Fragment,{children:[a[0],t,a.slice(1).map(((e,t)=>(0,g.jsx)(n.Fragment,{children:e},t)))]})},EventMap=({event:e})=>{const t=(0,n.useRef)(null);return(0,n.useEffect)((()=>
1{const a=t.current,n=e.get("coordinates");if(!a||!n)return;const s=H().map(a,{attributionControl:!1,center:[n.latitude,n.longitude],zoom:11,zoomControl:!1});return H().tileLayer("https://maptiles{s}.geocaching.com/tile/{z}/{x}/{y}.png",{subdomains:["01","02","03","04","05","06","07","08"]}).addTo(s),H().marker([n.latitude,n.longitude],{icon:H().icon({iconUrl:`/account/app/ui-icons/icons/cache-types/${e.get("cacheTypeId")}${e.get("isArchivedOrDisabled")?"-disabled":""}.svg`,iconSize:[24,24],iconAnchor:[12,24],popupAnchor:[1,-24],shadowUrl:null})}).addTo(s),()=>{s.remove()}}),[e]),(0,g.jsx)("div",{className:`event-list-item-map ${Z.mapContainer()}`,ref:t})},EventListItem=({event:e,i18n:t,isMetric:a,isSelected:n,onSelect:s})=>{const i=Z,r=((e,t)=>e.get("isInPast")&&e.get("isAttended")?{icon:"foundit"+(e.get("isArchivedOrDisabled")?"_disabled":""),label:getEventText(t,"HasAttended","Attended")}:!e.get("isInPast")&&e.get("isRsvp")?{icon:"willattend"+(e.get("isArchivedOrDisabled")?"_disabled":""),label:getEventText(t,"YouWillAttend","You will attend")}:!e.get("isInPast")&&e.get("isOwner")?{...e.get("links"),label:getEventText(t,"EventAnnouncement","Event announcement")}:e.get("isInPast")&&!e.get("isAttended")?{...e.get("links"),label:getEventText(t,"LogAttended","Log attended")}:e.get("isInPast")||e.get("isRsvp")||e.get("isCancelled")?null:{...e.get("links"),label:getEventText(t,"Rsvp","RSVP")})(e,t),l=((e,t)=>{const a=e.relationships?.friends;if(!a?.data?.length)return null;const n=a.data[0],s="function"==typeof n?.get?n.get("username"):n?.username;if(!s)return null;const i=a.meta?.count??0;let r="";return i>1?(r=e.get("isInPast")?getEventText(t,"FriendAttendedMultiple","{0} +{1} friends attended"):getEventText(t,"FriendAttendingMultiple","{0} +{1} friends attending"),r=r.replace("{1}",""+(i-1))):r=e.get("isInPast")?getEventText(t,"FriendAttended","{0} attended"):getEventText(t,"FriendAttending","{0} attending"),r.replace("{0}",s)})(e,t),o=(e=>{const t=e.relationships?.author?.data;return t?.attributes??t?.toJSON?.()??{}})(e),c=Q[e.get("cacheTypeId")]??"",d=n?(0,g.jsx)("a",{className:i.detailsOwnerText(),href:o.links?.profile,target:"_blank",title:o.username,children:o.username}):(0,g.jsx)("span",{className:i.detailsOwnerText(),title:o.username,children:o.username}),u=e.get("links")?.self,m=e.get("name"),h=e.get("isArchivedOrDisabled");return(0,g.jsxs)("li",{className:i.base(),children:[(0,g.jsxs)("div",{className:i.detailsBlock({selected:n}),onClick:e=>{n||(e.preventDefault(),s())},children:[(0,g.jsxs)("div",{className:"relative",children:[(0,g.jsx)("svg",{className:i.eventIcon(),"aria-hidden":"true",children:(0,g.jsx)("use",{href:`/app/ui-icons/sprites/cache-types.svg#icon-${e.get("cacheTypeId")}${h?"-disabled":""}`})}),e.get("isOwner")&&(0,g.jsx)("svg",{className:i.ownedIcon(),"aria-hidden":"true",children:(0,g.jsx)("use",{href:`#owned${h?"_disabled":""}--inline`})})]}),(0,g.jsxs)("div",{className:i.detailsText(),children:[(0,g.jsx)("h3",{className:i.eventHeader({isArchivedOrDisabled:h}),id:`eventName${e.cid}`,children:n?(0,g.jsx)("a",{"aria-description":c||void 0,className:i.eventName({selected:!0}),href:u,target:"_blank",title:m,children:m}):(0,g.jsx)("button",{"aria-controls":`eventExpandableContent${e.cid}`,"aria-description":c||void 0,"aria-expanded":"false",className:i.eventName({selected:!1}),title:m,type:"button",children:m})}),(0,g.jsxs)("ul",{"aria-describedby":`eventName${e.cid}`,className:i.detailsList(),children:[(0,g.jsx)("li",{className:i.detailsOwner(),title:getEventText(t,"EventOwner","Event owner"),children:renderTextWithContent(getEventText(t,"By","by {0}"),d)}),(0,g.jsxs)("li",{className:i.detailsTimeAndDistance(),title:getEventText(t,"Distance","Distance"),children:[(0,g.jsx)("svg",{className:"size-3",role:"img","aria-label":getEventText(t,"Distance","Distance"),children:q||(q=(0,g.jsx)("use",{href:"#pin--inline"}))}),Y.getFormattedDistance({Metric:e.get("distanceInKm"),Imperial:e.get("distanceInMiles")},0)," ",a?getCardinalText("Km","km"):getCardinalText("Mi","mi")," ",e.get("cardinal")]}),(0,g.jsxs)("li",{className:i.detailsTimeAndDistance(),title:getEventText(t,"EventTime","Event time"),children:[(0,g.jsx)("svg",{className:"size-3",role:"img","aria-label":getEventText(t,"EventTime","Event time"),children:J||(J=(0,g.jsx)("use",{href:"#time--inline"}))}),formatEventStartTime(e)]})]})]}),e.get("isAttended")&&(0,g.jsx)("svg",{className:i.collapsedAttendedOrRsvpIcon({selected:n}),role:"img","aria-label":getEventText(t,"LogAttended","Log attended"),children:(0,g.jsx)("use",{href:`#smiley${h?"_disabled":""}--inline`})}),!e.get("isAttended")&&e.get("isRsvp")&&(0,g.jsx)("svg",{className:i.collapsedAttendedOrRsvpIcon({selected:n}),role:"img","aria-label":getEventText(t,"Rsvp","RSVP"),children:(0,g.jsx)("use",{href:`#willattend${h?"_disabled":""}--inline`})})]}),(0,g.jsxs)("div",{className:n?void 0:"hidden",id:`eventExpandableContent${e.cid}`,children:[n&&(0,g.jsx)(EventMap,{event:e}),(0,g.jsxs)("div",{className:i.attendanceInfoAndActions({isEmpty:!r&&!l}),children:[r?.icon&&(0,g.jsxs)("span",{className:i.expandedAttendedOrRsvpIcon({isArchivedOrDisabled:h}),children:[(0,g.jsx)("svg",{className:"size-5",children:(0,g.jsx)("use",{href:`#${r.icon}--inline`})}),(0,g.jsx)("span",{children:r.label})]}),r&&!r.icon&&(0,g.jsx)("a",{href:r.action,target:"_blank",className:`${(0,w.P$)()}`,children:r.label}),l&&(0,g.jsx)("span",{className:i.friendsText(),children:l})]})]})]})},EventList=({events:e,i18n:t,preferences:a,selectedDay:s,selectedEventCid:i,selectedEventsCount:r,onSelectEvent:l})=>{const o=(0,n.useMemo)((()=>e.filter((e=>G()(e.get("dateTimeStart")).isSame(s,"day"))).sort(((e,t)=>
1{const n=7005===e.get("cacheTypeId")||453===e.get("cacheTypeId")?0:1,s=7005===t.get("cacheTypeId")||453===t.get("cacheTypeId")?0:1;if(n!==s)return n-s;if(a.sortByTime){const a=e.get("dateTimeStart"),n=t.get("dateTimeStart");return"string"!=typeof a||"string"!=typeof n?0:a.localeCompare(n)}return e.get("distanceInKm")-t.get("distanceInKm")}))),[e,a.sortByTime,s]),c=G()(s).format(window.App?.Settings?.get?.("user:info")?.dateFormat?.toUpperCase?.()??"L"),d=r>7,u=d?getEventText(t,"SearchEventsMany","Search {0} more events").replace("{0}",""+(r-7)):getEventText(t,"SearchEvents","Search events"),m=d?"pod":"ed",h=a.isMetric?"km":"mi",p=`/play/search/?origin=home&radius=${a.radius}${h}&types=${O}&sort=PlaceDate&asc=True&${m}=${s}`;return(0,g.jsxs)("div",{className:"rounded-lg",children:[(0,g.jsx)("h2",{id:"eventsListSelectedDay",className:"px-4 py-2 text-center text-base/5 font-normal m-0",children:c}),(0,g.jsx)("div",{className:"events-list-container",children:o.length?(0,g.jsx)("ul",{"aria-describedby":"eventsListSelectedDay",className:"list-none m-0 p-0 border-0 border-t-1 border-solid border-gray-100",children:o.slice(0,7).map((e=>(0,g.jsx)(EventListItem,{event:e,i18n:t,isMetric:a.isMetric,isSelected:i===e.cid,onSelect:()=>l(e.cid)},e.cid)))}):(0,g.jsx)("div",{className:"px-3 py-4 text-center border-0 border-t-1 border-b-1 border-solid border-gray-100",children:(0,g.jsx)("p",{className:"m-0",children:getEventText(t,"NoEventsScheduledForSelectedDay","No events scheduled within your search radius. Try selecting another day.")})})}),(0,g.jsx)("div",{className:"px-4 py-2.5 text-center",children:(0,g.jsx)("a",{"data-event-category":"data","data-event-label":"account dashboard - event widget - see more events",className:"center text-blue-600",target:"_blank",href:p,children:u})})]})};var X=a(15930);const ee=(0,p.tv)({slots:{base:"relative h-5 w-full",barLeft:"absolute left-0 right-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-gray-100",barRight:"absolute left-0 top-1/2 h-1 -translate-y-1/2 rounded-full",rangeInput:"peer absolute inset-0 z-30 m-0 h-5 w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",thumb:"pointer-events-none absolute top-1/2 z-20 h-[20px] w-[20px] -translate-y-1/2 rounded-full border-2 border-solid"},variants:{disabled:{true:{base:"opacity-[.38]",barRight:"bg-gray-500",thumb:"border-gray-500 bg-gray-400"},false:{barRight:"bg-green-500",thumb:"border-green-500 bg-green-400 peer-focus:ring-2 peer-focus:shadow-outline peer-hover:bg-green-500"}}},defaultVariants:{disabled:!1}}),Slider=({min:e=0,max:t=100,value:a,defaultValue:s=30,disabled:i=!1,onChange:r,className:l="",inputClassName:o="",style:c,...d})=>{const[u,m]=(0,n.useState)(s),h=void 0!==a,p=h?a:u,f=ee({disabled:i});(0,n.useEffect)((()=>{h||m(s)}),[s,h]);const x=t-e,y=x>0?Math.min(100,Math.max(0,(p-e)/x*100)):0,b=`calc(${y}% - ${.2*y}px)`,v=`calc(${y}% - ${.2*y}px + 10px)`;return(0,g.jsxs)("div",{className:`${f.base()} ${l}`,style:{...c,"--slider-thumb-offset":b,"--slider-progress":v},children:[(0,g.jsx)("span",{"aria-hidden":"true",className:f.barLeft()}),(0,g.jsx)("span",{"aria-hidden":"true",className:f.barRight(),style:{width:"var(--slider-progress)"}}),(0,g.jsx)("input",{...d,className:`${f.rangeInput()} ${o}`,disabled:i,max:t,min:e,onChange:e=>{const t=Number(e.target.value);h||m(t),r?.(t)},type:"range",value:p}),(0,g.jsx)("span",{"aria-hidden":"true",className:f.thumb(),style:{left:"var(--slider-thumb-offset)"}})]})},te="text-base leading-5 p-4 flex flex-col gap-4",ae="sr-only",ne="flex gap-1 text-[20px]/7 mt-2",se="mt-[2px]",ie="mb-2",re="flex gap-4",le="normal-case",oe="flex flex-row mt-2 gap-4",renderDistanceFromHome=e=>{const[t,a]=e.split("{0}");if(!a)return e;const[n,s=""]=a.split("{1}");return(0,g.jsxs)(g.Fragment,{children:[t,(0,g.jsx)("a",{href:"/account/settings/homelocation",children:n}),s]})},EventSettings=({i18n:e,preferences:t,onCancel:a,onSubmit:s})=>{const[i,r]=(0,n.useState)(t.radius),[l,o]=(0,n.useState)(t.sortByTime),[c,d]=(0,n.useState)(t.startWeekOnMonday),u=getEventText(e,t.isMetric?"DistanceInKm":"DistanceInMi",t.isMetric?"{0} km":"{0} mi"),[m,h=""]=u.split("{0}"),p=getEventText(e,"DistanceFromHome","Distance from home");return(0,g.jsxs)("div",{className:`events-widget-settings ${te}`,id:"eventsWidgetSettings",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("h2",{className:ae,children:getEventText(e,"Settings","Settings")}),(0,g.jsx)("div",{children:renderDistanceFromHome(p)}),(0,g.jsxs)("div",{className:ne,children:[m,(0,g.jsx)("strong",{id:"sliderRadius",children:i}),h]}),(0,g.jsx)(Slider,{"aria-label":(f=p,f.replace("{0}","").replace("{1}","")),className:se,id:"distanceFromHomeSlider",max:t.maxRadius,min:1,onChange:r,value:i})]}),(0,g.jsxs)("fieldset",{children:[(0,g.jsx)("legend",{className:ie,children:getEventText(e,"SortBy","Sort by")}),(0,g.jsxs)("div",{className:re,children:[(0,g.jsx)(X.bh,{checked:!l,inputProps:{id:"distanceRadio"},name:"distanceTime",onChange:e=>o("time"===e),value:"distance",label:getEventText(e,"Distance","Distance"),labelProps:{className:le}}),(0,g.jsx)(X.bh,{checked:l,inputProps:{id:"timeRadio"},name:"distanceTime",onChange:e=>o("time"===e),value:"time",label:getEventText(e,"Time","Time"),labelProps:{className:le}})]})]}),(0,g.jsxs)("fieldset",{children:[(0,g.jsx)("legend",{className:ie,children:getEventText(e,"StartWeekOn","Start week on")}),(0,g.jsxs)("div",{className:re,children:[(0,g.jsx)(X.bh,{checked:!c,inputProps:{id:"startWeekOnSundayRadio"},name:"startWeekOn",onChange:e=>d("monday"===e),value:"sunday",label:getEventText(e,"Sunday","Sunday"),labelProps:{className:le}}),(0,g.jsx)(X.bh,{checked:c,inputProps:{id:"startWeekOnMondayRadio"},name:"startWeekOn",onChange:e=>d("monday"===e),value:"monday",label:getEventText(e,"Monday","Monday"),labelProps:{className:le}})]})]}),(0,g.jsxs)("div",{className:oe,children:[(0,g.jsx)("button",{className:(0,w.HY)({className:"flex-1"}),id:"btnCancelUpdateSettings",onClick:a,type:"button",children:getEventText(e,"Cancel","Cancel")}),(0,g.jsx)("button",{className:(0,w.P$)({className:"flex-1"}),id:"btnUpdateSettings",onClick:()=>
1s({radius:i,sortByTime:l,startWeekOnMonday:c}),type:"button",children:getEventText(e,"Update","Update")})]})]});var f};var ce=a(74692),de=a.n(ce),ue=a(79297),me=a(21391),he=a.n(me),pe=a(78603),ge=a.n(pe);a(39158);App.Localizations.set("cache:sizes",window.cacheSizes);const fe="Player Dashboard",xe=App?.Settings?.get("api:settings")?.get("dashboard");App.Localizations.set("dashboard:resources",window.Localizations),App.Localizations.set("cache:type:labels",window.geocacheTypeLabels),App.Localizations.set("cardinals",window.cardinals);const ye=App.Localizations.get("dashboard:resources")??{},be=(App.Localizations.get("cardinals"),ye.playerDashboard,ye.events),ve=App.Localizations.get("cache:type:labels");var we=a(29960),je=a.n(we);const ke=(0,p.tv)({slots:{base:"",controlBase:"relative m-1 flex items-center justify-between gap-2",monthYear:"block text-base/5 ml-4",controlBtnContainer:"flex flex-no-wrap gap-2 items-center mr-3",controlBtn:["size-5 cursor-pointer p-0 border-none ","bg-transparent text-gray-600 focus:shadow-outline","disabled:opacity-[.38] disabled:cursor-default"].join(" "),daysHeaderGrid:"text-center mb-1",dayHeader:"bg-gray-50 py-[2px]",daysGrid:"",dayButton:["group relative flex flex-col items-center justify-center h-[30px]","bg-gray-50 border-none focus:z-10 focus:shadow-outline","cursor-pointer [&.selected]:shadow-outline hover:bg-gray-100"].join(" "),eventIcon:"absolute top-px right-[2px]",eventCountIndicatorContainer:"absolute bottom-[3px] right-0 left-0 flex justify-center group-[.bg-gray-50]:text-red-600"},compoundSlots:[{slots:["daysHeaderGrid","daysGrid"],class:["grid","grid-cols-7","gap-[2px]","text-xs/4"]},{slots:["dayHeader","dayButton"],class:["leading-5","rounded"]}],variants:{controlType:{next:{controlBtn:"right-[8%]"},prev:{controlBtn:"left-[8%]"}},today:{true:{dayButton:"font-bold"}},highlighted:{true:{dayButton:"text-white bg-green-500 hover:bg-green-500 [&.selected]:bg-green-500 hover:bg-green-700"}}}}),{GeocacheTypes:Ce}=V.dc,Ne=ge().View.extend({template:!1,className:"events-calendar",initialize:function(e){this.options=e||{},ue.default.bindAll(this,"onDayClick"),ue.default.bindAll(this,"onMonthChange"),ue.default.bindAll(this,"syncCalendarEvents"),ue.default.bindAll(this,"getCalendarArrowAnalyticsLabel"),this._CurrentMonth=F.A.now().startOf("month"),this._PreviousMonth=this._CurrentMonth.minus({months:1})},getVisibleMonthFromRenderData(e){if(!e?.month||!e?.year)return null;const t=F.A.fromFormat(`${e.month} ${e.year}`,"LLLL yyyy").startOf("month");return t.isValid?t:null},onRender:function(){this.stopListening(this.collection),this.listenTo(this.collection,"update reset sync",this.syncCalendarEvents),this.bindUIElements(),this.cal&&this.cal.destroy(),this.cal=this.$el.clndr({weekOffset:this.options?.startWeekOnMonday?1:0,render:e=>{const t=this.getVisibleMonthFromRenderData(e),a={...e,locals:{today:be.Today,previousMonth:be.PreviousMonth,nextMonth:be.NextMonth,megaEvent:ve[Ce.MegaEvent],gigaEvent:ve[Ce.GigaEvent]},styles:{controlBase:ke().controlBase(),monthYear:ke().monthYear(),controlBtnContainer:ke().controlBtnContainer(),controlNext:ke().controlBtn({controlType:"next"}),controlPrev:ke().controlBtn({controlType:"prev"}),eventCountIndicatorContainer:ke().eventCountIndicatorContainer(),eventIcon:ke().eventIcon(),daysHeaderGrid:ke().daysHeaderGrid(),daysGrid:ke().daysGrid(),dayHeader:ke().dayHeader()},prevArrowDataEventLabel:this.getCalendarArrowAnalyticsLabel(t?.minus({months:1})),nextArrowDataEventLabel:this.getCalendarArrowAnalyticsLabel(t?.plus({months:1}))};return je()(a)},dateParameter:"dateTimeStart",events:this.collection.toJSON(),constraints:{startDate:this.options.eventsFetchWindow.start,endDate:window?.showMoreEvents?this.options.eventsFetchWindow.limit:this.options.eventsFetchWindow.fetchedUntil},clickEvents:{click:this.onDayClick,onMonthChange:this.onMonthChange},extras:{hasEvents(){return this.events.length>0},getEventCountStr(){if(!this.events.length)return be.NoEvents??"No events";return be.EventCount.replace("{0}",this.events.length)},hasGiga(){return ue.default.isObject((0,ue.default)(this.events).findWhere({cacheTypeId:Ce.GigaEvent}))},getScreenReaderFriendlyCalendarDay(){let e=App?.Settings?.get("app:options")?.localRegion;
1return F.A.fromJSDate(this.date._d).setLocale(e).toLocaleString(F.A.DATE_MED_WITH_WEEKDAY)},hasMegaOrBlockParty(){return ue.default.isObject((0,ue.default)(this.events).findWhere({cacheTypeId:Ce.MegaEvent}))||ue.default.isObject((0,ue.default)(this.events).findWhere({cacheTypeId:Ce.GeocachingHqBlockPartyEvent}))},getCalDayButtonClasses(){let e={highlighted:ue.default.some(this.events,(function(e){return!(e.isCancelled&&!e.isOwner)&&(!0===e.isAttended||!0===e.isRsvp||!0===e.isOwner)})),today:this.properties.isToday};return ke().dayButton(e)}}})},goToDay(e){if(e)return this.$el.find(".calendar-day-"+e.toFormat("yyyy-MM-dd")).trigger("click")},onCloseDay:function(){return this.cal.element.find(".selected").removeClass("selected").attr("aria-selected","false")},onDayClick:function(e){e.element.classList.contains("selected")||(this.triggerMethod("close:day"),this.triggerMethod("click:day",e),e.element.classList.add("selected"),e.element.setAttribute("aria-selected","true"))},resetDaySelection(){return de()(".clndr-controls button.inactive")?.prop("disabled",!0),this.triggerMethod("close:day")},getCalendarArrowAnalyticsLabel(e){if(!F.A.isDateTime(e))return null;const t=`${fe} - Calendar - Arrow -`,a=e.startOf("month");if(a.hasSame(this._CurrentMonth,"month"))return`${t} Current month`;if(a.hasSame(this._PreviousMonth,"month"))return`${t} Past month`;return`${t} Future month (+${12*(a.year-this._CurrentMonth.year)+(a.month-this._CurrentMonth.month)})`},syncCalendarEvents(){this.cal&&ue.default.isFunction(this.cal.setEvents)&&this.cal.setEvents(this.collection.toJSON())},onMonthChange(e){if(this.resetDaySelection(),!window?.showMoreEvents)return;const t=e?._d||e?.toDate?.(),a=t?F.A.fromJSDate(t).startOf("month"):null,n=F.A.fromISO(this.options.eventsFetchWindow.fetchedUntil).startOf("month");a&&a.toMillis()>=n.toMillis()&&this.triggerMethod("load:more:events",a)}}),getLuxonMonth=e=>{if(F.A.isDateTime(e))return e.startOf("month");const t=e?._d??e?.toDate?.();return t?F.A.fromJSDate(t).startOf("month"):null},LegacyCalendarWrapper=({collection:e,eventsFetchWindow:t,startWeekOnMonday:a,selectedDay:s,visibleMonth:i,onCloseDay:r,onClickDay:l,onLoadMoreEvents:o,onVisibleMonthChange:c})=>{const d=(0,n.useRef)(null),u=(0,n.useRef)(null),m=(0,n.useRef)(s),h=(0,n.useRef)(i);return(0,n.useEffect)((()=>{if(!d.current)return;const n=new Ne({collection:e,eventsFetchWindow:t,startWeekOnMonday:a}),s=n.onMonthChange;"function"==typeof s&&(n.onMonthChange=e=>{s(e);const t=getLuxonMonth(e)??getLuxonMonth(n.cal?.month);t&&c(t)}),n.on?.("close:day",r),n.on?.("click:day",l),n.on?.("load:more:events",o),n.setElement(d.current),n.render();const i=h.current?F.A.fromISO(h.current).startOf("month"):null;if(i?.isValid){n.cal?.setYear?.(i.year,{withCallbacks:!1}),n.cal?.setMonth?.(i.month-1,{withCallbacks:!1}),c(i);const e=m.current?F.A.fromISO(m.current):null;if(e?.isValid&&e.hasSame(i,"month"))n.goToDay?.(e);else{const e=i.hasSame(F.A.now(),"month")?F.A.now():i;n.goToDay?.(e)}}else{const e=F.A.now().startOf("month");n.goToDay?.(F.A.now()),c(e)}return u.current=n,()=>{n.off?.("close:day",r),n.off?.("click:day",l),n.off?.("load:more:events",o),n.cal?.destroy?.(),n.stopListening?.(),u.current===n&&(u.current=null)}}),[e,t,l,r,o,c,a]),(0,g.jsx)("div",{ref:d,className:"events-calendar"})};var Le=a(5290);const Te=he().Model.extend({url:"/web/v1/users",defaults:{links:{self:"",profile:""},isCurrentUser:!1,username:void 0,membershipTypeId:void 0,securityRollId:void 0,findCount:void 0,hideCount:void 0,locale:void 0,dnfs:void 0,profileImage:void 0,isValidated:!1,availableFavoritePoints:void 0},parse:function(e){let t;return e.attributes?(t=e.attributes,t.id=e.id,t.links=e.links,this.url=e.links.self,t.isCurrentUser=this.isCurrentUser(e.id)):t=e,t},isCurrentUser:e=>e===App.Settings.get("user:info").publicGuid,getFriendsList:function(){},blockUser:function(){},addAsFriend:function(){}}),Se={user:he().Collection.extend({model:Te,url:"/web/v1/users/friendAccounts"})},Ie=he().Model.extend({constructor:function(e,t){this.collection=t.collection,he().Model.apply(this,arguments)},parse:function(e){if(!e)return e;let t={};return e.data&&e.data.attributes?(t=ue.default.extend({},e.data.attributes),t.id=e.data.id):e.attributes&&(t=ue.default.extend({},e.attributes),t.id=e.id),e.relationships&&(this.relationships=this._recursiveBindIncludedItems(e.relationships)),e.links&&ue.default.extend(t,{links:e.links}),t},_recursiveBindIncludedItems:function(e){const t=e;return ue.default.each(t,(function(e){if(e.data)if(ue.default.isArray(e.data)){const t=[];ue.default.each(e.data,(function(e){t.push(this.collection.relationships[e.type].findWhere({id:e.id}))}),this),e.data=t}else ue.default.isObject(e.data)&&(e.data=this.collection.relationships[e.data.type].findWhere({id:e.data.id}))}),this),t}}),Ae=Le.A.extend({constructor:function(e,t){this._generateIncludeCollections(this),he().Collection.apply(this,arguments)},parse:function(e){return e&&e.data?(e.included&&this._populateIncludeCollections(e.included),e.meta&&(this.meta=new(he().Model)(e.meta)),e.data):e},_populateIncludeCollections:function(e){return ue.default.each(e,(function(e){ue.default.contains(ue.default.keys(Se),e.type)&&this.relationships[e.type].add(e,{parse:!0})}),this),this},_generateIncludeCollections:function(){return this.relationships={},ue.default.each(Se,(function(e,t){this.relationships[t]=new e}),this),this}}),Pe=Ae.extend({url:()=>`${j.i}
1/activities/account/${App.Settings.get("user:info").referenceCode}/events`,model:Ie.extend({parse(e){const t=e?.attributes??{},a=t?.dateTimeStart?F.A.fromISO(t.dateTimeStart):null,n=t?.dateTimeEnd?F.A.fromISO(t.dateTimeEnd):null;t.dateTimeStartLuxon=a,t.dateTimeEndLuxon=n;const s=F.A.now(),i=n?.isValid?n:a?.isValid?a:null;return t.isInPast=!!i&&s>i,t.isArchivedOrDisabled=t.isArchived||!1===t.isAvailable,t.isCancelled=!t.isInPast&&t.isArchivedOrDisabled,Ie.prototype.parse.call(this,e)}})});let De=null;const patchPersistedState=e=>{De&&Object.assign(De,e)},useEventsWidgetState=({userInfo:e})=>{const t=(0,n.useRef)(De),a=(0,n.useRef)(t.current?.collection??new Pe),s=(0,n.useRef)(t.current?.eventsFetchWindow??(()=>{const e=F.A.now();return{start:e.minus({months:1}).startOf("month").toISODate(),fetchedUntil:e.plus({months:1}).endOf("month").toISODate(),limit:e.plus({months:12}).endOf("month").toISODate()}})()),i=(0,n.useRef)(null),r=(0,n.useRef)(!1),l=(0,n.useRef)(t.current?.hasStartedInitialFetch??!1),o=(0,n.useRef)(t.current?.isInitialFetchPending??!1),c=(0,n.useRef)(null),[d,u]=(0,n.use
1State)(t.current?.status??"loading"),[m,h]=(0,n.useState)(0),[p,g]=(0,n.useState)((()=>{const a=t.current?.preferences??(e=>{const t="Metric"===getUserInfo(e).distanceUnit,a=t?322:200,n=Math.round(getApiSetting("dashboard","eventsRadius")||(t?16:10));return{isMetric:t,maxRadius:a,radius:Math.min(n,a),sortByTime:getApiSetting("dashboard","sortEventsByTime")||!1,startWeekOnMonday:getApiSetting("preference","startWeekOnMonday")||!1}})(e);return i.current=a,a})),[f,x]=(0,n.useState)(t.current?.selectedDay??null),[y,b]=(0,n.useState)(t.current?.selectedEventsCount??0),[v,w]=(0,n.useState)(t.current?.selectedEventCid??null),[j,k]=(0,n.useState)(t.current?.shouldFocusSettingsButton??!1),[C,N]=(0,n.useState)(t.current?.visibleMonth??null);i.current=p;const L=(0,n.useRef)(t.current?.lastNonSettingsStatus??("settings"===d?a.current.length?"calendar":"empty":d));(0,n.useEffect)((()=>{"settings"!==d&&(L.current=d)}),[d]);const T=(0,n.useCallback)((()=>{u((e=>"loading"===e?a.current.length?"calendar":"empty":e))}),[]);(0,n.useEffect)((()=>{De={collection:a.current,eventsFetchWindow:s.current,hasStartedInitialFetch:l.current,isInitialFetchPending:o.current,lastNonSettingsStatus:L.current,preferences:p,selectedDay:f,selectedEventCid:v,selectedEventsCount:y,shouldFocusSettingsButton:j,status:d,visibleMonth:C}}),[p,f,v,y,j,d,C]),(0,n.useEffect)((()=>{const e=a.current,syncReactWithCollection=()=>{h((e=>e+1)),u((t=>"loading"===t?e.length?"calendar":"empty":t))},handleError=(e,t)=>{"canceled"!==t?.statusText&&u("error")};return e.on("update reset sync",syncReactWithCollection),e.on("error",handleError),()=>{e.off("update reset sync",syncReactWithCollection),e.off("error",handleError)}}),[]);const S=(0,n.useMemo)((()=>a.current.models.slice()),[m]),I=(0,n.useCallback)((()=>{x(null),b(0),w(null)}),[]),A=(0,n.useCallback)((({start:t,end:n,reset:s=!1,remove:r=!1})=>{const l=i.current,o=window.App?.Settings?.get?.("user:info")?.homeLocation??e?.homeLocation;return a.current.fetch({data:de().param({start:t,end:n,latitude:o?.Latitude,longitude:o?.Longitude,includeFriendsActivity:!0,radiusInMiles:getFetchRadiusInMiles(l)}),remove:r,reset:s,success:t=>((e,t)=>{const a=getUserInfo(t).accountId;e.each?.((e=>{e.set("isOwner",e?.relationships?.author?.data?.id===`${a}`)}))})(t,e)})}),[e]),P=(0,n.useCallback)((()=>{let e=!1;I(),u("loading"),o.current=!0,patchPersistedState({isInitialFetchPending:!0});const t=A({start:s.current.start,end:s.current.fetchedUntil,reset:!0,remove:!0});if(!t)return o.current=!1,patchPersistedState({isInitialFetchPending:!1}),()=>{};t.done((()=>{e=!0,window.setTimeout(T,0)})),t.always((()=>{o.current=!1,patchPersistedState({isInitialFetchPending:!1})}));const n=window.setTimeout((()=>{e||u((e=>"loading"===e?a.current.length?"calendar":"empty":e))}),4e3);return()=>window.clearTimeout(n)}),[I,A,T]);(0,n.useEffect)((()=>{if(!l.current)return l.current=!0,patchPersistedState({hasStartedInitialFetch:!0}),c.current=P(),()=>{c.current?.(),c.current=null};o.current||u((e=>"loading"===e?a.current.length?"calendar":"empty":e))}),[P]);const D=(0,n.useCallback)((e=>{if(r.current)return;const t=e&&"_d"in Object(e)?e._d:e&&"toDate"in Object(e)?e.toDate?.():null,a=t?F.A.fromJSDate(t).startOf("month"):F.A.isDateTime(e)?e.startOf("month"):null;if(!a)return;const{fetchedUntil:n,limit:i}=s.current,l=F.A.fromISO(n),o=F.A.fromISO(i);if(a<l.startOf("month"))return;const c=l.plus({days:1});if(c>o)return;r.current=!0;const d=A({start:c.toISODate(),end:o.toISODate()});d?(d.done((()=>{s.current.fetchedUntil=o.toISODate()})),d.always((()=>{r.current=!1}))):r.current=!1}),[A]),E=(0,n.useCallback)((e=>{const t=i.current,a=Math.round(Number(e.radius)),n={...t,radius:a,sortByTime:e.sortByTime,startWeekOnMonday:e.startWeekOnMonday};t.sortByTime!==n.sortByTime&&saveApiSetting("dashboard","sortEventsByTime",n.sortByTime),t.startWeekOnMonday!==n.startWeekOnMonday&&saveApiSetting("preference","startWeekOnMonday",n.startWeekOnMonday),t.radius!==n.radius&&saveApiSetting("dashboard","eventsRadius",n.radius),i.current=n,g(n),k(!0),l.current=!0,c.current?.(),c.current=P()}),[P]),M=(0,n.useCallback)((e=>{F.A.isDateTime(e)&&e.isValid&&N(e.startOf("month").toISODate())}),[]);return{applySettings:E,cancelSettings:(0,n.useCallback)((()=>{k(!0),u(L.current)}),[]),clearSelectedDay:I,collection:a.current,events:S,eventsFetchWindow:s.current,fetchNextChunk:D,openSettings:()=>u("settings"),preferences:p,selectedDay:f,selectedEventCid:v,selectedEventsCount:y,setSelectedDay:x,setSelectedEventCid:w,setSelectedEventsCount:b,setShouldFocusSettingsButton:k,setVisibleCalendarMonth:M,shouldFocusSettingsButton:j,status:d,visibleMonth:C}};var Ee,Me;const EventsNearbyContent=({AppSettingsUserInfo:e,i18n:t})=>{const a=useEventsWidgetState({userInfo:e}),{applySettings:s,cancelSettings:i,clearSelectedDay:r,collection:l,events:o,eventsFetchWindow:c,fetchNextChunk:d,openSettings:u,preferences:m,selectedDay:h,selectedEventCid:p,selectedEventsCount:f,setSelectedDay:x,setSelectedEventCid:y,setSelectedEventsCount:b,setShouldFocusSettingsButton:v,setVisibleCalendarMonth:w,shouldFocusSettingsButton:j,status:k,visibleMonth:C}=a,N=(0,n.useCallback)((e=>{const t=e.date?.format?.("YYYY-MM-DD")??null;x(t),b(e.events?.length??0),y(null)}),[x,y,b]),L=(0,n.useCallback)((()=>{v(!1)}),[v]);return"loading"===k?Ee||(Ee=(0,g.jsx)(EventsLoadingState,{})):"error"===k?(0,g.jsx)(EventsErrorState,{i18n:t}):"settings"===k?(0,g.jsx)(EventSettings,{i18n:t,onCancel:i,onSubmit:s,preferences:m}):"empty"===k?(0,g.jsx)(EmptyEventsState,{i18n:t,onFocusTransferred:L,onOpenSettings:u,preferences:m,shouldFocusSettingsButton:j}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("div",{id:"EventsMeta",children:(0,g.jsx)(EventHeaderMeta,{i18n:t,onFocusTransferred:L,onOpenSettings:u,preferences:m,shouldFocusSettingsButton:j})}),(0,g.jsx)("div",{id:"EventsCalendar",className:"bg-white",children:(0,g.jsx)(LegacyCalendarWrapper,{collection:l,eventsFetchWindow:c,onClickDay:N,onCloseDay:r,onLoadMoreEvents:d,onVisibleMonthChange:w,selectedDay:h,startWeekOnMonday:m.startWeekOnMonday,visibleMonth:C},m.startWeekOnMonday?"monday":"sunday")}),(0,g.jsx)("div",{id:"EventsList",children:h&&(0,g.jsx)(EventList,{events:o,i18n:t,onSelectEvent:y,preferences:m,selectedDay:h,selectedEventCid:p,selectedEventsCount:f})})]})},EventsWidget=e=>{const{AppSettingsUserInfo:t,dashboardSettings:a,i18n:s}
1=e,[i,r]=(0,n.useState)(!1),{isExpanded:l,toggleExpanded:o}=(0,E.p)({dashboardSettings:a,settingKey:A.c.eventsWidget.settingKey,usesIsCollapsedPattern:A.c.eventsWidget.usesIsCollapsedPattern});(0,n.useEffect)((()=>{l&&r(!0)}),[l]);const c=t?.homeLocation,d=!c||null==c.Latitude||null==c.Longitude;return(0,g.jsxs)(P.iV,{id:"eventsWidget",className:d?"":"bg-white rounded-lg",isExpanded:l,keepContentMounted:!0,header:({contentId:e})=>(0,g.jsx)(D.h,{contentId:e,headerSize:"small",isExpanded:l,onToggle:o,title:s.EventsNearby??"Events nearby"}),children:[d&&(0,g.jsxs)("div",{className:"flex flex-column center px-5 pt-4 pb-6 bg-white rounded-lg",children:[Me||(Me=(0,g.jsx)("svg",{className:"m-auto w-full",height:"50","aria-hidden":"true",children:(0,g.jsx)("use",{href:"#home-illustration--inline"})})),(0,g.jsx)("h1",{className:"m-0 mb-2 text-base/5",children:s.NoHomeHeader??"You haven't set a home location"}),(0,g.jsx)("p",{children:s.NoHomeDetails??"Set a home location to see upcoming events near you."}),(0,g.jsx)("a",{href:"/account/settings/homelocation",className:"gc-button gc-button-primary gc-button-lg text-white text-base/5 hover:no-underline",children:s.SetHomeLocation??"Set home location"})]}),!d&&i&&(0,g.jsx)(EventsNearbyContent,{AppSettingsUserInfo:t,i18n:s})]},"eventsWidget")};var $e=a(99418),Fe=a(64764);const Re=(0,p.tv)({slots:{panel:"",status:"flex items-center justify-center px-4 py-5 text-center text-gray-600",statusText:"m-0",list:"list-none p-0",item:"m-2 block",link:"flex items-center gap-2 p-2 text-gray-600 rounded-lg no-underline transition-colors hover:bg-gray-50 focus:shadow-outline",icon:"flex shrink-0 items-center justify-center text-gray-500 [&>svg]:size-[20px] [&>svg]:block",label:"min-w-0 flex-1"},compoundSlots:[{slots:["status","list"],class:["bg-white","rounded-lg","m-0","text-base/5"]}]}),isCampaignActive=e=>{const t=F.A.utc(),a=F.A.fromISO(e.linkVisibleStartDateUtc,{zone:"utc"}),n=F.A.fromISO(e.linkVisibleEndDateUtc,{zone:"utc"});return e.linkVisibleOnWeb&&a.isValid&&n.isValid&&a<=t&&n>=t},decodeCampaignIcon=e=>{if(!e)return null;try{return $e.A.sanitize(atob(e),{USE_PROFILES:{svg:!0,svgFilters:!0}})}catch{return null}},FeaturedCampaigns=({dashboardSettings:e,displayFeaturedActivityTeaser:t,i18n:a})=>{const[s,i]=(0,n.useState)([]),[r,l]=(0,n.useState)("idle"),{isExpanded:o,toggleExpanded:c}=(0,E.p)({dashboardSettings:e,settingKey:A.c.campaigns.settingKey});(0,n.useEffect)((()=>{let e=!0;return(async()=>{l("loading");try{const t=await fetch(`${j.i}/MarketingCampaigns/metadata`);if(!t.ok)throw new Error(`Campaign fetch failed with status ${t.status}`);const a=await t.json();if(!e)return;i(a.filter(isCampaignActive)),l("loaded")}catch(t){if(!e)return;console.warn("Failed to fetch campaigns",t),i([]),l("error")}})(),()=>{e=!1}}),[]);const d=Re(),u=Boolean(t),m="loading"===r||s.length>0||u,h=(0,n.useMemo)((()=>s.map((e=>({...e,iconSvg:decodeCampaignIcon(e.iconRawBytes)})))),[s]);return m?(0,g.jsx)(P.iV,{id:"campaigns",className:d.panel(),isExpanded:o,header:({contentId:e})=>(0,g.jsx)(D.h,{contentId:e,headerSize:"small",isExpanded:o,onToggle:c,title:a.CampaignsWidgetHeader??"Featured activities"}),children:h.length>0?(0,g.jsx)("ul",{className:d.list(),children:h.map((e=>(0,g.jsx)("li",{className:d.item(),children:(0,g.jsxs)("a",{href:e.relativeUrl,className:d.link(),"data-event-category":"data","data-event-label":e.webTrackingTag,target:e.openLinkExternally?"_blank":void 0,rel:e.openLinkExternally?"noopener noreferrer":void 0,children:[e.iconSvg&&(0,g.jsx)("span",{"aria-hidden":"true",className:d.icon(),dangerouslySetInnerHTML:{__html:e.iconSvg}}),(0,g.jsx)("span",{className:d.label(),children:e.name})]})},e.campaignId)))}):(0,g.jsx)("div",{className:d.status(),children:"loading"===r?(0,g.jsx)(Fe.Gu,{size:"md","aria-label":a.Loading??"Loading"}):(0,g.jsx)("p",{className:d.statusText(),children:a.NewActivitiesComing??"New activities coming soon."})})},"campaigns"):null},Oe=(0,p.tv)({slots:{base:"bg-white mb-4 rounded-lg text-xs/5 px-2 py-[6px] flex-col md:flex-row relative h-auto w-full",list:'flex-wrap [&>
1li:not(:first-child):not(:last-child)]:after:content-["|"] [&>li:not(:first-child):not(:last-child)]:after:text-gray-200 [&>li:not(:first-child):not(:last-child)]:after:w-[8px] [&>li:not(:first-child):not(:last-child)]:after:text-center',listItem:"",childList:"",link:"text-blue-600"},compoundSlots:[{slots:["base","list","listItem","childList"],className:"flex"},{slots:["base","childList"],className:"gap-[6px]"},{slots:["list","listItem"],className:"gap-1"},{slots:["list","childList"],className:"m-0 p-0 list-none"}]}),JumpBar=e=>{const{i18n:t,publicGuid:a,environmentUrls:n}=e,{base:s,list:i,listItem:r,link:l,childList:o}=Oe(),c=t.QuickLinks??"Quick links:",u=[{href:(0,d.k)(n.plan,"plan/lists"),label:t.Lists??"Lists"},{href:(0,d.k)(n.web,"my/geocaches.aspx"),label:t.Geocaches??"Geocaches",children:[{href:(0,d.k)(n.web,"my/owned.aspx"),label:t.YoursContextGeocaches??"Yours",ariaLabel:t.YourGeocaches??"Your geocaches",srOnlySuffix:t.Geocaches??"Geocaches"},{href:(0,d.k)(n.web,"my/recentlyviewedcaches.aspx"),label:t.RecentlyViewed??"Recently viewed"}]},{href:(0,d.k)(n.web,"my/travelbugs.aspx"),label:t.TrackableItems??"Trackable items",children:[{href:(0,d.k)(n.web,a?`track/search.aspx?o=1&uid=${a}`:"track/search.aspx"),label:t.YoursContextTrackables??"Yours",ariaLabel:t.YourTrackables??"Your trackables",srOnlySuffix:t.TrackableItems??"Trackable items"},{href:(0,d.k)(n.web,"my/inventory.aspx"),label:t.Inventory??"Inventory"},{href:(0,d.k)(n.web,"my/collection.aspx"),label:t.Collection??"Collection"}]},{href:(0,d.k)(n.web,"my/souvenirs.aspx"),label:t.SouvenirsPage??"Souvenirs"},{href:(0,d.k)(n.web,"my/statistics.aspx"),label:t.StatisticsPage??"Statistics"},{href:(0,d.k)(n.web,"my/myfriends.aspx"),label:t.ViewFriends??"View friends"},{href:(0,d.k)(n.web,"play/leaderboard"),label:t.LeaderboardPage??"Leaderboard"}];return(0,g.jsxs)("nav",{className:s(),"data-testid":"jump-bar","aria-labelledby":"jump-bar-heading",children:[(0,g.jsx)("h2",{id:"jump-bar-heading",className:"sr-only",children:c}),(0,g.jsxs)("ul",{"data-testid":"jump-bar-list",className:`${i()}`,children:[(0,g.jsx)("li",{"data-testid":"jump-bar-visual-heading",className:`${r()} font-bold`,"aria-hidden":!0,children:c}),u.map((e=>(0,g.jsxs)("li",{className:`${r()}`,children:[(0,g.jsx)("a",{href:e.href,className:`${l()}`,children:e.label}),e.children&&(0,g.jsx)("ul",{className:`${o()}`,children:e.children.map((e=>(0,g.jsx)("li",{children:(0,g.jsxs)("a",{href:e.href,className:`${l()}`,"aria-label":e.ariaLabel,children:["(",e.label,e.srOnlySuffix&&(0,g.jsx)("span",{className:"sr-only",children:e.srOnlySuffix}),")"]})},e.href)))})]},e.href)))]})]})};var Be;const Ue=(0,p.tv)({slots:{base:"group relative bg-white rounded-lg border border-solid border-white p-4 flex gap-4 items-center text-grey-600 text-base leading-5 no-underline hover:border-grey-100 focus:shadow-outline",graphic:"grow-0 shrink-0 size-[64px]",textContainer:"flex flex-col gap-1 m-0 leading-5 grow min-w-0",heading:"text-base m-0 font-bold",fauxLink:"text-blue-500 underline group-hover:no-underline",caretIcon:"-rotate-90 size-5 bg-blue-500 text-white rounded-full opacity-0 group-hover:opacity-100 transition-opacity absolute right-4 top-0 bottom-0 my-auto"},variants:{isIcon:{false:{graphic:"rounded-lg"}},visuallyDistinguish:{true:{heading:"font-bold"},false:{heading:"font-normal"}}}}),LinkCard=e=>{const{fauxLinkText:t,headingText:a,imgSrc:n,iconName:s,linkProps:i,linkUrl:r,supportingText:l,visuallyDistinguishHeader:o=!0,type:c="visibleLink"}=e,{base:d,textContainer:u,heading:m,fauxLink:h,graphic:p,caretIcon:f}=Ue(),{className:x,...y}=i??{},b="chevron"===c;return(0,g.jsxs)("a",{"data-testid":"link-card",href:r,className:`${d()} ${x??""}`,...y,children:[s&&(0,g.jsx)("svg",{"aria-hidden":"true",className:p(),children:(0,g.jsx)("use",{href:`#${s}--inline`})}),n&&!s&&(0,g.jsx)("img",{src:n,alt:"",className:`${p({isIcon:!1})} `}),(0,g.jsxs)("span",{className:u(),children:[(0,g.jsx)("h2",{className:m({visuallyDistinguish:o}),children:a}),l&&(0,g.jsx)("span",{children:l}),!b&&t&&(0,g.jsx)("span",{className:h(),children:t})]}),b&&(0,g.jsx)("svg",{"aria-hidden":"true",className:f(),"data-testid":"link-card-caret",children:Be||(Be=(0,g.jsx)("use",{href:"#chevron-small--inline"}))})]})};var Ke;a(79766);const ze=(0,p.tv)({slots:{base:"bg-white rounded-lg flex flex-col p-5 pt-8 gap-y-5 text-base leading-5",graphic:"max-w-full mx-auto h-[130px] w-[240px]",heading:"text-[14px] m-0 mb
1-1",infoText:"m-0",linkBtn:"inline-block box-border text-center no-underline cursor-pointer rounded border border-transparent bg-transparent text-green-500 text-sm leading-normal py-2.5 px-4 hover:bg-green-50 hover:border-green-500 hover:no-underline active:bg-green-100 active:text-green-700 focus:shadow-outline focus:outline-none"}}),PremiumUpsell=({i18n:e})=>{const t=ze();return(0,g.jsxs)("aside",{"aria-labelledby":"premiumUpsellHeading",className:t.base(),children:[(0,g.jsx)("svg",{"aria-hidden":"true",className:t.graphic(),"data-testid":"premium-hero-illustration",children:Ke||(Ke=(0,g.jsx)("use",{href:"#premium-hero--inline"}))}),(0,g.jsxs)("div",{children:[(0,g.jsx)("h2",{id:"premiumUpsellHeading",className:t.heading(),children:e.PremiumUpsellHeading}),(0,g.jsx)("p",{className:t.infoText(),children:e.PremiumUpsellContent})]}),(0,g.jsx)("a",{className:t.linkBtn(),"data-event-category":"data","data-event-label":"Upgrade CTA - Dashboard PM Upsell - image and copy",href:"/membership",children:e.PremiumUpsellButtonText})]})},He=(0,p.tv)({slots:{base:"bg-transparent border-0 block h-auto m-0 p-0 relative w-full flex flex-col overflow-visible",navGroup:"p-0",navListItem:"leading-5 ",navLinkWrapper:"group rounded-lg px-2 transition-colors flex items-center gap-2 border-[2px] border-solid border-transparent has-[a:hover]:bg-white has-[a:hover]:border-white focus-within:border-gray-600",navLink:"flex w-full cursor-pointer gap-2 items-center no-underline hover:text-gray-600 hover:no-underline focus:text-gray-600 focus:shadow-none",navHeader:"flex gap-2 items-center",navLinkIcon:"size-4 text-gray-500",navChildList:"pl-4 pt-1 flex flex-col",navSubList:"pl-2 pt-1 flex flex-col",sectionTitle:"inline-flex items-center gap-2",newBadge:"inline-flex items-center justify-center px-1.5 py-0.5 rounded-[2px] bg-blue-100 text-blue-600 text-[10px] leading-none font-bold"},variants:{isFavPointsData:{true:{navChildList:"text-xs gap-[2px]"}},isTrackableList:{true:{navChildList:"pl-0"}},size:{small:{navLinkWrapper:"py-1"},large:{navLinkWrapper:"py-2"}},useCompactLayout:{true:{base:"gap-1"},false:{base:"gap-2"}}},compoundVariants:[{size:"large",useCompactLayout:!0,class:{navLinkWrapper:"py-1"}}],defaultVariants:{size:"small",useCompactLayout:!1}});var We,Ge;const Ve=(0,p.tv)({slots:{base:"block",icon:"block"},variants:{isBasic:{true:{base:"bg-white rounded p-[2px] transition-colors group-hover:bg-gray-50",icon:"h-[14px] w-[61px]"},false:{icon:"size-[14px]"}}}}),PremiumFeatureIcon=e=>{const{i18n:t,isBasic:a=!0,paywebUrl:n}=e,s=Ve({isBasic:a});return(0,g.jsx)("span",{className:s.base(),title:t?.PremiumFeature,children:a?(0,g.jsx)("svg",{"data-testid":"premium-logo",className:s.icon(),height:"14",width:"61",role:"img","aria-label":t?.PremiumFeature,children:We||(We=(0,g.jsx)("use",{href:"#premium-logo--inline"}))}):(0,g.jsx)("svg",{"data-testid":"premium-mark",className:s.icon(),height:"14",width:"14",role:"img","aria-label":t?.PremiumFeature,children:Ge||(Ge=(0,g.jsx)("use",{href:"#premium-mark--inline"}))})})},_e=(0,p.tv)({slots:{base:"",btn:"bg-transparent border-none p-0 flex w-full justify-between items-center cursor-pointer",chevronIcon:"text-gray-600 transition-all duration-300 origin-center ease-in-out size-[20px]",inventoryArea:"gap-3",trackableList:"mt-1 gap-2",trackableListItem:"flex gap-1",trackableLink:"text-blue-600 text-xs",trackableIcon:"size-4",showAllBtn:"inline-block bg-white rounded-lg text-gray-600 hover:bg-gray-100 active:bg-gray-100 hover:text-gray-600 active:text-gray-600 focus:bg-white focus:text-gray-600"},variants:{expanded:{true:{chevronIcon:"rotate-180"}}},compoundSlots:[{slots:["base","trackableList"],class:["ml-4"]},{slots:["inventoryArea","trackableList"],class:["flex flex-col"]}]});var Ye;const TrackablesInventory=e=>{const{dashboardSettings:t={},i18n:a={},inventoryCount:n,inventoryData:s=[],inventoryDisplayLimit:i,isMobileDevice:r=!1,toggleText:l=""}=e,o=A.c.trackableInventory,{base:c,btn:d,chevronIcon:u,inventoryArea:m,trackableList:h,trackableListItem:p,trackableLink:f,trackableIcon:x,showAllBtn:y}=_e(),{isExpanded:b,toggleExpanded:v}=(0,E.p)({dashboardSettings:t,settingKey:o.settingKey,isMobileDevice:r,collapseOnMobile:o.collapseOnMobile});return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("div",{className:c(),children:(0,g.jsxs)("button",{"aria-expanded":b,"aria-controls":"trackableInventoryItems",className:d(),"data-testid":"inventory-toggle-button",onClick:v,type:"button",children:[(0,g.jsx)("span",{children:l}),(0,g.jsx)("svg",{width:"24px",height:"24px",className:u({expanded:b}),"aria-hidden":"true",children:Ye||(Ye=(0,g.jsx)("use",{href:"#chevron-small--inline"}))})]})}),b&&(0,g.jsxs)("div",{id:"trackableInventoryItems",className:m(),children:[(0,g.jsx)("ul",{className:h(),children:s.slice(0,i).map(((e,t)=>(0,g.jsxs)("li",{className:p(),children:[(0,g.jsx)("img",{alt:"",className:x(),src:e.iconUrl}),(0,g.jsx)("a",{className:f(),href:`/track/details.aspx?tracker=${e.referenceCode}`,children:e.name})]},t)))}),n>i&&(0,g.jsx)("div",{children:(0,g.jsx)("a",{className:`${(0,w.HY)({size:"sm"})} ${y()}`,href:"/my/inventory.aspx","aria-label":a.ViewAllTrackablesInInventory??"View all trackables in your inventory",children:a.ShowAll})})]})]})};const qe=[{id:"quickAccess",settingsKey:A.c.quickAccess.settingKey,titleKey:"QuickAccess",fallbackTitle:"[Quick access]",items:[{id:"statistics",environmentUrlKey:"web",path:"/my/statistics.aspx",labelKey:"StatisticsPage",iconName:"statistics",analytics:{"data-event-action":"click","data-event-category":"data","data-event-label":"Dashboard My Statistics Link"}},{id:"listsHub",environmentUrlKey:"plan",path:"/plan/lists",labelKey:"ListsPage",iconName:"list-user",isPremium:!0,analytics:{"data-event-action":"click","data-event-category":"data","data-event-label":"Dashboard List Hub Link"}},{id:"treasures",environmentUrlKey:"web",path:"/play/treasure",labelKey:"TreasureInventoryPage",iconName:"treasures",analytics:{"data-event-action":"click","data-event-category":"data","data-event-label":"Dashboard Treasures Link"}}
1,{id:"customLeaderboard",environmentUrlKey:"web",hrefMvcPropKey:"customLeaderboardUrl",imageMvcPropKey:"customLeaderboardLogoUrl",visibleIfMvcPropKey:"customLeaderboardUrl",labelKey:"CustomLeaderboardName",analytics:{"data-event-action":"click","data-event-category":"data","data-event-label":"Dashboard Custom Leaderboard Link"}},{id:"leaderboard",environmentUrlKey:"web",path:"/play/leaderboard",labelKey:"LeaderboardPage",iconName:"leaderboard",analytics:{"data-event-action":"click","data-event-category":"data","data-event-label":"Dashboard Leaderboard Link"}},{id:"souvenirs",environmentUrlKey:"web",path:"/my/souvenirs.aspx",labelKey:"SouvenirsPage",iconName:"ribbon-souvenir",analytics:{"data-event-action":"click","data-event-category":"data","data-event-label":"Dashboard My Souvenirs Link"}},{id:"experimentalFeatures",environmentUrlKey:"live",hrefSidebarPropKey:"experimentalfeaturesUrl",labelKey:"ExperimentalFeaturesPage",iconName:"experiment",isPremium:!0,analytics:{"data-event-action":"click","data-event-category":"data","data-event-label":"Dashboard Experimental Feature Link"}}]},{id:"geocaches",settingsKey:A.c.geocaches.settingKey,titleKey:"Geocaches",items:[{id:"recentlyViewed",environmentUrlKey:"web",path:"/my/recentlyviewedcaches.aspx",labelKey:"RecentlyViewed"},{id:"myLogs",environmentUrlKey:"web",path:"/my/geocaches.aspx",labelKey:"SidebarGeocachesLogs"},{id:"drafts",environmentUrlKey:"web",path:"/account/drafts",labelKey:"Drafts",countConfig:{i18nKey:"DraftsWithCount",mvcPropKey:"draftsCount",useParentheses:!0}},{id:"logTemplates",environmentUrlKey:"live",path:"/live/account/settings/templates",labelKey:"SidebarPremiumTemplates",isPremium:!0,visibleIfMvcPropKey:"showLogTemplates",analytics:{"data-event-action":"click","data-event-category":"data","data-event-label":"Dashboard Log Templates Link"}},{id:"favoritePoints",environmentUrlKey:"web",path:"/my/favorites.aspx",labelKey:"FavoritePoints",isPremium:!0,childContent:"favoritePointsSummary"}]},{id:"yourHides",settingsKey:A.c.yourHides.settingKey,titleKey:"ActivityToggleYourHidesHeader",items:[{id:"cacheOwnerDashboard",environmentUrlKey:"gameplay",path:"/play/owner",labelKey:"CacheOwnerDashboard",analytics:{"data-event-action":"cta","data-event-category":"data","data-event-label":"Cache owner dashboard"}},{id:"ownedCaches",environmentUrlKey:"web",path:"/my/owned.aspx",labelKey:"SidebarGeocachesOwned"},{id:"unpublishedHides",environmentUrlKey:"gameplay",path:"/play/owner/unpublished",labelKey:"UnpublishedHides",countConfig:{i18nKey:"UnpublishedHidesWithCount",mvcPropKey:"unpublishedCachesCount",useParentheses:!0}}]},{id:"plan",settingsKey:A.c.plan.settingKey,titleKey:"Plan",items:[{id:"watchlist",environmentUrlKey:"web",path:"/my/watchlist.aspx",labelKey:"SidebarListsWatchlists"},{id:"lists",environmentUrlKey:"gameplay",path:"/plan/lists",labelKey:"Lists",isPremium:!0},{id:"pocketQueries",environmentUrlKey:"web",path:"/pocket/default.aspx",labelKey:"PocketQueries",isPremium:!0},{id:"routes",environmentUrlKey:"web",path:"/my/userroutes.aspx",labelKey:"SidebarPremiumRoutes",isPremium:!0,hiddenIfMvcPropKey:"showCachesAlongRoute"},{id:"createRoute",labelKey:"SidebarPremiumCreateRoute",isPremium:!0,isHeader:!0,visibleIfMvcPropKey:"showCachesAlongRoute",items:[{id:"routeGpxPocketQuery",environmentUrlKey:"web",path:"/my/userroutes.aspx",labelKey:"SidebarPremiumRouteGpxPocketQuery"},{id:"routeList",environmentUrlKey:"gameplay",path:"/play/map/route",labelKey:"SidebarPremiumRouteList"}]},{id:"notifications",environmentUrlKey:"web",path:"/notify/default.aspx",labelKey:"SidebarPremiumNotifications",isPremium:!0}]},{id:"community",settingsKey:A.c.community.settingKey,titleKey:"NavHeaderCommunity",items:[{id:"friends",environmentUrlKey:"web",path:"/my/myfriends.aspx",labelKey:"ViewFriends"},{id:"findPlayer",environmentUrlKey:"web",path:"/find/default.aspx",labelKey:"SidebarFriendsFindPlayer"},{id:"giftPremium",environmentUrlKey:"payweb",path:"/gift",labelKey:"GiftPM",dataTestId:"link-gift-premium"}]},{id:"shareables",settingsKey:A.c.shareables.settingKey,titleKey:"SidebarShareablesHeader",visibleIfMvcPropKey:"showShareables",newIndicatorMvcPropKey:"showShareablesNewIndicator",items:[{id:"receivedShareables",environmentUrlKey:"web",path:"/play/shareables/received/",labelKey:"SidebarShareablesReceived"},{id:"yourShareables",environmentUrlKey:"web",path:"/play/shareables/",labelKey:"SidebarShareablesYours"},{id:"createShareable",environmentUrlKey:"web",path:"/play/shareables/create",labelKey:"SidebarShareablesCreate"}]},{id:"trackables",settingsKey:A.c.trackables.settingKey,titleKey:"SidebarTrackablesHeader",items:[{id:"ownedTrackables",pathTemplate:"/track/search.aspx?o=1&uid={publicGuid}",labelKey:"SidebarTrackablesOwnedTrackables"},{id:"collection",environmentUrlKey:"web",path:"/my/collection.aspx",labelKey:"Collection"},{id:"trackableLogs",environmentUrlKey:"web",path:"/my/logs.aspx?s=2",labelKey:"SidebarTrackablesLogs"},{id:"inventory",environmentUrlKey:"web",path:"/my/inventory.aspx",labelKey:"TrackableInventory",fallbackLabel:"Trackable inventory",dataTestId:"your-inventory-link",childContent:"trackablesInventory"}]}],SidebarNavigationSection=({children:e,dashboardSettings:t,isMobileDevice:a,onExpandedChange:s,section:i,title:r})=>{const{isExpanded:l,toggleExpanded:o}=(0,E.p)({dashboardSettings:t,settingKey:i.settingsKey??"",isMobileDevice:a});return(0,n.useEffect)((()=>{s?.(l)}),[l,s]),(0,g.jsx)(P.iV,{id:i.id,isExpanded:l,header:({contentId:e})=>(0,g.jsx)(D.h,{contentId:e,headerSize:"small",isExpanded:l,onToggle:o,title:r}),children:e})},TrackablesInventoryLoader=({inventoryDisplayLimit:e,onInventoryChange:t,reqToken:a})=>{const{inventoryData:s,inventoryCount:i}
1=function useTrackablesInventory(e,t=10){const[a,s]=(0,n.useState)([]),[i,r]=(0,n.useState)(0),l=(0,n.useCallback)((async()=>{if(!e)return!1;try{const a=await fetch(`${j.i}/trackables/inventory?take=${encodeURIComponent(t)}`,{headers:{"Content-Type":"application/json",__RequestVerificationToken:e}});if(!a.ok){const e=await a.text().catch((()=>""));throw new Error(`Error: ${a.status} ${a.statusText} ${e}`.trim())}const n=await a.json();return s(n?.data??[]),r(n?.total??0),!0}catch(e){return console.error(`Error getting your Trackable inventory: ${e}`),!1}}),[e,t]);return(0,n.useEffect)((()=>{l()}),[l]),{getInventory:l,inventoryData:a,inventoryCount:i}}(a,e);return(0,n.useEffect)((()=>{t({inventoryCount:i,inventoryData:s})}),[i,s,t]),null},SidebarNavigation=e=>{const{AppSettingsUserInfo:t,dashboardSettings:a,experimentalfeaturesUrl:s,i18n:i,isMobileDevice:r=!1,mvcProps:c,useCompactLayout:d}=e,{base:u,navGroup:m,navListItem:h,navLinkWrapper:p,navLink:f,navHeader:x,navLinkIcon:y,navChildList:v,navSubList:w,sectionTitle:j,newBadge:k}=He({useCompactLayout:d}),C=(0,l.uc)(),N=o.h$[C]?.urls||{},L=N?.payweb||"http://payments.geocaching.com",T=!t?.userType||"Basic"===t?.userType,S=t?.publicGuid||"",I=A.c.trackables,[P,D]=(0,n.useState)((()=>{const e=(0,E.I)(a,I.settingKey);return null==e||!e})),[M,$]=(0,n.useState)({inventoryCount:0,inventoryData:[]}),F=(0,n.useMemo)((()=>(0,g.jsx)(PremiumFeatureIcon,{isBasic:T,i18n:{PremiumFeature:i.PremiumFeature??"Premium feature"},paywebUrl:L})),[T,i,L]),resolveLabel=e=>{if(e.countConfig){const t=c?.[e.countConfig.mvcPropKey];if("number"==typeof t&&t>0)return(0,b.AI)({translatedString:i[e.countConfig.i18nKey],value:t,useParentheses:e.countConfig.useParentheses})}return i[e.labelKey]??e.fallbackLabel??null},shouldRenderItem=e=>e.visibleIfMvcPropKey?Boolean(c?.[e.visibleIfMvcPropKey]):!e.hiddenIfMvcPropKey||!c?.[e.hiddenIfMvcPropKey],renderLeadingVisual=e=>{const t=e.imageMvcPropKey?c?.[e.imageMvcPropKey]:null;return"string"==typeof t&&t?(0,g.jsx)("img",{className:y(),src:t,alt:""}):e.iconName?(0,g.jsx)("svg",{"aria-hidden":"true",className:y(),children:(0,g.jsx)("use",{href:`#${e.iconName}--inline`})}):null},getNavItemLinkProps=e=>{const t=resolveLabel(e),a=(e=>{if(e.isPremium&&T)return L;if("experimentalfeaturesUrl"===e.hrefSidebarPropKey)return s??"#";if(e.hrefMvcPropKey){const t=c?.[e.hrefMvcPropKey];return"string"==typeof t&&t?t:"#"}const t=N?.[e.environmentUrlKey]??N?.web??"";return e.path?`${t}${e.path}`:e.pathTemplate?e.pathTemplate.replace("{publicGuid}",S):"#"})(e);return{label:t,href:a,content:(0,g.jsxs)("span",{className:"flex items-center gap-2",children:[renderLeadingVisual(e),t]})}},renderChildContent=e=>"favoritePointsSummary"!==e.childContent||T?"trackablesInventory"===e.childContent&&P?M.inventoryCount<=0?null:(0,g.jsx)("ul",{className:v({isTrackableList:!0}),children:(0,g.jsx)("li",{children:(0,g.jsx)(TrackablesInventory,{dashboardSettings:a,inventoryCount:M.inventoryCount,inventoryData:M.inventoryData,inventoryDisplayLimit:100,i18n:i,isMobileDevice:r,toggleText:(0,b.AI)({translatedString:i.YourInventoryWithCount??"Your inventory {0}",value:M.inventoryCount,useParentheses:!0})})})}):null:(0,g.jsxs)("ul",{className:v({isFavPointsData:!0}),children:[(0,g.jsx)("li",{children:(0,b.AI)({translatedString:i.FavoritesRemainingPoints,value:c?.favoritePointSummary?.Available??0})}),(0,g.jsx)("li",{children:(0,b.AI)({translatedString:i.FavoritesLogsUntilNextPoint,value:c?.favoritePointSummary?.LogsNeededToNext??0})}),(0,g.jsx)("li",{children:(0,b.AI)({translatedString:i.FavoritesTotalPoints,value:c?.favoritePointSummary?.Total??0})})]}),renderNavItem=(e,t)=>{if(!shouldRenderItem(e))return null;if(e.isHeader)return renderNavHeaderGroup(e,t);const{content:a,href:n}=getNavItemLinkProps(e);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("div",{className:p({size:"quickAccess"===t.id?"large":"small",useCompactLayout:d}),children:(0,g.jsxs)("a",{className:f(),href:n,...e.analytics,"data-testid":e.dataTestId,children:[a,e.isPremium&&F]})}),renderChildContent(e)]})},renderNavHeaderGroup=(e,t)=>{const a=resolveLabel(e),n=(e.items??[]).filter(shouldRenderItem);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("div",{className:p({size:"quickAccess"===t.id?"large":"small",useCompactLayout:d}),children:(0,g.jsxs)("span",{className:x(),"data-testid":e.dataTestId,children:[(0,g.jsxs)("span",{className:"flex items-center gap-2",children:[renderLeadingVisual(e),a]}),e.isPremium&&F]})}),n.length>0&&(0,g.jsx)("ul",{className:w(),children:n.map((e=>(0,g.jsx)("li",{className:h(),children:renderNavItem(e,t)},e.id)))})]})},renderSectionTitle=e=>{const t=i[e.titleKey]??e.fallbackTitle??null;
1return null!=e.newIndicatorMvcPropKey&&Boolean(c?.[e.newIndicatorMvcPropKey])?(0,g.jsxs)("span",{className:j(),children:[t,(0,g.jsx)("span",{"aria-hidden":"true",className:k(),children:i.New??"New"})]}):t};return(0,g.jsxs)("nav",{className:u(),"aria-label":i.SecondaryNavLabelAccountLinks,children:[P&&(0,g.jsx)(TrackablesInventoryLoader,{inventoryDisplayLimit:100,onInventoryChange:$,reqToken:t?.reqToken}),qe.filter((e=>!e.visibleIfMvcPropKey||Boolean(c?.[e.visibleIfMvcPropKey]))).map((e=>(0,g.jsx)(SidebarNavigationSection,{dashboardSettings:a,isMobileDevice:r,onExpandedChange:"trackables"===e.id?e=>{e&&D(!0)}:void 0,section:e,title:renderSectionTitle(e),children:(0,g.jsx)("ul",{className:m(),children:e.items.map((t=>(0,g.jsx)("li",{className:h(),children:renderNavItem(t,e)},t.id)))})},e.id)))]})};var Je=a(63157);const ProfileSummary=e=>{const{analyticsPageTitle:t,dashboardSettings:a,environmentUrls:n,i18n:s,mvcProps:i,AppSettingsUserInfo:r,username:l}=e,o=!r?.userType||"Basic"===r?.userType,c=A.c.profileSummary,{isExpanded:u,toggleExpanded:m}=(0,E.p)({dashboardSettings:a,settingKey:c.settingKey}),h={analyticsPageTitle:t,coverImageUrl:i?.coverImageUrl,editImageLink:(0,d.k)(n?.web,"/account/settings/profile"),editCoverImageIconName:"pencil--inline",editProfileImageIconName:"camera-filled--inline",i18n:{Edit:s?.Edit??"Edit",EditProfileImage:s?.EditProfileImage??"Edit profile photo",ProfileCoverPhoto:s?.ProfileCoverPhoto??"Profile cover photo",ProfileImgFor:s?.UserProfilePhoto?.replace("{0}",l)??`Profile image for ${l}`,ViewProfile:s?.ViewProfile??"View profile"},profileImageUrl:i?.profileImageUrl,profileLink:(0,d.k)(n?.web,"/p/default.aspx"),stats:{finds:{icon:"smiley_no-outline--inline",label:s?.GeocacheFindCount??void 0,link:(0,d.k)(n?.web,"/my/geocaches.aspx")},hides:{icon:"owned_no-outline--inline",label:s?.GeocacheHideCount??void 0,link:(0,d.k)(n?.web,"/my/owned.aspx")},joined:{icon:"calendar-2--inline",label:s?.AccountJoinedDate??void 0},...!o&&{renewal:{icon:"refresh--inline",label:s?.AccountRenewalDate??void 0}}},useLegacyProfileImageUi:!0};return(0,g.jsx)(P.iV,{id:"profileSummary",isExpanded:u,header:({contentId:e})=>(0,g.jsx)(D.h,{contentId:e,headerSize:"small",isExpanded:u,onToggle:m,title:s.ProfileSummary??"Profile Summary"}),children:(0,g.jsx)(Je.q,{...h})},"profileSummary")};function getNewListLabel(){return window.ListResources?.NewListName??window.ListResources?.newListName??"New list name"}function getErrorMessage(e){return 422===e?window.ListResources?.ErrorListsTooMany??window.ListResources?.errorListsTooMany??"Sorry, you have reached your List limit. Please delete a List to make a new one.":window.ListResources?.ErrorListsBadRequest??window.ListResources?.badRequest??"There was a problem updating your list."}const Qe=`${j.i}/lists`,Ze=[];function getRequestHeaders(e=!1){const t={},a=window.App?.Settings?.get?.("user:info")?.reqToken;return e&&(t["Content-Type"]="application/json; charset=utf-8"),a&&(t["X-Verification-Token"]=a),t}async function requestJson(e,t={}){const a=await fetch(e,{credentials:"same-origin",...t}),n=await async function readJson(e){if(!(e.headers.get("content-type")??"").includes("application/json"))return null;try{return await e.json()}catch{return null}}(a);if(!a.ok){const e=new Error(n?.errorMessage??n?.message??`Request failed with ${a.status}`);throw e.status=a.status,e.responseJSON=n,e}return n}function normalizeList(e){return e?{...e,id:e.id??e.referenceCode,referenceCode:e.referenceCode??e.id}:null}async function fetchAddToListOptions(){return((await requestJson(`${Qe}?type=bm&take=100`,{headers:getRequestHeaders()})).data??[]).map(normalizeList).filter(Boolean)}const useAddToLists=({item:e,onAdded:t,prefetchedLists:a=null})=>{const s=(0,n.useMemo)((()=>function createAddToListDataStructure(e){const t=e.data;return[{name:t.name,id:t.geocacheReferenceCode,rownumber:0,referenceCode:t.geocacheReferenceCode,listItem:{name:t.name,description:""}}]}(e)),[e]),[i,r]=(0,n.useState)(a??Ze),[l,o]=(0,n.useState)(""),[c,d]=(0,n.useState)(!1),[u,m]=(0,n.useState)(null),[h,p]=(0,n.useState)(""),[g,f]=(0,n.use
1State)(null),{data:x,error:y,isLoading:b}=(0,k.e)(null===a?fetchAddToListOptions:null,[a],Ze);(0,n.useEffect)((()=>{r(a??x)}),[a,x]),(0,n.useEffect)((()=>{if(y){const e=y;console.warn(`${e.status??"Unknown"} Error loading lists: ${e.message}`),p(getErrorMessage(e.status))}else b||p("")}),[y,b]);const v=l.trim().length>0,w=c||null!==u,addToExistingList=async e=>{try{await requestJson(`${Qe}/${encodeURIComponent(e)}/geocaches`,{method:"PUT",headers:getRequestHeaders(!0),body:JSON.stringify(s)}),f(e),window.setTimeout((()=>{t?.()}),500)}catch(e){const t=e;console.warn(`${t.status??"Unknown"} Error adding to existing list: ${t.message}`),p(getErrorMessage(t.status))}finally{m(null)}};return{addingToListRefCode:u,isBusy:w,isCreatingList:c,isListNameAcceptable:v,isLoadingLists:b,lists:i,newListName:l,onAddToExistingList:async e=>{e&&!w&&(m(e),p(""),await addToExistingList(e))},onAddToNewList:async()=>{const e=l.trim();if(e&&!w){d(!0),p("");try{const t=function getCreatedList(e,t){let a=null;e&&(a="data"in e?e.data??null:e);const n=normalizeList(a);return n?.referenceCode?{description:"",name:t,type:{code:"bm"},...n}:null}(await requestJson(Qe,{method:"POST",headers:getRequestHeaders(!0),body:JSON.stringify({name:e,description:"",lastUpdateUtc:(new Date).toISOString(),type:{code:"bm"}})}),e);if(!t?.referenceCode)throw new Error("Missing list reference code");r((e=>[t,...e.filter((e=>e.referenceCode!==t.referenceCode))])),m(t.referenceCode),o(""),await addToExistingList(t.referenceCode)}catch(e){const t=e;console.warn(`${t.status??"Unknown"} Error adding to new list: ${t.message}`),p(getErrorMessage(t.status))}finally{d(!1)}}},setNewListName:o,statusMessage:h,successfulListRefCode:g}},Xe=(0,p.tv)({slots:{base:"group flex flex-nowrap justify-start gap-2 bg-white border-none rounded-lg p-2 text-base/5",iconContainer:"flex shrink-0",cacheIcon:"",activityData:"flex m-0 items-center",compactDatum:"shrink-0",compactNameDatum:"grow shrink basis-0 min-w-0",gcCode:"m-0 text-gray-500",metaTags:"flex gap-1",srOnly:"sr-only",premiumLogo:"h-[14px] w-[61px]",geocacheHeader:"sr-only",geocacheNameDd:"m-0 flex flex-[1_1_0%] min-w-0 w-0 items-center",geocacheNameLink:"inline-block min-w-0 max-w-full text-gray-600 font-bold",geocacheNameText:"block w-full truncate",activityDataTop:"flex gap-2",activityDataBottom:"order-3 flex gap-2",activityMeta:"mt-[3px]",eventDate:"flex gap-1 items-center",eventCreatorSeparator:"left-separator",mobileMenuBtn:"block bg-transparent border-none p-0 m-0",mobileMenuIcon:"block size-5 cursor-pointer",metadataIcon:"size-4",eventDateIcon:"size-3",gcCodeSeparator:"left-separator",actionsList:"m-0 p-0 list-none shrink-0 flex items-center",actionLink:"flex gap-2 items-center",actionIcon:"block size-5",actionLabel:""},variants:{visuallyDisabled:{true:{base:"bg-white/[.38]"}},isInPast:{true:{cacheIcon:"opacity-50"}},useCompactLayout:{true:{base:"py-[2px] gap-1 items-center min-w-0",activityData:"flex-1 min-w-0
1w-0 gap-1",geocacheHeader:"flex grow shrink",gcCode:"mr-1 shrink-0",actionsList:"gap-1",actionLink:"",mobileMenuBtn:"shrink-0",actionIcon:"size-[18px]"},false:{activityData:"grow shrink min-w-0",activityHeader:"",activityDataTop:"",actionsList:"gap-2"}}}});var et,tt=a(94770),at=a(85849);const nt=(0,p.tv)({slots:{base:"flex items-center justify-center rounded-[2px] py-[1px] px-1 text-[10px] h-[18px] w-fit font-bold font-input bg-gray-50 text-gray-600 leading-4 group-[.isDisabled]:bg-gray-100"},variants:{type:{premium:{base:"p-[2px] group-[.isDisabled]:bg-white"},disabled:{base:"bg-red-50 text-red-600 group-[.isDisabled]:bg-red-100"},geotour:{base:"bg-blue-50 text-blue-600 group-[.isDisabled]:bg-blue-100"}}}}),getGeocacheStatusMetaTag=(e,t)=>{if(e.isArchived)return{label:t.ArchivedStatus,text:t.Archived,twClasses:nt().base()};if(!e.isPublished)return{label:t.PublishedStatus,text:t.Unpublished,twClasses:nt().base()};if(!e.isAvailable)return{label:t.ActiveStatus,text:t.Disabled,twClasses:nt().base({type:"disabled"})};if(e.isOnGeotour)return{label:t.GeotourStatus,text:t.GeotourGeocache,twClasses:nt().base({type:"geotour"})};if(e.isEvent){return!!e.placedDate&&F.A.fromISO(e.placedDate)<F.A.now().minus({days:1})?{label:t.EventStatus,text:t.Past,twClasses:nt().base()}:null}return null},GeocacheStatusTags=({data:e,locals:t={}})=>{const a=getGeocacheStatusMetaTag(e,t);return Boolean(a||e.isPremium)?(0,g.jsxs)(g.Fragment,{children:[e.isPremium&&(0,g.jsx)("span",{className:nt().base({type:"premium"}),children:(0,g.jsx)("svg",{role:"img","aria-label":t.PremiumOnlyCache,className:"h-[14px] w-[61px]",children:et||(et=(0,g.jsx)("use",{href:"#premium-logo--inline"}))})}),a&&(0,g.jsxs)("span",{className:a.twClasses,children:[(0,g.jsx)("span",{className:"sr-only",children:a.label}),a.text]})]}):null};var st=a(45516);const it=(0,p.tv)({slots:{base:"flex flex-col gap-4",heading:"m-0 pr-8 text-lg font-bold leading-6 text-gray-900",createSection:"flex flex-col gap-1",inputRow:"flex items-start gap-2",input:["min-w-0 flex-1 px-3 py-[10px] bg-white m-0","rounded border border-gray-200 hover:border-gray-300","text-base/5 text-gray-600 placeholder:text-gray-500","focus:outline-none focus:shadow-outline","disabled:cursor-not-allowed disabled:opacity-[.38]"].join(" "),addButton:"max-h-[42px]",statusMessage:"text-xs/4 text-red-500",existingListsContainer:"flex flex-col gap-2 mt-4",existingListsHelperText:"m-0 text-base/5 text-gray-600",listRegion:"rounded border border-gray-200 bg-gray-25",list:"m-0 flex max-h-72 list-none flex-col overflow-y-auto p-1 gap-1",listItem:"m-0",listButton:["flex w-full items-center justify-between rounded px-3 py-1 text-left","bg-white text-base/5 text-gray-600 transition-colors border-none cursor-pointer","hover:bg-gray-50 focus:outline-none focus:shadow-outline","disabled:cursor-not-allowed disabled:text-gray-500 disabled:hover:bg-transparent"].join(" "),listButtonLabel:"truncate",listButtonState:"ml-3 shrink-0 text-xs font-normal text-teal-700",emptyState:"px-3 py-4 text-sm leading-5 text-gray-600"},variants:{hasError:{true:{input:"border-red-500 hover:border-red-500 bg-red-50"}}}}),AddToListMenu=({item:e,onAdded:t,prefetchedLists:a=null,headless:s=!1,suppressHeading:i=!1})=>{const r=it(),l=(0,n.useRef)(`new-list-name-${Math.random().toString(36).slice(2)}`),{addingToListRefCode:o,isBusy:c,isListNameAcceptable:d,isLoadingLists:u,lists:m,newListName:h,onAddToExistingList:p,onAddToNewList:f,setNewListName:x,statusMessage:y,successfulListRefCode:b}=useAddToLists({item:e,onAdded:t,prefetchedLists:a}),v=s?n.Fragment:"section";return(0,g.jsxs)(v,{className:r.base(),"aria-busy":c||u,children:[(0,g.jsxs)("div",{className:r.createSection(),children:[!i&&(0,g.jsx)("h2",{id:`${l.current}-heading`,className:r.heading(),children:window.ListResources?.CreateNewList??window.ListResources?.createNewList??"Create a new list"}),(0,g.jsxs)("div",{className:r.inputRow(),children:[(0,g.jsx)("label",{className:"sr-only",htmlFor:l.current,children:getNewListLabel()}),(0,g.jsx)("input",{id:l.current,name:"newListName",type:"text",value:h,onChange:e=>x(e.target.value),onKeyDown:e=>{"Enter"===e.key&&d&&(e.preventDefault(),f())},className:r.input({hasError:Boolean(y)}),placeholder:getNewListLabel(),"aria-label":getNewListLabel(),"aria-describedby":`${l.current}-existing-lists`,disabled:c,autoComplete:"off"}),d&&(0,g.jsx)("button",{type:"button",className:`${(0,w.P$)()} ${r.addButton()}`,onClick:()=>{f()}
1,disabled:c,children:window.ListResources?.Add??window.ListResources?.add??"Add"})]}),(0,g.jsx)("div",{className:r.statusMessage(),role:"status","aria-live":"polite",children:y})]}),u?null:m.length>0&&(0,g.jsxs)("div",{className:r.existingListsContainer(),children:[(0,g.jsx)("p",{id:`${l.current}-existing-lists`,className:r.existingListsHelperText(),children:window.ListResources?.AddToExistingList??window.ListResources?.addToExistingList??"Add to an existing list"}),(0,g.jsx)("div",{className:r.listRegion(),children:(0,g.jsx)("ul",{className:r.list(),"aria-label":"Existing lists",children:m.map((e=>{const t=e.referenceCode,a=o===t,n=b===t;return(0,g.jsx)("li",{className:r.listItem(),"data-cid":e.id??t,children:(0,g.jsxs)("button",{type:"button",onClick:()=>{p(t)},disabled:c,"aria-busy":a,"aria-pressed":n,className:r.listButton(),children:[(0,g.jsx)("span",{className:r.listButtonLabel(),children:e.name??"Untitled list"}),(a||n)&&(0,g.jsx)("span",{className:r.listButtonState(),"aria-hidden":"true",children:a?"Adding...":"Added"})]})},t??e.id??e.name??"list")}))})})]})]})};AddToListMenu.displayName="AddToListMenu";const rt=AddToListMenu;var lt,ot,ct,dt,ut,mt;const ht=[V.dc.GeocacheTypes.Event,V.dc.GeocacheTypes.CitoEvent,V.dc.GeocacheTypes.MegaEvent,V.dc.GeocacheTypes.GigaEvent,V.dc.GeocacheTypes.GeocachingHqBlockPartyEvent,V.dc.GeocacheTypes.CommunityCelebrationEvent],ViewedFeedItem=({cacheSizes:e,geocacheTypeLabels:t,item:a,i18n:s={},cacheHasProblem:i=!1,useCompactLayout:l=!1,userInfo:o,prefetchedAddToLists:c=null})=>{var d;(0,r.useMediaQuery)({query:"(max-width: 600px)"});const u=(0,r.useMediaQuery)({query:"(max-width: 1200px)"}),m=(0,n.useRef)(null),h=(0,n.useRef)(null),p=Xe({useCompactLayout:l}),[f,x]=(0,n.useState)(!1),y=s.geocacheTags??{},v=(0,n.useMemo)((()=>{const e=(t=a.data.cacheTypeId,ht.includes(t));var t;const n=!(!e||!a.data.placedDate)&&F.A.fromISO(a.data.placedDate)<F.A.now().minus({days:1}),s=a.data.placedDate?F.A.fromISO(a.data.placedDate).toFormat("t"):void 0;return{...a.data,isEvent:e,isInPast:n,eventStartTime:s}}),[a.data]),j=(0,n.useMemo)((()=>getGeocacheStatusMetaTag(v,y)||v.isPremium?d||(d=(0,g.jsx)(GeocacheStatusTags,{data:v,locals:y})):null),[v,y]),k=a.relationships?.author?.accountId,C=a.relationships?.author?.username??"",N=o.accountId===k,L="Basic"!==o.userType,T=!v.isAvailable||!v.isPublished,S=Boolean(v.isFound||v.isDnf),I=N||v.hasDrafts||v.isSolved||Boolean(v.isFound||v.isDnf);let A;N?A="owned":S?A=v.isFound?"2":"3":v.hasDrafts?A="draft":v.isSolved&&(A="correctedcoords");const P=A?`#icon-${A}`:"",D="string"==typeof v.geocacheReferenceCode&&v.geocacheReferenceCode.length>0,E=a.links?.self??null,M=a.links?.action??null;let $=M;if(M){let e="";N?e=i?"46":"4":v.isFound&&(e="4"),$=e?`${M}&LogType=${e}`:M}const{modalProps:R,toggleModal:O}=st.v2.useModal("custom",m,{isOpen:!1,closeIconName:"close--inline",uniqueId:`viewed-feed-item-actions-${a.id}`,size:"small",onCloseClick:()=>O(!1),resources:{headerText:s.viewedFeed?.Actions??"Actions",close:s.playerDashboard?.Close??"Close"}}),{modalProps:B,toggleModal:U}=st.v2.useModal("custom",h,{isOpen:!1,closeIconName:"close--inline",uniqueId:`viewed-feed-item-add-to-list-${a.id}`,size:"medium",onCloseClick:()=>{x(!1),U(!1)},resources:{headerText:window.ListResources?.CreateNewList??"Create a new list",close:s.playerDashboard?.Close??"Close"}}),K=(0,n.useMemo)((()=>{const e=`/app/ui-icons/sprites/cache-types.svg#icon-${v.cacheTypeId}${T?"-disabled":""}`,a=I?N||!S?`/app/ui-icons/sprites/cache-types.svg${P}`:`/app/ui-icons/sprites/log-types.svg${P}`:void 0;return(0,g.jsx)(at.Z,{icons:{primary:{href:e,ariaLabel:t[v.cacheTypeId]??"",className:p.cacheIcon({isInPast:v.isInPast&&v.isAvailable})},secondary:a?{href:a}:void 0},size:l?"small":"large"})}),[v.cacheTypeId,v.isAvailable,v.isInPast,t,S,P,N,I,p,T]),z=(s.viewedFeed?.ActionMenuForCache??"Action menu for {0}").replace("{0}",a.data.name??a.data.geocacheReferenceCode??"cache"),onAddCacheToListClick=({fromMobile:e=!1}={})=>{e&&O(!1),x(!0),U(!0)},onAddToListComplete=()=>{x(!1),U(!1)},H=p.base({visuallyDisabled:T});return(0,g.jsxs)("div",{className:H,"data-viewedid":a.id,children:[(0,g.jsx)("h3",{className:p.geocacheHeader(),children:v.name})," ",l?(0,g.jsx)(g.Fragment,{children:(0,g.jsxs)("dl",{className:p.activityData(),children:[(0,g.jsx)("dt",{className:"sr-only",children:s.playerDashboard.Type??"Type"}),(0,g.jsx)("dd",{className:p.iconContainer(),title:s.playerDashboard.Type??"Type",children:K}),D&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("dt",{className:"sr-only",children:s.playerDashboard.GeocacheCode??"Geocache code"}),(0,g.jsx)("dd",{className:p.gcCode(),title:s.playerDashboard.GeocacheCode??"Geocache code",children:v.geocacheReferenceCode})]}),(0,g.jsx)("dt",{className:"sr-only",children:s.viewedFeed?.GeocacheName??"Geocache name"}),(0,g.jsx)("dd",{className:p.geocacheNameDd(),title:s.viewedFeed?.GeocacheName??"Geocache name",children:(0,g.jsx)("a",{className:p.geocacheNameLink(),href:E,children:(0,g.jsx)("span",{className:p.geocacheNameText(),children:v.name??""})})})]})}):(0,g.jsxs)("div",{className:p.activityData(),children:[K,(0,g.jsx)(tt.H,{cacheName:v.name,cacheUrl:E,i18n:{...s.playerDashboard,...s.viewedFeed},detailsData:{topRow:{...!v.isEvent&&{favoritePoints:{ddText:v.favoritePoints,dtText:s.playerDashboard?.Favorites??"[Favorites]",iconName:v.isFavorited?"heart--inline":"heart_open--inline",isFavorited:v.isFavorited}},geocacheCode:{ddText:v.geocacheReferenceCode,dtText:s.playerDashboard?.GeocacheCode??"[Geocache code]"},...j&&{labelBadges:{ddText:(0,g.jsx)("div",{className:"flex gap-1",children:j}),dtText:s.viewedFeed?.Tags??"[Tags]"}},owner:{ddText:C,dtText:v.isEvent?s.playerDashboard?.HostedBy??"[Hosted by]":s.playerDashboard?.PlacedBy??"[Placed by]",truncate:!0,iconName:"account--inline"}},bottomRow:{difficultyTerrainRating:{ddText:(0,g.jsxs)(g.Fragment,{children:[v.difficultyLevel,lt||(lt=(0,g.jsx)("span",{"aria-hidden":"true",children:"/"})),v.terrainLevel]}),dtText:s.viewedFeed?.DifficultyTerrainRating??"[Difficulty terrain rating]",iconName:"statistics--inline"},...v.isEvent&&{eventDate:{ddText:(0,b.po)(v.placedDate),dtText:s.playerDashboard?.EventDateLabel??"[Event date]",iconName:"
1calendar-2--inline"},eventTime:{ddText:v.eventStartTime,dtText:s.events?.EventTime??"[Event start time]",iconName:"time--inline"}},...!v.isEvent&&{cacheSize:{ddText:(0,b.kb)(v.containerTypeId),dtText:s.playerDashboard?.Size??"[Size]",iconName:"size--inline"}},location:{ddText:s.playerDashboard?.RegionCountry?.replace("{0}",v.state??"").replace("{1}",v.country??"")??"",dtText:s.playerDashboard?.Location??"[Location]",truncate:!0,iconName:"pin--inline"}}}})]}),u?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("button",{type:"button",className:p.mobileMenuBtn(),onClick:()=>{O(!0)},children:(0,g.jsx)("svg",{className:p.mobileMenuIcon(),role:"img","aria-label":z,children:ot||(ot=(0,g.jsx)("use",{href:"#more-vert--inline"}))})}),(0,g.jsx)(st.v2.Modal,{ref:m,...R,children:(0,g.jsxs)("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:[(0,g.jsx)("li",{children:(0,g.jsxs)("a",{href:$,className:`${(0,w.Oo)({size:"sm"})} ${p.actionLink()} w-full justify-center`,children:[(0,g.jsx)("svg",{"aria-hidden":"true",className:p.actionIcon(),children:ct||(ct=(0,g.jsx)("use",{href:"#pencil--inline"}))}),(0,g.jsx)("span",{className:p.actionLabel(),children:s.viewedFeed?.Log??"Log"})]})}),L&&(0,g.jsx)("li",{children:(0,g.jsxs)("button",{className:`${(0,w.Oo)({size:"sm"})} ${p.actionLink()} w-full justify-center`,type:"button",onClick:()=>onAddCacheToListClick({fromMobile:!0}),children:[(0,g.jsx)("svg",{"aria-hidden":"true",className:p.actionIcon(),children:dt||(dt=(0,g.jsx)("use",{href:"#new--inline"}))}),(0,g.jsx)("span",{className:p.actionLabel(),children:s.viewedFeed?.List??"List"})]})})]})}),(0,g.jsx)(st.v2.Modal,{ref:h,...B,children:f&&(0,g.jsx)(rt,{item:a,onAdded:onAddToListComplete,prefetchedLists:c,suppressHeading:!0,headless:!0})})]}):(0,g.jsxs)("ul",{className:p.actionsList(),children:[(0,g.jsx)("li",{children:(0,g.jsxs)("a",{href:$,className:`${(0,w.Oo)({size:"sm"})} ${p.actionLink()}`,children:[(0,g.jsx)("svg",{"aria-hidden":"true",className:p.actionIcon(),children:ut||(ut=(0,g.jsx)("use",{href:"#pencil--inline"}))}),(0,g.jsx)("span",{className:p.actionLabel(),children:s.viewedFeed?.Log??"Log"})]})}),L&&(0,g.jsx)("li",{children:(0,g.jsxs)("button",{className:`${(0,w.Oo)({size:"sm"})} ${p.actionLink()}`,type:"button",onClick:()=>onAddCacheToListClick(),children:[(0,g.jsx)("svg",{"aria-hidden":"true",className:p.actionIcon(),children:mt||(mt=(0,g.jsx)("use",{href:"#new--inline"}))}),(0,g.jsx)("span",{className:p.actionLabel(),children:s.viewedFeed?.List??"List"})]})})]}),!u&&(0,g.jsx)(st.v2.Modal,{ref:h,...B,children:f&&(0,g.jsx)(rt,{item:a,onAdded:onAddToListComplete,prefetchedLists:c,suppressHeading:!0,headless:!0})})]})};ViewedFeedItem.displayName="ViewedFeedItem",window.App=window.App||{};const getViewedSinceDateTimeUtc=()=>G().utc().subtract(30,"d").format("YYYY-MM-DD"),buildViewedUrl=({take:e=5,viewedSinceDateTimeUtc:t=getViewedSinceDateTimeUtc()}={})=>{const a=new URLSearchParams({take:String(e),viewedSinceDateTimeUtc:t});return`${j.i}/activities/account/${App?.Settings?.get("user:info")?.referenceCode}/recentlyviewed?${a.toString()}`},pt={buildUrl:buildViewedUrl,async fetchRecentlyViewed({take:e=5,viewedSinceDateTimeUtc:t=getViewedSinceDateTimeUtc(),signal:a}={}){const n=await fetch(buildViewedUrl({take:e,viewedSinceDateTimeUtc:t}),{method:"GET",credentials:"same-origin",signal:a});if(!n.ok)throw new Error(`ViewedV2 request failed with status ${n.status}`);return n.json()}},gt=(he().Collection.extend({url:buildViewedUrl(),model:he().Model}),(0,p.tv)({slots:{base:"max-w-full min-w-0",loading:"px-3",emptyState:"px-3 text-center text-gray-500",viewedList:"flex flex-col gap-1 m-0 p-0 list-none",viewAllBar:"bg-white w-full px-3 rounded-lg text-center",viewAllLink:"cursor-pointer text-blue-600 underline hover:no-underline focus:shadow-outline"},variants:{useCompactLayout:{true:{loading:"py-1",emptyState:"py-1",viewAllBar:"py-1"},false:{loading:"py-2",emptyState:"py-2",viewAllBar:"py-2"}}}})),RecentlyViewedFeed=({cacheSizes:e,geocacheTypeLabels:t,dashboardSettings:a,i18n:s,isMobileDevice:i,useCompactLayout:r,userInfo:l})=>{const o=A.c.viewedFeed,c=gt({useCompactLayout:r}),{isExpanded:d,toggleExpanded:u}=(0,E.p)({dashboardSettings:a,settingKey:o.settingKey,isMobileDevice:i,usesIsCollapsedPattern:o.usesIsCollapsedPattern}
1),[m,h]=(0,n.useState)(!1),[p,f]=(0,n.useState)([]),[x,y]=(0,n.useState)(!1),[b,v]=(0,n.useState)(null),w=(0,n.useRef)(!1),j=(0,n.useRef)(!1);return n.useEffect((()=>{if(d){if(!w.current){w.current=!0;(async()=>{try{const e=await pt.fetchRecentlyViewed({take:6});y(e.length>5),f(e.length>5?e.slice(0,5):e)}catch(e){console.error("Error fetching recently viewed data:",e)}finally{h(!0)}})()}if(!j.current){j.current=!0;(async()=>{try{const e=await fetchAddToListOptions();v(e)}catch(e){console.error("Error preloading add-to-list data:",e)}})()}}}),[d]),(0,g.jsxs)(P.iV,{id:"viewedFeed",className:c.base(),isExpanded:d,header:({contentId:e})=>(0,g.jsx)(D.h,{contentId:e,headerSize:"small",isExpanded:d,onToggle:u,title:s.playerDashboard?.RecentlyViewedHeader??"Recently viewed"}),children:[!m&&d&&(0,g.jsx)(Fe.Gu,{size:"md","aria-label":s.playerDashboard?.Loading??"Loading",containerClassName:c.loading()}),m&&0===p.length?(0,g.jsx)("div",{className:c.emptyState(),children:s.playerDashboard?.NoRecentlyViewedCaches??"No recently viewed caches"}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("ul",{className:c.viewedList(),children:p.map(((a,n)=>(0,g.jsx)("li",{children:(0,g.jsx)(ViewedFeedItem,{cacheSizes:e,geocacheTypeLabels:t,item:a,i18n:s,prefetchedAddToLists:b,useCompactLayout:r,userInfo:l})},`${a.data.geocacheReferenceCode}-${n}`)))}),x&&(0,g.jsx)("div",{className:c.viewAllBar(),children:(0,g.jsx)("a",{href:"/my/recentlyviewedcaches.aspx",className:c.viewAllLink(),children:s.playerDashboard?.ViewAll??"View all"})})]})]},"viewedFeed")};var ft;RecentlyViewedFeed.displayName="RecentlyViewedFeed";const ActivityEmptyState=({message:e,subtext:t="",ctaLinkText:a,ctaLinkUrl:n,userPrivacyText:s,userPrivacyUrl:i})=>(0,g.jsxs)("div",{className:"bg-white rounded-lg flex flex-col gap-3 text-center p-6",children:[ft||(ft=(0,g.jsx)("img",{className:"m-auto",src:"/app/ui-images/premium/GTmap.svg",width:"190",height:"100",alt:"","aria-hidden":"true"})),(0,g.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,g.jsx)("p",{className:"font-bold m-0",children:(0,g.jsx)("strong",{children:e})}),t&&(0,g.jsx)("p",{className:"m-0",children:t})]}),(0,g.jsx)("div",{children:(0,g.jsx)("a",{href:n,className:`${(0,w.P$)()} inline-block`,children:a})}),s&&i&&(0,g.jsx)("div",{children:(0,g.jsx)("a",{href:i,className:"text-xs",children:s})})]}),getSpriteIconHref=({iconId:e,sprite:t})=>!1===e||null==e||""===e?"":`/app/ui-icons/sprites/${t}.svg#icon-${e}`,getActivityParentIconData=({cacheTypeId:e,isTrackableLog:t,i18n:a})=>{if(t)return{href:"/account/app/ui-icons/icons/global/travelbug-default.svg",ariaLabel:a?.Trackable};const n="string"==typeof e||"number"==typeof e?a?.geocacheTypeLabels?.[e]:void 0;return{href:getSpriteIconHref({iconId:e,sprite:"cache-types"}),ariaLabel:n}},shouldLeadActivityWithProfileImage=({activityType:e})=>"yours"!==e,showActivityFavPointIcon=({item:e,matchLogTypeId:t})=>{if(!e.isFavorited)return!1;return void 0===t?[2,3,4,5,6,7,9,10,12].includes(e.logTypeId):e.logTypeId===t},getActivityLogLinkProps=({item:e,i18n:t,useCompactLayout:a=!1})=>{let n=e.links?.action??null,s=t.ViewLog??"View log",i="log-view",r="View log - "+(a?"Compact view":"Detailed view");return e.authorIsSelf&&(n=e.links?.edit??e.links?.action??null,s=t.EditLog??"Edit log",i="pencil-new-square",r="Edit log - "+(a?"Compact view":"Detailed view")),n?{href:n,text:s,icon:i,dataLabel:r}:null},getActivityAuthorDisplayName=({item:e,i18n:t})=>e.authorIsSelf?t?.YouUser??"You":e.author?.username??"Unknown user",getActivityProfileLinkLabel=({item:e,i18n:t})=>(({translatedString:e,value:t,boldValue:a=!1})=>e?e.replace("{0}",a?`<strong>${t}</strong>`:t):"")({translatedString:t?.VisitProfile??"Visit {0}'s Profile",value:e.author?.username??"Author"}),getActivityPresentation=({activityType:e,item:t,i18n:a,useCompactLayout:n=!1})=>{const s=shouldLeadActivityWithProfileImage({activityType:e}),i=getActivityParentIconData({cacheTypeId:t.cacheTypeId,isTrackableLog:t.isTrackableLog,i18n:a}),r=getSpriteIconHref({iconId:t.logTypeId,sprite:"log-types"}),l={href:"#heart_filled_circle--inline",ariaLabel:a?.FavoritePointAwarded??"Favorite point awarded"},o={href:r,ariaLabel:void 0};
1return{authorDisplayName:getActivityAuthorDisplayName({item:t,i18n:a}),parentTypeIcon:i,favoriteIcon:l,leadWithProfileImage:s,logLink:getActivityLogLinkProps({item:t,i18n:a,useCompactLayout:n}),logTypeIcon:o,profileLinkLabel:getActivityProfileLinkLabel({item:t,i18n:a}),showFavPointIcon:e=>showActivityFavPointIcon({item:t,matchLogTypeId:e}),iconStackOptions:s?{primary:o,secondary:showActivityFavPointIcon({item:t})?l:void 0}:{primary:{href:i.href,ariaLabel:i.ariaLabel??""},secondary:showActivityFavPointIcon({item:t,matchLogTypeId:2})?l:o}}},getActivityLogTextLink=({item:e,userInfo:t,environmentUrls:a})=>{const n=e.isCondensed,s="Basic"!==t.userType;if(n&&e.parentReferenceCode){const t=e.author?.username;if(0===e.parentReferenceCode.indexOf("TB"))return(0,d.k)(a?.web,`/p/default.aspx?u=${encodeURIComponent(t)}&tab=trackables`);if(0===e.parentReferenceCode.indexOf("GC")&&s){const n=e.logDateTime.split("T")[0],s=`/play/results?sort=founddate&asc=false&fb=${encodeURIComponent(t)}&fod=${encodeURIComponent(n)}`;return(0,d.k)(a?.gameplay,s)}}return e.links?.parent},getActivityFormattedLogSummary=({item:e,i18n:t,userInfo:a,environmentUrls:s,itemActionLinkClassName:i,itemActionLinkContentClassName:r,itemTargetLinkClassName:l,itemTargetLinkContentClassName:o,useExplicitSpaces:c=!1,prependSpace:d=!1})=>{const u=(({item:e,i18n:t})=>{const a=e.logTypeId?`LogFormat${e.logTypeId}`:"";return 14!==e.logTypeId||e.relationships?.target?.name?t?.logFormats?.[a]??"":t?.logFormats?.LogFormat14_noTarget??t?.logFormats?.[a]??""})({item:e,i18n:t});if(!u)return null;const m=13===e.logTypeId||14===e.logTypeId,h=(({item:e,i18n:t})=>{const a=t?.logFormats;let n="";switch(e.logTypeId){case 9:case 10:n=a?.AdditionalEvents??t?.AdditionalEvents??"";break;case 22:case 23:n=a?.AdditionalGeneric??t?.AdditionalGeneric??"";break;default:n=0===e.parentReferenceCode?.indexOf("TB")?a?.AdditionalTrackables??t?.AdditionalTrackables??"":a?.AdditionalCaches??t?.AdditionalCaches??""}return n.replace("{0}",String(e.condensedCount??""))})({item:e,i18n:t}),p=getActivityLogTextLink({item:e,userInfo:a,environmentUrls:s})??"",f=(({item:e,userInfo:t,environmentUrls:a})=>e.isCondensed&&0===e.parentReferenceCode?.indexOf("GC")?e.links?.parent??"":getActivityLogTextLink({item:e,userInfo:t,environmentUrls:a})??"")({item:e,userInfo:a,environmentUrls:s})??"",x=e.relationships?.target?.name,y=i??"",b=r??"",v=e.isCondensed&&m?`${e.name??""} ${h}`.trim():e.name??"",w=u.split(/(\{0\}|\{1\})/g),j=[];let k=d;if(w.forEach(((t,a)=>{if("{0}"===t)return j.push({key:`log-name-${a}`,href:f,text:v,className:y||void 0,contentClassName:b||void 0,spaceBefore:k}),void(k=!1);if("{1}"===t)return x&&j.push({key:`log-target-${a}`,href:e.relationships?.target?.links?.self??void 0,text:x,className:[y,l].filter(Boolean).join(" ")||void 0,contentClassName:[b,o].filter(Boolean).join(" ")||void 0,spaceBefore:k}),void(k=!1);if(t){if(c){const e=t.trim(),n=/^\s/.test(t),s=/\s$/.test(t);return e?(j.push({key:`log-text-${a}`,text:e,spaceBefore:k||n}),void(k=s)):void(k=k||n||s)}j.push({key:`log-text-${a}`,text:t})}})),e.isCondensed&&!m){const e=c?h.trim():` ${h}`;j.push({key:"log-condensed-count",href:p,text:e,className:y||void 0,contentClassName:b||void 0,spaceBefore:!!c||void 0})}const C=j.map((({key:e,href:t,text:a,className:s,contentClassName:i,spaceBefore:r})=>(0,g.jsxs)(n.Fragment,{children:[r?" ":null,t?(0,g.jsx)("a",{className:s,href:t,children:(0,g.jsx)("span",{className:i,children:a})}):a]},e)));return(0,g.jsx)(g.Fragment,{children:C})},UserAvatarIcon=({analyticsPageTitle:e,authorData:t,authorIsSelf:a=!1,profileLinkLabel:n,linkClassName:s,imgClassName:i})=>{const r=["block rounded-full bg-gray-100",s].filter(Boolean).join(" "),l=["block",i].filter(Boolean).join(" ");return(0,g.jsx)(g.Fragment,{children:a?(0,g.jsx)("span",{className:r,children:(0,g.jsx)("img",{className:l,src:t?.profileImageUrl??"",alt:"","aria-hidden":"true"})}):(0,g.jsxs)("a",{"data-event-category":"data","data-event-label":`${e} - Avatar profile link`,className:r,href:t?.links.profile??"",children:[(0,g.jsx)("span",{className:"sr-only",children:n}),(0,g.jsx)("img",{className:l,src:t?.profileImageUrl??"",alt:"","aria-hidden":"true"})]})})},xt=(0,p.tv)({slots:{table:"w-full table-fixed text-gray-600 border-separate border-spacing-y-1 border-spacing-x-0 -mt-1",tableBody:"",thLeadingIcon:"w-5",thSummary:"w-auto",thParentIcon:"w-[14px]",thParentReferenceCode:"w-[8ch]",thLocation:"w-[104px] min-w-[104px] max-w-[104px]",thLink:"w-4",thInnerText:"sr-only",row:"bg-transparent border-none",leadingIconCell:"pl-1 rounded-l-lg",mainCell:"text-base/5",iconCell:"",parentReferenceCodeCell:"truncate",locationCell:"truncate",linkCell:"pr-1 text-right rounded-r-lg",mainCellIcon:"block rounded-full size-5 align-middle",iconWrapHorizontal:"mx-1",summaryWrap:"inline-block max-w-full align-top",summaryText:"text-gray-600 text-base/5",summaryFormattedLogText:"inline",authorIsSelfText:"text-gray-600 font-bold",summaryLinks:"text-gray-600 font-bold underline hover:no-underline focus:shadow-outline",parentReferenceCodeIcon:"block size-4 align-middle",link:"block text-blue-600 no-underline hover:no-underline hover:text-blue-500 focus:shadow-outline",linkIcon:"block size-4"},compoundSlots:[{slots:["thLeadingIcon","thSummary","thParentIcon","thParentReferenceCode","thLocation","thLink"],class:["box-content"]},{slots:["thLeadingIcon","thSummary","thParentIcon","thParentReferenceCode","thLocation","thLink","mainCell","leadingIconCell","iconCell","parentReferenceCodeCell","locationCell","linkCell"],class:["px-1"]},{slots:["thLeadingIcon","leadingIconCell"],class:["pl-2"]},{slots:["thLink","linkCell"],class:["pr-2"]},{slots:["leadingIconCell","mainCell","iconCell","parentReferenceCodeCell","locationCell","linkCell"],class:["bg-white","py-[2px]","align-middle"]},{slots:["parentReferenceCodeCell","locationCell","linkCell","link"],class:["text-xs/4"]}],variants:{isTrackableLog:{true:{parentReferenceCodeIcon:"bg-white rounded"}}}});function ActivityTable({analyticsPageTitle:e,activityType:t,environmentUrls:a,items:n,i18n:s,isLaptop:i=!1,userInfo:r}){const l=shouldLeadActivityWithProfileImage({activityType:t}),o=xt();return(0,g.jsxs)("table",{className:o.table(),children:[(0,g.jsx)("thead",{children:(0,g.jsxs)("tr",{children:[(0,g.jsx)("th",{className:o.thLeadingIcon(),children:(0,g.jsx)("span",{className:o.thInnerText(),children:l?s?.Player??"Player":s?.LogType??"Log type"})}),(0,g.jsx)("th",{className:o.thSummary(),children:(0,g.jsx)("span",{className:o.thInnerText(),children:s?.LogSummary??"Log summary"})}),(0,g.jsx)("th",{className:o.thParentIcon(),children:(0,g.jsx)("span",{className:o.thInnerText(),children:s?.Type??"Type"})}),(0,g.jsx)("th",{className:o.thParentReferenceCode(),children:(0,g.jsx)("span",{className:o.thInnerText(),children:s?.ReferenceNumber??"Reference number"})}),(0,g.jsx)("th",{className:o.thLocation(),children:(0,g.jsx)("span",{className:o.thInnerText(),children:s?.Location??"Location"})}),(0,g.jsx)("th",{className:o.thLink(),children:(0,g.jsx)("span",{className:o.thInnerText(),children:s?.Log??"Log"})})]})}),(0,g.jsx)("tbody",{className:o.tableBody(),children:n.map((n=>{const{authorDisplayName:l,parentTypeIcon:c,favoriteIcon:d,leadWithProfileImage:u,logLink:m,logTypeIcon:h,profileLinkLabel:p,showFavPointIcon:f,iconStackOptions:x}=getActivityPresentation({activityType:t,item:n,i18n:s,useCompactLayout:!0}),y=(0,g.jsx)(at.Z,{icons:x,orientation:u?"horizontal":"vertical",size:i?"medium":"small"}),v=getActivityFormattedLogSummary({item:n,i18n:s,userInfo:r,environmentUrls:a,itemActionLinkClassName:o.summaryLinks(),itemTargetLinkClassName:o.summaryLinks(),useExplicitSpaces:!0,prependSpace:!u}),w=(0,g.jsx)(UserAvatarIcon,{analyticsPageTitle:e,authorData:n.author??{},authorIsSelf:n.authorIsSelf,profileLinkLabel:p,imgClassName:o.mainCellIcon()});return(0,g.jsxs)("tr",{className:o.row(),children:[(0,g.jsx)("td",{className:o.leadingIconCell(),children:u?w:f(2)?(0,g.jsx)("svg",{className:`${o.mainCellIcon()} text-green-400`,...(0,b.Jf)(d?.ariaLabel),children:(0,g.jsx)("use",{href:d.href})}):(0,g.jsx)("svg",{className:o.mainCellIcon(),...(0,b.Jf)(h?.ariaLabel),children:(0,g.jsx)("use",{href:h.href})})}),(0,g.jsx)("td",{className:o.mainCell(),children:(0,g.jsx)("span",{className:o.summaryWrap(),children:(0,g.jsxs)("span",{className:o.summaryText(),children:[n.authorIsSelf?(0,g.jsx)("span",{className:o.authorIsSelfText(),children:l}):(0,g.jsx)("a",{"data-event-category":"data","data-event-label":`${e} - Author profile link - Compact view`,href:n.author?.links?.profile,className:o.summaryLinks(),children:l}),u?(0,g.jsx)("span",{className:o.iconWrapHorizontal(),children:y}):null,(0,g.jsx)("span",{className:o.summaryFormattedLogText(),children:v??(0,g.jsxs)(g.Fragment,{children:["Error: Provide a resource template. LogTypeId:"," ",n.logTypeId]})})]})})}),(0,g.jsx)("td",{className:o.iconCell(),children:c?.href?(0,g.jsx)("svg",{className:o.parentReferenceCodeIcon({isTrackableLog:n.isTrackableLog}),...(0,b.Jf)(c.ariaLabel),children:(0,g.jsx)("use",{href:c.href})}):null}),(0,g.jsx)("td",{className:o.parentReferenceCodeCell(),title:n.parentReferenceCode,children:n.parentReferenceCode}),(0,g.jsx)("td",{className:o.locationCell(),title:n.location?.name,children:n.location?.name}),(0,g.jsx)("td",{className:o.linkCell(),children:m?(0,g.jsx)("a",{className:o.link(),href:m.href,title:m.text,"data-event-category":"data","data-event-label":`${e} - ${m.dataLabel}`,children:(0,g.jsx)("svg",{"aria-label":m.text,className:o.linkIcon(),role:"img",children:(0,g.jsx)("use",{href:`#${m.icon}--inline`})})}):null})]},n.id)}))})]})}const yt=(0,p.tv)({slots:{base:"",compactTextContent:"flex-1 w-0 min-w-0 max-w-full text-xs/4 tablet:text-base/5 laptop-l:grid laptop-l:grid-cols-3 laptop-l:gap-1",compactCol:"flex w-full flex-wrap min-w-0 max-w-full gap-1 items-center last:mt-1",itemTopRow:"flex grow w-full min-w-0 max-w-full items-start gap-1 bg-transparent text-grey-600 text-base/5",itemTopRowTextWrap:"flex w-full min-w-0 max-w-full flex-1 flex-col gap-1",itemIconStackWrap:"shrink-0",itemTitle:"m-0 text-xs/4 tablet:text-base/5 font-normal text-grey-600",itemTitleAuthorSelfText:"text-gray-600 font-bold",itemTitleAuthorLink:"",itemTitleTargetText:"",itemTitleActionLink:"",itemMeta:"flex flex-nowrap min-w-0 max-w-full items-center gap-x-2 text-xs/4",itemMetaItem:"flex flex-nowrap min-w-0 max-w-full items-center gap-x-1",itemMetaLocationItem:"grow shrink basis-0 w-0 overflow-hidden",itemMetaLocation:"min-w-0 max-w-full grow shrink basis-0 w-0 overflow-hidden",itemMain:"w-full min-w-0 max-w-full flex-1",itemMainOverviewRow:"grid w-full min-w-0 max-w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-4",itemMainOverviewContent:"flex min-w-0
1w-full flex-col gap-2",itemNoteWrap:"w-full min-w-0 max-w-full overflow-hidden",itemNote:"m-0 block w-full min-w-0 max-w-full text-base/5 text-grey-600",itemMoreButton:"inline-flex shrink-0 w-fit text-xs/4 bg-transparent cursor-pointer border-none p-0 text-blue-600 underline hover:no-underline focus:shadow-outline",itemImageRow:"mt-2 gap-2 grid grid-cols-3 sm:flex",itemImageButton:["relative block overflow-hidden p-0 cursor-pointer","rounded border-none bg-transparent focus:shadow-outline","h-[90px] w-full sm:w-[120px]"].join(" "),itemImage:"block h-full w-full object-cover rounded",itemImageOverlay:"absolute inset-0 flex items-center justify-center bg-grey-900/50 px-2 text-center text-sm/5 font-bold text-white",itemFooter:"mt-2 flex flex-wrap items-center gap-3 text-xs text-grey-600",itemLink:"text-blue-600 text-xs/4 underline hover:no-underline focus:shadow-outline shrink-0",collapsedImageCountBtn:"inline-flex items-center rounded-lg text-xs/4 text-grey-600 gap-1 bg-transparent border-none p-0 cursor-pointer focus:shadow-outline",imageCountIcon:"block size-4 text-grey-500",statusIcon:"bg-white rounded-full relative",favPointIcon:"text-green-400",cacheTypeIcon:"block size-3 tablet:size-[14px]",avatarIconLink:"shrink-0 block rounded-full",avatarIcon:"block rounded-full"},compoundSlots:[{slots:["itemTitleAuthorLink","itemTitleActionLink","itemTitleTargetText"],class:["text-grey-600","font-bold","underline","hover:no-underline","focus:shadow-outline"]}],variants:{truncated:{true:{itemNoteWrap:"whitespace-nowrap",itemNote:"truncate"}},useCompactLayout:{true:{base:"flex w-full min-w-0 max-w-full items-center gap-1",avatarIcon:"size-5",itemMeta:"grow shrink basis-0 w-0 gap-1",itemMetaLocation:"truncate",statusIcon:"size-[13px]",itemLink:"laptop-l:ml-auto "},false:{base:"flex w-full min-w-0 max-w-full flex-col gap-2",avatarIcon:"size-5 laptop:size-6",statusIcon:"size-4"}},isCondensed:{true:{itemTopRowTextWrap:"self-center"}},leadWithProfileImage:{true:{itemIconStackWrap:"ml-1"}},hasNote:{true:{itemMoreButton:"leading-[20px]"}},isTrackableLog:{true:{cacheTypeIcon:"bg-white rounded"}}},compoundVariants:[{leadWithProfileImage:!0,useCompactLayout:!0,class:{favPointIcon:"size-[13px] align-text-top -ml-1",statusIcon:"z-10"}},{leadWithProfileImage:!1,useCompactLayout:!0,class:{favPointIcon:"",statusIcon:"size-5"}},{leadWithProfileImage:!1,useCompactLayout:!1,class:{statusIcon:"block absolute top-0 left-0",favPointIcon:"absolute top-0 left-0"}}]}),getImageModalHeaderText=({item:e,i18n:t})=>{let a;return a=e.authorIsSelf?e.isTrackableLog?t.YourImagesForTrackableContextFormat??"<boldText>Your</boldText> images for <boldText>{0}</boldText>":t.YourImagesForGeocacheContextFormat??"<boldText>Your</boldText> images for <boldText>{0}</boldText>":e.isTrackableLog?t.UserImagesForTrackableContextFormat??"<boldText>{0}'s</boldText> images for <boldText>{1}</boldText>":t.UserImagesForGeocacheContextFormat??"<boldText>{0}'s</boldText> images for <boldText>{1}</boldText>",(({translatedString:e,values:t})=>e.split(/(<boldText>.*?<\/boldText>)/g).map(((e,a)=>{const s=e.match(/^<boldText>(.*?)<\/boldText>$/),i=(s?.[1]??e).split(/(\{\d+\})/g).map(((e,s)=>{const i=e.match(/^\{(\d+)\}$/),r=i&&t[Number(i[1])];return(0,g.jsx)(n.Fragment,{children:r??e},`${a}-${s}`)}));return s?(0,g.jsx)("span",{className:"font-bold",children:i},a):(0,g.jsx)(n.Fragment,{children:i},a)})))({translatedString:a,values:e.authorIsSelf?[e.name??""]:[e.author?.username??"",e.name??""]})};var bt,vt;const wt=(0,p.tv)({slots:{base:"",content:"relative flex items-center justify-center",modalImage:["block rounded h-auto w-auto max-w-full max-h-full","object-contain"].join(" "),paginationBtn:["absolute top-1/2 z-10 -translate-y-1/2 size-6 p-0 cursor-pointer","flex items-center justify-center rounded-full border-none","bg-white text-gray-600/[.85] hover:text-gray-600 hover:bg-gray-100","focus:shadow-outline"].join(" "),paginationIcon:"block size-5"},variants:{previous:{true:{paginationBtn:"left-2",paginationIcon:"rotate-90"}},next:{true:{paginationBtn:"right-2",paginationIcon:"-rotate-90"}}}}),LogGalleryModal=({images:e,selectedImageIndex:t,onPreviousImage:a,onNextImage:n,i18n:s})=>{const i=wt(),r=e[t];return(0,g.jsx)(g.Fragment,{children:r?.url?(0,g.jsxs)("div",{className:i.content(),children:[e.length>1?(0,g.jsx)("button",{type:"button",className:i.paginationBtn({previous:!0}),onClick:a,"aria-label":s.Previous??"Previous",children:(0,g.jsx)("svg",{className:i.paginationIcon({previous:!0}),"aria-hidden":"true",children:bt||(bt=(0,g.jsx)("use",{href:"#chevron-small--inline"}))})}):null,(0,g.jsx)("img",{className:i.modalImage(),src:r.url,alt:""}),e.length>1?(0,g.jsx)("button",{type:"button",className:i.paginationBtn({next:!0}),onClick:n,"aria-label":s.Next??"Next",children:(0,g.jsx)("svg",{className:i.paginationIcon({next:!0}),"aria-hidden":"true",children:vt||(vt=(0,g.jsx)("use",{href:"#chevron-small--inline"}))})}):null]}):null})};var jt,kt,Ct;
1const ActivityFeedItem=({analyticsPageTitle:e,activityType:t,environmentUrls:a,item:s,i18n:i,isLaptop:r=!1,useCompactLayout:l=!1,userInfo:o})=>{const[c,d]=n.useState(!1),[u,m]=n.useState([]),[h,p]=n.useState(!1),[f,x]=n.useState(0),y=n.useRef(null),{authorDisplayName:v,parentTypeIcon:w,favoriteIcon:k,leadWithProfileImage:C,logLink:N,logTypeIcon:L,profileLinkLabel:T,showFavPointIcon:S,iconStackOptions:I}=getActivityPresentation({activityType:t,item:s,i18n:i,useCompactLayout:l}),A=yt({useCompactLayout:l,leadWithProfileImage:C,isCondensed:s.isCondensed,isTrackableLog:s.isTrackableLog}),P=getActivityFormattedLogSummary({item:s,i18n:i,userInfo:o,environmentUrls:a,itemActionLinkClassName:A.itemTitleActionLink(),itemTargetLinkClassName:A.itemTitleTargetText(),useExplicitSpaces:!0,prependSpace:!0}),D="string"==typeof s.note&&s.note.length>0,E=Number(s.imageCount??0)>0,{modalProps:M,toggleModal:$}=st.v2.useModal("custom",y,{isOpen:!1,closeIconName:"close--inline",uniqueId:`activity-feed-item-images-${s.id}`,size:"medium",onCloseClick:()=>$(!1),resources:{headerText:getImageModalHeaderText({item:s,i18n:i}),close:i.Close??"Close"},classNames:{h1:"font-normal mb-4"}});n.useEffect((()=>{if(!c||!E||h||!s.parentReferenceCode||!s.logReferenceCode)return;const e=new AbortController;return(async()=>{try{const t=await fetch(`${j.i}/${0===s.logReferenceCode.indexOf("TL")?"trackables":"Geocaches"}/${s.parentReferenceCode}/logs/${s.logReferenceCode}/images?${new URLSearchParams({cacheReferenceCode:s.parentReferenceCode,skip:"0",take:String(Math.max(Number(s.imageCount??0),3))}).toString()}`,{signal:e.signal});if(!t.ok)throw new Error(`Activity image request failed with ${t.status}`);const a=await t.json();m(Array.isArray(a?.data)?a.data:[])}catch(e){"AbortError"!==e.name&&(console.warn("Error fetching activity images:",e),m([]))}finally{p(!0)}})(),()=>e.abort()}),[E,h,c,s.imageCount,s.logReferenceCode,s.parentReferenceCode]);const F=s.note?.replace(/\s+/g," ").trim()??"",R=u.slice(0,3),O=u.length>3,B=(i.ImagesIndicator??"{0} images").replace("{0}",`+${Math.max(u.length-3,0)}`),U=n.useMemo((()=>N?(0,g.jsx)("a",{className:A.itemLink(),href:N.href,"data-event-category":"data","data-event-label":`${e} - ${N.dataLabel}`,children:N.text}):null),[N,A,e,l]),K=(0,g.jsx)(at.Z,{icons:I,orientation:C?"horizontal":"vertical",...C?{}:{size:r?"medium":"small"},containerClassName:A.itemIconStackWrap({leadWithProfileImage:C})}),z=S(2)?(0,g.jsx)("svg",{className:`${A.statusIcon()} ${A.favPointIcon()}`,...(0,b.Jf)(k.ariaLabel),children:(0,g.jsx)("use",{href:k.href})}):(0,g.jsx)("svg",{className:A.statusIcon(),...(0,b.Jf)(L.ariaLabel),children:(0,g.jsx)("use",{href:L.href})}),H=(0,g.jsx)(UserAvatarIcon,{analyticsPageTitle:e,authorData:s.author??{},authorIsSelf:s.authorIsSelf,profileLinkLabel:T,linkClassName:A.avatarIconLink(),imgClassName:A.avatarIcon()}),W=(0,g.jsxs)("h2",{className:A.itemTitle(),children:[s.authorIsSelf?(0,g.jsx)("span",{className:A.itemTitleAuthorSelfText(),children:v}):(0,g.jsx)("a",{"data-event-category":"data","data-event-label":`${e} - Author profile link - ${l?"Compact view":"Detailed view"}`,href:s.author?.links?.profile??"",className:A.itemTitleAuthorLink(),children:v}),P?(0,g.jsxs)(g.Fragment,{children:[C?K:null,P]}):(0,g.jsxs)(g.Fragment,{children:["Error: Provide a resource template. LogTypeId: ",s?.logTypeId]})]}),G=(0,g.jsxs)("dl",{className:A.itemMeta(),"aria-label":i?.CacheDetails??"[Cache details]",children:[(l||C)&&(0,g.jsxs)("div",{className:A.itemMetaItem(),children:[(0,g.jsx)("dt",{className:"sr-only",children:i?.CacheType??"[Cache type]"}),(0,g.jsx)("dd",{children:(0,g.jsx)("svg",{className:A.cacheTypeIcon(),...(0,b.Jf)(w.ariaLabel),children:(0,g.jsx)("use",{href:w.href})})})]}),(0,g.jsxs)("div",{className:A.itemMetaItem(),children:[(0,g.jsx)("dt",{className:"sr-only",children:i?.GeocacheCode??"[Geocache code]"}),(0,g.jsx)("dd",{children:s.parentReferenceCode})]}),(0,g.jsxs)("div",{className:`${A.itemMetaItem()} ${A.itemMetaLocationItem()}`,children:[l?(0,g.jsx)("dt",{className:"sr-only",children:i?.Location??"[Location]"}):(0,g.jsx)("dt",{children:(0,g.jsx)("svg",{height:"14",width:"14",className:"block text-grey-500 shrink-0",...(0,b.Jf)(i?.Location),children:jt||(jt=(0,g.jsx)("use",{href:"#pin--inline"}))})}),(0,g.jsx)("dd",{className:A.itemMetaLocation(),title:s.location?.name??"[Unknown location]",children:(0,g.jsx)("span",{className:"block truncate",children:s.location?.name??"[Unknown location]"})})]})]});return(0,g.jsxs)(g.Fragment,{children:[l&&(0,g.jsxs)("div",{className:A.base(),"aria-labelledby":`${s.id}-title`,children:[(0,g.jsx)("div",{className:"shrink-0",children:C?H:z}),(0,g.jsxs)("div",{className:A.compactTextContent(),children:[(0,g.jsx)("div",{className:A.compactCol(),children:W}),(0,g.jsxs)("div",{className:A.compactCol(),children:[G,U&&U]})]})]}),!l&&(0,g.jsxs)("article",{className:A.base(),"aria-labelledby":`${s.id}-title`,children:[(0,g.jsxs)("header",{className:A.itemTopRow(),children:[(0,g.jsx)("div",{className:"shrink-0",children:C?H:K}),(0,g.jsxs)("div",{className:A.itemTopRowTextWrap(),children:[W,!s.isCondensed&&G]})]}),!s.isCondensed&&(0,g.jsxs)("div",{className:A.itemMain(),children:[(0,g.jsxs)("div",{className:A.itemMainOverviewRow(),children:[(0,g.jsxs)("div",{className:A.itemMainOverviewContent(),children:[D&&(0,g.jsx)("div",{className:A.itemNoteWrap({truncated:!c}),children:(0,g.jsx)("p",{className:A.itemNote({truncated:!c}),children:c?s.note?.split(/\r?\n/).map(((e,t)=>(0,g.jsxs)(n.Fragment,{children:[t>0?kt||(kt=(0,g.jsx)("br",{})):null,e]},`${s.id}-note-${t}`))):F})}),s.imageCount?(0,g.jsx)("div",{className:`${A.itemMeta()}`,children:(0,g.jsxs)("button",{className:A.collapsedImageCountBtn(),"data-event-category":"data","data-event-label":`${e} - View image previews`,type:"button",onClick:()=>d((e=>!e)),children:[(0,g.jsx)("svg",{height:"16",width:"16",className:A.imageCountIcon(),"aria-hidden":"true",children:Ct||(Ct=(0,g.jsx)("use",{href:"#photos--inline"}))}),(i.ImagesIndicator??"{0} images").replace("{0}",String(s.imageCount))]})}):null]}),(0,g.jsx)("button",{className:A.itemMoreButton({hasNote:D}),"data-event-category":"data","data-event-label":`${e} - Detailed - View ${c?"less":"more"}`,type:"button",onClick:()=>d((e=>!e)),children:c?i.ShowLess??"Less":i.ShowMore??"More"})]}),c&&(0,g.jsxs)("div",{children:[u.length>0?(0,g.jsx)("div",{className:A.itemImageRow(),children:R.map(((t,a)=>(0,g.jsxs)("button",{className:A.itemImageButton(),"data-event-category":"data","data-event-label":`${e} - Open image modal`,type:"button",onClick:()=>(e=>{x(e),$(!0)})(a),children:[(0,g.jsx)("img",{className:A.itemImage(),src:t.url,alt:""}),O&&2===a?(0,g.jsx)("span",{className:A.itemImageOverlay(),children:B}):null]},t.id??`${s.id}-image-${a}`)))}):null,(0,g.jsx)("div",{className:A.itemFooter(),children:U&&U})]})]})]}),(0,g.jsx)(st.v2.Modal,{ref:y,...M,children:(0,g.jsx)(LogGalleryModal,{images:u,selectedImageIndex:f,onPreviousImage:()=>{x((e=>0===e?u.length-1:e-1))},onNextImage:()=>{x((e=>e===u.length-1?0:e+1))},i18n:i})})]})};ActivityFeedItem.displayName="ActivityFeedItem";const Nt=(0,p.tv)({slots:{base:"max-w-full min-w-0",body:"mt-1 flex w-full min-w-0 flex-col gap-1",filterBar:"flex flex-row flex-wrap items-center justify-between gap-x-3 gap-y-2",filterBarLinks:"m-0 min-w-0 shrink-0 text-xs/4 text-grey-600",filterControlWrap:"ml-auto flex shrink-0 justify-end",filterList:"m-0 grid list-none gap-2 p-0 tablet:grid-cols-2",filterDescription:"mt-1 block text-xs leading-4 text-grey-600",intro:"rounded-lg border border-emerald-200 bg-emerald-50 px-3 py-3 text-sm text-emerald-900",introTitle:"font-semibold",introDismiss:"mt-2 inline-flex rounded border border-emerald-300 bg-white px-2 py-1 text-xs font-semibold text-emerald-900",loading:"px-3",error:"rounded-lg border border-rose-200 bg-rose-50 px-3 py-3 text-sm text-rose-800",groups:"m-0 flex w-full min-w-0 list-none flex-col gap-3 p-0",groupHeader:"text-xs/4 text-grey-600",groupItems:"m-0 flex w-full min-w-0 list-none flex-col gap-1 p-0",item:"w-full min-w-0 max-w-full overflow-hidden rounded-lg bg-white px-3 py-3 gap-y-1",itemBorder:"border-t border-stone-100",itemTopRow:"flex items-start gap-3",itemIconWrap:"mt-0.5 inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-stone-100 text-grey-700",itemMain:"min-w-0 flex-1",itemMeta:"mb-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-grey-500",itemAuthor:"font-semibold text-grey-700",itemTime:"",itemTitle:"text-sm leading-5 text-grey-800",itemNote:"mt-2 rounded-md bg-stone-50 px-3 py-2 text-sm leading-5 text-grey-700",itemFooter:"mt-2 flex flex-wrap items-center gap-3 text-xs text-grey-600",itemLink:"text-blue-600 underline hover:no-underline focus:shadow-outline",itemBadge:"inl
1ine-flex items-center rounded-full bg-stone-100 px-2 py-1 text-xs font-semibold text-grey-700"},variants:{useCompactLayout:{true:{loading:"py-1",empty:"py-1",groups:"gap-2",item:"px-2 py-[2px]"},false:{loading:"py-2",empty:"py-2"}},selected:{true:{},false:{}}}});var Lt;const Tt={yours:1,friends:2,owner:3,domain:4},resolveInitialFilter=(e,t)=>{const a=(0,E.I)(e,"activityContentDisplayed"),n="yours"===a||"friends"===a||"owner"===a||"domain"===a?a:"friends";return"domain"===n&&Number(t?.domainGroupId??0)<=0?"friends":n},formatGroupDate=e=>{if(!e)return"";const t=F.A.fromISO(e);return t.isValid?t.toLocaleString(F.A.DATE_FULL):e},getGlobalWindow=()=>window,writeDashboardSettingValue=(e,t,a)=>{const n=e;n.set?.(t,a),n.save?.()},renderYourLogsMessage=e=>{const t=e.YourLogs??"Your logs: {0}, {1}",a={"{0}":(0,g.jsx)("a",{href:"/my/logs.aspx?s=1",children:e.Geocaches??"Geocaches"}),"{1}":(0,g.jsx)("a",{href:"/my/logs.aspx?s=2",children:e.Trackables??"Trackables"})};return t.split(/(\{0\}|\{1\})/g).map(((e,t)=>{const s=a[e];return s?(0,g.jsx)(n.Fragment,{children:s},`${e}-${t}`):(0,g.jsx)(n.Fragment,{children:e},`${e}-${t}`)}))},LatestActivityFeed=({analyticsPageTitle:e,dashboardSettings:t,environmentUrls:a,geocacheTypeLabels:s,i18n:i,isMobileDevice:l,useCompactLayout:o,userInfo:c})=>{const d=A.c.activityFeed,u=i.activityFeed??{},m=Nt({useCompactLayout:o}),h=(0,r.useMediaQuery)({query:"(min-width: 1440px)"}),p=o&&h,[f,y]=n.useState((()=>resolveInitialFilter(t,c))),[b,v]=n.useState([]),[w,k]=n.useState(!1),[C,N]=n.useState(""),[L,T]=n.useState(!1),{isExpanded:S,toggleExpanded:I}=(0,E.p)({dashboardSettings:t,settingKey:d.settingKey,isMobileDevice:l,usesIsCollapsedPattern:d.usesIsCollapsedPattern}),M=n.useMemo((()=>[{label:i.ActivityToggleYoursHeader??"Yours",onClick:()=>{onSelectFilter("yours")},selected:"yours"===f},{label:i.ActivityToggleSelectorFriends??"Friends",onClick:()=>{onSelectFilter("friends")},selected:"friends"===f},{label:"Owner",onClick:()=>{onSelectFilter("owner")},selected:"owner"===f}]),[i,f]),$=n.useMemo((()=>((e,t,a,n=!1)=>{switch(t){case"owner":return{message:e.ActivityFeedEmptyHeaderOwner,ctaLinkText:e.ActivityFeedEmptyLinkOwner,ctaLinkUrl:`${a.web}/my/owned.aspx`};case"friends":{const t={userPrivacyText:e.ViewUserPrivacySettings,userPrivacyUrl:`${a.web}/account/settings/userprivacy`};return n?{...t,message:e.ActivityFeedEmptyFriendsHeader,subtext:e.ActivityFeedEmptyFriendsDescription,ctaLinkText:e.ActivityFeedEmptyLink,ctaLinkUrl:`${a.gameplay}/play/search`}:{...t,message:e.ActivityFeedEmptyZeroFriendsHeader,subtext:e.ActivityFeedEmptyZeroFriendsDescription,ctaLinkText:e.ActivityFeedEmptyZeroFriendsCTA,ctaLinkUrl:`${a.web}/my/myfriends.aspx`}}default:return{message:e.ActivityFeedEmptyHeader,subtext:e.ActivityFeedEmptyDescription,ctaLinkText:e.ActivityFeedEmptyLink,ctaLinkUrl:`${a.gameplay}/play/search`}}})(i,f,a,c?.friendsCount>0)),[a,i,f,c?.friendsCount]);n.useEffect((()=>{const e=resolveInitialFilter(t,c);y(e)}),[t,c]),n.useEffect((()=>{const e=Boolean((0,E.I)(t,"introModalViewed"));T(!e)}),[t]),n.useEffect((()=>{if(!S)return;const e=new AbortController;return(async()=>{k(!1),v([]),N("");try{const a=Tt[f],n=c?.referenceCode;if(!n)throw new Error("Missing activity reference code");const s=await fetch(`${j.i}/activities/account/${n}/api?${new URLSearchParams({activitySince:(t=f,F.A.local().plus({days:"yours"===t?-30:-7}).toFormat("yyyy-MM-dd")),activityType:String(a)}).toString()}`,{signal:e.signal});if(!s.ok)throw new Error(`Activity request failed with ${s.status}`);const i=await s.json();let r=[];Array.isArray(i)?r=i:Array.isArray(i.data)&&(r=i.data);const l=r.map((e=>function prepareActivityItemData(e,t){const{data:a,...n}=e??{},{attributes:s,...i}=a??{},r=s?.logDateTime,l="string"==typeof s?.note?s.note.trim():s?.note,o=0!==s?.cacheTypeId&&s?.cacheTypeId;return{...n,...i,...s,author:e?.relationships?.author,authorIsSelf:t?.accountId==n.relationships?.author?.accountId,cacheTypeId:o,id:i.logReferenceCode??i.id??`activity-${s?.logDateTime??Math.random().toString(36).substring(2,15)}`,isTrackableLog:i.logReferenceCode?.startsWith("TL")||!1,groupDate:r?F.A.fromISO(r).toFormat("yyyy-MM-dd"):"",logDateTime:r,note:l??"",parentIconData:getActivityParentIconData({cac
1heTypeId:o,isTrackableLog:i.logReferenceCode?.startsWith("TL")||!1,i18n:t?.i18n})}}(e,c)));v((e=>{const t=new Map;return e.forEach((e=>{const a=e.groupDate||"unknown",n=t.get(a)??[];n.push(e),t.set(a,n)})),Array.from(t.entries()).map((([e,t])=>({date:e,items:t})))})(l))}catch(e){if("AbortError"===e.name)return;console.warn("Error fetching activity feed:",e),v([]),N(i.ActivityErrorMessage??"We couldn't load latest activity. Refresh the page to try again.")}finally{k(!0)}var t})(),()=>e.abort()}),[S,i.ActivityErrorMessage,f,c]);const onSelectFilter=e=>{e!==f&&(y(e),writeDashboardSettingValue(t,"activityContentDisplayed",e))};return(0,g.jsx)(P.iV,{id:"activityFeed",className:m.base(),isExpanded:S,header:({contentId:e})=>(0,g.jsx)(D.h,{contentId:e,headerSize:"small",isExpanded:S,onToggle:I,title:i.ActivityFeedHeader??"Recent activity"}),children:(0,g.jsxs)("div",{className:m.body(),children:[L&&(0,g.jsxs)("div",{className:m.intro(),children:[(0,g.jsx)("div",{className:m.introTitle(),children:u.IntroHeader??i.ActivityFeedHeader??"Recent activity"}),(0,g.jsx)("div",{children:u.IntroBody??u.Description??"Choose which activity you want to see from your dashboard settings."}),(0,g.jsx)("button",{className:m.introDismiss(),type:"button",onClick:()=>{T(!1),writeDashboardSettingValue(t,"introModalViewed",!0)},children:i.GotIt??"Got it"})]}),(0,g.jsxs)("div",{className:m.filterBar(),children:[(0,g.jsx)("p",{className:m.filterBarLinks(),children:renderYourLogsMessage(i)}),(0,g.jsx)("div",{className:m.filterControlWrap(),children:(0,g.jsx)(x.A,{"aria-label":i.FilterActivityBy??"Filter activity by",className:"preserve-width",layout:"hug",size:"small",variant:"tabs",options:M})})]}),!w&&S&&(0,g.jsx)(Fe.Gu,{size:"md",containerClassName:m.loading()}),w&&C&&(0,g.jsx)("div",{className:m.error(),children:(R=C,R.split(/<br\s*\/?>/i).map(((e,t)=>(0,g.jsxs)(n.Fragment,{children:[t>0&&(Lt||(Lt=(0,g.jsx)("br",{}))),e.trim()]},`${e}-${t}`))))}),w&&!C&&0===b.length&&(0,g.jsx)(ActivityEmptyState,{message:$.message,subtext:$.subtext,ctaLinkText:$.ctaLinkText,ctaLinkUrl:$.ctaLinkUrl,userPrivacyText:$.userPrivacyText,userPrivacyUrl:$.userPrivacyUrl}),w&&!C&&b.length>0&&(p?b.map((t=>(0,g.jsxs)("div",{children:[(0,g.jsx)("div",{className:m.groupHeader(),children:formatGroupDate(t.date)}),(0,g.jsx)(ActivityTable,{analyticsPageTitle:e,activityType:f,environmentUrls:a,i18n:{...i,logFormats:i.logFormats??getGlobalWindow().logFormats??{},geocacheTypeLabels:s??{}},isLaptop:h,items:t.items,userInfo:c})]},t.date))):(0,g.jsx)("ol",{className:m.groups(),children:b.map((t=>(0,g.jsxs)("li",{className:"min-w-0",children:[(0,g.jsx)("div",{className:m.groupHeader(),children:formatGroupDate(t.date)}),(0,g.jsx)("ol",{className:m.groupItems(),children:t.items.map(((t,n)=>(0,g.jsx)("li",{className:`${m.item()} ${n>0?m.itemBorder():""}`,children:(0,g.jsx)(ActivityFeedItem,{analyticsPageTitle:e,activityType:f,environmentUrls:a,item:t,i18n:{...i,logFormats:i.logFormats??getGlobalWindow().logFormats??{},geocacheTypeLabels:s??{}},isLaptop:h,useCompactLayout:o,userInfo:c})},t.id)))})]},t.date)))}))]})},"activityFeed");var R};LatestActivityFeed.displayName="LatestActivityFeed";var St,It,At;a(92446),a(57625),a(52074),a(77531),a(7116),a(53018),a(18109),a(75706),a(36677),a(35043),a(5050),a(81754),a(76449),a(50131),a(61133),a(7966),a(81411),a(24666),a(62507),a(51554),a(97986),a(29318),a(80570),a(96232),a(34249),a(4030),a(45102),a(75179),a(76084),a(90050),a(78863),a(8012),a(82879),a(10253),a(24024),a(76598),a(96509),a(56482),a(41456),a(7029),a(79387),a(69456),a(40776),a(94985),a(90206),a(66638),a(8329),a(18970),a(26149);const Pt=(0,n.lazy)((()=>a.e(3052).then((()=>a(82708))).then((e=>({default:e.YourCacheNotesFeed}))))),Dt="AlertAttentionContainer",Et=`#${Dt} .btn-close`,DashboardRoot=e=>{const{i18n:t,cacheSizes:a,displayFeaturedActivityTeaser:s,geocacheTypeLabels:u,isMobileDevice:m,serverParameters:h,showYourCacheNotes:p,sidebarProps:f}=e,j=h["user:info"],k=(0,r.useMediaQuery)({query:"(min-width: 768px)"}),C=(0,r.useMediaQuery)({query:"(min-width: 1024px)"}),N=(0,l.uc)(),L=o.h$[N]?.urls||{},T=document.getElementById("header-root"),S=A.c.quickLinksJumpBar.settingKey,I=A.c.useCompactLayout.settingKey,P=A.c.useCompactSettingsButton.settingKey,[D,E]=(0,n.use
1State)((()=>Boolean(xe?.get?.(I)))),[M,$]=(0,n.useState)((()=>!0!==xe?.get?.(S))),[F,R]=(0,n.useState)((()=>Boolean(xe?.get?.(P)))),[O,B]=(0,n.useState)(!1),U=v({numberOfColumns:C?"three":k?"two":"one",useCompactLayout:D}),K=(0,b.EX)(j?.username),z="basic"===j?.userType?.toLowerCase(),H=(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(FeaturedCampaigns,{dashboardSettings:xe,displayFeaturedActivityTeaser:s,i18n:t.playerDashboard}),(0,g.jsx)(EventsWidget,{analyticsPageTitle:fe,environmentUrls:L,dashboardSettings:xe,i18n:{...t.playerDashboard,...t.events},mvcProps:f,AppSettingsUserInfo:j}),(0,g.jsxs)("div",{children:[(0,g.jsx)(LinkCard,{headingText:t.maps?.SearchMap,imgSrc:"https://gs-strapi.s3.us-east-1.amazonaws.com/map_search_186x186_0326b62fd8.png",linkProps:{"data-event-category":"data","data-event-label":`${fe} - Search Map Link Card`},linkUrl:(0,d.k)(L?.gameplay,"/play/map"),supportingText:t.maps?.SearchMapDesc,type:"chevron"}),(0,g.jsx)(LinkCard,{headingText:t.maps?.BrowseMap,imgSrc:"https://gs-strapi.s3.us-east-1.amazonaws.com/map_browse_186x186_27811ba07c.png",linkProps:{className:"mt-4","data-event-category":"data","data-event-label":`${fe} - Browse Map Link Card`},linkUrl:"/map",supportingText:t.maps?.BrowseMapDesc,type:"chevron"})]}),(0,g.jsx)(LinkCard,{fauxLinkText:t.geocaching101?.GoToGeocaching101,headingText:t.geocaching101?.FindTips,iconName:"lightbulb",linkProps:{"data-event-category":"data","data-event-label":`${fe} - Geocaching 101 Link Card`,target:"_blank",rel:"noopener noreferrer"},linkUrl:"https://www.geocaching.com/sites/education/en/",visuallyDistinguishHeader:!1}),z&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"advertisement hide-mobile m-0 text-center",children:[St||(St=(0,g.jsx)("div",{id:"dashboard-ad"})),(0,g.jsx)("a",{href:(0,d.k)(L?.web,"/about/advertising.aspx"),className:"text-xs/4 inline-block mt-1",target:"_blank",children:t.playerDashboard?.SidebarAdvertisement??"Advertising with us"})]}),(0,g.jsx)(PremiumUpsell,{i18n:{PremiumUpsellHeading:t.premium?.PremiumUpsellHeading,PremiumUpsellContent:t.premium?.PremiumUpsellContent,PremiumUpsellButtonText:t.premium?.PremiumUpsellButtonText}}),","]})]});(0,n.useEffect)((()=>{E(Boolean(xe?.get?.(I))),$(!0!==xe?.get?.(S)),R(Boolean(xe?.get?.(P)))}),[S,I,P]),(0,n.useEffect)((()=>{z&&c.A.loadAd("dashboard-ad","/1011121/new_dashboard_250x250",[250,250])}),[z]),(0,n.useEffect)((()=>{const handleAlertAttentionClose=e=>{e.preventDefault();const t=document.getElementById(Dt);t&&(t.style.display="none",t.innerHTML="")},e=document.querySelector(Et);return e?.addEventListener("click",handleAlertAttentionClose),()=>{e?.removeEventListener("click",handleAlertAttentionClose)}}),[]);const updateCompactLayout=e=>{E(e),xe?.set?.(I,e)?.save?.()},toggleSettingsPopover=()=>{B((e=>!e))};return(0,g.jsxs)(g.Fragment,{children:[T&&(0,i.createPortal)((0,g.jsx)(g.Fragment,{children:(0,g.jsxs)("div",{className:U.headerRow(),children:[(0,g.jsx)("h1",{className:U.pageHeading(),children:(0,g.jsx)(b.bR,{resxString:t.playerDashboard?.PageHeading,params:{username:K},playerTag:f?.membershipTypeName?"premium"===f.membershipTypeName.toLocaleLowerCase()?(0,g.jsx)("span",{className:U.playerTag({isPremium:!0}),children:(0,g.jsx)("svg",{className:U.playerTagIcon(),height:"14",width:"61",role:"img","aria-label":f.membershipTypeName,children:It||(It=(0,g.jsx)("use",{href:"#premium-logo--inline"}))})}):(0,g.jsx)("span",{className:U.playerTag({isLackey:"lackey"===f.membershipTypeName.toLocaleLowerCase(),isCharter:"charter"===f.membershipTypeName.toLocaleLowerCase()}),children:f?.membershipTypeName}):null})}),(0,g.jsx)(Popover,{anchor:(e,a)=>(0,g.jsxs)("button",{...a({"aria-controls":"dashboard-settings-popover","aria-expanded":O,"aria-haspopup":"dialog","data-event-category":"data","data-event-label":`${fe} - Dashboard Settings - ${O?"Close":"Open"}`,className:`${(0,w.HY)({size:"md",reverse:!0})} ${U.settingsBtn()}`,onClick:toggleSettingsPopover,type:"button"}),ref:t=>e(t),children:[(0,g.jsx)("svg",{height:"18",width:"18","aria-hidden":"true",className:U.settingsBtnIcon(),children:At||(At=(0,g.jsx)("use",{href:"#settings--inline"}))}),(0,g.jsx)("span",{className:F?"sr-only":void 0,children:t.playerDashboard?.DashboardSettings??"Dashboard settings"})]}),open:O,id:"dashboard-settings-popover","aria-labelledby":"dashboard-settings-popover-title",onOpenChange:e=>B(e),hasArrow:!1,placement:"bottom-end",className:"w-fit",children:(0,g.jsxs)("div",{className:U.settingsPopoverContent(),children:[(0,g.jsx)("h2",{id:"dashboard-settings-popover-title",className:U.settingsPopoverHeading(),children:t.playerDashboard?.DashboardSettings??"Dashboard settings"}),(0,g.jsxs)("div",{className:U.settingsRow(),children:[(0,g.jsx)("span",{className:U.settingsLabel(),children:t.playerDashboard?.HideSettingsLabel??"Hide settings label"}),(0,g.jsx)(y.h,{active:F,onClick:()=>{R((e=>{const t=!e;return xe?.set?.(P,t)?.save?.(),t}))},inputProps:{"data-testid":"dashboard-settings-button-display-toggle","data-event-category":"data","data-event-label":`${fe} - Dashboard Settings - Display - ${F?"default":"icon-only"}`}})]}),(0,g.jsxs)("div",{className:U.settingsRow(),children:[(0,g.jsx)("span",{className:U.settingsLabel(),children:t.playerDashboard?.ShowTopQuickLinks??"Show top quick links"}),(0,g.jsx)(y.h,{active:M,onClick:()=>{$((e=>{const t=!e;return xe?.set?.(S,!t)?.save?.(),t}))},inputProps:{"data-testid":"dashboard-top-quick-links-toggle","data-event-category":"data","data-event-label":`${fe} - Dashboard Settings - Quick Links - ${M?"Off":"On"}`}})]}),(0,g.jsxs)("div",{className:U.settingsRow({stackContent:!0}),children:[(0,g.jsx)("p",{id:"dashboard-settings-view-options",className:U.settingsLabel(),children:t.playerDashboard?.ViewOptions??"View options"}),(0,g.jsx)(x.A,{"aria-labelledby":"dashboard-settings-view-options",layout:"fullWidth",size:"large",variant:"radio",options:[{label:t.playerDashboard?.Detailed??"Detailed",onClick:()=>updateCompactLayout(!1),selected:!D,options:{"data-event-category":"data","data-event-label":`${fe} - Dashboard Settings - Detailed View - On`}},{label:t.playerDashboard?.Compact??"Compact",onClick:()=>updateCompactLayout(!0),selected:D,options:{"data-event-category":"data","data-event-label":`${fe} - Dashboard Settings - Compact View - On`}}]})]})]})})]})}),T),(0,g.jsx)("div",{className:U.topContainer(),children:M&&(0,g.jsx)(JumpBar,{i18n:t.navigation,publicGuid:j?.publicGuid??"",environmentUrls:L})}),(0,g.jsxs)("div",{className:U.mainContentArea(),children:[(0,g.jsx)("div",{id:"leftCol",className:U.leftColumn(),children:(0,g.jsxs)("div",{className:U.leftColumnInner(),children:[(0,g.jsx)(ProfileSummary,{analyticsPageTitle:fe,environmentUrls:L,dashboardSettings:xe,i18n:t.profileSummary??{},mvcProps:f,username:K,AppSettingsUserInfo:j}),(0,g.jsx)(SidebarNavigation,{dashboardSettings:xe,experimentalfeaturesUrl:(0,d.k)(L?.live,"/live/account/settings/experimentalfeatures"),i18n:t.navigation,mvcProps:f,useCompactLayout:D,AppSettingsUserInfo:j,isMobileDevice:m}
1),k&&!C&&(0,g.jsx)("div",{className:U.rightColumn(),children:H})]})}),(0,g.jsxs)("div",{id:"centerCol",className:U.centerColumn(),children:[(0,g.jsx)(CacheOwnerFeed,{analyticsPageTitle:fe,className:"flex flex-col gap-y-4",codUrl:L?.gameplay??"",resources:window.codAlert||{},supportedBanners:["needsAttention","unpublishedSubmitted"]}),(0,g.jsx)(RecentlyViewedFeed,{cacheSizes:a,geocacheTypeLabels:u,dashboardSettings:xe,i18n:t,isMobileDevice:m,useCompactLayout:D,userInfo:j}),(0,g.jsx)(LatestActivityFeed,{analyticsPageTitle:`${fe} - Activity feed`,dashboardSettings:xe,environmentUrls:L,geocacheTypeLabels:u,i18n:{...t.activityFeed,...t.playerDashboard},isMobileDevice:m,useCompactLayout:D,userInfo:j}),p&&(0,g.jsx)(n.Suspense,{fallback:null,children:(0,g.jsx)(Pt,{dashboardSettings:xe,geocacheTypeLabels:u,i18n:t,isMobileDevice:m,useCompactLayout:D})}),!k&&!C&&(0,g.jsx)("div",{className:"flex flex-col gap-y-4 tablet:gap-y-5",children:H})]}),C&&(0,g.jsx)("div",{id:"rightCol",className:U.rightColumn(),children:H})]})]})};let Mt=null;const render=()=>{const e=document.getElementById("dashboard-root");e&&(Mt||(Mt=(0,s.createRoot)(e)),Mt.render((0,g.jsx)(DashboardRoot,{i18n:window.Localizations??{},cacheSizes:window.cacheSizes??[],displayFeaturedActivityTeaser:window.displayFeaturedActivityTeaser??!1,geocacheTypeLabels:window.geocacheTypeLabels??{},isMobileDevice:window.App?.Settings?.get?.("isMobile")??!1,serverParameters:window.serverParameters,showYourCacheNotes:window.showYourCacheNotes??!1,sidebarProps:window.sidebarProps})))}},49586(e,t,a){"use strict";a.d(t,{EX:()=>NormalizeUsername});var n=a(92334),s=a.n(n),i=a(28975),r=a(74848);function NormalizeUsername(e){return null==e?"":String(e)}a.d(t,["AI",0,({translatedString:e,value:t,useParentheses:a=!1})=>{if(!e)return null;const n=e.split(/(\{0\})/g),s=a?`(${t})`:t;return(0,r.jsx)(r.Fragment,{children:n.map(((e,t)=>"{0}"===e?(0,r.jsx)("strong",{children:s},t):e))})},"Jf",0,e=>e?.trim()?{role:"img","aria-label":e}:{"aria-hidden":!0},"bR",0,({resxString:e,params:t,playerTag:a})=>{if(!e)return null;const renderInterpolatedText=(e,n)=>e.split(/({{\w+,?\s*\w*}})/g).map(((e,s)=>{var i;const l=e.match(/^{{(\w+),?\s*\w*}}$/);if(!l)return e;const[,o]=l,c=void 0!==t[o]?String(t[o]):e;return"username"===o?(0,r.jsxs)("span",{className:"inline-flex items-center gap-2",children:[i||(i=(0,r.jsx)("span",{children:c})),a]},`${n}-username-${s}`):(0,r.jsx)("span",{children:c},`${n}-${o}-${s}`)})),n=e.split(/(<spanNormal>.*?<\/spanNormal>)/g);return(0,r.jsx)(r.Fragment,{children:n.map(((e,t)=>{if(e.startsWith("<spanNormal>")){const a=e.replace(/<\/?spanNormal>/g,"");return(0,r.jsx)("span",{className:"font-normal",children:renderInterpolatedText(a,`normal-${t}`)},t)}return renderInterpolatedText(e,`default-${t}`)}))})},"kb",0,e=>{const t=s()?.helpers?.cacheSize;if(t)return t(e);return"number"!=typeof e?"":["","[Not chosen]","[Micro]","[Regular]","[Large]","[Virtual]","[Other]","","[Small]"][e]??""},"po",0,e=>{const t=s()?.helpers?.happyDates;return t?t(e):e?i.A.fromISO(e).toFormat("D"):""}])},54028(e,t,a){"use strict";const n=a(74692),s={loadAd:function(e,t,a){const s=App.Settings.provideBreakpoint();let i=!1;const _loader=function(){i?n(window).off("resize.loadAd"):(a||(a=[160,600]),n(".sidebar-ad, .advertisement").is(":visible")&&"undefined"!=typeof googletag&&(googletag.cmd.push((function(){googletag.defineSlot(t,a,e).addService(googletag.pubads()),googletag.enableServices(),googletag.display(e)})),i=!0))};"desktop"!==s?n(window).on("resize.loadAd",_loader):_loader()}},i=s;a.d(t,["A",0,i])},29960(e,t,a){var n=a(93633);e.exports=(n.default||n).template({0:function(e,t,a,n,s,i,r){var l,o=e.lambda,c=e.escapeExpression,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return' <div class="clndr-day-header '+c(o(null!=(l=null!=r[1]?d(r[1],"styles"):r[1])?d(l,"dayHeader"):l,t))+'">'+c(o(t,t))+"</div>\n"},1:function(e,t,a,n,s,i,r){var l,o,c=e.lambda,d=e.escapeExpression,u=null!=t?t:e.nullContext||{},m=e.hooks.helperMissing,h="function",p=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return' <button \n role="gridcell"\n aria-label="'+d(c(null!=(l=null!=r[1]?p(r[1],"extras"):r[1])?p(l,"getScreenReaderFriendlyCalendarDay"):l,t))+'"\n aria-description="'+d(c(null!=(l=null!=r[1]?p(r[1],"extras"):r[1])?p(l,"getEventC
1ountStr"):l,t))+'"\n aria-selected="false"\n '+(null!=(l=p(a,"if").call(u,null!=(l=null!=t?p(t,"properties"):t)?p(l,"isToday"):l,{name:"if",hash:{},fn:e.program(2,s,0,i,r),inverse:e.noop,data:s,loc:{start:{line:42,column:16},end:{line:42,column:68}}}))?l:"")+'\n class="'+d(typeof(o=null!=(o=p(a,"classes")||(null!=t?p(t,"classes"):t))?o:m)===h?o.call(u,{name:"classes",hash:{},data:s,loc:{start:{line:43,column:23},end:{line:43,column:34}}}):o)+" "+d(c(null!=(l=null!=r[1]?p(r[1],"extras"):r[1])?p(l,"getCalDayButtonClasses"):l,t))+'" \n '+(null!=(l=p(a,"if").call(u,null!=(l=null!=t?p(t,"properties"):t)?p(l,"isToday"):l,{name:"if",hash:{},fn:e.program(3,s,0,i,r),inverse:e.noop,data:s,loc:{start:{line:44,column:16},end:{line:44,column:76}}}))?l:"")+"\n >\n "+d(typeof(o=null!=(o=p(a,"day")||(null!=t?p(t,"day"):t))?o:m)===h?o.call(u,{name:"day",hash:{},data:s,loc:{start:{line:46,column:16},end:{line:46,column:23}}}):o)+"\n \n"+(null!=(l=p(a,"if").call(u,null!=(l=null!=r[1]?p(r[1],"extras"):r[1])?p(l,"hasEvents"):l,{name:"if",hash:{},fn:e.program(4,s,0,i,r),inverse:e.noop,data:s,loc:{start:{line:48,column:16},end:{line:54,column:23}}}))?l:"")+"\n"+(null!=(l=p(a,"if").call(u,null!=(l=null!=r[1]?p(r[1],"extras"):r[1])?p(l,"hasGiga"):l,{name:"if",hash:{},fn:e.program(5,s,0,i,r),inverse:e.program(6,s,0,i,r),data:s,loc:{start:{line:56,column:16},end:{line:64,column:23}}}))?l:"")+" </button>\n"},2:function(e,t,a,n,s){return'aria-current="date"'},3:function(e,t,a,n,s,i,r){var l,o=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return'title="'+e.escapeExpression(e.lambda(null!=(l=null!=r[1]?o(r[1],"locals"):r[1])?o(l,"today"):l,t))+'"'},4:function(e,t,a,n,s,i,r){var l,o=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return' <span class="'+e.escapeExpression(e.lambda(null!=(l=null!=r[1]?o(r[1],"styles"):r[1])?o(l,"eventCountIndicatorContainer"):l,t))+'">\n <svg width="5" height="4" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">\n <circle cx="2.571" cy="2" r="2" fill="currentColor"/>\n </svg>\n </span>\n'},5:function(e,t,a,n,s,i,r){var l,o=e.lambda,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return' <svg height="10" width="10" class="'+e.escapeExpression(o(null!=(l=null!=r[1]?c(r[1],"styles"):r[1])?c(l,"eventIcon"):l,t))+'" role="img" aria-label="'+(null!=(l=o(null!=(l=null!=r[1]?c(r[1],"locals"):r[1])?c(l,"gigaEvent"):l,t))?l:"")+'">\n <use href="#giga_simple--inline"></use>\n </svg>\n'},6:function(e,t,a,n,s,i,r){var l,o=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return null!=(l=o(a,"if").call(null!=t?t:e.nullContext||{},null!=(l=null!=r[1]?o(r[1],"extras"):r[1])?o(l,"hasMegaOrBlockParty"):l,{name:"if",hash:{},fn:e.program(7,s,0,i,r),inverse:e.noop,data:s,loc:{start:{line:60,column:16},end:{line:64,column:16}}}))?l:""},7:function(e,t,a,n,s,i,r){var l,o=e.lambda,c=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return' <svg height="10" width="10" class="'+e.escapeExpression(o(null!=(l=null!=r[1]?c(r[1],"styles"):r[1])?c(l,"eventIcon"):l,t))+'" role="img" aria-label="'+(null!=(l=o(null!=(l=null!=r[1]?c(r[1],"locals"):r[1])?c(l,"megaEvent"):l,t))?l:"")+'">\n <use href="#mega_simple--inline"></use>\n </svg>\n '},compiler:[8,">= 4.3.0"],main:function(e,t,a,n,s,i,r){var l,o,c,d=e.lambda,u=e.escapeExpression,m=null!=t?t:e.nullContext||{},h=e.hooks.helperMissing,p="function",g=e.hooks.blockHelperMissing,f=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]},x='<div class="clndr-controls '+u(d(null!=(l=null!=t?f(t,"styles"):t)?f(l,"controlBase"):l,t))+'">\n <strong class="'+u(d(null!=(l=null!=t?f(t,"styles"):t)?f(l,"monthYear"):l,t))+'">'+u(typeof(o=null!=(o=f(a,"month")||(null!=t?f(t,"month"):t))?o:h)===p?o.call(m,{name:"month",hash:{},data:s,loc:{start:{line:2,column:41},end:{line:2,column:50}}}):o)+" "+u(typeof(o=null!=(o=f(a,"year")||(null!=t?f(t,"year"):t))?o:h)===p?o.call(m,{name:"year",hash:{},data:s,loc:{start:{line:2,column:51},end:{line:2,column:59}}}):o)+'</strong>\n <div class="'+u(d(null!=(l=null!=t?f(t,"styles"):t)?f(l,"controlBtnContainer"):l,t))+'">\n <button \n class="clndr-previous-button '+u(d(null!=(l=null!=t?f(t,"styles"):t)?f(l,"controlPrev"):l,t))+'" \n aria-label="'+u(d(null!=(l=null!=t?f(t,"locals"):t)?f(l,"previousMonth"):l,t))+'"\n data-event-category="data"\n data-event-label="'+u(typeof(o=null!=(o=f(a,"prevArrowDataEventLabel")||(null!=t?f(t,"prevArrowDataEventLabel"):t))?o:h)===p?o.call(m,{name:"prevArrowDataEventLabel",hash:{},data:s,loc:{start:{line:8,column:30},end:{line:8,column:57}}}):o)+'"\n >\n <svg height="24" width="24" aria-hidden="true" class="rotate-90">\n <use href="#chevron-small--inline"></use>\n </svg>\n </button>\n <button \n class="clndr-next-button '+u(d(null!=(l=null!=t?f(t,"styles"):t)?f(l,"controlNext"):l,t))+'" \n aria-label="'+u(d(null!=(l=null!=t?f(t,"locals"):t)?f(l,"nextMonth"):l,t))+'"\n data-event-category="data"\n data-event-label="'+u(typeof(o=null!=(o=f(a,"nextArrowDataEventLabel")||(null!=t?f(t,"nextArrowDataEventLabel"):t))?o:h)===p?o.call(m,{name:"nextArrowDataEventLabel",hash:{},data:s,loc:{start:{line:18,column:30},end:{line:18,column:57}}}):o)+'"\n >\n <svg height="24" width="24" aria-hidden="true" class="-rotate-90">\n <use href="#chevron-small--inline"></use>\n </svg>\n </button>\n </div>\n</div>\n\n<div class="clndr-days-container p-1 pt-0">\n <div class="clndr-day-headers '+u(d(null!=(l=null!=t?f(t,"styles"):t)?f(l,"daysHeaderGrid"):l,t))+'">\n';return o=null!=(o=f(a,"daysOfTheWeek")||(null!=t?f(t,"daysOfTheWeek"):t))?o:h,c={name:"daysOfTheWeek",hash:{},fn:e.program(0,s,0,i,r),inverse:e.noop,data:s,loc:{start:{line:29,column:8},end:{line:31,column:26}}},l=typeof o===p?o.call(m,c):o,f(a,"daysOfTheWeek")||(l=g.call(t,l,c)),null!=l&&(x+=l),x+=' </div>\n\n <div class="clndr-days '+u(d(null!=(l=null!=t?f(t,"styles"):t)?f(l,"daysGrid"):l,t))+'" role="grid">\n',o=null!=(o=f(a,"days")||(null!=t?f(t,"days"):t))?o:h,c={name:"days",hash:{},fn:e.program(1,s,0,i,r),inverse:e.noop,data:s,loc:{start:{line:35,column:8},end:{line:66,column:17}}},l=typeof o===p?o.call(m,c):o,f(a,"days")||(l=g.call(t,l,c)),null!=l&&(x+=l),x+" </div>\n</div>\n"},useData:!0,useDepths:!0})}}]);
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.