1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5778],{75778:(e,r,t)=>{t.r(r),t.d(r,{WebsiteUrlPage:()=>b,default:()=>m});var o=t(95155),n=t(12115),i=t(82222),l=t(41841),a=t(94992),s=t(73139),c=t(86478),d=t(51711),u=t(91057),x=t(6438),p=t(58411);let f=[{match:/^\/donate\/?$/,build:()=>"/mobile/donate"},{match:/^\/votd\/?$/,build:()=>"/mobile/votd"},{match:/^\/my\/checkin\/?$/,build:()=>"/mobile/checkin"},{match:/^\/my\/community\/?$/,build:()=>"/mobile/community"},{match:/^\/my\/community\/([^/?#]+)\/?$/,build:e=>`/mobile/community/${e}`},{match:/^\/my\/groups\/?$/,build:()=>"/mobile/groups"},{match:/^\/my\/plans\/?$/,build:()=>"/mobile/plans"},{match:/^\/my\/plans\/([^/?#]+)\/?$/,build:e=>`/mobile/plans/${e}`},{match:/^\/groups\/details\/([^/?#]+)\/?$/,build:e=>`/mobile/groups/${e}`}],b=({config:e})=>{let r=x.MB.colors,t=(0,i.useRouter)(),b=(0,i.usePathname)(),m=(0,i.useSearchParams)(),h=(b||"").includes("/mobile/page"),g=m?.get("url")||"",w=m?.get("id")||"",y=m?.get("title")||u.h.label("mobile.screens.website"),$=(0,n.useMemo)(()=>{if(h){if(!w)return"";let e=w.startsWith("/")?w:`/${w}`;return`${window.location.origin}${e}`}if(!g)return"";try{let e=new URL(g,window.location.href);if("https:"!==e.protocol&&"http:"!==e.protocol)return"";return e.href}catch{return""}},[h,w,g]),j=(0,n.useMemo)(()=>{if(!$)return!1;try{return new URL($,window.location.href).origin!==window.location.origin}catch{return!1}},[$]),M=(0,n.useMemo)(()=>{if(!$)return"";try{return new URL($,window.location.href).host}catch{return $}},[$]),[B,k]=(0,n.useState)("loading"),S=(0,n.useRef)(null);(0,n.useEffect)(()=>{let e=e=>{if(e.origin!==window.location.origin)return;let r=e.data;if(!r||"object"!=typeof r||"navigate"!==r.type||"string"!=typeof r.url)return;let o=(e=>{try{let r=new URL(e,window.location.href);if(r.origin!==window.location.origin)return null;let t=r.pathname;if(t.startsWith("/mobile/"))return t;for(let e of f){let r=t.match(e.match);if(r)return e.build(r[1])}return null}catch{return null}})(r.url);o&&t.push(o)};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[t]),(0,n.useEffect)(()=>{if($)return k("loading"),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{k(e=>"loading"===e?"error":e)},15e3),()=>{S.current&&clearTimeout(S.current)}},[$]);let[v,z]=(0,n.useState)(0);return $&&j?(0,o.jsx)(l.default,{sx:{p:`${x.MB.spacing.md}px`,bgcolor:r.background,minHeight:"100%"},children:(0,o.jsxs)(l.default,{sx:{bgcolor:r.surface,border:`1px solid ${r.border}`,borderRadius:`${x.MB.radius.xl}px`,p:`${x.MB.spacing.lg}px`,textAlign:"center"},children:[(0,o.jsx)(l.default,{sx:{width:64,height:64,borderRadius:"18px",bgcolor:r.iconBackground,display:"inline-flex",alignItems:"center",justifyContent:"center",mb:`${x.MB.spacing.md}px`},children:(0,o.jsx)(a.default,{sx:{fontSize:32,color:r.primary},children:"public"})}),(0,o.jsx)(s.default,{sx:{fontSize:18,fontWeight:600,color:r.text,mb:`${x.MB.spacing.xs}px`},children:y}),(0,o.jsx)(s.default,{sx:{fontSize:14,color:r.textMuted,mb:`${x.MB.spacing.md}px`,wordBreak:"break-all"},children:M}),(0,o.jsxs)(l.default,{component:"a",href:$,target:"_blank",rel:"noopener noreferrer",sx:{display:"inline-flex",alignItems:"center",gap:1,bgcolor:r.primary,color:r.onPrimary,textDecoration:"none",borderRadius:`${x.MB.radius.md}px`,px:2,py:1,fontSize:14,fontWeight:600,cursor:"pointer","&:hover":{opacity:.9}},children:[(0,o.jsx)(a.default,{sx:{fontSize:18},children:"open_in_new"}),u.h.label("mobile.screens.openWebsite")]}),(0,o.jsx)(s.default,{sx:{fontSize:12,color:r.textHint,mt:`${x.MB.spacing.sm}px`},children:u.h.label("mobile.screens.cantShowInApp")})]})}):$?(0,o.jsxs)(l.default,{sx:{display:"flex",flexDirection:"column",height:"100dvh",bgcolor:r.background},children:[(0,o.jsxs)(l.default,{sx:{display:"flex",alignItems:"center",gap:`${x.MB.spacing.sm}px`,px:`${x.MB.spacing.md}px`,py:`${x.MB.spacing.sm}px`,bgcolor:r.surface,borderBottom:`1px solid ${r.border}`},children:[(0,o.jsx)(c.default,{"aria-label":u.h.label("mobile.components.back"),onClick:()=>(0,p.Tl)(t,"/mobile/dashboard"),sx:{color:r.text},children:(0,o.jsx)(a.default,{children:"arrow_back"})}),(0,o.jsx)(s.default,{sx:{flex:1,fontSize:16,fontWeight:600,color:r.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:y}),(0,o.jsx)(c.default,{"aria-label":u.h.label("mobile.screens.openInNewTab"),onClick:()=>window.open($,"_blank","noopener,noreferrer"),sx:{color:r.text},children:(0,o.jsx)(a.default,{children:"open_in_new"})})]}),(0,o.jsxs)(l.default,{sx:{position:"relative",flex:1,bgcolor:r.surface},children:[(0,o.jsx)(l.default,{component:"iframe",src:$,title:y,onLoad:()=>{S.current&&clearTimeout(S.current),k("ready")},onError:()=>{S.current&&clearTimeout(S.current),k("error")},sx:{width:"100%",height:"100%",border:0,bgcolor:r.surface,display:"error"===B?"none":"block"}},v),"loading"===B&&(0,o.jsx)(l.default,{sx:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:r.surface,pointerEvents:"none"},children:(0,o.jsx)(d.default,{size:32,sx:{color:r.primary}})}),"error"===B&&(0,o.jsx)(l.default,{sx:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",p:`${x.MB.spacing.md}px`,bgcolor:r.background},children:(0,o.jsxs)(l.default,{sx:{bgcolor:r.surface,border:`1px solid ${r.border}`,borderRadius:`${x.MB.radius.xl}px`,p:`${x.MB.spacing.lg}px`,textAlign:"center",maxWidth:320,width:"100%"},children:[(0,o.jsx)(a.default,{sx:{fontSize:32,color:r.error,mb:1},children:"error_outline"}),(0,o.jsx)(s.default,{sx:{fontSize:18,fontWeight:600,color:r.text,mb:1},children:u.h.label("mobile.screens.unableToLoadPage")}),(0,o.jsx)(s.default,{sx:{fontSize:14,color:r.textMuted,mb:2},children:u.h.label("mobile.screens.unableToLoadPageBody")}),(0,o.jsx)(l.default,{component:"button",onClick:()=>{k("loading"),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{k(e=>"loading"===e?"error":e)},15e3),z(e=>e+1)},sx:{bgcolor:r.primary,color:r.onPrimary,border:"none",borderRadius:`${x.MB.radius.md}px`,px:2,py:1,fontSize:14,fontWeight:500,cursor:"pointer"},children:u.h.label("mobile.screens.retry")})]})})]})]}):(0,o.jsx)(l.default,{sx:{p:`${x.MB.spacing.md}px`,bgcolor:r.background,minHeight:"100%"},children:(0,o.jsxs)(l.default,{sx:{bgcolor:r.surface,border:`1px solid ${r.border}`,borderRadius:`${x.MB.radius.xl}px`,p:`${x.MB.spacing.lg}px`,textAlign:"center"},children:[(0,o.jsx)(a.default,{sx:{fontSize:32,color:r.primary,mb:1},children:"link_off"}),(0,o.jsx)(s.default,{sx:{fontSize:18,fontWeight:600,color:r.text},children:u.h.label("mobile.screens.noUrlProvided")})]})})},m=b}}]);
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.